v2.5.0: fixed ghost and smith enchant RNG outcomes affecting levelgen

This commit is contained in:
Evan Debenham
2024-06-30 13:44:55 -04:00
parent 0d9746b598
commit b6dd63a649
2 changed files with 14 additions and 6 deletions
@@ -469,10 +469,14 @@ public class Blacksmith extends NPC {
} }
// 30% base chance to be enchanted, stored separately so status isn't revealed early // 30% base chance to be enchanted, stored separately so status isn't revealed early
float enchantRoll = Random.Float(); //we generate first so that the outcome doesn't affect the number of RNG rolls
if (enchantRoll <= 0.3f * ParchmentScrap.enchantChanceMultiplier()){
smithEnchant = Weapon.Enchantment.random(); smithEnchant = Weapon.Enchantment.random();
smithGlyph = Armor.Glyph.random(); smithGlyph = Armor.Glyph.random();
float enchantRoll = Random.Float();
if (enchantRoll > 0.3f * ParchmentScrap.enchantChanceMultiplier()){
smithEnchant = null;
smithGlyph = null;
} }
} }
@@ -351,10 +351,14 @@ public class Ghost extends NPC {
armor.upgrade(itemLevel); armor.upgrade(itemLevel);
// 20% base chance to be enchanted, stored separately so status isn't revealed early // 20% base chance to be enchanted, stored separately so status isn't revealed early
float enchantRoll = Random.Float(); //we generate first so that the outcome doesn't affect the number of RNG rolls
if (enchantRoll < 0.2f * ParchmentScrap.enchantChanceMultiplier()){
enchant = Weapon.Enchantment.random(); enchant = Weapon.Enchantment.random();
glyph = Armor.Glyph.random(); glyph = Armor.Glyph.random();
float enchantRoll = Random.Float();
if (enchantRoll > 0.2f * ParchmentScrap.enchantChanceMultiplier()){
enchant = null;
glyph = null;
} }
} }