Class ChrystalMonster

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

    public class ChrystalMonster
    extends CleverComputerFigure
    Computer figure that only works in the last chrystal zone. Leaves the ChrystalStone on its point when dying.
    See Also:
    Serialized Form
    • Constructor Detail

      • ChrystalMonster

        public ChrystalMonster​(Game game,
                               FigureInfo figureInfo)
        Creates a new ChrystalMonster 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.
      • calculatePointRating

        protected int calculatePointRating​(Point p)
        Gets the point rating for the given point for determining the best next point for this figure. Prevents from leaving the inner quadrant.
        Overrides:
        calculatePointRating in class CleverComputerFigure
        Parameters:
        p - The point.
        Returns:
        Rating for the point.
      • 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.
      • 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.
      • 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
      • 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 Chrystal Stone.
        Overrides:
        onAfterDeath in class Figure
        Parameters:
        p - The point
        animation - T-he AnimationInfo