Interface RaidStrategy
- All Known Subinterfaces:
AttackRaidStrategy,BattleAIRaidStrategy,BattleEndRaidStrategy,BossTierRaidStrategy,CheerRaidStrategy,GimmickRaidStrategy,PokemonModifierRaidStrategy,ReviveRaidStrategy,ShieldRaidStrategy,ShockwaveRaidStrategy
- All Known Implementing Classes:
DynamaxAttackRaidStrategy,DynamaxBattleAIRaidStrategy,DynamaxBossTierRaidStrategy,DynamaxCheerRaidStrategy,DynamaxGimmickRaidStrategy,DynamaxPokemonModifierRaidStrategy,DynamaxProgressRaidStrategy,DynamaxReviveRaidStrategy,DynamaxShieldRaidStrategy,DynamaxShockwaveStrategy,GigantamaxGimmickRaidStrategy,GigantamaxPokemonModifierRaidStrategy,RaidStrategySet,TeraAttackRaidStrategy,TeraBattleAIRaidStrategy,TeraBossActionRaidStrategy,TeraBossTierRaidStrategy,TeraChargeRaidStrategy,TeraCheerRaidStrategy,TeraGimmickRaidStrategy,TeraPokemonModifierRaidStrategy,TeraProgressRaidStrategy,TeraReviveRaidStrategy,TeraShieldRaidStrategy
Raid strategies are deliberately narrow: each implementation should own one rule or concern, such as shields, revive timing, boss action selection, raid progress, or Pokemon setup. A raid type composes multiple strategies to produce a complete raid mode.
The default methods are no-ops so implementations only need to override the lifecycle hooks
they actually participate in. Hooks that return boolean use true to indicate
that the strategy handled or blocked the action and later strategies should usually not run
for that same action. Damage hooks return the damage value to pass to the next strategy.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<RaidStrategy> Codec for datapack-defined raid strategies. -
Method Summary
Modifier and TypeMethodDescriptiondefault booleanonAddStatus(BattleParticipant boss, PixelmonWrapper user, PixelmonWrapper target, StatusBase status) Called when a status is about to be applied while the raid boss is involved.default booleanonBattleAction(BattleParticipant boss, BattleParticipant actor, BattleAction action) Called when an opposing participant selects a battle action that the raid boss may handle.default voidonBossAttack(BattleParticipant boss, PixelmonWrapper bossPokemon) Called when the raid boss participant is asked to use its attack for the current action.default floatonBossDamaged(BattleParticipant boss, PixelmonWrapper attacker, float damage, DamageTypeEnum damageType) Called when the raid boss is about to take damage.default voidonPokemonFainted(BattleParticipant boss, PixelmonWrapper fainted) Called when a Pokemon on the opposing side faints during the raid.default voidonPokemonSwitchIn(BattleParticipant boss, PixelmonWrapper entering) Called when the raid boss switches in or is re-applied as the active Pokemon.default voidonRaidEnd(BattleParticipant boss, BattleEndCause cause) Called when the raid battle ends.default voidonRaidStart(BattleParticipant boss) Called when the raid boss participant is initialized for battle.default booleanonTakeTurn(BattleParticipant boss) Called when the raid boss participant is asked whether it wants to take a special turn action.default booleanonTargeted(BattleParticipant boss, PixelmonWrapper user, Attack attack) Called when the raid boss is targeted by an attack.default voidonTurnEnd(BattleParticipant boss) Called when a battle turn ends for the raid boss participant.default booleanonUseAttackOther(BattleParticipant boss, BattleParticipant user, PixelmonWrapper attacker, Attack attack) Called when another participant attempts to use an attack while the raid boss is present.default voidonUseAttackPost(BattleParticipant boss, Attack attack) Called after the raid boss uses an attack.default booleanshouldKeepFaintedPokemon(BattleParticipant boss, BattleParticipant opponent, PixelmonWrapper fainted) Called when an opponent faints and the battle controller is deciding whether the fainted Pokemon should remain active instead of being removed.default booleanshouldSkipTurnAgainstOpponent(BattleParticipant boss, BattleParticipant opponent, PixelmonWrapper bossPokemon) Called when the raid boss's lane participant is deciding whether to skip its turn against a specific opponent.type()Gets the registered type used to serialize and deserialize this strategy.default voidupdate(BattleParticipant boss) Called from the raid boss participant tick.
-
Field Details
-
CODEC
Codec for datapack-defined raid strategies. The registeredRaidStrategyTypechooses the concrete strategy codec.
-
-
Method Details
-
type
RaidStrategyType<?> type()Gets the registered type used to serialize and deserialize this strategy.- Returns:
- The strategy type.
-
onRaidStart
Called when the raid boss participant is initialized for battle.Use this hook for battle-local setup such as boss modification, applying gimmicks, initializing context state, or preparing cached values.
- Parameters:
boss- The raid boss participant.
-
update
Called from the raid boss participant tick.Use this for real-time behavior that is not tied to turn boundaries, such as Tera Raid timers or delayed revival.
- Parameters:
boss- The raid boss participant.
-
onTurnEnd
Called when a battle turn ends for the raid boss participant.- Parameters:
boss- The raid boss participant.
-
onBossDamaged
default float onBossDamaged(BattleParticipant boss, PixelmonWrapper attacker, float damage, DamageTypeEnum damageType) Called when the raid boss is about to take damage.The returned value is the damage that should continue through the battle damage flow. Composite strategy dispatch passes the returned value from one strategy into the next.
- Parameters:
boss- The raid boss participant.attacker- The Pokemon that caused the damage.damage- The incoming damage amount.damageType- The kind of damage being applied.- Returns:
- The damage amount to apply after this strategy has handled it.
-
onPokemonFainted
Called when a Pokemon on the opposing side faints during the raid.- Parameters:
boss- The raid boss participant.fainted- The Pokemon that fainted.
-
shouldKeepFaintedPokemon
default boolean shouldKeepFaintedPokemon(BattleParticipant boss, BattleParticipant opponent, PixelmonWrapper fainted) Called when an opponent faints and the battle controller is deciding whether the fainted Pokemon should remain active instead of being removed.- Parameters:
boss- The raid boss participant.opponent- The participant whose Pokemon fainted.fainted- The fainted Pokemon.- Returns:
trueif the fainted Pokemon should remain active.
-
shouldSkipTurnAgainstOpponent
default boolean shouldSkipTurnAgainstOpponent(BattleParticipant boss, BattleParticipant opponent, PixelmonWrapper bossPokemon) Called when the raid boss's lane participant is deciding whether to skip its turn against a specific opponent.- Parameters:
boss- The raid boss participant.opponent- The opposing lane participant.bossPokemon- The boss Pokemon in that lane.- Returns:
trueif the boss should skip this lane turn.
-
onRaidEnd
Called when the raid battle ends.- Parameters:
boss- The raid boss participant.cause- The battle end cause.
-
onPokemonSwitchIn
Called when the raid boss switches in or is re-applied as the active Pokemon.- Parameters:
boss- The raid boss participant.entering- The Pokemon entering battle.
-
onBossAttack
Called when the raid boss participant is asked to use its attack for the current action.- Parameters:
boss- The raid boss participant.bossPokemon- The active boss Pokemon.
-
onUseAttackOther
default boolean onUseAttackOther(BattleParticipant boss, BattleParticipant user, PixelmonWrapper attacker, Attack attack) Called when another participant attempts to use an attack while the raid boss is present.Return
truewhen the strategy handled or blocked the attack. This prevents later strategies in the composite from also handling the same attack.- Parameters:
boss- The raid boss participant.user- The participant using the attack.attacker- The Pokemon using the attack.attack- The attack being used.- Returns:
- Whether this strategy handled or blocked the attack.
-
onTargeted
Called when the raid boss is targeted by an attack.- Parameters:
boss- The raid boss participant.user- The Pokemon targeting the raid boss.attack- The attack being used.- Returns:
trueif targeting should be blocked.
-
onAddStatus
default boolean onAddStatus(BattleParticipant boss, PixelmonWrapper user, PixelmonWrapper target, StatusBase status) Called when a status is about to be applied while the raid boss is involved.- Parameters:
boss- The raid boss participant.user- The Pokemon applying the status.target- The Pokemon receiving the status.status- The status being applied.- Returns:
trueif the status should be blocked.
-
onTakeTurn
Called when the raid boss participant is asked whether it wants to take a special turn action.- Parameters:
boss- The raid boss participant.- Returns:
trueif this strategy handled the turn action.
-
onBattleAction
default boolean onBattleAction(BattleParticipant boss, BattleParticipant actor, BattleAction action) Called when an opposing participant selects a battle action that the raid boss may handle.- Parameters:
boss- The raid boss participant.actor- The participant selecting the action.action- The selected action.- Returns:
trueif this strategy handled the action.
-
onUseAttackPost
Called after the raid boss uses an attack.- Parameters:
boss- The raid boss participant.attack- The attack that was used.
-