Class ItemChrystalStone

  • All Implemented Interfaces:
    ItemRammable, FigureMoveListener, java.io.Serializable, 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.
        Overrides:
        addStateProperties in class Thing
        Parameters:
        state - The state to add properties to.
        animation - The current AnimationInfo.
      • isAvailableInEditor

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

        public java.lang.String getPainterClassname()
        Gets the fully qualified classname of the Painter to use for this item (in 2D game).
        Overrides:
        getPainterClassname in class Item
        Returns:
        "com.starpoints.painter.arena2D.PainterItemChrystalStone"
      • getItemRating

        public int getItemRating()
        Returns an item value for ComputerFigures rating in the items category.
        Overrides:
        getItemRating in class Item
        Returns:
        -10000000.
      • 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).
        Returns:
        null as default.
      • removeEnergy

        public void removeEnergy​(int min,
                                 Thing source,
                                 DieReason reason,
                                 AnimationInfo animation)
        Does nothing. Chrystal Stone never loses energy.
        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.
      • 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.
        Overrides:
        performFieldEffect in class Item
        Parameters:
        animation - The AnimationInfo.
      • getRamPower

        public int getRamPower()
        Description copied from interface: ItemRammable
        Gets this items ram power.
        Specified by:
        getRamPower in interface ItemRammable
        Returns:
        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
        Parameters:
        rammer - The rammer
        animation - the AnimationInfo.
        Returns:
        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
        Parameters:
        f - The figure.
        p - The figures current point.
        newP - The point the figures wants to move to.
        animation - The AnimationInfo
        Returns:
        true, if figure can move.