Move all battle state from IPokemon to an ephemeral IBattlePokemon wrapper
This commit is contained in:
@@ -4,13 +4,13 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
public class HealEachEndOfTurnEffect : Script, IScriptOnEndTurn
|
||||
{
|
||||
private readonly float _healPercentage;
|
||||
private readonly IPokemon? _pokemon;
|
||||
private readonly IBattlePokemon? _pokemon;
|
||||
|
||||
private HealEachEndOfTurnEffect()
|
||||
{
|
||||
}
|
||||
|
||||
public HealEachEndOfTurnEffect(float healPercentage, IPokemon pokemon)
|
||||
public HealEachEndOfTurnEffect(float healPercentage, IBattlePokemon pokemon)
|
||||
{
|
||||
_healPercentage = healPercentage;
|
||||
_pokemon = pokemon;
|
||||
@@ -23,7 +23,7 @@ public class HealEachEndOfTurnEffect : Script, IScriptOnEndTurn
|
||||
{
|
||||
if (_pokemon is null)
|
||||
return;
|
||||
if (_pokemon.BattleData?.IsOnBattlefield != true)
|
||||
if (_pokemon.IsOnBattlefield != true)
|
||||
return;
|
||||
|
||||
var amount = _pokemon.BoostedStats.Hp * _healPercentage;
|
||||
|
||||
Reference in New Issue
Block a user