Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - D&D 5th Edition SRD

Notices

Reply
 
Thread Tools Display Modes
DeathSheep
Member
 
Join Date: Jun 2018
Posts: 83

Old October 31st, 2021, 07:43 AM
Just a syntax question today I believe. I am trying to create a fighting style that increments your unarmed die type 1 step (1 to 1d4, 1d4 to 1d6, 1d6 to 1d8, etc.) Here is the entire fighting style, and I am sure I have the syntax all bollixed up, but not sure what it should be:

Code:
  <thing id="cXXXPRBrawler" name="Brawler Style" description="You are skilled at using your weight to your advantage. You gain the following benefits:\n\n- You are proficient with improvised weapons.\n- Your damage die for your unarmed strikes and natural weapons increases by one step (from 1 to d4, d4 to d6, or d6 to d8).\n- When you take the Attack action and attempt to grapple, shove, or trip a creature, or make an attack against a creature with an unarmed strike or a weapon wielded in one hand on your turn, you can use your bonus action to make an unarmed strike, grapple, shove, or trip against the same creature." compset="CustomSpec" uniqueness="unique">
    <tag group="abCategory" tag="GrdFight"/>
    <tag group="Helper" tag="Secondary"/>
    <tag group="abRange" tag="Personal"/>
    <tag group="abDuration" tag="Constant"/>
    <tag group="WepProf" tag="w5CImMeWe"/>
    <tag group="WepProf" tag="w5CIMRaWe"/>
    <bootstrap thing="wUnarmed"></bootstrap>
    <eval phase="First"><![CDATA[      ~ If we're disabled, do nothing &
 
      doneif (tagis[Helper.Disable] = 1)

      ~ Push all weapon proficiencies to the hero

      perform hero.pushtags[WepProf.?]]]></eval>
    <eval phase="First" index="2"><![CDATA[      ~ If we're disabled, do nothing 
 
      doneif (tagis[Helper.Disable] = 1)
      
      ~ Increment unarmed damage one die type
      if (wUnarmed.wDieCount.value = 0)
      perform wUnarmed.wDieCount.value = 1
      perform wUnarmed.wDieSize.value = 4
      done
      endif

      if (wUnarmed.wDieSize.value = 4
      perform wUnarmed.wDieSize.value = 6
      done
      endif

      if (wUnarmed.wDieSize.value = 6
      perform wUnarmed.wDieSize.value = 8
      done
      endif

      if (wUnarmed.wDieSize.value = 8
      perform wUnarmed.wDieSize.value = 10
      done      
      endif

      if (hero.wUnarmed.wDieSize.value = 10
      perform hero.wUnarmed.wDieSize.value = 12
      done
      endif]]></eval>
    </thing>
DeathSheep is offline   #1 Reply With Quote
spannclann
Member
 
Join Date: Aug 2018
Location: Texas
Posts: 56

Old November 3rd, 2021, 09:43 AM
Here is the entire code I use. Though my code is checking for feats to raise damage, I am sure you can see the logic and can take what you need.



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

~ If we're disabled, do nothing
doneif (tagis[Helper.Disable] <> 0)

~ first we have to establish our benchmark, based on our level
~ all comparisons are made assuming that the wielder is medium,
~ because that is what wMain tags assume. Damage dice are then
~ adjusted up or down appropriately based on size.

~ There are two feats that can increase the level upward.

var act_level as number

~!!! You were looking for the field xAllLev on this ability, not the hero.
~!!! Doing herofield[xAllLev].value may work, but this macro should work,
~!!! too.

act_level = #totallevelcount[]


~!!! I added this debug code; you can see its output from Develop >
~!!! Floating Info Windows > Show debug output. It'll tell you what
~!!! act_level is at this stage in the script. If you add it again
~!!! later, you can see whether it's calculating correctly. You can
~!!! do this with any field, variable, etc.

debug "Current act_level: " & act_level


~ Checking for Grappler
if (#hasfeat[fGrappler] <> 0) then
act_level += 1
endif
~ Checking for Tavern Brawler
if (#hasfeat[ft5CTaverB] <> 0) then
act_level += 1
endif


~!!! Changed your test because it was looking to see if this
~!!! ability has the tag "IsWeapon.wUnarmed".
~!!! Now instead we're looking to see if the hero has the tags
~!!! for equipping stuff in their main and offhand.

if (hero.tagis[Hero.EquipMain] = 0) then
if (hero.tagis[Hero.EquipOff] = 0) then
if (hero.tagis[Hero.EquipShld] = 0) then
if (act_level >= 18) then
act_level += 6
elseif (act_level >= 11) then
act_level += 6
elseif (act_level >= 6) then
act_level += 6
elseif (act_level >= 3) then
act_level += 3
else
act_level += 2
endif
endif
endif
endif


if (#hasability[c5CFtrUnaFig] = 0) then
if (act_level >= 24) then
act_level += 6
elseif (act_level >= 18) then
act_level += 6
elseif (act_level >= 11) then
act_level += 6
elseif (act_level >= 6) then
act_level += 6
elseif (act_level >= 3) then
act_level += 3
else
act_level += 2
endif
endif

~!!! added hero.childfound[wUnarmed] to the beginning of
~!!! these, to tell HL to go to the wUnarmed thing
~!!! (Unarmed Strikes) and modify it's weapon dice #'s
~!!! Another thing you may want to think about doing is
~!!! telling it to be the maximum of whatever damage dice is
~!!! present, otherwise you're overriding a possibly higher dice,
~!!! like if they're a Monk. You'd do this:
~!!! hero.childfound[wUnarmed].field[wDieSize].value =
~!!! maximum(hero.childfound[wUnarmed].field[wDieSize].value,12)


if (act_level >= 30) then
~ Medium folks get 2d8 at this level. Avg = 9
hero.childfound[wUnarmed].field[wDieCount].value = 2
hero.childfound[wUnarmed].field[wDieSize].value = 8
field[abValue].value += 9
elseif (act_level >= 24) then
~ Medium folks get 1d12 at this level. Avg = 7
hero.childfound[wUnarmed].field[wDieCount].value = 2
hero.childfound[wUnarmed].field[wDieSize].value = 6
field[abValue].value += 7
elseif (act_level >= 18) then
~ Medium folks get 1d10 at this level. Avg = 5.5
hero.childfound[wUnarmed].field[wDieCount].value = 1
hero.childfound[wUnarmed].field[wDieSize].value = 10
field[abValue].value += 5.5
elseif (act_level >= 12) then
~ Medium folks get 1d8 at this level. Avg = 4.5
hero.childfound[wUnarmed].field[wDieCount].value = 1
hero.childfound[wUnarmed].field[wDieSize].value = 8
field[abValue].value += 4.5
elseif (act_level >= 6) then
~ Medium folks get 1d6 at this level. Avg = 3.5
hero.childfound[wUnarmed].field[wDieCount].value = 1
hero.childfound[wUnarmed].field[wDieSize].value = 6
field[abValue].value += 3.5
elseif (act_level >= 3) then
~ Medium folks get 1d4 at this level. Avg = 2.5
hero.childfound[wUnarmed].field[wDieCount].value = 1
hero.childfound[wUnarmed].field[wDieSize].value = 4
field[abValue].value += 2.5
else

~!!! I removed the part where you're telling it to be 1d1, since that's
~!!! already the default.
~!!! Again, you might accidentally override a higher die that someone
~!!! has from another source.

field[abValue].value += 1
endif


~!!! I have no idea what this is, but it's likely unrelated to your problem

var v_text as string

call wMainText

field[abText].text = v_text

Last edited by spannclann; November 3rd, 2021 at 09:47 AM.
spannclann is offline   #2 Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 01:13 AM.


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