• 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

M&M 3rd ed. Better Way to Script Attack Specialization?

The Cascadian

New member
With the goal of someday importing elements of the Power Profiles and Gadget Guides, I've been spending some time getting the hang of the editor. Patching in some of my group's simpler house rules hasn't been an issue. But I'm working on chopping out the Close Combat and Ranged Combat skills (done) and replacing them with an "Attack Specialization" advantage that let's the player pick from both ranged and melee attacks and powers, granting a +2 to 1pp. It's all to make slotting in the 3 skill points/1pp house rule a little smoother.

First attempt was based on copying the script from Improved Crit, but that seemed bulky and unnecessary. Second attempt failed based on my then misunderstanding. Current attempt borrows from Throwing Mastery to get the job done. I've got the code below, but here's my question: Is this the best way to accomplish this advantage? Or is there a trick or solution I'm missing?

Code:
     var bonus as number
      bonus = 2 * field[adRanks].value

     ~ If we're not active, get out
      doneif (activated = 0)

      ~ Get the pick we selected - if we chose 'other', just get out now
      perform field[usrChosen1].chosen.setfocus
      doneif (state.isfocus = 0)
      if (focus.tagis[Helper.OtherAtt] <> 0) then
        perform assign[User.NeedDomain]
        done
        endif

      ~ Iterate through our throwing weapons, adding our ranks as a bonus to each
        focus.field[atkAttack].value += bonus
        

      ~ Do the same with our throw-ranged powers
      ~  focus.field[atkAttack].value += bonus
      ~ nexteach

Thanks in advance
The Cascadian
 
Back
Top