Files
PkmnLib.NET/Plugins/PkmnLib.Plugin.Gen7/Scripts/Pokemon/FocusPunchEffect.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

22 lines
674 B
C#

using PkmnLib.Plugin.Gen7.Scripts.Moves;
namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon;
[Script(ScriptCategory.Pokemon, "focus_punch")]
public class FocusPunchEffect : Script, IScriptOnIncomingHit
{
public bool WasHit { get; private set; }
/// <inheritdoc />
public void OnIncomingHit(IExecutingMove move, IPokemon target, byte hit)
{
if (move.UseMove.SecondaryEffect?.Name == "one_hit_ko")
return;
WasHit = true;
target.BattleData?.Battle.EventHook.Invoke(new DialogEvent("focus_punch_lost_focus",
new Dictionary<string, object>
{
{ "pokemon", target },
}));
}
}