Class GetItemTierEvent


  • public final class GetItemTierEvent
    extends PlayerEvent
    Called when a Survivor finished opening a Chest and the Item generation progress has begun. Calculates the generated Item's Tier like so:
    If generatedNumber is smaller than or equal to ultraRareThreshold: return Tiers.ULTRA_RARE
    else if generatedNumber is smaller than or equal to veryRareThreshold: return Tiers.VERY_RARE
    ...
    else return Tiers.COMMON
    Default values:
    - uncommon threshold = 0.56
    - rare threshold = 0.23
    - very rare threshold = 0.07
    - ultra rare threshold = 0.02
    • Constructor Detail

      • GetItemTierEvent

        public GetItemTierEvent​(Survivor survivor,
                                double generatedNumber)
    • Method Detail

      • getUncommonThreshold

        public double getUncommonThreshold()
        Gets the uncommon threshold.
        Returns:
        The uncommon threshold.
      • getRareThreshold

        public double getRareThreshold()
        Gets the rare threshold.
        Returns:
        The rare threshold.
      • getVeryRareThreshold

        public double getVeryRareThreshold()
        Gets the very rare threshold.
        Returns:
        The very rare threshold.
      • getUltraRareThreshold

        public double getUltraRareThreshold()
        Gets the ultra rare threshold.
        Returns:
        The ultra rare threshold.
      • multiplyUncommonThreshold

        public void multiplyUncommonThreshold​(double multiplier)
        Multiplies the uncommon threshold with the specified multiplier.
        Parameters:
        multiplier - The multiplier.
      • multiplyRareThreshold

        public void multiplyRareThreshold​(double multiplier)
        Multiplies the rare threshold with the specified multiplier.
        Parameters:
        multiplier - The multiplier.
      • multiplyVeryRareThreshold

        public void multiplyVeryRareThreshold​(double multiplier)
        Multiplies the very rare threshold with the specified multiplier.
        Parameters:
        multiplier - The multiplier.
      • multiplyUltraRareThreshold

        public void multiplyUltraRareThreshold​(double multiplier)
        Multiplies the ultra rare threshold with the specified multiplier.
        Parameters:
        multiplier - The multiplier.
      • getTier

        public Tiers getTier()
        Calculates the Tier.
        Returns:
        The Tier.