Thread: notifyApplyHRFC
-
March 7th, 2022, 00:31 #1
notifyApplyHRFC
Is there any chance we could see this change in the ruleset?
manager_action_attack.lua
line 60
Code:function notifyApplyHRFC(sTable) local msgOOB = {}; msgOOB.type = OOB_MSGTYPE_APPLYHRFC; msgOOB.sTable = sTable; Comm.deliverOOBMessage(msgOOB, ""); end
Code:function notifyApplyHRFC(rAction) local msgOOB = {}; msgOOB.type = OOB_MSGTYPE_APPLYHRFC; if rAction.sResult = "fumble" then msgOOB.sTable = "Fumble"; elseif rAction.sResult = "crit" then msgOOB.sTable = "Critical Hit; end Comm.deliverOOBMessage(msgOOB, ""); end
line 581
Code:-- HANDLE FUMBLE/CRIT HOUSE RULES local sOptionHRFC = OptionsManager.getOption("HRFC"); if rAction.sResult == "fumble" and ((sOptionHRFC == "both") or (sOptionHRFC == "fumble")) then notifyApplyHRFC("Fumble"); end if rAction.sResult == "crit" and ((sOptionHRFC == "both") or (sOptionHRFC == "criticalhit")) then notifyApplyHRFC("Critical Hit"); end
Code:-- HANDLE FUMBLE/CRIT HOUSE RULES local sOptionHRFC = OptionsManager.getOption("HRFC"); if rAction.sResult == "fumble" and ((sOptionHRFC == "both") or (sOptionHRFC == "fumble")) then notifyApplyHRFC(rAction); end if rAction.sResult == "crit" and ((sOptionHRFC == "both") or (sOptionHRFC == "criticalhit")) then notifyApplyHRFC(rAction); end
-
March 7th, 2022, 00:43 #2
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 22,068
I'm not sure how that really helps shield against overwrites. What exactly are you trying to override
Looking at the code, it actually makes more sense to generalize the notifyApplyHRFC to a more general TableManager.rollTableOnGM call (or something like that); but I feel like that might actually be at odds with what you are doing.
JPG
-
March 7th, 2022, 00:50 #3
I was hoping to be able to override notifyApplyHRFC to make something happen on crits and fumbles by backing up the function, overriding it, and then calling the original. But the data "Fumble" isn't enough to do what I want (automating Pathfinder 1e fumbles and crits that have different effects based on damage type and attack type). This is what I meant by saying this would give extension devs a way to expand on crits and fumbles without overriding onAttack (which is very long and contains a lots of things that other extension devs might be working with). The easiest way to avoid having to patch extensions to work around each other in my experience is having functions called that we can 'overlay' onto within these big functions like onAttack.
But yes a standardized TableManager.rollTableOnGM call would make more sense from a functional programming approach.Last edited by bmos; March 7th, 2022 at 00:52.
-
March 7th, 2022, 04:57 #4
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 22,068
Ah, I thought that's what you might be after. I think it makes sense to leave that function alone (i.e. notifyApplyHRFC); and maybe add a new function in ActionAttack to allow a hook for handling result behaviors that calls the current function. Let me think on it a bit.
Regards,
JPG
-
March 7th, 2022, 12:09 #5
Last edited by bmos; March 7th, 2022 at 12:54.
-
March 10th, 2022, 22:16 #6
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 22,068
I've included some changes in several of the rulesets supporting Critical/Fumble house rule in the Test/beta channel. [i.e. internal function references prefixed with ActionAttack; and post-attack resolution (including this house rule) moved to ActionAttack.onPostAttackResolve(rAction);]
Regards,
JPG
-
March 10th, 2022, 22:50 #7
-
March 11th, 2022, 02:54 #8
uuuh, nice, thanks a lot
My extensions for 3.5e and Pathfinder
Bug reports please here
-
April 9th, 2022, 18:38 #9
Could we get something like this before the attack is resolved as well?
Many extensions add/modify the contents of rAction before the attack is resolved to add/modify functionality to attack parsing.
Perhaps before "Comm.deliverChatMessage(rMessage);"?Last edited by bmos; April 9th, 2022 at 19:55.
-
April 9th, 2022, 21:35 #10
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 22,068
I'm looking at this; and I can probably do something here. However, it makes more sense to change the signatures so that all similar calls match; which means that the current onPostAttackResolve will be changed and break anything built currently. All sub-functions would have parameters of (rSource, rTarget, rRoll, rMessage).
Regards,
JPGLast edited by Moon Wizard; April 9th, 2022 at 23:31.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks