23 lines
654 B
C#
23 lines
654 B
C#
using PkmnLib.Static.Utils;
|
|
|
|
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
|
|
|
[Script(ScriptCategory.Move, "retaliate")]
|
|
public class Retaliate : Script
|
|
{
|
|
/// <inheritdoc />
|
|
public override void ChangeBasePower(IExecutingMove move, IPokemon target, byte hit, ref ushort basePower)
|
|
{
|
|
var battleData = move.User.BattleData;
|
|
if (battleData is null)
|
|
return;
|
|
|
|
var lastFaint = battleData.BattleSide.GetLastFaintTurn();
|
|
if (lastFaint == null)
|
|
return;
|
|
if (lastFaint >= battleData.Battle.CurrentTurnNumber - 1)
|
|
{
|
|
basePower = basePower.MultiplyOrMax(2);
|
|
}
|
|
}
|
|
} |