-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FinalizeHitChance and OverrideFinalHitChanceFns don't include enough information for FinalizeHitChance mods #1368
Comments
That's gonna be problematic. The best we could do is create a It will also start creeping towards a backwards compatibility hell, because original OverrideHitChanceFns will still need to be supported (which were a terrible implementation, in my opinion). |
Yeah, that sounds like a compatibility nightmare. I wonder what other mods are using this beyond LWOTC (and my standalone implementation), which is why I'd want to make sure the new stuff is optional and mods using the new hook can't expect the new additions to be passed in 100% of the time. XModBase and its MCO will probably step on its toes anyways. |
As an alternative implementation, would it be possible to trigger a new event here that passes a tuple with the shotbreakdown, ability, target (or just pass them in as event parameters) along with a bool for CHL to know whether a mod used it or not? This seems less robust than the delegate implementation, but would likely be better for backwards compatibility as none of the previous functionality is touched. to something like this. Any mod using this would have to deal with XModBase jank, but they can get around it by simply requiring my XMB Redux as a dependency or shipping it themselves in usual XMB style. |
No, GetHitChance is called by UI code, we can't trigger events here. |
welp, so much for that plan then. |
Issue #555 added these hooks, but they did not add information about the ability and target if available, such as in
X2AbilityToHitCalc_StandardAim
We should add new versions that pass through the ability and target information if available.
GetAdditionalHitModifiers_CH
receives this information, butFinalizeHitChance
does not.Proposed Solution: Update
X2AbilityToHitCalc.FinalizeHitChance
to take inXComGameState_Ability kAbility
andAvailableTarget kTarget
as optional parameters, updateX2AbilityToHitCalc_StandardAim
to pass them, and then add a new delegate that will pass these through as well.Example use case: LW's aim rolls calculation does not respect checking for effects that implement the
ShotsCannotGraze
function because it does not have that information, this new version would allow LW to check for those effects and respect them.The text was updated successfully, but these errors were encountered: