Search in sources :

Example 1 with FrozenCarpaccio

use of com.watabou.pixeldungeon.items.food.FrozenCarpaccio in project pixel-dungeon by watabou.

the class Frost method attachTo.

@Override
public boolean attachTo(Char target) {
    if (super.attachTo(target)) {
        target.paralysed = true;
        Burning.detach(target, Burning.class);
        if (target instanceof Hero) {
            Hero hero = (Hero) target;
            Item item = hero.belongings.randomUnequipped();
            if (item instanceof MysteryMeat) {
                item = item.detach(hero.belongings.backpack);
                FrozenCarpaccio carpaccio = new FrozenCarpaccio();
                if (!carpaccio.collect(hero.belongings.backpack)) {
                    Dungeon.level.drop(carpaccio, target.pos).sprite.drop();
                }
            }
        }
        return true;
    } else {
        return false;
    }
}
Also used : Item(com.watabou.pixeldungeon.items.Item) FrozenCarpaccio(com.watabou.pixeldungeon.items.food.FrozenCarpaccio) Hero(com.watabou.pixeldungeon.actors.hero.Hero) MysteryMeat(com.watabou.pixeldungeon.items.food.MysteryMeat)

Aggregations

Hero (com.watabou.pixeldungeon.actors.hero.Hero)1 Item (com.watabou.pixeldungeon.items.Item)1 FrozenCarpaccio (com.watabou.pixeldungeon.items.food.FrozenCarpaccio)1 MysteryMeat (com.watabou.pixeldungeon.items.food.MysteryMeat)1