Deukhoofd 1feb27e826
All checks were successful
Build / Build (push) Successful in 50s
More work on refactor to interfaces
2025-06-29 12:03:51 +02:00

25 lines
674 B
C#

namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon;
[Script(ScriptCategory.Pokemon, "magnet_rise")]
public class MagnetRiseEffect : Script, IScriptChangeEffectiveness, IScriptOnEndTurn
{
private int _turnsRemaining = 5;
/// <inheritdoc />
public void ChangeEffectiveness(IExecutingMove move, IPokemon target, byte hit, ref float effectiveness)
{
if (move.UseMove.MoveType.Name == "ground")
{
effectiveness = 0.0f;
}
}
/// <inheritdoc />
public void OnEndTurn(IScriptSource owner, IBattle battle)
{
if (_turnsRemaining > 0)
_turnsRemaining--;
else
RemoveSelf();
}
}