Class ItemEnergyPlusSuper

    • Field Detail

      • energyGain

        protected int energyGain
        The energy gain per round for the owner.
    • Constructor Detail

      • ItemEnergyPlusSuper

        public ItemEnergyPlusSuper()
        Creates a new ItemEnergyPlusSuper.
    • Method Detail

      • getItemRating

        public int getItemRating()
        Returns an item value for ComputerFigures rating in the items category.
        Overrides:
        getItemRating in class Item
        Returns:
        energy * 1000.
      • getImageName

        public java.lang.String getImageName​(AnimationInfo animation)
        Returns image name.
        Overrides:
        getImageName in class Thing
        Parameters:
        animation - The AnimationInfo.
        Returns:
        "item_energy0", "item_energy1" or "item_energy2", depending on energy level
      • onAddedAsPermanentItem

        public void onAddedAsPermanentItem​(Figure user,
                                           AnimationInfo animation)
        Adds this item as permanent. Duration is this items energy * 20, energy gain is energy/10 (max. 10)
        Overrides:
        onAddedAsPermanentItem in class ItemPermanent
        Parameters:
        user - The figure using the item.
        animation - AnimationInfo.
      • performPermanentEffect

        public void performPermanentEffect​(Figure owner,
                                           AnimationInfo animation)
        Adds 2 energy to the owner's. Duration is decreased by 2 (if the owner still gains energy).
        Overrides:
        performPermanentEffect in class ItemPermanent
        Parameters:
        owner - The owner.
        animation - The AnimationInfo.
      • checkRegeneration

        protected boolean checkRegeneration​(Figure owner)
        Checks, if the item gives energy to the user.
        Parameters:
        owner - The owner.
        Returns:
        true, if this item is ok, the owner is ok, adn either hasn't max energy or an item which hasn't reached its max energy and an EnergyTransformer (which is a bit dirty!).
      • getUseClip

        protected java.lang.String getUseClip()
        Gets the name of the .wav file.
        Overrides:
        getUseClip in class Item
        Returns:
        "item_energyplus" or "item_energyplussuper" depending on energy.
      • getEnergyGain

        public int getEnergyGain()
        Gets this items energy gain.
        Specified by:
        getEnergyGain in interface RegenerationItem
        Returns:
        The calculated energy gain.