Class ItemChrystalStone

  • All Implemented Interfaces:
    ItemRammable, FigureMoveListener,, java.lang.Cloneable

    public class ItemChrystalStone
    extends Item
    implements FigureMoveListener, ItemRammable
    ChrystalStone for the last InnerChrystalZone. Gets created by the ChrystalMonster. If rammed, the game end sequence is started, if the rammer has all 4 ChrystalStones. In multiplayer mode, all carriers of chrystal stones must ram the stone to start the sequence.
    See Also:
    Serialized Form
    • Field Detail

      • counters

        protected int[] counters
      • classes

        protected java.lang.String[] classes
      • image_sfx

        protected static java.lang.String[] image_sfx
      • sequenceStarted

        protected boolean sequenceStarted
      • sequenceStopped

        protected boolean sequenceStopped
      • sequenceCounter

        protected int sequenceCounter
    • Constructor Detail

      • ItemChrystalStone

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

      • addStateProperties

        protected void addStateProperties​(ThingState state,
                                          AnimationInfo animation)
        Adds properties necessary for chrystal stone painting.
        addStateProperties in class Thing
        state - The state to add properties to.
        animation - The current AnimationInfo.
      • isAvailableInEditor

        public boolean isAvailableInEditor()
        Checks, if this item is available in level editor.
        isAvailableInEditor in class Item
      • getPainterClassname

        public java.lang.String getPainterClassname()
        Gets the fully qualified classname of the Painter to use for this item (in 2D game).
        getPainterClassname in class Item
      • getItemRating

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

        public java.lang.String getImageName()
        Returns image name relative to path /pics, without suffix. image (item paints as small oval in inner and outer color).
        null as default.
      • removeEnergy

        public void removeEnergy​(int min,
                                 Thing source,
                                 DieReason reason,
                                 AnimationInfo animation)
        Does nothing. Chrystal Stone never loses energy.
        removeEnergy in class Thing
        min - The energy to remove.
        source - The source for the energy loss.
        reason - The reason for the energy loss.
        animation - The AnimationInfo.
      • performFieldEffect

        protected void performFieldEffect​(AnimationInfo animation)
        Called each round if the item lies on the field. Performs the final sequence after rammed Does nothing by default.
        performFieldEffect in class Item
        animation - The AnimationInfo.
      • getRamPower

        public int getRamPower()
        Description copied from interface: ItemRammable
        Gets this items ram power.
        Specified by:
        getRamPower in interface ItemRammable
        The Ram power.
      • beRammed

        public boolean beRammed​(Figure rammer,
                                AnimationInfo animation)
        Description copied from interface: ItemRammable
        Called, if the item is rammed by a figure. Return true, if the figure is allowed to enter the items point after ramming.
        Specified by:
        beRammed in interface ItemRammable
        rammer - The rammer
        animation - the AnimationInfo.
        true, if the figure can enter the items point.
      • getAnimationCounter

        public int getAnimationCounter()
      • getAnimationIndex

        public int getAnimationIndex()
      • beforeMove

        public boolean beforeMove​(Figure f,
                                  Point p,
                                  Point newP,
                                  AnimationInfo animation)
        Description copied from interface: FigureMoveListener
        Called, before the figure moves to a new point.
        Specified by:
        beforeMove in interface FigureMoveListener
        f - The figure.
        p - The figures current point.
        newP - The point the figures wants to move to.
        animation - The AnimationInfo
        true, if figure can move.