using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using HarmonyLib; using Severon.PerkMod; using UnityEngine; using UnityEngine.Audio; using UnityEngine.Events; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("ModTest")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("ModTest")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("5216a860-e0eb-41e2-ba19-290bf2caba7f")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] [HarmonyPatch(typeof(CL_AssetManager), "Initialize")] internal static class ChallengePerks { private static Perk _noSpeed; private static Perk _nearlyNoSpeed; private static Perk _brick; private static Perk _rampingSpeed; private static Perk _noClimbing; private static Perk _noJumping; private static Perk _noStamina; private static Perk _foodOnly; private static Perk _helium; private static Perk _oneTap; private static Perk _wizardTime; [HarmonyPostfix] public static void Postfix() { //IL_01e3: Unknown result type (might be due to invalid IL or missing references) WKAssetDatabase val = ScriptableObject.CreateInstance(); val.id = "severonsModPerks"; List list = new List { NoSpeed(), NearlyNoSpeed(), Brick(), RampingSpeed(), NoClimbing(), NoJumping(), NoStamina(), FoodOnly(), Helium(), OneTap(), WizardTime(), GamePerks.TrainedSoldier(), GamePerks.ItemRecycling(), GamePerks.Scavenger(), GamePerks.FloatationDevice(), GamePerks.RunningJump(), GamePerks.AcrobaticLeap(), GamePerks.WallBounce(), GamePerks.MeltingBody(), GamePerks.GluteusMaximus(), GamePerks.GrubTransformation(), GamePerks.CrawlingLigaments(), GamePerks.SubservientInstinct(), GamePerks.RabbitLegs(), GamePerks.HungerMotive(), GamePerks.AgilityBoost(), GamePerks.MetaOverdrive(), GamePerks.Rebartender(), GamePerks.InsectPheromones(), GamePerks.ManicConviction(), GamePerks.YourReward(), GamePerks.TerribleThoughts(), GamePerks.GastricBypass(), GamePerks.adhesiveSkin(), GamePerks.SoulTrade(), GamePerks.SharedTorment(), GamePerks.SemisolidMuscles() }; for (int i = 0; i < list.Count; i++) { Perk val2 = list[i]; val2.spawnPool = (PerkPool)5; val2.tags = new List { "severon" }; } val.perkAssets.AddRange(list); CL_AssetManager.AddNewDatabase(val.id, val); } private static Perk NoSpeed() { //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: 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_00fd: 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_010f: 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) //IL_0125: 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_0133: 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_0143: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Expected O, but got Unknown //IL_0169: Expected O, but got Unknown if ((Object)(object)_noSpeed != (Object)null) { return _noSpeed; } _noSpeed = ScriptableObject.CreateInstance(); ((Object)_noSpeed).hideFlags = (HideFlags)61; _noSpeed.id = "severon_no_speed_perk"; ((Object)_noSpeed).name = "perk_noSpeed"; _noSpeed.title = "No Speed"; _noSpeed.description = "100% Less speed"; _noSpeed.cost = 0; _noSpeed.canStack = true; _noSpeed.stackMax = 100; _noSpeed.useBuff = true; _noSpeed.buffMultiplier = 1f; _noSpeed.multiplierCurve = AnimationCurve.Linear(0f, 1f, 1f, 1f); _noSpeed.modules = new List(); _noSpeed.buff = new BuffContainer { id = "severon_no_speed_buff", desc = "", loseOverTime = false, loseRate = 0f, buffTime = 1f, multiplier = 1f, loseRateEffectedByPerks = false, buffs = new List { new Buff { id = "addSpeed", maxAmount = -1f, amount = -1f } } }; return _noSpeed; } private static Perk NearlyNoSpeed() { //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: 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_00fd: 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_010f: 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) //IL_0125: 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_0133: 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_0143: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Expected O, but got Unknown //IL_0169: Expected O, but got Unknown if ((Object)(object)_nearlyNoSpeed != (Object)null) { return _nearlyNoSpeed; } _nearlyNoSpeed = ScriptableObject.CreateInstance(); ((Object)_nearlyNoSpeed).hideFlags = (HideFlags)61; _nearlyNoSpeed.id = "severon_nearly_no_speed_perk"; ((Object)_nearlyNoSpeed).name = "perk_nearlyNoSpeed"; _nearlyNoSpeed.title = "Nearly No Speed"; _nearlyNoSpeed.description = "99% Less speed"; _nearlyNoSpeed.cost = 0; _nearlyNoSpeed.canStack = true; _nearlyNoSpeed.stackMax = 100; _nearlyNoSpeed.useBuff = true; _nearlyNoSpeed.buffMultiplier = 1f; _nearlyNoSpeed.multiplierCurve = AnimationCurve.Linear(0f, 1f, 1f, 1f); _nearlyNoSpeed.modules = new List(); _nearlyNoSpeed.buff = new BuffContainer { id = "severon_nearly_no_speed_buff", desc = "", loseOverTime = false, loseRate = 0f, buffTime = 1f, multiplier = 1f, loseRateEffectedByPerks = false, buffs = new List { new Buff { id = "addSpeed", maxAmount = -0.99f, amount = -0.99f } } }; return _nearlyNoSpeed; } private static Perk Brick() { //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Expected O, but got Unknown if ((Object)(object)_brick != (Object)null) { return _brick; } _brick = ScriptableObject.CreateInstance(); ((Object)_brick).hideFlags = (HideFlags)61; _brick.id = "severon_bricked_perk"; ((Object)_brick).name = "perk_brick"; _brick.title = "Brick"; _brick.description = "Brick"; _brick.cost = 0; _brick.canStack = false; _brick.stackMax = 1; _brick.useBuff = false; _brick.buffMultiplier = 0f; _brick.multiplierCurve = AnimationCurve.Linear(0f, 1f, 1f, 1f); _brick.modules = new List(); _brick.buff = new BuffContainer(); return _brick; } private static Perk RampingSpeed() { //IL_00b7: 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_00be: 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_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: 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_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Expected O, but got Unknown //IL_0103: 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_0113: 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_0125: 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) //IL_013b: 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_014d: 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_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Expected O, but got Unknown //IL_0183: Expected O, but got Unknown if ((Object)(object)_rampingSpeed != (Object)null) { return _rampingSpeed; } _rampingSpeed = ScriptableObject.CreateInstance(); ((Object)_rampingSpeed).hideFlags = (HideFlags)61; _rampingSpeed.id = "severon_ramping_speed_perk"; ((Object)_rampingSpeed).name = "perk_rampingSpeed"; _rampingSpeed.title = "Ramping Speed"; _rampingSpeed.description = "Speed builds up while running."; _rampingSpeed.cost = 0; _rampingSpeed.canStack = true; _rampingSpeed.stackMax = 1000; _rampingSpeed.multiplierCurve = AnimationCurve.Linear(0f, 1f, 1f, 1f); PerkModule_PlayerStates val = new PerkModule_PlayerStates { playerState = (PlayerState)3, buffMultiplier = 1f, buffChangeRate = 0.1f, buffRaiseRateMult = 0.1f, buffLowerRateMult = 100f, persistTime = 0f, useHandEffectModule = false }; val.buff = new BuffContainer { id = "severon_ramping_speed_buff", desc = "Ramping Speed Modifier", loseOverTime = false, loseRate = 0f, buffTime = 1f, multiplier = 0f, buffs = new List { new Buff { id = "addSpeed", maxAmount = 300f, amount = 0f } } }; _rampingSpeed.modules = new List { (PerkModule)(object)val }; return _rampingSpeed; } private static Perk NoClimbing() { //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: 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_00fd: 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_010f: 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) //IL_0125: 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_0133: 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_0143: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Expected O, but got Unknown //IL_0169: Expected O, but got Unknown if ((Object)(object)_noClimbing != (Object)null) { return _noClimbing; } _noClimbing = ScriptableObject.CreateInstance(); ((Object)_noClimbing).hideFlags = (HideFlags)61; _noClimbing.id = "severon_no_climbing_perk"; ((Object)_noClimbing).name = "perk_noClimbing"; _noClimbing.title = "No Climbing"; _noClimbing.description = "100% Less climb speed"; _noClimbing.cost = 0; _noClimbing.canStack = true; _noClimbing.stackMax = 100; _noClimbing.useBuff = true; _noClimbing.buffMultiplier = 1f; _noClimbing.multiplierCurve = AnimationCurve.Linear(0f, 1f, 1f, 1f); _noClimbing.modules = new List(); _noClimbing.buff = new BuffContainer { id = "severon_no_climbing_buff", desc = "", loseOverTime = false, loseRate = 0f, buffTime = 1f, multiplier = 1f, loseRateEffectedByPerks = false, buffs = new List { new Buff { id = "addClimb", maxAmount = -1f, amount = -1f } } }; return _noClimbing; } private static Perk NoJumping() { //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: 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_00fd: 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_010f: 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) //IL_0125: 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_0133: 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_0143: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Expected O, but got Unknown //IL_0169: Expected O, but got Unknown if ((Object)(object)_noJumping != (Object)null) { return _noJumping; } _noJumping = ScriptableObject.CreateInstance(); ((Object)_noJumping).hideFlags = (HideFlags)61; _noJumping.id = "severon_no_jumping_perk"; ((Object)_noJumping).name = "perk_noJumping"; _noJumping.title = "No Jumping"; _noJumping.description = "100% Less jump height"; _noJumping.cost = 0; _noJumping.canStack = true; _noJumping.stackMax = 100; _noJumping.useBuff = true; _noJumping.buffMultiplier = 1f; _noJumping.multiplierCurve = AnimationCurve.Linear(0f, 1f, 1f, 1f); _noJumping.modules = new List(); _noJumping.buff = new BuffContainer { id = "severon_no_jumping_buff", desc = "", loseOverTime = false, loseRate = 0f, buffTime = 1f, multiplier = 1f, loseRateEffectedByPerks = false, buffs = new List { new Buff { id = "addJump", maxAmount = -1f, amount = -1f } } }; return _noJumping; } private static Perk NoStamina() { //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: 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_00fd: 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_010f: 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) //IL_0125: 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_0133: 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_0143: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Expected O, but got Unknown //IL_0169: Expected O, but got Unknown if ((Object)(object)_noStamina != (Object)null) { return _noStamina; } _noStamina = ScriptableObject.CreateInstance(); ((Object)_noStamina).hideFlags = (HideFlags)61; _noStamina.id = "severon_no_stamina_perk"; ((Object)_noStamina).name = "perk_noStamina"; _noStamina.title = "No Stamina"; _noStamina.description = "100% Less max stamina"; _noStamina.cost = 0; _noStamina.canStack = true; _noStamina.stackMax = 100; _noStamina.useBuff = true; _noStamina.buffMultiplier = 1f; _noStamina.multiplierCurve = AnimationCurve.Linear(0f, 1f, 1f, 1f); _noStamina.modules = new List(); _noStamina.buff = new BuffContainer { id = "severon_no_stamina_buff", desc = "", loseOverTime = false, loseRate = 0f, buffTime = 1f, multiplier = 1f, loseRateEffectedByPerks = false, buffs = new List { new Buff { id = "addStamina", maxAmount = -1f, amount = -1f } } }; return _noStamina; } private static Perk FoodOnly() { //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: 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_00fd: 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_010f: 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) //IL_0125: 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_0133: 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_0143: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Expected O, but got Unknown //IL_0169: Expected O, but got Unknown if ((Object)(object)_foodOnly != (Object)null) { return _foodOnly; } _foodOnly = ScriptableObject.CreateInstance(); ((Object)_foodOnly).hideFlags = (HideFlags)61; _foodOnly.id = "severon_food_only_perk"; ((Object)_foodOnly).name = "perk_foodOnly"; _foodOnly.title = "Food Only"; _foodOnly.description = "No natural stamina regeneration"; _foodOnly.cost = 0; _foodOnly.canStack = true; _foodOnly.stackMax = 100; _foodOnly.useBuff = true; _foodOnly.buffMultiplier = 1f; _foodOnly.multiplierCurve = AnimationCurve.Linear(0f, 1f, 1f, 1f); _foodOnly.modules = new List(); _foodOnly.buff = new BuffContainer { id = "severon_food_only_buff", desc = "", loseOverTime = false, loseRate = 0f, buffTime = 1f, multiplier = 1f, loseRateEffectedByPerks = false, buffs = new List { new Buff { id = "addStaminaRegen", maxAmount = -1f, amount = -1f } } }; return _foodOnly; } private static Perk Helium() { //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: 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_00fd: 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_010f: 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) //IL_0125: 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_0133: 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_0143: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Expected O, but got Unknown //IL_0169: Expected O, but got Unknown if ((Object)(object)_helium != (Object)null) { return _helium; } _helium = ScriptableObject.CreateInstance(); ((Object)_helium).hideFlags = (HideFlags)61; _helium.id = "severon_helium_perk"; ((Object)_helium).name = "perk_helium"; _helium.title = "Helium"; _helium.description = "105% Less gravity"; _helium.cost = 0; _helium.canStack = true; _helium.stackMax = 100; _helium.useBuff = true; _helium.buffMultiplier = 1f; _helium.multiplierCurve = AnimationCurve.Linear(0f, 1f, 1f, 1f); _helium.modules = new List(); _helium.buff = new BuffContainer { id = "severon_helium_buff", desc = "", loseOverTime = false, loseRate = 0f, buffTime = 1f, multiplier = 1f, loseRateEffectedByPerks = false, buffs = new List { new Buff { id = "addGravity", maxAmount = -1.05f, amount = -1.05f } } }; return _helium; } private static Perk OneTap() { //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: 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_00fd: 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_010f: 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) //IL_0125: 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_0133: 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_0143: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Expected O, but got Unknown //IL_0169: Expected O, but got Unknown if ((Object)(object)_oneTap != (Object)null) { return _oneTap; } _oneTap = ScriptableObject.CreateInstance(); ((Object)_oneTap).hideFlags = (HideFlags)61; _oneTap.id = "severon_one_tap_perk"; ((Object)_oneTap).name = "perk_oneTap"; _oneTap.title = "One Tap"; _oneTap.description = "You take 100x damage from all sources."; _oneTap.cost = 0; _oneTap.canStack = true; _oneTap.stackMax = 100; _oneTap.useBuff = true; _oneTap.buffMultiplier = 1f; _oneTap.multiplierCurve = AnimationCurve.Linear(0f, 1f, 1f, 1f); _oneTap.modules = new List(); _oneTap.buff = new BuffContainer { id = "severon_one_tap_buff", desc = "", loseOverTime = false, loseRate = 0f, buffTime = 1f, multiplier = 1f, loseRateEffectedByPerks = false, buffs = new List { new Buff { id = "damageMult", maxAmount = 100f, amount = 100f } } }; return _oneTap; } private static Perk WizardTime() { //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Expected O, but got Unknown if ((Object)(object)_wizardTime != (Object)null) { return _wizardTime; } _wizardTime = ScriptableObject.CreateInstance(); ((Object)_wizardTime).hideFlags = (HideFlags)61; _wizardTime.id = "severon_wizard_perk"; ((Object)_wizardTime).name = "perk_wizardTime"; _wizardTime.title = "Bound Warlock"; _wizardTime.description = "In development"; _wizardTime.cost = 0; _wizardTime.canStack = false; _wizardTime.stackMax = 1; _wizardTime.useBuff = false; _wizardTime.buffMultiplier = 1f; _wizardTime.multiplierCurve = AnimationCurve.Linear(0f, 1f, 1f, 1f); _wizardTime.modules = new List { (PerkModule)(object)new PerkModule_Warlock() }; _wizardTime.buff = new BuffContainer(); return _wizardTime; } } public class HandholdEntity : MonoBehaviour { public GameObject InnerObject { get; private set; } public GameObject OuterObject { get; private set; } public void Build(bool isFloating) { //IL_004b: 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_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: 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_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Expected O, but got Unknown //IL_019b: 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) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_02b9: Unknown result type (might be due to invalid IL or missing references) //IL_02d6: Unknown result type (might be due to invalid IL or missing references) //IL_02db: Unknown result type (might be due to invalid IL or missing references) //IL_02e1: Unknown result type (might be due to invalid IL or missing references) //IL_02e6: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: 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_0307: Unknown result type (might be due to invalid IL or missing references) OuterObject = GameObject.CreatePrimitive((PrimitiveType)0); ((Object)OuterObject).name = (isFloating ? "Floating_Handhold_Outer" : "Summoned_Handhold_Outer"); OuterObject.transform.SetParent(((Component)this).transform); OuterObject.transform.localPosition = Vector3.zero; OuterObject.transform.localRotation = Quaternion.identity; OuterObject.transform.localScale = Vector3.one; Collider val = default(Collider); if (OuterObject.TryGetComponent(ref val)) { val.isTrigger = true; } InnerObject = GameObject.CreatePrimitive((PrimitiveType)0); ((Object)InnerObject).name = (isFloating ? "Floating_Handhold" : "Summoned_Handhold"); InnerObject.transform.SetParent(OuterObject.transform); InnerObject.transform.localPosition = Vector3.zero; InnerObject.transform.localRotation = Quaternion.identity; InnerObject.transform.localScale = new Vector3(0.5f, 0.5f, 0.5f); Collider val2 = default(Collider); if (InnerObject.TryGetComponent(ref val2)) { val2.isTrigger = true; } Shader val3 = Shader.Find("Sprites/Default") ?? Shader.Find("UI/Default") ?? Shader.Find("Legacy Shaders/Transparent/Diffuse"); Material val4 = new Material(val3); Color val5 = default(Color); ((Color)(ref val5))..ctor(0.46f, 0.08f, 0.04f, 0.4f); val4.color = val5; if (val4.HasProperty("_Color")) { val4.SetColor("_Color", val5); } if (val4.HasProperty("_BaseColor")) { val4.SetColor("_BaseColor", val5); } val4.renderQueue = 3000; Renderer val6 = default(Renderer); if (OuterObject.TryGetComponent(ref val6)) { val6.material = val4; } Renderer val7 = default(Renderer); if (InnerObject.TryGetComponent(ref val7)) { val7.material = val4; } ObjectTagger val8 = InnerObject.GetComponent(); if ((Object)(object)val8 == (Object)null) { val8 = InnerObject.AddComponent(); } val8.AddTag("Handhold"); GameObject cachedPrefab = Spells.GetCachedPrefab("Rho Particles"); if ((Object)(object)cachedPrefab != (Object)null) { cachedPrefab.transform.SetParent(((Component)this).transform); cachedPrefab.transform.localPosition = Vector3.zero; cachedPrefab.transform.localScale = new Vector3(0.15f, 0.15f, 0.15f); ParticleSystem val9 = default(ParticleSystem); if (cachedPrefab.TryGetComponent(ref val9)) { EmissionModule emission = val9.emission; MinMaxCurve rateOverTime = ((EmissionModule)(ref emission)).rateOverTime; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(((MinMaxCurve)(ref rateOverTime)).constant * 2f); MainModule main = val9.main; ((MainModule)(ref main)).maxParticles = Mathf.CeilToInt((float)((MainModule)(ref main)).maxParticles * 2f); ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1; } } } } public class WerelightEntity : MonoBehaviour { public CL_Lamp LampComponent { get; private set; } public void Initialize(float range, float intensity) { //IL_003d: 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_006e: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Expected O, but got Unknown //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: 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_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0192: 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) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: 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_028f: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_02cb: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: Unknown result type (might be due to invalid IL or missing references) //IL_02dd: Unknown result type (might be due to invalid IL or missing references) ((Object)((Component)this).gameObject).name = "Werelight"; GameObject val = GameObject.CreatePrimitive((PrimitiveType)0); ((Object)val).name = "Werelight_Mesh"; val.transform.SetParent(((Component)this).transform); val.transform.localPosition = Vector3.zero; val.transform.localRotation = Quaternion.identity; val.transform.localScale = new Vector3(0.04f, 0.04f, 0.04f); Collider val2 = default(Collider); if (val.TryGetComponent(ref val2)) { Object.Destroy((Object)(object)val2); } Shader val3 = Shader.Find("Sprites/Default") ?? Shader.Find("UI/Default") ?? Shader.Find("Legacy Shaders/Transparent/Diffuse"); Material val4 = new Material(val3); Color val5 = default(Color); ((Color)(ref val5))..ctor(0.86f, 0.08f, 0.24f, 0.3f); val4.color = val5; if (val4.HasProperty("_Color")) { val4.SetColor("_Color", val5); } if (val4.HasProperty("_BaseColor")) { val4.SetColor("_BaseColor", val5); } val4.renderQueue = 3000; Renderer val6 = default(Renderer); if (val.TryGetComponent(ref val6)) { val6.material = val4; } LampComponent = ((Component)this).gameObject.AddComponent(); LampComponent.range = range; LampComponent.intensity = intensity; Color val7 = default(Color); ((Color)(ref val7))..ctor(0.86f, 0.5f, 0.5f, 1f); LampComponent.startColor = val7; LampComponent.color = val7; LampComponent.fadeStart = 0f; LampComponent.fadeSpeed = 1f; LampComponent.fadeTarget = 1f; LampComponent.intensity = 1.1f; LampComponent.anim = (Animations)1; LampComponent.animSpeed = 1.5f; LampComponent.animAmplitude = 0.3f; LampComponent.animOffset = Random.Range(0f, 100f); LampComponent.lampActive = true; GameObject cachedPrefab = Spells.GetCachedPrefab("Rho Particles"); if ((Object)(object)cachedPrefab != (Object)null) { cachedPrefab.transform.SetParent(((Component)this).transform); cachedPrefab.transform.localPosition = Vector3.zero; cachedPrefab.transform.localScale = new Vector3(0.15f, 0.15f, 0.15f); ParticleSystem val8 = default(ParticleSystem); if (cachedPrefab.TryGetComponent(ref val8)) { EmissionModule emission = val8.emission; MinMaxCurve rateOverTime = ((EmissionModule)(ref emission)).rateOverTime; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(((MinMaxCurve)(ref rateOverTime)).constant * 2f); MainModule main = val8.main; ((MainModule)(ref main)).maxParticles = Mathf.CeilToInt((float)((MainModule)(ref main)).maxParticles * 2f); ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1; } } } } [HarmonyPatch(typeof(Projectile), "OnCollisionHit")] public static class OnCollisionHitPatch { private static void Prefix(Projectile __instance, RaycastHit hit, ObjectTagger tagger, bool hasHitThis, bool hasKilled) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) CustomProjectileEntity component = ((Component)__instance).GetComponent(); if ((Object)(object)component != (Object)null && component.Callback != null) { component.Callback(hit); } } } public class CustomProjectileEntity : MonoBehaviour { public Action Callback = null; public Projectile ProjectileComponent { get; private set; } public GameObject MeshObject { get; private set; } public TrailRenderer TrailComponent { get; private set; } public void Build(Color projectileColor, float speed = 20f, float damage = 1f, float radius = 0.1f, float lifetime = 5f, float gravity = 0f, bool addTrail = true, float trailTime = 0.2f, Action onHitCallback = null) { //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_009a: 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_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Expected O, but got Unknown //IL_00f6: 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_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0132: 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_01d6: Expected O, but got Unknown //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: 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_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_021a: 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_0230: Unknown result type (might be due to invalid IL or missing references) //IL_03c9: Unknown result type (might be due to invalid IL or missing references) //IL_03d3: Expected O, but got Unknown //IL_0585: Unknown result type (might be due to invalid IL or missing references) //IL_058a: Unknown result type (might be due to invalid IL or missing references) //IL_0602: Unknown result type (might be due to invalid IL or missing references) //IL_0623: Unknown result type (might be due to invalid IL or missing references) //IL_0640: Unknown result type (might be due to invalid IL or missing references) //IL_0645: Unknown result type (might be due to invalid IL or missing references) //IL_064b: Unknown result type (might be due to invalid IL or missing references) //IL_0650: Unknown result type (might be due to invalid IL or missing references) //IL_065f: Unknown result type (might be due to invalid IL or missing references) //IL_066c: Unknown result type (might be due to invalid IL or missing references) //IL_0671: Unknown result type (might be due to invalid IL or missing references) Callback = onHitCallback; ((Object)((Component)this).gameObject).name = "Custom_Projectile"; MeshObject = GameObject.CreatePrimitive((PrimitiveType)0); Collider component = MeshObject.GetComponent(); if ((Object)(object)component != (Object)null) { component.enabled = false; Object.Destroy((Object)(object)component); } ((Object)MeshObject).name = "Projectile_Mesh"; MeshObject.transform.SetParent(((Component)this).transform); MeshObject.transform.localPosition = Vector3.zero; MeshObject.transform.localRotation = Quaternion.identity; float num = radius * 2f; MeshObject.transform.localScale = new Vector3(num, num, num); Shader val = Shader.Find("Sprites/Default") ?? Shader.Find("UI/Default") ?? Shader.Find("Legacy Shaders/Transparent/Diffuse"); Material val2 = new Material(val); val2.color = projectileColor; if (val2.HasProperty("_Color")) { val2.SetColor("_Color", projectileColor); } if (val2.HasProperty("_BaseColor")) { val2.SetColor("_BaseColor", projectileColor); } if (projectileColor.a < 1f) { val2.renderQueue = 3000; } Renderer val3 = default(Renderer); if (MeshObject.TryGetComponent(ref val3)) { val3.material = val2; } if (addTrail) { TrailComponent = ((Component)this).gameObject.AddComponent(); ((Renderer)TrailComponent).material = val2; TrailComponent.time = trailTime; TrailComponent.startWidth = num; TrailComponent.endWidth = 0f; Gradient val4 = new Gradient(); val4.SetKeys((GradientColorKey[])(object)new GradientColorKey[2] { new GradientColorKey(projectileColor, 0f), new GradientColorKey(projectileColor, 1f) }, (GradientAlphaKey[])(object)new GradientAlphaKey[2] { new GradientAlphaKey(projectileColor.a, 0f), new GradientAlphaKey(0f, 1f) }); TrailComponent.colorGradient = val4; TrailComponent.minVertexDistance = 0.1f; } ProjectileComponent = ((Component)this).gameObject.AddComponent(); FieldInfo[] fields = typeof(Projectile).GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); FieldInfo[] array = fields; foreach (FieldInfo fieldInfo in array) { if (fieldInfo.GetValue(ProjectileComponent) == null) { if (fieldInfo.FieldType.IsGenericType && fieldInfo.FieldType.GetGenericTypeDefinition() == typeof(List<>)) { Type type = typeof(List<>).MakeGenericType(fieldInfo.FieldType.GetGenericArguments()); fieldInfo.SetValue(ProjectileComponent, Activator.CreateInstance(type)); } else if (fieldInfo.FieldType.IsArray) { fieldInfo.SetValue(ProjectileComponent, Array.CreateInstance(fieldInfo.FieldType.GetElementType(), 0)); } else if (typeof(UnityEventBase).IsAssignableFrom(fieldInfo.FieldType) && !fieldInfo.FieldType.IsAbstract) { fieldInfo.SetValue(ProjectileComponent, Activator.CreateInstance(fieldInfo.FieldType)); } } } if (ProjectileComponent.onHitEvent == null) { ProjectileComponent.onHitEvent = new UnityEvent(); } if (ProjectileComponent.customHitEffects == null) { ProjectileComponent.customHitEffects = new List(); } if (ProjectileComponent.damageTags == null) { ProjectileComponent.damageTags = new List(); } if (ProjectileComponent.spawnSound == null) { ProjectileComponent.spawnSound = new List(); } if (ProjectileComponent.reflectSound == null) { ProjectileComponent.reflectSound = new List(); } if (ProjectileComponent.hitSound == null) { ProjectileComponent.hitSound = new List(); } if (ProjectileComponent.pierceSound == null) { ProjectileComponent.pierceSound = new List(); } if (ProjectileComponent.hitDamageSounds == null) { ProjectileComponent.hitDamageSounds = new List(); } if (ProjectileComponent.hitKillSounds == null) { ProjectileComponent.hitKillSounds = new List(); } if (ProjectileComponent.hitWeakSpotSounds == null) { ProjectileComponent.hitWeakSpotSounds = new List(); } ProjectileComponent.speed = speed; ProjectileComponent.damage = damage; ProjectileComponent.hitRadius = radius; ProjectileComponent.lifetime = lifetime; ProjectileComponent.gravity = gravity; ProjectileComponent.destroyOnHit = true; ProjectileComponent.faceVelocity = true; ProjectileComponent.canRicochet = false; ProjectileComponent.hitMask = LayerMask.op_Implicit(19955841); Collider[] componentsInChildren = ((Component)this).GetComponentsInChildren(true); Collider[] array2 = componentsInChildren; foreach (Collider val5 in array2) { val5.enabled = false; Object.Destroy((Object)(object)val5); } GameObject cachedPrefab = Spells.GetCachedPrefab("Rho Particles"); if ((Object)(object)cachedPrefab != (Object)null) { cachedPrefab.transform.SetParent(((Component)this).transform); cachedPrefab.transform.localPosition = Vector3.zero; cachedPrefab.transform.localScale = new Vector3(0.15f, 0.15f, 0.15f); ParticleSystem val6 = default(ParticleSystem); if (cachedPrefab.TryGetComponent(ref val6)) { EmissionModule emission = val6.emission; MinMaxCurve rateOverTime = ((EmissionModule)(ref emission)).rateOverTime; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(((MinMaxCurve)(ref rateOverTime)).constant * 5f); MainModule main = val6.main; ((MainModule)(ref main)).maxParticles = Mathf.CeilToInt((float)((MainModule)(ref main)).maxParticles * 5f); ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1; } } } public void Launch(Vector3 direction, GameEntity sourceEntity = null, Item sourceItem = null) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)ProjectileComponent == (Object)null)) { ProjectileComponent.Initialize(((Vector3)(ref direction)).normalized, sourceEntity, sourceItem); } } } public class AxisMarkerEntity : MonoBehaviour { public static List ObjectPositions = new List(); private static List activeInstances = new List(); public static int MaxAmount = 1; public GameObject SphereObject { get; private set; } public List RodObjects { get; private set; } = new List(); public void Build(float sphereRadius = 0.15f, float rodThickness = 0.015f) { //IL_005a: 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_0089: 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_00de: Expected O, but got Unknown //IL_00fa: 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_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Expected O, but got Unknown //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0192: 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_01b7: 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_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0232: 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_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) //IL_0345: Unknown result type (might be due to invalid IL or missing references) //IL_03f5: Unknown result type (might be due to invalid IL or missing references) //IL_0416: Unknown result type (might be due to invalid IL or missing references) //IL_0433: Unknown result type (might be due to invalid IL or missing references) //IL_0438: Unknown result type (might be due to invalid IL or missing references) //IL_043e: Unknown result type (might be due to invalid IL or missing references) //IL_0443: Unknown result type (might be due to invalid IL or missing references) //IL_0452: Unknown result type (might be due to invalid IL or missing references) //IL_045f: Unknown result type (might be due to invalid IL or missing references) //IL_0464: Unknown result type (might be due to invalid IL or missing references) ((Object)((Component)this).gameObject).name = "Axis_Marker_Entity"; float num = sphereRadius * 2f; SphereObject = GameObject.CreatePrimitive((PrimitiveType)0); ((Object)SphereObject).name = "Center_Sphere"; SphereObject.transform.SetParent(((Component)this).transform); SphereObject.transform.localPosition = Vector3.zero; SphereObject.transform.localRotation = Quaternion.identity; SphereObject.transform.localScale = new Vector3(num, num, num); Collider val = default(Collider); if (SphereObject.TryGetComponent(ref val)) { Object.Destroy((Object)(object)val); } Shader val2 = Shader.Find("Sprites/Default") ?? Shader.Find("UI/Default") ?? Shader.Find("Legacy Shaders/Transparent/Diffuse"); Material val3 = new Material(val2); Color val4 = default(Color); ((Color)(ref val4))..ctor(0.85f, 0f, 0f, 0.35f); val3.color = val4; if (val3.HasProperty("_Color")) { val3.SetColor("_Color", val4); } if (val3.HasProperty("_BaseColor")) { val3.SetColor("_BaseColor", val4); } val3.renderQueue = 3000; Renderer val5 = default(Renderer); if (SphereObject.TryGetComponent(ref val5)) { val5.material = val3; } Shader val6 = Shader.Find("Standard") ?? Shader.Find("Diffuse"); Material val7 = new Material(val6); Color val8 = (val7.color = Color.black); if (val7.HasProperty("_Color")) { val7.SetColor("_Color", val8); } if (val7.HasProperty("_BaseColor")) { val7.SetColor("_BaseColor", val8); } float num2 = sphereRadius * 3f / 2f; Quaternion[] array = (Quaternion[])(object)new Quaternion[3] { Quaternion.Euler(0f, 0f, 90f), Quaternion.identity, Quaternion.Euler(90f, 0f, 0f) }; string[] array2 = new string[3] { "X", "Y", "Z" }; Collider val10 = default(Collider); Renderer val11 = default(Renderer); for (int i = 0; i < 3; i++) { GameObject val9 = GameObject.CreatePrimitive((PrimitiveType)2); ((Object)val9).name = "Rod_" + array2[i] + "_Axis"; val9.transform.SetParent(((Component)this).transform); val9.transform.localPosition = Vector3.zero; val9.transform.localRotation = array[i]; val9.transform.localScale = new Vector3(rodThickness, num2, rodThickness); if (val9.TryGetComponent(ref val10)) { Object.Destroy((Object)(object)val10); } if (val9.TryGetComponent(ref val11)) { val11.material = val7; } RodObjects.Add(val9); } activeInstances.Add(this); ObjectPositions.Add(((Component)this).transform.position); if (activeInstances.Count > MaxAmount) { AxisMarkerEntity axisMarkerEntity = activeInstances[0]; activeInstances.RemoveAt(0); ObjectPositions.RemoveAt(0); if ((Object)(object)axisMarkerEntity != (Object)null && (Object)(object)((Component)axisMarkerEntity).gameObject != (Object)null) { Object.Destroy((Object)(object)((Component)axisMarkerEntity).gameObject); } } GameObject cachedPrefab = Spells.GetCachedPrefab("Rho Particles"); if ((Object)(object)cachedPrefab != (Object)null) { cachedPrefab.transform.SetParent(((Component)this).transform); cachedPrefab.transform.localPosition = Vector3.zero; cachedPrefab.transform.localScale = new Vector3(0.15f, 0.15f, 0.15f); ParticleSystem val12 = default(ParticleSystem); if (cachedPrefab.TryGetComponent(ref val12)) { EmissionModule emission = val12.emission; MinMaxCurve rateOverTime = ((EmissionModule)(ref emission)).rateOverTime; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(((MinMaxCurve)(ref rateOverTime)).constant * 2f); MainModule main = val12.main; ((MainModule)(ref main)).maxParticles = Mathf.CeilToInt((float)((MainModule)(ref main)).maxParticles * 2f); ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1; } } } private void OnDestroy() { int num = activeInstances.IndexOf(this); if (num >= 0) { activeInstances.RemoveAt(num); ObjectPositions.RemoveAt(num); } } } public static class Patches2 { [HarmonyPatch(typeof(HandItem_Shoot), "Shoot")] public class HandItem_Shoot_Bricked_Patch { [HarmonyPostfix] public static void Postfix(HandItem_Shoot __instance) { //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: 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) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) ENT_Player player = ENT_Player.GetPlayer(); if ((Object)(object)player != (Object)null && player.HasPerk("severon_bricked_perk") && (Object)(object)__instance != (Object)null && ((Object)__instance).name != null && ((Object)__instance).name.ToLower().Contains("rubble") && (Object)(object)Camera.main != (Object)null) { Inventory.instance.AddItemToInventoryCenter(CL_AssetManager.GetItemObjectPrefab("Item_Rubble", "").itemData.GetClone((Item)null, false)); Inventory.instance.AddItemToInventoryCenter(CL_AssetManager.GetItemObjectPrefab("Item_Rubble", "").itemData.GetClone((Item)null, false)); Vector3 val = -((Component)Camera.main).transform.forward * 7f; ((GameEntity)player).AddForce(val, ""); } } } [HarmonyPatch(typeof(ENT_Player), "Update")] public class Player_WingFlight_Patch { public static bool isGliding; [HarmonyPostfix] public static void Postfix(ENT_Player __instance) { //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: 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_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: 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_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_010e: 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_011f: 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_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0160: 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_0134: 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_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0153: 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) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) ENT_Player val = (((Object)(object)__instance != (Object)null) ? __instance : ENT_Player.GetPlayer()); if ((Object)(object)val == (Object)null) { return; } if (val.IsGrounded(false) || val.IsHanging()) { isGliding = false; return; } BuffContainer buffContainer = ((GameEntity)val).curBuffs.GetBuffContainer("TempFlight"); bool flag = buffContainer != null && buffContainer.buffTime > 0f; if (val.IsGrounded(false) || val.IsHanging()) { isGliding = false; if (flag) { buffContainer.buffTime = 0f; } return; } if (flag) { isGliding = true; } if (isGliding) { Vector3 trueVelocity = ((GameEntity)val).GetTrueVelocity(); float magnitude = ((Vector3)(ref trueVelocity)).magnitude; Vector3 forward = ((Component)Camera.main).transform.forward; Vector3 val2 = Vector3.zero; if (magnitude > 0.1f) { Vector3 val3 = trueVelocity / magnitude; val2 += (forward - val3) * 0.003f * magnitude; } if (flag) { val2 += forward * 0.06f * val.jumpHeight * buffContainer.buffTime; } if (val2 != Vector3.zero) { ((GameEntity)val).AddForce(val2, ""); } } } } [HarmonyPatch(typeof(ENT_Player), "GetCurrentMaxFallDistance")] public class Player_Flight_Fall_Damage_Patch { [HarmonyPrefix] public static bool Prefix(ref float __result) { if (!Player_WingFlight_Patch.isGliding) { return true; } __result = 1000000f; return false; } } [HarmonyPatch(typeof(ENT_Player), "Jump")] public class Player_Jump_Flight_Patch { [HarmonyPrefix] public static void Prefix() { //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_0067: 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_0079: 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_008f: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Expected O, but got Unknown ENT_Player player = ENT_Player.GetPlayer(); if ((Object)(object)player != (Object)null && player.HasPerk("severon_terrible_thoughts") && !player.IsGrounded(false) && !player.IsHanging()) { BuffContainer buffContainer = ((GameEntity)player).curBuffs.GetBuffContainer("TempFlight"); if (buffContainer == null) { buffContainer = new BuffContainer { id = "TempFlight", desc = "", loseOverTime = true, loseRate = 1f, buffTime = 0.7f, multiplier = 1f, buffs = new List() }; buffContainer.id = "TempFlight"; ((GameEntity)player).curBuffs.AddBuff(buffContainer); } else { BuffContainer obj = buffContainer; obj.buffTime += 1.4f; } } } } [HarmonyPatch(typeof(ENT_Player), "Damage")] public class ENT_Player_Damage_Patch { [HarmonyPrefix] public static void Prefix(ENT_Player __instance, DamageInfo info) { float health = ((GameEntity)__instance).health; string text = info.type?.ToLower() ?? ""; float num = info.amount; if (((GameEntity)__instance).curBuffs != null) { float buff = ((GameEntity)__instance).curBuffs.GetBuff("damageResist"); float buff2 = ((GameEntity)__instance).curBuffs.GetBuff("damageMult"); num /= 1f + buff; num *= 1f + buff2; } if (((!(text == "teeth") && !(text == "phage")) || !(health - num <= 0f)) && !info.HasTag("nonlethal")) { if (info.HasTag("dontkill")) { num = Mathf.Min(num, health - 0.1f); } if (health - num <= 0f) { OnPlayerWillDie(__instance, info); } } } private static void OnPlayerWillDie(ENT_Player player, DamageInfo info) { if (!player.HasPerk("severon_gastric_bypass_perk")) { return; } List itemsByTag = Inventory.instance.GetItemsByTag("food", true, true); if (itemsByTag.Count > 0) { itemsByTag[0].Destroy(true); ((GameEntity)player).Heal(100f); player.OnEat("food"); return; } itemsByTag = Inventory.instance.GetItemsByTag("brick", true, true); if (itemsByTag.Count > 0) { itemsByTag[0].Destroy(true); ((GameEntity)player).Heal(100f); player.OnEat("food"); return; } itemsByTag = Inventory.instance.GetItemsByTag("roach", true, true); if (itemsByTag.Count > 0) { itemsByTag[0].Destroy(true); ((GameEntity)player).Heal(100f); player.OnEat("food"); } } } [HarmonyPatch(typeof(ENT_Player), "Revive")] public class ENT_Player_Revive_Patch { [HarmonyPostfix] public static void Postfix(ENT_Player __instance) { //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_00a3: 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_00be: Expected O, but got Unknown //IL_00c5: 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_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Expected O, but got Unknown //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0107: 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_0122: Expected O, but got Unknown //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: 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_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Expected O, but got Unknown //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Expected O, but got Unknown //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0192: 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) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Expected O, but got Unknown //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: 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_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Expected O, but got Unknown //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: 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_020c: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Expected O, but got Unknown //IL_0030: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0052: 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_0068: 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_007f: Expected O, but got Unknown if (__instance.HasPerk("severon_soul_perk")) { BuffContainer val = ((GameEntity)__instance).curBuffs.GetBuffContainer("severon_soul_stats"); if (val == null) { val = new BuffContainer { id = "severon_soul_stats", desc = "", loseOverTime = false, loseRate = 0f, buffTime = 1f, multiplier = 1f, buffs = new List() }; ((GameEntity)__instance).curBuffs.AddBuff(val); } val.buffs.Add(new Buff { id = "addStamina", maxAmount = 0.3f, amount = 0.3f }); val.buffs.Add(new Buff { id = "addJump", maxAmount = 0.3f, amount = 0.3f }); val.buffs.Add(new Buff { id = "addSpeed", maxAmount = 0.3f, amount = 0.3f }); val.buffs.Add(new Buff { id = "addClimb", maxAmount = 0.3f, amount = 0.3f }); val.buffs.Add(new Buff { id = "addReach", maxAmount = 0.3f, amount = 0.3f }); val.buffs.Add(new Buff { id = "addStaminaRegen", maxAmount = 0.3f, amount = 0.3f }); val.buffs.Add(new Buff { id = "addGravity", maxAmount = -0.3f, amount = -0.3f }); val.buffs.Add(new Buff { id = "damageResist", maxAmount = 0.3f, amount = 0.3f }); } } } [HarmonyPatch(typeof(ENT_Player), "Damage")] public class Player_OnDamage_Patch { [HarmonyPostfix] public static void Postfix(ENT_Player __instance) { if ((Object)(object)__instance != (Object)null && __instance.HasPerk("severon_torment_perk")) { StatManager.sessionStats.UpdateStatistic("Kills", (object)1, (DataType)0, (ModType)1, (DisplayType)0, (ModType)1); } } } } public class PerkModule_CrouchMothSpawner : PerkModule { [Header("Crouch Spawn Settings")] public float requiredCrouchTime = 3f; public string entityIdToSpawn = "Denizen_Moth"; public float cooldownTime = 60f; public float spawnOffsetDistance = 2f; private float crouchTimer = 0f; private float currentCooldown = 0f; public override void Initialize(Perk p, bool firstTime) { ((PerkModule)this).Initialize(p, firstTime); crouchTimer = 0f; currentCooldown = 0f; } public override void Update() { ((PerkModule)this).Update(); if (currentCooldown > 0f) { currentCooldown -= Time.deltaTime; } ENT_Player player = ENT_Player.GetPlayer(); if ((Object)(object)player == (Object)null) { return; } if (player.IsCrouching()) { if (currentCooldown <= 0f) { crouchTimer += Time.deltaTime; if (crouchTimer >= requiredCrouchTime) { SpawnMoth(player); crouchTimer = 0f; currentCooldown = cooldownTime; } } } else { crouchTimer = 0f; } } private void SpawnMoth(ENT_Player player) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: 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_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_003d: Expected O, but got Unknown //IL_0043: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)player).transform.position + ((Component)player).transform.forward * spawnOffsetDistance + Vector3.up; GameObject val = new GameObject("Temp_Moth_Spawner"); val.transform.position = position; UT_SpawnEntityByID val2 = val.AddComponent(); val2.idToSpawn = entityIdToSpawn; val2.spawnOnStart = false; val2.saveSpawnedObject = false; if (WorldLoader.initialized) { val2.customParent = ((Component)WorldLoader.instance.GetCurrentLevel().GetLevel()).transform; } val2.SpawnCustom(entityIdToSpawn); Object.Destroy((Object)(object)val, 5f); } } public class PerkModule_HeavyHanded : PerkModule { public BuffContainer heavyHandedBuff; public BuffContainer reloadBuff; public override void Initialize(Perk p, bool firstTime) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: 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_003a: 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_004c: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Expected O, but got Unknown //IL_006c: 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_007c: 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) //IL_008e: 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_00a9: Expected O, but got Unknown ((PerkModule)this).Initialize(p, firstTime); ENT_Player player = ENT_Player.GetPlayer(); if (heavyHandedBuff == null) { heavyHandedBuff = new BuffContainer { id = "severon_heavyhanded_buff", desc = "Heavy Handed", loseOverTime = false, multiplier = 1f, buffs = new List() }; } if (reloadBuff == null) { reloadBuff = new BuffContainer { id = "reloadNeg", desc = "Weapon Speed", loseOverTime = false, multiplier = 0.8f, buffs = new List() }; } reloadBuff.id = "reloadNeg"; heavyHandedBuff.id = "severon_heavyhanded_buff"; if (((GameEntity)player).curBuffs.GetBuffContainer(heavyHandedBuff.id) == null) { ((GameEntity)player).curBuffs.AddBuff(heavyHandedBuff); } if (((GameEntity)player).curBuffs.GetBuffContainer(reloadBuff.id) == null) { ((GameEntity)player).curBuffs.AddBuff(reloadBuff); } ((GameEntity)player).curBuffs.GetBuffContainer(reloadBuff.id).SetMultiplier(0.8f); ((GameEntity)player).curBuffs.GetBuffContainer(reloadBuff.id).loseOverTime = false; ((GameEntity)player).curBuffs.GetBuffContainer(heavyHandedBuff.id).loseOverTime = false; reloadBuff.id = "reloadNeg"; heavyHandedBuff.id = "severon_heavyhanded_buff"; } public override void OnDestroy(Perk p) { ENT_Player player = ENT_Player.GetPlayer(); if ((Object)(object)player != (Object)null && ((GameEntity)player).curBuffs != null) { BuffContainer buffContainer = ((GameEntity)player).curBuffs.GetBuffContainer("severon_heavyhanded_buff"); if (buffContainer != null) { ((GameEntity)player).curBuffs.RemoveBuffContainer(buffContainer); } BuffContainer buffContainer2 = ((GameEntity)player).curBuffs.GetBuffContainer("reloadNeg"); if (buffContainer2 != null) { ((GameEntity)player).curBuffs.RemoveBuffContainer(buffContainer); } } ((PerkModule)this).OnDestroy(p); } } public class PerkModule_ItemRecycling : PerkModule { public BuffContainer recycleBuff; public float recycleChanceMultiplier = 0.3f; public override void Initialize(Perk p, bool firstTime) { ((PerkModule)this).Initialize(p, firstTime); recycleBuff.id = "itemRecycling"; ENT_Player player = ENT_Player.GetPlayer(); if (((GameEntity)player).curBuffs.GetBuffContainer(recycleBuff.id) == null) { ((GameEntity)player).curBuffs.AddBuff(recycleBuff); } BuffContainer buffContainer = ((GameEntity)player).curBuffs.GetBuffContainer(recycleBuff.id); buffContainer.loseOverTime = false; Perk perk = player.GetPerk("severon_recycle_perk"); int num = ((!((Object)(object)perk != (Object)null)) ? 1 : perk.GetStackAmount()); buffContainer.SetMultiplier((float)num * recycleChanceMultiplier); } public override void Update() { ((PerkModule)this).Update(); ENT_Player player = ENT_Player.GetPlayer(); Perk perk = player.GetPerk("severon_recycle_perk"); BuffContainer buffContainer = ((GameEntity)player).curBuffs.GetBuffContainer(recycleBuff.id); if ((Object)(object)perk != (Object)null && buffContainer != null) { buffContainer.SetMultiplier((float)perk.GetStackAmount() * recycleChanceMultiplier); } } } [HarmonyPatch(typeof(HandItem_Shoot), "Update")] public class HandItem_Shoot_Update_Patch { private static void Postfix(HandItem_Shoot __instance) { ENT_Player player = ENT_Player.GetPlayer(); if ((Object)(object)((HandItem)__instance).anim != (Object)null && ((Hand_Base)__instance).hand != null && (Object)(object)player != (Object)null && ((GameEntity)player).curBuffs.GetBuffContainer("reloadBuff") != null) { float multiplier = ((GameEntity)player).curBuffs.GetBuffContainer("reloadBuff").GetMultiplier(); ((HandItem)__instance).anim.speed = 1f + multiplier; if ((Object)(object)((HandItem)__instance).anim != (Object)null && ((Hand_Base)__instance).hand != null && (Object)(object)player != (Object)null && ((GameEntity)player).curBuffs.GetBuffContainer("reloadNeg") != null) { multiplier = ((GameEntity)player).curBuffs.GetBuffContainer("reloadNeg").GetMultiplier(); Animator anim = ((HandItem)__instance).anim; anim.speed -= multiplier; } } else if ((Object)(object)((HandItem)__instance).anim != (Object)null && ((Hand_Base)__instance).hand != null && (Object)(object)player != (Object)null && ((GameEntity)player).curBuffs.GetBuffContainer("reloadNeg") != null) { float multiplier2 = ((GameEntity)player).curBuffs.GetBuffContainer("reloadNeg").GetMultiplier(); ((HandItem)__instance).anim.speed = 1f - multiplier2; } } } [HarmonyPatch(typeof(HandItem_Buff_Grub), "CanPet")] public static class HandItem_Buff_Grub_CanPet_Patch { [HarmonyPostfix] public static void Postfix(ref bool __result) { if (!__result) { ENT_Player player = ENT_Player.GetPlayer(); if ((Object)(object)player != (Object)null && player.HasPerk("severon_grub_transformation_perk")) { __result = true; } } } } [HarmonyPatch(typeof(HandItem_Melee), "Update")] public class HandItem_Swing_Update_Patch { private static readonly AnimationCurve SlowIntensityCurve = new AnimationCurve((Keyframe[])(object)new Keyframe[3] { new Keyframe(0f, 3f), new Keyframe(0.05f, 0f), new Keyframe(1f, 0.2f) }); private static void Postfix(HandItem_Melee __instance) { //IL_008c: 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) ENT_Player player = ENT_Player.GetPlayer(); if (!((Object)(object)((HandItem)__instance).anim == (Object)null) && ((Hand_Base)__instance).hand != null && !((Object)(object)player == (Object)null) && ((GameEntity)player).curBuffs != null) { float num = 1f; BuffContainer buffContainer = ((GameEntity)player).curBuffs.GetBuffContainer("reloadBuff"); if (buffContainer != null) { num += buffContainer.GetMultiplier(); } BuffContainer buffContainer2 = ((GameEntity)player).curBuffs.GetBuffContainer("reloadNeg"); if (buffContainer2 != null) { AnimatorStateInfo currentAnimatorStateInfo = ((HandItem)__instance).anim.GetCurrentAnimatorStateInfo(0); float num2 = ((AnimatorStateInfo)(ref currentAnimatorStateInfo)).normalizedTime % 1f; float num3 = SlowIntensityCurve.Evaluate(num2); float multiplier = buffContainer2.GetMultiplier(); num -= multiplier * num3; } ((HandItem)__instance).anim.speed = Mathf.Max(0.04f, num); } } } [HarmonyPatch(typeof(HandItem), "RemoveItem")] public class Patch_HandItem_RemoveItem { [HarmonyPrefix] public static bool Prefix(HandItem __instance) { //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Invalid comparison between Unknown and I4 //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Invalid comparison between Unknown and I4 //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Invalid comparison between Unknown and I4 ENT_Player player = ENT_Player.GetPlayer(); if ((Object)(object)player == (Object)null || ((GameEntity)player).curBuffs == null) { return true; } BuffContainer buffContainer = ((GameEntity)player).curBuffs.GetBuffContainer("itemRecycling"); if (buffContainer == null) { return true; } float multiplier = buffContainer.GetMultiplier(); if (Random.value < multiplier) { __instance.used = false; Traverse val = Traverse.Create((object)__instance.item).Method("SetUsed", new object[1] { false }); if (val.MethodExists()) { val.GetValue(); } string firstDataStringByType = __instance.item.GetFirstDataStringByType("uses", false); if (!string.IsNullOrEmpty(firstDataStringByType) && int.TryParse(firstDataStringByType, out var result) && result <= 0) { __instance.item.SetFirstDataStringsofType("uses", "1"); Traverse val2 = Traverse.Create((object)__instance).Field("uses"); if (val2.FieldExists()) { val2.SetValue((object)3); } } if ((Object)(object)__instance.anim != (Object)null) { __instance.anim.Rebind(); AnimatorControllerParameter[] parameters = __instance.anim.parameters; foreach (AnimatorControllerParameter val3 in parameters) { int result2; if (val3.name == "Empty" && (int)val3.type == 4) { __instance.anim.SetBool("Empty", false); } else if (val3.name == "Squeeze" && (int)val3.type == 4) { __instance.anim.SetBool("Squeeze", false); } else if (val3.name == "Uses" && (int)val3.type == 3 && int.TryParse(__instance.item.GetFirstDataStringByType("uses", false), out result2)) { __instance.anim.SetInteger("Uses", result2); } } __instance.anim.Update(0f); } Hand_Takeover val4 = ((Component)__instance).GetComponent() ?? ((Component)__instance).GetComponentInChildren(); if ((Object)(object)val4 != (Object)null) { val4.blend = 0f; Traverse val5 = Traverse.Create((object)val4).Field("curBlend"); if (val5.FieldExists()) { val5.SetValue((object)0f); } } HandItem_BlinkEye val6 = (HandItem_BlinkEye)(object)((__instance is HandItem_BlinkEye) ? __instance : null); if (val6 != null) { val6.CancelBlink(); if ((Object)(object)val6.crushEffect != (Object)null) { val6.crushEffect.Stop(); } } HandItem_Food val7 = (HandItem_Food)(object)((__instance is HandItem_Food) ? __instance : null); if (val7 != null) { val7.FinishEating(); } __instance.Refresh(); return false; } return true; } } [HarmonyPatch(typeof(Item), "Destroy")] public class Patch_Item_RemoveItem { [HarmonyPrefix] public static bool Prefix(Item __instance) { ENT_Player player = ENT_Player.GetPlayer(); if ((Object)(object)player == (Object)null || ((GameEntity)player).curBuffs == null) { return true; } BuffContainer buffContainer = ((GameEntity)player).curBuffs.GetBuffContainer("itemRecycling"); if (buffContainer == null) { return true; } float num = Mathf.Clamp01(buffContainer.GetMultiplier()); if (Random.value < num) { return false; } return true; } } [HarmonyPatch(typeof(HandItem_Shoot), "Shoot")] public class HandItem_Shoot_Shoot_Patch { [HarmonyPostfix] public static void Postfix() { //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: 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_0066: 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) ENT_Player player = ENT_Player.GetPlayer(); if ((Object)(object)player != (Object)null && ((GameEntity)player).curBuffs != null) { BuffContainer buffContainer = ((GameEntity)player).curBuffs.GetBuffContainer("severon_heavyhanded_buff"); if (buffContainer != null && (Object)(object)Camera.main != (Object)null) { Vector3 val = -((Component)Camera.main).transform.forward * 1f; ((GameEntity)player).AddForce(val, ""); } } } } [HarmonyPatch(typeof(HandItem_Melee), "Hit")] public class HandItem_Melee_Hit_Patch { [HarmonyPostfix] public static void Postfix() { //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: 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_0066: 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) ENT_Player player = ENT_Player.GetPlayer(); if ((Object)(object)player != (Object)null && ((GameEntity)player).curBuffs != null) { BuffContainer buffContainer = ((GameEntity)player).curBuffs.GetBuffContainer("severon_heavyhanded_buff"); if (buffContainer != null && (Object)(object)Camera.main != (Object)null) { Vector3 val = -((Component)Camera.main).transform.forward * 0.65f; ((GameEntity)player).AddForce(val, ""); } } } } [HarmonyPatch(typeof(HandItem_Melee), "OnChargeAttack")] public class HandItem_Melee_Charged_Patch { [HarmonyPostfix] public static void Postfix() { //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: 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_0066: 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) ENT_Player player = ENT_Player.GetPlayer(); if ((Object)(object)player != (Object)null && ((GameEntity)player).curBuffs != null) { BuffContainer buffContainer = ((GameEntity)player).curBuffs.GetBuffContainer("severon_heavyhanded_buff"); if (buffContainer != null && (Object)(object)Camera.main != (Object)null) { Vector3 val = -((Component)Camera.main).transform.forward * 1f; ((GameEntity)player).AddForce(val, ""); } } } } [HarmonyPatch(typeof(OS_Filesystem), "Initialize")] public class OS_Filesystem_Initialize_Patch { private static void Postfix(OS_Filesystem __instance, OS_Manager o) { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Invalid comparison between Unknown and I4 //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_00c6: 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_00da: Expected O, but got Unknown //IL_00e9: 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_0107: 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_0141: Expected O, but got Unknown //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Expected O, but got Unknown //IL_01b7: 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_01d5: Unknown result type (might be due to invalid IL or missing references) if (((Object)((Component)((Component)o.worldInterface).gameObject.transform.parent).gameObject).name != "Prop_UpgradeConsole_ScreenAndDisk Variant") { return; } App_PerkPage[] array = Resources.FindObjectsOfTypeAll(); App_PerkPage val = null; App_PerkPage[] array2 = array; foreach (App_PerkPage val2 in array2) { if ((int)val2.perkPageType == 0) { val = val2; Scene scene = ((Component)val2).gameObject.scene; if (!((Scene)(ref scene)).isLoaded) { break; } } } if (!((Object)(object)val == (Object)null)) { GameObject val3 = Object.Instantiate(((Component)val).gameObject, ((Component)val).transform.parent); App_PerkPage component = val3.GetComponent(); component.perkPageType = (PerkPageType)10; OS_Window component2 = ((Component)component).GetComponent(); FileInfo val4 = new FileInfo(); val4.name = "Rho Is Friend"; val4.type = (fileType)0; val4.useCustomFiletype = true; val4.position = new Vector2(-150f, -200f); val4.icon = CL_AssetManager.GetSpriteAsset("Perk_Icon_Rho_Blessing_03", ""); val4.windowAsset = component2; __instance.CreateFile(val4, __instance.desktop); val4 = new FileInfo(); val4.name = "You Won't Hurt"; val4.type = (fileType)0; val4.useCustomFiletype = true; val4.position = new Vector2(-300f, -160f); val4.icon = CL_AssetManager.GetSpriteAsset("Perk_Icon_Rho_Blessing_04", ""); val4.windowAsset = component2; __instance.CreateFile(val4, __instance.desktop); val4 = new FileInfo(); val4.name = "Take This Gift"; val4.type = (fileType)0; val4.useCustomFiletype = true; val4.position = new Vector2(-40f, -80f); val4.icon = CL_AssetManager.GetSpriteAsset("Perk_Icon_Rho_Blessing_02", ""); val4.windowAsset = component2; __instance.CreateFile(val4, __instance.desktop); } } } [HarmonyPatch(typeof(App_PerkPage), "OnEnable")] public class App_PerkPage_OnEnable_Patch { private static void Postfix(App_PerkPage __instance) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Invalid comparison between Unknown and I4 if ((int)__instance.perkPageType != 10) { return; } Traverse val = Traverse.Create((object)__instance); OS_Manager value = val.Field("os").GetValue(); if (!((Object)(object)value != (Object)null) || !((Object)(object)value.worldInterface != (Object)null)) { return; } string text = "recieved-" + value.worldInterface.computerID + "-perk"; if (ENT_Player.GetPlayer().HasPerk("Perk_Rho_Blessing_Overwhelm")) { CL_GameManager.SetGameFlag(text, false, "", false, false); val.Field("fullfilled").SetValue((object)false); if ((Object)(object)__instance.outOfPerksRoot != (Object)null) { __instance.outOfPerksRoot.SetActive(false); } List value2 = val.Field("cards").GetValue>(); if (value2 != null && value2.Count == 0) { val.Method("GenerateCards", new object[1] { false }).GetValue(); } } } } [HarmonyPatch(typeof(App_PerkPage), "Update")] public class App_PerkPage_Update_Patch { private static void Postfix(App_PerkPage __instance) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Invalid comparison between Unknown and I4 if ((int)__instance.perkPageType == 10 && (Object)(object)__instance.purchaseButton != (Object)null) { Traverse val = Traverse.Create((object)__instance); if (!val.Field("fullfilled").GetValue()) { bool flag = ENT_Player.GetPlayer().HasPerk("Perk_Rho_Blessing_Overwhelm"); App_PerkPage_Card value = val.Field("selectedCard").GetValue(); bool flag2 = (Object)(object)value != (Object)null && value.CanAfford(); ((Selectable)__instance.purchaseButton).interactable = flag && flag2; } } } } [HarmonyPatch(typeof(App_PerkPage), "PurchaseSelected")] public class App_PerkPage_PurchaseSelected_Patch { [HarmonyPrefix] private static bool Prefix(App_PerkPage __instance) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Invalid comparison between Unknown and I4 if ((int)__instance.perkPageType == 10) { Traverse val = Traverse.Create((object)__instance); App_PerkPage_Card value = val.Field("selectedCard").GetValue(); List value2 = val.Field("cards").GetValue>(); OS_Manager value3 = val.Field("os").GetValue(); if ((Object)(object)value == (Object)null || CL_GameManager.IsIronKnuckle()) { return false; } if (!value.CanAfford()) { return false; } if (!ENT_Player.GetPlayer().HasPerk("Perk_Rho_Blessing_Overwhelm")) { return false; } value3.audioClipHandler.PlaySound("perk:buy"); CL_GameManager.gMan.localPlayer.AddPerk(Object.Instantiate(value.perk), 1, true); ENT_Player.GetPlayer().RemovePerk("Perk_Rho_Blessing_Overwhelm", false); value.BuyCard(); value.LockCard(); value.UpdateCard(); if ((Object)(object)__instance.purchaseButton != (Object)null) { ((Selectable)__instance.purchaseButton).interactable = false; } val.Method("GenerateIcons", Array.Empty()).GetValue(); if (!ENT_Player.GetPlayer().HasPerk("Perk_Rho_Blessing_Overwhelm")) { val.Field("fullfilled").SetValue((object)true); if (value2 != null) { foreach (App_PerkPage_Card item in value2) { if ((Object)(object)item != (Object)(object)value) { item.DisableCard(); item.LockCard(); item.UpdateCard(); } } } if ((Object)(object)value3.worldInterface != (Object)null && value3.worldInterface.computerID != "") { CL_GameManager.SetGameFlag("recieved-" + value3.worldInterface.computerID + "-perk", true, "", false, false); } if ((Object)(object)__instance.outOfPerksRoot != (Object)null) { __instance.outOfPerksRoot.SetActive(true); } if ((Object)(object)__instance.reloadSettingsRoot != (Object)null) { __instance.reloadSettingsRoot.SetActive(false); } } return false; } return true; } } [HarmonyPatch(typeof(App_PerkPage), "PurchaseRefresh")] public class App_PerkPage_PurchaseRefresh_Patch { [HarmonyPrefix] private static bool Prefix(App_PerkPage __instance) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Invalid comparison between Unknown and I4 if ((int)__instance.perkPageType == 10) { OS_Manager value = Traverse.Create((object)__instance).Field("os").GetValue(); if ((Object)(object)value != (Object)null && (Object)(object)value.audioClipHandler != (Object)null) { value.audioClipHandler.PlaySound("os:error"); } return false; } return true; } } [HarmonyPatch(typeof(ENV_RhoAltar), "CheckItemObject")] public class ENV_RhoAltar_MothersUpgrade_Patch { [HarmonyPrefix] public static bool Prefix(ENV_RhoAltar __instance, Item_Object item) { //IL_011d: 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_012d: 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_0148: Expected O, but got Unknown //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Expected O, but got Unknown //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Expected O, but got Unknown //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_01c6: 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_01e1: Expected O, but got Unknown //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Expected O, but got Unknown //IL_00ac: 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) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: 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_00d9: 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_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_0247: Unknown result type (might be due to invalid IL or missing references) ENT_Player player = ENT_Player.GetPlayer(); if (player.HasPerk("Perk_MotherlyInstinct") && __instance.maxTrades <= 1) { __instance.maxTrades++; } if ((Object)(object)item == (Object)null) { return true; } if ((Object)(object)player == (Object)null) { return true; } if (player.HasPerk("severon_mothersupgrade_perk") && ((Object)item).name.Contains("Grub")) { BuffContainer val = ((GameEntity)player).curBuffs.GetBuffContainer("severon_mothersupgrade_stats"); if (val == null) { val = new BuffContainer { id = "severon_mothersupgrade_stats", desc = "Mother's Upgrade Stats", loseOverTime = false, loseRate = 0f, buffTime = 1f, multiplier = 1f, buffs = new List() }; ((GameEntity)player).curBuffs.AddBuff(val); } Debug.Log((object)"Adding Buffs for grub murder."); val.buffs.Add(new Buff { id = "addStamina", maxAmount = 0.07f, amount = 0.07f }); val.buffs.Add(new Buff { id = "addJump", maxAmount = 0.07f, amount = 0.07f }); val.buffs.Add(new Buff { id = "addSpeed", maxAmount = 0.07f, amount = 0.07f }); val.buffs.Add(new Buff { id = "addClimb", maxAmount = 0.07f, amount = 0.07f }); val.buffs.Add(new Buff { id = "addReach", maxAmount = 0.07f, amount = 0.07f }); item.canPickup = false; Object.Destroy((Object)(object)((Component)item).gameObject); if ((Object)(object)__instance.acceptSound != (Object)null) { AudioManager.PlaySound(__instance.acceptSound, ((Component)__instance).transform.position, 1f, 1f, 1f, false, 1f, (AudioMixerGroup)null, ""); } if (__instance.tradeEvent != null) { __instance.tradeEvent.Invoke(); } return false; } return true; } } [HarmonyPatch(typeof(ENT_Player), "Update")] public class ENT_Player_RabbitSpirit_Patch { [HarmonyPostfix] public static void Postfix(ENT_Player __instance) { if (!((Object)(object)__instance == (Object)null) && __instance.HasPerk("severon_rabbit_spirit_perk") && __instance.IsHanging()) { Traverse.Create((object)__instance).Field("isGrounded").SetValue((object)true); } } } public static class PlayerGroundedSpoofer { [HarmonyPatch(typeof(ENT_Player), "Movement")] public static class MovementPatch { [HarmonyPrefix] public static void Prefix() { _isUpdatingPhysics = true; } [HarmonyPostfix] public static void Postfix() { _isUpdatingPhysics = false; } } [HarmonyPatch(typeof(ENT_Player), "IsGrounded", new Type[] { typeof(bool) })] public static class IsGroundedPatch { [HarmonyPrefix] public static bool Prefix(ENT_Player __instance, ref bool __result) { if (_isUpdatingPhysics) { return true; } if (__instance.HasPerk("severon_rabbit_spirit_perk") && __instance.IsHanging()) { __result = true; return false; } return true; } } [HarmonyPatch(typeof(ENT_Player), "IsCrouching")] public static class IsCrouchingPatch { [HarmonyPrefix] public static bool Prefix(ENT_Player __instance, ref bool __result) { if (_isUpdatingPhysics) { return true; } if (__instance.HasPerk("severon_rabbit_spirit_perk") && __instance.IsHanging()) { __result = true; return false; } return true; } } [HarmonyPatch(typeof(ENT_Player), "Jump")] public static class JumpPatch { private static bool _wasSpoofed; private static bool _realCrouching; private static bool _realIsGrounded; private static PlayerState _realPlayerState; [HarmonyPrefix] public static void Prefix(ENT_Player __instance, ref bool ___crouching, ref bool ___isGrounded, ref PlayerState ___playerState) { //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Invalid comparison between Unknown and I4 //IL_00a0: Unknown result type (might be due to invalid IL or missing references) if (__instance.HasPerk("severon_conviction_perk") && (double)Random.value < 0.6) { ENT_Player.GetPlayer().AddExtraJumpsOneTime(1); } if (!__instance.HasPerk("severon_rabbit_spirit_perk") || !__instance.IsHanging()) { return; } Hand[] hands = __instance.hands; foreach (Hand val in hands) { if ((int)val.interactState == 4) { __instance.StopInteraction(val.id, "jump", true); } } _realCrouching = ___crouching; _realIsGrounded = ___isGrounded; _realPlayerState = ___playerState; _wasSpoofed = true; ___crouching = true; ___isGrounded = true; ___playerState = (PlayerState)0; } [HarmonyPostfix] public static void Postfix(ENT_Player __instance, ref bool ___crouching, ref bool ___isGrounded, ref PlayerState ___playerState) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected I4, but got Unknown if (_wasSpoofed) { ___crouching = _realCrouching; ___isGrounded = _realIsGrounded; ___playerState = (PlayerState)(int)_realPlayerState; _wasSpoofed = false; } } } private static bool _isUpdatingPhysics; } [HarmonyPatch(typeof(HandItem_Food), "Eat")] public class HandItem_Food_Eat_MetabolicOverdrive_Patch { [HarmonyPostfix] public static void Postfix(HandItem_Food __instance) { ENT_Player player = ENT_Player.GetPlayer(); if ((Object)(object)player != (Object)null && player.HasPerk("severon_metabolic_overdrive") && __instance.buff != null) { ((GameEntity)CL_GameManager.gMan.localPlayer).Buff(__instance.buff); ((GameEntity)CL_GameManager.gMan.localPlayer).Buff(__instance.buff); } } } [HarmonyPatch(typeof(HandItem_Buff), "Activate")] public class HandItem_Buff_Activate_MetabolicOverdrive_Patch { [HarmonyPostfix] public static void Postfix(HandItem_Buff __instance) { ENT_Player player = ENT_Player.GetPlayer(); if (!((Object)(object)player != (Object)null) || !player.HasPerk("severon_metabolic_overdrive")) { return; } if (__instance.buff != null) { ((GameEntity)CL_GameManager.gMan.localPlayer).Buff(__instance.buff); ((GameEntity)CL_GameManager.gMan.localPlayer).Buff(__instance.buff); } if (!__instance.useSecondaryBuffs || __instance.secondaryBuffs == null) { return; } foreach (BuffContainer secondaryBuff in __instance.secondaryBuffs) { if (secondaryBuff != null) { ((GameEntity)CL_GameManager.gMan.localPlayer).Buff(secondaryBuff); ((GameEntity)CL_GameManager.gMan.localPlayer).Buff(secondaryBuff); } } } } [HarmonyPatch(typeof(HandItem_Shoot), "Shoot")] public class HandItem_Shoot_BartenderRecoil_Patch { [HarmonyPostfix] public static void Postfix(HandItem_Shoot __instance) { //IL_006b: 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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: 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) ENT_Player player = ENT_Player.GetPlayer(); if ((Object)(object)player != (Object)null && player.HasPerk("severon_bartender_perk") && (Object)(object)__instance != (Object)null && ((Object)__instance).name != null && ((Object)__instance).name.ToLower().Contains("rebar") && (Object)(object)Camera.main != (Object)null) { Vector3 val = -((Component)Camera.main).transform.forward * 5f; ((GameEntity)player).AddForce(val, ""); } } } [HarmonyPatch(typeof(Hand), "DamageGripStrength")] public class ENT_Player_Hand_DamageGripStrength_Patch { [HarmonyPrefix] public static bool Prefix() { ENT_Player player = ENT_Player.GetPlayer(); if ((Object)(object)player != (Object)null && player.HasPerk("severon_insect_perk")) { return false; } return true; } } [CreateAssetMenu(fileName = "DenizenDatabase", menuName = "Custom/Denizen Database")] public class DenizenDatabase : ScriptableObject { [Serializable] public struct DenizenEntry { public string id; public Denizen prefab; } public List entries = new List(); public Denizen GetPrefabByID(string id) { foreach (DenizenEntry entry in entries) { if (entry.id == id) { return entry.prefab; } } Debug.LogError((object)("[DenizenDatabase] No Denizen found with ID: " + id)); return null; } } [Serializable] public class DenizenReplaceInfo : ReplaceInfo { [Header("Denizen By ID Setup")] public string targetDenizenID; public DenizenDatabase database; public void ResolvePrefab() { if ((Object)(object)database != (Object)null && !string.IsNullOrEmpty(targetDenizenID)) { base.replacementPrefab = (GameEntity)(object)database.GetPrefabByID(targetDenizenID); } } public GameEntity ReplaceE(GameEntity entity) { if ((Object)(object)base.replacementPrefab == (Object)null) { ResolvePrefab(); } GameEntity val = ((ReplaceInfo)this).Replace(entity); if ((Object)(object)val != (Object)null) { Denizen val2 = (Denizen)(object)((val is Denizen) ? val : null); if ((Object)(object)val2 != (Object)null) { val2.Initialize(); } } return val; } } [HarmonyPatch(typeof(DEN_BasicDenizen_Flier), "Update")] public static class Patch_DenizenMovement_PheromoneAttraction { [HarmonyPrefix] public static void Prefix(DEN_BasicDenizen_Flier __instance) { //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Expected O, but got Unknown //IL_0116: 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) //IL_012f: Unknown result type (might be due to invalid IL or missing references) if (!ENT_Player.GetPlayer().HasPerk("severon_insect_perk")) { return; } ((DEN_BasicDenizen)__instance).movementModule.SetSpeedMult(3f); if (!((Object)(object)((AIGameEntity)__instance).GetTargetEntity() != (Object)null)) { return; } CL_Handhold component = ((Component)__instance).GetComponent(); if ((Object)(object)component != (Object)null) { component.climbGrav = 0f; HandholdModule_FlierSteering val = (HandholdModule_FlierSteering)component.modules.Find((HandholdModule m) => m is HandholdModule_FlierSteering); if (val != null && val.canBuck) { val.canBuck = false; val.steerDownwardsForce = 3f; val.steerHorizontalForce = 3f; val.steerUpwardsForce = 3f; val.gravityForce = 0f; val.forceMult = 2f; } } if ((Object)(object)component == (Object)null || !component.GetHolding()) { ((AIGameEntity)__instance).SetTargetPosition(((Component)((AIGameEntity)__instance).GetTargetEntity()).transform.position + new Vector3(0f, 3f, 0f)); } } } [HarmonyPatch(typeof(HandItem), "Use")] public class Patch_HandItem_Use { [HarmonyPrefix] public static bool Prefix(HandItem __instance) { Hand_Roach_Base component = ((Component)__instance).GetComponent(); if ((Object)(object)component == (Object)null) { return true; } ENT_Player player = ENT_Player.GetPlayer(); if ((Object)(object)player == (Object)null) { return true; } if (player.HasPerk("severon_hunger_perk")) { EatRoach(__instance, player, component); return false; } return true; } private static void EatRoach(HandItem item, ENT_Player player, Hand_Roach_Base roachBase) { //IL_008d: 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_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: 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_00f2: 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_0108: 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_011f: Expected O, but got Unknown //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Expected O, but got Unknown //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_0199: 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_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Expected O, but got Unknown //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: 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_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Expected O, but got Unknown //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: 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_0213: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Expected O, but got Unknown //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Expected O, but got Unknown //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Expected O, but got Unknown //IL_02be: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_02e9: Expected O, but got Unknown //IL_02f0: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_0300: Unknown result type (might be due to invalid IL or missing references) //IL_030b: Unknown result type (might be due to invalid IL or missing references) //IL_031b: Expected O, but got Unknown //IL_0352: Unknown result type (might be due to invalid IL or missing references) //IL_0357: Unknown result type (might be due to invalid IL or missing references) //IL_0362: Unknown result type (might be due to invalid IL or missing references) //IL_036d: Unknown result type (might be due to invalid IL or missing references) //IL_037d: Expected O, but got Unknown //IL_0384: Unknown result type (might be due to invalid IL or missing references) //IL_0389: Unknown result type (might be due to invalid IL or missing references) //IL_0394: Unknown result type (might be due to invalid IL or missing references) //IL_039f: Unknown result type (might be due to invalid IL or missing references) //IL_03af: Expected O, but got Unknown //IL_03b6: Unknown result type (might be due to invalid IL or missing references) //IL_03bb: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03d1: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Expected O, but got Unknown //IL_03e8: 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_03f8: Unknown result type (might be due to invalid IL or missing references) //IL_0403: Unknown result type (might be due to invalid IL or missing references) //IL_0413: Expected O, but got Unknown //IL_044a: Unknown result type (might be due to invalid IL or missing references) //IL_044f: Unknown result type (might be due to invalid IL or missing references) //IL_045a: Unknown result type (might be due to invalid IL or missing references) //IL_0465: Unknown result type (might be due to invalid IL or missing references) //IL_0475: Expected O, but got Unknown //IL_047c: Unknown result type (might be due to invalid IL or missing references) //IL_0481: Unknown result type (might be due to invalid IL or missing references) //IL_048c: Unknown result type (might be due to invalid IL or missing references) //IL_0497: Unknown result type (might be due to invalid IL or missing references) //IL_04a7: Expected O, but got Unknown //IL_04ae: Unknown result type (might be due to invalid IL or missing references) //IL_04b3: Unknown result type (might be due to invalid IL or missing references) //IL_04be: Unknown result type (might be due to invalid IL or missing references) //IL_04c9: Unknown result type (might be due to invalid IL or missing references) //IL_04d9: Expected O, but got Unknown //IL_04e0: Unknown result type (might be due to invalid IL or missing references) //IL_04e5: Unknown result type (might be due to invalid IL or missing references) //IL_04f0: Unknown result type (might be due to invalid IL or missing references) //IL_04fb: Unknown result type (might be due to invalid IL or missing references) //IL_050b: Expected O, but got Unknown player.AddGripStrength(10f, false, false); player.OnEat("food"); ((GameEntity)player).Heal(2f); item.item.SetUsed(true); AudioClip val = null; AudioClip[] array = Resources.FindObjectsOfTypeAll(); AudioClip[] array2 = array; foreach (AudioClip val2 in array2) { if (((Object)val2).name == "item_roach_lemon_eat") { val = val2; break; } } if ((Object)(object)val != (Object)null) { AudioManager.PlaySound(val, ((Component)player).transform.position, 1f, 1f, 1f, false, 1f, (AudioMixerGroup)null, ""); } BuffContainer val3 = ((GameEntity)player).curBuffs.GetBuffContainer("severon_roacheating_stats"); if (val3 == null) { val3 = new BuffContainer { id = "severon_roacheating_stats", desc = "", loseOverTime = false, loseRate = 0f, buffTime = 1f, multiplier = 1f, buffs = new List() }; ((GameEntity)player).curBuffs.AddBuff(val3); } if (((Object)item).name.Contains("gold") || ((Object)item).name.Contains("Gold")) { val3.buffs.Add(new Buff { id = "addStaminaRegen", maxAmount = 0.01f, amount = 0.01f }); val3.buffs.Add(new Buff { id = "addJump", maxAmount = 0.01f, amount = 0.01f }); val3.buffs.Add(new Buff { id = "addSpeed", maxAmount = 0.01f, amount = 0.01f }); val3.buffs.Add(new Buff { id = "addClimb", maxAmount = 0.01f, amount = 0.01f }); } if (((Object)item).name.Contains("platinum") || ((Object)item).name.Contains("Platinum")) { val3.buffs.Add(new Buff { id = "addStaminaRegen", maxAmount = 0.05f, amount = 0.05f }); val3.buffs.Add(new Buff { id = "addJump", maxAmount = 0.05f, amount = 0.05f }); val3.buffs.Add(new Buff { id = "addSpeed", maxAmount = 0.05f, amount = 0.05f }); val3.buffs.Add(new Buff { id = "addClimb", maxAmount = 0.05f, amount = 0.05f }); } if (((Object)item).name.Contains("lemon") || ((Object)item).name.Contains("Lemon")) { val3.buffs.Add(new Buff { id = "addStaminaRegen", maxAmount = 0.07f, amount = 0.07f }); val3.buffs.Add(new Buff { id = "addJump", maxAmount = 0.07f, amount = 0.07f }); val3.buffs.Add(new Buff { id = "addSpeed", maxAmount = 0.07f, amount = 0.07f }); val3.buffs.Add(new Buff { id = "addClimb", maxAmount = 0.07f, amount = 0.07f }); } if (((Object)item).name.Contains("ruby") || ((Object)item).name.Contains("Ruby")) { val3.buffs.Add(new Buff { id = "addStaminaRegen", maxAmount = 0.15f, amount = 0.15f }); val3.buffs.Add(new Buff { id = "addJump", maxAmount = 0.15f, amount = 0.15f }); val3.buffs.Add(new Buff { id = "addSpeed", maxAmount = 0.15f, amount = 0.15f }); val3.buffs.Add(new Buff { id = "addClimb", maxAmount = 0.15f, amount = 0.15f }); } if ((Object)(object)((Component)item).gameObject != (Object)null) { item.RemoveItem(); } } } public class PerkModule_FastReload : PerkModule { public BuffContainer reloadBuff; public float reloadSpeedMultiplier = 0.7f; public override void Initialize(Perk p, bool firstTime) { ((PerkModule)this).Initialize(p, firstTime); reloadBuff.id = "reloadBuff"; ENT_Player player = ENT_Player.GetPlayer(); if (((GameEntity)player).curBuffs.GetBuffContainer(reloadBuff.id) == null) { ((GameEntity)player).curBuffs.AddBuff(reloadBuff); } BuffContainer buffContainer = ((GameEntity)player).curBuffs.GetBuffContainer(reloadBuff.id); buffContainer.loseOverTime = false; Perk perk = player.GetPerk("severon_soldier_perk"); int num = ((!((Object)(object)perk != (Object)null)) ? 1 : perk.GetStackAmount()); buffContainer.SetMultiplier((float)num * reloadSpeedMultiplier); } public override void Update() { ((PerkModule)this).Update(); ENT_Player player = ENT_Player.GetPlayer(); Perk perk = player.GetPerk("severon_soldier_perk"); BuffContainer buffContainer = ((GameEntity)player).curBuffs.GetBuffContainer(reloadBuff.id); if ((Object)(object)perk != (Object)null && buffContainer != null) { buffContainer.SetMultiplier((float)perk.GetStackAmount() * reloadSpeedMultiplier); } } } public class PerkModule_JumpCombo : PerkModule { public BuffContainer buff; public float buffMultiplier = 1f; [Header("Combo Settings")] public float buffAmount = 0f; public float buffMax = 3f; public float buffIncreasePerJump = 1f; public float buffDecayRate = 5f; private BuffContainer currentBuff; private float baseMaxAmount = 0.35f; public override void Initialize(Perk p, bool firstTime) { ((PerkModule)this).Initialize(p, firstTime); ENT_Player player = ENT_Player.GetPlayer(); if (buff.id != "") { currentBuff = ((GameEntity)player).curBuffs.GetBuffContainer(buff.id); } if (currentBuff == null) { ((GameEntity)player).curBuffs.AddBuff(buff); currentBuff = ((GameEntity)player).curBuffs.GetBuffContainer(buff.id); } player._OnJump = (Action)Delegate.Combine(player._OnJump, new Action(OnJump)); currentBuff.SetMultiplier(0f); if (currentBuff.buffs.Count > 0) { baseMaxAmount = currentBuff.buffs[0].maxAmount; Perk perk = player.GetPerk("severon_acrobatic_leap_perk"); int num = ((!((Object)(object)perk != (Object)null)) ? 1 : perk.GetStackAmount()); currentBuff.buffs[0].maxAmount = baseMaxAmount * (float)num; } } public override void Update() { ((PerkModule)this).Update(); ENT_Player player = ENT_Player.GetPlayer(); Perk perk = player.GetPerk("severon_acrobatic_leap_perk"); if ((Object)(object)perk != (Object)null && currentBuff != null && currentBuff.buffs.Count > 0) { currentBuff.buffs[0].maxAmount = baseMaxAmount * (float)perk.GetStackAmount(); currentBuff.buffs[0].amount = baseMaxAmount * (float)perk.GetStackAmount(); } if (player.IsGrounded(false) || player.IsHanging()) { buffAmount -= buffDecayRate * Time.deltaTime; } buffAmount = Mathf.Clamp(buffAmount, 0f, buffMax); currentBuff.SetMultiplier(buffAmount * buffMultiplier); } public void OnJump() { ENT_Player player = ENT_Player.GetPlayer(); if (!(player.GetTimeSinceGrounded() > 1f)) { buffAmount += buffIncreasePerJump; buffAmount = Mathf.Clamp(buffAmount, 0f, buffMax); } } public override void OnDestroy(Perk p) { ENT_Player player = ENT_Player.GetPlayer(); ((GameEntity)player).curBuffs.RemoveBuffContainer(buff.id); player._OnJump = (Action)Delegate.Remove(player._OnJump, new Action(OnJump)); ((PerkModule)this).OnDestroy(p); } } public class PerkModule_Scavenging : PerkModule { private int last_roaches = 0; private int updateCounter = 0; public override void Initialize(Perk p, bool firstTime) { ((PerkModule)this).Initialize(p, firstTime); Random random = new Random(); if (random.Next(100) < 5) { Inventory.instance.AddItemToInventoryCenter(CL_AssetManager.GetItemObjectPrefab("Item_Beans_Periphery", "").itemData.GetClone((Item)null, false)); } else if (random.Next(100) < 20) { Inventory.instance.AddItemToInventoryCenter(CL_AssetManager.GetItemObjectPrefab("Item_Food_Bar", "").itemData.GetClone((Item)null, false)); } else if (random.Next(100) < 100) { Inventory.instance.AddItemToInventoryCenter(CL_AssetManager.GetItemObjectPrefab("Item_Beans", "").itemData.GetClone((Item)null, false)); } random = new Random(); if (random.Next(100) < 1) { Inventory.instance.AddItemToInventoryCenter(CL_AssetManager.GetItemObjectPrefab("Item_Beans_Periphery", "").itemData.GetClone((Item)null, false)); } else if (random.Next(100) < 20) { Inventory.instance.AddItemToInventoryCenter(CL_AssetManager.GetItemObjectPrefab("Item_Food_Bar", "").itemData.GetClone((Item)null, false)); } else if (random.Next(100) < 100) { Inventory.instance.AddItemToInventoryCenter(CL_AssetManager.GetItemObjectPrefab("Item_Beans", "").itemData.GetClone((Item)null, false)); } } public override void Update() { ((PerkModule)this).Update(); updateCounter++; if (updateCounter < 50) { return; } updateCounter = 0; int roaches = CL_GameManager.GetRoaches(false); for (int i = 0; i < ENT_Player.GetPlayer().GetPerk("severon_scavenge_perk").GetStackAmount(); i++) { if (roaches < last_roaches) { Random random = new Random(); if (random.Next(100) < 1) { Inventory.instance.AddItemToInventoryCenter(CL_AssetManager.GetItemObjectPrefab("Item_Beans_Periphery", "").itemData.GetClone((Item)null, false)); } else if (random.Next(100) < 20) { Inventory.instance.AddItemToInventoryCenter(CL_AssetManager.GetItemObjectPrefab("Item_Food_Bar", "").itemData.GetClone((Item)null, false)); } else if (random.Next(100) < 100) { Inventory.instance.AddItemToInventoryCenter(CL_AssetManager.GetItemObjectPrefab("Item_Beans", "").itemData.GetClone((Item)null, false)); } random = new Random(); if (random.Next(100) < 1) { Inventory.instance.AddItemToInventoryCenter(CL_AssetManager.GetItemObjectPrefab("Item_Beans_Periphery", "").itemData.GetClone((Item)null, false)); } else if (random.Next(100) < 20) { Inventory.instance.AddItemToInventoryCenter(CL_AssetManager.GetItemObjectPrefab("Item_Food_Bar", "").itemData.GetClone((Item)null, false)); } else if (random.Next(100) < 100) { Inventory.instance.AddItemToInventoryCenter(CL_AssetManager.GetItemObjectPrefab("Item_Beans", "").itemData.GetClone((Item)null, false)); } } } last_roaches = roaches; } public override void OnDestroy(Perk p) { ((PerkModule)this).OnDestroy(p); } } public class PerkModule_WallJump : PerkModule { public BuffContainer wallJumpBuff; public string perkID = "severon_wall_jump_perk"; public int jumpsPerStack = 1; public float horizontalPushForce = 0.43f; public float verticalJumpForce = 0f; private int currentWallJumps = 0; private FieldInfo hasJumpedField; private bool jumpGranted = false; private Vector3 lastWallNormal = Vector3.zero; public override void Initialize(Perk p, bool firstTime) { ((PerkModule)this).Initialize(p, firstTime); ENT_Player player = ENT_Player.GetPlayer(); hasJumpedField = typeof(ENT_Player).GetField("temporaryExtraJumpsRemaining", BindingFlags.Instance | BindingFlags.NonPublic); player._OnJump = (Action)Delegate.Combine(player._OnJump, new Action(OnJump)); } public override void Update() { //IL_005b: 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) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Invalid comparison between Unknown and I4 //IL_009a: 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_00a1: 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_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) ((PerkModule)this).Update(); ENT_Player player = ENT_Player.GetPlayer(); Perk perk = player.GetPerk(perkID); int num = ((!((Object)(object)perk != (Object)null)) ? 1 : perk.GetStackAmount()) * jumpsPerStack; if (player.IsHanging() || player.IsGrounded(false)) { currentWallJumps = 0; jumpGranted = false; lastWallNormal = Vector3.zero; } else { if (currentWallJumps >= num) { return; } if ((player.cCon.collisionFlags & 1) > 0) { Vector3 wallNormal = GetWallNormal(player); if (wallNormal != Vector3.zero) { lastWallNormal = wallNormal; } if (hasJumpedField != null && !jumpGranted) { jumpGranted = true; hasJumpedField.SetValue(player, 1); } } else if (jumpGranted) { jumpGranted = false; if (hasJumpedField != null) { hasJumpedField.SetValue(player, 0); } } } } public void OnJump() { //IL_0042: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0080: 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) //IL_008c: 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_009c: 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_00a4: Unknown result type (might be due to invalid IL or missing references) ENT_Player player = ENT_Player.GetPlayer(); if (!player.IsGrounded(false) && jumpGranted && !player.IsHanging()) { currentWallJumps++; jumpGranted = false; if (lastWallNormal != Vector3.zero) { Vector3 val = new Vector3(lastWallNormal.x, 0f, lastWallNormal.z); Vector3 normalized = ((Vector3)(ref val)).normalized; Vector3 val2 = normalized * horizontalPushForce + Vector3.up * verticalJumpForce; ((GameEntity)player).AddForce(val2, ""); } } } private Vector3 GetWallNormal(ENT_Player player) { //IL_002d: 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_003f: 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_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: 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_006d: 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_007f: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: 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_009d: 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_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: 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_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: 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_00ef: 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_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0115: 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) //IL_011f: 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) //IL_0128: 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_0151: 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_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: 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_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0172: 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) //IL_01a2: 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_018a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)player.cCon == (Object)null) { return Vector3.zero; } Vector3[] obj = new Vector3[8] { ((Component)player).transform.forward, -((Component)player).transform.forward, ((Component)player).transform.right, -((Component)player).transform.right, default(Vector3), default(Vector3), default(Vector3), default(Vector3) }; Vector3 val = ((Component)player).transform.forward + ((Component)player).transform.right; obj[4] = ((Vector3)(ref val)).normalized; val = ((Component)player).transform.forward - ((Component)player).transform.right; obj[5] = ((Vector3)(ref val)).normalized; val = -((Component)player).transform.forward + ((Component)player).transform.right; obj[6] = ((Vector3)(ref val)).normalized; val = -((Component)player).transform.forward - ((Component)player).transform.right; obj[7] = ((Vector3)(ref val)).normalized; Vector3[] array = (Vector3[])(object)obj; float num = player.cCon.radius + 0.3f; Vector3 val2 = ((Component)player).transform.position + player.cCon.center; Vector3[] array2 = array; RaycastHit val4 = default(RaycastHit); foreach (Vector3 val3 in array2) { if (Physics.Raycast(val2, val3, ref val4, num)) { return ((RaycastHit)(ref val4)).normal; } } return Vector3.zero; } public override void OnDestroy(Perk p) { ENT_Player player = ENT_Player.GetPlayer(); if ((Object)(object)player != (Object)null) { ((GameEntity)player).curBuffs.RemoveBuffContainer(wallJumpBuff?.id ?? "severon_walljump_buff"); player._OnJump = (Action)Delegate.Remove(player._OnJump, new Action(OnJump)); } ((PerkModule)this).OnDestroy(p); } } public class PerkModule_Warlock : PerkModule { public override void Initialize(Perk p, bool firstTime) { Spells.Start(ENT_Player.GetPlayer().hands[1]); } } public static class Spells { public class SpellItem { public string Name; public string Group; public float ConsumedOnUse; public float Power = 1f; public float Reach = 1f; public float Utility = 1f; } private static readonly FieldInfo particleDictField; public static Dictionary> SpellDictionary; public static Dictionary RegisteredItems; private static Dictionary prefabCache; static Spells() { particleDictField = typeof(FXManager).GetField("particleDict", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); SpellDictionary = new Dictionary>(); RegisteredItems = new Dictionary(); prefabCache = new Dictionary(); RegisterItem("Rebar", "Piton", 10f); RegisterItem("Note", "Target", 0f); RegisterItem("Hammer", "Weapon", 0f); RegisterItem("Rebar-Explosive", "Explosive", 10f); RegisterItem("Piton", "Piton", 40f); RegisterItem("SlugGrub", "Denizen", 5f); RegisterItem("Roach", "Denizen", 50f); RegisterItem("Bandage", "Buff", 50f); RegisterItem("Injector", "Buff", 20f); RegisterItem("PillBottle", "Buff", 10f); RegisterItem("10mm Ammo", "Explosive", 15f); RegisterItem("Handgun", "Projectile", 0f); RegisterItem("Rubble", "Projectile", 50f, 2f, 2f, 2f); RegisterItem("Flaregun Ammo", "Light", 35f); RegisterItem("Flaregun", "Explosive", 0f); RegisterItem("Flashlight", "Light", 1f); RegisterItem("Can of Beans", "Food", 70f); RegisterItem("Bean Bar", "Food", 20f, 1.1f, 1.1f, 1.1f); RegisterItem("Blink Eye", "Magic", 33f, 1.4f, 3f); RegisterItem("Rho Stone", "Magic", 0f); RegisterItem("Cleaver", "Weapon", 10f, 1.5f, 1.5f, 1.5f); RegisterSpell("Rebar", "", CastRebarBone); RegisterSpell("Rebar", "Piton", CastRebarRope); RegisterSpell("Rebar", "Explosive", CastRebarExplosive); RegisterSpell("Light", "Projectile", CastFlare); RegisterSpell("Rebar", "Projectile", CastRebar); RegisterSpell("Weapon", "", SimpleMelee); RegisterSpell("Rebar", "Rebar", CastRebarExtra); RegisterSpell("Weapon", "Rebar", SpearMelee); RegisterSpell("Weapon", "Piton", ComboMelee); RegisterSpell("Weapon", "SlugGrub", SpinAttack); RegisterSpell("Weapon", "Weapon", HeavyMelee); RegisterSpell("Weapon", "Explosive", MeleeExplosion); RegisterSpell("Explosive", "", ParryWhat); RegisterSpell("Explosive", "Magic", RangedExplosion); RegisterSpell("Piton", "", CastHandholdSpell); RegisterSpell("Piton", "SlugGrub", CastHandholdGrabSpell); RegisterSpell("Piton", "Piton", CastFloatingHandholdSpell); RegisterSpell("", "Light", CastWerelightWeakSpell); RegisterSpell("Light", "Light", CastWerelightStrongSpell); RegisterSpell("Magic", "", CastBasicTeleport); RegisterSpell("Projectile", "", CastEldritchBlast); RegisterSpell("Projectile", "Explosive", CastFireball); RegisterSpell("Injector", "", BasicBuff); RegisterSpell("Injector", "PillBottle", LongInjectorBuff); RegisterSpell("PillBottle", "", StaminaBuff); RegisterSpell("Buff", "Rebar", ReachClimbingBuff); RegisterSpell("Buff", "SlugGrub", GrubClimbingBuff); RegisterSpell("Buff", "Piton", ClimbingBuff); RegisterSpell("Buff", "Food", FoodHealBuff); RegisterSpell("Buff", "Weapon", BulletTimeBuff); RegisterSpell("Buff", "Explosive", FoodHealBuff); RegisterSpell("Buff", "Magic", FlightBuff); RegisterSpell("PillBottle", "Bean Bar", BarLongBuff); RegisterSpell("Target", "", CastFloatingTarget); } public static List GetCastingOrigins(bool FromHand = false) { //IL_0130: 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_0159: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) List list = new List(); if (AxisMarkerEntity.ObjectPositions != null && AxisMarkerEntity.ObjectPositions.Count > 0) { list.AddRange(AxisMarkerEntity.ObjectPositions); AxisMarkerEntity[] array = Object.FindObjectsOfType(); for (int i = 0; i < array.Length; i++) { if ((Object)(object)array[i] != (Object)null && (Object)(object)((Component)array[i]).gameObject != (Object)null) { Object.DestroyImmediate((Object)(object)((Component)array[i]).gameObject); } } AxisMarkerEntity.ObjectPositions.Clear(); } else if (FromHand) { if ((Object)(object)SpellManager.Instance != (Object)null) { list.Add(((Component)SpellManager.Instance).transform.position); } else if ((Object)(object)Camera.main != (Object)null) { list.Add(((Component)Camera.main).transform.position); } else if ((Object)(object)ENT_Player.GetPlayer() != (Object)null) { list.Add(((Component)ENT_Player.GetPlayer()).transform.position); } } else if ((Object)(object)Camera.main != (Object)null) { list.Add(((Component)Camera.main).transform.position); } else if ((Object)(object)ENT_Player.GetPlayer() != (Object)null) { list.Add(((Component)ENT_Player.GetPlayer()).transform.position); } if (list.Count == 0) { list.Add(Vector3.zero); } return list; } public static void RegisterItem(string name, string group, float consumedOnUse, float power = 1f, float reach = 1f, float utility = 1f) { if (!string.IsNullOrEmpty(name)) { RegisteredItems[name.Trim().ToUpperInvariant()] = new SpellItem { Name = name.Trim(), Group = (group ?? string.Empty).Trim(), ConsumedOnUse = consumedOnUse, Power = power, Reach = reach, Utility = utility }; } } private static string GetSpellKey(string a, string b) { string text = (a ?? string.Empty).Trim().ToUpperInvariant(); string text2 = (b ?? string.Empty).Trim().ToUpperInvariant(); return (string.Compare(text, text2, StringComparison.Ordinal) < 0) ? (text + "|" + text2) : (text2 + "|" + text); } public static void RegisterSpell(string itemA, string itemB, Action spellAction) { string spellKey = GetSpellKey(itemA, itemB); SpellDictionary[spellKey] = spellAction; } public static void Start(Hand hand) { if (hand != null && !((Object)(object)hand.handModel == (Object)null)) { SpellManager spellManager = ((Component)hand.handModel).gameObject.AddComponent(); spellManager.hand = hand; spellManager.targetDuration = 0.4f; spellManager.OnDurationReached = OnSpellCast; } } private static SpellItem ResolveItem(string rawName) { if (string.IsNullOrEmpty(rawName)) { return null; } string text = rawName.Trim().Replace("(Clone)", "").ToUpperInvariant(); if (RegisteredItems.TryGetValue(text, out var value)) { return value; } foreach (KeyValuePair registeredItem in RegisteredItems) { if (text.Contains(registeredItem.Key)) { return registeredItem.Value; } } return null; } private static bool TryFindSpell(string stringA, string stringB, out Action spellAction) { string spellKey = GetSpellKey(stringA, stringB); return SpellDictionary.TryGetValue(spellKey, out spellAction); } public static void OnSpellCast() { string leftTopItemName = TopPouchManager.GetLeftTopItemName(); string rightTopItemName = TopPouchManager.GetRightTopItemName(); SpellItem spellItem = ResolveItem(leftTopItemName); SpellItem spellItem2 = ResolveItem(rightTopItemName); float num = (spellItem?.Power ?? 0f) + (spellItem2?.Power ?? 0f); float num2 = (spellItem?.Reach ?? 0f) + (spellItem2?.Reach ?? 0f); float num3 = (spellItem?.Utility ?? 0f) + (spellItem2?.Utility ?? 0f); if (num == 0f) { num = 1f; } if (num2 == 0f) { num2 = 1f; } if (num3 == 0f) { num3 = 1f; } string text = spellItem?.Name ?? string.Empty; string text2 = spellItem2?.Name ?? string.Empty; string text3 = spellItem?.Group ?? string.Empty; string text4 = spellItem2?.Group ?? string.Empty; if (!(text == string.Empty) && !(text2 == string.Empty)) { num *= 0.5f; num2 *= 0.5f; num3 *= 0.5f; } if (text3.Equals("Power", StringComparison.OrdinalIgnoreCase)) { text = string.Empty; text3 = string.Empty; } if (text4.Equals("Power", StringComparison.OrdinalIgnoreCase)) { text2 = string.Empty; text4 = string.Empty; } Action spellAction = null; bool flag = false; if (!flag) { flag = TryFindSpell(text, text2, out spellAction); } if (!flag && !string.IsNullOrEmpty(text4)) { flag = TryFindSpell(text, text4, out spellAction); } if (!flag && !string.IsNullOrEmpty(text3)) { flag = TryFindSpell(text2, text3, out spellAction); } if (!flag && !string.IsNullOrEmpty(text3) && !string.IsNullOrEmpty(text4)) { flag = TryFindSpell(text3, text4, out spellAction); } if (flag) { spellAction?.Invoke(num, num2, num3); if (spellItem != null && spellItem.ConsumedOnUse > 0f) { float num4 = Random.Range(0f, 100f); if (num4 <= spellItem.ConsumedOnUse) { TopPouchManager.RemoveLeftTopItem(); } } if (spellItem2 != null && spellItem2.ConsumedOnUse > 0f) { float num5 = Random.Range(0f, 100f); if (num5 <= spellItem2.ConsumedOnUse) { TopPouchManager.RemoveRightTopItem(); } } } else { Debug.Log((object)("Combination not found: [" + leftTopItemName + "] (" + text3 + ") + [" + rightTopItemName + "] (" + text4 + ")")); } } public static bool ForceGrabHandhold(this Hand hand, Transform target, Vector3? customWorldPos = null) { //IL_005d: 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_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) if (hand == null || (Object)(object)target == (Object)null) { return false; } CL_Handhold val = ((Component)target).GetComponent() ?? ((Component)target).GetComponentInChildren() ?? ((Component)target).GetComponentInParent(); if ((Object)(object)val == (Object)null) { return false; } Vector3 val2 = (Vector3)(((??)customWorldPos) ?? ((Component)val).transform.position); if (hand.IsHolding()) { hand.DropHand(true); } hand.GrabHold(((Component)val).transform, val2, (InteractionInfo)null); return true; } public static void HealthCost(float cost) { //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) ENT_Player player = ENT_Player.GetPlayer(); if (!((Object)(object)player == (Object)null)) { DamageInfo val = DamageInfo.CreateDamageInfo(cost, "HealthCost", new List { "player" }, (GameEntity)(object)player); val.position = ((Component)player).transform.position; val.sourceEntity = (GameEntity)(object)player; val.sourceObject = ((Component)player).gameObject; ((GameEntity)player).Damage(val); } } private static void ApplyDamageAndForce(Collider collider, Vector3 hitPoint, float damage, float knockback, List damageTags, ENT_Player player) { //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_007c: 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_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_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) ObjectTagger val = ((Component)collider).GetComponent(); if ((Object)(object)val == (Object)null) { return; } Hitbox component = ((Component)val).GetComponent(); GameEntity val2 = ((component != null) ? component.GetGameEntity() : null); if ((Object)(object)val2 != (Object)null) { val = val2.GetTagger(); } if (val.HasTag("Damageable")) { Damageable component2 = ((Component)collider).GetComponent(); if (component2 != null) { DamageInfo val3 = DamageInfo.CreateDamageInfo(damage, "Melee", damageTags, (GameEntity)(object)player); val3.position = hitPoint; val3.sourceEntity = (GameEntity)(object)player; val3.sourceObject = ((Component)player).gameObject; component2.Damage(val3); } } if (knockback > 0f) { if ((val.HasTag("Prop") || val.HasTag("Denizen")) && (Object)(object)val2 != (Object)null) { val2.AddForceAtPosition(((Component)Camera.main).transform.forward * (knockback * 20f), hitPoint, ""); } else if ((Object)(object)val2 != (Object)null) { val2.AddForce(((Component)Camera.main).transform.forward * (knockback * 10f), ""); } } } public static GameObject GetCachedPrefab(string prefabName) { if (prefabCache.TryGetValue(prefabName, out var value) && (Object)(object)value != (Object)null) { return Object.Instantiate(value); } GameObject[] array = Resources.FindObjectsOfTypeAll(); foreach (GameObject val in array) { if (((Object)val).name == prefabName) { prefabCache[prefabName] = val; return Object.Instantiate(val); } } return null; } public static void ApplySpellBuff(string effectName, float value, float duration, float loseRate = 1f, bool useID = false) { //IL_00d8: 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) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: 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_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: 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_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Expected O, but got Unknown //IL_013c: Expected O, but got Unknown //IL_004b: 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_0057: 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_0069: 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_0077: 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) //IL_008b: Expected O, but got Unknown ENT_Player player = ENT_Player.GetPlayer(); if ((Object)(object)player == (Object)null || ((GameEntity)player).curBuffs == null) { return; } if (useID) { BuffContainer buffContainer = ((GameEntity)player).curBuffs.GetBuffContainer(effectName); if (buffContainer == null) { buffContainer = new BuffContainer { id = effectName, desc = "", loseOverTime = true, loseRate = loseRate, buffTime = duration, multiplier = value, buffs = new List() }; buffContainer.id = effectName; ((GameEntity)player).curBuffs.AddBuff(buffContainer); } else { BuffContainer obj = buffContainer; obj.buffTime += duration; } } else { string id = "spell_buff_" + Guid.NewGuid().ToString("N"); BuffContainer val = new BuffContainer { id = id, desc = "", loseOverTime = true, loseRate = loseRate, buffTime = duration, multiplier = 1f, buffs = new List { new Buff { id = effectName, maxAmount = value, amount = value } } }; ((GameEntity)player).curBuffs.AddBuff(val); } } public static GameObject CastAxisMarker(Vector3 position) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0012: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Axis_Marker_Root"); val.transform.position = position; AxisMarkerEntity axisMarkerEntity = val.AddComponent(); axisMarkerEntity.Build(); return val; } public static GameObject CastWeakWerelight(Vector3 position, float power) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0012: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Weak_Werelight_Root"); val.transform.position = position; WerelightEntity werelightEntity = val.AddComponent(); werelightEntity.Initialize(5f * power, 1f); werelightEntity.LampComponent.bypassLightmap = 1f; werelightEntity.LampComponent.forwardPlusHiddenMult = 1f; return val; } public static GameObject CastStrongWerelight(Vector3 position, float power) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0012: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Strong_Werelight_Root"); val.transform.position = position; WerelightEntity werelightEntity = val.AddComponent(); werelightEntity.Initialize(15f * power, 1f); werelightEntity.LampComponent.bypassLightmap = 1f; werelightEntity.LampComponent.forwardPlusHiddenMult = 1f; return val; } private static void ExecuteMeleeAttack(float damage, float range, float knockback, bool hitAllInRange, List damageTags, float power, float reach, float utility) { //IL_0042: 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_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: 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_0106: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0132: 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_00a5: 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_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_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: 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_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) ENT_Player player = ENT_Player.GetPlayer(); if ((Object)(object)player == (Object)null || (Object)(object)Camera.main == (Object)null) { return; } float damage2 = damage * power; float num = range * reach; float knockback2 = knockback * utility; Vector3 forward = ((Component)Camera.main).transform.forward; float num2 = 0.1f * reach; RaycastHit val3 = default(RaycastHit); foreach (Vector3 castingOrigin in GetCastingOrigins()) { if (hitAllInRange) { Collider[] array = Physics.OverlapSphere(castingOrigin, num); Collider[] array2 = array; foreach (Collider val in array2) { Vector3 val2 = ((Component)val).transform.position - castingOrigin; Vector3 normalized = ((Vector3)(ref val2)).normalized; if (Vector3.Dot(forward, normalized) > 0.5f) { Vector3 hitPoint = val.ClosestPoint(castingOrigin); ApplyDamageAndForce(val, hitPoint, damage2, knockback2, damageTags, player); SpawnHitEffects(hitPoint); } } } else if (Physics.SphereCast(castingOrigin, num2, forward, ref val3, num)) { ApplyDamageAndForce(((RaycastHit)(ref val3)).collider, ((RaycastHit)(ref val3)).point, damage2, knockback2, damageTags, player); SpawnHitEffects(((RaycastHit)(ref val3)).point); } } } private static void SpawnHitEffects(Vector3 hitPoint) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0012: 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_0047: Expected O, but got Unknown //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Expected O, but got Unknown //IL_0080: 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_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0121: 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_0197: 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) //IL_01c1: 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_0205: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("MeleeHitEffect"); val.transform.position = hitPoint; Shader val2 = Shader.Find("Sprites/Default") ?? Shader.Find("UI/Default") ?? Shader.Find("Legacy Shaders/Transparent/Diffuse"); Material val3 = new Material(val2); if (val3.HasProperty("_Color")) { val3.SetColor("_Color", Color.white); } if (val3.HasProperty("_BaseColor")) { val3.SetColor("_BaseColor", Color.white); } Material val4 = new Material(val2); if (val4.HasProperty("_Color")) { val4.SetColor("_Color", Color.yellow); } if (val4.HasProperty("_BaseColor")) { val4.SetColor("_BaseColor", Color.yellow); } GameObject val5 = GameObject.CreatePrimitive((PrimitiveType)0); Object.Destroy((Object)(object)val5.GetComponent()); val5.transform.SetParent(val.transform); val5.transform.localPosition = Vector3.zero; val5.transform.localScale = Vector3.one * 0.3f; Renderer component = val5.GetComponent(); if ((Object)(object)component != (Object)null) { component.material = val3; } Object.Destroy((Object)(object)val5, 0.05f); int num = 14; for (int i = 0; i < num; i++) { GameObject val6 = GameObject.CreatePrimitive((PrimitiveType)3); Object.Destroy((Object)(object)val6.GetComponent()); val6.transform.SetParent(val.transform); val6.transform.localPosition = Vector3.zero; float num2 = Random.Range(0.01f, 0.04f); val6.transform.localScale = Vector3.one * num2; Renderer component2 = val6.GetComponent(); if ((Object)(object)component2 != (Object)null) { component2.material = val4; } Rigidbody val7 = val6.AddComponent(); val7.useGravity = true; Vector3 onUnitSphere = Random.onUnitSphere; val7.velocity = onUnitSphere * Random.Range(3f, 6f); } Object.Destroy((Object)(object)val, 0.4f); } private static void TriggerExplosion(Vector3 position, string explosionPrefabName, string visualsPrefabName, float power, float reach, float utility) { //IL_0022: 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) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_008f: 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) GameObject cachedPrefab = GetCachedPrefab(explosionPrefabName); GameObject cachedPrefab2 = GetCachedPrefab(visualsPrefabName); if (!((Object)(object)cachedPrefab == (Object)null)) { GameObject val = Object.Instantiate(cachedPrefab, position, Quaternion.identity); UT_Explosion component = val.GetComponent(); component.damageMult = power; component.maxDistance *= utility; ExplosionEffect obj = component.effects[0]; obj.force *= utility; ExplosionEffect obj2 = component.effects[0]; obj2.distance *= utility; if ((Object)(object)cachedPrefab2 != (Object)null) { GameObject val2 = Object.Instantiate(cachedPrefab2, position, Quaternion.identity); Transform transform = val2.transform; transform.localScale *= utility; } if ((Object)(object)component != (Object)null) { component.runOnStart = false; component.Explode(); } } } private static void FireProjectiles(string prefabName, float speed, int count, float delay, float recoil, float power) { if (count <= 1 || delay <= 0f) { SpawnSingleProjectile(prefabName, speed, recoil, power); } else if ((Object)(object)SpellManager.Instance != (Object)null) { ((MonoBehaviour)SpellManager.Instance).StartCoroutine(FireProjectileRoutine(prefabName, speed, count, delay, recoil, power)); } } private static void SpawnSingleProjectile(string prefabName, float speed, float recoil, float power) { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005b: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0080: 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: Unknown result type (might be due to invalid IL or missing references) //IL_0094: 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_009c: 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_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_0109: 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_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: 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_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0148: 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_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0155: 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 cachedPrefab = GetCachedPrefab(prefabName); if ((Object)(object)cachedPrefab == (Object)null) { return; } ENT_Player player = ENT_Player.GetPlayer(); if ((Object)(object)player == (Object)null || (Object)(object)Camera.main == (Object)null) { return; } RaycastHit val3 = default(RaycastHit); foreach (Vector3 castingOrigin in GetCastingOrigins(FromHand: true)) { Vector3 val = Vector3.Lerp(castingOrigin, ((Component)Camera.main).transform.position, 0.8f) + -((Component)Camera.main).transform.forward * 0.4f; GameObject val2 = Object.Instantiate(cachedPrefab, val, Quaternion.LookRotation(((Component)Camera.main).transform.forward)); Transform transform = val2.transform; transform.localScale *= power; Projectile component = val2.GetComponent(); if ((Object)(object)component != (Object)null) { component.damageTags.Add("player"); if (Physics.Raycast(((Component)Camera.main).transform.position, ((Component)Camera.main).transform.forward, ref val3, float.PositiveInfinity)) { Vector3 val4 = ((RaycastHit)(ref val3)).point - val2.transform.position; Vector3 normalized = ((Vector3)(ref val4)).normalized; component.Initialize(normalized * speed, (GameEntity)(object)player, (Item)null); } else { Vector3 forward = ((Component)Camera.main).transform.forward; component.Initialize(forward * speed, (GameEntity)(object)player, (Item)null); } } if (recoil > 0f) { ((GameEntity)player).AddForce(-((Component)Camera.main).transform.forward * recoil, ""); } } } private static IEnumerator FireProjectileRoutine(string prefabName, float speed, int count, float delay, float recoil, float power) { for (int i = 0; i < count; i++) { SpawnSingleProjectile(prefabName, speed, recoil, power); yield return (object)new WaitForSeconds(delay); } } private static bool TryGetRaycastHit(Vector3 origin, out RaycastHit hit, float reach) { //IL_001e: 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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Camera.main == (Object)null) { hit = default(RaycastHit); return false; } Ray val = default(Ray); ((Ray)(ref val))..ctor(origin, ((Component)Camera.main).transform.forward); return Physics.Raycast(val, ref hit, reach); } private static CL_Handhold CreateHandhold(Vector3 position, Vector3 normal, float power) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0012: 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_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Expected O, but got Unknown //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown GameObject val = new GameObject("Summoned_Handhold_Root"); val.transform.position = position; val.transform.rotation = Quaternion.LookRotation(normal); val.transform.localScale = new Vector3(0.25f * power, 0.25f * power, 0.25f * power); HandholdEntity handholdEntity = val.AddComponent(); handholdEntity.Build(isFloating: false); CL_Handhold val2 = handholdEntity.InnerObject.AddComponent(); val2.activeEvent = new UnityEvent(); val2.stopEvent = new UnityEvent(); val2.hammerEvent = new UnityEvent(); val2.secure = true; val2.secureAmount = 1f; val2.active = true; val2.useSharedHandholdMaterial = false; val2.Initialize(); return val2; } private static CL_Handhold CreateFloatingHandhold(Vector3 position, Quaternion rotation, float power) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0012: 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_0041: 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_0072: Expected O, but got Unknown //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Expected O, but got Unknown //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Expected O, but got Unknown GameObject val = new GameObject("Floating_Handhold_Root"); val.transform.position = position; val.transform.rotation = rotation; val.transform.localScale = new Vector3(0.25f * power, 0.25f * power, 0.25f * power); HandholdEntity handholdEntity = val.AddComponent(); handholdEntity.Build(isFloating: true); CL_Handhold val2 = handholdEntity.InnerObject.AddComponent(); val2.activeEvent = new UnityEvent(); val2.stopEvent = new UnityEvent(); val2.hammerEvent = new UnityEvent(); val2.secure = true; val2.secureAmount = 1f; val2.active = true; val2.useSharedHandholdMaterial = false; val2.Initialize(); return val2; } private static Vector3 ExecuteTeleportLogic(float power, float reach, float utility) { //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) //IL_002d: 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_013a: 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_0077: 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_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0096: 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_009a: 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_00a4: 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_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_0103: 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_00c2: 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_00cf: 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_0134: 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) ENT_Player val = ENT_Player.GetPlayer() ?? ENT_Player.playerObject; if ((Object)(object)val == (Object)null || (Object)(object)Camera.main == (Object)null) { return Vector3.zero; } Vector3 forward = ((Component)Camera.main).transform.forward; float num = 10f * reach; float num2 = (((Object)(object)val.cCon != (Object)null) ? val.cCon.radius : 0.5f); Vector3 result = Vector3.zero; RaycastHit val3 = default(RaycastHit); foreach (Vector3 castingOrigin in GetCastingOrigins()) { Vector3 val2 = castingOrigin + forward * num; Physics.queriesHitBackfaces = true; if (Physics.SphereCast(castingOrigin, num2, forward, ref val3, num)) { val2 = castingOrigin + forward * ((RaycastHit)(ref val3)).distance; } Physics.queriesHitBackfaces = false; result = val2; ENT_Player.playerObject.DropHang(0f, 1f, false, "drop", false); ((GameEntity)ENT_Player.playerObject).Teleport(val2); ((GameEntity)ENT_Player.playerObject).ClearGrapple(); } return result; } public static void CastBasicTeleport(float p, float r, float u) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) ExecuteTeleportLogic(p, r, u); } public static void CastFloatingHandholdSpell(float p, float r, float u) { //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_0030: 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_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_0051: 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_0061: 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_0064: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Camera.main == (Object)null) { return; } foreach (Vector3 castingOrigin in GetCastingOrigins()) { Vector3 position = castingOrigin + ((Component)Camera.main).transform.forward * (2f * r); Quaternion rotation = ((Component)Camera.main).transform.rotation; CL_Handhold val = CreateFloatingHandhold(position, rotation, p); val.climbMult = 3f * u; val.jumpMult = 1.5f * p; ENT_Player.GetPlayer().hands[1].GrabHold(((Component)val).transform, ((Component)val).transform.position, (InteractionInfo)null); } } public static void CastFloatingTarget(float p, float r, float u) { //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_002a: 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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: 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) if ((Object)(object)Camera.main == (Object)null) { return; } foreach (Vector3 castingOrigin in GetCastingOrigins()) { Vector3 position = castingOrigin + ((Component)Camera.main).transform.forward * (2f * r); CastAxisMarker(position); } } public static void CastHandholdSpell(float p, float r, float u) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0019: 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_0036: Unknown result type (might be due to invalid IL or missing references) foreach (Vector3 castingOrigin in GetCastingOrigins()) { if (TryGetRaycastHit(castingOrigin, out var hit, 100f * r)) { CL_Handhold val = CreateHandhold(((RaycastHit)(ref hit)).point, ((RaycastHit)(ref hit)).normal, p); } } } public static void CastHandholdGrabSpell(float p, float r, float u) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0019: 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_0036: 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) foreach (Vector3 castingOrigin in GetCastingOrigins()) { if (TryGetRaycastHit(castingOrigin, out var hit, 100f * r)) { CL_Handhold val = CreateHandhold(((RaycastHit)(ref hit)).point, ((RaycastHit)(ref hit)).normal, p); ENT_Player.GetPlayer().hands[1].GrabHold(((Component)val).transform, ((Component)val).transform.position, (InteractionInfo)null); } } } public static void CastWerelightWeakSpell(float p, float r, float u) { //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_002a: 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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Camera.main == (Object)null) { return; } foreach (Vector3 castingOrigin in GetCastingOrigins()) { CastWeakWerelight(castingOrigin + ((Component)Camera.main).transform.forward * (2f * r), p); } } public static void CastWerelightStrongSpell(float p, float r, float u) { //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_002a: 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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Camera.main == (Object)null) { return; } foreach (Vector3 castingOrigin in GetCastingOrigins()) { CastStrongWerelight(castingOrigin + ((Component)Camera.main).transform.forward * (2f * r), p); } } private static void CastRebar(float p, float r, float u) { FireProjectiles("Projectile_Rebar", 50f * r, 1, 0f, 1f * u, p); } private static void CastRebarRope(float p, float r, float u) { HealthCost(1f); FireProjectiles("Projectile_RebarRope", 50f * r, 1, 0f, 1f * u, p); } private static void CastRebarBone(float p, float r, float u) { HealthCost(3f); FireProjectiles("Projectile_Rebar_Bone", 50f * r, 1, 0f, 1f * u, p); } private static void CastFlare(float p, float r, float u) { HealthCost(1f); FireProjectiles("Projectile_Flare", 50f * r, 1, 0f, 2f * u, p); } private static void CastRebarExplosive(float p, float r, float u) { FireProjectiles("Projectile_Rebar_Explosive", 50f * r, 1, 0f, 2f * u, p); } public static void CastRebarExtra(float p, float r, float u) { HealthCost(2f); FireProjectiles("Projectile_Rebar", 50f * r, 3, 0.1f / Mathf.Max(0.1f, u), 1f * u, p); } private static IEnumerator ComboMeleeRoutine(float p, float r, float u) { for (int i = 0; i < 4; i++) { ExecuteMeleeAttack(0.25f, 5f, 1f, hitAllInRange: false, new List { "player", "piton", "blunt" }, p, r, u); yield return (object)new WaitForSeconds(0.15f / Mathf.Max(0.1f, u)); } } public static void SimpleMelee(float p, float r, float u) { ExecuteMeleeAttack(1f, 5f, 1f, hitAllInRange: false, new List { "player", "piton", "blunt" }, p, r, u); } public static void SpearMelee(float p, float r, float u) { ExecuteMeleeAttack(1f, 80f, 1f, hitAllInRange: false, new List { "player", "piton", "blunt" }, p, r, u); } public static void HeavyMelee(float p, float r, float u) { ExecuteMeleeAttack(3f, 5f, 3f, hitAllInRange: false, new List { "player", "piton", "blunt" }, p, r, u); } public static void SpinAttack(float p, float r, float u) { ExecuteMeleeAttack(1f, 5f, 1f, hitAllInRange: true, new List { "player", "piton", "blunt" }, p, r, u); } public static void ComboMelee(float p, float r, float u) { if ((Object)(object)SpellManager.Instance != (Object)null) { ((MonoBehaviour)SpellManager.Instance).StartCoroutine(ComboMeleeRoutine(p, r, u)); } } public static void MeleeExplosion(float p, float r, float u) { //IL_0025: 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_003a: 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_006b: 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) //IL_0065: 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_007a: 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_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) float num = 5f; float num2 = num * r; float num3 = 0.2f; RaycastHit val = default(RaycastHit); foreach (Vector3 castingOrigin in GetCastingOrigins()) { Vector3 position = ((!((Object)(object)Camera.main != (Object)null) || !Physics.SphereCast(castingOrigin, num3, ((Component)Camera.main).transform.forward, ref val, num2)) ? (castingOrigin + (((Object)(object)Camera.main != (Object)null) ? ((Component)Camera.main).transform.forward : Vector3.forward) * num2) : ((RaycastHit)(ref val)).point); TriggerExplosion(position, "Explosion_Medium", "Effect_Explosion", p, r * 0.2f, u); } } public static void RangedExplosion(float p, float r, float u) { //IL_0025: 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_003a: 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_006b: 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) //IL_0065: 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_007a: 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_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) float num = 100f; float num2 = num * r; float num3 = 0.2f; RaycastHit val = default(RaycastHit); foreach (Vector3 castingOrigin in GetCastingOrigins()) { Vector3 position = ((!((Object)(object)Camera.main != (Object)null) || !Physics.SphereCast(castingOrigin, num3, ((Component)Camera.main).transform.forward, ref val, num2)) ? (castingOrigin + (((Object)(object)Camera.main != (Object)null) ? ((Component)Camera.main).transform.forward : Vector3.forward) * num2) : ((RaycastHit)(ref val)).point); TriggerExplosion(position, "Explosion_Medium", "Effect_Explosion", p, r, u); } } public static void ParryWhat(float p, float r, float u) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) foreach (Vector3 castingOrigin in GetCastingOrigins()) { TriggerExplosion(castingOrigin, "Explosion_Medium", "Effect_Explosion", p, r, u); } } public static void CastFireball(float p, float r, float u) { //IL_0044: 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_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown //IL_0057: 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: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: 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) if ((Object)(object)Camera.main == (Object)null) { return; } foreach (Vector3 castingOrigin in GetCastingOrigins(FromHand: true)) { GameObject val = new GameObject("fireball_projectile"); Vector3 position = Vector3.Lerp(castingOrigin, ((Component)Camera.main).transform.position, 0.8f) + -((Component)Camera.main).transform.forward * 0.4f; val.transform.position = position; CustomProjectileEntity customProjectileEntity = val.AddComponent(); Action onHitCallback = delegate(RaycastHit hit) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) TriggerExplosion(((RaycastHit)(ref hit)).point, "Explosion_Medium", "Effect_Explosion", p, r, u); }; customProjectileEntity.Build(new Color(1f, 0.35f, 0f, 1f), 45f * r, 1.5f * p, 0.2f, 4f * u, 0f, addTrail: true, 0.2f, onHitCallback); customProjectileEntity.Launch(((Component)Camera.main).transform.forward, (GameEntity)(object)ENT_Player.GetPlayer()); } } public static void CastEldritchBlast(float p, float r, float u) { //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_003b: Expected O, but got Unknown //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0046: 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_005f: 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: 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_0080: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Camera.main == (Object)null) { return; } foreach (Vector3 castingOrigin in GetCastingOrigins(FromHand: true)) { GameObject val = new GameObject("projectile"); Vector3 position = Vector3.Lerp(castingOrigin, ((Component)Camera.main).transform.position, 0.8f) + -((Component)Camera.main).transform.forward * 0.4f; val.transform.position = position; CustomProjectileEntity customProjectileEntity = val.AddComponent(); customProjectileEntity.Build(new Color(0f, 0.7f, 0.7f, 1f), 750f * r, 1.5f * p, 0.03f, 10f * u, 1f); customProjectileEntity.Launch(((Component)Camera.main).transform.forward, (GameEntity)(object)ENT_Player.GetPlayer()); } } public static void BasicBuff(float p, float r, float u) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) HealthCost(3f); foreach (Vector3 castingOrigin in GetCastingOrigins()) { ApplySpellBuff("addJump", 0.3f * p, 10f * (r * u)); ApplySpellBuff("roided", 0.6f * p, 10f * (r * u)); ApplySpellBuff("addSpeed", 0.3f * p, 10f * (r * u)); ApplySpellBuff("addClimb", 0.3f * p, 10f * (r * u)); ApplySpellBuff("addStaminaRegen", 0.3f * p, 10f * (r * u)); ApplySpellBuff("addFOV", 10f * p, 10f * (r * u)); } } public static void BarLongBuff(float p, float r, float u) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) HealthCost(4.5f); foreach (Vector3 castingOrigin in GetCastingOrigins()) { ApplySpellBuff("addJump", 0.08f * p, 360f * (r * u)); ApplySpellBuff("roided", 0.08f * p, 360f * (r * u)); ApplySpellBuff("addSpeed", 0.08f * p, 360f * (r * u)); ApplySpellBuff("addClimb", 0.08f * p, 360f * (r * u)); ApplySpellBuff("addStaminaRegen", 0.08f * p, 360f * (r * u)); ApplySpellBuff("addFOV", 2f * p, 360f * (r * u)); } } public static void LongInjectorBuff(float p, float r, float u) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) HealthCost(3f); foreach (Vector3 castingOrigin in GetCastingOrigins()) { ApplySpellBuff("addJump", 0.3f * p, 30f * (r * u)); ApplySpellBuff("pilled", 0.6f * p, 30f * (r * u)); ApplySpellBuff("roided", 0.6f * p, 30f * (r * u)); ApplySpellBuff("addSpeed", 0.6f * p, 30f * (r * u)); ApplySpellBuff("addClimb", 0.6f * p, 30f * (r * u)); ApplySpellBuff("addFOV", 10f * p, 30f * (r * u)); } } public static void StaminaBuff(float p, float r, float u) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) HealthCost(1.5f); foreach (Vector3 castingOrigin in GetCastingOrigins()) { ApplySpellBuff("addStamina", 1f * p, 30f * (r * u)); ApplySpellBuff("addStaminaRegen", 1f * p, 30f * (r * u)); ApplySpellBuff("pilled", 1f * p, 30f * (r * u)); } } public static void ReachClimbingBuff(float p, float r, float u) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) HealthCost(3f); foreach (Vector3 castingOrigin in GetCastingOrigins()) { ApplySpellBuff("addReach", 1f * p, 15f * (r * u)); ApplySpellBuff("addClimb", 1f * p, 15f * (r * u)); ApplySpellBuff("addFOV", 10f * p, 15f * (r * u)); } } public static void GrubClimbingBuff(float p, float r, float u) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) HealthCost(4f); foreach (Vector3 castingOrigin in GetCastingOrigins()) { ApplySpellBuff("grabAnything", 1f, 10f * (r * u * p)); ApplySpellBuff("addClimb", 1f * p, 15f * (r * u)); ApplySpellBuff("addFOV", 20f * p, 15f * (r * u)); } } public static void ClimbingBuff(float p, float r, float u) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) HealthCost(2f); foreach (Vector3 castingOrigin in GetCastingOrigins()) { ApplySpellBuff("addClimb", 2f * p, 15f * (r * u)); ApplySpellBuff("addFOV", 20f * p, 15f * (r * u)); } } public static void BulletTimeBuff(float p, float r, float u) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) HealthCost(4f); foreach (Vector3 castingOrigin in GetCastingOrigins()) { ApplySpellBuff("slowTime", 2f * p, 1f * (r * u), 0.2f); ApplySpellBuff("addSpeed", 1f * p, 1f * (r * u), 0.2f); ApplySpellBuff("addJump", 1f * p, 1f * (r * u), 0.2f); ApplySpellBuff("addClimb", 1f * p, 1f * (r * u), 0.2f); ApplySpellBuff("addStrike", 1f * p, 1f * (r * u), 0.2f); ApplySpellBuff("addThrow", 1f * p, 1f * (r * u), 0.2f); ApplySpellBuff("addFOV", 20f * p, 1f * (r * u), 0.2f); } } public static void FlightBuff(float p, float r, float u) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) HealthCost(4f); foreach (Vector3 castingOrigin in GetCastingOrigins()) { ApplySpellBuff("TempFlight", 1f, p, 0.1f / (r * u), useID: true); ApplySpellBuff("addFOV", 20f * p, p, 0.1f / (r * u)); } } public static void FoodHealBuff(float p, float r, float u) { //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) ((GameEntity)ENT_Player.GetPlayer()).Heal(p); foreach (Vector3 castingOrigin in GetCastingOrigins()) { ApplySpellBuff("addClimb", -0.05f / p, 60f / (r * u)); ApplySpellBuff("addJump", -0.05f / p, 60f / (r * u)); ApplySpellBuff("addStamina", -0.05f / p, 60f / (r * u)); ApplySpellBuff("addStaminaRegen", -0.05f / p, 60f / (r * u)); ApplySpellBuff("addSpeed", -0.05f / p, 60f / (r * u)); ApplySpellBuff("addFOV", -10f / p, 60f / (r * u)); } } } public class SpellManager : MonoBehaviour { public Hand hand; public float targetDuration = 1f; public Action OnDurationReached; private float currentTimer; private bool hasTriggered; private bool isCasting; private Bag_Handler bagHandler; private GameObject particles; public static SpellManager Instance { get; private set; } private void Awake() { Instance = this; } private void Start() { //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: 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_00c4: 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_00d5: Unknown result type (might be due to invalid IL or missing references) InitializeBagHandlerReflection(); if ((Object)(object)bagHandler != (Object)null) { CreateTopPouches(bagHandler); } particles = Spells.GetCachedPrefab("Rho Particles"); particles.transform.SetParent(((Component)hand.handModel).transform); particles.transform.localPosition = Vector3.zero; particles.transform.localScale = new Vector3(0.15f, 0.15f, 0.15f); ParticleSystem val = default(ParticleSystem); if (particles.TryGetComponent(ref val)) { EmissionModule emission = val.emission; MinMaxCurve rateOverTime = ((EmissionModule)(ref emission)).rateOverTime; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(((MinMaxCurve)(ref rateOverTime)).constant * 2f); MainModule main = val.main; ((MainModule)(ref main)).maxParticles = Mathf.CeilToInt((float)((MainModule)(ref main)).maxParticles * 2f); ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1; ((EmissionModule)(ref emission)).enabled = false; } } private void Update() { //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: 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_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_02b9: 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_013b: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: 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_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) if (hand == null || (Object)(object)hand.handModel == (Object)null) { return; } if (Input.GetKey((KeyCode)101) && (hand.IsFree() || isCasting)) { if (!isCasting) { isCasting = true; if (!hasTriggered) { hand.SetLocked(true); hand.SetSprite(hand.GetPoseSprite("open"), (Sprite)null); ParticleSystem val = default(ParticleSystem); if (particles.TryGetComponent(ref val)) { EmissionModule emission = val.emission; ((EmissionModule)(ref emission)).enabled = true; } } } Transform transform = ((Component)hand.GetPlayer().cam).transform; Vector3 val2 = transform.position + transform.forward * 1f + transform.right * 0.4f + transform.up * -0.4f; if (!hasTriggered) { hand.MoveTo(val2, new Vector3(0.3f, 0.3f, 0.3f), transform.rotation, 1f, true); } if (hasTriggered) { return; } currentTimer += Time.deltaTime; if (!(currentTimer >= targetDuration)) { return; } hasTriggered = true; OnDurationReached?.Invoke(); hand.SetLocked(false); ParticleSystem val3 = default(ParticleSystem); if (particles.TryGetComponent(ref val3)) { EmissionModule emission2 = val3.emission; ((EmissionModule)(ref emission2)).enabled = false; } AudioClip val4 = null; AudioClip[] array = Resources.FindObjectsOfTypeAll(); AudioClip[] array2 = array; foreach (AudioClip val5 in array2) { if (((Object)val5).name == "den-moth-flap-02") { val4 = val5; break; } } if ((Object)(object)val4 != (Object)null) { AudioManager.PlaySound(val4, ((Component)ENT_Player.GetPlayer()).transform.position, 1f, 1f, 1f, false, 1f, (AudioMixerGroup)null, ""); } return; } if (isCasting) { isCasting = false; hand.SetLocked(false); ParticleSystem val6 = default(ParticleSystem); if (particles.TryGetComponent(ref val6)) { EmissionModule emission3 = val6.emission; ((EmissionModule)(ref emission3)).enabled = false; } } currentTimer = 0f; hasTriggered = false; } private void OnDestroy() { RemoveTopPouches(); if ((Object)(object)Instance == (Object)(object)this) { Instance = null; } } private void InitializeBagHandlerReflection() { if (!((Object)(object)Inventory.instance == (Object)null)) { FieldInfo field = typeof(Inventory).GetField("bagHandler", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (!(field == null)) { ref Bag_Handler reference = ref bagHandler; object? value = field.GetValue(Inventory.instance); reference = (Bag_Handler)((value is Bag_Handler) ? value : null); } } } public void CreateTopPouches(Bag_Handler activeHandler) { //IL_00e6: 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_00f6: 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_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: 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_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012b: 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) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_014d: 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_015b: 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_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017f: 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_0189: 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_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) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)activeHandler == (Object)null) { return; } bagHandler = activeHandler; if ((Object)(object)Inventory.instance == (Object)null || !(typeof(Inventory).GetField("pouches", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(Inventory.instance) is IList list)) { return; } Type nestedType = typeof(Inventory).GetNestedType("Pouch", BindingFlags.Public | BindingFlags.NonPublic); if (nestedType == null) { return; } FieldInfo field = nestedType.GetField("pouchVisual", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); FieldInfo field2 = nestedType.GetField("maxCapacity", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); FieldInfo field3 = nestedType.GetField("maxLargeCapacity", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); RemoveTopPouches(); float backgroundCircleSize = bagHandler.backgroundCircleSize; Vector3 localPosition = ((Component)bagHandler.backgroundCircle).transform.localPosition; float num = 4.4505897f; Vector3 val = localPosition + Vector3.right * Mathf.Cos(num) * backgroundCircleSize + Vector3.up * Mathf.Sin(num) * backgroundCircleSize; Vector3 val2 = ((Component)bagHandler).transform.TransformPoint(val); float num2 = 4.9741883f; Vector3 val3 = localPosition + Vector3.right * Mathf.Cos(num2) * backgroundCircleSize + Vector3.up * Mathf.Sin(num2) * backgroundCircleSize; Vector3 val4 = ((Component)bagHandler).transform.TransformPoint(val3); Bag_Pouch val5 = bagHandler.CreateCustomPouch(val2, bagHandler.pouchAsset); Bag_Pouch val6 = bagHandler.CreateCustomPouch(val4, bagHandler.pouchAsset); if (!((Object)(object)val5 == (Object)null) && !((Object)(object)val6 == (Object)null)) { object obj = Activator.CreateInstance(nestedType); field2?.SetValue(obj, 1); field3?.SetValue(obj, 1); field?.SetValue(obj, val5); TopPouchManager.LeftTopPouch = obj; object obj2 = Activator.CreateInstance(nestedType); field2?.SetValue(obj2, 1); field3?.SetValue(obj2, 1); field?.SetValue(obj2, val6); TopPouchManager.RightTopPouch = obj2; list.Insert(0, TopPouchManager.RightTopPouch); list.Insert(0, TopPouchManager.LeftTopPouch); if ((Object)(object)((Component)val5).transform != (Object)null) { ((Component)val5).transform.SetAsFirstSibling(); } if ((Object)(object)((Component)val6).transform != (Object)null) { ((Component)val6).transform.SetAsFirstSibling(); } } } public void RemoveTopPouches() { if ((Object)(object)Inventory.instance == (Object)null || !(typeof(Inventory).GetField("pouches", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(Inventory.instance) is IList list)) { return; } FieldInfo fieldInfo = typeof(Inventory).GetNestedType("Pouch", BindingFlags.Public | BindingFlags.NonPublic)?.GetField("pouchVisual", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (TopPouchManager.LeftTopPouch != null) { list.Remove(TopPouchManager.LeftTopPouch); object? obj = fieldInfo?.GetValue(TopPouchManager.LeftTopPouch); Bag_Pouch val = (Bag_Pouch)((obj is Bag_Pouch) ? obj : null); if ((Object)(object)val != (Object)null && (Object)(object)((Component)val).gameObject != (Object)null) { Object.Destroy((Object)(object)((Component)val).gameObject); } TopPouchManager.LeftTopPouch = null; } if (TopPouchManager.RightTopPouch != null) { list.Remove(TopPouchManager.RightTopPouch); object? obj2 = fieldInfo?.GetValue(TopPouchManager.RightTopPouch); Bag_Pouch val2 = (Bag_Pouch)((obj2 is Bag_Pouch) ? obj2 : null); if ((Object)(object)val2 != (Object)null && (Object)(object)((Component)val2).gameObject != (Object)null) { Object.Destroy((Object)(object)((Component)val2).gameObject); } TopPouchManager.RightTopPouch = null; } } } [HarmonyPatch(typeof(CL_LocalizationManager), "GetLocalization")] public class LocalizationPatch { [HarmonyPrefix] public static bool Prefix(string groupid, string lineid, ref string __result) { if (groupid == "deathmessages" && lineid == "healthcost") { __result = "FELL TO HUBRIS"; return false; } return true; } } [HarmonyPatch(typeof(Bag_Handler), "CreatePouches")] public static class BagHandlerTopPouchPatch { public static void Postfix(Bag_Handler __instance) { if (!((Object)(object)SpellManager.Instance == (Object)null)) { SpellManager.Instance.CreateTopPouches(__instance); } } } public static class TopPouchManager { public static object LeftTopPouch; public static object RightTopPouch; public static string GetLeftTopItemName() { return GetItemNameFromPouch(LeftTopPouch); } public static string GetRightTopItemName() { return GetItemNameFromPouch(RightTopPouch); } public static void RemoveLeftTopItem() { RemoveItemFromPouch(LeftTopPouch); } public static void RemoveRightTopItem() { RemoveItemFromPouch(RightTopPouch); } private static string GetItemNameFromPouch(object pouchObj) { if (pouchObj == null) { return string.Empty; } if (pouchObj.GetType().GetField("pouchItems", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(pouchObj) is IList { Count: >0 } list) { object obj = list[0]; if (obj != null) { return (obj.GetType().GetField("itemName", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(obj) as string) ?? string.Empty; } } return string.Empty; } private static void RemoveItemFromPouch(object pouchObj) { if (pouchObj != null && pouchObj.GetType().GetField("pouchItems", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(pouchObj) is IList { Count: >0 } list) { object? obj = list[0]; Item val = (Item)((obj is Item) ? obj : null); val.Destroy(true); } } } namespace Severon.DropLogPerkMod { public class PerkModule_LogOnDrop : PerkModule_HoldDrop { public override void HoldDrop(Hand hand) { ((PerkModule_HoldDrop)this).HoldDrop(hand); Debug.Log((object)"Drop button held"); } } [BepInPlugin("com.severon.droplogperk", "Severon's Perk Mod", "1.0.0")] public class Plugin : BaseUnityPlugin { private void Awake() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown Harmony val = new Harmony("com.severon.droplogperk"); val.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Severon's Perk Mod loaded successfully, hell yeah."); } } [HarmonyPatch(typeof(M_Gamemode), "Initialize")] public static class M_Gamemode_Initialize_Patch { private static void Postfix(M_Gamemode __instance) { __instance.allowLeaderboardScoring = false; __instance.allowCheatedScores = false; } } } namespace Severon.PerkMod { [HarmonyPatch(typeof(App_PerkPage), "GenerateCards")] public static class GamePerks { public static readonly FieldInfo _cardsField = AccessTools.Field(typeof(App_PerkPage), "cards"); public static bool _spritesLoaded = false; public static Perk _trainedSoldierPerk; public static Perk _itemRecyclingPerk; public static Perk _scavengerPerk; public static Perk _floatationDevicePerk; public static Perk _runningJumpPerk; public static Perk _acrobaticLeapPerk; public static Perk _wallBouncePerk; public static Perk _meltingBodyPerk; public static Perk _gluteusMaximusPerk; public static Perk _grubTransformationPerk; public static Perk _crawlingLigamentsPerk; public static Perk _subservientInstinctPerk; public static Perk _rabbitSpiritPerk; public static Perk _metaOverdrive; public static Perk _rebartender; public static Perk _insectPheromonesPerk; public static Perk _manicConviction; public static Perk _yourRewardPerk; public static readonly Dictionary> _upgradeConditions = new Dictionary> { { "Perk_LigamentRestructure", CrawlingLigaments }, { "Perk_MotherlyInstinct", SubservientInstinct }, { "Perk_RabbitDNA", RabbitLegs }, { "Perk_MetabolicStasis", MetaOverdrive }, { "Perk_AutotomousSkeleton", Rebartender }, { "Perk_PheromoneGlands", InsectPheromones }, { "Perk_U_T3_UnstoppableConviction", ManicConviction }, { "Perk_SystemReorganization", AgilityBoost }, { "Perk_ProfitMotive", HungerMotive }, { "Perk_ConsumptiveReflex", GastricBypass }, { "Perk_AnomalousBonds", SoulTrade }, { "Perk_CarnalBloodlust", SharedTorment }, { "Perk_PulseOrgan", TerribleThoughts }, { "Perk_AdhesivePerspiration", adhesiveSkin }, { "Perk_ElasticLimbs", SemisolidMuscles } }; public static Perk _agilityBoostPerk; public static Perk _soulTradePerk; public static Perk _gastricBypassPerk; public static Perk _adhesiveSkinPerk; public static Perk _semisolidMusclesPerk; public static Perk _hungerMotive; public static Perk _sharedTorment; public static Perk _terribleThoughts; [HarmonyPostfix] public static void Postfix(App_PerkPage __instance) { //IL_003c: 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_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Invalid comparison between Unknown and I4 //IL_0328: Unknown result type (might be due to invalid IL or missing references) //IL_032d: 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_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)__instance == (Object)null || !(_cardsField?.GetValue(__instance) is List list)) { return; } PerkPageType val = (PerkPageType)10; if (__instance.perkPageType == val) { foreach (App_PerkPage_Card item in list) { if ((Object)(object)item != (Object)null && (Object)(object)((Component)item).gameObject != (Object)null) { Object.Destroy((Object)(object)((Component)item).gameObject); } } list.Clear(); List list2 = new List(); foreach (KeyValuePair> upgradeCondition in _upgradeConditions) { if (ENT_Player.GetPlayer().HasPerk(upgradeCondition.Key)) { list2.Add(upgradeCondition.Value()); } } if (list2.Count == 0) { list2.Add(YourReward()); } { foreach (Perk item2 in list2) { App_PerkPage_Card val2 = Object.Instantiate(__instance.cardAsset, __instance.cardParent.position, Quaternion.identity, __instance.cardParent); val2.Initialize(__instance, item2); list.Add(val2); } return; } } if ((int)__instance.perkPageType > 0) { Func[] array = new Func[4] { MeltingBody, GluteusMaximus, GrubTransformation, HeavyHanded }; Perk val3 = array[Random.Range(0, array.Length)](); if ((Object)(object)val3 == (Object)null) { val3 = MeltingBody(); } App_PerkPage_Card val4 = Object.Instantiate(__instance.cardAsset, __instance.cardParent.position, Quaternion.identity, __instance.cardParent); val4.Initialize(__instance, val3); if (list.Count >= 3) { list[2] = val4; } else { list.Add(val4); } return; } Func[] array2 = new Func[7] { TrainedSoldier, ItemRecycling, Scavenger, FloatationDevice, RunningJump, AcrobaticLeap, WallBounce }; Perk val5 = array2[Random.Range(0, array2.Length)](); if ((Object)(object)val5 == (Object)null) { val5 = WallBounce(); } App_PerkPage_Card val6 = Object.Instantiate(__instance.cardAsset, __instance.cardParent.position, Quaternion.identity, __instance.cardParent); if (!((Object)(object)val6 == (Object)null)) { val6.Initialize(__instance, val5); Debug.Log((object)list.Count); if (list.Count >= 4) { list[3] = val6; } else { list.Add(val6); } } } public static Perk RabbitLegs() { if ((Object)(object)_rabbitSpiritPerk != (Object)null) { return _rabbitSpiritPerk; } _rabbitSpiritPerk = ScriptableObject.CreateInstance(); ((Object)_rabbitSpiritPerk).name = "perk_frogLegs"; ((Object)_rabbitSpiritPerk).hideFlags = (HideFlags)61; _rabbitSpiritPerk.id = "severon_rabbit_spirit_perk"; _rabbitSpiritPerk.title = "Frog Legs"; _rabbitSpiritPerk.description = "You are considered grounded while climbing."; _rabbitSpiritPerk.flavorText = "Disgustingly sticky."; _rabbitSpiritPerk.cost = 0; _rabbitSpiritPerk.canStack = false; _rabbitSpiritPerk.stackMax = 1; _rabbitSpiritPerk.useBuff = false; _rabbitSpiritPerk.multiplierCurve = AnimationCurve.Linear(0f, 1f, 1f, 1f); _rabbitSpiritPerk.modules = new List(); _rabbitSpiritPerk.perkCard = LoadSpriteFromFile("RhoCard.png"); _rabbitSpiritPerk.perkFrame = LoadSpriteFromFile("PerkCard_Frame_Rho.png"); return _rabbitSpiritPerk; } public static Perk MetaOverdrive() { if ((Object)(object)_metaOverdrive != (Object)null) { return _metaOverdrive; } _metaOverdrive = ScriptableObject.CreateInstance(); ((Object)_metaOverdrive).name = "perk_metabolicHyperdrive"; ((Object)_metaOverdrive).hideFlags = (HideFlags)61; _metaOverdrive.id = "severon_metabolic_overdrive"; _metaOverdrive.title = "Metabolic Hyperdrive"; _metaOverdrive.description = "Buffs from items are applied two additional times."; _metaOverdrive.flavorText = "You can't form a single thought, but at least you're still alive."; _metaOverdrive.cost = 0; _metaOverdrive.canStack = false; _metaOverdrive.stackMax = 1; _metaOverdrive.useBuff = false; _metaOverdrive.multiplierCurve = AnimationCurve.Linear(0f, 1f, 1f, 1f); _metaOverdrive.modules = new List(); _metaOverdrive.perkCard = LoadSpriteFromFile("RhoCard.png"); _metaOverdrive.perkFrame = LoadSpriteFromFile("PerkCard_Frame_Rho.png"); return _metaOverdrive; } public static Perk ManicConviction() { if ((Object)(object)_manicConviction != (Object)null) { return _manicConviction; } _manicConviction = ScriptableObject.CreateInstance(); ((Object)_manicConviction).name = "perk_manicConviction"; ((Object)_manicConviction).hideFlags = (HideFlags)61; _manicConviction.id = "severon_conviction_perk"; _manicConviction.title = "Manic Conviction"; _manicConviction.description = "You have a 60% chance to gain a temporary jump whenever you jump."; _manicConviction.flavorText = "Eventually, it's going to catch up to you."; _manicConviction.cost = 0; _manicConviction.canStack = false; _manicConviction.stackMax = 1; _manicConviction.useBuff = false; _manicConviction.multiplierCurve = AnimationCurve.Linear(0f, 1f, 1f, 1f); _manicConviction.modules = new List(); _manicConviction.perkCard = LoadSpriteFromFile("RhoCard.png"); _manicConviction.perkFrame = LoadSpriteFromFile("PerkCard_Frame_Rho.png"); return _manicConviction; } public static Perk AgilityBoost() { //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_010c: 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_011e: 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_0134: 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_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: 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_015d: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Expected O, but got Unknown //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Expected O, but got Unknown //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: 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_01c7: Expected O, but got Unknown //IL_01c9: 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_01d9: 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_01f4: Expected O, but got Unknown //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: 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_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Expected O, but got Unknown //IL_022c: Expected O, but got Unknown if ((Object)(object)_agilityBoostPerk != (Object)null) { return _agilityBoostPerk; } _agilityBoostPerk = ScriptableObject.CreateInstance(); ((Object)_agilityBoostPerk).name = "perk_systemRerouting"; ((Object)_agilityBoostPerk).hideFlags = (HideFlags)61; _agilityBoostPerk.id = "severon_agility_boost_perk"; _agilityBoostPerk.title = "System Rerouting"; _agilityBoostPerk.description = "Gain a 50% increase to Speed, Climb Speed, Stamina Regen, and Jump Height, but a 75% decrease to Max Stamina"; _agilityBoostPerk.flavorText = "Are you even the same person?"; _agilityBoostPerk.cost = 0; _agilityBoostPerk.canStack = true; _agilityBoostPerk.stackMax = 10; _agilityBoostPerk.useBuff = true; _agilityBoostPerk.buffMultiplier = 1f; _agilityBoostPerk.multiplierCurve = AnimationCurve.Linear(0f, 1f, 1f, 1f); _agilityBoostPerk.modules = new List(); _agilityBoostPerk.buff = new BuffContainer { id = "severon_agility_boost_buff", desc = "", loseOverTime = false, loseRate = 0f, buffTime = 1f, multiplier = 1f, loseRateEffectedByPerks = false, buffs = new List { new Buff { id = "addSpeed", maxAmount = 0.5f, amount = 0f }, new Buff { id = "addClimb", maxAmount = 0.5f, amount = 0f }, new Buff { id = "addStaminaRegen", maxAmount = 0.5f, amount = 0f }, new Buff { id = "addJump", maxAmount = 0.5f, amount = 0f }, new Buff { id = "addStamina", maxAmount = -0.7f, amount = 0f } } }; _agilityBoostPerk.perkCard = LoadSpriteFromFile("RhoCard.png"); _agilityBoostPerk.perkFrame = LoadSpriteFromFile("PerkCard_Frame_Rho.png"); return _agilityBoostPerk; } public static Perk Rebartender() { if ((Object)(object)_rebartender != (Object)null) { return _rebartender; } _rebartender = ScriptableObject.CreateInstance(); ((Object)_rebartender).name = "perk_arrowSling"; ((Object)_rebartender).hideFlags = (HideFlags)61; _rebartender.id = "severon_bartender_perk"; _rebartender.title = "Arrow Sling"; _rebartender.description = "Rebar has additional recoil."; _rebartender.flavorText = "You can't help but be repulsed."; _rebartender.cost = 0; _rebartender.canStack = false; _rebartender.stackMax = 1; _rebartender.useBuff = false; _rebartender.multiplierCurve = AnimationCurve.Linear(0f, 1f, 1f, 1f); _rebartender.modules = new List(); _rebartender.perkCard = LoadSpriteFromFile("RhoCard.png"); _rebartender.perkFrame = LoadSpriteFromFile("PerkCard_Frame_Rho.png"); return _rebartender; } public static Perk MeltingBody() { //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: 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_00fd: 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_010f: 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) //IL_0125: 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_0133: 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_0143: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Expected O, but got Unknown //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Expected O, but got Unknown //IL_0196: Expected O, but got Unknown if ((Object)(object)_meltingBodyPerk != (Object)null) { return _meltingBodyPerk; } _meltingBodyPerk = ScriptableObject.CreateInstance(); ((Object)_meltingBodyPerk).name = "perk_meltingBody"; ((Object)_meltingBodyPerk).hideFlags = (HideFlags)61; _meltingBodyPerk.id = "severon_melting_body_perk"; _meltingBodyPerk.title = "Melting Body"; _meltingBodyPerk.description = "+100% Reach, -100% Climb Speed"; _meltingBodyPerk.cost = 5; _meltingBodyPerk.canStack = true; _meltingBodyPerk.stackMax = 10; _meltingBodyPerk.useBuff = true; _meltingBodyPerk.buffMultiplier = 1f; _meltingBodyPerk.multiplierCurve = AnimationCurve.Linear(0f, 1f, 1f, 1f); _meltingBodyPerk.modules = new List(); _meltingBodyPerk.buff = new BuffContainer { id = "severon_melting_body_buff", desc = "Melting Body Effects", loseOverTime = false, loseRate = 0f, buffTime = 1f, multiplier = 1f, loseRateEffectedByPerks = false, buffs = new List { new Buff { id = "addReach", maxAmount = 1f, amount = 0f }, new Buff { id = "addClimb", maxAmount = -1f, amount = 0f } } }; _meltingBodyPerk.perkCard = LoadSpriteFromFile("TrainedSoldierCard.png"); _meltingBodyPerk.perkFrame = LoadSpriteFromFile("PerkCard_Frame_Advanced.png"); return _meltingBodyPerk; } public static Perk GluteusMaximus() { //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: 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_00fd: 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_010f: 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) //IL_0125: 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_0133: 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_0143: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Expected O, but got Unknown //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Expected O, but got Unknown //IL_0196: Expected O, but got Unknown if ((Object)(object)_gluteusMaximusPerk != (Object)null) { return _gluteusMaximusPerk; } _gluteusMaximusPerk = ScriptableObject.CreateInstance(); ((Object)_gluteusMaximusPerk).name = "perk_gluteusMaximus"; ((Object)_gluteusMaximusPerk).hideFlags = (HideFlags)61; _gluteusMaximusPerk.id = "severon_gluteus_maximus_perk"; _gluteusMaximusPerk.title = "Gluteus Maximus"; _gluteusMaximusPerk.description = "+50% Jump Height, +35% Gravity"; _gluteusMaximusPerk.cost = 5; _gluteusMaximusPerk.canStack = true; _gluteusMaximusPerk.stackMax = 10; _gluteusMaximusPerk.useBuff = true; _gluteusMaximusPerk.buffMultiplier = 1f; _gluteusMaximusPerk.multiplierCurve = AnimationCurve.Linear(0f, 1f, 1f, 1f); _gluteusMaximusPerk.modules = new List(); _gluteusMaximusPerk.buff = new BuffContainer { id = "severon_gluteus_maximus_buff", desc = "Gluteus Maximus Effects", loseOverTime = false, loseRate = 0f, buffTime = 1f, multiplier = 1f, loseRateEffectedByPerks = false, buffs = new List { new Buff { id = "addJump", maxAmount = 0.5f, amount = 0f }, new Buff { id = "addGravity", maxAmount = 0.35f, amount = 0f } } }; _gluteusMaximusPerk.perkCard = LoadSpriteFromFile("TrainedSoldierCard.png"); _gluteusMaximusPerk.perkFrame = LoadSpriteFromFile("PerkCard_Frame_Advanced.png"); return _gluteusMaximusPerk; } public static Perk GrubTransformation() { //IL_00d3: 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_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: 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_0100: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011d: 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_0129: 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_013f: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Expected O, but got Unknown //IL_0151: 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_0161: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Expected O, but got Unknown //IL_0187: Expected O, but got Unknown //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018c: 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_0193: Unknown result type (might be due to invalid IL or missing references) //IL_019e: 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_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Expected O, but got Unknown //IL_01d3: 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_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: 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_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Expected O, but got Unknown //IL_0253: Expected O, but got Unknown if ((Object)(object)_grubTransformationPerk != (Object)null) { return _grubTransformationPerk; } _grubTransformationPerk = ScriptableObject.CreateInstance(); ((Object)_grubTransformationPerk).name = "perk_grubTransformation"; ((Object)_grubTransformationPerk).hideFlags = (HideFlags)61; _grubTransformationPerk.id = "severon_grub_transformation_perk"; _grubTransformationPerk.title = "Grub Transformation"; _grubTransformationPerk.description = "You can climb anything, but your ability to jump scales with your current stamina."; _grubTransformationPerk.cost = 5; _grubTransformationPerk.canStack = true; _grubTransformationPerk.stackMax = 10; _grubTransformationPerk.useBuff = true; _grubTransformationPerk.buffMultiplier = 1f; _grubTransformationPerk.multiplierCurve = AnimationCurve.Linear(0f, 1f, 1f, 1f); _grubTransformationPerk.buff = new BuffContainer { id = "severon_grub_transformation_base_buff", desc = "", loseOverTime = false, loseRate = 0f, buffTime = 1f, multiplier = 1f, loseRateEffectedByPerks = false, buffs = new List { new Buff { id = "grabAnything", maxAmount = 1f, amount = 0f }, new Buff { id = "addJump", maxAmount = -1f, amount = 0f } } }; PerkModule_PlayerStates val = new PerkModule_PlayerStates { playerState = (PlayerState)7, buffMultiplier = 1f, buffChangeRate = 1f, buffRaiseRateMult = 1f, buffLowerRateMult = 1f, persistTime = 0f, useHandEffectModule = false }; val.buff = new BuffContainer { id = "severon_grub_hanging_debuff", desc = "", loseOverTime = false, loseRate = 0f, buffTime = 1f, multiplier = 0f, buffs = new List { new Buff { id = "addJump", maxAmount = 1f, amount = 0f } } }; _grubTransformationPerk.modules = new List { (PerkModule)(object)val }; _grubTransformationPerk.perkCard = LoadSpriteFromFile("TrainedSoldierCard.png"); _grubTransformationPerk.perkFrame = LoadSpriteFromFile("PerkCard_Frame_Advanced.png"); return _grubTransformationPerk; } public static Perk TrainedSoldier() { if ((Object)(object)_trainedSoldierPerk != (Object)null) { return _trainedSoldierPerk; } _trainedSoldierPerk = ScriptableObject.CreateInstance(); ((Object)_trainedSoldierPerk).name = "perk_trainedSoldier"; ((Object)_trainedSoldierPerk).hideFlags = (HideFlags)61; _trainedSoldierPerk.id = "severon_soldier_perk"; _trainedSoldierPerk.title = "Trained Soldier"; _trainedSoldierPerk.description = "Your weapons are swung, fired, and reloaded faster."; _trainedSoldierPerk.cost = 5; _trainedSoldierPerk.canStack = true; _trainedSoldierPerk.stackMax = 10; _trainedSoldierPerk.multiplierCurve = AnimationCurve.Linear(0f, 1f, 1f, 1f); _trainedSoldierPerk.perkCard = LoadSpriteFromFile("TrainedSoldierCard.png"); _trainedSoldierPerk.perkFrame = LoadSpriteFromFile("PerkCard_Frame_Advanced.png"); _trainedSoldierPerk.modules = new List { (PerkModule)(object)new PerkModule_FastReload() }; return _trainedSoldierPerk; } public static Perk ItemRecycling() { if ((Object)(object)_itemRecyclingPerk != (Object)null) { return _itemRecyclingPerk; } _itemRecyclingPerk = ScriptableObject.CreateInstance(); ((Object)_itemRecyclingPerk).name = "perk_itemRecycling"; ((Object)_itemRecyclingPerk).hideFlags = (HideFlags)61; _itemRecyclingPerk.id = "severon_recycle_perk"; _itemRecyclingPerk.title = "Item Recycling"; _itemRecyclingPerk.description = "Items have a 30% chance to not be destroyed when they otherwise would be. (Includes food, rebar, ammo, etcetera)"; _itemRecyclingPerk.cost = 8; _itemRecyclingPerk.canStack = true; _itemRecyclingPerk.stackMax = 10; _itemRecyclingPerk.multiplierCurve = AnimationCurve.Linear(0f, 1f, 1f, 1f); _itemRecyclingPerk.modules = new List { (PerkModule)(object)new PerkModule_ItemRecycling() }; _itemRecyclingPerk.perkCard = LoadSpriteFromFile("TrainedSoldierCard.png"); _itemRecyclingPerk.perkFrame = LoadSpriteFromFile("PerkCard_Frame_Advanced.png"); return _itemRecyclingPerk; } public static Perk SoulTrade() { if ((Object)(object)_soulTradePerk != (Object)null) { return _soulTradePerk; } _soulTradePerk = ScriptableObject.CreateInstance(); ((Object)_soulTradePerk).name = "perk_soulTrade"; ((Object)_soulTradePerk).hideFlags = (HideFlags)61; _soulTradePerk.id = "severon_soul_perk"; _soulTradePerk.title = "Soul Trade"; _soulTradePerk.description = "Gain a 30% increase to ALL stats when you revive by disk."; _soulTradePerk.flavorText = "We'll have so much fun when you finally die."; _soulTradePerk.cost = 0; _soulTradePerk.canStack = false; _soulTradePerk.stackMax = 1; _soulTradePerk.multiplierCurve = AnimationCurve.Linear(0f, 1f, 1f, 1f); _soulTradePerk.modules = new List(); _soulTradePerk.perkCard = LoadSpriteFromFile("RhoCard.png"); _soulTradePerk.perkFrame = LoadSpriteFromFile("PerkCard_Frame_Rho.png"); return _soulTradePerk; } public static Perk Scavenger() { if ((Object)(object)_scavengerPerk != (Object)null) { return _scavengerPerk; } _scavengerPerk = ScriptableObject.CreateInstance(); ((Object)_scavengerPerk).name = "perk_promotionalDeal"; ((Object)_scavengerPerk).hideFlags = (HideFlags)61; _scavengerPerk.id = "severon_scavenge_perk"; _scavengerPerk.title = "Promotional Deal"; _scavengerPerk.description = "Obtain two random food items when you spend roaches."; _scavengerPerk.cost = 3; _scavengerPerk.canStack = true; _scavengerPerk.stackMax = 10; _scavengerPerk.multiplierCurve = AnimationCurve.Linear(0f, 1f, 1f, 1f); _scavengerPerk.modules = new List { (PerkModule)(object)new PerkModule_Scavenging() }; _scavengerPerk.perkCard = LoadSpriteFromFile("TrainedSoldierCard.png"); _scavengerPerk.perkFrame = LoadSpriteFromFile("PerkCard_Frame_Advanced.png"); return _scavengerPerk; } public static Perk FloatationDevice() { //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_00bb: 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_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: 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_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Expected O, but got Unknown //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_011b: 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_012d: 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_0143: Unknown result type (might be due to invalid IL or missing references) //IL_014a: 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_015a: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Expected O, but got Unknown //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_017c: 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_0192: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Expected O, but got Unknown //IL_01ad: Expected O, but got Unknown if ((Object)(object)_floatationDevicePerk != (Object)null) { return _floatationDevicePerk; } _floatationDevicePerk = ScriptableObject.CreateInstance(); ((Object)_floatationDevicePerk).name = "perk_floatationDevice"; ((Object)_floatationDevicePerk).hideFlags = (HideFlags)61; _floatationDevicePerk.id = "severon_floater_perk"; _floatationDevicePerk.title = "Floatation Device"; _floatationDevicePerk.description = "Decrease gravity, up to 35%, while not grounded."; _floatationDevicePerk.cost = 12; _floatationDevicePerk.canStack = true; _floatationDevicePerk.stackMax = 4; _floatationDevicePerk.multiplierCurve = AnimationCurve.Linear(0f, 1f, 1f, 1f); PerkModule_PlayerStates val = new PerkModule_PlayerStates { playerState = (PlayerState)2, buffMultiplier = 1f, buffChangeRate = 0.3f, buffRaiseRateMult = 1f, buffLowerRateMult = 500f, persistTime = 0f, useHandEffectModule = false }; val.buff = new BuffContainer { id = "severon_floater_buff", desc = "Floatation Device Effects", loseOverTime = false, loseRate = 0f, buffTime = 1f, multiplier = 0f, buffs = new List { new Buff { id = "addGravity", maxAmount = -0.35f, amount = 0f }, new Buff { id = "addFOV", maxAmount = 5f, amount = 0f } } }; _floatationDevicePerk.modules = new List { (PerkModule)(object)val }; _floatationDevicePerk.perkCard = LoadSpriteFromFile("TrainedSoldierCard.png"); _floatationDevicePerk.perkFrame = LoadSpriteFromFile("PerkCard_Frame_Advanced.png"); return _floatationDevicePerk; } public static Perk RunningJump() { //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: 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_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: 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_0100: Expected O, but got Unknown //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: 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_011c: 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) //IL_012e: 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_0144: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_015b: 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_0176: Expected O, but got Unknown //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Expected O, but got Unknown //IL_01ae: Expected O, but got Unknown if ((Object)(object)_runningJumpPerk != (Object)null) { return _runningJumpPerk; } _runningJumpPerk = ScriptableObject.CreateInstance(); ((Object)_runningJumpPerk).name = "perk_runningJump"; ((Object)_runningJumpPerk).hideFlags = (HideFlags)61; _runningJumpPerk.id = "severon_Running_jump_perk"; _runningJumpPerk.title = "Running Jump"; _runningJumpPerk.description = "The longer you sprint while grounded, the higher you jump."; _runningJumpPerk.cost = 10; _runningJumpPerk.canStack = true; _runningJumpPerk.stackMax = 10; _runningJumpPerk.multiplierCurve = AnimationCurve.Linear(0f, 1f, 1f, 1f); PerkModule_PlayerStates val = new PerkModule_PlayerStates { playerState = (PlayerState)4, buffMultiplier = 1f, buffChangeRate = 0.4f, buffRaiseRateMult = 1f, buffLowerRateMult = 2f, persistTime = 0f, useHandEffectModule = false }; val.buff = new BuffContainer { id = "severon_momentum_jump_buff", desc = "Sprinting Jump Height Modifier", loseOverTime = false, loseRate = 0f, buffTime = 1f, multiplier = 0f, buffs = new List { new Buff { id = "addJump", maxAmount = 2f, amount = 0f }, new Buff { id = "addSpeed", maxAmount = 1f, amount = 0f } } }; _runningJumpPerk.modules = new List { (PerkModule)(object)val }; _runningJumpPerk.perkCard = LoadSpriteFromFile("TrainedSoldierCard.png"); _runningJumpPerk.perkFrame = LoadSpriteFromFile("PerkCard_Frame_Advanced.png"); return _runningJumpPerk; } public static Perk AcrobaticLeap() { //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0117: 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_012d: 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_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0144: 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_015a: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Expected O, but got Unknown //IL_0175: Expected O, but got Unknown if ((Object)(object)_acrobaticLeapPerk != (Object)null) { return _acrobaticLeapPerk; } _acrobaticLeapPerk = ScriptableObject.CreateInstance(); ((Object)_acrobaticLeapPerk).name = "perk_acrobaticLeap"; ((Object)_acrobaticLeapPerk).hideFlags = (HideFlags)61; _acrobaticLeapPerk.id = "severon_acrobatic_leap_perk"; _acrobaticLeapPerk.title = "Acrobatic Leap"; _acrobaticLeapPerk.description = "Chaining jumps without touching the ground or hanging grants progressively higher jumps. Loses momentum quickly on landing."; _acrobaticLeapPerk.flavorText = "Whoop.. whup.. WAHOO!"; _acrobaticLeapPerk.cost = 5; _acrobaticLeapPerk.canStack = true; _acrobaticLeapPerk.stackMax = 10; _acrobaticLeapPerk.multiplierCurve = AnimationCurve.Linear(0f, 1f, 1f, 1f); PerkModule_JumpCombo item = new PerkModule_JumpCombo { buffMultiplier = 1f, buffMax = 3f, buffIncreasePerJump = 1f, buffDecayRate = 2f, buff = new BuffContainer { id = "severon_acrobatic_leap_buff", desc = "Jump Combo Momentum", loseOverTime = false, loseRate = 0f, buffTime = 1f, multiplier = 1f, buffs = new List { new Buff { id = "addJump", maxAmount = 0.35f, amount = 0.35f } } } }; _acrobaticLeapPerk.modules = new List { (PerkModule)(object)item }; _acrobaticLeapPerk.perkCard = LoadSpriteFromFile("TrainedSoldierCard.png"); _acrobaticLeapPerk.perkFrame = LoadSpriteFromFile("PerkCard_Frame_Advanced.png"); return _acrobaticLeapPerk; } public static Perk WallBounce() { if ((Object)(object)_wallBouncePerk != (Object)null) { return _wallBouncePerk; } _wallBouncePerk = ScriptableObject.CreateInstance(); ((Object)_wallBouncePerk).name = "perk_pikeShoes"; ((Object)_wallBouncePerk).hideFlags = (HideFlags)61; _wallBouncePerk.id = "severon_wall_jump_perk"; _wallBouncePerk.title = "Pike Shoes"; _wallBouncePerk.description = "You can wall jump once before landing or climbing."; _wallBouncePerk.cost = 8; _wallBouncePerk.canStack = true; _wallBouncePerk.stackMax = 10; _wallBouncePerk.multiplierCurve = AnimationCurve.Linear(0f, 1f, 1f, 1f); _wallBouncePerk.modules = new List { (PerkModule)(object)new PerkModule_WallJump() }; _wallBouncePerk.perkCard = LoadSpriteFromFile("TrainedSoldierCard.png"); _wallBouncePerk.perkFrame = LoadSpriteFromFile("PerkCard_Frame_Advanced.png"); return _wallBouncePerk; } public static Perk HeavyHanded() { Perk val = ScriptableObject.CreateInstance(); ((Object)val).name = "perk_heavyHanded"; val.id = "severon_heavyhanded_perk"; val.title = "Heavy Handed"; val.description = "Weapons are much slower, but they have greatly increased recoil."; val.cost = 6; val.canStack = true; val.stackMax = 10; val.multiplierCurve = AnimationCurve.Linear(0f, 1f, 1f, 1f); val.modules = new List { (PerkModule)(object)new PerkModule_HeavyHanded() }; val.perkCard = LoadSpriteFromFile("TrainedSoldierCard.png"); val.perkFrame = LoadSpriteFromFile("PerkCard_Frame_Advanced.png"); return val; } public static Perk CrawlingLigaments() { //IL_00c3: 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_00ca: 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_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Expected O, but got Unknown //IL_010f: 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_011f: 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) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0147: 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_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Expected O, but got Unknown //IL_018f: Expected O, but got Unknown if ((Object)(object)_crawlingLigamentsPerk != (Object)null) { return _crawlingLigamentsPerk; } _crawlingLigamentsPerk = ScriptableObject.CreateInstance(); ((Object)_crawlingLigamentsPerk).name = "perk_crawlingLigaments"; ((Object)_crawlingLigamentsPerk).hideFlags = (HideFlags)61; _crawlingLigamentsPerk.id = "severon_crawling_ligaments_perk"; _crawlingLigamentsPerk.title = "Crawling Ligaments"; _crawlingLigamentsPerk.description = "You gain movement speed while in the air and lose the buff rapidly while on the ground."; _crawlingLigamentsPerk.flavorText = "Your joints are growing."; _crawlingLigamentsPerk.cost = 0; _crawlingLigamentsPerk.canStack = true; _crawlingLigamentsPerk.stackMax = 10; _crawlingLigamentsPerk.multiplierCurve = AnimationCurve.Linear(0f, 1f, 1f, 1f); PerkModule_PlayerStates val = new PerkModule_PlayerStates { playerState = (PlayerState)2, buffMultiplier = 1f, buffChangeRate = 0.5f, buffRaiseRateMult = 1f, buffLowerRateMult = 5f, persistTime = 0f, useHandEffectModule = false }; val.buff = new BuffContainer { id = "severon_crawling_ligaments_buff", desc = "Airborne Speed Modifier", loseOverTime = false, loseRate = 0f, buffTime = 1f, multiplier = 0f, buffs = new List { new Buff { id = "addSpeed", maxAmount = 10f, amount = 0f } } }; _crawlingLigamentsPerk.modules = new List { (PerkModule)(object)val }; _crawlingLigamentsPerk.perkCard = LoadSpriteFromFile("RhoCard.png"); _crawlingLigamentsPerk.perkFrame = LoadSpriteFromFile("PerkCard_Frame_Rho.png"); return _crawlingLigamentsPerk; } public static Perk YourReward() { //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_010c: 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_011e: 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_0134: 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_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: 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_015d: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Expected O, but got Unknown //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Expected O, but got Unknown //IL_01a5: Expected O, but got Unknown if ((Object)(object)_yourRewardPerk != (Object)null) { return _yourRewardPerk; } _yourRewardPerk = ScriptableObject.CreateInstance(); ((Object)_yourRewardPerk).name = "perk_yourReward"; ((Object)_yourRewardPerk).hideFlags = (HideFlags)61; _yourRewardPerk.id = "severon_your_reward_perk"; _yourRewardPerk.title = "Your Reward"; _yourRewardPerk.description = "Gain a 40% increase to jump height and -20% to gravity."; _yourRewardPerk.flavorText = "A Gift."; _yourRewardPerk.cost = 0; _yourRewardPerk.canStack = true; _yourRewardPerk.stackMax = 10; _yourRewardPerk.useBuff = true; _yourRewardPerk.buffMultiplier = 1f; _yourRewardPerk.multiplierCurve = AnimationCurve.Linear(0f, 1f, 1f, 1f); _yourRewardPerk.modules = new List(); _yourRewardPerk.buff = new BuffContainer { id = "severon_your_reward_buff", desc = "Your Reward Effects", loseOverTime = false, loseRate = 0f, buffTime = 1f, multiplier = 1f, loseRateEffectedByPerks = false, buffs = new List { new Buff { id = "addJump", maxAmount = 0.4f, amount = 0f }, new Buff { id = "addGravity", maxAmount = -0.2f, amount = 0f } } }; _yourRewardPerk.perkCard = LoadSpriteFromFile("RhoCard.png"); _yourRewardPerk.perkFrame = LoadSpriteFromFile("PerkCard_Frame_Rho.png"); return _yourRewardPerk; } public static Perk GastricBypass() { //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_010c: 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_011e: 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_0134: 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_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: 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_015d: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Expected O, but got Unknown //IL_0178: Expected O, but got Unknown if ((Object)(object)_gastricBypassPerk != (Object)null) { return _gastricBypassPerk; } _gastricBypassPerk = ScriptableObject.CreateInstance(); ((Object)_gastricBypassPerk).name = "perk_gastricBypass"; ((Object)_gastricBypassPerk).hideFlags = (HideFlags)61; _gastricBypassPerk.id = "severon_gastric_bypass_perk"; _gastricBypassPerk.title = "Gastric Bypass"; _gastricBypassPerk.description = "Gain a 75% increase to maximum stamina. If you would take damage that would kill you, you automatically eat an edible item in your inventory to heal to full."; _gastricBypassPerk.flavorText = "What's left of your stomach rumbles."; _gastricBypassPerk.cost = 0; _gastricBypassPerk.canStack = true; _gastricBypassPerk.stackMax = 10; _gastricBypassPerk.useBuff = true; _gastricBypassPerk.buffMultiplier = 1f; _gastricBypassPerk.multiplierCurve = AnimationCurve.Linear(0f, 1f, 1f, 1f); _gastricBypassPerk.modules = new List(); _gastricBypassPerk.buff = new BuffContainer { id = "severon_gastric_bypass_buff", desc = "Gastric Bypass Effects", loseOverTime = false, loseRate = 0f, buffTime = 1f, multiplier = 1f, loseRateEffectedByPerks = false, buffs = new List { new Buff { id = "addStamina", maxAmount = 0.75f, amount = 0f } } }; _gastricBypassPerk.perkCard = LoadSpriteFromFile("RhoCard.png"); _gastricBypassPerk.perkFrame = LoadSpriteFromFile("PerkCard_Frame_Rho.png"); return _gastricBypassPerk; } public static Perk adhesiveSkin() { //IL_00f0: 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_0100: Unknown result type (might be due to invalid IL or missing references) //IL_010b: 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_011d: 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_0133: 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_0141: 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_0151: 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_016c: Expected O, but got Unknown //IL_0177: Expected O, but got Unknown if ((Object)(object)_adhesiveSkinPerk != (Object)null) { return _adhesiveSkinPerk; } _adhesiveSkinPerk = ScriptableObject.CreateInstance(); ((Object)_adhesiveSkinPerk).name = "perk_adhesiveSkin"; ((Object)_adhesiveSkinPerk).hideFlags = (HideFlags)61; _adhesiveSkinPerk.id = "severon_adhesive_skin_perk"; _adhesiveSkinPerk.title = "Adhesive Skin"; _adhesiveSkinPerk.description = "You can climb anything."; _adhesiveSkinPerk.flavorText = "Keep an eye on your uncle."; _adhesiveSkinPerk.cost = 0; _adhesiveSkinPerk.canStack = false; _adhesiveSkinPerk.stackMax = 1; _adhesiveSkinPerk.useBuff = true; _adhesiveSkinPerk.buffMultiplier = 1f; _adhesiveSkinPerk.multiplierCurve = AnimationCurve.Linear(0f, 1f, 1f, 1f); _adhesiveSkinPerk.modules = new List(); _adhesiveSkinPerk.buff = new BuffContainer { id = "severon_climb_anything_buff", desc = "", loseOverTime = false, loseRate = 0f, buffTime = 1f, multiplier = 1f, loseRateEffectedByPerks = false, buffs = new List { new Buff { id = "grabAnything", maxAmount = 1f, amount = 0f } } }; _adhesiveSkinPerk.perkCard = LoadSpriteFromFile("RhoCard.png"); _adhesiveSkinPerk.perkFrame = LoadSpriteFromFile("PerkCard_Frame_Rho.png"); return _adhesiveSkinPerk; } public static Perk SemisolidMuscles() { //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_010c: 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_011e: 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_0134: 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_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: 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_015d: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Expected O, but got Unknown //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Expected O, but got Unknown //IL_01a5: Expected O, but got Unknown if ((Object)(object)_semisolidMusclesPerk != (Object)null) { return _semisolidMusclesPerk; } _semisolidMusclesPerk = ScriptableObject.CreateInstance(); ((Object)_semisolidMusclesPerk).name = "perk_semisolidMuscles"; ((Object)_semisolidMusclesPerk).hideFlags = (HideFlags)61; _semisolidMusclesPerk.id = "severon_semisolid_muscles_perk"; _semisolidMusclesPerk.title = "Semisolid Muscles"; _semisolidMusclesPerk.description = "You have 150% additional reach and 150% climb speed."; _semisolidMusclesPerk.flavorText = "It hurts it hurts it hurts it hurts it hurts it hurts it h..."; _semisolidMusclesPerk.cost = 0; _semisolidMusclesPerk.canStack = true; _semisolidMusclesPerk.stackMax = 10; _semisolidMusclesPerk.useBuff = true; _semisolidMusclesPerk.buffMultiplier = 1f; _semisolidMusclesPerk.multiplierCurve = AnimationCurve.Linear(0f, 1f, 1f, 1f); _semisolidMusclesPerk.modules = new List(); _semisolidMusclesPerk.buff = new BuffContainer { id = "severon_semisolid_muscles_buff", desc = "", loseOverTime = false, loseRate = 0f, buffTime = 1f, multiplier = 1f, loseRateEffectedByPerks = false, buffs = new List { new Buff { id = "addReach", maxAmount = 1.5f, amount = 0f }, new Buff { id = "addClimb", maxAmount = 1.5f, amount = 0f } } }; _semisolidMusclesPerk.perkCard = LoadSpriteFromFile("RhoCard.png"); _semisolidMusclesPerk.perkFrame = LoadSpriteFromFile("PerkCard_Frame_Rho.png"); return _semisolidMusclesPerk; } public static Perk InsectPheromones() { if ((Object)(object)_insectPheromonesPerk != (Object)null) { return _insectPheromonesPerk; } _insectPheromonesPerk = ScriptableObject.CreateInstance(); ((Object)_insectPheromonesPerk).name = "perk_poreGrowths"; ((Object)_insectPheromonesPerk).hideFlags = (HideFlags)61; _insectPheromonesPerk.id = "severon_insect_perk"; _insectPheromonesPerk.title = "Pore Growths"; _insectPheromonesPerk.description = "Moths love you."; _insectPheromonesPerk.flavorText = "It appears that moths have some form of empathy for the hosts of their eggs."; _insectPheromonesPerk.cost = 0; _insectPheromonesPerk.canStack = false; _insectPheromonesPerk.stackMax = 1; _insectPheromonesPerk.useBuff = false; _insectPheromonesPerk.multiplierCurve = AnimationCurve.Linear(0f, 1f, 1f, 1f); PerkModule_CrouchMothSpawner item = new PerkModule_CrouchMothSpawner { requiredCrouchTime = 3f, entityIdToSpawn = "Denizen_Moth", cooldownTime = 60f, spawnOffsetDistance = -2f }; _insectPheromonesPerk.modules = new List { (PerkModule)(object)item }; _insectPheromonesPerk.perkCard = LoadSpriteFromFile("RhoCard.png"); _insectPheromonesPerk.perkFrame = LoadSpriteFromFile("PerkCard_Frame_Rho.png"); return _insectPheromonesPerk; } public static Perk SubservientInstinct() { if ((Object)(object)_subservientInstinctPerk != (Object)null) { return _subservientInstinctPerk; } _subservientInstinctPerk = ScriptableObject.CreateInstance(); ((Object)_subservientInstinctPerk).name = "perk_subservientInstinct"; ((Object)_subservientInstinctPerk).hideFlags = (HideFlags)61; _subservientInstinctPerk.id = "severon_mothersupgrade_perk"; _subservientInstinctPerk.title = "Subservient Instinct"; _subservientInstinctPerk.description = "Gain a 7% increase to most stats when you sacrifice a Grub to Rho."; _subservientInstinctPerk.flavorText = "I'm sure they're an amazing parent."; _subservientInstinctPerk.cost = 0; _subservientInstinctPerk.canStack = false; _subservientInstinctPerk.stackMax = 1; _subservientInstinctPerk.useBuff = false; _subservientInstinctPerk.multiplierCurve = AnimationCurve.Linear(0f, 1f, 1f, 1f); _subservientInstinctPerk.modules = new List(); _subservientInstinctPerk.perkCard = LoadSpriteFromFile("RhoCard.png"); _subservientInstinctPerk.perkFrame = LoadSpriteFromFile("PerkCard_Frame_Rho.png"); return _subservientInstinctPerk; } public static Perk HungerMotive() { if ((Object)(object)_hungerMotive != (Object)null) { return _hungerMotive; } _hungerMotive = ScriptableObject.CreateInstance(); ((Object)_hungerMotive).name = "perk_hungerMotive"; ((Object)_hungerMotive).hideFlags = (HideFlags)61; _hungerMotive.id = "severon_hunger_perk"; _hungerMotive.title = "Hunger Motive"; _hungerMotive.description = "You can eat roaches. Gain a permanent 1% buff to every stat as per the roach's value when you eat one."; _hungerMotive.flavorText = "You can't shake the feeling that it isn't you who hungers."; _hungerMotive.cost = 0; _hungerMotive.canStack = false; _hungerMotive.stackMax = 1; _hungerMotive.useBuff = false; _hungerMotive.multiplierCurve = AnimationCurve.Linear(0f, 1f, 1f, 1f); _hungerMotive.modules = new List(); _hungerMotive.perkCard = LoadSpriteFromFile("RhoCard.png"); _hungerMotive.perkFrame = LoadSpriteFromFile("PerkCard_Frame_Rho.png"); return _hungerMotive; } public static Perk SharedTorment() { if ((Object)(object)_sharedTorment != (Object)null) { return _sharedTorment; } _sharedTorment = ScriptableObject.CreateInstance(); ((Object)_sharedTorment).name = "perk_sharedTorment"; ((Object)_sharedTorment).hideFlags = (HideFlags)61; _sharedTorment.id = "severon_torment_perk"; _sharedTorment.title = "Eternal Torment"; _sharedTorment.description = "When you take damage, something dies."; _sharedTorment.flavorText = "You don't know what you're killing, but you've lost the ability to care."; _sharedTorment.cost = 0; _sharedTorment.canStack = false; _sharedTorment.stackMax = 1; _sharedTorment.useBuff = false; _sharedTorment.multiplierCurve = AnimationCurve.Linear(0f, 1f, 1f, 1f); _sharedTorment.modules = new List(); _sharedTorment.perkCard = LoadSpriteFromFile("RhoCard.png"); _sharedTorment.perkFrame = LoadSpriteFromFile("PerkCard_Frame_Rho.png"); return _sharedTorment; } public static Perk TerribleThoughts() { if ((Object)(object)_terribleThoughts != (Object)null) { return _terribleThoughts; } _terribleThoughts = ScriptableObject.CreateInstance(); ((Object)_terribleThoughts).name = "perk_terribleThoughts"; ((Object)_terribleThoughts).hideFlags = (HideFlags)61; _terribleThoughts.id = "severon_terrible_thoughts"; _terribleThoughts.title = "Terrible Thoughts"; _terribleThoughts.description = "Whenever you jump midair, begin gliding and gain a temporary boost in the direction that you are looking."; _terribleThoughts.flavorText = "Don't look down."; _terribleThoughts.cost = 0; _terribleThoughts.canStack = false; _terribleThoughts.stackMax = 1; _terribleThoughts.useBuff = false; _terribleThoughts.multiplierCurve = AnimationCurve.Linear(0f, 1f, 1f, 1f); _terribleThoughts.modules = new List(); _terribleThoughts.perkCard = LoadSpriteFromFile("RhoCard.png"); _terribleThoughts.perkFrame = LoadSpriteFromFile("PerkCard_Frame_Rho.png"); return _terribleThoughts; } public static Sprite LoadSpriteFromFile(string fileName) { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Expected O, but got Unknown //IL_0066: 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) string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); string path = Path.Combine(directoryName, fileName); if (!File.Exists(path)) { return null; } byte[] array = File.ReadAllBytes(path); Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false); if (ImageConversion.LoadImage(val, array)) { Sprite val2 = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f), 100f); ((Texture)val2.texture).filterMode = (FilterMode)0; return val2; } return null; } } }