Move all battle state from IPokemon to an ephemeral IBattlePokemon wrapper
This commit is contained in:
@@ -10,9 +10,9 @@ public class Confusion : Script, IScriptStopBeforeMove
|
||||
/// <inheritdoc />
|
||||
public override void OnAddedToParent(IScriptSource source)
|
||||
{
|
||||
if (source is not IPokemon pokemon)
|
||||
if (source is not IBattlePokemon pokemon)
|
||||
throw new InvalidOperationException("Confusion script can only be added to a Pokemon.");
|
||||
var battleData = pokemon.BattleData;
|
||||
var battleData = pokemon;
|
||||
if (battleData == null)
|
||||
throw new InvalidOperationException("Confusion script requires a Pokemon to be in a battle.");
|
||||
_turnsConfused = battleData.Battle.Random.GetInt(2, 5);
|
||||
|
||||
Reference in New Issue
Block a user