@Override public void empoweredRead() { ArrayList<Item> unIDed = new ArrayList<>(); for( Item i : curUser.belongings){ if (!i.isIdentified()){ unIDed.add(i); } } if (unIDed.size() > 1) { Random.element(unIDed).identify(); Sample.INSTANCE.play( Assets.SND_TELEPORT ); } doRead(); }
@Override public int price() { return isKnown() ? 30 * quantity : super.price(); } }
private static void initCommon( Hero hero ) { Item i = new ClothArmor().identify(); if (!Challenges.isItemBlocked(i)) hero.belongings.armor = (ClothArmor)i; i = new Food(); if (!Challenges.isItemBlocked(i)) i.collect(); if (Dungeon.isChallenged(Challenges.NO_FOOD)){ new SmallRation().collect(); } new ScrollOfIdentify().identify(); }
itemsToSpawn.add( Generator.random( Generator.Category.POTION ) ); itemsToSpawn.add( new ScrollOfIdentify() ); itemsToSpawn.add( new ScrollOfRemoveCurse() ); itemsToSpawn.add( new ScrollOfMagicMapping() );
private static void initCommon( Hero hero ) { Item i = new ClothArmor().identify(); if (!Challenges.isItemBlocked(i)) hero.belongings.armor = (ClothArmor)i; i = new Food(); if (!Challenges.isItemBlocked(i)) i.collect(); if (Dungeon.isChallenged(Challenges.NO_FOOD)){ new SmallRation().collect(); } new ScrollOfIdentify().identify(); }
itemsToSpawn.add( Generator.random( Generator.Category.POTION ) ); itemsToSpawn.add( new ScrollOfIdentify() ); itemsToSpawn.add( new ScrollOfRemoveCurse() ); itemsToSpawn.add( new ScrollOfMagicMapping() );
public void paint( Level level ) { Painter.fill( level, this, Terrain.WALL ); Painter.fill( level, this, 1, Terrain.EMPTY_SP ); Door entrance = entrance(); Painter.fill( level, left + 1, top+1, width() - 2, 1 , Terrain.BOOKSHELF ); Painter.drawInside(level, this, entrance, 1, Terrain.EMPTY_SP ); int n = Random.IntRange( 2, 3 ); for (int i=0; i < n; i++) { int pos; do { pos = level.pointToCell(random()); } while (level.map[pos] != Terrain.EMPTY_SP || level.heaps.get( pos ) != null); Item item; if (i == 0) item = Random.Int(2) == 0 ? new ScrollOfIdentify() : new ScrollOfRemoveCurse(); else item = prize( level ); level.drop( item, pos ); } entrance.set( Door.Type.LOCKED ); level.addItemToSpawn( new IronKey( Dungeon.depth ) ); }
@Override public int price() { return isKnown() ? 30 * quantity : super.price(); } }
@Override public void empoweredRead() { ArrayList<Item> unIDed = new ArrayList<>(); for( Item i : curUser.belongings){ if (!i.isIdentified()){ unIDed.add(i); } } if (unIDed.size() > 1) { Random.element(unIDed).identify(); Sample.INSTANCE.play( Assets.SND_TELEPORT ); } doRead(); }
public void paint( Level level ) { Painter.fill( level, this, Terrain.WALL ); Painter.fill( level, this, 1, Terrain.EMPTY_SP ); Door entrance = entrance(); Painter.fill( level, left + 1, top+1, width() - 2, 1 , Terrain.BOOKSHELF ); Painter.drawInside(level, this, entrance, 1, Terrain.EMPTY_SP ); int n = Random.IntRange( 2, 3 ); for (int i=0; i < n; i++) { int pos; do { pos = level.pointToCell(random()); } while (level.map[pos] != Terrain.EMPTY_SP || level.heaps.get( pos ) != null); Item item; if (i == 0) item = Random.Int(2) == 0 ? new ScrollOfIdentify() : new ScrollOfRemoveCurse(); else item = prize( level ); level.drop( item, pos ); } entrance.set( Door.Type.LOCKED ); level.addItemToSpawn( new IronKey( Dungeon.depth ) ); }