Further work on refactor to interface based scripts

This commit is contained in:
2025-06-28 18:40:33 +02:00
parent b7bdf2b744
commit 436d1899e0
352 changed files with 940 additions and 867 deletions

View File

@@ -1,7 +1,8 @@
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
[Script(ScriptCategory.Move, "struggle")]
public class Struggle : Script, IScriptChangeNumberOfHits
public class Struggle : Script, IScriptChangeNumberOfHits, IScriptIsInvulnerableToMove, IScriptChangeEffectiveness,
IScriptOnSecondaryEffect
{
/// <inheritdoc />
public void ChangeNumberOfHits(IMoveChoice choice, ref byte numberOfHits)
@@ -10,19 +11,19 @@ public class Struggle : Script, IScriptChangeNumberOfHits
}
/// <inheritdoc />
public override void IsInvulnerableToMove(IExecutingMove move, IPokemon target, ref bool invulnerable)
public void IsInvulnerableToMove(IExecutingMove move, IPokemon target, ref bool invulnerable)
{
invulnerable = false;
}
/// <inheritdoc />
public override void ChangeEffectiveness(IExecutingMove move, IPokemon target, byte hit, ref float effectiveness)
public void ChangeEffectiveness(IExecutingMove move, IPokemon target, byte hit, ref float effectiveness)
{
effectiveness = 1;
}
/// <inheritdoc />
public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
public void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
{
var damage = move.User.MaxHealth / 4;
if (damage == 0)