use of com.shatteredpixel.shatteredpixeldungeon.items.keys.Key in project shattered-pixel-dungeon-gdx by 00-Evan.
the class Belongings method resurrect.
public void resurrect(int depth) {
for (Item item : backpack.items.toArray(new Item[0])) {
if (item instanceof Key) {
if (((Key) item).depth == depth) {
item.detachAll(backpack);
}
} else if (item.unique) {
item.detachAll(backpack);
// you keep the bag itself, not its contents.
if (item instanceof Bag) {
((Bag) item).clear();
}
item.collect();
} else if (!item.isEquipped(owner)) {
item.detachAll(backpack);
}
}
if (weapon != null) {
weapon.cursed = false;
weapon.activate(owner);
}
if (armor != null) {
armor.cursed = false;
armor.activate(owner);
}
if (misc1 != null) {
misc1.cursed = false;
misc1.activate(owner);
}
if (misc2 != null) {
misc2.cursed = false;
misc2.activate(owner);
}
}
use of com.shatteredpixel.shatteredpixeldungeon.items.keys.Key in project shattered-pixel-dungeon-gdx by 00-Evan.
the class Hero method actPickUp.
private boolean actPickUp(HeroAction.PickUp action) {
int dst = action.dst;
if (pos == dst) {
Heap heap = Dungeon.level.heaps.get(pos);
if (heap != null) {
Item item = heap.peek();
if (item.doPickUp(this)) {
heap.pickUp();
if (item instanceof Dewdrop || item instanceof TimekeepersHourglass.sandBag || item instanceof DriedRose.Petal || item instanceof Key) {
// Do Nothing
} else {
boolean important = ((item instanceof ScrollOfUpgrade || item instanceof ScrollOfMagicalInfusion) && ((Scroll) item).isKnown()) || ((item instanceof PotionOfStrength || item instanceof PotionOfMight) && ((Potion) item).isKnown());
if (important) {
GLog.p(Messages.get(this, "you_now_have", item.name()));
} else {
GLog.i(Messages.get(this, "you_now_have", item.name()));
}
}
curAction = null;
} else {
heap.sprite.drop();
ready();
}
} else {
ready();
}
return false;
} else if (getCloser(dst)) {
return true;
} else {
ready();
return false;
}
}
Aggregations