Dirtydeedz
Member
Hello I have created a new racial trait. However, the benefit of the trait is determined by the constitution score.
Where X should equate to something like: hero.childfound[isCheckCon] += (4 is +1, 7 is +2, 11 is +3, 14 is +4, 18 is +5)
I simply do not know how to insert X into the statement. However, I can follow example code.
Well, I scripted a solution. If anyone would like to show me some cleaner code, especially on daisy-chaining "if's" instead of something like "&&", I would appreciate it. I also, couldn't get a "string &= "blah blah"" to compile inside of a #situational
Code:
~ If we're disabled, just get out now
doneif (tagis[Helper.SpcDisable] <> 0)
#situational[hero.child[svAll],"+X vs. spell & spell-like abilites",field[thingname].text]
Where X should equate to something like: hero.childfound[isCheckCon] += (4 is +1, 7 is +2, 11 is +3, 14 is +4, 18 is +5)
I simply do not know how to insert X into the statement. However, I can follow example code.
Well, I scripted a solution. If anyone would like to show me some cleaner code, especially on daisy-chaining "if's" instead of something like "&&", I would appreciate it. I also, couldn't get a "string &= "blah blah"" to compile inside of a #situational
Code:
~ If we're disabled, just get out now
doneif (tagis[Helper.SpcDisable] <> 0)
var str as string
if (#attrvalue[aCON] < 4) then
str = "+0"
endif
if (#attrvalue[aCON] > 3) then
if (#attrvalue[aCON] < 7) then
str = "+1"
endif
endif
if (#attrvalue[aCON] > 6) then
if (#attrvalue[aCON] < 11) then
str = "+2"
endif
endif
if (#attrvalue[aCON] > 10) then
if (#attrvalue[aCON] < 14) then
str = "+3"
endif
endif
if (#attrvalue[aCON] > 13) then
if (#attrvalue[aCON] < 18) then
str = "+4"
endif
endif
if (#attrvalue[aCON] >= 18) then
str = "+5"
endif
str &= " vs. spell & spell-like abilites"
#situational[hero.child[svAll],str,field[thingname].text]
Last edited: