Adds a bunch more move scripts

This commit is contained in:
2024-11-02 12:59:55 +01:00
parent 6f2bd678a5
commit 44cd2ee03e
17 changed files with 492 additions and 1 deletions

View File

@@ -0,0 +1,36 @@
using PkmnLib.Dynamic.Models;
using PkmnLib.Dynamic.Models.Choices;
using PkmnLib.Dynamic.ScriptHandling;
using PkmnLib.Dynamic.ScriptHandling.Registry;
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
[Script(ScriptCategory.Move, "struggle")]
public class Struggle : Script
{
/// <inheritdoc />
public override void ChangeNumberOfHits(IMoveChoice choice, ref byte numberOfHits)
{
numberOfHits = 1;
}
/// <inheritdoc />
public override 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)
{
effectiveness = 1;
}
/// <inheritdoc />
public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
{
var damage = move.User.MaxHealth / 4;
if (damage == 0) damage = 1;
move.User.Damage(damage, DamageSource.Struggle, new());
}
}