Move all battle state from IPokemon to an ephemeral IBattlePokemon wrapper
This commit is contained in:
@@ -12,7 +12,7 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
public class Acupressure : Script, IScriptOnSecondaryEffect
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
|
||||
public void OnSecondaryEffect(IExecutingMove move, IBattlePokemon target, byte hit)
|
||||
{
|
||||
var possibleStats = target.StatBoost.Where(x => x.statistic != Statistic.Hp && x.value < 6).ToArray();
|
||||
// If the target has no stats to raise, the move fails
|
||||
@@ -22,7 +22,7 @@ public class Acupressure : Script, IScriptOnSecondaryEffect
|
||||
return;
|
||||
}
|
||||
|
||||
var index = move.User.BattleData!.Battle.Random.GetInt(0, possibleStats.Length);
|
||||
var index = move.User.Battle.Random.GetInt(0, possibleStats.Length);
|
||||
var stat = possibleStats[index].statistic;
|
||||
target.ChangeStatBoost(stat, 2, false, false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user