Record Class RaidStrategySet
- Record Components:
strategies- The ordered raid strategies to dispatch to.
- All Implemented Interfaces:
RaidStrategy
This class is intentionally separate from RaidType. The raid type remains datapack
configuration, while this composite provides the convenient RaidStrategy dispatch
surface used by the raid boss participant.
Void lifecycle hooks are forwarded to every strategy in list order. Damage hooks pipe the
returned damage value through each strategy in order. Boolean hooks short-circuit on the
first strategy that returns true, because those hooks represent handling or blocking
a single action.
-
Field Summary
Fields inherited from interface com.pixelmonmod.pixelmon.battles.raids.strategy.RaidStrategy
CODEC -
Constructor Summary
ConstructorsConstructorDescriptionRaidStrategySet(List<RaidStrategy> strategies) Creates an instance of aRaidStrategySetrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanonAddStatus(BattleParticipant boss, PixelmonWrapper user, PixelmonWrapper target, StatusBase status) Called when a status is about to be applied while the raid boss is involved.booleanonBattleAction(BattleParticipant boss, BattleParticipant actor, BattleAction action) Called when an opposing participant selects a battle action that the raid boss may handle.voidonBossAttack(BattleParticipant boss, PixelmonWrapper bossPokemon) Called when the raid boss participant is asked to use its attack for the current action.floatonBossDamaged(BattleParticipant boss, PixelmonWrapper attacker, float damage, DamageTypeEnum damageType) Called when the raid boss is about to take damage.voidonPokemonFainted(BattleParticipant boss, PixelmonWrapper fainted) Called when a Pokemon on the opposing side faints during the raid.voidonPokemonSwitchIn(BattleParticipant boss, PixelmonWrapper entering) Called when the raid boss switches in or is re-applied as the active Pokemon.voidonRaidEnd(BattleParticipant boss, BattleEndCause cause) Called when the raid battle ends.voidonRaidStart(BattleParticipant boss) Called when the raid boss participant is initialized for battle.booleanonTakeTurn(BattleParticipant boss) Called when the raid boss participant is asked whether it wants to take a special turn action.booleanonTargeted(BattleParticipant boss, PixelmonWrapper user, Attack attack) Called when the raid boss is targeted by an attack.voidonTurnEnd(BattleParticipant boss) Called when a battle turn ends for the raid boss participant.booleanonUseAttackOther(BattleParticipant boss, BattleParticipant user, PixelmonWrapper attacker, Attack attack) Called when another participant attempts to use an attack while the raid boss is present.voidonUseAttackPost(BattleParticipant boss, Attack attack) Called after the raid boss uses an attack.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.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.Returns the value of thestrategiesrecord component.final StringtoString()Returns a string representation of this record class.type()Strategy sets are runtime composites and are not serialized as standalone strategy entries.voidupdate(BattleParticipant boss) Called from the raid boss participant tick.
-
Constructor Details
-
RaidStrategySet
Creates an instance of aRaidStrategySetrecord class.- Parameters:
strategies- the value for thestrategiesrecord component
-
-
Method Details
-
type
Strategy sets are runtime composites and are not serialized as standalone strategy entries.- Specified by:
typein interfaceRaidStrategy- Returns:
- Never returns normally.
- Throws:
UnsupportedOperationException- Always thrown because this composite has no registered strategy type.
-
onRaidStart
Description copied from interface:RaidStrategyCalled 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.
- Specified by:
onRaidStartin interfaceRaidStrategy- Parameters:
boss- The raid boss participant.
-
update
Description copied from interface:RaidStrategyCalled 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.
- Specified by:
updatein interfaceRaidStrategy- Parameters:
boss- The raid boss participant.
-
onTurnEnd
Description copied from interface:RaidStrategyCalled when a battle turn ends for the raid boss participant.- Specified by:
onTurnEndin interfaceRaidStrategy- Parameters:
boss- The raid boss participant.
-
onBossDamaged
public float onBossDamaged(BattleParticipant boss, PixelmonWrapper attacker, float damage, DamageTypeEnum damageType) Description copied from interface:RaidStrategyCalled 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.
- Specified by:
onBossDamagedin interfaceRaidStrategy- 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
Description copied from interface:RaidStrategyCalled when a Pokemon on the opposing side faints during the raid.- Specified by:
onPokemonFaintedin interfaceRaidStrategy- Parameters:
boss- The raid boss participant.fainted- The Pokemon that fainted.
-
shouldKeepFaintedPokemon
public boolean shouldKeepFaintedPokemon(BattleParticipant boss, BattleParticipant opponent, PixelmonWrapper fainted) Description copied from interface:RaidStrategyCalled when an opponent faints and the battle controller is deciding whether the fainted Pokemon should remain active instead of being removed.- Specified by:
shouldKeepFaintedPokemonin interfaceRaidStrategy- 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
public boolean shouldSkipTurnAgainstOpponent(BattleParticipant boss, BattleParticipant opponent, PixelmonWrapper bossPokemon) Description copied from interface:RaidStrategyCalled when the raid boss's lane participant is deciding whether to skip its turn against a specific opponent.- Specified by:
shouldSkipTurnAgainstOpponentin interfaceRaidStrategy- 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
Description copied from interface:RaidStrategyCalled when the raid battle ends.- Specified by:
onRaidEndin interfaceRaidStrategy- Parameters:
boss- The raid boss participant.cause- The battle end cause.
-
onPokemonSwitchIn
Description copied from interface:RaidStrategyCalled when the raid boss switches in or is re-applied as the active Pokemon.- Specified by:
onPokemonSwitchInin interfaceRaidStrategy- Parameters:
boss- The raid boss participant.entering- The Pokemon entering battle.
-
onBossAttack
Description copied from interface:RaidStrategyCalled when the raid boss participant is asked to use its attack for the current action.- Specified by:
onBossAttackin interfaceRaidStrategy- Parameters:
boss- The raid boss participant.bossPokemon- The active boss Pokemon.
-
onUseAttackOther
public boolean onUseAttackOther(BattleParticipant boss, BattleParticipant user, PixelmonWrapper attacker, Attack attack) Description copied from interface:RaidStrategyCalled 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.- Specified by:
onUseAttackOtherin interfaceRaidStrategy- 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
Description copied from interface:RaidStrategyCalled when the raid boss is targeted by an attack.- Specified by:
onTargetedin interfaceRaidStrategy- 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
public boolean onAddStatus(BattleParticipant boss, PixelmonWrapper user, PixelmonWrapper target, StatusBase status) Description copied from interface:RaidStrategyCalled when a status is about to be applied while the raid boss is involved.- Specified by:
onAddStatusin interfaceRaidStrategy- 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
Description copied from interface:RaidStrategyCalled when the raid boss participant is asked whether it wants to take a special turn action.- Specified by:
onTakeTurnin interfaceRaidStrategy- Parameters:
boss- The raid boss participant.- Returns:
trueif this strategy handled the turn action.
-
onBattleAction
Description copied from interface:RaidStrategyCalled when an opposing participant selects a battle action that the raid boss may handle.- Specified by:
onBattleActionin interfaceRaidStrategy- Parameters:
boss- The raid boss participant.actor- The participant selecting the action.action- The selected action.- Returns:
trueif this strategy handled the action.
-
onUseAttackPost
Description copied from interface:RaidStrategyCalled after the raid boss uses an attack.- Specified by:
onUseAttackPostin interfaceRaidStrategy- Parameters:
boss- The raid boss participant.attack- The attack that was used.
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
strategies
Returns the value of thestrategiesrecord component.- Returns:
- the value of the
strategiesrecord component
-