27 lines
793 B
C#
27 lines
793 B
C#
using System.Linq;
|
|
using PkmnLib.Dynamic.Models;
|
|
using PkmnLib.Dynamic.ScriptHandling;
|
|
using PkmnLib.Dynamic.ScriptHandling.Registry;
|
|
using PkmnLib.Static.Utils;
|
|
|
|
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
|
|
|
[Script(ScriptCategory.Move, "cure_party_status")]
|
|
public class CurePartyStatus : Script
|
|
{
|
|
/// <inheritdoc />
|
|
public override void OnSecondaryEffect(IExecutingMove move, IPokemon 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));
|
|
if (party == null)
|
|
return;
|
|
foreach (var pokemon in party.Party.WhereNotNull())
|
|
{
|
|
pokemon.ClearStatus();
|
|
}
|
|
}
|
|
} |