Record Class TeraCheerRaidStrategy
java.lang.Object
java.lang.Record
com.pixelmonmod.pixelmon.battles.raids.tera.strategy.TeraCheerRaidStrategy
- All Implemented Interfaces:
RaidStrategy
public record TeraCheerRaidStrategy(int maxCheers, float healPercent, int statBoostStages)
extends Record
implements RaidStrategy
Handles player-selected Tera raid cheers.
Unlike Dynamax cheers, Tera cheers are explicit player choices made while the player is waiting
to revive. This strategy therefore responds to TeraCheerBattleAction instead of using
the automatic cheer roll path.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<TeraCheerRaidStrategy.Cheer> static final com.mojang.serialization.MapCodec<TeraCheerRaidStrategy> -
Constructor Summary
ConstructorsConstructorDescriptionTeraCheerRaidStrategy(int maxCheers) TeraCheerRaidStrategy(int maxCheers, float healPercent, int statBoostStages) Creates an instance of aTeraCheerRaidStrategyrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleancanCheer(BattleParticipant cheerer) voidcheerFailed(BattleParticipant cheerer) booleanconsumeCheer(BattleParticipant cheerer) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.floatReturns the value of thehealPercentrecord component.intReturns the value of themaxCheersrecord component.booleanonBattleAction(BattleParticipant boss, BattleParticipant cheerer, BattleAction action) Called when an opposing participant selects a battle action that the raid boss may handle.intReturns the value of thestatBoostStagesrecord component.final StringtoString()Returns a string representation of this record class.type()Gets the registered type used to serialize and deserialize this strategy.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.pixelmonmod.pixelmon.battles.raids.strategy.RaidStrategy
onAddStatus, onBossAttack, onBossDamaged, onPokemonFainted, onPokemonSwitchIn, onRaidEnd, onRaidStart, onTakeTurn, onTargeted, onTurnEnd, onUseAttackOther, onUseAttackPost, shouldKeepFaintedPokemon, shouldSkipTurnAgainstOpponent, update
-
Field Details
-
CHEER_CODEC
-
CODEC
-
-
Constructor Details
-
TeraCheerRaidStrategy
public TeraCheerRaidStrategy() -
TeraCheerRaidStrategy
public TeraCheerRaidStrategy(int maxCheers) -
TeraCheerRaidStrategy
public TeraCheerRaidStrategy(int maxCheers, float healPercent, int statBoostStages) Creates an instance of aTeraCheerRaidStrategyrecord class.- Parameters:
maxCheers- the value for themaxCheersrecord componenthealPercent- the value for thehealPercentrecord componentstatBoostStages- the value for thestatBoostStagesrecord component
-
-
Method Details
-
type
Description copied from interface:RaidStrategyGets the registered type used to serialize and deserialize this strategy.- Specified by:
typein interfaceRaidStrategy- Returns:
- The strategy type.
-
canCheer
-
onBattleAction
public boolean onBattleAction(BattleParticipant boss, BattleParticipant cheerer, BattleAction action) 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.cheerer- The participant selecting the action.action- The selected action.- Returns:
trueif this strategy handled the action.
-
consumeCheer
-
cheerFailed
-
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 with '=='. -
maxCheers
public int maxCheers()Returns the value of themaxCheersrecord component.- Returns:
- the value of the
maxCheersrecord component
-
healPercent
public float healPercent()Returns the value of thehealPercentrecord component.- Returns:
- the value of the
healPercentrecord component
-
statBoostStages
public int statBoostStages()Returns the value of thestatBoostStagesrecord component.- Returns:
- the value of the
statBoostStagesrecord component
-