Decompiled source of 2R4R v1.0.18
ArtificerExtended.dll
Decompiled 2 weeks ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.CodeDom.Compiler; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text.RegularExpressions; using System.Threading.Tasks; using AncientScepter; using ArtificerExtended.Components; using ArtificerExtended.Helpers; using ArtificerExtended.Modules; using ArtificerExtended.Passive; using ArtificerExtended.Properties; using ArtificerExtended.Skills; using ArtificerExtended.States; using ArtificerExtended.Unlocks; using Assets.RoR2.Scripts.Platform; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using ChillRework; using EntityStates; using EntityStates.Huntress; using EntityStates.Mage; using EntityStates.Mage.Weapon; using EntityStates.Seeker; using EntityStates.Toolbot; using EntityStates.Treebot.Weapon; using JetBrains.Annotations; using JetHack; using KinematicCharacterController; using On.EntityStates; using On.EntityStates.Mage; using On.EntityStates.Mage.Weapon; using On.RoR2; using On.RoR2.Skills; using On.RoR2.UI; using R2API; using R2API.Utils; using RainrotSharedUtils.Components; using Rewired.ComponentControls.Effects; using RiskyMod.Survivors.Mage.Components; using RoR2; using RoR2.Achievements; using RoR2.ContentManagement; using RoR2.EntityLogic; using RoR2.ExpansionManagement; using RoR2.Networking; using RoR2.Orbs; using RoR2.Projectile; using RoR2.Skills; using RoR2.Stats; using RoR2.UI; using ThreeEyedGames; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Events; using UnityEngine.Networking; using VRAPI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")] [assembly: AssemblyCompany("ArtificerExtended")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("ArtificerExtended")] [assembly: AssemblyTitle("ArtificerExtended")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: UnverifiableCode] [module: UnverifiableCode] namespace ArtificerExtended { [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [R2APISubmoduleDependency(new string[] { "UnlockableAPI", "LanguageAPI", "LoadoutAPI", "PrefabAPI", "DamageAPI", "DeployableAPI" })] [BepInPlugin("com.Borbo.ArtificerExtended", "ArtificerExtended", "4.0.0")] public class ArtificerExtendedPlugin : BaseUnityPlugin { public delegate TCheese GiveCheese<TCheese>(); private class FlamethrowerContext { public AltArtiPassive passive; public float timer; public FlamethrowerContext(AltArtiPassive passive) { this.passive = passive; timer = 0f; } } private class PrepWallContext { public AltArtiPassive passive; public AltArtiPassive.BatchHandle handle; public PrepWallContext(AltArtiPassive passive, AltArtiPassive.BatchHandle handle) { this.passive = passive; this.handle = handle; } } private class NanoBombContext { public AltArtiPassive passive; public AltArtiPassive.BatchHandle handle; public float timer; public NanoBombContext(AltArtiPassive passive, AltArtiPassive.BatchHandle handle) { this.passive = passive; this.handle = handle; timer = 0f; } } public const string guid = "com.Borbo.ArtificerExtended"; public const string modName = "ArtificerExtended"; public const string teamName = "Borbo"; public const string version = "4.0.0"; public static ArtificerExtendedPlugin instance; public static AssetBundle iconBundle = Tools.LoadAssetBundle(Resources.artiskillicons); public const string iconsPath = "Assets/AESkillIcons/"; public const string DEVELOPER_PREFIX = "AE_"; public const string achievementIdentifier = "_ACHIEVEMENT_NAME"; public static bool isScepterLoaded = Tools.isLoaded("com.DestroyedClone.AncientScepter"); public static bool autosprintLoaded = Tools.isLoaded("com.johnedwa.RTAutoSprintEx"); public static bool is2r4rLoaded = Tools.isLoaded("com.HouseOfFruits.RiskierRain"); public static bool isRiskyModLoaded = Tools.isLoaded("com.RiskyLives.RiskyMod"); public static GameObject mageObject; public static CharacterBody mageBody; public static SkillLocator mageSkillLocator; public static GenericSkill magePassive; public static SkillFamily magePassiveFamily; public static SkillFamily magePrimary; public static SkillFamily mageSecondary; public static SkillFamily mageUtility; public static SkillFamily mageSpecial; public static float artiBoltDamage = 2.8f; public static float artiNanoDamage = 20f; public static float artiUtilCooldown = 12f; public static float meleeRangeChannel = 21f; public static float meleeRangeSingle = meleeRangeChannel + 7f; public static List<Type> entityStates = new List<Type>(); public static List<SkillBase> Skills = new List<SkillBase>(); public static Dictionary<SkillBase, bool> SkillStatusDictionary = new Dictionary<SkillBase, bool>(); private readonly Dictionary<Flamethrower, FlamethrowerContext> flamethrowerContext = new Dictionary<Flamethrower, FlamethrowerContext>(); private readonly Dictionary<PrepWall, PrepWallContext> prepWallContext = new Dictionary<PrepWall, PrepWallContext>(); private readonly Dictionary<BaseChargeBombState, NanoBombContext> nanoBombContext = new Dictionary<BaseChargeBombState, NanoBombContext>(); public const string ThunderSurgeHitBoxGroupName = "Charge"; public static Material ionSurgePowerOverlay; public static BuffDef ionSurgePower; public static GameObject muzzleflashIonSurgeTrail; internal static ConfigFile CustomConfigFile { get; set; } public static ConfigEntry<bool> RecolorMeteor { get; set; } public static bool ShouldReworkIonSurge { get; set; } private void Awake() { //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Expected O, but got Unknown //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Expected O, but got Unknown instance = this; Config.Init(); InitializeConfig(); Log.Init(((BaseUnityPlugin)this).Logger); Language.Init(); mageObject = LegacyResourcesAPI.Load<GameObject>("prefabs/characterbodies/MageBody"); mageObject.AddComponent<ElementCounter>(); mageBody = mageObject.GetComponent<CharacterBody>(); mageSkillLocator = mageObject.GetComponent<SkillLocator>(); if (Object.op_Implicit((Object)(object)mageObject) && Object.op_Implicit((Object)(object)mageBody) && Object.op_Implicit((Object)(object)mageSkillLocator)) { ArtificerExtended.Modules.Skills.characterSkillLocators.Add("MageBody", mageSkillLocator); Debug.Log((object)"ARTIFICEREXTENDED setup succeeded!"); } magePassive = CreateMagePassiveSlot(mageObject, mageSkillLocator); magePassiveFamily = magePassive.skillFamily; magePrimary = mageSkillLocator.primary.skillFamily; mageSecondary = mageSkillLocator.secondary.skillFamily; mageUtility = mageSkillLocator.utility.skillFamily; mageSpecial = mageSkillLocator.special.skillFamily; Debug.Log((object)"ArtificerExtended setup succeeded!"); CreateMagePassives(magePassiveFamily); if (ShouldReworkIonSurge) { DoSurgeReworkAssetSetup(); } SkillCatalog.Init += new hook_Init(ReplaceSkillDefs); if (is2r4rLoaded) { artiNanoDamage = 12f; artiUtilCooldown = 8f; } CommonAssets.Init(); AddHooks(); ArtiChanges(); InitializeContent(); CharacterMaster.OnBodyStart += new hook_OnBodyStart(AddAEBodyFX); new ContentPacks().Initialize(); VRStuff.SetupVR(); } private void InitializeContent() { Type[] types = Assembly.GetExecutingAssembly().GetTypes(); BeginInitializing<SkillBase>(types, "SwanSongSkills.txt"); } private void BeginInitializing<T>(Type[] allTypes, string fileName = "") where T : SharedBase { Type baseType = typeof(T); if (!baseType.IsAbstract) { Log.Error(Log.Combine() + "Incorrect BaseType: " + baseType.Name); return; } IEnumerable<Type> enumerable = allTypes.Where((Type type) => !type.IsAbstract && type.IsSubclassOf(baseType)); if (enumerable.Count() <= 0) { return; } Log.Debug(Log.Combine(baseType.Name) + "Initializing"); foreach (Type item in enumerable) { string text = Log.Combine(baseType.Name, item.Name); Log.Debug(text); T obj = (T)Activator.CreateInstance(item); if (ValidateBaseType(obj)) { Log.Debug(text + "Validated"); InitializeBaseType(obj); Log.Debug(text + "Initialized"); } } if (!string.IsNullOrEmpty(fileName)) { Language.TryPrintOutput(fileName); } } private bool ValidateBaseType(SharedBase obj) { bool isEnabled = obj.isEnabled; if (obj.lockEnabled) { return isEnabled; } return obj.Bind(isEnabled, "Should This Content Be Enabled"); } private void InitializeBaseType(SharedBase obj) { obj.Init(); } private GenericSkill CreateMagePassiveSlot(GameObject body, SkillLocator skillLocator) { //IL_00f4: 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) GenericSkill[] components = body.GetComponents<GenericSkill>(); foreach (GenericSkill val in components) { if (((Object)val.skillFamily).name.ToLower().Contains("passive")) { return val; } } SkillFamily val2 = ScriptableObject.CreateInstance<SkillFamily>(); val2.variants = (Variant[])(object)new Variant[1]; GenericSkill val3 = body.gameObject.AddComponent<GenericSkill>(); val3._skillFamily = val2; SkillsAPI.SetOrderPriority(val3, -1); SkillsAPI.SetLoadoutTitleTokenOverride(val3, "MAGE_LOADOUT_PASSIVE"); val3._skillFamily = val2; ((Object)val3.skillFamily).name = "MageBodyPassive"; LanguageAPI.Add("MAGE_LOADOUT_PASSIVE", "Passive"); Content.AddSkillFamily(val2); skillLocator.passiveSkill.enabled = false; EntityStateMachine[] components2 = body.GetComponents<EntityStateMachine>(); foreach (EntityStateMachine val4 in components2) { if (val4.customName == "Body") { val4.mainStateType = new SerializableEntityStateType(typeof(GenericCharacterMain)); } } return val3; } private void CharacterSelectController_BuildSkillStripDisplayData(orig_BuildSkillStripDisplayData orig, CharacterSelectController self, Loadout loadout, ValueType bodyInfo, object dest) { throw new NotImplementedException(); } public void CreateMagePassives(SkillFamily passiveFamily) { //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_00a9: 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_00bf: 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_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_0164: 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_017a: 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_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Expected O, but got Unknown //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Expected O, but got Unknown //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) PassiveSkillDef passiveSkillDef = ScriptableObject.CreateInstance<PassiveSkillDef>(); ((SkillDef)passiveSkillDef).skillNameToken = mageSkillLocator.passiveSkill.skillNameToken; ((Object)passiveSkillDef).name = mageSkillLocator.passiveSkill.skillNameToken; ((SkillDef)passiveSkillDef).skillDescriptionToken = mageSkillLocator.passiveSkill.skillDescriptionToken; ((SkillDef)passiveSkillDef).icon = mageSkillLocator.passiveSkill.icon; ((SkillDef)passiveSkillDef).canceledFromSprinting = false; ((SkillDef)passiveSkillDef).cancelSprintingOnActivation = false; passiveSkillDef.stateMachineDefaults = new PassiveSkillDef.StateMachineDefaults[1] { new PassiveSkillDef.StateMachineDefaults { machineName = "Body", initalState = new SerializableEntityStateType(typeof(MageCharacterMain)), mainState = new SerializableEntityStateType(typeof(MageCharacterMain)), defaultInitalState = new SerializableEntityStateType(typeof(GenericCharacterMain)), defaultMainState = new SerializableEntityStateType(typeof(GenericCharacterMain)) } }; LanguageAPI.Add("MAGE_PASSIVE_ENERGY_NAME", "Energetic Resonance"); Sprite icon = iconBundle.LoadAsset<Sprite>("Assets/AESkillIcons/ElementalIntensity.png"); PassiveSkillDef passiveSkillDef2 = ScriptableObject.CreateInstance<PassiveSkillDef>(); ((SkillDef)passiveSkillDef2).skillNameToken = "MAGE_PASSIVE_ENERGY_NAME"; ((SkillDef)passiveSkillDef2).skillDescriptionToken = CommonAssets.magePassiveDescToken; ((SkillDef)passiveSkillDef2).icon = icon; ((SkillDef)passiveSkillDef2).canceledFromSprinting = false; ((SkillDef)passiveSkillDef2).cancelSprintingOnActivation = false; passiveSkillDef2.stateMachineDefaults = new PassiveSkillDef.StateMachineDefaults[1] { new PassiveSkillDef.StateMachineDefaults { machineName = "Jet", initalState = new SerializableEntityStateType(typeof(AltArtiPassive)), mainState = new SerializableEntityStateType(typeof(AltArtiPassive)), defaultInitalState = new SerializableEntityStateType(typeof(Idle)), defaultMainState = new SerializableEntityStateType(typeof(Idle)) } }; ((SkillDef)passiveSkillDef2).keywordTokens = new string[3] { CommonAssets.meltKeywordToken, CommonAssets.arcticBlastKeywordToken, CommonAssets.lightningBoltKeywordToken }; Variant[] array = new Variant[2]; Variant val = new Variant { skillDef = (SkillDef)(object)passiveSkillDef, unlockableName = "" }; ((Variant)(ref val)).viewableNode = new Node(((SkillDef)passiveSkillDef).skillNameToken, false, (Node)null); array[0] = val; val = new Variant { skillDef = (SkillDef)(object)passiveSkillDef2, unlockableDef = UnlockBase.CreateUnlockDef(typeof(FullKitElementUnlock), icon) }; ((Variant)(ref val)).viewableNode = new Node(((SkillDef)passiveSkillDef2).skillNameToken, false, (Node)null); array[1] = val; passiveFamily.variants = (Variant[])(object)array; Content.AddSkillDef((SkillDef)(object)passiveSkillDef); Content.AddSkillDef((SkillDef)(object)passiveSkillDef2); } private void ReplaceSkillDefs(orig_Init orig) { orig.Invoke(); ReplaceVanillaIonSurge(ShouldReworkIonSurge); } private void AddAEBodyFX(orig_OnBodyStart orig, CharacterMaster self, CharacterBody body) { orig.Invoke(self, body); AEBodyEffects aEBodyEffects = ((Component)body).gameObject.AddComponent<AEBodyEffects>(); aEBodyEffects.body = body; } private void InitializeConfig() { ShouldReworkIonSurge = ConfigManager.DualBind("(A0) ArtificerExtended : Ion Surge", "Enable Ion Surge Rework", defaultValue: true, "Determines whether Ion Surge gets reworked. Note that vanilla Ion Surge is INCOMPATIBLE with ALL alt-passives. Use at your own risk."); } private void ArtiChanges() { LanguageAPI.Add("MAGE_OUTRO_FLAVOR", "..and so she left, still searching for a heaven that no longer exists."); GameObject val = LegacyResourcesAPI.Load<GameObject>("prefabs/projectiles/MageIcewallPillarProjectile"); ProjectileImpactExplosion componentInChildren = val.GetComponentInChildren<ProjectileImpactExplosion>(); if (Object.op_Implicit((Object)(object)componentInChildren)) { componentInChildren.destroyOnEnemy = false; } LanguageAPI.Add("MAGE_UTILITY_ICE_DESCRIPTION", "<style=cIsUtility>Freezing</style>. Create a barrier that hurts enemies for up to <style=cIsDamage>12x100% damage</style>."); SkillDef skillDef = mageSpecial.variants[0].skillDef; if ((Object)(object)skillDef != (Object)null) { skillDef.mustKeyPress = true; } } public static SkillDef CloneSkillDef(SkillDef oldDef) { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0051: 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) SkillDef val = ScriptableObject.CreateInstance<SkillDef>(); val.skillName = oldDef.skillName; val.skillNameToken = oldDef.skillNameToken; val.skillDescriptionToken = oldDef.skillDescriptionToken; val.icon = oldDef.icon; val.activationStateMachineName = oldDef.activationStateMachineName; val.activationState = oldDef.activationState; val.interruptPriority = oldDef.interruptPriority; val.baseRechargeInterval = oldDef.baseRechargeInterval; val.baseMaxStock = oldDef.baseMaxStock; val.rechargeStock = oldDef.rechargeStock; val.requiredStock = oldDef.requiredStock; val.stockToConsume = oldDef.stockToConsume; val.beginSkillCooldownOnSkillEnd = oldDef.beginSkillCooldownOnSkillEnd; val.fullRestockOnAssign = oldDef.fullRestockOnAssign; val.dontAllowPastMaxStocks = oldDef.dontAllowPastMaxStocks; val.resetCooldownTimerOnUse = oldDef.resetCooldownTimerOnUse; val.isCombatSkill = oldDef.isCombatSkill; val.cancelSprintingOnActivation = oldDef.cancelSprintingOnActivation; val.canceledFromSprinting = oldDef.canceledFromSprinting; val.forceSprintDuringState = oldDef.forceSprintDuringState; val.mustKeyPress = oldDef.mustKeyPress; val.keywordTokens = oldDef.keywordTokens; return val; } public void DoHooks() { AddHooks(); } private void RemoveHooks() { } private void AddHooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Expected O, but got Unknown //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Expected O, but got Unknown //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Expected O, but got Unknown //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Expected O, but got Unknown //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Expected O, but got Unknown //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Expected O, but got Unknown //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Expected O, but got Unknown FireFireBolt.FireGauntlet += new hook_FireGauntlet(FireFireBolt_FireGauntlet); BaseChargeBombState.OnEnter += new hook_OnEnter(BaseChargeBombState_OnEnter); BaseChargeBombState.FixedUpdate += new hook_FixedUpdate(BaseChargeBombState_FixedUpdate); BaseChargeBombState.OnExit += new hook_OnExit(BaseChargeBombState_OnExit); PrepWall.OnEnter += new hook_OnEnter(PrepWall_OnEnter); PrepWall.OnExit += new hook_OnExit(PrepWall_OnExit); Flamethrower.OnEnter += new hook_OnEnter(Flamethrower_OnEnter); Flamethrower.FixedUpdate += new hook_FixedUpdate(Flamethrower_FixedUpdate); Flamethrower.OnExit += new hook_OnExit(Flamethrower_OnExit); HealthComponent.TakeDamage += new hook_TakeDamage(HealthComponent_TakeDamage); GlobalEventManager.onCharacterDeathGlobal += GlobalEventManager_OnCharacterDeath; CharacterMaster.OnBodyStart += new hook_OnBodyStart(CharacterMaster_OnBodyStart); CharacterMaster.OnBodyDestroyed += new hook_OnBodyDestroyed(CharacterMaster_OnBodyDestroyed); ChillRework.OnMaxChill += FrostNovaOnMaxChill; RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(MeltAttackSpeedBuff); GlobalEventManager.OnHitAll += new hook_OnHitAll(ChainLightningHook); } private static void ChainLightningHook(orig_OnHitAll orig, GlobalEventManager self, DamageInfo damageInfo, GameObject hitObject) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_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_0108: Unknown result type (might be due to invalid IL or missing references) if (DamageAPI.HasModdedDamageType(damageInfo, CommonAssets.ChainLightningDamageType)) { LightningOrb val = new LightningOrb(); ((Orb)val).origin = damageInfo.position; val.damageValue = damageInfo.damage * CommonAssets.chainLightningZapDamageFraction; val.isCrit = damageInfo.crit; val.teamIndex = TeamComponent.GetObjectTeam(damageInfo.attacker); val.attacker = damageInfo.attacker; val.bouncesRemaining = 0; val.canBounceOnSameTarget = false; val.bouncedObjects = new List<HealthComponent>(); HurtBox component = hitObject.GetComponent<HurtBox>(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.healthComponent)) { val.bouncedObjects.Add(component.healthComponent); } else { HealthComponent component2 = hitObject.GetComponent<HealthComponent>(); if (Object.op_Implicit((Object)(object)component2)) { val.bouncedObjects.Add(component2); } } val.procChainMask = damageInfo.procChainMask; val.procCoefficient = CommonAssets.chainLightningZapDamageCoefficient; val.lightningType = (LightningType)0; val.damageColorIndex = (DamageColorIndex)0; val.range = CommonAssets.chainLightningZapDistance; HurtBox val2 = val.PickNextTarget(damageInfo.position); if (Object.op_Implicit((Object)(object)val2)) { ((Orb)val).target = val2; OrbManager.instance.AddOrb((Orb)(object)val); } } orig.Invoke(self, damageInfo, hitObject); } private void MeltAttackSpeedBuff(CharacterBody sender, StatHookEventArgs args) { int buffCount = sender.GetBuffCount(CommonAssets.meltBuff); if (buffCount > 0) { args.baseAttackSpeedAdd += AltArtiPassive.meltAspdIncrease * (float)buffCount; } } private void CharacterMaster_OnBodyStart(orig_OnBodyStart orig, CharacterMaster self, CharacterBody body) { ElementCounter component = ((Component)body).GetComponent<ElementCounter>(); if ((Object)(object)component != (Object)null) { component.OnBodyStart(body.skillLocator); } orig.Invoke(self, body); } private void CharacterMaster_OnBodyDestroyed(orig_OnBodyDestroyed orig, CharacterMaster self, CharacterBody body) { ElementCounter component = ((Component)body).GetComponent<ElementCounter>(); if ((Object)(object)component != (Object)null) { component.OnBodyEnd(); } orig.Invoke(self, body); } private void GlobalEventManager_OnCharacterDeath(DamageReport damageReport) { //IL_00ee: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active || damageReport == null) { return; } CharacterBody attackerBody = damageReport.attackerBody; CharacterBody victimBody = damageReport.victimBody; if (!Object.op_Implicit((Object)(object)victimBody) || !Object.op_Implicit((Object)(object)attackerBody) || !Object.op_Implicit((Object)(object)victimBody.healthComponent)) { return; } ElementCounter.Power powerLevelFromBody = ElementCounter.GetPowerLevelFromBody(((Component)attackerBody).gameObject, (MageElement)2); int buffCount = victimBody.GetBuffCount(Buffs.Slow80); int buffCount2 = victimBody.GetBuffCount(ChillRework.ChillLimitBuff); int num = ((buffCount2 <= 0) ? 1 : 5); if (buffCount >= num && powerLevelFromBody > ElementCounter.Power.None) { float num2 = (float)buffCount / 10f; float num3 = 1f - num2; float num4 = Mathf.Pow(num3, 2f); float num5 = 1f - num4; if (Util.CheckRoll(num5 * 100f, damageReport.attackerMaster)) { AltArtiPassive.DoNova(attackerBody, powerLevelFromBody, ((Component)damageReport.victim).transform.position, buffCount); } } } private void HealthComponent_TakeDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo) { orig.Invoke(self, damageInfo); } private void FrostNovaOnMaxChill(CharacterBody aBody, CharacterBody vBody) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)aBody != (Object)null && AltArtiPassive.instanceLookup.TryGetValue(((Component)aBody).gameObject, out var value)) { ElementCounter.Power powerLevelFromBody = ElementCounter.GetPowerLevelFromBody(((Component)aBody).gameObject, (MageElement)2, value); if (powerLevelFromBody > ElementCounter.Power.None) { AltArtiPassive.DoNova(aBody, powerLevelFromBody, vBody.corePosition); } } } private void Flamethrower_OnEnter(orig_OnEnter orig, Flamethrower self) { orig.Invoke(self); GameObject gameObject = ((Component)((EntityState)self).outer).gameObject; if (AltArtiPassive.instanceLookup.ContainsKey(gameObject)) { AltArtiPassive altArtiPassive = AltArtiPassive.instanceLookup[gameObject]; FlamethrowerContext value = new FlamethrowerContext(altArtiPassive); altArtiPassive.SkillCast(null, isFire: true); flamethrowerContext[self] = value; } } private void Flamethrower_FixedUpdate(orig_FixedUpdate orig, Flamethrower self) { orig.Invoke(self); if (this.flamethrowerContext.ContainsKey(self)) { FlamethrowerContext flamethrowerContext = this.flamethrowerContext[self]; flamethrowerContext.timer += Time.fixedDeltaTime * flamethrowerContext.passive.ext_attackSpeedStat; int num = 0; while (flamethrowerContext.timer >= flamethrowerContext.passive.ext_flamethrowerInterval && num <= flamethrowerContext.passive.ext_flamethrowerMaxPerTick) { flamethrowerContext.passive.SkillCast(null, isFire: true); num++; flamethrowerContext.timer -= flamethrowerContext.passive.ext_flamethrowerInterval; } } } private void Flamethrower_OnExit(orig_OnExit orig, Flamethrower self) { orig.Invoke(self); if (this.flamethrowerContext.ContainsKey(self)) { FlamethrowerContext flamethrowerContext = this.flamethrowerContext[self]; flamethrowerContext.passive.SkillCast(null, isFire: true); this.flamethrowerContext.Remove(self); } } private void PrepWall_OnEnter(orig_OnEnter orig, PrepWall self) { orig.Invoke(self); GameObject gameObject = ((Component)((EntityState)self).outer).gameObject; if (AltArtiPassive.instanceLookup.ContainsKey(gameObject)) { AltArtiPassive altArtiPassive = AltArtiPassive.instanceLookup[gameObject]; AltArtiPassive.BatchHandle handle = new AltArtiPassive.BatchHandle(); altArtiPassive.SkillCast(handle); PrepWallContext value = new PrepWallContext(altArtiPassive, handle); prepWallContext[self] = value; } } private void PrepWall_OnExit(orig_OnExit orig, PrepWall self) { orig.Invoke(self); if (this.prepWallContext.ContainsKey(self)) { PrepWallContext prepWallContext = this.prepWallContext[self]; prepWallContext.handle.Fire(prepWallContext.passive.ext_prepWallMinDelay, prepWallContext.passive.ext_prepWallMaxDelay); this.prepWallContext.Remove(self); } } private void BaseChargeBombState_OnEnter(orig_OnEnter orig, BaseChargeBombState self) { orig.Invoke(self); GameObject gameObject = ((Component)((EntityState)self).outer).gameObject; if (AltArtiPassive.instanceLookup.ContainsKey(gameObject)) { AltArtiPassive altArtiPassive = AltArtiPassive.instanceLookup[gameObject]; AltArtiPassive.BatchHandle handle = new AltArtiPassive.BatchHandle(); NanoBombContext value = new NanoBombContext(altArtiPassive, handle); nanoBombContext[self] = value; altArtiPassive.SkillCast(handle, self is ChargeSolarFlare); } } private void BaseChargeBombState_FixedUpdate(orig_FixedUpdate orig, BaseChargeBombState self) { orig.Invoke(self); if (this.nanoBombContext.ContainsKey(self)) { NanoBombContext nanoBombContext = this.nanoBombContext[self]; nanoBombContext.timer += Time.fixedDeltaTime * nanoBombContext.passive.ext_attackSpeedStat; int num = 0; while (nanoBombContext.timer >= nanoBombContext.passive.ext_nanoBombInterval && num <= nanoBombContext.passive.ext_nanoBombMaxPerTick) { num++; nanoBombContext.passive.SkillCast(nanoBombContext.handle, self is ChargeSolarFlare); nanoBombContext.timer -= nanoBombContext.passive.ext_nanoBombInterval; } } } private void BaseChargeBombState_OnExit(orig_OnExit orig, BaseChargeBombState self) { orig.Invoke(self); if (this.nanoBombContext.ContainsKey(self)) { NanoBombContext nanoBombContext = this.nanoBombContext[self]; int num = 0; while (nanoBombContext.timer >= nanoBombContext.passive.ext_nanoBombInterval && num <= nanoBombContext.passive.ext_nanoBombMaxPerTick) { num++; nanoBombContext.passive.SkillCast(nanoBombContext.handle, self is ChargeSolarFlare); nanoBombContext.timer -= nanoBombContext.passive.ext_nanoBombInterval; } nanoBombContext.handle.Fire(nanoBombContext.passive.ext_nanoBombMinDelay, nanoBombContext.passive.ext_nanoBombMaxDelay); this.nanoBombContext.Remove(self); } } private void FireFireBolt_FireGauntlet(orig_FireGauntlet orig, FireFireBolt self) { orig.Invoke(self); GameObject gameObject = ((Component)((EntityState)self).outer).gameObject; if (AltArtiPassive.instanceLookup.TryGetValue(gameObject, out var value)) { value.SkillCast(null, !(self is FireLightningBolt) && !(self is FireSnowBall)); } } public void ReplaceVanillaIonSurge(bool shouldReworkSurge) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: 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_005d: Unknown result type (might be due to invalid IL or missing references) SkillDef val = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/Base/Mage/MageBodyFlyUp.asset").WaitForCompletion(); if ((Object)(object)val != (Object)null) { Debug.Log((object)"Changing ion surge"); if (shouldReworkSurge) { ModifyVanillaIonSurge(val); } else { Content.AddEntityState(typeof(VanillaIonSurge)); val.activationState = new SerializableEntityStateType(typeof(VanillaIonSurge)); } } if (isScepterLoaded) { ReplaceScepterIonSurge(shouldReworkSurge, val); } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public void ReplaceScepterIonSurge(bool shouldReworkSurge, SkillDef surgeSkillDef) { if (!shouldReworkSurge || (Object)(object)surgeSkillDef == (Object)null) { Debug.LogError((object)"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\nArtificerExtended could not replace Ancient Scepter's Antimatter Surge. Antimatter Surge WILL break Artificer Extended's alt passives. \nEither turn on ArtificerExtended's Ion Surge rework to use ArtificerExtended's Antimatter Surge, avoid using Antimatter Surge with ArtificerExtended's alt passive, or tell the Ancient Scepter developers to get in contact to fix Antimatter Surge. \nThis is NOT an error that can be fixed on the ArtificerExtended side.\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); return; } SkillDef skillDef = SkillCatalog.GetSkillDef(SkillCatalog.FindSkillIndexByName(surgeSkillDef.skillName + "Scepter")); if ((Object)(object)skillDef != (Object)null) { ModifyScepterSurge(skillDef); } } private void DoSurgeReworkAssetSetup() { //IL_0121: 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_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_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Expected O, but got Unknown //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: 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_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00df: 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_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_02ca: Unknown result type (might be due to invalid IL or missing references) //IL_036a: Unknown result type (might be due to invalid IL or missing references) //IL_036f: Unknown result type (might be due to invalid IL or missing references) ModelLocator component = ((Component)mageBody).GetComponent<ModelLocator>(); Transform val = ((component != null) ? component.modelTransform : null); if (Object.op_Implicit((Object)(object)val)) { HitBoxGroup val2 = ((Component)val).gameObject.AddComponent<HitBoxGroup>(); val2.groupName = "Charge"; ChildLocator component2 = ((Component)val).GetComponent<ChildLocator>(); if (Object.op_Implicit((Object)(object)component2)) { Transform obj = component2.FindChild("Base"); Transform val3 = ((obj != null) ? obj.parent : null); if (Object.op_Implicit((Object)(object)val3)) { GameObject val4 = new GameObject(); HitBox val5 = val4.AddComponent<HitBox>(); val4.transform.parent = val3; val4.layer = LayerIndex.projectile.intVal; val4.transform.localPosition = new Vector3(0f, 1.564f, 0f); val4.transform.localRotation = Quaternion.identity; val4.transform.localScale = Vector3.one * 3f; val2.hitBoxes = (HitBox[])(object)new HitBox[1] { val5 }; } } } ionSurgePower = Content.CreateAndAddBuff("bdIonSurgePower", null, Color.black, canStack: false, isDebuff: false); ionSurgePower.isHidden = true; ionSurgePowerOverlay = Object.Instantiate<Material>(Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/VoidSurvivor/matVoidSurvivorCorruptOverlay.mat").WaitForCompletion()); ((Object)ionSurgePowerOverlay).name = "matIonSurgePowerOverlay"; ionSurgePowerOverlay.SetColor("_TintColor", Color32.op_Implicit(new Color32((byte)0, (byte)210, byte.MaxValue, byte.MaxValue))); CharacterModel.UpdateOverlays += new hook_UpdateOverlays(SurgeOverlay); muzzleflashIonSurgeTrail = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Mage/MuzzleflashMageLightningLargeWithTrail.prefab").WaitForCompletion(), "MuzzleflashIonSurgeTrail"); ParticleSystem[] componentsInChildren = muzzleflashIonSurgeTrail.GetComponentsInChildren<ParticleSystem>(); ParticleSystem[] array = componentsInChildren; foreach (ParticleSystem val6 in array) { Debug.Log((object)((Object)((Component)val6).gameObject).name); MainModule main = val6.main; ((MainModule)(ref main)).duration = SurgeExtendedDash.flightDuration; } TrailRenderer componentInChildren = muzzleflashIonSurgeTrail.GetComponentInChildren<TrailRenderer>(); if (Object.op_Implicit((Object)(object)componentInChildren)) { componentInChildren.time = SurgeExtendedDash.flightDuration + 0.5f; } Transform val7 = muzzleflashIonSurgeTrail.transform.Find("Trail"); if (Object.op_Implicit((Object)(object)val7)) { TrailRenderer component3 = ((Component)val7).GetComponent<TrailRenderer>(); component3.time = SurgeExtendedDash.flightDuration + 0.5f; } else { Debug.LogError((object)"A"); } Transform val8 = muzzleflashIonSurgeTrail.transform.Find("Matrix, Mesh"); if (Object.op_Implicit((Object)(object)val8)) { ParticleSystem component4 = ((Component)val8).GetComponent<ParticleSystem>(); MainModule main2 = component4.main; ((MainModule)(ref main2)).duration = SurgeExtendedDash.flightDuration; ((MainModule)(ref main2)).loop = true; } else { Debug.LogError((object)"nb"); } Transform val9 = muzzleflashIonSurgeTrail.transform.Find("Point Light"); if (Object.op_Implicit((Object)(object)val9)) { LightIntensityCurve component5 = ((Component)val9).GetComponent<LightIntensityCurve>(); component5.timeMax = 2f; } else { Debug.LogError((object)"c"); } Transform val10 = muzzleflashIonSurgeTrail.transform.Find("Smoke"); if (Object.op_Implicit((Object)(object)val10)) { ParticleSystem component6 = ((Component)val10).GetComponent<ParticleSystem>(); MainModule main3 = component6.main; ((MainModule)(ref main3)).duration = SurgeExtendedDash.flightDuration; ((MainModule)(ref main3)).loop = true; } else { Debug.LogError((object)"d"); } } private void SurgeOverlay(orig_UpdateOverlays orig, CharacterModel self) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if ((int)self.visibility != 0 && !((Object)(object)self.body == (Object)null)) { AddOverlay(ionSurgePowerOverlay, self.body.HasBuff(ionSurgePower)); } void AddOverlay(Material overlayMaterial, bool condition) { if (self.activeOverlayCount < CharacterModel.maxOverlays && condition) { Material[] currentOverlays = self.currentOverlays; CharacterModel obj = self; int activeOverlayCount = obj.activeOverlayCount; obj.activeOverlayCount = activeOverlayCount + 1; currentOverlays[activeOverlayCount] = overlayMaterial; } } } public void ModifyVanillaIonSurge(SkillDef surge) { //IL_0074: 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) Content.AddEntityState(typeof(SurgeExtendedDash)); Content.AddEntityState(typeof(SurgeExtendedImpact)); LanguageAPI.Add("MAGE_SPECIAL_LIGHTNING_DESCRIPTION", "<style=cIsDamage>Stunning</style>. Surge forward, dealing <style=cIsDamage>" + Tools.ConvertDecimal(SurgeExtendedDash.grazeDamageCoefficient) + " damage</style> to enemies in your path. Upon impact, create an explosion for <style=cIsDamage>" + Tools.ConvertDecimal(SurgeExtendedDash.impactDamageCoefficient) + " damage</style>."); surge.activationState = new SerializableEntityStateType(typeof(SurgeExtendedDash)); surge.baseRechargeInterval = 8f; } public void ModifyScepterSurge(SkillDef surge2) { //IL_003c: 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) Content.AddEntityState(typeof(AlternateIonSurge2)); LanguageAPI.Add("MAGE_ANTISURGE_LIGHTNING_NAME", "Antimatter Surge"); LanguageAPI.Add("MAGE_ANTISURGE_LIGHTNING_DESC", "Burst forward up to 3 times. <style=cIsDamage>Can attack while dashing.</style> Trigger again to cancel early.\n<color=#d299ff>SCEPTER: Each burst reduces ALL cooldowns.</color>"); surge2.activationState = new SerializableEntityStateType(typeof(AlternateIonSurge2)); surge2.baseRechargeInterval = 8f; surge2.skillDescriptionToken = "MAGE_ANTISURGE_LIGHTNING_DESC"; surge2.skillNameToken = "MAGE_ANTISURGE_LIGHTNING_NAME"; surge2.keywordTokens = new string[0]; } } public class AEBodyEffects : MonoBehaviour { public CharacterBody body; private TemporaryVisualEffect blizzardArmorTempEffect; private void Update() { UpdateSingleTemporaryVisualEffect(ref blizzardArmorTempEffect, _1FrostbiteSkill.blizzardArmorVFX, body.radius * 0.5f, body.GetBuffCount(_1FrostbiteSkill.artiIceShield)); } private void UpdateSingleTemporaryVisualEffect(ref TemporaryVisualEffect tempEffect, GameObject obj, float effectRadius, int count, string childLocatorOverride = "") { //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: 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) bool flag = (Object)(object)tempEffect != (Object)null; if (flag == count > 0) { return; } if (count > 0) { if (flag) { return; } GameObject val = Object.Instantiate<GameObject>(obj, body.corePosition, Quaternion.identity); tempEffect = val.GetComponent<TemporaryVisualEffect>(); tempEffect.parentTransform = body.coreTransform; tempEffect.visualState = (VisualState)0; tempEffect.healthComponent = body.healthComponent; tempEffect.radius = effectRadius; LocalCameraEffect component = val.GetComponent<LocalCameraEffect>(); if (Object.op_Implicit((Object)(object)component)) { component.targetCharacter = ((Component)this).gameObject; } if (string.IsNullOrEmpty(childLocatorOverride)) { return; } ModelLocator modelLocator = body.modelLocator; ChildLocator val2; if ((Object)(object)modelLocator == (Object)null) { val2 = null; } else { Transform modelTransform = modelLocator.modelTransform; val2 = (((Object)(object)modelTransform != (Object)null) ? ((Component)modelTransform).GetComponent<ChildLocator>() : null); } ChildLocator val3 = val2; if (Object.op_Implicit((Object)(object)val3)) { Transform val4 = val3.FindChild(childLocatorOverride); if (Object.op_Implicit((Object)(object)val4)) { tempEffect.parentTransform = val4; } } } else if (Object.op_Implicit((Object)(object)tempEffect)) { tempEffect.visualState = (VisualState)1; } } } public abstract class SharedBase { public virtual string BASE_TOKEN => TOKEN_PREFIX + TOKEN_IDENTIFIER; public abstract string TOKEN_IDENTIFIER { get; } public abstract string TOKEN_PREFIX { get; } public virtual bool lockEnabled { get; } = false; public abstract string ConfigName { get; } public virtual bool isEnabled { get; } = true; public virtual ConfigFile configFile { get; } = Config.MyConfig; public static ManualLogSource Logger => Log._logSource; public abstract AssetBundle assetBundle { get; } public virtual Type RequiredUnlock { get; } public abstract void Hooks(); public abstract void Lang(); public virtual void Init() { ConfigManager.HandleConfigAttributes(GetType(), ConfigName, configFile); Hooks(); Lang(); } public T Bind<T>(T defaultValue, string configName, string configDesc = "") { return ConfigManager.DualBindToConfig(ConfigName, configFile, configName, defaultValue, configDesc); } public static float GetHyperbolic(float firstStack, float cap, float chance) { if (firstStack >= cap) { return cap * (chance / firstStack); } float num = chance / firstStack; float num2 = 100f * firstStack / (cap - firstStack); return cap * (1f - 100f / (num * num2 + 100f)); } } internal static class Log { public static bool enableDebugging; internal static ManualLogSource _logSource; internal static void Init(ManualLogSource logSource) { enableDebugging = ConfigManager.DualBindToConfig("Artificer Extended", Config.MyConfig, "Enable Debugging", defaultValue: false, "Enable debug outputs to the log for troubleshooting purposes. Enabling this will slow down the game."); _logSource = logSource; } internal static string Combine(params string[] parameters) { string text = "ArtificerExtended : "; foreach (string text2 in parameters) { text = text + text2 + " : "; } return text; } internal static void Debug(object data) { if (enableDebugging) { _logSource.LogDebug(data); } } internal static void Error(object data) { _logSource.LogError(data); } internal static void ErrorAssetBundle(string assetName, string bundleName) { Error("failed to load asset, " + assetName + ", because it does not exist in asset bundle, " + bundleName); } internal static void Fatal(object data) { _logSource.LogFatal(data); } internal static void Info(object data) { _logSource.LogInfo(data); } internal static void Message(object data) { _logSource.LogMessage(data); } internal static void Warning(object data) { _logSource.LogWarning(data); } } public static class Tools { public static string modPrefix = string.Format("@{0}+{1}", "ArtificerExtended", "artiskillicons"); public static AssetBundle LoadAssetBundle(byte[] resourceBytes) { if (resourceBytes == null) { throw new ArgumentNullException("resourceBytes"); } return AssetBundle.LoadFromMemory(resourceBytes); } public static string GetModPrefix(this BaseUnityPlugin plugin, string bundleName) { return $"@{plugin.Info.Metadata.Name}+{bundleName}"; } public static string ConvertDecimal(float f) { return f * 100f + "%"; } internal static bool isLoaded(string modguid) { foreach (KeyValuePair<string, PluginInfo> pluginInfo in Chainloader.PluginInfos) { string key = pluginInfo.Key; PluginInfo value = pluginInfo.Value; if (key == modguid) { return true; } } return false; } internal static void GetMaterial(GameObject model, string childObject, Color color, ref Material material, float scaleMultiplier = 1f, bool replaceAll = false) { //IL_0030: 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_00aa: 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_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Expected O, but got Unknown //IL_0092: Unknown result type (might be due to invalid IL or missing references) Renderer[] componentsInChildren = model.GetComponentsInChildren<Renderer>(); Renderer[] array = componentsInChildren; foreach (Renderer val in array) { Renderer val2 = val; if (string.Equals(((Object)val).name, childObject)) { if (color == Color.clear) { Object.Destroy((Object)(object)val); break; } if ((Object)(object)material == (Object)null) { material = new Material(val.material); material.mainTexture = val.material.mainTexture; material.shader = val.material.shader; material.color = color; } val.material = material; Transform transform = ((Component)val).transform; transform.localScale *= scaleMultiplier; if (!replaceAll) { break; } } } } internal static void DebugMaterial(GameObject model) { Renderer[] componentsInChildren = model.GetComponentsInChildren<Renderer>(); Renderer[] array = componentsInChildren; foreach (Renderer val in array) { Renderer val2 = val; Debug.Log((object)("Material: " + ((Object)val2).name.ToString())); } } internal static void GetParticle(GameObject model, string childObject, Color color, float sizeMultiplier = 1f, bool replaceAll = false) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_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_002e: 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_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) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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) ParticleSystem[] componentsInChildren = model.GetComponentsInChildren<ParticleSystem>(); ParticleSystem[] array = componentsInChildren; foreach (ParticleSystem val in array) { ParticleSystem val2 = val; MainModule main = val2.main; ColorOverLifetimeModule colorOverLifetime = val2.colorOverLifetime; ColorBySpeedModule colorBySpeed = val2.colorBySpeed; if (string.Equals(((Object)val2).name, childObject)) { ((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(color); ((MainModule)(ref main)).startSizeMultiplier = ((MainModule)(ref main)).startSizeMultiplier * sizeMultiplier; ((ColorOverLifetimeModule)(ref colorOverLifetime)).color = MinMaxGradient.op_Implicit(color); ((ColorBySpeedModule)(ref colorBySpeed)).color = MinMaxGradient.op_Implicit(color); if (!replaceAll) { break; } } } } internal static void DebugParticleSystem(GameObject model) { ParticleSystem[] componentsInChildren = model.GetComponentsInChildren<ParticleSystem>(); ParticleSystem[] array = componentsInChildren; foreach (ParticleSystem val in array) { ParticleSystem val2 = val; Debug.Log((object)("Particle: " + ((Object)val2).name.ToString())); } } internal static void GetLight(GameObject model, string childObject, Color color, bool replaceAll = false) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) Light[] componentsInChildren = model.GetComponentsInChildren<Light>(); Light[] array = componentsInChildren; foreach (Light val in array) { Light val2 = val; if (string.Equals(((Object)val2).name, childObject)) { val2.color = color; if (!replaceAll) { break; } } } } internal static void DebugLight(GameObject model) { Light[] componentsInChildren = model.GetComponentsInChildren<Light>(); Light[] array = componentsInChildren; foreach (Light val in array) { Light val2 = val; Debug.Log((object)("Light: " + ((Object)val2).name.ToString())); } } } public static class VRStuff { public static bool VRInstalled; [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void SetupVR() { if (Chainloader.PluginInfos.ContainsKey("com.DrBibop.VRAPI")) { VRInstalled = VR.enabled && MotionControls.enabled; } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static Ray GetVRHandAimRay(bool dominant) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) return dominant ? MotionControls.dominantHand.aimRay : MotionControls.nonDominantHand.aimRay; } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void AnimateVRHand(bool dominant, string triggerName) { HandController val = (dominant ? MotionControls.dominantHand : MotionControls.nonDominantHand); val.animator.SetTrigger(triggerName); } } } namespace ArtificerExtended.Unlocks { [RegisterAchievement("AbsoluteZeroUnlock", "AbsoluteZeroUnlock", "FreeMage", 5u, null)] public class AbsoluteZeroUnlock : UnlockBase { public override string TOKEN_IDENTIFIER => "AbsoluteZeroUnlock".ToUpperInvariant(); public override string AchievementName => "Artificer: Absolute Zero"; public override string AchievementDesc => "As Artificer, freeze and execute the King of Nothing."; private void ExecuteMithrixCheck(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001e: 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_002b: 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_0038: 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_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_00a4: Unknown result type (might be due to invalid IL or missing references) bool flag = false; CharacterBody body = self.body; BodyIndex bodyIndex = body.bodyIndex; if ((bodyIndex == BodyCatalog.FindBodyIndex("BrotherBody") || bodyIndex == BodyCatalog.FindBodyIndex("BrotherGlassBody") || bodyIndex == BodyCatalog.FindBodyIndex("BrotherHauntBody") || bodyIndex == BodyCatalog.FindBodyIndex("BrotherHurtBody")) && self.isInFrozenState) { flag = true; } orig.Invoke(self, damageInfo); if (!flag || self.alive) { return; } GameObject attacker = damageInfo.attacker; CharacterBody val = ((attacker != null) ? attacker.GetComponent<CharacterBody>() : null); if ((Object)(object)val != (Object)null) { BodyIndex bodyIndex2 = val.bodyIndex; if (bodyIndex2 == ((BaseAchievement)this).LookUpRequiredBodyIndex()) { ((BaseAchievement)this).Grant(); } } } public override void OnInstall() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown HealthComponent.TakeDamage += new hook_TakeDamage(ExecuteMithrixCheck); ((BaseAchievement)this).OnInstall(); } public override void OnUninstall() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown HealthComponent.TakeDamage -= new hook_TakeDamage(ExecuteMithrixCheck); ((BaseAchievement)this).OnUninstall(); } } [RegisterAchievement("FastHellUnlock", "FastHellUnlock", "FreeMage", 5u, null)] internal class FastHellUnlock : UnlockBase { private static readonly string[] requiredScenes = new string[2] { "dampcavesimple", "helminthroost" }; public static float timeInMinutes = 3f; private bool stageOk = false; private float stageEnterTime; public override string TOKEN_IDENTIFIER => "FastHellUnlock".ToUpperInvariant(); public override string AchievementName => "Artificer: God, It’s Pretty Hot Down Here"; public override string AchievementDesc => $"As Artificer, leave the Abyssal Depths or Helminth Hatchery within {timeInMinutes} minutes of entering."; public override void OnBodyRequirementMet() { ((BaseAchievement)this).OnBodyRequirementMet(); SceneCatalog.onMostRecentSceneDefChanged += HandleMostRecentSceneDefChanged; } public override void OnBodyRequirementBroken() { ((BaseAchievement)this).OnBodyRequirementBroken(); SceneCatalog.onMostRecentSceneDefChanged -= HandleMostRecentSceneDefChanged; stageOk = false; stageEnterTime = float.NegativeInfinity; } private void HandleMostRecentSceneDefChanged(SceneDef sceneDef) { if (stageOk && stageEnterTime > 0f) { if (Run.instance.GetRunStopwatch() <= stageEnterTime + (timeInMinutes * 60f + 5f)) { } ((BaseAchievement)this).Grant(); stageOk = false; stageEnterTime = float.NegativeInfinity; } else { stageOk = Array.IndexOf(requiredScenes, sceneDef.baseSceneName) != -1; if (stageOk) { stageEnterTime = Run.instance.GetRunStopwatch(); } stageOk = false; stageEnterTime = float.NegativeInfinity; } } } [RegisterAchievement("FreezeManySimultaneousUnlock", "FreezeManySimultaneousUnlock", "FreeMage", 5u, typeof(FreezeManySimultaneousServerAchievement))] internal class FreezeManySimultaneousUnlock : UnlockBase<FreezeManySimultaneousUnlock> { private class FreezeManySimultaneousServerAchievement : BaseServerAchievement { private Dictionary<SetStateOnHurt, float> avalancheUnlockTrackers; private CharacterBody trackedBody; public override void OnInstall() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown ((BaseServerAchievement)this).OnInstall(); avalancheUnlockTrackers = new Dictionary<SetStateOnHurt, float>(); RoR2Application.onFixedUpdate += SetTrackedBody; SetStateOnHurt.SetFrozenInternal += new hook_SetFrozenInternal(AddFreezeTracker); } private void AddFreezeTracker(orig_SetFrozenInternal orig, SetStateOnHurt self, float duration) { orig.Invoke(self, duration); CharacterBody val = default(CharacterBody); if (!((Component)self).TryGetComponent<CharacterBody>(ref val)) { return; } HealthComponent healthComponent = val.healthComponent; GameObject val2 = ((healthComponent != null) ? healthComponent.lastHitAttacker : null); CharacterBody val3 = default(CharacterBody); if (!Object.op_Implicit((Object)(object)val2) || !val2.TryGetComponent<CharacterBody>(ref val3) || (Object)(object)val3 != (Object)(object)trackedBody) { return; } int num = 1; bool flag = false; foreach (KeyValuePair<SetStateOnHurt, float> avalancheUnlockTracker in avalancheUnlockTrackers) { if (!((Object)(object)avalancheUnlockTracker.Key == (Object)null) && !(Time.time > avalancheUnlockTracker.Value)) { num++; if (num >= freezeRequirementTotal) { flag = true; break; } } } if (flag) { ((BaseServerAchievement)this).Grant(); ((BaseServerAchievement)this).ServerTryToCompleteActivity(); } else if (avalancheUnlockTrackers.ContainsKey(self)) { avalancheUnlockTrackers[self] = Time.time + duration; } else { avalancheUnlockTrackers.Add(self, Time.time + duration); } } private void SetTrackedBody() { trackedBody = ((BaseServerAchievement)this).GetCurrentBody(); } public override void OnUninstall() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown ((BaseServerAchievement)this).OnUninstall(); RoR2Application.onFixedUpdate -= SetTrackedBody; SetStateOnHurt.SetFrozenInternal += new hook_SetFrozenInternal(AddFreezeTracker); } } public static int freezeRequirementTotal = 5; public override string AchievementName => "Artificer: Ice V Has Arrived"; public override string AchievementDesc => $"As Artificer, have {freezeRequirementTotal} monsters frozen at once."; public override string TOKEN_IDENTIFIER => "FreezeManySimultaneousUnlock".ToUpperInvariant(); public override void TryToCompleteActivity() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown bool flag = ((BaseAchievement)this).localUser.id == LocalUserManager.GetFirstLocalUser().id; if (((BaseAchievement)this).shouldGrant && flag) { BaseActivitySelector val = new BaseActivitySelector(); val.activityAchievementID = "FreezeManySimultaneousUnlock"; PlatformSystems.activityManager.TryToCompleteActivity(val, true, true); } } public override void OnBodyRequirementMet() { ((BaseAchievement)this).OnBodyRequirementMet(); ((BaseAchievement)this).SetServerTracked(true); } public override void OnBodyRequirementBroken() { ((BaseAchievement)this).OnBodyRequirementBroken(); ((BaseAchievement)this).SetServerTracked(false); } public override void OnInstall() { ((BaseAchievement)this).OnInstall(); } public override void OnUninstall() { ((BaseAchievement)this).OnUninstall(); } } [RegisterAchievement("FullKitElementUnlock", "FullKitElementUnlock", "FreeMage", 5u, null)] internal class FullKitElementUnlock : UnlockBase { public override string TOKEN_IDENTIFIER => "FullKitElementUnlock".ToUpperInvariant(); public override string AchievementName => "Artificer: Elemental Intensity"; public override string AchievementDesc => "As Artificer, win with 4 abilities of a single element equipped at once."; public override void OnInstall() { Run.onClientGameOverGlobal += ClearCheck; ((BaseAchievement)this).OnInstall(); } private void ClearCheck(Run run, RunReport runReport) { //IL_004e: 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) if (run == null || runReport == null || !Object.op_Implicit((Object)(object)runReport.gameEnding) || !runReport.gameEnding.isWin) { return; } CharacterBody cachedBody = ((BaseAchievement)this).localUser.cachedBody; if (cachedBody.bodyIndex == ((BaseAchievement)this).requiredBodyIndex) { ElementCounter component = ((Component)cachedBody).GetComponent<ElementCounter>(); if ((Object)(object)component != (Object)null && (component.firePower >= ElementCounter.Power.Extreme || component.icePower >= ElementCounter.Power.Extreme || component.lightningPower >= ElementCounter.Power.Extreme)) { ((BaseAchievement)this).Grant(); } } } public override void OnUninstall() { Run.onClientGameOverGlobal -= ClearCheck; ((BaseAchievement)this).OnUninstall(); } private void PowerCheck(orig_OnEnter orig, MageCharacterMain self) { orig.Invoke(self); CharacterBody characterBody = ((EntityState)self).characterBody; ElementCounter elementCounter = ((characterBody != null) ? ((Component)characterBody).GetComponent<ElementCounter>() : null); if ((Object)(object)elementCounter != (Object)null && (elementCounter.firePower >= ElementCounter.Power.Extreme || elementCounter.icePower >= ElementCounter.Power.Extreme || elementCounter.lightningPower >= ElementCounter.Power.Extreme)) { ((BaseAchievement)this).Grant(); } } } [RegisterAchievement("KillBlazingWithFireUnlock", "KillBlazingWithFireUnlock", "FreeMage", 5u, null)] internal class KillBlazingWithFireUnlock : UnlockBase { public static int burnRequirementTotal = 15; public int burnCounter = 0; public override string TOKEN_IDENTIFIER => "KillBlazingWithFireUnlock".ToUpperInvariant(); public override string AchievementName => "Artificer: Sinners For Dinner"; public override string AchievementDesc => $"As Artificer, kill {burnRequirementTotal} Blazing Elites with burn damage in a single run."; public override void OnInstall() { GlobalEventManager.onCharacterDeathGlobal += AddBurnCounter; Run.onRunStartGlobal += ResetBurnCounter; ((BaseAchievement)this).OnInstall(); } public override void OnUninstall() { GlobalEventManager.onCharacterDeathGlobal -= AddBurnCounter; Run.onRunStartGlobal -= ResetBurnCounter; ((BaseAchievement)this).OnUninstall(); } private void ResetBurnCounter(Run obj) { burnCounter = 0; } private void AddBurnCounter(DamageReport obj) { //IL_0029: 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_005b: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Invalid comparison between Unknown and I4 //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Invalid comparison between Unknown and I4 CharacterBody attackerBody = obj.attackerBody; CharacterBody victimBody = obj.victimBody; if (!Object.op_Implicit((Object)(object)attackerBody) || !Object.op_Implicit((Object)(object)victimBody) || attackerBody.bodyIndex != ((BaseAchievement)this).LookUpRequiredBodyIndex() || !victimBody.HasBuff(Buffs.AffixRed)) { return; } DamageInfo damageInfo = obj.damageInfo; bool flag = ((Enum)damageInfo.damageType.damageType).HasFlag((Enum)(object)(DamageType)128) || ((Enum)damageInfo.damageType.damageType).HasFlag((Enum)(object)(DamageType)8192); bool flag2 = (int)damageInfo.dotIndex == 1 || (int)damageInfo.dotIndex == 3 || (int)damageInfo.dotIndex == 7; if (flag || flag2) { burnCounter++; if (burnCounter >= burnRequirementTotal) { ((BaseAchievement)this).Grant(); } } } } [RegisterAchievement("MeteoriteDeathUnlock", "MeteoriteDeathUnlock", "FreeMage", 5u, null)] internal class MeteoriteDeathUnlock : UnlockBase { private GameObject meteorGameObject = LegacyResourcesAPI.Load<GameObject>("Prefabs/NetworkedObjects/MeteorStorm"); public override string TOKEN_IDENTIFIER => "MeteoriteDeathUnlock".ToUpperInvariant(); public override string AchievementName => "Artificer: Cloudy, With A Risk Of..."; public override string AchievementDesc => "As Artificer, kill yourself with a meteor strike."; public override void OnInstall() { GlobalEventManager.onCharacterDeathGlobal += MeteorCheck; ((BaseAchievement)this).OnInstall(); } public override void OnUninstall() { GlobalEventManager.onCharacterDeathGlobal -= MeteorCheck; ((BaseAchievement)this).OnUninstall(); } private void MeteorCheck(DamageReport obj) { //IL_0019: 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_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) CharacterBody attackerBody = obj.attackerBody; CharacterBody victimBody = obj.victimBody; if ((Object)(object)attackerBody == (Object)(object)victimBody && attackerBody.bodyIndex == ((BaseAchievement)this).LookUpRequiredBodyIndex()) { GameObject inflictor = obj.damageInfo.inflictor; MeteorStormController component = inflictor.GetComponent<MeteorStormController>(); if ((Object)(object)component != (Object)null && attackerBody.equipmentSlot.equipmentIndex == Equipment.Meteor.equipmentIndex) { ((BaseAchievement)this).Grant(); } } } } [RegisterAchievement("NoDamageUnlock", "NoDamageUnlock", "FreeMage", 5u, null)] internal class NoDamageUnlock : UnlockBase { public static float maxHealthFraction = 0.8f; private HealthComponent healthComponent; private bool failed; private bool characterOk; private ToggleAction healthCheck; private ToggleAction teleporterCheck; public override string TOKEN_IDENTIFIER => "NoDamageUnlock".ToUpperInvariant(); public override string AchievementName => "Artificer: Flawless Execution"; public override string AchievementDesc => "As Artificer, start and finish any stage without falling below " + Tools.ConvertDecimal(maxHealthFraction) + " health."; private void SubscribeHealthCheck() { RoR2Application.onFixedUpdate += CheckHealth; } private void UnsubscribeHealthCheck() { RoR2Application.onFixedUpdate -= CheckHealth; } private void SubscribeTeleporterCheck() { TeleporterInteraction.onTeleporterChargedGlobal += CheckTeleporter; } private void UnsubscribeTeleporterCheck() { TeleporterInteraction.onTeleporterChargedGlobal -= CheckTeleporter; } private void CheckTeleporter(TeleporterInteraction teleporterInteraction) { if (characterOk && !failed) { ((BaseAchievement)this).Grant(); } } public override void OnInstall() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Expected O, but got Unknown ((BaseAchievement)this).OnInstall(); healthCheck = new ToggleAction((Action)SubscribeHealthCheck, (Action)UnsubscribeHealthCheck); teleporterCheck = new ToggleAction((Action)SubscribeTeleporterCheck, (Action)UnsubscribeTeleporterCheck); SceneCatalog.onMostRecentSceneDefChanged += OnMostRecentSceneDefChanged; ((BaseAchievement)this).localUser.onBodyChanged += OnBodyChanged; } public override void OnUninstall() { ((BaseAchievement)this).localUser.onBodyChanged -= OnBodyChanged; SceneCatalog.onMostRecentSceneDefChanged -= OnMostRecentSceneDefChanged; healthCheck.Dispose(); teleporterCheck.Dispose(); ((BaseAchievement)this).OnUninstall(); } private void OnBodyChanged() { if (characterOk && !failed && Object.op_Implicit((Object)(object)((BaseAchievement)this).localUser.cachedBody)) { healthComponent = ((BaseAchievement)this).localUser.cachedBody.healthComponent; healthCheck.SetActive(true); teleporterCheck.SetActive(true); } } private void OnMostRecentSceneDefChanged(SceneDef sceneDef) { failed = false; } public override void OnBodyRequirementMet() { ((BaseAchievement)this).OnBodyRequirementMet(); characterOk = true; } public override void OnBodyRequirementBroken() { characterOk = false; Fail(); ((BaseAchievement)this).OnBodyRequirementBroken(); } private void Fail() { failed = true; healthCheck.SetActive(false); teleporterCheck.SetActive(false); } private void CheckHealth() { if (Object.op_Implicit((Object)(object)healthComponent) && healthComponent.combinedHealth < healthComponent.fullCombinedHealth * maxHealthFraction) { Fail(); } } } [RegisterAchievement("OverkillOverloadingUnlock", "OverkillOverloadingUnlock", "FreeMage", 5u, null)] internal class OverkillOverloadingUnlock : UnlockBase { private static float overkillAmount = 1f; public override string TOKEN_IDENTIFIER => "OverkillOverloadingUnlock".ToUpperInvariant(); public override string AchievementName => "Artificer: Powertrippin’"; public override string AchievementDesc => $"As Artificer, overkill an Overloading Elite enemy by more than {overkillAmount * 100f}% of its total maximum health."; public override void OnInstall() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown HealthComponent.TakeDamage += new hook_TakeDamage(OverkillCheck); ((BaseAchievement)this).OnInstall(); } public override void OnUninstall() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown HealthComponent.TakeDamage -= new hook_TakeDamage(OverkillCheck); ((BaseAchievement)this).OnUninstall(); } private void OverkillCheck(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo) { //IL_006d: 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) CharacterBody body = self.body; bool flag = body.HasBuff(Buffs.AffixBlue); float combinedHealth = self.combinedHealth; float fullHealth = self.fullHealth; orig.Invoke(self, damageInfo); if (!(!self.alive && flag)) { return; } CharacterBody val = null; if ((Object)(object)damageInfo.attacker != (Object)null) { val = damageInfo.attacker.GetComponent<CharacterBody>(); } if ((Object)(object)val != (Object)null && val.bodyIndex == ((BaseAchievement)this).LookUpRequiredBodyIndex()) { float num = damageInfo.damage - combinedHealth; if (num > fullHealth * overkillAmount) { ((BaseAchievement)this).Grant(); } } } } [RegisterAchievement("StackBurnUnlock", "StackBurnUnlock", "FreeMage", 5u, null)] internal class StackBurnUnlock : UnlockBase { public static int burnRequirementTotal = 25; public override string TOKEN_IDENTIFIER => "StackBurnUnlock".ToUpperInvariant(); public override string AchievementName => "Artificer: The Ultimate Stonecutter"; public override string AchievementDesc => $"As Artificer, apply {burnRequirementTotal} stacks of burn to a single target."; public override void OnInstall() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown GlobalEventManager.OnHitEnemy += new hook_OnHitEnemy(CountBurn); ((BaseAchievement)this).OnInstall(); } public override void OnUninstall() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown GlobalEventManager.OnHitEnemy -= new hook_OnHitEnemy(CountBurn); ((BaseAchievement)this).OnUninstall(); } private void CountBurn(orig_OnHitEnemy orig, GlobalEventManager self, DamageInfo damageInfo, GameObject victim) { //IL_0078: 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) if (damageInfo.procCoefficient == 0f || damageInfo.rejected || !NetworkServer.active) { return; } CharacterBody component = victim.GetComponent<CharacterBody>(); CharacterBody val = null; if ((Object)(object)damageInfo.attacker != (Object)null) { val = damageInfo.attacker.GetComponent<CharacterBody>(); } if ((Object)(object)component != (Object)null && (Object)(object)val != (Object)null && val.bodyIndex == ((BaseAchievement)this).LookUpRequiredBodyIndex()) { int num = component.GetBuffCount(Buffs.OnFire) + component.GetBuffCount(Buffs.StrongerBurn) + 1; if (num >= burnRequirementTotal) { ((BaseAchievement)this).Grant(); } } orig.Invoke(self, damageInfo, victim); } } [RegisterAchievement("TankDamageUnlock", "TankDamageUnlock", "FreeMage", 5u, null)] internal class TankDamageUnlock : UnlockBase { public static int damageRequirementTotal = 5000; private float damageTakenCount = 0f; public ulong killRequirementTotal = 5uL; public StatDef postmortemKillCounter = UnlockBase.GetCareerStatTotal("artificerKillsPostMortem"); public override string TOKEN_IDENTIFIER => "TankDamageUnlock".ToUpperInvariant(); public override string AchievementName => "Artificer: Cold Hearted"; public override string AchievementDesc => $"As Artificer, take more than {damageRequirementTotal} points of damage in a single life."; private void ResetDamageCount() { damageTakenCount = 0f; } public override void OnBodyRequirementMet() { ((BaseAchievement)this).OnBodyRequirementMet(); GlobalEventManager.onServerDamageDealt += DamageCounter; Run.onClientGameOverGlobal += ClearCheck; } private void ClearCheck(Run run, RunReport runReport) { ResetDamageCount(); } public override void OnBodyRequirementBroken() { ((BaseAchievement)this).OnBodyRequirementBroken(); GlobalEventManager.onServerDamageDealt -= DamageCounter; } private void DamageCounter(DamageReport damageReport) { if (!((Object)(object)damageReport.victimBody == (Object)(object)((BaseAchievement)this).localUser.cachedBody)) { return; } if (!damageReport.victimBody.healthComponent.alive) { ResetDamageCount(); return; } damageTakenCount += damageReport.damageDealt; if (damageTakenCount > (float)damageRequirementTotal) { ((BaseAchievement)this).Grant(); } } private void ColdFusionKillCounter(DamageReport damageReport) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: 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_004e: 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_0059: Invalid comparison between Unknown and I4 BodyIndex attackerBodyIndex = damageReport.attackerBodyIndex; CharacterMaster attackerMaster = damageReport.attackerMaster; string? text = ((object)(BodyIndex)(ref attackerBodyIndex)).ToString(); BodyIndex val = ((BaseAchievement)this).LookUpRequiredBodyIndex(); Debug.Log((object)(text + " + " + ((object)(BodyIndex)(ref val)).ToString())); if (!Object.op_Implicit((Object)(object)attackerMaster) || (attackerBodyIndex != ((BaseAchievement)this).LookUpRequiredBodyIndex() && (int)attackerBodyIndex != -1)) { return; } CharacterBody attackerBody = damageReport.attackerBody; if ((Object)(object)attackerBody == (Object)null || !attackerBody.healthComponent.alive) { StatSheet currentStats = attackerMaster.playerStatsComponent.currentStats; currentStats.PushStatValue(postmortemKillCounter, 1uL); ulong statValueULong = ((BaseAchievement)this).userProfile.statSheet.GetStatValueULong(postmortemKillCounter); Debug.Log((object)statValueULong); if (statValueULong >= killRequirementTotal) { ((BaseAchievement)this).Grant(); } } } } [RegisterAchievement("UgornsMusicUnlock", "UgornsMusicUnlock", "FreeMage", 5u, null)] internal class UgornsMusicUnlock : UnlockBase { private Inventory currentInventory; public override string TOKEN_IDENTIFIER => "UgornsMusicUnlock".ToUpperInvariant(); public override string AchievementName => "Artificer: Ugorn’s Music"; public override string AchievementDesc => "As Artificer, (with at least one Lightning ability equipped) obtain a Charged Perforator and Royal Capacitor, OR become an aspect of lightning."; public override void OnInstall() { ((BaseAchievement)this).OnInstall(); } public override void OnUninstall() { SetCurrentInventory(null); ((BaseAchievement)this).OnUninstall(); } private void UpdateInventory() { Inventory val = null; if (Object.op_Implicit((Object)(object)((BaseAchievement)this).localUser.cachedMasterController)) { val = ((BaseAchievement)this).localUser.cachedMasterController.master.inventory; } SetCurrentInventory(val); } private void SetCurrentInventory(Inventory newInventory) { if (!((Object)(object)currentInventory == (Object)(object)newInventory)) { if ((Object)(object)currentInventory != (Object)null) { currentInventory.onInventoryChanged -= OnInventoryChanged; } currentInventory = newInventory; if ((Object)(object)currentInventory != (Object)null) { currentInventory.onInventoryChanged += OnInventoryChanged; OnInventoryChanged(); } } } public override void OnBodyRequirementMet() { ((BaseAchievement)this).OnBodyRequirementMet(); ((BaseAchievement)this).localUser.onMasterChanged += UpdateInventory; UpdateInventory(); } public override void OnBodyRequirementBroken() { ((BaseAchievement)this).localUser.onMasterChanged -= UpdateInventory; SetCurrentInventory(null); ((BaseAchievement)this).OnBodyRequirementBroken(); } private void OnInventoryChanged() { //IL_005b: 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_0082: 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) GameObject cachedBodyObject = ((BaseAchievement)this).localUser.cachedBodyObject; if (!((Object)(object)((Component)currentInventory).gameObject == (Object)(object)cachedBodyObject) || !((BaseAchievement)this).meetsBodyRequirement) { return; } ElementCounter component = cachedBodyObject.GetComponent<ElementCounter>(); if ((Object)(object)component != (Object)null && component.lightningPower >= ElementCounter.Power.Low) { if (currentInventory.currentEquipmentIndex == Equipment.AffixBlue.equipmentIndex) { ((BaseAchievement)this).Grant(); } else if (currentInventory.currentEquipmentIndex == Equipment.Lightning.equipmentIndex && currentInventory.GetItemCount(Items.LightningStrikeOnHit) > 0) { ((BaseAchievement)this).Grant(); } } } private void ImpBossSmiteCheck(DamageReport obj) { //IL_0036: 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_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0062: 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_007e: 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_008d: 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) CharacterBody attackerBody = obj.attackerBody; CharacterBody victimBody = obj.victimBody; DamageInfo damageInfo = obj.damageInfo; if (Object.op_Implicit((Object)(object)attackerBody) && Object.op_Implicit((Object)(object)victimBody) && damageInfo != null) { bool flag = victimBody.bodyIndex == BodyCatalog.FindBodyIndex("ImpBossBody"); if (attackerBody.bodyIndex == ((BaseAchievement)this).LookUpRequiredBodyIndex() && flag && (damageInfo.force == Vector3.down * 1500f || (damageInfo.force == Vector3.down * 3000f && ((Enum)damageInfo.damageType.damageType).HasFlag((Enum)(object)(DamageType)32))) && (Object)(object)damageInfo.inflictor == (Object)null) { ((BaseAchievement)this).Grant(); } } } } public abstract class UnlockBase<T> : UnlockBase where T : UnlockBase<T> { public static T instance { get; private set; } public UnlockBase() { if (instance != null) { throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting UnlockBase was instantiated twice"); } instance = this as T; } } public abstract class UnlockBase : BaseAchievement { public abstract string TOKEN_IDENTIFIER { get; } public abstract string AchievementName { get; } public abstract string AchievementDesc { get; } public static UnlockableDef CreateUnlockDef(Type RequiredUnlock, Sprite icon) { string name = RequiredUnlock.Name; string text = name.ToUpperInvariant(); UnlockableDef val = Content.CreateAndAddUnlockbleDef(name, name, icon); string nameToken = "ACHIEVEMENT_" + text + "_NAME"; string descToken = "ACHIEVEMENT_" + text + "_DESCRIPTION"; LanguageAPI.Add(nameToken, Reflection.GetPropertyValue<string>(RequiredUnlock, "AchievementName")); LanguageAPI.Add(descToken, Reflection.GetPropertyValue<string>(RequiredUnlock, "AchievementDesc")); val.getHowToUnlockString = () => Language.GetStringFormatted("UNLOCK_VIA_ACHIEVEMENT_FORMAT", new object[2] { Language.GetString(nameToken), Language.GetString(descToken) }); val.getUnlockedString = () => Language.GetStringFormatted("UNLOCKED_FORMAT", new object[2] { Language.GetString(nameToken), Language.GetString(descToken) }); return val; } public void AddLang() { LanguageAPI.Add("ACHIEVEMENT_" + TOKEN_IDENTIFIER + "_NAME", AchievementName); LanguageAPI.Add("ACHIEVEMENT_" + TOKEN_IDENTIFIER + "_DESCRIPTION", AchievementDesc); } public override BodyIndex LookUpRequiredBodyIndex() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return BodyCatalog.FindBodyIndex("MageBody"); } public static StatDef GetCareerStatTotal(string name) { StatDef val = StatDef.Find(name); if (val == null) { val = StatDef.Register(name, (StatRecordType)0, (StatDataType)0, 0.0, (DisplayValueFormatterDelegate)null); } return val; } } [RegisterAchievement("WoolieRushUnlock", "WoolieRushUnlock", "FreeMage", 5u, null)] internal class WoolieRushUnlock : UnlockBase { public static float timeRequirement = 600f; public override string TOKEN_IDENTIFIER => "TankDamageUnlock".ToUpperInvariant(); public override string AchievementName => "Artificer: Lightning-Fast"; public override string AchievementDesc => $"As Artificer, fully charge the third teleporter before the timer reaches {timeRequirement / 60f} minutes."; public override void OnInstall() { ((BaseAchievement)this).OnInstall(); } public override void OnUninstall() { ((BaseAchievement)this).OnUninstall(); } private void OnTeleporterChargedGlobal(TeleporterInteraction teleporterInteraction) { if (Run.instance.GetRunStopwatch() < timeRequirement && Run.instance.stageClearCount == 2 && ((BaseAchievement)this).isUserAlive) { ((BaseAchievement)this).Grant(); } } public override void OnBodyRequirementMet() { TeleporterInteraction.onTeleporterChargedGlobal += OnTeleporterChargedGlobal; ((BaseAchievement)this).OnBodyRequirementMet(); } public override void OnBodyRequirementBroken() { TeleporterInteraction.onTeleporterChargedGlobal -= OnTeleporterChargedGlobal; ((BaseAchievement)this).OnBodyRequirementBroken(); } } } namespace ArtificerExtended.States { internal class ChargeFireBlast : BaseSkillState { public GameObject projectilePrefabOuter = _2FireSkill2Skill.outerFireball; public GameObject projectilePrefabInner = _2FireSkill2Skill.innerFireball; public GameObject muzzleflashEffectPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/effects/MuzzleflashMageFireLarge"); public GameObject chargeEffectPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/effects/ChargeMageFireBomb"); public string chargeSoundString = "Play_mage_m2_charge"; public float baseChargeDuration = 1f; public float baseWinddownDuration = 0.2f; public static float minRadius = 0f; public static float maxRadius = 0.5f; public static float minDamageCoefficient = 1.2f; public static float maxDamageCoefficient = ArtificerExtendedPlugin.artiBoltDamage * 1.25f; public static float procCoefficient = 1f; public float force = 0f; public float selfForce = 150f; public static float recoilAmplitude = 4f; public static GameObject crosshairOverridePrefab; private const float baseMinChargeDuration = 0.15f; private float stopwatch; private float timer; private float frequency = 0.25f; private float windDownDuration; private float chargeDuration; private float minChargeDuration; private bool hasFiredBomb; private string muzzleString; private GameObject defaultCrosshairPrefab; private uint soundID; private AltArtiPassive.BatchHandle handle; public override void OnEnter() { ((BaseState)this).OnEnter(); handle = new AltArtiPassive.BatchHandle(); windDownDuration = baseWinddownDuration / ((BaseState)this).attackSpeedStat; chargeDuration = baseChargeDuration / ((BaseState)this).attackSpeedStat; minChargeDuration = 0.15f / ((BaseState)this).attackSpeedStat; soundID = Util.PlayAttackSpeedSound(chargeSoundString, ((EntityState)this).gameObject, ((BaseState)this).attackSpeedStat); ((EntityState)this).characterBody.SetAimTimer(chargeDuration + windDownDuration + 2f); muzzleString = "MuzzleBetween"; ((EntityState)this).PlayAnimation("Gesture, Additive", "PrepFlamethrower", "Flamethrower.playbackRate", chargeDuration, 0f); defaultCrosshairPrefab = ((EntityState)this).characterBody._defaultCrosshairPrefab; if (Object.op_Implicit((Object)(object)ChargeMeteors.crosshairOverridePrefab)) { ((EntityState)this).characterBody._defaultCrosshairPrefab = ChargeMeteors.crosshairOverridePrefab; } if (VRStuff.VRInstalled) { VRStuff.AnimateVRHand(dominant: true, "Charge"); } } public override void Update() { ((EntityState)this).Update(); ((EntityState)this).characterBody.SetSpreadBloom(Util.Remap(GetChargeProgressSmooth(), 0f, 1f, minRadius, maxRadius), true); } private float GetChargeProgressSmooth() { return Mathf.Clamp01(stopwatch / chargeDuration); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); stopwatch += Time.fixedDeltaTime; timer += Time.fixedDeltaTime * ((EntityState)this).characterBody.attackSpeed; GameObject gameObject = ((Component)((EntityState)this).outer).gameObject; if (AltArtiPassive.instanceLookup.TryGetValue(gameObject, out var value)) { while (timer > frequency) { timer -= frequency; value.SkillCast(handle, isFire: true); } } if (!hasFiredBomb && (stopwatch >= chargeDuration || !((BaseSkillState)this).IsKeyDownAuthority()) && !hasFiredBomb && stopwatch >= minChargeDuration) { FireFireBlast(); } if (stopwatch >= windDownDuration && hasFiredBomb && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public void FireFireBlast() { //IL_0076: 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_007b: 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_00e3: 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_0118: Unknown result type (might be due to invalid IL or missing references) hasFiredBomb = true; float num = 1f * recoilAmplitude; ((BaseState)this).AddRecoil(0f - num, -2f * num, 0f - num, num); if (Object.op_Implicit((Object)(object)muzzleflashEffectPrefab)) { EffectManager.SimpleMuzzleFlash(muzzleflashEffectPrefab, ((EntityState)this).gameObject, muzzleString, false); } if (((EntityState)this).isAuthority) { float chargeProgressSmooth = GetChargeProgressSmooth(); Ray aimRay = ((!VRStuff.VRInstalled) ? ((BaseState)this).GetAimRay() : VRStuff.GetVRHandAimRay(dominant: true)); if ((Object)(object)projectilePrefabOuter != (Object)null && (Object)(object)projectilePrefabInner != (Object)null) { float damage = Util.Remap(chargeProgressSmooth, 0f, 1f, minDamageCoefficient, maxDamageCoefficient); bool isCrit = Util.CheckRoll(((BaseState)this).critStat, ((EntityState)this).characterBody.master); FireOuterFireballs(aimRay, damage, isCrit); FireInnerFireball(aimRay, damage, isCrit); } if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.ApplyForce(((Ray)(ref aimRay)).direction * ((0f - selfForce) * chargeProgressSmooth), false, false); } } ((EntityState)this).characterBody._defaultCrosshairPrefab = defaultCrosshairPrefab; stopwatch = 0f; timer = 0f; handle.Fire(0f, 0.5f); } private void FireOuterFireballs(Ray aimRay, float damage, bool isCrit) { //IL_000e: 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_0025: 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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: 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_007e: 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_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_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_00b6: 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_00f4: 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) GameObject outerFireball = _2FireSkill2Skill.outerFireball; ProjectileManager.instance.FireProjectile(new FireProjectileInfo { projectilePrefab = outerFireball, position = ((Ray)(ref aimRay)).origin, rotation = Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), owner = ((EntityState)this).gameObject, damage = ((BaseState)this).damageStat * damage, force = force, crit = isCrit, damageColorIndex = (DamageColorIndex)0, target = null }); ProjectileManager.instance.FireProjectile(new FireProjectileInfo { projectilePrefab = outerFireball, position = ((Ray)(ref aimRay)).origin, rotation = Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction, Vector3.down), owner = ((EntityState)this).gameObject, damage = ((BaseState)this).damageStat * damage, force = force, crit = isCrit, damageColorIndex = (DamageColorIndex)0, target = null }); } private void FireInnerFireball(Ray aimRay, float damage, bool isCrit) { //IL_000e: 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_0025: 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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: 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_007e: Unknown result type (might be due to invalid IL or missing references) GameObject innerFireball = _2FireSkill2Skill.innerFireball; ProjectileManager.instance.FireProjectile(new FireProjectileInfo { projectilePrefab = innerFireball, position = ((Ray)(ref aimRay)).origin, rotation = Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), owner = ((EntityState)this).gameObject, damage = ((BaseState)this).damageStat * damage, force = force, crit = isCrit, damageColorIndex = (DamageColorIndex)0, target = null }); } public override void OnExit() { ((EntityState)this).PlayAnimation("Gesture, Additive", "FireWall"); AkSoundEngine.StopPlayingID(soundID); ((EntityState)this).characterBody._defaultCrosshairPrefab = defaultCrosshairPrefab; if (VRStuff.VRInstalled) { VRStuff.AnimateVRHand(dominant: true, "Cast"); } ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)3; } } internal class FireIceShard : BaseSkillState, IStepSetter { public enum Gauntlet { Left, Right } public static GameObject effectPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/effects/MuzzleflashMageLightningLarge"); public static GameObject hitEffectPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/effects/
ModularEclipse.dll
Decompiled 2 weeks agousing System; using System.Collections.ObjectModel; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using On.RoR2; using RoR2; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = "")] [assembly: AssemblyCompany("ModularEclipse")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("ModularEclipse")] [assembly: AssemblyTitle("ModularEclipse")] [assembly: AssemblyVersion("1.0.0.0")] namespace ModularEclipse; [BepInPlugin("com.HouseOfFruits.ModularEclipse", "ModularEclipse", "1.0.0")] public class ModularEclipsePlugin : BaseUnityPlugin { public const string guid = "com.HouseOfFruits.ModularEclipse"; public const string teamName = "HouseOfFruits"; public const string modName = "ModularEclipse"; public const string version = "1.0.0"; public static PluginInfo PInfo { get; private set; } internal static ConfigFile ArtifactWhitelistConfig { get; set; } public static void SetArtifactDefaultWhitelist(ArtifactDef artifactDef, bool defaultValue) { string cachedName = artifactDef.cachedName; if (cachedName == "") { Debug.LogError((object)("Artifact " + artifactDef.nameToken + " has no cached name! The Eclipse rule choice selection will not work for it.")); } else { ArtifactWhitelistConfig.Bind<bool>("Eclipse: Whitelisted Artifacts", cachedName, defaultValue, "If true, this artifact will be *allowed* for use in the Eclipse gamemode. Recommended only difficulty artifacts should be enabled."); } } private void Awake() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown ArtifactWhitelistConfig = new ConfigFile(Paths.ConfigPath + "\\ModularEclipse.cfg", true); EclipseRun.OverrideRuleChoices += new hook_OverrideRuleChoices(EclipseRuleChoices); } private void EclipseRuleChoices(orig_OverrideRuleChoices orig, EclipseRun self, RuleChoiceMask mustInclude, RuleChoiceMask mustExclude, ulong runSeed) { //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_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_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) int num = 0; ReadOnlyCollection<NetworkUser> readOnlyInstancesList = NetworkUser.readOnlyInstancesList; for (int i = 0; i < readOnlyInstancesList.Count; i++) { NetworkUser val = readOnlyInstancesList[i]; SurvivorDef survivorPreference = val.GetSurvivorPreference(); if (Object.op_Implicit((Object)(object)survivorPreference)) { int num2 = EclipseRun.GetNetworkUserSurvivorCompletedEclipseLevel(val, survivorPreference) + 1; num = ((num > 0) ? Math.Min(num, num2) : num2); } } num = Math.Min(num, EclipseRun.maxEclipseLevel); DifficultyIndex eclipseDifficultyIndex = EclipseRun.GetEclipseDifficultyIndex(num); RuleDef val2 = RuleCatalog.FindRuleDef("Difficulty"); foreach (RuleChoiceDef choice in val2.choices) { if (choice.excludeByDefault && choice.difficultyIndex <= eclipseDifficultyIndex) { if (choice.difficultyIndex == eclipseDifficultyIndex) { val2.defaultChoiceIndex = choice.localIndex; } ((SerializableBitArray)mustInclude)[choice.globalIndex] = true; ((SerializableBitArray)mustExclude)[choice.globalIndex] = false; } else { ((SerializableBitArray)mustInclude)[choice.globalIndex] = false; ((SerializableBitArray)mustExclude)[choice.globalIndex] = true; } } ((Run)self).ForceChoice(mustInclude, mustExclude, "Items." + ((Object)Items.LunarTrinket).name + ".Off"); for (int j = 0; j < ArtifactCatalog.artifactCount; j++) { ArtifactDef artifactDef = ArtifactCatalog.GetArtifactDef((ArtifactIndex)j); string cachedName = artifactDef.cachedName; if (cachedName == "") { Debug.LogError((object)("Artifact " + artifactDef.nameToken + " has no cached name! The Eclipse rule choice selection will not work for it.")); continue; } Debug.LogWarning((object)cachedName); if (!ArtifactWhitelistConfig.Bind<bool>("Eclipse: Whitelisted Artifacts", cachedName, false, "If true, this artifact will be *allowed* for use in the Eclipse gamemode. Recommended only difficulty artifacts should be enabled.").Value) { RuleDef val3 = RuleCatalog.FindRuleDef("Artifacts." + cachedName); ((Run)self).ForceChoice(mustInclude, mustExclude, val3.FindChoice("Off")); } } } }
RainrotSharedUtils.dll
Decompiled 2 weeks agousing System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using On.RoR2; using R2API; using R2API.Utils; using RainrotSharedUtils.Components; using RoR2; using RoR2.Projectile; using UnityEngine; using UnityEngine.Networking; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")] [assembly: AssemblyCompany("RainrotSharedUtils")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("RainrotSharedUtils")] [assembly: AssemblyTitle("RainrotSharedUtils")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: UnverifiableCode] namespace RainrotSharedUtils { public static class Hooks { public static void DoHooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown IcicleAuraController.Awake += new hook_Awake(AuraControllerFix); BuffWard.BuffTeam += new hook_BuffTeam(ApplyDotWard); } private static void AuraControllerFix(orig_Awake orig, IcicleAuraController self) { orig.Invoke(self); if (Object.op_Implicit((Object)(object)self.buffWard) && self.buffWard is DotWard dotWard) { dotWard.ownerObject = self.cachedOwnerInfo.gameObject; dotWard.ownerBody = self.cachedOwnerInfo.characterBody; } } private static void ApplyDotWard(orig_BuffTeam orig, BuffWard self, IEnumerable<TeamComponent> recipients, float radiusSqr, Vector3 currentPosition) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Invalid comparison between Unknown and I4 //IL_0084: 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: Unknown result type (might be due to invalid IL or missing references) //IL_0090: 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_0099: Invalid comparison between Unknown and I4 //IL_010c: 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_0155: 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_0169: Unknown result type (might be due to invalid IL or missing references) if (!(self is DotWard dotWard)) { orig.Invoke(self, recipients, radiusSqr, currentPosition); } else { if (!NetworkServer.active || (int)dotWard.dotIndex == -1) { return; } GameObject ownerObject = dotWard.ownerObject; CharacterBody ownerBody = dotWard.ownerBody; Inventory ownerInventory = dotWard.ownerInventory; foreach (TeamComponent recipient in recipients) { Vector3 val = ((Component)recipient).transform.position - currentPosition; if ((int)self.shape == 1) { val.y = 0f; } if (!(((Vector3)(ref val)).sqrMagnitude <= radiusSqr)) { continue; } CharacterBody component = ((Component)recipient).GetComponent<CharacterBody>(); if (Object.op_Implicit((Object)(object)component) && (!self.requireGrounded || !Object.op_Implicit((Object)(object)component.characterMotor) || component.characterMotor.isGrounded)) { InflictDotInfo val2 = default(InflictDotInfo); val2.attackerObject = ownerObject; val2.victimObject = ((Component)component).gameObject; val2.totalDamage = dotWard.damageCoefficient * ownerBody.damage; val2.damageMultiplier = 1f; val2.dotIndex = dotWard.dotIndex; val2.maxStacksFromAttacker = null; InflictDotInfo val3 = val2; if ((Object)(object)ownerInventory != (Object)null) { StrengthenBurnUtils.CheckDotForUpgrade(ownerInventory, ref val3); } DotController.InflictDot(ref val3); } } } } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.RiskOfBrainrot.RainrotSharedUtils", "RainrotSharedUtils", "1.0.2")] [R2APISubmoduleDependency(new string[] { "LanguageAPI" })] public class SharedUtilsPlugin : BaseUnityPlugin { public const string guid = "com.RiskOfBrainrot.RainrotSharedUtils"; public const string teamName = "RiskOfBrainrot"; public const string modName = "RainrotSharedUtils"; public const string version = "1.0.2"; public const string executeKeywordToken = "2R4R_EXECUTION_KEYWORD"; public const string noAttackSpeedKeywordToken = "2R4R_NOATTACKSPEED_KEYWORD"; public const float survivorExecuteThreshold = 0.15f; public static PluginInfo PInfo { get; private set; } public void Awake() { Hooks.DoHooks(); LanguageAPI.Add("2R4R_EXECUTION_KEYWORD", "<style=cKeywordName>Finisher</style><style=cSub>Enemies targeted by this skill can be <style=cIsHealth>instantly killed</style> if below " + $"<style=cIsHealth>{15.000001f}% health</style>.</style>"); LanguageAPI.Add("2R4R_NOATTACKSPEED_KEYWORD", "<style=cKeywordName>Exacting</style><style=cSub>This skill <style=cIsHealth>does not gain attack speed bonuses</style>. Instead, attack speed <style=cIsDamage>increases total damage</style>.</style>"); } } } namespace RainrotSharedUtils.Components { public class DotWard : BuffWard { public DotIndex dotIndex = (DotIndex)(-1); public float damageCoefficient = 1f; private ProjectileController _projectileController; private GameObject _ownerObject; private CharacterBody _ownerBody; private Inventory _ownerInventory; public ProjectileController projectileController { get { if ((Object)(object)_projectileController == (Object)null) { _projectileController = ((Component)this).GetComponent<ProjectileController>(); } return _projectileController; } set { _projectileController = value; } } public GameObject ownerObject { get { if ((Object)(object)_ownerObject == (Object)null) { _ownerObject = projectileController.owner; } return _ownerObject; } set { _ownerObject = value; } } public CharacterBody ownerBody { get { if ((Object)(object)_ownerBody == (Object)null) { _ownerBody = ownerObject.GetComponent<CharacterBody>(); } return _ownerBody; } set { _ownerBody = value; } } public Inventory ownerInventory { get { if ((Object)(object)_ownerInventory == (Object)null) { _ownerInventory = ownerBody.inventory; } return _ownerInventory; } set { _ownerInventory = value; } } } [RequireComponent(typeof(ProjectileDamage))] public class ProjectileIncreaseDamageAfterDistance : MonoBehaviour { private ProjectileDamage projectileDamage; public float requiredDistance = 21f; public float damageMultiplierOnIncrease = 1f; public GameObject effectPrefab; private Vector3 initialPosition; private bool damageIncreased; private float requiredDistanceSqr => requiredDistance * requiredDistance; private void OnEnable() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) initialPosition = ((Component)this).transform.position; projectileDamage = ((Component)this).GetComponent<ProjectileDamage>(); } private void FixedUpdate() { //IL_0027: 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_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: 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_009e: Expected O, but got Unknown if (!NetworkServer.active || damageIncreased) { return; } Vector3 val = ((Component)this).transform.position - initialPosition; float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude; if (sqrMagnitude >= requiredDistanceSqr) { damageIncreased = true; ProjectileDamage obj = projectileDamage; obj.damage *= damageMultiplierOnIncrease; if ((Object)(object)effectPrefab != (Object)null) { EffectData val2 = new EffectData { origin = ((Component)this).transform.position }; EffectManager.SpawnEffect(effectPrefab, val2, true); } } } } }
RiskierRain.dll
Decompiled 2 weeks ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using ChillRework; using EntityStates; using EntityStates.Bandit2; using EntityStates.Bandit2.Weapon; using EntityStates.BeetleQueenMonster; using EntityStates.Captain.Weapon; using EntityStates.CaptainDefenseMatrixItem; using EntityStates.CaptainSupplyDrop; using EntityStates.Commando; using EntityStates.Commando.CommandoWeapon; using EntityStates.Croco; using EntityStates.Engi.EngiBubbleShield; using EntityStates.Engi.EngiMissilePainter; using EntityStates.Engi.EngiWeapon; using EntityStates.Engi.Mine; using EntityStates.GameOver; using EntityStates.GoldGat; using EntityStates.Huntress; using EntityStates.Huntress.HuntressWeapon; using EntityStates.Huntress.Weapon; using EntityStates.ImpBossMonster; using EntityStates.Loader; using EntityStates.Mage; using EntityStates.Mage.Weapon; using EntityStates.Merc; using EntityStates.Merc.Weapon; using EntityStates.Missions.Arena.NullWard; using EntityStates.NullifierMonster; using EntityStates.QuestVolatileBattery; using EntityStates.Toolbot; using EntityStates.Treebot; using EntityStates.Treebot.Weapon; using EntityStates.VagrantMonster; using EntityStates.VagrantNovaItem; using EntityStates.VoidJailer.Weapon; using EntityStates.VoidSurvivor.Weapon; using HG; using IL.EntityStates.Croco; using IL.EntityStates.Engi.Mine; using IL.RoR2; using IL.RoR2.Items; using IL.RoR2.Orbs; using IL.RoR2.Projectile; using Mono.Cecil; using Mono.Cecil.Cil; using MonoMod.Cil; using MonoMod.RuntimeDetour; using MoreStats; using On.EntityStates; using On.EntityStates.Bandit2; using On.EntityStates.Bandit2.Weapon; using On.EntityStates.Captain.Weapon; using On.EntityStates.CaptainDefenseMatrixItem; using On.EntityStates.CaptainSupplyDrop; using On.EntityStates.Commando; using On.EntityStates.Commando.CommandoWeapon; using On.EntityStates.Croco; using On.EntityStates.Engi.EngiBubbleShield; using On.EntityStates.Engi.EngiWeapon; using On.EntityStates.Engi.Mine; using On.EntityStates.GameOver; using On.EntityStates.Huntress; using On.EntityStates.Huntress.HuntressWeapon; using On.EntityStates.Mage; using On.EntityStates.Mage.Weapon; using On.EntityStates.Merc; using On.EntityStates.Merc.Weapon; using On.EntityStates.Missions.Arena.NullWard; using On.EntityStates.NullifierMonster; using On.EntityStates.QuestVolatileBattery; using On.EntityStates.Toolbot; using On.EntityStates.Treebot; using On.EntityStates.Treebot.Weapon; using On.EntityStates.VagrantMonster; using On.EntityStates.VagrantNovaItem; using On.EntityStates.VoidSurvivor.Weapon; using On.RoR2; using On.RoR2.Items; using On.RoR2.Orbs; using On.RoR2.Projectile; using On.RoR2.Skills; using R2API; using R2API.Utils; using RainrotSharedUtils.Components; using RiskierRain.Components; using RiskierRain.CoreModules; using RiskierRain.States.Commando; using RiskierRain.States.VoidFiend; using RiskierRain.SurvivorTweaks; using RoR2; using RoR2.CharacterAI; using RoR2.ContentManagement; using RoR2.Items; using RoR2.Orbs; using RoR2.Projectile; using RoR2.Skills; using RoR2.Stats; using RoR2.UI; using SwanSongExtended; using SwanSongExtended.Components; using SwanSongExtended.Modules; using ThreeEyedGames; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Events; using UnityEngine.Networking; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")] [assembly: AssemblyCompany("RiskierRain")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("RiskierRain")] [assembly: AssemblyTitle("RiskierRain")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: UnverifiableCode] [module: UnverifiableCode] namespace RiskierRain { [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.RiskOfBrainrot.RiskierRain", "RiskierRain", "1.0.18")] [R2APISubmoduleDependency(new string[] { "LanguageAPI", "PrefabAPI", "DirectorAPI", "ItemAPI", "RecalculateStatsAPI", "EliteAPI" })] internal class RiskierRainPlugin : BaseUnityPlugin { public delegate bool orig_getHasOneShotProtection(CharacterBody self); [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func<Instruction, bool> <>9__24_0; public static Func<Instruction, bool> <>9__24_1; public static Func<Instruction, bool> <>9__24_2; public static Func<Instruction, bool> <>9__24_3; public static Func<Instruction, bool> <>9__24_4; public static Func<Instruction, bool> <>9__25_1; public static Func<Instruction, bool> <>9__25_2; public static Func<Instruction, bool> <>9__25_3; public static Func<Instruction, bool> <>9__25_4; public static Func<Instruction, bool> <>9__25_5; public static Func<Instruction, bool> <>9__25_6; public static Func<Instruction, bool> <>9__25_8; public static Func<Instruction, bool> <>9__25_9; public static Func<Instruction, bool> <>9__25_10; public static Func<Instruction, bool> <>9__25_11; public static Func<Instruction, bool> <>9__25_12; public static Func<Instruction, bool> <>9__25_13; public static Func<float, float> <>9__25_14; public static Func<Instruction, bool> <>9__53_0; public static Func<Instruction, bool> <>9__53_1; public static Func<Instruction, bool> <>9__54_0; public static Func<Instruction, bool> <>9__56_0; public static Func<Instruction, bool> <>9__56_1; public static Func<Instruction, bool> <>9__56_2; public static Func<uint, uint> <>9__123_0; public static Func<uint, uint> <>9__124_0; public static Func<Instruction, bool> <>9__190_0; public static Action<CharacterBody> <>9__190_1; public static Func<EliteRules, bool> <>9__206_0; public static Func<Instruction, bool> <>9__213_0; public static Func<Instruction, bool> <>9__213_1; public static Func<Instruction, bool> <>9__213_3; public static Func<Instruction, bool> <>9__213_5; public static Func<Instruction, bool> <>9__213_6; public static Func<Instruction, bool> <>9__213_7; public static Func<Instruction, bool> <>9__222_0; public static Func<Instruction, bool> <>9__222_1; public static Func<Instruction, bool> <>9__228_0; public static Func<Instruction, bool> <>9__228_1; public static Func<Instruction, bool> <>9__228_2; public static Func<Instruction, bool> <>9__228_3; public static Func<int, int> <>9__228_4; public static Func<Instruction, bool> <>9__231_0; public static Func<Instruction, bool> <>9__231_1; public static Func<HealthComponent, float> <>9__231_2; public static Func<Instruction, bool> <>9__231_3; public static Action<HealthComponent, float, ProcChainMask, bool> <>9__231_4; public static hook_OnEnter <>9__236_0; public static hook_OnEnter <>9__236_1; public static Func<Instruction, bool> <>9__307_0; public static Func<Instruction, bool> <>9__317_0; public static Func<Instruction, bool> <>9__317_1; public static Func<Instruction, bool> <>9__317_2; public static Func<Instruction, bool> <>9__318_0; public static Func<Instruction, bool> <>9__318_1; public static Func<Instruction, bool> <>9__318_2; public static Func<Instruction, bool> <>9__318_3; public static Func<Instruction, bool> <>9__321_0; public static Func<Instruction, bool> <>9__321_1; public static Func<Instruction, bool> <>9__321_4; public static Func<Instruction, bool> <>9__326_0; public static Func<Instruction, bool> <>9__326_1; public static Func<Instruction, bool> <>9__326_2; public static Func<Instruction, bool> <>9__326_5; public static Func<Instruction, bool> <>9__326_6; public static Func<Instruction, bool> <>9__326_8; public static Func<Instruction, bool> <>9__329_0; public static Func<Instruction, bool> <>9__337_0; public static Func<Instruction, bool> <>9__337_1; public static Func<Instruction, bool> <>9__337_4; public static Func<Instruction, bool> <>9__337_5; public static Func<int, int, CharacterBody, int> <>9__337_7; public static Func<Instruction, bool> <>9__347_0; public static Func<Instruction, bool> <>9__347_1; public static Func<Instruction, bool> <>9__347_4; public static Func<Instruction, bool> <>9__347_5; public static Func<Instruction, bool> <>9__347_6; public static Func<Instruction, bool> <>9__357_0; public static Func<Instruction, bool> <>9__357_1; public static Func<int, HealthComponent, int> <>9__357_2; public static Func<Instruction, bool> <>9__362_0; public static Func<Instruction, bool> <>9__362_1; public static Func<Instruction, bool> <>9__363_0; public static Func<Instruction, bool> <>9__363_2; public static Func<Instruction, bool> <>9__371_0; public static Func<Instruction, bool> <>9__371_1; public static Func<Instruction, bool> <>9__371_3; public static Func<float, int, float> <>9__371_4; public static Func<Instruction, bool> <>9__408_0; public static Func<Instruction, bool> <>9__409_0; public static Func<float, SprintWispBodyBehavior, float> <>9__409_1; public static Func<Instruction, bool> <>9__411_0; public static Func<Vector3, DevilOrb, Vector3> <>9__411_1; public static Func<Instruction, bool> <>9__412_0; public static Func<float, DamageReport, int, float> <>9__412_1; public static Func<Instruction, bool> <>9__412_2; public static Func<float, DamageReport, int, float> <>9__412_3; public static Func<Instruction, bool> <>9__413_0; public static Func<Instruction, bool> <>9__413_1; public static Func<Instruction, bool> <>9__413_2; public static Func<Instruction, bool> <>9__413_3; public static Func<Instruction, bool> <>9__413_4; public static Func<Instruction, bool> <>9__413_5; public static Func<float, int, float> <>9__413_6; public static Func<Instruction, bool> <>9__413_7; public static Func<float, DamageReport, int, float> <>9__413_8; public static Func<Instruction, bool> <>9__414_0; public static Func<Instruction, bool> <>9__414_2; public static Func<float, int, float> <>9__414_3; public static Func<Instruction, bool> <>9__414_4; public static Func<float, int, float> <>9__414_5; public static Func<Instruction, bool> <>9__415_0; public static Func<int, int> <>9__415_2; public static Func<Instruction, bool> <>9__415_3; public static Func<float, int, float> <>9__415_4; public static Func<Instruction, bool> <>9__415_5; public static Func<float, int, float> <>9__415_6; public static Func<Instruction, bool> <>9__424_0; public static Func<Instruction, bool> <>9__424_2; public static Func<Instruction, bool> <>9__424_5; public static Func<float, CharacterBody, float> <>9__424_6; public static Func<Instruction, bool> <>9__424_8; public static Func<Instruction, bool> <>9__424_9; public static Func<float, CharacterBody, float> <>9__424_10; public static Func<Instruction, bool> <>9__425_0; public static Func<Instruction, bool> <>9__425_2; public static Func<Instruction, bool> <>9__425_4; public static Func<Instruction, bool> <>9__425_5; public static Func<Instruction, bool> <>9__425_8; public static Func<float, CharacterBody, float> <>9__425_9; public static Func<Instruction, bool> <>9__426_0; public static Func<Instruction, bool> <>9__426_2; public static Func<Instruction, bool> <>9__426_4; public static Func<Instruction, bool> <>9__426_5; public static Func<Instruction, bool> <>9__426_8; public static Func<float, CharacterBody, float> <>9__426_9; public static Func<GameObject, bool> <>9__429_0; public static Func<GameObject, bool> <>9__429_1; public static Func<Instruction, bool> <>9__449_0; public static Func<Instruction, bool> <>9__449_1; public static Action<CharacterBody, BuffDef, float, float> <>9__449_3; public static Func<Instruction, bool> <>9__450_0; public static Func<Instruction, bool> <>9__450_1; public static Func<Instruction, bool> <>9__450_2; public static Func<float, HealthComponent, float> <>9__450_3; public static Func<Instruction, bool> <>9__475_0; public static Func<Instruction, bool> <>9__475_1; public static Func<Instruction, bool> <>9__476_0; public static Func<Instruction, bool> <>9__476_1; public static Func<Instruction, bool> <>9__494_0; public static Func<Instruction, bool> <>9__494_2; public static Func<float, float> <>9__494_3; public static Func<Instruction, bool> <>9__496_0; public static Func<Instruction, bool> <>9__496_1; public static Func<Instruction, bool> <>9__500_0; public static Func<Instruction, bool> <>9__500_3; public static Func<Instruction, bool> <>9__500_4; public static Func<float, float, float> <>9__500_5; public static Func<Instruction, bool> <>9__504_0; public static Func<Instruction, bool> <>9__504_2; public static Func<Instruction, bool> <>9__504_4; public static Func<float, float, float> <>9__504_5; public static Func<Instruction, bool> <>9__516_0; public static Func<Instruction, bool> <>9__516_2; public static Func<float, int, float> <>9__516_3; public static Func<Instruction, bool> <>9__516_4; public static Func<float, float> <>9__516_5; public static Func<Instruction, bool> <>9__517_0; public static Func<Instruction, bool> <>9__517_2; public static Func<float, int, float> <>9__517_3; public static Func<Instruction, bool> <>9__517_4; public static Func<float, float> <>9__517_5; public static Func<Instruction, bool> <>9__518_0; public static Func<Instruction, bool> <>9__518_2; public static Func<float, int, float> <>9__518_3; public static Func<Instruction, bool> <>9__520_0; public static Func<float, float> <>9__520_1; public static Func<Instruction, bool> <>9__521_0; public static Func<Type, bool> <>9__570_0; public static Func<Type, bool> <>9__571_0; internal bool <DirectorCreditGainChanges>b__24_0(Instruction x) { float num = default(float); return ILPatternMatchingExt.MatchLdcR4(x, ref num); } internal bool <DirectorCreditGainChanges>b__24_1(Instruction x) { float num = default(float); return ILPatternMatchingExt.MatchLdcR4(x, ref num); } internal bool <DirectorCreditGainChanges>b__24_2(Instruction x) { float num = default(float); return ILPatternMatchingExt.MatchLdcR4(x, ref num); } internal bool <DirectorCreditGainChanges>b__24_3(Instruction x) { int num = default(int); return ILPatternMatchingExt.MatchStloc(x, ref num); } internal bool <DirectorCreditGainChanges>b__24_4(Instruction x) { float num = default(float); return ILPatternMatchingExt.MatchLdcR4(x, ref num); } internal bool <AmbientLevelChanges>b__25_1(Instruction x) { float num = default(float); return ILPatternMatchingExt.MatchLdcR4(x, ref num); } internal bool <AmbientLevelChanges>b__25_2(Instruction x) { return ILPatternMatchingExt.MatchMul(x); } internal bool <AmbientLevelChanges>b__25_3(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt<Mathf>(x, "Floor"); } internal bool <AmbientLevelChanges>b__25_4(Instruction x) { float num = default(float); return ILPatternMatchingExt.MatchLdcR4(x, ref num); } internal bool <AmbientLevelChanges>b__25_5(Instruction x) { return ILPatternMatchingExt.MatchLdarg(x, 0); } internal bool <AmbientLevelChanges>b__25_6(Instruction x) { return ILPatternMatchingExt.MatchLdfld<Run>(x, "stageClearCount"); } internal bool <AmbientLevelChanges>b__25_8(Instruction x) { float num = default(float); return ILPatternMatchingExt.MatchLdcR4(x, ref num); } internal bool <AmbientLevelChanges>b__25_9(Instruction x) { return ILPatternMatchingExt.MatchMul(x); } internal bool <AmbientLevelChanges>b__25_10(Instruction x) { float num = default(float); return ILPatternMatchingExt.MatchLdcR4(x, ref num); } internal bool <AmbientLevelChanges>b__25_11(Instruction x) { return ILPatternMatchingExt.MatchLdarg(x, 0); } internal bool <AmbientLevelChanges>b__25_12(Instruction x) { return ILPatternMatchingExt.MatchLdfld<Run>(x, "stageClearCount"); } internal bool <AmbientLevelChanges>b__25_13(Instruction x) { return ILPatternMatchingExt.MatchLdsfld<Run>(x, "ambientLevelCap"); } internal float <AmbientLevelChanges>b__25_14(float levelIn) { float ambientLevelBoost = GetAmbientLevelBoost(); return levelIn + ambientLevelBoost; } internal bool <RemoveEclipseStats>b__53_0(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt<Run>(x, "get_selectedDifficulty"); } internal bool <RemoveEclipseStats>b__53_1(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt<Run>(x, "get_selectedDifficulty"); } internal bool <RemoveEclipseEffect>b__54_0(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt<Run>(x, "get_selectedDifficulty"); } internal bool <EclipseHoldoutScale>b__56_0(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt<Run>(x, "get_selectedDifficulty"); } internal bool <EclipseHoldoutScale>b__56_1(Instruction x) { int num = default(int); return ILPatternMatchingExt.MatchLdcI4(x, ref num); } internal bool <EclipseHoldoutScale>b__56_2(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt<HealthComponent>(x, "get_fullHealth"); } internal uint <FixGoldRewards>b__123_0(uint money) { float compensatedDifficultyFraction = GetCompensatedDifficultyFraction(); return (uint)((float)money * compensatedDifficultyFraction * goldRewardMultiplierGlobal); } internal uint <FixExpRewards>b__124_0(uint exp) { float compensatedDifficultyFraction = GetCompensatedDifficultyFraction(); return (uint)((float)exp * compensatedDifficultyFraction * expRewardMultiplierGlobal); } internal bool <SoulShrineLuckBuff>b__190_0(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC2Content/Buffs", "ExtraLifeBuff"); } internal void <SoulShrineLuckBuff>b__190_1(CharacterBody body) { body.AddBuff(Assets.soulShrineLuckBuff); } internal bool <ChangeEliteTierStats>b__206_0(EliteRules rules) { //IL_0011: 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_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Invalid comparison between Unknown and I4 //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Invalid comparison between Unknown and I4 //IL_0074: 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_0061: Invalid comparison between Unknown and I4 //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Invalid comparison between Unknown and I4 return (Run.instance.stageClearCount >= Tier2EliteMinimumStageDrizzle && (int)rules == 0 && (int)Run.instance.selectedDifficulty <= 0) || (Run.instance.stageClearCount >= Tier2EliteMinimumStageRainstorm && (int)rules == 0 && (int)Run.instance.selectedDifficulty == 1) || (Run.instance.stageClearCount >= Tier2EliteMinimumStageMonsoon && (int)rules == 0 && (int)Run.instance.selectedDifficulty == 2) || (Run.instance.stageClearCount >= Tier2EliteMinimumStageEclipse && (int)rules == 0 && (int)Run.instance.selectedDifficulty > 2); } internal bool <OverloadingShieldConversion>b__213_0(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, "RoR2.RoR2Content/Buffs", "AffixBlue"); } internal bool <OverloadingShieldConversion>b__213_1(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt<CharacterBody>(x, "get_maxHealth"); } internal bool <OverloadingShieldConversion>b__213_3(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt<CharacterBody>(x, "set_maxShield"); } internal bool <OverloadingShieldConversion>b__213_5(Instruction x) { return ILPatternMatchingExt.MatchLdarg(x, 0); } internal bool <OverloadingShieldConversion>b__213_6(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt<CharacterBody>(x, "get_maxHealth"); } internal bool <OverloadingShieldConversion>b__213_7(Instruction x) { return ILPatternMatchingExt.MatchAdd(x); } internal bool <OverloadingBombDamage>b__222_0(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, "RoR2.RoR2Content/Buffs", "AffixBlue"); } internal bool <OverloadingBombDamage>b__222_1(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt(x, "RoR2.Util", "OnHitProcDamage"); } internal bool <RemoveVoidtouchedCollapse>b__228_0(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC1Content/Items", "BleedOnHitVoid"); } internal bool <RemoveVoidtouchedCollapse>b__228_1(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC1Content/Buffs", "EliteVoid"); } internal bool <RemoveVoidtouchedCollapse>b__228_2(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt<CharacterBody>(x, "HasBuff"); } internal bool <RemoveVoidtouchedCollapse>b__228_3(Instruction x) { int num = default(int); return ILPatternMatchingExt.MatchStloc(x, ref num); } internal int <RemoveVoidtouchedCollapse>b__228_4(int guh) { return 0; } internal bool <ReplaceHealingWithBarrier>b__231_0(Instruction x) { return ILPatternMatchingExt.MatchLdfld<HurtBox>(x, "healthComponent"); } internal bool <ReplaceHealingWithBarrier>b__231_1(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt<HealthComponent>(x, "get_fullHealth"); } internal float <ReplaceHealingWithBarrier>b__231_2(HealthComponent healthComponent) { return healthComponent.fullHealth * 2f; } internal bool <ReplaceHealingWithBarrier>b__231_3(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt<HealthComponent>(x, "Heal"); } internal void <ReplaceHealingWithBarrier>b__231_4(HealthComponent targetHealthComponent, float healAmount, ProcChainMask procChainMask, bool nonRegen) { float num = 0f; num = healAmount; targetHealthComponent.AddBarrier(num); } internal void <FixJellyNuke>b__236_0(orig_OnEnter orig, ChargeMegaNova self) { orig.Invoke(self); self.duration = ChargeMegaNova.baseDuration; if (((EntityState)self).characterBody.attackSpeed > 1.5f) { self.duration = 2f; } } internal void <FixJellyNuke>b__236_1(orig_OnEnter orig, ChargeState self) { orig.Invoke(self); self.duration = 3f; } internal bool <GummyInheritItems>b__307_0(Instruction x) { return ILPatternMatchingExt.MatchNewobj<DirectorSpawnRequest>(x); } internal bool <CapacitorNerf>b__317_0(Instruction x) { float num = default(float); return ILPatternMatchingExt.MatchLdcR4(x, ref num); } internal bool <CapacitorNerf>b__317_1(Instruction x) { return ILPatternMatchingExt.MatchMul(x); } internal bool <CapacitorNerf>b__317_2(Instruction x) { return ILPatternMatchingExt.MatchStfld<GenericDamageOrb>(x, "damageValue"); } internal bool <CapacitorBuff>b__318_0(Instruction x) { int num = default(int); return ILPatternMatchingExt.MatchLdcI4(x, ref num); } internal bool <CapacitorBuff>b__318_1(Instruction x) { return ILPatternMatchingExt.MatchStfld<BlastAttack>(x, "falloffModel"); } internal bool <CapacitorBuff>b__318_2(Instruction x) { float num = default(float); return ILPatternMatchingExt.MatchLdcR4(x, ref num); } internal bool <CapacitorBuff>b__318_3(Instruction x) { return ILPatternMatchingExt.MatchStfld<BlastAttack>(x, "radius"); } internal bool <GlassesNerf>b__321_0(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, "RoR2.RoR2Content/Items", "CritGlasses"); } internal bool <GlassesNerf>b__321_1(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt<Inventory>(x, "GetItemCount"); } internal bool <GlassesNerf>b__321_4(Instruction x) { return ILPatternMatchingExt.MatchConvR4(x); } internal bool <RemovePauldronAttackSpeed>b__326_0(Instruction x) { return ILPatternMatchingExt.MatchLdfld(x, "RoR2.CharacterBody", "baseAttackSpeed"); } internal bool <RemovePauldronAttackSpeed>b__326_1(Instruction x) { return ILPatternMatchingExt.MatchLdarg(x, 0); } internal bool <RemovePauldronAttackSpeed>b__326_2(Instruction x) { return ILPatternMatchingExt.MatchLdfld(x, "RoR2.CharacterBody", "levelAttackSpeed"); } internal bool <RemovePauldronAttackSpeed>b__326_5(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, "RoR2.RoR2Content/Buffs", "WarCryBuff"); } internal bool <RemovePauldronAttackSpeed>b__326_6(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt<CharacterBody>(x, "HasBuff"); } internal bool <RemovePauldronAttackSpeed>b__326_8(Instruction x) { return ILPatternMatchingExt.MatchLdcR4(x, 1f); } internal bool <MeteorFix>b__329_0(Instruction x) { return ILPatternMatchingExt.MatchStfld<BlastAttack>(x, "falloffModel"); } internal bool <InfusionBuff>b__337_0(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, "RoR2.RoR2Content/Items", "Infusion"); } internal bool <InfusionBuff>b__337_1(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt<Inventory>(x, "GetItemCount"); } internal bool <InfusionBuff>b__337_4(Instruction x) { int num = default(int); return ILPatternMatchingExt.MatchLdcI4(x, ref num); } internal bool <InfusionBuff>b__337_5(Instruction x) { return ILPatternMatchingExt.MatchMul(x); } internal int <InfusionBuff>b__337_7(int currentInfusionCap, int infusionCount, CharacterBody body) { float num = 100 * infusionCount; if ((Object)(object)body != (Object)null) { float num2 = 1f + 0.3f * (body.level - 1f); num = newInfusionBaseHealth * num2 * (float)infusionCount; } return (int)num; } internal bool <PolyluteDamage>b__347_0(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC1Content/Items", "ChainLightningVoid"); } internal bool <PolyluteDamage>b__347_1(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt<Inventory>(x, "GetItemCount"); } internal bool <PolyluteDamage>b__347_4(Instruction x) { return ILPatternMatchingExt.MatchLdcI4(x, 0); } internal bool <PolyluteDamage>b__347_5(Instruction x) { ILLabel val = default(ILLabel); return ILPatternMatchingExt.MatchBle(x, ref val); } internal bool <PolyluteDamage>b__347_6(Instruction x) { float num = default(float); return ILPatternMatchingExt.MatchLdcR4(x, ref num); } internal bool <FixLostSeersDamageImmunity>b__357_0(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC1Content/Items", "CritGlassesVoid"); } internal bool <FixLostSeersDamageImmunity>b__357_1(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt<Inventory>(x, "GetItemCount"); } internal int <FixLostSeersDamageImmunity>b__357_2(int lensCount, HealthComponent hc) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) CharacterBody body = hc.body; if (((Enum)body.bodyFlags).HasFlag((Enum)(object)(BodyFlags)2048)) { return 0; } return lensCount; } internal bool <FuelCellStock>b__362_0(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, "RoR2.RoR2Content/Items", "EquipmentMagazine"); } internal bool <FuelCellStock>b__362_1(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt<Inventory>(x, "GetItemCount"); } internal bool <FuelCellCdr>b__363_0(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, "RoR2.RoR2Content/Items", "EquipmentMagazine"); } internal bool <FuelCellCdr>b__363_2(Instruction x) { float num = default(float); return ILPatternMatchingExt.MatchLdcR4(x, ref num); } internal bool <StickyBombRework>b__371_0(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, "RoR2.RoR2Content/Items", "StickyBomb"); } internal bool <StickyBombRework>b__371_1(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt<Inventory>(x, "GetItemCount"); } internal bool <StickyBombRework>b__371_3(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt(x, "RoR2.Util", "OnHitProcDamage"); } internal float <StickyBombRework>b__371_4(float damageCoefficient, int itemCount) { return stickyDamageCoeffBase + stickyDamageCoeffStack * (float)(itemCount - 1); } internal bool <NkuhanasBuff>b__408_0(Instruction x) { return ILPatternMatchingExt.MatchStfld<DevilOrb>(x, "damageValue"); } internal bool <NerfDiscipleDamage>b__409_0(Instruction x) { return ILPatternMatchingExt.MatchStfld<DevilOrb>(x, "damageValue"); } internal float <NerfDiscipleDamage>b__409_1(float damageIn, SprintWispBodyBehavior behavior) { return damageIn / (float)((BaseItemBodyBehavior)behavior).stack; } internal bool <BuffDevilOrb>b__411_0(Instruction x) { return ILPatternMatchingExt.MatchStfld<DamageInfo>(x, "force"); } internal Vector3 <BuffDevilOrb>b__411_1(Vector3 forceIn, DevilOrb orb) { //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_006f: 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_0073: 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_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Invalid comparison between Unknown and I4 //IL_0107: 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_011c: 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_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) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: 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) HealthComponent healthComponent = ((Orb)orb).target.healthComponent; float num = 1f; if ((Object)(object)healthComponent.body.characterMotor != (Object)null) { num = healthComponent.body.characterMotor.mass; } else if ((Object)(object)healthComponent.body.rigidbody != (Object)null) { num = healthComponent.body.rigidbody.mass; } EffectType effectType = orb.effectType; EffectType val = effectType; if ((int)val != 0) { if ((int)val == 1) { if (useDiscipleKnockbackSlow) { num *= 15f; healthComponent.body.AddTimedBuffAuthority(Buffs.Slow50.buffIndex, 3f); } else { num *= 0f; } } } else if (useNkuhanaKnockbackSlow) { num *= 25f; healthComponent.body.AddTimedBuffAuthority(Buffs.Slow50.buffIndex, 3f); } else { num *= 0f; } Vector3 val2 = ((Component)((Orb)orb).target).transform.position - orb.attacker.transform.position; return ((Vector3)(ref val2)).normalized * (100f + num); } internal bool <GasChanges>b__412_0(Instruction x) { return ILPatternMatchingExt.MatchStfld<InflictDotInfo>(x, "totalDamage"); } internal float <GasChanges>b__412_1(float currentDamage, DamageReport damageReport, int itemCount) { return (gasBaseBurnDamage + gasStackBurnDamage * (float)itemCount) * damageReport.attackerBody.damage; } internal bool <GasChanges>b__412_2(Instruction x) { return ILPatternMatchingExt.MatchStfld<BlastAttack>(x, "baseDamage"); } internal float <GasChanges>b__412_3(float currentDamage, DamageReport damageReport, int itemCount) { return (gasBaseDamage + gasStackDamage * (float)itemCount) * damageReport.attackerBody.damage; } internal bool <GasChangesOld>b__413_0(Instruction x) { return ILPatternMatchingExt.MatchLdcR4(x, 1.5f); } internal bool <GasChangesOld>b__413_1(Instruction x) { return ILPatternMatchingExt.MatchLdcR4(x, 1.5f); } internal bool <GasChangesOld>b__413_2(Instruction x) { return ILPatternMatchingExt.MatchLdarg(x, 1); } internal bool <GasChangesOld>b__413_3(Instruction x) { return ILPatternMatchingExt.MatchConvR4(x); } internal bool <GasChangesOld>b__413_4(Instruction x) { return ILPatternMatchingExt.MatchMul(x); } internal bool <GasChangesOld>b__413_5(Instruction x) { return ILPatternMatchingExt.MatchAdd(x); } internal float <GasChangesOld>b__413_6(float currentDuration, int itemCount) { return gasBaseBurnDamage + gasStackBurnDamage * (float)itemCount; } internal bool <GasChangesOld>b__413_7(Instruction x) { return ILPatternMatchingExt.MatchStfld<BlastAttack>(x, "baseDamage"); } internal float <GasChangesOld>b__413_8(float currentDamage, DamageReport damageReport, int itemCount) { return (gasBaseDamage + gasStackDamage * (float)itemCount) * damageReport.attackerBody.damage; } internal bool <WillOWispChanges>b__414_0(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, "RoR2.RoR2Content/Items", "ExplodeOnDeath"); } internal bool <WillOWispChanges>b__414_2(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt(x, "RoR2.Util", "OnKillProcDamage"); } internal float <WillOWispChanges>b__414_3(float currentDamage, int itemCount) { return willowispBaseDamage * (1f + willowispScaleFraction * (float)(itemCount - 1)); } internal bool <WillOWispChanges>b__414_4(Instruction x) { return ILPatternMatchingExt.MatchStfld<DelayBlast>(x, "radius"); } internal float <WillOWispChanges>b__414_5(float currentRadius, int itemCount) { return willowispBaseRange + willowispStackRange * (float)itemCount; } internal bool <VoidsentFlameChanges>b__415_0(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC1Content/Items", "ExplodeOnDeathVoid"); } internal int <VoidsentFlameChanges>b__415_2(int itemCountIn) { if (itemCountIn > 0 && Util.CheckRoll(voidsentBaseChance + voidsentStackChance * (float)(itemCountIn - 1), 0f, (CharacterMaster)null)) { return itemCountIn; } return 0; } internal bool <VoidsentFlameChanges>b__415_3(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt(x, "RoR2.Util", "OnKillProcDamage"); } internal float <VoidsentFlameChanges>b__415_4(float currentDamage, int itemCount) { return voidsentBaseDamage * (1f + voidsentScaleFraction * (float)(itemCount - 1)); } internal bool <VoidsentFlameChanges>b__415_5(Instruction x) { return ILPatternMatchingExt.MatchStfld<DelayBlast>(x, "radius"); } internal float <VoidsentFlameChanges>b__415_6(float currentRadius, int itemCount) { return voidsentBaseRange + voidsentStackRange * (float)itemCount; } internal bool <CooldownBuff>b__424_0(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, "RoR2.RoR2Content/Items", "IceRing"); } internal bool <CooldownBuff>b__424_2(Instruction x) { return ILPatternMatchingExt.MatchLdcI4(x, 1); } internal bool <CooldownBuff>b__424_5(Instruction x) { return ILPatternMatchingExt.MatchConvR4(x); } internal float <CooldownBuff>b__424_6(float cooldown, CharacterBody self) { float num = 1f; if (Object.op_Implicit((Object)(object)self.skillLocator.special)) { float cooldownScale = self.skillLocator.special.cooldownScale; num *= cooldownScale; if (!(self.skillLocator.special.flatCooldownReduction < 9f)) { } } return cooldown * num; } internal bool <CooldownBuff>b__424_8(Instruction x) { return ILPatternMatchingExt.MatchConvR4(x); } internal bool <CooldownBuff>b__424_9(Instruction x) { float num = default(float); return ILPatternMatchingExt.MatchLdcR4(x, ref num); } internal float <CooldownBuff>b__424_10(float seconds, CharacterBody self) { float num = 0f; if (Object.op_Implicit((Object)(object)self.skillLocator.special)) { } return Mathf.Max(seconds - num, 1f); } internal bool <RunaldNerf>b__425_0(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, "RoR2.RoR2Content/Items", "IceRing"); } internal bool <RunaldNerf>b__425_2(Instruction x) { float num = default(float); return ILPatternMatchingExt.MatchLdcR4(x, ref num); } internal bool <RunaldNerf>b__425_4(Instruction x) { return ILPatternMatchingExt.MatchConvR4(x); } internal bool <RunaldNerf>b__425_5(Instruction x) { return ILPatternMatchingExt.MatchMul(x); } internal bool <RunaldNerf>b__425_8(Instruction x) { MethodReference val = default(MethodReference); return ILPatternMatchingExt.MatchCallOrCallvirt(x, ref val); } internal float <RunaldNerf>b__425_9(float damage, CharacterBody attackerBody) { float num = attackerBody.baseDamage * runaldBaseDamage; return damage + num; } internal bool <KjaroNerf>b__426_0(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, "RoR2.RoR2Content/Items", "FireRing"); } internal bool <KjaroNerf>b__426_2(Instruction x) { float num = default(float); return ILPatternMatchingExt.MatchLdcR4(x, ref num); } internal bool <KjaroNerf>b__426_4(Instruction x) { return ILPatternMatchingExt.MatchConvR4(x); } internal bool <KjaroNerf>b__426_5(Instruction x) { return ILPatternMatchingExt.MatchMul(x); } internal bool <KjaroNerf>b__426_8(Instruction x) { MethodReference val = default(MethodReference); return ILPatternMatchingExt.MatchCallOrCallvirt(x, ref val); } internal float <KjaroNerf>b__426_9(float damage, CharacterBody attackerBody) { float num = attackerBody.baseDamage * kjaroBaseDamage; return damage + num; } internal bool <SceneDirector_Start>b__429_0(GameObject obj) { return ((Object)obj).name == "NewtStatue" || ((Object)obj).name == "NewtStatue (1)" || ((Object)obj).name == "NewtStatue (2)" || ((Object)obj).name == "NewtStatue (3)" || ((Object)obj).name == "NewtStatue (4)"; } internal bool <SceneDirector_Start>b__429_1(GameObject obj) { return ((Object)obj).name == "NewtStatue, Guarantee" || ((Object)obj).name == "NewtStatue, Guaranteed" || ((Object)obj).name == "NewtStatue (Permanent)"; } internal bool <DeathMarkFix_Stacking>b__449_0(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, "RoR2.RoR2Content/Buffs", "DeathMark"); } internal bool <DeathMarkFix_Stacking>b__449_1(Instruction x) { float num = default(float); return ILPatternMatchingExt.MatchLdcR4(x, ref num); } internal void <DeathMarkFix_Stacking>b__449_3(CharacterBody body, BuffDef buffDef, float duration, float itemCount) { int buffCount = body.GetBuffCount(Buffs.DeathMark); int num = 0; if (buffCount < (int)itemCount) { num = (int)itemCount - buffCount; } for (float num2 = 0f; num2 < (float)num; num2 += 1f) { body.AddTimedBuff(buffDef, duration); } } internal bool <DeathMarkFix_Damage>b__450_0(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, "RoR2.RoR2Content/Buffs", "DeathMark"); } internal bool <DeathMarkFix_Damage>b__450_1(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt<CharacterBody>(x, "HasBuff"); } internal bool <DeathMarkFix_Damage>b__450_2(Instruction x) { float num = default(float); return ILPatternMatchingExt.MatchLdcR4(x, ref num); } internal float <DeathMarkFix_Damage>b__450_3(float damage, HealthComponent hc) { CharacterBody body = hc.body; float num = 1f; int buffCount = body.GetBuffCount(Buffs.DeathMark); num += deathMarkBonusDamage * (float)buffCount; Debug.Log((object)(damage + " " + num)); return num; } internal bool <RevokeShatterspleenBleedRights>b__475_0(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, "RoR2.RoR2Content/Items", "BleedOnHitAndExplode"); } internal bool <RevokeShatterspleenBleedRights>b__475_1(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt<Inventory>(x, "GetItemCount"); } internal bool <RevokeShatterspleenDeathRights>b__476_0(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, "RoR2.RoR2Content/Items", "BleedOnHitAndExplode"); } internal bool <RevokeShatterspleenDeathRights>b__476_1(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt<Inventory>(x, "GetItemCount"); } internal bool <VoidBearChanges>b__494_0(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC1Content/Items", "BearVoid"); } internal bool <VoidBearChanges>b__494_2(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt<CharacterBody>(x, "AddTimedBuff"); } internal float <VoidBearChanges>b__494_3(float inDuration) { float num = 15f; float num2 = 5f; return num2 + inDuration * ((num - num2) / num); } internal bool <TeddyChanges>b__496_0(Instruction x) { return ILPatternMatchingExt.MatchLdfld(x, "RoR2.HealthComponent/ItemCounts", "bear"); } internal bool <TeddyChanges>b__496_1(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt(x, "RoR2.Util", "ConvertAmplificationPercentageIntoReductionPercentage"); } internal bool <HoofNerf>b__500_0(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, "RoR2.RoR2Content/Items", "Hoof"); } internal bool <HoofNerf>b__500_3(Instruction x) { return ILPatternMatchingExt.MatchConvR4(x); } internal bool <HoofNerf>b__500_4(Instruction x) { float num = default(float); return ILPatternMatchingExt.MatchLdcR4(x, ref num); } internal float <HoofNerf>b__500_5(float itemCount, float speedBonus) { float result = 0f; if (itemCount > 0f) { result = hoofSpeedBonusBase + hoofSpeedBonusStack * (itemCount - 1f); } return result; } internal bool <DrinkNerf>b__504_0(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, "RoR2.RoR2Content/Items", "SprintBonus"); } internal bool <DrinkNerf>b__504_2(Instruction x) { float num = default(float); return ILPatternMatchingExt.MatchLdcR4(x, ref num); } internal bool <DrinkNerf>b__504_4(Instruction x) { return ILPatternMatchingExt.MatchConvR4(x); } internal float <DrinkNerf>b__504_5(float speedBonus, float itemCount) { float result = 0f; if (itemCount > 0f) { result = drinkSpeedBonusBase + drinkSpeedBonusStack * (itemCount - 1f); } return result; } internal bool <MonsterToothHealChange>b__516_0(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, "RoR2.RoR2Content/Items", "Tooth"); } internal bool <MonsterToothHealChange>b__516_2(Instruction x) { return ILPatternMatchingExt.MatchStfld<HealthPickup>(x, "flatHealing"); } internal float <MonsterToothHealChange>b__516_3(float currentHealAmt, int itemCount) { return monsterToothFlatHeal * (float)itemCount; } internal bool <MonsterToothHealChange>b__516_4(Instruction x) { return ILPatternMatchingExt.MatchStfld<HealthPickup>(x, "fractionalHealing"); } internal float <MonsterToothHealChange>b__516_5(float currentHealAmt) { return monsterToothPercentHeal; } internal bool <MedkitHealChange>b__517_0(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, "RoR2.RoR2Content/Items", "Medkit"); } internal bool <MedkitHealChange>b__517_2(Instruction x) { int num = default(int); return ILPatternMatchingExt.MatchStloc(x, ref num); } internal float <MedkitHealChange>b__517_3(float currentHealAmt, int itemCount) { return medkitFlatHeal * (float)itemCount; } internal bool <MedkitHealChange>b__517_4(Instruction x) { int num = default(int); return ILPatternMatchingExt.MatchStloc(x, ref num); } internal float <MedkitHealChange>b__517_5(float currentHealAmt) { return medkitPercentHeal; } internal bool <ScytheNerf>b__518_0(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, "RoR2.RoR2Content/Items", "HealOnCrit"); } internal bool <ScytheNerf>b__518_2(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt<HealthComponent>(x, "Heal"); } internal float <ScytheNerf>b__518_3(float currentHealAmt, int itemCount) { return scytheBaseHeal + scytheStackHeal * (float)itemCount; } internal bool <ReduceBungusInterval>b__520_0(Instruction x) { return ILPatternMatchingExt.MatchStfld<HealingWard>(x, "interval"); } internal float <ReduceBungusInterval>b__520_1(float interval) { return fungusHealInterval; } internal bool <ReduceBungusWaitTime>b__521_0(Instruction x) { return ILPatternMatchingExt.MatchLdfld<CharacterBody>(x, "notMovingStopwatch"); } internal bool <InitializeCoreModules>b__570_0(Type type) { return !type.IsAbstract && type.IsSubclassOf(typeof(CoreModule)); } internal bool <InitializeSurvivorTweaks>b__571_0(Type type) { return !type.IsAbstract && type.IsSubclassOf(typeof(SurvivorTweakModule)); } } public static float drizzleDifficultyBoost = 0f; public static float rainstormDifficultyBoost = 3f; public static float monsoonDifficultyBoost = 6f; public static float eclipseDifficultyBoost = 9f; public static float baseScalingMultiplier = 1.1f; public static float difficultyIncreasePerMinutePerDifficulty = 0.01f; public static float difficultyIncreasePerMinuteBase = 1f; public static float difficultyIncreasePerStage = 0.9f; public static float difficultyIncreasePerLoop = 1.3f; public static float playerBaseDifficultyFactor = 0.2f; public static float playerScalingDifficultyFactor = 0.2f; public static float playerSpawnRateFactor = 0.5f; public static float difficultySpawnRateFactor = 0.4f; public static int ambientLevelCap = 999; public static float easyTeleParticleRadius = 1f; public static float normalTeleParticleRadius = 0.8f; public static float hardTeleParticleRadius = 0.4f; public static float eclipseTeleParticleRadius = 0.4f; public static float defaultTeleParticleRadius = 0.9f; public static bool useAmbientLevel = false; public static DifficultyIndex eclipseLevelBossShield = (DifficultyIndex)3; public static float eclipseBossShieldFraction = 0.1f; public static string eclipseOneDesc = "\n<mspace=0.5em>(1)</mspace> Boss Shields: <style=cIsHealth>+" + Tools.ConvertDecimal(eclipseBossShieldFraction) + "</style>"; public static DifficultyIndex eclipseLevelHoldoutLoss = (DifficultyIndex)4; public static float eclipseHoldoutLossRate = 0.03f; public static string eclipseTwoDesc = "\n<mspace=0.5em>(2)</mspace> Holdout Zone Discharge: <style=cIsHealth>-" + Tools.ConvertDecimal(eclipseHoldoutLossRate) + " per second</style>"; public static DifficultyIndex eclipseLevelEnemyCdr = (DifficultyIndex)5; public static float eclipseEnemyCdr = 0.5f; public static string eclipseThreeDesc = "\n<mspace=0.5em>(3)</mspace> Enemy Cooldowns: <style=cIsHealth>-" + Tools.ConvertDecimal(eclipseEnemyCdr) + "</style>"; public static DifficultyIndex eclipseLevelSmallHoldout = (DifficultyIndex)6; public static float eclipseHoldoutScale = 0.7f; public static string eclipseFourDesc = "\n<mspace=0.5em>(4)</mspace> Holdout Zone Radius: <style=cIsHealth>-" + Tools.ConvertDecimal(1f - eclipseHoldoutScale) + "</style>"; public static DifficultyIndex eclipseLevelEnemyMspd = (DifficultyIndex)7; public static float eclipseEnemyMspd = 0.25f; public static string eclipseFiveDesc = "\n<mspace=0.5em>(5)</mspace> Enemy Speed: <style=cIsHealth>+" + Tools.ConvertDecimal(eclipseEnemyMspd) + "</style>"; public static DifficultyIndex eclipseLevelSpiteArtifact = (DifficultyIndex)8; public static string eclipseSixDesc = "\n<mspace=0.5em>(6)</mspace> On Kill: <style=cIsHealth>Enemies drop exploding bombs</style>"; public static DifficultyIndex eclipseLevelVeryHard = (DifficultyIndex)9; public static string eclipseSevenDesc = "\n<mspace=0.5em>(7)</mspace> Difficulty: <style=cIsHealth>Very Hard</style>"; public static DifficultyIndex eclipseLevelPlayerDegen = (DifficultyIndex)10; public static float eclipsePlayerDegen = 0.2f; public static string eclipseEightDesc = "\n<mspace=0.5em>(8)</mspace> Health Degeneration: <style=cIsHealth>-" + Tools.ConvertDecimal(eclipsePlayerDegen) + " per level</style>"; public static float voidFieldsTimeCost = 120f; public static float fastDirectorEliteBias = 0.75f; public static float fastDirectorCreditMultiplier = 0.75f; public static float slowDirectorEliteBias = 1f; public static float slowDirectorCreditMultiplier = 1.5f; public static float teleLesserEliteBias = 1f; public static float teleLesserCreditMultiplier = 1f; public static float teleBossEliteBias = 1f; public static float teleBossCreditMultiplier = 1f; private static bool wasTpCharged = false; private GameObject awu = LegacyResourcesAPI.Load<GameObject>("prefabs/characterbodies/SuperRoboBallBossBody"); private CharacterBody awuBody; private float awuArmor = 40f; private float awuAdditionalArmor = 0f; private int awuAdaptiveArmorCount = 1; private static float costExponent = 1f; private static float goldRewardMultiplierGlobal = 0.6f; private static float expRewardMultiplierGlobal = 1f; private PurchaseInteraction smallChest = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Chest1/Chest1.prefab").WaitForCompletion().GetComponent<PurchaseInteraction>(); private PurchaseInteraction smallCategoryChestDamage = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/CategoryChest/CategoryChestDamage.prefab").WaitForCompletion().GetComponent<PurchaseInteraction>(); private PurchaseInteraction smallCategoryChestHealing = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/CategoryChest/CategoryChestHealing.prefab").WaitForCompletion().GetComponent<PurchaseInteraction>(); private PurchaseInteraction smallCategoryChestUtility = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/CategoryChest/CategoryChestUtility.prefab").WaitForCompletion().GetComponent<PurchaseInteraction>(); private PurchaseInteraction bigChest = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Chest2/Chest2.prefab").WaitForCompletion().GetComponent<PurchaseInteraction>(); private PurchaseInteraction bigCategoryChestDamage = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/CategoryChest2/CategoryChest2Damage Variant.prefab").WaitForCompletion().GetComponent<PurchaseInteraction>(); private PurchaseInteraction bigCategoryChestHealing = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/CategoryChest2/CategoryChest2Healing Variant.prefab").WaitForCompletion().GetComponent<PurchaseInteraction>(); private PurchaseInteraction bigCategoryChestUtility = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/CategoryChest2/CategoryChest2Utility Variant.prefab").WaitForCompletion().GetComponent<PurchaseInteraction>(); private PurchaseInteraction casinoChest = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/CasinoChest/CasinoChest.prefab").WaitForCompletion().GetComponent<PurchaseInteraction>(); private PurchaseInteraction chanceShrine = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/ShrineChance/ShrineChance.prefab").WaitForCompletion().GetComponent<PurchaseInteraction>(); private PurchaseInteraction chanceShrineSnowy = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/ShrineChance/ShrineChanceSnowy Variant.prefab").WaitForCompletion().GetComponent<PurchaseInteraction>(); private PurchaseInteraction chanceShrineSandy = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/ShrineChance/ShrineChanceSandy Variant.prefab").WaitForCompletion().GetComponent<PurchaseInteraction>(); private MultiShopController smallShop = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/TripleShop/TripleShop.prefab").WaitForCompletion().GetComponent<MultiShopController>(); private MultiShopController bigShop = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/TripleShopLarge/TripleShopLarge.prefab").WaitForCompletion().GetComponent<MultiShopController>(); private MultiShopController equipmentShop = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/TripleShopEquipment/TripleShopEquipment.prefab").WaitForCompletion().GetComponent<MultiShopController>(); private string discountChestPrefix = "Bargain"; private int smallChestTypeCost = 20; private int smallShopTypeCost = 35; private int smallCategoryChestTypeCost = 25; private int bigChestTypeCost = 45; private int bigShopTypeCost = 70; private int bigCategoryChestTypeCost = 50; private int goldChestTypeCost = 200; private int bigDroneTypeCost = 160; private int casinoChestTypeCost = 30; private int chanceShrineTypeCost = 15; private GameObject goldShrine = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/ShrineGoldshoresAccess/ShrineGoldshoresAccess.prefab").WaitForCompletion(); private int goldShrineCost = 5; private static int teamMaxHealth; private static int totalBloodGoldValue = 60; private const float totalHealthFraction = 2.18f; private static float chestsPerHealthBar = 2f; public float interactableCreditsMultiplier = 1.5f; public float monsterCreditsMultiplier = 1.5f; public int equipBarrelWeightS1 = 20; public int equipBarrelLimitS1 = 5; public int equipBarrelWeight = 6; public int equipBarrelLimit = 2; public int equipShopWeightS3 = 20; public int equipShopLimitS3 = 4; public int equipShopWeight = 4; public int equipShopLimit = 2; public int scrapperWeight = 1000; public int scrapperLimit = 3; public int doubleChestWeight = 15; public static GameObject whitePrinter = LegacyResourcesAPI.Load<GameObject>("prefabs/networkedobjects/chest/Duplicator"); public static GameObject greenPrinter = LegacyResourcesAPI.Load<GameObject>("prefabs/networkedobjects/chest/DuplicatorLarge"); public static GameObject redPrinter = LegacyResourcesAPI.Load<GameObject>("prefabs/networkedobjects/chest/DuplicatorMilitary"); public static GameObject scrapper = LegacyResourcesAPI.Load<GameObject>("prefabs/networkedobjects/chest/Scrapper"); public int printerGreenWeight = 20; public int printerGreenLimit = 4; public int printerRedWeight = 4; public int printerRedLimit = 1; public int printerRedWeightS5 = 1000; public int printerRedLimitS5 = 2; public int lunarPodWeightS1 = 20; public int lunarPodLimitS1 = 6; public int lunarPodWeight = 6; public int lunarPodLimit = 2; private BasicPickupDropTable doubleChestDropTable = Addressables.LoadAssetAsync<BasicPickupDropTable>((object)"RoR2/Base/CasinoChest/dtCasinoChest.asset").WaitForCompletion(); private InteractableSpawnCard doubleChestSpawnCard = Addressables.LoadAssetAsync<InteractableSpawnCard>((object)"RoR2/Base/CasinoChest/iscCasinoChest.asset").WaitForCompletion(); public DirectorCard doubleChestDirectorCard; public static int halcyoniteShrineLowGoldCost = 40; public static int halcyoniteShrineMidGoldCost = 100; public static int halcyoniteShrineMaxGoldCost = 150; public static int soulShrineLuckIncrease = 1; private GameObject soulShrine = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC2/ShrineColossusAccess.prefab").WaitForCompletion(); private float softEliteHealthBoostCoefficient = 2f; private float rareEliteHealthBoostCoefficient = 4f; private float baseEliteHealthBoostCoefficient = 3f; private float T2EliteHealthBoostCoefficient = 9f; private float rareEliteDamageBoostCoefficient = 2f; private float baseEliteDamageBoostCoefficient = 1.5f; private float T2EliteDamageBoostCoefficient = 4f; public static float overloadingBombDamage = 1.5f; public static int Tier2EliteMinimumStageDefault = 5; public static int Tier2EliteMinimumStageDrizzle = 10; public static int Tier2EliteMinimumStageRainstorm = 5; public static int Tier2EliteMinimumStageMonsoon = 3; public static int Tier2EliteMinimumStageEclipse = 3; private static string Tier2EliteName = "Tier 2"; public static float fireTrailDPS = 80f; public static float fireTrailBaseRadius = 6f; public static float fireTrailLifetime = 100f; public static float overloadingShieldConversionFraction = 0.33f; public static float overloadingSmiteCountBase = 2f; public static float overloadingSmiteCountPerRadius = 1f; public static float overloadingSmiteRangeBase = 18f; public static float overloadingSmiteRangePerRadius = 9f; public static float overloadingSmiteStartingDamage = 10f; public static float overloadingSmiteDamagePerStrike = 5f; public float voidtouchedNullifyBaseDuration = 12f; private float genesisLoopBlastDamageCoefficient = 30f; private float vagrantBaseHealth = 1600f; private GameObject vagrantPrefab; private GameObject pestPrefab; private GameObject pestSpit; private float pestBaseHealth = 50f; private float pestBaseDamage = 6f; private float pestBaseSpeed = 4f; private float pestSpitVelocity = 70f; private GameObject queenSpitPrefab; private GameObject queenAcidPrefab; private float spitDamageCoefficient = 0.4f; private float acidSize = 2f; private float acidDamageCoefficient = 2.5f; private float acidDamageFrequency = 4f; private CharacterSpawnCard gupSpawnCard; private int gupCreditCost = 200; private GameObject gupPrefab; private float gupBaseHealth = 800f; private float gupBaseArmor = 25f; private float gupBaseDamage = 12f; private float gupBaseSpeed = 14f; private float gupBaseRegen = 0f; private GameObject geepPrefab; private float geepBaseHealth = 400f; private float geepBaseArmor = 25f; private float geepBaseDamage = 8f; private float geepBaseSpeed = 10f; private float geepBaseRegen = 0f; private GameObject gipPrefab; private float gipBaseHealth = 200f; private float gipBaseArmor = 25f; private float gipBaseDamage = 5f; private float gipBaseSpeed = 6f; private float gipBaseRegen = 0f; private int nulliferBombCount = 10; private GameObject barnaclePrefab; private float fuckRegen = 0f; private GameObject lesserWispPrefab; private float wispBaseDamage = 1.5f; private GameObject xiMaster = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/MajorAndMinorConstruct/MegaConstructMaster.prefab").WaitForCompletion(); private AISkillDriver[] xiAI; public static EquipmentDef[] scavBlacklistedEquips = (EquipmentDef[])(object)new EquipmentDef[3] { Equipment.PassiveHealing, Equipment.Fruit, Equipment.LifestealOnHit }; public float crunderFunnyMoneyProcChance = 10f; public Func<ItemIndex, bool> gooboItemCopyFilter = Inventory.defaultItemCopyFilterDelegate.Invoke; private float gummyLifetime = 30f; private int gummyDamage = 0; private float gummyDamageMultiplier = 0.7f; private int gummyHealth = 20; private float gummyHealthMultiplier = 1f; public int blastShowerBuffCount = 3; public static float capacitorDamageCoefficient = 10f; public static float capacitorBlastRadius = 13f; public static float capacitorCooldown = 20f; private float glassesNewCritChance = 10f; private float pauldronDamageMultiplier = 1f; private float pauldronAspdMultiplier = 0.5f; private FalloffModel falloffModel = (FalloffModel)0; private float justiceMinDamageCoeff = 8f; public static float newInfusionBaseHealth = 40f; public float wungusRegenBase = 1.5f; public float wungusRegenStack = 1.5f; public float luteDamageCoefficient = 0.4f; private GameObject shurikenProjectilePrefab; public float shurikenBaseDamage = 0.8f; public float shurikenProcCoefficient = 2f; public float daisyRadiusMultiplier = 1.15f; public const float fuelCellCooldownMultiplier = 0.67f; public static string fuelCellEquipCdr = Tools.ConvertDecimal(0.32999998f); public static int fuelCellStock = 2; public const float chaosCooldownMultiplier = 0.67f; public static string chaosEquipCdr = Tools.ConvertDecimal(0.32999998f); public static float stickyDamageCoeffBase = 3.2f; public static float stickyDamageCoeffStack = 0.4f; private float resdiscSpinPerKill = 0.015f; private float resdiscDecayRate = 2f; private GameObject daggerPrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/Projectiles/DaggerProjectile"); private GameObject willowispPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/networkedobjects/WilloWispDelay"); private GameObject voidsentPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/ExplodeOnDeathVoid/ExplodeOnDeathVoidExplosion.prefab").WaitForCompletion(); private GameObject spleenPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/networkedobjects/BleedOnHitAndExplodeDelay"); private GameObject fireworkProjectilePrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/projectiles/FireworkProjectile"); private GameObject resdiscProjectilePrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/projectiles/LaserTurbineBomb"); private GameObject meatballProjectilePrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/Projectiles/FireMeatBall"); private static float willowispProcCoeff = 0.75f; private static float willowispBaseDamage = 3.6f; private static float willowispScaleFraction = 0.75f; private static float willowispBaseRange = 16f; private static float willowispStackRange = 0f; private static float voidsentProcCoeff = 1f; private static float voidsentBaseDamage = 5.6f; private static float voidsentScaleFraction = 0.75f; private static float voidsentBaseRange = 24f; private static float voidsentStackRange = 0f; private static float voidsentBaseChance = 33f; private static float voidsentStackChance = 0f; private static float gasBaseBurnDamage = 0.5f; private static float gasStackBurnDamage = 2f; private static float gasBaseDamage = 0.5f; private static float gasStackDamage = 0f; private float discipleDevilorbProc = 0.4f; private float opinionDevilorbProc = 0.75f; public static bool useNkuhanaKnockbackSlow = false; public static bool useDiscipleKnockbackSlow = false; private float nkuhanaNewDamageMultiplier = 3.5f; private static float runaldBaseDamage = 6f; private static float runaldTotalDamage = 1f; private static float kjaroBaseDamage = 6f; private static float kjaroTotalDamage = 1f; private static string runaldTotal = Tools.ConvertDecimal(runaldTotalDamage); private static string kjaroTotal = Tools.ConvertDecimal(kjaroTotalDamage); public static float newtAltarChance = 0.3f; public static float deathMarkBonusDamage = 0.3f; private float elephantBuffDuration = 10f; private int elephantArmor = 200; private GameObject templarPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/characterbodies/ClayBruiserBody"); private GameObject chimeraWispPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/characterbodies/LunarWispBody"); public static float tarSlowAspdReduction = 0.3f; public static float kitSlowAspdReduction = 0.3f; public static float chronoSlowAspdReduction = 0.5f; public static float chillSlowAspdReduction = 0.6f; private float critHudDamageMul = 1f; private GameObject healPack = LegacyResourcesAPI.Load<GameObject>("prefabs/networkedobjects/HealPack"); private float toothDuration = 15f; private GameObject ammoPack = LegacyResourcesAPI.Load<GameObject>("prefabs/networkedobjects/AmmoPack"); private GameObject moneyPack = LegacyResourcesAPI.Load<GameObject>("prefabs/networkedobjects/BonusMoneyPack"); public static int minSpikes = 3; public static int maxSpikes = 4; public static int baseSpikesPerBuff = 2; public static int stackSpikesPerBuff = 1; public static float minDamageCoefficient = 5f; public static float releaseSpeed = 2f; public static float spikeDamageCoefficient = 0.3f; public static float spikeProcCoefficient = 1f; public static int shatterspleenBleedChance = 20; public static GameObject impBleedSpikePrefab; public static float shockForceExitFraction = 0.1f; public static int rapFreeArmor = 2; public static int knurlFreeArmor = 15; public static int bucklerFreeArmor = 10; public static float voidBearNewMaxCooldown = 15f; public static float voidBearNewMinCooldown = 5f; public static float teddyNewMaxValue = 0.5f; public static float hoofSpeedBonusBase = 0.1f; public static float hoofSpeedBonusStack = 0.1f; public static float drinkSpeedBonusBase = 0.2f; public static float drinkSpeedBonusStack = 0.15f; public static float scytheBaseHeal = 0f; public static float scytheStackHeal = 5f; public static float monsterToothFlatHeal = 10f; public static float monsterToothPercentHeal = 0f; public static float medkitFlatHeal = 40f; public static float medkitPercentHeal = 0f; public static float notMovingRequirement = 0.1f; public static float fungusHealInterval = 0.125f; public const string guid = "com.RiskOfBrainrot.RiskierRain"; public const string teamName = "RiskOfBrainrot"; public const string modName = "RiskierRain"; public const string version = "1.0.18"; public static bool isAELoaded = Tools.isLoaded("com.Borbo.ArtificerExtended"); public static bool isHBULoaded = Tools.isLoaded("com.Borbo.HuntressBuffULTIMATE"); public static bool isScepterLoaded = Tools.isLoaded("com.DestroyedClone.AncientScepter"); public static bool autosprintLoaded = Tools.isLoaded("com.johnedwa.RTAutoSprintEx"); public static bool acridLungeLoaded = Tools.isLoaded("Withor.AcridBiteLunge"); public static bool ucrLoaded = Tools.isLoaded("HIFU.UltimateCustomRun"); public static string drizzleDesc = "Simplifies difficulty for players new to the game. Weeping and gnashing is replaced by laughter and tickles.<style=cStack>\n\n>Player Health Regeneration: <style=cIsHealing>+50%</style> \n>Difficulty Scaling: <style=cIsHealing>-50%</style> \n>Player Damage Reduction: <style=cIsHealing>+38%</style>"; public static string rainstormDesc = "This is the way the game is meant to be played! Test your abilities and skills against formidable foes.<style=cStack>\n\n>Player Health Regeneration: +0% \n>Difficulty Scaling: +0% "; public static string monsoonDesc = "For hardcore players. Every bend introduces pain and horrors of the planet. You will die.<style=cStack>\n\n>Player Health Regeneration: <style=cIsHealth>-40%</style> \n>Difficulty Scaling: <style=cIsHealth>+50%</style>"; private GameObject meatballNapalmPool; public static PluginInfo PInfo { get; private set; } public static string dropPrefabsPath => Assets.dropPrefabsPath; public static string iconsPath => Assets.iconsPath; public static string eliteMaterialsPath => Assets.eliteMaterialsPath; internal static ConfigFile CustomConfigFile { get; set; } public static ConfigEntry<bool> EnableConfig { get; set; } private void DifficultyDependentTeleParticles() { //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Expected O, but got Unknown drizzleDesc = drizzleDesc + "\n>Teleporter Visuals: <style=cIsHealing>+" + Tools.ConvertDecimal(easyTeleParticleRadius / normalTeleParticleRadius - 1f) + "</style> "; rainstormDesc = rainstormDesc + "\n>Teleporter Visuals: +" + Tools.ConvertDecimal(normalTeleParticleRadius / normalTeleParticleRadius - 1f) + " "; monsoonDesc = monsoonDesc + "\n>Teleporter Visuals: <style=cIsHealth>" + Tools.ConvertDecimal(1f - hardTeleParticleRadius / normalTeleParticleRadius) + "</style> "; BaseTeleporterState.OnEnter += new hook_OnEnter(TeleporterParticleScale); } private void TeleporterParticleScale(orig_OnEnter orig, BaseState self) { //IL_0014: 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_001b: 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_001e: 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_0036: Expected I4, but got Unknown //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Invalid comparison between Unknown and I4 //IL_00ab: 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_00bb: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); float num = 1f; DifficultyIndex selectedDifficulty = Run.instance.selectedDifficulty; DifficultyIndex val = selectedDifficulty; switch (val - -1) { default: if ((int)val != 11) { num = eclipseTeleParticleRadius; } break; case 3: num = hardTeleParticleRadius; break; case 2: num = normalTeleParticleRadius; break; case 1: num = easyTeleParticleRadius; break; case 0: break; } TeleporterInteraction component = ((EntityState)self).GetComponent<TeleporterInteraction>(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.modelChildLocator)) { Transform val2 = ((Component)component).transform.Find("TeleporterBaseMesh/BuiltInEffects/PassiveParticle, Sphere"); if (Object.op_Implicit((Object)(object)val2)) { val2.localScale = Vector3.one * defaultTeleParticleRadius * num; } } } internal static float GetAmbientLevelBoost() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_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_0025: 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_0029: 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_0042: Expected I4, but got Unknown //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Invalid comparison between Unknown and I4 //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) float result = 0f; if (!useAmbientLevel) { return result; } DifficultyIndex selectedDifficulty = Run.instance.selectedDifficulty; DifficultyIndex val = selectedDifficulty; DifficultyIndex val2 = val; switch (val2 - -1) { default: if ((int)val2 != 11) { result = ((selectedDifficulty < eclipseLevelVeryHard) ? monsoonDifficultyBoost : eclipseDifficultyBoost); } break; case 3: result = monsoonDifficultyBoost; break; case 2: result = rainstormDifficultyBoost; break; case 1: result = drizzleDifficultyBoost; break; case 0: break; } return result; } private void AmbientLevelDifficulty() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Expected O, but got Unknown useAmbientLevel = true; Run.ambientLevelCap = ambientLevelCap; Run.RecalculateDifficultyCoefficentInternal += new hook_RecalculateDifficultyCoefficentInternal(DifficultyCoefficientChanges); DirectorMoneyWave.Update += new Manipulator(DirectorCreditGainChanges); } private void DirectorCreditGainChanges(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0051: 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_014d: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); float num5 = default(float); val.GotoNext((MoveType)2, new Func<Instruction, bool>[1] { (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, ref num5) }); int index = val.Index; val.Index = index - 1; val.Remove(); val.Emit(OpCodes.Ldc_R4, 1f - playerSpawnRateFactor); float num4 = default(float); val.GotoNext((MoveType)2, new Func<Instruction, bool>[1] { (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, ref num4) }); index = val.Index; val.Index = index - 1; val.Remove(); val.Emit(OpCodes.Ldc_R4, playerSpawnRateFactor); float num3 = default(float); int num2 = default(int); float num = default(float); val.GotoNext((MoveType)2, new Func<Instruction, bool>[3] { (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, ref num3), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref num2), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, ref num) }); index = val.Index; val.Index = index - 1; val.Remove(); val.Emit(OpCodes.Ldc_R4, difficultySpawnRateFactor); } private void AmbientLevelChanges(ILContext il) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: 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_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); int timeLoc = 2; int num = 2; float num5 = default(float); val.GotoNext((MoveType)2, new Func<Instruction, bool>[4] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref timeLoc), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, ref num5), (Instruction x) => ILPatternMatchingExt.MatchMul(x), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Mathf>(x, "Floor") }); int index = val.Index; val.Index = index - 1; val.Emit(OpCodes.Ldc_R4, baseScalingMultiplier); val.Emit(OpCodes.Mul); float num4 = default(float); val.GotoNext((MoveType)0, new Func<Instruction, bool>[3] { (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, ref num4), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdfld<Run>(x, "stageClearCount") }); val.Remove(); val.Emit(OpCodes.Ldc_R4, difficultyIncreasePerStage); float num3 = default(float); val.GotoNext((MoveType)2, new Func<Instruction, bool>[3] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref timeLoc), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, ref num3), (Instruction x) => ILPatternMatchingExt.MatchMul(x) }); val.Emit(OpCodes.Ldc_R4, baseScalingMultiplier); val.Emit(OpCodes.Mul); float num2 = default(float); val.GotoNext((MoveType)0, new Func<Instruction, bool>[3] { (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, ref num2), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdfld<Run>(x, "stageClearCount") }); val.Remove(); val.Emit(OpCodes.Ldc_R4, difficultyIncreasePerStage); val.GotoNext((MoveType)0, new Func<Instruction, bool>[1] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld<Run>(x, "ambientLevelCap") }); val.EmitDelegate<Func<float, float>>((Func<float, float>)delegate(float levelIn) { float ambientLevelBoost = GetAmbientLevelBoost(); return levelIn + ambientLevelBoost; }); } private void DifficultyCoefficientChanges(orig_RecalculateDifficultyCoefficentInternal orig, Run self) { //IL_000f: 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) DifficultyDef difficultyDef = DifficultyCatalog.GetDifficultyDef(self.selectedDifficulty); float num = difficultyDef.scalingValue; if (self.selectedDifficulty >= eclipseLevelVeryHard) { num += 1f; } float num2 = self.GetRunStopwatch() * (1f / 60f); float num3 = 0.0506f * baseScalingMultiplier; float num4 = GetTimeDifficultyFactor(num2, num); float num5 = GetStageDifficultyFactor(self.stageClearCount); float num6 = 1f + playerBaseDifficultyFactor * (float)(self.participatingPlayerCount - 1); float num7 = Mathf.Pow((float)self.participatingPlayerCount, playerScalingDifficultyFactor); float num8 = num3 * num * num7; float num9 = (num6 + num8 * num2) * num4 * num5; self.difficultyCoefficient = num9; self.compensatedDifficultyCoefficient = num9; self.oneOverCompensatedDifficultyCoefficientSquared = 1f / (self.compensatedDifficultyCoefficient * self.compensatedDifficultyCoefficient); self.ambientLevel = Mathf.Min(1f + GetAmbientLevelBoost() + 3f * (num9 - num6), (float)Run.ambientLevelCap); int ambientLevelFloor = self.ambientLevelFloor; self.ambientLevelFloor = Mathf.FloorToInt(self.ambientLevel); if (ambientLevelFloor != self.ambientLevelFloor && ambientLevelFloor != 0 && self.ambientLevelFloor > ambientLevelFloor) { self.OnAmbientLevelUp(); } float GetStageDifficultyFactor(int stageClearCount) { float num10 = Mathf.Pow(difficultyIncreasePerStage, (float)stageClearCount); int num11 = Mathf.FloorToInt((float)self.stageClearCount / 5f); if (self.stageClearCount % 5 <= 1 && Object.op_Implicit((Object)(object)Stage.instance) && SceneCatalog.GetSceneDefForCurrentScene().isFinalStage) { num11--; } float num12 = Mathf.Pow(difficultyIncreasePerLoop, (float)num11); return num10 * num12; } static float GetTimeDifficultyFactor(float timeInMinutes, float scalingValue) { return Mathf.Pow(difficultyIncreasePerMinuteBase + difficultyIncreasePerMinutePerDifficulty * scalingValue, timeInMinutes); } } private void MonsoonStatBoost() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown monsoonDesc += "\n>Enemies gain <style=cIsHealth>unique scaling</style></style>"; RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(MonsoonPlusStatBuffs2); } private void MonsoonPlusStatBuffs2(CharacterBody sender, StatHookEventArgs args) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: 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_001e: Invalid comparison between Unknown and I4 //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Invalid comparison between Unknown and I4 DifficultyIndex selectedDifficulty = Run.instance.selectedDifficulty; float ambientLevelBoost = GetAmbientLevelBoost(); if ((int)sender.teamComponent.teamIndex != 1 && (int)selectedDifficulty >= 2) { float num = sender.level - ambientLevelBoost; if (sender.baseNameToken != "JELLYFISH_BODY_NAME") { args.attackSpeedMultAdd += Mathf.Clamp01(num / 200f) * 9f; } if (sender.isChampion) { args.armorAdd += 3f * num; } else { args.moveSpeedMultAdd += Mathf.Clamp01(num / 200f) * 3f; } } } private void EclipseChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Expected O, but got Unknown //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Expected O, but got Unknown //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Expected O, but got Unknown //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Expected O, but got Unknown CharacterMaster.OnBodyStart += new Manipulator(RemoveEclipseEffect); GlobalEventManager.OnCharacterHitGroundServer += new Manipulator(RemoveEclipseEffect); HealthComponent.Heal += new Manipulator(RemoveEclipseEffect); DeathRewards.OnKilledServer += new Manipulator(RemoveEclipseEffect); HealthComponent.TakeDamageProcess += new Manipulator(RemoveEclipseEffect); CharacterBody.RecalculateStats += new Manipulator(RemoveEclipseStats); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(EclipseStatBuffs); CharacterBody.RecalculateStats += new hook_RecalculateStats(EclipseCdr); RunArtifactManager.SetArtifactEnabled += new hook_SetArtifactEnabled(EclipseSpiteArtifact); HoldoutZoneController.DoUpdate += new Manipulator(EclipseHoldoutScale); HoldoutZoneController.Start += new hook_Start(EclipseHoldoutDischarge); string text = "\"You only celebrate in the light... because I allow it.\" \n\n"; string text2 = "Starts at baseline Monsoon difficulty.<style=cSub>\n"; string text3 = "</style>"; LanguageAPI.Add("ECLIPSE_1_DESCRIPTION", text2 + eclipseOneDesc + text3); LanguageAPI.Add("ECLIPSE_2_DESCRIPTION", text2 + eclipseOneDesc + eclipseTwoDesc + text3); LanguageAPI.Add("ECLIPSE_3_DESCRIPTION", text2 + eclipseOneDesc + eclipseTwoDesc + eclipseThreeDesc + text3); LanguageAPI.Add("ECLIPSE_4_DESCRIPTION", text2 + eclipseOneDesc + eclipseTwoDesc + eclipseThreeDesc + eclipseFourDesc + text3); LanguageAPI.Add("ECLIPSE_5_DESCRIPTION", text2 + eclipseOneDesc + eclipseTwoDesc + eclipseThreeDesc + eclipseFourDesc + eclipseFiveDesc + text3); LanguageAPI.Add("ECLIPSE_6_DESCRIPTION", text2 + eclipseOneDesc + eclipseTwoDesc + eclipseThreeDesc + eclipseFourDesc + eclipseFiveDesc + eclipseSixDesc + text3); LanguageAPI.Add("ECLIPSE_7_DESCRIPTION", text2 + eclipseOneDesc + eclipseTwoDesc + eclipseThreeDesc + eclipseFourDesc + eclipseFiveDesc + eclipseSixDesc + eclipseSevenDesc + text3); LanguageAPI.Add("ECLIPSE_8_DESCRIPTION", text + text2 + eclipseOneDesc + eclipseTwoDesc + eclipseThreeDesc + eclipseFourDesc + eclipseFiveDesc + eclipseSixDesc + eclipseSevenDesc + eclipseEightDesc + text3); } private void EclipseCdr(orig_RecalculateStats orig, CharacterBody self) { //IL_000e: 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_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Invalid comparison between Unknown and I4 //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); DifficultyIndex selectedDifficulty = Run.instance.selectedDifficulty; if ((int)self.teamComponent.teamIndex != 1 && selectedDifficulty >= eclipseLevelEnemyCdr) { float cooldownScale = 1f - eclipseEnemyCdr; SkillLocator skillLocator = self.skillLocator; if ((Object)(object)skillLocator != (Object)null) { StatHooks.ApplyCooldownScale(skillLocator.primary, cooldownScale); StatHooks.ApplyCooldownScale(skillLocator.secondary, cooldownScale); StatHooks.ApplyCooldownScale(skillLocator.utility, cooldownScale); StatHooks.ApplyCooldownScale(skillLocator.special, cooldownScale); } } } private void RemoveEclipseStats(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0082: 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) ILCursor val = new ILCursor(il); val.GotoNext((MoveType)2, new Func<Instruction, bool>[1] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Run>(x, "get_selectedDifficulty") }); val.Emit(OpCodes.Pop); val.Emit(OpCodes.Ldc_I4, -1); val.GotoNext((MoveType)2, new Func<Instruction, bool>[1] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Run>(x, "get_selectedDifficulty") }); val.Emit(OpCodes.Pop); val.Emit(OpCodes.Ldc_I4, -1); } private void RemoveEclipseEffect(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); val.GotoNext((MoveType)2, new Func<Instruction, bool>[1] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Run>(x, "get_selectedDifficulty") }); val.Emit(OpCodes.Pop); val.Emit(OpCodes.Ldc_I4, -1); } private void EclipseHoldoutDischarge(orig_Start orig, HoldoutZoneController self) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) if (Run.instance.selectedDifficulty >= eclipseLevelHoldoutLoss) { self.dischargeRate = Mathf.Max(self.dischargeRate, eclipseHoldoutLossRate); } orig.Invoke(self); } private void EclipseHoldoutScale(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0075: 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_0084: Expected I4, but got Unknown ILCursor val = new ILCursor(il); int num = 3; int num2 = default(int); val.GotoNext((MoveType)2, new Func<Instruction, bool>[2] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Run>(x, "get_selectedDifficulty"), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, ref num2) }); int index = val.Index; val.Index = index - 1; val.Remove(); val.Emit(OpCodes.Ldc_I4, (int)eclipseLevelSmallHoldout); } private void EclipseSpiteArtifact(orig_SetArtifactEnabled orig, RunArtifactManager self, ArtifactDef artifactDef, bool newEnabled) { //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) if ((Object)(object)Run.instance == (Object)null) { orig.Invoke(self, artifactDef, newEnabled); return; } if (Run.instance.selectedDifficulty >= eclipseLevelSpiteArtifact && (Object)(object)artifactDef == (Object)(object)Artifacts.bombArtifactDef) { newEnabled = true; } orig.Invoke(self, artifactDef, newEnabled); } private void EclipseStatBuffs(CharacterBody sender, StatHookEventArgs args) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: 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_0018: Invalid comparison between Unknown and I4 //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Invalid comparison between Unknown and I4 //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: 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_0062: 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_007c: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) DifficultyIndex selectedDifficulty = Run.instance.selectedDifficulty; if ((int)sender.teamComponent.teamIndex != 1) { if (selectedDifficulty < eclipseLevelBossShield) { return; } if (sender.isBoss) { args.baseShieldAdd += sender.maxHealth * eclipseBossShieldFraction; } if (selectedDifficulty < eclipseLevelEnemyCdr || selectedDifficulty < eclipseLevelEnemyMspd) { return; } args.moveSpeedMultAdd += eclipseEnemyMspd; } if ((int)sender.teamComponent.teamIndex == 1 && selectedDifficulty >= eclipseLevelPlayerDegen) { args.baseRegenAdd -= (sender.baseRegen + sender.levelRegen * sender.level) * (eclipsePlayerDegen * sender.level); } } private void VoidFieldsStageType() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) SceneDef val = Addressables.LoadAssetAsync<SceneDef>((object)"RoR2/Base/arena/arena.asset").WaitForCompletion(); val.sceneType = (SceneType)2; } private void VoidFieldsTimeCost() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown WardOnAndReady.OnExit += new hook_OnExit(AddVoidFieldsTimeCost); } private void AddVoidFieldsTimeCost(orig_OnExit orig, WardOnAndReady self) { orig.Invoke(self); Run.instance.SetRunStopwatch(Run.instance.GetRunStopwatch() + voidFieldsTimeCost); } private void ChangeDirectorStats() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: 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_008d: 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) GameObject val = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Common/Director.prefab").WaitForCompletion(); CombatDirector[] components = val.GetComponents<CombatDirector>(); if (components.Length != 0) { CombatDirector val2 = components[0]; if ((Object)(object)val2 != (Object)null) { val2.eliteBias = fastDirectorEliteBias; val2.eliteBias = fastDirectorCreditMultiplier; } CombatDirector val3 = components[1]; if ((Object)(object)val3 != (Object)null) { val3.eliteBias = slowDirectorEliteBias; val3.eliteBias = slowDirectorCreditMultiplier; } } GameObject val4 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Common/Director.prefab").WaitForCompletion(); GameObject val5 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Common/Director.prefab").WaitForCompletion(); AdjustTeleporterDirectors(val4.GetComponents<CombatDirector>()); AdjustTeleporterDirectors(val5.GetComponents<CombatDirector>()); static void AdjustTeleporterDirectors(CombatDirector[] directors) { if (directors != null && directors.Length != 0) { foreach (CombatDirector val6 in directors) { if (val6.customName == "Boss") { val6.eliteBias = teleBossEliteBias; val6.creditMultiplier = teleBossCreditMultiplier; } if (val6.customName == "Monsters") { val6.eliteBias = teleLesserEliteBias; val6.creditMultiplier = teleLesserCreditMultiplier; } } } } } public void AddTpBossWeaken() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown ChargingState.FixedUpdate += new hook_FixedUpdate(WeakenBossPostTpCharge); } private void WeakenBossPostTpCharge(orig_FixedUpdate orig, BaseState baseState) { //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0095: 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_00bf: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(baseState); if (!NetworkServer.active) { return; } ChargingState val = (ChargingState)(object)((baseState is ChargingState) ? baseState : null); if (((BaseTeleporterState)val).teleporterInteraction.holdoutZoneController.charge >= 1f) { if (wasTpCharged) { return; } wasTpCharged = true; if (((BaseTeleporterState)val).teleporterInteraction.monstersCleared) { return; } BossGroup bossGroup = ((BaseTeleporterState)val).teleporterInteraction.bossGroup; BossMemory[] bossMemories = bossGroup.bossMemories; foreach (BossMemory val2 in bossMemories) { CharacterBody val3 = val2.cachedBody; if ((Object)(object)val3 == (Object)null && (Object)(object)val2.cachedMaster != (Object)null) { val3 = val2.cachedMaster.GetBody(); } if ((Object)(object)val3 != (Object)null) { val3.AddTimedBuff(Buffs.Cripple, 9999f); } } } else { wasTpCharged = false; } } private void FixMoneyScaling() { ChestRebalance(); ChestCostScaling(); EnemyRewards(); } private void ChestCostScaling() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_0094: 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_00cf: 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) Run.GetDifficultyScaledCost_int_float += new hook_GetDifficultyScaledCost_int_float(ChangeScaledCost); awuBody = awu.GetComponent<CharacterBody>(); if (!Object.op_Implicit((Object)(object)awuBody)) { return; } awuBody.baseArmor = awuArmor; if (awuAdaptiveArmorCount <= 0) { CharacterBody obj = awuBody; obj.armor += awuAdditionalArmor; return; } GivePickupsOnStart val = ((Component)awuBody).gameObject.AddComponent<GivePickupsOnStart>(); if (Object.op_Implicit((Object)(object)val)) { ItemInfo val2 = default(ItemInfo); val2.count = awuAdaptiveArmorCount; val2.itemString = Addressables.LoadAssetAsync<ItemDef>((object)"RoR2/Base/AdaptiveArmor/AdaptiveArmor.asset").WaitForCompletion().nameToken; val.itemInfos = (ItemInfo[])(object)new ItemInfo[1] { val2 }; } } private void GoldShrineRework() { //IL_0046: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)goldShrine == (Object)null) { Debug.Log((object)"goldshrine null!! uh oh!!!!"); return; } PurchaseInteraction component = goldShrine.GetComponent<PurchaseInteraction>(); if ((Object)(object)component == (Object)null) { Debug.Log((object)"goldshrine purchase thing null bwuh"); return; } component.costType = (CostTypeIndex)3; component.cost = goldShrineCost; } private void BloodShrineRewardRework() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown ShrineBloodBehavior.Start += new hook_Start(ShrineBloodBehavior_Start); } private void ShrineBloodBehavior_Start(orig_Start orig, ShrineBloodBehavior self) { orig.Invoke(self); if (NetworkServer.active) { ((MonoBehaviour)this).StartCoroutine(WaitForPlayerBody(self)); } } private IEnumerator WaitForPlayerBody(ShrineBloodBehavior instance) { yield return (object
SwanSongExtended.dll
Decompiled 2 weeks ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using BetterSoulCost; using BossDropRework; using ChillRework; using EntityStates; using EntityStates.AI.Walker; using EntityStates.Bandit2; using EntityStates.BrotherMonster.Weapon; using EntityStates.Captain.Weapon; using EntityStates.CaptainSupplyDrop; using EntityStates.Engi.EngiMissilePainter; using EntityStates.GrandParent; using EntityStates.Huntress.HuntressWeapon; using EntityStates.Loader; using EntityStates.Mage.Weapon; using EntityStates.Missions.BrotherEncounter; using EntityStates.MoonElevator; using EntityStates.NullifierMonster; using EntityStates.TeleporterHealNovaController; using HG; using HG.BlendableTypes; using HarmonyLib; using IL.RoR2; using IL.RoR2.Items; using IL.RoR2.Orbs; using KinematicCharacterController; using MissileRework; using Mono.Cecil; using Mono.Cecil.Cil; using MonoMod.Cil; using MonoMod.RuntimeDetour; using MoreStats; using On.EntityStates.Captain.Weapon; using On.EntityStates.Engi.EngiMissilePainter; using On.EntityStates.Mage.Weapon; using On.EntityStates.Missions.BrotherEncounter; using On.EntityStates.TeleporterHealNovaController; using On.RoR2; using On.RoR2.Items; using On.RoR2.Orbs; using R2API; using R2API.Utils; using RainrotSharedUtils.Components; using RoR2; using RoR2.Achievements; using RoR2.Artifacts; using RoR2.Audio; using RoR2.CharacterAI; using RoR2.ContentManagement; using RoR2.EntitlementManagement; using RoR2.ExpansionManagement; using RoR2.Hologram; using RoR2.Navigation; using RoR2.Networking; using RoR2.Orbs; using RoR2.Projectile; using RoR2.Skills; using RoR2.UI; using SwanSongExtended.Artifacts; using SwanSongExtended.Characters; using SwanSongExtended.Components; using SwanSongExtended.Elites; using SwanSongExtended.Equipment; using SwanSongExtended.Equipment.Zapinator; using SwanSongExtended.Interactables; using SwanSongExtended.Items; using SwanSongExtended.Modules; using SwanSongExtended.Orbs; using SwanSongExtended.Scavengers; using SwanSongExtended.Skills; using SwanSongExtended.States; using SwanSongExtended.States.Captain; using SwanSongExtended.States.Huntress; using SwanSongExtended.States.Loader; using ThreeEyedGames; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.Rendering; using UnityEngine.SceneManagement; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")] [assembly: AssemblyCompany("SwanSongExtended")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("SwanSongExtended")] [assembly: AssemblyTitle("SwanSongExtended")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: UnverifiableCode] namespace RiskierRainContent.Interactables { internal static class CombatEncounterHelper { public enum CustomDirectorType { GalleryDirector = 1, ConstructDirector } public static GameObject MethodOne(PurchaseInteraction purchaseInteraction, Interactor activator, int credits, CustomDirectorType directorType) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //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_002e: 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_0057: 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_00db: 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_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: 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_00f1: Expected O, but got Unknown Vector3 val = Vector3.zero; Quaternion rotation = Quaternion.identity; Transform transform = ((Component)purchaseInteraction).gameObject.transform; if (Object.op_Implicit((Object)(object)transform)) { val = transform.position; rotation = transform.rotation; } GameObject val2 = LegacyResourcesAPI.Load<GameObject>("Prefabs/NetworkedObjects/Encounters/MonstersOnShrineUseEncounter"); if ((Object)(object)val2 == (Object)null) { return null; } GameObject val3 = Object.Instantiate<GameObject>(val2, val, Quaternion.identity); NetworkServer.Spawn(val3); CombatDirector component = val3.GetComponent<CombatDirector>(); ParseDirectorType(((Component)component).gameObject, directorType); if (!Object.op_Implicit((Object)(object)component) || !Object.op_Implicit((Object)(object)Stage.instance)) { return null; } float num = (float)credits * Stage.instance.entryDifficultyCoefficient; DirectorCard val4 = component.SelectMonsterCardForCombatShrine(num); if (val4 != null) { component.CombatShrineActivation(activator, num, val4); EffectData val5 = new EffectData { origin = val, rotation = rotation }; if (directorType == CustomDirectorType.ConstructDirector) { GameObject val6 = LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/MonstersOnShrineUse"); EffectManager.SpawnEffect(val6, val5, true); } } return val3; } public static void ParseDirectorType(GameObject obj, CustomDirectorType value) { switch (value) { case CustomDirectorType.GalleryDirector: obj.AddComponent<GalleryDirector>(); break; case CustomDirectorType.ConstructDirector: obj.AddComponent<ConstructDirector>(); break; default: obj.AddComponent<GalleryDirector>(); break; } } } internal class GalleryDirector : MonoBehaviour { } internal class ConstructDirector : MonoBehaviour { } } namespace SwanSongExtended { [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] [R2APISubmoduleDependency(new string[] { "LanguageAPI", "PrefabAPI", "RecalculateStatsAPI", "DotAPI" })] [BepInPlugin("com.RiskOfBrainrot.SwanSongExtended", "SwanSongExtended", "1.0.0")] public class SwanSongPlugin : BaseUnityPlugin { public static int ignitionTankBurnChance = 15; public float ignitionBurnDamage = 2f; public float ignitionBurnDuration = 2f; private bool shouldIgnitionDamageAndDurationCompound = false; public static int stacheBurnChance = 25; public static int brandBurnChance = 30; public static GameObject massPillar = Resources.Load<GameObject>("prefabs/networkedobjects/MoonBatteryMass"); public static GameObject designPillar = Resources.Load<GameObject>("prefabs/networkedobjects/MoonBatteryDesign"); public static GameObject bloodPillar = Resources.Load<GameObject>("prefabs/networkedobjects/MoonBatteryBlood"); public static GameObject soulPillar = Resources.Load<GameObject>("prefabs/networkedobjects/MoonBatterySoul"); public static float pillarDropOffset = 2.5f; public static float pillarDropForce = 20f; public static int baseRewardCount = 1; public static bool scaleRewardsByPlayerCount = true; public static int brittleCrownStealCountBase = 2; public static int brittleCrownStealCountStack = 1; public static float crownCommonStealSoulCost = 0.25f; public static float crownUncommonStealSoulCost = 0.5f; public static float crownRareStealSoulCost = 0.8f; private string common = Tools.ConvertDecimal(crownCommonStealSoulCost); private string uncommon = Tools.ConvertDecimal(crownUncommonStealSoulCost); private string rare = Tools.ConvertDecimal(crownRareStealSoulCost); public static float cooldown = 90f; public static float secondsPerCost = 0.5f; public static float foconMinRadius = 8f; public static float foconRadiusMultiplier = 0.5f; public static float foconChargeBonus = 1f; public static int foconMaxStack = 5; public static List<EquipmentIndex> gestureBreakBlacklist = new List<EquipmentIndex>(); public static float gestureEquipBreakChance = 40f; public static int gestureStockBase = 4; public static int gestureStockStack = 2; public static float gestureCdiBase = 1f; public static float gestureCdiStack = 0.5f; public static float hauntExecutionThreshold = 0.25f; private float ghostSpawnChanceOnExecute = 100f; private float ghostDurationPerStack = 6.66f; public static float harpoonBarrierBase = 5f; public static float harpoonBarrierStack = 5f; public static float harpoonTargetTime = 15f; public static Material harpoonTargetMaterial; public int scopeBaseCrit = 5; public int scopeStackCrit = 0; public int scopeBaseStationaryCrit = 40; public int scopeStackStationaryCrit = 0; public static ItemDef seedItemDef; public static float seedRegenDurationBase = 0.25f; public static float seedRegenDurationStack = 0.25f; public static float sunDurationBase = 10f; public static float sunDurationStack = 5f; private static float razorwireArmorBase = 8f; private static float razorwireArmorStack = 8f; private static float razorwireRangeBase = 40f; private static float razorwireRangeStack = 0f; private static float razorwireTargetsBase = 5f; private static float razorwireTargetsStack = 2f; private static float razorwireBleedDuration = 5f; private static float razorwireDamage = 3.6f; private static float razorwireProcCoeff = 0.2f; private static float razorwireCooldown = 1f; public static GameObject StormsRunBehaviorPrefab; public static GameObject StormsControllerPrefab; public static EliteTierDef StormT1; public static EliteTierDef StormT2; public static SpawnCard exploderCard = Resources.Load<SpawnCard>("spawncards/characterspawncards/cscLunarExploder"); private List<DirectorCard> exploderCards = new List<DirectorCard>(); public static ExploderDirector exploderDirector; internal static float phaseTwoRate = 0f; internal static float phaseThreeRate = 1f; public const string guid = "com.RiskOfBrainrot.SwanSongExtended"; public const string teamName = "RiskOfBrainrot"; public const string modName = "SwanSongExtended"; public const string version = "1.0.0"; public const string expansionName = "Swan Song"; public const string expansionName2 = "Secrets of the Scug"; public const string expansionToken = "EXPANSION2R4R"; public const string expansionToken2 = "EXPANSIONSOTS"; public const string DEVELOPER_PREFIX = "FRUIT"; public static SwanSongPlugin instance; public static ExpansionDef expansionDefSS2; public static ExpansionDef expansionDefSOTS; public const string iconsPath = ""; private BuffDef brittleCrownBuff => CommonAssets.brittleCrownCursePurchase; private GameObject meatballNapalmPool => CommonAssets.meatballNapalmPool; public static AssetBundle mainAssetBundle => CommonAssets.mainAssetBundle; public static AssetBundle orangeAssetBundle => CommonAssets.orangeAssetBundle; public static bool iabMissilesLoaded => ModLoaded("com.HouseOfFruits.IAmBecomeMissiles"); public static bool isAELoaded => ModLoaded("com.Borbo.ArtificerExtended"); public static bool is2R4RLoaded => ModLoaded("com.HouseOfFruits.RiskierRain"); public static bool isHBULoaded => ModLoaded("com.Borbo.HuntressBuffULTIMATE"); public static bool isScepterLoaded => ModLoaded("com.DestroyedClone.AncientScepter"); public static bool autosprintLoaded => ModLoaded("com.johnedwa.RTAutoSprintEx"); public static bool acridLungeLoaded => ModLoaded("Withor.AcridBiteLunge"); public static bool ucrLoaded => ModLoaded("HIFU.UltimateCustomRun"); private void BurnReworks() { IgnitionTankRework(); } private void IgnitionTankRework() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown StatHooks.GetMoreStatCoefficients += new MoreStatHookEventHandler(IgniTankBurnChance); StrengthenBurnUtils.CheckDotForUpgrade += new hook_CheckDotForUpgrade(OverrideIgnitionBurn); LanguageAPI.Add("ITEM_STRENGTHENBURN_PICKUP", "Your ignite effects deal triple damage."); LanguageAPI.Add("ITEM_STRENGTHENBURN_DESC", $"Gain <style=cIsDamage>{ignitionTankBurnChance}% ignite chance</style>. " + "All ignition effects deal <style=cIsDamage>+" + Tools.ConvertDecimal(ignitionBurnDamage) + "</style> <style=cStack>(+" + Tools.ConvertDecimal(ignitionBurnDamage) + " per stack)</style> more damage and last <style=cIsUtility>+" + Tools.ConvertDecimal(ignitionBurnDuration) + "</style> <style=cStack>(+" + Tools.ConvertDecimal(ignitionBurnDuration) + " per stack)</style> longer."); } private void IgniTankBurnChance(CharacterBody sender, MoreStatHookEventArgs args) { Inventory inventory = sender.inventory; if (Object.op_Implicit((Object)(object)inventory) && inventory.GetItemCount(Items.StrengthenBurn) > 0) { args.burnChanceOnHit += (float)ignitionTankBurnChance; } } private void OverrideIgnitionBurn(orig_CheckDotForUpgrade orig, Inventory inventory, ref InflictDotInfo dotInfo) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Invalid comparison between Unknown and I4 //IL_0038: 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) if ((int)dotInfo.dotIndex != 1 && (int)dotInfo.dotIndex != 2) { return; } int itemCount = inventory.GetItemCount(Items.StrengthenBurn); if (itemCount > 0) { dotInfo.preUpgradeDotIndex = dotInfo.dotIndex; dotInfo.dotIndex = (DotIndex)7; float num = 1f + ignitionBurnDamage * (float)itemCount; float num2 = 1f + ignitionBurnDuration * (float)itemCount; if (shouldIgnitionDamageAndDurationCompound) { dotInfo.totalDamage *= num * num2; dotInfo.damageMultiplier *= num; } else { dotInfo.totalDamage *= num; dotInfo.damageMultiplier *= num / num2; } } } public static int GetBurnCount(CharacterBody victimBody) { return victimBody.GetBuffCount(Buffs.OnFire) + victimBody.GetBuffCount(Buffs.StrongerBurn); } private void MakePillarsFun() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown MoonBatteryMissionController.OnBatteryCharged += new hook_OnBatteryCharged(PillarsDropItems); MoonBatteryMissionController.Awake += new hook_Awake(ReduceRequiredPillars); } private void ReduceRequiredPillars(orig_Awake orig, MoonBatteryMissionController self) { orig.Invoke(self); self._numRequiredBatteries = 2; } private void PillarsDropItems(orig_OnBatteryCharged orig, MoonBatteryMissionController self, HoldoutZoneController holdoutZone) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: 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_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_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //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_00a3: 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_00b2: 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_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_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_00d7: 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_00d9: 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_00e9: 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_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Expected O, but got Unknown int participatingPlayerCount = Run.instance.participatingPlayerCount; Vector3 val = ((Component)holdoutZone).gameObject.transform.position + Vector3.up * pillarDropOffset; if (participatingPlayerCount != 0) { PickupIndex pickupIndexFromPillarType = GetPickupIndexFromPillarType(((Component)holdoutZone).gameObject); if (pickupIndexFromPillarType != PickupIndex.none) { int num = baseRewardCount; if (scaleRewardsByPlayerCount) { num *= participatingPlayerCount; } float num2 = 360f / (float)num; Vector3 val2 = Quaternion.AngleAxis((float)Random.Range(0, 360), Vector3.up) * (Vector3.up * pillarDropForce + Vector3.forward * 5f); Quaternion val3 = Quaternion.AngleAxis(num2, Vector3.up); int num3 = 0; while (num3 < num) { PickupDropletController.CreatePickupDroplet(pickupIndexFromPillarType, val, val2); num3++; val2 = val3 * val2; } } } self.Network_numChargedBatteries = self._numChargedBatteries + 1; if (self._numChargedBatteries < self._numRequiredBatteries || !NetworkServer.active) { return; } for (int i = 0; i < self.batteryHoldoutZones.Length; i++) { if (((Behaviour)self.batteryHoldoutZones[i]).enabled) { self.batteryHoldoutZones[i].FullyChargeHoldoutZone(); ((UnityEvent<HoldoutZoneController>)(object)self.batteryHoldoutZones[i].onCharged).RemoveListener((UnityAction<HoldoutZoneController>)self.OnBatteryCharged); } } for (int j = 0; j < self.elevatorStateMachines.Length; j++) { self.elevatorStateMachines[j].SetNextState((EntityState)new InactiveToReady()); } } public static PickupIndex GetPickupIndexFromPillarType(GameObject pillar) { //IL_00a0: 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_0083: 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_008a: 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_0091: 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) ItemBase itemBase = null; string name = ((Object)pillar).name; switch (name.Substring(11, 4)) { case "Mass": itemBase = ItemBase<MassAnomaly>.instance; break; case "Desi": itemBase = ItemBase<DesignAnomaly>.instance; break; case "Bloo": itemBase = ItemBase<BloodAnomaly>.instance; break; case "Soul": itemBase = ItemBase<SoulAnomaly>.instance; break; } if (itemBase != null) { ItemIndex itemIndex = itemBase.ItemsDef.itemIndex; return PickupCatalog.FindPickupIndex(itemIndex); } Debug.Log((object)"No pickup index found!"); return PickupIndex.none; } public void BrittleCrownChanges() { //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Expected O, but got Unknown //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Expected O, but got Unknown //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Expected O, but got Unknown //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Expected O, but got Unknown LanguageAPI.Add("ITEM_GOLDONHIT_NAME", "Sunken Crown"); LanguageAPI.Add("ITEM_GOLDONHIT_PICKUP", "Steal from chests... " + Language.Styling.HealthColor("at the cost of health.")); LanguageAPI.Add("ITEM_GOLDONHIT_DESC", "Allows interacting with chests without the ability to afford them, opening the chest " + Language.Styling.UtilityColor("without spending ANY money") + ". Stealing from chests costs " + Language.Styling.HealthColor("[ " + common + " / " + uncommon + " / " + rare + " ]") + " of your " + Language.Styling.HealthColor("maximum health") + ", depending on the size of the chest. " + $"Can steal up to {brittleCrownStealCountBase} {Language.Styling.StackText($"+{brittleCrownStealCountStack}")} times per stage."); HealthComponent.TakeDamageProcess += new Manipulator(RemoveCrownPenalty); GlobalEventManager.ProcessHitEnemy += new Manipulator(RemoveCrownReward); PurchaseInteraction.CanBeAffordedByInteractor += new hook_CanBeAffordedByInteractor(PurchaseInteraction_CanBeAffordedByInteractor); CharacterBody.OnInventoryChanged += new hook_OnInventoryChanged(AddBrittleCrownBehavior); } private void AddBrittleCrownBehavior(orig_OnInventoryChanged orig, CharacterBody self) { orig.Invoke(self); if (NetworkServer.active) { self.AddItemBehavior<BrittleCrownBehavior>(self.inventory.GetItemCount(Items.GoldOnHit)); } } private void RemoveCrownReward(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //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) ILCursor val = new ILCursor(il); val.GotoNext((MoveType)2, new Func<Instruction, bool>[2] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.RoR2Content/Items", "GoldOnHit"), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Inventory>(x, "GetItemCount") }); val.Emit(OpCodes.Pop); val.Emit(OpCodes.Ldc_I4, 0); } private void RemoveCrownPenalty(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); val.GotoNext((MoveType)2, new Func<Instruction, bool>[1] { (Instruction x) => ILPatternMatchingExt.MatchLdfld<ItemCounts>(x, "goldOnHit") }); val.Emit(OpCodes.Pop); val.Emit(OpCodes.Ldc_I4, 0); } private void CTCInit(orig_Init orig) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown orig.Invoke(); CostTypeDef costTypeDef = CostTypeCatalog.GetCostTypeDef((CostTypeIndex)1); MethodInfo method = ((Delegate)(object)costTypeDef.payCost).Method; ILHook val = new ILHook((MethodBase)method, new Manipulator(PatchMoneyCostForBrittleCrown)); } private void PatchMoneyCostForBrittleCrown(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0009: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); val.Emit(OpCodes.Ldarg_1); val.EmitDelegate<Action<PayCostContext>>((Action<PayCostContext>)delegate(PayCostContext ctx) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0010: 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_0029: Unknown result type (might be due to invalid IL or missing references) CharacterBody activatorBody = ctx.activatorBody; if (Object.op_Implicit((Object)(object)activatorBody) && Object.op_Implicit((Object)(object)ctx.activatorMaster) && ctx.activatorMaster.money < ctx.cost) { ctx.cost = 0; } }); } private bool PurchaseInteraction_CanBeAffordedByInteractor(orig_CanBeAffordedByInteractor orig, PurchaseInteraction self, Interactor activator) { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Invalid comparison between Unknown and I4 bool flag = orig.Invoke(self, activator); if (flag) { return flag; } CharacterBody val = null; if (((Component)activator).gameObject.TryGetComponent<CharacterBody>(ref val) && val.HasBuff(brittleCrownBuff) && (int)self.costType == 1 && self.saleStarCompatible && val.master.money < self.cost) { int num = 1; int difficultyScaledCost = Run.instance.GetDifficultyScaledCost(45, Stage.instance.entryDifficultyCoefficient); int difficultyScaledCost2 = Run.instance.GetDifficultyScaledCost(245, Stage.instance.entryDifficultyCoefficient); if (self.cost >= num && self.cost < difficultyScaledCost) { CounterfeitCalculations(val, crownCommonStealSoulCost); } else if (self.cost >= difficultyScaledCost && self.cost < difficultyScaledCost2) { CounterfeitCalculations(val, crownUncommonStealSoulCost); } else { CounterfeitCalculations(val, crownRareStealSoulCost); } flag = true; } return flag; } public void CounterfeitCalculations(CharacterBody activator, float soulCost) { SoulCostPlugin.AddSoulCostToBody(activator, soulCost); activator.AddBuff(Buffs.FreeUnlocks); Util.PlaySound("sfx_lunarmoney_start", ((Component)activator).gameObject); if (NetworkServer.active) { activator.RemoveBuff(brittleCrownBuff); } } public void ExecutiveCardChanges() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: 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: Expected O, but got Unknown //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Expected O, but got Unknown //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown EquipmentDef val = Addressables.LoadAssetAsync<EquipmentDef>((object)"RoR2/DLC1/MultiShopCard/MultiShopCard.asset").WaitForCompletion(); val.cooldown = cooldown; LanguageAPI.Add("EQUIPMENT_MULTISHOPCARD_PICKUP", "Hack a targeted interactable. Hacked Multishops remain open."); LanguageAPI.Add("EQUIPMENT_MULTISHOPCARD_DESC", "Target an interactable to <style=cIsUtility>hack</style> it, unlocking its contents for <style=cIsUtility>free</style>. If the target is a <style=cIsUtility>multishop</style> terminal, the other terminals will <style=cIsUtility>remain open</style>."); MultiShopCardUtils.OnPurchase += new Manipulator(FreezeCard); EquipmentSlot.UpdateTargets += new hook_UpdateTargets(CardTargetInteractables); EquipmentSlot.PerformEquipmentAction += new hook_PerformEquipmentAction(PerformEquipmentAction); } private void FreezeCard(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val = new ILCursor(il); val.GotoNext((MoveType)0, new Func<Instruction, bool>[1] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Inventory>(x, "get_currentEquipmentIndex") }); val.Remove(); val.EmitDelegate<Func<Inventory, int>>((Func<Inventory, int>)((Inventory inv) => -1)); } private bool PerformEquipmentAction(orig_PerformEquipmentAction orig, EquipmentSlot self, EquipmentDef equipmentDef) { if ((Object)(object)equipmentDef == (Object)(object)Equipment.MultiShopCard) { return ActivateEquipment(self); } return orig.Invoke(self, equipmentDef); static bool ActivateEquipment(EquipmentSlot slot) { bool result = false; GameObject rootObject = slot.currentTarget.rootObject; if ((Object)(object)rootObject != (Object)null) { PurchaseInteraction component = rootObject.GetComponent<PurchaseInteraction>(); if ((Object)(object)component != (Object)null && HackingMainState.PurchaseInteractionIsValidTarget(component)) { component.Networkcost = 0; ShopTerminalBehavior component2 = rootObject.GetComponent<ShopTerminalBehavior>(); if (Object.op_Implicit((Object)(object)component2)) { component2.serverMultiShopController.SetCloseOnTerminalPurchase(((Component)component).GetComponent<PurchaseInteraction>(), false); } CharacterBody characterBody = slot.characterBody; Interactor val = ((characterBody != null) ? ((Component)characterBody).GetComponent<Interactor>() : null); if (Object.op_Implicit((Object)(object)val)) { val.AttemptInteraction(rootObject); } slot.InvalidateCurrentTarget(); result = true; } } return result; } } private void CardTargetInteractables(orig_UpdateTargets orig, EquipmentSlot self, EquipmentIndex targetingEquipmentIndex, bool userShouldAnticipateTarget) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: 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_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_007b: 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_0163: Unknown result type (might be due to invalid IL or missing references) //IL_016f: 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_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0180: 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_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: 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_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: 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_00f7: 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_00ff: 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_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: 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_011d: 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_0128: Unknown result type (might be due to invalid IL or missing references) if (targetingEquipmentIndex != Equipment.MultiShopCard.equipmentIndex || !userShouldAnticipateTarget) { orig.Invoke(self, targetingEquipmentIndex, userShouldAnticipateTarget); return; } float num = 150f; float num2 = 10f; float num3 = Mathf.Cos(Mathf.Clamp(num2, 0f, 180f) * MathF.PI / 180f); float num4 = default(float); Ray val = CameraRigController.ModifyAimRayIfApplicable(self.GetAimRay(), ((Component)self.characterBody).gameObject, ref num4); Collider[] array = Physics.OverlapSphere(((Ray)(ref val)).origin, num + num4, -1, (QueryTriggerInteraction)2); bool flag = false; GameObject rootObject = self.currentTarget.rootObject; Vector3 val3; if ((Object)(object)rootObject != (Object)null) { PurchaseInteraction val2 = ((rootObject != null) ? rootObject.GetComponent<PurchaseInteraction>() : null); if ((Object)(object)val2 != (Object)null) { flag = HackingMainState.PurchaseInteractionIsValidTarget(val2) && val2.available; } Vector3 origin = ((Ray)(ref val)).origin; Vector3 position = rootObject.transform.position; if (flag) { val3 = position - origin; if (!(((Vector3)(ref val3)).sqrMagnitude > num * num)) { Vector3 direction = ((Ray)(ref val)).direction; val3 = position - origin; if (!(Vector3.Dot(direction, ((Vector3)(ref val3)).normalized) < num3)) { goto IL_0146; } } } self.InvalidateCurrentTarget(); } goto IL_0146; IL_0146: bool flag2 = false; PurchaseInteraction val4 = null; Collider[] array2 = array; foreach (Collider val5 in array2) { Vector3 direction2 = ((Ray)(ref val)).direction; val3 = ((Component)val5).transform.position - ((Ray)(ref val)).origin; float num5 = Vector3.Dot(direction2, ((Vector3)(ref val3)).normalized); if (num5 < num3) { continue; } Vector3 origin2 = ((Ray)(ref val)).origin; Vector3 position2 = ((Component)val5).transform.position; if (!HasLos(origin2, position2)) { continue; } EntityLocator component = ((Component)val5).GetComponent<EntityLocator>(); if (!Object.op_Implicit((Object)(object)component)) { continue; } PurchaseInteraction component2 = component.entity.GetComponent<PurchaseInteraction>(); if (Object.op_Implicit((Object)(object)component2)) { flag2 = HackingMainState.PurchaseInteractionIsValidTarget(component2); if (flag2) { flag2 = true; val4 = component2; break; } if ((Object)(object)val4 == (Object)null && component2.available) { val4 = component2; } } } if ((Object)(object)val4 != (Object)null) { if (flag2 && userShouldAnticipateTarget) { self.targetIndicator.visualizerPrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/RecyclerIndicator"); } else { self.targetIndicator.visualizerPrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/RecyclerBadIndicator"); } self.currentTarget = new UserTargetInfo { transformToIndicateAt = ((Component)val4).gameObject.transform, pickupController = null, hurtBox = null, rootObject = ((Component)val4).gameObject }; self.targetIndicator.active = true; self.targetIndicator.targetTransform = self.currentTarget.transformToIndicateAt; } else { self.InvalidateCurrentTarget(); self.targetIndicator.active = false; } } public bool HasLos(Vector3 origin, Vector3 targetPosition) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: 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) Vector3 val = targetPosition - origin; RaycastHit val2 = default(RaycastHit); return !Physics.Raycast(origin, val, ref val2, ((Vector3)(ref val)).magnitude - 1f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1); } private void FreezeCardf(orig_OnPurchase orig, PayCostContext context, int moneyCost) { } public void FocusedConvergenceChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown FocusConvergenceController.ApplyRadius += new hook_ApplyRadius(FoconNewRadius); FocusConvergenceController.ApplyRate += new Manipulator(FoconApplyRate); FocusConvergenceController.DoUpdate += new Manipulator(FoconUpdate); LanguageAPI.Add("ITEM_FOCUSEDCONVERGENCE_PICKUP", $"Increase the speed Holdout Zones charge... <color=#FF7F7F>BUT reduce the size of the zone</color>. Max of {foconMaxStack}."); LanguageAPI.Add("ITEM_FOCUSEDCONVERGENCE_DESC", "Holdout Zones charge <style=cIsUtility>" + Tools.ConvertDecimal(foconChargeBonus) + " <style=cStack>(+" + Tools.ConvertDecimal(foconChargeBonus) + " per stack)</style> faster</style>, but are <style=cIsHealth>" + Tools.ConvertDecimal(1f - foconRadiusMultiplier) + " smaller</style> <style=cStack>(-" + Tools.ConvertDecimal(1f - foconRadiusMultiplier) + " per stack)</style>. " + $"Max of {foconMaxStack}."); } private void FoconUpdate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val = new ILCursor(il); val.GotoNext((MoveType)2, new Func<Instruction, bool>[1] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld<FocusConvergenceController>(x, "cap") }); val.EmitDelegate<Func<int, int>>((Func<int, int>)((int cap) => foconMaxStack)); } private void FoconNewRadius(orig_ApplyRadius orig, MonoBehaviour self, ref float radius) { FocusConvergenceController val = (FocusConvergenceController)(object)((self is FocusConvergenceController) ? self : null); if (val.currentFocusConvergenceCount > 0) { radius -= foconMinRadius; radius *= Mathf.Pow(foconRadiusMultiplier, (float)val.currentFocusConvergenceCount); radius += foconMinRadius; } } private void FoconApplyRadius(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_008d: 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_00db: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); val.GotoNext((MoveType)0, new Func<Instruction, bool>[1] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld<FocusConvergenceController>(x, "convergenceRadiusDivisor") }); val.Emit(OpCodes.Ldc_R4, foconMinRadius); val.Emit(OpCodes.Sub); val.GotoNext((MoveType)2, new Func<Instruction, bool>[1] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld<FocusConvergenceController>(x, "convergenceRadiusDivisor") }); val.Remove(); val.Emit(OpCodes.Ldc_R4, 2); val.GotoNext((MoveType)0, new Func<Instruction, bool>[1] { (Instruction x) => ILPatternMatchingExt.MatchStindR4(x) }); val.Emit(OpCodes.Ldc_R4, foconMinRadius); val.Emit(OpCodes.Add); } private void FoconApplyRate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val = new ILCursor(il); val.GotoNext((MoveType)2, new Func<Instruction, bool>[1] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld<FocusConvergenceController>(x, "convergenceChargeRateBonus") }); val.EmitDelegate<Func<float, float>>((Func<float, float>)((float chargeBonus) => foconChargeBonus)); } public void GestureChanges() { //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Expected O, but got Unknown //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Expected O, but got Unknown //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Expected O, but got Unknown //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Expected O, but got Unknown //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Expected O, but got Unknown //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Expected O, but got Unknown //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Expected O, but got Unknown //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Expected O, but got Unknown //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Expected O, but got Unknown LanguageAPI.Add("ITEM_AUTOCASTEQUIPMENT_PICKUP", "Greatly increase equipment stock... " + Language.Styling.HealthColor("BUT greatly increase equipment cooldown.") + " Equipments can be activated during their cooldown, " + Language.Styling.HealthColor("with a chance to break.")); LanguageAPI.Add("ITEM_AUTOCASTEQUIPMENT_DESC", "Hold " + Language.Styling.UtilityColor($"{gestureStockBase} additional equipment charges") + " " + Language.Styling.StackText($"+{gestureStockStack}") + "... " + Language.Styling.HealthColor("BUT increase equipment cooldown by +" + Tools.ConvertDecimal(gestureCdiBase)) + " " + Language.Styling.StackText("+" + Tools.ConvertDecimal(gestureCdiStack)) + ". Using your equipment without charges " + Language.Styling.UtilityColor("under-casts") + " it, allowing it to be used " + Language.Styling.HealthColor($"with a {gestureEquipBreakChance}% chance to break") + ". " + Language.Styling.UtilityColor("Unaffected by luck.")); EquipmentCatalog.Init += new hook_Init(CreateGestureBlacklist); EquipmentSlot.ExecuteIfReady += new hook_ExecuteIfReady(AddGestureUndercast); EquipmentSlot.OnEquipmentExecuted += new hook_OnEquipmentExecuted(AddGestureBreak); EquipmentSlot.MyFixedUpdate += new Manipulator(RemoveGestureAutocast); EquipmentSlot.MyFixedUpdate += new Manipulator(AddPreonAccumulatorBreak); Inventory.CalculateEquipmentCooldownScale += new Manipulator(RemoveGestureCdr); Inventory.CalculateEquipmentCooldownScale += new hook_CalculateEquipmentCooldownScale(AddGestureCdi); Inventory.GetEquipmentSlotMaxCharges += new hook_GetEquipmentSlotMaxCharges(AddGestureStock); Inventory.UpdateEquipment += new Manipulator(FixMaxStock); } private void FixMaxStock(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_008b: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); val.GotoNext((MoveType)2, new Func<Instruction, bool>[2] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.RoR2Content/Items", "EquipmentMagazine"), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Inventory>(x, "GetItemCount") }); int num = default(int); val.GotoNext((MoveType)0, new Func<Instruction, bool>[1] { (Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref num) }); val.Emit(OpCodes.Ldarg_0); val.EmitDelegate<Func<int, Inventory, int>>((Func<int, Inventory, int>)delegate(int stock, Inventory inv) { stock += GetGestureStockFromInventory(inv); return stock; }); } private int AddGestureStock(orig_GetEquipmentSlotMaxCharges orig, Inventory self, byte slot) { int num = orig.Invoke(self, slot); return num + GetGestureStockFromInventory(self); } public static int GetGestureStockFromInventory(Inventory inv) { int itemCount = inv.GetItemCount(Items.AutoCastEquipment); if (itemCount > 0) { return 4 + 2 * (itemCount - 1); } return 0; } private float AddGestureCdi(orig_CalculateEquipmentCooldownScale orig, Inventory self) { float num = orig.Invoke(self); int itemCount = self.GetItemCount(Items.AutoCastEquipment); if (itemCount > 0) { num *= 1f + gestureCdiBase + gestureCdiStack * (float)(itemCount - 1); } return num; } private void RemoveGestureCdr(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //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) ILCursor val = new ILCursor(il); val.GotoNext((MoveType)2, new Func<Instruction, bool>[2] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.RoR2Content/Items", "AutoCastEquipment"), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Inventory>(x, "GetItemCount") }); val.Emit(OpCodes.Pop); val.Emit(OpCodes.Ldc_I4, 0); } private void AddGestureBreak(orig_OnEquipmentExecuted orig, EquipmentSlot self) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (!gestureBreakBlacklist.Contains(self.equipmentIndex)) { TryGestureEquipmentBreak(self); } } private void AddPreonAccumulatorBreak(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_005b: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); val.GotoNext((MoveType)2, new Func<Instruction, bool>[2] { (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 0f), (Instruction x) => ILPatternMatchingExt.MatchStfld<EquipmentSlot>(x, "bfgChargeTimer") }); val.Emit(OpCodes.Ldarg_0); val.EmitDelegate<Action<EquipmentSlot>>((Action<EquipmentSlot>)delegate(EquipmentSlot self) { TryGestureEquipmentBreak(self); }); } private void CreateGestureBlacklist(orig_Init orig) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(); gestureBreakBlacklist.Add((EquipmentIndex)(-1)); gestureBreakBlacklist.Add(Equipment.BFG.equipmentIndex); } private bool AddGestureUndercast(orig_ExecuteIfReady orig, EquipmentSlot self) { if (NetworkServer.active) { Inventory inventory = self.inventory; if (inventory != null && inventory.GetItemCount(Items.AutoCastEquipment) > 0 && ((ButtonState)(ref self.inputBank.activateEquipment)).justPressed && self.stock <= 0) { self.stock += 1; self.characterBody.AddBuff(CommonAssets.gestureQueueEquipBreak); } } return orig.Invoke(self); } public static void TryGestureEquipmentBreak(EquipmentSlot self) { if (self.characterBody.HasBuff(CommonAssets.gestureQueueEquipBreak)) { if (Util.CheckRoll(gestureEquipBreakChance, 0f, (CharacterMaster)null)) { self.inventory.SetEquipmentIndex((EquipmentIndex)(-1)); } self.characterBody.RemoveBuff(CommonAssets.gestureQueueEquipBreak); } } private void RemoveGestureAutocast(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //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) ILCursor val = new ILCursor(il); val.GotoNext((MoveType)2, new Func<Instruction, bool>[2] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.RoR2Content/Items", "AutoCastEquipment"), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Inventory>(x, "GetItemCount") }); val.Emit(OpCodes.Pop); val.Emit(OpCodes.Ldc_I4, 0); } public void HappiestMaskRework() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown StatHooks.GetMoreStatCoefficients += new MoreStatHookEventHandler(MaskExecution); GlobalEventManager.onServerCharacterExecuted += HappiestMaskGhostSpawn; GlobalEventManager.OnCharacterDeath += new Manipulator(RevokeHappiestMaskRights); CharacterBody.OnInventoryChanged += new hook_OnInventoryChanged(AddMaskBehavior); LanguageAPI.Add("ITEM_GHOSTONKILL_PICKUP", "Haunt nearby enemies, marking them for execution. Executing enemies summons a ghost."); LanguageAPI.Add("ITEM_GHOSTONKILL_DESC", $"Once every <style=cIsDamage>{HappiestMaskBehavior.baseHauntInterval}</style> seconds, " + "<style=cIsDamage>Haunt</style> a nearby non-boss enemy, marking them for Execution below <style=cIsHealth>" + Tools.ConvertDecimal(hauntExecutionThreshold) + "</style> health. Execution <style=cIsDamage>spawns a ghost</style> of the killed enemy with <style=cIsDamage>1500%</style> damage, " + $"lasting for <style=cIsDamage>{ghostDurationPerStack}s</style> <style=cStack>(+{ghostDurationPerStack}s per stack)</style>."); LanguageAPI.Add("ITEM_GHOSTONKILL_LORE", "<style=cMono>\r\n//--AUTO-TRANSCRIPTION FROM RALLYPOINT DELTA --//</style>\r\n\r\n“Sir, the ghosts are back.”\r\n\r\nThe man sighed. After a routine expedition, one of the crew members – a simple soldier - had recovered an artifact thought to have been aboard the Contact Light – a simple mask, adorned with a painfully happy grin. \r\n\r\n“I’ll take care of it.” The man trudged down the hall towards the barracks. The Lemurians he had killed earlier that day walked down the hall by him, barely earning a second glance from the man. This had become so commonplace that most of the crew members in this block had grown accustomed to having a ghostly room-mate.\r\n\r\nBut enough was enough. Stepping through the ghost of an Imp, the man slammed the door open. The lights were off, and in the corner sat the soldier.\r\n\r\n“Alright, we’ve had enough fun playing with the dead. Fork it over.”\r\n\r\nNo response. The man grunted and hoisted the soldier to his feet, giving him a few rough shakes. “Hey, can you hear me!? I said hand over the mask! I’m tired of waking up next to Beetles, so give it a rest already--”\r\n\r\nThe soldier’s limp body moved. Slowly, the soldier raised his finger – pointing directly at the man.\r\n\r\n“What are you...?” With a sense of dread, the man turned and saw the Lemurians he had killed earlier step into the room. Their mouths began to glow with an otherworldly light.\r\n\r\nThe man cursed under his breath as he loaded his shotgun. “This planet, I tell you...”"); } private void MaskExecution(CharacterBody sender, MoreStatHookEventArgs args) { bool flag = sender.HasBuff(CommonAssets.hauntDebuff); args.ModifyBaseExecutionThreshold(hauntExecutionThreshold, flag); } private void AddMaskBehavior(orig_OnInventoryChanged orig, CharacterBody self) { orig.Invoke(self); int itemCount = self.inventory.GetItemCount(Items.GhostOnKill); self.AddItemBehavior<HappiestMaskBehavior>(itemCount); } private void HappiestMaskGhostSpawn(DamageReport damageReport, float executionHealthLost) { CharacterBody victimBody = damageReport.victimBody; CharacterBody attackerBody = damageReport.attackerBody; if (!Object.op_Implicit((Object)(object)victimBody) || !Object.op_Implicit((Object)(object)attackerBody)) { return; } Inventory inventory = attackerBody.inventory; if (Object.op_Implicit((Object)(object)inventory)) { int itemCount = inventory.GetItemCount(Items.GhostOnKill); if (itemCount > 0 && Object.op_Implicit((Object)(object)victimBody) && Util.CheckRoll(ghostSpawnChanceOnExecute, attackerBody.master)) { Util.TryToCreateGhost(victimBody, attackerBody, Mathf.CeilToInt((float)itemCount * ghostDurationPerStack)); } } } private void RevokeHappiestMaskRights(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //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) ILCursor val = new ILCursor(il); val.GotoNext((MoveType)2, new Func<Instruction, bool>[2] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.RoR2Content/Items", "GhostOnKill"), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Inventory>(x, "GetItemCount") }); val.Emit(OpCodes.Ldc_I4, 0); val.Emit(OpCodes.Mul); } public void HuntersHarpoonRework() { //IL_000f: 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) //IL_002f: Expected O, but got Unknown //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Expected O, but got Unknown harpoonTargetMaterial = CreateMatRecolor(new Color32((byte)210, (byte)140, (byte)32, (byte)100)); GlobalEventManager.OnCharacterDeath += new Manipulator(RevokeHarpoonRights); CharacterBody.OnInventoryChanged += new hook_OnInventoryChanged(AddHarpoonBehavior); OnHit.GetHitBehavior += new HitHookEventHandler(HarpoonOnHit); LanguageAPI.Add("ITEM_MOVESPEEDONKILL_PICKUP", "Target a nearby enemy, gaining barrier on hit."); LanguageAPI.Add("ITEM_MOVESPEEDONKILL_DESC", $"Once every <style=cIsDamage>{harpoonTargetTime}</style> seconds, <style=cIsDamage>target</style> a random enemy. " + "Attacking the targeted enemy grants a <style=cIsHealing>temporary barrier</style> " + $"for <style=cIsHealing>{harpoonBarrierBase} health</style> <style=cStack>(+{harpoonBarrierStack} per stack)</style>."); } public static Material CreateMatRecolor(Color32 blueEquivalent) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: 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) Material val = Object.Instantiate<Material>(Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Huntress/matHuntressFlashExpanded.mat").WaitForCompletion()); val.SetColor("_TintColor", Color32.op_Implicit(blueEquivalent)); val.SetInt("_Cull", 1); return val; } private void HarpoonOnHit(CharacterBody attackerBody, DamageInfo damageInfo, CharacterBody victimBody) { Inventory inventory = attackerBody.inventory; HealthComponent healthComponent = attackerBody.healthComponent; if ((Object)(object)inventory != (Object)null && (Object)(object)healthComponent != (Object)null && (Object)(object)victimBody != (Object)null && victimBody.HasBuff(CommonAssets.harpoonDebuff)) { int itemCount = inventory.GetItemCount(Items.MoveSpeedOnKill); if (itemCount > 0) { float num = harpoonBarrierBase + harpoonBarrierStack * (float)(itemCount - 1); healthComponent.AddBarrierAuthority(num * damageInfo.procCoefficient); } } } private void AddHarpoonBehavior(orig_OnInventoryChanged orig, CharacterBody self) { orig.Invoke(self); int itemCount = self.inventory.GetItemCount(Items.MoveSpeedOnKill); self.AddItemBehavior<HuntersHarpoonBehavior>(itemCount); } private void RevokeHarpoonRights(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //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) ILCursor val = new ILCursor(il); val.GotoNext((MoveType)2, new Func<Instruction, bool>[2] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC1Content/Items", "MoveSpeedOnKill"), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Inventory>(x, "GetItemCount") }); val.Emit(OpCodes.Pop); val.Emit(OpCodes.Ldc_I4, 0); } public void ReworkLaserScope() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown RetierItem(Addressables.LoadAssetAsync<ItemDef>((object)"RoR2/DLC1/CritDamage/CritDamage.asset").WaitForCompletion(), (ItemTier)1); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(ScopeCritChance); CharacterBody.OnInventoryChanged += new hook_OnInventoryChanged(AddScopeItemBehavior); LanguageAPI.Add("ITEM_CRITDAMAGE_NAME", "Combat Telescope"); LanguageAPI.Add("ITEM_CRITDAMAGE_PICKUP", "Increases 'Critical Strike' chance and damage while stationary."); LanguageAPI.Add("ITEM_CRITDAMAGE_DESC", "<style=cIsDamage>Critical Strikes</style> deal an additional <style=cIsDamage>100% damage</style> <style=cStack>(+100% per stack)</style>. " + $"Gain <style=cIsDamage>{scopeBaseCrit}% critical chance</style>, " + $"or <style=cIsDamage>{scopeBaseStationaryCrit}%</style> after standing still " + $"for <style=cIsUtility>{CombatTelescopeBehavior.combatTelescopeWaitTime}</style> seconds."); } private void AddScopeItemBehavior(orig_OnInventoryChanged orig, CharacterBody self) { orig.Invoke(self); self.AddItemBehavior<CombatTelescopeBehavior>(self.inventory.GetItemCount(Items.CritDamage)); } private void ScopeCritChance(CharacterBody sender, StatHookEventArgs args) { if (!Object.op_Implicit((Object)(object)sender.inventory)) { return; } int itemCount = sender.inventory.GetItemCount(Items.CritDamage); if (itemCount > 0) { int num = scopeBaseCrit; int buffCount = sender.GetBuffCount(CommonAssets.combatTelescopeCritChance); if (buffCount > 0) { num = scopeBaseStationaryCrit; } args.critAdd += (float)num; } } private void RevokeScopeRights(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //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) ILCursor val = new ILCursor(il); val.GotoNext((MoveType)2, new Func<Instruction, bool>[2] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC1Content/Items", "CritDamage"), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Inventory>(x, "GetItemCount") }); val.Emit(OpCodes.Ldc_I4, 0); val.Emit(OpCodes.Mul); } public void ReworkLeechingSeed() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: 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) //IL_002f: Expected O, but got Unknown //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown seedItemDef = RetierItem(Addressables.LoadAssetAsync<ItemDef>((object)"RoR2/Base/Seed/Seed.asset").WaitForCompletion(), (ItemTier)0); GlobalEventManager.ProcessHitEnemy += new Manipulator(FuckLeechingSeed); OnHit.GetHitBehavior += new HitHookEventHandler(NewSeedBehavior); LanguageAPI.Add("ITEM_SEED_PICKUP", "Dealing damage heals you."); LanguageAPI.Add("ITEM_SEED_DESC", "Dealing damage increases <style=cIsHealing>base health regeneration</style> by <style=cIsHealing>+2 hp/s</style> " + $"for <style=cIsUtility>{seedRegenDurationBase}s</style> <style=cStack>(+{seedRegenDurationStack}s per stack)</style>."); } private void NewSeedBehavior(CharacterBody body, DamageInfo damageInfo, CharacterBody victimBody) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) if (((ProcChainMask)(ref damageInfo.procChainMask)).HasProc((ProcType)6)) { return; } Inventory inventory = body.inventory; if ((Object)(object)inventory != (Object)null) { int itemCount = inventory.GetItemCount(seedItemDef); if (itemCount > 0) { ProcChainMask procChainMask = damageInfo.procChainMask; ((ProcChainMask)(ref procChainMask)).AddProc((ProcType)6); body.AddTimedBuff(Buffs.MeatRegenBoost, (seedRegenDurationBase + seedRegenDurationStack * (float)(itemCount - 1)) * damageInfo.procCoefficient); } } } private void FuckLeechingSeed(ILContext il) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); int seedLoc = 14; val.GotoNext((MoveType)2, new Func<Instruction, bool>[3] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.RoR2Content/Items", "Seed"), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Inventory>(x, "GetItemCount"), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref seedLoc) }); int index = val.Index; val.Index = index - 1; val.Emit(OpCodes.Pop); val.Emit(OpCodes.Ldc_I4, 0); } public void ReworkFreshMeat() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown ChangeBuffStacking("MeatRegenBoost", canStack: true); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(LetMeatActuallyStack); GlobalEventManager.OnCharacterDeath += new hook_OnCharacterDeath(MeatRegen); LanguageAPI.Add("ITEM_FLATHEALTH_PICKUP", "Regenerate health after killing an enemy."); LanguageAPI.Add("ITEM_FLATHEALTH_DESC", "Increases <style=cIsHealing>base health regeneration</style> by <style=cIsHealing>+2 hp/s</style> for <style=cIsUtility>3s</style> <style=cStack>(+3s per stack)</style> after killing an enemy."); } private void MeatRegen(orig_OnCharacterDeath orig, GlobalEventManager self, DamageReport damageReport) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) CharacterBody attackerBody = damageReport.attackerBody; if ((Object)(object)attackerBody != (Object)null && (Object)(object)attackerBody.inventory != (Object)null) { Inventory inventory = attackerBody.inventory; int itemCount = inventory.GetItemCount(Items.FlatHealth); if (itemCount > 0) { attackerBody.AddTimedBuffAuthority(Buffs.MeatRegenBoost.buffIndex, (float)(3 * itemCount)); } } orig.Invoke(self, damageReport); } private void LetMeatActuallyStack(CharacterBody sender, StatHookEventArgs args) { int buffCount = sender.GetBuffCount(Buffs.MeatRegenBoost); if (buffCount > 1) { args.baseRegenAdd += 2f * (1f + 0.2f * (sender.level - 1f)) * (float)(buffCount - 1); } Inventory inventory = sender.inventory; if ((Object)(object)inventory != (Object)null) { args.baseHealthAdd -= (float)(inventory.GetItemCount(Items.FlatHealth) * 25); } } private void PlanulaChanges() { //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Expected O, but got Unknown //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Expected O, but got Unknown //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Expected O, but got Unknown //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Expected O, but got Unknown LanguageAPI.Add("ITEM_PARENTEGG_DESC", "After beginning the teleporter event, " + Language.Styling.DamageColor("summon a sun overhead") + " that lasts for " + Language.Styling.DamageColor(sunDurationBase.ToString()) + " seconds " + Language.Styling.StackText($"+{sunDurationStack}") + ". " + Language.Styling.HealthColor("All enemies and allies burn near the sun") + "."); HealthComponent.TakeDamageProcess += new Manipulator(FuckPlanula); IdleToChargingState.OnEnter += new hook_OnEnter(OnTeleporterEventPreStart); ChargingState.OnEnter += new hook_OnEnter(OnTeleporterEventStart); ChargingState.FixedUpdate += new hook_FixedUpdate(OnTeleporterEventUpdate); } private void FuckPlanula(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); val.GotoNext((MoveType)2, new Func<Instruction, bool>[1] { (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "RoR2.HealthComponent/ItemCounts", "parentEgg") }); val.Emit(OpCodes.Pop); val.Emit(OpCodes.Ldc_I4_0); } private void OnTeleporterEventPreStart(orig_OnEnter orig, BaseState self) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); int itemCountForTeam = Util.GetItemCountForTeam((TeamIndex)1, Items.ParentEgg.itemIndex, false, false); if (itemCountForTeam <= 0) { return; } TeleporterInteraction teleporterInteraction = ((BaseTeleporterState)((self is BaseTeleporterState) ? self : null)).teleporterInteraction; GameObject chargeActivatorServer = teleporterInteraction.chargeActivatorServer; PlanulaSunController planulaSunController = ((Component)teleporterInteraction).gameObject.AddComponent<PlanulaSunController>(); Debug.Log((object)((Object)(object)planulaSunController != (Object)null)); if ((Object)(object)planulaSunController != (Object)null) { planulaSunController.holdoutZoneController = teleporterInteraction.holdoutZoneController; Transform val = ((EntityState)self).transform.Find("FireworkOrigin"); if ((Object)(object)val == (Object)null) { val = ((Component)teleporterInteraction).transform; } planulaSunController.activator = chargeActivatorServer; planulaSunController.CreateBeamEffect(val); planulaSunController.SetSunDuration(itemCountForTeam); } } private void OnTeleporterEventStart(orig_OnEnter orig, BaseState self) { orig.Invoke(self); PlanulaSunController component = ((EntityState)self).gameObject.GetComponent<PlanulaSunController>(); if ((Object)(object)component != (Object)null) { component.EndBeamEffect(); component.CreateSun(); } } private void OnTeleporterEventUpdate(orig_FixedUpdate orig, BaseState self) { orig.Invoke(self); } public void RazorwireRework() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RazorwireArmor); CharacterBody.OnInventoryChanged += new hook_OnInventoryChanged(AddRazorBehavior); HealthComponent.TakeDamageProcess += new Manipulator(RazorwireBegin); LightningOrb.OnArrival += new Manipulator(RazorwireArrival); LanguageAPI.Add("ITEM_THORNS_PICKUP", "Retaliate in a burst of bleeding razors on taking damage. Recharges over time."); LanguageAPI.Add("ITEM_THORNS_DESC", $"Increase <style=cIsHealing>armor</style> by <style=cIsHealing>{razorwireArmorBase}</style> <style=cStack>(+{razorwireArmorStack} per stack)</stack>" + "Getting hit causes you to explode in a burst of razors, " + $"<style=cIsDamage>bleeding</style> up to <style=cIsDamage>{razorwireTargetsBase}</style> " + $"<style=cStack>(+{razorwireTargetsStack} per stack)</style> nearby enemies " + "for <style=cIsDamage>" + Tools.ConvertDecimal(razorwireBleedDuration * 0.8f) + "</style> base damage per <style=cIsDamage>razor charge</style> expelled. " + $"You can hold up to {RazorwireBehavior.baseRazors} <style=cStack>(+{RazorwireBehavior.stackRazors} per stack)</style> " + $"razor charges, all reloading over <style=cIsUtility>{RazorwireBehavior.rechargeTime}</style> seconds."); } private void RazorwireArmor(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender.inventory)) { int itemCount = sender.inventory.GetItemCount(Items.Thorns); if (itemCount > 0) { args.armorAdd += razorwireArmorBase + razorwireArmorStack * (float)(itemCount - 1); } } } private void AddRazorBehavior(orig_OnInventoryChanged orig, CharacterBody self) { orig.Invoke(self); int itemCount = self.inventory.GetItemCount(Items.Thorns); self.AddItemBehavior<RazorwireBehavior>(itemCount); } private void RazorwireArrival(ILContext il) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_0072: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); int healthComponentLoc = 0; val.GotoNext((MoveType)2, new Func<Instruction, bool>[2] { (Instruction x) => ILPatternMatchingExt.MatchLdfld<HurtBox>(x, "healthComponent"), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref healthComponentLoc) }); val.GotoNext((MoveType)2, new Func<Instruction, bool>[1] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, healthComponentLoc) }); val.Emit(OpCodes.Ldarg_0); val.EmitDelegate<Func<HealthComponent, LightningOrb, HealthComponent>>((Func<HealthComponent, LightningOrb, HealthComponent>)delegate(HealthComponent hc, LightningOrb orb) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 if ((int)orb.lightningType == 6 && (Object)(object)hc != (Object)null) { for (int i = 0; (float)i < orb.procCoefficient; i++) { DotController.InflictDot(((Component)hc).gameObject, orb.attacker, (DotIndex)0, razorwireBleedDuration, orb.damageValue, (uint?)null); } return null; } return hc; }); } private void RazorwireBegin(ILContext il) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_017c: 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) ILCursor val = new ILCursor(il); int buffCount = 0; val.GotoNext((MoveType)2, new Func<Instruction, bool>[2] { (Instruction x) => ILPatternMatchingExt.MatchLdflda<HealthComponent>(x, "itemCounts"), (Instruction x) => ILPatternMatchingExt.MatchLdfld<ItemCounts>(x, "thorns") }); int num4 = default(int); int num3 = default(int); val.GotoPrev((MoveType)0, new Func<Instruction, bool>[2] { (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, ref num4), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, ref num3) }); val.Next.Operand = razorwireTargetsBase; int index = val.Index; val.Index = index + 1; val.Next.Operand = razorwireTargetsStack; val.GotoNext((MoveType)2, new Func<Instruction, bool>[3] { (Instruction x) => ILPatternMatchingExt.MatchLdflda<HealthComponent>(x, "itemCounts"), (Instruction x) => ILPatternMatchingExt.MatchLdfld<ItemCounts>(x, "thorns"), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 0) }); index = val.Index; val.Index = index - 1; val.Emit(OpCodes.Ldarg_0); val.EmitDelegate<Func<int, HealthComponent, int>>((Func<int, HealthComponent, int>)delegate(int itemCount, HealthComponent hc) { CharacterBody body2 = hc.body; buffCount = 0; while (body2.HasBuff(CommonAssets.razorChargeBuff)) { body2.RemoveBuff(CommonAssets.razorChargeBuff); buffCount++; } return (buffCount > 0) ? itemCount : 0; }); val.GotoNext((MoveType)2, new Func<Instruction, bool>[2] { (Instruction x) => ILPatternMatchingExt.MatchLdflda<HealthComponent>(x, "itemCounts"), (Instruction x) => ILPatternMatchingExt.MatchLdfld<ItemCounts>(x, "thorns") }); int num2 = default(int); int num = default(int); val.GotoPrev((MoveType)0, new Func<Instruction, bool>[2] { (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, ref num2), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, ref num) }); val.Next.Operand = razorwireRangeBase; index = val.Index; val.Index = index + 1; val.Next.Operand = razorwireRangeStack; val.GotoNext((MoveType)0, new Func<Instruction, bool>[1] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<OrbManager>(x, "AddOrb") }); val.Emit(OpCodes.Ldarg_0); val.EmitDelegate<Func<LightningOrb, HealthComponent, LightningOrb>>((Func<LightningOrb, HealthComponent, LightningOrb>)delegate(LightningOrb razorwireOrb, HealthComponent hc) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Invalid comparison between Unknown and I4 CharacterBody body = hc.body; razorwireOrb.procCoefficient = buffCount; razorwireOrb.damageValue = (((int)body.teamComponent.teamIndex == 1) ? 1f : 0.2f); return razorwireOrb; }); } private void NerfRazorwireOrb(orig_Begin orig, LightningOrb self) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 //IL_0025: Unknown result type (might be due to invalid IL or missing references) if ((int)self.lightningType == 6) { self.procCoefficient = razorwireProcCoeff; self.damageType.damageType = (DamageType)1024; } orig.Invoke(self); } public void SquolypRework() { SquolypChangeAttack(); SquolypChangeStats(); } private void SquolypChangeAttack() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) SkillDef val = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/Base/Squid/SquidTurretBodyTurret.asset").WaitForCompletion(); Content.AddEntityState(typeof(SquidBlaster)); SerializableEntityStateType activationState = default(SerializableEntityStateType); ((SerializableEntityStateType)(ref activationState))..ctor(typeof(SquidBlaster)); val.activationState = activationState; } private void SquolypChangeStats() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) GameObject val = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Squid/SquidTurretBody.prefab").WaitForCompletion(); CharacterBody component = val.GetComponent<CharacterBody>(); if (Object.op_Implicit((Object)(object)component)) { component.baseDamage = 12f; component.levelDamage = 2.4f; } } private void InitializeStorms() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_005d: 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_015d: 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_0178: Unknown result type (might be due to invalid IL or missing references) CreateStormEliteTiers(); CreateStormsRunBehaviorPrefab(); HoldoutZoneController.OnEnable += new hook_OnEnable(RegisterHoldoutZone); HoldoutZoneController.OnDisable += new hook_OnDisable(UnregisterHoldoutZone); StormRunBehaviorController.meteorWarningEffectPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Meteor/MeteorStrikePredictionEffect.prefab").WaitForCompletion(), "StormStrikePredictionEffect"); StormRunBehaviorController.meteorWarningEffectPrefab.transform.localScale = Vector3.one * StormRunBehaviorController.meteorBlastRadius * 0.85f; DestroyOnTimer component = StormRunBehaviorController.meteorWarningEffectPrefab.GetComponent<DestroyOnTimer>(); if (Object.op_Implicit((Object)(object)component)) { component.duration = StormRunBehaviorController.meteorImpactDelay + 0.5f; } Transform val = StormRunBehaviorController.meteorWarningEffectPrefab.transform.Find("GroundSlamIndicator"); if (Object.op_Implicit((Object)(object)val)) { AnimateShaderAlpha component2 = ((Component)val).GetComponent<AnimateShaderAlpha>(); if (Object.op_Implicit((Object)(object)component2)) { component2.timeMax = StormRunBehaviorController.meteorImpactDelay + 0.1f; } MeshRenderer component3 = ((Component)val).GetComponent<MeshRenderer>(); if (Object.op_Implicit((Object)(object)component3)) { Material val2 = Object.Instantiate<Material>(((Renderer)component3).material); ((Object)val2).name = "matStormStrikeImpactIndicator"; ((Renderer)component3).material = val2; val2.SetFloat("_Boost", 0.64f); val2.SetFloat("_AlphaBoost", 4.29f); val2.SetTexture("_RemapTex", Addressables.LoadAssetAsync<Texture>((object)"RoR2/Base/Common/ColorRamps/texRampArtifactShellSoft.png").WaitForCompletion()); val2.SetColor("_TintColor", Color.white); } } Content.CreateAndAddEffectDef(StormRunBehaviorController.meteorWarningEffectPrefab); LanguageAPI.Add("OBJECTIVE_METEORDEFAULT_2R4R", "Meteor Storm Imminent"); LanguageAPI.Add("OBJECTIVE_LIGHTNING_2R4R", "Thunderstorm Imminent"); LanguageAPI.Add("OBJECTIVE_FIRE_2R4R", "Fire Storm Imminent"); LanguageAPI.Add("OBJECTIVE_COLD_2R4R", "Blizzard Imminent"); } private void RegisterHoldoutZone(orig_OnEnable orig, HoldoutZoneController self) { orig.Invoke(self); if (!StormRunBehaviorController.holdoutZones.Contains(self)) { StormRunBehaviorController.holdoutZones.Add(self); } } private void UnregisterHoldoutZone(orig_OnDisable orig, HoldoutZoneController self) { orig.Invoke(self); if (StormRunBehaviorController.holdoutZones.Contains(self)) { StormRunBehaviorController.holdoutZones.Remove(self); } } private void CreateStormEliteTiers() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Expected O, but got Unknown StormT1 = new EliteTierDef(); StormT1.costMultiplier = 2f; StormT1.canSelectWithoutAvailableEliteDef = false; StormT1.isAvailable = (EliteRules rules) => (int)rules == 0 && Object.op_Implicit((Object)(object)StormRunBehaviorController.instance) && StormRunBehaviorController.instance.hasBegunStorm; StormT1.eliteTypes = (EliteDef[])(object)new EliteDef[0]; StormT2 = new EliteTierDef(); StormT2.costMultiplier = 2f; StormT2.canSelectWithoutAvailableEliteDef = false; StormT2.isAvailable = (EliteRules rules) => ((int)rules == 0 && Object.op_Implicit((Object)(object)StormRunBehaviorController.instance) && StormRunBehaviorController.instance.hasBegunStorm && !is2R4RLoaded) ? (Run.instance.loopClearCount > 0) : ((Run.instance.stageClearCount >= 10 && (int)rules == 0 && (int)Run.instance.selectedDifficulty <= 0) || (Run.instance.stageClearCount >= 5 && (int)rules == 0 && (int)Run.instance.selectedDifficulty == 1) || (Run.instance.stageClearCount >= 3 && (int)rules == 0 && (int)Run.instance.selectedDifficulty == 2) || (Run.instance.stageClearCount >= 3 && (int)rules == 0 && (int)Run.instance.selectedDifficulty > 2)); StormT2.eliteTypes = (EliteDef[])(object)new EliteDef[0]; } private static void CreateStormsRunBehaviorPrefab() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0147: 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_015c: 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_00f2: Unknown result type (might be due to invalid IL or missing references) StormsRunBehaviorPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/Common/DLC1RunBehavior.prefab").WaitForCompletion(), "2R4RExpansionRunBehavior", true); ExpansionRequirementComponent component = StormsRunBehaviorPrefab.GetComponent<ExpansionRequirementComponent>(); component.requiredExpansion = expansionDefSS2; StormsRunBehaviorPrefab.AddComponent<StormRunBehaviorController>(); expansionDefSS2.runBehaviorPrefab = StormsRunBehaviorPrefab; StormsControllerPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Common/Director.prefab").WaitForCompletion(), "2R4RStormController", true); MonoBehaviour[] componentsInChildren = StormsControllerPrefab.GetComponentsInChildren<MonoBehaviour>(); bool flag = false; MonoBehaviour[] array = componentsInChildren; foreach (MonoBehaviour val in array) { CombatDirector val2 = (CombatDirector)(object)((val is CombatDirector) ? val : null); if (val2 != null && !flag) { val2.creditMultiplier = 0.5f; val2.expRewardCoefficient = 1f; val2.goldRewardCoefficient = 1f; val2.minRerollSpawnInterval = 15f; val2.maxRerollSpawnInterval = 25f; val2.teamIndex = (TeamIndex)2; flag = true; ((UnityEvent<GameObject>)(object)val2.onSpawnedServer).AddListener((UnityAction<GameObject>)OnStormDirectorSpawnServer); } else { Object.Destroy((Object)(object)val); } } EntityStateMachine val3 = StormsControllerPrefab.AddComponent<EntityStateMachine>(); val3.initialStateType = new SerializableEntityStateType(typeof(StormController.StormApproach)); val3.mainStateType = new SerializableEntityStateType(typeof(StormController.StormApproach)); StormsControllerPrefab.AddComponent<StormController>(); StormsControllerPrefab.AddComponent<NetworkIdentity>(); Content.AddNetworkedObjectPrefab(StormsRunBehaviorPrefab); Content.AddEntityState(typeof(StormController.IdleState)); Content.AddEntityState(typeof(StormController.StormApproach)); Content.AddEntityState(typeof(StormController.StormWarning)); Content.AddEntityState(typeof(StormController.StormActive)); static void OnStormDirectorSpawnServer(GameObject masterObject) { //IL_002e: 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_00ac: Invalid comparison between Unknown and I4 //IL_0054: 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_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) EliteDef eliteDef = T1EliteEquipmentBase<WhirlwindAspect>.instance.EliteDef; if (Util.CheckRoll(50f, 0f, (CharacterMaster)null)) { eliteDef = T1EliteEquipmentBase<SurgingAspect>.instance.EliteDef; } EquipmentIndex val4 = (EquipmentIndex)(-1); if ((Object)(object)eliteDef != (Object)null) { EquipmentDef eliteEquipmentDef = eliteDef.eliteEquipmentDef; val4 = (EquipmentIndex)((!((Object)(object)eliteEquipmentDef != (Object)null)) ? (-1) : ((int)eliteEquipmentDef.equipmentIndex)); } CharacterMaster component2 = masterObject.GetComponent<CharacterMaster>(); GameObject bodyObject = component2.GetBodyObject(); if (Object.op_Implicit((Object)(object)bodyObject)) { EntityStateMachine[] components = bodyObject.GetComponents<EntityStateMachine>(); foreach (EntityStateMachine val5 in components) { val5.initialStateType = val5.mainStateType; } } if ((int)val4 != -1) { Debug.LogWarning((object)("Spawning Storm Elite: " + ((Object)eliteDef).name)); component2.inventory.SetEquipmentIndex(val4); } } } public void LunarExplodersDuringBrother() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown Phase1.OnEnter += new hook_OnEnter(InitializeExploderDirector); Phase2.OnEnter += new hook_OnEnter(DisableExploderDirector); Phase3.OnEnter += new hook_OnEnter(RestoreExploderDirector); Phase4.OnEnter += new hook_OnEnter(KillExploderDirector); } private void GetExploderCard(List<DirectorCardHolder> cardList, StageInfo currentStage) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Invalid comparison between Unknown and I4 //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Invalid comparison between Unknown and I4 Debug.Log((object)"jsd fjsn"); if ((int)currentStage.stage != 65536) { return; } List<DirectorCardHolder> list = new List<DirectorCardHolder>(); foreach (DirectorCardHolder card2 in cardList) { if ((int)card2.MonsterCategory == 2) { DirectorCard card = card2.Card; SpawnCard spawnCard = card.spawnCard; GameObject prefab = spawnCard.prefab; if (((Object)spawnCard).name == "cscLunarExploder") { exploderCards.Add(card); } } } foreach (DirectorCardHolder item in list) { cardList.Remove(item); } } private void InitializeExploderDirector(orig_OnEnter orig, Phase1 self) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if ((Object)(object)exploderDirector == (Object)null) { GameObject val = new GameObject("CommencementPerfected_ChimeraExploderDirector_OrTheCPCEDForShort"); val.transform.position = new Vector3(-88f, 491.1f, 0f); exploderDirector = val.AddComponent<ExploderDirector>(); exploderDirector.baseState = (BrotherEncounterBaseState)(object)self; } } private void DisableExploderDirector(orig_OnEnter orig, Phase2 self) { orig.Invoke(self); exploderDirector.SetDirectorRate(phaseTwoRate); } private void RestoreExploderDirector(orig_OnEnter orig, Phase3 self) { orig.Invoke(self); exploderDirector.SetDirectorRate(phaseThreeRate); } private void KillExploderDirector(orig_OnEnter orig, Phase4 self) { orig.Invoke(self); Object.Destroy((Object)(object)((Component)exploderDirector).gameObject); } public static bool ModLoaded(string modGuid) { return modGuid != "" && Chainloader.PluginInfos.ContainsKey(modGuid); } public static bool IsMissileArtifactEnabled() { if (ModLoaded("com.RiskOfBrainrot.IAmBecomeMissiles")) { return GetMissileArtifactEnabled(); } return false; } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private static bool GetMissileArtifactEnabled() { return RunArtifactManager.instance.IsArtifactEnabled(MissileReworkPlugin.MissileArtifact); } private void Awake() { instance = this; Config.Init(); Log.Init(((BaseUnityPlugin)this).Logger); CreateExpansionDef(); Language.Init(); Hooks.Init(); CommonAssets.Init(); EliteModule.Init(); AllyCaps.Init(); Spawnlists.Init(); InitializeStorms(); ConfigManager.HandleConfigAttributes(((object)this).GetType(), "SwanSong", Config.MyConfig); InitializeContent(); InitializeChanges(); Materials.SwapShadersFromMaterialsInBundle(mainAssetBundle); Materials.SwapShadersFromMaterialsInBundle(orangeAssetBundle); new ContentPacks().Initialize(); } private void CreateExpansionDef() { expansionDefSS2 = ScriptableObject.CreateInstance<ExpansionDef>(); expansionDefSS2.nameToken = "EXPANSION2R4R_NAME"; expansionDefSS2.descriptionToken = "EXPANSION2R4R_DESCRIPTION"; expansionDefSS2.iconSprite = null; expansionDefSS2.disabledIconSprite = null; LanguageAPI.Add("EXPANSION2R4R_NAME", "Swan Song"); LanguageAPI.Add("EXPANSION2R4R_DESCRIPTION", "Adds content from the 'Swan Song' expansion to the game."); Content.AddExpansionDef(expansionDefSS2); expansionDefSOTS = ScriptableObject.CreateInstance<ExpansionDef>(); expansionDefSOTS.nameToken = "EXPANSIONSOTS_NAME"; expansionDefSOTS.descriptionToken = "EXPANSIONSOTS_DESCRIPTION"; expansionDefSOTS.iconSprite = null; expansionDefSOTS.disabledIconSprite = null; LanguageAPI.Add("EXPANSIONSOTS_NAME", "Secrets of the Scug"); LanguageAPI.Add("EXPANSIONSOTS_DESCRIPTION", "Adds content from the 'Secrets of the Scug' expansion to the game."); Content.AddExpansionDef(expansionDefSOTS); } private void InitializeContent() { Type[] types = Assembly.GetExecutingAssembly().GetTypes(); BeginInitializing<ItemBase>(types, "SwanSongItems.txt"); BeginInitializing<EquipmentBase>(types, "SwanSongEquipment.txt"); BeginInitializing<EliteEquipmentBase>(types, "SwanSongElites.txt"); BeginInitializing<InteractableBase>(types, "SwanSongInteractables.txt"); BeginInitializing<ArtifactBase>(types, "SwanSongArtifacts.txt"); BeginInitializing<SkillBase>(types, "SwanSongSkills.txt"); BeginInitializing<TwistedScavengerBase>(types, "SwanSongScavengers.txt"); } private void InitializeChanges() { BurnReworks(); if (GetConfigBool(defaultValue: true, "Reworks : Razorwire")) { RazorwireRework(); } if (GetConfigBool(defaultValue: true, "Reworks : Laser Scope")) { ReworkLaserScope(); } if (GetConfigBool(defaultValue: true, "Reworks : Happiest Mask")) { HappiestMaskRework(); } if (GetConfigBool(defaultValue: true, "Reworks : Hunters Harpoon")) { HuntersHarpoonRework(); } if (GetConfigBool(defaultValue: true, "Reworks : Focused Convergence")) { FocusedConvergenceChanges(); } if (GetConfigBool(defaultValue: true, "Reworks : Squid Polyp")) { SquolypRework(); } if (GetConfigBool(defaultValue: true, "Reworks : Executive Card")) { ExecutiveCardChanges(); } if (GetConfigBool(defaultValue: true, "Reworks : Leeching Seed")) { ReworkLeechingSeed(); } if (GetConfigBool(defaultValue: true, "Reworks : Bison Steak")) { ReworkFreshMeat(); } if (GetConfigBool(defaultValue: true, "Reworks : Gesture of the Drowned")) { GestureChanges(); } if (GetConfigBool(defaultValue: true, "Reworks : Brittle Crown")) { BrittleCrownChanges(); } if (GetConfigBool(defaultValue: true, "Reworks : Planula")) { PlanulaChanges(); } if (GetConfigBool(defaultValue: true, "Reworks : Commencement")) { MakePillarsFun(); LunarExplodersDuringBrother(); } Secrets.AddSecrets(); } private void BeginInitializing<T>(Type[] allTypes, string fileName = "") where T : SharedBase { Type baseType = typeof(T); if (!baseType.IsAbstract) { Log.Error(Log.Combine() + "Incorrect BaseType: " + baseType.Name); return; } IEnumerable<Type> enumerable = allTypes.Where((Type type) => !type.IsAbstract && type.IsSubclassOf(baseType)); if (enumerable.Count() <= 0) { return; } Log.Debug(Log.Combine(baseType.Name) + "Initializing"); foreach (Type item in enumerable) { string text = Log.Combine(baseType.Name, item.Name); Log.Debug(text); T obj = (T)Activator.CreateInstance(item); if (ValidateBaseType(obj)) { Log.Debug(text + "Validated"); InitializeBaseType(obj); Log.Debug(text + "Initialized"); } } if (!string.IsNullOrEmpty(fileName)) { Language.TryPrintOutput(fileName); } } private bool ValidateBaseType(SharedBase obj) { bool isEnabled = obj.isEnabled; if (obj.lockEnabled) { return isEnabled; } return obj.Bind(isEnabled, "Should This Content Be Enabled"); } private void InitializeBaseType(SharedBase obj) { obj.Init(); } private bool GetConfigBool(bool defaultValue, string packetTitle, string desc = "") { return ConfigManager.DualBindToConfig(packetTitle, Config.MyConfig, "Should This Content Be Enabled", defaultValue, desc); } public static ItemDef RetierItem(string itemName, ItemTier tier = 5) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) ItemDef def = LoadItemDef(itemName); return RetierItem(def, tier); } public static ItemDef RetierItem(ItemDef def, ItemTier tier = 5) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0016: 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) if ((Object)(object)def != (Object)null) { def.tier = tier; def.deprecatedTier = tier; } return def; } internal static void BlacklistSingleItem(string name, ItemTag itemTag = 4) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) ItemDef val = LoadItemDef(name); if ((Object)(object)val != (Object)null) { List<ItemTag> list = new List<ItemTag>(val.tags); list.Add(itemTag); val.tags = list.ToArray(); } else { Debug.LogError((object)("ItemDef " + name + " failed to load - unable to blacklist")); } } public static void RemoveEquipment(string equipName) { EquipmentDef val = LoadEquipDef(equipName); val.canDrop = false; val.canBeRandomlyTriggered = false; val.enigmaCompatible = false; val.dropOnDeathChance = 0f; } public static void ChangeEquipmentEnigma(string equipName, bool canEnigma) { EquipmentDef val = LoadEquipDef(equipName); if ((Obje