Decompiled source of SnowtimeToybox v1.1.2
plugins/SnowtimeSkins.dll
Decompiled 8 hours ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using MonoMod.RuntimeDetour; using MonoMod.RuntimeDetour.HookGen; using RoR2; using RuneFoxMods.DynamicSkins; using UnityEngine; using UnityEngine.Rendering; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.0")] namespace SnowtimeSkins { [BepInPlugin("com.winterwonderland.SnowtimeSkins", "Snowtime Skins", "1.0.0")] public class SnowtimeSkinsPlugin : BaseUnityPlugin { public class DynamicSkinExtension { private Modification SnowtimeSkinsVRCSnowtime01snowtime_snowflakeModification; private Modification SnowtimeSkinsVRCSnowtime01snowtime_weaponModification; private Modification SnowtimeSkinsVRCSnowtime01outfit_extendedModification; private Modification SnowtimeSkinsVRCSnowtime01neko_hair_updModification; private Modification SnowtimeSkinsVRCSnowtime01neko_ears_updModification; private Modification SnowtimeSkinsVRCSnowtime01neko_tail_updModification; private Modification SnowtimeSkinsVRCShortcakeshortcake_hair01Modification; private Modification SnowtimeSkinsVRCShortcakeshortcake_hair02Modification; internal void BeforeStart() { //IL_0038: Unknown result type (might be due to invalid IL or missing references) _DynamicSkinManager.InstanceLogger = ((BaseUnityPlugin)Instance).Logger; new Hook((MethodBase)typeof(SkinDef).GetMethod("Apply"), (Delegate)new Action<Action<SkinDef, GameObject>, SkinDef, GameObject>(_DynamicSkinManager.SkinDefApply)).Apply(); } internal void AfterStart() { InitializeModifications(); InitializeDynamicBones(); AddModificationsToList(); } internal void BeforeBodyCatalogInit() { DroneTechBodySnowtimeSkinsVRCSnowtime01SkinAddedEvent += onSkinAdded; MageBodySnowtimeSkinsVRCShortcakeSkinAddedEvent += onSkinAdded; } internal void AfterBodyCatalogInit() { } private void InitializeModifications() { SnowtimeSkinsVRCSnowtime01snowtime_snowflakeModification = new Modification("snowtime_snowflake.prefab", "head", "DroneTechBody", "WINTERWONDERLAND_SKIN_SNOWTIMESKINSVRCSNOWTIME01_NAME", -1, AffectsBaseModel: false, assetBundle); SnowtimeSkinsVRCSnowtime01snowtime_weaponModification = new Modification("snowtime_weapon.prefab", "weapon_M", "DroneTechBody", "WINTERWONDERLAND_SKIN_SNOWTIMESKINSVRCSNOWTIME01_NAME", -2, AffectsBaseModel: false, assetBundle); SnowtimeSkinsVRCSnowtime01outfit_extendedModification = new Modification("outfit_extended.prefab", "pelvis", "DroneTechBody", "WINTERWONDERLAND_SKIN_SNOWTIMESKINSVRCSNOWTIME01_NAME", -3, AffectsBaseModel: false, assetBundle); SnowtimeSkinsVRCSnowtime01neko_hair_updModification = new Modification("neko_hair_upd.prefab", "head", "DroneTechBody", "WINTERWONDERLAND_SKIN_SNOWTIMESKINSVRCSNOWTIME01_NAME", -4, AffectsBaseModel: false, assetBundle); SnowtimeSkinsVRCSnowtime01neko_ears_updModification = new Modification("neko_ears_upd.prefab", "head", "DroneTechBody", "WINTERWONDERLAND_SKIN_SNOWTIMESKINSVRCSNOWTIME01_NAME", -5, AffectsBaseModel: false, assetBundle); SnowtimeSkinsVRCSnowtime01neko_tail_updModification = new Modification("neko_tail_upd.prefab", "pelvis", "DroneTechBody", "WINTERWONDERLAND_SKIN_SNOWTIMESKINSVRCSNOWTIME01_NAME", -6, AffectsBaseModel: false, assetBundle); SnowtimeSkinsVRCShortcakeshortcake_hair01Modification = new Modification("shortcake_hair01.prefab", "head", "MageBody", "WINTERWONDERLAND_SKIN_SNOWTIMESKINSVRCSHORTCAKE_NAME", -1, AffectsBaseModel: false, assetBundle); SnowtimeSkinsVRCShortcakeshortcake_hair02Modification = new Modification("shortcake_hair02.prefab", "head", "MageBody", "WINTERWONDERLAND_SKIN_SNOWTIMESKINSVRCSHORTCAKE_NAME", -2, AffectsBaseModel: false, assetBundle); } private void InitializeDynamicBones() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_02f8: Unknown result type (might be due to invalid IL or missing references) //IL_030c: Unknown result type (might be due to invalid IL or missing references) //IL_0363: Unknown result type (might be due to invalid IL or missing references) //IL_0377: Unknown result type (might be due to invalid IL or missing references) //IL_038b: Unknown result type (might be due to invalid IL or missing references) //IL_03ed: Unknown result type (might be due to invalid IL or missing references) //IL_0401: Unknown result type (might be due to invalid IL or missing references) //IL_0415: Unknown result type (might be due to invalid IL or missing references) SnowtimeSkinsVRCSnowtime01snowtime_snowflakeModification.dynamicBoneData = new DynamicBoneData("dynamicboneroot", 0.2f, null, 0.05f, null, 0.5f, null, 0f, null, 0f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>(), new List<string>(), (FreezeAxis)0); SnowtimeSkinsVRCSnowtime01snowtime_weaponModification.dynamicBoneData = new DynamicBoneData("db_one", 0.1f, null, 0.1f, null, 0.1f, null, 0f, null, 0f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>(), new List<string>(), (FreezeAxis)0); SnowtimeSkinsVRCSnowtime01outfit_extendedModification.dynamicBoneData = new DynamicBoneData("coat_root01", 0.35f, null, 0.1f, null, 0.4f, null, 0.15f, null, 0f, null, 1.7f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>(), new List<string> { "coat_root01", "coat_woah" }, (FreezeAxis)0); SnowtimeSkinsVRCSnowtime01neko_hair_updModification.dynamicBoneData = new DynamicBoneData("ponytail_root", 0.35f, null, 0.1f, null, 0.3f, null, 0.05f, null, 0f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>(), new List<string> { "ponytail_root" }, (FreezeAxis)0); SnowtimeSkinsVRCSnowtime01neko_ears_updModification.dynamicBoneData = new DynamicBoneData("neko_root", 0.35f, null, 0.1f, null, 0.8f, null, 0f, null, 0f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>(), new List<string> { "neko_root" }, (FreezeAxis)0); SnowtimeSkinsVRCSnowtime01neko_tail_updModification.dynamicBoneData = new DynamicBoneData("tail_root", 0.35f, null, 0.1f, null, 0.3f, null, 0.1f, null, 0f, null, 1f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>(), new List<string>(), (FreezeAxis)0); SnowtimeSkinsVRCShortcakeshortcake_hair01Modification.dynamicBoneData = new DynamicBoneData("hair_root", 0.5f, null, 0.3f, null, 0.7f, null, 0.25f, null, 0f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>(), new List<string> { "hair_root" }, (FreezeAxis)0); SnowtimeSkinsVRCShortcakeshortcake_hair02Modification.dynamicBoneData = new DynamicBoneData("ears_root", 0.35f, null, 0.1f, null, 0.3f, null, 0.05f, null, 0f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData>(), new List<string> { "ears_root" }, (FreezeAxis)0); } private void AddModificationsToList() { _DynamicSkinManager.AddModification("WINTERWONDERLAND_SKIN_SNOWTIMESKINSVRCSNOWTIME01_NAME", -1, SnowtimeSkinsVRCSnowtime01snowtime_snowflakeModification); _DynamicSkinManager.AddModification("WINTERWONDERLAND_SKIN_SNOWTIMESKINSVRCSNOWTIME01_NAME", -2, SnowtimeSkinsVRCSnowtime01snowtime_weaponModification); _DynamicSkinManager.AddModification("WINTERWONDERLAND_SKIN_SNOWTIMESKINSVRCSNOWTIME01_NAME", -3, SnowtimeSkinsVRCSnowtime01outfit_extendedModification); _DynamicSkinManager.AddModification("WINTERWONDERLAND_SKIN_SNOWTIMESKINSVRCSNOWTIME01_NAME", -4, SnowtimeSkinsVRCSnowtime01neko_hair_updModification); _DynamicSkinManager.AddModification("WINTERWONDERLAND_SKIN_SNOWTIMESKINSVRCSNOWTIME01_NAME", -5, SnowtimeSkinsVRCSnowtime01neko_ears_updModification); _DynamicSkinManager.AddModification("WINTERWONDERLAND_SKIN_SNOWTIMESKINSVRCSNOWTIME01_NAME", -6, SnowtimeSkinsVRCSnowtime01neko_tail_updModification); _DynamicSkinManager.AddModification("WINTERWONDERLAND_SKIN_SNOWTIMESKINSVRCSHORTCAKE_NAME", -1, SnowtimeSkinsVRCShortcakeshortcake_hair01Modification); _DynamicSkinManager.AddModification("WINTERWONDERLAND_SKIN_SNOWTIMESKINSVRCSHORTCAKE_NAME", -2, SnowtimeSkinsVRCShortcakeshortcake_hair02Modification); } private static void onSkinAdded(object sender, SkinAddedArgs e) { _DynamicSkinManager.AddSkinDef(e.skinDef); } } public delegate void VoidDelegate(); public class SkinAddedArgs : EventArgs { public SkinDef skinDef { get; } public GameObject bodyPrefab { get; } public SkinAddedArgs(SkinDef newSkinDef, GameObject newGameObject) { skinDef = newSkinDef; bodyPrefab = newGameObject; } } private class FieldException : Exception { public FieldException(string message, Exception innerException) : base(message, innerException) { } } private class ElementException : Exception { public int Index { get; } public ElementException(int index, string message) : base(message) { Index = index; } } private static DynamicSkinExtension _DynamicSkinExtension = new DynamicSkinExtension(); private static DynamicSkinManager _DynamicSkinManager = new DynamicSkinManager(); private static VoidDelegate BeforeStartDelegate; private static VoidDelegate AfterStartDelegate; private static VoidDelegate BeforeBodyCatalogDelegate; private static VoidDelegate AfterBodyCatalogDelegate; private static AssetBundle assetBundle; internal static SnowtimeSkinsPlugin Instance { get; private set; } internal static ManualLogSource InstanceLogger { get { SnowtimeSkinsPlugin instance = Instance; if (instance == null) { return null; } return ((BaseUnityPlugin)instance).Logger; } } private static event EventHandler<SkinAddedArgs> DroneTechBodySnowtimeSkinsVRCSnowtime01SkinAddedEvent; private static event EventHandler<SkinAddedArgs> DTGunnerDroneBodySnowtimeSkinsVRCSnowtime02SkinAddedEvent; private static event EventHandler<SkinAddedArgs> Drone1BodySnowtimeSkinsVRCSnowtime02_genericSkinAddedEvent; private static event EventHandler<SkinAddedArgs> MissileDroneBodySnowtimeSkinsVRCSnowtime03SkinAddedEvent; private static event EventHandler<SkinAddedArgs> MegaDroneBodySnowtimeSkinsVRCSnowtime04SkinAddedEvent; private static event EventHandler<SkinAddedArgs> BackupDroneBodySnowtimeSkinsVRCSnowtime05SkinAddedEvent; private static event EventHandler<SkinAddedArgs> MageBodySnowtimeSkinsVRCShortcakeSkinAddedEvent; private void Start() { Instance = this; BeforeStart(); using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("SnowtimeSkins.winterwonderlandsnowtimeskins")) { assetBundle = AssetBundle.LoadFromStream(stream); } ((ResourceAvailability)(ref BodyCatalog.availability)).CallWhenAvailable((Action)BodyCatalogInit); HookEndpointManager.Add((MethodBase)typeof(Language).GetMethod("LoadStrings"), (Delegate)new Action<Action<Language>, Language>(LanguageLoadStrings)); AfterStart(); } private void BeforeStart() { BeforeStartDelegate = (VoidDelegate)Delegate.Combine(BeforeStartDelegate, new VoidDelegate(_DynamicSkinExtension.BeforeStart)); BeforeStartDelegate?.Invoke(); } private void AfterStart() { AfterStartDelegate = (VoidDelegate)Delegate.Combine(AfterStartDelegate, new VoidDelegate(_DynamicSkinExtension.AfterStart)); AfterStartDelegate?.Invoke(); } private static void BeforeBodyCatalogInit() { BeforeBodyCatalogDelegate = (VoidDelegate)Delegate.Combine(BeforeBodyCatalogDelegate, new VoidDelegate(_DynamicSkinExtension.BeforeBodyCatalogInit)); BeforeBodyCatalogDelegate?.Invoke(); } private static void AfterBodyCatalogInit() { AfterBodyCatalogDelegate = (VoidDelegate)Delegate.Combine(AfterBodyCatalogDelegate, new VoidDelegate(_DynamicSkinExtension.AfterBodyCatalogInit)); AfterBodyCatalogDelegate?.Invoke(); } private static void LanguageLoadStrings(Action<Language> orig, Language self) { orig(self); self.SetStringByToken("WINTERWONDERLAND_SKIN_SNOWTIMESKINSVRCSNOWTIME02_NAME", "B4NSH33"); self.SetStringByToken("WINTERWONDERLAND_SKIN_SNOWTIMESKINSVRCSNOWTIME02_GENERIC_NAME", "B4NSH33"); self.SetStringByToken("WINTERWONDERLAND_SKIN_SNOWTIMESKINSVRCSNOWTIME03_NAME", "B4NSH33"); self.SetStringByToken("WINTERWONDERLAND_SKIN_SNOWTIMESKINSVRCSNOWTIME04_NAME", "B4NSH33"); self.SetStringByToken("WINTERWONDERLAND_SKIN_SNOWTIMESKINSVRCSNOWTIME05_NAME", "B4NSH33"); self.SetStringByToken("WINTERWONDERLAND_SKIN_SNOWTIMESKINSVRCSHORTCAKE_NAME", "Kate (Shortcake)"); self.SetStringByToken("WINTERWONDERLAND_SKIN_SNOWTIMESKINSVRCSNOWTIME01_NAME", "Anastasia Winters (SnowySnowtime)"); } private static void BodyCatalogInit() { BeforeBodyCatalogInit(); AddDTGunnerDroneBodySnowtimeSkinsVRCSnowtime02Skin(); AddDrone1BodySnowtimeSkinsVRCSnowtime02_genericSkin(); AddMissileDroneBodySnowtimeSkinsVRCSnowtime03Skin(); AddMegaDroneBodySnowtimeSkinsVRCSnowtime04Skin(); AddBackupDroneBodySnowtimeSkinsVRCSnowtime05Skin(); AddMageBodySnowtimeSkinsVRCShortcakeSkin(); AddDroneTechBodySnowtimeSkinsVRCSnowtime01Skin(); AfterBodyCatalogInit(); } private static void DTGunnerDroneBodySnowtimeSkinsVRCSnowtime02SkinAdded(SkinDef skinDef, GameObject bodyPrefab) { SnowtimeSkinsPlugin.DTGunnerDroneBodySnowtimeSkinsVRCSnowtime02SkinAddedEvent(Instance, new SkinAddedArgs(skinDef, bodyPrefab)); } private static void AddDTGunnerDroneBodySnowtimeSkinsVRCSnowtime02Skin() { string text = "DTGunnerDroneBody"; string text2 = "SnowtimeSkinsVRCSnowtime02"; try { GameObject val = BodyCatalog.FindBodyPrefab(text); if (!Object.op_Implicit((Object)(object)val)) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin because \"" + text + "\" doesn't exist")); return; } ModelLocator component = val.GetComponent<ModelLocator>(); if (!Object.op_Implicit((Object)(object)component)) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelLocator\" component")); return; } GameObject gameObject = ((Component)component.modelTransform).gameObject; ModelSkinController val2 = (Object.op_Implicit((Object)(object)gameObject) ? gameObject.GetComponent<ModelSkinController>() : null); if (!Object.op_Implicit((Object)(object)val2)) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelSkinController\" component")); return; } Renderer[] renderers = gameObject.GetComponentsInChildren<Renderer>(true); gameObject.GetComponentsInChildren<Light>(true); SkinDef skin = ScriptableObject.CreateInstance<SkinDef>(); SkinDefParams skinParams = ScriptableObject.CreateInstance<SkinDefParams>(); skin.skinDefParams = skinParams; TryCatchThrow("Icon", delegate { skin.icon = assetBundle.LoadAsset<Sprite>("Assets/snowtime/halo/hunkevolved/Icons/HaloCESpartan_SnowtimeIcon.png"); }); ((Object)skin).name = text2; skin.nameToken = "WINTERWONDERLAND_SKIN_SNOWTIMESKINSVRCSNOWTIME02_NAME"; skin.rootObject = gameObject; TryCatchThrow("Base Skins", delegate { skin.baseSkins = Array.Empty<SkinDef>(); }); TryCatchThrow("Unlockable Name", delegate { skin.unlockableDef = null; }); TryCatchThrow("Game Object Activations", delegate { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) skinParams.gameObjectActivations = (GameObjectActivation[])(object)new GameObjectActivation[2] { new GameObjectActivation { gameObject = ((Component)ThrowIfNull<Renderer>(0, "There is no renderer with the name \"Drone1Mesh\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "Drone1Mesh")))).gameObject, shouldActivate = false, spawnPrefabOnModelObject = true, localPosition = new Vector3(0.5f, -1.3f, -4f), localRotation = new Vector3(0f, 0f, 20f), localScale = new Vector3(1f, 1f, 1f), prefab = assetBundle.LoadAsset<GameObject>("Assets/snowtime/halo/hunkevolved/prefab/banshee_fx_ce.prefab") }, new GameObjectActivation { gameObject = ((Component)ThrowIfNull<Renderer>(1, "There is no renderer with the name \"Drone1BladeActive\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "Drone1BladeActive")))).gameObject, shouldActivate = false, spawnPrefabOnModelObject = false } }; }); TryCatchThrow("Renderer Infos", delegate { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) skinParams.rendererInfos = (RendererInfo[])(object)new RendererInfo[1] { new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/snowtime/templatematerial/banshee/banshee.mat"), defaultShadowCastingMode = (ShadowCastingMode)2, ignoreOverlays = false, renderer = ThrowIfNull<Renderer>(0, "There is no renderer with the name \"Drone1Mesh\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "Drone1Mesh"))) } }; }); TryCatchThrow("Mesh Replacements", delegate { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) skinParams.meshReplacements = (MeshReplacement[])(object)new MeshReplacement[1] { new MeshReplacement { mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\SnowtimeSkins\\Meshes\\unnamed base superhigh.mesh"), renderer = ThrowIfNull<Renderer>(0, "There is no renderer with the name \"Drone1Mesh\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "Drone1Mesh"))) } }; }); TryCatchThrow("Light Infos", delegate { skinParams.lightReplacements = (LightInfo[])(object)new LightInfo[0]; }); TryCatchThrow("Minion Skin Replacements", delegate { skinParams.minionSkinReplacements = Array.Empty<MinionSkinReplacement>(); }); TryCatchThrow("Projectile Ghost Replacements", delegate { skinParams.projectileGhostReplacements = Array.Empty<ProjectileGhostReplacement>(); }); Array.Resize(ref val2.skins, val2.skins.Length + 1); val2.skins[val2.skins.Length - 1] = skin; DTGunnerDroneBodySnowtimeSkinsVRCSnowtime02SkinAdded(skin, val); } catch (FieldException ex) { if (ex.InnerException is ElementException ex2) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\"")); InstanceLogger.LogWarning((object)$"Field causing issue: {ex.Message}, element: {ex2.Index}"); InstanceLogger.LogWarning((object)ex2.Message); InstanceLogger.LogError((object)ex.InnerException); } else { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\"")); InstanceLogger.LogWarning((object)("Field causing issue: " + ex.Message)); InstanceLogger.LogError((object)ex.InnerException); } } catch (Exception ex3) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\"")); InstanceLogger.LogError((object)ex3); } } private static void Drone1BodySnowtimeSkinsVRCSnowtime02_genericSkinAdded(SkinDef skinDef, GameObject bodyPrefab) { SnowtimeSkinsPlugin.Drone1BodySnowtimeSkinsVRCSnowtime02_genericSkinAddedEvent(Instance, new SkinAddedArgs(skinDef, bodyPrefab)); } private static void AddDrone1BodySnowtimeSkinsVRCSnowtime02_genericSkin() { string text = "Drone1Body"; string text2 = "SnowtimeSkinsVRCSnowtime02_generic"; try { GameObject val = BodyCatalog.FindBodyPrefab(text); if (!Object.op_Implicit((Object)(object)val)) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin because \"" + text + "\" doesn't exist")); return; } ModelLocator component = val.GetComponent<ModelLocator>(); if (!Object.op_Implicit((Object)(object)component)) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelLocator\" component")); return; } GameObject gameObject = ((Component)component.modelTransform).gameObject; ModelSkinController val2 = (Object.op_Implicit((Object)(object)gameObject) ? gameObject.GetComponent<ModelSkinController>() : null); if (!Object.op_Implicit((Object)(object)val2)) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelSkinController\" component")); return; } Renderer[] renderers = gameObject.GetComponentsInChildren<Renderer>(true); gameObject.GetComponentsInChildren<Light>(true); SkinDef skin = ScriptableObject.CreateInstance<SkinDef>(); SkinDefParams skinParams = ScriptableObject.CreateInstance<SkinDefParams>(); skin.skinDefParams = skinParams; TryCatchThrow("Icon", delegate { skin.icon = assetBundle.LoadAsset<Sprite>("Assets/snowtime/halo/hunkevolved/Icons/HaloCESpartan_SnowtimeIcon.png"); }); ((Object)skin).name = text2; skin.nameToken = "WINTERWONDERLAND_SKIN_SNOWTIMESKINSVRCSNOWTIME02_GENERIC_NAME"; skin.rootObject = gameObject; TryCatchThrow("Base Skins", delegate { skin.baseSkins = Array.Empty<SkinDef>(); }); TryCatchThrow("Unlockable Name", delegate { skin.unlockableDef = null; }); TryCatchThrow("Game Object Activations", delegate { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) skinParams.gameObjectActivations = (GameObjectActivation[])(object)new GameObjectActivation[2] { new GameObjectActivation { gameObject = ((Component)ThrowIfNull<Renderer>(0, "There is no renderer with the name \"Drone1Mesh\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "Drone1Mesh")))).gameObject, shouldActivate = false, spawnPrefabOnModelObject = true, localPosition = new Vector3(0.5f, -1.3f, -4f), localRotation = new Vector3(0f, 0f, 20f), localScale = new Vector3(1f, 1f, 1f), prefab = assetBundle.LoadAsset<GameObject>("Assets/snowtime/halo/hunkevolved/prefab/banshee_fx_h2.prefab") }, new GameObjectActivation { gameObject = ((Component)ThrowIfNull<Renderer>(1, "There is no renderer with the name \"Drone1BladeActive\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "Drone1BladeActive")))).gameObject, shouldActivate = false, spawnPrefabOnModelObject = false } }; }); TryCatchThrow("Renderer Infos", delegate { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) skinParams.rendererInfos = (RendererInfo[])(object)new RendererInfo[1] { new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/snowtime/templatematerial/banshee/banshee_heretic.mat"), defaultShadowCastingMode = (ShadowCastingMode)2, ignoreOverlays = false, renderer = ThrowIfNull<Renderer>(0, "There is no renderer with the name \"Drone1Mesh\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "Drone1Mesh"))) } }; }); TryCatchThrow("Mesh Replacements", delegate { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) skinParams.meshReplacements = (MeshReplacement[])(object)new MeshReplacement[1] { new MeshReplacement { mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\SnowtimeSkins\\Meshes\\unnamed base superhigh.mesh"), renderer = ThrowIfNull<Renderer>(0, "There is no renderer with the name \"Drone1Mesh\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "Drone1Mesh"))) } }; }); TryCatchThrow("Light Infos", delegate { skinParams.lightReplacements = (LightInfo[])(object)new LightInfo[0]; }); TryCatchThrow("Minion Skin Replacements", delegate { skinParams.minionSkinReplacements = Array.Empty<MinionSkinReplacement>(); }); TryCatchThrow("Projectile Ghost Replacements", delegate { skinParams.projectileGhostReplacements = Array.Empty<ProjectileGhostReplacement>(); }); Array.Resize(ref val2.skins, val2.skins.Length + 1); val2.skins[val2.skins.Length - 1] = skin; Drone1BodySnowtimeSkinsVRCSnowtime02_genericSkinAdded(skin, val); } catch (FieldException ex) { if (ex.InnerException is ElementException ex2) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\"")); InstanceLogger.LogWarning((object)$"Field causing issue: {ex.Message}, element: {ex2.Index}"); InstanceLogger.LogWarning((object)ex2.Message); InstanceLogger.LogError((object)ex.InnerException); } else { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\"")); InstanceLogger.LogWarning((object)("Field causing issue: " + ex.Message)); InstanceLogger.LogError((object)ex.InnerException); } } catch (Exception ex3) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\"")); InstanceLogger.LogError((object)ex3); } } private static void MissileDroneBodySnowtimeSkinsVRCSnowtime03SkinAdded(SkinDef skinDef, GameObject bodyPrefab) { SnowtimeSkinsPlugin.MissileDroneBodySnowtimeSkinsVRCSnowtime03SkinAddedEvent(Instance, new SkinAddedArgs(skinDef, bodyPrefab)); } private static void AddMissileDroneBodySnowtimeSkinsVRCSnowtime03Skin() { string text = "MissileDroneBody"; string text2 = "SnowtimeSkinsVRCSnowtime03"; try { GameObject val = BodyCatalog.FindBodyPrefab(text); if (!Object.op_Implicit((Object)(object)val)) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin because \"" + text + "\" doesn't exist")); return; } ModelLocator component = val.GetComponent<ModelLocator>(); if (!Object.op_Implicit((Object)(object)component)) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelLocator\" component")); return; } GameObject gameObject = ((Component)component.modelTransform).gameObject; ModelSkinController val2 = (Object.op_Implicit((Object)(object)gameObject) ? gameObject.GetComponent<ModelSkinController>() : null); if (!Object.op_Implicit((Object)(object)val2)) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelSkinController\" component")); return; } Renderer[] renderers = gameObject.GetComponentsInChildren<Renderer>(true); gameObject.GetComponentsInChildren<Light>(true); SkinDef skin = ScriptableObject.CreateInstance<SkinDef>(); SkinDefParams skinParams = ScriptableObject.CreateInstance<SkinDefParams>(); skin.skinDefParams = skinParams; TryCatchThrow("Icon", delegate { skin.icon = assetBundle.LoadAsset<Sprite>("Assets/snowtime/halo/hunkevolved/Icons/HaloCESpartan_SnowtimeIcon.png"); }); ((Object)skin).name = text2; skin.nameToken = "WINTERWONDERLAND_SKIN_SNOWTIMESKINSVRCSNOWTIME03_NAME"; skin.rootObject = gameObject; TryCatchThrow("Base Skins", delegate { skin.baseSkins = Array.Empty<SkinDef>(); }); TryCatchThrow("Unlockable Name", delegate { skin.unlockableDef = null; }); TryCatchThrow("Game Object Activations", delegate { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) skinParams.gameObjectActivations = (GameObjectActivation[])(object)new GameObjectActivation[2] { new GameObjectActivation { gameObject = ((Component)ThrowIfNull<Renderer>(0, "There is no renderer with the name \"Blades\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "Blades")))).gameObject, shouldActivate = false, spawnPrefabOnModelObject = false }, new GameObjectActivation { gameObject = ((Component)ThrowIfNull<Renderer>(1, "There is no renderer with the name \"Blades2\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "Blades2")))).gameObject, shouldActivate = false, spawnPrefabOnModelObject = false } }; }); TryCatchThrow("Renderer Infos", delegate { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) skinParams.rendererInfos = (RendererInfo[])(object)new RendererInfo[1] { new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/snowtime/templatematerial/hornet/hornet.mat"), defaultShadowCastingMode = (ShadowCastingMode)2, ignoreOverlays = false, renderer = ThrowIfNull<Renderer>(0, "There is no renderer with the name \"MissileDroneMesh\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "MissileDroneMesh"))) } }; }); TryCatchThrow("Mesh Replacements", delegate { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) skinParams.meshReplacements = (MeshReplacement[])(object)new MeshReplacement[1] { new MeshReplacement { mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\SnowtimeSkins\\Meshes\\hornet.mesh"), renderer = ThrowIfNull<Renderer>(0, "There is no renderer with the name \"MissileDroneMesh\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "MissileDroneMesh"))) } }; }); TryCatchThrow("Light Infos", delegate { skinParams.lightReplacements = (LightInfo[])(object)new LightInfo[0]; }); TryCatchThrow("Minion Skin Replacements", delegate { skinParams.minionSkinReplacements = Array.Empty<MinionSkinReplacement>(); }); TryCatchThrow("Projectile Ghost Replacements", delegate { skinParams.projectileGhostReplacements = Array.Empty<ProjectileGhostReplacement>(); }); Array.Resize(ref val2.skins, val2.skins.Length + 1); val2.skins[val2.skins.Length - 1] = skin; MissileDroneBodySnowtimeSkinsVRCSnowtime03SkinAdded(skin, val); } catch (FieldException ex) { if (ex.InnerException is ElementException ex2) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\"")); InstanceLogger.LogWarning((object)$"Field causing issue: {ex.Message}, element: {ex2.Index}"); InstanceLogger.LogWarning((object)ex2.Message); InstanceLogger.LogError((object)ex.InnerException); } else { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\"")); InstanceLogger.LogWarning((object)("Field causing issue: " + ex.Message)); InstanceLogger.LogError((object)ex.InnerException); } } catch (Exception ex3) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\"")); InstanceLogger.LogError((object)ex3); } } private static void MegaDroneBodySnowtimeSkinsVRCSnowtime04SkinAdded(SkinDef skinDef, GameObject bodyPrefab) { SnowtimeSkinsPlugin.MegaDroneBodySnowtimeSkinsVRCSnowtime04SkinAddedEvent(Instance, new SkinAddedArgs(skinDef, bodyPrefab)); } private static void AddMegaDroneBodySnowtimeSkinsVRCSnowtime04Skin() { string text = "MegaDroneBody"; string text2 = "SnowtimeSkinsVRCSnowtime04"; try { GameObject val = BodyCatalog.FindBodyPrefab(text); if (!Object.op_Implicit((Object)(object)val)) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin because \"" + text + "\" doesn't exist")); return; } ModelLocator component = val.GetComponent<ModelLocator>(); if (!Object.op_Implicit((Object)(object)component)) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelLocator\" component")); return; } GameObject mdl = ((Component)component.modelTransform).gameObject; ModelSkinController skinController = (Object.op_Implicit((Object)(object)mdl) ? mdl.GetComponent<ModelSkinController>() : null); if (!Object.op_Implicit((Object)(object)skinController)) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelSkinController\" component")); return; } Renderer[] renderers = mdl.GetComponentsInChildren<Renderer>(true); mdl.GetComponentsInChildren<Light>(true); SkinDef skin = ScriptableObject.CreateInstance<SkinDef>(); SkinDefParams skinParams = ScriptableObject.CreateInstance<SkinDefParams>(); skin.skinDefParams = skinParams; TryCatchThrow("Icon", delegate { skin.icon = assetBundle.LoadAsset<Sprite>("Assets/snowtime/halo/hunkevolved/Icons/HaloCESpartan_SnowtimeIcon.png"); }); ((Object)skin).name = text2; skin.nameToken = "WINTERWONDERLAND_SKIN_SNOWTIMESKINSVRCSNOWTIME04_NAME"; skin.rootObject = mdl; TryCatchThrow("Base Skins", delegate { skin.baseSkins = (SkinDef[])(object)new SkinDef[1] { ThrowIfOutOfBounds(0, "Index 0 is out of bounds of skins array", skinController.skins, 0) }; }); TryCatchThrow("Unlockable Name", delegate { skin.unlockableDef = null; }); TryCatchThrow("Game Object Activations", delegate { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Unknown result type (might be due to invalid IL or missing references) //IL_02be: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_0302: Unknown result type (might be due to invalid IL or missing references) //IL_030c: Unknown result type (might be due to invalid IL or missing references) //IL_034f: Unknown result type (might be due to invalid IL or missing references) //IL_0350: Unknown result type (might be due to invalid IL or missing references) skinParams.gameObjectActivations = (GameObjectActivation[])(object)new GameObjectActivation[11] { new GameObjectActivation { gameObject = ((Component)ThrowIfNull<Transform>(0, "There is no renderer at path \"MegaDroneArmature/Base/BlinkyForwardRedLight\"", mdl.transform.Find("MegaDroneArmature/Base/BlinkyForwardRedLight"))).gameObject, shouldActivate = false, spawnPrefabOnModelObject = false }, new GameObjectActivation { gameObject = ((Component)ThrowIfNull<Transform>(1, "There is no renderer at path \"MegaDroneArmature/Base/Rotor/WingRoll.l/WingPitch.l/WingPitch.l_end/BlinkyBackLight\"", mdl.transform.Find("MegaDroneArmature/Base/Rotor/WingRoll.l/WingPitch.l/WingPitch.l_end/BlinkyBackLight"))).gameObject, shouldActivate = false, spawnPrefabOnModelObject = false }, new GameObjectActivation { gameObject = ((Component)ThrowIfNull<Transform>(2, "There is no renderer at path \"MegaDroneArmature/Base/Rotor/WingRoll.r/WingPitch.r/WingPitch.r_end/BlinkyBackLight\"", mdl.transform.Find("MegaDroneArmature/Base/Rotor/WingRoll.r/WingPitch.r/WingPitch.r_end/BlinkyBackLight"))).gameObject, shouldActivate = false, spawnPrefabOnModelObject = false }, new GameObjectActivation { gameObject = ((Component)ThrowIfNull<Transform>(3, "There is no renderer at path \"MegaDroneArmature/Base/Rotor/WingRoll.l/WingPitch.l/WingPitch.l_end/GreenFlare\"", mdl.transform.Find("MegaDroneArmature/Base/Rotor/WingRoll.l/WingPitch.l/WingPitch.l_end/GreenFlare"))).gameObject, shouldActivate = false, spawnPrefabOnModelObject = false }, new GameObjectActivation { gameObject = ((Component)ThrowIfNull<Transform>(4, "There is no renderer at path \"MegaDroneArmature/Base/Rotor/WingRoll.r/WingPitch.r/WingPitch.r_end/RedFlare\"", mdl.transform.Find("MegaDroneArmature/Base/Rotor/WingRoll.r/WingPitch.r/WingPitch.r_end/RedFlare"))).gameObject, shouldActivate = false, spawnPrefabOnModelObject = false }, new GameObjectActivation { gameObject = ((Component)ThrowIfNull<Transform>(5, "There is no renderer at path \"MegaDroneArmature/Base/Rotor/WingRoll.l/WingPitch.l/WingPitch.l_end/JetCenter/ExhaustLight\"", mdl.transform.Find("MegaDroneArmature/Base/Rotor/WingRoll.l/WingPitch.l/WingPitch.l_end/JetCenter/ExhaustLight"))).gameObject, shouldActivate = false, spawnPrefabOnModelObject = false }, new GameObjectActivation { gameObject = ((Component)ThrowIfNull<Transform>(6, "There is no renderer at path \"MegaDroneArmature/Base/Rotor/WingRoll.l/WingPitch.l/WingPitch.l_end/JetCenter/Flames\"", mdl.transform.Find("MegaDroneArmature/Base/Rotor/WingRoll.l/WingPitch.l/WingPitch.l_end/JetCenter/Flames"))).gameObject, shouldActivate = false, spawnPrefabOnModelObject = false }, new GameObjectActivation { gameObject = ((Component)ThrowIfNull<Transform>(7, "There is no renderer at path \"MegaDroneArmature/Base/Rotor/WingRoll.l/WingPitch.l/WingPitch.l_end/JetCenter/Distortion\"", mdl.transform.Find("MegaDroneArmature/Base/Rotor/WingRoll.l/WingPitch.l/WingPitch.l_end/JetCenter/Distortion"))).gameObject, shouldActivate = false, spawnPrefabOnModelObject = false }, new GameObjectActivation { gameObject = ((Component)ThrowIfNull<Transform>(8, "There is no renderer at path \"MegaDroneArmature/Base/Rotor/WingRoll.r/WingPitch.r/WingPitch.r_end/JetCenter/ExhaustLight\"", mdl.transform.Find("MegaDroneArmature/Base/Rotor/WingRoll.r/WingPitch.r/WingPitch.r_end/JetCenter/ExhaustLight"))).gameObject, shouldActivate = false, spawnPrefabOnModelObject = false }, new GameObjectActivation { gameObject = ((Component)ThrowIfNull<Transform>(9, "There is no renderer at path \"MegaDroneArmature/Base/Rotor/WingRoll.r/WingPitch.r/WingPitch.r_end/JetCenter/Flames\"", mdl.transform.Find("MegaDroneArmature/Base/Rotor/WingRoll.r/WingPitch.r/WingPitch.r_end/JetCenter/Flames"))).gameObject, shouldActivate = false, spawnPrefabOnModelObject = false }, new GameObjectActivation { gameObject = ((Component)ThrowIfNull<Transform>(10, "There is no renderer at path \"MegaDroneArmature/Base/Rotor/WingRoll.r/WingPitch.r/WingPitch.r_end/JetCenter/Distortion\"", mdl.transform.Find("MegaDroneArmature/Base/Rotor/WingRoll.r/WingPitch.r/WingPitch.r_end/JetCenter/Distortion"))).gameObject, shouldActivate = false, spawnPrefabOnModelObject = false } }; }); TryCatchThrow("Renderer Infos", delegate { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) skinParams.rendererInfos = (RendererInfo[])(object)new RendererInfo[1] { new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/snowtime/templatematerial/hornet/vulture.mat"), defaultShadowCastingMode = (ShadowCastingMode)2, ignoreOverlays = false, renderer = ThrowIfNull<Renderer>(0, "There is no renderer with the name \"MegaDroneMesh\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "MegaDroneMesh"))) } }; }); TryCatchThrow("Mesh Replacements", delegate { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) skinParams.meshReplacements = (MeshReplacement[])(object)new MeshReplacement[1] { new MeshReplacement { mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\SnowtimeSkins\\Meshes\\Vulture_ForArchive.mesh"), renderer = ThrowIfNull<Renderer>(0, "There is no renderer with the name \"MegaDroneMesh\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "MegaDroneMesh"))) } }; }); TryCatchThrow("Light Infos", delegate { skinParams.lightReplacements = (LightInfo[])(object)new LightInfo[0]; }); TryCatchThrow("Minion Skin Replacements", delegate { skinParams.minionSkinReplacements = Array.Empty<MinionSkinReplacement>(); }); TryCatchThrow("Projectile Ghost Replacements", delegate { skinParams.projectileGhostReplacements = Array.Empty<ProjectileGhostReplacement>(); }); Array.Resize(ref skinController.skins, skinController.skins.Length + 1); skinController.skins[skinController.skins.Length - 1] = skin; MegaDroneBodySnowtimeSkinsVRCSnowtime04SkinAdded(skin, val); } catch (FieldException ex) { if (ex.InnerException is ElementException ex2) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\"")); InstanceLogger.LogWarning((object)$"Field causing issue: {ex.Message}, element: {ex2.Index}"); InstanceLogger.LogWarning((object)ex2.Message); InstanceLogger.LogError((object)ex.InnerException); } else { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\"")); InstanceLogger.LogWarning((object)("Field causing issue: " + ex.Message)); InstanceLogger.LogError((object)ex.InnerException); } } catch (Exception ex3) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\"")); InstanceLogger.LogError((object)ex3); } } private static void BackupDroneBodySnowtimeSkinsVRCSnowtime05SkinAdded(SkinDef skinDef, GameObject bodyPrefab) { SnowtimeSkinsPlugin.BackupDroneBodySnowtimeSkinsVRCSnowtime05SkinAddedEvent(Instance, new SkinAddedArgs(skinDef, bodyPrefab)); } private static void AddBackupDroneBodySnowtimeSkinsVRCSnowtime05Skin() { string text = "BackupDroneBody"; string text2 = "SnowtimeSkinsVRCSnowtime05"; try { GameObject val = BodyCatalog.FindBodyPrefab(text); if (!Object.op_Implicit((Object)(object)val)) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin because \"" + text + "\" doesn't exist")); return; } ModelLocator component = val.GetComponent<ModelLocator>(); if (!Object.op_Implicit((Object)(object)component)) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelLocator\" component")); return; } GameObject gameObject = ((Component)component.modelTransform).gameObject; ModelSkinController val2 = (Object.op_Implicit((Object)(object)gameObject) ? gameObject.GetComponent<ModelSkinController>() : null); if (!Object.op_Implicit((Object)(object)val2)) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelSkinController\" component")); return; } Renderer[] renderers = gameObject.GetComponentsInChildren<Renderer>(true); gameObject.GetComponentsInChildren<Light>(true); SkinDef skin = ScriptableObject.CreateInstance<SkinDef>(); SkinDefParams skinParams = ScriptableObject.CreateInstance<SkinDefParams>(); skin.skinDefParams = skinParams; TryCatchThrow("Icon", delegate { skin.icon = assetBundle.LoadAsset<Sprite>("Assets/snowtime/halo/hunkevolved/Icons/HaloCESpartan_SnowtimeIcon.png"); }); ((Object)skin).name = text2; skin.nameToken = "WINTERWONDERLAND_SKIN_SNOWTIMESKINSVRCSNOWTIME05_NAME"; skin.rootObject = gameObject; TryCatchThrow("Base Skins", delegate { skin.baseSkins = Array.Empty<SkinDef>(); }); TryCatchThrow("Unlockable Name", delegate { skin.unlockableDef = null; }); TryCatchThrow("Game Object Activations", delegate { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) skinParams.gameObjectActivations = (GameObjectActivation[])(object)new GameObjectActivation[3] { new GameObjectActivation { gameObject = ((Component)ThrowIfNull<Renderer>(0, "There is no renderer with the name \"mdlBackupDrone\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "mdlBackupDrone")))).gameObject, shouldActivate = true, spawnPrefabOnModelObject = false }, new GameObjectActivation { gameObject = ((Component)ThrowIfNull<Renderer>(1, "There is no renderer with the name \"Blades\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "Blades")))).gameObject, shouldActivate = false, spawnPrefabOnModelObject = false }, new GameObjectActivation { gameObject = ((Component)ThrowIfNull<Renderer>(2, "There is no renderer with the name \"Blades2\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "Blades2")))).gameObject, shouldActivate = false, spawnPrefabOnModelObject = false } }; }); TryCatchThrow("Renderer Infos", delegate { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) skinParams.rendererInfos = (RendererInfo[])(object)new RendererInfo[1] { new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/snowtime/templatematerial/vampire/vampire.mat"), defaultShadowCastingMode = (ShadowCastingMode)2, ignoreOverlays = false, renderer = ThrowIfNull<Renderer>(0, "There is no renderer with the name \"mdlBackupDrone\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "mdlBackupDrone"))) } }; }); TryCatchThrow("Mesh Replacements", delegate { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) skinParams.meshReplacements = (MeshReplacement[])(object)new MeshReplacement[1] { new MeshReplacement { mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\SnowtimeSkins\\Meshes\\Vampire.mesh"), renderer = ThrowIfNull<Renderer>(0, "There is no renderer with the name \"mdlBackupDrone\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "mdlBackupDrone"))) } }; }); TryCatchThrow("Light Infos", delegate { skinParams.lightReplacements = (LightInfo[])(object)new LightInfo[0]; }); TryCatchThrow("Minion Skin Replacements", delegate { skinParams.minionSkinReplacements = Array.Empty<MinionSkinReplacement>(); }); TryCatchThrow("Projectile Ghost Replacements", delegate { skinParams.projectileGhostReplacements = Array.Empty<ProjectileGhostReplacement>(); }); Array.Resize(ref val2.skins, val2.skins.Length + 1); val2.skins[val2.skins.Length - 1] = skin; BackupDroneBodySnowtimeSkinsVRCSnowtime05SkinAdded(skin, val); } catch (FieldException ex) { if (ex.InnerException is ElementException ex2) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\"")); InstanceLogger.LogWarning((object)$"Field causing issue: {ex.Message}, element: {ex2.Index}"); InstanceLogger.LogWarning((object)ex2.Message); InstanceLogger.LogError((object)ex.InnerException); } else { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\"")); InstanceLogger.LogWarning((object)("Field causing issue: " + ex.Message)); InstanceLogger.LogError((object)ex.InnerException); } } catch (Exception ex3) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\"")); InstanceLogger.LogError((object)ex3); } } private static void MageBodySnowtimeSkinsVRCShortcakeSkinAdded(SkinDef skinDef, GameObject bodyPrefab) { SnowtimeSkinsPlugin.MageBodySnowtimeSkinsVRCShortcakeSkinAddedEvent(Instance, new SkinAddedArgs(skinDef, bodyPrefab)); } private static void AddMageBodySnowtimeSkinsVRCShortcakeSkin() { if (!((BaseUnityPlugin)Instance).Config.Bind<bool>("SnowtimeSkinsVRCShortcake", "Enabled", true, (ConfigDescription)null).Value) { return; } string text = "MageBody"; string text2 = "SnowtimeSkinsVRCShortcake"; try { GameObject val = BodyCatalog.FindBodyPrefab(text); if (!Object.op_Implicit((Object)(object)val)) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin because \"" + text + "\" doesn't exist")); return; } ModelLocator component = val.GetComponent<ModelLocator>(); if (!Object.op_Implicit((Object)(object)component)) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelLocator\" component")); return; } GameObject gameObject = ((Component)component.modelTransform).gameObject; ModelSkinController val2 = (Object.op_Implicit((Object)(object)gameObject) ? gameObject.GetComponent<ModelSkinController>() : null); if (!Object.op_Implicit((Object)(object)val2)) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelSkinController\" component")); return; } Renderer[] renderers = gameObject.GetComponentsInChildren<Renderer>(true); gameObject.GetComponentsInChildren<Light>(true); SkinDef skin = ScriptableObject.CreateInstance<SkinDef>(); SkinDefParams skinParams = ScriptableObject.CreateInstance<SkinDefParams>(); skin.skinDefParams = skinParams; TryCatchThrow("Icon", delegate { skin.icon = assetBundle.LoadAsset<Sprite>("Assets\\SkinMods\\SnowtimeSkins\\Icons\\SnowtimeSkinsVRCShortcakeIcon.png"); }); ((Object)skin).name = text2; skin.nameToken = "WINTERWONDERLAND_SKIN_SNOWTIMESKINSVRCSHORTCAKE_NAME"; skin.rootObject = gameObject; TryCatchThrow("Base Skins", delegate { skin.baseSkins = Array.Empty<SkinDef>(); }); TryCatchThrow("Unlockable Name", delegate { skin.unlockableDef = null; }); TryCatchThrow("Game Object Activations", delegate { skinParams.gameObjectActivations = Array.Empty<GameObjectActivation>(); }); TryCatchThrow("Renderer Infos", delegate { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) skinParams.rendererInfos = (RendererInfo[])(object)new RendererInfo[2] { new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/snowtime/updated/mats/Binah_mat_Face.mat"), defaultShadowCastingMode = (ShadowCastingMode)2, ignoreOverlays = true, renderer = ThrowIfNull<Renderer>(0, "There is no renderer with the name \"MageMesh\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "MageMesh"))) }, new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/snowtime/guns/gem_basic.mat"), defaultShadowCastingMode = (ShadowCastingMode)2, ignoreOverlays = true, renderer = ThrowIfNull<Renderer>(1, "There is no renderer with the name \"MageCapeMesh\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "MageCapeMesh"))) } }; }); TryCatchThrow("Mesh Replacements", delegate { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) skinParams.meshReplacements = (MeshReplacement[])(object)new MeshReplacement[2] { new MeshReplacement { mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\SnowtimeSkins\\Meshes\\MageMesh_shortcake.mesh"), renderer = ThrowIfNull<Renderer>(0, "There is no renderer with the name \"MageMesh\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "MageMesh"))) }, new MeshReplacement { mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\SnowtimeSkins\\Meshes\\MageCapeMesh_shortcake.mesh"), renderer = ThrowIfNull<Renderer>(1, "There is no renderer with the name \"MageCapeMesh\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "MageCapeMesh"))) } }; }); TryCatchThrow("Light Infos", delegate { skinParams.lightReplacements = (LightInfo[])(object)new LightInfo[0]; }); TryCatchThrow("Minion Skin Replacements", delegate { skinParams.minionSkinReplacements = Array.Empty<MinionSkinReplacement>(); }); TryCatchThrow("Projectile Ghost Replacements", delegate { skinParams.projectileGhostReplacements = Array.Empty<ProjectileGhostReplacement>(); }); Array.Resize(ref val2.skins, val2.skins.Length + 1); val2.skins[val2.skins.Length - 1] = skin; MageBodySnowtimeSkinsVRCShortcakeSkinAdded(skin, val); } catch (FieldException ex) { if (ex.InnerException is ElementException ex2) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\"")); InstanceLogger.LogWarning((object)$"Field causing issue: {ex.Message}, element: {ex2.Index}"); InstanceLogger.LogWarning((object)ex2.Message); InstanceLogger.LogError((object)ex.InnerException); } else { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\"")); InstanceLogger.LogWarning((object)("Field causing issue: " + ex.Message)); InstanceLogger.LogError((object)ex.InnerException); } } catch (Exception ex3) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\"")); InstanceLogger.LogError((object)ex3); } } private static void DroneTechBodySnowtimeSkinsVRCSnowtime01SkinAdded(SkinDef skinDef, GameObject bodyPrefab) { SnowtimeSkinsPlugin.DroneTechBodySnowtimeSkinsVRCSnowtime01SkinAddedEvent(Instance, new SkinAddedArgs(skinDef, bodyPrefab)); } private static void AddDroneTechBodySnowtimeSkinsVRCSnowtime01Skin() { if (!((BaseUnityPlugin)Instance).Config.Bind<bool>("SnowtimeSkinsVRCSnowtime01", "Enabled", true, (ConfigDescription)null).Value) { return; } string text = "DroneTechBody"; string text2 = "SnowtimeSkinsVRCSnowtime01"; try { GameObject val = BodyCatalog.FindBodyPrefab(text); if (!Object.op_Implicit((Object)(object)val)) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin because \"" + text + "\" doesn't exist")); return; } ModelLocator component = val.GetComponent<ModelLocator>(); if (!Object.op_Implicit((Object)(object)component)) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelLocator\" component")); return; } GameObject gameObject = ((Component)component.modelTransform).gameObject; ModelSkinController val2 = (Object.op_Implicit((Object)(object)gameObject) ? gameObject.GetComponent<ModelSkinController>() : null); if (!Object.op_Implicit((Object)(object)val2)) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelSkinController\" component")); return; } Renderer[] renderers = gameObject.GetComponentsInChildren<Renderer>(true); gameObject.GetComponentsInChildren<Light>(true); SkinDef skin = ScriptableObject.CreateInstance<SkinDef>(); SkinDefParams skinParams = ScriptableObject.CreateInstance<SkinDefParams>(); skin.skinDefParams = skinParams; TryCatchThrow("Icon", delegate { skin.icon = assetBundle.LoadAsset<Sprite>("Assets/snowtime/halo/hunkevolved/Icons/HaloCESpartan_SnowtimeIcon.png"); }); ((Object)skin).name = text2; skin.nameToken = "WINTERWONDERLAND_SKIN_SNOWTIMESKINSVRCSNOWTIME01_NAME"; skin.rootObject = gameObject; TryCatchThrow("Base Skins", delegate { skin.baseSkins = Array.Empty<SkinDef>(); }); TryCatchThrow("Unlockable Name", delegate { skin.unlockableDef = null; }); TryCatchThrow("Game Object Activations", delegate { skinParams.gameObjectActivations = Array.Empty<GameObjectActivation>(); }); TryCatchThrow("Renderer Infos", delegate { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) skinParams.rendererInfos = (RendererInfo[])(object)new RendererInfo[6] { new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/snowtime/templatematerial/dronetechthing.mat"), defaultShadowCastingMode = (ShadowCastingMode)2, ignoreOverlays = true, renderer = ThrowIfNull<Renderer>(0, "There is no renderer with the name \"DroneTech_Body\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "DroneTech_Body"))) }, new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/snowtime_skin/DOLOSart/1.Milltina/Material/Milltina_Body_Poi.mat"), defaultShadowCastingMode = (ShadowCastingMode)2, ignoreOverlays = true, renderer = ThrowIfNull<Renderer>(1, "There is no renderer with the name \"DroneTech_Gun\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "DroneTech_Gun"))) }, new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/snowtime/Milltina_Eyes.mat"), defaultShadowCastingMode = (ShadowCastingMode)0, ignoreOverlays = true, renderer = ThrowIfNull<Renderer>(2, "There is no renderer with the name \"Operator_Glow_01\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "Operator_Glow_01"))) }, new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/snowtime_skin/Vellie/Urban Grace/MaterialPack/Top_Pants_Belt/Basics/Blue_Black.mat"), defaultShadowCastingMode = (ShadowCastingMode)2, ignoreOverlays = true, renderer = ThrowIfNull<Renderer>(3, "There is no renderer with the name \"Operator_Glow_02\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "Operator_Glow_02"))) }, new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/snowtime_skin/Vellie/Urban Grace/MaterialPack/Top_Pants_Belt/Basics/HaloMetallic.mat"), defaultShadowCastingMode = (ShadowCastingMode)2, ignoreOverlays = true, renderer = ThrowIfNull<Renderer>(4, "There is no renderer with the name \"Operator_Glow_03\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "Operator_Glow_03"))) }, new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/snowtime_skin/DOLOSart/1.Milltina/Material/Milltina_Body_Poi.mat"), defaultShadowCastingMode = (ShadowCastingMode)2, ignoreOverlays = true, renderer = ThrowIfNull<Renderer>(5, "There is no renderer with the name \"Operator_Glow_04\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "Operator_Glow_04"))) } }; }); TryCatchThrow("Mesh Replacements", delegate { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) skinParams.meshReplacements = (MeshReplacement[])(object)new MeshReplacement[6] { new MeshReplacement { mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\SnowtimeSkins\\Meshes\\_dronetech.mesh"), renderer = ThrowIfNull<Renderer>(0, "There is no renderer with the name \"DroneTech_Body\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "DroneTech_Body"))) }, new MeshReplacement { mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\SnowtimeSkins\\Meshes\\_face.mesh"), renderer = ThrowIfNull<Renderer>(1, "There is no renderer with the name \"DroneTech_Gun\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "DroneTech_Gun"))) }, new MeshReplacement { mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\SnowtimeSkins\\Meshes\\_eyes.mesh"), renderer = ThrowIfNull<Renderer>(2, "There is no renderer with the name \"Operator_Glow_01\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "Operator_Glow_01"))) }, new MeshReplacement { mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\SnowtimeSkins\\Meshes\\_outfitfix.mesh"), renderer = ThrowIfNull<Renderer>(3, "There is no renderer with the name \"Operator_Glow_02\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "Operator_Glow_02"))) }, new MeshReplacement { mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\SnowtimeSkins\\Meshes\\_metalfix.mesh"), renderer = ThrowIfNull<Renderer>(4, "There is no renderer with the name \"Operator_Glow_03\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "Operator_Glow_03"))) }, new MeshReplacement { mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\SnowtimeSkins\\Meshes\\_face_nooverlay.mesh"), renderer = ThrowIfNull<Renderer>(5, "There is no renderer with the name \"Operator_Glow_04\"", ((IEnumerable<Renderer>)renderers).FirstOrDefault((Func<Renderer, bool>)((Renderer r) => ((Object)r).name == "Operator_Glow_04"))) } }; }); TryCatchThrow("Light Infos", delegate { skinParams.lightReplacements = (LightInfo[])(object)new LightInfo[0]; }); TryCatchThrow("Minion Skin Replacements", delegate { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) skinParams.minionSkinReplacements = (MinionSkinReplacement[])(object)new MinionSkinReplacement[5] { new MinionSkinReplacement { minionBodyPrefab = BodyCatalog.FindBodyPrefab("DTGunnerDroneBody"), minionSkin = ThrowIfNull<SkinDef>(0, "There is no skin with the name \"SnowtimeSkinsVRCSnowtime02\" for body \"DTGunnerDroneBody\"", ((IEnumerable<SkinDef>)SkinCatalog.FindSkinsForBody(ThrowIfEquals<BodyIndex>(0, "Body \"DTGunnerDroneBody\" doesn't exist", BodyCatalog.FindBodyIndex("DTGunnerDroneBody"), (BodyIndex)(-1)))).FirstOrDefault((Func<SkinDef, bool>)((SkinDef s) => ((Object)s).name == "SnowtimeSkinsVRCSnowtime02"))) }, new MinionSkinReplacement { minionBodyPrefab = BodyCatalog.FindBodyPrefab("Drone1Body"), minionSkin = ThrowIfNull<SkinDef>(1, "There is no skin with the name \"SnowtimeSkinsVRCSnowtime02_generic\" for body \"Drone1Body\"", ((IEnumerable<SkinDef>)SkinCatalog.FindSkinsForBody(ThrowIfEquals<BodyIndex>(1, "Body \"Drone1Body\" doesn't exist", BodyCatalog.FindBodyIndex("Drone1Body"), (BodyIndex)(-1)))).FirstOrDefault((Func<SkinDef, bool>)((SkinDef s) => ((Object)s).name == "SnowtimeSkinsVRCSnowtime02_generic"))) }, new MinionSkinReplacement { minionBodyPrefab = BodyCatalog.FindBodyPrefab("MissileDroneBody"), minionSkin = ThrowIfNull<SkinDef>(2, "There is no skin with the name \"SnowtimeSkinsVRCSnowtime03\" for body \"MissileDroneBody\"", ((IEnumerable<SkinDef>)SkinCatalog.FindSkinsForBody(ThrowIfEquals<BodyIndex>(2, "Body \"MissileDroneBody\" doesn't exist", BodyCatalog.FindBodyIndex("MissileDroneBody"), (BodyIndex)(-1)))).FirstOrDefault((Func<SkinDef, bool>)((SkinDef s) => ((Object)s).name == "SnowtimeSkinsVRCSnowtime03"))) }, new MinionSkinReplacement { minionBodyPrefab = BodyCatalog.FindBodyPrefab("MegaDroneBody"), minionSkin = ThrowIfNull<SkinDef>(3, "There is no skin with the name \"SnowtimeSkinsVRCSnowtime04\" for body \"MegaDroneBody\"", ((IEnumerable<SkinDef>)SkinCatalog.FindSkinsForBody(ThrowIfEquals<BodyIndex>(3, "Body \"MegaDroneBody\" doesn't exist", BodyCatalog.FindBodyIndex("MegaDroneBody"), (BodyIndex)(-1)))).FirstOrDefault((Func<SkinDef, bool>)((SkinDef s) => ((Object)s).name == "SnowtimeSkinsVRCSnowtime04"))) }, new MinionSkinReplacement { minionBodyPrefab = BodyCatalog.FindBodyPrefab("BackupDroneBody"), minionSkin = ThrowIfNull<SkinDef>(4, "There is no skin with the name \"SnowtimeSkinsVRCSnowtime05\" for body \"BackupDroneBody\"", ((IEnumerable<SkinDef>)SkinCatalog.FindSkinsForBody(ThrowIfEquals<BodyIndex>(4, "Body \"BackupDroneBody\" doesn't exist", BodyCatalog.FindBodyIndex("BackupDroneBody"), (BodyIndex)(-1)))).FirstOrDefault((Func<SkinDef, bool>)((SkinDef s) => ((Object)s).name == "SnowtimeSkinsVRCSnowtime05"))) } }; }); TryCatchThrow("Projectile Ghost Replacements", delegate { skinParams.projectileGhostReplacements = Array.Empty<ProjectileGhostReplacement>(); }); Array.Resize(ref val2.skins, val2.skins.Length + 1); val2.skins[val2.skins.Length - 1] = skin; DroneTechBodySnowtimeSkinsVRCSnowtime01SkinAdded(skin, val); } catch (FieldException ex) { if (ex.InnerException is ElementException ex2) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\"")); InstanceLogger.LogWarning((object)$"Field causing issue: {ex.Message}, element: {ex2.Index}"); InstanceLogger.LogWarning((object)ex2.Message); InstanceLogger.LogError((object)ex.InnerException); } else { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\"")); InstanceLogger.LogWarning((object)("Field causing issue: " + ex.Message)); InstanceLogger.LogError((object)ex.InnerException); } } catch (Exception ex3) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\"")); InstanceLogger.LogError((object)ex3); } } private static T ThrowIfEquals<T>(int index, string message, T value, T expected) where T : Enum { if (value.Equals(expected)) { throw new ElementException(index, message); } return value; } private static T ThrowIfOutOfBounds<T>(int index, string message, T[] array, int elementIndex) where T : class { if (array == null || array.Length <= elementIndex) { throw new ElementException(index, message); } return array[elementIndex]; } private static T ThrowIfNull<T>(int index, string message, T value) where T : class { if (value == null) { throw new ElementException(index, message); } return value; } private static void TryCatchThrow(string message, Action action) { try { action?.Invoke(); } catch (Exception innerException) { throw new FieldException(message, innerException); } } private static void TryAddComponent<T>(GameObject obj) where T : Component { if (Object.op_Implicit((Object)(object)obj) && !Object.op_Implicit((Object)(object)obj.GetComponent<T>())) { obj.AddComponent<T>(); } } } } namespace RuneFoxMods { internal class Utils { public static void PrintBodyCatalog() { Debug.Log((object)"\nBodyCatalog"); foreach (GameObject allBodyPrefab in BodyCatalog.allBodyPrefabs) { Debug.Log((object)((Object)allBodyPrefab).name); } Debug.Log((object)"\n"); } public static void ReadChildren(GameObject parent, int tabs, bool includecomponents = true) { //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) string text = ""; for (int i = 0; i < tabs; i++) { text += " "; } for (int j = 0; j < parent.transform.childCount; j++) { Transform child = parent.transform.GetChild(j); if ((Object)(object)child == (Object)null) { break; } string text2 = ((Component)child).gameObject.activeInHierarchy.ToString(); string[] obj = new string[6] { text, ((Object)child).name, " ", text2, " ", null }; Vector3 position = ((Component)child).transform.position; obj[5] = ((object)(Vector3)(ref position)).ToString(); Debug.Log((object)string.Concat(obj)); if (includecomponents) { ReadComponents(((Component)child).gameObject, tabs + 1); Debug.Log((object)""); } ReadChildren(((Component)child).gameObject, tabs + 1, includecomponents); } } public static void readheiarchy(GameObject parent, bool includeComponents = true) { Debug.Log((object)((Object)parent).name); if (includeComponents) { ReadComponents(parent, 1); Debug.Log((object)""); } ReadChildren(parent, 1, includeComponents); } public static void ReadComponents(GameObject obj, int tabs) { string text = ""; for (int i = 0; i < tabs; i++) { text += " "; } Component[] components = obj.GetComponents(typeof(Component)); foreach (Component val in components) { string text2 = ""; Debug.Log((object)(text + "Comp: " + ((object)val).GetType().ToString() + " " + text2)); } } public static void PrintAllPaths(GameObject parent) { Debug.Log((object)((Object)parent).name); PrintAllPathsInner(parent, ((Object)parent).name); } private static void PrintAllPathsInner(GameObject parent, string parent_string) { int childCount = parent.transform.childCount; for (int i = 0; i < childCount; i++) { Transform child = parent.transform.GetChild(i); if (!((Object)child).name.EndsWith("_end")) { string text = parent_string + "/" + ((Object)child).name; Debug.Log((object)(" " + ((Object)child).name + "\t\t" + text)); PrintAllPathsInner(((Component)child).gameObject, text); continue; } break; } } public static void PrintDynamicBone(DynamicBone DB) { //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) Debug.Log((object)("Root: " + (object)DB.m_Root)); Debug.Log((object)("Damping: " + DB.m_Damping)); Debug.Log((object)("Damping Dist: " + (object)DB.m_DampingDistrib)); Debug.Log((object)("Elasticity: " + DB.m_Elasticity)); Debug.Log((object)("Elasticity Dist: " + (object)DB.m_ElasticityDistrib)); Debug.Log((object)("Stiffness: " + DB.m_Stiffness)); Debug.Log((object)("Stiffness Dist: " + (object)DB.m_StiffnessDistrib)); Debug.Log((object)("Inert: " + DB.m_Inert)); Debug.Log((object)("Inert Dist: " + (object)DB.m_InertDistrib)); Debug.Log((object)("Radius: " + DB.m_Radius)); Debug.Log((object)("Radius Dist: " + (object)DB.m_RadiusDistrib)); Debug.Log((object)("End Length: " + DB.m_EndLength)); Vector3 val = DB.m_EndOffset; Debug.Log((object)("End Offset: " + ((object)(Vector3)(ref val)).ToString())); val = DB.m_Gravity; Debug.Log((object)("Gravity: " + ((object)(Vector3)(ref val)).ToString())); val = DB.m_Force; Debug.Log((object)("Force: " + ((object)(Vector3)(ref val)).ToString())); Debug.Log((object)("FreezeAxis: " + ((object)(FreezeAxis)(ref DB.m_FreezeAxis)).ToString())); Debug.Log((object)("Colliders: " + DB.m_Colliders.Count)); foreach (DynamicBoneCollider collider in DB.m_Colliders) { Debug.Log((object)("\t Parent: " + ((Object)((Component)collider).transform).name)); Debug.Log((object)("\t Direction: " + ((object)(Direction)(ref collider.m_Direction)).ToString())); val = collider.m_Center; Debug.Log((object)("\t Center " + ((object)(Vector3)(ref val)).ToString())); Debug.Log((object)("\t Bound " + ((object)(Bound)(ref collider.m_Bound)).ToString())); Debug.Log((object)("\t Radius " + collider.m_Radius)); Debug.Log((object)("\t Height " + collider.m_Height)); } Debug.Log((object)("Exclusions: " + DB.m_Exclusions.Count)); foreach (Transform exclusion in DB.m_Exclusions) { Debug.Log((object)("\t Transform: " + ((Object)exclusion).name)); } } public static ChildLocator GetChildLocator(GameObject body) { ChildLocator val = null; Transform child = body.transform.GetChild(0); if (Object.op_Implicit((Object)(object)child)) { Transform child2 = child.GetChild(0); if (Object.op_Implicit((Object)(object)child2)) { val = ((Component)child2).GetComponent<ChildLocator>(); if (Object.op_Implicit((Object)(object)val)) { Debug.Log((object)"Locator Found"); } } } return val; } public static Transform FindChildInTree(Transform Root, string name) { Queue<Transform> queue = new Queue<Transform>(); queue.Enqueue(Root); while (queue.Count != 0) { Transform val = queue.Dequeue(); if (((Object)val).name == name) { return val; } for (int i = 0; i < val.childCount; i++) { Transform child = val.GetChild(i); queue.Enqueue(child); } } return null; } public static string RemoveCloneNaming(string str) { return str.Remove(str.Length - 7); } } } namespace RuneFoxMods.DynamicSkins { public static class DynamicSkinHelpers { public static SkinnedMeshRenderer[] GetBaseSkinRenderers(GameObject modelObject) { SkinnedMeshRenderer[] componentsInChildren = modelObject.GetComponentsInChildren<SkinnedMeshRenderer>(true); List<SkinnedMeshRenderer> list = new List<SkinnedMeshRenderer>(); SkinnedMeshRenderer[] array = componentsInChildren; foreach (SkinnedMeshRenderer val in array) { if ((Object)(object)((Component)val).transform.parent == (Object)(object)modelObject.transform) { list.Add(val); } } return list.ToArray(); } public static Transform[] BoneArrayBuilder(Transform NewBoneRoot) { List<Transform> list = new List<Transform>(); BoneArrayBuilderHelper(NewBoneRoot, list); return list.ToArray(); } public static void BoneArrayBuilderHelper(Transform parent, List<Transform> list) { if (!((Object)parent).name.EndsWith("_end")) { list.Add(parent); } for (int i = 0; i < parent.childCount; i++) { BoneArrayBuilderHelper(parent.GetChild(i), list); } } public static Transform GetArmature(GameObject obj) { return GetArmatureHelper(obj); } public static Transform GetArmatureHelper(GameObject obj) { if (((Object)obj).name.ToLower().Contains("armature")) { return obj.transform; } for (int i = 0; i < obj.transform.childCount; i++) { Transform armatureHelper = GetArmatureHelper(((Component)obj.transform.GetChild(i)).gameObject); if (Object.op_Implicit((Object)(object)armatureHelper)) { return armatureHelper; } } return null; } public static Transform GetTopParent(Transform obj) { Transform val = obj; while ((Object)(object)val.parent != (Object)null) { val = val.parent; } return val; } public static string GetPrevBoneInList(Transform targetBone, SkinnedMeshRenderer meshRenderer) { Transform[] bones = meshRenderer.bones; for (int i = 0; i <= bones.Length - 1; i++) { if (((Object)bones[i + 1]).name == ((Object)targetBone).name) { return ((Object)bones[i]).name; } } return null; } public static int GetBoneIndexInList(Transform targetBone, SkinnedMeshRenderer meshRenderer) { Transform[] bones = meshRenderer.bones; for (int i = 0; i <= bones.Length; i++) { if (((Object)bones[i]).name == ((Object)targetBone).name) { return i; } } return -1; } public static int GetPrevBoneIndexInList(Transform targetBone, SkinnedMeshRenderer meshRenderer) { Transform[] bones = meshRenderer.bones; for (int i = 0; i <= bones.Length - 1; i++) { if (((Object)bones[i + 1]).name == ((Object)targetBone).name) { return i; } } return -1; } } internal class DynamicSkinManager { internal Dictionary<string, SkinDef> SkinDefs = new Dictionary<string, SkinDef>(); private GameObject LastModelObject; internal Dictionary<string, SortedList<int, Modification>> ModificationList = new Dictionary<string, SortedList<int, Modification>>(); private Dictionary<GameObject, AppliedModifications> ModifiedObjects = new Dictionary<GameObject, AppliedModifications>(); internal ManualLogSource InstanceLogger; internal void AddModification(string skinNameToken, int boneIndex, Modification modification) { if (!ModificationList.TryGetValue(skinNameToken, out var value)) { value = new SortedList<int, Modification>(); ModificationList.Add(skinNameToken, value); } value.Add(boneIndex, modification); } internal void AddSkinDef(SkinDef skinDef) { SkinDefs.Add(skinDef.nameToken, skinDef); } internal void SkinDefApply(Action<SkinDef, GameObject> orig, SkinDef self, GameObject modelObject) { orig(self, modelObject); RemoveInvalidModelObjects(); ModifiedObjects.TryGetValue(modelObject, out var value); try { if (!SkinDefs.TryGetValue(self.nameToken, out var _)) { if (value != null) { ClearSkinModifications(LastModelObject, value); } } else if (value == null) { AppliedModifications appliedModifications = new AppliedModifications(); ModifiedObjects.Add(modelObject, appliedModifications); ApplySkinModifications(self, modelObject, appliedModifications); } } catch (Exception ex) { InstanceLogger.LogWarning((object)"An error occured while adding accessories to a skin"); InstanceLogger.LogError((object)ex); } } private void RemoveInvalidModelObjects() { foreach (GameObject item in ModifiedObjects.Keys.Where((GameObject el) => !Object.op_Implicit((Object)(object)el)).ToList()) { ModifiedObjects.Remove(item); } } private void ClearSkinModifications(GameObject modelObject, AppliedModifications modifications) { while (modifications.BaseModelModifications.Count != 0) { Modification modification = modifications.BaseModelModifications.Pop(); clearModification(modification, modelObject, modifications); } while (modifications.OtherModifications.Count != 0) { clearModification(modifications.OtherModifications[0], modelObject, modifications); } ModifiedObjects.Remove(modelObject); } private void ApplySkinModifications(SkinDef skindef, GameObject modelObject, AppliedModifications modifications) { CharacterModel component = modelObject.GetComponent<CharacterModel>(); LastModelObject = modelObject; if (!ModificationList.TryGetValue(skindef.nameToken, out var value)) { return; } foreach (KeyValuePair<int, Modification> item in value) { ApplyModification(modelObject, component, item.Value, modifications); } } private static void ApplyModification(GameObject modelObject, CharacterModel characterModel, Modification modification, AppliedModifications modifications) { _ = modification.bodyname; string parentname = modification.parentname; Transform val = Utils.FindChildInTree(modelObject.transform, parentname); GameObject val2; if (modification.affectsbasemodel) { val2 = Object.Instantiate<GameObject>(modification.prefab, val, false); ((Object)val2).name = Utils.RemoveCloneNaming(((Object)val2).name); modification.instance = val2; modification.inst_armature = val2; ModificationApplyBones(modelObject, modification, modifications); } else { val2 = Object.Instantiate<GameObject>(modification.prefab, modelObject.transform, false); ((Object)val2).name = Utils.RemoveCloneNaming(((Object)val2).name); modification.instance = val2; Transform armature = DynamicSkinHelpers.GetArmature(val2); ((Component)armature).transform.SetParent(val, false); modification.inst_armature = ((Component)armature).gameObject; } modification.instance = val2; if (modification.dynamicBoneData != null) { ModificationApplyDynamicBones(modelObject, modification); } ModificationAddRenderers(val2, characterModel); modifications.OtherModifications.Add(modification); } private static void ModificationApplyBones(GameObject modelObject, Modification modification, AppliedModifications modifications) { SkinnedMeshRenderer[] baseSkinRenderers = DynamicSkinHelpers.GetBaseSkinRenderers(modelObject); List<Transform> list = baseSkinRenderers[0].bones.ToList(); Transform[] array = DynamicSkinHelpers.BoneArrayBuilder(modification.instance.transform); list.InsertRange(modification.boneIndex, array); modification.boneCount = array.Length; SkinnedMeshRenderer[] array2 = baseSkinRenderers; for (int i = 0; i < array2.Length; i++) { array2[i].bones = list.ToArray(); } modifications.BaseModelModifications.Push(modification); } private static void ModificationApplyDynamicBones(GameObject modelObject, Modification modification) { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) DynamicBone val = (modification.inst_dynamicBone = modification.instance.AddComponent<DynamicBone>()); List<DynamicBoneCollider> list = new List<DynamicBoneCollider>(); foreach (DynamicBoneColliderData collider in modification.dynamicBoneData.m_Colliders) { DynamicBoneCollider val2 = ((Component)Utils.FindChildInTree(modelObject.transform, collider.m_parent_name)).gameObject.AddComponent<DynamicBoneCollider>(); val2.m_Direction = collider.m_Direction; val2.m_Center = collider.m_Center; val2.m_Bound = collider.m_Bound; val2.m_Radius = collider.m_Radius; val2.m_Height = collider.m_Height; list.Add(val2); } modification.inst_DB_colliders = list; Transform root = (val.m_Root = Utils.FindChildInTree(modification.inst_armature.transform, modification.dynamicBoneData.m_Root)); val.m_Damping = modification.dynamicBoneData.m_Damping; val.m_DampingDistrib = modification.dynamicBoneData.m_DampingDistrib; val.m_Elasticity = modification.dynamicBoneData.m_Elasticity; val.m_ElasticityDistrib = modification.dynamicBoneData.m_ElasticityDistrib; val.m_Stiffness = modification.dynamicBoneData.m_Stiffness; val.m_StiffnessDistrib = modification.dynamicBoneData.m_StiffnessDistrib; val.m_Inert = modification.dynamicBoneData.m_Inert; val.m_InertDistrib = modification.dynamicBoneData.m_InertDistrib; val.m_Radius = modification.dynamicBoneData.m_Radius; val.m_RadiusDistrib = modification.dynamicBoneData.m_RadiusDistrib; val.m_EndLength = modification.dynamicBoneData.m_EndLength; val.m_EndOffset = modification.dynamicBoneData.m_EndOffset; val.m_Gravity = modification.dynamicBoneData.m_Gravity; val.m_Force = modification.dynamicBoneData.m_Force; val.m_Colliders = list; val.m_Exclusions = new List<Transform>(); foreach (string exclusion in modification.dynamicBoneData.m_Exclusions) { Transform val3 = Utils.FindChildInTree(root, exclusion); if ((Object)(object)val3 != (Object)null) { val.
plugins/SnowtimeToybox.dll
Decompiled 8 hours ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using EntityStates; using EntityStates.SnowtimeToybox_FireHaloWeapon; using EntityStates.SnowtimeToybox_FriendlyTurret; using Grumpy; using HG.Reflection; using Microsoft.CodeAnalysis; using On.RoR2; using R2API; using RoR2; using RoR2.Orbs; using RoR2.Skills; using RoR2BepInExPack.GameAssetPaths.Version_1_39_0; using SeekingTheVoid; using ShaderSwapper; using SnowtimeToybox; using SnowtimeToybox.Buffs; using SnowtimeToybox.Components; using SnowtimeToybox.FriendlyTurretChecks; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.SceneManagement; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: OptIn] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("SnowtimeToybox")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+1fbe03ab9c97b1f17b454cd188d9ac8a07d5c24c")] [assembly: AssemblyProduct("SnowtimeToybox")] [assembly: AssemblyTitle("SnowtimeToybox")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [module: UnverifiableCode] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace EntityStates.SnowtimeToybox_FireHaloWeapon { public class FirePlasmaRifle : GenericBulletBaseState { public string muzzleName = "NanoPistolOrigin"; public static GameObject MuzzleFlashObject = SnowtimeToyboxMod._stcharacterAssetBundle.LoadAsset<GameObject>("Assets/SnowtimeMod/Assets/Characters/DroneTech/PlasmaRifle/PlasmaRifleMuzzleFlashVFX.prefab"); public static GameObject TracerObject = SnowtimeToyboxMod._stcharacterAssetBundle.LoadAsset<GameObject>("Assets/SnowtimeMod/Assets/Characters/DroneTech/PlasmaRifle/TracerPlasmaRifle.prefab"); public static GameObject HitObject = SnowtimeToyboxMod._stcharacterAssetBundle.LoadAsset<GameObject>("Assets/SnowtimeMod/Assets/Characters/DroneTech/PlasmaRifle/PlasmaRifleImpactVFX.prefab"); public GameObject muzzleFlashPrefab = MuzzleFlashObject; public GameObject tracerEffectPrefab = TracerObject; public GameObject hitEffectPrefab = HitObject; public string fireSoundString = "Play_Plasma_Rifle_Fire"; public float procCoefficient = 0.7f; public float damageCoefficient = 0.6f; public float bulletRadius = 1.25f; public float maxDistance = 128f; public float baseDuration = 0.04f; public float bounceDamageCoefficient = 0.4f; public float RecoilY = 0.8f; public float RecoilX = 0.2f; public float orbSpeed = 100f; public bool shouldBounce = true; public bool useSmartCollision = true; public Transform muzzleTransform; public float additionalStocks = 26f; private DroneTechController controller; private GameObject currentDrone; public override void OnEnter() { controller = ((EntityState)this).GetComponent<DroneTechController>(); ((GenericBulletBaseState)this).OnEnter(); base.duration = baseDuration / (((BaseState)this).attackSpeedStat / 4f); additionalStocks = 23f + ((BaseState)this).attackSpeedStat * 3.5f; ((EntityState)this).skillLocator.primary.maxStock = (int)additionalStocks; } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)1; } public override void PlayFireAnimation() { Animator modelAnimator = ((EntityState)this).GetModelAnimator(); string text = ((Object.op_Implicit((Object)(object)modelAnimator) && (modelAnimator.GetBool("isCarried") || modelAnimator.GetBool("inLeap"))) ? "FullBody, Override" : "Gesture, Override"); ((EntityState)this).PlayAnimation(text, "FireNanoPistol"); } public override void DoFireEffects() { Util.PlaySound(fireSoundString, ((EntityState)this).gameObject); EffectManager.SimpleMuzzleFlash(muzzleFlashPrefab, ((EntityState)this).gameObject, muzzleName, false); } public override void FireBullet(Ray aimRay) { //IL_0077: Unknown result type (might be due to invalid IL or missing references) TrajectoryAimAssist.ApplyTrajectoryAimAssist(ref aimRay, maxDistance, ((EntityState)this).gameObject, 1f); if (Object.op_Implicit((Object)(object)controller) && Object.op_Implicit((Object)(object)controller.CurrentDrone?.characterBody)) { currentDrone = ((Component)controller.CurrentDrone.characterBody).gameObject; } base.recoilAmplitudeY = RecoilY; base.recoilAmplitudeX = RecoilX; ((GenericBulletBaseState)this).FireBullet(aimRay); } public override void ModifyBullet(BulletAttack bulletAttack) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Expected O, but got Unknown //IL_0091: Unknown result type (might be due to invalid IL or missing references) ((GenericBulletBaseState)this).ModifyBullet(bulletAttack); bulletAttack.damage = damageCoefficient * ((EntityState)this).characterBody.damage; bulletAttack.damageType = new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)128), (DamageTypeExtended)0, (DamageSource)1); DamageAPI.AddModdedDamageType(bulletAttack, SnowtimeToyboxMod.HaloRicochetOnHit); bulletAttack.muzzleName = muzzleName; bulletAttack.tracerEffectPrefab = tracerEffectPrefab; bulletAttack.hitEffectPrefab = hitEffectPrefab; bulletAttack.weapon = ((EntityState)this).gameObject; bulletAttack.maxDistance = maxDistance; bulletAttack.filterCallback = new FilterCallback(IgnoreAlliesAndCurrentDrone); bulletAttack.falloffModel = (FalloffModel)1; } private bool IgnoreAlliesAndCurrentDrone(BulletAttack bullet, ref BulletHit hit) { //IL_009d: Unknown result type (might be due to invalid IL or missing references) HurtBox component = ((Component)hit.collider).GetComponent<HurtBox>(); if ((Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.healthComponent) && ((Object)(object)((Component)component.healthComponent).gameObject == (Object)(object)bullet.weapon || (Object)(object)((Component)component.healthComponent).gameObject == (Object)(object)currentDrone)) || (Object)(object)hit.entityObject == (Object)(object)((EntityState)this).gameObject || (Object)(object)hit.entityObject == (Object)(object)bullet.weapon) { return false; } if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.healthComponent)) { return FriendlyFireManager.ShouldDirectHitProceed(component.healthComponent, ((EntityState)this).teamComponent.teamIndex); } return true; } } } namespace EntityStates.SnowtimeToybox_FriendlyTurret { public class ChargeBorboLaser : BaseState { public static float baseDuration = 2.5f; public static float laserMaxWidth = 0.2f; public static GameObject effectPrefabObject = SnowtimeToyboxMod._stcharacterAssetBundle.LoadAsset<GameObject>("Assets/SnowtimeMod/Assets/Characters/FriendlyTurrets/FriendlyTurretTestIngame/Borbo/Skills/ChargeBorbo.prefab"); public static GameObject laserPrefabObject = SnowtimeToyboxMod._stcharacterAssetBundle.LoadAsset<GameObject>("Assets/SnowtimeMod/Assets/Characters/FriendlyTurrets/FriendlyTurretTestIngame/Borbo/Skills/LaserBorbo.prefab"); public static GameObject effectPrefab = effectPrefabObject; public static GameObject laserPrefab = laserPrefabObject; public static string attackSoundString = "Play_Borbo_Laser_Charge"; private float duration; private uint chargePlayID; private GameObject chargeEffect; private GameObject laserEffect; private LineRenderer laserLineComponent; private Vector3 laserDirection; private Vector3 visualEndPosition; private float flashTimer; private bool laserOn; protected EffectManagerHelper _efh_Charge; private static int ChargeLaserStateHash = Animator.StringToHash("ChargeLaser"); private static int ChargeLaserParamHash = Animator.StringToHash("ChargeLaser.playbackRate"); public override void Reset() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).Reset(); duration = 0f; chargePlayID = 0u; chargeEffect = null; laserLineComponent = null; laserDirection = Vector3.zero; visualEndPosition = Vector3.zero; flashTimer = 0f; laserOn = false; _efh_Charge = null; } public override void OnEnter() { //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); ((EntityState)this).SetAIUpdateFrequency(true); duration = baseDuration; Transform modelTransform = ((EntityState)this).GetModelTransform(); chargePlayID = Util.PlayAttackSpeedSound(attackSoundString, ((EntityState)this).gameObject, base.attackSpeedStat); if (Object.op_Implicit((Object)(object)modelTransform)) { ChildLocator component = ((Component)modelTransform).GetComponent<ChildLocator>(); if (Object.op_Implicit((Object)(object)component)) { Transform val = component.FindChild("Muzzle"); if (Object.op_Implicit((Object)(object)val)) { if (Object.op_Implicit((Object)(object)effectPrefab)) { if (!EffectManager.ShouldUsePooledEffect(effectPrefab)) { chargeEffect = Object.Instantiate<GameObject>(effectPrefab, val.position, val.rotation); } else { _efh_Charge = EffectManager.GetAndActivatePooledEffect(effectPrefab, val.position, val.rotation); chargeEffect = ((Component)_efh_Charge).gameObject; } chargeEffect.transform.parent = val; ScaleParticleSystemDuration component2 = chargeEffect.GetComponent<ScaleParticleSystemDuration>(); if (Object.op_Implicit((Object)(object)component2)) { component2.newDuration = duration; } } if (Object.op_Implicit((Object)(object)laserPrefab) && (Object)(object)laserEffect == (Object)null) { laserEffect = Object.Instantiate<GameObject>(laserPrefab, val.position, val.rotation); } if ((Object)(object)laserEffect != (Object)null) { if (!laserEffect.activeInHierarchy) { laserEffect.SetActive(true); } if ((Object)(object)laserEffect.transform.parent != (Object)(object)val) { laserEffect.transform.parent = val; } laserLineComponent = laserEffect.GetComponent<LineRenderer>(); } } } } ((EntityState)this).PlayAnimation("Gesture", ChargeLaserStateHash, ChargeLaserParamHash, duration); flashTimer = 0f; laserOn = true; } public override void OnExit() { AkSoundEngine.StopPlayingID(chargePlayID); ((EntityState)this).OnExit(); ((EntityState)this).SetAIUpdateFrequency(false); if (Object.op_Implicit((Object)(object)chargeEffect)) { if (!EffectManager.UsePools) { EntityState.Destroy((Object)(object)chargeEffect); } else if ((Object)(object)_efh_Charge != (Object)null && _efh_Charge.OwningPool != null) { if (!((PrefabComponentPool<EffectManagerHelper>)(object)_efh_Charge.OwningPool).IsObjectInPool(_efh_Charge)) { ((GenericPool<EffectManagerHelper>)(object)_efh_Charge.OwningPool).ReturnObject(_efh_Charge); } } else { _ = (Object)(object)_efh_Charge != (Object)null; EntityState.Destroy((Object)(object)chargeEffect); } } if (Object.op_Implicit((Object)(object)laserEffect) && laserEffect.activeInHierarchy) { laserEffect.SetActive(false); } } public override void Update() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).Update(); if (!Object.op_Implicit((Object)(object)laserEffect) || !Object.op_Implicit((Object)(object)laserLineComponent)) { return; } float num = 1000f; Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 position = laserEffect.transform.parent.position; Vector3 point = ((Ray)(ref aimRay)).GetPoint(num); laserDirection = point - position; RaycastHit val = default(RaycastHit); if (Physics.Raycast(aimRay, ref val, num, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask) | LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask))) { point = ((RaycastHit)(ref val)).point; } laserLineComponent.SetPosition(0, position); laserLineComponent.SetPosition(1, point); float num2; if (duration - ((EntityState)this).age > 0.5f) { num2 = ((EntityState)this).age / duration; } else { flashTimer -= Time.deltaTime; if (flashTimer <= 0f) { laserOn = !laserOn; flashTimer = 1f / 30f; } num2 = (laserOn ? 1f : 0f); } num2 *= laserMaxWidth; laserLineComponent.startWidth = num2; laserLineComponent.endWidth = num2; } public override void FixedUpdate() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { FireBorboLaser fireBorboLaser = new FireBorboLaser(); fireBorboLaser.laserDirection = laserDirection; ((EntityState)this).outer.SetNextState((EntityState)(object)fireBorboLaser); } } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)1; } } public class FireBorboLaser : BaseState { public static GameObject effectPrefabObject = SnowtimeToyboxMod._stcharacterAssetBundle.LoadAsset<GameObject>("Assets/SnowtimeMod/Assets/Characters/FriendlyTurrets/FriendlyTurretTestIngame/Borbo/Skills/MuzzleflashBorbo.prefab"); public static GameObject hitEffectPrefabObject = SnowtimeToyboxMod._stcharacterAssetBundle.LoadAsset<GameObject>("Assets/SnowtimeMod/Assets/Characters/FriendlyTurrets/FriendlyTurretTestIngame/Borbo/Skills/ExplosionBorbo.prefab"); public static GameObject tracerEffectPrefabObject = SnowtimeToyboxMod._stcharacterAssetBundle.LoadAsset<GameObject>("Assets/SnowtimeMod/Assets/Characters/FriendlyTurrets/FriendlyTurretTestIngame/Borbo/Skills/TracerBorbo.prefab"); public static GameObject effectPrefab = effectPrefabObject; public static GameObject hitEffectPrefab = hitEffectPrefabObject; public static GameObject tracerEffectPrefab = tracerEffectPrefabObject; public static Component TracerWaow; public static float damageCoefficient = 10f; public static float blastRadius = 4f; public static float force = 5000f; public static float minSpread = 0f; public static float maxSpread = 0f; public static int bulletCount = 1; public static float baseDuration = 5f; public static string attackSoundString = "Play_Borbo_Laser_Fire"; public static string attackFoleySoundString = "Play_Borbo_Laser_Overheat"; public Vector3 laserDirection; public float selfKnockbackForce = 10f; private float duration; private Ray modifiedAimRay; private static int FireLaserStateHash = Animator.StringToHash("FireLaser"); private static int FireLaserParamHash = Animator.StringToHash("FireLaser.playbackRate"); public override void OnEnter() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Expected O, but got Unknown //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Expected O, but got Unknown ((BaseState)this).OnEnter(); if (!Object.op_Implicit((Object)(object)tracerEffectPrefabObject.GetComponent<TracerComponentLinger>())) { tracerEffectPrefabObject.AddComponent<TracerComponentLinger>(); } duration = baseDuration; modifiedAimRay = ((BaseState)this).GetAimRay(); ((Ray)(ref modifiedAimRay)).direction = laserDirection; ((EntityState)this).GetModelAnimator(); ((EntityState)this).characterBody.characterMotor.ApplyForce((0f - selfKnockbackForce) * laserDirection, false, false); Transform modelTransform = ((EntityState)this).GetModelTransform(); Util.PlaySound(attackSoundString, ((EntityState)this).gameObject); Util.PlaySound(attackFoleySoundString, ((EntityState)this).gameObject); string text = "Muzzle"; ((EntityState)this).PlayAnimation("Gesture", FireLaserStateHash, FireLaserParamHash, duration); if (Object.op_Implicit((Object)(object)effectPrefab)) { EffectManager.SimpleMuzzleFlash(effectPrefab, ((EntityState)this).gameObject, text, false); } if (!((EntityState)this).isAuthority) { return; } float num = 1000f; Vector3 val = ((Ray)(ref modifiedAimRay)).origin + ((Ray)(ref modifiedAimRay)).direction * num; RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(modifiedAimRay, ref val2, num, LayerMask.op_Implicit(CommonMasks.laser))) { val = ((RaycastHit)(ref val2)).point; } BlastAttack val3 = new BlastAttack { attacker = ((EntityState)this).gameObject, inflictor = ((EntityState)this).gameObject, teamIndex = TeamComponent.GetObjectTeam(((EntityState)this).gameObject), baseDamage = base.damageStat * damageCoefficient * Math.Clamp(base.attackSpeedStat / 2f, 1f, 69420f), baseForce = force * 0.2f, position = val, radius = blastRadius, falloffModel = (FalloffModel)2, bonusForce = force * ((Ray)(ref modifiedAimRay)).direction, damageType = new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)0), (DamageTypeExtended)0, (DamageSource)1) }; DamageAPI.AddModdedDamageType(val3, SnowtimeToyboxMod.BorboSuperDebuffOnHit); val3.Fire(); _ = ((Ray)(ref modifiedAimRay)).origin; if (!Object.op_Implicit((Object)(object)modelTransform)) { return; } ChildLocator component = ((Component)modelTransform).GetComponent<ChildLocator>(); if (Object.op_Implicit((Object)(object)component)) { int num2 = component.FindChildIndex(text); if (Object.op_Implicit((Object)(object)tracerEffectPrefab)) { EffectData val4 = new EffectData { origin = val, start = ((Ray)(ref modifiedAimRay)).origin }; val4.SetChildLocatorTransformReference(((EntityState)this).gameObject, num2); EffectManager.SpawnEffect(tracerEffectPrefab, val4, true); EffectManager.SpawnEffect(hitEffectPrefab, val4, true); } } } public override void OnExit() { ((EntityState)this).OnExit(); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)1; } } public class Shenanigans : BaseSkillState { public static float hopPower = 7f; public static string playtimeSoundString = "Play_Item_FriendUnit_VO_Whistle"; public static string stopSoundString = "Play_Item_FriendUnit_VO_Happy"; public static float baseDuration = 2f; public static float timeBetweenHops = 0.2f; private float hopTimer; private uint soundID; public override void OnEnter() { ((BaseState)this).OnEnter(); hopTimer = 0f; soundID = Util.PlaySound(playtimeSoundString, ((Component)((EntityState)this).outer).gameObject); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (hopTimer > 0f) { hopTimer -= Time.deltaTime; } if (((EntityState)this).characterMotor.isGrounded && hopTimer <= 0f) { ((BaseState)this).SmallHop(((EntityState)this).characterMotor, hopPower); hopTimer += timeBetweenHops; } if (((EntityState)this).isAuthority && !((BaseSkillState)this).IsKeyDownAuthority()) { AkSoundEngine.StopPlayingID(soundID); Util.PlaySound(stopSoundString, ((Component)((EntityState)this).outer).gameObject); ((EntityState)this).outer.SetNextStateToMain(); } } } public class ShortcakeTaunt : BaseState { public static GameObject effectPrefab; public static GameObject hitEffectPrefab; public static GameObject tracerEffectPrefab; public static float damageCoefficient = 1f; public static float radius = 45f; public static float baseDuration = 2f; private float duration; private int max = 999; public override void OnEnter() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); duration = baseDuration / base.attackSpeedStat; TeamIndex teamIndex = ((EntityState)this).gameObject.GetComponent<TeamComponent>().teamIndex; HurtBox[] hurtBoxes = new SphereSearch { origin = ((EntityState)this).characterBody.corePosition, radius = radius, mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask, queryTriggerInteraction = (QueryTriggerInteraction)0 }.RefreshCandidates().FilterCandidatesByHurtBoxTeam(TeamMask.GetEnemyTeams(teamIndex)).OrderCandidatesByDistance() .FilterCandidatesByDistinctHurtBoxEntities() .GetHurtBoxes(); if (((EntityState)this).isAuthority) { for (int i = 0; i < Mathf.Min(max, hurtBoxes.Length); i++) { SnowtimeOrbs snowtimeOrbs = new SnowtimeOrbs(); snowtimeOrbs.attacker = ((EntityState)this).gameObject; snowtimeOrbs.speed = 300f; snowtimeOrbs.damageColorIndex = (DamageColorIndex)0; snowtimeOrbs.damageValue = ((EntityState)this).characterBody.damage * damageCoefficient; snowtimeOrbs.isCrit = Util.CheckRoll(base.critStat, ((EntityState)this).characterBody.master); snowtimeOrbs.snowtimeOrbType = SnowtimeOrbs.OrbTypes.ShortcakeTaunt; ((Orb)snowtimeOrbs).origin = ((EntityState)this).characterBody.corePosition; snowtimeOrbs.procCoefficient = 0f; snowtimeOrbs.range = 0f; snowtimeOrbs.teamIndex = teamIndex; ((Orb)snowtimeOrbs).target = hurtBoxes[i]; OrbManager.instance.AddOrb((Orb)(object)snowtimeOrbs); } } } public override void OnExit() { ((EntityState)this).OnExit(); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)1; } } } namespace SnowtimeToybox { public class SnowtimeHaloRicochetOrb : GenericDamageOrb { public class RicochetOrb : GenericDamageOrb { public GameObject effectPrefab; public override GameObject GetOrbEffect() { return effectPrefab; } } public static GameObject orbEffectObject = SnowtimeToyboxMod._stcharacterAssetBundle.LoadAsset<GameObject>("Assets/SnowtimeMod/Assets/Characters/DroneTech/PlasmaRifle/PlasmaRifleOrbEffect.prefab"); public GameObject orbEffectPrefab = orbEffectObject; public override void Begin() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Expected O, but got Unknown base.speed = 220f; ((Orb)this).duration = Mathf.Max(((Orb)this).distanceToTarget / base.speed, 0.167f); EffectData val = new EffectData { scale = base.scale, origin = ((Orb)this).origin, genericFloat = ((Orb)this).duration }; if (Object.op_Implicit((Object)(object)((Orb)this).target)) { val.SetHurtBoxReference(((Orb)this).target); } } public override void OnArrival() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)((Orb)this).target) && Object.op_Implicit((Object)(object)((Orb)this).target.healthComponent) && ((Orb)this).target.healthComponent.alive) { DamageInfo val = new DamageInfo(); val.damage = base.damageValue; val.attacker = base.attacker; val.inflictor = null; val.force = Vector3.zero; val.crit = base.isCrit; val.procChainMask = base.procChainMask; val.procCoefficient = base.procCoefficient; val.position = ((Component)((Orb)this).target).transform.position; val.damageColorIndex = base.damageColorIndex; val.damageType = base.damageType; val.inflictedHurtbox = ((Orb)this).target; ((Orb)this).target.healthComponent.TakeDamage(val); GlobalEventManager.instance.OnHitEnemy(val, ((Component)((Orb)this).target.healthComponent).gameObject); GlobalEventManager.instance.OnHitAll(val, ((Component)((Orb)this).target.healthComponent).gameObject); } } public static void CreateHaloRicochetOrb(DamageInfo damageInfo, TeamIndex attackerTeamIndex, CharacterBody victim, List<BodyIndex> killedBodies = null) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) HurtBox val = null; BullseyeSearch val2 = new BullseyeSearch(); val2.searchOrigin = damageInfo.position; val2.searchDirection = Vector3.zero; val2.teamMaskFilter = TeamMask.GetEnemyTeams(attackerTeamIndex); val2.filterByLoS = false; val2.sortMode = (SortMode)0; val2.maxAngleFilter = 180f; val2.maxDistanceFilter = 27f; val2.filterByDistinctEntity = true; val2.RefreshCandidates(); if (Object.op_Implicit((Object)(object)victim)) { val2.FilterOutGameObject(((Component)victim).gameObject); } IEnumerable<HurtBox> results = val2.GetResults(); float num = float.PositiveInfinity; foreach (HurtBox item in results) { if (Object.op_Implicit((Object)(object)item.healthComponent) && (double)item.healthComponent.combinedHealth < (double)num && item.healthComponent.alive) { num = item.healthComponent.combinedHealth; val = item; } } if (Object.op_Implicit((Object)(object)val)) { RicochetOrb ricochetOrb = new RicochetOrb(); ((Orb)ricochetOrb).origin = damageInfo.position; ricochetOrb.effectPrefab = orbEffectObject; ((GenericDamageOrb)ricochetOrb).damageValue = damageInfo.damage * 0.75f; ((GenericDamageOrb)ricochetOrb).isCrit = damageInfo.crit; ((GenericDamageOrb)ricochetOrb).teamIndex = attackerTeamIndex; ((GenericDamageOrb)ricochetOrb).attacker = damageInfo.attacker; ((GenericDamageOrb)ricochetOrb).procChainMask = damageInfo.procChainMask; ((GenericDamageOrb)ricochetOrb).procCoefficient = 0.3f; ((GenericDamageOrb)ricochetOrb).damageType = DamageTypeCombo.op_Implicit((DamageType)0); ((GenericDamageOrb)ricochetOrb).damageType.damageSource = (DamageSource)1; ((GenericDamageOrb)ricochetOrb).damageColorIndex = (DamageColorIndex)0; ((Orb)ricochetOrb).target = val; OrbManager.instance.AddOrb((Orb)(object)ricochetOrb); } } } public class SnowtimeOrbs : Orb { public enum OrbTypes { ShortcakeTaunt, ShortcakeRetaliate, ShortcakeRetaliateFriendly } public float speed = 200f; public float damageValue; public GameObject attacker; public GameObject inflictor; public TeamIndex teamIndex; public bool isCrit; public ProcChainMask procChainMask; public float procCoefficient = 1f; public DamageColorIndex damageColorIndex; public float range = 20f; public DamageTypeCombo damageType = DamageTypeCombo.op_Implicit((DamageType)0); public OrbTypes snowtimeOrbType; private bool isElectric; private bool isHealing; public static GameObject orbShortcakeRetaliateObject = SnowtimeToyboxMod._stcharacterAssetBundle.LoadAsset<GameObject>("Assets/SnowtimeMod/Assets/Characters/FriendlyTurrets/FriendlyTurretTestIngame/Shortcake/Skills/shortcakeretaliate_orbeffect.prefab"); public static GameObject orbShortcakeRetaliateImpactObject = SnowtimeToyboxMod._stcharacterAssetBundle.LoadAsset<GameObject>("Assets/SnowtimeMod/Assets/Characters/FriendlyTurrets/FriendlyTurretTestIngame/Shortcake/Skills/shortcakeretaliate_impacteffect.prefab"); public static GameObject orbShortcakeRetaliateFriendlyObject = SnowtimeToyboxMod._stcharacterAssetBundle.LoadAsset<GameObject>("Assets/SnowtimeMod/Assets/Characters/FriendlyTurrets/FriendlyTurretTestIngame/Shortcake/Skills/shortcakeretaliatefriendly_orbeffect.prefab"); public static GameObject orbShortcakeRetaliateFriendlyImpactObject = SnowtimeToyboxMod._stcharacterAssetBundle.LoadAsset<GameObject>("Assets/SnowtimeMod/Assets/Characters/FriendlyTurrets/FriendlyTurretTestIngame/Shortcake/Skills/shortcakeretaliatefriendly_impacteffect.prefab"); public GameObject orbShortcakeRetaliatePrefab = orbShortcakeRetaliateObject; public GameObject orbShortcakeRetaliateFriendlyPrefab = orbShortcakeRetaliateFriendlyObject; public static GameObject orbShortcakeTauntObject = SnowtimeToyboxMod._stcharacterAssetBundle.LoadAsset<GameObject>("Assets/SnowtimeMod/Assets/Characters/FriendlyTurrets/FriendlyTurretTestIngame/Shortcake/Skills/shortcaketaunt_orbeffect.prefab"); public static GameObject orbShortcakeTauntImpactObject = SnowtimeToyboxMod._stcharacterAssetBundle.LoadAsset<GameObject>("Assets/SnowtimeMod/Assets/Characters/FriendlyTurrets/FriendlyTurretTestIngame/Shortcake/Skills/shortcaketaunt_impacteffect.prefab"); public GameObject orbShortcakeTauntPrefab = orbShortcakeTauntObject; public override void Begin() { //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Expected O, but got Unknown ((Orb)this).duration = Mathf.Max(((Orb)this).distanceToTarget / speed, 0.1f); GameObject val = null; switch (snowtimeOrbType) { case OrbTypes.ShortcakeTaunt: val = orbShortcakeTauntPrefab; isHealing = false; isElectric = false; break; case OrbTypes.ShortcakeRetaliate: val = orbShortcakeRetaliatePrefab; isHealing = false; isElectric = false; break; case OrbTypes.ShortcakeRetaliateFriendly: val = orbShortcakeRetaliatePrefab; isHealing = false; isElectric = false; break; } EffectData val2 = new EffectData { origin = base.origin, genericFloat = ((Orb)this).duration * 2f }; val2.SetHurtBoxReference(base.target); EffectManager.SpawnEffect(val, val2, true); } public override void OnArrival() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)base.target)) { return; } HealthComponent healthComponent = base.target.healthComponent; if (Object.op_Implicit((Object)(object)healthComponent)) { DamageInfo val = new DamageInfo(); if (!isHealing) { val.damage = damageValue; } else { healthComponent.Heal(damageValue, procChainMask, true); } val.attacker = attacker; val.inflictor = inflictor; val.force = Vector3.zero; val.crit = isCrit; val.procChainMask = procChainMask; val.procCoefficient = procCoefficient; val.position = ((Component)base.target).transform.position; val.damageColorIndex = damageColorIndex; val.damageType = damageType; if (isElectric) { val.damageType.damageTypeExtended = (DamageTypeExtended)8192; } val.inflictedHurtbox = base.target; healthComponent.TakeDamage(val); GlobalEventManager.instance.OnHitEnemy(val, ((Component)healthComponent).gameObject); GlobalEventManager.instance.OnHitAll(val, ((Component)healthComponent).gameObject); } } } internal static class Log { private static ManualLogSource _logSource; internal static void Init(ManualLogSource logSource) { _logSource = logSource; } internal static void Debug(object data) { _logSource.LogDebug(data); } internal static void Error(object data) { _logSource.LogError(data); } internal static void Fatal(object data) { _logSource.LogFatal(data); } internal static void Info(object data) { _logSource.LogInfo(data); } internal static void Message(object data) { _logSource.LogMessage(data); } internal static void Warning(object data) { _logSource.LogWarning(data); } } [BepInPlugin("SnowySnowtime.SnowtimeToyboxMod", "SnowtimeToyboxMod", "1.1.1")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class SnowtimeToyboxMod : BaseUnityPlugin { public const string Author = "SnowySnowtime"; public const string Name = "SnowtimeToyboxMod"; public const string Version = "1.1.1"; public const string GUID = "SnowySnowtime.SnowtimeToyboxMod"; public static SnowtimeToyboxMod instance; public static DifficultyDef SnowtimeLegendaryDiffDef; public static DifficultyIndex SnowtimeLegendaryDiffIndex; public static SkillDef SnowtimePlasmaRifleSkillDef; public static GameObject MuzzleFlashObject; public static GameObject TracerObject; public static GameObject HitObject; public static GameObject OrbObject; public static GameObject FriendlyTurretUseEffect; public static SkillFamily FriendlyTurretBorboUtilSkillFamily; public static SkillDef FriendlyTurretBorboUtilSkillDef; public static SkillFamily FriendlyTurretShortcakeUtilSkillFamily; public static SkillDef FriendlyTurretShortcakeUtilSkillDef; public static DroneDef FriendlyTurretBorboDef; public static InteractableSpawnCard FriendlyTurretBorboIsc; public static SkillFamily FriendlyTurretBorboSkillFamily; public static SkillDef FriendlyTurretBorboSkillDef; public static GameObject FriendlyTurretBorboBody; public static GameObject FriendlyTurretBorboMaster; public static GameObject FriendlyTurretBorboBroken; public static DroneDef FriendlyTurretShortcakeDef; public static InteractableSpawnCard FriendlyTurretShortcakeIsc; public static SkillFamily FriendlyTurretShortcakeSkillFamily; public static SkillDef FriendlyTurretShortcakeSkillDef; public static GameObject FriendlyTurretShortcakeBody; public static GameObject FriendlyTurretShortcakeMaster; public static GameObject FriendlyTurretShortcakeBroken; public static List<GameObject> friendlyTurretList = new List<GameObject>(); public static string[] friendlyTurretListNames; public static bool Legendary = false; public static ModdedDamageType HaloRicochetOnHit = DamageAPI.ReserveDamageType(); public static ModdedDamageType BorboSuperDebuffOnHit = DamageAPI.ReserveDamageType(); public static string assetDirectory; public static AssetBundle _stdifficultyAssetBundle; public static AssetBundle _stcharacterAssetBundle; internal const string _stdifficultyAssetBundleName = "snowtimetoybox_difficulty"; internal const string _stcharacterAssetBundleName = "snowtimetoybox_characters"; public static List<EquipmentIndex> eliteDefsEquipInherit = new List<EquipmentIndex>(); private string interactablesuffering = " (UnityEngine.GameObject)"; private string charactersuffering = "(Clone) (UnityEngine.GameObject)"; private string interactablesmaster; private string charactersmaster; public static BuffDef BorboTurretDebuff; public static BuffDef ShortcakeTurretBuff; public static ConfigEntry<bool> ToggleSpawnMessages { get; set; } public static bool riskierLoaded => ModLoaded("com.RiskOfBrainrot.RiskierRain"); public static bool acanthivoidLoaded => ModLoaded("acanthi.SeekingTheVoid"); public static bool ModLoaded(string modGuid) { if (!string.IsNullOrEmpty(modGuid)) { return Chainloader.PluginInfos.ContainsKey(modGuid); } return false; } public void Awake() { //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Expected O, but got Unknown //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Expected O, but got Unknown //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Expected O, but got Unknown //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown instance = this; Log.Init(((BaseUnityPlugin)this).Logger); ToggleSpawnMessages = ((BaseUnityPlugin)this).Config.Bind<bool>("Friendly Turret Functions", "Spawn Message", true, "If true, the Friendly Turrets will give a message on every stage they spawn on, for insight on if and which turret spawned. Otherwise, friendly turrets are shy, and are also sad!"); Language.collectLanguageRootFolders += CollectLanguageRootFolders; Run.onRunStartGlobal += delegate(Run run) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) Legendary = false; if (run.selectedDifficulty == SnowtimeLegendaryDiffIndex) { Legendary = true; CharacterMaster.onStartGlobal += CharacterMaster_OnStartGlobal; } }; Run.onRunDestroyGlobal += delegate { Legendary = false; CharacterMaster.onStartGlobal -= CharacterMaster_OnStartGlobal; }; GlobalEventManager.OnHitEnemy += new hook_OnHitEnemy(JustLetMeDamageMyFoesPleaseThankYou); SceneDirector.Start += new hook_Start(SceneDirectorOnStart); CharacterBody.FixedUpdate += new hook_FixedUpdate(ShortcakeTurretHandler); CharacterMaster.Start += new hook_Start(AddInheritanceToFriendlyTurrets); } private void AddInheritanceToFriendlyTurrets(orig_Start orig, CharacterMaster self) { orig.Invoke(self); if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.GetBody()) && self.GetBody().baseNameToken.Contains("FRIENDLYTURRET")) { if (!Object.op_Implicit((Object)(object)self.bodyPrefab.GetComponent<EquipmentSlot>())) { self.bodyPrefab.AddComponent<EquipmentSlot>(); Log.Debug("Added EquipmentSlot to: " + self.GetBody().baseNameToken); } if (!Object.op_Implicit((Object)(object)((Component)self).gameObject.GetComponent<FriendlyTurretInheritance>())) { ((Component)self).gameObject.AddComponent<FriendlyTurretInheritance>(); ((Component)self).gameObject.GetComponent<FriendlyTurretInheritance>().turretType = self.GetBody().baseNameToken; Log.Debug("Added FriendlyTurretInheritance to: " + self.GetBody().baseNameToken); } } } private void JustLetMeDamageMyFoesPleaseThankYou(orig_OnHitEnemy orig, GlobalEventManager self, DamageInfo damageInfo, GameObject victim) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, damageInfo, victim); if (DamageAPI.HasModdedDamageType(damageInfo, HaloRicochetOnHit)) { SnowtimeHaloRicochetOrb.CreateHaloRicochetOrb(damageInfo, damageInfo.attacker.GetComponent<TeamComponent>().teamIndex, victim.GetComponent<CharacterBody>()); } if (DamageAPI.HasModdedDamageType(damageInfo, BorboSuperDebuffOnHit)) { victim.GetComponent<CharacterBody>().AddTimedBuff(BorboTurretDebuff, 3f); } } private void ShortcakeTurretHandler(orig_FixedUpdate orig, CharacterBody self) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Invalid comparison between Unknown and I4 if ((int)self.teamComponent.teamIndex == 1 && self.baseNameToken.Contains("FRIENDLYTURRET_SHORTCAKE") && !self.HasBuff(ShortcakeTurretBuff)) { self.AddBuff(ShortcakeTurretBuff); } orig.Invoke(self); } private void SceneDirectorOnStart(orig_Start orig, SceneDirector self) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0adf: Unknown result type (might be due to invalid IL or missing references) //IL_0af3: Unknown result type (might be due to invalid IL or missing references) //IL_0b0d: Unknown result type (might be due to invalid IL or missing references) //IL_0b21: Unknown result type (might be due to invalid IL or missing references) //IL_0838: Unknown result type (might be due to invalid IL or missing references) //IL_084c: Unknown result type (might be due to invalid IL or missing references) //IL_0866: Unknown result type (might be due to invalid IL or missing references) //IL_087a: Unknown result type (might be due to invalid IL or missing references) //IL_114b: Unknown result type (might be due to invalid IL or missing references) //IL_115f: Unknown result type (might be due to invalid IL or missing references) //IL_1179: Unknown result type (might be due to invalid IL or missing references) //IL_118d: Unknown result type (might be due to invalid IL or missing references) //IL_1089: Unknown result type (might be due to invalid IL or missing references) //IL_109d: Unknown result type (might be due to invalid IL or missing references) //IL_10b7: Unknown result type (might be due to invalid IL or missing references) //IL_10cb: Unknown result type (might be due to invalid IL or missing references) //IL_0f6b: Unknown result type (might be due to invalid IL or missing references) //IL_0f7f: Unknown result type (might be due to invalid IL or missing references) //IL_0f99: Unknown result type (might be due to invalid IL or missing references) //IL_0fad: Unknown result type (might be due to invalid IL or missing references) //IL_1b2b: Unknown result type (might be due to invalid IL or missing references) //IL_1b3f: Unknown result type (might be due to invalid IL or missing references) //IL_1b59: Unknown result type (might be due to invalid IL or missing references) //IL_1b6d: Unknown result type (might be due to invalid IL or missing references) //IL_1b87: Unknown result type (might be due to invalid IL or missing references) //IL_1b9b: Unknown result type (might be due to invalid IL or missing references) //IL_1bb5: Unknown result type (might be due to invalid IL or missing references) //IL_1bc9: Unknown result type (might be due to invalid IL or missing references) //IL_12cf: Unknown result type (might be due to invalid IL or missing references) //IL_12e3: Unknown result type (might be due to invalid IL or missing references) //IL_12fd: Unknown result type (might be due to invalid IL or missing references) //IL_1311: Unknown result type (might be due to invalid IL or missing references) //IL_1a0d: Unknown result type (might be due to invalid IL or missing references) //IL_1a21: Unknown result type (might be due to invalid IL or missing references) //IL_1a3b: Unknown result type (might be due to invalid IL or missing references) //IL_1a4f: Unknown result type (might be due to invalid IL or missing references) //IL_1a69: Unknown result type (might be due to invalid IL or missing references) //IL_1a7d: Unknown result type (might be due to invalid IL or missing references) //IL_09bc: Unknown result type (might be due to invalid IL or missing references) //IL_09d0: Unknown result type (might be due to invalid IL or missing references) //IL_09ea: Unknown result type (might be due to invalid IL or missing references) //IL_09fe: Unknown result type (might be due to invalid IL or missing references) //IL_0776: Unknown result type (might be due to invalid IL or missing references) //IL_078a: Unknown result type (might be due to invalid IL or missing references) //IL_07a4: Unknown result type (might be due to invalid IL or missing references) //IL_07b8: Unknown result type (might be due to invalid IL or missing references) //IL_0899: Unknown result type (might be due to invalid IL or missing references) //IL_08ad: Unknown result type (might be due to invalid IL or missing references) //IL_08c7: Unknown result type (might be due to invalid IL or missing references) //IL_08db: Unknown result type (might be due to invalid IL or missing references) //IL_0a1d: Unknown result type (might be due to invalid IL or missing references) //IL_0a31: Unknown result type (might be due to invalid IL or missing references) //IL_0a4b: Unknown result type (might be due to invalid IL or missing references) //IL_0a5f: Unknown result type (might be due to invalid IL or missing references) //IL_0715: Unknown result type (might be due to invalid IL or missing references) //IL_0729: Unknown result type (might be due to invalid IL or missing references) //IL_0743: Unknown result type (might be due to invalid IL or missing references) //IL_0757: Unknown result type (might be due to invalid IL or missing references) //IL_10ea: Unknown result type (might be due to invalid IL or missing references) //IL_10fe: Unknown result type (might be due to invalid IL or missing references) //IL_1118: Unknown result type (might be due to invalid IL or missing references) //IL_112c: Unknown result type (might be due to invalid IL or missing references) //IL_0ea9: Unknown result type (might be due to invalid IL or missing references) //IL_0ebd: Unknown result type (might be due to invalid IL or missing references) //IL_0ed7: Unknown result type (might be due to invalid IL or missing references) //IL_0eeb: Unknown result type (might be due to invalid IL or missing references) //IL_0c02: Unknown result type (might be due to invalid IL or missing references) //IL_0c16: Unknown result type (might be due to invalid IL or missing references) //IL_0c30: Unknown result type (might be due to invalid IL or missing references) //IL_0c44: Unknown result type (might be due to invalid IL or missing references) //IL_0e48: Unknown result type (might be due to invalid IL or missing references) //IL_0e5c: Unknown result type (might be due to invalid IL or missing references) //IL_0e76: Unknown result type (might be due to invalid IL or missing references) //IL_0e8a: Unknown result type (might be due to invalid IL or missing references) //IL_126e: Unknown result type (might be due to invalid IL or missing references) //IL_1282: Unknown result type (might be due to invalid IL or missing references) //IL_129c: Unknown result type (might be due to invalid IL or missing references) //IL_12b0: Unknown result type (might be due to invalid IL or missing references) //IL_13f2: Unknown result type (might be due to invalid IL or missing references) //IL_1406: Unknown result type (might be due to invalid IL or missing references) //IL_1420: Unknown result type (might be due to invalid IL or missing references) //IL_1434: Unknown result type (might be due to invalid IL or missing references) //IL_1330: Unknown result type (might be due to invalid IL or missing references) //IL_1344: Unknown result type (might be due to invalid IL or missing references) //IL_135e: Unknown result type (might be due to invalid IL or missing references) //IL_1372: Unknown result type (might be due to invalid IL or missing references) //IL_1391: Unknown result type (might be due to invalid IL or missing references) //IL_13a5: Unknown result type (might be due to invalid IL or missing references) //IL_13bf: Unknown result type (might be due to invalid IL or missing references) //IL_13d3: Unknown result type (might be due to invalid IL or missing references) //IL_14e2: Unknown result type (might be due to invalid IL or missing references) //IL_14f6: Unknown result type (might be due to invalid IL or missing references) //IL_1510: Unknown result type (might be due to invalid IL or missing references) //IL_1524: Unknown result type (might be due to invalid IL or missing references) //IL_153e: Unknown result type (might be due to invalid IL or missing references) //IL_1552: Unknown result type (might be due to invalid IL or missing references) //IL_156c: Unknown result type (might be due to invalid IL or missing references) //IL_1580: Unknown result type (might be due to invalid IL or missing references) //IL_159f: Unknown result type (might be due to invalid IL or missing references) //IL_15b3: Unknown result type (might be due to invalid IL or missing references) //IL_16f0: Unknown result type (might be due to invalid IL or missing references) //IL_1704: Unknown result type (might be due to invalid IL or missing references) //IL_171e: Unknown result type (might be due to invalid IL or missing references) //IL_1732: Unknown result type (might be due to invalid IL or missing references) //IL_174c: Unknown result type (might be due to invalid IL or missing references) //IL_1760: Unknown result type (might be due to invalid IL or missing references) //IL_177a: Unknown result type (might be due to invalid IL or missing references) //IL_178e: Unknown result type (might be due to invalid IL or missing references) //IL_17a8: Unknown result type (might be due to invalid IL or missing references) //IL_17bc: Unknown result type (might be due to invalid IL or missing references) //IL_17d6: Unknown result type (might be due to invalid IL or missing references) //IL_17ea: Unknown result type (might be due to invalid IL or missing references) //IL_1804: Unknown result type (might be due to invalid IL or missing references) //IL_1818: Unknown result type (might be due to invalid IL or missing references) //IL_1832: Unknown result type (might be due to invalid IL or missing references) //IL_1846: Unknown result type (might be due to invalid IL or missing references) //IL_1860: Unknown result type (might be due to invalid IL or missing references) //IL_1874: Unknown result type (might be due to invalid IL or missing references) //IL_188e: Unknown result type (might be due to invalid IL or missing references) //IL_18a2: Unknown result type (might be due to invalid IL or missing references) //IL_18bc: Unknown result type (might be due to invalid IL or missing references) //IL_18d0: Unknown result type (might be due to invalid IL or missing references) //IL_18ea: Unknown result type (might be due to invalid IL or missing references) //IL_18fe: Unknown result type (might be due to invalid IL or missing references) //IL_1453: Unknown result type (might be due to invalid IL or missing references) //IL_1467: Unknown result type (might be due to invalid IL or missing references) //IL_1481: Unknown result type (might be due to invalid IL or missing references) //IL_1495: Unknown result type (might be due to invalid IL or missing references) //IL_14af: Unknown result type (might be due to invalid IL or missing references) //IL_14c3: Unknown result type (might be due to invalid IL or missing references) //IL_0d86: Unknown result type (might be due to invalid IL or missing references) //IL_0d9a: Unknown result type (might be due to invalid IL or missing references) //IL_0db4: Unknown result type (might be due to invalid IL or missing references) //IL_0dc8: Unknown result type (might be due to invalid IL or missing references) //IL_0f0a: Unknown result type (might be due to invalid IL or missing references) //IL_0f1e: Unknown result type (might be due to invalid IL or missing references) //IL_0f38: Unknown result type (might be due to invalid IL or missing references) //IL_0f4c: Unknown result type (might be due to invalid IL or missing references) //IL_0de7: Unknown result type (might be due to invalid IL or missing references) //IL_0dfb: Unknown result type (might be due to invalid IL or missing references) //IL_0e15: Unknown result type (might be due to invalid IL or missing references) //IL_0e29: Unknown result type (might be due to invalid IL or missing references) //IL_0a7e: Unknown result type (might be due to invalid IL or missing references) //IL_0a92: Unknown result type (might be due to invalid IL or missing references) //IL_0aac: Unknown result type (might be due to invalid IL or missing references) //IL_0ac0: Unknown result type (might be due to invalid IL or missing references) //IL_0cc4: Unknown result type (might be due to invalid IL or missing references) //IL_0cd8: Unknown result type (might be due to invalid IL or missing references) //IL_0cf2: Unknown result type (might be due to invalid IL or missing references) //IL_0d06: Unknown result type (might be due to invalid IL or missing references) //IL_15d2: Unknown result type (might be due to invalid IL or missing references) //IL_15e6: Unknown result type (might be due to invalid IL or missing references) //IL_1600: Unknown result type (might be due to invalid IL or missing references) //IL_1614: Unknown result type (might be due to invalid IL or missing references) //IL_0fcc: Unknown result type (might be due to invalid IL or missing references) //IL_0fe0: Unknown result type (might be due to invalid IL or missing references) //IL_0ffa: Unknown result type (might be due to invalid IL or missing references) //IL_100e: Unknown result type (might be due to invalid IL or missing references) //IL_1028: Unknown result type (might be due to invalid IL or missing references) //IL_103c: Unknown result type (might be due to invalid IL or missing references) //IL_1056: Unknown result type (might be due to invalid IL or missing references) //IL_106a: Unknown result type (might be due to invalid IL or missing references) //IL_0d25: Unknown result type (might be due to invalid IL or missing references) //IL_0d39: Unknown result type (might be due to invalid IL or missing references) //IL_0d53: Unknown result type (might be due to invalid IL or missing references) //IL_0d67: Unknown result type (might be due to invalid IL or missing references) //IL_0b40: Unknown result type (might be due to invalid IL or missing references) //IL_0b54: Unknown result type (might be due to invalid IL or missing references) //IL_0b6e: Unknown result type (might be due to invalid IL or missing references) //IL_0b82: Unknown result type (might be due to invalid IL or missing references) //IL_1be8: Unknown result type (might be due to invalid IL or missing references) //IL_1bfc: Unknown result type (might be due to invalid IL or missing references) //IL_1c16: Unknown result type (might be due to invalid IL or missing references) //IL_1c2a: Unknown result type (might be due to invalid IL or missing references) //IL_1c44: Unknown result type (might be due to invalid IL or missing references) //IL_1c58: Unknown result type (might be due to invalid IL or missing references) //IL_191d: Unknown result type (might be due to invalid IL or missing references) //IL_1931: Unknown result type (might be due to invalid IL or missing references) //IL_194b: Unknown result type (might be due to invalid IL or missing references) //IL_195f: Unknown result type (might be due to invalid IL or missing references) //IL_1c77: Unknown result type (might be due to invalid IL or missing references) //IL_1c8b: Unknown result type (might be due to invalid IL or missing references) //IL_1ca5: Unknown result type (might be due to invalid IL or missing references) //IL_1cb9: Unknown result type (might be due to invalid IL or missing references) //IL_1cd3: Unknown result type (might be due to invalid IL or missing references) //IL_1ce7: Unknown result type (might be due to invalid IL or missing references) //IL_1d01: Unknown result type (might be due to invalid IL or missing references) //IL_1d15: Unknown result type (might be due to invalid IL or missing references) //IL_1a9c: Unknown result type (might be due to invalid IL or missing references) //IL_1ab0: Unknown result type (might be due to invalid IL or missing references) //IL_1aca: Unknown result type (might be due to invalid IL or missing references) //IL_1ade: Unknown result type (might be due to invalid IL or missing references) //IL_1af8: Unknown result type (might be due to invalid IL or missing references) //IL_1b0c: Unknown result type (might be due to invalid IL or missing references) //IL_197e: Unknown result type (might be due to invalid IL or missing references) //IL_1992: Unknown result type (might be due to invalid IL or missing references) //IL_19ac: Unknown result type (might be due to invalid IL or missing references) //IL_19c0: Unknown result type (might be due to invalid IL or missing references) //IL_19da: Unknown result type (might be due to invalid IL or missing references) //IL_19ee: Unknown result type (might be due to invalid IL or missing references) //IL_095b: Unknown result type (might be due to invalid IL or missing references) //IL_096f: Unknown result type (might be due to invalid IL or missing references) //IL_0989: Unknown result type (might be due to invalid IL or missing references) //IL_099d: Unknown result type (might be due to invalid IL or missing references) //IL_0ba1: Unknown result type (might be due to invalid IL or missing references) //IL_0bb5: Unknown result type (might be due to invalid IL or missing references) //IL_0bcf: Unknown result type (might be due to invalid IL or missing references) //IL_0be3: Unknown result type (might be due to invalid IL or missing references) //IL_0c63: Unknown result type (might be due to invalid IL or missing references) //IL_0c77: Unknown result type (might be due to invalid IL or missing references) //IL_0c91: Unknown result type (might be due to invalid IL or missing references) //IL_0ca5: Unknown result type (might be due to invalid IL or missing references) //IL_07d7: Unknown result type (might be due to invalid IL or missing references) //IL_07eb: Unknown result type (might be due to invalid IL or missing references) //IL_0805: Unknown result type (might be due to invalid IL or missing references) //IL_0819: Unknown result type (might be due to invalid IL or missing references) //IL_1633: Unknown result type (might be due to invalid IL or missing references) //IL_1647: Unknown result type (might be due to invalid IL or missing references) //IL_1661: Unknown result type (might be due to invalid IL or missing references) //IL_1675: Unknown result type (might be due to invalid IL or missing references) //IL_168f: Unknown result type (might be due to invalid IL or missing references) //IL_16a3: Unknown result type (might be due to invalid IL or missing references) //IL_16bd: Unknown result type (might be due to invalid IL or missing references) //IL_16d1: Unknown result type (might be due to invalid IL or missing references) //IL_120d: Unknown result type (might be due to invalid IL or missing references) //IL_1221: Unknown result type (might be due to invalid IL or missing references) //IL_123b: Unknown result type (might be due to invalid IL or missing references) //IL_124f: Unknown result type (might be due to invalid IL or missing references) //IL_11ac: Unknown result type (might be due to invalid IL or missing references) //IL_11c0: Unknown result type (might be due to invalid IL or missing references) //IL_11da: Unknown result type (might be due to invalid IL or missing references) //IL_11ee: Unknown result type (might be due to invalid IL or missing references) //IL_08fa: Unknown result type (might be due to invalid IL or missing references) //IL_090e: Unknown result type (might be due to invalid IL or missing references) //IL_0928: Unknown result type (might be due to invalid IL or missing references) //IL_093c: Unknown result type (might be due to invalid IL or missing references) //IL_06b4: Unknown result type (might be due to invalid IL or missing references) //IL_06c8: Unknown result type (might be due to invalid IL or missing references) //IL_06e2: Unknown result type (might be due to invalid IL or missing references) //IL_06f6: Unknown result type (might be due to invalid IL or missing references) //IL_1e5f: Unknown result type (might be due to invalid IL or missing references) //IL_1e66: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (!NetworkServer.active) { return; } Dictionary<Vector3, Quaternion> dictionary = new Dictionary<Vector3, Quaternion>(); Scene activeScene = SceneManager.GetActiveScene(); switch (((Scene)(ref activeScene)).name) { case "golemplains": dictionary.Add(new Vector3(190.3899f, -86.776f, -135.183f), Quaternion.Euler(0f, 59.69361f, 0f)); dictionary.Add(new Vector3(-91.03493f, -158.2584f, 120.482f), Quaternion.Euler(0f, 205.1253f, 0f)); break; case "golemplains2": dictionary.Add(new Vector3(31.92904f, 82.58593f, -64.25964f), Quaternion.Euler(0f, 0.5191317f, 0f)); dictionary.Add(new Vector3(316.7331f, 44.01719f, -29.57135f), Quaternion.Euler(0f, 336.1666f, 0f)); break; case "blackbeach": dictionary.Add(new Vector3(-24.12934f, -174.6557f, -387.6982f), Quaternion.Euler(0f, 182.4907f, 0f)); dictionary.Add(new Vector3(-4.805637f, -204.4452f, -12.48376f), Quaternion.Euler(0f, 152.4669f, 0f)); break; case "blackbeach2": dictionary.Add(new Vector3(13.17906f, 87.47905f, -133.2737f), Quaternion.Euler(0f, 323.4963f, 0f)); dictionary.Add(new Vector3(-174.5754f, 17.0354f, -96.01575f), Quaternion.Euler(0f, 23.97439f, 0f)); break; case "lakes": dictionary.Add(new Vector3(86.66148f, 15.45605f, 118.2119f), Quaternion.Euler(0f, 195.2255f, 0f)); dictionary.Add(new Vector3(-160.3739f, 0.8921404f, -86.5373f), Quaternion.Euler(0f, 21.13958f, 0f)); break; case "lakesnight": dictionary.Add(new Vector3(86.66148f, 15.45605f, 118.2119f), Quaternion.Euler(0f, 195.2255f, 0f)); dictionary.Add(new Vector3(-160.3739f, 0.8921404f, -86.5373f), Quaternion.Euler(0f, 21.13958f, 0f)); break; case "snowyforest": dictionary.Add(new Vector3(106.6341f, 68.99653f, 214.1347f), Quaternion.Euler(0f, 241.8315f, 0f)); dictionary.Add(new Vector3(101.7054f, 36.81925f, 28.63689f), Quaternion.Euler(0f, 273.5906f, 0f)); break; case "village": dictionary.Add(new Vector3(-116.2186f, -4.684125f, -248.0959f), Quaternion.Euler(0f, 47.27631f, 0f)); dictionary.Add(new Vector3(234.6463f, 48.88169f, 22.69479f), Quaternion.Euler(0f, 232.9216f, 0f)); break; case "goolake": dictionary.Add(new Vector3(116.9908f, -91.04021f, -7.358109f), Quaternion.Euler(0f, 170.321f, 0f)); dictionary.Add(new Vector3(193.6468f, -122.2093f, 81.47984f), Quaternion.Euler(0f, 134.2626f, 0f)); break; case "foggyswamp": dictionary.Add(new Vector3(21.54059f, -97.81608f, -48.92618f), Quaternion.Euler(0f, 294.0464f, 0f)); dictionary.Add(new Vector3(321.5318f, -160.4051f, -323.4489f), Quaternion.Euler(0f, 78.9093f, 0f)); break; case "ancientloft": dictionary.Add(new Vector3(80.94776f, 30.03779f, -130.4797f), Quaternion.Euler(0f, 125.4776f, 0f)); dictionary.Add(new Vector3(-71.81654f, 27.19449f, 83.8267f), Quaternion.Euler(0f, 93.52406f, 0f)); break; case "nest": dictionary.Add(new Vector3(-7.882278f, 166.7073f, -109.7369f), Quaternion.Euler(0f, 175.1611f, 0f)); dictionary.Add(new Vector3(-301.5674f, 104.5605f, -12.576f), Quaternion.Euler(0f, 37.47514f, 0f)); break; case "lemuriantemple": dictionary.Add(new Vector3(-4.580923f, 27.38782f, 3.959016f), Quaternion.Euler(0f, 9.96745f, 0f)); dictionary.Add(new Vector3(101.6959f, -27.22142f, 163.6068f), Quaternion.Euler(0f, 232.0676f, 0f)); break; case "frozenwall": dictionary.Add(new Vector3(82.25099f, 3.083081f, 64.41711f), Quaternion.Euler(0f, 330.366f, 0f)); dictionary.Add(new Vector3(96.06144f, 115.7271f, 156.4782f), Quaternion.Euler(0f, 199.4881f, 0f)); break; case "wispgraveyard": dictionary.Add(new Vector3(-133.0515f, -31.09213f, -118.661f), Quaternion.Euler(0f, 24.76236f, 0f)); dictionary.Add(new Vector3(79.80575f, 30.06047f, 56.93044f), Quaternion.Euler(0f, 52.20761f, 0f)); break; case "sulfurpools": dictionary.Add(new Vector3(-183.9088f, 10.77933f, 32.21773f), Quaternion.Euler(0f, 181.6929f, 0f)); dictionary.Add(new Vector3(174.8141f, 28.67295f, 33.7763f), Quaternion.Euler(0f, 308.1877f, 0f)); break; case "ironalluvium": dictionary.Add(new Vector3(13.42801f, 125.7309f, -188.0156f), Quaternion.Euler(0f, 43.0607f, 0f)); dictionary.Add(new Vector3(167.1385f, 149.9529f, 95.30859f), Quaternion.Euler(0f, 205.8401f, 0f)); break; case "ironalluvium2": dictionary.Add(new Vector3(13.42801f, 125.7309f, -188.0156f), Quaternion.Euler(0f, 43.0607f, 0f)); dictionary.Add(new Vector3(167.1385f, 149.9529f, 95.30859f), Quaternion.Euler(0f, 205.8401f, 0f)); break; case "habitat": dictionary.Add(new Vector3(62.35349f, 0.6543378f, 143.4429f), Quaternion.Euler(0f, 292.0843f, 0f)); dictionary.Add(new Vector3(-13.10078f, 21.30807f, -104.7179f), Quaternion.Euler(0f, 205.8312f, 0f)); break; case "habitatfall": dictionary.Add(new Vector3(62.35349f, 0.6543378f, 143.4429f), Quaternion.Euler(0f, 292.0843f, 0f)); dictionary.Add(new Vector3(-13.10078f, 21.30807f, -104.7179f), Quaternion.Euler(0f, 205.8312f, 0f)); break; case "dampcavesimple": dictionary.Add(new Vector3(74.77532f, -87.4948f, -196.4726f), Quaternion.Euler(0f, 200.3068f, 0f)); dictionary.Add(new Vector3(-156.3687f, -122.5679f, -91.23058f), Quaternion.Euler(0f, 111.9192f, 0f)); break; case "shipgraveyard": dictionary.Add(new Vector3(-93.99381f, 11.12058f, -31.31874f), Quaternion.Euler(0f, 218.6378f, 0f)); dictionary.Add(new Vector3(186.8673f, 77.27081f, 26.32287f), Quaternion.Euler(0f, 346.0909f, 0f)); break; case "rootjungle": dictionary.Add(new Vector3(77.77145f, -60.95433f, -8.285771f), Quaternion.Euler(0f, 359.0302f, 0f)); dictionary.Add(new Vector3(-202.9731f, 92.59643f, -166.5592f), Quaternion.Euler(0f, 71.41415f, 0f)); break; case "repurposedcrater": dictionary.Add(new Vector3(-253.8853f, 121.0383f, 11.31156f), Quaternion.Euler(0f, 68.99377f, 0f)); dictionary.Add(new Vector3(9.018836f, 53.40439f, -134.2828f), Quaternion.Euler(0f, 305.9838f, 0f)); break; case "conduitcanyon": dictionary.Add(new Vector3(-420.648f, 43.71975f, -332.4908f), Quaternion.Euler(0f, 61.96296f, 0f)); dictionary.Add(new Vector3(-131.2769f, 32.62687f, -154.4974f), Quaternion.Euler(0f, 173.366f, 0f)); dictionary.Add(new Vector3(135.7131f, 40.00665f, 304.5394f), Quaternion.Euler(0f, 127.5887f, 0f)); dictionary.Add(new Vector3(120.3498f, 113.6439f, 605.4644f), Quaternion.Euler(0f, 181.6343f, 0f)); break; case "skymeadow": dictionary.Add(new Vector3(-122.741f, -87.85542f, -117.1602f), Quaternion.Euler(0f, 79.03946f, 0f)); dictionary.Add(new Vector3(-197.5687f, 26.55142f, 30.68633f), Quaternion.Euler(0f, 135.1837f, 0f)); break; case "helminthroost": dictionary.Add(new Vector3(-569.6815f, -148.7018f, 337.3586f), Quaternion.Euler(0f, 269.8808f, 0f)); dictionary.Add(new Vector3(-397.3075f, 118.8055f, -55.87037f), Quaternion.Euler(0f, 123.3015f, 0f)); break; case "FBLScene": dictionary.Add(new Vector3(300.2629f, 229.4142f, -126.4303f), Quaternion.Euler(0f, 125.6396f, 0f)); dictionary.Add(new Vector3(169.5165f, 255.284f, 410.8152f), Quaternion.Euler(0f, 20.25785f, 0f)); break; case "observatory_wormsworms": dictionary.Add(new Vector3(176.1036f, -2.617247f, -34.78374f), Quaternion.Euler(0f, 210.1473f, 0f)); dictionary.Add(new Vector3(-141.1253f, 77.90317f, 221.5992f), Quaternion.Euler(0f, 13.25202f, 0f)); break; case "foggyswampdownpour": dictionary.Add(new Vector3(-749.5313f, 91.3914f, -2025.714f), Quaternion.Euler(0f, 227.2804f, 0f)); dictionary.Add(new Vector3(-1018.735f, 76.65155f, -2313.54f), Quaternion.Euler(0f, 334.4469f, 0f)); break; case "sm64_bbf_SM64_BBF": dictionary.Add(new Vector3(162.9347f, 38.44512f, 74.83717f), Quaternion.Euler(0f, 189.5465f, 0f)); dictionary.Add(new Vector3(-97.6097f, 15.58791f, 97.34737f), Quaternion.Euler(0f, 10.41307f, 0f)); break; case "catacombs_DS1_Catacombs": dictionary.Add(new Vector3(-49.93897f, 218.098f, -439.0562f), Quaternion.Euler(0f, 125.6632f, 0f)); dictionary.Add(new Vector3(-29.51958f, 190.1485f, -174.524f), Quaternion.Euler(0f, 135.824f, 0f)); break; case "snowtime_bloodgulch": dictionary.Add(new Vector3(-380.7556f, 7.749712f, 374.3361f), Quaternion.Euler(0f, 53.47242f, 0f)); dictionary.Add(new Vector3(-59.86384f, 47.40347f, 365.2287f), Quaternion.Euler(0f, 288.4397f, 0f)); break; case "snowtime_deathisland": dictionary.Add(new Vector3(101.2409f, 49.95498f, -98.19534f), Quaternion.Euler(0f, 166.7226f, 0f)); dictionary.Add(new Vector3(119.7398f, 36.45596f, -237.7042f), Quaternion.Euler(0f, 306.9397f, 0f)); break; case "snowtime_deltahalo": dictionary.Add(new Vector3(35.93007f, 82.32765f, 981.3515f), Quaternion.Euler(0f, 175.9509f, 0f)); dictionary.Add(new Vector3(31.13048f, 65.11033f, 641.2076f), Quaternion.Euler(0f, 15.0037f, 0f)); break; case "snowtime_gephyrophobia": dictionary.Add(new Vector3(-93.77584f, -17.08484f, 51.58313f), Quaternion.Euler(0f, 359.9742f, 0f)); dictionary.Add(new Vector3(-93.86058f, -17.27335f, 453.9898f), Quaternion.Euler(0f, 179.6247f, 0f)); dictionary.Add(new Vector3(-93.63819f, -59.47458f, 253.0157f), Quaternion.Euler(0f, 359.8916f, 0f)); break; case "snowtime_gmconstruct": dictionary.Add(new Vector3(125.6074f, -24.182f, 41.94416f), Quaternion.Euler(0f, 224.6205f, 0f)); dictionary.Add(new Vector3(191.7613f, -4.52605f, -229.1491f), Quaternion.Euler(0f, 134.3182f, 0f)); dictionary.Add(new Vector3(-35.97609f, -0.746001f, 50.99677f), Quaternion.Euler(0f, 134.9052f, 0f)); dictionary.Add(new Vector3(-36.71188f, -6.793999f, 58.53889f), Quaternion.Euler(0f, 277.8377f, 0f)); break; case "snowtime_gmflatgrass": dictionary.Add(new Vector3(10.22947f, 15.37018f, 9.359962f), Quaternion.Euler(0f, 256.2039f, 0f)); break; case "snowtime_halo": dictionary.Add(new Vector3(-30.71955f, 229.6823f, -144.8316f), Quaternion.Euler(0f, 209.9076f, 0f)); dictionary.Add(new Vector3(-208.1239f, 202.1529f, 170.1005f), Quaternion.Euler(0f, 134.7629f, 0f)); break; case "snowtime_halo2": dictionary.Add(new Vector3(1867.69f, 238.3529f, -642.8783f), Quaternion.Euler(0f, 44.7936f, 0f)); dictionary.Add(new Vector3(1293.771f, 263.4328f, -554.2413f), Quaternion.Euler(0f, 107.449f, 0f)); dictionary.Add(new Vector3(1342.334f, 164.51f, -135.1692f), Quaternion.Euler(0f, 125.0683f, 0f)); dictionary.Add(new Vector3(1840.748f, 213.0739f, -200.0254f), Quaternion.Euler(0f, 337.9286f, 0f)); break; case "snowtime_highcharity": dictionary.Add(new Vector3(60.14213f, 11.577f, -483.8502f), Quaternion.Euler(0f, 241.12f, 0f)); dictionary.Add(new Vector3(-52.33072f, 11.577f, -487.8752f), Quaternion.Euler(0f, 129.98f, 0f)); dictionary.Add(new Vector3(-61.07679f, 11.57699f, -546.1075f), Quaternion.Euler(0f, 59.45599f, 0f)); dictionary.Add(new Vector3(57.52615f, 11.577f, -544.13f), Quaternion.Euler(0f, 297.445f, 0f)); dictionary.Add(new Vector3(21.75992f, 2.126976f, -484.5297f), Quaternion.Euler(0f, 35.51595f, 0f)); dictionary.Add(new Vector3(37.98527f, 2.126978f, -514.8828f), Quaternion.Euler(0f, 89.67403f, 0f)); dictionary.Add(new Vector3(22.01921f, 2.126978f, -545.0482f), Quaternion.Euler(0f, 145.1344f, 0f)); dictionary.Add(new Vector3(-21.56447f, 2.12697f, -544.3843f), Quaternion.Euler(0f, 217.2564f, 0f)); dictionary.Add(new Vector3(-37.30863f, 2.126962f, -514.6474f), Quaternion.Euler(0f, 271.6194f, 0f)); dictionary.Add(new Vector3(-21.56099f, 2.12697f, -485.05f), Quaternion.Euler(0f, 324.465f, 0f)); dictionary.Add(new Vector3(-17.53811f, 9.018085f, -621.3613f), Quaternion.Euler(0f, 123.2604f, 0f)); dictionary.Add(new Vector3(17.22844f, 9.0188f, -408.7164f), Quaternion.Euler(0f, 313.6848f, 0f)); break; case "snowtime_icefields": dictionary.Add(new Vector3(272.5726f, 7.359958f, -303.162f), Quaternion.Euler(0f, 357.3307f, 0f)); dictionary.Add(new Vector3(-86.97459f, 7.360003f, 77.48335f), Quaternion.Euler(0f, 178.8512f, 0f)); break; case "snowtime_mvmmannhattan": dictionary.Add(new Vector3(97.37387f, -3.909989f, 39.39054f), Quaternion.Euler(0f, 243.5768f, 0f)); dictionary.Add(new Vector3(11.37051f, -10.19141f, 163.9846f), Quaternion.Euler(0f, 138.7431f, 0f)); dictionary.Add(new Vector3(-30.7068f, 1.629176f, -88.67094f), Quaternion.Euler(0f, 44.10945f, 0f)); break; case "snowtime_newmombasabridge": dictionary.Add(new Vector3(-856.0861f, 1.803394f, -65.45497f), Quaternion.Euler(0f, 91.96432f, 0f)); dictionary.Add(new Vector3(79.94922f, 48.21177f, 8.020412f), Quaternion.Euler(0f, 255.742f, 0f)); dictionary.Add(new Vector3(836.3431f, 5.02102f, 28.03459f), Quaternion.Euler(0f, 0.5525074f, 0f)); break; case "snowtime_odstmombasa": dictionary.Add(new Vector3(-600.8646f, 19.12913f, 4.601078f), Quaternion.Euler(0f, 128.6979f, 0f)); dictionary.Add(new Vector3(-41.66861f, 17.09908f, -53.34187f), Quaternion.Euler(0f, 269.7134f, 0f)); dictionary.Add(new Vector3(-413.2506f, 12.5159f, 210.6578f), Quaternion.Euler(0f, 135.8528f, 0f)); break; case "snowtime_plrhightower": dictionary.Add(new Vector3(188.9554f, 46.25977f, -153.9811f), Quaternion.Euler(0f, 304.0394f, 0f)); dictionary.Add(new Vector3(71.34775f, 31.16273f, -141.1281f), Quaternion.Euler(0f, 91.36182f, 0f)); dictionary.Add(new Vector3(23.99743f, 23.75547f, -210.7883f), Quaternion.Euler(0f, 12.54428f, 0f)); dictionary.Add(new Vector3(26.78335f, 24.51611f, -58.37008f), Quaternion.Euler(0f, 194.0668f, 0f)); break; case "snowtime_sandtrap": dictionary.Add(new Vector3(37.73601f, -77.13338f, 176.5529f), Quaternion.Euler(0f, 350.9677f, 0f)); dictionary.Add(new Vector3(-0.09483957f, -78.48047f, 20.26742f), Quaternion.Euler(0f, 178.6303f, 0f)); dictionary.Add(new Vector3(-133.8743f, -71.43472f, 2.363332f), Quaternion.Euler(0f, 276.9908f, 0f)); break; case "snowtime_sidewinder": dictionary.Add(new Vector3(-7.530613f, -7.065588f, -197.7645f), Quaternion.Euler(0f, 2.06729f, 0f)); dictionary.Add(new Vector3(116.0248f, -3.413208f, 46.1681f), Quaternion.Euler(0f, 83.94437f, 0f)); dictionary.Add(new Vector3(117.4637f, -7.276778f, 112.5169f), Quaternion.Euler(0f, 204.6324f, 0f)); dictionary.Add(new Vector3(-102.5031f, -8.326768f, 126.306f), Quaternion.Euler(0f, 181.4125f, 0f)); break; default: Log.Debug("no custom pos !!! too bad ,.."); return; } int[] array = new int[friendlyTurretList.Count]; foreach (CharacterMaster readOnlyInstances in CharacterMaster.readOnlyInstancesList) { if ((Object)(object)readOnlyInstances.minionOwnership == (Object)null || !((Object)readOnlyInstances).name.Contains("FriendlyTurret")) { continue; } string text = ((Object)readOnlyInstances).name.Replace("(Clone)", ""); for (int i = 0; i < friendlyTurretList.Count; i++) { if (!(text != friendlyTurretListNames[i])) { array[i]++; } } } List<GameObject> list = new List<GameObject>(); for (int j = 0; j < friendlyTurretList.Count; j++) { if (array[j] != PlayerCharacterMasterController.playerCount) { list.Add(friendlyTurretList[j]); } } if (list.Count != 0) { GameObject obj = list[Run.instance.runRNG.RangeInt(0, list.Count)]; KeyValuePair<Vector3, Quaternion> keyValuePair = dictionary.ElementAt(Run.instance.runRNG.RangeInt(0, dictionary.Count)); NetworkServer.Spawn(Object.Instantiate<GameObject>(obj, keyValuePair.Key, keyValuePair.Value)); } } private void Start() { instance = this; string path = (assetDirectory = Path.Combine(Path.GetDirectoryName(typeof(SnowtimeToyboxMod).Assembly.Location), "assetbundles")); Debug.Log((object)"Ran Start!"); _stcharacterAssetBundle = AssetBundle.LoadFromFile(Path.Combine(path, "snowtimetoybox_characters")); ((MonoBehaviour)this).StartCoroutine(ShaderSwapper.UpgradeStubbedShadersAsync(_stcharacterAssetBundle)); _stdifficultyAssetBundle = AssetBundle.LoadFromFile(Path.Combine(path, "snowtimetoybox_difficulty")); Debug.Log((object)_stcharacterAssetBundle); Debug.Log((object)_stdifficultyAssetBundle); AddDifficulty(); AddCustomSkills(); AddCustomAllies(); AddCustomBuffs(); ((ResourceAvailability)(ref ItemCatalog.availability)).CallWhenAvailable((Action)AddCustomTagsToItems); ((ResourceAvailability)(ref EquipmentCatalog.availability)).CallWhenAvailable((Action)AddElitesToList); } public void AddCustomTagsToItems() { Log.Debug("SnowtimeToybox is adding custom tags to items for Friendly Turrets/Drones..."); ItemDef[] array = (ItemDef[])(object)new ItemDef[8] { Items.Syringe, Items.BossDamageBonus, Items.Pearl, Items.ShinyPearl, Items.FallBoots, Items.PermanentDebuffOnHit, Items.MeteorAttackOnHighDamage, Items.AttackSpeedPerNearbyAllyOrEnemy }; ItemDef[] array2 = (ItemDef[])(object)new ItemDef[25] { Items.Thorns, Items.FlatHealth, Items.HealWhileSafe, Items.ArmorPlate, Items.PersonalShield, Items.Infusion, Items.ChainLightning, Items.BarrierOnOverHeal, Items.Plant, Items.BounceNearby, Items.ShockNearby, Items.Pearl, Items.ShinyPearl, Items.Knurl, Items.FallBoots, Items.OutOfCombatArmor, Items.PermanentDebuffOnHit, Items.LunarSun, Items.HalfSpeedDoubleHealth, Items.MissileVoid, Items.ChainLightningVoid, Items.CookedSteak, Items.BarrierOnCooldown, Items.ShieldBooster, Items.ShockDamageAura }; ItemDef[] array3 = array; foreach (ItemDef val in array3) { Log.Debug("Added " + ((Object)val).name + " to borbo turret's item whitelist"); ItemAPI.ApplyTagToItem("turretBorboWhitelist", val); } array3 = array2; foreach (ItemDef val2 in array3) { Log.Debug("Added " + ((Object)val2).name + " to Strawberry Shortcake Turret's item whitelist"); ItemAPI.ApplyTagToItem("turretShortcakeWhitelist", val2); } if (acanthivoidLoaded && SeekingTheVoid.isPairyEnabled) { ItemAPI.ApplyTagToItem("turretShortcakeWhitelist", StrawPairy.StrawPairyDef); } } public void AddElitesToList() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) Log.Debug("SnowtimeToybox is listing Elite equipment for inheritance..."); eliteDefsEquipInherit = new List<EquipmentIndex>(); EliteDef[] eliteDefs = EliteCatalog.eliteDefs; foreach (EliteDef val in eliteDefs) { eliteDefsEquipInherit.Add(val.eliteEquipmentDef.equipmentIndex); string? obj = ((object)val.eliteEquipmentDef)?.ToString(); EquipmentIndex equipmentIndex = val.eliteEquipmentDef.equipmentIndex; Log.Debug("Elite Equipment: " + obj + " Index: " + ((object)(EquipmentIndex)(ref equipmentIndex)).ToString()); } } public void AddCustomAllies() { //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_032c: Expected O, but got Unknown Log.Debug("Adding SnowtimeToybox Friend Turrets/Drones..."); Log.Debug("Defining Friendly Turret based on Borbo (2R4R)"); FriendlyTurretBorboBody = _stcharacterAssetBundle.LoadAsset<GameObject>("Assets/SnowtimeMod/Assets/Characters/FriendlyTurrets/FriendlyTurretTestIngame/Borbo/_FriendlyTurretBorboBody.prefab"); FriendlyTurretBorboMaster = _stcharacterAssetBundle.LoadAsset<GameObject>("Assets/SnowtimeMod/Assets/Characters/FriendlyTurrets/FriendlyTurretTestIngame/Borbo/_FriendlyTurretBorboMaster.prefab"); FriendlyTurretBorboSkillFamily = _stcharacterAssetBundle.LoadAsset<SkillFamily>("Assets/SnowtimeMod/Assets/Characters/FriendlyTurrets/FriendlyTurretTestIngame/Borbo/Skills/BorboPrimaryFamily.asset"); FriendlyTurretBorboSkillDef = _stcharacterAssetBundle.LoadAsset<SkillDef>("Assets/SnowtimeMod/Assets/Characters/FriendlyTurrets/FriendlyTurretTestIngame/Borbo/Skills/BorboBlast.asset"); FriendlyTurretBorboUtilSkillFamily = _stcharacterAssetBundle.LoadAsset<SkillFamily>("Assets/SnowtimeMod/Assets/Characters/FriendlyTurrets/FriendlyTurretTestIngame/Borbo/Skills/BorboUtilityFamily.asset"); FriendlyTurretBorboUtilSkillDef = _stcharacterAssetBundle.LoadAsset<SkillDef>("Assets/SnowtimeMod/Assets/Characters/FriendlyTurrets/FriendlyTurretTestIngame/Borbo/Skills/BorboShenanigans.asset"); FriendlyTurretBorboSkillDef.activationState = new SerializableEntityStateType(typeof(ChargeBorboLaser)); FriendlyTurretBorboUtilSkillDef.activationState = new SerializableEntityStateType(typeof(Shenanigans)); FriendlyTurretBorboDef = _stcharacterAssetBundle.LoadAsset<DroneDef>("Assets/SnowtimeMod/Assets/Characters/FriendlyTurrets/FriendlyTurretTestIngame/Borbo/_FriendlyTurretBorbo.asset"); Log.Debug("Adding Borbo Turret Assets"); Log.Debug("Adding Friendly Turret Entity States"); bool flag = default(bool); ContentAddition.AddEntityState(typeof(FireBorboLaser), ref flag); ContentAddition.AddEntityState(typeof(ChargeBorboLaser), ref flag); ContentAddition.AddBody(FriendlyTurretBorboBody); ContentAddition.AddMaster(FriendlyTurretBorboMaster); ContentAddition.AddSkillFamily(FriendlyTurretBorboSkillFamily); ContentAddition.AddSkillDef(FriendlyTurretBorboSkillDef); ContentAddition.AddEffect(FireBorboLaser.effectPrefabObject); ContentAddition.AddEffect(FireBorboLaser.hitEffectPrefabObject); ContentAddition.AddEffect(FireBorboLaser.tracerEffectPrefabObject); Log.Debug("Defining Friendly Turret based on Shortcake (Snowtime Partner)"); FriendlyTurretShortcakeBody = _stcharacterAssetBundle.LoadAsset<GameObject>("Assets/SnowtimeMod/Assets/Characters/FriendlyTurrets/FriendlyTurretTestIngame/Shortcake/_FriendlyTurretShortcakeBody.prefab"); FriendlyTurretShortcakeMaster = _stcharacterAssetBundle.LoadAsset<GameObject>("Assets/SnowtimeMod/Assets/Characters/FriendlyTurrets/FriendlyTurretTestIngame/Shortcake/_FriendlyTurretShortcakeMaster.prefab"); FriendlyTurretShortcakeSkillFamily = _stcharacterAssetBundle.LoadAsset<SkillFamily>("Assets/SnowtimeMod/Assets/Characters/FriendlyTurrets/FriendlyTurretTestIngame/Shortcake/Skills/ShortcakePrimaryFamily.asset"); FriendlyTurretShortcakeSkillDef = _stcharacterAssetBundle.LoadAsset<SkillDef>("Assets/SnowtimeMod/Assets/Characters/FriendlyTurrets/FriendlyTurretTestIngame/Shortcake/Skills/ShortcakeTaunt.asset"); FriendlyTurretShortcakeUtilSkillFamily = _stcharacterAssetBundle.LoadAsset<SkillFamily>("Assets/SnowtimeMod/Assets/Characters/FriendlyTurrets/FriendlyTurretTestIngame/Shortcake/Skills/ShortcakeUtilityFamily.asset"); FriendlyTurretShortcakeUtilSkillDef = _stcharacterAssetBundle.LoadAsset<SkillDef>("Assets/SnowtimeMod/Assets/Characters/FriendlyTurrets/FriendlyTurretTestIngame/Shortcake/Skills/ShortcakeShenanigans.asset"); FriendlyTurretShortcakeSkillDef.activationState = new SerializableEntityStateType(typeof(ShortcakeTaunt)); FriendlyTurretShortcakeUtilSkillDef.activationState = new SerializableEntityStateType(typeof(Shenanigans)); FriendlyTurretShortcakeDef = _stcharacterAssetBundle.LoadAsset<DroneDef>("Assets/SnowtimeMod/Assets/Characters/FriendlyTurrets/FriendlyTurretTestIngame/Shortcake/_FriendlyTurretShortcake.asset"); ContentAddition.AddEntityState(typeof(ShortcakeTaunt), ref flag); ContentAddition.AddBody(FriendlyTurretShortcakeBody); ContentAddition.AddMaster(FriendlyTurretShortcakeMaster); ContentAddition.AddSkillFamily(FriendlyTurretShortcakeSkillFamily); ContentAddition.AddSkillDef(FriendlyTurretShortcakeSkillDef); ContentAddition.AddEffect(SnowtimeOrbs.orbShortcakeRetaliateObject); ContentAddition.AddEffect(SnowtimeOrbs.orbShortcakeRetaliateFriendlyObject); ContentAddition.AddEffect(SnowtimeOrbs.orbShortcakeTauntObject); ContentAddition.AddEffect(SnowtimeOrbs.orbShortcakeRetaliateImpactObject); ContentAddition.AddEffect(SnowtimeOrbs.orbShortcakeRetaliateFriendlyImpactObject); ContentAddition.AddEffect(SnowtimeOrbs.orbShortcakeTauntImpactObject); ContentAddition.AddEntityState(typeof(Shenanigans), ref flag); Log.Debug("Adding Friendly Turrets Interactables to Stages"); FriendlyTurretBorboBroken = _stcharacterAssetBundle.LoadAsset<GameObject>("Assets/SnowtimeMod/Assets/Characters/FriendlyTurrets/FriendlyTurretTestIngame/Borbo/_mdlFriendlyTurretBorboBroken.prefab"); FriendlyTurretShortcakeBroken = _stcharacterAssetBundle.LoadAsset<GameObject>("Assets/SnowtimeMod/Assets/Characters/FriendlyTurrets/FriendlyTurretTestIngame/Shortcake/_mdlFriendlyTurretShortcakeBroken.prefab"); BorboCheck borboCheck = FriendlyTurretBorboBroken.AddComponent<BorboCheck>(); BorboCheck borboCheck2 = FriendlyTurretShortcakeBroken.AddComponent<BorboCheck>(); PurchaseInteraction component = FriendlyTurretBorboBroken.GetComponent<PurchaseInteraction>(); PurchaseInteraction component2 = FriendlyTurretShortcakeBroken.GetComponent<PurchaseInteraction>(); borboCheck.purchaseInteraction = component; borboCheck2.purchaseInteraction = component2; PurchaseInteraction.GetInteractability += new hook_GetInteractability(GetInteractabilityFriendlyTurrets); ContentAddition.AddNetworkedObject(FriendlyTurretBorboBroken); ContentAddition.AddNetworkedObject(FriendlyTurretShortcakeBroken); ContentAddition.AddEffect(BorboCheck.turretUseEffect); friendlyTurretList.Add(FriendlyTurretBorboBroken); friendlyTurretList.Add(FriendlyTurretShortcakeBroken); Log.Debug(friendlyTurretList); friendlyTurretListNames = new string[friendlyTurretList.Count]; for (int i = 0; i < friendlyTurretList.Count; i++) { friendlyTurretListNames[i] = ((Object)friendlyTurretList[i].GetComponent<SummonMasterBehavior>().masterPrefab.GetComponent<CharacterMaster>()).name; } } private Interactability GetInteractabilityFriendlyTurrets(orig_GetInteractability orig, PurchaseInteraction self, Interactor activator) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) if (!self.displayNameToken.StartsWith("FRIENDLYTURRET_")) { return orig.Invoke(self, activator); } CharacterBody component = ((Component)activator).gameObject.GetComponent<CharacterBody>(); CharacterBody[] array = ((component != null) ? component.GetMinionBodies() : null); if (array == null) { return orig.Invoke(self, activator); } CharacterBody[] array2 = array; foreach (CharacterBody val in array2) { if (!val.baseNameToken.StartsWith("FRIENDLYTURRET_")) { interactablesmaster = ((object)((Component)self).GetComponent<SummonMasterBehavior>().masterPrefab.gameObject).ToString(); if (interactablesmaster.EndsWith(interactablesuffering)) { interactablesmaster = interactablesmaster.Substring(0, interactablesmaster.LastIndexOf(interactablesuffering)); } charactersmaster = ((object)((Component)val.master).gameObject).ToString(); if (charactersmaster.EndsWith(charactersuffering)) { charactersmaster = charactersmaster.Substring(0, charactersmaster.LastIndexOf(charactersuffering)); } if (charactersmaster.Contains(interactablesmaster)) { return (Interactability)0; } } } return orig.Invoke(self, activator); } private void CharacterMaster_OnStartGlobal(CharacterMaster obj) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between