Files
PkmnLib.NET/Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/HealingWish.cs
Deukhoofd d2a82b5fe3
All checks were successful
Build / Build (push) Successful in 3m12s
Many more tests and fixes
2026-08-27 17:11:12 +02:00

28 lines
964 B
C#

using PkmnLib.Plugin.Gen7.Scripts.Side;
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
[Script(ScriptCategory.Move, "healing_wish")]
public class HealingWish : Script, IScriptOnSecondaryEffect
{
/// <inheritdoc />
public void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
{
var battleData = move.User.BattleData;
if (battleData == null)
return;
var responsibleIndex = new ResponsibleIndex(battleData.SideIndex, battleData.Position);
var party = battleData.Battle.Parties.FirstOrDefault(x => x.IsResponsibleForIndex(responsibleIndex));
if (party == null || !party.HasUsablePokemonNotInField())
{
move.GetHitData(target, hit).Fail();
return;
}
var side = battleData.Battle.Sides[battleData.SideIndex];
side.VolatileScripts.Add(new HealingWishEffect(battleData.Position));
move.User.Faint(DamageSource.Misc);
}
}