View Single Post
SeeleyOne
Senior Member
 
Join Date: Nov 2009
Posts: 891

Old August 30th, 2015, 10:18 AM
I would do this with a mechanic that searches for the weapon, and then changes its skill. When coming up with how to change the die so that it can have a d14, d16, d18, d20, d22, or d24 Fighting skill I figured out how to do this.

http://forums.wolflair.com/showthread.php?t=53040

Make it use whatever skill you want it to use, so change Fighting to whatever you want it to be.

The trickiest part will be the "foreach pick in hero from.. " because that really depends on what you are looking for. You can make it look for a specific ID for a specific weapon, or if you ware going for a class of weapons you can make it look for those. If you have multiple weapons, like maybe several types of lightsabers you would be best served either using a tag or even easier is to have a similar ID syntax that only changes at the end. So for different lightsabers, you might have weapon ID that are these: wpLIGHTred, wpLIGHTblu, wpLIGHTgrn, wpLIGHTyel. The wildcard that looks for them would be "wpLIGHT?".

Phase Final
Priority 10000

Code:
var finalbonus as number
var thisbonus as number
var finaldie as string
var finaltext as string
var bonustext as string
var dieNumber as number

finalbonus = hero.child[skFighting].field[trtNetRoll].value 
thisbonus = 0
finaldie = ""
finaltext = ""
bonustext = ""
dieNumber = #trait[skFighting]


~ Cap die number at 12
if (dieNumber >= 6) then
      dieNumber = 6
endif

~ Double the dieNumber so that it will be a die
dieNumber = dieNumber * 2
finaldie = "d" & dieNumber

foreach pick in hero from WeapMelee
      bonustext = ""
      thisbonus = finalbonus
      thisbonus += eachpick.field[wpBonus].value
      thisbonus += eachpick.field[wpPenalty].value

      if (thisbonus > 0) then
           bonustext = "+" & thisbonus
      endif

      if (thisbonus < 0) then
           bonustext = thisbonus
      endif

      finaltext = finaldie & bonustext
      eachpick.field[wpNetAtk].text = finaltext
nexteach

Evil wins because good rolls poorly .... or the players are not paying enough attention to the game.

Last edited by SeeleyOne; August 30th, 2015 at 10:20 AM. Reason: Wow, it killed my code and made it unreadable, this should be better
SeeleyOne is offline   #2 Reply With Quote