2009-04-02, 06:03 AM
Fiel Wrote:I don't think I'd want to go through the mess of trying to [noparse]
[/noparse] that. Furthermore, I had a hell of a time trying to figure out the formula to match your results. I finally cracked it, though. This is the code that worked for me; I had a hard time with Russt's formula: Code:class AComboAttack:
def __init__(self):
self.AComboAttackLevels = [[121, 6], [122, 6],
[123, 6], [124, 6],
[125, 6], [126, 6],
[127, 7], [128, 7],
[129, 7], [130, 7],
[131, 7], [132, 7],
[133, 8], [134, 8],
[135, 8], [136, 8],
[137, 8], [138, 8],
[139, 9], [140, 9],
[141, 9], [142, 9],
[143, 9], [144, 9],
[145, 10], [146, 10],
[147, 10], [148, 10],
[149, 10], [150, 10]]
def AComboAttack(self, Level):
if Level <= 0:
raise Exception("Level cannot be less than or equal to 0!")
if Level > 30:
raise Exception("Level cannot be greater than 30!")
AComboPercentage, TotalOrbs = self.AComboAttackLevels[Level-1]
print("Level: %d" % (Level))
for EachOrb in range(TotalOrbs):
#This gets orbs 0, 1, 2, 3, 4
if(EachOrb < 5):
Multiplier = AComboPercentage + (EachOrb * (Level / 6))
#Orbs 5, 6, 7, 8, 9
else:
Multiplier = AComboPercentage + 20 + (EachOrb - 4) * 4
print(" ORB %d: %d" % (EachOrb + 1, int(Multiplier)))
print("")
MyClass = AComboAttack()
for Level in range(1, 31):
MyClass.AComboAttack(Level)I've not tested it, but this should work?: Code:def adv_combo(orbs, lvl):
if lvl < 0:
raise Exception("Level cannot be less than 0!")
if lvl > 29:
raise Exception("Level cannot be greater than 29!")
orbs = limit_orbs(orbs, lvl)
if (orbs == 0)
return 100
elif (orbs < 6)
return 116 + lvl + (5 * orbs)
elif
return 141 + lvl + (4 * (orbs - 5))
def limit_orbs(orbs, lvl):
return min(orbs, 5 + lvl // 6)
def print_table():
print("[table]")
for lvl in range(30):
for orbs in range(11):
print(adv_combo(orbs, lvl) + "|")
print("\n")
print("[\table]")lvl is zero-indexed.

