v0.2.4: tweaked item generation: treasuries spawn a bit more gold, bombs are in armories, and honeypots are in shortages.

This commit is contained in:
Evan Debenham 2015-02-10 13:50:15 -05:00
parent 72975a49cc
commit dded8b5dc4
4 changed files with 17 additions and 7 deletions

View File

@ -103,7 +103,7 @@ public class Gold extends Item {
@Override @Override
public Item random() { public Item random() {
quantity = Random.Int( 20 + Dungeon.depth * 10, 40 + Dungeon.depth * 20 ); quantity = Random.Int( 30 + Dungeon.depth * 10, 60 + Dungeon.depth * 20 );
return this; return this;
} }

View File

@ -18,6 +18,7 @@
package com.shatteredpixel.shatteredpixeldungeon.levels.painters; package com.shatteredpixel.shatteredpixeldungeon.levels.painters;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.items.Bomb;
import com.shatteredpixel.shatteredpixeldungeon.items.Generator; import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.keys.IronKey; import com.shatteredpixel.shatteredpixeldungeon.items.keys.IronKey;
@ -63,9 +64,11 @@ public class ArmoryPainter extends Painter {
} }
private static Item prize( Level level ) { private static Item prize( Level level ) {
return Generator.random( Random.oneOf( return Random.Int( 6 ) == 0 ?
Generator.Category.ARMOR, new Bomb().random() :
Generator.Category.WEAPON Generator.random( Random.oneOf(
) ); Generator.Category.ARMOR,
Generator.Category.WEAPON
) );
} }
} }

View File

@ -18,6 +18,7 @@
package com.shatteredpixel.shatteredpixeldungeon.levels.painters; package com.shatteredpixel.shatteredpixeldungeon.levels.painters;
import com.shatteredpixel.shatteredpixeldungeon.items.Generator; import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
import com.shatteredpixel.shatteredpixeldungeon.items.Honeypot;
import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfLiquidFlame; import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfLiquidFlame;
import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
@ -34,13 +35,19 @@ public class StoragePainter extends Painter {
fill( level, room, Terrain.WALL ); fill( level, room, Terrain.WALL );
fill( level, room, 1, floor ); fill( level, room, 1, floor );
boolean honeyPot = Random.Int( 2 ) == 0;
int n = Random.IntRange( 3, 4 ); int n = Random.IntRange( 3, 4 );
for (int i=0; i < n; i++) { for (int i=0; i < n; i++) {
int pos; int pos;
do { do {
pos = room.random(); pos = room.random();
} while (level.map[pos] != floor); } while (level.map[pos] != floor);
level.drop( prize( level ), pos ); if (honeyPot){
level.drop( new Honeypot(), pos);
honeyPot = false;
} else
level.drop( prize( level ), pos );
} }
room.entrance().set( Room.Door.Type.BARRICADE ); room.entrance().set( Room.Door.Type.BARRICADE );

View File

@ -52,7 +52,7 @@ public class TreasuryPainter extends Painter {
do { do {
pos = room.random(); pos = room.random();
} while (level.map[pos] != Terrain.EMPTY); } while (level.map[pos] != Terrain.EMPTY);
level.drop( new Gold( Random.IntRange( 1, 3 ) ), pos ); level.drop( new Gold( Random.IntRange( 5, 12 ) ), pos );
} }
} }