Move all battle state from IPokemon to an ephemeral IBattlePokemon wrapper
This commit is contained in:
@@ -13,13 +13,13 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
public class CursedBody : Script, IScriptOnIncomingHit
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public void OnIncomingHit(IExecutingMove move, IPokemon target, byte hit)
|
||||
public void OnIncomingHit(IExecutingMove move, IBattlePokemon target, byte hit)
|
||||
{
|
||||
// 30% chance to disable the move
|
||||
if (move.Battle.Random.GetFloat() > 0.3f)
|
||||
return;
|
||||
|
||||
target.BattleData?.Battle.EventHook.Invoke(new AbilityTriggerEvent(target));
|
||||
target.Battle.EventHook.Invoke(new AbilityTriggerEvent(target));
|
||||
target.Volatile.Add(new DisableEffect(move.ChosenMove.MoveData.Name));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user