Class BlueChrystalFigure

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

    public class BlueChrystalFigure
    extends CleverComputerFigure
    Computer figure that only works in the blue chrystal zone. Destroys a rock on (9/8) and creates a driller on (8/2) when dying.
    See Also:
    Serialized Form
    • Constructor Detail

      • BlueChrystalFigure

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

      • isForbiddenItem

        protected boolean isForbiddenItem​(Item i)
        Checks, if the item is not allowed to be picked up by this figure.
        Overrides:
        isForbiddenItem in class ComputerFigure
        Parameters:
        i - The item.
        Returns:
        true, if item must not be picked up.
      • isAvailableInEditor

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

        protected Figure getClosestEnemy()
      • beRammed

        public void beRammed​(Figure rammer,
                             int energyLoss,
                             AnimationInfo animation)
        Performs the effect when this figure is rammed by the rammer or rams him.
        Overrides:
        beRammed in class Figure
        Parameters:
        rammer - The rammer or rammed figure
        energyLoss - The ram power of the rammer
        animation - The AnimationInfo.
      • onAddHeat

        protected int onAddHeat​(int heat,
                                boolean internal,
                                Thing source)
        Adds no heat - chrystal monsters are immune to heat.
        Overrides:
        onAddHeat in class Figure
        Parameters:
        heat - The heat gain.
        internal - Flag, if internal heat.
        source - The heat source.
        Returns:
        A modified heat value.
      • onBeforeRemoveEnergy

        public int onBeforeRemoveEnergy​(int min,
                                        Thing source,
                                        DieReason reason,
                                        AnimationInfo animation)
        Overheat-damage is ignored. Otherwise, if the source is a figure with the blue chrystal, damage is doubled.
        Overrides:
        onBeforeRemoveEnergy in class Figure
        Parameters:
        min - The energy to remove
        source - The source for the energy removal
        reason - The energy removal reason.
        animation - The AnimationInfo
        Returns:
        The modified energy loss.
      • isRamTarget

        protected boolean isRamTarget​(Figure f)
        Checks, if the figure is a good ram target (because it is weaker than this figure).
        Overrides:
        isRamTarget in class ComputerFigure
        Parameters:
        f - The figure
        Returns:
        true, if the figure is a good ram target
      • drawState

        public boolean drawState()
        Checks, if the figure draws items and on figure shielding in 2D
        Overrides:
        drawState in class Figure
        Returns:
        true as default
      • doSpecialUpdate

        protected void doSpecialUpdate​(AnimationInfo animation)
        This method is called at the end of the regular updateThing()-method. Override this for special update needs.
        Overrides:
        doSpecialUpdate in class CleverComputerFigure
        Parameters:
        animation - The AnimationInfo.
      • onAfterDeath

        protected void onAfterDeath​(Point p,
                                    AnimationInfo animation)
        Called, directly after a figure dies and its point is unoccupied. Places the Driller on (8/2), destroys a rock on (9/8).
        Overrides:
        onAfterDeath in class Figure
        Parameters:
        p - The point
        animation - T-he AnimationInfo