Class GreenChrystalFigure

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

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

      • GreenChrystalFigure

        public GreenChrystalFigure​(Game game,
                                   FigureInfo figureInfo)
        Creates a new GreenChrystalFigure figure on the field.
        Parameters:
        game - The game.
        figureInfo - The FigureInfo.
    • 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.
      • addHeat

        public int addHeat​(int heat,
                           boolean internal,
                           Thing source)
      • 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 green 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
      • onAfterDeath

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