Move all battle state from IPokemon to an ephemeral IBattlePokemon wrapper
This commit is contained in:
@@ -4,16 +4,13 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
public class CurePartyStatus : Script, IScriptOnSecondaryEffect
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
|
||||
public void OnSecondaryEffect(IExecutingMove move, IBattlePokemon target, byte hit)
|
||||
{
|
||||
var user = move.User;
|
||||
var battle = user.BattleData?.Battle;
|
||||
if (battle == null)
|
||||
return;
|
||||
var party = battle.Parties.FirstOrDefault(p => p.Party.Contains(user));
|
||||
var party = user.Battle.Parties.FirstOrDefault(p => p.BattlePokemon.Contains(user));
|
||||
if (party == null)
|
||||
return;
|
||||
foreach (var pokemon in party.Party.WhereNotNull())
|
||||
foreach (var pokemon in party.BattlePokemon.WhereNotNull())
|
||||
{
|
||||
pokemon.ClearStatus();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user