Line indented where I spotted errors, even in the case of comment lines.
Code#!/usr/bin/env python
#charclass = character classes, case sensitive
charclass = raw_input('Character class: ')
#Setting character level
level = input('Character level? ')
#Setting the vitality per life, life per level, and starting life variables
vitlife = 0
lvlife = 0
slife = 0
#Setting all the input variables
vitality = input('Base vitality: ')
itemvitality = input('Vitality from items: ')
item_life_per_level = input('Life/level from items? ')
#Setting a BO level variable
bolvl = input('BO level: ')
bo = (bolvl * 3 + 32) / 100.0
#Transformed states variables
werewolf = 0
werebear = 0
lyc = 0
ww = raw_input('Werewolf? ')
if ww == 'yes':
werewolf = 0.25
lyc = input('Lycanthropy level? ')
elif ww == 'no':
werewolf = 0
wb = raw_input('Werebear? ')
if wb == 'yes':
werebear = 0.50
lyc = input('Lycanthropy level? ')
elif wb == 'no':
wearbear = 0
lycan = (lyc * 5 + 15) / 100.0
if wb == 'no':
lycan = 0
if ww == 'no':
lycan = 0
#Bird quest
bird = input('How many golden bird quests have you completed? ') * 20
#Percentage of +% life from items
itempercent = input('+% Life from items? ') / 100.0
#+ xx to life items
itemlife = input('+ X to life from items ')
#Oak sage variable
sage = input('Oak sage level')
oak = (sage * 5 + 25) / 100.0
#Character classes, vitality per life, life per level, starting life
if charclass == 'necromancer':
vitlife = 2
lvlife = 1.5
slife = 45
elif charclass == 'amazon':
vitlife = 3
lvlife = 2
slife = 50
elif charclass == 'assassin':
vitlife = 3
lvlife = 2
slife = 50
elif charclass == 'barbarian':
vitlife = 4
lvlife = 2
slife = 55
elif charclass == 'sorceress':
vitlife = 2
lvlife = 1
slife = 40
elif charclass == 'druid':
vitlife = 2
lvlife = 1.5
slife = 55
elif charclass == 'paladin':
vitlife = 3
lvlife = 2
slife = 55
#Life boosters
total_percent = itempercent + werebear + werewolf + lycan + bo + oak
#Boostable life
elife = slife + (lvlife *level) + itemlife +(vitality * vitlife) + bird
#Total life
lifetot = elife * (1 + total_percent) + itemvitality + item_life_per_level
print lifetot
Change indented lines to read:
#Setting the life per vitality, life per level, and starting life variables
statvitality = input('Vitality points spent: ') 
otherwise user ends up including the starting vitality which does not contribute at all (starting life is stored as variable '
slife').
bo = bolvl * 3 + 32
werewolf = 25
werebear = 50
lycan = lyc * 5 + 15
itempercent = input('+% Life from items? ')
oak = sage * 5 + 25
elife = slife + (lvlife * level) + itemlife + (statvitality * vitlife) + bird
lifetot = elife * (100 + total_percent)/100 + itemvitality * vitlife + item_life_per_level * levelNotice:
item_life_per_level need not be an integer (internally, the game handles this stat (
hp/lvl) in eighths, i.e. 12 means 1.5 per level), but as you know, fractions are truncated.
Hence the term
item_life_per_level * level should be rounded down.
Fixed the vitality problem by adding a variable which takes data from a library at the top of how much vitality they start with and it subtracts it from the input so users won't have to worry, but for the BO, wereforms, lycan, oak, that is all that way for a reason o.O If I didn't have them in parantheses the number coming out would be HUUUGE