Class MultiLaneBattleController
- All Implemented Interfaces:
RegistryBacked,BattleController,BattleEvents,BattleMessaging,BattleRandomContext,BattleSimulationContext,BattleSpectating,BattleStateView,ContextHolder,LegacyBattleAISupport
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionMultiLaneBattleController(net.minecraft.core.RegistryAccess registryAccess, BattleParticipant mainParticipant) MultiLaneBattleController(net.minecraft.core.RegistryAccess registryAccess, BattleParticipant mainParticipant, BiFunction<MultiLaneBattleController, BattleParticipant, BattleParticipant> laneParticipantFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoidacknowledgeBattleAnimation(net.minecraft.server.level.ServerPlayer player, UUID acknowledgementId) Acknowledges completion of a client-side battle animation wait.intReturns the current action index within the active turn.voidaddBattleAnimation(ActiveBattleAnimation animation) Stores a battle animation that is currently running for this battle.<E extends BattleEvent,A>
CompletableFuture<A> addFunctionAtEvent(Class<E> eventClass, BiFunction<E, BattleController, A> task) Adds a one-shot function to run the next time the specified event type is published.<E extends BattleEvent>
voidaddPersistentTaskAtEvent(Class<E> eventClass, BiConsumer<E, BattleController> task) Adds a persistent task to run every time the specified event type is published.void<E extends BattleEvent>
CompletableFuture<Void> addTaskAtEvent(Class<E> eventClass, BiConsumer<E, BattleController> task) Adds a one-shot task to run the next time the specified event type is published.battleAnimationLaneFor(PixelmonWrapper user, PixelmonWrapper target) intReturns this battle's index.voidbattleIndex(int battleIndex) Sets this battle's index.Returns the battle log for this battle.intReturns the number of times the current battle has been ticked.intReturns the current battle turn number.voidbroadcastPacket(PixelmonPacket packet) Broadcasts a battle packet to all relevant battle clients.This method returns a set of Pokémon that need to be evolved at the end of the turn.voidChecks the conditions of the active Pokémon.voidcleanUpBattleAnimationChannel(String channel) copy()Creates a copy of this battle controller.voidcurrentlyActingPokemon(PixelmonWrapper currentlyActingPokemon) voidbooleanChecks whether the battle controller is performing hard swaps causing aligned switch-in effectsendBattle(BattleEndCause cause, Map<BattleParticipant, BattleResults> results) Ends the battle with the given cause and any precalculated results.voidendPause()Unpauses the battle.voidendTurn()Handles end-of-turn effects.Returns the attack damage calculator used by this battle.getStage()Returns the current stage of the battle.Returns the controller for global battle statuses.booleanbooleanThis method returns if a Pokémon has switched due to a move during this move.voidhasSwitchedDuringThisMove(boolean hasSwitchedDuringThisMove) This method sets whether a Pokémon has switched due to a move during this move.booleanisBattleAnimationChannelBusy(String channel) booleanisSpectating(net.minecraft.world.entity.player.Player player) Returns whether the specified player is currently spectating this battle.lanes()voidlastAttack(Attack attack) voidlastSimulatedAttack(Attack attack) voidlastSimulatedTempAttack(Attack attack) voidlastTempAttack(Attack attack) voidmodifyStatsCancellable(PixelmonWrapper attacker) Modifies Pokémon stats during a turn after deciding which Pokémon gets to make a move.oldGen()Returns the old-generation rules state for this battle.voidSets the old-generation rules state for this battle.voidonLaneParticipantEnded(BattleParticipant participant, BattleEndCause cause) outcome()Returns whether this battle has ended.booleanChecks if a participant is capable of dynamaxing and that it is their turn.Returns the participants in this battle.voidPauses the battle.<T extends BattleEvent>
TpublishEvent(T event) Publishes a battle event.voidvoidpublishSwitchPokemonEvent(PixelmonWrapper switchedOut, PixelmonWrapper switchedIn) Returns the battle randomness provider used by this battle.net.minecraft.core.RegistryAccessReturns the backing registry access used to resolve registries and entries.voidremovePlayer(net.minecraft.server.level.ServerPlayer player, BattleEndCause cause) Handles a player leaving the server while in this battle, such as by logging out or dying.booleanremoveSpectator(net.minecraft.server.level.ServerPlayer player) Removes a player from this battle's spectators.voidFinds any statuses affecting the whole team and determines where a Pokémon being sent into battle should be positioned.voidsetAttackDamageCalculator(AttackDamageCalculator attackDamageCalculator) Sets the attack damage calculator used by this battle.voidSets a Pokémon to flee in the turn.voidsetRandomness(BattleRandomness randomness) Sets the battle randomness provider used by this battle.booleanReturns whether this battle is currently running in the legacy AI simulation mode.voidsimulateMode(boolean simulateMode) Sets whether this battle is currently running in the legacy AI simulation mode.booleanReturns whether the legacy AI should use simulated stat handling for this battle.voidsimulateStats(boolean simulateStats) Sets whether the legacy AI should use simulated stat handling for this battle.voidspectate(net.minecraft.server.level.ServerPlayer player, net.minecraft.world.entity.Entity target) Adds a player as a spectator of this battle.Returns the spectators currently watching this battle.spinLane(BattleParticipant opposition) spinLaneWithoutRegistering(BattleParticipant opposition) voidvoidstoreSwitchInActivation(PixelmonWrapper pw, PixelmonWrapper former) voidswitchPokemon(UUID switchingPokemonUUID, UUID newPokemonUUID, boolean switchInstantly) Switches a Pokémon out for a different one.<T> voidsync(ContextKey<T> key) This method synchronizes the value stored in the battle context for the given key to all clients participating in the battle.teams()Returns the battle participants grouped by team.voidMoves pokemon to end of list of pokemon gaining their abilitiesturnList()This method returns the order of Pokémon moving during a battle turn.voidturnList(List<PixelmonWrapper> turnList) This method sets the order of Pokémon moving during a battle turn.voidupdate()Updates the battle every tick.intReturns the number of battle ticks this battle must wait before normal turn progression can continue.voidwaitTicks(int waitTicks) Sets the number of battle ticks this battle must wait before normal turn progression can continue.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.pixelmonmod.pixelmon.battles.controller.BattleController
advanceToMoves, battleAnimationChannelId, battleAnimationChannelId, checkValid, clearHurtTimer, consumeAllItems, enableReturnHeldItems, endBattle, endBattle, endBattleWithoutXP, forfeitBattleForPlayerAndTheirTeam, getAbilityIfPresent, getDefaultTurnOrder, getFirstMover, getFirstMover, getLastMover, getLastMover, getPokemonAtPosition, getPokemonWithAbility, getPositionOfPokemon, getPositionOfPokemon, getTurn, getTurnForPokemon, isLastMover, modifyStats, publishPokemonHealthUpdate, recordFaintOrder, removeFromTurnList, reserveFaintOrder, reserveFaintOrderBefore, sendBattleScenePacket, sendBattleScenePackets, setAllReady, setUseItem, setUseItem, shouldSendBattleStartPackets, shouldSendBattleStartPackets, spawnEntityForBattle, takeFullTurn, takeFullTurn, updateRemovedPokemonMethods inherited from interface com.pixelmonmod.pixelmon.battles.controller.BattleMessaging
sendToAll, sendToAll, sendToOthers, sendToOthers, sendToPlayer, updateFormChangeMethods inherited from interface com.pixelmonmod.pixelmon.battles.controller.BattleRandomContext
forceChance, forceChance, setRandom, shouldForceChanceMethods inherited from interface com.pixelmonmod.pixelmon.battles.controller.BattleSimulationContext
disableCommunication, freeze, isFrozen, isLevelingDisabled, isSimulatedBattle, shouldSpawnEntities, unfreezeMethods inherited from interface com.pixelmonmod.pixelmon.battles.controller.BattleStateView
battleEnded, battleTicksPerSecond, containsParticipantType, getActiveFaintedPokemon, getActivePokemon, getActiveUnfaintedPokemon, getBattleType, getParticipantForEntity, getParticipantFromPokemon, getParticipants, getPartyPokemonFromUUID, getPlayer, getPlayer, getPlayerEntities, getPlayers, getPokemonFromUUID, isInverseBattle, isPvE, isPvP, isRaid, isTeamDefeated, isTeamHomogeneous, isWaiting, onBattlefield, otherParticipant, playerCount, team, timeElapsedMethods inherited from interface com.pixelmonmod.pixelmon.battles.controller.context.ContextHolder
get, getOrDefault, has, remove, set, updateMethods inherited from interface com.pixelmonmod.pixelmon.api.registry.RegistryBacked
holder, registry, registryValue
-
Constructor Details
-
MultiLaneBattleController
public MultiLaneBattleController(net.minecraft.core.RegistryAccess registryAccess, BattleParticipant mainParticipant) -
MultiLaneBattleController
public MultiLaneBattleController(net.minecraft.core.RegistryAccess registryAccess, BattleParticipant mainParticipant, BiFunction<MultiLaneBattleController, BattleParticipant, BattleParticipant> laneParticipantFactory)
-
-
Method Details
-
spinLane
-
spinLaneWithoutRegistering
-
lanes
-
mainParticipant
-
raidBossState
-
addTaskAtBattleEnd
-
onLaneParticipantEnded
-
removePlayer
Description copied from interface:BattleControllerHandles a player leaving the server while in this battle, such as by logging out or dying. By default this ends the battle.- Specified by:
removePlayerin interfaceBattleController
-
battleTicks
public int battleTicks()Description copied from interface:BattleStateViewReturns the number of times the current battle has been ticked.
This may be incremented multiple times per-server tick depending on the controller's battle tick rate. So this is not necessarily equal to 20 times a second.
To get the number of battle ticks per second, useBattleStateView.battleTicksPerSecond().- Specified by:
battleTicksin interfaceBattleStateView- Returns:
- the current battle tick
-
waitTicks
public int waitTicks()Description copied from interface:BattleSimulationContextReturns the number of battle ticks this battle must wait before normal turn progression can continue.- Specified by:
waitTicksin interfaceBattleSimulationContext- Returns:
- remaining wait ticks
-
waitTicks
public void waitTicks(int waitTicks) Description copied from interface:BattleSimulationContextSets the number of battle ticks this battle must wait before normal turn progression can continue.- Specified by:
waitTicksin interfaceBattleSimulationContext- Parameters:
waitTicks- remaining wait ticks
-
update
public void update()Description copied from interface:BattleControllerUpdates the battle every tick.- Specified by:
updatein interfaceBattleController
-
doTurnLogic
public void doTurnLogic()- Specified by:
doTurnLogicin interfaceBattleController
-
endTurn
public void endTurn()Description copied from interface:BattleControllerHandles end-of-turn effects.- Specified by:
endTurnin interfaceBattleController
-
sync
Description copied from interface:BattleControllerThis method synchronizes the value stored in the battle context for the given key to all clients participating in the battle.
This should be called whenever a value in the battle context is changed that needs to be known by the clients, such as theContextKeys.TURN_TIMEwhich is required by the clients to display the turn timer.- Specified by:
syncin interfaceBattleController- Type Parameters:
T- The type of the value in the battle context to synchronize.- Parameters:
key- The key of the value in the battle context to synchronize to the clients.
-
modifyStatsCancellable
Description copied from interface:BattleControllerModifies Pokémon stats during a turn after deciding which Pokémon gets to make a move.- Specified by:
modifyStatsCancellablein interfaceBattleController- Parameters:
attacker- The Pokémon using a move.
-
getLastAttack
- Specified by:
getLastAttackin interfaceBattleController
-
getLastTempAttack
- Specified by:
getLastTempAttackin interfaceBattleController
-
addBattleAnimation
Description copied from interface:BattleControllerStores a battle animation that is currently running for this battle.- Specified by:
addBattleAnimationin interfaceBattleController- Parameters:
animation- The animation to store
-
battleAnimationLaneFor
-
isBattleAnimationChannelBusy
- Specified by:
isBattleAnimationChannelBusyin interfaceBattleController
-
cleanUpBattleAnimationChannel
- Specified by:
cleanUpBattleAnimationChannelin interfaceBattleController
-
acknowledgeBattleAnimation
public void acknowledgeBattleAnimation(net.minecraft.server.level.ServerPlayer player, UUID acknowledgementId) Description copied from interface:BattleControllerAcknowledges completion of a client-side battle animation wait.- Specified by:
acknowledgeBattleAnimationin interfaceBattleController- Parameters:
player- the client that acknowledged the animationacknowledgementId- the acknowledgement token sent to the client
-
endBattle
public Map<BattleParticipant,BattleResults> endBattle(BattleEndCause cause, Map<BattleParticipant, BattleResults> results) Description copied from interface:BattleControllerEnds the battle with the given cause and any precalculated results. This method is called by ALL other end of battle methods.- Specified by:
endBattlein interfaceBattleController
-
switchPokemon
Description copied from interface:BattleControllerSwitches a Pokémon out for a different one.- Specified by:
switchPokemonin interfaceBattleController- Parameters:
switchingPokemonUUID- The Pokémon switching out.newPokemonUUID- The Pokémon to switch into.switchInstantly- True if the switch will happen immediately, false if the switch will happen during the turn.
-
hasSwitchedDuringThisMove
public boolean hasSwitchedDuringThisMove()Description copied from interface:BattleControllerThis method returns if a Pokémon has switched due to a move during this move. This is used to prevent multiple Pokémon from switching out during one move, such as with moves like U-Turn or Volt Switch. Only one Pokémon may switch per move.- Specified by:
hasSwitchedDuringThisMovein interfaceBattleController- Returns:
- If a Pokémon has switched due to a move during this move.
-
hasSwitchedDuringThisMove
public void hasSwitchedDuringThisMove(boolean hasSwitchedDuringThisMove) Description copied from interface:BattleControllerThis method sets whether a Pokémon has switched due to a move during this move. This is used to prevent multiple Pokémon from switching out during one move, such as with moves like U-Turn or Volt Switch. Only one Pokémon may switch per move.- Specified by:
hasSwitchedDuringThisMovein interfaceBattleController- Parameters:
hasSwitchedDuringThisMove- If a Pokémon has switched due to a move during this move.
-
turnList
Description copied from interface:BattleControllerThis method returns the order of Pokémon moving during a battle turn.- Specified by:
turnListin interfaceBattleController- Returns:
- The order of Pokémon moving during a battle turn.
-
turnList
Description copied from interface:BattleControllerThis method sets the order of Pokémon moving during a battle turn.- Specified by:
turnListin interfaceBattleController- Parameters:
turnList- The order of Pokémon moving during a battle turn.
-
setFlee
Description copied from interface:BattleControllerSets a Pokémon to flee in the turn.- Specified by:
setFleein interfaceBattleController- Parameters:
fleeingUUID- The fleeing Pokémon.
-
duringSwitchAction
public boolean duringSwitchAction()Description copied from interface:BattleControllerChecks whether the battle controller is performing hard swaps causing aligned switch-in effects- Specified by:
duringSwitchActionin interfaceBattleController- Returns:
- whether the controller is occupied with hard switches
-
pauseBattle
public void pauseBattle()Description copied from interface:BattleControllerPauses the battle.- Specified by:
pauseBattlein interfaceBattleController
-
endPause
public void endPause()Description copied from interface:BattleControllerUnpauses the battle.- Specified by:
endPausein interfaceBattleController
-
participantCanDynamax
Description copied from interface:BattleControllerChecks if a participant is capable of dynamaxing and that it is their turn.- Specified by:
participantCanDynamaxin interfaceBattleController
-
lastAttack
- Specified by:
lastAttackin interfaceBattleController
-
lastAttack
- Specified by:
lastAttackin interfaceBattleController
-
lastTempAttack
- Specified by:
lastTempAttackin interfaceBattleController
-
lastTempAttack
- Specified by:
lastTempAttackin interfaceBattleController
-
lastSimulatedAttack
- Specified by:
lastSimulatedAttackin interfaceBattleController
-
lastSimulatedAttack
- Specified by:
lastSimulatedAttackin interfaceBattleController
-
lastSimulatedTempAttack
- Specified by:
lastSimulatedTempAttackin interfaceBattleController
-
lastSimulatedTempAttack
- Specified by:
lastSimulatedTempAttackin interfaceBattleController
-
getPokemonOrderedByAbilityGain
- Specified by:
getPokemonOrderedByAbilityGainin interfaceBattleController
-
timedAbilityStarted
Description copied from interface:BattleControllerMoves pokemon to end of list of pokemon gaining their abilities- Specified by:
timedAbilityStartedin interfaceBattleController
-
checkedPokemon
Description copied from interface:BattleControllerThis method returns a set of Pokémon that need to be evolved at the end of the turn. This is used to keep track of Pokémon that need to be evolved at the end of the turn after all actions have been resolved, so that they can be evolved before the next turn starts.- Specified by:
checkedPokemonin interfaceBattleController- Returns:
- A set of Pokémon that need to be evolved at the end of the turn.
-
reviveAfterDefeat
Description copied from interface:BattleControllerFinds any statuses affecting the whole team and determines where a Pokémon being sent into battle should be positioned. Then sends out the newly revived Pokémon as an entity if it can, and sets the revived Pokémon's battle position, sets it as on the battlefield and applies the statuses. Finally, triggers some affects that occur when a Pokémon switches in.- Specified by:
reviveAfterDefeatin interfaceBattleController- Parameters:
p- the trainer that needs to send out a now revived Pokémon.
-
checkPokemon
public void checkPokemon()Description copied from interface:BattleControllerChecks the conditions of the active Pokémon.- Specified by:
checkPokemonin interfaceBattleController
-
currentlyActingPokemon
- Specified by:
currentlyActingPokemonin interfaceBattleController
-
currentlyActingPokemon
- Specified by:
currentlyActingPokemonin interfaceBattleController
-
storeSwitchInActivation
- Specified by:
storeSwitchInActivationin interfaceBattleController
-
registryAccess
public net.minecraft.core.RegistryAccess registryAccess()Description copied from interface:RegistryBackedReturns the backing registry access used to resolve registries and entries.- Specified by:
registryAccessin interfaceRegistryBacked- Returns:
- the registry access for this object
-
addFunctionAtEvent
public <E extends BattleEvent,A> CompletableFuture<A> addFunctionAtEvent(Class<E> eventClass, BiFunction<E, BattleController, A> task) Description copied from interface:BattleEventsAdds a one-shot function to run the next time the specified event type is published.The returned future is completed with the function result after the task has executed. Once executed, the task is removed and will not run for later events of the same type.
- Specified by:
addFunctionAtEventin interfaceBattleEvents- Type Parameters:
E- the battle event typeA- the function result type- Parameters:
eventClass- the event type to wait fortask- the function to execute when the event is published- Returns:
- a future completed with the function result when the task runs
-
addTaskAtEvent
public <E extends BattleEvent> CompletableFuture<Void> addTaskAtEvent(Class<E> eventClass, BiConsumer<E, BattleController> task) Description copied from interface:BattleEventsAdds a one-shot task to run the next time the specified event type is published.The returned future is completed after the task has executed. Once executed, the task is removed and will not run for later events of the same type.
- Specified by:
addTaskAtEventin interfaceBattleEvents- Type Parameters:
E- the battle event type- Parameters:
eventClass- the event type to wait fortask- the task to execute when the event is published- Returns:
- a future completed when the task has run
-
addPersistentTaskAtEvent
public <E extends BattleEvent> void addPersistentTaskAtEvent(Class<E> eventClass, BiConsumer<E, BattleController> task) Description copied from interface:BattleEventsAdds a persistent task to run every time the specified event type is published.Persistent tasks are not removed after execution and do not expose a future, because they may run multiple times over the lifetime of the battle.
- Specified by:
addPersistentTaskAtEventin interfaceBattleEvents- Type Parameters:
E- the battle event type- Parameters:
eventClass- the event type to listen fortask- the task to execute each time the event is published
-
publishEvent
Description copied from interface:BattleEventsPublishes a battle event.Publishing an event should run any one-shot or persistent tasks waiting for that event type, and should also pass the event through the normal Pixelmon event pipeline where applicable. The returned event may have been modified by listeners.
- Specified by:
publishEventin interfaceBattleEvents- Type Parameters:
T- the battle event type- Parameters:
event- the event to publish- Returns:
- the published event, potentially modified by listeners
-
broadcastPacket
Description copied from interface:BattleMessagingBroadcasts a battle packet to all relevant battle clients.Implementations should avoid sending packets when battle communication is disabled.
- Specified by:
broadcastPacketin interfaceBattleMessaging- Parameters:
packet- the packet to broadcast
-
publishSwitchPokemonEvent
- Specified by:
publishSwitchPokemonEventin interfaceBattleController
-
publishRevivedPokemonEvent
- Specified by:
publishRevivedPokemonEventin interfaceBattleController
-
getAttackDamageCalculator
Description copied from interface:BattleRandomContextReturns the attack damage calculator used by this battle.The damage calculator controls how the attack damage random multiplier is resolved. Different implementations may use normal random damage rolls, average damage, minimum damage, maximum damage, or another deterministic strategy for simulations and tests.
- Specified by:
getAttackDamageCalculatorin interfaceBattleRandomContext- Returns:
- the attack damage calculator
-
setAttackDamageCalculator
Description copied from interface:BattleRandomContextSets the attack damage calculator used by this battle.- Specified by:
setAttackDamageCalculatorin interfaceBattleRandomContext- Parameters:
attackDamageCalculator- the attack damage calculator to use
-
randomness
Description copied from interface:BattleRandomContextReturns the battle randomness provider used by this battle.The randomness provider should be used by battle logic for random battle behaviour so live battles, tests, and simulations can control randomness consistently.
- Specified by:
randomnessin interfaceBattleRandomContext- Returns:
- the battle randomness provider
-
setRandomness
Description copied from interface:BattleRandomContextSets the battle randomness provider used by this battle.- Specified by:
setRandomnessin interfaceBattleRandomContext- Parameters:
randomness- the battle randomness provider to use
-
copy
Description copied from interface:BattleSimulationContextCreates a copy of this battle controller.The returned battle is intended for systems that need to evaluate or simulate battle outcomes without directly mutating the original battle. The exact copied state depends on the backing
BattleControllerimplementation.- Specified by:
copyin interfaceBattleSimulationContext- Returns:
- a copied battle controller
-
spectators
Description copied from interface:BattleSpectatingReturns the spectators currently watching this battle.The returned list may be backed by the live battle state. Callers should avoid mutating it directly unless they are part of battle-controller internals.
- Specified by:
spectatorsin interfaceBattleSpectating- Returns:
- the current battle spectators
-
spectate
public void spectate(net.minecraft.server.level.ServerPlayer player, net.minecraft.world.entity.Entity target) Description copied from interface:BattleSpectatingAdds a player as a spectator of this battle.The target entity is used as the entity the player is spectating from or tracking when they begin watching the battle.
- Specified by:
spectatein interfaceBattleSpectating- Parameters:
player- the player to add as a spectatortarget- the battle-related entity being spectated or tracked
-
isSpectating
public boolean isSpectating(net.minecraft.world.entity.player.Player player) Description copied from interface:BattleSpectatingReturns whether the specified player is currently spectating this battle.- Specified by:
isSpectatingin interfaceBattleSpectating- Parameters:
player- the player to check- Returns:
trueif the player is spectating this battle;falseotherwise
-
removeSpectator
public boolean removeSpectator(net.minecraft.server.level.ServerPlayer player) Description copied from interface:BattleSpectatingRemoves a player from this battle's spectators.- Specified by:
removeSpectatorin interfaceBattleSpectating- Parameters:
player- the spectator to remove- Returns:
trueif the player was spectating this battle and was removed;falseotherwise
-
battleLog
Description copied from interface:BattleStateViewReturns the battle log for this battle.- Specified by:
battleLogin interfaceBattleStateView- Returns:
- the battle log
-
outcome
Description copied from interface:BattleStateViewReturns whether this battle has ended.- Specified by:
outcomein interfaceBattleStateView- Returns:
trueif the battle has ended;falseotherwise
-
battleTurn
public int battleTurn()Description copied from interface:BattleStateViewReturns the current battle turn number.- Specified by:
battleTurnin interfaceBattleStateView- Returns:
- the current battle turn
-
actionIndex
public int actionIndex()Description copied from interface:BattleStateViewReturns the current action index within the active turn.This is used while resolving turn actions to identify which action or Pokémon is currently being processed.
- Specified by:
actionIndexin interfaceBattleStateView- Returns:
- the current action index
-
battleIndex
public int battleIndex()Description copied from interface:BattleStateViewReturns this battle's index.- Specified by:
battleIndexin interfaceBattleStateView- Returns:
- the battle index
-
battleIndex
public void battleIndex(int battleIndex) Description copied from interface:BattleStateViewSets this battle's index.- Specified by:
battleIndexin interfaceBattleStateView- Parameters:
battleIndex- the battle index
-
getStage
Description copied from interface:BattleStateViewReturns the current stage of the battle.- Specified by:
getStagein interfaceBattleStateView- Returns:
- the current battle stage
-
globalStatusController
Description copied from interface:BattleStateViewReturns the controller for global battle statuses.- Specified by:
globalStatusControllerin interfaceBattleStateView- Returns:
- the global status controller
-
participants
Description copied from interface:BattleStateViewReturns the participants in this battle.The returned list may be backed by the live battle state. Callers should avoid mutating it unless they are part of battle-controller internals.
- Specified by:
participantsin interfaceBattleStateView- Returns:
- the battle participants
-
teams
Description copied from interface:BattleStateViewReturns the battle participants grouped by team.The returned lists may be backed by the live battle state. Callers should avoid mutating them unless they are part of battle-controller internals.
- Specified by:
teamsin interfaceBattleStateView- Returns:
- the battle teams
-
hasInitialized
public boolean hasInitialized() -
oldGen
Description copied from interface:BattleStateViewReturns the old-generation rules state for this battle.- Specified by:
oldGenin interfaceBattleStateView- Returns:
- the old-generation rules state
-
oldGen
Description copied from interface:BattleStateViewSets the old-generation rules state for this battle.- Specified by:
oldGenin interfaceBattleStateView- Parameters:
oldGen- the old-generation rules state
-
simulateMode
public boolean simulateMode()Description copied from interface:LegacyBattleAISupportReturns whether this battle is currently running in the legacy AI simulation mode.This flag is only used by the legacy
BattleAI.ADVANCED,BattleAI.TACTICAL, andBattleAI.AGGRESSIVEimplementations. New simulation-aware code should use the battle context instead.- Specified by:
simulateModein interfaceLegacyBattleAISupport- Returns:
trueif the battle is being simulated by legacy AI logic;falseotherwise
-
simulateMode
public void simulateMode(boolean simulateMode) Description copied from interface:LegacyBattleAISupportSets whether this battle is currently running in the legacy AI simulation mode.- Specified by:
simulateModein interfaceLegacyBattleAISupport- Parameters:
simulateMode- whether the battle should be treated as simulated by legacy AI logic
-
simulateStats
public boolean simulateStats()Description copied from interface:LegacyBattleAISupportReturns whether the legacy AI should use simulated stat handling for this battle.This is an artifact of the older battle AI system. It is separate from the modern battle context simulation flag and does not represent a general-purpose battle state setting.
- Specified by:
simulateStatsin interfaceLegacyBattleAISupport- Returns:
trueif legacy AI stat simulation handling is enabled;falseotherwise
-
simulateStats
public void simulateStats(boolean simulateStats) Description copied from interface:LegacyBattleAISupportSets whether the legacy AI should use simulated stat handling for this battle.- Specified by:
simulateStatsin interfaceLegacyBattleAISupport- Parameters:
simulateStats- whether legacy AI stat simulation handling should be enabled
-
getContext
- Specified by:
getContextin interfaceContextHolder
-
startMainParticipant
public void startMainParticipant()
-