Move all battle state from IPokemon to an ephemeral IBattlePokemon wrapper
This commit is contained in:
@@ -6,7 +6,7 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
public class Bide : Script, IScriptOnSecondaryEffect
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
|
||||
public void OnSecondaryEffect(IExecutingMove move, IBattlePokemon target, byte hit)
|
||||
{
|
||||
var bideEffect = move.User.Volatile.Get<BideEffect>();
|
||||
if (bideEffect == null)
|
||||
@@ -24,7 +24,7 @@ public class Bide : Script, IScriptOnSecondaryEffect
|
||||
}
|
||||
else
|
||||
{
|
||||
var lastPokemon = bideEffect.HitBy.LastOrDefault(x => x.BattleData?.IsOnBattlefield == true);
|
||||
var lastPokemon = bideEffect.HitBy.LastOrDefault(x => x.IsOnBattlefield == true);
|
||||
lastPokemon?.Damage(bideEffect.DamageTaken * 2, DamageSource.MoveDamage);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user