v0.8.1: buff/redesign to lucky, now pulls from ring of wealth pools
This commit is contained in:
parent
de1c3518ae
commit
671f4fba69
|
@ -680,8 +680,8 @@ public abstract class Mob extends Char {
|
||||||
|
|
||||||
//lucky enchant logic
|
//lucky enchant logic
|
||||||
if (Dungeon.hero.lvl <= maxLvl && buff(Lucky.LuckProc.class) != null){
|
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();
|
Dungeon.level.drop(Lucky.genLoot(), pos).sprite.drop();
|
||||||
|
Lucky.showFlare(sprite);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,12 +23,12 @@ package com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments;
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
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.Item;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfWealth;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon;
|
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite.Glowing;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite.Glowing;
|
||||||
|
import com.watabou.noosa.Visual;
|
||||||
import com.watabou.utils.Random;
|
import com.watabou.utils.Random;
|
||||||
|
|
||||||
public class Lucky extends Weapon.Enchantment {
|
public class Lucky extends Weapon.Enchantment {
|
||||||
|
@ -52,20 +52,12 @@ public class Lucky extends Weapon.Enchantment {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Item genLoot(){
|
public static Item genLoot(){
|
||||||
float roll = Random.Float();
|
//80% common, 20% uncommon, 0% rare
|
||||||
if (roll < 0.6f){
|
return RingOfWealth.genConsumableDrop(-5);
|
||||||
Item result = new Gold().random();
|
}
|
||||||
result.quantity(Math.round(result.quantity() * 0.5f));
|
|
||||||
return result;
|
public static void showFlare( Visual vis ){
|
||||||
} else if (roll < 0.9f){
|
RingOfWealth.showFlareForBonusDrop(vis);
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue
Block a user