Class ItemJungleTree

  • All Implemented Interfaces:
    ItemRammable, java.io.Serializable, java.lang.Cloneable

    public class ItemJungleTree
    extends Item
    implements ItemRammable
    Item that blocks the point it occupies. If any damage is done to the JungleTree, the damage source gets a penalty depending on the damage stregth.
    See Also:
    Serialized Form
    • Constructor Detail

      • ItemJungleTree

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

      • getItemRating

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

        public java.lang.String getImageName​(AnimationInfo animation)
        Returns image name.
        Overrides:
        getImageName in class Thing
        Parameters:
        animation - The AnimationInfo.
        Returns:
        "item_tree"+imgIndex
      • getRamPower

        public int getRamPower()
        Gets this items ram power.
        Specified by:
        getRamPower in interface ItemRammable
        Returns:
        energy/2.
      • beRammed

        public boolean beRammed​(Figure rammer,
                                AnimationInfo animation)
        Called, if the item is rammed by a figure. Removes rampower/3 energy.
        Specified by:
        beRammed in interface ItemRammable
        Parameters:
        rammer - The rammer
        animation - the AnimationInfo.
        Returns:
        false because the figure can't enter the items point.
      • removeEnergy

        public void removeEnergy​(int min,
                                 Thing source,
                                 DieReason reason,
                                 AnimationInfo animation)
        Gives a point penalty to the source (if its a figure).
        Overrides:
        removeEnergy in class Thing
        Parameters:
        min - The energy to remove.
        source - The source for the energy loss.
        reason - The reason for the energy loss.
        animation - The AnimationInfo.