Junior Member
Join Date: Jun 2015
Posts: 23
|
Trying to code this feat and running into issues around how to reduce the AC penalty for shields by 1. Could anyone help this novice? I appreciate it!
+1 Dodge bonus to AC while carrying a shield. AC penalty for the shield is reduced by 1 to no less than zero. |
#1 |
Senior Member
Join Date: Jul 2010
Posts: 3,147
|
Quote:
Code:
if (hero.tagis[Hero.EquipShld] <> 0) then #applybonus[Dodge,hero.child[ArmorClass],1] endif For the second part, I'm assuming you mean armor check penalty. For that, you'll need a foreach loop to look at all shields on the hero and reduce the penalty by 1. For this script, I'll assume the ability stacks with the reduction from the item being masterwork: Code:
foreach pick in hero from BaseArmor where "EquipType.Shield" eachpick.field[mArmorChk].value = maximum(0,eachpick.field[mArmorChk].value-1) nexteach |
|
#2 |
Senior Member
Join Date: Oct 2011
Posts: 6,793
|
One point, I believe dodge bonuses do stack with themselves, so you wouldn't want to use the #applybonus macro here (that is for non stacking, use the highest type bonuses).
|
#3 |
Senior Member
Join Date: Jul 2010
Posts: 3,147
|
Quote:
Code:
if (hero.tagis[Hero.EquipShld] <> 0) then hero.child[ArmorClass].field[tACDodge].value += 1 endif |
|
#4 |
|
|