Junior Member
Join Date: Dec 2009
Posts: 3
|
To cut a long story short, one of the classes I'm attempting to code in has a feature that uses its Con bonus to add to its Natural Armor, with a minimum of 1. I've tried bootstrapping it with the code below, but I can't seem to get it to change at all with the stats.
Code:
hero.child[mNatural].field[Bonus].value = hero.child[mNatural].field[Bonus].value + hero.child[aCON].field[aNormMod].value |
#1 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
Natural armor is:
hero.child[ArmorClass].field[tACNatural].value Timing? Since you want the Con mod, you'll need to be in the Post-Attributes phase or later (Post-Attributes/10000 seems about right). I'd suggest using aModBonus instead of aNormMod - otherwise, your Amulet of Health's effects won't be added to your natural armor. Since you want a minimum bonus (and I'm shortening the amount of typing as well): Code:
hero.child[ArmorClass].field[tACNatural].value += maximum(hero.child[aCON].field[aModBonus].value, 1) |
#2 |
Junior Member
Join Date: Dec 2009
Posts: 3
|
Ah, I was using it Post-Levels. My bad, forgot to whack that in there.
And that worked a charm, thanks! I'll have to remember that code. |
#3 |
|
|