From 63696cb502be3a7385da6ed5fa2ae0153fb48826 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sun, 14 Sep 2014 19:40:59 -0400 Subject: [PATCH] V0.2.0: Added last bit of Ring of Wealth logic --- .../shatteredpixeldungeon/actors/mobs/Mob.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java index 101808f3a..fb0957faf 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java @@ -36,6 +36,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Generator; import com.shatteredpixel.shatteredpixeldungeon.items.Heap; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfAccuracy; +import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfWealth; import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; @@ -467,6 +468,14 @@ public abstract class Mob extends Char { @SuppressWarnings("unchecked") protected void dropLoot() { + float lootChance = this.lootChance; + int bonus = 0; + for (Buff buff : Dungeon.hero.buffs(RingOfWealth.Wealth.class)) { + bonus += ((RingOfWealth.Wealth) buff).level; + } + + lootChance *= Math.pow(1.1, bonus); + if (loot != null && Random.Float() < lootChance) { Item item = null; if (loot instanceof Generator.Category) {