Class BonusManager

    • Field Detail

      • game

        protected Game game
      • playerInfos

        protected java.util.List<com.starpoints.game.BonusManager.PlayerBonusInfo> playerInfos
      • blackRains

        protected java.util.List<PlayerFigure> blackRains
      • DESTRUCTION_BONUS

        protected static final int[] DESTRUCTION_BONUS
      • EXPLOSION_BONUSLIMIT

        protected static final int[] EXPLOSION_BONUSLIMIT
      • EXPLOSION_BONUS

        protected static final int[] EXPLOSION_BONUS
      • HOVER_BONUSLIMIT

        protected static final int[] HOVER_BONUSLIMIT
      • HOVER_BONUS

        protected static final int[] HOVER_BONUS
      • STUN_BONUSLIMIT

        protected static final int[] STUN_BONUSLIMIT
      • STUN_BONUS

        protected static final int[] STUN_BONUS
    • Constructor Detail

      • BonusManager

        public BonusManager​(Game game)
    • Method Detail

      • update

        public void update()
        Updates explosion counters.
      • reInit

        public void reInit()
        Reinitializes the BonusManager for a new level.
      • getBonusInfo

        public com.starpoints.game.BonusManager.PlayerBonusInfo getBonusInfo​(PlayerFigure player)
      • explodes

        public boolean explodes​(Figure f,
                                Thing source,
                                DieReason reason,
                                AnimationInfo animation)
        Description copied from interface: FigureKillListener
        Called, if the figure is destroyed.
        Specified by:
        explodes in interface FigureKillListener
        Parameters:
        f - The figure that was killed.
        source - The source that killed the figure.
        reason - The death reason.
        animation - The AnimationInfo
        Returns:
        true, if destruction is ok, false, if figure survives the explosion.
      • gainsSlots

        public int gainsSlots​(Figure f,
                              int slots,
                              AnimationInfo animation)
        Description copied from interface: FigureItemListener
        Called, if the figure gains slots. The figures slot count has not changed, when this method is called. If a value different to slots is returned, this value is added instead. If more listeners change the slot gain for the figure, the effect is cumulative.
        Specified by:
        gainsSlots in interface FigureItemListener
        Parameters:
        f - The figure.
        slots - Number of slots.
        animation - The AnimationInfo.
        Returns:
        Modified number of slots.
      • pickesUpBomb

        public boolean pickesUpBomb​(Figure f,
                                    Item explosive,
                                    AnimationInfo animation)
        Description copied from interface: FigureItemListener
        Called, if the figure pickes up a bomb or active bigmine.
        Specified by:
        pickesUpBomb in interface FigureItemListener
        Parameters:
        f - The figure.
        explosive - The explosive item.
        animation - The AnimationInfo.
        Returns:
        Return true, to indicate that the figure can pick up the explosive item.
      • losesItem

        public boolean losesItem​(Figure f,
                                 Item i,
                                 AnimationInfo animation)
        Description copied from interface: FigureItemListener
        Called, if the figure loses an item. Listeners might prevent that.
        Specified by:
        losesItem in interface FigureItemListener
        Parameters:
        f - The figure.
        i - The item that is lost.
        animation - The AnimationInfo.
        Returns:
        Return true, to indicate that the figure loses the item, false to prevent that.
      • losesPermanentItem

        public boolean losesPermanentItem​(Figure f,
                                          Item i,
                                          AnimationInfo animation)
        Description copied from interface: FigureItemListener
        Called, if the figure uses a permanent item by some external effect (dark red point or rocket). The method is not called, if a permanent item is used up.
        Specified by:
        losesPermanentItem in interface FigureItemListener
        Parameters:
        f - The figure.
        i - The item.
        animation - The AnimationInfo.
        Returns:
        true, if item is really lost.
      • lostPermanentItem

        public void lostPermanentItem​(Figure f,
                                      Item i,
                                      AnimationInfo animation)
        Description copied from interface: FigureItemListener
        Called, if the figure finally lost a permanent item by some external effect (dark red point or rocket).
        Specified by:
        lostPermanentItem in interface FigureItemListener
        Parameters:
        f - The figure.
        i - The item.
        animation - The AnimationInfo.
      • pickesUpItem

        public boolean pickesUpItem​(Figure f,
                                    Item i,
                                    AnimationInfo animation)
        Description copied from interface: FigureItemListener
        Called, if the figure picks up an item. Listeners might prevent that.
        Specified by:
        pickesUpItem in interface FigureItemListener
        Parameters:
        f - The figure.
        i - The item that is picked up.
        animation - The AnimationInfo.
        Returns:
        Return true, to indicate that the figure picks up the item, false to prevent that.
      • usesItem

        public boolean usesItem​(Figure f,
                                Item i,
                                AnimationInfo animation)
        Description copied from interface: FigureItemListener
        Called, if the figure uses an item. Listeners might prevent that.
        Specified by:
        usesItem in interface FigureItemListener
        Parameters:
        f - The figure.
        i - The item that is used.
        animation - The AnimationInfo.
        Returns:
        Return true, to indicate that the figure can use the item, false to prevent that.
      • pickesUpExplosive

        public boolean pickesUpExplosive​(Figure f,
                                         Item i,
                                         AnimationInfo animation)
        Description copied from interface: FigureItemListener
        Called, if the figure picks up an exploding item. Listeners might prevent the immense energy loss resulting from that.
        Specified by:
        pickesUpExplosive in interface FigureItemListener
        Parameters:
        f - The figure.
        i - The item that is picked up.
        animation - The AnimationInfo.
        Returns:
        Return false, to indicate that the figure can pick the item without damage.
      • gainsPermanentItem

        public boolean gainsPermanentItem​(Figure figure,
                                          Item it,
                                          AnimationInfo animation)
        Description copied from interface: FigureItemListener
        Called, if the figure adds a permananent item to its inventory. Listeners might prevent that.
        Specified by:
        gainsPermanentItem in interface FigureItemListener
        Parameters:
        figure - The figure.
        it - The item that is used.
        animation - The AnimationInfo.
        Returns:
        Return true, to indicate that the figure can add the permananent item, false to prevent that.