Adds a bunch more move scripts

This commit is contained in:
2024-11-02 12:59:55 +01:00
parent 6f2bd678a5
commit 44cd2ee03e
17 changed files with 492 additions and 1 deletions

View File

@@ -0,0 +1,27 @@
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();
}
}
}