2024-11-02 11:59:55 +00:00
|
|
|
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;
|
2025-03-02 16:19:57 +00:00
|
|
|
if (damage == 0)
|
|
|
|
damage = 1;
|
|
|
|
move.User.Damage(damage, DamageSource.Struggle, new EventBatchId());
|
2024-11-02 11:59:55 +00:00
|
|
|
}
|
|
|
|
}
|