• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Replacing a standard adjustment

Charender

Member
I am trying to replace the Fighting Defensively rule with a house rule. I followed the same procedure as replacing a feat.
Create a skeleton adjustment that replaces pstFtDefen
Create an exact copy of the normal fighting defensively adjustment with a containerreq of !source.HouseRule
Create a new adjustment that contains my house rules with a containerreq of source.HouseRule

Everything works except for 1 thing
My problem is that in the adjustments section of the conditions tab, Fighting Defensively shows up twice. It has the correct modifiers based on whether I have my house rule source selected or not, but when I select it, it applies highlights both of the fighting defensively modifiers, and it applies the correct modifiers twice.

Code:
<thing id="pstFDTest" name="Fighting Defensively Test" description="This will replace fighting defensively and bootstrap both the old or new Fighting Defensively." compset="InPlay" replaces="pstFtDefen">
    <bootstrap thing="pstStdFtDe"></bootstrap>
    <bootstrap thing="pstHRFtDef"></bootstrap>
    </thing>
  <thing id="pstStdFtDe" name="Fighting Defensively" description="You can choose to fight defensively when attacking. If you do so, you take a –4 penalty on all attacks in a round to gain a +2 to AC for the same round." compset="InPlay">
    <tag group="Helper" tag="AdjState" name="Combat State" abbrev="Combat State"/>
    <containerreq phase="First" priority="100">!source.srcHouseRH</containerreq>
    <eval phase="Final" priority="20000" index="2"><![CDATA[
      ~ If we're in output mode, don't do anything
      doneif (state.isoutput <> 0)

      field[livename].text = field[thingname].text & " (" & signed(field[abValue2].value) & " To Hit, " & signed(field[abValue].value) & " AC)"]]></eval>
    <eval phase="PostLevel" priority="20000"><![CDATA[
      ~ If we're in output mode, don't do anything
      doneif (state.isoutput <> 0)

      ~AC
      field[abValue].value += 2
      ~attack
      field[abValue2].value -= 4

      ~ If we're not enabled, get out now
      doneif (field[pIsOn].value + hero.isidentity[Condition] = 0)

      ~ +2 AC
      hero.child[ArmorClass].field[tACDodge].value += field[abValue].value

      ~-4 to hit
      hero.child[Attack].field[tAtk].value += field[abValue2].value]]></eval>
    </thing>
  <hidden id="pstTotDef"/>
  <thing id="pstHRFtDef" name="Fighting Defensively" description="You can choose to take a –1 penalty on melee attack rolls and combat maneuver checks to gain a +1 dodge bonus to your Armor Class. When your base attack bonus reaches +4, and every +4 thereafter, the penalty increases by –1 and the dodge bonus increases by +1. You can only choose to use this feat when you declare that you are making an attack or a full-attack action with a melee weapon. The effects of this feat last until your next turn" compset="InPlay">
    <usesource source="srcHouseRH"/>
    <tag group="Helper" tag="AdjState" name="Combat State" abbrev="Combat State"/>
    <containerreq phase="First" priority="100">source.srcHouseRH</containerreq>
    <eval phase="PostLevel" priority="20000"><![CDATA[~ If we're in output mode, don't do anything
        doneif (state.isoutput <> 0)
        
        ~ If fighting Defensively is active, change the bonuses
        var ACBonus as number
        var HitPenalty as number
        
        HitPenalty = round(hero.child[Attack].field[tAtkBase].value/4,0,-1)+1
        ACBonus = HitPenalty
        
        if (#hasfeat[fAgilDef] <> 0) then
          ACBonus = round(ACBonus * 1.5,0,-1)
        endif
        
        ~AC
        field[abValue].value += ACBonus
        ~attack
        field[abValue2].value -= HitPenalty
        
        ~ If we're not enabled, get out now
        doneif (field[pIsOn].value + hero.isidentity[Condition] = 0)
        
        ~ AC
        hero.child[ArmorClass].field[tACDodge].value += field[abValue].value
        
        ~ to hit
        hero.child[Attack].field[tAtk].value += field[abValue2].value]]></eval>
    <eval phase="Final" priority="20000" index="2"><![CDATA[
      ~ If we're in output mode, don't do anything
      doneif (state.isoutput <> 0)

      field[livename].text = field[thingname].text & " (" & signed(field[abValue2].value) & " To Hit, " & signed(field[abValue].value) & " AC)"]]></eval>
    </thing>
 
I put your xml in a test file and it is currently working just fine. As the conditions are bootstrapped to the hero to get it to work you have to do a complete re-load of pathfinder. You can do this by either restarting HL or by doing Ctrl-R. If Ctrl-R does not work go to Develop->Enable Data File Debugging.

My advice for future changes that include bootstrapping conditionally I would always do a re-load before testing.
 
Back
Top