use of com.shatteredpixel.shatteredpixeldungeon.items.quest.DarkGold in project shattered-pixel-dungeon-gdx by 00-Evan.
the class Blacksmith method interact.
@Override
public boolean interact() {
sprite.turnTo(pos, Dungeon.hero.pos);
if (!Quest.given) {
GameScene.show(new WndQuest(this, Quest.alternative ? Messages.get(this, "blood_1") : Messages.get(this, "gold_1")) {
@Override
public void onBackPressed() {
super.onBackPressed();
Quest.given = true;
Quest.completed = false;
Pickaxe pick = new Pickaxe();
if (pick.doPickUp(Dungeon.hero)) {
GLog.i(Messages.get(Dungeon.hero, "you_now_have", pick.name()));
} else {
Dungeon.level.drop(pick, Dungeon.hero.pos).sprite.drop();
}
}
});
Notes.add(Notes.Landmark.TROLL);
} else if (!Quest.completed) {
if (Quest.alternative) {
Pickaxe pick = Dungeon.hero.belongings.getItem(Pickaxe.class);
if (pick == null) {
tell(Messages.get(this, "lost_pick"));
} else if (!pick.bloodStained) {
tell(Messages.get(this, "blood_2"));
} else {
if (pick.isEquipped(Dungeon.hero)) {
pick.doUnequip(Dungeon.hero, false);
}
pick.detach(Dungeon.hero.belongings.backpack);
tell(Messages.get(this, "completed"));
Quest.completed = true;
Quest.reforged = false;
}
} else {
Pickaxe pick = Dungeon.hero.belongings.getItem(Pickaxe.class);
DarkGold gold = Dungeon.hero.belongings.getItem(DarkGold.class);
if (pick == null) {
tell(Messages.get(this, "lost_pick"));
} else if (gold == null || gold.quantity() < 15) {
tell(Messages.get(this, "gold_2"));
} else {
if (pick.isEquipped(Dungeon.hero)) {
pick.doUnequip(Dungeon.hero, false);
}
pick.detach(Dungeon.hero.belongings.backpack);
gold.detachAll(Dungeon.hero.belongings.backpack);
tell(Messages.get(this, "completed"));
Quest.completed = true;
Quest.reforged = false;
}
}
} else if (!Quest.reforged) {
GameScene.show(new WndBlacksmith(this, Dungeon.hero));
} else {
tell(Messages.get(this, "get_lost"));
}
return false;
}
Aggregations