v2.5.0: fixed parchment scrap still affecting RNG in some cases

This commit is contained in:
Evan Debenham
2024-08-08 13:15:29 -04:00
parent 543bc3f587
commit 1ac5ac4fae
2 changed files with 32 additions and 20 deletions
@@ -569,6 +569,10 @@ public class Armor extends EquipableItem {
} }
level(n); level(n);
//we use a separate RNG here so that variance due to things like parchment scrap
//does not affect levelgen
Random.pushGenerator(Random.Long());
//30% chance to be cursed //30% chance to be cursed
//15% chance to be inscribed //15% chance to be inscribed
float effectRoll = Random.Float(); float effectRoll = Random.Float();
@@ -579,6 +583,8 @@ public class Armor extends EquipableItem {
inscribe(); inscribe();
} }
Random.popGenerator();
return this; return this;
} }
@@ -332,6 +332,10 @@ abstract public class Weapon extends KindOfWeapon {
} }
level(n); level(n);
//we use a separate RNG here so that variance due to things like parchment scrap
//does not affect levelgen
Random.pushGenerator(Random.Long());
//30% chance to be cursed //30% chance to be cursed
//10% chance to be enchanted //10% chance to be enchanted
float effectRoll = Random.Float(); float effectRoll = Random.Float();
@@ -342,6 +346,8 @@ abstract public class Weapon extends KindOfWeapon {
enchant(); enchant();
} }
Random.popGenerator();
return this; return this;
} }