25 lines
779 B
C#
25 lines
779 B
C#
using System.Linq;
|
|
using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
|
using PkmnLib.Static.Utils;
|
|
|
|
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
|
|
|
[Script(ScriptCategory.Move, "heal_bell")]
|
|
public class HealBell : Script
|
|
{
|
|
/// <inheritdoc />
|
|
public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
|
|
{
|
|
var party = move.User.BattleData?.Battle.Parties.FirstOrDefault(p => p.Party.Contains(target));
|
|
if (party == null)
|
|
return;
|
|
|
|
foreach (var pokemon in party.Party.WhereNotNull())
|
|
{
|
|
pokemon.ClearStatus();
|
|
var confusion = ScriptUtils.ResolveName<Confusion>();
|
|
if (pokemon.Volatile.Contains(confusion))
|
|
pokemon.Volatile.Remove(confusion);
|
|
}
|
|
}
|
|
} |