public static void RegisterVerb(Type verbType, bool patchFirstFound = false) { HarmonyPatches.Patch(BestMethod(verbType, "TryCastShot", patchFirstFound), patches[0], patches[1], "TryCastShot", verbType); HarmonyPatches.Patch(BestMethod(verbType, "Available", patchFirstFound), patches[0], debug_targetName: "Available", debug_targetType: verbType); var method = BestMethod(verbType, "get_Projectile", patchFirstFound); if (method != null) { HarmonyPatches.Patch(method, patches[2], debug_targetName: "Projectile", debug_targetType: verbType); } }
public override void ResolveReferences(HediffDef parent) { base.ResolveReferences(parent); AmmoFilter.ResolveReferences(); HarmonyPatches.DoPatches(); var verb = TargetVerb(parent); if (verb == null) { return; } if (NewVerbClass != null) { verb.verbClass = NewVerbClass; } ReloadingMod.RegisterVerb(verb.verbClass, PatchFirstFound); }
public override void PostLoadSpecial(ThingDef parent) { base.PostLoadSpecial(parent); HarmonyPatches.DoPatches(); ref var type = ref TargetVerb(parent).verbClass;