I can answer my own question:
It seems though that code like this should be included into a LOT of
powers, they always took the easy way and used just one of the options and wrote the rest down as text. Note, that a third variable (attidstr3) is needed, originally I had "attidstr = "attrCha"" etc. in this example overwriting the old value and then it always used the default, when I was using a third variable it works correctly (for both cases, Int>Cha and Cha>Int)
var bonus as number
var bonus2 as number
var attidstr as string
var attidstr2 as string
var attidstr3 as string
bonus = #attrbonus[attrInt]
attidstr = "attrInt"
bonus2 = #attrbonus[attrCha]
attidstr2 = "attrCha"
if (#attrbonus[attrCha]>#attrbonus[attrInt]) then
bonus = #attrbonus[attrCha]
attidstr3 = "attrCha"
else
bonus = #attrbonus[attrInt]
attidstr3 = "attrInt"
endif
~ Use that as the damage and attack attributes
perform assignstr["DamageAttr." & attidstr3]
perform assignstr["Attack." & attidstr3]
|