Class ItemRocketGenerator

    • Field Detail

      • fireFrequency

        protected int fireFrequency
        Fire frequency in rounds.
      • GRAYROCKET

        protected static final int GRAYROCKET
        Constant for ItemGrayRocket.
        See Also:
        Constant Field Values
      • SWIRLROCKET

        protected static final int SWIRLROCKET
        Constant for ItemSwirlRocket.
        See Also:
        Constant Field Values
      • DROPROCKET

        protected static final int DROPROCKET
        Constant for ItemDropRocket.
        See Also:
        Constant Field Values
      • FASTROCKET

        protected static final int FASTROCKET
        Constant for ItemFastRocket.
        See Also:
        Constant Field Values
      • rocketType

        protected int rocketType
        Constant for item class to produce. Default is ROCKET.
      • origRocketType

        protected int origRocketType
        Original item nr, if changed by any boost.
      • rocketEnergy

        protected int rocketEnergy
        Initial rocket energy. Default is 100.
    • Constructor Detail

      • ItemRocketGenerator

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

      • getItemRating

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

        public java.lang.String getSlotImageName()
        Returns an image name for slot display.
        Overrides:
        getSlotImageName in class ItemPermanent
        Returns:
        getImageName()+"_slot"
      • getDrawText

        public java.lang.String getDrawText()
        Returns a display string for UI.
        Overrides:
        getDrawText in class Item
        Returns:
        DURATIONx.
      • getFigureOverlayImageName

        public java.lang.String getFigureOverlayImageName​(AnimationInfo animation)
        Gets an image name for painting on the figure.
        Overrides:
        getFigureOverlayImageName in class ItemPermanent
        Parameters:
        animation - The AnimationInfo.
        Returns:
        "item_rocketgenerator_sm".
      • performPermanentEffect

        public void performPermanentEffect​(Figure owner,
                                           AnimationInfo animation)
        If this is the first rocket generator, and the owners item is null, the internal round counter is increased. If the fireFrequency value is reached, a new item is produced and given to the owner.
        Overrides:
        performPermanentEffect in class ItemPermanent
        Parameters:
        owner - The owner of the rocket generator.
        animation - The AnimationInfo.
      • getRocketType

        public int getRocketType()
        Gets the rocket type.
        Returns:
        Rocket type.
      • setRocketType

        public void setRocketType​(int itemNr)
        Sets the rocket type.
        Parameters:
        itemNr - Rocket type.
      • resetRocketType

        public void resetRocketType()
        Resets the rocket type.
      • getRocketEnergy

        public int getRocketEnergy()
        Gets the rocket energy.
        Returns:
        The rocket energy.
      • setRocketEnergy

        public void setRocketEnergy​(int rocketEnergy)
        Sets the rocket energy.
        Parameters:
        rocketEnergy - energy.