More moves implemented

This commit is contained in:
2025-02-01 15:00:22 +01:00
parent 3a75493912
commit 00fe08dcd4
50 changed files with 1146 additions and 139 deletions

View File

@@ -0,0 +1,14 @@
using PkmnLib.Static.Moves;
namespace PkmnLib.Plugin.Gen7.Scripts.Side;
[Script(ScriptCategory.Side, "crafty_shield")]
public class CraftyShieldEffect : Script
{
/// <inheritdoc />
public override void StopBeforeMove(IExecutingMove move, ref bool stop)
{
if (move.UseMove.Category == MoveCategory.Status)
stop = true;
}
}

View File

@@ -0,0 +1,63 @@
using System.Collections.Generic;
namespace PkmnLib.Plugin.Gen7.Scripts.Side;
[Script(ScriptCategory.Side, "doom_desire_effect")]
public class DoomDesireEffect : Script
{
private class Target
{
public byte Position { get; }
public uint Damage { get; }
public int Turns { get; set; }
public Target(byte position, uint damage)
{
Position = position;
Damage = damage;
Turns = 3;
}
}
private readonly IBattleSide _side;
private List<Target> _targets = new();
public DoomDesireEffect(IBattleSide side)
{
_side = side;
}
public void AddTarget(byte position, uint damage)
{
_targets.Add(new Target(position, damage));
}
public bool HasTarget(byte position)
{
return _targets.Exists(x => x.Position == position);
}
/// <inheritdoc />
public override void OnEndTurn(IBattle battle)
{
var toRemove = new List<Target>();
foreach (var v in _targets)
{
v.Turns--;
if (v.Turns == 0)
{
var pokemon = _side.Pokemon[v.Position];
pokemon?.Damage(v.Damage, DamageSource.Misc);
toRemove.Add(v);
}
}
foreach (var v in toRemove)
{
_targets.Remove(v);
}
if (_targets.Count == 0)
{
RemoveSelf();
}
}
}

View File

@@ -0,0 +1,14 @@
namespace PkmnLib.Plugin.Gen7.Scripts.Side;
/// <summary>
/// Just here to indicate that a Pokemon on this side has used Echoed Voice.
/// </summary>
[Script(ScriptCategory.Side, "echoed_voice_data")]
public class EchoedVoiceData : Script
{
/// <inheritdoc />
public override void OnEndTurn(IBattle battle)
{
RemoveSelf();
}
}