• 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

Code critique/correction request

Paris.Crenshaw

Well-known member
I'm reworking the Ghonhatine from PF16 and decided to have an activation-tracking to support the Feed racial ability.

The ability is as follows:
Feed (Su): Insatiable predators, ghonhatines are invigorated immediately after feeding. By spending a round devouring the body of a dead or unconscious creature, a ghonhatine gains 1d8+8 temporary hit points and a +2 bonus on attack and damage rolls for 8 rounds. The bonus to hit points and duration of this effect are Constitution-based.

So...I wrote the following eval script:

Code:
          ~Set abValue to creature's Con bonus.
          field[abValue].value = #attrmod[aCON]

          ~Bonus to temp hit points and duration is Con dependent
          field[abSumm].text = "Feed on a helpless creature to gain +2 atk/dmg and 1d8+" & field[abValue].value & ", for "& field[abValue].value & " rounds."
          field[actName].text = "Fed [enter d8 result for temp hit points (" &  field[abValue].value & " rds duration)]"

      ~If creature has fed, apply +2 atk and damage bonus and temp hit points.
      If (field[abilActive].value <> 0) then
          hero.child[Attack].field[tAtkMelee].value += 2
          hero.child[Attack].field[tAtkRanged].value += 2
          hero.child[Damage].field[tDamBonus].value += 2
          herofield[tCurrentHP].value += field[actUser].value + field[abValue].value
      Endif

I originally had this set for the Final Phase (User) with a priority of 10000, but I've found that the script doesn't work unless I use Final Phase with a priority of 10000.

I can get the attack and damage modifiers to work in the Final Phase (User) section, but adding the temp hit points doesn't work unless it's in the Final Phase.

Also, I thought that I should be able to use:

hero.child[Attack].field[tAtk].value += 2

to apply a bonus to all attacks but the bonus only shows up in the "Attack Bonus" and doesn't seem to do anything else. Only the code above seems to actually work.

Am I doing something wrong or is this correct?
 
Thanks, Mathias.

When I shift to Post-Attributes, the temporary hit points don't show up. I'd based the modification on the Aid and False Life spell adjustments, which use Final.
 
Back
Top