Move all battle state from IPokemon to an ephemeral IBattlePokemon wrapper
This commit is contained in:
@@ -14,7 +14,7 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
public class CuteCharm : Script, IScriptOnIncomingHit
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public void OnIncomingHit(IExecutingMove move, IPokemon target, byte hit)
|
||||
public void OnIncomingHit(IExecutingMove move, IBattlePokemon target, byte hit)
|
||||
{
|
||||
// Only trigger on contact moves
|
||||
if (!move.GetHitData(target, hit).IsContact)
|
||||
@@ -28,7 +28,7 @@ public class CuteCharm : Script, IScriptOnIncomingHit
|
||||
move.User.Gender == Gender.Genderless)
|
||||
return;
|
||||
|
||||
target.BattleData?.Battle.EventHook.Invoke(new AbilityTriggerEvent(target));
|
||||
target.Battle.EventHook.Invoke(new AbilityTriggerEvent(target));
|
||||
move.User.Volatile.Add(new Infatuated());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user