More move effects
This commit is contained in:
29
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/FocusPunch.cs
Normal file
29
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/FocusPunch.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using System.Collections.Generic;
|
||||
using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "focus_punch")]
|
||||
public class FocusPunch : Script
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnBeforeTurnStart(ITurnChoice choice)
|
||||
{
|
||||
choice.User.Volatile.Add(new FocusPunchEffect());
|
||||
choice.User.BattleData?.Battle.EventHook.Invoke(new DialogEvent("focus_punch_charge",
|
||||
new Dictionary<string, object>()
|
||||
{
|
||||
{ "pokemon", choice.User }
|
||||
}));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void PreventMove(IExecutingMove move, ref bool prevent)
|
||||
{
|
||||
var focusPunchEffect = move.User.Volatile.Get<FocusPunchEffect>();
|
||||
if (focusPunchEffect == null || focusPunchEffect.WasHit)
|
||||
{
|
||||
prevent = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user