• 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

Getting an ability to add only once

Bob G

Well-known member
Hello everyone, me again...
I have an ability that the user may select more than once. Each time it is added, it grants a +1 bonus. I only want the class tab to show the ability once, reflecting the bonus based on how many times the user has selected it. I thought that using the FirstCopy tag would help:
Code:
 If we're not shown, just get out now
      doneif (tagis[Helper.ShowSpec] = 0)

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

~ Only add the first copy
      doneif (tagis[Helper.FirstCopy] = 0)

~Add a +1 bonus to Will saving throws against fear and mind-affecting effects.
     field[abValue].value += field[xIndex].value     

     #situational[hero.childfound[svWill],signed(field[abValue].value) & " to saves against fear and mind-affecting effects.",field[thingname].text]
But that's not working; it still adds a new entry to the class tab each time it's picked, and the bonus isn't adding properly.

Is FirstCopy the right tag to be using here? If not, what would work?
 
If I understand what you mean, then what you ask for as far as showing only one pick on the class tab is impossible. You CAN have only a single copy show on the specials tab, and you CAN have later copies of abilities add to the first, but any table to which Users add picks MUST show all picks. Otherwise, there would be no way to delete the added picks.

Also, the type of pick which are user added to class tabs are Custom Specials. They have a different setup, so you can't count on the xIndex field (as you would with Class Specials), and they do not automatically get FirstCopy assigned.

For an example of a custom special which can be taken multiple times to stacking effect, check out the Deadly Range Ninja/Slayer talent (cNinDeadRa).

Here is the relevant code for that.

PostLevel 10000
Code:
      ~ This procedure declares one copy the first (assigning Helper.FirstCopy)
      ~ and sets the quickadd to the same copy. All others redirect to this first
      ~ copy and add some value to it (defined by the incrval variable). The
      ~ final combined value will be in the abValue field of the first copy (if
      ~ setval1 = 1) or in the trkMax field of the same (if setval1 = 0).
      var incrval as number
      var setval1 as number
      incrval = 10
      setval1 = 1

      call combocopy

      if (tagis[Helper.FirstCopy] <> 0) then
        ~ Nothing
      else
        perform assign[Helper.SpecUp]
        endif

You'd want to put the situational in the first branch, so only the first copy ran it. The "else" branch is what prevents later copies from being shown on the specials tab.
 
Back
Top