More move scripts

This commit is contained in:
2025-05-03 16:51:44 +02:00
parent f8c43b6ba0
commit 1973ff50fa
52 changed files with 704 additions and 78 deletions

View File

@@ -12,7 +12,7 @@ public class FocusPunchEffect : Script
{
WasHit = true;
target.BattleData?.Battle.EventHook.Invoke(new DialogEvent("focus_punch_lost_focus",
new Dictionary<string, object>()
new Dictionary<string, object>
{
{ "pokemon", target },
}));

View File

@@ -33,7 +33,7 @@ public abstract class OutrageLikeEffect : Script
if (_turns <= 0)
{
RemoveSelf();
_owner.Volatile.Add(new Confusion());
_owner.Volatile.Add(new Confusion(), true);
}
}
}

View File

@@ -23,7 +23,7 @@ public class RequiresRechargeEffect : Script
{
RemoveSelf();
_owner.BattleData?.Battle.EventHook.Invoke(new DialogEvent("pokemon_must_recharge",
new Dictionary<string, object>()
new Dictionary<string, object>
{
{ "pokemon", _owner },
}));

View File

@@ -0,0 +1,27 @@
using PkmnLib.Plugin.Gen7.Scripts.Utils;
namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon;
[Script(ScriptCategory.Pokemon, "shadow_force")]
public class ShadowForceCharge : Script
{
private readonly IPokemon _owner;
public ShadowForceCharge(IPokemon owner)
{
_owner = owner;
}
/// <inheritdoc />
public override void ForceTurnSelection(byte sideIndex, byte position, ref ITurnChoice? choice)
{
var opposingSideIndex = (byte)(_owner.BattleData?.SideIndex == 0 ? 1 : 0);
choice = TurnChoiceHelper.CreateMoveChoice(_owner, "shadow_force", opposingSideIndex, position);
}
/// <inheritdoc />
public override void BlockIncomingHit(IExecutingMove executingMove, IPokemon target, byte hitIndex, ref bool block)
{
block = true;
}
}

View File

@@ -0,0 +1,16 @@
using PkmnLib.Static.Moves;
namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon;
[Script(ScriptCategory.Pokemon, "shell_trap")]
public class ShellTrapHelper : Script
{
public bool HasHit { get; private set; }
/// <inheritdoc />
public override void OnIncomingHit(IExecutingMove move, IPokemon target, byte hit)
{
if (move.UseMove.Category == MoveCategory.Physical)
HasHit = true;
}
}