v2.5.0: fixed parchment scrap still affecting RNG in some cases
This commit is contained in:
@@ -568,16 +568,22 @@ public class Armor extends EquipableItem {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
level(n);
|
level(n);
|
||||||
|
|
||||||
//30% chance to be cursed
|
//we use a separate RNG here so that variance due to things like parchment scrap
|
||||||
//15% chance to be inscribed
|
//does not affect levelgen
|
||||||
float effectRoll = Random.Float();
|
Random.pushGenerator(Random.Long());
|
||||||
if (effectRoll < 0.3f * ParchmentScrap.curseChanceMultiplier()) {
|
|
||||||
inscribe(Glyph.randomCurse());
|
//30% chance to be cursed
|
||||||
cursed = true;
|
//15% chance to be inscribed
|
||||||
} else if (effectRoll >= 1f - (0.15f * ParchmentScrap.enchantChanceMultiplier())){
|
float effectRoll = Random.Float();
|
||||||
inscribe();
|
if (effectRoll < 0.3f * ParchmentScrap.curseChanceMultiplier()) {
|
||||||
}
|
inscribe(Glyph.randomCurse());
|
||||||
|
cursed = true;
|
||||||
|
} else if (effectRoll >= 1f - (0.15f * ParchmentScrap.enchantChanceMultiplier())){
|
||||||
|
inscribe();
|
||||||
|
}
|
||||||
|
|
||||||
|
Random.popGenerator();
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -331,16 +331,22 @@ abstract public class Weapon extends KindOfWeapon {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
level(n);
|
level(n);
|
||||||
|
|
||||||
//30% chance to be cursed
|
//we use a separate RNG here so that variance due to things like parchment scrap
|
||||||
//10% chance to be enchanted
|
//does not affect levelgen
|
||||||
float effectRoll = Random.Float();
|
Random.pushGenerator(Random.Long());
|
||||||
if (effectRoll < 0.3f * ParchmentScrap.curseChanceMultiplier()) {
|
|
||||||
enchant(Enchantment.randomCurse());
|
//30% chance to be cursed
|
||||||
cursed = true;
|
//10% chance to be enchanted
|
||||||
} else if (effectRoll >= 1f - (0.1f * ParchmentScrap.enchantChanceMultiplier())){
|
float effectRoll = Random.Float();
|
||||||
enchant();
|
if (effectRoll < 0.3f * ParchmentScrap.curseChanceMultiplier()) {
|
||||||
}
|
enchant(Enchantment.randomCurse());
|
||||||
|
cursed = true;
|
||||||
|
} else if (effectRoll >= 1f - (0.1f * ParchmentScrap.enchantChanceMultiplier())){
|
||||||
|
enchant();
|
||||||
|
}
|
||||||
|
|
||||||
|
Random.popGenerator();
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user