diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DM100.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DM100.java index 4a0c74b63..dd8268644 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DM100.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DM100.java @@ -48,7 +48,7 @@ public class DM100 extends Mob implements Callback { maxLvl = 13; loot = Generator.Category.SCROLL; - lootChance = 0.33f; + lootChance = 0.25f; properties.add(Property.ELECTRIC); properties.add(Property.INORGANIC); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Warlock.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Warlock.java index 905f4bea0..e4a3f2fdf 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Warlock.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Warlock.java @@ -53,7 +53,7 @@ public class Warlock extends Mob implements Callback { maxLvl = 21; loot = Generator.Category.POTION; - lootChance = 0.83f; + lootChance = 0.5f; properties.add(Property.UNDEAD); } @@ -134,21 +134,31 @@ public class Warlock extends Mob implements Callback { } @Override - //TODO refactor warlock drops, they shouldn't pull from regular healing potion pool public Item createLoot(){ - Item loot = super.createLoot(); - if (loot instanceof PotionOfHealing){ - - //count/8 chance of not dropping potion - if (Random.Float() < ((8f - Dungeon.LimitedDrops.WARLOCK_HP.count) / 8f)){ - Dungeon.LimitedDrops.WARLOCK_HP.count++; - } else { - return null; + // 1/6 chance for healing, scaling to 0 over 8 drops + if (Random.Int(2) == 0 && Random.Int(8) > Dungeon.LimitedDrops.WARLOCK_HP.count ){ + Dungeon.LimitedDrops.WARLOCK_HP.drop(); + return new PotionOfHealing(); + } else { + Item i = Generator.random(Generator.Category.POTION); + int healingTried = 0; + while (i instanceof PotionOfHealing){ + healingTried++; + i = Generator.random(Generator.Category.POTION); } + //return the attempted healing potion drops to the pool + if (healingTried > 0){ + for (int j = 0; j < Generator.Category.POTION.classes.length; j++){ + if (Generator.Category.POTION.classes[j] == PotionOfHealing.class){ + Generator.Category.POTION.probs[j] += healingTried; + } + } + } + + return i; } - return loot; } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Generator.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Generator.java index b92209543..ddc95be3f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Generator.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Generator.java @@ -188,7 +188,7 @@ public class Generator { ARMOR ( 4, Armor.class ), - MISSILE ( 3, MissileWeapon.class ), + MISSILE ( 4, MissileWeapon.class ), MIS_T1 ( 0, MissileWeapon.class ), MIS_T2 ( 0, MissileWeapon.class ), MIS_T3 ( 0, MissileWeapon.class ), @@ -201,13 +201,13 @@ public class Generator { FOOD ( 0, Food.class ), - POTION ( 20, Potion.class ), - SEED ( 0, Plant.Seed.class ), //dropped by grass + POTION ( 16, Potion.class ), + SEED ( 2, Plant.Seed.class ), - SCROLL ( 20, Scroll.class ), + SCROLL ( 16, Scroll.class ), STONE ( 2, Runestone.class), - GOLD ( 18, Gold.class ); + GOLD ( 20, Gold.class ); public Class[] classes; @@ -270,8 +270,7 @@ public class Generator { Earthroot.Seed.class, Dreamfoil.Seed.class, Starflower.Seed.class}; - //TODO adjust these - SEED.defaultProbs = new float[]{ 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 1 }; + SEED.defaultProbs = new float[]{ 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 1 }; SEED.probs = SEED.defaultProbs.clone(); SCROLL.classes = new Class[]{ @@ -303,10 +302,9 @@ public class Generator { StoneOfAggression.class, StoneOfBlast.class, StoneOfAffection.class, - StoneOfAugmentation.class //1 is also sold in each shop + StoneOfAugmentation.class //1 is sold in each shop }; - //TODO adjust these - STONE.defaultProbs = new float[]{ 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0 }; + STONE.defaultProbs = new float[]{ 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0 }; STONE.probs = STONE.defaultProbs.clone(); WAND.classes = new Class[]{ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/LibraryRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/LibraryRoom.java index a539ec935..fbcb954d2 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/LibraryRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/LibraryRoom.java @@ -45,7 +45,7 @@ public class LibraryRoom extends SpecialRoom { 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 ); + int n = Random.NormalIntRange( 1, 3 ); for (int i=0; i < n; i++) { int pos; do { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/ShopRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/ShopRoom.java index 5eaa3cf70..a90b119c9 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/ShopRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/ShopRoom.java @@ -198,12 +198,10 @@ public class ShopRoom extends SpecialRoom { itemsToSpawn.add( new PotionOfHealing() ); itemsToSpawn.add( Generator.randomUsingDefaults( Generator.Category.POTION ) ); itemsToSpawn.add( Generator.randomUsingDefaults( Generator.Category.POTION ) ); - itemsToSpawn.add( Generator.randomUsingDefaults( Generator.Category.POTION ) ); itemsToSpawn.add( new ScrollOfIdentify() ); itemsToSpawn.add( new ScrollOfRemoveCurse() ); itemsToSpawn.add( new ScrollOfMagicMapping() ); - itemsToSpawn.add( Generator.randomUsingDefaults( Generator.Category.SCROLL ) ); for (int i=0; i < 2; i++) itemsToSpawn.add( Random.Int(2) == 0 ?