public static ArrayList<Item> tryRareDrop(Char target, int tries ){ if (getBonus(target, Wealth.class) <= 0) return null; HashSet<Wealth> buffs = target.buffs(Wealth.class); float triesToDrop = -1; //find the largest count (if they aren't synced yet) for (Wealth w : buffs){ if (w.triesToDrop() > triesToDrop){ triesToDrop = w.triesToDrop(); } } //reset (if needed), decrement, and store counts if (triesToDrop <= 0) triesToDrop += Random.NormalIntRange(15, 60); triesToDrop -= dropProgression( target, tries ); for (Wealth w : buffs){ w.triesToDrop(triesToDrop); } //now handle reward logic if (triesToDrop <= 0){ return generateRareDrop(); } else { return null; } }
public String statsInfo() { if (isIdentified()){ return Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (Math.pow(1.2f, soloBonus()) - 1f))); } else { return Messages.get(this, "typical_stats", new DecimalFormat("#.##").format(20f)); } }
public void rollToDropLoot(){ if (Dungeon.hero.lvl > maxLvl + 2) return; float lootChance = this.lootChance; lootChance *= RingOfWealth.dropChanceMultiplier( Dungeon.hero ); if (Random.Float() < lootChance) { Item loot = createLoot(); if (loot != null) { Dungeon.level.drop(loot, pos).sprite.drop(); } } //ring of wealth logic if (Ring.getBonus(Dungeon.hero, RingOfWealth.Wealth.class) > 0) { int rolls = 1; if (properties.contains(Property.BOSS)) rolls = 15; else if (properties.contains(Property.MINIBOSS)) rolls = 5; ArrayList<Item> bonus = RingOfWealth.tryRareDrop(Dungeon.hero, rolls); if (bonus != null) { for (Item b : bonus) Dungeon.level.drop(b, pos).sprite.drop(); new Flare(8, 32).color(0xFFFF00, true).show(sprite, 2f); } } }
"_-_ Cursed rings are now always harmful regardless of their level, until the curse is cleansed.\n\n" + "_-_ Scrolls of upgrade have a chance to remove curses on a ring, scrolls of remove curse will always remove the curse.")); changes.addButton( new ChangeButton( new ItemSprite(ItemSpriteSheet.RING_AMETHYST, null), new RingOfWealth().trueName(), "The ring of wealth is getting a change in emphasis, moving away from affecting items generally, and instead affecting item drops more strongly.\n\n" + "_-_ No longer grants any benefit to item spawns when levels are generated.\n\n" +
public static float dropChanceMultiplier( Char target ){ return (float)Math.pow(1.2, getBonus(target, Wealth.class)); }
ArrayList<Item> bonus = RingOfWealth.tryRareDrop(hero, 1); if (bonus != null){ items.addAll(0, bonus);
public void rollToDropLoot(){ if (Dungeon.hero.lvl > maxLvl + 2) return; float lootChance = this.lootChance; lootChance *= RingOfWealth.dropChanceMultiplier( Dungeon.hero ); if (Random.Float() < lootChance) { Item loot = createLoot(); if (loot != null) { Dungeon.level.drop(loot, pos).sprite.drop(); } } //ring of wealth logic if (Ring.getBonus(Dungeon.hero, RingOfWealth.Wealth.class) > 0) { int rolls = 1; if (properties.contains(Property.BOSS)) rolls = 15; else if (properties.contains(Property.MINIBOSS)) rolls = 5; ArrayList<Item> bonus = RingOfWealth.tryRareDrop(Dungeon.hero, rolls); if (bonus != null) { for (Item b : bonus) Dungeon.level.drop(b, pos).sprite.drop(); new Flare(8, 32).color(0xFFFF00, true).show(sprite, 2f); } } }
"_-_ Cursed rings are now always harmful regardless of their level, until the curse is cleansed.\n\n" + "_-_ Scrolls of upgrade have a chance to remove curses on a ring, scrolls of remove curse will always remove the curse.")); changes.addButton( new ChangeButton( new ItemSprite(ItemSpriteSheet.RING_AMETHYST, null), new RingOfWealth().trueName(), "The ring of wealth is getting a change in emphasis, moving away from affecting items generally, and instead affecting item drops more strongly.\n\n" + "_-_ No longer grants any benefit to item spawns when levels are generated.\n\n" +
private static float dropProgression( Char target, int tries ){ return tries * (float)Math.pow(1.2f, getBonus(target, Wealth.class) -1 ); }
ArrayList<Item> bonus = RingOfWealth.tryRareDrop(hero, 1); if (bonus != null){ items.addAll(0, bonus);
public static ArrayList<Item> tryRareDrop(Char target, int tries ){ if (getBonus(target, Wealth.class) <= 0) return null; HashSet<Wealth> buffs = target.buffs(Wealth.class); float triesToDrop = -1; //find the largest count (if they aren't synced yet) for (Wealth w : buffs){ if (w.triesToDrop() > triesToDrop){ triesToDrop = w.triesToDrop(); } } //reset (if needed), decrement, and store counts if (triesToDrop <= 0) triesToDrop += Random.NormalIntRange(15, 60); triesToDrop -= dropProgression( target, tries ); for (Wealth w : buffs){ w.triesToDrop(triesToDrop); } //now handle reward logic if (triesToDrop <= 0){ return generateRareDrop(); } else { return null; } }
public String statsInfo() { if (isIdentified()){ return Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (Math.pow(1.2f, soloBonus()) - 1f))); } else { return Messages.get(this, "typical_stats", new DecimalFormat("#.##").format(20f)); } }
public static float dropChanceMultiplier( Char target ){ return (float)Math.pow(1.2, getBonus(target, Wealth.class)); }
private static float dropProgression( Char target, int tries ){ return tries * (float)Math.pow(1.2f, getBonus(target, Wealth.class) -1 ); }