2009-07-13, 08:31 PM
Rewrote it closer to the actual function
I'll post the translated ASM later.
Code:
def randStat(VariationType, WeaponStat):
baseChange = (WeaponStat / 10) + 1
if VarationType == "Gachapon" and baseChange > 7:
baseChange = 7
if VariationType == "RegItem" and baseChange > 5:
baseChange = 5
if VariationType == "ChaosScroll":
baseChange = 5
rand = CRand32.Rand()
wepStatDelta = 0
for change in range(baseChange):
wepStatDelta += rand & 1
rand >>= 1
rand = CRand32.Rand()
if(rand > 0):
return WeaponStat + wepStatDelta
else:
return WeaponStat - wepStatDeltaI'll post the translated ASM later.
