diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java index 9dcb789b5..69d901193 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java @@ -680,8 +680,8 @@ public abstract class Mob extends Char { //lucky enchant logic if (Dungeon.hero.lvl <= maxLvl && buff(Lucky.LuckProc.class) != null){ - new Flare(8, 24).color(0x00FF00, true).show(sprite, 3f); Dungeon.level.drop(Lucky.genLoot(), pos).sprite.drop(); + Lucky.showFlare(sprite); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Lucky.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Lucky.java index b24dd3ba3..6a8a001d7 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Lucky.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Lucky.java @@ -23,12 +23,12 @@ package com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; -import com.shatteredpixel.shatteredpixeldungeon.items.Generator; -import com.shatteredpixel.shatteredpixeldungeon.items.Gold; import com.shatteredpixel.shatteredpixeldungeon.items.Item; +import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfWealth; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite.Glowing; +import com.watabou.noosa.Visual; import com.watabou.utils.Random; public class Lucky extends Weapon.Enchantment { @@ -52,20 +52,12 @@ public class Lucky extends Weapon.Enchantment { } public static Item genLoot(){ - float roll = Random.Float(); - if (roll < 0.6f){ - Item result = new Gold().random(); - result.quantity(Math.round(result.quantity() * 0.5f)); - return result; - } else if (roll < 0.9f){ - return Random.Int(2) == 0 - ? Generator.random(Generator.Category.SEED) - : Generator.random(Generator.Category.STONE); - } else { - return Random.Int(2) == 0 - ? Generator.random(Generator.Category.POTION) - : Generator.random(Generator.Category.SCROLL); - } + //80% common, 20% uncommon, 0% rare + return RingOfWealth.genConsumableDrop(-5); + } + + public static void showFlare( Visual vis ){ + RingOfWealth.showFlareForBonusDrop(vis); } @Override