More moves implemented
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
63
Plugins/PkmnLib.Plugin.Gen7/Scripts/Side/DoomDesireEffect.cs
Normal file
63
Plugins/PkmnLib.Plugin.Gen7/Scripts/Side/DoomDesireEffect.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
14
Plugins/PkmnLib.Plugin.Gen7/Scripts/Side/EchoedVoiceData.cs
Normal file
14
Plugins/PkmnLib.Plugin.Gen7/Scripts/Side/EchoedVoiceData.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user