Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   HL - D&D 5th Edition SRD (http://forums.wolflair.com/forumdisplay.php?f=89)
-   -   Race that excludes Dexterity from AC calculation (http://forums.wolflair.com/showthread.php?t=59498)

CNYGamer November 11th, 2017 07:06 AM

Race that excludes Dexterity from AC calculation
 
Hi all.

I'm trying to set up the Tortle race and I'm having some difficulty with regards to AC calculation. A Tortle has a natural AC of 17, can't wear armor (but can use shields), and gains no AC bonus from Dexterity.

I found the following script in another race's natural armor:

Code:

if (hero.tagis[Hero.EquipArmor] = 0) then
    hero.child[ArmorClass].field[tACUnarDef].value = maximum(hero.child[ArmorClass].field[tACUnarDef].value,field[abValue].value)
endif

It doesn't explicitely prevent the character from equipping armor, but it does set base AC to whatever value is stored in abValue (in this case, 7).

Unfortunately, it also increases AC by the character's Dexterity modifier. So my two questions are:

1. Is there a way for me to exclude the Dexterity modifier from AC?

2. Is there a way to explicitely prevent the character from equipping armor?

Thanks much!

CNYGamer November 11th, 2017 08:00 AM

Update:

I added the following line to the scriptand chnged it's phase from Post-Attributes to Attributes, and it seems to work:

Code:

hero.herofield[tMaxDex].value = 0 to the script
I then checked to see if the Dex modifier was still being added to dex-based weapon attack and damage rolls, and that seem to be unaffected, so that is a plus.

This feels a little ham-handed and I'm wondering if there is a more elegant way to handle this.

dungeonguru November 11th, 2017 09:13 AM

What we did for the community tortle (which will come out next update) was to catch the DEX modifier and subtract it when unarmored, if armored, we set any worn armor bonuses to 0. This leaves shields and magic bracers/rings alone as is indicated by the tortle. It's not beautiful, but it works. It also allows a tortle to wear armor of resistance and get the resistance granted, but not the AC.

Post-attributes/5000
Code:

~ If we're not shown, just get out now
doneif (tagis[Helper.Disable] <> 0)

var dexmod as number

dexmod = #attrmod[aDEX]
~ turn it into a penalty
dexmod *= -1

if (hero.tagis[Hero.EquipArmor] = 0) then
    ~ we are unarmored, remove Dex bonus by adding it's negative value back
    hero.child[ArmorClass].field[tACUnarDef].value += dexmod
else
    ~ we are armored, strip all armor bonuses
    hero.child[ArmorClass].field[tACDexMod].value = 0
    foreach pick in hero from BaseArmor where "Helper.CurrArmor"
    ~ kill off any type of AC modifier
          eachpick.field[arAC].value = 0
          eachpick.field[arBonus].value = 0
          eachpick.field[Bonus].value = 0
    nexteach
endif


CNYGamer November 11th, 2017 09:49 AM

Quote:

Originally Posted by dungeonguru (Post 258498)
What we did for the community tortle (which will come out next update) was to catch the DEX modifier and subtract it when unarmored, if armored, we set any worn armor bonuses to 0. This leaves shields and magic bracers/rings alone as is indicated by the tortle. It's not beautiful, but it works. It also allows a tortle to wear armor of resistance and get the resistance granted, but not the AC.


Interesting. That didn't work for me. I set it to the Post-Attributes phase with a timing of 5000 as indicated, and it left the character's AC at 10. If I wasn't cramming to get several characters set up in Hero Lab for my game this evening, I would tinker with it more.

dungeonguru November 11th, 2017 10:10 AM

Quote:

Originally Posted by CNYGamer (Post 258501)
, and it left the character's AC at 10.

The code I provided just negates armor and dex, so if you start with AC10, it stays AC 10. The +7 is added later in another script.

Final/1000
Code:

doneif (tagis[Helper.Disable] <> 0)

      if (hero.tagis[Hero.EquipArmor] = 0) then
        hero.child[ArmorClass].field[tACNatural].value = 7
        endif


CNYGamer November 11th, 2017 10:18 AM

Quote:

Originally Posted by dungeonguru (Post 258503)
The code I provided just negates armor and dex, so if you start with AC10, it stays AC 10. The +7 is added later in another script.

Thanks very much for that additional information. I appreciate your time.


All times are GMT -8. The time now is 08:32 AM.

Powered by vBulletin® - Copyright ©2000 - 2021, vBulletin Solutions, Inc.
wolflair.com copyright 1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.