From c3910a127788ea0d123b64553fac45d17307b4ba Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sat, 26 Mar 2016 04:48:17 -0400 Subject: [PATCH] v0.3.5: refactored guard item drop code, now works with ring of wealth. --- .../shatteredpixeldungeon/actors/mobs/Guard.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Guard.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Guard.java index ba1a76893..e819922fb 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Guard.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Guard.java @@ -52,7 +52,7 @@ public class Guard extends Mob { maxLvl = 14; loot = null; //see createloot. - lootChance = 1; + lootChance = 0.25f; properties.add(Property.DEMONIC); } @@ -136,13 +136,13 @@ public class Guard extends Mob { @Override protected Item createLoot() { - //first see if we drop armor, chance is 1/8 (0.125f) - if (Random.Int(8) == 0){ + //first see if we drop armor, overall chance is 1/8 + if (Random.Int(2) == 0){ return Generator.randomArmor(); - //otherwise, we may drop a health potion. Chance is 1/(7+potions dropped) - //including the chance for armor before it, effective droprate is ~1/(8 + (1.15*potions dropped)) + //otherwise, we may drop a health potion. overall chance is 7/(8 * (7 + potions dropped)) + //with 0 potions dropped that simplifies to 1/8 } else { - if (Random.Int(7 + Dungeon.limitedDrops.guardHP.count) == 0){ + if (Random.Int(7 + Dungeon.limitedDrops.guardHP.count) < 7){ Dungeon.limitedDrops.guardHP.drop(); return new PotionOfHealing(); }