Adds a bunch more move scripts
This commit is contained in:
27
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/CurePartyStatus.cs
Normal file
27
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/CurePartyStatus.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user