RUMBLE does not support other mod managers. If you want to use a manager, you must use the RUMBLE Mod Manager, a manager specifically designed for this game.
Decompiled source of CustomShiftstoneModels v1.2.2
Mods/ShifstoneModels.dll
Decompiled 3 days agousing System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Text.Json; using HarmonyLib; using Il2CppRUMBLE.Combat.ShiftStones; using Il2CppSystem; using MelonLoader; using MelonLoader.Utils; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using RumbleModdingAPI; using ShifstoneModels; using UnityEngine; using UnityEngine.VFX; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: MelonInfo(typeof(Class1), "Custom Shiftstone Models", "1.2.2", "SpooderCode", null)] [assembly: MelonGame("", "")] [assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")] [assembly: AssemblyCompany("ShifstoneModels")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+6836442fee63bfba396b6680b0ad5b36ef693fe0")] [assembly: AssemblyProduct("ShifstoneModels")] [assembly: AssemblyTitle("ShifstoneModels")] [assembly: AssemblyVersion("1.0.0.0")] namespace ShifstoneModels; public class Class1 : MelonMod { [HarmonyPatch(typeof(ShiftStone), "OnFetchFromPool")] public class ReplaceStone { [HarmonyPostfix] public static void Postfix(ShiftStone __instance) { switch (__instance.StoneName) { case "Charge Stone": replace(__instance, chargemodel); break; case "Guard Stone": replace(__instance, guardmodel); break; case "Volatile Stone": replace(__instance, volatilemodel); break; case "Stubborn Stone": replace(__instance, stubbornmodel); break; case "Flow Stone": replace(__instance, flowmodel); break; case "Surge Stone": replace(__instance, surgemodel); break; case "Adamant Stone": replace(__instance, adamantmodel); break; case "Vigor Stone": replace(__instance, vigormodel); break; } } } [HarmonyPatch(typeof(VisualEffect), "Play", new Type[] { })] public class ShiftstoneActivateEffect { [HarmonyPostfix] public static void Postfix(VisualEffect __instance) { if (!(((Object)__instance).name == "Shiftstone Trigger VFX") || ((Component)__instance).transform.parent.childCount <= 2) { return; } foreach (Animation componentsInChild in ((Component)((Component)__instance).transform.parent).GetComponentsInChildren<Animation>()) { if (((Object)((Component)componentsInChild).gameObject).name.Contains("$")) { componentsInChild.Play(); } } foreach (ParticleSystem componentsInChild2 in ((Component)((Component)__instance).transform.parent).GetComponentsInChildren<ParticleSystem>()) { if (((Object)((Component)componentsInChild2).gameObject).name.Contains("$")) { componentsInChild2.Play(false); } } foreach (AudioSource componentsInChild3 in ((Component)((Component)__instance).transform.parent).GetComponentsInChildren<AudioSource>()) { if (((Object)((Component)componentsInChild3).gameObject).name.Contains("$")) { componentsInChild3.Play(); } } } } private static GameObject chargemodel; private static GameObject adamantmodel; private static GameObject stubbornmodel; private static GameObject flowmodel; private static GameObject guardmodel; private static GameObject surgemodel; private static GameObject volatilemodel; private static GameObject vigormodel; public GameObject LoadShifstone(string file) { string path = Path.Combine(MelonEnvironment.UserDataDirectory, "ShiftstoneModels"); path = Path.Combine(path, file + ".shift"); if (File.Exists(path)) { return VersionHandler.ChooseVersion(path); } try { GameObject val; try { val = Object.Instantiate<GameObject>(Calls.LoadAssetFromFile<GameObject>("UserData/ShiftstoneModels/" + file, file)); } catch { val = Object.Instantiate<GameObject>(Calls.LoadAssetFromFile<GameObject>("UserData/ShiftstoneModels/" + file, "Stone")); } val.SetActive(false); return val; } catch { return null; } } public static void replace(ShiftStone stone, GameObject shiftstone) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) if (((Component)stone).transform.childCount >= 3 || !((Object)(object)shiftstone != (Object)null) || !((Object)(object)stone != (Object)null)) { return; } ((Renderer)((Component)stone).GetComponentInChildren<MeshRenderer>()).enabled = false; ((Component)stone).transform.localRotation = Quaternion.identity; GameObject val = Object.Instantiate<GameObject>(shiftstone, ((Component)stone).transform); val.SetActive(true); foreach (MeshRenderer componentsInChild in ((Component)stone).GetComponentsInChildren<MeshRenderer>()) { if (((Object)((Component)componentsInChild).gameObject).name.Contains("%")) { ((Renderer)componentsInChild).material = ((Renderer)((Component)((Component)stone).transform.GetChild(0)).GetComponent<MeshRenderer>()).material; } } } public override void OnSceneWasLoaded(int buildIndex, string sceneName) { if (sceneName == "Loader") { chargemodel = LoadShifstone("CHARGE"); if (Object.op_Implicit((Object)(object)chargemodel)) { Object.DontDestroyOnLoad((Object)(object)chargemodel); } guardmodel = LoadShifstone("GUARD"); if (Object.op_Implicit((Object)(object)guardmodel)) { Object.DontDestroyOnLoad((Object)(object)guardmodel); } flowmodel = LoadShifstone("FLOW"); if (Object.op_Implicit((Object)(object)flowmodel)) { Object.DontDestroyOnLoad((Object)(object)flowmodel); } surgemodel = LoadShifstone("SURGE"); if (Object.op_Implicit((Object)(object)surgemodel)) { Object.DontDestroyOnLoad((Object)(object)surgemodel); } adamantmodel = LoadShifstone("ADAMANT"); if (Object.op_Implicit((Object)(object)adamantmodel)) { Object.DontDestroyOnLoad((Object)(object)adamantmodel); } stubbornmodel = LoadShifstone("STUBBORN"); if (Object.op_Implicit((Object)(object)stubbornmodel)) { Object.DontDestroyOnLoad((Object)(object)stubbornmodel); } volatilemodel = LoadShifstone("VOLATILE"); if (Object.op_Implicit((Object)(object)volatilemodel)) { Object.DontDestroyOnLoad((Object)(object)volatilemodel); } vigormodel = LoadShifstone("VIGOR"); if (Object.op_Implicit((Object)(object)vigormodel)) { Object.DontDestroyOnLoad((Object)(object)vigormodel); } } } } public static class GodotExportBuilder { private class ExportRoot { public int version; public List<ObjectDef> objects; public JArray activate; public JArray passive; } private class ObjectDef { public string id; public float[] albedo; public float[] emmision; public float emmision_strength; public float metallic; public bool shift_mat; public TransformDef transform; } private class TransformDef { public float[] position; public float[] rotation; public float[] scale; } public static GameObject Build(string jsonPath) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown string text = File.ReadAllText(jsonPath); ExportRoot exportRoot = JsonConvert.DeserializeObject<ExportRoot>(text); GameObject val = new GameObject("ExportedObjectRoot"); GameObject val2 = new GameObject("Objects"); GameObject val3 = new GameObject("Passive"); GameObject val4 = new GameObject("Activate"); val2.transform.SetParent(val.transform, false); val3.transform.SetParent(val.transform, false); val4.transform.SetParent(val.transform, false); Dictionary<string, GameObject> dictionary = new Dictionary<string, GameObject>(); foreach (ObjectDef @object in exportRoot.objects) { GameObject val5 = CreatePrimitiveForId(@object.id); ((Object)val5).name = @object.id; ApplyTransform(val5.transform, @object.transform); ApplyMaterial(val5, @object); val5.transform.SetParent(val2.transform, false); dictionary[@object.id] = val5; } return val; } private static GameObject CreatePrimitiveForId(string id) { return (GameObject)(id.ToLower() switch { "icosphere" => GameObject.CreatePrimitive((PrimitiveType)0), "cube" => GameObject.CreatePrimitive((PrimitiveType)3), "cylinder" => GameObject.CreatePrimitive((PrimitiveType)2), "capsule" => GameObject.CreatePrimitive((PrimitiveType)1), _ => GameObject.CreatePrimitive((PrimitiveType)3), }); } private static void ApplyMaterial(GameObject go, ObjectDef def) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_0059: 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_00be: Unknown result type (might be due to invalid IL or missing references) Renderer componentInChildren = go.GetComponentInChildren<Renderer>(); if (!Object.op_Implicit((Object)(object)componentInChildren)) { return; } Material val = new Material(Shader.Find("Universal Render Pipeline/Lit")); if (!Object.op_Implicit((Object)(object)val)) { Debug.LogError(Object.op_Implicit("URP Lit shader not found!")); return; } val.SetColor("_BaseColor", ToColor(def.albedo)); val.SetFloat("_Metallic", def.metallic); val.SetFloat("_Smoothness", 0f); if (def.emmision_strength > 0f) { val.EnableKeyword("_EMISSION"); val.SetColor("_EmissionColor", ToColor(def.emmision) * def.emmision_strength); } componentInChildren.material = val; if (def.shift_mat) { ((Object)go).name = ((Object)go).name + "%"; } } private static void ApplyTransform(Transform t, TransformDef d) { //IL_0008: 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_001f: 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) t.localPosition = ToVec3(d.position); t.localRotation = Quaternion.Euler(ToVec3(d.rotation)); t.localScale = ToVec3(d.scale); } private static void ParseEffects(JArray effects, GameObject parent, Dictionary<string, GameObject> objects) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Expected O, but got Unknown if (effects == null) { return; } int num = 0; foreach (JObject effect in effects) { JObject val = effect; string text = ((object)val["type"]).ToString(); GameObject val2 = null; string text2 = text; string text3 = text2; if (!(text3 == "particles")) { if (text3 == "trail") { val2 = CreateTrail(val); } } else { val2 = CreateParticles(val); } if ((Object)(object)val2 != (Object)null) { ((Object)val2).name = $"{text}_{num++}"; val2.transform.SetParent(parent.transform, false); } } } private static GameObject CreateParticles(JObject e) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown GameObject val = new GameObject("Particles"); ParticleSystem val2 = val.AddComponent<ParticleSystem>(); return val; } private static GameObject CreateTrail(JObject e) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown return new GameObject("Trail"); } private static Vector3 ToVec3(float[] v) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) return new Vector3(v[0], v[1], v[2]); } private static Color ToColor(float[] c) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) return new Color(c[0], c[1], c[2], c[3]); } } public static class GodotExportBuilderV2 { private class ExportRoot { public int version; public List<ObjectDef> objects; public JArray activate; public JArray passive; } private class ObjectDef { public string id; public float[] albedo; public float[] emmision; public float emmision_strength; public float metallic; public int shader; public TransformDef transform; } private class TransformDef { public float[] position; public float[] rotation; public float[] scale; } public static GameObject Build(string jsonPath) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown string text = File.ReadAllText(jsonPath); ExportRoot exportRoot = JsonConvert.DeserializeObject<ExportRoot>(text); GameObject val = new GameObject("ExportedObjectRoot"); GameObject val2 = new GameObject("Objects"); GameObject val3 = new GameObject("Passive"); GameObject val4 = new GameObject("Activate"); val2.transform.SetParent(val.transform, false); val3.transform.SetParent(val.transform, false); val4.transform.SetParent(val.transform, false); Dictionary<string, GameObject> dictionary = new Dictionary<string, GameObject>(); foreach (ObjectDef @object in exportRoot.objects) { GameObject val5 = CreatePrimitiveForId(@object.id); ((Object)val5).name = @object.id; ApplyTransform(val5.transform, @object.transform); ApplyMaterial(val5, @object); val5.transform.SetParent(val2.transform, false); dictionary[@object.id] = val5; } return val; } private static GameObject CreatePrimitiveForId(string id) { return (GameObject)(id.ToLower() switch { "icosphere" => GameObject.CreatePrimitive((PrimitiveType)0), "cube" => GameObject.CreatePrimitive((PrimitiveType)3), "cylinder" => GameObject.CreatePrimitive((PrimitiveType)2), "capsule" => GameObject.CreatePrimitive((PrimitiveType)1), _ => GameObject.CreatePrimitive((PrimitiveType)3), }); } private static void ApplyMaterial(GameObject go, ObjectDef def) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown //IL_006c: 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_012f: Expected O, but got Unknown //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) Renderer componentInChildren = go.GetComponentInChildren<Renderer>(); if (!Object.op_Implicit((Object)(object)componentInChildren)) { return; } if (def.shader == 0) { Material val = new Material(Shader.Find("Universal Render Pipeline/Lit")); if (!Object.op_Implicit((Object)(object)val)) { Debug.LogError(Object.op_Implicit("URP Lit shader not found!")); return; } val.SetColor("_BaseColor", ToColor(def.albedo)); val.SetFloat("_Metallic", def.metallic); val.SetFloat("_Smoothness", 0f); if (def.emmision_strength > 0f) { val.EnableKeyword("_EMISSION"); val.SetColor("_EmissionColor", ToColor(def.emmision) * def.emmision_strength); } componentInChildren.material = val; } if (def.shader == 1) { ((Object)go).name = ((Object)go).name + "%"; } if (def.shader == 2) { Material val2 = new Material(Shader.Find("Shader Graphs/RUMBLE_Prop")); val2.SetColor("_Overlay", ToColor(def.albedo)); componentInChildren.material = val2; } } private static void ApplyTransform(Transform t, TransformDef d) { //IL_0008: 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_001f: 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) t.localPosition = ToVec3(d.position); t.localRotation = Quaternion.Euler(ToVec3(d.rotation)); t.localScale = ToVec3(d.scale); } private static void ParseEffects(JArray effects, GameObject parent, Dictionary<string, GameObject> objects) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Expected O, but got Unknown if (effects == null) { return; } int num = 0; foreach (JObject effect in effects) { JObject val = effect; string text = ((object)val["type"]).ToString(); GameObject val2 = null; string text2 = text; string text3 = text2; if (!(text3 == "particles")) { if (text3 == "trail") { val2 = CreateTrail(val); } } else { val2 = CreateParticles(val); } if ((Object)(object)val2 != (Object)null) { ((Object)val2).name = $"{text}_{num++}"; val2.transform.SetParent(parent.transform, false); } } } private static GameObject CreateParticles(JObject e) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown GameObject val = new GameObject("Particles"); ParticleSystem val2 = val.AddComponent<ParticleSystem>(); return val; } private static GameObject CreateTrail(JObject e) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown return new GameObject("Trail"); } private static Vector3 ToVec3(float[] v) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) return new Vector3(v[0], v[1], v[2]); } private static Color ToColor(float[] c) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) return new Color(c[0], c[1], c[2], c[3]); } } public static class VersionHandler { public static GameObject ChooseVersion(string jsonPath) { string json = File.ReadAllText(jsonPath); using JsonDocument jsonDocument = JsonDocument.Parse(json); return (GameObject)(jsonDocument.RootElement.GetProperty("version").GetInt32() switch { 1 => GodotExportBuilder.Build(jsonPath), 2 => GodotExportBuilderV2.Build(jsonPath), _ => GodotExportBuilderV2.Build(jsonPath), }); } }