31 lines
898 B
C#
31 lines
898 B
C#
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());
|
|
}
|
|
} |