diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Blacksmith.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Blacksmith.java index cb9310aba..0291374dc 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Blacksmith.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Blacksmith.java @@ -469,10 +469,14 @@ public class Blacksmith extends NPC { } // 30% base chance to be enchanted, stored separately so status isn't revealed early + //we generate first so that the outcome doesn't affect the number of RNG rolls + smithEnchant = Weapon.Enchantment.random(); + smithGlyph = Armor.Glyph.random(); + float enchantRoll = Random.Float(); - if (enchantRoll <= 0.3f * ParchmentScrap.enchantChanceMultiplier()){ - smithEnchant = Weapon.Enchantment.random(); - smithGlyph = Armor.Glyph.random(); + if (enchantRoll > 0.3f * ParchmentScrap.enchantChanceMultiplier()){ + smithEnchant = null; + smithGlyph = null; } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Ghost.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Ghost.java index 317aaaefb..7340dd15a 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Ghost.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Ghost.java @@ -351,10 +351,14 @@ public class Ghost extends NPC { armor.upgrade(itemLevel); // 20% base chance to be enchanted, stored separately so status isn't revealed early + //we generate first so that the outcome doesn't affect the number of RNG rolls + enchant = Weapon.Enchantment.random(); + glyph = Armor.Glyph.random(); + float enchantRoll = Random.Float(); - if (enchantRoll < 0.2f * ParchmentScrap.enchantChanceMultiplier()){ - enchant = Weapon.Enchantment.random(); - glyph = Armor.Glyph.random(); + if (enchantRoll > 0.2f * ParchmentScrap.enchantChanceMultiplier()){ + enchant = null; + glyph = null; } }