use of com.watabou.pixeldungeon.items.Item in project pixel-dungeon-remix by NYRDS.
the class ShopPainter method range.
private static Item[] range() {
ArrayList<Item> items = new ArrayList<>();
switch(Dungeon.depth) {
case 6:
items.add((Random.Int(2) == 0 ? new Quarterstaff() : new Spear()).identify());
items.add(new LeatherArmor().identify());
items.add(new Weightstone());
items.add(new TomeOfKnowledge().identify());
break;
case 11:
items.add((Random.Int(2) == 0 ? new Sword() : new Mace()).identify());
items.add(new MailArmor().identify());
items.add(new Weightstone());
items.add(new TomeOfKnowledge().identify());
break;
case 16:
items.add((Random.Int(2) == 0 ? new Longsword() : new BattleAxe()).identify());
items.add(new ScaleArmor().identify());
items.add(new Weightstone());
items.add(new TomeOfKnowledge().identify());
break;
case 21:
switch(Random.Int(3)) {
case 0:
items.add(new Glaive().identify());
break;
case 1:
items.add(new WarHammer().identify());
break;
case 2:
items.add(new PlateArmor().identify());
break;
}
items.add(new Weightstone());
items.add(new Torch());
items.add(new Torch());
break;
case 27:
switch(Random.Int(3)) {
case 0:
items.add(new Claymore().identify());
break;
case 1:
items.add(new Halberd().identify());
break;
case 2:
items.add(new GothicArmor().identify());
break;
}
items.add(new PotionOfHealing());
items.add(new PotionOfExperience());
items.add(new PotionOfMight());
break;
}
items.add(new PotionOfHealing());
for (int i = 0; i < 2; i++) {
items.add(Generator.random(Generator.Category.POTION));
}
items.add(new ScrollOfIdentify());
items.add(new ScrollOfRemoveCurse());
items.add(new ScrollOfMagicMapping());
items.add(Generator.random(Generator.Category.SCROLL));
items.add(new OverpricedRation());
items.add(new OverpricedRation());
items.add(new Ankh());
Collections.shuffle(items);
return items.toArray(new Item[items.size()]);
}
use of com.watabou.pixeldungeon.items.Item in project pixel-dungeon-remix by NYRDS.
the class ShopPainter method paint.
public static void paint(Level level, Room room) {
fill(level, room, Terrain.WALL);
fill(level, room, 1, Terrain.EMPTY_SP);
pasWidth = room.width() - 2;
pasHeight = room.height() - 2;
int per = pasWidth * 2 + pasHeight * 2;
Item[] range = range();
int pos = xy2p(room, room.entrance()) + (per - range.length) / 2;
for (int i = 0; i < range.length; i++) {
Point xy = p2xy(room, (pos + per) % per);
int cell = xy.x + xy.y * level.getWidth();
if (level.getHeap(cell) != null) {
do {
cell = room.random(level);
} while (level.getHeap(cell) != null);
}
level.drop(range[i], cell).type = Heap.Type.FOR_SALE;
pos++;
}
placeShopkeeper(level, room);
for (Room.Door door : room.connected.values()) {
door.set(Room.Door.Type.REGULAR);
}
}
use of com.watabou.pixeldungeon.items.Item in project pixel-dungeon-remix by NYRDS.
the class CityBossLevel method createItems.
@Override
protected void createItems() {
Item item = Bones.get();
if (item != null) {
int pos;
do {
pos = Random.IntRange(_Left() + 1, _Left() + HALL_WIDTH - 2) + Random.IntRange(TOP + HALL_HEIGHT + 1, TOP + HALL_HEIGHT + CHAMBER_HEIGHT) * getWidth();
} while (pos == entrance);
drop(item, pos).type = Heap.Type.SKELETON;
}
}
use of com.watabou.pixeldungeon.items.Item in project pixel-dungeon-remix by NYRDS.
the class HallsBossLevel method createItems.
@Override
protected void createItems() {
Item item = Bones.get();
if (item != null) {
int pos;
do {
pos = Random.IntRange(_RoomLeft(), _RoomRight()) + Random.IntRange(_RoomTop() + 1, _RoomBottom()) * getWidth();
} while (pos == entrance);
drop(item, pos).type = Heap.Type.SKELETON;
}
}
use of com.watabou.pixeldungeon.items.Item in project pixel-dungeon-remix by NYRDS.
the class AzuterronNPC method interact.
@Override
public boolean interact(final Hero hero) {
getSprite().turnTo(getPos(), hero.getPos());
if (Quest.completed) {
sell();
return true;
}
if (Quest.given) {
Item item = hero.belongings.getItem(HeartOfDarkness.class);
if (item != null) {
item.removeItemFrom(Dungeon.hero);
Item reward = new PotionOfMight();
if (reward.doPickUp(Dungeon.hero)) {
GLog.i(Hero.TXT_YOU_NOW_HAVE, reward.name());
} else {
Dungeon.level.drop(reward, hero.getPos()).sprite.drop();
}
Quest.complete();
GameScene.show(new WndQuest(this, TXT_QUEST_END));
} else {
GameScene.show(new WndQuest(this, TXT_QUEST));
}
} else {
GameScene.show(new WndQuest(this, TXT_QUEST_START));
Quest.given = true;
Quest.process();
Journal.add(Journal.Feature.AZUTERRON.desc());
}
return true;
}
Aggregations