diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Bat.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Bat.java index fddca7e40..8f3022054 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Bat.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Bat.java @@ -26,7 +26,6 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfHealing; -import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Vampiric; import com.shatteredpixel.shatteredpixeldungeon.sprites.BatSprite; import com.watabou.utils.Random; @@ -45,7 +44,7 @@ public class Bat extends Mob { flying = true; loot = new PotionOfHealing(); - lootChance = 0.1667f; //by default, see die() + lootChance = 0.1667f; //by default, see rollToDropLoot() } @Override @@ -75,14 +74,13 @@ public class Bat extends Mob { return damage; } - + @Override - public void die( Object cause ){ - //sets drop chance - lootChance = 1f/((6 + Dungeon.LimitedDrops.BAT_HP.count )); - super.die( cause ); + public void rollToDropLoot() { + lootChance *= ((7f - Dungeon.LimitedDrops.BAT_HP.count) / 7f); + super.rollToDropLoot(); } - + @Override protected Item createLoot(){ Dungeon.LimitedDrops.BAT_HP.count++; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Guard.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Guard.java index 04aae9145..52886b6d7 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Guard.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Guard.java @@ -135,10 +135,10 @@ public class Guard extends Mob { } while (loot.tier >= 4 && Random.Int(2) == 0); loot.level(0); return loot; - //otherwise, we may drop a health potion. overall chance is 7/(8 * (7 + potions dropped)) + //otherwise, we may drop a health potion. overall chance is 1/8 * (6-potions dropped)/6 //with 0 potions dropped that simplifies to 1/8 } else { - if (Random.Int(7 + Dungeon.LimitedDrops.GUARD_HP.count) < 7){ + if (Random.Float() < ((6f - Dungeon.LimitedDrops.GUARD_HP.count) / 6f)){ Dungeon.LimitedDrops.GUARD_HP.drop(); return new PotionOfHealing(); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Scorpio.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Scorpio.java index d8adba69a..40980c321 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Scorpio.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Scorpio.java @@ -26,11 +26,9 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Cripple; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Light; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Poison; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.food.MysteryMeat; import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfHealing; -import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Vampiric; import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica; import com.shatteredpixel.shatteredpixeldungeon.sprites.ScorpioSprite; import com.watabou.utils.Random; @@ -95,8 +93,8 @@ public class Scorpio extends Mob { @Override protected Item createLoot() { - //5/count+5 total chance of getting healing, failing the 2nd roll drops mystery meat instead. - if (Random.Int( 5 + Dungeon.LimitedDrops.SCORPIO_HP.count ) < 5) { + //(9-count) / 9 chance of getting healing, otherwise mystery meat + if (Random.Float() < ((9f - Dungeon.LimitedDrops.SCORPIO_HP.count) / 9f)) { Dungeon.LimitedDrops.SCORPIO_HP.count++; return (Item)loot; } else { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Swarm.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Swarm.java index b5b7acc60..ffb998d2f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Swarm.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Swarm.java @@ -139,8 +139,8 @@ public class Swarm extends Mob { @Override public void rollToDropLoot() { - //sets drop chance - lootChance = 1f/((6 + 2* Dungeon.LimitedDrops.SWARM_HP.count ) * (generation+1) ); + lootChance = 1f/(6 * (generation+1) ); + lootChance *= (5f - Dungeon.LimitedDrops.SWARM_HP.count) / 5f; super.rollToDropLoot(); } 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 d0dad16ce..042414bc2 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 @@ -132,10 +132,11 @@ public class Warlock extends Mob implements Callback { if (loot instanceof PotionOfHealing){ //count/10 chance of not dropping potion - if ((Random.Int(10) - Dungeon.LimitedDrops.WARLOCK_HP.count) < 0){ - return null; - } else + if (Random.Float() < ((8f - Dungeon.LimitedDrops.WARLOCK_HP.count) / 8f)){ Dungeon.LimitedDrops.WARLOCK_HP.count++; + } else { + return null; + } }