Closed NosVladimir closed 1 year ago
Sure, I have a solution. Give me a bit more time.
var CreateAddMechanicsFeature = AccessTools.Method("CodexLib.Helper, CodexLib:CreateAddMechanicsFeature", new[] { Type.GetType("CodexLib.MechanicFeature, CodexLib") });
var comp = CreateAddMechanicsFeature?.Invoke(null, new object[] { 8 });
Use this code to generate a blueprint component. Check for null. If it is null, then DarkCodex is not installed. If it is non-null you need to add it to the blueprint that grants AoO with kinetic blades (can be BlueprintFeature or BlueprintBuff).
You could call the library directly, without reflection. But then you would need to add dependency.
Tell me, if you have any questions about this. Oh, and only works with the current update.
Thank you!! This is very sweet and works perfectly. I've updated my mod and I'll close the issue now
Hi Truinto,
Thank you very much for this mod, for providing both interesting contents and coding examples for modding!
I recently made a mod featuring a kineticist duelist archetype that allows AoOs with normal kinetic blades (https://github.com/NosVladimir/KineticArchetypes/blob/main/KineticDuelist.cs), and I implemented it by removing the
DisableAttacksOfOpportunity
condition onAddKineticistBlade.OnActivate()
. But currently if I turn onPatch_KineticistAllowOpportunityAttack
in DarkCodex, it would fall back to not being able to AoO with kinetic blades. I also like your patch since it re-enables AoOs for other off-hand weapons, but I didn't figure out a way make my feature compatible with the patch so I just left it as is for now.I thought an easy fix would be for you to extend the
if
statement inGetThreatHand_AttackOfOpportunity
to check if character has the kinetic duelistKDKineticBlade
feature, but then if anyone would like to add some other stuff to allow kinetic blade AoOs in the future they would need to ask you again. So are there any better workarounds or recommended solutions, that you could possibly think of?