Move all battle state from IPokemon to an ephemeral IBattlePokemon wrapper
This commit is contained in:
@@ -4,18 +4,19 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Battle;
|
||||
public class UproarEffect : Script, IScriptOnBeforeTurnStart, IScriptOnSecondaryEffect, IScriptOnEndTurn,
|
||||
IScriptPreventStatusChange
|
||||
{
|
||||
private IPokemon? _placer;
|
||||
private IBattlePokemon? _placer;
|
||||
private bool _hasUsedUproar;
|
||||
private int _turns = 3;
|
||||
|
||||
public void SetPlacer(IPokemon placer)
|
||||
public void SetPlacer(IBattlePokemon placer)
|
||||
{
|
||||
_placer = placer;
|
||||
_hasUsedUproar = true;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void PreventStatusChange(IPokemon pokemon, StringKey status, bool selfInflicted, ref bool preventStatus)
|
||||
public void PreventStatusChange(IBattlePokemon pokemon, StringKey status, bool selfInflicted,
|
||||
ref bool preventStatus)
|
||||
{
|
||||
if (status == ScriptUtils.ResolveName<Status.Sleep>())
|
||||
{
|
||||
@@ -30,7 +31,7 @@ public class UproarEffect : Script, IScriptOnBeforeTurnStart, IScriptOnSecondary
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
|
||||
public void OnSecondaryEffect(IExecutingMove move, IBattlePokemon target, byte hit)
|
||||
{
|
||||
if (move.User == _placer && move.UseMove.Name == MoveNames.Uproar)
|
||||
_hasUsedUproar = true;
|
||||
|
||||
Reference in New Issue
Block a user