Class ItemRamPower

    • Constructor Detail

      • ItemRamPower

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

      • getItemRating

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

        public java.lang.String getUseClip()
        Returns a sound clip depending on the gain,
        Overrides:
        getUseClip in class Item
        Returns:
        "item_rampower"+x.
      • calculateGain

        public int calculateGain()
        Calculates the ram power gain.
        Returns:
        The ram power gain.
      • getDrawText

        public java.lang.String getDrawText()
        Returns a display string for UI.
        Overrides:
        getDrawText in class Item
        Returns:
        null as default.
      • isRammed

        public int isRammed​(Figure f,
                            Figure rammer,
                            int ramPower,
                            AnimationInfo animation)
        Removes one ram power.
        Specified by:
        isRammed in interface FigureRamListener
        Overrides:
        isRammed in class Item
        Parameters:
        f - The figure.
        rammer - The rammer.
        ramPower - The original ram power.
        animation - The AnimationInfo.
        Returns:
        The initial ram power increased by the gain.
      • getRamPower

        public int getRamPower​(Figure f,
                               Figure rammer,
                               int initialRamPower)
        Returns the initial ram power increased by the gain.
        Specified by:
        getRamPower in interface FigureRamListener
        Overrides:
        getRamPower in class Item
        Parameters:
        f - The figure.
        rammer - The rammer.
        initialRamPower - The original ram power.
        Returns:
        The initial ram power increased by the gain.