Class BlasterTank

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

    public class BlasterTank
    extends CleverComputerFigure
    Computer figure, that fires fireballs frequently. Increased rampower and energy. Immune to own explosions.
    See Also:
    Serialized Form
    • Field Detail

      • fireFrequency

        public int fireFrequency
        Frequency for fire fx.
    • Constructor Detail

      • BlasterTank

        public BlasterTank​(Game game,
                           FigureInfo figureInfo)
        Creates a new BlasterTank.
        Parameters:
        game - The game.
        figureInfo - The FigureInfo.
    • Method Detail

      • addStateProperties

        protected void addStateProperties​(ThingState state,
                                          AnimationInfo animation)
        Adds properties necessary for Blastertank painting.
        Overrides:
        addStateProperties in class Thing
        Parameters:
        state - The state to add properties to.
        animation - The current AnimationInfo.
      • 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 Figure
        Returns:
        "com.starpoints.painter.arena2D.PainterBlasterTank"
      • getIq

        public int getIq()
        Gets the IQ of this figure (at least 120).
        Overrides:
        getIq in class CleverComputerFigure
        Returns:
        The IQ.
      • doSpecialUpdate

        protected void doSpecialUpdate​(AnimationInfo animation)
        This method is called at the end of the regular updateThing()-method. If the number of rounds equal to the fire frequency has passed, since the last item was used, the figure gains a new fireball.
        Overrides:
        doSpecialUpdate in class CleverComputerFigure
        Parameters:
        animation - The AnimationInfo.
      • wantsToMove

        protected boolean wantsToMove()
        Checks, if this figure wants to move.
        Overrides:
        wantsToMove in class CleverComputerFigure
        Returns:
        false, if just fired.
      • onExplode

        protected int onExplode​(int power,
                                Thing source,
                                AnimationInfo animation)
        Performed, when a thing stands in an explosion. Ignores self-sourced explosions.
        Overrides:
        onExplode in class Figure
        Parameters:
        power - The explosion power
        source - The explosion source
        animation - The AnimationInfo.
        Returns:
        A modified energy loss.
      • getFireCounter

        public int getFireCounter()
        Gets the number of rounds until firing.
        Returns:
        The fire counter. 0-this.fireFrequency-1.
      • reInit

        protected void reInit​(Field f)
        Reinitializes the figure after each level.
        Overrides:
        reInit in class CleverComputerFigure
        Parameters:
        f - The new field