Search in sources :

Example 1 with BrokenSeal

use of com.shatteredpixel.shatteredpixeldungeon.items.BrokenSeal in project shattered-pixel-dungeon-gdx by 00-Evan.

the class Blacksmith method upgrade.

public static void upgrade(Item item1, Item item2) {
    Item first, second;
    if (item2.level() > item1.level()) {
        first = item2;
        second = item1;
    } else {
        first = item1;
        second = item2;
    }
    Sample.INSTANCE.play(Assets.SND_EVOKE);
    ScrollOfUpgrade.upgrade(Dungeon.hero);
    Item.evoke(Dungeon.hero);
    if (first.isEquipped(Dungeon.hero)) {
        ((EquipableItem) first).doUnequip(Dungeon.hero, true);
    }
    // prevents on-upgrade effects like enchant/glyph removal
    first.level(first.level() + 1);
    Dungeon.hero.spendAndNext(2f);
    Badges.validateItemLevelAquired(first);
    if (second.isEquipped(Dungeon.hero)) {
        ((EquipableItem) second).doUnequip(Dungeon.hero, false);
    }
    second.detachAll(Dungeon.hero.belongings.backpack);
    if (second instanceof Armor) {
        BrokenSeal seal = ((Armor) second).checkSeal();
        if (seal != null) {
            Dungeon.level.drop(seal, Dungeon.hero.pos);
        }
    }
    Quest.reforged = true;
    Notes.remove(Notes.Landmark.TROLL);
}
Also used : EquipableItem(com.shatteredpixel.shatteredpixeldungeon.items.EquipableItem) Item(com.shatteredpixel.shatteredpixeldungeon.items.Item) Armor(com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor) BrokenSeal(com.shatteredpixel.shatteredpixeldungeon.items.BrokenSeal) EquipableItem(com.shatteredpixel.shatteredpixeldungeon.items.EquipableItem)

Example 2 with BrokenSeal

use of com.shatteredpixel.shatteredpixeldungeon.items.BrokenSeal in project shattered-pixel-dungeon-gdx by 00-Evan.

the class ClassArmor method upgrade.

public static ClassArmor upgrade(Hero owner, Armor armor) {
    ClassArmor classArmor = null;
    switch(owner.heroClass) {
        case WARRIOR:
            classArmor = new WarriorArmor();
            BrokenSeal seal = armor.checkSeal();
            if (seal != null) {
                classArmor.affixSeal(seal);
            }
            break;
        case ROGUE:
            classArmor = new RogueArmor();
            break;
        case MAGE:
            classArmor = new MageArmor();
            break;
        case HUNTRESS:
            classArmor = new HuntressArmor();
            break;
    }
    classArmor.level(armor.level());
    classArmor.armorTier = armor.tier;
    classArmor.inscribe(armor.glyph);
    classArmor.identify();
    return classArmor;
}
Also used : BrokenSeal(com.shatteredpixel.shatteredpixeldungeon.items.BrokenSeal)

Aggregations

BrokenSeal (com.shatteredpixel.shatteredpixeldungeon.items.BrokenSeal)2 EquipableItem (com.shatteredpixel.shatteredpixeldungeon.items.EquipableItem)1 Item (com.shatteredpixel.shatteredpixeldungeon.items.Item)1 Armor (com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor)1