Some mods may be broken due to the recent Alloyed Collective update.
Decompiled source of OrographicGambitBaseMod v1.0.5
OrographicGambitBaseMod.dll
Decompiled 2 weeks agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; 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 EntityStates; using MonoMod.RuntimeDetour; using On.RoR2; using OrographicGambitBaseMod.Modules; using OrographicGambitBaseMod.Modules.Components; using R2API; using R2API.Utils; using RoR2; using RoR2.ConVar; using RoR2.ContentManagement; using RoR2.Projectile; using RoR2.Skills; using UnityEngine; using UnityEngine.Networking; using UnityEngine.Rendering; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: IgnoresAccessChecksTo("0Harmony")] [assembly: IgnoresAccessChecksTo("HGUnityUtils")] [assembly: AssemblyCompany("OrographicGambitBaseMod")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("OrographicGambitBaseMod")] [assembly: AssemblyTitle("OrographicGambitBaseMod")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: UnverifiableCode] internal class BodyInfo { internal string bodyName = ""; internal string bodyNameToken = ""; internal string subtitleNameToken = ""; internal Texture characterPortrait = null; internal GameObject crosshair = null; internal GameObject podPrefab = null; internal float maxHealth = 100f; internal float healthGrowth = 2f; internal float healthRegen = 0f; internal float shield = 0f; internal float shieldGrowth = 0f; internal float moveSpeed = 7f; internal float moveSpeedGrowth = 0f; internal float acceleration = 80f; internal float jumpPower = 15f; internal float jumpPowerGrowth = 0f; internal float damage = 12f; internal float attackSpeed = 1f; internal float attackSpeedGrowth = 0f; internal float armor = 0f; internal float armorGrowth = 0f; internal float crit = 1f; internal float critGrowth = 0f; internal int jumpCount = 1; internal Color bodyColor = Color.grey; } internal class CustomRendererInfo { internal string childName; internal Material material; internal bool ignoreOverlays; } internal class SkillDefInfo { public string skillName; public string skillNameToken; public string skillDescriptionToken; public Sprite skillIcon; public SerializableEntityStateType activationState; public string activationStateMachineName; public int baseMaxStock; public float baseRechargeInterval; public bool beginSkillCooldownOnSkillEnd; public bool canceledFromSprinting; public bool forceSprintDuringState; public bool fullRestockOnAssign; public InterruptPriority interruptPriority; public bool resetCooldownTimerOnUse; public bool isCombatSkill; public bool mustKeyPress; public bool cancelSprintingOnActivation; public int rechargeStock; public int requiredStock; public int stockToConsume; public string[] keywordTokens; } namespace OrographicGambitBaseMod { [BepInDependency(/*Could not decode attribute arguments.*/)] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.JavAngle.OrographicGambitBaseMod", "OrographicGambitBaseMod", "1.0.2")] [R2APISubmoduleDependency(new string[] { "PrefabAPI", "LanguageAPI", "SoundAPI", "NetworkingAPI", "ItemAPI", "DamageAPI" })] public class OrographicGambitBasePlugin : BaseUnityPlugin { public const string MODUID = "com.JavAngle.OrographicGambitBaseMod"; public const string MODNAME = "OrographicGambitBaseMod"; public const string MODVERSION = "1.0.2"; public const string developerPrefix = "JAVANGLE"; public static bool scepterInstalled; public static bool scrollableLobbyInstalled; public static bool RiskOfOptionsInstalled; public static bool EmotesAPIInstalled; public static bool KKArenaInstalled; public static OrographicGambitBasePlugin instance; private void Awake() { //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Expected O, but got Unknown //IL_0136: 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_0156: 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) instance = this; if (Chainloader.PluginInfos.ContainsKey("com.DestroyedClone.AncientScepter")) { scepterInstalled = true; } if (Chainloader.PluginInfos.ContainsKey("com.KingEnderBrine.ScrollableLobbyUI")) { scrollableLobbyInstalled = true; } if (Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions")) { RiskOfOptionsInstalled = true; } if (Chainloader.PluginInfos.ContainsKey("com.weliveinasociety.CustomEmotesAPI")) { EmotesAPIInstalled = true; } if (Chainloader.PluginInfos.ContainsKey("com.Kingpinush.KingKombatArena")) { KKArenaInstalled = true; } Assets.PopulateAssets(); Config.ReadConfig(); States.RegisterStates(); Buffs.RegisterBuffs(); Projectiles.RegisterProjectiles(); Tokens.AddTokens(); ContentManager.collectContentPackProviders += new CollectContentPackProvidersDelegate(ContentManager_collectContentPackProviders); if (Config.internalFloatValueMSX.Value > 100f) { Config.internalFloatValueMSX.Value = 100f; } if (Config.internalFloatValueSFX.Value > 100f) { Config.internalFloatValueSFX.Value = 100f; } VolumeController.ActualMSX = Config.internalFloatValueMSX.Value; VolumeController.ActualSFX = Config.internalFloatValueSFX.Value; AkSoundEngine.SetRTPCValue("Volume_MSX", VolumeController.ActualMSX); AkSoundEngine.SetRTPCValue("Volume_SFX", VolumeController.ActualSFX); AkSoundEngine.SetRTPCValue("Volume_Global_SFX", VolumeController.ActualSFX); AkSoundEngine.SetRTPCValue("Volume_Limit_SFX", VolumeController.ActualSFX); Hook(); } private void ContentManager_collectContentPackProviders(AddContentPackProviderDelegate addContentPackProvider) { addContentPackProvider.Invoke((IContentPackProvider)(object)new ContentPacks()); } private void Start() { } private void Hook() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown CharacterBody.RecalculateStats += new hook_RecalculateStats(CharacterBody_RecalculateStats); CharacterBody.OnBuffFinalStackLost += new hook_OnBuffFinalStackLost(CharacterBody_OnBuffFinalStackLost); VolumeConVar.SetString += new hook_SetString(VolumeConVar_SetString); HealthComponent.TakeDamage += new hook_TakeDamage(HealthComponent_TakeDamage); } private void CharacterBody_RecalculateStats(orig_RecalculateStats orig, CharacterBody self) { orig.Invoke(self); if (Object.op_Implicit((Object)(object)self)) { if (self.HasBuff(Buffs.GenericArmorPlus)) { self.armor += 0.5f * (float)self.GetBuffCount(Buffs.GenericArmorPlus); } if (self.HasBuff(Buffs.GenericArmorMinus)) { self.armor -= 0.5f * (float)self.GetBuffCount(Buffs.GenericArmorMinus); } if (self.HasBuff(Buffs.GenericASPlus)) { self.attackSpeed *= 1f + 0.02f * (float)self.GetBuffCount(Buffs.GenericASPlus); } if (self.HasBuff(Buffs.GenericASMinus)) { self.attackSpeed *= 1f - 0.01f * (float)self.GetBuffCount(Buffs.GenericASMinus); } if (self.HasBuff(Buffs.GenericDamagePlus)) { self.damage *= 1f + 0.02f * (float)self.GetBuffCount(Buffs.GenericDamagePlus); } if (self.HasBuff(Buffs.GenericDamageMinus)) { self.damage *= 1f - 0.01f * (float)self.GetBuffCount(Buffs.GenericDamageMinus); } if (self.HasBuff(Buffs.GenericMSPlus)) { self.moveSpeed *= 1f + 0.02f * (float)self.GetBuffCount(Buffs.GenericMSPlus); } if (self.HasBuff(Buffs.GenericMSMinus)) { self.moveSpeed *= 1f - 0.01f * (float)self.GetBuffCount(Buffs.GenericMSMinus); } if (self.HasBuff(Buffs.GenericRegenPlus)) { self.regen += self.baseRegen * (1f + 0.06f * (float)self.GetBuffCount(Buffs.GenericRegenPlus)); } if (self.HasBuff(Buffs.GenericRegenMinus)) { self.regen -= self.baseRegen * (1f + 0.03f * (float)self.GetBuffCount(Buffs.GenericRegenMinus)); } } } private void HealthComponent_TakeDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo info) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, info); if (self.alive && DamageAPI.HasModdedDamageType(info, Buffs.Blind15s)) { self.body.AddTimedBuff(Buffs.Blinded, 15f); } } private void VolumeConVar_SetString(orig_SetString orig, BaseConVar self, string newValue) { //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, newValue); if (Reflection.GetFieldValue<string>((object)self, "rtpcName") == "Volume_MSX") { VolumeController.ActualMSX = float.Parse(newValue, CultureInfo.InvariantCulture); Config.internalFloatValueMSX.Value = float.Parse(newValue, CultureInfo.InvariantCulture); } if (Reflection.GetFieldValue<string>((object)self, "rtpcName") == "Volume_SFX") { VolumeController.ActualSFX = float.Parse(newValue, CultureInfo.InvariantCulture); Config.internalFloatValueSFX.Value = float.Parse(newValue, CultureInfo.InvariantCulture); AkSoundEngine.SetRTPCValue("Volume_Global_SFX", float.Parse(newValue, CultureInfo.InvariantCulture)); AkSoundEngine.SetRTPCValue("Volume_Limit_SFX", float.Parse(newValue, CultureInfo.InvariantCulture)); } } private void CharacterBody_OnBuffFinalStackLost(orig_OnBuffFinalStackLost orig, CharacterBody self, BuffDef buffDef) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //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_0033: 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) orig.Invoke(self, buffDef); if ((Object)(object)buffDef == (Object)(object)Buffs.Polymorphed) { Vector3 val = self.master.CalculateSafeGroundPosition(self.footPosition, self); self.master.Respawn(val, self.transform.rotation, false); } } } } namespace OrographicGambitBaseMod.Modules { internal static class Assets { internal static AssetBundle mainAssetBundle; internal static GameObject trackerPrefab; internal static GameObject trackerAllyPrefab; internal static GameObject trackerSubPrefab; internal static List<NetworkSoundEventDef> networkSoundEventDefs = new List<NetworkSoundEventDef>(); internal static List<EffectDef> effectDefs = new List<EffectDef>(); public static Shader hotpoo = LegacyResourcesAPI.Load<Shader>("Shaders/Deferred/HGStandard"); public static Material commandoMat; internal static void PopulateAssets() { if ((Object)(object)mainAssetBundle == (Object)null) { using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("OrographicGambitBaseMod.ogbaseassetsjavangle")) { mainAssetBundle = AssetBundle.LoadFromStream(stream); } } } internal static NetworkSoundEventDef CreateNetworkSoundEventDef(string eventName) { NetworkSoundEventDef val = ScriptableObject.CreateInstance<NetworkSoundEventDef>(); val.akId = AkSoundEngine.GetIDFromString(eventName); val.eventName = eventName; networkSoundEventDefs.Add(val); return val; } internal static void ConvertAllRenderersToHopooShader(GameObject objectToConvert) { MeshRenderer[] componentsInChildren = objectToConvert.GetComponentsInChildren<MeshRenderer>(); foreach (MeshRenderer val in componentsInChildren) { if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)((Renderer)val).material)) { ((Renderer)val).material.shader = hotpoo; ((Renderer)val).material = CreateMaterial("MystMat", 5f); } } SkinnedMeshRenderer[] componentsInChildren2 = objectToConvert.GetComponentsInChildren<SkinnedMeshRenderer>(); foreach (SkinnedMeshRenderer val2 in componentsInChildren2) { if (Object.op_Implicit((Object)(object)val2) && Object.op_Implicit((Object)(object)((Renderer)val2).material)) { ((Renderer)val2).material.shader = hotpoo; ((Renderer)val2).material = CreateMaterial("MystMat", 5f); } } } internal static RendererInfo[] SetupRendererInfos(GameObject obj) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0049: 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) MeshRenderer[] componentsInChildren = obj.GetComponentsInChildren<MeshRenderer>(); RendererInfo[] array = (RendererInfo[])(object)new RendererInfo[componentsInChildren.Length]; for (int i = 0; i < componentsInChildren.Length; i++) { array[i] = new RendererInfo { defaultMaterial = ((Renderer)componentsInChildren[i]).material, renderer = (Renderer)(object)componentsInChildren[i], defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = false }; } return array; } internal static Texture LoadCharacterIcon(string characterName) { return mainAssetBundle.LoadAsset<Texture>("tex" + characterName + "Icon"); } internal static GameObject LoadCrosshair(string crosshairName) { return LegacyResourcesAPI.Load<GameObject>("Prefabs/Crosshair/" + crosshairName + "Crosshair"); } private static GameObject LoadEffect(string resourceName, string soundName = "", bool parentToTransform = false, float effectDuration = 20f) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) GameObject val = mainAssetBundle.LoadAsset<GameObject>(resourceName); val.AddComponent<DestroyOnTimer>().duration = effectDuration; val.AddComponent<NetworkIdentity>(); val.AddComponent<VFXAttributes>().vfxPriority = (VFXPriority)2; EffectComponent val2 = val.AddComponent<EffectComponent>(); val2.applyScale = false; val2.effectIndex = (EffectIndex)(-1); val2.parentToReferencedTransform = parentToTransform; val2.positionAtReferencedTransform = true; val2.soundName = soundName; AddNewEffectDef(val, soundName); return val; } private static void AddNewEffectDef(GameObject effectPrefab, string soundName = "") { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown EffectDef val = new EffectDef(); val.prefab = effectPrefab; val.prefabEffectComponent = effectPrefab.GetComponent<EffectComponent>(); val.prefabName = ((Object)effectPrefab).name; val.prefabVfxAttributes = effectPrefab.GetComponent<VFXAttributes>(); val.spawnSoundEventName = soundName; effectDefs.Add(val); } public static Material CreateMaterial(string materialName, float emission, Color emissionColor, float normalStrength = 0f) { //IL_0077: 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) if (!Object.op_Implicit((Object)(object)commandoMat)) { commandoMat = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/CommandoBody").GetComponentInChildren<CharacterModel>().baseRendererInfos[0].defaultMaterial; } Material val = Object.Instantiate<Material>(commandoMat); Material val2 = mainAssetBundle.LoadAsset<Material>(materialName); if (!Object.op_Implicit((Object)(object)val2)) { return commandoMat; } ((Object)val).name = materialName; val.SetColor("_Color", val2.GetColor("_Color")); val.SetTexture("_MainTex", val2.GetTexture("_MainTex")); val.SetColor("_EmColor", emissionColor); val.SetFloat("_EmPower", emission); val.SetTexture("_EmTex", val2.GetTexture("_EmissionMap")); val.SetFloat("_NormalStrength", normalStrength); return val; } public static Material CreateMaterial(string materialName, float emission = 0f) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) return CreateMaterial(materialName, emission, Color.white); } } public static class Buffs { public static BuffDef GenericASPlus; public static BuffDef GenericASMinus; public static BuffDef GenericDamagePlus; public static BuffDef GenericDamageMinus; public static BuffDef GenericMSPlus; public static BuffDef GenericMSMinus; public static BuffDef GenericArmorPlus; public static BuffDef GenericArmorMinus; public static BuffDef GenericRegenPlus; public static BuffDef GenericRegenMinus; public static BuffDef Polymorphed; internal static List<BuffDef> buffDefs = new List<BuffDef>(); public static ModdedDamageType Blind15s; internal static void RegisterBuffs() { //IL_0015: 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_005f: 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_00a9: 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_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0187: 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_019d: Unknown result type (might be due to invalid IL or missing references) GenericASPlus = AddNewBuff("GenericASPlus", Assets.mainAssetBundle.LoadAsset<Sprite>("RandoASpeedIcon"), Color.red, canStack: true, isDebuff: false); GenericASMinus = AddNewBuff("GenericASMinus", Assets.mainAssetBundle.LoadAsset<Sprite>("RandoASpeedIcon"), Color.magenta, canStack: true, isDebuff: false); GenericDamagePlus = AddNewBuff("GenericDamagePlus", Assets.mainAssetBundle.LoadAsset<Sprite>("RandoDamageIcon"), Color.red, canStack: true, isDebuff: false); GenericDamageMinus = AddNewBuff("GenericDamageMinus", Assets.mainAssetBundle.LoadAsset<Sprite>("RandoDamageIcon"), Color.magenta, canStack: true, isDebuff: false); GenericMSPlus = AddNewBuff("GenericMSPlus", Assets.mainAssetBundle.LoadAsset<Sprite>("RandoMSpeedIcon"), Color.red, canStack: true, isDebuff: false); GenericMSMinus = AddNewBuff("GenericMSMinus", Assets.mainAssetBundle.LoadAsset<Sprite>("RandoMSpeedIcon"), Color.magenta, canStack: true, isDebuff: false); GenericArmorPlus = AddNewBuff("GenericArmorPlus", Assets.mainAssetBundle.LoadAsset<Sprite>("RandoArmorIcon"), Color.red, canStack: true, isDebuff: false); GenericArmorMinus = AddNewBuff("GenericArmorMinus", Assets.mainAssetBundle.LoadAsset<Sprite>("RandoArmorIcon"), Color.magenta, canStack: true, isDebuff: false); GenericRegenPlus = AddNewBuff("GenericRegenPlus", Assets.mainAssetBundle.LoadAsset<Sprite>("RandoRegenIcon"), Color.red, canStack: true, isDebuff: false); GenericRegenMinus = AddNewBuff("GenericRegenMinus", Assets.mainAssetBundle.LoadAsset<Sprite>("RandoRegenIcon"), Color.magenta, canStack: true, isDebuff: false); Polymorphed = AddNewBuff("Polymorphed", Assets.mainAssetBundle.LoadAsset<Sprite>("Polymorphed"), Color.white, canStack: false, isDebuff: false); Blind15s = DamageAPI.ReserveDamageType(); } internal static BuffDef AddNewBuff(string buffName, Sprite buffIcon, Color buffColor, bool canStack, bool isDebuff) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) BuffDef val = ScriptableObject.CreateInstance<BuffDef>(); ((Object)val).name = buffName; val.buffColor = buffColor; val.canStack = canStack; val.isDebuff = isDebuff; val.eliteDef = null; val.iconSprite = buffIcon; buffDefs.Add(val); return val; } } public static class Config { public static ConfigEntry<float> internalFloatValueMSX; public static ConfigEntry<float> internalFloatValueSFX; public static void ReadConfig() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Expected O, but got Unknown //IL_0034: Expected O, but got Unknown //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown //IL_006c: Expected O, but got Unknown internalFloatValueMSX = ((BaseUnityPlugin)OrographicGambitBasePlugin.instance).Config.Bind<float>(new ConfigDefinition("internal", "internalFloatValue1"), 99999f, new ConfigDescription("Don't touch this, everything that is supposed to be configured in this mod can be configured in-game with the RiskOfOptions mod", (AcceptableValueBase)null, Array.Empty<object>())); internalFloatValueSFX = ((BaseUnityPlugin)OrographicGambitBasePlugin.instance).Config.Bind<float>(new ConfigDefinition("internal", "internalFloatValue2"), 99999f, new ConfigDescription("Don't touch this, everything that is supposed to be configured in this mod can be configured in-game with the RiskOfOptions mod2", (AcceptableValueBase)null, Array.Empty<object>())); } } internal class ContentPacks : IContentPackProvider { private static ContentPack contentPack = new ContentPack(); public string identifier => "OrographicGambitBase.OrographicGambitBaseContent"; public IEnumerator FinalizeAsync(FinalizeAsyncArgs args) { args.ReportProgress(1f); yield break; } public IEnumerator GenerateContentPackAsync(GetContentPackAsyncArgs args) { ContentPack.Copy(contentPack, args.output); yield break; } public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args) { contentPack.bodyPrefabs.Add(Prefabs.bodyPrefabs.ToArray()); contentPack.buffDefs.Add(Buffs.buffDefs.ToArray()); contentPack.effectDefs.Add(Assets.effectDefs.ToArray()); contentPack.entityStateTypes.Add(States.entityStates.ToArray()); contentPack.masterPrefabs.Add(Prefabs.masterPrefabs.ToArray()); contentPack.networkSoundEventDefs.Add(Assets.networkSoundEventDefs.ToArray()); contentPack.projectilePrefabs.Add(Prefabs.projectilePrefabs.ToArray()); contentPack.skillDefs.Add(Skills.skillDefs.ToArray()); contentPack.skillFamilies.Add(Skills.skillFamilies.ToArray()); contentPack.survivorDefs.Add(Prefabs.survivorDefinitions.ToArray()); args.ReportProgress(1f); yield break; } internal void CreateContentPack() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown contentPack = new ContentPack(); contentPack.bodyPrefabs.Add(Prefabs.bodyPrefabs.ToArray()); contentPack.buffDefs.Add(Buffs.buffDefs.ToArray()); contentPack.effectDefs.Add(Assets.effectDefs.ToArray()); contentPack.entityStateTypes.Add(States.entityStates.ToArray()); contentPack.masterPrefabs.Add(Prefabs.masterPrefabs.ToArray()); contentPack.networkSoundEventDefs.Add(Assets.networkSoundEventDefs.ToArray()); contentPack.projectilePrefabs.Add(Prefabs.projectilePrefabs.ToArray()); contentPack.skillDefs.Add(Skills.skillDefs.ToArray()); contentPack.skillFamilies.Add(Skills.skillFamilies.ToArray()); contentPack.survivorDefs.Add(Prefabs.survivorDefinitions.ToArray()); } } internal static class Helpers { internal const string agilePrefix = "<style=cIsUtility>Agile.</style> "; internal static string ScepterDescription(string desc) { return "\n<color=#d299ff>SCEPTER: " + desc + "</color>"; } public static T[] Append<T>(ref T[] array, List<T> list) { int num = array.Length; int count = list.Count; Array.Resize(ref array, num + count); list.CopyTo(array, num); return array; } public static Func<T[], T[]> AppendDel<T>(List<T> list) { return (T[] r) => Append(ref r, list); } } internal static class ArrayHelper { public static T[] Append<T>(ref T[] array, List<T> list) { int num = array.Length; int count = list.Count; Array.Resize(ref array, num + count); list.CopyTo(array, num); return array; } public static Func<T[], T[]> AppendDel<T>(List<T> list) { return (T[] r) => Append(ref r, list); } } internal static class Prefabs { private static PhysicMaterial ragdollMaterial; internal static List<SurvivorDef> survivorDefinitions = new List<SurvivorDef>(); internal static List<GameObject> bodyPrefabs = new List<GameObject>(); internal static List<GameObject> masterPrefabs = new List<GameObject>(); internal static List<GameObject> projectilePrefabs = new List<GameObject>(); internal static void RegisterNewSurvivor(GameObject bodyPrefab, GameObject displayPrefab, Color charColor, string namePrefix, UnlockableDef unlockableDef) { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) string displayNameToken = "JAVANGLE_" + namePrefix + "_BODY_NAME"; string descriptionToken = "JAVANGLE_" + namePrefix + "_BODY_DESCRIPTION"; string outroFlavorToken = "JAVANGLE_" + namePrefix + "_BODY_OUTRO_FLAVOR"; string mainEndingEscapeFailureFlavorToken = "JAVANGLE_" + namePrefix + "_BODY_OUTRO_FAILURE"; SurvivorDef val = ScriptableObject.CreateInstance<SurvivorDef>(); val.bodyPrefab = bodyPrefab; val.displayPrefab = displayPrefab; val.primaryColor = charColor; val.displayNameToken = displayNameToken; val.descriptionToken = descriptionToken; val.outroFlavorToken = outroFlavorToken; val.mainEndingEscapeFailureFlavorToken = mainEndingEscapeFailureFlavorToken; val.desiredSortPosition = 15.000001f; val.unlockableDef = unlockableDef; val.cachedName = ((Object)bodyPrefab).name.Replace("Body", ""); survivorDefinitions.Add(val); } internal static void RegisterNewSurvivor(GameObject bodyPrefab, GameObject displayPrefab, Color charColor, string namePrefix) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) RegisterNewSurvivor(bodyPrefab, displayPrefab, charColor, namePrefix, null); } internal static GameObject CreateDisplayPrefab(string modelName, GameObject prefab) { GameObject val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/CommandoBody"), modelName + "Prefab"); GameObject val2 = CreateModel(val, modelName); Transform val3 = SetupModel(val, val2.transform); val2.AddComponent<CharacterModel>().baseRendererInfos = prefab.GetComponentInChildren<CharacterModel>().baseRendererInfos; Assets.ConvertAllRenderersToHopooShader(val2); return val2.gameObject; } internal static GameObject CreatePrefab(string bodyName, string modelName, BodyInfo bodyInfo) { //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) GameObject val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/CommandoBody"), bodyName); GameObject val2 = CreateModel(val, modelName); Transform val3 = SetupModel(val, val2.transform); CharacterBody component = val.GetComponent<CharacterBody>(); ((Object)component).name = bodyInfo.bodyName; component.baseNameToken = bodyInfo.bodyNameToken; component.subtitleNameToken = bodyInfo.subtitleNameToken; component.portraitIcon = bodyInfo.characterPortrait; component._defaultCrosshairPrefab = bodyInfo.crosshair; component.bodyFlags = (BodyFlags)16; component.rootMotionInMainState = false; component.baseMaxHealth = bodyInfo.maxHealth; component.levelMaxHealth = bodyInfo.healthGrowth; component.baseRegen = bodyInfo.healthRegen; component.levelRegen = component.baseRegen * 0.2f; component.baseMaxShield = bodyInfo.shield; component.levelMaxShield = bodyInfo.shieldGrowth; component.baseMoveSpeed = bodyInfo.moveSpeed; component.levelMoveSpeed = bodyInfo.moveSpeedGrowth; component.baseAcceleration = bodyInfo.acceleration; component.baseJumpPower = bodyInfo.jumpPower; component.levelJumpPower = bodyInfo.jumpPowerGrowth; component.baseDamage = bodyInfo.damage; component.levelDamage = component.baseDamage * 0.2f; component.baseAttackSpeed = bodyInfo.attackSpeed; component.levelAttackSpeed = bodyInfo.attackSpeedGrowth; component.baseArmor = bodyInfo.armor; component.levelArmor = bodyInfo.armorGrowth; component.baseCrit = bodyInfo.crit; component.levelCrit = bodyInfo.critGrowth; component.baseJumpCount = bodyInfo.jumpCount; component.sprintingSpeedMultiplier = 1.45f; component.hideCrosshair = false; component.aimOriginTransform = val3.Find("AimOrigin"); component.hullClassification = (HullClassification)0; component.preferredPodPrefab = bodyInfo.podPrefab; component.isChampion = false; component.bodyColor = bodyInfo.bodyColor; SetupCharacterDirection(val, val3, val2.transform); SetupCameraTargetParams(val); SetupModelLocator(val, val3, val2.transform); SetupRigidbody(val); SetupCapsuleCollider(val); SetupMainHurtbox(val, val2); SetupFootstepController(val2); SetupRagdoll(val2); SetupAimAnimator(val, val2); bodyPrefabs.Add(val); return val; } internal static void CreateGenericDoppelganger(GameObject bodyPrefab, string masterName, string masterToCopy) { GameObject val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterMasters/" + masterToCopy + "Master"), masterName, true); val.GetComponent<CharacterMaster>().bodyPrefab = bodyPrefab; masterPrefabs.Add(val); } private static Transform SetupModel(GameObject prefab, Transform modelTransform) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Expected O, but got Unknown //IL_00a1: 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_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Expected O, but got Unknown //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("ModelBase"); val.transform.parent = prefab.transform; val.transform.localPosition = new Vector3(0f, -0.92f, 0f); val.transform.localRotation = Quaternion.identity; val.transform.localScale = new Vector3(1f, 1f, 1f); GameObject val2 = new GameObject("CameraPivot"); val2.transform.parent = val.transform; val2.transform.localPosition = new Vector3(0f, 1.6f, 0f); val2.transform.localRotation = Quaternion.identity; val2.transform.localScale = Vector3.one; GameObject val3 = new GameObject("AimOrigin"); val3.transform.parent = val.transform; val3.transform.localPosition = new Vector3(0f, 1.8f, 0f); val3.transform.localRotation = Quaternion.identity; val3.transform.localScale = Vector3.one; prefab.GetComponent<CharacterBody>().aimOriginTransform = val3.transform; modelTransform.parent = val.transform; modelTransform.localPosition = Vector3.zero; modelTransform.localRotation = Quaternion.identity; return val.transform; } private static GameObject CreateModel(GameObject main, string modelName) { Object.DestroyImmediate((Object)(object)((Component)main.transform.Find("ModelBase")).gameObject); Object.DestroyImmediate((Object)(object)((Component)main.transform.Find("CameraPivot")).gameObject); Object.DestroyImmediate((Object)(object)((Component)main.transform.Find("AimOrigin")).gameObject); if ((Object)(object)Assets.mainAssetBundle.LoadAsset<GameObject>(modelName) == (Object)null) { Debug.LogError((object)"Trying to load a null model- check to see if the name in your code matches the name of the object in Unity"); return null; } return Object.Instantiate<GameObject>(Assets.mainAssetBundle.LoadAsset<GameObject>(modelName)); } internal static void SetupCharacterModel(GameObject prefab, CustomRendererInfo[] rendererInfo, int mainRendererIndex) { //IL_0038: 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_007e: Unknown result type (might be due to invalid IL or missing references) CharacterModel val = ((Component)prefab.GetComponent<ModelLocator>().modelTransform).gameObject.AddComponent<CharacterModel>(); ChildLocator component = ((Component)val).GetComponent<ChildLocator>(); val.body = prefab.GetComponent<CharacterBody>(); List<RendererInfo> list = new List<RendererInfo>(); for (int i = 0; i < rendererInfo.Length; i++) { list.Add(new RendererInfo { renderer = ((Component)component.FindChild(rendererInfo[i].childName)).GetComponent<Renderer>(), defaultMaterial = rendererInfo[i].material, ignoreOverlays = rendererInfo[i].ignoreOverlays, defaultShadowCastingMode = (ShadowCastingMode)1 }); } val.baseRendererInfos = list.ToArray(); val.autoPopulateLightInfos = true; val.invisibilityCount = 0; val.temporaryOverlays = new List<TemporaryOverlayInstance>(); val.mainSkinnedMeshRenderer = ((Component)val.baseRendererInfos[mainRendererIndex].renderer).GetComponent<SkinnedMeshRenderer>(); } private static void SetupCharacterDirection(GameObject prefab, Transform modelBaseTransform, Transform modelTransform) { CharacterDirection component = prefab.GetComponent<CharacterDirection>(); component.targetTransform = modelBaseTransform; component.overrideAnimatorForwardTransform = null; component.rootMotionAccumulator = null; component.modelAnimator = ((Component)modelTransform).GetComponent<Animator>(); component.driveFromRootRotation = false; component.turnSpeed = 720f; } private static void SetupCameraTargetParams(GameObject prefab) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) CameraTargetParams component = prefab.GetComponent<CameraTargetParams>(); component.cameraParams = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/MercBody").GetComponent<CameraTargetParams>().cameraParams; component.cameraPivotTransform = prefab.transform.Find("ModelBase").Find("CameraPivot"); component.recoil = Vector2.zero; component.dontRaycastToPivot = false; } private static void SetupModelLocator(GameObject prefab, Transform modelBaseTransform, Transform modelTransform) { ModelLocator component = prefab.GetComponent<ModelLocator>(); component.modelTransform = modelTransform; component.modelBaseTransform = modelBaseTransform; } private static void SetupRigidbody(GameObject prefab) { Rigidbody component = prefab.GetComponent<Rigidbody>(); component.mass = 100f; } private static void SetupCapsuleCollider(GameObject prefab) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) CapsuleCollider component = prefab.GetComponent<CapsuleCollider>(); component.center = new Vector3(0f, 0f, 0f); component.radius = 0.5f; component.height = 1.82f; component.direction = 1; } private static void SetupMainHurtbox(GameObject prefab, GameObject model) { //IL_0075: Unknown result type (might be due to invalid IL or missing references) HurtBoxGroup val = model.AddComponent<HurtBoxGroup>(); ChildLocator component = model.GetComponent<ChildLocator>(); if (!Object.op_Implicit((Object)(object)component.FindChild("MainHurtbox"))) { Debug.LogError((object)"Could not set up main hurtbox: make sure you have a transform pair in your prefab's ChildLocator component called 'MainHurtbox'"); return; } HurtBox val2 = ((Component)component.FindChild("MainHurtbox")).gameObject.AddComponent<HurtBox>(); ((Component)val2).gameObject.layer = LayerIndex.entityPrecise.intVal; val2.healthComponent = prefab.GetComponent<HealthComponent>(); val2.isBullseye = true; val2.damageModifier = (DamageModifier)0; val2.hurtBoxGroup = val; val2.indexInGroup = 0; val.hurtBoxes = (HurtBox[])(object)new HurtBox[1] { val2 }; val.mainHurtBox = val2; val.bullseyeCount = 1; } private static void SetupFootstepController(GameObject model) { FootstepHandler val = model.AddComponent<FootstepHandler>(); val.baseFootstepString = "Play_player_footstep"; val.sprintFootstepOverrideString = ""; val.enableFootstepDust = true; val.footstepDustPrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/GenericFootstepDust"); } private static void SetupRagdoll(GameObject model) { RagdollController component = model.GetComponent<RagdollController>(); if (!Object.op_Implicit((Object)(object)component)) { return; } if ((Object)(object)ragdollMaterial == (Object)null) { ragdollMaterial = ((Component)LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/CommandoBody").GetComponentInChildren<RagdollController>().bones[1]).GetComponent<Collider>().material; } Transform[] bones = component.bones; foreach (Transform val in bones) { if (Object.op_Implicit((Object)(object)val)) { ((Component)val).gameObject.layer = LayerIndex.ragdoll.intVal; Collider component2 = ((Component)val).GetComponent<Collider>(); if (Object.op_Implicit((Object)(object)component2)) { component2.material = ragdollMaterial; component2.sharedMaterial = ragdollMaterial; } } } } private static void SetupAimAnimator(GameObject prefab, GameObject model) { AimAnimator val = model.AddComponent<AimAnimator>(); val.directionComponent = prefab.GetComponent<CharacterDirection>(); val.pitchRangeMax = 60f; val.pitchRangeMin = -60f; val.yawRangeMin = -80f; val.yawRangeMax = 80f; val.pitchGiveupRange = 30f; val.yawGiveupRange = 10f; val.giveupDuration = 3f; val.inputBank = prefab.GetComponent<InputBankTest>(); } internal static void SetupHitbox(GameObject prefab, Transform hitboxTransform, string hitboxName) { HitBoxGroup val = prefab.AddComponent<HitBoxGroup>(); HitBox val2 = ((Component)hitboxTransform).gameObject.AddComponent<HitBox>(); ((Component)hitboxTransform).gameObject.layer = LayerIndex.projectile.intVal; val.hitBoxes = (HitBox[])(object)new HitBox[1] { val2 }; val.groupName = hitboxName; } internal static void SetupHitbox(GameObject prefab, string hitboxName, params Transform[] hitboxTransforms) { HitBoxGroup val = prefab.AddComponent<HitBoxGroup>(); List<HitBox> list = new List<HitBox>(); foreach (Transform val2 in hitboxTransforms) { HitBox item = ((Component)val2).gameObject.AddComponent<HitBox>(); ((Component)val2).gameObject.layer = LayerIndex.projectile.intVal; list.Add(item); } val.hitBoxes = list.ToArray(); val.groupName = hitboxName; } } internal static class Projectiles { internal static void RegisterProjectiles() { } private static void InitializeImpactExplosion(ProjectileImpactExplosion projectileImpactExplosion) { //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_0061: 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_00be: Unknown result type (might be due to invalid IL or missing references) ((ProjectileExplosion)projectileImpactExplosion).blastDamageCoefficient = 1f; ((ProjectileExplosion)projectileImpactExplosion).blastProcCoefficient = 1f; ((ProjectileExplosion)projectileImpactExplosion).blastRadius = 1f; ((ProjectileExplosion)projectileImpactExplosion).bonusBlastForce = Vector3.zero; ((ProjectileExplosion)projectileImpactExplosion).childrenCount = 0; ((ProjectileExplosion)projectileImpactExplosion).childrenDamageCoefficient = 0f; ((ProjectileExplosion)projectileImpactExplosion).childrenProjectilePrefab = null; projectileImpactExplosion.destroyOnEnemy = false; projectileImpactExplosion.destroyOnWorld = false; ((ProjectileExplosion)projectileImpactExplosion).explosionSoundString = ""; ((ProjectileExplosion)projectileImpactExplosion).falloffModel = (FalloffModel)0; ((ProjectileExplosion)projectileImpactExplosion).fireChildren = false; projectileImpactExplosion.impactEffect = null; projectileImpactExplosion.lifetime = 0f; projectileImpactExplosion.lifetimeAfterImpact = 0f; projectileImpactExplosion.lifetimeExpiredSoundString = ""; projectileImpactExplosion.lifetimeRandomOffset = 0f; projectileImpactExplosion.offsetForLifetimeExpiredSound = 0f; projectileImpactExplosion.timerAfterImpact = false; ((Component)projectileImpactExplosion).GetComponent<ProjectileDamage>().damageType = DamageTypeCombo.op_Implicit((DamageType)0); } private static GameObject CreateGhostPrefab(string ghostName) { GameObject val = Assets.mainAssetBundle.LoadAsset<GameObject>(ghostName); if (!Object.op_Implicit((Object)(object)val.GetComponent<NetworkIdentity>())) { val.AddComponent<NetworkIdentity>(); } if (!Object.op_Implicit((Object)(object)val.GetComponent<ProjectileGhostController>())) { val.AddComponent<ProjectileGhostController>(); } Assets.ConvertAllRenderersToHopooShader(val); return val; } private static GameObject CloneProjectilePrefab(string prefabName, string newPrefabName) { return PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load<GameObject>("Prefabs/Projectiles/" + prefabName), newPrefabName); } } internal static class Skills { internal static List<SkillFamily> skillFamilies = new List<SkillFamily>(); internal static List<SkillDef> skillDefs = new List<SkillDef>(); internal static void CreateSkillFamilies(GameObject targetPrefab) { SkillLocator component = targetPrefab.GetComponent<SkillLocator>(); component.primary = targetPrefab.AddComponent<GenericSkill>(); SkillFamily val = ScriptableObject.CreateInstance<SkillFamily>(); ((Object)val).name = ((Object)targetPrefab).name + "PrimaryFamily"; val.variants = (Variant[])(object)new Variant[0]; component.primary._skillFamily = val; component.secondary = targetPrefab.AddComponent<GenericSkill>(); SkillFamily val2 = ScriptableObject.CreateInstance<SkillFamily>(); ((Object)val2).name = ((Object)targetPrefab).name + "SecondaryFamily"; val2.variants = (Variant[])(object)new Variant[0]; component.secondary._skillFamily = val2; component.utility = targetPrefab.AddComponent<GenericSkill>(); SkillFamily val3 = ScriptableObject.CreateInstance<SkillFamily>(); ((Object)val3).name = ((Object)targetPrefab).name + "UtilityFamily"; val3.variants = (Variant[])(object)new Variant[0]; component.utility._skillFamily = val3; component.special = targetPrefab.AddComponent<GenericSkill>(); SkillFamily val4 = ScriptableObject.CreateInstance<SkillFamily>(); ((Object)val4).name = ((Object)targetPrefab).name + "SpecialFamily"; val4.variants = (Variant[])(object)new Variant[0]; component.special._skillFamily = val4; skillFamilies.Add(val); skillFamilies.Add(val2); skillFamilies.Add(val3); skillFamilies.Add(val4); } internal static void AddExtraSkill(GameObject targetPrefab, SkillDef skillDef, SkillFamily skillFamily) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1); Variant[] variants = skillFamily.variants; int num = skillFamily.variants.Length - 1; Variant val = new Variant { skillDef = skillDef }; ((Variant)(ref val)).viewableNode = new Node(skillDef.skillNameToken, false, (Node)null); variants[num] = val; } internal static void AddExtraSkills(GameObject targetPrefab, SkillFamily skillfamily, params SkillDef[] skillDefs) { foreach (SkillDef skillDef in skillDefs) { AddExtraSkill(targetPrefab, skillDef, skillfamily); } } internal static void AddPrimarySkill(GameObject targetPrefab, SkillDef skillDef) { //IL_003c: 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_005e: Expected O, but got Unknown //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) SkillLocator component = targetPrefab.GetComponent<SkillLocator>(); SkillFamily skillFamily = component.primary.skillFamily; Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1); Variant[] variants = skillFamily.variants; int num = skillFamily.variants.Length - 1; Variant val = new Variant { skillDef = skillDef }; ((Variant)(ref val)).viewableNode = new Node(skillDef.skillNameToken, false, (Node)null); variants[num] = val; } internal static void AddSecondarySkill(GameObject targetPrefab, SkillDef skillDef) { //IL_003c: 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_005e: Expected O, but got Unknown //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) SkillLocator component = targetPrefab.GetComponent<SkillLocator>(); SkillFamily skillFamily = component.secondary.skillFamily; Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1); Variant[] variants = skillFamily.variants; int num = skillFamily.variants.Length - 1; Variant val = new Variant { skillDef = skillDef }; ((Variant)(ref val)).viewableNode = new Node(skillDef.skillNameToken, false, (Node)null); variants[num] = val; } internal static void AddSecondarySkills(GameObject targetPrefab, params SkillDef[] skillDefs) { foreach (SkillDef skillDef in skillDefs) { AddSecondarySkill(targetPrefab, skillDef); } } internal static void AddUtilitySkill(GameObject targetPrefab, SkillDef skillDef) { //IL_003c: 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_005e: Expected O, but got Unknown //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) SkillLocator component = targetPrefab.GetComponent<SkillLocator>(); SkillFamily skillFamily = component.utility.skillFamily; Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1); Variant[] variants = skillFamily.variants; int num = skillFamily.variants.Length - 1; Variant val = new Variant { skillDef = skillDef }; ((Variant)(ref val)).viewableNode = new Node(skillDef.skillNameToken, false, (Node)null); variants[num] = val; } internal static void AddUtilitySkills(GameObject targetPrefab, params SkillDef[] skillDefs) { foreach (SkillDef skillDef in skillDefs) { AddUtilitySkill(targetPrefab, skillDef); } } internal static void AddSpecialSkill(GameObject targetPrefab, SkillDef skillDef) { //IL_003c: 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_005e: Expected O, but got Unknown //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) SkillLocator component = targetPrefab.GetComponent<SkillLocator>(); SkillFamily skillFamily = component.special.skillFamily; Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1); Variant[] variants = skillFamily.variants; int num = skillFamily.variants.Length - 1; Variant val = new Variant { skillDef = skillDef }; ((Variant)(ref val)).viewableNode = new Node(skillDef.skillNameToken, false, (Node)null); variants[num] = val; } internal static void AddSpecialSkills(GameObject targetPrefab, params SkillDef[] skillDefs) { foreach (SkillDef skillDef in skillDefs) { AddSpecialSkill(targetPrefab, skillDef); } } internal static SkillDef CreatePrimarySkillDef(SerializableEntityStateType state, string stateMachine, string skillNameToken, string skillDescriptionToken, Sprite skillIcon, bool agile) { //IL_0025: 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_0062: Unknown result type (might be due to invalid IL or missing references) SkillDef val = ScriptableObject.CreateInstance<SkillDef>(); val.skillName = skillNameToken; val.skillNameToken = skillNameToken; val.skillDescriptionToken = skillDescriptionToken; val.icon = skillIcon; val.activationState = state; val.activationStateMachineName = stateMachine; val.baseMaxStock = 1; val.baseRechargeInterval = 0f; val.beginSkillCooldownOnSkillEnd = false; val.canceledFromSprinting = false; val.forceSprintDuringState = false; val.fullRestockOnAssign = true; val.interruptPriority = (InterruptPriority)0; val.resetCooldownTimerOnUse = false; val.isCombatSkill = true; val.mustKeyPress = false; val.cancelSprintingOnActivation = !agile; val.rechargeStock = 1; val.requiredStock = 0; val.stockToConsume = 0; if (agile) { val.keywordTokens = new string[1] { "KEYWORD_AGILE" }; } skillDefs.Add(val); return val; } internal static SkillDef CreateSkillDef(SkillDefInfo skillDefInfo) { //IL_0039: 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_0099: 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) SkillDef val = ScriptableObject.CreateInstance<SkillDef>(); val.skillName = skillDefInfo.skillName; val.skillNameToken = skillDefInfo.skillNameToken; val.skillDescriptionToken = skillDefInfo.skillDescriptionToken; val.icon = skillDefInfo.skillIcon; val.activationState = skillDefInfo.activationState; val.activationStateMachineName = skillDefInfo.activationStateMachineName; val.baseMaxStock = skillDefInfo.baseMaxStock; val.baseRechargeInterval = skillDefInfo.baseRechargeInterval; val.beginSkillCooldownOnSkillEnd = skillDefInfo.beginSkillCooldownOnSkillEnd; val.canceledFromSprinting = skillDefInfo.canceledFromSprinting; val.forceSprintDuringState = skillDefInfo.forceSprintDuringState; val.fullRestockOnAssign = skillDefInfo.fullRestockOnAssign; val.interruptPriority = skillDefInfo.interruptPriority; val.resetCooldownTimerOnUse = skillDefInfo.resetCooldownTimerOnUse; val.isCombatSkill = skillDefInfo.isCombatSkill; val.mustKeyPress = skillDefInfo.mustKeyPress; val.cancelSprintingOnActivation = skillDefInfo.cancelSprintingOnActivation; val.rechargeStock = skillDefInfo.rechargeStock; val.requiredStock = skillDefInfo.requiredStock; val.stockToConsume = skillDefInfo.stockToConsume; val.keywordTokens = skillDefInfo.keywordTokens; skillDefs.Add(val); return val; } } public static class States { private delegate void set_stateTypeDelegate(ref SerializableEntityStateType self, Type value); private delegate void set_typeNameDelegate(ref SerializableEntityStateType self, string value); internal static List<Type> entityStates = new List<Type>(); private static Hook set_stateTypeHook; private static Hook set_typeNameHook; private static readonly BindingFlags allFlags = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic; internal static void RegisterStates() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected O, but got Unknown //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Expected O, but got Unknown Type typeFromHandle = typeof(SerializableEntityStateType); HookConfig val = default(HookConfig); val.Priority = int.MinValue; set_stateTypeHook = new Hook((MethodBase)typeFromHandle.GetMethod("set_stateType", allFlags), (Delegate)new set_stateTypeDelegate(SetStateTypeHook), val); set_typeNameHook = new Hook((MethodBase)typeFromHandle.GetMethod("set_typeName", allFlags), (Delegate)new set_typeNameDelegate(SetTypeName), val); } private static void SetStateTypeHook(this ref SerializableEntityStateType self, Type value) { self._typeName = value.AssemblyQualifiedName; } private static void SetTypeName(this ref SerializableEntityStateType self, string value) { Type typeFromName = GetTypeFromName(value); if (typeFromName != null) { self.SetStateTypeHook(typeFromName); } } private static Type GetTypeFromName(string name) { Type[] stateIndexToType = EntityStateCatalog.stateIndexToType; return Type.GetType(name); } } internal static class Tokens { internal static void AddTokens() { string text = "JAVANGLE_OROGRAPHICGAMBITBASE_"; } } } namespace OrographicGambitBaseMod.Modules.Components { public class PolymorphBuffComponent : MonoBehaviour { public CharacterMaster master; public bool permanent = false; public float buffDuration = 60f; private float timer = 1f; private bool activated = false; private void FixedUpdate() { timer -= Time.fixedDeltaTime; if (!(timer < 0f)) { return; } if (!activated) { activated = true; if (!permanent) { master.GetBody().AddTimedBuff(Buffs.Polymorphed, buffDuration); } else { master.GetBody().AddBuff(Buffs.Polymorphed); } } Object.Destroy((Object)(object)this); } } public class VolumeController : MonoBehaviour { public static float ActualMSX; public static float ActualSFX; public float fadeOutStartTime = 0f; public float fadeOutEndTime = 0f; public float fadeInStartTime = 0f; public float fadeInEndTime = 0f; public float percentageToFadeTo = 0f; public bool fadeMSX = false; public bool fadeSFX = false; private float fixedAge; private void OnDestroy() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) AkSoundEngine.SetRTPCValue("Volume_SFX", ActualSFX); AkSoundEngine.SetRTPCValue("Volume_MSX", ActualMSX); } private void FixedUpdate() { //IL_00a2: 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_0139: 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) fixedAge += Time.fixedDeltaTime; if (fadeSFX) { if (fixedAge < fadeOutEndTime) { AkSoundEngine.SetRTPCValue("Volume_SFX", AnimationCurve.Linear(fadeOutStartTime, ActualSFX, fadeOutEndTime, ActualSFX * percentageToFadeTo).Evaluate(fixedAge)); } else { AkSoundEngine.SetRTPCValue("Volume_SFX", AnimationCurve.Linear(fadeInStartTime, ActualSFX * percentageToFadeTo, fadeInEndTime, ActualSFX).Evaluate(fixedAge)); } } if (fadeMSX) { if (fixedAge < fadeOutEndTime) { AkSoundEngine.SetRTPCValue("Volume_MSX", AnimationCurve.Linear(fadeOutStartTime, ActualMSX, fadeOutEndTime, ActualMSX * percentageToFadeTo).Evaluate(fixedAge)); } else { AkSoundEngine.SetRTPCValue("Volume_MSX", AnimationCurve.Linear(fadeInStartTime, ActualMSX * percentageToFadeTo, fadeInEndTime, ActualMSX).Evaluate(fixedAge)); } } if (fixedAge > fadeInEndTime + 1f) { Object.Destroy((Object)(object)this); } } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { internal IgnoresAccessChecksToAttribute(string assemblyName) { } } }