Class BigBossDrone

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

    public class BigBossDrone
    extends Rocketeer
    Drone Figure for BigBoss. The Drones spawn rockets like Rocketeers, but additionally check, if any other BigBossDrone or the BigBoss is in line of fire before using.
    See Also:
    Serialized Form
    • Constructor Detail

      • BigBossDrone

        public BigBossDrone​(Game game,
                            FigureInfo fi)
        Creates a BigBossDrone.
        Parameters:
        game - The game.
        fi - The figure info.
    • Method Detail

      • getImageName

        public java.lang.String getImageName​(AnimationInfo animation)
        Gets the image name for this figure.
        Overrides:
        getImageName in class Figure
        Parameters:
        animation - AnimationInfo.
        Returns:
        "bb_"+getDirString()
      • 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.PainterBigBossDrone"
      • 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. This dummy figure does nothing the whole game (except for exploding maybe...)
        Overrides:
        doCalculateNextPoint in class ComputerFigure
        Returns:
        This figures current point
      • onAddHeat

        protected int onAddHeat​(int heat,
                                boolean internal,
                                Thing source)
        Reduces the heat by factor 5 to prevent drones from heat death.
        Overrides:
        onAddHeat in class Figure
        Parameters:
        heat - The heat gain.
        internal - Flag, if heat is internal.
        source - The heat source.
        Returns:
        A fifth of the original heat.
      • 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 rocket of the type depending on this rocketeers item nr setting.
        Overrides:
        doSpecialUpdate in class Rocketeer
        Parameters:
        animation - The AnimationInfo.
      • hasJustFired

        protected boolean hasJustFired()
        Checks, if this drone has just fired.
        Returns:
        Flag, if drone has just fired a rocket.
      • performExplodingEffect

        protected void performExplodingEffect​(AnimationInfo animation)
        Performs the explosion effect.
        Overrides:
        performExplodingEffect in class Rocketeer
        Parameters:
        animation - The AnimationInfo.
      • getBoss

        public BigBoss getBoss()
        Gets the boss.
        Returns:
        The BigBoss.
      • 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.
      • isDummy

        public boolean isDummy()
        Returns true.
        Overrides:
        isDummy in class ComputerFigure
        Returns:
        true.
      • wantsToFire

        protected boolean wantsToFire​(ItemRocket rocket)
        Checks, if the drone wants to fire a rocket.
        Parameters:
        rocket - The rocket.
        Returns:
        false, if the targetline crosses the BigBoss.