diff --git a/Source/Mods/DragonsDescent.cs b/Source/Mods/DragonsDescent.cs index 124da32..477e85f 100644 --- a/Source/Mods/DragonsDescent.cs +++ b/Source/Mods/DragonsDescent.cs @@ -1,5 +1,4 @@ using System; -using System.Collections; using System.Linq; using System.Reflection; using HarmonyLib; @@ -14,16 +13,6 @@ namespace Multiplayer.Compat [MpCompatFor("onyxae.dragonsdescent")] public class DragonsDescent { - //// Gizmos //// - // CompHostileResponse - // Inner class inside of CompHostileResponse - private static AccessTools.FieldRef compHostileResponseParentField; - private static AccessTools.FieldRef compHostileResponseOptionsField; - private static AccessTools.FieldRef compHostileResponseIndexField; - - // CompProperties_HostileResponse - private static AccessTools.FieldRef compHostileResponsePropsOptionsField; - //// Altar and Rituals //// // Command_RitualEffect private static ConstructorInfo ritualEffectCommandCtor; @@ -58,23 +47,7 @@ public DragonsDescent(ModContentPack mod) MpCompat.RegisterLambdaDelegate("DD.CompProperties_EggIncubator", "CreateGizmo", 0); } - // AbilityCom_AbilityControl seems unused, skipping this gizmo - - // Hostility response type changing - { - var type = AccessTools.TypeByName("DD.CompHostileResponse"); - var method = MpMethodUtil.GetLambda(type, "Gizmo", MethodType.Getter, null, 1); - var inner = method.DeclaringType; - - compHostileResponseParentField = AccessTools.FieldRefAccess(inner, "<>4__this"); - compHostileResponseOptionsField = AccessTools.FieldRefAccess(inner, "options"); - compHostileResponseIndexField = AccessTools.FieldRefAccess(inner, "index"); - - compHostileResponsePropsOptionsField = AccessTools.FieldRefAccess("DD.CompProperties_HostileResponse:options"); - - MP.RegisterSyncMethod(method); - MP.RegisterSyncWorker(SyncHostileResponseOptionInnerClass, inner, shouldConstruct: true); - } + // AbilityComp_AbilityControl seems unused, skipping this gizmo // Altar and Rituals { @@ -91,9 +64,6 @@ public DragonsDescent(ModContentPack mod) // RitualTracker var ritualTrackerType = AccessTools.TypeByName("DD.RitualTracker"); ritualTrackerMapField = AccessTools.FieldRefAccess(ritualTrackerType, "map"); - - // CompRitualAltar - MpCompat.RegisterLambdaDelegate("DD.CompRitualAltar", "CompGetGizmosExtra", 0, 1, 2, 3, 4, 5).SetDebugOnly(); MP.RegisterSyncWorker(SyncRitualTracker, ritualTrackerType); } @@ -120,25 +90,6 @@ private static void LatePatch() MP.RegisterSyncWorker(SyncRitualEffectCommand, ritualEffectCommand); } - private static void SyncHostileResponseOptionInnerClass(SyncWorker sync, ref object obj) - { - if (sync.isWriting) - { - sync.Write(compHostileResponseParentField(obj)); - sync.Write(compHostileResponseIndexField(obj)); - } - else - { - var comp = sync.Read(); - var index = sync.Read(); - var options = compHostileResponsePropsOptionsField(comp.props); - - compHostileResponseParentField(obj) = comp; - compHostileResponseOptionsField(obj) = options; - compHostileResponseIndexField(obj) = index; - } - } - private static void SyncRitualTracker(SyncWorker sync, ref object tracker) { if (sync.isWriting)