More move scripts
This commit is contained in:
@@ -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 },
|
||||
}));
|
||||
|
||||
@@ -33,7 +33,7 @@ public abstract class OutrageLikeEffect : Script
|
||||
if (_turns <= 0)
|
||||
{
|
||||
RemoveSelf();
|
||||
_owner.Volatile.Add(new Confusion());
|
||||
_owner.Volatile.Add(new Confusion(), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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 },
|
||||
}));
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user