javadragon
Well-known member
I am working with alientude's beast/plant/elemental shape files. There are some things that I want to edit/add to his files to make it more complete. The big thing that I want to add to each beast/plant/elemental shape is the polymorph size change table:
However, I do not want to add this logic to each and every shape. I am wondering if I can create a method/function in file so that I can just call this method/function like I do for SizeChange?
Code:
~ adjust the stats for size changes per polymorph spell
~ hero.tagis[Size.Tiny]
if (herofield[tSize].value = -4) then
hero.child[aSTR].field[Bonus].value += 6
hero.child[aDEX].field[Penalty].value -= 6
~ hero.tagis[Size.Diminutive]
elseif (herofield[tSize].value = -3) then
hero.child[aSTR].field[Bonus].value += 6
hero.child[aDEX].field[Penalty].value -= 4
~ hero.tagis[Size.Tiny]
elseif (herofield[tSize].value = -2) then
hero.child[aSTR].field[Bonus].value += 4
hero.child[aDEX].field[Penalty].value -= 2
~ hero.tagis[Size.Large]
elseif (herofield[tSize].value = 1) then
hero.child[aSTR].field[Penalty].value -= 4
hero.child[aDEX].field[Bonus].value += 2
hero.child[aCON].field[Penalty].value -= 2
~ hero.tagis[Size.Huge]
elseif (herofield[tSize].value = 2) then
hero.child[aSTR].field[Penalty].value -= 8
hero.child[aDEX].field[Bonus].value += 4
hero.child[aCON].field[Penalty].value -= 4
~ hero.tagis[Size.Gargantuan]
elseif (herofield[tSize].value = 3) then
hero.child[aSTR].field[Penalty].value -= 12
hero.child[aDEX].field[Bonus].value += 4
hero.child[aCON].field[Penalty].value -= 6
~ hero.tagis[Size.Colossal]
elseif (herofield[tSize].value = 4) then
hero.child[aSTR].field[Penalty].value -= 16
hero.child[aDEX].field[Bonus].value += 4
hero.child[aCON].field[Penalty].value -= 8
endif
However, I do not want to add this logic to each and every shape. I am wondering if I can create a method/function in file so that I can just call this method/function like I do for SizeChange?