DreadKatak
Active member
I am using the Unchained Automatic Progression (no magic item) ruleset, but there is apparently an issue with Armor Attunement enhancement bonus applying to Touch AC.  
This eval script works for my needs, but any suggestions on how to improve it?
I know the following is a hackish way around the current Enhancement bonus to AC applying to Touch AC bug, but here it is:
Post-levels, 11000
	
	
	
		
I tried to use the #applypenalty macro, but it does not work properly for this.
				
			This eval script works for my needs, but any suggestions on how to improve it?
I know the following is a hackish way around the current Enhancement bonus to AC applying to Touch AC bug, but here it is:
Post-levels, 11000
		Code:
	
	~ Don't do anything if Armor Attunements don't exist yet
  doneif (hero.childlives[ABPAttune] = 0) 
~ Add to our tACArmor  and tACFlat values only, and NOT tACTouch
If (hero.child[ArmorClass].field[BonEnhance].value >= 1) then
   if (hero.child[ArmorClass].field[BonEnhance].value = 1) then
      hero.child[ArmorClass].field[tACTouch].value -= 1
   elseif (hero.child[ArmorClass].field[BonEnhance].value = 2) then
      hero.child[ArmorClass].field[tACTouch].value -= 2
   elseif (hero.child[ArmorClass].field[BonEnhance].value = 3) then
      hero.child[ArmorClass].field[tACTouch].value -= 3
   elseif (hero.child[ArmorClass].field[BonEnhance].value = 4) then
      hero.child[ArmorClass].field[tACTouch].value -= 4
   elseif (hero.child[ArmorClass].field[BonEnhance].value = 5) then
      hero.child[ArmorClass].field[tACTouch].value -= 5
    endif
endif
	I tried to use the #applypenalty macro, but it does not work properly for this.