Search in sources :

Example 1 with IActingItem

use of com.nyrds.pixeldungeon.items.artifacts.IActingItem in project pixel-dungeon-remix by NYRDS.

the class Hero method spend.

@Override
public void spend(float time) {
    int hasteLevel = 0;
    if (heroClass == HeroClass.ELF) {
        hasteLevel++;
        if (subClass == HeroSubClass.SCOUT) {
            hasteLevel++;
        }
    }
    for (Buff buff : buffs(RingOfHaste.Haste.class)) {
        hasteLevel += ((RingOfHaste.Haste) buff).level;
    }
    for (Item item : belongings) {
        if (item instanceof IActingItem && item.isEquipped(this)) {
            ((IActingItem) item).spend(this, time);
        }
    }
    super.spend(hasteLevel == 0 ? time : (float) (time * Math.pow(1.1, -hasteLevel)));
}
Also used : IChaosItem(com.nyrds.pixeldungeon.items.chaos.IChaosItem) Item(com.watabou.pixeldungeon.items.Item) WndTradeItem(com.watabou.pixeldungeon.windows.WndTradeItem) IActingItem(com.nyrds.pixeldungeon.items.artifacts.IActingItem) IActingItem(com.nyrds.pixeldungeon.items.artifacts.IActingItem) RingOfHaste(com.watabou.pixeldungeon.items.rings.RingOfHaste) Buff(com.watabou.pixeldungeon.actors.buffs.Buff)

Aggregations

IActingItem (com.nyrds.pixeldungeon.items.artifacts.IActingItem)1 IChaosItem (com.nyrds.pixeldungeon.items.chaos.IChaosItem)1 Buff (com.watabou.pixeldungeon.actors.buffs.Buff)1 Item (com.watabou.pixeldungeon.items.Item)1 RingOfHaste (com.watabou.pixeldungeon.items.rings.RingOfHaste)1 WndTradeItem (com.watabou.pixeldungeon.windows.WndTradeItem)1