Alternate Damage Bonus for TwoHand/OffHand
is it possible to mod the calculation used for TwoHand/OffHand Damage Bonus?
Either through the Editor or by requesting an option in the options? It seems logical to me that your off hand is half as strong as your primary hand and that two hands are stronger than one hand. but Pathfinder only does this for positive strength bonuses (and really only for +2 or better) the values should change for all strength mods eg. HTML Code:
<table> |
It is possible to do through the editor but I don't think this is something worthwhile enough to include in the core program, so I can guide you roughly how to do it yourself... You'd have to do a foreach to cycle through the weapons on the hero, negate the strength bonus for a weapon, and then add in your own values. Here is an example eval script I was doing to replace STR with CHA.
PostAttr 10000 ~ DEFINE YOUR VALUES FOR DIFFERENT STR SCORES HERE var my2H as number var my1H as number var myOff as number if (hero.child[aSTR].field[aFinalVal].value >= 60) then my2H = WHATEVER1 my1H = WHATEVER2 myOff = WHATEVER3 elseif (hero.child[aSTR].field[aFinalVal].value >= 58) then BLAHBLAH SO ON AND SO FORTH endif ~ REPLACE THE BELOW REFERENCES TO aCHA's ATTRIBUTE MODIFIER WITH YOUR OWN VALUES AS APPROPRIATE ~ Then search through all the weapons, adjust our damage from STR to mySTR foreach pick in hero from BaseWep ~ Now we have to modify the damage var strmod as number var chamod as number ~ First negate the Str. If it is wielded 2 handed, if gets 1.5x Str, ~ unless it is light, or the Str mod is negative. if (eachpick.tagis[Hero.MainHand] + eachpick.tagis[Hero.OffHand] = 2) then if (eachpick.tagis[wClass.Light] <> 0) then strmod = #attrmod[aSTR] elseif (#attrmod[aSTR] < 0) then strmod = #attrmod[aSTR] else strmod = #attrmod[aSTR] * 1.5 endif if (eachpick.tagis[wClass.Light] <> 0) then chamod = #attrmod[aCHA] elseif (#attrmod[aCHA] < 0) then chamod = #attrmod[aCHA] else chamod = #attrmod[aCHA] * 1.5 endif ~ If is is in the main hand, we get just the Str mod elseif (eachpick.tagis[Hero.MainHand] = 1) then strmod = #attrmod[aSTR] chamod = #attrmod[aCHA] ~ If it is in the off hand, we get .5 Str unless the hero has the ~ Double Slice tag or the weapon has the Helper.NoHalfStr tag elseif (eachpick.tagis[Hero.OffHand] = 1) then if (hero.tagis[Hero.DblSlice] + eachpick.tagis[Helper.NoHalfStr] <> 0) then strmod = #attrmod[aSTR] chamod = #attrmod[aCHA] else if (#attrmod[aSTR] < 0) then strmod = #attrmod[aSTR] else strmod = #attrmod[aSTR] * .5 endif if (#attrmod[aCHA] < 0) then chamod = #attrmod[aCHA] else chamod = #attrmod[aCHA] * .5 endif endif ~ If it is not equipped at all, check if it is a 2 handed weapon, if ~ so treat is as being wielded 2 handed. Otherwise treat it as in 1 ~ hand. else if (eachpick.tagis[wClass.TwoHanded] <> 0) then if (#attrmod[aSTR] < 0) then strmod = #attrmod[aSTR] else strmod = #attrmod[aSTR] * 1.5 endif if (#attrmod[aCHA] < 0) then strmod = #attrmod[aCHA] else strmod = #attrmod[aCHA] * 1.5 endif else strmod = #attrmod[aSTR] chamod = #attrmod[aCHA] endif endif eachpick.field[wDamBonus].value -= strmod eachpick.field[wDamBonus].value += chamod nexteach |
1) where would I put this script? in a mechanic?
2) does the scripting language have an absolute value function/macro 3) does it have a function/macro to determine the maximum value of two arguments? |
1) If you want it to be present on all heroes you could create it as a mechanic, or if you want to only have it apply to some heroes you can add the script to an adjustment and apply that adjustment to whichever characters.
2) I don't think so, but you could easily convert something to its absolute value by checking if it is below 0, and multiplying by -1 if that is so. 3) I'm still pretty new to the programming, so I am not up on all the lingo. What do you mean by arguments? If you mean 2 variables, yes. For example if you have val1 and val2 as your variables, maximum(val1, val2) will give you the higher value of the two variables. |
variable is a subset of argument
function (arg1, arg2, arg3) the three arguments arg1, arg2 and arg3 could be variables, but they could also be pointers to objects (which means you can pass an object as an argument). They could also be literals. |
Then to my knowledge you can get the maximum of variables, but not other arguments.
|
You may wish to check out the wiki and THIS link that shows some of HL's built in functions.
|
maximum() in HL does work on any numerical argument - you don't have to place the arguments into variables before using maximum.
maximum(#attrmod[aSTR],-#attrmod[aSTR]) should give you the absolute value of the strength modifier. |
I believe this will do what I want.
~ search through all the weapons, adjust our damage from STR to mySTR foreach pick in hero from BaseWep ~ Now we have to modify the damage var strmod as number var myDmgAdj as number ~ First negate the Str. If it is wielded 2 handed, if gets 1.5x Str, ~ unless it is light, or the Str mod is negative. if (eachpick.tagis[Hero.MainHand] + eachpick.tagis[Hero.OffHand] = 2) then if (eachpick.tagis[wClass.Light] <> 0) then strmod = #attrmod[aSTR] myDmgAdj= #attrmod[aSTR] elseif (#attrmod[aSTR] < 1) then strmod = #attrmod[aSTR] myDmgAdj= #attrmod[aSTR] + maximum(1, round(#attrmod[aSTR]/-2,0,0)) else strmod = round(#attrmod[aSTR] * 1.5,0,-1) myDmgAdj= #attrmod[aSTR] + maximum(1, round(#attrmod[aSTR]/2,0,-1)) endif ~ If is is in the main hand, we get just the Str mod elseif (eachpick.tagis[Hero.MainHand] = 1) then strmod = #attrmod[aSTR] myDmgAdj = #attrmod[aSTR] ~ If it is in the off hand, we get .5 Str unless the hero has the ~ Double Slice tag or the weapon has the Helper.NoHalfStr tag elseif (eachpick.tagis[Hero.OffHand] = 1) then if (hero.tagis[Hero.DblSlice] + eachpick.tagis[Helper.NoHalfStr] <> 0) then strmod = #attrmod[aSTR] myDmgAdj = #attrmod[aSTR] else if (#attrmod[aSTR] < 1) then strmod = #attrmod[aSTR] myDmgAdj= #attrmod[aSTR] - maximum(1, round(#attrmod[aSTR]/-2,0,-1)) else strmod = round(#attrmod[aSTR] * .5,0,-1) myDmgAdj= #attrmod[aSTR] - maximum(1, round(#attrmod[aSTR]/2,0,0)) endif endif ~ If it is not equipped at all, check if it is a 2 handed weapon, if ~ so treat is as being wielded 2 handed. Otherwise treat it as in 1 ~ hand. else if (eachpick.tagis[wClass.TwoHanded] <> 0) then if (#attrmod[aSTR] < 1) then strmod = #attrmod[aSTR] myDmgAdj= #attrmod[aSTR] + maximum(1, round(#attrmod[aSTR]/-2,0,0)) else strmod = round(#attrmod[aSTR] * 1.5,0,-1) myDmgAdj= #attrmod[aSTR] + maximum(1, round(#attrmod[aSTR]/2,0,-1)) endif else strmod = #attrmod[aSTR] myDmgAdj = #attrmod[aSTR] endif endif eachpick.field[wDamBonus].value -= strmod eachpick.field[wDamBonus].value += myDmgAdj nexteach |
Double Strength
So I know I am pulling a necro on this thread but its the closest thing I have found to what I want to do. What would I have to do to just double strength when ever I two hand a weapon instead of the normal x1.5? Its a house rule that we use and I cant seem to figure out what to put into hero lab
|
All times are GMT -8. The time now is 02:09 PM. |
Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.