Further work on refactor to interface based scripts
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user