Fixes several moves

This commit is contained in:
2025-02-01 15:26:57 +01:00
parent 00fe08dcd4
commit 0669f15a98
10 changed files with 49 additions and 12 deletions

View File

@@ -0,0 +1,7 @@
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
[Script(ScriptCategory.Move, "ally_switch")]
public class AllySwitch : Script
{
// TODO: Implement the AllySwitch script.
}

View File

@@ -3,6 +3,7 @@ using PkmnLib.Static;
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
[Script(ScriptCategory.Move, "belch")]
public class Belch : Script
{
/// <inheritdoc />

View File

@@ -21,7 +21,7 @@ public class ChangeAllTargetStats : Script
{
throw new ArgumentException("Parameter 'amount' is required.");
}
_amount = (sbyte)amount;
_amount = (sbyte)(int)amount;
}
/// <inheritdoc />

View File

@@ -28,7 +28,7 @@ public abstract class ChangeTargetStats : Script
throw new ArgumentException("Parameter 'amount' is required.");
}
_amount = (sbyte)amount;
_amount = (sbyte)(int)amount;
}
/// <inheritdoc />

View File

@@ -28,7 +28,7 @@ public abstract class ChangeUserStats : Script
throw new ArgumentException("Parameter 'amount' is required.");
}
_amount = (sbyte)amount;
_amount = (sbyte)(int)amount;
}
/// <inheritdoc />

View File

@@ -7,10 +7,6 @@ public class BindEffect : Script
private int _turns;
private readonly float _percentOfMaxHealth;
private BindEffect(float percentOfMaxHealth)
{
_percentOfMaxHealth = percentOfMaxHealth;
}
public BindEffect(IPokemon owner, int turns, float percentOfMaxHealth)
{

View File

@@ -19,7 +19,7 @@ public class DoomDesireEffect : Script
}
}
private readonly IBattleSide _side;
private readonly IBattleSide? _side;
private List<Target> _targets = new();
public DoomDesireEffect(IBattleSide side)
@@ -40,6 +40,9 @@ public class DoomDesireEffect : Script
/// <inheritdoc />
public override void OnEndTurn(IBattle battle)
{
if (_side == null)
return;
var toRemove = new List<Target>();
foreach (var v in _targets)
{