@Override public String desc() { return key.toString(); }
@Override public boolean equals(Object obj) { return (obj instanceof KeyRecord) && key.isSimilar(((KeyRecord) obj).key); }
public int quantity(){ return key.quantity(); }
Notes.remove(new IronKey(Dungeon.depth)); Level.set( doorCell, Terrain.DOOR ); } else { Notes.remove(new SkeletonKey(Dungeon.depth)); Level.set( doorCell, Terrain.UNLOCKED_EXIT ); Sample.INSTANCE.play( Assets.SND_BONES ); } else if (heap.type == Type.LOCKED_CHEST){ Notes.remove(new GoldenKey(Dungeon.depth)); } else if (heap.type == Type.CRYSTAL_CHEST){ Notes.remove(new CrystalKey(Dungeon.depth));
public void paint( Level level ) { Painter.fill( level, this, Terrain.WALL ); Painter.fill( level, this, 1, Terrain.EMPTY_SP ); Painter.fill( level, this, 2, Terrain.EMPTY ); int cx = (left + right) / 2; int cy = (top + bottom) / 2; int c = cx + cy * level.width(); Random.shuffle(prizeClasses); Item i1, i2; i1 = prize( level ); i2 = prize( level ); level.drop( i1, c ).type = Heap.Type.CRYSTAL_CHEST; level.drop( i2, c + PathFinder.NEIGHBOURS8[Random.Int( 8 )]).type = Heap.Type.CRYSTAL_CHEST; level.addItemToSpawn( new CrystalKey( Dungeon.depth ) ); entrance().set( Door.Type.LOCKED ); level.addItemToSpawn( new IronKey( Dungeon.depth ) ); }
@Override protected void createItems() { Item item = Bones.get(); if (item != null) { drop( item, randomRespawnCell() ).setHauntedIfCursed(1f).type = Heap.Type.REMAINS; } drop(new IronKey(10), randomPrisonCell()); }
Notes.remove(new IronKey(Dungeon.depth)); Level.set( doorCell, Terrain.DOOR ); } else { Notes.remove(new SkeletonKey(Dungeon.depth)); Level.set( doorCell, Terrain.UNLOCKED_EXIT ); Sample.INSTANCE.play( Assets.SND_BONES ); } else if (heap.type == Type.LOCKED_CHEST){ Notes.remove(new GoldenKey(Dungeon.depth)); } else if (heap.type == Type.CRYSTAL_CHEST){ Notes.remove(new CrystalKey(Dungeon.depth));
public void quantity(int num){ key.quantity(num); }
public void paint( Level level ) { Painter.fill( level, this, Terrain.WALL ); Painter.fill( level, this, 1, Terrain.EMPTY_SP ); Painter.fill( level, this, 2, Terrain.EMPTY ); int cx = (left + right) / 2; int cy = (top + bottom) / 2; int c = cx + cy * level.width(); Random.shuffle(prizeClasses); Item i1, i2; i1 = prize( level ); i2 = prize( level ); level.drop( i1, c ).type = Heap.Type.CRYSTAL_CHEST; level.drop( i2, c + PathFinder.NEIGHBOURS8[Random.Int( 8 )]).type = Heap.Type.CRYSTAL_CHEST; level.addItemToSpawn( new CrystalKey( Dungeon.depth ) ); entrance().set( Door.Type.LOCKED ); level.addItemToSpawn( new IronKey( Dungeon.depth ) ); }
@Override public String desc() { return key.toString(); }
@Override public boolean equals(Object obj) { return (obj instanceof KeyRecord) && key.isSimilar(((KeyRecord) obj).key); }
@Override protected void createItems() { Item item = Bones.get(); if (item != null) { drop( item, randomRespawnCell() ).setHauntedIfCursed(1f).type = Heap.Type.REMAINS; } drop(new IronKey(10), randomPrisonCell()); }
public void quantity(int num){ key.quantity(num); }
public int quantity(){ return key.quantity(); }
public static void add( Key key ){ KeyRecord k = new KeyRecord(key); if (!records.contains(k)){ records.add(k); Collections.sort(records); } else { k = (KeyRecord) records.get(records.indexOf(k)); k.quantity(k.quantity() + key.quantity()); } }
public static void add( Key key ){ KeyRecord k = new KeyRecord(key); if (!records.contains(k)){ records.add(k); Collections.sort(records); } else { k = (KeyRecord) records.get(records.indexOf(k)); k.quantity(k.quantity() + key.quantity()); } }
public static void remove( Key key ){ KeyRecord k = new KeyRecord( key ); if (records.contains(k)){ k = (KeyRecord) records.get(records.indexOf(k)); k.quantity(k.quantity() - key.quantity()); if (k.quantity() <= 0){ records.remove(k); } } }
public static void remove( Key key ){ KeyRecord k = new KeyRecord( key ); if (records.contains(k)){ k = (KeyRecord) records.get(records.indexOf(k)); k.quantity(k.quantity() - key.quantity()); if (k.quantity() <= 0){ records.remove(k); } } }