Move all battle state from IPokemon to an ephemeral IBattlePokemon wrapper
This commit is contained in:
@@ -8,13 +8,13 @@ public class LightScreenEffect(int turns) : Script, IScriptChangeIncomingMoveDam
|
||||
private int _turns = turns;
|
||||
|
||||
/// <inheritdoc />
|
||||
public void ChangeIncomingMoveDamage(IExecutingMove move, IPokemon target, byte hit, ref uint damage)
|
||||
public void ChangeIncomingMoveDamage(IExecutingMove move, IBattlePokemon target, byte hit, ref uint damage)
|
||||
{
|
||||
if (move.UseMove.Category != MoveCategory.Special ||
|
||||
// Critical hits are not affected by the barrier
|
||||
move.GetHitData(target, hit).IsCritical)
|
||||
return;
|
||||
var battleData = target.BattleData;
|
||||
var battleData = target;
|
||||
// If not a 1v1 battle, damage reduction is only 1/3rd.
|
||||
if (battleData?.Battle.PositionsPerSide > 1)
|
||||
damage = (uint)(damage * (2.0f / 3.0f));
|
||||
|
||||
Reference in New Issue
Block a user