Class Perk

    • Constructor Summary

      Constructors 
      Constructor Description
      Perk​(org.bukkit.plugin.java.JavaPlugin plugin, PerkUser perkUser)
      The only constructor your Perk should have.
    • Constructor Detail

      • Perk

        public Perk​(org.bukkit.plugin.java.JavaPlugin plugin,
                    PerkUser perkUser)
        The only constructor your Perk should have. Even if it is a subclass of ExhaustionPerk or CooldownPerk. This is the only constructor that Dead by Moonlight will attempt to call. Missing this constructor, your Perk will not work and an exception will be thrown.
        Parameters:
        plugin - Your plugin's main class. Must never be null.
        perkUser - The PerkUser that will use the Perk. (If the Perk is constructed for the Perk List, perkUser will be null.)
    • Method Detail

      • getPerkUser

        protected final PerkUser getPerkUser()
        Gets the PerkUser who has this instance of this Perk.
        Returns:
        The PerkUser using this instance of this Perk.
      • getDisplayItemStack

        protected final org.bukkit.inventory.ItemStack getDisplayItemStack()
        Gets the ItemStack that represents this Perk in the Player's inventory.
        Returns:
        The ItemStack displaying this Perk in the Player's inventory.
      • setDisplayItemStack

        protected final void setDisplayItemStack​(org.bukkit.inventory.ItemStack displayItemStack)
        Sets the ItemStack that represents this Perk in the Player's Inventory.
        Parameters:
        displayItemStack - The new ItemStack which will hopefully give the Player information about this Perk.
      • setupPerkDisplay

        protected final void setupPerkDisplay()
        Creates the Perk Display book item, and then gives it to the player when the Match starts.
      • setDisplayStatus

        public final void setDisplayStatus​(boolean value)
        Changes the Perk Display to the current state of the perk
        Parameters:
        value - Is the Perk active, or inactive
      • isKiller

        public abstract boolean isKiller()
        Determines whether this Perk will appear in the Killers' Perk List.
        Returns:
        True if it is shown in the Killers' Perk List
      • isSurvivor

        public abstract boolean isSurvivor()
        Determines whether this Perk will appear in the Survivors' Perk List. If the Perk implements TotemPerk, it will not appear in the Survivors' Perk List no matter what.
        Returns:
        True if it is shown in the Survivors' Perk List
      • amountOfTotemsRequired

        public abstract int amountOfTotemsRequired()
        Determines how many Totems will be assigned to this TotemPerk at the start of the Trial. This function will only be called if the PerkUser equipping this Perk is the Killer.
        Returns:
        The amount of Totems needed for this Perk.
      • init

        public final void init()
        Initializes the Perk. Called from PerkUser when the game is about to start.
      • setupPerk

        protected void setupPerk()
        Created for the other abstract Perk classes. Gets called just before onStart().
      • getPerkDescription

        public final java.util.List<java.lang.String> getPerkDescription()
        The description of the Perk, which appears when either the ItemStack or the Chat Text is hovered over by the Player's cursor.
        Returns:
        The description of the Perk
      • getDisplayName

        public final java.lang.String getDisplayName()
        Description copied from class: Configurable
        The name that will be shown to players
        Specified by:
        getDisplayName in class Configurable
        Returns:
        The (translated) name that will be shown to players
      • getPerkDescriptionForChat

        public final java.lang.String getPerkDescriptionForChat()
        Creates the Perk Description for the Chat.
        Returns:
        The Perk Description in a single String.
      • getPerkItem

        public final org.bukkit.inventory.ItemStack getPerkItem()
        Gets the Enchanted Book Item, which explains what this Perk does. Visible in the Perk List.
        Returns:
        The Information Book Item.
      • getFileName

        protected final java.lang.String getFileName()
        Description copied from class: Configurable
        Gets the name of the config file.
        Specified by:
        getFileName in class Configurable
        Returns:
        The name of the config file.
      • getDescription

        public final java.lang.String getDescription()
        Description copied from class: Configurable
        The description of the Configurable, which will appear when the player hovers their cursor on the chat.
        Specified by:
        getDescription in class Configurable
        Returns:
        An informative description
      • toString

        public final java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public final boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class Configurable