Move all battle state from IPokemon to an ephemeral IBattlePokemon wrapper
This commit is contained in:
@@ -11,7 +11,7 @@ public class Gen7MiscLibrary : IMiscLibrary
|
||||
new SecondaryEffectImpl(-1, "struggle", new Dictionary<StringKey, object?>()), ["not_sketchable"]);
|
||||
|
||||
/// <inheritdoc />
|
||||
public ITurnChoice ReplacementChoice(IPokemon user, byte targetSide, byte targetPosition) =>
|
||||
public ITurnChoice ReplacementChoice(IBattlePokemon user, byte targetSide, byte targetPosition) =>
|
||||
new MoveChoice(user, new LearnedMoveImpl(_struggleData, MoveLearnMethod.Unknown), targetSide, targetPosition);
|
||||
|
||||
/// <inheritdoc />
|
||||
@@ -37,7 +37,7 @@ public class Gen7MiscLibrary : IMiscLibrary
|
||||
public bool CanFlee(IBattle battle, IFleeChoice fleeChoice)
|
||||
{
|
||||
var user = fleeChoice.User;
|
||||
var battleData = user.BattleData;
|
||||
var battleData = user;
|
||||
if (battleData == null)
|
||||
return false;
|
||||
var opponentSide = battle.Sides[battleData.SideIndex == 0 ? 1 : 0];
|
||||
|
||||
Reference in New Issue
Block a user