Class ElementalReaction

java.lang.Object
io.github.xrickastley.sevenelements.element.reaction.ElementalReaction
Direct Known Subclasses:
AbstractBloomElementalReaction, AbstractBurningElementalReaction, AbstractCrystallizeElementalReaction, AbstractDendroCoreElementalReaction, AbstractShatterElementalReaction, AbstractSuperconductElementalReaction, AbstractSwirlElementalReaction, AdditiveElementalReaction, AmplifyingElementalReaction, ElectroChargedElementalReaction, FrozenElementalReaction, OverloadedElementalReaction, QuickenElementalReaction

public abstract class ElementalReaction extends Object
  • Field Details

    • name

      protected final String name
    • id

      protected final Identifier id
    • text

      @Nullable protected final @Nullable Text text
    • reactionCoefficient

      protected final double reactionCoefficient
    • auraElement

      protected final Pair<Element,Integer> auraElement
    • triggeringElement

      protected final Pair<Element,Integer> triggeringElement
    • reversable

      protected final boolean reversable
    • applyResultAsAura

      protected final boolean applyResultAsAura
    • endsReactionTrigger

      protected final boolean endsReactionTrigger
    • preventsPriorityUpgrade

      protected final boolean preventsPriorityUpgrade
    • preventsReactionsAfter

      protected final Set<Identifier> preventsReactionsAfter
    • reactionDisplayOrder

      protected final List<Element> reactionDisplayOrder
  • Constructor Details

  • Method Details

    • getReactionDamage

      public static float getReactionDamage(Entity entity, double reactionMultiplier)
    • getReactionDamage

      public static float getReactionDamage(Entity entity, float reactionMultiplier)
    • getReactionDamage

      public static float getReactionDamage(World world, double reactionMultiplier)
    • getReactionDamage

      public static float getReactionDamage(World world, float reactionMultiplier)
    • getEntitiesInAoE

      public static List<LivingEntity> getEntitiesInAoE(LivingEntity target, double radius)
    • getEntitiesInAoE

      public static List<LivingEntity> getEntitiesInAoE(LivingEntity target, double radius, Predicate<LivingEntity> filter)
    • hasElement

      public boolean hasElement(Element element)
    • hasAnyElement

      public boolean hasAnyElement(Collection<Element> elements)
    • hasAnyElement

      public boolean hasAnyElement(Stream<Element> elements)
    • getAuraElement

      public Element getAuraElement()
    • getTriggeringElement

      public Element getTriggeringElement()
    • getAuraElementPriority

      public int getAuraElementPriority()
    • getTriggeringElementPriority

      public int getTriggeringElementPriority()
    • getHighestElementPriority

      public int getHighestElementPriority()
    • getText

      @Nullable public @Nullable Text getText()
    • getElementPair

      public Pair<Element,Integer> getElementPair(Element element)
    • getReactionDisplayOrder

      public List<Element> getReactionDisplayOrder()
    • shouldApplyResultAsAura

      public boolean shouldApplyResultAsAura()
    • shouldEndReactionTrigger

      public boolean shouldEndReactionTrigger()
    • shouldPreventPriorityUpgrade

      public boolean shouldPreventPriorityUpgrade()
    • preventsReaction

      public boolean preventsReaction(ElementalReaction reaction)
    • preventsReaction

      public boolean preventsReaction(Identifier reactionId)
    • getPriority

      public int getPriority(ElementalApplication application)
      Gets the priority of this Elemental Reaction.
      Parameters:
      application - The applied Elemental Application, which should be the triggering element.
      Returns:
      The priority of this Elemental Reaction.
    • getPriority

      public int getPriority(Element triggeringElement)
      Gets the priority of this Elemental Reaction.
      Parameters:
      triggeringElement - The applied element, also known as the triggering element.
      Returns:
      The priority of this Elemental Reaction.
    • onReaction

      protected abstract void onReaction(LivingEntity entity, ElementalApplication auraElement, ElementalApplication triggeringElement, double reducedGauge, @Nullable @Nullable LivingEntity origin)
      The function to execute after the Elemental Reaction has been triggered. This function is executed after both elements have reacted and have been reduced.
      Parameters:
      entity - The LivingEntity this Elemental Reaction was triggered on.
      auraElement - The aura element that triggered this reaction.
      triggeringElement - The triggering element that reacted with the aura element.
      reducedGauge - The gauge units reduced from both Elements. This will always be Math.min(auraElementGU, triggeringElementGU * reactionCoefficient)
      origin - The LivingEntity that triggered this Elemental Reaction.
    • getId

      public Identifier getId()
    • isTriggerable

      public boolean isTriggerable(Entity entity)
    • isTriggerable

      public boolean isTriggerable(LivingEntity entity)
    • trigger

      public boolean trigger(LivingEntity entity)
    • trigger

      public boolean trigger(LivingEntity entity, @Nullable @Nullable LivingEntity origin)
    • onTrigger

      protected final void onTrigger(LivingEntity entity, ElementalApplication auraElement, ElementalApplication triggeringElement, double reducedGauge, @Nullable @Nullable LivingEntity origin)
    • idEquals

      public boolean idEquals(ElementalReaction reaction)
    • displayReaction

      protected void displayReaction(LivingEntity target)