|
Senior Member
Join Date: Sep 2015
Posts: 435
|
I have a new material that works a lot like obsidian, but it adds 1 point to the critical range of the weapon. So my scimitar, made of this material, would crit on 17-20, not 18-20. But how do I code this?
I noticed that the original obsidian material has an eval script. It's apparently calling functions defined elsewhere, but I'm not sure why the first one is there at all. Code:
perform container.parent.setfocus ~ Our parent becomes Fragile perform focus.assign[wSpecial.Fragile] Code:
~ If we're disabled, do nothing doneif (tagis[Helper.FtDisable] <> 0) var name as string ~ If we haven't chosen anything, get out now doneif (field[usrChosen1].ischosen + tagis[Target.?] = 0) if (tagcount[Hero.MartVersa] + hero.tagcount[Hero.MartMaster] <> 0) then perform field[usrChosen1].chosen.pulltags[wFtrGroup.?] ~ this call takes care of mythic martial versatility and mythic martial mastery call MytMartial foreach pick in hero from BaseWep if (eachpick.tagmatch[wFtrGroup,wFtrGroup,initial] <> 0) then perform eachpick.assign[Broadcast.ImpCrit] perform eachpick.pulltags[ImpCrit.?] endif nexteach name = this.tagnames[wFtrGroup.?, ", "] perform hero.pushtags[ImpCrit.?] else ~ Assign the appropriate tag to all weapons that meet the criteria var id as string call fTargetId foreach pick in hero where "IsWeapon." & id perform eachpick.assign[Broadcast.ImpCrit] nexteach ~ Forward the improved critical tag for the weapon to the hero perform hero.assignstr["ImpCrit." & id] endif ~ Set our 'short name' field[shortname].text = "Imp Crit: " & name if (field[sbName].isempty <> 0) then field[sbName].text = "Improved Critical (" & lowercase(name) & ")" endif |
#1 |
Senior Member
Join Date: Sep 2013
Location: Vancouver, Canada.
Posts: 818
|
The Stalker (part of the Community Pack) has a Stalker Art that increases threat range by +1 (and is applied after Keen/Improved Critical).
That is the other source I'm aware of, of increasing a weapon's threat range. |
#2 |
Senior Member
Join Date: Oct 2011
Posts: 6,793
|
As Ualaa mentions, not sure if you want the expansion to stack with improved crit/keen, but one example that does not stack would be the phantom's "Ruthless Combatant" ability.
"The phantom threatens a critical hit with its slam attacks on a roll of 19–20. When the spiritualist reaches 11th level, the phantom’s critical modifier with slam attacks increases to ×3. This doesn’t stack with Improved Critical or similar effects." PostLevel 10000 Code:
doneif (tagis[Helper.ShowSpec] = 0) doneif (tagis[Helper.SpcDisable] <> 0) perform hero.findchild[BaseNatWep,"Custom.PhantSlam"].setfocus doneif (state.isfocus = 0) if (field[xAllLev].value >= 11) then perform focus.tagreplace[wCritMult.?,wCritMult.3] endif doneif (focus.tagexpr[Broadcast.ImpCrit | Helper.Keen] <> 0) var critvalue as number critvalue = focus.tagvalue[wCritMin.?] perform focus.delete[wCritMin.?] critvalue -= 1 perform focus.assignstr["wCritMin." & critvalue] |
#3 |
Senior Member
Join Date: Sep 2015
Posts: 435
|
Thanks, Ualaa. That seems like an almost perfect fit. We discussed it during the game last night and the GM ruled that the +1 from the material will stack with Improved Crit and the like, so that might be the only change needed. And, of course, the setfocus on the parent of the container.
Thanks, Aaron; that's a good starting point simply because there's less code that I have to parse through! Plus, it changes the crit threat range by one instead of just setting a flag that something has a doubled crit threat range, so it's more pertinent that the Improved Critical feat I was looking at. I'm guessing the source Ualaa found does something similar; I'll take a look at both. Thanks again to both of you! |
#4 |
|
|