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.

  • Field Details

  • Constructor Details

    • TeraCheerRaidStrategy

      public TeraCheerRaidStrategy()
    • TeraCheerRaidStrategy

      public TeraCheerRaidStrategy(int maxCheers)
    • TeraCheerRaidStrategy

      public TeraCheerRaidStrategy(int maxCheers, float healPercent, int statBoostStages)
      Creates an instance of a TeraCheerRaidStrategy record class.
      Parameters:
      maxCheers - the value for the maxCheers record component
      healPercent - the value for the healPercent record component
      statBoostStages - the value for the statBoostStages record component
  • Method Details

    • type

      public RaidStrategyType<?> type()
      Description copied from interface: RaidStrategy
      Gets the registered type used to serialize and deserialize this strategy.
      Specified by:
      type in interface RaidStrategy
      Returns:
      The strategy type.
    • canCheer

      public boolean canCheer(BattleParticipant cheerer)
    • onBattleAction

      public boolean onBattleAction(BattleParticipant boss, BattleParticipant cheerer, BattleAction action)
      Description copied from interface: RaidStrategy
      Called when an opposing participant selects a battle action that the raid boss may handle.
      Specified by:
      onBattleAction in interface RaidStrategy
      Parameters:
      boss - The raid boss participant.
      cheerer - The participant selecting the action.
      action - The selected action.
      Returns:
      true if this strategy handled the action.
    • consumeCheer

      public boolean consumeCheer(BattleParticipant cheerer)
    • cheerFailed

      public void cheerFailed(BattleParticipant cheerer)
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • maxCheers

      public int maxCheers()
      Returns the value of the maxCheers record component.
      Returns:
      the value of the maxCheers record component
    • healPercent

      public float healPercent()
      Returns the value of the healPercent record component.
      Returns:
      the value of the healPercent record component
    • statBoostStages

      public int statBoostStages()
      Returns the value of the statBoostStages record component.
      Returns:
      the value of the statBoostStages record component