Class ItemRatPoison

    • Field Detail

      • energyLoss

        protected int energyLoss
        The energy loss per round for the owner.
    • Constructor Detail

      • ItemRatPoison

        public ItemRatPoison()
        Creates a new ItemRatPoison.
    • Method Detail

      • getItemRating

        public int getItemRating()
        Returns an item value for ComputerFigures rating in the items category.
        Overrides:
        getItemRating in class ItemAbstractChrystal
        Returns:
        energy * -100.
      • onAddedAsPermanentItem

        public void onAddedAsPermanentItem​(Figure user,
                                           AnimationInfo animation)
        Adds this item as permanent. Duration is this items energy * 20, energy gain is energy/10 (max. 10)
        Overrides:
        onAddedAsPermanentItem in class ItemPermanent
        Parameters:
        user - The figure using the item.
        animation - AnimationInfo.
      • performPermanentEffect

        public void performPermanentEffect​(Figure owner,
                                           AnimationInfo animation)
        Adds 2 energy to the owner's. Duration is decreased by 2 (if the owner still gains energy).
        Overrides:
        performPermanentEffect in class ItemPermanent
        Parameters:
        owner - The owner.
        animation - The AnimationInfo.
      • getEnergyLoss

        public int getEnergyLoss()
        Gets this items energy loss.
        Returns:
        The calculated energy loss.
      • setSource

        public void setSource​(TheRat theRat)
        Sets the source of the energy loss.
        Parameters:
        theRat - The source of this poison.
      • onReinitForNewLevel

        protected void onReinitForNewLevel​(Figure user)
        Called after a level, if this item is stored in a permanent slot of the figure. Does nothing by default.
        Overrides:
        onReinitForNewLevel in class ItemPermanent
        Parameters:
        user - The user
      • checkPickup

        protected boolean checkPickup​(Figure picker)
        Checks, if the chrystal will really be picked up - false, if same chrystal is already owned.
        Overrides:
        checkPickup in class ItemAbstractChrystal
        Parameters:
        picker -
        Returns:
      • getRamPower

        public int getRamPower​(Figure f,
                               Figure rammer,
                               int initialRamPower)
        Description copied from class: Item
        Empty figure listener method.
        Specified by:
        getRamPower in interface FigureRamListener
        Overrides:
        getRamPower in class ItemAbstractChrystal
        Parameters:
        f - The figure.
        rammer - The figure that is rammed.
        initialRamPower - The original ramPower.
        Returns:
        The original ram power.