Class BigBoss

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

    public class BigBoss
    extends ComputerFigure
    The Boss enemy (surrounded by 4 BigBossDrones). Fires FlameThrower to diagonal directions if enemy would be affected. No rocket target.
    See Also:
    Serialized Form
    • Field Detail

      • TOPLEFT

        public static final int TOPLEFT
        Direction constant for fire animation.
        See Also:
        Constant Field Values
      • TOPRIGHT

        public static final int TOPRIGHT
        Direction constant for fire animation.
        See Also:
        Constant Field Values
      • BOTTOMLEFT

        public static final int BOTTOMLEFT
        Direction constant for fire animation.
        See Also:
        Constant Field Values
      • BOTTOMRIGHT

        public static final int BOTTOMRIGHT
        Direction constant for fire animation.
        See Also:
        Constant Field Values
      • FIRE_FREQUENCY

        public static final int FIRE_FREQUENCY
        Fire frequency constant.
        See Also:
        Constant Field Values
    • Constructor Detail

      • BigBoss

        public BigBoss​(Game game,
                       FigureInfo f)
        Creates The last Enemy.
        Parameters:
        game - The game.
        f - The figure info.
    • Method Detail

      • addStateProperties

        protected void addStateProperties​(ThingState state,
                                          AnimationInfo animation)
        Adds properties necessary for BigBoss 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.PainterBigBoss"
      • isAvailableInEditor

        public boolean isAvailableInEditor()
        Checks, if this figure is available in level editor.
        Overrides:
        isAvailableInEditor in class Figure
        Returns:
        false.
      • doCalculateNextPoint

        protected Point doCalculateNextPoint()
        This method is called each round, to get the next point for this figure when playing. If any drone explodes, the BigBoss does not move. Otherwise superclasses method is called. Stores the next point for acccess by drones.
        Overrides:
        doCalculateNextPoint in class ComputerFigure
        Returns:
        This figures next point
      • onAddHeat

        protected int onAddHeat​(int heat,
                                boolean internal,
                                Thing source)
        Returns a fifth of original heat gain. Big Boss is almost immune to heat.
        Overrides:
        onAddHeat in class Figure
        Parameters:
        heat - The originally added heat
        internal - Flag, if heat was produced inside the figure.
        source - The heating source.
        Returns:
        super.onAddHeat(heat, internal, source) / 5.
      • onAfterDeath

        protected void onAfterDeath​(Point p,
                                    AnimationInfo animation)
        Called, directly after the figure dies and its point is unoccupied. Places an ItemSecretLevel, that is activated for 8 rounds.
        Overrides:
        onAfterDeath in class Figure
        Parameters:
        p - The point
        animation - T-he AnimationInfo
      • calculatePointRating

        protected int calculatePointRating​(Point p)
        Gets the point rating for a given point during next point calculation - Returns -100000 for points on the edge of the field, otherwise supermethods return value.
        Overrides:
        calculatePointRating in class ComputerFigure
        Parameters:
        p - the point.
        Returns:
        The point rating.
      • getNextPoint

        public Point getNextPoint()
        Gets the next point BigBoss wants to move to.
        Returns:
        The next point.
      • wantsToUseItem

        public boolean wantsToUseItem()
        This method is called each round, if the figure has an item, to check, if the item should be used.
        Overrides:
        wantsToUseItem in class Figure
        Returns:
        true, if this figure wants to use it's item.
      • doSpecialUpdate

        protected void doSpecialUpdate​(AnimationInfo animation)
        Updates after each round. Drops any item that might have been picked up. Checks for the FlameThrower effect and loads a rocket, if all drones are dead.
        Overrides:
        doSpecialUpdate in class ComputerFigure
        Parameters:
        animation - The AnimationInfo.
      • reInit

        protected void reInit​(Field field)
        Reinitializes the figure after each level.
        Overrides:
        reInit in class Figure
        Parameters:
        field - The field.
      • getHasFiredDirection

        public int getHasFiredDirection()
        Gets the direction constant in which big boss has fired.
        Returns:
        Direction in which BigBoss has fired.
      • hasJustFired

        public boolean hasJustFired()
        Checks, if BigBoss has just fired.
        Returns:
        true, if has just fired.