21 lines
625 B
C#

using System.Linq;
using PkmnLib.Static;
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
[Script(ScriptCategory.Move, "punishment")]
public class Punishment : Script
{
/// <inheritdoc />
public override void ChangeBasePower(IExecutingMove move, IPokemon target, byte hit, ref byte basePower)
{
if (move.User.BattleData == null)
return;
var totalPower = 60 + 20 * target.StatBoost.Count(x =>
x.statistic is not Statistic.Accuracy and Statistic.Evasion && x.value > 0);
if (totalPower > 200)
totalPower = 200;
basePower = (byte)totalPower;
}
}