View Single Post
ploturo
Member
 
Join Date: May 2021
Posts: 84

Old September 12th, 2022, 10:55 PM
Here's a working adjustment to add an arcane familiar, although it isn't finished and hasn't been tested much.

Herolab's built-in arcane familiar stuff is implemented as level dependent abilities, and which expect to be bootstrapped from a configurable or class helper to work properly.

Remember that you need to check the boxes for "arms reach" and/or "within a mile" in the in-play tab in order for any benefits from a familiar to show up on the hero.

Code:
<thing id="cfgCustomFamiliar" name="Custom Familiar" description="This is a helper object for configuring the familiar." compset="Configure" uniqueness="unique">
      
    <fieldval field="cArcFStart" value="1"/>
    <fieldval field="cfgLevel" value="1"/>
    
    <bootstrap thing="cArcFClass"><autotag group="ClSpecWhen" tag="1"/></bootstrap>
    
    <bootstrap thing="cArcFNear"><autotag group="ClSpecWhen" tag="1"/></bootstrap>
    <bootstrap thing="cArcFShare"><autotag group="ClSpecWhen" tag="1"/></bootstrap>
    <bootstrap thing="cArcFEmpLn"><autotag group="ClSpecWhen" tag="1"/></bootstrap>
    <bootstrap thing="cArcFTouch"><autotag group="ClSpecWhen" tag="3"/></bootstrap>
    <bootstrap thing="cArcFSpkMs"><autotag group="ClSpecWhen" tag="5"/></bootstrap>
    <bootstrap thing="cArcFSpkAn"><autotag group="ClSpecWhen" tag="7"/></bootstrap>
    <bootstrap thing="cArcFScry"><autotag group="ClSpecWhen" tag="13"/></bootstrap>
    
  </thing>
  
  <thing id="pSDVAddFamiliar" name="Add Custom Familiar" description="Select this adjustment to configure a custom familiar. It will use the level of the hero or of the class selected in the menu to determine the familiar's abilities, or use a level of 1 if nothing is selected." compset="InPlay" uniqueness="unique">
      
    <fieldval field="pUsePicks" value="1"/>
    <fieldval field="pCandExpr" value="thingid.Totals | component.Class"/>
    
    <tag group="OthAdjCat" tag="Class"/>
    <tag group="Helper" tag="NoIncr"/>
    <tag group="Helper" tag="AdjNoPlus"/>
    
    <bootstrap thing="cfgCustomFamiliar">
      <containerreq phase="First" priority="495"><![CDATA[fieldVal:pIsOn <> 0]]></containerreq>
    </bootstrap>
    
    <eval phase="First" priority="496"><![CDATA[
        ~ If we're not enabled, get out now
        doneif (field[pIsOn].value = 0)
        
        ~ equivalent caster level
        if (field[pChosen].ischosen = 0) then
            ~ use a default level of 1
            hero.childFound[cfgCustomFamiliar].field[cfgLevel].value = 1
        else
            if (field[pChosen].chosen.tagis[thingid.Totals] <> 0) then
                ~debug "custom familiar using Hero levels for equiv level: " & #totallevelcount[]
                hero.childFound[cfgCustomFamiliar].field[cfgLevel].value = #totallevelcount[]
            else
                ~debug "custom familiar chose class for equiv level: " & field[pChosen].chosen.idstring & "(" & field[pChosen].chosen.field[cTotalLev].value & ")"
                hero.childFound[cfgCustomFamiliar].field[cfgLevel].value = field[pChosen].chosen.field[cTotalLev].value
            endif
        endif
        
        ~ available familiar options
        doneif (field[pChosen2].ischosen = 0)
        ~debug "choices for lists of familiars not implemented yet"
        
    ]]></eval>
    
  </thing>

Last edited by ploturo; September 12th, 2022 at 10:58 PM.
ploturo is offline   #3 Reply With Quote