Class RedChrystalFigure

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

    public class RedChrystalFigure
    extends CleverComputerFigure
    Computer figure that only works in the red chrystal zone. Destroys a rock on (6/3) and creates a driller on (0/8) when dying.
    See Also:
    Serialized Form
    • Constructor Detail

      • RedChrystalFigure

        public RedChrystalFigure​(Game game,
                                 FigureInfo figureInfo)
        Creates a new RedChrystalFigure figure on the field.
        Parameters:
        game - The game.
        figureInfo - The FigureInfo.
    • Method Detail

      • isAvailableInEditor

        public boolean isAvailableInEditor()
        Checks, if this figure is available in level editor.
        Overrides:
        isAvailableInEditor in class Figure
        Returns:
        false.
      • 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.
      • addHeat

        public int addHeat​(int heat,
                           boolean internal,
                           Thing source)
      • onBeforeRemoveEnergy

        public int onBeforeRemoveEnergy​(int min,
                                        Thing source,
                                        DieReason reason,
                                        AnimationInfo animation)
        Removes the given amount from this things energy level (if it is not invulnerable). Any present shielding will first be removed. If the energy level is reduced to 0, the thing will explode.
        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.
      • 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.
      • 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. Destroys a rock on (6/3) and creates a driller on (0/8).
        Overrides:
        onAfterDeath in class Figure
        Parameters:
        p - The point
        animation - T-he AnimationInfo