Record Class TeraChargeRaidStrategy
java.lang.Object
java.lang.Record
com.pixelmonmod.pixelmon.battles.raids.tera.strategy.TeraChargeRaidStrategy
- All Implemented Interfaces:
RaidStrategy
public record TeraChargeRaidStrategy(int attacksToCharge, int startingCharge)
extends Record
implements RaidStrategy
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<TeraChargeRaidStrategy> -
Constructor Summary
ConstructorsConstructorDescriptionTeraChargeRaidStrategy(int attacksToCharge, int startingCharge) Creates an instance of aTeraChargeRaidStrategyrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of theattacksToChargerecord component.booleancanTerastallize(BattleParticipant participant) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.voidonRaidStart(BattleParticipant boss) Called when the raid boss participant is initialized for battle.booleanonUseAttackOther(BattleParticipant boss, BattleParticipant user, PixelmonWrapper attacker, Attack attack) Called when another participant attempts to use an attack while the raid boss is present.intReturns the value of thestartingChargerecord component.voidstealCharge(BattleParticipant participant, int amount) 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, onBattleAction, onBossAttack, onBossDamaged, onPokemonFainted, onPokemonSwitchIn, onRaidEnd, onTakeTurn, onTargeted, onTurnEnd, onUseAttackPost, shouldKeepFaintedPokemon, shouldSkipTurnAgainstOpponent, update
-
Field Details
-
CODEC
-
-
Constructor Details
-
TeraChargeRaidStrategy
public TeraChargeRaidStrategy(int attacksToCharge, int startingCharge) Creates an instance of aTeraChargeRaidStrategyrecord class.- Parameters:
attacksToCharge- the value for theattacksToChargerecord componentstartingCharge- the value for thestartingChargerecord 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.
-
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.
-
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.
-
canTerastallize
-
stealCharge
-
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 '=='. -
attacksToCharge
public int attacksToCharge()Returns the value of theattacksToChargerecord component.- Returns:
- the value of the
attacksToChargerecord component
-
startingCharge
public int startingCharge()Returns the value of thestartingChargerecord component.- Returns:
- the value of the
startingChargerecord component
-