Class TheRat

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

    public class TheRat
    extends CleverComputerFigure
    Computer figure, that poisens an enemy when ramming. Increased ram power and ram shielding. Immune to heat.
    See Also:
    Serialized Form
    • Constructor Detail

      • TheRat

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

      • addHeat

        public int addHeat​(int heat,
                           boolean internal,
                           Thing source)
        Does nothing by returning 0.
        Parameters:
        heat - The heat.
        internal - Flag, if internal.
        source - Heat source.
        Returns:
        0.
      • getIq

        public int getIq()
        Gets the IQ of this figure. If the background is flickering, the figures iq is reduced by 20.
        Overrides:
        getIq in class CleverComputerFigure
        Returns:
        The IQ.
      • 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