v2.5.0: fixed ghost and smith enchant RNG outcomes affecting levelgen
This commit is contained in:
+6
-2
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-2
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user