using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using AK.Wwise; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using Pigeon.Math; using Pigeon.Movement; using Unity.Netcode; using UnityEngine; using UnityEngine.InputSystem; using UnityEngine.Rendering; using UnityEngine.SceneManagement; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("CyclerRework")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("CyclerRework")] [assembly: AssemblyTitle("CyclerRework")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } public sealed class CyclerHeatBehaviour : MonoBehaviour { [Serializable] public struct Data { public float maxHeat; public float heatPerShot; public float dissipatePerSecond; public float dissipateDelay; public float overheatCooldown; public float warmThreshold; public float hotThreshold; public float hotDamageMult; public float hotElementMult; public float redlineFireIntervalMult; public float redlineSpreadMult; public float redlineDamageMult; public float redlineElementMult; public bool ventEnabled; public float ventMinHeat; public float ventSpend; public float ventRadius; public float ventDamage; public float ventRecovery; public float ventBypassDissipateDuration; public bool cycling; public float cyclingEffectAmount; public float scorchingDetonationRadius; public float scorchingDetonationDamage; public float healOnSustainedFire; public int healShotsInterval; public float overloadSpeedIncrease; public float overloadSpeedDuration; public float aimRecoilMultiplier; public float aimDissipateDelayMult; public bool infinityBurn; public float infinityBurnDamagePerSecond; public float infinityBurnEffectPerSecond; public float infinityBurnHardCap; public float infinityBurnOutgoingDamagePerOvercap; public float infinityBurnOutgoingElementPerOvercap; public float infinityBurnOvercapFireIntervalMult; public float overheatDamageReduction; public float adrenalineDissipateMultiplier; public float adrenalineDuration; public float adrenalineHeatRefund; public float shockHeatRefund; public float toxinDamagePerStack; public int toxinMaxStacks; public float superheatElementPerStack; public int superheatMaxStacks; public float superheatFalloffSeconds; public float liteEnergyBulletSpeedBonus; public float massAccelEfficiency; public float siphonMaxHeatPer60; public float siphonHeatRefundPer60; public float fullOutputDamagePerRarity; public float energyConvHeatPerStack; public float dischargeRadius; public float dischargeDamage; public float dischargeChargeTime; public float dischargeHeatCost; public float violentRadius; public float violentEffectAmount; public float arcDamage; public float arcRadius; public float arcInterval; public float rocketSlideHeatCost; public float rocketSlideDamage; public float rocketSlideRadius; public float rocketSlideInterval; public float dumpBeamDps; public float dumpSecondsPerFullHeat; public float dumpHeatDrainPerSecond; public float dumpConeStartAngle; public float dumpConeEndAngle; public float dumpConeRange; public float dumpFireHitch; public bool cyclePhasing; public float cyclePhasingStrength; public float closedLoopSustainSeconds; public float closedLoopVentHeat; public float closedLoopEfficiencyDuration; public float closedLoopHeatPerShotMult; public float crossflashBonusRefund; public float crossflashSplashRadius; public float crossflashSplashDamage; public float crossflashSplashFire; public float pyrolysisRadius; public float pyrolysisDamage; public int pyrolysisBankStacks; public float triValveFire; public float triValveShock; public float triValveAcid; public float acidSparkArcDamage; public float acidSparkArcRadius; public float acidSparkShockAmount; public float braidWindowSeconds; public float braidEfficiencyDuration; public float braidHeatPerShotMult; public int catalystMaxStacks; public float catalystStackDuration; public float catalystVentDamagePerStack; public float catalystVentRadiusPerStack; } public enum PhaseMode { Coolant, Pyre, Storm, Solvent, Split, Needle, BleedOff, Spike } [SerializeField] private Data data = CreateDefaultData(); private Data prefabSnapshot = CreateDefaultData(); private string description = "A reworked Cycler SMG. Infinite ammo — builds Heat while firing. Ride Soft Redline at max Heat (keep firing, wilder and meaner). Tap R to Pressure Vent."; private float lastShotTime = -999f; private int firedShotCount; private float totalShotsFiredSinceStartedFiring; private bool wasFiring; private float lastOverloadTime = -999f; private float lastKillTime = -999f; private bool isDamagedTargetIgnited; private bool isUsingDecayUpgrade; private bool hooksBound; private bool playerDamageHookBound; private bool playerDamageDealtHookBound; private Gun boundGun; private HeatVentSystem ventSystem; private int toxinStacks; private int superheatStacks; private float lastSuperheatTime = -999f; private float siphonDamageAccumulator; private float baseFireIntervalCaptured; private float baseBulletSpeedCaptured; private float massAccelAppliedInterval = -1f; private int energyConvCounter; private const int EnergyConvPerStack = 4; private int energyConvStoredStacks; private float lastArcTime = -999f; private float arcIdleLogTime = -999f; private float lastRocketSlideTime = -999f; private float redlineSustainTimer; private float closedLoopEfficiencyUntil = -999f; private float lastFireApplyTime = -999f; private float lastShockApplyTime = -999f; private float lastAcidApplyTime = -999f; private float braidEfficiencyUntil = -999f; private int catalystStacks; private float catalystExpireTime = -999f; private int lockedPhaseMode = -1; private bool phaseLockedThisSpray; private int nextPhaseMode; private float phaseCoolantRefundThisSec; private float phaseCoolantSecBucket = -1f; private float phaseBleedOffTimer; private int phaseBaseBulletsPerShot = -1; private readonly List trackedArcBullets = new List(8); public static readonly string[] PhaseModeNames = new string[8] { "Coolant", "Pyre", "Storm", "Solvent", "Split", "Needle", "Bleed-Off", "Spike" }; public float CurrentHeat { get; private set; } public bool IsOverheated => false; public float OverheatTimer => 0f; private HeatVentSystem Vent => ventSystem ?? (ventSystem = new HeatVentSystem(this)); public int EnergyConvStoredStacks => energyConvStoredStacks; public int LockedPhaseMode => lockedPhaseMode; public string LockedPhaseModeName { get { if (lockedPhaseMode < 0 || lockedPhaseMode >= PhaseModeNames.Length) { return "—"; } return PhaseModeNames[lockedPhaseMode]; } } public int ToxinStacks => toxinStacks; public ref Data WeaponData => ref data; public string Description => description; public float HeatNormalized { get { float num = Mathf.Max(0.01f, data.maxHeat); return CurrentHeat / num; } } public bool IsOvercapped { get { if (data.infinityBurn) { return CurrentHeat > data.maxHeat + 0.0001f; } return false; } } public bool IsRedline { get { if (!IsOvercapped) { return CurrentHeat >= data.maxHeat - 0.0001f; } return false; } } public HeatZone CurrentZone { get { if (IsOvercapped) { return HeatZone.Overcap; } float heatNormalized = HeatNormalized; if (heatNormalized >= 0.9999f) { return HeatZone.Redline; } float num = ((data.hotThreshold > 0f) ? data.hotThreshold : 0.7f); float num2 = ((data.warmThreshold > 0f) ? data.warmThreshold : 0.4f); if (heatNormalized >= num) { return HeatZone.Hot; } if (heatNormalized >= num2) { return HeatZone.Warm; } return HeatZone.Cold; } } private float EffectiveDissipatePerSecond { get { float num = data.dissipatePerSecond; if (data.adrenalineDissipateMultiplier > 1f && Time.time - lastKillTime < data.adrenalineDuration) { num *= data.adrenalineDissipateMultiplier; } return num; } } public void SetData(Data newData) { data = newData; } public static Data CreateDefaultData() { return new Data { maxHeat = 100f, heatPerShot = 2.4f, dissipatePerSecond = 65f, dissipateDelay = 0.15f, overheatCooldown = 0f, warmThreshold = 0.4f, hotThreshold = 0.7f, hotDamageMult = 1.08f, hotElementMult = 1.1f, redlineFireIntervalMult = 1.18f, redlineSpreadMult = 1.25f, redlineDamageMult = 1.12f, redlineElementMult = 1.2f, ventEnabled = true, ventMinHeat = 15f, ventSpend = 35f, ventRadius = 3.5f, ventDamage = 20f, ventRecovery = 0.45f, ventBypassDissipateDuration = 0.35f, cycling = false, cyclingEffectAmount = 0f, scorchingDetonationRadius = 0f, scorchingDetonationDamage = 0f, healOnSustainedFire = 0f, healShotsInterval = 15, overloadSpeedIncrease = 0f, overloadSpeedDuration = 0f, aimRecoilMultiplier = 0f, aimDissipateDelayMult = 1f, infinityBurn = false, infinityBurnDamagePerSecond = 0f, infinityBurnEffectPerSecond = 0f, infinityBurnHardCap = 0f, infinityBurnOutgoingDamagePerOvercap = 0.35f, infinityBurnOutgoingElementPerOvercap = 0.25f, infinityBurnOvercapFireIntervalMult = 0.92f, overheatDamageReduction = 0f, adrenalineDissipateMultiplier = 0f, adrenalineDuration = 1.25f, adrenalineHeatRefund = 0f, shockHeatRefund = 0f, toxinDamagePerStack = 0f, toxinMaxStacks = 0, superheatElementPerStack = 0f, superheatMaxStacks = 0, superheatFalloffSeconds = 3f, liteEnergyBulletSpeedBonus = 0f, massAccelEfficiency = 0f, siphonMaxHeatPer60 = 0f, siphonHeatRefundPer60 = 0f, fullOutputDamagePerRarity = 0f, energyConvHeatPerStack = 0f, dischargeRadius = 0f, dischargeDamage = 0f, dischargeChargeTime = 0.55f, dischargeHeatCost = 40f, violentRadius = 0f, violentEffectAmount = 0f, arcDamage = 0f, arcRadius = 0f, arcInterval = 0.4f, rocketSlideHeatCost = 0f, rocketSlideDamage = 0f, rocketSlideRadius = 0f, rocketSlideInterval = 0.45f, dumpBeamDps = 0f, dumpSecondsPerFullHeat = 0f, dumpHeatDrainPerSecond = 0f, dumpConeStartAngle = 38f, dumpConeEndAngle = 7f, dumpConeRange = 28f, dumpFireHitch = 0.15f, cyclePhasing = false, cyclePhasingStrength = 0f, closedLoopSustainSeconds = 0f, closedLoopVentHeat = 0f, closedLoopEfficiencyDuration = 0f, closedLoopHeatPerShotMult = 0f, crossflashBonusRefund = 0f, crossflashSplashRadius = 0f, crossflashSplashDamage = 0f, crossflashSplashFire = 0f, pyrolysisRadius = 0f, pyrolysisDamage = 0f, pyrolysisBankStacks = 0, triValveFire = 0f, triValveShock = 0f, triValveAcid = 0f, acidSparkArcDamage = 0f, acidSparkArcRadius = 0f, acidSparkShockAmount = 0f, braidWindowSeconds = 0f, braidEfficiencyDuration = 0f, braidHeatPerShotMult = 0f, catalystMaxStacks = 0, catalystStackDuration = 0f, catalystVentDamagePerStack = 0f, catalystVentRadiusPerStack = 0f }; } public static Data CreateDataFromConfig() { Data result = CreateDefaultData(); if (SparrohPlugin.MaxHeat != null) { result.maxHeat = Mathf.Max(1f, SparrohPlugin.MaxHeat.Value); } if (SparrohPlugin.HeatPerShot != null) { result.heatPerShot = Mathf.Max(0f, SparrohPlugin.HeatPerShot.Value); } if (SparrohPlugin.DissipatePerSecond != null) { result.dissipatePerSecond = Mathf.Max(0f, SparrohPlugin.DissipatePerSecond.Value); } if (SparrohPlugin.DissipateDelay != null) { result.dissipateDelay = Mathf.Max(0f, SparrohPlugin.DissipateDelay.Value); } if (SparrohPlugin.HotThreshold != null) { result.hotThreshold = Mathf.Clamp01(SparrohPlugin.HotThreshold.Value); } if (SparrohPlugin.WarmThreshold != null) { result.warmThreshold = Mathf.Clamp01(SparrohPlugin.WarmThreshold.Value); } if (SparrohPlugin.HotDamageMult != null) { result.hotDamageMult = Mathf.Max(0.1f, SparrohPlugin.HotDamageMult.Value); } if (SparrohPlugin.RedlineFireIntervalMult != null) { result.redlineFireIntervalMult = Mathf.Max(1f, SparrohPlugin.RedlineFireIntervalMult.Value); } if (SparrohPlugin.RedlineSpreadMult != null) { result.redlineSpreadMult = Mathf.Max(1f, SparrohPlugin.RedlineSpreadMult.Value); } if (SparrohPlugin.RedlineDamageMult != null) { result.redlineDamageMult = Mathf.Max(0.1f, SparrohPlugin.RedlineDamageMult.Value); } if (SparrohPlugin.VentSpend != null) { result.ventSpend = Mathf.Max(1f, SparrohPlugin.VentSpend.Value); } if (SparrohPlugin.VentMinHeat != null) { result.ventMinHeat = Mathf.Max(0f, SparrohPlugin.VentMinHeat.Value); } if (SparrohPlugin.VentRecovery != null) { result.ventRecovery = Mathf.Max(0f, SparrohPlugin.VentRecovery.Value); } return result; } public void InitializeAsPrefab(string desc) { description = desc ?? "A reworked Cycler SMG. Infinite ammo — builds Heat while firing. Ride Soft Redline at max Heat (keep firing, wilder and meaner). Tap R to Pressure Vent."; data = CreateDataFromConfig(); prefabSnapshot = data; ResetHeatState(); ResetUpgradeRuntimeState(); } public void RestoreFromPrefab() { data = prefabSnapshot; } public void CapturePrefabSnapshot() { prefabSnapshot = data; } public Data GetPrefabSnapshot() { return prefabSnapshot; } public void CopySnapshotFrom(CyclerHeatBehaviour template) { if (!((Object)(object)template == (Object)null)) { prefabSnapshot = template.prefabSnapshot; data = prefabSnapshot; description = template.description; ResetHeatState(); ResetUpgradeRuntimeState(); } } public void ResetHeatState() { CurrentHeat = 0f; lastShotTime = -999f; } public void ResetUpgradeRuntimeState() { firedShotCount = 0; totalShotsFiredSinceStartedFiring = 0f; wasFiring = false; lastOverloadTime = -999f; lastKillTime = -999f; isDamagedTargetIgnited = false; isUsingDecayUpgrade = false; toxinStacks = 0; superheatStacks = 0; lastSuperheatTime = -999f; siphonDamageAccumulator = 0f; massAccelAppliedInterval = -1f; energyConvCounter = 0; energyConvStoredStacks = 0; lastArcTime = -999f; lastRocketSlideTime = -999f; redlineSustainTimer = 0f; closedLoopEfficiencyUntil = -999f; lastFireApplyTime = -999f; lastShockApplyTime = -999f; lastAcidApplyTime = -999f; braidEfficiencyUntil = -999f; catalystStacks = 0; catalystExpireTime = -999f; lockedPhaseMode = -1; phaseLockedThisSpray = false; nextPhaseMode = 0; phaseCoolantRefundThisSec = 0f; phaseCoolantSecBucket = -1f; phaseBleedOffTimer = 0f; phaseBaseBulletsPerShot = -1; trackedArcBullets.Clear(); Vent.Reset(); } public void AddHeat(float amount) { if (!(amount <= 0f)) { float num = ((!data.infinityBurn) ? data.maxHeat : ((data.infinityBurnHardCap > 0f) ? data.infinityBurnHardCap : (data.maxHeat * 2f))); CurrentHeat = Mathf.Min(num, CurrentHeat + amount); } } public void RefundHeat(float amount) { if (!(amount <= 0f)) { CurrentHeat = Mathf.Max(0f, CurrentHeat - amount); if (toxinStacks > 0 && CurrentHeat <= 0.0001f) { toxinStacks = 0; } } } public float SpendHeatUpTo(float maxSpend) { if (maxSpend <= 0f || CurrentHeat <= 0f) { return 0f; } float num = Mathf.Min(CurrentHeat, maxSpend); CurrentHeat = Mathf.Max(0f, CurrentHeat - num); if (toxinStacks > 0 && CurrentHeat <= 0.0001f) { toxinStacks = 0; } return num; } public bool SpendHeat(float amount) { if (amount <= 0f || CurrentHeat < amount) { return false; } SpendHeatUpTo(amount); return true; } public void CaptureBaseFireInterval(float interval) { if (interval > 0f && (baseFireIntervalCaptured <= 0f || interval < baseFireIntervalCaptured)) { baseFireIntervalCaptured = interval; } } public void CaptureBaseBulletSpeed(float speed) { if (speed > 0f && baseBulletSpeedCaptured <= 0f) { baseBulletSpeedCaptured = speed; } } public static void ApplyInfiniteAmmo(Gun gun) { if (!((Object)(object)gun == (Object)null)) { ref GunData gunData = ref gun.GunData; gunData.useAmmoOnFire = 0; gunData.magazineSize = 7777777; gunData.hasLimitedAmmo = false; gunData.autoReloadWhenEmpty = false; gun.RemainingAmmo = 7777777f; gun.StoredAmmo = 0f; } } public void OnUpgradesApplied(Gun gun) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Invalid comparison between Unknown and I4 //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) boundGun = gun; isUsingDecayUpgrade = (Object)(object)gun != (Object)null && (int)gun.GunData.damageEffect == 4; if ((Object)(object)gun != (Object)null) { CaptureBaseFireInterval(gun.GunData.fireInterval); } if (data.cycling && (Object)(object)gun != (Object)null) { if ((int)gun.GunData.damageEffect == 0) { gun.GunData.damageEffect = (EffectType)1; } if (gun.GunData.damageEffectAmount <= 0f && data.cyclingEffectAmount > 0f) { gun.GunData.damageEffectAmount = data.cyclingEffectAmount; } TrySetElementSwitch(gun); } BindHooks(gun, bind: true); } public void OnUpgradesCleared(Gun gun) { BindHooks(gun, bind: false); ResetUpgradeRuntimeState(); } private void BindHooks(Gun gun, bool bind) { //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Expected O, but got Unknown //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Expected O, but got Unknown //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Expected O, but got Unknown //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Expected O, but got Unknown //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Expected O, but got Unknown //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Expected O, but got Unknown //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Expected O, but got Unknown //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0211: 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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Expected O, but got Unknown //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Expected O, but got Unknown //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Expected O, but got Unknown //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Expected O, but got Unknown //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Expected O, but got Unknown //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Expected O, but got Unknown //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00da: 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_028a: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Expected O, but got Unknown //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Expected O, but got Unknown //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Expected O, but got Unknown //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Expected O, but got Unknown if ((Object)(object)gun == (Object)null || (bind && hooksBound) || (!bind && !hooksBound)) { return; } try { if (bind) { gun.OnKillTarget = (KillCallback)Delegate.Combine((Delegate?)(object)gun.OnKillTarget, (Delegate?)new KillCallback(HandleOnKill)); gun.OnBeforeDamage = (MutableDamageCallback)Delegate.Combine((Delegate?)(object)gun.OnBeforeDamage, (Delegate?)new MutableDamageCallback(HandleOnBeforeDamage)); gun.OnSaturateTarget = (EffectCallback)Delegate.Combine((Delegate?)(object)gun.OnSaturateTarget, (Delegate?)new EffectCallback(HandleOnSaturate)); gun.OnDamageTarget = (DamageCallback)Delegate.Combine((Delegate?)(object)gun.OnDamageTarget, (Delegate?)new DamageCallback(HandleGunDamageTarget)); if ((Object)(object)gun.Player != (Object)null) { Player player = gun.Player; player.OnSetMovementSpeed += (RefAction)HandleSetMoveSpeed; if (data.overheatDamageReduction > 0f && data.overheatDamageReduction < 1f) { gun.Player.OnBeforeTakeDamage += OnBeforePlayerTakeDamage; playerDamageHookBound = true; } if (data.siphonMaxHeatPer60 > 0f || data.siphonHeatRefundPer60 > 0f) { gun.Player.OnDamageTarget = (DamageCallback)Delegate.Combine((Delegate?)(object)gun.Player.OnDamageTarget, (Delegate?)new DamageCallback(HandlePlayerDamageDealt)); playerDamageDealtHookBound = true; } } hooksBound = true; return; } gun.OnKillTarget = (KillCallback)Delegate.Remove((Delegate?)(object)gun.OnKillTarget, (Delegate?)new KillCallback(HandleOnKill)); gun.OnBeforeDamage = (MutableDamageCallback)Delegate.Remove((Delegate?)(object)gun.OnBeforeDamage, (Delegate?)new MutableDamageCallback(HandleOnBeforeDamage)); gun.OnSaturateTarget = (EffectCallback)Delegate.Remove((Delegate?)(object)gun.OnSaturateTarget, (Delegate?)new EffectCallback(HandleOnSaturate)); gun.OnDamageTarget = (DamageCallback)Delegate.Remove((Delegate?)(object)gun.OnDamageTarget, (Delegate?)new DamageCallback(HandleGunDamageTarget)); if ((Object)(object)gun.Player != (Object)null) { Player player2 = gun.Player; player2.OnSetMovementSpeed -= (RefAction)HandleSetMoveSpeed; if (playerDamageHookBound) { gun.Player.OnBeforeTakeDamage -= OnBeforePlayerTakeDamage; playerDamageHookBound = false; } if (playerDamageDealtHookBound) { gun.Player.OnDamageTarget = (DamageCallback)Delegate.Remove((Delegate?)(object)gun.Player.OnDamageTarget, (Delegate?)new DamageCallback(HandlePlayerDamageDealt)); playerDamageDealtHookBound = false; } } hooksBound = false; } catch (Exception ex) { ManualLogSource logger = SparrohPlugin.Logger; if (logger != null) { logger.LogDebug((object)$"[CyclerRework] BindHooks({bind}) failed: {ex.Message}"); } } } public void AddHeatFromShot(int numBullets, Gun gun) { if (numBullets <= 0) { return; } lastShotTime = Time.time; float num = data.heatPerShot; if (data.closedLoopHeatPerShotMult > 0f && data.closedLoopHeatPerShotMult < 1f && Time.time < closedLoopEfficiencyUntil) { num *= data.closedLoopHeatPerShotMult; } if (data.braidHeatPerShotMult > 0f && data.braidHeatPerShotMult < 1f && Time.time < braidEfficiencyUntil) { num *= data.braidHeatPerShotMult; } if (data.cyclePhasing && lockedPhaseMode == 4) { num *= 1.25f * Mathf.Max(0.1f, data.cyclePhasingStrength); } float num2 = num * (float)numBullets; if (!(num2 <= 0f)) { float num3 = data.maxHeat; if (data.infinityBurn) { num3 = ((data.infinityBurnHardCap > 0f) ? data.infinityBurnHardCap : (data.maxHeat * 2f)); } else if (data.cyclePhasing && lockedPhaseMode == 7) { num3 = data.maxHeat * 1.2f; } CurrentHeat = Mathf.Min(num3, CurrentHeat + num2); SyncFireLock(gun); } } public void OnShotFired(int numBullets, Gun gun) { //IL_0116: 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_0133: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)gun == (Object)null || !((NetworkBehaviour)gun).IsOwner) { return; } if (!gun.IsFiring) { totalShotsFiredSinceStartedFiring = 0f; } if (data.cyclePhasing && !phaseLockedThisSpray) { LockPhaseModeForSpray(gun); } if (data.healOnSustainedFire > 0f) { totalShotsFiredSinceStartedFiring += 1f; int num = Mathf.Max(1, data.healShotsInterval); if ((int)totalShotsFiredSinceStartedFiring % num == 0) { float num2 = data.healOnSustainedFire; if (HeatNormalized >= ((data.hotThreshold > 0f) ? data.hotThreshold : 0.7f)) { num2 *= 1.5f; } try { Player player = gun.Player; if (player != null) { player.Heal(num2, (IDamageSource)(object)gun); } gun.TriggerEffectHeal((EffectType)5); } catch { } } } if (!data.cycling) { return; } firedShotCount++; if (firedShotCount < 3) { return; } firedShotCount = 0; int num3 = (sbyte)(gun.GunData.damageEffect + 1); if (num3 > 3) { num3 = 1; } if (num3 < 1) { num3 = 1; } gun.GunData.damageEffect = (EffectType)(sbyte)num3; TrySetElementSwitch(gun); try { gun.RefreshHUD(); } catch { } } public void Tick(float dt, Gun gun) { //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)gun == (Object)null || dt <= 0f) { return; } if (wasFiring && !gun.IsFiring) { totalShotsFiredSinceStartedFiring = 0f; EndPhaseSpray(gun); } if (data.cyclePhasing && gun.IsFiring && !phaseLockedThisSpray && ((NetworkBehaviour)gun).IsOwner) { LockPhaseModeForSpray(gun); } wasFiring = gun.IsFiring; Vent.Tick(dt, gun); TickClosedLoop(dt, gun); TickRocketSlide(dt, gun); TickProjectileArcs(dt, gun); TickCyclePhasing(dt, gun); float effectiveDissipatePerSecond = EffectiveDissipatePerSecond; if ((!gun.IsFiring || Vent.HasDissipateDelayBypass) && effectiveDissipatePerSecond > 0f && CurrentHeat > 0f) { float num = data.dissipateDelay; if (data.aimDissipateDelayMult > 0f && data.aimDissipateDelayMult < 1f && gun.IsAiming) { num *= data.aimDissipateDelayMult; } if (Vent.HasDissipateDelayBypass || Time.time - lastShotTime >= num) { CurrentHeat = Mathf.Max(0f, CurrentHeat - effectiveDissipatePerSecond * dt); } } if (toxinStacks > 0 && CurrentHeat <= 0.0001f) { toxinStacks = 0; } if (superheatStacks > 0 && data.superheatFalloffSeconds > 0f && Time.time - lastSuperheatTime >= data.superheatFalloffSeconds) { superheatStacks = 0; } ApplyDynamicFireStats(gun); if (data.infinityBurn && IsOvercapped && ((NetworkBehaviour)gun).IsOwner && (Object)(object)gun.Player != (Object)null) { float infinityBurnDamagePerSecond = data.infinityBurnDamagePerSecond; if (infinityBurnDamagePerSecond > 0f) { try { float num2 = infinityBurnDamagePerSecond * dt; float num3 = data.infinityBurnEffectPerSecond * dt; IDamageSource.DamageTarget((IDamageSource)(object)gun, (ITarget)(object)gun.Player, new DamageData(num2, gun.GunData.damageEffect, num3, (DamageFlags)1), gun.Player.InterpolatedPosition, (Collider)null); } catch (Exception ex) { ManualLogSource logger = SparrohPlugin.Logger; if (logger != null) { logger.LogDebug((object)("[CyclerRework] Infinity Burn self-DoT failed: " + ex.Message)); } } } } SyncFireLock(gun); TryApplyOverheatVisual(gun); } public void ModifyRecoilMultiplier(Gun gun, ref float multiplier) { if (data.aimRecoilMultiplier > 0f && (Object)(object)gun != (Object)null && gun.IsAiming) { multiplier *= data.aimRecoilMultiplier; } } public void ApplyDynamicFireStats(Gun gun) { if ((Object)(object)gun == (Object)null) { return; } if (baseFireIntervalCaptured <= 0f) { CaptureBaseFireInterval(gun.GunData.fireInterval); } HeatStatLayers.ApplyFireIntervalLayers(gun, in data, CurrentHeat, HeatNormalized, baseFireIntervalCaptured, out massAccelAppliedInterval); if (baseBulletSpeedCaptured <= 0f) { try { IUpgradable prefab = gun.Prefab; IWeapon val = (IWeapon)(object)((prefab is IWeapon) ? prefab : null); if (val != null && val.GunData.bulletSpeed > 0f) { baseBulletSpeedCaptured = val.GunData.bulletSpeed; } else if (gun.GunData.bulletSpeed > 0f) { baseBulletSpeedCaptured = gun.GunData.bulletSpeed; } } catch { } } HeatStatLayers.ApplyLiteEnergyBulletSpeed(gun, in data, baseFireIntervalCaptured, baseBulletSpeedCaptured); } public void SyncFireLock(Gun gun) { if ((Object)(object)gun == (Object)null || !((NetworkBehaviour)gun).IsOwner) { return; } if (Vent.IsFireHitched) { if (gun.RemainingAmmo > 0f) { gun.RemainingAmmo = 0f; } } else if (gun.RemainingAmmo < 1f || gun.GunData.useAmmoOnFire != 0 || gun.GunData.magazineSize != 7777777) { ApplyInfiniteAmmo(gun); } } private void TryApplyOverheatVisual(Gun gun) { try { Renderer[] skinRenderers = gun.SkinRenderers; if (skinRenderers != null && skinRenderers.Length != 0 && !((Object)(object)skinRenderers[0] == (Object)null)) { Material sharedMaterial = skinRenderers[0].sharedMaterial; if (!((Object)(object)sharedMaterial == (Object)null)) { float num = ((IsOvercapped || IsRedline) ? 1f : Mathf.Clamp01(HeatNormalized - 0.15f)); sharedMaterial.SetFloat(Global._Overheat, num); } } } catch { } } private void TrySetElementSwitch(Gun gun) { //IL_0024: 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) try { if (!((Object)(object)gun == (Object)null) && !((Object)(object)gun.playerLook == (Object)null)) { AkUnitySoundEngine.SetSwitch(Global.Element_Switch, Global.GetEffect(gun.GunData.damageEffect).ElementSwitchID, ((Component)gun.playerLook).gameObject); } } catch { } } private void HandleOnBeforeDamage(ref DamageCallbackData callbackData) { if (data.scorchingDetonationRadius > 0f) { isDamagedTargetIgnited = ITarget.IsSaturated(callbackData.target, (EffectType)1); } } private void HandleOnKill(in KillCallbackData callbackData) { //IL_00b9: 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) if (callbackData.damageData.damage <= 0f) { return; } if (data.adrenalineDissipateMultiplier > 1f || data.adrenalineHeatRefund > 0f) { lastKillTime = Time.time; if (data.adrenalineHeatRefund > 0f) { RefundHeat(data.adrenalineHeatRefund); } try { Gun obj = boundGun; if (obj != null) { obj.TriggerEffectBuff((EffectType)0); } } catch { } } if (data.scorchingDetonationRadius <= 0f || !isDamagedTargetIgnited || (Object)(object)boundGun == (Object)null) { return; } try { GameManager.Instance.SpawnExplosionObserverSeeThrough((IDamageSource)(object)boundGun, ((IFollowable)callbackData.target).GetHealthbarPosition(), data.scorchingDetonationRadius, (TargetType)5, new DamageData(data.scorchingDetonationDamage, (DamageFlags)16), ((NetworkBehaviour)boundGun).OwnerClientId, 0f); } catch (Exception ex) { ManualLogSource logger = SparrohPlugin.Logger; if (logger != null) { logger.LogDebug((object)("[CyclerRework] Scorching detonation failed: " + ex.Message)); } } } private void OnBeforePlayerTakeDamage(ref DamageData damageData, ref IDamageSource source) { if (!(data.overheatDamageReduction <= 0f) && !(data.overheatDamageReduction >= 1f)) { HeatZone currentZone = CurrentZone; if (currentZone == HeatZone.Hot || currentZone == HeatZone.Redline || currentZone == HeatZone.Overcap) { damageData.damage *= data.overheatDamageReduction; } } } private void HandleOnSaturate(in EffectCallbackData effectData) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Invalid comparison between Unknown and I4 //IL_0024: 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: Invalid comparison between Unknown and I4 //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Invalid comparison between Unknown and I4 //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Invalid comparison between Unknown and I4 //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Invalid comparison between Unknown and I4 //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Invalid comparison between Unknown and I4 ITarget val = EffectCallbackUtil.TryGetTarget(in effectData); if ((int)effectData.effect == 1 || (int)effectData.effect == 2 || (int)effectData.effect == 3) { NoteElementApplied(effectData.effect); TryAddCatalystStack(); } if ((int)effectData.effect == 2) { if (data.shockHeatRefund > 0f) { RefundHeat(data.shockHeatRefund); } if (data.cyclePhasing && lockedPhaseMode == 2) { RefundHeat(4f * Mathf.Max(0.1f, data.cyclePhasingStrength)); } if (data.crossflashBonusRefund > 0f && val != null && ITarget.IsSaturated(val, (EffectType)1)) { RefundHeat(data.crossflashBonusRefund); TryCrossflashSplash(val); } if (data.acidSparkArcDamage > 0f && val != null && ITarget.IsSaturated(val, (EffectType)3) && toxinStacks > 0) { TryAcidSpark(val); } if (data.overloadSpeedDuration > 0f) { lastOverloadTime = Time.time; try { Gun obj = boundGun; if (obj != null) { obj.TriggerEffectSpeedBoost((EffectType)2); } } catch { } } } if ((int)effectData.effect == 3) { TryAddToxinStack(); } if ((int)effectData.effect == 1) { if (data.superheatElementPerStack > 0f && data.superheatMaxStacks > 0) { superheatStacks = Mathf.Min(data.superheatMaxStacks, superheatStacks + 1); lastSuperheatTime = Time.time; } if (data.pyrolysisRadius > 0f && val != null && ITarget.IsSaturated(val, (EffectType)3)) { TryPyrolysis(val); } } } private void TryCrossflashSplash(ITarget target) { //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_0062: 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) if ((Object)(object)boundGun == (Object)null || target == null) { return; } try { Vector3 healthbarPosition = ((IFollowable)target).GetHealthbarPosition(); float num = ((data.crossflashSplashRadius > 0f) ? data.crossflashSplashRadius : 3f); float crossflashSplashDamage = data.crossflashSplashDamage; float crossflashSplashFire = data.crossflashSplashFire; GameManager.Instance.SpawnExplosionObserverSeeThrough((IDamageSource)(object)boundGun, healthbarPosition, num, (TargetType)5, new DamageData(crossflashSplashDamage, (EffectType)1, crossflashSplashFire, (DamageFlags)16), ((NetworkBehaviour)boundGun).OwnerClientId, 0f); } catch (Exception ex) { ManualLogSource logger = SparrohPlugin.Logger; if (logger != null) { logger.LogDebug((object)("[CyclerRework] Crossflash splash failed: " + ex.Message)); } } } private void TryPyrolysis(ITarget target) { //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_0056: 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) if ((Object)(object)boundGun == (Object)null || target == null) { return; } try { Vector3 healthbarPosition = ((IFollowable)target).GetHealthbarPosition(); float num = ((data.pyrolysisRadius > 0f) ? data.pyrolysisRadius : 2.8f); float pyrolysisDamage = data.pyrolysisDamage; GameManager.Instance.SpawnExplosionObserverSeeThrough((IDamageSource)(object)boundGun, healthbarPosition, num, (TargetType)5, new DamageData(pyrolysisDamage, (EffectType)1, pyrolysisDamage * 0.25f, (DamageFlags)16), ((NetworkBehaviour)boundGun).OwnerClientId, 0f); int num2 = Mathf.Max(1, data.pyrolysisBankStacks); if (data.toxinMaxStacks > 0) { toxinStacks = Mathf.Min(data.toxinMaxStacks, toxinStacks + num2); } else { toxinStacks += num2; } } catch (Exception ex) { ManualLogSource logger = SparrohPlugin.Logger; if (logger != null) { logger.LogDebug((object)("[CyclerRework] Pyrolysis failed: " + ex.Message)); } } } private void TickClosedLoop(float dt, Gun gun) { if (data.closedLoopVentHeat <= 0f || data.closedLoopSustainSeconds <= 0f) { redlineSustainTimer = 0f; return; } bool flag = IsRedline || IsOvercapped; if (gun.IsFiring && flag) { redlineSustainTimer += dt; } else { redlineSustainTimer = 0f; } if (redlineSustainTimer < data.closedLoopSustainSeconds) { return; } redlineSustainTimer = 0f; float num = SpendHeatUpTo(data.closedLoopVentHeat); if (!(num <= 0f)) { if (data.closedLoopEfficiencyDuration > 0f) { closedLoopEfficiencyUntil = Time.time + data.closedLoopEfficiencyDuration; } try { gun.TriggerEffectReload((EffectType)0); } catch { } ManualLogSource logger = SparrohPlugin.Logger; if (logger != null) { logger.LogDebug((object)$"[CyclerRework] Closed Loop micro-vent −{num:0.#} heat"); } } } private void HandlePlayerDamageDealt(in DamageCallbackData callbackData) { if ((Object)(object)boundGun == (Object)null || callbackData.damageData.damage <= 0f || (data.siphonMaxHeatPer60 <= 0f && data.siphonHeatRefundPer60 <= 0f)) { return; } try { IDamageSource val = callbackData.source; while (val != null && val.ParentSource != null && (object)val.ParentSource != boundGun.Player) { val = val.ParentSource; } if (val == null || (object)val == boundGun) { return; } siphonDamageAccumulator += callbackData.damageData.damage; int num = Mathf.FloorToInt(siphonDamageAccumulator) / 60; if (num > 0) { siphonDamageAccumulator -= num * 60; if (data.siphonHeatRefundPer60 > 0f) { RefundHeat((float)num * data.siphonHeatRefundPer60); } else if (data.siphonMaxHeatPer60 > 0f) { data.maxHeat += (float)num * data.siphonMaxHeatPer60; } } } catch { } } private void HandleGunDamageTarget(in DamageCallbackData callbackData) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Invalid comparison between Unknown and I4 //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Invalid comparison between Unknown and I4 //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) if (data.energyConvHeatPerStack > 0f && (int)callbackData.damageData.effect > 0 && callbackData.damageData.effectAmount == 0f) { energyConvCounter++; int num = energyConvCounter / 4; if (num > 0) { energyConvCounter -= num * 4; energyConvStoredStacks += num; } } if (data.cyclePhasing && lockedPhaseMode == 0) { TryPhaseCoolantRefund(); } if (data.cyclePhasing && lockedPhaseMode == 3 && callbackData.damageData.damage > 0f) { float num2 = 0.18f * Mathf.Max(0.1f, data.cyclePhasingStrength); if (Random.value < num2) { int num3 = ((data.toxinMaxStacks > 0) ? data.toxinMaxStacks : 8); toxinStacks = Mathf.Min(num3, toxinStacks + 1); } } if (callbackData.target != null && (Object)(object)boundGun != (Object)null && (data.triValveFire > 0f || data.triValveShock > 0f || data.triValveAcid > 0f)) { ApplyTriValveStatus(callbackData.target); } if (data.violentRadius > 0f && (Object)(object)boundGun != (Object)null && callbackData.target != null) { try { int num4 = 0; for (int i = 1; i <= 3; i++) { if (ITarget.IsSaturated(callbackData.target, (EffectType)(sbyte)i)) { num4++; } } if (num4 >= 2) { Vector3 healthbarPosition = ((IFollowable)callbackData.target).GetHealthbarPosition(); GameManager.Instance.SpawnExplosionObserverSeeThrough((IDamageSource)(object)boundGun, healthbarPosition, data.violentRadius, (TargetType)5, new DamageData(0f, boundGun.GunData.damageEffect, data.violentEffectAmount, (DamageFlags)16), ((NetworkBehaviour)boundGun).OwnerClientId, 0f); } } catch (Exception ex) { ManualLogSource logger = SparrohPlugin.Logger; if (logger != null) { logger.LogDebug((object)("[CyclerRework] Violent Reaction failed: " + ex.Message)); } } } if (!(data.toxinDamagePerStack <= 0f) && data.toxinMaxStacks > 0 && (int)callbackData.damageData.effect == 3 && !(callbackData.damageData.effectAmount <= 0f)) { TryAddToxinStack(); } } private void ApplyTriValveStatus(ITarget target) { if ((Object)(object)boundGun == (Object)null || target == null) { return; } try { if (data.triValveFire > 0f) { target.ApplyStatusEffect((EffectType)1, data.triValveFire, (IDamageSource)(object)boundGun, (DamageFlags)0); NoteElementApplied((EffectType)1); } if (data.triValveShock > 0f) { target.ApplyStatusEffect((EffectType)2, data.triValveShock, (IDamageSource)(object)boundGun, (DamageFlags)0); NoteElementApplied((EffectType)2); } if (data.triValveAcid > 0f) { target.ApplyStatusEffect((EffectType)3, data.triValveAcid, (IDamageSource)(object)boundGun, (DamageFlags)0); NoteElementApplied((EffectType)3); } } catch (Exception ex) { ManualLogSource logger = SparrohPlugin.Logger; if (logger != null) { logger.LogDebug((object)("[CyclerRework] Tri-Valve status apply failed: " + ex.Message)); } } } private void NoteElementApplied(EffectType element) { //IL_0006: 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_001a: Expected I4, but got Unknown float time = Time.time; switch (element - 1) { default: return; case 0: lastFireApplyTime = time; break; case 1: lastShockApplyTime = time; break; case 2: lastAcidApplyTime = time; break; } if (data.braidWindowSeconds <= 0f || data.braidHeatPerShotMult <= 0f) { return; } float braidWindowSeconds = data.braidWindowSeconds; if (time - lastFireApplyTime <= braidWindowSeconds && time - lastShockApplyTime <= braidWindowSeconds && time - lastAcidApplyTime <= braidWindowSeconds) { float num = ((data.braidEfficiencyDuration > 0f) ? data.braidEfficiencyDuration : 2f); braidEfficiencyUntil = time + num; lastFireApplyTime = -999f; lastShockApplyTime = -999f; lastAcidApplyTime = -999f; ManualLogSource logger = SparrohPlugin.Logger; if (logger != null) { logger.LogDebug((object)$"[CyclerRework] Braid Protocol efficiency {num:0.#}s"); } } } private void TryAddCatalystStack() { if (data.catalystMaxStacks > 0) { float time = Time.time; if (catalystStacks > 0 && time >= catalystExpireTime) { catalystStacks = 0; } catalystStacks = Mathf.Min(data.catalystMaxStacks, catalystStacks + 1); float num = ((data.catalystStackDuration > 0f) ? data.catalystStackDuration : 4.5f); catalystExpireTime = time + num; } } public void ConsumeCatalystForVent(out float damageAdd, out float radiusAdd) { damageAdd = 0f; radiusAdd = 0f; if (catalystStacks > 0 && data.catalystMaxStacks > 0) { if (Time.time >= catalystExpireTime) { catalystStacks = 0; return; } int num = catalystStacks; catalystStacks = 0; catalystExpireTime = -999f; damageAdd = (float)num * Mathf.Max(0f, data.catalystVentDamagePerStack); radiusAdd = (float)num * Mathf.Max(0f, data.catalystVentRadiusPerStack); } } public bool TrySpendToxinBankStack() { if (toxinStacks <= 0) { return false; } toxinStacks--; return true; } private void TryAcidSpark(ITarget sourceTarget) { //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_014f: 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_0141: 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_0086: 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_00a7: 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) if ((Object)(object)boundGun == (Object)null || sourceTarget == null || !TrySpendToxinBankStack()) { return; } try { Vector3 healthbarPosition = ((IFollowable)sourceTarget).GetHealthbarPosition(); float num = ((data.acidSparkArcRadius > 0f) ? data.acidSparkArcRadius : 7f); float acidSparkArcDamage = data.acidSparkArcDamage; float num2 = ((data.acidSparkShockAmount > 0f) ? data.acidSparkShockAmount : (acidSparkArcDamage * 0.4f)); int num3 = LayerMask.op_Implicit(boundGun.GunData.targetCollisionMask); Collider[] array = Physics.OverlapSphere(healthbarPosition, num, num3); ITarget val = null; float num4 = float.MaxValue; Vector3 val2 = healthbarPosition; foreach (Collider val3 in array) { if ((Object)(object)val3 == (Object)null) { continue; } ITarget target = IDamageSource.GetTarget((Component)(object)val3); if (target == null || target == sourceTarget) { continue; } try { if (target.IsPlayer()) { continue; } } catch { } Vector3 val4; try { val4 = ((IFollowable)target).GetHealthbarPosition(); } catch { Bounds bounds = val3.bounds; val4 = ((Bounds)(ref bounds)).center; } Vector3 val5 = val4 - healthbarPosition; float sqrMagnitude = ((Vector3)(ref val5)).sqrMagnitude; if (sqrMagnitude < num4) { num4 = sqrMagnitude; val = target; val2 = val4; } } if (val == null) { val2 = healthbarPosition; } GameManager.Instance.SpawnExplosionObserverSeeThrough((IDamageSource)(object)boundGun, val2, 0.9f, (TargetType)5, new DamageData(acidSparkArcDamage, (EffectType)2, num2, (DamageFlags)16), ((NetworkBehaviour)boundGun).OwnerClientId, 0f); } catch (Exception ex) { ManualLogSource logger = SparrohPlugin.Logger; if (logger != null) { logger.LogDebug((object)("[CyclerRework] Acid Spark failed: " + ex.Message)); } } } private void TryAddToxinStack() { if (!(data.toxinDamagePerStack <= 0f) && data.toxinMaxStacks > 0) { toxinStacks = Mathf.Min(data.toxinMaxStacks, toxinStacks + 1); } } public void ModifyOutgoingBullet(ref BulletData bullet) { if (toxinStacks > 0 && data.toxinDamagePerStack > 0f) { bullet.damage += (float)toxinStacks * data.toxinDamagePerStack; } if (superheatStacks > 0 && data.superheatElementPerStack > 0f) { bullet.damageEffectAmount += (float)superheatStacks * data.superheatElementPerStack; } if (data.fullOutputDamagePerRarity > 0f && (Object)(object)boundGun != (Object)null) { int num = CountDistinctEquippedRarities((IGear)(object)boundGun); if (num > 0) { bullet.damage += data.fullOutputDamagePerRarity * (float)num; } } HeatZone currentZone = CurrentZone; HeatStatLayers.ApplyZoneToBullet(ref bullet, in data, currentZone, HeatNormalized); HeatStatLayers.ApplyRedlineSpreadToBullet(ref bullet, in data, currentZone); if (data.cyclePhasing && !phaseLockedThisSpray && (Object)(object)boundGun != (Object)null && ((NetworkBehaviour)boundGun).IsOwner) { LockPhaseModeForSpray(boundGun); } ApplyCyclePhasingToBullet(ref bullet); } public bool TryTapReload(Gun gun) { return Vent.TryHeatAbility(gun); } public bool TryConsumeEnergyConvergence(Gun gun) { if (data.energyConvHeatPerStack <= 0f || energyConvStoredStacks <= 0) { return false; } float num = (float)energyConvStoredStacks * data.energyConvHeatPerStack; energyConvStoredStacks = 0; AddHeat(num); try { gun.TriggerEffectReload((EffectType)0); } catch { } ManualLogSource logger = SparrohPlugin.Logger; if (logger != null) { logger.LogInfo((object)$"[CyclerRework] Energy Convergence → +{num:0.#} heat"); } return true; } public void OnBulletFired(IBullet bullet) { if (!(data.arcDamage <= 0f) && bullet != null && !bullet.IsContinuous && bullet is Component) { if (trackedArcBullets.Count > 24) { trackedArcBullets.RemoveAt(0); } trackedArcBullets.Add(bullet); } } public static int CountDistinctEquippedRarities(IGear gear) { //IL_0044: 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) try { HashSet hashSet = new HashSet(); List list = ((gear != null) ? gear.ActiveUpgrades : null); if (list == null) { return 0; } for (int i = 0; i < list.Count; i++) { UpgradeInstance val = list[i]; if (!((Object)(object)((val != null) ? val.Upgrade : null) == (Object)null) && val.Upgrade.ID.ID != 92048) { hashSet.Add(val.Upgrade.Rarity); } } return hashSet.Count; } catch { return 0; } } private void HandleSetMoveSpeed(ref float speed) { if (!(data.overloadSpeedDuration <= 0f) && Time.time - lastOverloadTime < data.overloadSpeedDuration) { speed += data.overloadSpeedIncrease; } } public void OnFirePressedWhileHot(Gun gun) { } private void TickProjectileArcs(float dt, Gun gun) { //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0181: 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) if (data.arcDamage <= 0f || data.arcRadius <= 0f || Time.time - lastArcTime < Mathf.Max(0.12f, data.arcInterval)) { return; } for (int num = trackedArcBullets.Count - 1; num >= 0; num--) { IBullet val = trackedArcBullets[num]; if (val == null) { trackedArcBullets.RemoveAt(num); } else { Component val2 = (Component)(object)((val is Component) ? val : null); if (val2 != null && ((Object)(object)val2 == (Object)null || !val2.gameObject.activeInHierarchy)) { trackedArcBullets.RemoveAt(num); } } } if (trackedArcBullets.Count == 0) { if (gun.IsFiring && Time.time - arcIdleLogTime > 3f) { arcIdleLogTime = Time.time; ManualLogSource logger = SparrohPlugin.Logger; if (logger != null) { logger.LogWarning((object)"[CyclerRework] Condensed arcs idle — no tracked projectiles. Plasma prefab may not have applied (check resolve log)."); } } return; } lastArcTime = Time.time; float radius = ((data.arcRadius > 0f) ? data.arcRadius : 7f); float arcDamage = data.arcDamage; int targetMask = LayerMask.op_Implicit(gun.GunData.targetCollisionMask); for (int i = 0; i < trackedArcBullets.Count; i++) { try { IBullet obj = trackedArcBullets[i]; Component val3 = (Component)(object)((obj is Component) ? obj : null); if (val3 != null && !((Object)(object)val3 == (Object)null)) { Vector3 position = val3.transform.position; SpawnLightningArcFromProjectile(gun, position, radius, arcDamage, targetMask); } } catch { } } } private void SpawnLightningArcFromProjectile(Gun gun, Vector3 origin, float radius, float damage, int targetMask) { //IL_0000: 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_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: 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_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0086: 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_00d4: 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_00b5: 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) Collider[] array = Physics.OverlapSphere(origin, radius, targetMask); ITarget val = null; float num = float.MaxValue; Vector3 val2 = origin; foreach (Collider val3 in array) { if ((Object)(object)val3 == (Object)null) { continue; } ITarget target = IDamageSource.GetTarget((Component)(object)val3); if (target == null) { continue; } try { if (target.IsPlayer()) { continue; } } catch { } Vector3 val4; try { val4 = ((IFollowable)target).GetHealthbarPosition(); } catch { Bounds bounds = val3.bounds; val4 = ((Bounds)(ref bounds)).center; } Vector3 val5 = val4 - origin; float sqrMagnitude = ((Vector3)(ref val5)).sqrMagnitude; if (sqrMagnitude < num) { num = sqrMagnitude; val = target; val2 = val4; } } if (val == null) { return; } try { DamageData val6 = default(DamageData); ((DamageData)(ref val6))..ctor(damage, (EffectType)2, damage * 0.4f, (DamageFlags)16); GameManager.Instance.SpawnExplosionObserverSeeThrough((IDamageSource)(object)gun, val2, 0.85f, (TargetType)5, val6, ((NetworkBehaviour)gun).OwnerClientId, 0f); } catch { } try { SpawnArcLineVisual(origin, val2); } catch { } } private static void SpawnArcLineVisual(Vector3 start, Vector3 end) { //IL_0005: 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_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0030: 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_009b: Expected O, but got Unknown //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Expected O, but got Unknown //IL_00c9: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("HeatCycler_PlasmaArc") { hideFlags = (HideFlags)61 }; LineRenderer obj = val.AddComponent(); obj.positionCount = 2; obj.useWorldSpace = true; obj.SetPosition(0, start); obj.SetPosition(1, end); obj.startWidth = 0.045f; obj.endWidth = 0.02f; obj.numCapVertices = 2; ((Renderer)obj).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)obj).receiveShadows = false; Material val2 = new Material(Shader.Find("Universal Render Pipeline/Unlit") ?? Shader.Find("Unlit/Color") ?? Shader.Find("Sprites/Default") ?? Shader.Find("Standard")); Color val3 = default(Color); ((Color)(ref val3))..ctor(0.45f, 0.85f, 1f, 0.9f); if (val2.HasProperty("_BaseColor")) { val2.SetColor("_BaseColor", val3); } val2.color = val3; ((Renderer)obj).sharedMaterial = val2; obj.startColor = val3; obj.endColor = new Color(0.7f, 0.95f, 1f, 0.35f); Object.Destroy((Object)val, 0.12f); } private void TickRocketSlide(float dt, Gun gun) { if (!(data.rocketSlideHeatCost <= 0f) && !((Object)(object)gun.Player == (Object)null)) { bool flag = false; try { flag = gun.Player.Sliding; } catch { return; } if (flag && !(CurrentHeat < data.rocketSlideHeatCost) && !(Time.time - lastRocketSlideTime < Mathf.Max(0.15f, data.rocketSlideInterval))) { lastRocketSlideTime = Time.time; SpendHeatUpTo(data.rocketSlideHeatCost); FireRocketSalvo(gun); } } } private void FireRocketSalvo(Gun gun) { //IL_008a: 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_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: 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_00b8: 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_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) try { RocketSalvoBullet prefab = null; CartridgeSMG val = (CartridgeSMG)(object)((gun is CartridgeSMG) ? gun : null); if (val != null) { FieldInfo fieldInfo = AccessTools.Field(typeof(CartridgeSMG), "rocketBulletPrefab"); if (fieldInfo != null) { ref RocketSalvoBullet reference = ref prefab; object? value = fieldInfo.GetValue(val); reference = (RocketSalvoBullet)((value is RocketSalvoBullet) ? value : null); } if ((Object)(object)prefab == (Object)null) { IUpgradable prefab2 = ((Gun)val).Prefab; CartridgeSMG val2 = (CartridgeSMG)(object)((prefab2 is CartridgeSMG) ? prefab2 : null); if (val2 != null) { ref RocketSalvoBullet reference2 = ref prefab; object? obj = fieldInfo?.GetValue(val2); reference2 = (RocketSalvoBullet)((obj is RocketSalvoBullet) ? obj : null); } } } Vector3 val3 = ((Component)gun).transform.position + ((Component)gun).transform.forward * 1.2f + Vector3.up * 0.25f; Quaternion rotation = ((Component)gun).transform.rotation; if ((Object)(object)prefab != (Object)null) { BulletData bulletData = ((GunData)(ref gun.GunData)).GetBulletData(ref val3, ref rotation); bulletData.speed = 110f; bulletData.gravity = 33f; bulletData.force = ((data.rocketSlideRadius > 0f) ? data.rocketSlideRadius : 1.5f); if (data.rocketSlideDamage > 0f) { bulletData.damage = data.rocketSlideDamage; } RocketSalvoBullet val4 = SimplePool.Get(prefab, (Transform)null); val4.UpgradeFlags = gun.UpgradeFlags; val4.Initialize(bulletData, (IDamageSource)(object)gun, (Action)delegate(IBullet b) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown SimplePool.Release(prefab, (RocketSalvoBullet)b); }, (BulletFlags)11); RaycastHit val5 = default(RaycastHit); if (Physics.Raycast(val3, ((Component)gun).transform.forward, ref val5, 80f, LayerMask.op_Implicit(gun.GunData.targetCollisionMask))) { ITarget target = IDamageSource.GetTarget((Component)(object)((RaycastHit)(ref val5)).collider); if (target != null) { Vector3 val6 = ((ISelectable)target).transform.InverseTransformPoint(((RaycastHit)(ref val5)).point); val4.SetTarget(target, val6, -1f); } } } else { GameManager.Instance.SpawnExplosionObserverSeeThrough((IDamageSource)(object)gun, val3 + ((Component)gun).transform.forward * 10f, Mathf.Max(1.5f, data.rocketSlideRadius), (TargetType)5, new DamageData(Mathf.Max(20f, data.rocketSlideDamage), (DamageFlags)16), ((NetworkBehaviour)gun).OwnerClientId, 0f); } } catch (Exception ex) { ManualLogSource logger = SparrohPlugin.Logger; if (logger != null) { logger.LogDebug((object)("[CyclerRework] Rocket slide failed: " + ex.Message)); } } } private void LockPhaseModeForSpray(Gun gun) { if (phaseLockedThisSpray) { return; } int num = PhaseModeNames.Length; lockedPhaseMode = Mathf.Clamp(nextPhaseMode, 0, num - 1); nextPhaseMode = (lockedPhaseMode + 1) % num; phaseLockedThisSpray = true; phaseCoolantRefundThisSec = 0f; phaseCoolantSecBucket = Mathf.Floor(Time.time); phaseBleedOffTimer = 0f; float num2 = Mathf.Max(0.1f, data.cyclePhasingStrength); if (lockedPhaseMode == 4 && (Object)(object)gun != (Object)null) { try { if (phaseBaseBulletsPerShot < 0) { phaseBaseBulletsPerShot = gun.GunData.bulletsPerShot; } int num3 = Mathf.Max(1, Mathf.RoundToInt(num2)); gun.GunData.bulletsPerShot = phaseBaseBulletsPerShot + num3; } catch { } } string lockedPhaseModeName = LockedPhaseModeName; ManualLogSource logger = SparrohPlugin.Logger; if (logger != null) { logger.LogInfo((object)("[CyclerRework] Cycle Phasing locked: " + lockedPhaseModeName + " (next: " + PhaseModeNames[nextPhaseMode] + ")")); } try { if (gun != null) { gun.TriggerEffectBuff((EffectType)0); } } catch { } } private void EndPhaseSpray(Gun gun) { if (lockedPhaseMode == 4 && (Object)(object)gun != (Object)null && phaseBaseBulletsPerShot >= 0) { try { gun.GunData.bulletsPerShot = phaseBaseBulletsPerShot; } catch { } } if (lockedPhaseMode == 7 && !data.infinityBurn && CurrentHeat > data.maxHeat) { CurrentHeat = data.maxHeat; } lockedPhaseMode = -1; phaseLockedThisSpray = false; phaseCoolantRefundThisSec = 0f; phaseBleedOffTimer = 0f; phaseBaseBulletsPerShot = -1; } private void TickCyclePhasing(float dt, Gun gun) { //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: 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_00a7: 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_00b2: 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_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: 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_00d9: Unknown result type (might be due to invalid IL or missing references) if (!data.cyclePhasing || !phaseLockedThisSpray || lockedPhaseMode < 0) { return; } float num = Mathf.Max(0.1f, data.cyclePhasingStrength); if (lockedPhaseMode == 6 && (Object)(object)gun != (Object)null && gun.IsFiring) { phaseBleedOffTimer += dt; if (phaseBleedOffTimer >= 0.5f) { phaseBleedOffTimer = 0f; if (SpendHeatUpTo(5f * num) > 0f) { try { VanillaCyclerAssets.TryGetMuzzle(gun, out var origin, out var forward); Vector3 val = origin + forward * 12f; RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(origin, forward, ref val2, 40f, LayerMask.op_Implicit(gun.GunData.targetCollisionMask))) { val = ((RaycastHit)(ref val2)).point; } GameManager.Instance.SpawnExplosionObserverSeeThrough((IDamageSource)(object)gun, val, 1.4f, (TargetType)5, new DamageData(8f * num, (DamageFlags)16), ((NetworkBehaviour)gun).OwnerClientId, 0f); } catch { } } } } if (lockedPhaseMode != 7 || !(CurrentHeat > data.maxHeat + 0.01f) || !((Object)(object)gun != (Object)null) || !((NetworkBehaviour)gun).IsOwner || !((Object)(object)gun.Player != (Object)null)) { return; } try { float num2 = 6f * num * dt; IDamageSource.DamageTarget((IDamageSource)(object)gun, (ITarget)(object)gun.Player, new DamageData(num2, (EffectType)1, 0f, (DamageFlags)1), gun.Player.InterpolatedPosition, (Collider)null); } catch { } } private void TryPhaseCoolantRefund() { float num = Mathf.Floor(Time.time); if (!Mathf.Approximately(num, phaseCoolantSecBucket)) { phaseCoolantSecBucket = num; phaseCoolantRefundThisSec = 0f; } float num2 = Mathf.Max(0.1f, data.cyclePhasingStrength); float num3 = 0.75f * num2; float num4 = 8f * num2; if (!(phaseCoolantRefundThisSec >= num4)) { float num5 = Mathf.Min(num3, num4 - phaseCoolantRefundThisSec); phaseCoolantRefundThisSec += num5; RefundHeat(num5); } } private void ApplyCyclePhasingToBullet(ref BulletData bullet) { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Invalid comparison between Unknown and I4 if (!data.cyclePhasing || lockedPhaseMode < 0) { return; } float num = Mathf.Max(0.1f, data.cyclePhasingStrength); switch ((PhaseMode)lockedPhaseMode) { case PhaseMode.Pyre: bullet.damageEffect = (EffectType)1; bullet.damageEffectAmount += 12f * num; break; case PhaseMode.Storm: bullet.damageEffect = (EffectType)2; bullet.damageEffectAmount += 12f * num; break; case PhaseMode.Solvent: bullet.damageEffect = (EffectType)3; bullet.damageEffectAmount += 10f * num; break; case PhaseMode.Split: bullet.damage *= 1f + 0.05f * num; break; case PhaseMode.Needle: bullet.maxBounces = Mathf.Max(bullet.maxBounces, Mathf.RoundToInt(1f * num)); bullet.speed *= 1f + 0.12f * num; bullet.damage *= 1f + 0.08f * num; break; case PhaseMode.Spike: bullet.damage *= 1f + 0.12f * num; if ((int)bullet.damageEffect > 0) { bullet.damageEffectAmount += 6f * num; } break; case PhaseMode.Coolant: case PhaseMode.BleedOff: break; } } private void OnDestroy() { if ((Object)(object)boundGun != (Object)null) { BindHooks(boundGun, bind: false); } ventSystem?.Destroy(); } public static bool TryGet(IGear gear, out CyclerHeatBehaviour behaviour) { behaviour = null; if ((Object)(object)((gear != null) ? gear.gameObject : null) == (Object)null) { return false; } behaviour = gear.gameObject.GetComponent(); if ((Object)(object)behaviour != (Object)null) { return true; } bool num = (Object)(object)((IUpgradable)gear).Info != (Object)null && (((IUpgradable)gear).Info.APIName == "sparroh_cycler" || ((IUpgradable)gear).Info.ID == 92010); CyclerHeatBehaviour cyclerHeatBehaviour = null; IUpgradable prefab = ((IUpgradable)gear).Prefab; Component val = (Component)(object)((prefab is Component) ? prefab : null); if (val != null) { cyclerHeatBehaviour = val.GetComponent(); } if (!num && (Object)(object)cyclerHeatBehaviour == (Object)null) { return false; } string desc = (((Object)(object)cyclerHeatBehaviour != (Object)null) ? cyclerHeatBehaviour.Description : "A reworked Cycler SMG. Infinite ammo — builds Heat while firing. Ride Soft Redline at max Heat (keep firing, wilder and meaner). Tap R to Pressure Vent."); behaviour = gear.gameObject.AddComponent(); behaviour.InitializeAsPrefab(desc); if ((Object)(object)cyclerHeatBehaviour != (Object)null) { behaviour.CopySnapshotFrom(cyclerHeatBehaviour); } behaviour.CapturePrefabSnapshot(); return true; } public static bool IsOurGear(IUpgradable gear) { if (gear == null) { return false; } if (gear == SparrohPlugin.CustomWeaponPrefab || gear == WeaponRegistration.CatalogGear) { return true; } if ((Object)(object)gear.Info != (Object)null && (gear.Info.APIName == "sparroh_cycler" || gear.Info.ID == 92010)) { return true; } return false; } } internal static class CyclerHeatHooks { [HarmonyPatch(typeof(CartridgeSMG), "OnUpgradesRemoved")] [HarmonyPostfix] private static void OnUpgradesRemovedPostfix(CartridgeSMG __instance) { ResetHeatBaseline((Gun)(object)__instance); } [HarmonyPatch(typeof(Gun), "OnUpgradesRemoved")] [HarmonyPostfix] private static void OnUpgradesRemovedGunPostfix(Gun __instance) { if (!(__instance is CartridgeSMG)) { ResetHeatBaseline(__instance); } } private static void ResetHeatBaseline(Gun gun) { if (CyclerHeatBehaviour.TryGet((IGear)(object)gun, out var behaviour)) { behaviour.SetData(CyclerHeatBehaviour.CreateDataFromConfig()); behaviour.CapturePrefabSnapshot(); behaviour.ResetUpgradeRuntimeState(); } } [HarmonyPatch(typeof(Gun), "OnUpgradesEnabled")] [HarmonyPostfix] private static void OnUpgradesEnabledPostfix(Gun __instance) { if (CyclerHeatBehaviour.TryGet((IGear)(object)__instance, out var behaviour)) { CyclerHeatBehaviour.ApplyInfiniteAmmo(__instance); behaviour.OnUpgradesApplied(__instance); if (behaviour.WeaponData.arcDamage > 0f) { VanillaCyclerAssets.TryApplyPlasmaBullet(__instance); } behaviour.SyncFireLock(__instance); } } [HarmonyPatch(typeof(Gun), "AfterUpgradesEnabled")] [HarmonyPostfix] private static void AfterUpgradesEnabledPostfix(Gun __instance) { if (CyclerHeatBehaviour.TryGet((IGear)(object)__instance, out var behaviour)) { CyclerHeatBehaviour.ApplyInfiniteAmmo(__instance); if (behaviour.WeaponData.arcDamage > 0f) { VanillaCyclerAssets.TryApplyPlasmaBullet(__instance); } behaviour.SyncFireLock(__instance); } } [HarmonyPatch(typeof(Gun), "OnUpgradesDisabled")] [HarmonyPrefix] private static void OnUpgradesDisabledPrefix(Gun __instance) { if (CyclerHeatBehaviour.TryGet((IGear)(object)__instance, out var behaviour)) { behaviour.OnUpgradesCleared(__instance); } } [HarmonyPatch(typeof(CartridgeSMG), "OnFire")] [HarmonyPostfix] private static void CartridgeOnFirePostfix(CartridgeSMG __instance, int numBullets) { try { if (CyclerHeatBehaviour.TryGet((IGear)(object)__instance, out var behaviour) && ((NetworkBehaviour)__instance).IsOwner) { int numBullets2 = Mathf.Max(1, numBullets); behaviour.AddHeatFromShot(numBullets2, (Gun)(object)__instance); behaviour.OnShotFired(numBullets2, (Gun)(object)__instance); PushHeatHud((Gun)(object)__instance, behaviour); } } catch (Exception arg) { ManualLogSource logger = SparrohPlugin.Logger; if (logger != null) { logger.LogError((object)$"[CyclerRework] OnFire heat hook failed: {arg}"); } } } [HarmonyPatch(typeof(Gun), "AddRecoil")] [HarmonyPrefix] private static void AddRecoilPrefix(Gun __instance, ref float multiplier) { if (CyclerHeatBehaviour.TryGet((IGear)(object)__instance, out var behaviour)) { behaviour.ModifyRecoilMultiplier(__instance, ref multiplier); } } [HarmonyPatch(typeof(CartridgeSMG), "ModifyBulletData")] [HarmonyPostfix] private static void CartridgeModifyBulletDataPostfix(CartridgeSMG __instance, ref BulletData data, BulletFlags flags) { if (CyclerHeatBehaviour.TryGet((IGear)(object)__instance, out var behaviour)) { behaviour.ModifyOutgoingBullet(ref data); } } [HarmonyPatch(typeof(Gun), "ModifyBulletData")] [HarmonyPostfix] private static void GunModifyBulletDataPostfix(Gun __instance, ref BulletData data) { if (!(__instance is CartridgeSMG) && CyclerHeatBehaviour.TryGet((IGear)(object)__instance, out var behaviour)) { behaviour.ModifyOutgoingBullet(ref data); } } [HarmonyPatch(typeof(Gun), "Update")] [HarmonyPostfix] private static void GunUpdatePostfix(Gun __instance) { try { if (!((Object)(object)__instance == (Object)null) && ((NetworkBehaviour)__instance).IsOwner && __instance.Active && CyclerHeatBehaviour.TryGet((IGear)(object)__instance, out var behaviour)) { behaviour.Tick(Time.deltaTime, __instance); PushHeatHud(__instance, behaviour); } } catch (Exception arg) { ManualLogSource logger = SparrohPlugin.Logger; if (logger != null) { logger.LogError((object)$"[CyclerRework] Heat tick failed: {arg}"); } } } [HarmonyPatch(typeof(Gun), "CanReload")] [HarmonyPrefix] private static bool CanReloadPrefix(Gun __instance, ref bool __result) { if (!CyclerHeatBehaviour.TryGet((IGear)(object)__instance, out var _)) { return true; } __result = false; return false; } [HarmonyPatch(typeof(CartridgeSMG), "OverrideHoldReload")] [HarmonyPrefix] private static bool OverrideHoldReloadPrefix(CartridgeSMG __instance, ref bool __result) { if (!CyclerHeatBehaviour.TryGet((IGear)(object)__instance, out var behaviour)) { return true; } if (behaviour.TryTapReload((Gun)(object)__instance)) { __result = true; return false; } __result = false; return false; } [HarmonyPatch(typeof(Gun), "OnReloadPerformed")] [HarmonyPrefix] private static bool OnReloadPerformedPrefix(Gun __instance, CallbackContext context) { if (!CyclerHeatBehaviour.TryGet((IGear)(object)__instance, out var behaviour)) { return true; } if (!((NetworkBehaviour)__instance).IsOwner) { return true; } behaviour.TryTapReload(__instance); return false; } [HarmonyPatch(typeof(Gun), "OnFirePressed")] [HarmonyPostfix] private static void OnFirePressedPostfix(Gun __instance) { if (CyclerHeatBehaviour.TryGet((IGear)(object)__instance, out var behaviour) && ((NetworkBehaviour)__instance).IsOwner) { behaviour.OnFirePressedWhileHot(__instance); } } [HarmonyPatch(typeof(Gun), "OnFiredBullet")] [HarmonyPostfix] private static void OnFiredBulletPostfix(Gun __instance, IBullet bullet, BulletFlags flags, int shotIndex, ref BulletData bulletData) { if (CyclerHeatBehaviour.TryGet((IGear)(object)__instance, out var behaviour)) { behaviour.OnBulletFired(bullet); } } [HarmonyPatch(typeof(Gun), "AfterBulletFired")] [HarmonyPostfix] private static void AfterBulletFiredPostfix(Gun __instance, IBullet bullet, BulletFlags flags, int shotIndex) { if (CyclerHeatBehaviour.TryGet((IGear)(object)__instance, out var behaviour)) { behaviour.OnBulletFired(bullet); } } [HarmonyPatch(typeof(Gun), "GetPrimaryHUDText")] [HarmonyPrefix] private static bool GetPrimaryHUDTextPrefix(Gun __instance, char[] buffer, ref int __result) { if (!CyclerHeatBehaviour.TryGet((IGear)(object)__instance, out var behaviour)) { return true; } __result = WriteHeatHud(buffer, behaviour); return false; } [HarmonyPatch(typeof(Gun), "InvokeAmmoChangedAsHUDUpdate")] [HarmonyPrefix] private static bool InvokeAmmoChangedAsHUDUpdatePrefix(Gun __instance, float ammo) { if (!CyclerHeatBehaviour.TryGet((IGear)(object)__instance, out var behaviour)) { return true; } WriteHeatHud(Global.charBuffer, behaviour); __instance.RefreshHUD(); return false; } private static void PushHeatHud(Gun gun, CyclerHeatBehaviour heat) { if ((Object)(object)gun == (Object)null || (Object)(object)heat == (Object)null) { return; } try { int num = WriteHeatHud(Global.charBuffer, heat); gun.RefreshHUD(); MethodInfo methodInfo = AccessTools.Method(typeof(Gun), "InvokeOnUpdatePrimaryHUDText", (Type[])null, (Type[])null); if (methodInfo != null) { methodInfo.Invoke(gun, new object[2] { num, Global.charBuffer }); } } catch { } } private static int WriteHeatHud(char[] buffer, CyclerHeatBehaviour heat) { if (buffer == null || buffer.Length == 0) { return 0; } int num = MathUtil.FillArrayWithNumber(Mathf.Max(0, Mathf.RoundToInt(heat.HeatNormalized * 100f)), buffer); if (num < buffer.Length) { buffer[num++] = '%'; } if (heat.IsOvercapped && num + 2 <= buffer.Length) { buffer[num++] = 'O'; buffer[num++] = 'C'; } else if (heat.IsRedline && num + 2 <= buffer.Length) { buffer[num++] = 'R'; buffer[num++] = 'L'; } return num; } } public static class HeatCyclerUpgrades { public const int IdChargedCartridges = 92020; public const int IdCorrosivePlasma = 92021; public const int IdDecayEnergy = 92022; public const int IdHeatedBattery = 92023; public const int IdFocusedLenses = 92024; public const int IdPrecisionFire = 92025; public const int IdRicochet = 92026; public const int IdOverclockedFiring = 92027; public const int IdExtralightFrame = 92028; public const int IdDoubleShot = 92029; public const int IdCyclotron = 92030; public const int IdScorchingDetonation = 92031; public const int IdCyclingRepairs = 92032; public const int IdMomentumOverload = 92033; public const int IdStabilityModule = 92034; public const int IdInfinityBurn = 92035; public const int IdBigazine = 92036; public const int IdBulgingCartridge = 92037; public const int IdCompactCartridge = 92038; public const int IdDoublestackCartridge = 92039; public const int IdAdrenalineReload = 92040; public const int IdChargeShield = 92041; public const int IdShockRecursion = 92042; public const int IdToxinRecycling = 92043; public const int IdSuperheatReaction = 92044; public const int IdLiteEnergy = 92045; public const int IdMassAcceleration = 92046; public const int IdEquipmentSiphon = 92047; public const int IdFullOutput = 92048; public const int IdEnergyConvergence = 92049; public const int IdElementalDischarge = 92050; public const int IdViolentReaction = 92051; public const int IdCondensedEjection = 92052; public const int IdRocketSlide = 92053; public const int IdDumpCharge = 92054; public const int IdCyclePhasing = 92055; public const int IdBoundaryIncursion = 92056; public const int IdClosedLoop = 92057; public const int IdCrossflash = 92058; public const int IdPyrolysis = 92059; public const int IdTriValve = 92060; public const int IdAcidSpark = 92061; public const int IdBraidProtocol = 92062; public const int IdSaturateCatalyst = 92063; private const UpgradeFlags FlagMissionStack = (UpgradeFlags)16384u; private const UpgradeFlags FlagNoRandom = (UpgradeFlags)32u; private const UpgradeFlags FlagSpatialMissionStack = (UpgradeFlags)540672u; private static bool _registered; public static void RegisterAll(ManualLogSource log = null) { if (_registered) { return; } IUpgradable val = SparrohPlugin.ResolveRegisteredGear(); if (val == null) { if (log != null) { log.LogDebug((object)"[HeatCyclerUpgrades] Gear not ready — deferring."); } return; } if (PlayerData.Instance == null) { if (log != null) { log.LogDebug((object)"[HeatCyclerUpgrades] PlayerData not ready — deferring."); } return; } try { WeaponRegistration.EnsureGearData(val, autoUnlock: true, log); GearData val2 = PlayerData.GetGearData(val) ?? (((Object)(object)val.Info != (Object)null) ? PlayerData.GetGearData(val.Info.ID) : null); if (val2 == null) { if (log != null) { log.LogDebug((object)"[HeatCyclerUpgrades] GearData missing — deferring upgrades."); } return; } if (val2.Gear == null) { val2.Gear = val; } } catch (Exception ex) { if (log != null) { log.LogDebug((object)("[HeatCyclerUpgrades] GearData gate failed — deferring: " + ex.Message)); } return; } int num = 0; if (RegisterChargedCartridges(val, log)) { num++; } if (RegisterCorrosivePlasma(val, log)) { num++; } if (RegisterHeatedBattery(val, log)) { num++; } if (RegisterFocusedLenses(val, log)) { num++; } if (RegisterPrecisionFire(val, log)) { num++; } if (RegisterRicochet(val, log)) { num++; } if (RegisterOverclockedFiring(val, log)) { num++; } if (RegisterExtralightFrame(val, log)) { num++; } if (RegisterDoubleShot(val, log)) { num++; } if (RegisterCyclotron(val, log)) { num++; } if (RegisterScorchingDetonation(val, log)) { num++; } if (RegisterCyclingRepairs(val, log)) { num++; } if (RegisterMomentumOverload(val, log)) { num++; } if (RegisterStabilityModule(val, log)) { num++; } if (RegisterInfinityBurn(val, log)) { num++; } if (RegisterBigazine(val, log)) { num++; } if (RegisterBulgingCartridge(val, log)) { num++; } if (RegisterCompactCartridge(val, log)) { num++; } if (RegisterDoublestackCartridge(val, log)) { num++; } if (RegisterAdrenalineReload(val, log)) { num++; } if (RegisterChargeShield(val, log)) { num++; } if (RegisterShockRecursion(val, log)) { num++; } if (RegisterToxinRecycling(val, log)) { num++; } if (RegisterSuperheatReaction(val, log)) { num++; } if (RegisterLiteEnergy(val, log)) { num++; } if (RegisterMassAcceleration(val, log)) { num++; } if (RegisterEquipmentSiphon(val, log)) { num++; } if (RegisterFullOutput(val, log)) { num++; } if (RegisterEnergyConvergence(val, log)) { num++; } if (RegisterElementalDischarge(val, log)) { num++; } if (RegisterViolentReaction(val, log)) { num++; } if (RegisterCondensedEjection(val, log)) { num++; } if (RegisterRocketSlide(val, log)) { num++; } if (RegisterDumpCharge(val, log)) { num++; } if (RegisterCyclePhasing(val, log)) { num++; } if (RegisterBoundaryIncursion(val, log)) { num++; } if (RegisterClosedLoop(val, log)) { num++; } if (RegisterCrossflash(val, log)) { num++; } if (RegisterPyrolysis(val, log)) { num++; } if (RegisterTriValve(val, log)) { num++; } if (RegisterAcidSpark(val, log)) { num++; } if (RegisterBraidProtocol(val, log)) { num++; } if (RegisterSaturateCatalyst(val, log)) { num++; } if (num == 43) { _registered = true; if (log != null) { log.LogInfo((object)$"[HeatCyclerUpgrades] Registered {num}/{43} upgrades (Tier A–E3 + Boundary + Interlace)."); } return; } if (log != null) { log.LogWarning((object)$"[HeatCyclerUpgrades] Registered {num}/{43} upgrades (partial)."); } if (num > 0) { _registered = true; } } private static bool RegisterChargedCartridges(IUpgradable gear, ManualLogSource log) { return Create(gear, 92020, "Charged Cartridges", "Rounds apply Shock buildup.", (Rarity)1, (UpgradeFlags)16384, -10, UpgradePatterns.ElementApplicator(), (UpgradeProperty[])(object)new UpgradeProperty[1] { (UpgradeProperty)ElementDamage((EffectType)2, 1.85f, 2.15f) }, log, "Charged_Cartridges_Icon.png"); } private static bool RegisterCorrosivePlasma(IUpgradable gear, ManualLogSource log) { return Create(gear, 92021, "Corrosive Plasma", "Rounds apply Acid buildup.", (Rarity)1, (UpgradeFlags)16384, -10, UpgradePatterns.ElementApplicator(), (UpgradeProperty[])(object)new UpgradeProperty[1] { (UpgradeProperty)ElementDamage((EffectType)3, 1.85f, 2.15f) }, log, "Corrosive_Plasma_Icon.png"); } private static bool RegisterHeatedBattery(IUpgradable gear, ManualLogSource log) { return Create(gear, 92023, "Heated Battery", "Rounds apply Fire buildup.", (Rarity)1, (UpgradeFlags)16384, -10, UpgradePatterns.ElementApplicator(), (UpgradeProperty[])(object)new UpgradeProperty[1] { (UpgradeProperty)ElementDamage((EffectType)1, 1.85f, 2.15f) }, log, "Heated_Battery_Icon.png"); } private static UpgradeProperty_Damage ElementDamage(EffectType element, float amountMin, float amountMax) { //IL_0000: 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) //IL_0010: 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_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: 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_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Expected O, but got Unknown return new UpgradeProperty_Damage { damage = new OverrideData>(new Range(0f, 0f), (OverrideType)0), effectType = new OverrideData(element, (OverrideType)3), effectAmount = new OverrideData>(new Range(amountMin, amountMax), (OverrideType)1), stackModifier = 0f }; } private static bool RegisterFocusedLenses(IUpgradable gear, ManualLogSource log) { //IL_0000: 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) //IL_0010: 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_001b: 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_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_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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_0084: Expected O, but got Unknown UpgradeProperty_Range val = new UpgradeProperty_Range { falloffStartDistance = new OverrideData>(new Range(8f, 11f), (OverrideType)1), falloffEndDistance = new OverrideData>(new Range(8f, 11f), (OverrideType)1), maxDamageRange = new OverrideData>(new Range(0f, 0f), (OverrideType)0), maxFalloffDamageMultiplier = new OverrideData>(new Range(0f, 0f), (OverrideType)0), isMinRangeBetter = false, stackMultiplier = 0f }; return Create(gear, 92024, "Focused Lenses", "Increases effective range before damage falloff.", (Rarity)0, (UpgradeFlags)16384, 0, UpgradePatterns.FocusedLenses(), (UpgradeProperty[])(object)new UpgradeProperty[1] { (UpgradeProperty)val }, log, "Focused_Lenses_Icon.png"); } private static bool RegisterPrecisionFire(IUpgradable gear, ManualLogSource log) { //IL_0000: 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) //IL_0010: 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_0024: 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_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Expected O, but got Unknown UpgradeProperty_Spread val = new UpgradeProperty_Spread { spreadSize = new OverrideData>(new Range(new Vector2(0.2f, 0.2f), new Vector2(0.3f, 0.3f)), (OverrideType)2), spreadType = new OverrideData((SpreadType)0, (OverrideType)0), stackMultiplier = 0f }; UpgradeProperty_FireInterval val2 = new UpgradeProperty_FireInterval { fireInterval = new OverrideData>(new Range(1.23f, 1.27f), (OverrideType)2) }; return Create(gear, 92025, "Precision Fire", "Tighter spread at the cost of fire rate.", (Rarity)0, (UpgradeFlags)16384, 0, UpgradePatterns.PrecisionFire(), (UpgradeProperty[])(object)new UpgradeProperty[2] { (UpgradeProperty)val, (UpgradeProperty)val2 }, log, "Precision_Fire_Icon.png"); } private static bool RegisterRicochet(IUpgradable gear, ManualLogSource log) { //IL_0000: 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) //IL_0008: 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) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown UpgradeProperty_MaxBounces val = new UpgradeProperty_MaxBounces { maxBounces = new OverrideData>(new Range(1, 1), (OverrideType)1) }; return Create(gear, 92026, "Ricochet", "Bullets bounce once off surfaces.", (Rarity)1, (UpgradeFlags)16416, 0, UpgradePatterns.Ricochet(), (UpgradeProperty[])(object)new UpgradeProperty[1] { (UpgradeProperty)val }, log, "Ricochet_Icon.png"); } private static bool RegisterOverclockedFiring(IUpgradable gear, ManualLogSource log) { //IL_0000: 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) //IL_0010: 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_0024: 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_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Expected O, but got Unknown //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) UpgradeProperty_Spread val = new UpgradeProperty_Spread { spreadSize = new OverrideData>(new Range(new Vector2(4.5f, 4.5f), new Vector2(5.8f, 5.8f)), (OverrideType)1), spreadType = new OverrideData((SpreadType)0, (OverrideType)0), stackMultiplier = 0.25f }; UpgradeProperty_FireInterval val2 = new UpgradeProperty_FireInterval { fireInterval = new OverrideData>(new Range(0.8f, 0.9f), (OverrideType)2) }; UpgradeProperty_Heat_HeatPerShotMult upgradeProperty_Heat_HeatPerShotMult = new UpgradeProperty_Heat_HeatPerShotMult { heatPerShotMultiplier = new Range(1.08f, 1.14f) }; return Create(gear, 92027, "Overclocked Firing Mechanism", "Increases fire rate with wider spread. Slightly more Heat per shot.", (Rarity)0, (UpgradeFlags)16384, 0, UpgradePatterns.OverclockedFiring(), (UpgradeProperty[])(object)new UpgradeProperty[3] { (UpgradeProperty)val, (UpgradeProperty)val2, upgradeProperty_Heat_HeatPerShotMult }, log, "Overclocked_Firing_Mechanism_Icon.png"); } private static bool RegisterExtralightFrame(IUpgradable gear, ManualLogSource log) { //IL_0000: 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) //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) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown UpgradeProperty_FireConstraints val = new UpgradeProperty_FireConstraints { canFireWhileSprinting = new OverrideData((ActionFireMode)1, (OverrideType)3), canFireWhileJumping = new OverrideData(false, (OverrideType)0), canFireWhileSliding = new OverrideData((ActionFireMode)0, (OverrideType)0), canAimWhileSliding = new OverrideData((ActionFireMode)0, (OverrideType)0) }; return Create(gear, 92028, "Extralight Frame", "Fire while sprinting.", (Rarity)2, (UpgradeFlags)32, 0, UpgradePatterns.ExtralightFrame(), (UpgradeProperty[])(object)new UpgradeProperty[1] { (UpgradeProperty)val }, log, "Extralight_Frame_Icon.png"); } private static bool RegisterDoubleShot(IUpgradable gear, ManualLogSource log) { //IL_0000: 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) //IL_0008: 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) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown //IL_0019: 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_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_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_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_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Expected O, but got Unknown //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) UpgradeProperty_BulletsPerShot val = new UpgradeProperty_BulletsPerShot { bulletsPerShot = new OverrideData>(new Range(1, 1), (OverrideType)1) }; UpgradeProperty_FireInterval val2 = new UpgradeProperty_FireInterval { fireInterval = new OverrideData>(new Range(1.3f, 1.465f), (OverrideType)2) }; UpgradeProperty_Spread val3 = new UpgradeProperty_Spread { spreadSize = new OverrideData>(new Range(new Vector2(3f, 0f), new Vector2(5f, 0f)), (OverrideType)1), spreadType = new OverrideData((SpreadType)0, (OverrideType)0), stackMultiplier = 0f }; UpgradeProperty_Heat_HeatPerShotMult upgradeProperty_Heat_HeatPerShotMult = new UpgradeProperty_Heat_HeatPerShotMult { heatPerShotMultiplier = new Range(1.3f, 1.4f) }; return Create(gear, 92029, "Double Bore", "Fires an extra projectile. Each shot builds more Heat; slower fire rate and wider horizontal spread.", (Rarity)2, (UpgradeFlags)16384, 0, UpgradePatterns.DoubleShot(), (UpgradeProperty[])(object)new UpgradeProperty[4] { (UpgradeProperty)val, upgradeProperty_Heat_HeatPerShotMult, (UpgradeProperty)val2, (UpgradeProperty)val3 }, log, "Double_Shot_Icon.png"); } private static bool RegisterCyclotron(IUpgradable gear, ManualLogSource log) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) UpgradeProperty_Heat_Cycling upgradeProperty_Heat_Cycling = new UpgradeProperty_Heat_Cycling { effectAmount = new Range(0.333f, 0.333f) }; return Create(gear, 92030, "Cyclotron", "Every few shots, cycle bullet element Fire → Shock → Acid. Enables multi-element interlacing.", (Rarity)2, (UpgradeFlags)32, 1, UpgradePatterns.Cyclotron(), (UpgradeProperty[])(object)new UpgradeProperty[1] { upgradeProperty_Heat_Cycling }, log, "Cyclotron_Icon.png"); } private static bool RegisterScorchingDetonation(IUpgradable gear, ManualLogSource log) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_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) UpgradeProperty_Heat_ScorchingDetonation upgradeProperty_Heat_ScorchingDetonation = new UpgradeProperty_Heat_ScorchingDetonation { radius = new Range(3.6f, 4.22f), damage = new Range(37.5f, 49.5f) }; return Create(gear, 92031, "Scorching Detonation", "Killing a fully ignited target causes an explosion.", (Rarity)3, (UpgradeFlags)16384, 0, UpgradePatterns.ScorchingDetonation(), (UpgradeProperty[])(object)new UpgradeProperty[1] { upgradeProperty_Heat_ScorchingDetonation }, log, "Scorching_Detonation_Icon.png"); } private static bool RegisterCyclingRepairs(IUpgradable gear, ManualLogSource log) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) UpgradeProperty_Heat_HealOnSustainedFire upgradeProperty_Heat_HealOnSustainedFire = new UpgradeProperty_Heat_HealOnSustainedFire { health = new Range(0.8f, 1.2f) }; return Create(gear, 92032, "Cycling Repairs", "Sustained fire periodically heals you. Heal is stronger while Hot or above.", (Rarity)2, (UpgradeFlags)16384, 0, UpgradePatterns.CyclingRepairs(), (UpgradeProperty[])(object)new UpgradeProperty[1] { upgradeProperty_Heat_HealOnSustainedFire }, log, "Cycling_Repairs_Icon.png"); } private static bool RegisterMomentumOverload(IUpgradable gear, ManualLogSource log) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_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) UpgradeProperty_Heat_OverloadSpeed upgradeProperty_Heat_OverloadSpeed = new UpgradeProperty_Heat_OverloadSpeed { speed = new Range(3.75f, 5f), duration = new Range(3.6f, 4.4f) }; return Create(gear, 92033, "Momentum Overload", "Fully shocking a target grants a burst of movement speed.", (Rarity)1, (UpgradeFlags)16384, 0, UpgradePatterns.MomentumOverload(), (UpgradeProperty[])(object)new UpgradeProperty[1] { upgradeProperty_Heat_OverloadSpeed }, log, "Momentum_Overload_Icon.png"); } private static bool RegisterStabilityModule(IUpgradable gear, ManualLogSource log) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_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) UpgradeProperty_Heat_AimRecoil upgradeProperty_Heat_AimRecoil = new UpgradeProperty_Heat_AimRecoil { aimRecoilMultiplier = new Range(0.58f, 0.7f), aimDissipateDelayMult = new Range(0.5f, 0.5f) }; return Create(gear, 92034, "Stability Module", "Greatly reduced recoil while aiming. While ADS, heat begins dissipating sooner after you stop firing.", (Rarity)0, (UpgradeFlags)16384, 0, UpgradePatterns.StabilityModule(), (UpgradeProperty[])(object)new UpgradeProperty[1] { upgradeProperty_Heat_AimRecoil }, log, "Stability_Module_Icon.png"); } private static bool RegisterInfinityBurn(IUpgradable gear, ManualLogSource log) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_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) UpgradeProperty_Heat_InfinityBurn upgradeProperty_Heat_InfinityBurn = new UpgradeProperty_Heat_InfinityBurn { damagePerSecond = new Range(44f, 56f), effectPerSecond = new Range(11f, 20f) }; return Create(gear, 92035, "Infinity Burn", "Heat can exceed maximum while firing. Past max Heat you take damage over time, but outgoing damage and element scale with overcap depth.", (Rarity)3, (UpgradeFlags)16384, 0, UpgradePatterns.InfinityBurn(), (UpgradeProperty[])(object)new UpgradeProperty[1] { upgradeProperty_Heat_InfinityBurn }, log, "Infinity_Burn_Icon.png"); } private static bool RegisterBigazine(IUpgradable gear, ManualLogSource log) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) UpgradeProperty_Heat_MaxHeatMultBig upgradeProperty_Heat_MaxHeatMultBig = new UpgradeProperty_Heat_MaxHeatMultBig { maxHeatMultiplier = new Range(1.9f, 2.15f) }; return Create(gear, 92036, "Thermal Buffer", "Greatly increases maximum Heat capacity.", (Rarity)0, (UpgradeFlags)16384, 0, UpgradePatterns.Bigazine(), (UpgradeProperty[])(object)new UpgradeProperty[1] { upgradeProperty_Heat_MaxHeatMultBig }, log, "Bigazine_Icon.png"); } private static bool RegisterBulgingCartridge(IUpgradable gear, ManualLogSource log) { //IL_0000: 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) //IL_0010: 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_001b: 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_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: 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_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_0054: Expected O, but got Unknown //IL_0064: 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) UpgradeProperty_Damage val = new UpgradeProperty_Damage { damage = new OverrideData>(new Range(4f, 10f), (OverrideType)1), effectType = new OverrideData((EffectType)0, (OverrideType)0), effectAmount = new OverrideData>(new Range(0f, 0f), (OverrideType)0), stackModifier = 0f }; UpgradeProperty_Heat_HeatPerShotAdd upgradeProperty_Heat_HeatPerShotAdd = new UpgradeProperty_Heat_HeatPerShotAdd { heatPerShotAdd = new Range(0.15f, 0.25f) }; return Create(gear, 92037, "Hot Load", "Increases damage. Each shot builds slightly more Heat.", (Rarity)0, (UpgradeFlags)16384, 0, UpgradePatterns.BulgingCartridge(), (UpgradeProperty[])(object)new UpgradeProperty[2] { (UpgradeProperty)val, upgradeProperty_Heat_HeatPerShotAdd }, log, "Bulging_Cartridge_Icon.png"); } private static bool RegisterCompactCartridge(IUpgradable gear, ManualLogSource log) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_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) UpgradeProperty_Heat_CompactCartridge upgradeProperty_Heat_CompactCartridge = new UpgradeProperty_Heat_CompactCartridge { maxHeatAdd = new Range(-12f, -8f), dissipateMultiplier = new Range(1.3f, 1.45f) }; return Create(gear, 92038, "Quick Sink", "Faster Heat cooldown. Reduces maximum Heat.", (Rarity)0, (UpgradeFlags)16384, 0, UpgradePatterns.CompactCartridge(), (UpgradeProperty[])(object)new UpgradeProperty[1] { upgradeProperty_Heat_CompactCartridge }, log, "Compact_Cartridge_Icon.png"); } private static bool RegisterDoublestackCartridge(IUpgradable gear, ManualLogSource log) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: 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_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_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Expected O, but got Unknown UpgradeProperty_Heat_Doublestack upgradeProperty_Heat_Doublestack = new UpgradeProperty_Heat_Doublestack { maxHeatMultiplier = new Range(1.2f, 1.35f) }; UpgradeProperty_FireInterval val = new UpgradeProperty_FireInterval { fireInterval = new OverrideData>(new Range(1.08f, 1.14f), (OverrideType)2) }; return Create(gear, 92039, "Dense Core", "Increases maximum Heat. Decreases fire rate.", (Rarity)0, (UpgradeFlags)16384, 0, UpgradePatterns.DoublestackCartridge(), (UpgradeProperty[])(object)new UpgradeProperty[2] { upgradeProperty_Heat_Doublestack, (UpgradeProperty)val }, log, "Doublestack_Cartridge_Icon.png"); } private static bool RegisterAdrenalineReload(IUpgradable gear, ManualLogSource log) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) UpgradeProperty_Heat_AdrenalineReload upgradeProperty_Heat_AdrenalineReload = new UpgradeProperty_Heat_AdrenalineReload { heatRefund = new Range(12f, 20f), dissipateMultiplier = new Range(1.15f, 1.25f), duration = new Range(0.75f, 0.75f) }; return Create(gear, 92040, "Adrenaline Vent", "Killing a target instantly dumps Heat and briefly speeds cooldown.", (Rarity)1, (UpgradeFlags)16384, 0, UpgradePatterns.AdrenalineReload(), (UpgradeProperty[])(object)new UpgradeProperty[1] { upgradeProperty_Heat_AdrenalineReload }, log, "Adrenaline_Reload_Icon.png"); } private static bool RegisterChargeShield(IUpgradable gear, ManualLogSource log) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) UpgradeProperty_Heat_ChargeShield upgradeProperty_Heat_ChargeShield = new UpgradeProperty_Heat_ChargeShield { damageTakenMultiplier = new Range(0.75f, 0.85f) }; return Create(gear, 92041, "Charge Shield", "While Hot, Redline, or overcapped, take reduced damage.", (Rarity)1, (UpgradeFlags)16384, 0, UpgradePatterns.ChargeShield(), (UpgradeProperty[])(object)new UpgradeProperty[1] { upgradeProperty_Heat_ChargeShield }, log, "Charge_Shield_Icon.png"); } private static bool RegisterShockRecursion(IUpgradable gear, ManualLogSource log) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) UpgradeProperty_Heat_ShockRecursion upgradeProperty_Heat_ShockRecursion = new UpgradeProperty_Heat_ShockRecursion { heatRefund = new Range(10f, 22f) }; return Create(gear, 92042, "Shock Recursion", "Fully shocking a target refunds Heat.", (Rarity)2, (UpgradeFlags)16384, 0, UpgradePatterns.ShockRecursion(), (UpgradeProperty[])(object)new UpgradeProperty[1] { upgradeProperty_Heat_ShockRecursion }, log, "Overload_Siphon_Icon.png"); } private static bool RegisterToxinRecycling(IUpgradable gear, ManualLogSource log) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001e: 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) UpgradeProperty_Heat_ToxinRecycling upgradeProperty_Heat_ToxinRecycling = new UpgradeProperty_Heat_ToxinRecycling { damagePerStack = new Range(1.5f, 2.5f), maxStacks = new Range(8, 12) }; return Create(gear, 92043, "Toxin Bank", "Corrupting a target banks bonus damage stacks. Bank clears only when Heat hits empty.", (Rarity)2, (UpgradeFlags)16384, 0, UpgradePatterns.ToxinRecycling(), (UpgradeProperty[])(object)new UpgradeProperty[1] { upgradeProperty_Heat_ToxinRecycling }, log, "Toxin_Repurposing_Icon.png"); } private static bool RegisterSuperheatReaction(IUpgradable gear, ManualLogSource log) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_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) UpgradeProperty_Heat_SuperheatReaction upgradeProperty_Heat_SuperheatReaction = new UpgradeProperty_Heat_SuperheatReaction { elementPerStack = new Range(0.35f, 0.55f), maxStacks = new Range(5, 8), falloffSeconds = new Range(2.5f, 3.5f) }; return Create(gear, 92044, "Superheat Reaction", "Rapid ignites stack bonus Fire application per shot. Stacks fall off without fresh ignites.", (Rarity)2, (UpgradeFlags)16384, 0, UpgradePatterns.SuperheatReaction(), (UpgradeProperty[])(object)new UpgradeProperty[1] { upgradeProperty_Heat_SuperheatReaction }, log, "Intense_Reaction_Icon.png"); } private static bool RegisterLiteEnergy(IUpgradable gear, ManualLogSource log) { //IL_0000: 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) //IL_0010: 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_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_0031: 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) UpgradeProperty_FireInterval val = new UpgradeProperty_FireInterval { fireInterval = new OverrideData>(new Range(1.12f, 1.2f), (OverrideType)2) }; UpgradeProperty_Heat_LiteEnergy upgradeProperty_Heat_LiteEnergy = new UpgradeProperty_Heat_LiteEnergy { bulletSpeedAtDoubleFireRate = new Range(0.35f, 0.55f) }; return Create(gear, 92045, "Lite Exhaust", "Base fire rate is reduced. As fire rate increases, bullet speed increases.", (Rarity)2, (UpgradeFlags)16384, 0, UpgradePatterns.LiteEnergy(), (UpgradeProperty[])(object)new UpgradeProperty[2] { (UpgradeProperty)val, upgradeProperty_Heat_LiteEnergy }, log, "Exhaust_Cycling_Icon.png"); } private static bool RegisterMassAcceleration(IUpgradable gear, ManualLogSource log) { //IL_0000: 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) //IL_0010: 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_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_0031: 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) UpgradeProperty_FireInterval val = new UpgradeProperty_FireInterval { fireInterval = new OverrideData>(new Range(1.45f, 1.55f), (OverrideType)2) }; UpgradeProperty_Heat_MassAcceleration upgradeProperty_Heat_MassAcceleration = new UpgradeProperty_Heat_MassAcceleration { heatEfficiency = new Range(0.009f, 0.011f) }; return Create(gear, 92046, "Mass Acceleration", "Base fire rate is reduced. Fire rate scales up with current Heat.", (Rarity)2, (UpgradeFlags)16384, 0, UpgradePatterns.MassAcceleration(), (UpgradeProperty[])(object)new UpgradeProperty[2] { (UpgradeProperty)val, upgradeProperty_Heat_MassAcceleration }, log, "Mass_Acceleration_Icon.png"); } private static bool RegisterEquipmentSiphon(IUpgradable gear, ManualLogSource log) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) UpgradeProperty_Heat_EquipmentSiphon upgradeProperty_Heat_EquipmentSiphon = new UpgradeProperty_Heat_EquipmentSiphon { heatRefundPer60Damage = new Range(4f, 7f) }; return Create(gear, 92047, "Equipment Radiator", "Damage dealt with other gear dissipates Heat.", (Rarity)1, (UpgradeFlags)16384, 0, UpgradePatterns.EquipmentSiphon(), (UpgradeProperty[])(object)new UpgradeProperty[1] { upgradeProperty_Heat_EquipmentSiphon }, log, "Equipment_Siphon_Icon.png"); } private static bool RegisterFullOutput(IUpgradable gear, ManualLogSource log) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) UpgradeProperty_Heat_FullOutput upgradeProperty_Heat_FullOutput = new UpgradeProperty_Heat_FullOutput { damagePerRarity = new Range(9f, 13f) }; return Create(gear, 92048, "Full Spectrum", "For each different rarity among your other equipped upgrades, gain bonus damage.", (Rarity)2, (UpgradeFlags)16384, 0, UpgradePatterns.FullOutput(), (UpgradeProperty[])(object)new UpgradeProperty[1] { upgradeProperty_Heat_FullOutput }, log, "Full_Range_Icon.png"); } private static bool RegisterEnergyConvergence(IUpgradable gear, ManualLogSource log) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) UpgradeProperty_Heat_EnergyConvergence upgradeProperty_Heat_EnergyConvergence = new UpgradeProperty_Heat_EnergyConvergence { heatPerStack = new Range(0.75f, 1.2f) }; return Create(gear, 92049, "Energy Convergence", "Elemental debuffs on enemies build stacks. Tap R to convert stacks into Heat.", (Rarity)1, (UpgradeFlags)16384, 0, UpgradePatterns.EnergyConvergence(), (UpgradeProperty[])(object)new UpgradeProperty[1] { upgradeProperty_Heat_EnergyConvergence }, log, "Energy_Convergence_Icon.png"); } private static bool RegisterElementalDischarge(IUpgradable gear, ManualLogSource log) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) UpgradeProperty_Heat_ElementalDischarge upgradeProperty_Heat_ElementalDischarge = new UpgradeProperty_Heat_ElementalDischarge { radius = new Range(4f, 6f), damage = new Range(26f, 63f), chargeTime = new Range(0.5f, 0.68f) }; return Create(gear, 92050, "Elemental Discharge", "Tap R to spend Heat and release an elemental nova.", (Rarity)1, (UpgradeFlags)16384, 0, UpgradePatterns.ElementalDischarge(), (UpgradeProperty[])(object)new UpgradeProperty[1] { upgradeProperty_Heat_ElementalDischarge }, log, "Discharge_Icon.png"); } private static bool RegisterViolentReaction(IUpgradable gear, ManualLogSource log) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_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) UpgradeProperty_Heat_ViolentReaction upgradeProperty_Heat_ViolentReaction = new UpgradeProperty_Heat_ViolentReaction { radius = new Range(3.12f, 3.39f), effectAmount = new Range(8f, 12f) }; return Create(gear, 92051, "Violent Reaction", "Hitting a target with 2+ elemental effects spreads those effects nearby.", (Rarity)3, (UpgradeFlags)16384, 0, UpgradePatterns.ViolentReaction(), (UpgradeProperty[])(object)new UpgradeProperty[1] { upgradeProperty_Heat_ViolentReaction }, log, "Violent_Ignition_Icon.png"); } private static bool RegisterCondensedEjection(IUpgradable gear, ManualLogSource log) { //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) //IL_0010: 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_001e: 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_0029: Expected O, but got Unknown //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Expected O, but got Unknown //IL_00a4: 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_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: 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_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_00e4: Expected O, but got Unknown //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: 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_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_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_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Expected O, but got Unknown //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_0141: 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_0151: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Expected O, but got Unknown //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Expected O, but got Unknown //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown List list = new List(8); list.Add((UpgradeProperty)new UpgradeProperty_UpgradeFlag { flags = new UpgradeFlagField { flags = (GearUpgradeFlags)4 } }); GameObject val = VanillaCyclerAssets.TryGetPlasmaBulletPrefab(); if ((Object)(object)val != (Object)null) { list.Add((UpgradeProperty)new UpgradeProperty_BulletPrefab { bullet = val }); } list.Add((UpgradeProperty)new UpgradeProperty_Damage { damage = new OverrideData>(new Range(1.16f, 1.24f), (OverrideType)2), effectType = new OverrideData((EffectType)0, (OverrideType)0), effectAmount = new OverrideData>(new Range(0f, 0f), (OverrideType)0), stackModifier = 0f }); list.Add((UpgradeProperty)new UpgradeProperty_BulletPhysics { bulletGravity = new OverrideData>(new Range(0f, 0f), (OverrideType)0), bulletSpeed = new OverrideData>(new Range(17f, 23f), (OverrideType)3) }); list.Add((UpgradeProperty)new UpgradeProperty_BulletMagnetism { bulletMagnetismSurface = new OverrideData>(new Range(0f, 0f), (OverrideType)0), bulletMagnetismTarget = new OverrideData>(new Range(0.5f, 0.5f), (OverrideType)3), stackModifier = 0f }); list.Add((UpgradeProperty)new UpgradeProperty_Range { falloffStartDistance = new OverrideData>(new Range(60f, 60f), (OverrideType)3), falloffEndDistance = new OverrideData>(new Range(70f, 70f), (OverrideType)3), maxDamageRange = new OverrideData>(new Range(80f, 80f), (OverrideType)3), maxFalloffDamageMultiplier = new OverrideData>(new Range(0f, 0f), (OverrideType)0), isMinRangeBetter = false, stackMultiplier = 0f }); list.Add((UpgradeProperty)new UpgradeProperty_Spread { spreadSize = new OverrideData>(new Range(new Vector2(1.75f, 1.75f), new Vector2(2.2f, 2.2f)), (OverrideType)1), spreadType = new OverrideData((SpreadType)0, (OverrideType)0), stackMultiplier = 0f }); list.Add((UpgradeProperty)(object)new UpgradeProperty_Heat_CondensedEjection { arcDamage = new Range(12f, 18f), arcRadius = new Range(6f, 8f), interval = new Range(0.35f, 0.5f) }); return Create(gear, 92052, "Condensed Ejection", "Fires slow magnetic plasma. Projectiles periodically arc lightning to nearby targets.", (Rarity)3, (UpgradeFlags)16384, 0, UpgradePatterns.CondensedEjection(), list.ToArray(), log, "Condensed_Ejection_Icon.png"); } private static bool RegisterRocketSlide(IUpgradable gear, ManualLogSource log) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) UpgradeProperty_Heat_RocketSlide upgradeProperty_Heat_RocketSlide = new UpgradeProperty_Heat_RocketSlide { heatCost = new Range(8f, 12f), rocketDamage = new Range(28f, 40f), rocketRadius = new Range(1.2f, 2f), interval = new Range(0.4f, 0.55f) }; return Create(gear, 92053, "Rocket Vent", "While sliding, spend Heat to fire homing micro-missiles.", (Rarity)2, (UpgradeFlags)16384, 0, UpgradePatterns.RocketSlide(), (UpgradeProperty[])(object)new UpgradeProperty[1] { upgradeProperty_Heat_RocketSlide }, log, "Rocket_Burst_Icon.png"); } private static bool RegisterDumpCharge(IUpgradable gear, ManualLogSource log) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) UpgradeProperty_Heat_DumpCharge upgradeProperty_Heat_DumpCharge = new UpgradeProperty_Heat_DumpCharge { damagePerSecond = new Range(40f, 55f), secondsPerFullHeat = new Range(1.2f, 1.6f), heatDrainPerSecond = new Range(40f, 55f) }; return Create(gear, 92054, "Capacitor Dump", "Tap R to dump current Heat as a narrowing cone. Damage scales with Heat spent.", (Rarity)3, (UpgradeFlags)16384, 0, UpgradePatterns.DumpCharge(), (UpgradeProperty[])(object)new UpgradeProperty[1] { upgradeProperty_Heat_DumpCharge }, log, "Smart_Charge_Icon.png"); } private static bool RegisterCyclePhasing(IUpgradable gear, ManualLogSource log) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) UpgradeProperty_Heat_CyclePhasing upgradeProperty_Heat_CyclePhasing = new UpgradeProperty_Heat_CyclePhasing { bonusStrength = new Range(1f, 1f) }; return Create(gear, 92055, "Cycle Phasing", "Each spray advances phase for the whole hold: Coolant → Pyre → Storm → Solvent → Split → Needle → Bleed-Off → Spike.", (Rarity)4, (UpgradeFlags)32, 1, UpgradePatterns.CyclePhasing(), (UpgradeProperty[])(object)new UpgradeProperty[1] { upgradeProperty_Heat_CyclePhasing }, log, "Corrode_Siphon_Icon.png"); } private static bool RegisterBoundaryIncursion(IUpgradable gear, ManualLogSource log) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown return Create(gear, 92056, "Boundary Incursion", "Adds a row or column to the upgrade grid.", (Rarity)4, (UpgradeFlags)540672, -100, UpgradePatterns.BoundaryIncursion(), (UpgradeProperty[])(object)new UpgradeProperty[1] { (UpgradeProperty)new UpgradeProperty_GrowGrid() }, log, "Boundary_Incursion_Icon.png"); } private static bool RegisterClosedLoop(IUpgradable gear, ManualLogSource log) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) UpgradeProperty_Heat_ClosedLoop upgradeProperty_Heat_ClosedLoop = new UpgradeProperty_Heat_ClosedLoop { sustainSeconds = new Range(1.4f, 1.6f), ventHeat = new Range(22f, 28f), efficiencyDuration = new Range(0.9f, 1.1f), heatPerShotMult = new Range(0.65f, 0.75f) }; return Create(gear, 92057, "Closed Loop", "Holding Soft Redline while firing auto micro-vents Heat and briefly lowers Heat per shot.", (Rarity)3, (UpgradeFlags)16384, 0, UpgradePatterns.ClosedLoop(), (UpgradeProperty[])(object)new UpgradeProperty[1] { upgradeProperty_Heat_ClosedLoop }, log, "Smart_Slide_Icon.png"); } private static bool RegisterCrossflash(IUpgradable gear, ManualLogSource log) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) UpgradeProperty_Heat_Crossflash upgradeProperty_Heat_Crossflash = new UpgradeProperty_Heat_Crossflash { bonusHeatRefund = new Range(8f, 14f), splashRadius = new Range(2.8f, 3.6f), splashDamage = new Range(18f, 28f), splashFireAmount = new Range(6f, 10f) }; return Create(gear, 92058, "Crossflash", "Fully shocking an ignited target refunds extra Heat and splashes Fire nearby.", (Rarity)2, (UpgradeFlags)16384, 0, UpgradePatterns.Crossflash(), (UpgradeProperty[])(object)new UpgradeProperty[1] { upgradeProperty_Heat_Crossflash }, log, "Intense_Reaction_Icon.png"); } private static bool RegisterPyrolysis(IUpgradable gear, ManualLogSource log) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_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_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) UpgradeProperty_Heat_Pyrolysis upgradeProperty_Heat_Pyrolysis = new UpgradeProperty_Heat_Pyrolysis { radius = new Range(2.4f, 3.2f), damage = new Range(22f, 34f), bankStacks = new Range(1, 1) }; return Create(gear, 92059, "Pyrolysis", "Igniting a corroded target causes a lite detonation and banks 1 Toxin Bank stack.", (Rarity)2, (UpgradeFlags)16384, 0, UpgradePatterns.Pyrolysis(), (UpgradeProperty[])(object)new UpgradeProperty[1] { upgradeProperty_Heat_Pyrolysis }, log, "Scorching_Detonation_Icon.png"); } private static bool RegisterTriValve(IUpgradable gear, ManualLogSource log) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) UpgradeProperty_Heat_TriValve upgradeProperty_Heat_TriValve = new UpgradeProperty_Heat_TriValve { fireAmount = new Range(0.45f, 0.65f), shockAmount = new Range(0.45f, 0.65f), acidAmount = new Range(0.45f, 0.65f) }; return Create(gear, 92060, "Tri-Valve", "On hit, apply a small amount of Fire, Shock, and Acid buildup — enough to unlock interlace thresholds.", (Rarity)1, (UpgradeFlags)16384, 0, UpgradePatterns.TriValve(), (UpgradeProperty[])(object)new UpgradeProperty[1] { upgradeProperty_Heat_TriValve }, log, "Cyclotron_Icon.png"); } private static bool RegisterAcidSpark(IUpgradable gear, ManualLogSource log) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) UpgradeProperty_Heat_AcidSpark upgradeProperty_Heat_AcidSpark = new UpgradeProperty_Heat_AcidSpark { arcDamage = new Range(22f, 34f), arcRadius = new Range(6f, 9f), arcShockAmount = new Range(8f, 14f) }; return Create(gear, 92061, "Acid Spark", "Fully shocking a corroded target spends 1 Toxin Bank stack to arc Shock to a nearby foe.", (Rarity)2, (UpgradeFlags)16384, 0, UpgradePatterns.AcidSpark(), (UpgradeProperty[])(object)new UpgradeProperty[1] { upgradeProperty_Heat_AcidSpark }, log, "Overload_Siphon_Icon.png"); } private static bool RegisterBraidProtocol(IUpgradable gear, ManualLogSource log) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) UpgradeProperty_Heat_BraidProtocol upgradeProperty_Heat_BraidProtocol = new UpgradeProperty_Heat_BraidProtocol { windowSeconds = new Range(2.8f, 3.2f), efficiencyDuration = new Range(1.8f, 2.2f), heatPerShotMult = new Range(0.7f, 0.8f) }; return Create(gear, 92062, "Braid Protocol", "Applying Fire, Shock, and Acid within a short window briefly lowers Heat per shot.", (Rarity)2, (UpgradeFlags)16384, 0, UpgradePatterns.BraidProtocol(), (UpgradeProperty[])(object)new UpgradeProperty[1] { upgradeProperty_Heat_BraidProtocol }, log, "Energy_Convergence_Icon.png"); } private static bool RegisterSaturateCatalyst(IUpgradable gear, ManualLogSource log) { //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) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_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_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) UpgradeProperty_Heat_SaturateCatalyst upgradeProperty_Heat_SaturateCatalyst = new UpgradeProperty_Heat_SaturateCatalyst { maxStacks = new Range(3, 3), stackDuration = new Range(4f, 5f), ventDamagePerStack = new Range(8f, 12f), ventRadiusPerStack = new Range(0.35f, 0.55f) }; return Create(gear, 92063, "Saturate Catalyst", "Fully applying Fire, Shock, or Acid builds stacks. Your next Pressure Vent consumes them for a stronger pulse.", (Rarity)1, (UpgradeFlags)16384, 0, UpgradePatterns.SaturateCatalyst(), (UpgradeProperty[])(object)new UpgradeProperty[1] { upgradeProperty_Heat_SaturateCatalyst }, log, "Discharge_Icon.png"); } private static bool Create(IUpgradable gear, int id, string name, string description, Rarity rarity, UpgradeFlags flags, int priority, HexMap pattern, UpgradeProperty[] properties, ManualLogSource log, string iconFile = null) { //IL_0016: 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_005d: Unknown result type (might be due to invalid IL or missing references) Sprite val = IconLoader.Get(iconFile); if (!UpgradeRegistration.TryCreateGunUpgrade("sparroh.cyclerrework", gear, "sparroh_cycler", id, name, description, rarity, properties, pattern, flags, val, log, out var upgrade, priority, (CollectionSource)0)) { if (log != null) { log.LogDebug((object)$"[HeatCyclerUpgrades] Skipped '{name}' (id={id}) this pass."); } return false; } if (log != null) { log.LogInfo((object)($"[HeatCyclerUpgrades] + {name} (id={id}, {rarity}" + (((Object)(object)val != (Object)null) ? ", icon" : ", no-icon") + ").")); } return (Object)(object)upgrade != (Object)null; } } internal static class HeatE2 { public const int IdShockRecursion = 92042; public const int IdToxinRecycling = 92043; public const int IdSuperheatReaction = 92044; public const int IdLiteEnergy = 92045; public const int IdMassAcceleration = 92046; public const int IdEquipmentSiphon = 92047; public const int IdFullOutput = 92048; } [Serializable] public class UpgradeProperty_Heat_ShockRecursion : UpgradeProperty { public Range heatRefund = new Range(8f, 23f); public override IEnumerator GetStatData(Random rand, IUpgradable gear, UpgradeInstance upgrade) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) yield return StatData.Create("Heat refund (Shock):", heatRefund, upgrade, ref rand, (OverrideType)1, (LabelType)1, default(BoostParams), (Range?)null); } public override void Apply(IGear gear, UpgradeInstance upgrade, ref Random rand) { //IL_001b: 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) if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { behaviour.WeaponData.shockHeatRefund = heatRefund.GetValue(ref rand, upgrade, default(BoostParams)); } } public override void Remove(IGear gear, IGear prefab, UpgradeInstance upgrade, ref Random rand) { if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { behaviour.WeaponData.shockHeatRefund = behaviour.GetPrefabSnapshot().shockHeatRefund; } } } [Serializable] public class UpgradeProperty_Heat_ToxinRecycling : UpgradeProperty { public Range damagePerStack = new Range(1.5f, 2.5f); public Range maxStacks = new Range(8, 12); public override IEnumerator GetStatData(Random rand, IUpgradable gear, UpgradeInstance upgrade) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) yield return StatData.Create("Damage/stack (Corrode):", damagePerStack, upgrade, ref rand, (OverrideType)1, (LabelType)1, default(BoostParams), (Range?)null); yield return StatData.Create("Max stacks:", maxStacks, upgrade, ref rand, (OverrideType)1, (LabelType)1, default(BoostParams)); } public override void Apply(IGear gear, UpgradeInstance upgrade, ref Random rand) { //IL_001b: 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_003c: 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) if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { behaviour.WeaponData.toxinDamagePerStack = damagePerStack.GetValue(ref rand, upgrade, default(BoostParams)); behaviour.WeaponData.toxinMaxStacks = maxStacks.GetValue(ref rand, upgrade, default(BoostParams)); } } public override void Remove(IGear gear, IGear prefab, UpgradeInstance upgrade, ref Random rand) { if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { CyclerHeatBehaviour.Data prefabSnapshot = behaviour.GetPrefabSnapshot(); behaviour.WeaponData.toxinDamagePerStack = prefabSnapshot.toxinDamagePerStack; behaviour.WeaponData.toxinMaxStacks = prefabSnapshot.toxinMaxStacks; } } } [Serializable] public class UpgradeProperty_Heat_SuperheatReaction : UpgradeProperty { public Range elementPerStack = new Range(0.35f, 0.55f); public Range maxStacks = new Range(5, 8); public Range falloffSeconds = new Range(2.5f, 3.5f); public override IEnumerator GetStatData(Random rand, IUpgradable gear, UpgradeInstance upgrade) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) yield return StatData.Create("Element/stack:", elementPerStack, upgrade, ref rand, (OverrideType)1, (LabelType)1, default(BoostParams), (Range?)null); yield return StatData.Create("Max stacks:", maxStacks, upgrade, ref rand, (OverrideType)1, (LabelType)1, default(BoostParams)); } public override void Apply(IGear gear, UpgradeInstance upgrade, ref Random rand) { //IL_001b: 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_003c: 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_005d: 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) if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { behaviour.WeaponData.superheatElementPerStack = elementPerStack.GetValue(ref rand, upgrade, default(BoostParams)); behaviour.WeaponData.superheatMaxStacks = maxStacks.GetValue(ref rand, upgrade, default(BoostParams)); behaviour.WeaponData.superheatFalloffSeconds = falloffSeconds.GetValue(ref rand, upgrade, default(BoostParams)); } } public override void Remove(IGear gear, IGear prefab, UpgradeInstance upgrade, ref Random rand) { if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { CyclerHeatBehaviour.Data prefabSnapshot = behaviour.GetPrefabSnapshot(); behaviour.WeaponData.superheatElementPerStack = prefabSnapshot.superheatElementPerStack; behaviour.WeaponData.superheatMaxStacks = prefabSnapshot.superheatMaxStacks; behaviour.WeaponData.superheatFalloffSeconds = prefabSnapshot.superheatFalloffSeconds; } } } [Serializable] public class UpgradeProperty_Heat_LiteEnergy : UpgradeProperty { public Range bulletSpeedAtDoubleFireRate = new Range(0.35f, 0.55f); public override IEnumerator GetStatData(Random rand, IUpgradable gear, UpgradeInstance upgrade) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) yield return StatData.Create("Bullet speed @ 2x FR:", bulletSpeedAtDoubleFireRate, upgrade, ref rand, (OverrideType)2, (LabelType)1, default(BoostParams), (Range?)null); } public override void Apply(IGear gear, UpgradeInstance upgrade, ref Random rand) { //IL_001b: 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) if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { behaviour.WeaponData.liteEnergyBulletSpeedBonus = bulletSpeedAtDoubleFireRate.GetValue(ref rand, upgrade, default(BoostParams)); IWeapon val = (IWeapon)(object)((gear is IWeapon) ? gear : null); if (val != null) { behaviour.CaptureBaseFireInterval(val.GunData.fireInterval); behaviour.CaptureBaseBulletSpeed(val.GunData.bulletSpeed); } } } public override void Remove(IGear gear, IGear prefab, UpgradeInstance upgrade, ref Random rand) { if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { behaviour.WeaponData.liteEnergyBulletSpeedBonus = behaviour.GetPrefabSnapshot().liteEnergyBulletSpeedBonus; } } } [Serializable] public class UpgradeProperty_Heat_MassAcceleration : UpgradeProperty { public Range heatEfficiency = new Range(0.009f, 0.011f); public override IEnumerator GetStatData(Random rand, IUpgradable gear, UpgradeInstance upgrade) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) yield return StatData.Create("FR per Heat:", heatEfficiency, upgrade, ref rand, (OverrideType)1, (LabelType)1, default(BoostParams), (Range?)null); } public override void Apply(IGear gear, UpgradeInstance upgrade, ref Random rand) { //IL_001b: 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) if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { behaviour.WeaponData.massAccelEfficiency = heatEfficiency.GetValue(ref rand, upgrade, default(BoostParams)); IWeapon val = (IWeapon)(object)((gear is IWeapon) ? gear : null); if (val != null) { behaviour.CaptureBaseFireInterval(val.GunData.fireInterval); } } } public override void Remove(IGear gear, IGear prefab, UpgradeInstance upgrade, ref Random rand) { if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { behaviour.WeaponData.massAccelEfficiency = behaviour.GetPrefabSnapshot().massAccelEfficiency; } } } [Serializable] public class UpgradeProperty_Heat_EquipmentSiphon : UpgradeProperty { public Range maxHeatPer60Damage = new Range(0f, 0f); public Range heatRefundPer60Damage = new Range(4f, 7f); public Range dissipateMultiplier = new Range(1f, 1f); public override IEnumerator GetStatData(Random rand, IUpgradable gear, UpgradeInstance upgrade) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) yield return StatData.Create("Heat cool / 60 dmg:", heatRefundPer60Damage, upgrade, ref rand, (OverrideType)1, (LabelType)1, default(BoostParams), (Range?)null); } public override void Apply(IGear gear, UpgradeInstance upgrade, ref Random rand) { //IL_001b: 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) if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { behaviour.WeaponData.siphonHeatRefundPer60 = heatRefundPer60Damage.GetValue(ref rand, upgrade, default(BoostParams)); behaviour.WeaponData.siphonMaxHeatPer60 = 0f; } } public override void Remove(IGear gear, IGear prefab, UpgradeInstance upgrade, ref Random rand) { if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { CyclerHeatBehaviour.Data prefabSnapshot = behaviour.GetPrefabSnapshot(); behaviour.WeaponData.siphonHeatRefundPer60 = prefabSnapshot.siphonHeatRefundPer60; behaviour.WeaponData.siphonMaxHeatPer60 = prefabSnapshot.siphonMaxHeatPer60; } } } [Serializable] public class UpgradeProperty_Heat_FullOutput : UpgradeProperty { public Range damagePerRarity = new Range(9f, 13f); public override IEnumerator GetStatData(Random rand, IUpgradable gear, UpgradeInstance upgrade) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) yield return StatData.Create("Damage / rarity:", damagePerRarity, upgrade, ref rand, (OverrideType)1, (LabelType)1, default(BoostParams), (Range?)null); } public override void Apply(IGear gear, UpgradeInstance upgrade, ref Random rand) { //IL_001b: 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) if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { behaviour.WeaponData.fullOutputDamagePerRarity = damagePerRarity.GetValue(ref rand, upgrade, default(BoostParams)); } } public override void Remove(IGear gear, IGear prefab, UpgradeInstance upgrade, ref Random rand) { if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { behaviour.WeaponData.fullOutputDamagePerRarity = behaviour.GetPrefabSnapshot().fullOutputDamagePerRarity; } } } internal static class HeatE3 { public const int IdEnergyConvergence = 92049; public const int IdElementalDischarge = 92050; public const int IdViolentReaction = 92051; public const int IdCondensedEjection = 92052; public const int IdRocketSlide = 92053; public const int IdDumpCharge = 92054; public const int IdCyclePhasing = 92055; } [Serializable] public class UpgradeProperty_Heat_EnergyConvergence : UpgradeProperty { public Range heatPerStack = new Range(0.75f, 1.2f); public override IEnumerator GetStatData(Random rand, IUpgradable gear, UpgradeInstance upgrade) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) yield return StatData.Create("Heat / stack (hold R):", heatPerStack, upgrade, ref rand, (OverrideType)1, (LabelType)1, default(BoostParams), (Range?)null); } public override void Apply(IGear gear, UpgradeInstance upgrade, ref Random rand) { //IL_001b: 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) if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { behaviour.WeaponData.energyConvHeatPerStack = heatPerStack.GetValue(ref rand, upgrade, default(BoostParams)); } } public override void Remove(IGear gear, IGear prefab, UpgradeInstance upgrade, ref Random rand) { if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { behaviour.WeaponData.energyConvHeatPerStack = behaviour.GetPrefabSnapshot().energyConvHeatPerStack; } } } [Serializable] public class UpgradeProperty_Heat_ElementalDischarge : UpgradeProperty { public Range radius = new Range(4f, 6f); public Range damage = new Range(26f, 63f); public Range chargeTime = new Range(0.5f, 0.68f); public override IEnumerator GetStatData(Random rand, IUpgradable gear, UpgradeInstance upgrade) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) yield return StatData.Create("Nova radius:", radius, upgrade, ref rand, (OverrideType)1, (LabelType)1, default(BoostParams), (Range?)null); yield return StatData.Create("Nova damage:", damage, upgrade, ref rand, (OverrideType)1, (LabelType)1, default(BoostParams), (Range?)null); yield return StatData.Create("Charge time:", chargeTime, upgrade, ref rand, (OverrideType)1, (LabelType)1, default(BoostParams), (Range?)null); } public override void Apply(IGear gear, UpgradeInstance upgrade, ref Random rand) { //IL_001b: 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_003c: 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_005d: 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) if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { behaviour.WeaponData.dischargeRadius = radius.GetValue(ref rand, upgrade, default(BoostParams)); behaviour.WeaponData.dischargeDamage = damage.GetValue(ref rand, upgrade, default(BoostParams)); behaviour.WeaponData.dischargeChargeTime = chargeTime.GetValue(ref rand, upgrade, default(BoostParams)); } } public override void Remove(IGear gear, IGear prefab, UpgradeInstance upgrade, ref Random rand) { if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { CyclerHeatBehaviour.Data prefabSnapshot = behaviour.GetPrefabSnapshot(); behaviour.WeaponData.dischargeRadius = prefabSnapshot.dischargeRadius; behaviour.WeaponData.dischargeDamage = prefabSnapshot.dischargeDamage; behaviour.WeaponData.dischargeChargeTime = prefabSnapshot.dischargeChargeTime; } } } [Serializable] public class UpgradeProperty_Heat_ViolentReaction : UpgradeProperty { public Range radius = new Range(3.12f, 3.39f); public Range effectAmount = new Range(8f, 12f); public override IEnumerator GetStatData(Random rand, IUpgradable gear, UpgradeInstance upgrade) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) yield return StatData.Create("Spread radius:", radius, upgrade, ref rand, (OverrideType)1, (LabelType)1, default(BoostParams), (Range?)null); yield return StatData.Create("Spread element:", effectAmount, upgrade, ref rand, (OverrideType)1, (LabelType)1, default(BoostParams), (Range?)null); } public override void Apply(IGear gear, UpgradeInstance upgrade, ref Random rand) { //IL_001b: 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_003c: 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) if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { behaviour.WeaponData.violentRadius = radius.GetValue(ref rand, upgrade, default(BoostParams)); behaviour.WeaponData.violentEffectAmount = effectAmount.GetValue(ref rand, upgrade, default(BoostParams)); } } public override void Remove(IGear gear, IGear prefab, UpgradeInstance upgrade, ref Random rand) { if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { CyclerHeatBehaviour.Data prefabSnapshot = behaviour.GetPrefabSnapshot(); behaviour.WeaponData.violentRadius = prefabSnapshot.violentRadius; behaviour.WeaponData.violentEffectAmount = prefabSnapshot.violentEffectAmount; } } } [Serializable] public class UpgradeProperty_Heat_CondensedEjection : UpgradeProperty { public Range arcDamage = new Range(12f, 18f); public Range arcRadius = new Range(6f, 8f); public Range interval = new Range(0.35f, 0.5f); public override IEnumerator GetStatData(Random rand, IUpgradable gear, UpgradeInstance upgrade) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) yield return StatData.Create("Arc damage:", arcDamage, upgrade, ref rand, (OverrideType)1, (LabelType)1, default(BoostParams), (Range?)null); yield return StatData.Create("Arc radius:", arcRadius, upgrade, ref rand, (OverrideType)1, (LabelType)1, default(BoostParams), (Range?)null); } public override void Apply(IGear gear, UpgradeInstance upgrade, ref Random rand) { //IL_001b: 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_003c: 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_005d: 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) if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { behaviour.WeaponData.arcDamage = arcDamage.GetValue(ref rand, upgrade, default(BoostParams)); behaviour.WeaponData.arcRadius = arcRadius.GetValue(ref rand, upgrade, default(BoostParams)); behaviour.WeaponData.arcInterval = interval.GetValue(ref rand, upgrade, default(BoostParams)); Gun val = (Gun)(object)((gear is Gun) ? gear : null); if (val != null) { VanillaCyclerAssets.TryApplyPlasmaBullet(val); } } } public override void Remove(IGear gear, IGear prefab, UpgradeInstance upgrade, ref Random rand) { if (!CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { return; } CyclerHeatBehaviour.Data prefabSnapshot = behaviour.GetPrefabSnapshot(); behaviour.WeaponData.arcDamage = prefabSnapshot.arcDamage; behaviour.WeaponData.arcRadius = prefabSnapshot.arcRadius; behaviour.WeaponData.arcInterval = prefabSnapshot.arcInterval; Gun val = (Gun)(object)((gear is Gun) ? gear : null); if (val == null) { return; } try { val.ResetBullet(); val.SetBulletPrefabOnObservers_Owner(); } catch { } CartridgeSMG val2 = (CartridgeSMG)(object)((val is CartridgeSMG) ? val : null); if (val2 == null) { return; } IUpgradable prefab2 = ((Gun)val2).Prefab; CartridgeSMG val3 = (CartridgeSMG)(object)((prefab2 is CartridgeSMG) ? prefab2 : null); if (val3 == null) { return; } try { FieldInfo fieldInfo = AccessTools.Field(typeof(Gun), "fireSound"); FieldInfo fieldInfo2 = fieldInfo; if (fieldInfo != null && fieldInfo2 != null) { fieldInfo.SetValue(val2, fieldInfo2.GetValue(val3)); } } catch { } } } [Serializable] public class UpgradeProperty_Heat_RocketSlide : UpgradeProperty { public Range heatCost = new Range(8f, 12f); public Range rocketDamage = new Range(28f, 40f); public Range rocketRadius = new Range(2.5f, 3.5f); public Range interval = new Range(0.4f, 0.55f); public override IEnumerator GetStatData(Random rand, IUpgradable gear, UpgradeInstance upgrade) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) yield return StatData.Create("Heat / rocket:", heatCost, upgrade, ref rand, (OverrideType)1, (LabelType)1, default(BoostParams), (Range?)null); yield return StatData.Create("Rocket damage:", rocketDamage, upgrade, ref rand, (OverrideType)1, (LabelType)1, default(BoostParams), (Range?)null); } public override void Apply(IGear gear, UpgradeInstance upgrade, ref Random rand) { //IL_001b: 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_003c: 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_005d: 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_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { behaviour.WeaponData.rocketSlideHeatCost = heatCost.GetValue(ref rand, upgrade, default(BoostParams)); behaviour.WeaponData.rocketSlideDamage = rocketDamage.GetValue(ref rand, upgrade, default(BoostParams)); behaviour.WeaponData.rocketSlideRadius = rocketRadius.GetValue(ref rand, upgrade, default(BoostParams)); behaviour.WeaponData.rocketSlideInterval = interval.GetValue(ref rand, upgrade, default(BoostParams)); } } public override void Remove(IGear gear, IGear prefab, UpgradeInstance upgrade, ref Random rand) { if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { CyclerHeatBehaviour.Data prefabSnapshot = behaviour.GetPrefabSnapshot(); behaviour.WeaponData.rocketSlideHeatCost = prefabSnapshot.rocketSlideHeatCost; behaviour.WeaponData.rocketSlideDamage = prefabSnapshot.rocketSlideDamage; behaviour.WeaponData.rocketSlideRadius = prefabSnapshot.rocketSlideRadius; behaviour.WeaponData.rocketSlideInterval = prefabSnapshot.rocketSlideInterval; } } } [Serializable] public class UpgradeProperty_Heat_DumpCharge : UpgradeProperty { public Range damagePerSecond = new Range(40f, 55f); public Range secondsPerFullHeat = new Range(1.2f, 1.6f); public Range heatDrainPerSecond = new Range(40f, 55f); public override IEnumerator GetStatData(Random rand, IUpgradable gear, UpgradeInstance upgrade) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) yield return StatData.Create("Beam DPS:", damagePerSecond, upgrade, ref rand, (OverrideType)1, (LabelType)1, default(BoostParams), (Range?)null); yield return StatData.Create("Duration @ full heat:", secondsPerFullHeat, upgrade, ref rand, (OverrideType)1, (LabelType)1, default(BoostParams), (Range?)null); } public override void Apply(IGear gear, UpgradeInstance upgrade, ref Random rand) { //IL_001b: 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_003c: 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_005d: 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) if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { behaviour.WeaponData.dumpBeamDps = damagePerSecond.GetValue(ref rand, upgrade, default(BoostParams)); behaviour.WeaponData.dumpSecondsPerFullHeat = secondsPerFullHeat.GetValue(ref rand, upgrade, default(BoostParams)); behaviour.WeaponData.dumpHeatDrainPerSecond = heatDrainPerSecond.GetValue(ref rand, upgrade, default(BoostParams)); } } public override void Remove(IGear gear, IGear prefab, UpgradeInstance upgrade, ref Random rand) { if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { CyclerHeatBehaviour.Data prefabSnapshot = behaviour.GetPrefabSnapshot(); behaviour.WeaponData.dumpBeamDps = prefabSnapshot.dumpBeamDps; behaviour.WeaponData.dumpSecondsPerFullHeat = prefabSnapshot.dumpSecondsPerFullHeat; behaviour.WeaponData.dumpHeatDrainPerSecond = prefabSnapshot.dumpHeatDrainPerSecond; } } } [Serializable] public class UpgradeProperty_Heat_CyclePhasing : UpgradeProperty { public Range bonusStrength = new Range(1f, 1f); public override IEnumerator GetStatData(Random rand, IUpgradable gear, UpgradeInstance upgrade) { //IL_0007: 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) yield return StatData.Create("Phasing modes:", new Range(8, 8), upgrade, ref rand, (OverrideType)1, (LabelType)1, default(BoostParams)); } public override void Apply(IGear gear, UpgradeInstance upgrade, ref Random rand) { //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) if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { behaviour.WeaponData.cyclePhasing = true; behaviour.WeaponData.cyclePhasingStrength = bonusStrength.GetValue(ref rand, upgrade, default(BoostParams)); } } public override void Remove(IGear gear, IGear prefab, UpgradeInstance upgrade, ref Random rand) { if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { CyclerHeatBehaviour.Data prefabSnapshot = behaviour.GetPrefabSnapshot(); behaviour.WeaponData.cyclePhasing = prefabSnapshot.cyclePhasing; behaviour.WeaponData.cyclePhasingStrength = prefabSnapshot.cyclePhasingStrength; } } } internal static class HeatInterlace { public const int IdClosedLoop = 92057; public const int IdCrossflash = 92058; public const int IdPyrolysis = 92059; public const int IdTriValve = 92060; public const int IdAcidSpark = 92061; public const int IdBraidProtocol = 92062; public const int IdSaturateCatalyst = 92063; } [Serializable] public class UpgradeProperty_Heat_ClosedLoop : UpgradeProperty { public Range sustainSeconds = new Range(1.4f, 1.6f); public Range ventHeat = new Range(22f, 28f); public Range efficiencyDuration = new Range(0.9f, 1.1f); public Range heatPerShotMult = new Range(0.65f, 0.75f); public override IEnumerator GetStatData(Random rand, IUpgradable gear, UpgradeInstance upgrade) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) yield return StatData.Create("Redline sustain:", sustainSeconds, upgrade, ref rand, (OverrideType)1, (LabelType)1, default(BoostParams), (Range?)null); yield return StatData.Create("Auto-vent heat:", ventHeat, upgrade, ref rand, (OverrideType)1, (LabelType)1, default(BoostParams), (Range?)null); yield return StatData.Create("Efficiency duration:", efficiencyDuration, upgrade, ref rand, (OverrideType)1, (LabelType)1, default(BoostParams), (Range?)null); yield return StatData.Create("Heat/shot during efficiency:", heatPerShotMult, upgrade, ref rand, (OverrideType)2, (LabelType)1, default(BoostParams), (Range?)null); } public override void Apply(IGear gear, UpgradeInstance upgrade, ref Random rand) { //IL_001b: 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_003c: 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_005d: 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_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { behaviour.WeaponData.closedLoopSustainSeconds = sustainSeconds.GetValue(ref rand, upgrade, default(BoostParams)); behaviour.WeaponData.closedLoopVentHeat = ventHeat.GetValue(ref rand, upgrade, default(BoostParams)); behaviour.WeaponData.closedLoopEfficiencyDuration = efficiencyDuration.GetValue(ref rand, upgrade, default(BoostParams)); behaviour.WeaponData.closedLoopHeatPerShotMult = heatPerShotMult.GetValue(ref rand, upgrade, default(BoostParams)); } } public override void Remove(IGear gear, IGear prefab, UpgradeInstance upgrade, ref Random rand) { if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { CyclerHeatBehaviour.Data prefabSnapshot = behaviour.GetPrefabSnapshot(); behaviour.WeaponData.closedLoopSustainSeconds = prefabSnapshot.closedLoopSustainSeconds; behaviour.WeaponData.closedLoopVentHeat = prefabSnapshot.closedLoopVentHeat; behaviour.WeaponData.closedLoopEfficiencyDuration = prefabSnapshot.closedLoopEfficiencyDuration; behaviour.WeaponData.closedLoopHeatPerShotMult = prefabSnapshot.closedLoopHeatPerShotMult; } } } [Serializable] public class UpgradeProperty_Heat_Crossflash : UpgradeProperty { public Range bonusHeatRefund = new Range(8f, 14f); public Range splashRadius = new Range(2.8f, 3.6f); public Range splashDamage = new Range(18f, 28f); public Range splashFireAmount = new Range(6f, 10f); public override IEnumerator GetStatData(Random rand, IUpgradable gear, UpgradeInstance upgrade) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) yield return StatData.Create("Bonus heat (ignited Shock):", bonusHeatRefund, upgrade, ref rand, (OverrideType)1, (LabelType)1, default(BoostParams), (Range?)null); yield return StatData.Create("Fire splash radius:", splashRadius, upgrade, ref rand, (OverrideType)1, (LabelType)1, default(BoostParams), (Range?)null); yield return StatData.Create("Fire splash damage:", splashDamage, upgrade, ref rand, (OverrideType)1, (LabelType)1, default(BoostParams), (Range?)null); } public override void Apply(IGear gear, UpgradeInstance upgrade, ref Random rand) { //IL_001b: 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_003c: 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_005d: 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_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { behaviour.WeaponData.crossflashBonusRefund = bonusHeatRefund.GetValue(ref rand, upgrade, default(BoostParams)); behaviour.WeaponData.crossflashSplashRadius = splashRadius.GetValue(ref rand, upgrade, default(BoostParams)); behaviour.WeaponData.crossflashSplashDamage = splashDamage.GetValue(ref rand, upgrade, default(BoostParams)); behaviour.WeaponData.crossflashSplashFire = splashFireAmount.GetValue(ref rand, upgrade, default(BoostParams)); } } public override void Remove(IGear gear, IGear prefab, UpgradeInstance upgrade, ref Random rand) { if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { CyclerHeatBehaviour.Data prefabSnapshot = behaviour.GetPrefabSnapshot(); behaviour.WeaponData.crossflashBonusRefund = prefabSnapshot.crossflashBonusRefund; behaviour.WeaponData.crossflashSplashRadius = prefabSnapshot.crossflashSplashRadius; behaviour.WeaponData.crossflashSplashDamage = prefabSnapshot.crossflashSplashDamage; behaviour.WeaponData.crossflashSplashFire = prefabSnapshot.crossflashSplashFire; } } } [Serializable] public class UpgradeProperty_Heat_Pyrolysis : UpgradeProperty { public Range radius = new Range(2.4f, 3.2f); public Range damage = new Range(22f, 34f); public Range bankStacks = new Range(1, 1); public override IEnumerator GetStatData(Random rand, IUpgradable gear, UpgradeInstance upgrade) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) yield return StatData.Create("Detonation radius:", radius, upgrade, ref rand, (OverrideType)1, (LabelType)1, default(BoostParams), (Range?)null); yield return StatData.Create("Detonation damage:", damage, upgrade, ref rand, (OverrideType)1, (LabelType)1, default(BoostParams), (Range?)null); yield return StatData.Create("Bank stacks:", bankStacks, upgrade, ref rand, (OverrideType)1, (LabelType)1, default(BoostParams)); } public override void Apply(IGear gear, UpgradeInstance upgrade, ref Random rand) { //IL_001b: 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_003c: 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_005d: 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) if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { behaviour.WeaponData.pyrolysisRadius = radius.GetValue(ref rand, upgrade, default(BoostParams)); behaviour.WeaponData.pyrolysisDamage = damage.GetValue(ref rand, upgrade, default(BoostParams)); behaviour.WeaponData.pyrolysisBankStacks = bankStacks.GetValue(ref rand, upgrade, default(BoostParams)); } } public override void Remove(IGear gear, IGear prefab, UpgradeInstance upgrade, ref Random rand) { if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { CyclerHeatBehaviour.Data prefabSnapshot = behaviour.GetPrefabSnapshot(); behaviour.WeaponData.pyrolysisRadius = prefabSnapshot.pyrolysisRadius; behaviour.WeaponData.pyrolysisDamage = prefabSnapshot.pyrolysisDamage; behaviour.WeaponData.pyrolysisBankStacks = prefabSnapshot.pyrolysisBankStacks; } } } [Serializable] public class UpgradeProperty_Heat_TriValve : UpgradeProperty { public Range fireAmount = new Range(0.45f, 0.65f); public Range shockAmount = new Range(0.45f, 0.65f); public Range acidAmount = new Range(0.45f, 0.65f); public override IEnumerator GetStatData(Random rand, IUpgradable gear, UpgradeInstance upgrade) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) yield return StatData.Create("Fire appl:", fireAmount, upgrade, ref rand, (OverrideType)1, (LabelType)1, default(BoostParams), (Range?)null); yield return StatData.Create("Shock appl:", shockAmount, upgrade, ref rand, (OverrideType)1, (LabelType)1, default(BoostParams), (Range?)null); yield return StatData.Create("Acid appl:", acidAmount, upgrade, ref rand, (OverrideType)1, (LabelType)1, default(BoostParams), (Range?)null); } public override void Apply(IGear gear, UpgradeInstance upgrade, ref Random rand) { //IL_001b: 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_003c: 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_005d: 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) if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { behaviour.WeaponData.triValveFire = fireAmount.GetValue(ref rand, upgrade, default(BoostParams)); behaviour.WeaponData.triValveShock = shockAmount.GetValue(ref rand, upgrade, default(BoostParams)); behaviour.WeaponData.triValveAcid = acidAmount.GetValue(ref rand, upgrade, default(BoostParams)); } } public override void Remove(IGear gear, IGear prefab, UpgradeInstance upgrade, ref Random rand) { if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { CyclerHeatBehaviour.Data prefabSnapshot = behaviour.GetPrefabSnapshot(); behaviour.WeaponData.triValveFire = prefabSnapshot.triValveFire; behaviour.WeaponData.triValveShock = prefabSnapshot.triValveShock; behaviour.WeaponData.triValveAcid = prefabSnapshot.triValveAcid; } } } [Serializable] public class UpgradeProperty_Heat_AcidSpark : UpgradeProperty { public Range arcDamage = new Range(22f, 34f); public Range arcRadius = new Range(6f, 9f); public Range arcShockAmount = new Range(8f, 14f); public override IEnumerator GetStatData(Random rand, IUpgradable gear, UpgradeInstance upgrade) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) yield return StatData.Create("Arc damage:", arcDamage, upgrade, ref rand, (OverrideType)1, (LabelType)1, default(BoostParams), (Range?)null); yield return StatData.Create("Arc radius:", arcRadius, upgrade, ref rand, (OverrideType)1, (LabelType)1, default(BoostParams), (Range?)null); } public override void Apply(IGear gear, UpgradeInstance upgrade, ref Random rand) { //IL_001b: 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_003c: 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_005d: 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) if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { behaviour.WeaponData.acidSparkArcDamage = arcDamage.GetValue(ref rand, upgrade, default(BoostParams)); behaviour.WeaponData.acidSparkArcRadius = arcRadius.GetValue(ref rand, upgrade, default(BoostParams)); behaviour.WeaponData.acidSparkShockAmount = arcShockAmount.GetValue(ref rand, upgrade, default(BoostParams)); } } public override void Remove(IGear gear, IGear prefab, UpgradeInstance upgrade, ref Random rand) { if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { CyclerHeatBehaviour.Data prefabSnapshot = behaviour.GetPrefabSnapshot(); behaviour.WeaponData.acidSparkArcDamage = prefabSnapshot.acidSparkArcDamage; behaviour.WeaponData.acidSparkArcRadius = prefabSnapshot.acidSparkArcRadius; behaviour.WeaponData.acidSparkShockAmount = prefabSnapshot.acidSparkShockAmount; } } } [Serializable] public class UpgradeProperty_Heat_BraidProtocol : UpgradeProperty { public Range windowSeconds = new Range(2.8f, 3.2f); public Range efficiencyDuration = new Range(1.8f, 2.2f); public Range heatPerShotMult = new Range(0.7f, 0.8f); public override IEnumerator GetStatData(Random rand, IUpgradable gear, UpgradeInstance upgrade) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) yield return StatData.Create("Braid window:", windowSeconds, upgrade, ref rand, (OverrideType)1, (LabelType)1, default(BoostParams), (Range?)null); yield return StatData.Create("Efficiency duration:", efficiencyDuration, upgrade, ref rand, (OverrideType)1, (LabelType)1, default(BoostParams), (Range?)null); yield return StatData.Create("Heat/shot during braid:", heatPerShotMult, upgrade, ref rand, (OverrideType)2, (LabelType)1, default(BoostParams), (Range?)null); } public override void Apply(IGear gear, UpgradeInstance upgrade, ref Random rand) { //IL_001b: 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_003c: 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_005d: 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) if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { behaviour.WeaponData.braidWindowSeconds = windowSeconds.GetValue(ref rand, upgrade, default(BoostParams)); behaviour.WeaponData.braidEfficiencyDuration = efficiencyDuration.GetValue(ref rand, upgrade, default(BoostParams)); behaviour.WeaponData.braidHeatPerShotMult = heatPerShotMult.GetValue(ref rand, upgrade, default(BoostParams)); } } public override void Remove(IGear gear, IGear prefab, UpgradeInstance upgrade, ref Random rand) { if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { CyclerHeatBehaviour.Data prefabSnapshot = behaviour.GetPrefabSnapshot(); behaviour.WeaponData.braidWindowSeconds = prefabSnapshot.braidWindowSeconds; behaviour.WeaponData.braidEfficiencyDuration = prefabSnapshot.braidEfficiencyDuration; behaviour.WeaponData.braidHeatPerShotMult = prefabSnapshot.braidHeatPerShotMult; } } } [Serializable] public class UpgradeProperty_Heat_SaturateCatalyst : UpgradeProperty { public Range maxStacks = new Range(3, 3); public Range stackDuration = new Range(4f, 5f); public Range ventDamagePerStack = new Range(8f, 12f); public Range ventRadiusPerStack = new Range(0.35f, 0.55f); public override IEnumerator GetStatData(Random rand, IUpgradable gear, UpgradeInstance upgrade) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) yield return StatData.Create("Max stacks:", maxStacks, upgrade, ref rand, (OverrideType)1, (LabelType)1, default(BoostParams)); yield return StatData.Create("Stack duration:", stackDuration, upgrade, ref rand, (OverrideType)1, (LabelType)1, default(BoostParams), (Range?)null); yield return StatData.Create("Vent dmg/stack:", ventDamagePerStack, upgrade, ref rand, (OverrideType)1, (LabelType)1, default(BoostParams), (Range?)null); } public override void Apply(IGear gear, UpgradeInstance upgrade, ref Random rand) { //IL_001b: 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_003c: 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_005d: 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_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { behaviour.WeaponData.catalystMaxStacks = maxStacks.GetValue(ref rand, upgrade, default(BoostParams)); behaviour.WeaponData.catalystStackDuration = stackDuration.GetValue(ref rand, upgrade, default(BoostParams)); behaviour.WeaponData.catalystVentDamagePerStack = ventDamagePerStack.GetValue(ref rand, upgrade, default(BoostParams)); behaviour.WeaponData.catalystVentRadiusPerStack = ventRadiusPerStack.GetValue(ref rand, upgrade, default(BoostParams)); } } public override void Remove(IGear gear, IGear prefab, UpgradeInstance upgrade, ref Random rand) { if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { CyclerHeatBehaviour.Data prefabSnapshot = behaviour.GetPrefabSnapshot(); behaviour.WeaponData.catalystMaxStacks = prefabSnapshot.catalystMaxStacks; behaviour.WeaponData.catalystStackDuration = prefabSnapshot.catalystStackDuration; behaviour.WeaponData.catalystVentDamagePerStack = prefabSnapshot.catalystVentDamagePerStack; behaviour.WeaponData.catalystVentRadiusPerStack = prefabSnapshot.catalystVentRadiusPerStack; } } } internal static class EffectCallbackUtil { private static FieldInfo _targetField; private static PropertyInfo _targetProp; private static bool _resolved; public static ITarget TryGetTarget(in EffectCallbackData data) { //IL_005f: Unknown result type (might be due to invalid IL or missing references) try { if (!_resolved) { Type typeFromHandle = typeof(EffectCallbackData); _targetField = typeFromHandle.GetField("target", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) ?? typeFromHandle.GetField("Target", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); _targetProp = typeFromHandle.GetProperty("target", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) ?? typeFromHandle.GetProperty("Target", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); _resolved = true; } object obj = data; if (_targetField != null) { object? value = _targetField.GetValue(obj); ITarget val = (ITarget)((value is ITarget) ? value : null); if (val != null) { return val; } } if (_targetProp != null) { object? value2 = _targetProp.GetValue(obj); ITarget val2 = (ITarget)((value2 is ITarget) ? value2 : null); if (val2 != null) { return val2; } } } catch { } return null; } } internal static class HeatStatLayers { public static void ApplyFireIntervalLayers(Gun gun, in CyclerHeatBehaviour.Data data, float currentHeat, float heatNormalized, float baseFireIntervalCaptured, out float appliedInterval) { appliedInterval = -1f; if ((Object)(object)gun == (Object)null) { return; } ref GunData gunData = ref gun.GunData; float num = ((baseFireIntervalCaptured > 0f) ? baseFireIntervalCaptured : gunData.fireInterval); if (data.massAccelEfficiency > 0f && num > 0f) { float num2 = 1f + currentHeat * data.massAccelEfficiency; num /= Mathf.Max(0.05f, num2); } int num3; if (data.infinityBurn) { num3 = ((currentHeat > data.maxHeat + 0.0001f) ? 1 : 0); if (num3 != 0) { goto IL_00a9; } } else { num3 = 0; } if (currentHeat >= data.maxHeat - 0.0001f && data.redlineFireIntervalMult > 1f) { num *= data.redlineFireIntervalMult; } goto IL_00a9; IL_00a9: if (num3 != 0 && data.infinityBurnOvercapFireIntervalMult > 0f && data.infinityBurnOvercapFireIntervalMult < 1f) { num *= data.infinityBurnOvercapFireIntervalMult; } gunData.fireInterval = Mathf.Max(0.02f, num); appliedInterval = gunData.fireInterval; } public static void ApplyLiteEnergyBulletSpeed(Gun gun, in CyclerHeatBehaviour.Data data, float baseFireIntervalCaptured, float baseBulletSpeedCaptured) { if (!((Object)(object)gun == (Object)null) && !(data.liteEnergyBulletSpeedBonus <= 0f) && !(baseFireIntervalCaptured <= 0.01f) && !(baseBulletSpeedCaptured <= 0f)) { ref GunData gunData = ref gun.GunData; float num = Mathf.Clamp01(baseFireIntervalCaptured / Mathf.Max(0.02f, gunData.fireInterval) - 1f); gunData.bulletSpeed = baseBulletSpeedCaptured * (1f + data.liteEnergyBulletSpeedBonus * num); } } public static void ApplyZoneToBullet(ref BulletData bullet, in CyclerHeatBehaviour.Data data, HeatZone zone, float heatNormalized) { //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Invalid comparison between Unknown and I4 float num = 1f; float num2 = 1f; switch (zone) { case HeatZone.Hot: num *= ((data.hotDamageMult > 0f) ? data.hotDamageMult : 1f); num2 *= ((data.hotElementMult > 0f) ? data.hotElementMult : 1f); break; case HeatZone.Redline: num *= ((data.redlineDamageMult > 0f) ? data.redlineDamageMult : 1f); num2 *= ((data.redlineElementMult > 0f) ? data.redlineElementMult : 1f); break; case HeatZone.Overcap: { num *= ((data.redlineDamageMult > 0f) ? data.redlineDamageMult : 1f); num2 *= ((data.redlineElementMult > 0f) ? data.redlineElementMult : 1f); float num3 = Mathf.Max(0f, heatNormalized - 1f); num *= 1f + num3 * Mathf.Max(0f, data.infinityBurnOutgoingDamagePerOvercap); num2 *= 1f + num3 * Mathf.Max(0f, data.infinityBurnOutgoingElementPerOvercap); break; } } if (num != 1f) { bullet.damage *= num; } if (num2 != 1f && (int)bullet.damageEffect > 0) { bullet.damageEffectAmount *= num2; } } public static void ApplyRedlineSpreadToBullet(ref BulletData bullet, in CyclerHeatBehaviour.Data data, HeatZone zone) { if (zone == HeatZone.Redline && !(data.redlineSpreadMult <= 1f) && bullet.targetMagnetism > 0f) { bullet.targetMagnetism /= data.redlineSpreadMult; } } } [Serializable] public class UpgradeProperty_Heat_MaxHeatMult : UpgradeProperty { public Range maxHeatMultiplier = new Range(0.6f, 0.8f); public override IEnumerator GetStatData(Random rand, IUpgradable gear, UpgradeInstance upgrade) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) yield return StatData.Create("Max Heat:", maxHeatMultiplier, upgrade, ref rand, (OverrideType)2, (LabelType)1, default(BoostParams), (Range?)null); } public override void Apply(IGear gear, UpgradeInstance upgrade, ref Random rand) { //IL_0015: 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) if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { float value = maxHeatMultiplier.GetValue(ref rand, upgrade, default(BoostParams)); behaviour.WeaponData.maxHeat = Mathf.Max(1f, behaviour.WeaponData.maxHeat * value); } } public override void Remove(IGear gear, IGear prefab, UpgradeInstance upgrade, ref Random rand) { if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { behaviour.WeaponData.maxHeat = behaviour.GetPrefabSnapshot().maxHeat; } } } [Serializable] public class UpgradeProperty_Heat_Cycling : UpgradeProperty { public Range effectAmount = new Range(0.333f, 0.333f); public override IEnumerator GetStatData(Random rand, IUpgradable gear, UpgradeInstance upgrade) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) yield return StatData.Create("Element cycle:", new Range(1, 1), upgrade, ref rand, (OverrideType)1, (LabelType)1, default(BoostParams)); yield return StatData.Create("Element:", effectAmount, upgrade, ref rand, (OverrideType)1, (LabelType)1, default(BoostParams), (Range?)null); } public override void Apply(IGear gear, UpgradeInstance upgrade, ref Random rand) { //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) if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { behaviour.WeaponData.cycling = true; behaviour.WeaponData.cyclingEffectAmount = effectAmount.GetValue(ref rand, upgrade, default(BoostParams)); } } public override void Remove(IGear gear, IGear prefab, UpgradeInstance upgrade, ref Random rand) { if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { CyclerHeatBehaviour.Data prefabSnapshot = behaviour.GetPrefabSnapshot(); behaviour.WeaponData.cycling = prefabSnapshot.cycling; behaviour.WeaponData.cyclingEffectAmount = prefabSnapshot.cyclingEffectAmount; } } } [Serializable] public class UpgradeProperty_Heat_ScorchingDetonation : UpgradeProperty { public Range radius = new Range(3.6f, 4.22f); public Range damage = new Range(37.5f, 49.5f); public override IEnumerator GetStatData(Random rand, IUpgradable gear, UpgradeInstance upgrade) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) yield return StatData.Create("Detonation radius:", radius, upgrade, ref rand, (OverrideType)1, (LabelType)1, default(BoostParams), (Range?)null); yield return StatData.Create("Detonation damage:", damage, upgrade, ref rand, (OverrideType)1, (LabelType)1, default(BoostParams), (Range?)null); } public override void Apply(IGear gear, UpgradeInstance upgrade, ref Random rand) { //IL_001b: 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_003c: 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) if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { behaviour.WeaponData.scorchingDetonationRadius = radius.GetValue(ref rand, upgrade, default(BoostParams)); behaviour.WeaponData.scorchingDetonationDamage = damage.GetValue(ref rand, upgrade, default(BoostParams)); } } public override void Remove(IGear gear, IGear prefab, UpgradeInstance upgrade, ref Random rand) { if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { CyclerHeatBehaviour.Data prefabSnapshot = behaviour.GetPrefabSnapshot(); behaviour.WeaponData.scorchingDetonationRadius = prefabSnapshot.scorchingDetonationRadius; behaviour.WeaponData.scorchingDetonationDamage = prefabSnapshot.scorchingDetonationDamage; } } } [Serializable] public class UpgradeProperty_Heat_HealOnSustainedFire : UpgradeProperty { public Range health = new Range(0.8f, 1.2f); public override IEnumerator GetStatData(Random rand, IUpgradable gear, UpgradeInstance upgrade) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) yield return StatData.Create("Heal (per 15 shots):", health, upgrade, ref rand, (OverrideType)1, (LabelType)1, default(BoostParams), (Range?)null); } public override void Apply(IGear gear, UpgradeInstance upgrade, ref Random rand) { //IL_001b: 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) if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { behaviour.WeaponData.healOnSustainedFire = health.GetValue(ref rand, upgrade, default(BoostParams)); behaviour.WeaponData.healShotsInterval = 15; } } public override void Remove(IGear gear, IGear prefab, UpgradeInstance upgrade, ref Random rand) { if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { CyclerHeatBehaviour.Data prefabSnapshot = behaviour.GetPrefabSnapshot(); behaviour.WeaponData.healOnSustainedFire = prefabSnapshot.healOnSustainedFire; behaviour.WeaponData.healShotsInterval = prefabSnapshot.healShotsInterval; } } } [Serializable] public class UpgradeProperty_Heat_OverloadSpeed : UpgradeProperty { public Range speed = new Range(3.75f, 5f); public Range duration = new Range(3.6f, 4.4f); public override IEnumerator GetStatData(Random rand, IUpgradable gear, UpgradeInstance upgrade) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) yield return StatData.Create("Speed on Shock:", speed, upgrade, ref rand, (OverrideType)1, (LabelType)1, default(BoostParams), (Range?)null); yield return StatData.Create("Duration:", duration, upgrade, ref rand, (OverrideType)1, (LabelType)1, default(BoostParams), (Range?)null); } public override void Apply(IGear gear, UpgradeInstance upgrade, ref Random rand) { //IL_001b: 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_003c: 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) if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { behaviour.WeaponData.overloadSpeedIncrease = speed.GetValue(ref rand, upgrade, default(BoostParams)); behaviour.WeaponData.overloadSpeedDuration = duration.GetValue(ref rand, upgrade, default(BoostParams)); } } public override void Remove(IGear gear, IGear prefab, UpgradeInstance upgrade, ref Random rand) { if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { CyclerHeatBehaviour.Data prefabSnapshot = behaviour.GetPrefabSnapshot(); behaviour.WeaponData.overloadSpeedIncrease = prefabSnapshot.overloadSpeedIncrease; behaviour.WeaponData.overloadSpeedDuration = prefabSnapshot.overloadSpeedDuration; } } } [Serializable] public class UpgradeProperty_Heat_AimRecoil : UpgradeProperty { public Range aimRecoilMultiplier = new Range(0.58f, 0.7f); public Range aimDissipateDelayMult = new Range(1f, 1f); public override IEnumerator GetStatData(Random rand, IUpgradable gear, UpgradeInstance upgrade) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) yield return StatData.Create("ADS Recoil:", aimRecoilMultiplier, upgrade, ref rand, (OverrideType)2, (LabelType)1, default(BoostParams), (Range?)null); if (aimDissipateDelayMult.min < 0.999f || aimDissipateDelayMult.max < 0.999f) { yield return StatData.Create("ADS cool delay:", aimDissipateDelayMult, upgrade, ref rand, (OverrideType)2, (LabelType)1, default(BoostParams), (Range?)null); } } public override void Apply(IGear gear, UpgradeInstance upgrade, ref Random rand) { //IL_001b: 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_003c: 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) if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { behaviour.WeaponData.aimRecoilMultiplier = aimRecoilMultiplier.GetValue(ref rand, upgrade, default(BoostParams)); behaviour.WeaponData.aimDissipateDelayMult = aimDissipateDelayMult.GetValue(ref rand, upgrade, default(BoostParams)); } } public override void Remove(IGear gear, IGear prefab, UpgradeInstance upgrade, ref Random rand) { if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { CyclerHeatBehaviour.Data prefabSnapshot = behaviour.GetPrefabSnapshot(); behaviour.WeaponData.aimRecoilMultiplier = prefabSnapshot.aimRecoilMultiplier; behaviour.WeaponData.aimDissipateDelayMult = prefabSnapshot.aimDissipateDelayMult; } } } [Serializable] public class UpgradeProperty_Heat_HeatPerShotMult : UpgradeProperty { public Range heatPerShotMultiplier = new Range(1.1f, 1.2f); public override IEnumerator GetStatData(Random rand, IUpgradable gear, UpgradeInstance upgrade) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) yield return StatData.Create("Heat / shot:", heatPerShotMultiplier, upgrade, ref rand, (OverrideType)2, (LabelType)1, default(BoostParams), (Range?)null); } public override void Apply(IGear gear, UpgradeInstance upgrade, ref Random rand) { //IL_0015: 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) if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { float value = heatPerShotMultiplier.GetValue(ref rand, upgrade, default(BoostParams)); behaviour.WeaponData.heatPerShot = Mathf.Max(0.01f, behaviour.WeaponData.heatPerShot * value); } } public override void Remove(IGear gear, IGear prefab, UpgradeInstance upgrade, ref Random rand) { if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { behaviour.WeaponData.heatPerShot = behaviour.GetPrefabSnapshot().heatPerShot; } } } [Serializable] public class UpgradeProperty_Heat_HeatPerShotAdd : UpgradeProperty { public Range heatPerShotAdd = new Range(0.15f, 0.25f); public override IEnumerator GetStatData(Random rand, IUpgradable gear, UpgradeInstance upgrade) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) yield return StatData.Create("Heat / shot:", heatPerShotAdd, upgrade, ref rand, (OverrideType)1, (LabelType)1, default(BoostParams), (Range?)null); } public override void Apply(IGear gear, UpgradeInstance upgrade, ref Random rand) { //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) if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { behaviour.WeaponData.heatPerShot = Mathf.Max(0.01f, behaviour.WeaponData.heatPerShot + heatPerShotAdd.GetValue(ref rand, upgrade, default(BoostParams))); } } public override void Remove(IGear gear, IGear prefab, UpgradeInstance upgrade, ref Random rand) { if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { behaviour.WeaponData.heatPerShot = behaviour.GetPrefabSnapshot().heatPerShot; } } } [Serializable] public class UpgradeProperty_Heat_InfinityBurn : UpgradeProperty { public Range damagePerSecond = new Range(44f, 56f); public Range effectPerSecond = new Range(11f, 20f); public override IEnumerator GetStatData(Random rand, IUpgradable gear, UpgradeInstance upgrade) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) yield return StatData.Create("Overcap heat:", new Range(1, 1), upgrade, ref rand, (OverrideType)1, (LabelType)1, default(BoostParams)); yield return StatData.Create("Self-damage/s (over max):", damagePerSecond, upgrade, ref rand, (OverrideType)1, (LabelType)1, default(BoostParams), (Range?)null); yield return StatData.Create("Self element/s:", effectPerSecond, upgrade, ref rand, (OverrideType)1, (LabelType)1, default(BoostParams), (Range?)null); } public override void Apply(IGear gear, UpgradeInstance upgrade, ref Random rand) { //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_0048: 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) if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { behaviour.WeaponData.infinityBurn = true; behaviour.WeaponData.infinityBurnDamagePerSecond = damagePerSecond.GetValue(ref rand, upgrade, default(BoostParams)); behaviour.WeaponData.infinityBurnEffectPerSecond = effectPerSecond.GetValue(ref rand, upgrade, default(BoostParams)); behaviour.WeaponData.infinityBurnHardCap = behaviour.WeaponData.maxHeat * 2f; if (behaviour.WeaponData.infinityBurnOutgoingDamagePerOvercap <= 0f) { behaviour.WeaponData.infinityBurnOutgoingDamagePerOvercap = 0.35f; } if (behaviour.WeaponData.infinityBurnOutgoingElementPerOvercap <= 0f) { behaviour.WeaponData.infinityBurnOutgoingElementPerOvercap = 0.25f; } if (behaviour.WeaponData.infinityBurnOvercapFireIntervalMult <= 0f) { behaviour.WeaponData.infinityBurnOvercapFireIntervalMult = 0.92f; } } } public override void Remove(IGear gear, IGear prefab, UpgradeInstance upgrade, ref Random rand) { if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { CyclerHeatBehaviour.Data prefabSnapshot = behaviour.GetPrefabSnapshot(); behaviour.WeaponData.infinityBurn = prefabSnapshot.infinityBurn; behaviour.WeaponData.infinityBurnDamagePerSecond = prefabSnapshot.infinityBurnDamagePerSecond; behaviour.WeaponData.infinityBurnEffectPerSecond = prefabSnapshot.infinityBurnEffectPerSecond; behaviour.WeaponData.infinityBurnHardCap = prefabSnapshot.infinityBurnHardCap; behaviour.WeaponData.infinityBurnOutgoingDamagePerOvercap = prefabSnapshot.infinityBurnOutgoingDamagePerOvercap; behaviour.WeaponData.infinityBurnOutgoingElementPerOvercap = prefabSnapshot.infinityBurnOutgoingElementPerOvercap; behaviour.WeaponData.infinityBurnOvercapFireIntervalMult = prefabSnapshot.infinityBurnOvercapFireIntervalMult; } } } [Serializable] public class UpgradeProperty_Heat_MaxHeatMultBig : UpgradeProperty { public Range maxHeatMultiplier = new Range(1.9f, 2.15f); public override IEnumerator GetStatData(Random rand, IUpgradable gear, UpgradeInstance upgrade) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) yield return StatData.Create("Max Heat:", maxHeatMultiplier, upgrade, ref rand, (OverrideType)2, (LabelType)1, default(BoostParams), (Range?)null); } public override void Apply(IGear gear, UpgradeInstance upgrade, ref Random rand) { //IL_0015: 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) if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { float value = maxHeatMultiplier.GetValue(ref rand, upgrade, default(BoostParams)); behaviour.WeaponData.maxHeat = Mathf.Max(1f, behaviour.WeaponData.maxHeat * value); } } public override void Remove(IGear gear, IGear prefab, UpgradeInstance upgrade, ref Random rand) { if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { behaviour.WeaponData.maxHeat = behaviour.GetPrefabSnapshot().maxHeat; } } } [Serializable] public class UpgradeProperty_Heat_CompactCartridge : UpgradeProperty { public Range maxHeatAdd = new Range(-9f, -7f); public Range dissipateMultiplier = new Range(1.3f, 1.4f); public override IEnumerator GetStatData(Random rand, IUpgradable gear, UpgradeInstance upgrade) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) yield return StatData.Create("Max Heat:", maxHeatAdd, upgrade, ref rand, (OverrideType)1, (LabelType)1, default(BoostParams), (Range?)null); yield return StatData.Create("Cooldown speed:", dissipateMultiplier, upgrade, ref rand, (OverrideType)2, (LabelType)1, default(BoostParams), (Range?)null); } public override void Apply(IGear gear, UpgradeInstance upgrade, ref Random rand) { //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_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { behaviour.WeaponData.maxHeat = Mathf.Max(1f, behaviour.WeaponData.maxHeat + maxHeatAdd.GetValue(ref rand, upgrade, default(BoostParams))); behaviour.WeaponData.dissipatePerSecond *= dissipateMultiplier.GetValue(ref rand, upgrade, default(BoostParams)); } } public override void Remove(IGear gear, IGear prefab, UpgradeInstance upgrade, ref Random rand) { if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { CyclerHeatBehaviour.Data prefabSnapshot = behaviour.GetPrefabSnapshot(); behaviour.WeaponData.maxHeat = prefabSnapshot.maxHeat; behaviour.WeaponData.dissipatePerSecond = prefabSnapshot.dissipatePerSecond; } } } [Serializable] public class UpgradeProperty_Heat_Doublestack : UpgradeProperty { public Range maxHeatMultiplier = new Range(1.2f, 1.4f); public override IEnumerator GetStatData(Random rand, IUpgradable gear, UpgradeInstance upgrade) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) yield return StatData.Create("Max Heat:", maxHeatMultiplier, upgrade, ref rand, (OverrideType)2, (LabelType)1, default(BoostParams), (Range?)null); } public override void Apply(IGear gear, UpgradeInstance upgrade, ref Random rand) { //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) if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { behaviour.WeaponData.maxHeat = Mathf.Max(1f, behaviour.WeaponData.maxHeat * maxHeatMultiplier.GetValue(ref rand, upgrade, default(BoostParams))); } } public override void Remove(IGear gear, IGear prefab, UpgradeInstance upgrade, ref Random rand) { if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { behaviour.WeaponData.maxHeat = behaviour.GetPrefabSnapshot().maxHeat; } } } [Serializable] public class UpgradeProperty_Heat_AdrenalineReload : UpgradeProperty { public Range heatRefund = new Range(12f, 20f); public Range dissipateMultiplier = new Range(1.15f, 1.25f); public Range duration = new Range(0.75f, 0.75f); public override IEnumerator GetStatData(Random rand, IUpgradable gear, UpgradeInstance upgrade) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) yield return StatData.Create("Heat dump on kill:", heatRefund, upgrade, ref rand, (OverrideType)1, (LabelType)1, default(BoostParams), (Range?)null); yield return StatData.Create("Cool after kill:", dissipateMultiplier, upgrade, ref rand, (OverrideType)2, (LabelType)1, default(BoostParams), (Range?)null); yield return StatData.Create("Duration:", duration, upgrade, ref rand, (OverrideType)1, (LabelType)1, default(BoostParams), (Range?)null); } public override void Apply(IGear gear, UpgradeInstance upgrade, ref Random rand) { //IL_001b: 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_003c: 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_005d: 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) if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { behaviour.WeaponData.adrenalineHeatRefund = heatRefund.GetValue(ref rand, upgrade, default(BoostParams)); behaviour.WeaponData.adrenalineDissipateMultiplier = dissipateMultiplier.GetValue(ref rand, upgrade, default(BoostParams)); behaviour.WeaponData.adrenalineDuration = duration.GetValue(ref rand, upgrade, default(BoostParams)); } } public override void Remove(IGear gear, IGear prefab, UpgradeInstance upgrade, ref Random rand) { if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { CyclerHeatBehaviour.Data prefabSnapshot = behaviour.GetPrefabSnapshot(); behaviour.WeaponData.adrenalineHeatRefund = prefabSnapshot.adrenalineHeatRefund; behaviour.WeaponData.adrenalineDissipateMultiplier = prefabSnapshot.adrenalineDissipateMultiplier; behaviour.WeaponData.adrenalineDuration = prefabSnapshot.adrenalineDuration; } } } [Serializable] public class UpgradeProperty_Heat_ChargeShield : UpgradeProperty { public Range damageTakenMultiplier = new Range(0.75f, 0.85f); public override IEnumerator GetStatData(Random rand, IUpgradable gear, UpgradeInstance upgrade) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) yield return StatData.Create("Damage taken (overheat):", damageTakenMultiplier, upgrade, ref rand, (OverrideType)2, (LabelType)1, default(BoostParams), (Range?)null); } public override void Apply(IGear gear, UpgradeInstance upgrade, ref Random rand) { //IL_001b: 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) if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { behaviour.WeaponData.overheatDamageReduction = damageTakenMultiplier.GetValue(ref rand, upgrade, default(BoostParams)); } } public override void Remove(IGear gear, IGear prefab, UpgradeInstance upgrade, ref Random rand) { if (CyclerHeatBehaviour.TryGet(gear, out var behaviour)) { behaviour.WeaponData.overheatDamageReduction = behaviour.GetPrefabSnapshot().overheatDamageReduction; } } } internal sealed class HeatVentSystem { private readonly CyclerHeatBehaviour host; private float ventRecoveryTimer; private float dissipateDelayBypassUntil = -999f; private bool dumpActive; private float dumpTimer; private float dumpDuration; private float dumpDamageBudget; private float dumpStartAngle; private float dumpEndAngle; private float dumpMaxRange; private LineRenderer dumpLine; private GameObject dumpLineGo; private float fireHitchTimer; public bool IsDumpActive => dumpActive; public bool IsVentRecovering => ventRecoveryTimer > 0f; public bool HasDissipateDelayBypass => Time.time < dissipateDelayBypassUntil; public bool IsFireHitched => fireHitchTimer > 0f; public HeatVentSystem(CyclerHeatBehaviour host) { this.host = host; } public void Reset() { ventRecoveryTimer = 0f; dissipateDelayBypassUntil = -999f; EndDump(); fireHitchTimer = 0f; } public void Tick(float dt, Gun gun) { if (dt <= 0f) { return; } if (ventRecoveryTimer > 0f) { ventRecoveryTimer = Mathf.Max(0f, ventRecoveryTimer - dt); } if (fireHitchTimer > 0f) { fireHitchTimer = Mathf.Max(0f, fireHitchTimer - dt); if (fireHitchTimer <= 0f && (Object)(object)gun != (Object)null) { host.SyncFireLock(gun); } } TickDumpCone(dt, gun); } public bool TryHeatAbility(Gun gun) { if ((Object)(object)gun == (Object)null || !((NetworkBehaviour)gun).IsOwner) { return false; } ref CyclerHeatBehaviour.Data weaponData = ref host.WeaponData; if (weaponData.dumpBeamDps > 0f && !dumpActive && TryCapacitorDump(gun)) { return true; } if (weaponData.energyConvHeatPerStack > 0f && host.EnergyConvStoredStacks > 0 && host.TryConsumeEnergyConvergence(gun)) { return true; } if (weaponData.dischargeRadius > 0f && weaponData.dischargeDamage > 0f && TryElementalDischarge(gun)) { return true; } return TryPressureVent(gun); } public bool TryPressureVent(Gun gun) { ref CyclerHeatBehaviour.Data weaponData = ref host.WeaponData; if (!weaponData.ventEnabled) { return false; } if (ventRecoveryTimer > 0f || dumpActive) { return false; } float num = ((weaponData.ventMinHeat > 0f) ? weaponData.ventMinHeat : 15f); if (host.CurrentHeat < num) { return false; } float maxSpend = ((weaponData.ventSpend > 0f) ? weaponData.ventSpend : 35f); float num2 = host.SpendHeatUpTo(maxSpend); if (num2 <= 0f) { return false; } ventRecoveryTimer = ((weaponData.ventRecovery > 0f) ? weaponData.ventRecovery : 0.45f); float num3 = ((weaponData.ventBypassDissipateDuration > 0f) ? weaponData.ventBypassDissipateDuration : 0.35f); dissipateDelayBypassUntil = Time.time + num3; float num4 = ((weaponData.ventRadius > 0f) ? weaponData.ventRadius : 3.5f); float num5 = ((weaponData.ventDamage > 0f) ? weaponData.ventDamage : 20f); host.ConsumeCatalystForVent(out var damageAdd, out var radiusAdd); num5 += damageAdd; num4 += radiusAdd; SpawnPulse(gun, num4, num5); try { gun.TriggerEffectReload((EffectType)0); } catch { } ManualLogSource logger = SparrohPlugin.Logger; if (logger != null) { logger.LogDebug((object)($"[CyclerRework] Pressure Vent spent={num2:0.#}" + ((damageAdd > 0f) ? $" catalyst=+{damageAdd:0.#}dmg/+{radiusAdd:0.##}r" : ""))); } return true; } public bool TryCapacitorDump(Gun gun) { ref CyclerHeatBehaviour.Data weaponData = ref host.WeaponData; if (weaponData.dumpBeamDps <= 0f || dumpActive) { return false; } if (host.CurrentHeat <= 1f) { return false; } if (ventRecoveryTimer > 0f) { return false; } float currentHeat = host.CurrentHeat; float num = Mathf.Max(1f, weaponData.maxHeat); float num2 = ((weaponData.dumpSecondsPerFullHeat > 0f) ? (weaponData.dumpSecondsPerFullHeat * Mathf.Clamp(currentHeat / num, 0.15f, 2f)) : (1.2f * Mathf.Clamp(currentHeat / num, 0.15f, 2f))); float dumpBeamDps = weaponData.dumpBeamDps; dumpDamageBudget = dumpBeamDps * num2 * Mathf.Clamp(currentHeat / num, 0.25f, 2f); dumpDuration = Mathf.Max(0.35f, num2); dumpTimer = dumpDuration; dumpStartAngle = ((weaponData.dumpConeStartAngle > 0f) ? weaponData.dumpConeStartAngle : 38f); dumpEndAngle = ((weaponData.dumpConeEndAngle > 0f) ? weaponData.dumpConeEndAngle : 7f); dumpMaxRange = ((weaponData.dumpConeRange > 0f) ? weaponData.dumpConeRange : 28f); dumpActive = true; host.SpendHeatUpTo(currentHeat * 0.35f); fireHitchTimer = ((weaponData.dumpFireHitch > 0f) ? weaponData.dumpFireHitch : 0.15f); if (((NetworkBehaviour)gun).IsOwner) { gun.RemainingAmmo = 0f; } try { gun.TriggerEffectBuff((EffectType)0); } catch { } ManualLogSource logger = SparrohPlugin.Logger; if (logger != null) { logger.LogInfo((object)$"[CyclerRework] Capacitor Dump start heat={currentHeat:0.#} dur={dumpDuration:0.##}s"); } return true; } public bool TryElementalDischarge(Gun gun) { //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Invalid comparison between Unknown and I4 //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) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: 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_0120: Invalid comparison between Unknown and I4 //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) ref CyclerHeatBehaviour.Data weaponData = ref host.WeaponData; if (weaponData.dischargeRadius <= 0f) { return false; } if (ventRecoveryTimer > 0f || dumpActive) { return false; } float num = ((weaponData.dischargeHeatCost > 0f) ? weaponData.dischargeHeatCost : 40f); if (host.CurrentHeat < Mathf.Min(num, (weaponData.ventMinHeat > 0f) ? weaponData.ventMinHeat : 15f)) { return false; } if (host.SpendHeatUpTo(num) <= 0f) { return false; } ventRecoveryTimer = Mathf.Max(0.35f, weaponData.dischargeChargeTime); float num2 = ((weaponData.dischargeDamage > 0f) ? weaponData.dischargeDamage : 40f); float num3 = ((weaponData.dischargeRadius > 0f) ? weaponData.dischargeRadius : 5f); EffectType val = (EffectType)(((int)gun.GunData.damageEffect <= 0) ? 1 : ((int)gun.GunData.damageEffect)); try { VanillaCyclerAssets.TryGetMuzzle(gun, out var origin, out var forward); origin += forward * 1.2f; DamageData val2 = default(DamageData); ((DamageData)(ref val2))..ctor(((int)val > 0) ? 0f : num2, val, num2, (DamageFlags)16); GameManager.Instance.SpawnExplosionObserverSeeThrough((IDamageSource)(object)gun, origin, num3, (TargetType)5, val2, ((NetworkBehaviour)gun).OwnerClientId, 0f); try { gun.TriggerEffectBuff((EffectType)0); } catch { } } catch (Exception arg) { ManualLogSource logger = SparrohPlugin.Logger; if (logger != null) { logger.LogWarning((object)$"[CyclerRework] Discharge nova failed: {arg}"); } } return true; } private void TickDumpCone(float dt, Gun gun) { //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_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_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_0279: 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_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_0251: 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) if (!dumpActive) { DestroyDumpVisual(); return; } if ((Object)(object)gun == (Object)null) { EndDump(); return; } ref CyclerHeatBehaviour.Data weaponData = ref host.WeaponData; dumpTimer -= dt; float num = ((dumpDuration > 0.01f) ? (1f - Mathf.Clamp01(dumpTimer / dumpDuration)) : 1f); float num2 = ((weaponData.dumpHeatDrainPerSecond > 0f) ? weaponData.dumpHeatDrainPerSecond : (host.WeaponData.maxHeat / Mathf.Max(0.35f, dumpDuration))); host.SpendHeatUpTo(num2 * dt); float num3 = Mathf.Lerp(dumpStartAngle, dumpEndAngle, num); float num4 = dumpMaxRange; float num5 = ((dumpDuration > 0.01f) ? (dumpDamageBudget * (dt / dumpDuration)) : dumpDamageBudget); try { VanillaCyclerAssets.TryGetMuzzle(gun, out var origin, out var forward); Vector3 val = origin + forward * 0.35f; int num6 = LayerMask.op_Implicit(gun.GunData.targetCollisionMask) | LayerMask.op_Implicit(gun.GunData.surfaceCollisionMask); int num7 = 5; float num8 = num5 / (float)num7; Vector3 end = val + forward * num4; Transform val2 = (((Object)(object)gun.playerLook != (Object)null) ? ((Component)gun.playerLook).transform : ((Component)gun).transform); RaycastHit val5 = default(RaycastHit); DamageData val6 = default(DamageData); for (int i = 0; i < num7; i++) { float num9 = 0f; if (num7 > 1) { num9 = ((float)i / (float)(num7 - 1) * 2f - 1f) * num3 * 0.5f; } Vector3 val3 = Quaternion.AngleAxis(num9, val2.up) * Quaternion.LookRotation(forward, val2.up) * Vector3.forward; Vector3 val4 = val + val3 * num4; if (Physics.Raycast(val, val3, ref val5, num4, num6)) { val4 = ((RaycastHit)(ref val5)).point; } float num10 = Mathf.Lerp(1.4f, 0.55f, num); ((DamageData)(ref val6))..ctor(num8, gun.GunData.damageEffect, num8 * 0.25f, (DamageFlags)16); GameManager.Instance.SpawnExplosionObserverSeeThrough((IDamageSource)(object)gun, val4, num10, (TargetType)5, val6, ((NetworkBehaviour)gun).OwnerClientId, 0f); if (i == num7 / 2) { end = val4; } } float width = Mathf.Lerp(0.06f, 0.02f, num); UpdateDumpLine(val, end, width); } catch { } if (dumpTimer <= 0f || host.CurrentHeat <= 0.25f) { EndDump(); } } private void SpawnPulse(Gun gun, float radius, float damage) { //IL_0045: 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_002a: 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) if ((Object)(object)gun == (Object)null) { return; } try { VanillaCyclerAssets.TryGetMuzzle(gun, out var origin, out var _); try { if ((Object)(object)gun.Player != (Object)null) { origin = gun.Player.InterpolatedPosition; } } catch { } DamageData val = default(DamageData); ((DamageData)(ref val))..ctor(damage, (DamageFlags)16); GameManager.Instance.SpawnExplosionObserverSeeThrough((IDamageSource)(object)gun, origin, radius, (TargetType)5, val, ((NetworkBehaviour)gun).OwnerClientId, 0f); } catch (Exception ex) { ManualLogSource logger = SparrohPlugin.Logger; if (logger != null) { logger.LogDebug((object)("[CyclerRework] Vent pulse failed: " + ex.Message)); } } } private void UpdateDumpLine(Vector3 start, Vector3 end, float width) { //IL_0196: 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_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Expected O, but got Unknown //IL_0107: 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_015b: 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) if ((Object)(object)dumpLine == (Object)null) { dumpLineGo = new GameObject("HeatCycler_DumpLine"); ((Object)dumpLineGo).hideFlags = (HideFlags)61; dumpLine = dumpLineGo.AddComponent(); dumpLine.positionCount = 2; dumpLine.useWorldSpace = true; ((Renderer)dumpLine).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)dumpLine).receiveShadows = false; dumpLine.numCapVertices = 2; dumpLine.textureMode = (LineTextureMode)0; Material val = new Material(Shader.Find("Universal Render Pipeline/Unlit") ?? Shader.Find("Unlit/Color") ?? Shader.Find("Sprites/Default") ?? Shader.Find("Standard")); if (val.HasProperty("_BaseColor")) { val.SetColor("_BaseColor", new Color(1f, 0.45f, 0.1f, 0.55f)); } val.color = new Color(1f, 0.45f, 0.1f, 0.55f); ((Renderer)dumpLine).sharedMaterial = val; dumpLine.startColor = new Color(1f, 0.55f, 0.15f, 0.7f); dumpLine.endColor = new Color(1f, 0.25f, 0.05f, 0.35f); } ((Renderer)dumpLine).enabled = true; dumpLine.startWidth = width; dumpLine.endWidth = width * 0.45f; dumpLine.SetPosition(0, start); dumpLine.SetPosition(1, end); } private void EndDump() { dumpActive = false; dumpTimer = 0f; dumpDuration = 0f; dumpDamageBudget = 0f; DestroyDumpVisual(); } private void DestroyDumpVisual() { if ((Object)(object)dumpLineGo != (Object)null) { Object.Destroy((Object)(object)dumpLineGo); dumpLineGo = null; dumpLine = null; } } public void Destroy() { EndDump(); } } public enum HeatZone { Cold, Warm, Hot, Redline, Overcap } internal static class IconLoader { private static readonly Dictionary Cache = new Dictionary(StringComparer.OrdinalIgnoreCase); private static string _iconsDir; private static bool _dirResolved; public static Sprite Get(string fileName) { //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Expected O, but got Unknown //IL_00da: 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) if (string.IsNullOrEmpty(fileName)) { return null; } if (Cache.TryGetValue(fileName, out var value)) { return value; } string text = ResolvePath(fileName); if (text == null || !File.Exists(text)) { ManualLogSource logger = SparrohPlugin.Logger; if (logger != null) { logger.LogDebug((object)("[IconLoader] Missing icon: " + fileName)); } Cache[fileName] = null; return null; } try { byte[] array = File.ReadAllBytes(text); Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false); if (!ImageConversion.LoadImage(val, array, true)) { Object.Destroy((Object)(object)val); ManualLogSource logger2 = SparrohPlugin.Logger; if (logger2 != null) { logger2.LogWarning((object)("[IconLoader] LoadImage failed: " + fileName)); } Cache[fileName] = null; return null; } ((Object)val).name = Path.GetFileNameWithoutExtension(fileName); ((Texture)val).filterMode = (FilterMode)1; ((Texture)val).wrapMode = (TextureWrapMode)1; Sprite val2 = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f), 100f); ((Object)val2).name = ((Object)val).name; Cache[fileName] = val2; return val2; } catch (Exception ex) { ManualLogSource logger3 = SparrohPlugin.Logger; if (logger3 != null) { logger3.LogWarning((object)("[IconLoader] Failed '" + fileName + "': " + ex.Message)); } Cache[fileName] = null; return null; } } private static string ResolvePath(string fileName) { string iconsDirectory = GetIconsDirectory(); if (string.IsNullOrEmpty(iconsDirectory)) { return null; } string text = Path.Combine(iconsDirectory, fileName); if (File.Exists(text)) { return text; } try { string[] files = Directory.GetFiles(iconsDirectory, "*.png"); foreach (string text2 in files) { if (string.Equals(Path.GetFileName(text2), fileName, StringComparison.OrdinalIgnoreCase)) { return text2; } } } catch { } return null; } private static string GetIconsDirectory() { if (_dirResolved) { return _iconsDir; } _dirResolved = true; try { string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); if (!string.IsNullOrEmpty(directoryName)) { string text = Path.Combine(directoryName, "ICONS"); if (Directory.Exists(text)) { _iconsDir = text; return _iconsDir; } string fullPath = Path.GetFullPath(Path.Combine(directoryName, "..", "..", "ICONS")); if (Directory.Exists(fullPath)) { _iconsDir = fullPath; return _iconsDir; } } } catch (Exception ex) { ManualLogSource logger = SparrohPlugin.Logger; if (logger != null) { logger.LogDebug((object)("[IconLoader] Dir resolve failed: " + ex.Message)); } } _iconsDir = null; return null; } } [BepInPlugin("sparroh.cyclerrework", "CyclerRework", "1.0.0")] [MycoMod(/*Could not decode attribute arguments.*/)] public class SparrohPlugin : BaseUnityPlugin { public const string PluginGUID = "sparroh.cyclerrework"; public const string PluginName = "CyclerRework"; public const string PluginVersion = "1.0.0"; public const int GearId = 92010; public const string GearApiName = "sparroh_cycler"; public const string GearDisplayName = "Heat Cycler"; public const string GearDescription = "A reworked Cycler SMG. Infinite ammo — builds Heat while firing. Ride Soft Redline at max Heat (keep firing, wilder and meaner). Tap R to Pressure Vent."; public const string BaseTypeName = "CartridgeSMG"; internal static ManualLogSource Logger; internal static SparrohPlugin Instance; internal static ConfigEntry MaxHeat; internal static ConfigEntry HeatPerShot; internal static ConfigEntry DissipatePerSecond; internal static ConfigEntry DissipateDelay; internal static ConfigEntry OverheatCooldown; internal static ConfigEntry WarmThreshold; internal static ConfigEntry HotThreshold; internal static ConfigEntry HotDamageMult; internal static ConfigEntry RedlineFireIntervalMult; internal static ConfigEntry RedlineSpreadMult; internal static ConfigEntry RedlineDamageMult; internal static ConfigEntry VentSpend; internal static ConfigEntry VentMinHeat; internal static ConfigEntry VentRecovery; public static IUpgradable CustomWeaponPrefab; private Harmony _harmony; private bool _gearRegistered; private void Awake() { //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Expected O, but got Unknown Instance = this; Logger = ((BaseUnityPlugin)this).Logger; MaxHeat = ((BaseUnityPlugin)this).Config.Bind("Heat", "MaxHeat", 100f, "Heat ceiling for Soft Redline (Infinity Burn may overcap past this)."); HeatPerShot = ((BaseUnityPlugin)this).Config.Bind("Heat", "HeatPerShot", 2.4f, "Heat added per shot. ~3.5s continuous fire to redline at vanilla-ish RoF."); DissipatePerSecond = ((BaseUnityPlugin)this).Config.Bind("Heat", "DissipatePerSecond", 65f, "Heat removed per second while not firing (after DissipateDelay)."); DissipateDelay = ((BaseUnityPlugin)this).Config.Bind("Heat", "DissipateDelay", 0.15f, "Seconds after the last shot before heat begins dissipating."); OverheatCooldown = ((BaseUnityPlugin)this).Config.Bind("Heat", "OverheatCooldown", 0f, "LEGACY — unused. Soft Redline hard-cut: no fire lockout on base gun."); WarmThreshold = ((BaseUnityPlugin)this).Config.Bind("Zones", "WarmThreshold", 0.4f, "Normalized heat where Warm band begins (VFX only on base kit)."); HotThreshold = ((BaseUnityPlugin)this).Config.Bind("Zones", "HotThreshold", 0.7f, "Normalized heat where Hot band carrots apply."); HotDamageMult = ((BaseUnityPlugin)this).Config.Bind("Zones", "HotDamageMult", 1.08f, "Outgoing damage multiplier while in Hot band."); RedlineFireIntervalMult = ((BaseUnityPlugin)this).Config.Bind("Zones", "RedlineFireIntervalMult", 1.18f, "Fire interval multiplier at Soft Redline (>1 = slower RoF brake)."); RedlineSpreadMult = ((BaseUnityPlugin)this).Config.Bind("Zones", "RedlineSpreadMult", 1.25f, "Spread multiplier at Soft Redline."); RedlineDamageMult = ((BaseUnityPlugin)this).Config.Bind("Zones", "RedlineDamageMult", 1.12f, "Outgoing damage multiplier at Soft Redline."); VentSpend = ((BaseUnityPlugin)this).Config.Bind("Vent", "VentSpend", 35f, "Heat spent by baseline Pressure Vent (tap R)."); VentMinHeat = ((BaseUnityPlugin)this).Config.Bind("Vent", "VentMinHeat", 15f, "Minimum heat required to Pressure Vent."); VentRecovery = ((BaseUnityPlugin)this).Config.Bind("Vent", "VentRecovery", 0.45f, "Seconds before R can vent again."); _harmony = new Harmony("sparroh.cyclerrework"); _harmony.PatchAll(typeof(GlobalLoadHook)); _harmony.PatchAll(typeof(PlayerDataPersistenceHooks)); _harmony.PatchAll(typeof(CyclerHeatHooks)); _harmony.PatchAll(typeof(GearSelectionWindowHooks)); SpawnGearHooks.Apply(_harmony); PlayerData.AddRegisterUpgradesCallback((Action)RegisterUpgrades); TryRegisterGear("Awake"); if (PlayerData.Instance != null) { RegisterUpgrades(); } Logger.LogInfo((object)"CyclerRework v1.0.0 loaded."); } private void OnDestroy() { Harmony harmony = _harmony; if (harmony != null) { harmony.UnpatchSelf(); } _harmony = null; Instance = null; } internal void TryRegisterGear(string reason) { if (_gearRegistered) { return; } if ((Object)(object)Global.Instance == (Object)null || Global.Instance.AllGear == null || Global.Instance.AllGear.Length == 0) { Logger.LogDebug((object)("[CyclerRework] Global.AllGear not ready yet (" + reason + ").")); return; } try { if (WeaponRegistration.TryCreateAndRegister("sparroh.cyclerrework", 92010, "sparroh_cycler", "Heat Cycler", "A reworked Cycler SMG. Infinite ammo — builds Heat while firing. Ride Soft Redline at max Heat (keep firing, wilder and meaner). Tap R to Pressure Vent.", "CartridgeSMG", autoUnlock: true, Logger, out CustomWeaponPrefab)) { _gearRegistered = true; Logger.LogInfo((object)("[CyclerRework] Registered gear 'Heat Cycler' " + string.Format("(api={0}, id={1}) via {2}.", "sparroh_cycler", 92010, reason))); if (PlayerData.Instance != null) { RegisterUpgrades(); } } } catch (Exception arg) { Logger.LogError((object)$"[CyclerRework] Gear registration failed: {arg}"); } } internal void RegisterUpgrades() { try { HeatCyclerUpgrades.RegisterAll(Logger); } catch (Exception arg) { Logger.LogError((object)$"[CyclerRework] Upgrade registration failed: {arg}"); } } internal static IUpgradable ResolveRegisteredGear() { if (CustomWeaponPrefab != null) { return CustomWeaponPrefab; } if (WeaponRegistration.CatalogGear != null) { return WeaponRegistration.CatalogGear; } return WeaponRegistration.FindGearSafe("sparroh_cycler", 92010); } } [HarmonyPatch(typeof(Global), "LoadInstance")] internal static class GlobalLoadHook { [HarmonyPostfix] private static void Postfix() { SparrohPlugin.Instance?.TryRegisterGear("Global.LoadInstance"); } } [HarmonyPatch(typeof(PlayerData), "OnAwake")] internal static class PlayerDataPersistenceHooks { [HarmonyPrefix] private static void Prefix() { SparrohPlugin.Instance?.TryRegisterGear("PlayerData.OnAwake.Prefix"); } [HarmonyPostfix] private static void Postfix() { try { SparrohPlugin.Instance?.TryRegisterGear("PlayerData.OnAwake.Postfix"); SparrohPlugin.Instance?.RegisterUpgrades(); IUpgradable val = SparrohPlugin.ResolveRegisteredGear(); if (val == null) { ManualLogSource logger = SparrohPlugin.Logger; if (logger != null) { logger.LogWarning((object)"[CyclerRework] Persistence: gear missing after OnAwake."); } return; } GearData gearData = PlayerData.GetGearData(val); if (gearData == null) { WeaponRegistration.EnsureGearData(val, autoUnlock: true, SparrohPlugin.Logger); gearData = PlayerData.GetGearData(val); } else { gearData.Gear = val; } if (gearData != null) { if (!gearData.IsUnlocked) { gearData.Unlock(); } ManualLogSource logger2 = SparrohPlugin.Logger; if (logger2 != null) { logger2.LogInfo((object)($"[CyclerRework] Persistence OK: level={gearData.Level} unlocked={gearData.IsUnlocked} " + $"equipped={gearData.EquippedUpgradeCount} xp={gearData.LevelXP}")); } } } catch (Exception arg) { ManualLogSource logger3 = SparrohPlugin.Logger; if (logger3 != null) { logger3.LogError((object)$"[CyclerRework] Persistence postfix failed: {arg}"); } } } } internal static class SpawnGearHooks { [ThreadStatic] private static bool RemappingCustomSpawn; [ThreadStatic] private static int RemappedSlot; public static void Apply(Harmony harmony) { //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Expected O, but got Unknown //IL_015d: Expected O, but got Unknown Type? typeFromHandle = typeof(Player); int num = 0; foreach (MethodInfo declaredMethod in AccessTools.GetDeclaredMethods(typeFromHandle)) { if (declaredMethod.Name != "SpawnGear_Server") { continue; } ParameterInfo[] parameters = declaredMethod.GetParameters(); StringBuilder stringBuilder = new StringBuilder(); for (int i = 0; i < parameters.Length; i++) { if (i > 0) { stringBuilder.Append(", "); } stringBuilder.Append(parameters[i].ParameterType.Name).Append(' ').Append(parameters[i].Name); } ManualLogSource logger = SparrohPlugin.Logger; if (logger != null) { logger.LogInfo((object)$"[CyclerRework] Found {declaredMethod.Name}({stringBuilder})"); } if (parameters.Length < 2 || parameters[0].ParameterType != typeof(int) || parameters[1].ParameterType != typeof(int)) { ManualLogSource logger2 = SparrohPlugin.Logger; if (logger2 != null) { logger2.LogWarning((object)("[CyclerRework] Skip " + declaredMethod.Name + " — unexpected first params.")); } continue; } try { harmony.Patch((MethodBase)declaredMethod, new HarmonyMethod(typeof(SpawnGearHooks), "SpawnGearServerPrefix_Args", (Type[])null) { priority = 800 }, new HarmonyMethod(typeof(SpawnGearHooks), "SpawnGearServerPostfix", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); num++; ManualLogSource logger3 = SparrohPlugin.Logger; if (logger3 != null) { logger3.LogInfo((object)$"[CyclerRework] Patched {declaredMethod.Name} ({parameters.Length} params) via __args remap."); } } catch (Exception arg) { ManualLogSource logger4 = SparrohPlugin.Logger; if (logger4 != null) { logger4.LogError((object)$"[CyclerRework] Failed to patch {declaredMethod.Name}: {arg}"); } } } if (num == 0) { ManualLogSource logger5 = SparrohPlugin.Logger; if (logger5 != null) { logger5.LogError((object)"[CyclerRework] No SpawnGear_Server methods patched."); } } } private static void SpawnGearServerPrefix_Args(object[] __args) { RemappingCustomSpawn = false; if (__args == null || __args.Length < 2 || !(__args[0] is int num) || !(__args[1] is int allGearIndex)) { return; } int num2 = allGearIndex; if (TryRemap(num, ref allGearIndex)) { __args[1] = allGearIndex; ManualLogSource logger = SparrohPlugin.Logger; if (logger != null) { logger.LogInfo((object)$"[CyclerRework] __args remap slot={num} {num2}→{allGearIndex}"); } } } private static bool TryRemap(int slot, ref int allGearIndex) { RemappingCustomSpawn = false; if (Global.Instance?.AllGear == null) { ManualLogSource logger = SparrohPlugin.Logger; if (logger != null) { logger.LogWarning((object)"[CyclerRework] TryRemap: AllGear null."); } return false; } if (allGearIndex < 0 || allGearIndex >= Global.Instance.AllGear.Length) { ManualLogSource logger2 = SparrohPlugin.Logger; if (logger2 != null) { logger2.LogWarning((object)$"[CyclerRework] TryRemap: index {allGearIndex} out of range (len={Global.Instance.AllGear.Length})."); } return false; } IUpgradable val = Global.Instance.AllGear[allGearIndex]; bool flag = IsOurCatalogGear(val) || IsOurCatalogIndex(allGearIndex); ManualLogSource logger3 = SparrohPlugin.Logger; if (logger3 != null) { string text = $"[CyclerRework] TryRemap slot={slot} idx={allGearIndex} "; object obj; if (val == null) { obj = null; } else { GearInfo info = val.Info; obj = ((info != null) ? info.APIName : null); } if (obj == null) { obj = "null"; } int? obj2; if (val == null) { obj2 = null; } else { GearInfo info2 = val.Info; obj2 = ((info2 != null) ? new int?(info2.ID) : ((int?)null)); } logger3.LogDebug((object)(text + $"api={obj} id={obj2 ?? (-1)} ours={flag}")); } if (!flag) { return false; } int num = ResolveBaseIndex(); if (num < 0) { ManualLogSource logger4 = SparrohPlugin.Logger; if (logger4 != null) { logger4.LogError((object)"[CyclerRework] Cannot resolve base gun index — scanning AllGear for any primary Gun."); } for (int i = 0; i < Global.Instance.AllGear.Length; i++) { if (Global.Instance.AllGear[i] is Gun && !IsOurCatalogGear(Global.Instance.AllGear[i])) { num = i; break; } } } if (num < 0 || num == allGearIndex) { ManualLogSource logger5 = SparrohPlugin.Logger; if (logger5 != null) { logger5.LogError((object)$"[CyclerRework] Remap failed (baseIndex={num}). Catalog spawn will NRE."); } return false; } ManualLogSource logger6 = SparrohPlugin.Logger; if (logger6 != null) { string text2 = $"[CyclerRework] Remap SpawnGear slot={slot} index {allGearIndex} → base {num} "; object obj3; if (val == null) { obj3 = null; } else { GearInfo info3 = val.Info; obj3 = ((info3 != null) ? info3.APIName : null); } logger6.LogInfo((object)(text2 + "(api=" + (string?)obj3 + ").")); } allGearIndex = num; RemappingCustomSpawn = true; RemappedSlot = slot; return true; } internal static int ResolveBaseIndex() { //IL_0103: 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) if (Global.Instance?.AllGear == null) { return -1; } int baseAllGearIndex = WeaponRegistration.BaseAllGearIndex; if (baseAllGearIndex >= 0 && baseAllGearIndex < Global.Instance.AllGear.Length) { IUpgradable val = Global.Instance.AllGear[baseAllGearIndex]; if (val is Gun && !IsOurCatalogGear(val)) { return baseAllGearIndex; } } if ((Object)(object)WeaponRegistration.BaseGunPrefab != (Object)null) { int num = Array.IndexOf(Global.Instance.AllGear, (IUpgradable)(object)WeaponRegistration.BaseGunPrefab); if (num >= 0) { WeaponRegistration.SetBaseAllGearIndex(num); return num; } } if ((Object)(object)WeaponRegistration.BaseNetworkPrefab != (Object)null) { for (int i = 0; i < Global.Instance.AllGear.Length; i++) { IUpgradable obj = Global.Instance.AllGear[i]; Component val2 = (Component)(object)((obj is Component) ? obj : null); if (val2 != null && (Object)(object)val2.gameObject == (Object)(object)WeaponRegistration.BaseNetworkPrefab && !IsOurCatalogGear(Global.Instance.AllGear[i])) { WeaponRegistration.SetBaseAllGearIndex(i); return i; } } } for (int j = 0; j < Global.Instance.AllGear.Length; j++) { IUpgradable obj2 = Global.Instance.AllGear[j]; Gun val3 = (Gun)(object)((obj2 is Gun) ? obj2 : null); if (val3 != null && (int)val3.GearType == 0 && string.Equals(((object)val3).GetType().Name, "CartridgeSMG", StringComparison.Ordinal) && !IsOurCatalogGear(Global.Instance.AllGear[j])) { WeaponRegistration.SetBaseAllGearIndex(j); return j; } } for (int k = 0; k < Global.Instance.AllGear.Length; k++) { IUpgradable obj3 = Global.Instance.AllGear[k]; Gun val4 = (Gun)(object)((obj3 is Gun) ? obj3 : null); if (val4 != null && (int)val4.GearType == 0 && !IsOurCatalogGear(Global.Instance.AllGear[k])) { WeaponRegistration.SetBaseAllGearIndex(k); return k; } } return -1; } private static void SpawnGearServerPostfix(Player __instance) { if (!RemappingCustomSpawn) { return; } RemappingCustomSpawn = false; int remappedSlot = RemappedSlot; try { StampCustomIdentityOnSlot(__instance, remappedSlot); } catch (Exception arg) { ManualLogSource logger = SparrohPlugin.Logger; if (logger != null) { logger.LogError((object)$"[CyclerRework] Post-spawn stamp failed: {arg}"); } } } private static void StampCustomIdentityOnSlot(Player player, int slot) { if (((player != null) ? player.Gear : null) == null || slot < 0 || slot >= player.Gear.Length) { return; } IGear val = player.Gear[slot]; if (val == null) { ManualLogSource logger = SparrohPlugin.Logger; if (logger != null) { logger.LogWarning((object)$"[CyclerRework] Post-spawn Gear[{slot}] is null — base spawn may have failed."); } return; } IUpgradable val2 = SparrohPlugin.ResolveRegisteredGear(); if (val2 == null) { ManualLogSource logger2 = SparrohPlugin.Logger; if (logger2 != null) { logger2.LogWarning((object)"[CyclerRework] Catalog gear missing during stamp."); } } else { RebindLiveGear(val, val2, slot); } } internal static void RebindLiveGear(IGear live, IUpgradable catalog, int slot = -1) { if (live == null || catalog == null) { return; } ((IUpgradable)live).Prefab = catalog; if ((Object)(object)catalog.Info != (Object)null) { TryAssignInfo(live, catalog.Info); } if ((Object)(object)live.gameObject != (Object)null) { CyclerHeatBehaviour cyclerHeatBehaviour = live.gameObject.GetComponent(); if ((Object)(object)cyclerHeatBehaviour == (Object)null) { cyclerHeatBehaviour = live.gameObject.AddComponent(); } CyclerHeatBehaviour cyclerHeatBehaviour2 = null; Component val = (Component)(object)((catalog is Component) ? catalog : null); if (val != null) { cyclerHeatBehaviour2 = val.GetComponent(); } cyclerHeatBehaviour.InitializeAsPrefab(((Object)(object)cyclerHeatBehaviour2 != (Object)null) ? cyclerHeatBehaviour2.Description : "A reworked Cycler SMG. Infinite ammo — builds Heat while firing. Ride Soft Redline at max Heat (keep firing, wilder and meaner). Tap R to Pressure Vent."); if ((Object)(object)cyclerHeatBehaviour2 != (Object)null) { cyclerHeatBehaviour.CopySnapshotFrom(cyclerHeatBehaviour2); } } try { live.ApplyUpgrades(); } catch (Exception arg) { ManualLogSource logger = SparrohPlugin.Logger; if (logger != null) { logger.LogError((object)$"[CyclerRework] ApplyUpgrades after rebind failed (slot={slot}): {arg}"); } } Gun val2 = (Gun)(object)((live is Gun) ? live : null); if (val2 != null && CyclerHeatBehaviour.TryGet(live, out var behaviour)) { CyclerHeatBehaviour.ApplyInfiniteAmmo(val2); behaviour.ResetHeatState(); behaviour.SyncFireLock(val2); } ManualLogSource logger2 = SparrohPlugin.Logger; if (logger2 != null) { string[] obj = new string[6] { string.Format("[CyclerRework] Rebound Gear[{0}] → {1} ", slot, "sparroh_cycler"), "(Info=", null, null, null, null }; GearInfo info = ((IUpgradable)live).Info; obj[2] = ((info != null) ? info.APIName : null); obj[3] = ", Prefab="; IUpgradable prefab = ((IUpgradable)live).Prefab; IUpgradable obj2 = ((prefab is Component) ? prefab : null); obj[4] = ((obj2 != null) ? ((Object)obj2).name : null); obj[5] = ")."; logger2.LogInfo((object)string.Concat(obj)); } } internal static bool IsOurCatalogGear(IUpgradable gear) { return CyclerHeatBehaviour.IsOurGear(gear); } internal static bool IsOurCatalogIndex(int index) { if (Global.Instance?.AllGear == null || index < 0 || index >= Global.Instance.AllGear.Length) { return false; } IUpgradable val = Global.Instance.AllGear[index]; if (IsOurCatalogGear(val)) { return true; } IUpgradable val2 = SparrohPlugin.ResolveRegisteredGear(); if (val2 != null && val == val2) { return true; } int num = IndexOfCatalogInAllGear(); if (num >= 0) { return num == index; } return false; } internal static int IndexOfCatalogInAllGear() { IUpgradable val = SparrohPlugin.ResolveRegisteredGear(); if (val == null || Global.Instance?.AllGear == null) { return -1; } int num = Array.IndexOf(Global.Instance.AllGear, val); if (num >= 0) { return num; } for (int i = 0; i < Global.Instance.AllGear.Length; i++) { if (IsOurCatalogGear(Global.Instance.AllGear[i])) { return i; } } return -1; } private static void TryAssignInfo(IGear live, GearInfo info) { Type type = ((object)live).GetType(); while (type != null) { FieldInfo fieldInfo = type.GetField("k__BackingField", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) ?? type.GetField("Info", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (fieldInfo != null) { fieldInfo.SetValue(live, info); break; } PropertyInfo property = type.GetProperty("Info", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (property != null && property.CanWrite) { property.SetValue(live, info); break; } type = type.BaseType; } } } [HarmonyPatch(typeof(GearSelectionWindow))] internal static class GearSelectionWindowHooks { [HarmonyPatch("OnOpen")] [HarmonyFinalizer] private static Exception OnOpenFinalizer(Exception __exception) { if (__exception is NullReferenceException ex) { ManualLogSource logger = SparrohPlugin.Logger; if (logger != null) { logger.LogError((object)("[CyclerRework] GearSelectionWindow.OnOpen NRE swallowed.\n" + ex)); } return null; } return __exception; } [HarmonyPatch("OnCloseCallback")] [HarmonyPrefix] private static bool OnCloseCallbackPrefix(GearSelectionWindow __instance) { try { PreEquipCustomSlots(__instance); } catch (Exception arg) { ManualLogSource logger = SparrohPlugin.Logger; if (logger != null) { logger.LogError((object)$"[CyclerRework] OnCloseCallback prefix failed: {arg}"); } } return true; } [HarmonyPatch("OnCloseCallback")] [HarmonyFinalizer] private static Exception OnCloseFinalizer(Exception __exception) { if (__exception is NullReferenceException ex) { ManualLogSource logger = SparrohPlugin.Logger; if (logger != null) { logger.LogError((object)("[CyclerRework] GearSelectionWindow.OnCloseCallback NRE swallowed.\n" + ex)); } return null; } return __exception; } private static void PreEquipCustomSlots(GearSelectionWindow window) { //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Invalid comparison between Unknown and I4 //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) GearSlot[] value = Traverse.Create((object)window).Field("gearEquipSlots").GetValue(); if (value == null) { ManualLogSource logger = SparrohPlugin.Logger; if (logger != null) { logger.LogWarning((object)"[CyclerRework] OnClose: gearEquipSlots null."); } return; } bool flag = false; try { flag = Traverse.Create(typeof(GearSelectionWindow)).Field("DisableGearSwitching").GetValue(); } catch { } if (flag) { return; } Player localPlayer = Player.LocalPlayer; if (((localPlayer != null) ? localPlayer.Gear : null) == null || Global.Instance?.AllGear == null) { return; } int num = SpawnGearHooks.IndexOfCatalogInAllGear(); int num2 = SpawnGearHooks.ResolveBaseIndex(); ManualLogSource logger2 = SparrohPlugin.Logger; if (logger2 != null) { logger2.LogInfo((object)($"[CyclerRework] OnClose pre-equip: catalogIndex={num} baseIndex={num2} " + $"AllGear.len={Global.Instance.AllGear.Length}")); } for (int i = 0; i < value.Length; i++) { GearSlot val = value[i]; if ((Object)(object)val == (Object)null) { continue; } IUpgradable val2 = null; GearType val3 = (GearType)0; try { val2 = val.Gear; val3 = val.GearType; } catch { Traverse val4 = Traverse.Create((object)val); val2 = val4.Property("Gear", (object[])null).GetValue() ?? val4.Field("gear").GetValue(); try { val3 = val4.Property("GearType", (object[])null).GetValue(); } catch { } } if ((int)val3 == 6 || i == 2 || i >= localPlayer.Gear.Length || val2 == null || !SpawnGearHooks.IsOurCatalogGear(val2)) { continue; } IGear val5 = localPlayer.Gear[i]; if (val5 != null && ((IUpgradable)val5).Prefab == val2 && (Object)(object)((IUpgradable)val5).Info != (Object)null && ((IUpgradable)val5).Info.APIName == "sparroh_cycler") { ManualLogSource logger3 = SparrohPlugin.Logger; if (logger3 != null) { logger3.LogDebug((object)$"[CyclerRework] OnClose slot {i}: already our gear, skip spawn."); } continue; } if (num2 < 0) { ManualLogSource logger4 = SparrohPlugin.Logger; if (logger4 != null) { logger4.LogError((object)$"[CyclerRework] OnClose slot {i}: no baseIndex — cannot equip safely."); } continue; } bool flag2 = i == 0; ManualLogSource logger5 = SparrohPlugin.Logger; if (logger5 != null) { logger5.LogInfo((object)$"[CyclerRework] OnClose slot {i}: SpawnGear_ServerRpc baseIndex={num2} equip={flag2}"); } try { localPlayer.SpawnGear_ServerRpc(i, num2, flag2, true); } catch (Exception arg) { ManualLogSource logger6 = SparrohPlugin.Logger; if (logger6 != null) { logger6.LogError((object)$"[CyclerRework] SpawnGear_ServerRpc: {arg}"); } continue; } IGear val6 = localPlayer.Gear[i]; IUpgradable val7 = SparrohPlugin.ResolveRegisteredGear(); if (val6 == null) { ManualLogSource logger7 = SparrohPlugin.Logger; if (logger7 != null) { logger7.LogWarning((object)$"[CyclerRework] OnClose slot {i}: Gear still null after spawn."); } } else if (val7 != null) { SpawnGearHooks.RebindLiveGear(val6, val7, i); ((IUpgradable)val6).Prefab = val7; } } } } public static class UpgradePatterns { public static HexMap ElementApplicator() { //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_0011: Expected O, but got Unknown //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown //IL_0027: Expected O, but got Unknown HexMap val = new HexMap(2, 2); Set(val, 0, 0, enabled: true, 4); Set(val, 1, 0, enabled: true, 16); Set(val, 0, 1, enabled: true, 1); return val; } public static HexMap FocusedLenses() { //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_0011: Expected O, but got Unknown //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0026: 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 //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown //IL_003b: Expected O, but got Unknown HexMap val = new HexMap(2, 3); Set(val, 0, 0, enabled: true, 0); Set(val, 0, 1, enabled: true, 1); Set(val, 1, 1, enabled: false, 32); Set(val, 0, 2, enabled: true, 1); Set(val, 1, 2, enabled: false, 1); return val; } public static HexMap PrecisionFire() { //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_0011: Expected O, but got Unknown //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_0026: Expected O, but got Unknown HexMap val = new HexMap(2, 2); Set(val, 0, 0, enabled: true, 4); Set(val, 1, 0, enabled: true, 8); Set(val, 1, 1, enabled: true, 0); return val; } public static HexMap Ricochet() { //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_0011: Expected O, but got Unknown //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0026: 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 //IL_0031: Expected O, but got Unknown HexMap val = new HexMap(2, 2); Set(val, 0, 0, enabled: true, 8); Set(val, 1, 0, enabled: true, 32); Set(val, 0, 1, enabled: true, 4); Set(val, 1, 1, enabled: true, 1); return val; } public static HexMap OverclockedFiring() { //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_0011: Expected O, but got Unknown //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected O, but got Unknown //IL_0046: Expected O, but got Unknown HexMap val = new HexMap(3, 3); Set(val, 1, 0, enabled: true, 4); Set(val, 0, 1, enabled: true, 2); Set(val, 2, 1, enabled: true, 0); Set(val, 0, 2, enabled: true, 1); Set(val, 1, 2, enabled: true, 32); Set(val, 2, 2, enabled: false, 16); return val; } public static HexMap ExtralightFrame() { //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_0011: Expected O, but got Unknown //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown //IL_003a: Expected O, but got Unknown HexMap val = new HexMap(4, 3); Set(val, 0, 0, enabled: true, 4); Set(val, 1, 0, enabled: true, 8); Set(val, 1, 1, enabled: true, 4); Set(val, 2, 2, enabled: true, 4); Set(val, 3, 2, enabled: true, 0); return val; } public static HexMap DoubleShot() { //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_0011: Expected O, but got Unknown //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0026: 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 //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown //IL_0045: Expected O, but got Unknown HexMap val = new HexMap(3, 2); Set(val, 0, 0, enabled: true, 8); Set(val, 1, 0, enabled: false, 16); Set(val, 2, 0, enabled: true, 0); Set(val, 0, 1, enabled: true, 4); Set(val, 1, 1, enabled: true, 2); Set(val, 2, 1, enabled: true, 1); return val; } public static HexMap Cyclotron() { //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_0012: Expected O, but got Unknown //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0026: 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 //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected O, but got Unknown //IL_0046: Expected O, but got Unknown HexMap val = new HexMap(3, 3); Set(val, 1, 0, enabled: true, 20); Set(val, 0, 1, enabled: true, 0); Set(val, 2, 1, enabled: true, 0); Set(val, 0, 2, enabled: true, 5); Set(val, 1, 2, enabled: true, 0); Set(val, 2, 2, enabled: true, 17); return val; } public static HexMap ScorchingDetonation() { //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_0012: Expected O, but got Unknown //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected O, but got Unknown //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0050: 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_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Expected O, but got Unknown //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Expected O, but got Unknown //IL_006f: Expected O, but got Unknown HexMap val = new HexMap(4, 4); Set(val, 1, 0, enabled: false, 16); Set(val, 2, 0, enabled: true, 0); Set(val, 3, 0, enabled: true, 0); Set(val, 1, 1, enabled: false, 10); Set(val, 2, 1, enabled: true, 3); Set(val, 3, 1, enabled: true, 16); Set(val, 1, 2, enabled: true, 4); Set(val, 2, 2, enabled: true, 1); Set(val, 1, 3, enabled: false, 8); Set(val, 2, 3, enabled: true, 1); return val; } public static HexMap CyclingRepairs() { //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_0011: Expected O, but got Unknown //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected O, but got Unknown //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Expected O, but got Unknown //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Expected O, but got Unknown //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Expected O, but got Unknown //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Expected O, but got Unknown //IL_006f: Expected O, but got Unknown HexMap val = new HexMap(3, 4); Set(val, 0, 0, enabled: false, 4); Set(val, 1, 0, enabled: true, 4); Set(val, 2, 0, enabled: false, 8); Set(val, 0, 1, enabled: true, 2); Set(val, 2, 1, enabled: true, 8); Set(val, 0, 2, enabled: false, 2); Set(val, 1, 2, enabled: true, 16); Set(val, 2, 2, enabled: true, 16); Set(val, 0, 3, enabled: true, 0); Set(val, 2, 3, enabled: false, 16); return val; } public static HexMap MomentumOverload() { //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_0011: Expected O, but got Unknown //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Expected O, but got Unknown //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Expected O, but got Unknown //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Expected O, but got Unknown //IL_0064: Expected O, but got Unknown HexMap val = new HexMap(4, 4); Set(val, 0, 0, enabled: false, 4); Set(val, 1, 0, enabled: true, 8); Set(val, 1, 1, enabled: true, 8); Set(val, 2, 1, enabled: false, 2); Set(val, 1, 2, enabled: true, 16); Set(val, 2, 2, enabled: false, 10); Set(val, 0, 3, enabled: true, 0); Set(val, 1, 3, enabled: false, 8); Set(val, 2, 3, enabled: false, 2); return val; } public static HexMap StabilityModule() { //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_0011: Expected O, but got Unknown //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_0030: Expected O, but got Unknown HexMap val = new HexMap(2, 3); Set(val, 0, 0, enabled: false, 4); Set(val, 1, 0, enabled: true, 8); Set(val, 1, 1, enabled: true, 0); Set(val, 0, 2, enabled: true, 2); return val; } public static HexMap InfinityBurn() { //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_0011: Expected O, but got Unknown //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected O, but got Unknown //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Expected O, but got Unknown //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Expected O, but got Unknown //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Expected O, but got Unknown //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Expected O, but got Unknown //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Expected O, but got Unknown //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Expected O, but got Unknown //IL_0083: Expected O, but got Unknown HexMap val = new HexMap(5, 4); Set(val, 0, 0, enabled: false, 4); Set(val, 1, 0, enabled: false, 8); Set(val, 2, 0, enabled: true, 8); Set(val, 0, 1, enabled: true, 4); Set(val, 1, 1, enabled: true, 4); Set(val, 2, 1, enabled: true, 8); Set(val, 3, 1, enabled: true, 16); Set(val, 4, 1, enabled: true, 16); Set(val, 2, 2, enabled: true, 8); Set(val, 1, 3, enabled: true, 0); Set(val, 2, 3, enabled: true, 20); Set(val, 3, 3, enabled: true, 0); return val; } public static HexMap Bigazine() { //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_0011: Expected O, but got Unknown //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected O, but got Unknown //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Expected O, but got Unknown //IL_0059: Expected O, but got Unknown HexMap val = new HexMap(2, 4); Set(val, 0, 0, enabled: true, 4); Set(val, 1, 0, enabled: true, 8); Set(val, 0, 1, enabled: true, 1); Set(val, 1, 1, enabled: true, 8); Set(val, 0, 2, enabled: true, 1); Set(val, 1, 2, enabled: true, 8); Set(val, 0, 3, enabled: true, 1); Set(val, 1, 3, enabled: true, 32); return val; } public static HexMap BulgingCartridge() { //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_0011: Expected O, but got Unknown //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown //IL_0027: Expected O, but got Unknown HexMap val = new HexMap(1, 3); Set(val, 0, 0, enabled: true, 0); Set(val, 0, 1, enabled: true, 9); Set(val, 0, 2, enabled: true, 0); return val; } public static HexMap CompactCartridge() { //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_0011: Expected O, but got Unknown //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_0026: Expected O, but got Unknown HexMap val = new HexMap(3, 1); Set(val, 0, 0, enabled: true, 4); Set(val, 1, 0, enabled: true, 2); Set(val, 2, 0, enabled: true, 0); return val; } public static HexMap DoublestackCartridge() { //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_0011: Expected O, but got Unknown //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected O, but got Unknown //IL_0044: Expected O, but got Unknown HexMap val = new HexMap(3, 2); Set(val, 0, 0, enabled: false, 4); Set(val, 1, 0, enabled: true, 4); Set(val, 2, 0, enabled: false, 0); Set(val, 0, 1, enabled: true, 2); Set(val, 1, 1, enabled: false, 2); Set(val, 2, 1, enabled: true, 0); return val; } public static HexMap AdrenalineReload() { //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_0011: Expected O, but got Unknown //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0026: 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 //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown //IL_0045: Expected O, but got Unknown HexMap val = new HexMap(3, 3); Set(val, 0, 0, enabled: false, 4); Set(val, 1, 0, enabled: true, 10); Set(val, 2, 0, enabled: true, 0); Set(val, 1, 1, enabled: true, 0); Set(val, 0, 2, enabled: true, 2); Set(val, 2, 2, enabled: false, 8); return val; } public static HexMap ChargeShield() { //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_0011: Expected O, but got Unknown //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected O, but got Unknown //IL_0046: Expected O, but got Unknown HexMap val = new HexMap(3, 2); Set(val, 0, 0, enabled: false, 8); Set(val, 1, 0, enabled: true, 0); Set(val, 2, 0, enabled: false, 0); Set(val, 0, 1, enabled: true, 2); Set(val, 1, 1, enabled: false, 32); Set(val, 2, 1, enabled: false, 16); return val; } public static HexMap ShockRecursion() { //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_0011: Expected O, but got Unknown //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected O, but got Unknown //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Expected O, but got Unknown //IL_004f: Expected O, but got Unknown HexMap val = new HexMap(3, 4); Set(val, 0, 0, enabled: true, 4); Set(val, 1, 0, enabled: true, 8); Set(val, 1, 1, enabled: true, 4); Set(val, 1, 2, enabled: true, 0); Set(val, 2, 2, enabled: true, 8); Set(val, 1, 3, enabled: true, 0); Set(val, 2, 3, enabled: true, 48); return val; } public static HexMap ToxinRecycling() { //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_0011: Expected O, but got Unknown //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected O, but got Unknown //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown //IL_0058: Expected O, but got Unknown HexMap val = new HexMap(2, 4); Set(val, 0, 0, enabled: true, 4); Set(val, 1, 0, enabled: true, 8); Set(val, 0, 1, enabled: true, 1); Set(val, 1, 1, enabled: true, 8); Set(val, 0, 2, enabled: true, 1); Set(val, 1, 2, enabled: true, 0); Set(val, 0, 3, enabled: true, 4); Set(val, 1, 3, enabled: true, 0); return val; } public static HexMap SuperheatReaction() { //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_0011: Expected O, but got Unknown //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_0030: Expected O, but got Unknown HexMap val = new HexMap(3, 4); Set(val, 1, 0, enabled: true, 4); Set(val, 0, 1, enabled: true, 2); Set(val, 2, 1, enabled: true, 0); Set(val, 1, 2, enabled: true, 0); return val; } public static HexMap LiteEnergy() { //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_0011: Expected O, but got Unknown //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown //IL_003a: Expected O, but got Unknown HexMap val = new HexMap(5, 1); Set(val, 0, 0, enabled: true, 4); Set(val, 1, 0, enabled: true, 2); Set(val, 2, 0, enabled: true, 4); Set(val, 3, 0, enabled: true, 2); Set(val, 4, 0, enabled: true, 0); return val; } public static HexMap MassAcceleration() { //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_0011: Expected O, but got Unknown //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown //IL_003c: Expected O, but got Unknown HexMap val = new HexMap(3, 2); Set(val, 0, 0, enabled: false, 8); Set(val, 1, 0, enabled: true, 4); Set(val, 0, 1, enabled: true, 2); Set(val, 1, 1, enabled: true, 32); Set(val, 2, 1, enabled: true, 16); return val; } public static HexMap EquipmentSiphon() { //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_0011: Expected O, but got Unknown //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_0030: Expected O, but got Unknown HexMap val = new HexMap(3, 3); Set(val, 1, 0, enabled: true, 4); Set(val, 0, 1, enabled: true, 2); Set(val, 2, 1, enabled: true, 0); Set(val, 1, 2, enabled: true, 1); return val; } public static HexMap FullOutput() { //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_0011: Expected O, but got Unknown //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown //IL_003c: Expected O, but got Unknown HexMap val = new HexMap(3, 2); Set(val, 0, 0, enabled: false, 4); Set(val, 1, 0, enabled: true, 28); Set(val, 0, 1, enabled: true, 0); Set(val, 1, 1, enabled: true, 34); Set(val, 2, 1, enabled: true, 0); return val; } public static HexMap EnergyConvergence() { //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_0011: Expected O, but got Unknown //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_0030: Expected O, but got Unknown HexMap val = new HexMap(3, 3); Set(val, 1, 0, enabled: true, 4); Set(val, 0, 1, enabled: true, 2); Set(val, 2, 1, enabled: true, 0); Set(val, 1, 2, enabled: true, 1); return val; } public static HexMap ElementalDischarge() { //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_0011: Expected O, but got Unknown //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown //IL_003a: Expected O, but got Unknown HexMap val = new HexMap(3, 3); Set(val, 0, 0, enabled: true, 4); Set(val, 1, 0, enabled: true, 8); Set(val, 1, 1, enabled: true, 0); Set(val, 0, 2, enabled: true, 2); Set(val, 2, 2, enabled: true, 0); return val; } public static HexMap ViolentReaction() { //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_0011: Expected O, but got Unknown //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0026: 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 //IL_0031: Expected O, but got Unknown HexMap val = new HexMap(3, 5); Set(val, 1, 0, enabled: true, 0); Set(val, 2, 2, enabled: true, 32); Set(val, 1, 3, enabled: true, 2); Set(val, 2, 3, enabled: true, 1); return val; } public static HexMap CondensedEjection() { //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_0011: Expected O, but got Unknown //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_0030: Expected O, but got Unknown HexMap val = new HexMap(3, 2); Set(val, 0, 0, enabled: true, 4); Set(val, 1, 0, enabled: true, 2); Set(val, 2, 0, enabled: true, 0); Set(val, 1, 1, enabled: true, 1); return val; } public static HexMap RocketSlide() { //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_0011: Expected O, but got Unknown //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_0030: Expected O, but got Unknown HexMap val = new HexMap(4, 2); Set(val, 1, 0, enabled: true, 4); Set(val, 2, 0, enabled: true, 0); Set(val, 0, 1, enabled: true, 2); Set(val, 3, 1, enabled: true, 0); return val; } public static HexMap DumpCharge() { //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_0011: Expected O, but got Unknown //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown //IL_003a: Expected O, but got Unknown HexMap val = new HexMap(3, 3); Set(val, 0, 0, enabled: true, 4); Set(val, 1, 0, enabled: true, 8); Set(val, 1, 1, enabled: true, 4); Set(val, 2, 1, enabled: true, 0); Set(val, 1, 2, enabled: true, 1); return val; } public static HexMap CyclePhasing() { //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_0011: Expected O, but got Unknown //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0026: 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 //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Expected O, but got Unknown //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown //IL_005b: Expected O, but got Unknown HexMap val = new HexMap(3, 3); Set(val, 0, 0, enabled: true, 4); Set(val, 1, 0, enabled: true, 10); Set(val, 2, 0, enabled: true, 8); Set(val, 0, 1, enabled: true, 5); Set(val, 2, 1, enabled: true, 17); Set(val, 0, 2, enabled: true, 1); Set(val, 1, 2, enabled: true, 3); Set(val, 2, 2, enabled: true, 16); return val; } public static HexMap BoundaryIncursion() { //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_0011: Expected O, but got Unknown //IL_0012: Expected O, but got Unknown HexMap val = new HexMap(1, 1); Set(val, 0, 0, enabled: true, 0); return val; } public static HexMap ClosedLoop() { //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_0011: Expected O, but got Unknown //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown //IL_0031: Expected O, but got Unknown HexMap val = new HexMap(2, 2); Set(val, 0, 0, enabled: true, 4); Set(val, 1, 0, enabled: true, 8); Set(val, 0, 1, enabled: true, 1); Set(val, 1, 1, enabled: true, 16); return val; } public static HexMap Crossflash() { //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_0011: Expected O, but got Unknown //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown //IL_0027: Expected O, but got Unknown HexMap val = new HexMap(2, 2); Set(val, 0, 0, enabled: true, 4); Set(val, 1, 0, enabled: true, 16); Set(val, 0, 1, enabled: true, 1); return val; } public static HexMap Pyrolysis() { //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_0011: Expected O, but got Unknown //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0026: 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 //IL_0031: Expected O, but got Unknown HexMap val = new HexMap(2, 2); Set(val, 0, 0, enabled: true, 8); Set(val, 1, 0, enabled: true, 32); Set(val, 0, 1, enabled: true, 4); Set(val, 1, 1, enabled: true, 1); return val; } public static HexMap TriValve() { //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_0011: Expected O, but got Unknown //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_0026: Expected O, but got Unknown HexMap val = new HexMap(2, 2); Set(val, 0, 0, enabled: true, 4); Set(val, 1, 0, enabled: true, 8); Set(val, 1, 1, enabled: true, 0); return val; } public static HexMap AcidSpark() { //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_0011: Expected O, but got Unknown //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown //IL_0027: Expected O, but got Unknown HexMap val = new HexMap(2, 2); Set(val, 0, 0, enabled: true, 4); Set(val, 1, 0, enabled: true, 16); Set(val, 0, 1, enabled: true, 1); return val; } public static HexMap BraidProtocol() { //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_0011: Expected O, but got Unknown //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown //IL_003a: Expected O, but got Unknown HexMap val = new HexMap(3, 2); Set(val, 0, 0, enabled: true, 4); Set(val, 1, 0, enabled: true, 8); Set(val, 2, 0, enabled: true, 0); Set(val, 0, 1, enabled: true, 1); Set(val, 2, 1, enabled: true, 1); return val; } public static HexMap SaturateCatalyst() { //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_0011: Expected O, but got Unknown //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0026: 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 //IL_0031: Expected O, but got Unknown HexMap val = new HexMap(2, 2); Set(val, 0, 0, enabled: true, 8); Set(val, 1, 0, enabled: true, 32); Set(val, 0, 1, enabled: true, 4); Set(val, 1, 1, enabled: true, 1); return val; } private static void Set(HexMap map, int x, int y, bool enabled, byte connections) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) map[x, y].enabled = enabled; map[x, y].connections = (Direction)connections; } } public static class UpgradeRegistration { public static bool TryCreateGunUpgrade(string modGuid, IUpgradable gear, string gearApiName, int upgradeId, string name, string description, Rarity rarity, UpgradeProperty[] properties, HexMap pattern, UpgradeFlags flags, Sprite icon, ManualLogSource log, out Upgrade upgrade, int priority = 0, CollectionSource collectionSource = (CollectionSource)0) { //IL_012d: 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_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_014d: 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_0173: Unknown result type (might be due to invalid IL or missing references) upgrade = null; if (string.IsNullOrEmpty(modGuid)) { if (log != null) { log.LogError((object)"[UpgradeRegistration] modGuid is null/empty."); } return false; } if (properties == null || properties.Length == 0) { if (log != null) { log.LogError((object)"[UpgradeRegistration] properties array is null/empty."); } return false; } if (gear == null) { gear = WeaponRegistration.FindGearSafe(gearApiName); } if (gear == null) { if (log != null) { log.LogError((object)("[UpgradeRegistration] Gear \"" + gearApiName + "\" not found. Register gear first.")); } return false; } if (PlayerData.Instance == null) { if (log != null) { log.LogDebug((object)"[UpgradeRegistration] PlayerData.Instance null — defer CreateUpgrade."); } return false; } if ((Object)(object)gear.Info == (Object)null) { if (log != null) { log.LogError((object)("[UpgradeRegistration] Gear \"" + gearApiName + "\" has null Info.")); } return false; } try { WeaponRegistration.EnsureGearData(gear, autoUnlock: true, log); GearData gearData = PlayerData.GetGearData(gear); if (gearData == null) { gearData = PlayerData.GetGearData(gear.Info.ID); } if (gearData == null) { if (log != null) { log.LogDebug((object)("[UpgradeRegistration] No GearData for '" + gearApiName + "' yet — defer CreateUpgrade.")); } return false; } if (gearData.Gear == null) { gearData.Gear = gear; } } catch (Exception ex) { if (log != null) { log.LogDebug((object)("[UpgradeRegistration] GearData probe failed (defer): " + ex.Message)); } return false; } CustomUpgradeParams val = CustomUpgradeParams.Create(gear, upgradeId, name, description, rarity, icon); val.flags = flags; val.priority = priority; val.collectionSource = collectionSource; val.upgradeType = (Type)3; val.useDefaultUnlockCost = true; if (pattern != null) { val.pattern = pattern; } try { upgrade = PlayerData.CreateUpgrade(modGuid, val, properties); } catch (Exception arg) { if (log != null) { log.LogError((object)$"[UpgradeRegistration] CreateUpgrade threw: {arg}"); } upgrade = null; return false; } if ((Object)(object)upgrade == (Object)null) { if (log != null) { log.LogError((object)"[UpgradeRegistration] CreateUpgrade returned null."); } return false; } if (pattern != null) { upgrade.SetPattern(pattern); } return true; } public static UpgradeInstance GrantTestInstance(IUpgradable gear, Upgrade upgrade, bool unlock = true, bool quietUnlock = true, ManualLogSource log = null) { if (gear == null || (Object)(object)upgrade == (Object)null) { if (log != null) { log.LogError((object)"[UpgradeRegistration] GrantTestInstance: gear or upgrade is null."); } return null; } UpgradeInstance val = PlayerData.CollectInstance(gear, upgrade, (UnlockFlags)1); if (val == null) { if (log != null) { log.LogError((object)"[UpgradeRegistration] CollectInstance returned null."); } return null; } if (unlock) { val.Unlock(quietUnlock); } if (log != null) { log.LogInfo((object)("[UpgradeRegistration] Granted test instance of '" + upgrade.Name + "'.")); } return val; } } internal static class VanillaCyclerAssets { public const int VanillaPlasmaBulletsUpgradeId = 41000; private static GameObject _plasmaBulletGo; private static bool _loggedFail; private static Event _plasmaFireSound; private static bool _plasmaSoundAttempted; public static GameObject TryGetPlasmaBulletPrefab() { if ((Object)(object)_plasmaBulletGo != (Object)null) { return _plasmaBulletGo; } try { GameObject val = ResolveFromVanillaCyclerUpgrades(); if ((Object)(object)val != (Object)null) { return CachePlasma(val, "vanilla Cycler Info.Upgrades"); } GameObject val2 = ResolveFromAllGearUpgrades(); if ((Object)(object)val2 != (Object)null) { return CachePlasma(val2, "AllGear upgrade scan"); } GameObject val3 = ResolveViaGetUpgradeFromID(); if ((Object)(object)val3 != (Object)null) { return CachePlasma(val3, "GetUpgradeFromID"); } GameObject val4 = ResolveFromLoadedUpgrades(); if ((Object)(object)val4 != (Object)null) { return CachePlasma(val4, "Resources.FindObjectsOfTypeAll"); } GameObject val5 = ResolveFromLoadedBulletGOs(); if ((Object)(object)val5 != (Object)null) { return CachePlasma(val5, "loaded IBullet GameObject name"); } if (!_loggedFail) { _loggedFail = true; ManualLogSource logger = SparrohPlugin.Logger; if (logger != null) { logger.LogWarning((object)"[CyclerRework] Could not resolve vanilla plasma bullet prefab. Condensed Ejection will keep default projectile until resolve succeeds."); } } } catch (Exception ex) { ManualLogSource logger2 = SparrohPlugin.Logger; if (logger2 != null) { logger2.LogWarning((object)("[CyclerRework] Plasma bullet resolve failed: " + ex.Message)); } } return null; } public static bool TryApplyPlasmaBullet(Gun gun) { if ((Object)(object)gun == (Object)null) { return false; } GameObject val = TryGetPlasmaBulletPrefab(); if ((Object)(object)val == (Object)null) { return false; } try { IBullet component = val.GetComponent(); if (component == null) { ManualLogSource logger = SparrohPlugin.Logger; if (logger != null) { logger.LogWarning((object)("[CyclerRework] Plasma GO '" + ((Object)val).name + "' has no IBullet.")); } return false; } gun.SetBullet(component, gun.CreateBulletPool()); gun.SetBulletPrefabOnObservers_Owner(); CartridgeSMG val2 = (CartridgeSMG)(object)((gun is CartridgeSMG) ? gun : null); if (val2 != null) { Event val3 = TryGetPlasmaFireSound(val2); if (val3 != null) { AccessTools.Field(typeof(Gun), "fireSound")?.SetValue(val2, val3); } } ManualLogSource logger2 = SparrohPlugin.Logger; if (logger2 != null) { logger2.LogInfo((object)("[CyclerRework] Applied plasma bullet '" + ((Object)val).name + "' to " + ((Object)gun).name + ".")); } return true; } catch (Exception ex) { ManualLogSource logger3 = SparrohPlugin.Logger; if (logger3 != null) { logger3.LogWarning((object)("[CyclerRework] TryApplyPlasmaBullet failed: " + ex.Message)); } return false; } } public static Event TryGetPlasmaFireSound(CartridgeSMG smg) { if (_plasmaFireSound != null) { return _plasmaFireSound; } if (_plasmaSoundAttempted) { return null; } _plasmaSoundAttempted = true; try { CartridgeSMG val = smg; if ((Object)(object)val == (Object)null) { Gun baseGunPrefab = WeaponRegistration.BaseGunPrefab; CartridgeSMG val2 = (CartridgeSMG)(object)((baseGunPrefab is CartridgeSMG) ? baseGunPrefab : null); if (val2 != null) { val = val2; } } if ((Object)(object)val == (Object)null) { return null; } FieldInfo fieldInfo = AccessTools.Field(typeof(CartridgeSMG), "plasmaBulletSound"); if (fieldInfo == null) { return null; } object obj = val; IUpgradable prefab = ((Gun)val).Prefab; CartridgeSMG val3 = (CartridgeSMG)(object)((prefab is CartridgeSMG) ? prefab : null); if (val3 != null) { obj = val3; } object? value = fieldInfo.GetValue(obj); _plasmaFireSound = (Event)((value is Event) ? value : null); return _plasmaFireSound; } catch { return null; } } public static bool TryGetMuzzle(Gun gun, out Vector3 origin, out Vector3 forward) { //IL_0001: 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_000d: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0112: 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_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_008e: 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_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_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_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) origin = default(Vector3); forward = Vector3.forward; if ((Object)(object)gun == (Object)null) { return false; } try { Transform firePoint = gun.GunData.firePoint; if ((Object)(object)firePoint != (Object)null) { origin = firePoint.position; forward = firePoint.forward; if ((Object)(object)gun.playerLook != (Object)null) { forward = ((Component)gun.playerLook).transform.forward; } return true; } } catch { } try { Transform gunModel = gun.GunModel; if ((Object)(object)gunModel != (Object)null) { origin = gunModel.position + gunModel.forward * 0.35f + Vector3.up * 0.05f; forward = (((Object)(object)gun.playerLook != (Object)null) ? ((Component)gun.playerLook).transform.forward : gunModel.forward); return true; } } catch { } origin = ((Component)gun).transform.position + ((Component)gun).transform.forward * 0.9f + Vector3.up * 0.15f; forward = (((Object)(object)gun.playerLook != (Object)null) ? ((Component)gun.playerLook).transform.forward : ((Component)gun).transform.forward); return true; } private static GameObject CachePlasma(GameObject go, string source) { _plasmaBulletGo = go; ManualLogSource logger = SparrohPlugin.Logger; if (logger != null) { logger.LogInfo((object)("[CyclerRework] Resolved plasma bullet prefab '" + ((Object)go).name + "' via " + source + ".")); } return _plasmaBulletGo; } private static GameObject ResolveFromVanillaCyclerUpgrades() { foreach (IUpgradable item in EnumerateCyclerCandidates()) { GameObject val = ExtractPlasmaFromGearUpgrades(item, preferId: true); if ((Object)(object)val != (Object)null) { return val; } } return null; } private static GameObject ResolveFromAllGearUpgrades() { if (Global.Instance?.AllGear == null) { return null; } IUpgradable[] allGear = Global.Instance.AllGear; foreach (IUpgradable val in allGear) { if (!((Object)(object)((val != null) ? val.Info : null) == (Object)null) && !CyclerHeatBehaviour.IsOurGear(val)) { GameObject val2 = ExtractPlasmaFromGearUpgrades(val, preferId: false); if ((Object)(object)val2 != (Object)null) { return val2; } } } return null; } private static IEnumerable EnumerateCyclerCandidates() { if ((Object)(object)WeaponRegistration.BaseGunPrefab != (Object)null) { yield return (IUpgradable)(object)WeaponRegistration.BaseGunPrefab; } if (Global.Instance?.AllGear != null) { IUpgradable[] allGear = Global.Instance.AllGear; foreach (IUpgradable val in allGear) { if (val is CartridgeSMG && !CyclerHeatBehaviour.IsOurGear(val)) { yield return val; } } } IUpgradable val2 = WeaponRegistration.FindGearSafe("cartridgesmg"); if (val2 != null) { yield return val2; } } private static GameObject ExtractPlasmaFromGearUpgrades(IUpgradable gear, bool preferId) { if ((Object)(object)((gear != null) ? gear.Info : null) == (Object)null) { return null; } List list = null; try { list = gear.Info.Upgrades; } catch { return null; } if (list == null || list.Count == 0) { return null; } for (int i = 0; i < list.Count; i++) { Upgrade val = list[i]; if (!((Object)(object)val == (Object)null) && GetUpgradeNumberId(val) == 41000) { GameObject val2 = ExtractBulletPrefabFromUpgrade(val); if ((Object)(object)val2 != (Object)null) { return val2; } } } for (int j = 0; j < list.Count; j++) { Upgrade val3 = list[j]; if (!((Object)(object)val3 == (Object)null) && IsPlasmaNamed(val3)) { GameObject val4 = ExtractBulletPrefabFromUpgrade(val3); if ((Object)(object)val4 != (Object)null) { return val4; } } } if (!preferId) { for (int k = 0; k < list.Count; k++) { Upgrade val5 = list[k]; if (!((Object)(object)val5 == (Object)null)) { GameObject val6 = ExtractBulletPrefabFromUpgrade(val5); if ((Object)(object)val6 != (Object)null && IsPlasmaGoName(((Object)val6).name)) { return val6; } } } } return null; } private static GameObject ResolveViaGetUpgradeFromID() { try { MethodInfo method = typeof(PlayerData).GetMethod("GetUpgradeFromID", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); if (method == null) { return null; } ParameterInfo[] parameters = method.GetParameters(); if (parameters.Length != 1) { return null; } object obj; if (parameters[0].ParameterType == typeof(int)) { obj = 41000; } else { Type parameterType = parameters[0].ParameterType; try { obj = Activator.CreateInstance(parameterType, 41000, null); } catch { obj = Activator.CreateInstance(parameterType); (parameterType.GetField("ID") ?? parameterType.GetField("id"))?.SetValue(obj, 41000); } } object? obj3 = method.Invoke(null, new object[1] { obj }); Upgrade val = (Upgrade)((obj3 is Upgrade) ? obj3 : null); if (val != null) { return ExtractBulletPrefabFromUpgrade(val); } } catch { } return null; } private static GameObject ResolveFromLoadedUpgrades() { try { Upgrade[] array = Resources.FindObjectsOfTypeAll(); foreach (Upgrade val in array) { if (!((Object)(object)val == (Object)null) && (GetUpgradeNumberId(val) == 41000 || IsPlasmaNamed(val))) { GameObject val2 = ExtractBulletPrefabFromUpgrade(val); if ((Object)(object)val2 != (Object)null) { return val2; } } } } catch { } return null; } private static GameObject ResolveFromLoadedBulletGOs() { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0063: 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) try { MonoBehaviour[] array = Resources.FindObjectsOfTypeAll(); foreach (MonoBehaviour val in array) { if ((Object)(object)val == (Object)null || (Object)(object)((Component)val).gameObject == (Object)null || !(val is IBullet) || !IsPlasmaGoName(((Object)((Component)val).gameObject).name ?? "")) { continue; } Scene scene = ((Component)val).gameObject.scene; if (((Scene)(ref scene)).IsValid()) { scene = ((Component)val).gameObject.scene; if (((Scene)(ref scene)).isLoaded) { continue; } } return ((Component)val).gameObject; } } catch { } return null; } private static bool IsPlasmaNamed(Upgrade u) { string text = ""; try { text = u.APIName ?? ((Object)u).name ?? u.Name ?? ""; } catch { try { text = ((Object)u).name ?? ""; } catch { text = ""; } } if (text.IndexOf("Plasma", StringComparison.OrdinalIgnoreCase) < 0) { return text.IndexOf("Condensed", StringComparison.OrdinalIgnoreCase) >= 0; } return true; } private static bool IsPlasmaGoName(string n) { if (string.IsNullOrEmpty(n)) { return false; } if (n.IndexOf("Plasma", StringComparison.OrdinalIgnoreCase) < 0) { return n.IndexOf("Condensed", StringComparison.OrdinalIgnoreCase) >= 0; } return true; } private static int GetUpgradeNumberId(Upgrade u) { if ((Object)(object)u == (Object)null) { return -1; } try { return u.NumberID; } catch { try { FieldInfo field = typeof(Upgrade).GetField("id", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (field != null && field.FieldType == typeof(int)) { return (int)field.GetValue(u); } } catch { } } return -1; } private static GameObject ExtractBulletPrefabFromUpgrade(Upgrade up) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)up == (Object)null) { return null; } try { GenericGunUpgrade val = (GenericGunUpgrade)(object)((up is GenericGunUpgrade) ? up : null); if (val != null) { GameObject val2 = ExtractFromPropertyList(((Upgrade)val).Properties); if ((Object)(object)val2 != (Object)null) { return val2; } } try { GameObject val3 = ExtractFromPropertyList(up.Properties); if ((Object)(object)val3 != (Object)null) { return val3; } } catch { } try { MethodInfo method = ((object)up).GetType().GetMethod("GetProperties", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (method != null && method.GetParameters().Length == 0) { object obj2 = method.Invoke(up, null); if (obj2 != null) { MethodInfo method2 = obj2.GetType().GetMethod("MoveNext"); PropertyInfo property = obj2.GetType().GetProperty("Current"); while (method2 != null && (bool)method2.Invoke(obj2, null)) { object? obj3 = property?.GetValue(obj2); UpgradeProperty_BulletPrefab val4 = (UpgradeProperty_BulletPrefab)((obj3 is UpgradeProperty_BulletPrefab) ? obj3 : null); if (val4 != null && (Object)(object)val4.bullet != (Object)null) { return val4.bullet; } } } } } catch { } Type[] array = new Type[2] { ((object)up).GetType(), typeof(GenericGunUpgrade) }; foreach (Type type in array) { if (type == null || !type.IsInstanceOfType(up)) { continue; } FieldInfo field = type.GetField("properties", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (!(field == null) && field.GetValue(up) is UpgradePropertyList list) { GameObject val5 = ExtractFromPropertyList(list); if ((Object)(object)val5 != (Object)null) { return val5; } } } } catch (Exception ex) { ManualLogSource logger = SparrohPlugin.Logger; if (logger != null) { logger.LogDebug((object)("[CyclerRework] ExtractBulletPrefab failed: " + ex.Message)); } } return null; } private static GameObject ExtractFromPropertyList(UpgradePropertyList list) { try { if (!((UpgradePropertyList)(ref list)).HasProperties) { return null; } int count = ((UpgradePropertyList)(ref list)).Count; for (int i = 0; i < count; i++) { UpgradeProperty obj = ((UpgradePropertyList)(ref list))[i]; UpgradeProperty_BulletPrefab val = (UpgradeProperty_BulletPrefab)(object)((obj is UpgradeProperty_BulletPrefab) ? obj : null); if (val != null && (Object)(object)val.bullet != (Object)null) { return val.bullet; } } foreach (UpgradeProperty item in (UpgradePropertyList)(ref list)) { UpgradeProperty_BulletPrefab val2 = (UpgradeProperty_BulletPrefab)(object)((item is UpgradeProperty_BulletPrefab) ? item : null); if (val2 != null && (Object)(object)val2.bullet != (Object)null) { return val2.bullet; } } } catch { } return null; } } public static class WeaponRegistration { public static IUpgradable CatalogGear { get; private set; } public static Gun BaseGunPrefab { get; private set; } public static GameObject BaseNetworkPrefab { get; private set; } public static int BaseAllGearIndex { get; private set; } = -1; public static void SetBaseAllGearIndex(int index) { BaseAllGearIndex = index; } public static IUpgradable FindGearSafe(string apiName, int gearId = -1) { if (CatalogGear != null && (Object)(object)CatalogGear.Info != (Object)null && (CatalogGear.Info.APIName == apiName || (gearId >= 0 && CatalogGear.Info.ID == gearId))) { return CatalogGear; } if (Global.Instance?.AllGear != null) { IUpgradable[] allGear = Global.Instance.AllGear; foreach (IUpgradable val in allGear) { if (!((Object)(object)((val != null) ? val.Info : null) == (Object)null)) { if (!string.IsNullOrEmpty(apiName) && val.Info.APIName == apiName) { return val; } if (gearId >= 0 && val.Info.ID == gearId) { return val; } } } } try { if (PlayerData.Instance != null && !string.IsNullOrEmpty(apiName)) { IUpgradable val2 = PlayerData.FindGear(apiName); if (val2 != null) { return val2; } } } catch { } return null; } public static bool TryCreateAndRegister(string modGuid, int gearId, string apiName, string displayName, string description, string baseTypeName, bool autoUnlock, ManualLogSource log, out IUpgradable registeredGear) { registeredGear = null; if (string.IsNullOrEmpty(modGuid) || string.IsNullOrEmpty(apiName)) { if (log != null) { log.LogError((object)"[WeaponRegistration] modGuid / apiName required."); } return false; } if ((Object)(object)Global.Instance == (Object)null || Global.Instance.AllGear == null) { if (log != null) { log.LogError((object)"[WeaponRegistration] Global.Instance.AllGear is null."); } return false; } IUpgradable val = FindGearSafe(apiName, gearId); if (val != null) { CatalogGear = val; registeredGear = val; TryRefreshBaseIndex(baseTypeName, log); RegisterGearTextBlocks(apiName, displayName, "Primary Weapon", description, log); if ((Object)(object)val.Info != (Object)null) { TrySetMember(val.Info, "_localizedName", displayName); } EnsureGearData(val, autoUnlock, log); if (log != null) { log.LogInfo((object)("[WeaponRegistration] Gear '" + apiName + "' already present — reusing.")); } return true; } if (!TryFindBaseGun(baseTypeName, log, out var gear, out var go, out var allGearIndex)) { return false; } BaseGunPrefab = gear; BaseNetworkPrefab = go; BaseAllGearIndex = allGearIndex; if (log != null) { log.LogInfo((object)$"[WeaponRegistration] Base spawn prefab index={allGearIndex} type={((object)gear).GetType().Name}."); } GameObject val2 = Object.Instantiate(go); ((Object)val2).name = "[" + modGuid + "] " + displayName; val2.SetActive(false); Object.DontDestroyOnLoad((Object)(object)val2); NetworkObject val3 = default(NetworkObject); if (val2.TryGetComponent(ref val3)) { Object.DestroyImmediate((Object)(object)val3); if (log != null) { log.LogDebug((object)"[WeaponRegistration] Stripped NetworkObject from catalog clone."); } } Gun component = val2.GetComponent(); if ((Object)(object)component == (Object)null) { if (log != null) { log.LogError((object)"[WeaponRegistration] Clone lost Gun component."); } Object.Destroy((Object)(object)val2); return false; } GearInfo val4 = CreateGearInfo(gearId, apiName, displayName, description, gear.Info, autoUnlock, log); if ((Object)(object)val4 == (Object)null) { Object.Destroy((Object)(object)val2); return false; } if (!TryAssignGearInfo(component, val4, log)) { Object.Destroy((Object)(object)val2); return false; } if ((Object)(object)component.Info == (Object)null || component.Info.ID != gearId || component.Info.APIName != apiName) { if (log != null) { log.LogError((object)("[WeaponRegistration] GearInfo verification failed (Info=" + (((Object)(object)component.Info == (Object)null) ? "null" : (component.Info.APIName + "/" + component.Info.ID)) + ").")); } Object.Destroy((Object)(object)val2); return false; } CyclerHeatBehaviour cyclerHeatBehaviour = val2.GetComponent(); if ((Object)(object)cyclerHeatBehaviour == (Object)null) { cyclerHeatBehaviour = val2.AddComponent(); } cyclerHeatBehaviour.InitializeAsPrefab(description); CyclerHeatBehaviour.ApplyInfiniteAmmo(component); if (!InjectIntoAllGear((IUpgradable)(object)component, log)) { Object.Destroy((Object)(object)val2); return false; } InjectIntoPlayerData((IUpgradable)(object)component, autoUnlock, log); CatalogGear = (IUpgradable)(object)component; registeredGear = (IUpgradable)(object)component; return true; } private static void TryRefreshBaseIndex(string preferredTypeName, ManualLogSource log) { if (Global.Instance?.AllGear == null) { return; } if ((Object)(object)BaseGunPrefab != (Object)null) { int num = Array.IndexOf(Global.Instance.AllGear, (IUpgradable)(object)BaseGunPrefab); if (num >= 0) { BaseAllGearIndex = num; return; } } if (TryFindBaseGun(preferredTypeName, log, out var gear, out var go, out var allGearIndex)) { BaseGunPrefab = gear; BaseNetworkPrefab = go; BaseAllGearIndex = allGearIndex; } } private static bool TryFindBaseGun(string preferredTypeName, ManualLogSource log, out Gun gear, out GameObject go, out int allGearIndex) { //IL_0037: 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_0046: Invalid comparison between Unknown and I4 //IL_00ca: Unknown result type (might be due to invalid IL or missing references) gear = null; go = null; allGearIndex = -1; Gun val = null; GameObject val2 = null; int num = -1; IUpgradable[] allGear = Global.Instance.AllGear; for (int i = 0; i < allGear.Length; i++) { IUpgradable obj = allGear[i]; Gun val3 = (Gun)(object)((obj is Gun) ? obj : null); if (val3 == null) { continue; } if ((int)val3.GearType != 0 && (int)val3.GearType != -1) { if ((Object)(object)val == (Object)null) { val = val3; val2 = ((Component)val3).gameObject; num = i; } continue; } GameObject gameObject = ((Component)val3).gameObject; string name = ((object)val3).GetType().Name; if (!string.IsNullOrEmpty(preferredTypeName) && string.Equals(name, preferredTypeName, StringComparison.Ordinal)) { gear = val3; go = gameObject; allGearIndex = i; if (log != null) { log.LogInfo((object)$"[WeaponRegistration] Base gun: {name} ({((Object)gameObject).name}) index={i}."); } return true; } if ((Object)(object)val == (Object)null || (int)val.GearType != 0) { val = val3; val2 = gameObject; num = i; } } if ((Object)(object)val != (Object)null) { gear = val; go = val2; allGearIndex = num; if (log != null) { log.LogWarning((object)("[WeaponRegistration] '" + preferredTypeName + "' not found — " + $"falling back to {((object)val).GetType().Name} ({((Object)val2).name}) index={num}.")); } return true; } if (log != null) { log.LogError((object)"[WeaponRegistration] No Gun found in Global.AllGear."); } return false; } private static GearInfo CreateGearInfo(int gearId, string apiName, string displayName, string description, GearInfo template, bool autoUnlock, ManualLogSource log) { //IL_014b: Unknown result type (might be due to invalid IL or missing references) GearInfo val = ScriptableObject.CreateInstance(); ((Object)val).name = apiName; TrySetMember(val, "ID", gearId); TrySetMember(val, "k__BackingField", gearId); TrySetMember(val, "_name", apiName); TrySetMember(val, "id", gearId); RegisterGearTextBlocks(apiName, displayName, "Primary Weapon", description, log); TrySetMember(val, "_localizedName", displayName); if ((Object)(object)template != (Object)null) { object member = GetMember(template, "grid"); if (member != null) { TrySetMember(val, "grid", member); } if ((Object)(object)template.Icon != (Object)null) { TrySetMember(val, "k__BackingField", template.Icon); } if (template.UnlockCost != null) { val.UnlockCost = template.UnlockCost; } val.CanGainXP = template.CanGainXP; val.XPGainMultilier = template.XPGainMultilier; val.MaxLevel = template.MaxLevel; val.MinUnlockLevel = 0; val.HideWhenNotCollected = false; } else if ((Object)(object)Global.Instance != (Object)null && (Object)(object)Global.Instance.WarningIcon != (Object)null) { TrySetMember(val, "k__BackingField", Global.Instance.WarningIcon); } val.UnlockAutomatically = autoUnlock; val.UnlockState = (UnlockState)(autoUnlock ? 2 : 0); TrySetMember(val, "upgrades", Array.Empty()); TrySetMember(val, "skins", Array.Empty()); TrySetMember(val, "combinedUpgradeList", new List()); TrySetMember(val, "defaultSkin", null); TrySetMember(val, "k__BackingField", null); _ = val.Upgrades; if (log != null) { log.LogDebug((object)$"[WeaponRegistration] GearInfo created id={gearId} api={apiName} name={displayName}"); } return val; } private static void RegisterGearTextBlocks(string apiName, string displayName, string typeName, string description, ManualLogSource log) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown if (string.IsNullOrEmpty(apiName)) { return; } try { TextBlockGroup val = new TextBlockGroup(0); val.blocks = (TextBlock[])(object)new TextBlock[3] { new TextBlock(displayName ?? apiName, apiName), new TextBlock(typeName ?? "Primary Weapon", apiName), new TextBlock(description ?? string.Empty, apiName) }; TextBlockGroup value = val; TextBlocks.strings[apiName] = value; if (log != null) { log.LogDebug((object)("[WeaponRegistration] Registered TextBlocks for '" + apiName + "' → '" + displayName + "'.")); } } catch (Exception ex) { if (log != null) { log.LogWarning((object)("[WeaponRegistration] TextBlocks registration failed: " + ex.Message)); } } } private static bool TryAssignGearInfo(Gun gear, GearInfo info, ManualLogSource log) { if (TrySetMember(gear, "k__BackingField", info) || TrySetMember(gear, "Info", info)) { return true; } if (log != null) { log.LogError((object)"[WeaponRegistration] Failed to assign GearInfo onto clone (reflection)."); } return false; } private static bool InjectIntoAllGear(IUpgradable gear, ManualLogSource log) { IUpgradable[] allGear = Global.Instance.AllGear; for (int i = 0; i < allGear.Length; i++) { if (allGear[i] != null && (Object)(object)allGear[i].Info != (Object)null && allGear[i].Info.ID == gear.Info.ID) { if (log != null) { log.LogWarning((object)$"[WeaponRegistration] AllGear already contains id={gear.Info.ID}."); } return true; } } IUpgradable[] array = (IUpgradable[])(object)new IUpgradable[allGear.Length + 1]; Array.Copy(allGear, array, allGear.Length); array[allGear.Length] = gear; Global.Instance.AllGear = array; Component val = (Component)(object)((gear is Component) ? gear : null); if (val != null) { TryAppendObjectArray(Global.Instance, "_allGear", (Object)(object)val.gameObject); } if (log != null) { log.LogInfo((object)$"[WeaponRegistration] Injected into AllGear (count={array.Length})."); } return true; } private static void InjectIntoPlayerData(IUpgradable gear, bool autoUnlock, ManualLogSource log) { EnsureGearData(gear, autoUnlock, log); } public static void EnsureGearData(IUpgradable gear, bool autoUnlock, ManualLogSource log) { //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Expected O, but got Unknown if ((Object)(object)((gear != null) ? gear.Info : null) == (Object)null) { return; } if (PlayerData.Instance == null) { if (log != null) { log.LogWarning((object)"[WeaponRegistration] PlayerData.Instance null — gear may appear on next InitializeCollectedGear."); } return; } GearData gearData = PlayerData.GetGearData(gear); if (gearData != null) { gearData.Gear = gear; if (autoUnlock && !gearData.IsUnlocked) { gearData.Unlock(); } if (log != null) { log.LogDebug((object)"[WeaponRegistration] Bound existing GearData entry."); } return; } gearData = PlayerData.GetGearData(gear.Info.ID); if (gearData != null) { gearData.Gear = gear; if (autoUnlock && !gearData.IsUnlocked) { gearData.Unlock(); } if (log != null) { log.LogInfo((object)"[WeaponRegistration] Re-bound GearData by id after load."); } } else if (typeof(PlayerData).GetField("collectedGear", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(PlayerData.Instance) is IDictionary dictionary) { GearData val = new GearData(gear, (UnlockState)(autoUnlock ? 2 : 0)); dictionary[gear.Info.ID] = val; if (autoUnlock) { val.Unlock(); } if (log != null) { log.LogInfo((object)"[WeaponRegistration] Added GearData to collectedGear."); } } else if (log != null) { log.LogWarning((object)"[WeaponRegistration] Could not inject GearData directly."); } } private static bool TrySetMember(object target, string name, object value) { if (target == null) { return false; } Type type = target.GetType(); PropertyInfo property = type.GetProperty(name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (property != null && property.CanWrite) { property.SetValue(target, value); return true; } FieldInfo field = type.GetField(name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (field != null) { field.SetValue(target, value); return true; } Type baseType = type.BaseType; while (baseType != null) { field = baseType.GetField(name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (field != null) { field.SetValue(target, value); return true; } property = baseType.GetProperty(name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (property != null && property.CanWrite) { property.SetValue(target, value); return true; } baseType = baseType.BaseType; } return false; } private static object GetMember(object target, string name) { if (target == null) { return null; } Type type = target.GetType(); object obj = type.GetField(name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(target); if (obj == null) { PropertyInfo? property = type.GetProperty(name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if ((object)property == null) { return null; } obj = property.GetValue(target); } return obj; } private static void TryAppendObjectArray(object host, string fieldName, Object item) { FieldInfo field = host.GetType().GetField(fieldName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (!(field == null) && field.GetValue(host) is Array array) { Type elementType = array.GetType().GetElementType(); if (!(elementType == null) && elementType.IsInstanceOfType(item)) { Array array2 = Array.CreateInstance(elementType, array.Length + 1); Array.Copy(array, array2, array.Length); array2.SetValue(item, array.Length); field.SetValue(host, array2); } } } } namespace CyclerRework { public static class MyPluginInfo { public const string PLUGIN_GUID = "CyclerRework"; public const string PLUGIN_NAME = "CyclerRework"; public const string PLUGIN_VERSION = "1.0.0"; } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } }