Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | quizzcode |
Hey there !
Working on the effect of attack_type vs enemy_armor and define a modifier’s damage to it.
I got it to work. But dear lord it’s ugly.
I can’t think of any other way to list it… Anyone has a “shorter” idea ? Match ?
#Let's define the modifier depending on attakinng atype and monster's armor
##### Attack type :
##### 1 normal
##### 2 pierce
##### 3 siege
##### 4 magic
##### 5 heroic : 100% all but divine armor
#####Armor type :
##### 0 Unarmored : 100%
##### 1 light armor
##### 2 medium armor
##### 3 heavy armor
##### 4 fortified armor
##### 5 divine armor : onlly 30% no matter what.
if attack_type == 1: #NORMAL ATTACK
if armor_type == 1:
damage_modifier = 1.5#%
elif armor_type == 2:
damage_modifier = 1#%
elif armor_type == 3:
damage_modifier = 1#%
elif armor_type == 4:
damage_modifier = 0.7#%
elif armor_type == 5:
damage_modifier = 0.3#%
elif attack_type == 2:
if armor_type == 1:
damage_modifier = 0.7#%
elif armor_type == 2:
damage_modifier = 1.5#%
elif armor_type == 3:
damage_modifier = 1#%
elif armor_type == 4:
damage_modifier = 1#%
elif armor_type == 5:
damage_modifier = 0.3#%
elif attack_type == 3:
if armor_type == 1:
damage_modifier = 1#%
elif armor_type == 2:
damage_modifier = 0.7#%
elif armor_type == 3:
damage_modifier = 1.5#%
elif armor_type == 4:
damage_modifier = 1#%
elif armor_type == 5:
damage_modifier = 0.3#%
elif attack_type == 4:
if armor_type == 1:
damage_modifier = 1#%
elif armor_type == 2:
damage_modifier = 1#%
elif armor_type == 3:
damage_modifier = 0.7#%
elif armor_type == 4:
damage_modifier = 1.5#%
elif armor_type == 5:
damage_modifier = 0.3#%
elif attack_type == 5: #Heroic type doe 100% but for divine armor
if armor_type == 5:
damage_modifier = 0.3#%
else:
damage_modifier = 1#%