Class ElementalReaction.Settings

java.lang.Object
io.github.xrickastley.sevenelements.element.reaction.ElementalReaction.Settings
Enclosing class:
ElementalReaction

public static final class ElementalReaction.Settings extends Object
  • Field Details

    • name

      private final String name
    • id

      private final Identifier id
    • text

      @Nullable private final @Nullable Text text
    • reactionCoefficient

      private double reactionCoefficient
    • auraElement

      private Pair<Element,Integer> auraElement
    • triggeringElement

      private Pair<Element,Integer> triggeringElement
    • reversable

      private boolean reversable
    • applyResultAsAura

      private boolean applyResultAsAura
    • endsReactionTrigger

      private boolean endsReactionTrigger
    • preventsPriorityUpgrade

      private boolean preventsPriorityUpgrade
    • preventsReactionsAfter

      private Set<Identifier> preventsReactionsAfter
    • reactionDisplayOrder

      private List<Element> reactionDisplayOrder
  • Constructor Details

  • Method Details

    • setReactionCoefficient

      public ElementalReaction.Settings setReactionCoefficient(double reactionCoefficient)
      Sets the reaction coefficient of the Elemental Reaction. This is a multiplier that dictates how many gauge units are consumed from the aura element.
      Parameters:
      reactionCoefficient - The reaction coefficient of the Elemental Reaction.
    • setAuraElement

      public ElementalReaction.Settings setAuraElement(Element element)
    • setAuraElement

      public ElementalReaction.Settings setAuraElement(Element element, int priority)
      Sets the Aura Element of the Elemental Reaction.

      This is the element that must be applied onto the entity in order for the reaction to be triggered by applying the Triggering Element onto the entity.

      However, when the Elemental Reaction is considered "reversable" through Settings#reversable(), the Aura Element may be considered as the Triggering Element, and the Triggering Element may be considered as the Aura Element.
      Parameters:
      element - The Aura Element of the Elemental Reaction.
      priority - The priority of this reaction triggering when auraElement is currently the triggering element. priority will only be applied when reversable is true, as that is the only instance the auraElement can be considered a triggering element.
    • setTriggeringElement

      public ElementalReaction.Settings setTriggeringElement(Element element)
    • setTriggeringElement

      public ElementalReaction.Settings setTriggeringElement(Element element, int priority)
      Sets the Triggering Element of the Elemental Reaction.

      This is the element that must be applied onto the entity with the specified Aura Element in order for the reaction to be triggered.

      However, when the Elemental Reaction is considered "reversable" through Settings#reversable(), the Triggering Element may be considered as the Aura Element, and the Aura Element may be considered as the Triggering Element.
      Parameters:
      element - The Triggering Element of the Elemental Reaction.
      priority - The priority of this reaction triggering when triggeringElement is the triggering element.
    • setReactionDisplayOrder

      public ElementalReaction.Settings setReactionDisplayOrder(Element... elementOrder)
      Sets the display order when this reaction is displayed.

      This must contain only the Aura and Triggering element, as an IllegalArgumentException will be thrown when a different unexpected Element is added instead.
      Parameters:
      elementOrder - The order of the elements when this reaction is displayed.
    • reversable

      public ElementalReaction.Settings reversable(boolean reversable)
      Sets the Elemental Reaction as reversable.

      When this is true, the Triggering Element can be considered as an Aura Element.
      Parameters:
      reversable - Whether the Elemental Reaction is reversable.
    • applyResultAsAura

      public ElementalReaction.Settings applyResultAsAura(boolean applyResultAsAura)
      Whether the triggering Element is applied as an aura.

      Once all possible Elemental Reactions have been triggered, the triggering element may have some Gauge Units left. This setting allows for the remaining Gauge Units to be applied as an Elemental Aura.

      If multiple Elemental Reactions are triggered, all triggered Elemental Reactions must have this setting set to true for the Gauge Units from the triggering element to be applied as an Elemental Aura.

      Do note that this setting will not affect Elemental Applications with ElementalApplication.Type.DURATION, as those are always applied as an Aura Element after possible reactions.
      Parameters:
      applyResultAsAura - Whether the remaining Gauge Units from the triggering element are applied as an Elemental Aura.
    • endsReactionTrigger

      public ElementalReaction.Settings endsReactionTrigger(boolean endsReactionTrigger)
      Whether this reaction ends all future reactions from triggering.

      Once a reaction is triggered, an attempt to trigger another is made. This setting denies other reactions to be triggered after triggering this reaction.
      Parameters:
      endsReactionTrigger - Whether reactions can be triggered after this reaction.
    • preventsPriorityUpgrade

      public ElementalReaction.Settings preventsPriorityUpgrade(boolean preventsPriorityUpgrade)
      Whether this reaction prevents the priority upgrade.

      Once a reaction is triggered, an attempt to trigger another is made. If no reactions were found, an attempt to upgrade the "element priority" is done. This setting denies that attempt after triggering this reaction.

      However, the attempt to upgrade the priority will only be denied once after this reaction. Succeeding reactions must also have this property enabled in order for the upgrade to be fully denied.
      Parameters:
      preventsPriorityUpgrade - Whether the element priority can be upgraded after this reaction.
    • preventsReactionsAfter

      public ElementalReaction.Settings preventsReactionsAfter(Identifier... reactions)
      Whether this reaction prevents other reactions from triggering after it.

      This setting denies the specified reactions from triggering directly after this reaction.
      Parameters:
      reactions - The reactions to prevent from triggering directly after this reaction.
    • getAuraElement

      public Element getAuraElement()
    • getTriggeringElement

      public Element getTriggeringElement()