using System; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using BetterSoulCost; using BossDropRework; using EntityStates; using EntityStates.AI.Walker; using EntityStates.Bandit2; using EntityStates.BrotherMonster.Weapon; using EntityStates.Captain.Weapon; using EntityStates.CaptainSupplyDrop; using EntityStates.GrandParent; using EntityStates.LaserTurbine; using EntityStates.Mage.Weapon; using EntityStates.NullifierMonster; using EntityStates.TeleporterHealNovaController; using FabricatorStandalone; using HG; using HG.BlendableTypes; using HG.Reflection; using HarmonyLib; using IL.RoR2; using IL.RoR2.Items; using IL.RoR2.Orbs; using KinematicCharacterController; using MissileRework; using Mono.Cecil; using Mono.Cecil.Cil; using MonoMod.Cil; using MonoMod.RuntimeDetour; using MoreStats; using On.EntityStates; using On.EntityStates.LaserTurbine; using On.EntityStates.TeleporterHealNovaController; using On.RoR2; using On.RoR2.Items; using On.RoR2.Orbs; using R2API; using R2API.Utils; using RainrotSharedUtils; using RainrotSharedUtils.Components; using RainrotSharedUtils.Difficulties; using RainrotSharedUtils.Shelters; using RainrotSharedUtils.Status; using RoR2; using RoR2.Achievements; using RoR2.Artifacts; using RoR2.Audio; using RoR2.CharacterAI; using RoR2.ContentManagement; using RoR2.EntitlementManagement; using RoR2.ExpansionManagement; using RoR2.Hologram; using RoR2.Items; using RoR2.Navigation; using RoR2.Orbs; using RoR2.Projectile; using RoR2.Skills; using RoR2.UI; using RoR2BepInExPack.GameAssetPaths; using RoR2BepInExPack.GameAssetPaths.Version_1_39_0; using RoR2BepInExPack.GameAssetPathsBetter; using SwanSongExtended.Artifacts; using SwanSongExtended.Characters; using SwanSongExtended.Components; using SwanSongExtended.Elites; using SwanSongExtended.Equipment; using SwanSongExtended.Equipment.Zapinator; using SwanSongExtended.Interactables; using SwanSongExtended.Items; using SwanSongExtended.Modules; using SwanSongExtended.Scavengers; using SwanSongExtended.Skills; using SwanSongExtended.States; using SwanSongExtended.Storms; using ThreeEyedGames; using Unity; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.Rendering; using UnityEngine.ResourceManagement.AsyncOperations; using UnityEngine.SceneManagement; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: OptIn] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")] [assembly: AssemblyCompany("SwanSongExtended")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("SwanSongExtended")] [assembly: AssemblyTitle("SwanSongExtended")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: UnverifiableCode] namespace RiskierRainContent.Interactables { internal static class CombatEncounterHelper { public enum CustomDirectorType { GalleryDirector = 1, ConstructDirector } public static GameObject MethodOne(PurchaseInteraction purchaseInteraction, Interactor activator, int credits, CustomDirectorType directorType) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Expected O, but got Unknown Vector3 val = Vector3.zero; Quaternion rotation = Quaternion.identity; Transform transform = ((Component)purchaseInteraction).gameObject.transform; if (Object.op_Implicit((Object)(object)transform)) { val = transform.position; rotation = transform.rotation; } GameObject val2 = LegacyResourcesAPI.Load("Prefabs/NetworkedObjects/Encounters/MonstersOnShrineUseEncounter"); if ((Object)(object)val2 == (Object)null) { return null; } GameObject val3 = Object.Instantiate(val2, val, Quaternion.identity); NetworkServer.Spawn(val3); CombatDirector component = val3.GetComponent(); ParseDirectorType(((Component)component).gameObject, directorType); if (!Object.op_Implicit((Object)(object)component) || !Object.op_Implicit((Object)(object)Stage.instance)) { return null; } float num = (float)credits * Stage.instance.entryDifficultyCoefficient; DirectorCard val4 = component.SelectMonsterCardForCombatShrine(num); if (val4 != null) { component.CombatShrineActivation(activator, num, val4); EffectData val5 = new EffectData { origin = val, rotation = rotation }; if (directorType == CustomDirectorType.ConstructDirector) { GameObject val6 = LegacyResourcesAPI.Load("Prefabs/Effects/MonstersOnShrineUse"); EffectManager.SpawnEffect(val6, val5, true); } } return val3; } public static void ParseDirectorType(GameObject obj, CustomDirectorType value) { switch (value) { case CustomDirectorType.GalleryDirector: obj.AddComponent(); break; case CustomDirectorType.ConstructDirector: obj.AddComponent(); break; default: obj.AddComponent(); break; } } } internal class GalleryDirector : MonoBehaviour { } internal class ConstructDirector : MonoBehaviour { } } namespace SwanSongExtended { [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] [R2APISubmoduleDependency(new string[] { "LanguageAPI", "PrefabAPI", "RecalculateStatsAPI", "DotAPI" })] [BepInPlugin("com.RiskOfBrainrot.SwanSongExtended", "SwanSongExtended", "0.1.0")] public class SwanSongPlugin : BaseUnityPlugin { public delegate void orig_idc(LaserTurbineController self); private class ResDiscContext { public LaserTurbineController laserTurbineController; public ResDiscContext(LaserTurbineController passive) { laserTurbineController = passive; } } [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func <>9__15_0; public static Func <>9__35_0; public static Func <>9__35_1; public static Func <>9__36_0; public static Action <>9__38_0; public static Func <>9__44_0; public static Func <>9__44_1; public static Func <>9__54_0; public static Func <>9__54_1; public static Func <>9__56_0; public static Func <>9__56_1; public static Func <>9__56_2; public static Func <>9__57_0; public static Func <>9__57_1; public static Func <>9__64_0; public static Func <>9__64_1; public static Func <>9__65_0; public static Func <>9__65_1; public static Func <>9__65_2; public static Func <>9__65_3; public static Func <>9__69_0; public static Func <>9__69_1; public static Func <>9__72_0; public static Func <>9__72_1; public static Action <>9__72_2; public static Func <>9__74_0; public static Func <>9__74_1; public static Func <>9__82_0; public static Func <>9__82_1; public static Func <>9__84_0; public static Func <>9__84_1; public static Func <>9__84_2; public static Func <>9__84_3; public static Func <>9__84_4; public static Func <>9__85_0; public static Func <>9__85_1; public static Func <>9__85_3; public static Func <>9__85_6; public static Func <>9__85_7; public static Func <>9__85_8; public static Func <>9__85_11; public static Func <>9__85_12; public static Func <>9__93_0; public static Func <>9__93_1; public static Func <>9__99_0; public static Func <>9__99_1; public static Func <>9__99_2; public static Func <>9__106_0; public static hook_TrackBeadExperience <>9__111_1; public static Func <>9__115_0; public static Func <>9__115_1; public static Func <>9__115_4; public static Func <>9__115_5; public static Action <>9__115_7; public static Func <>9__115_8; public static Func <>9__115_9; public static Func <>9__115_10; public static Func <>9__115_17; public static Func <>9__115_18; public static Func <>9__129_0; public static Func <>9__129_3; public static Func <>9__130_0; public static Func <>9__130_1; public static Func <>9__130_2; public static Func <>9__130_3; public static Func <>9__130_4; public static Func <>9__130_5; public static Func <>9__130_6; public static Func <>9__130_8; public static Func <>9__130_9; public static Func <>9__130_10; public static Func <>9__130_11; public static Func <>9__130_12; public static Action <>9__205_0; internal bool b__15_0(Instruction x) { return ILPatternMatchingExt.MatchLdfld(x, "barrierOnOverHeal"); } internal bool b__35_0(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, "RoR2.RoR2Content/Items", "GoldOnHit"); } internal bool b__35_1(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt(x, "GetItemCountEffective"); } internal bool b__36_0(Instruction x) { return ILPatternMatchingExt.MatchLdfld(x, "goldOnHit"); } internal void b__38_0(PayCostContext ctx) { CharacterBody activatorBody = ctx.activatorBody; if (Object.op_Implicit((Object)(object)activatorBody) && Object.op_Implicit((Object)(object)ctx.activatorMaster) && ctx.activatorMaster.money < ctx.cost) { ctx.cost = 0; } } internal bool b__44_0(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt(x, "get_currentEquipmentIndex"); } internal int b__44_1(Inventory inv) { return -1; } internal bool b__54_0(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, "cap"); } internal int b__54_1(int cap) { return foconMaxStack; } internal bool b__56_0(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, "convergenceRadiusDivisor"); } internal bool b__56_1(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, "convergenceRadiusDivisor"); } internal bool b__56_2(Instruction x) { return ILPatternMatchingExt.MatchStindR4(x); } internal bool b__57_0(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, "convergenceChargeRateBonus"); } internal float b__57_1(float chargeBonus) { return foconChargeBonus; } internal bool b__64_0(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt(x, "get_stock"); } internal int b__64_1(int stock, EquipmentSlot slot) { if (stock > 0) { return stock; } if (slot.inventory.GetItemCountEffective(Items.AutoCastEquipment) > 0) { return 1; } return 0; } internal bool b__65_0(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, "RoR2.RoR2Content/Items", "EquipmentMagazine"); } internal bool b__65_1(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt(x, "GetItemCountEffective"); } internal bool b__65_2(Instruction x) { int num = default(int); return ILPatternMatchingExt.MatchStloc(x, ref num); } internal int b__65_3(int stock, Inventory inv) { stock += GetGestureStockFromInventory(inv); return stock; } internal bool b__69_0(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, "RoR2.RoR2Content/Items", "AutoCastEquipment"); } internal bool b__69_1(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt(x, "GetItemCountEffective"); } internal bool b__72_0(Instruction x) { return ILPatternMatchingExt.MatchLdcR4(x, 0f); } internal bool b__72_1(Instruction x) { return ILPatternMatchingExt.MatchStfld(x, "bfgChargeTimer"); } internal void b__72_2(EquipmentSlot self) { TryGestureEquipmentBreak(self); } internal bool b__74_0(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, "RoR2.RoR2Content/Items", "AutoCastEquipment"); } internal bool b__74_1(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt(x, "GetItemCountEffective"); } internal bool b__82_0(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, "RoR2.RoR2Content/Items", "GhostOnKill"); } internal bool b__82_1(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt(x, "GetItemCountEffective"); } internal bool b__84_0(Instruction x) { float num = default(float); return ILPatternMatchingExt.MatchLdcR4(x, ref num); } internal bool b__84_1(Instruction x) { return ILPatternMatchingExt.MatchLdarg(x, 0); } internal bool b__84_2(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC1Content/Buffs", "KillMoveSpeed"); } internal bool b__84_3(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt(x, "GetBuffCount"); } internal int b__84_4(int buffCount) { if (buffCount > 0) { return 1; } return 0; } internal bool b__85_0(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC1Content/Items", "MoveSpeedOnKill"); } internal bool b__85_1(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt(x, "GetItemCountEffective"); } internal bool b__85_3(Instruction x) { return ILPatternMatchingExt.MatchLdcI4(x, 5); } internal bool b__85_6(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC1Content/Buffs", "KillMoveSpeed"); } internal bool b__85_7(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt(x, "ClearTimedBuffs"); } internal bool b__85_8(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt(x, "AddTimedBuff"); } internal float b__85_11(float baseBuffDuration, int iterator) { return iterator + 1; } internal int b__85_12(int vanillaBuffCount, int itemCount, CharacterBody attackerBody) { if (itemCount > 25) { return itemCount; } int buffCount = attackerBody.GetBuffCount(Buffs.KillMoveSpeed); return Mathf.Min(25, buffCount + itemCount); } internal bool b__93_0(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC1Content/Items", "CritDamage"); } internal bool b__93_1(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt(x, "GetItemCountEffective"); } internal bool b__99_0(Instruction x) { return ILPatternMatchingExt.MatchLdcI4(x, 6); } internal bool b__99_1(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt(x, "RoR2.ProcChainMask", "HasProc"); } internal bool b__99_2(bool cantProc, DamageInfo damageInfo) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Invalid comparison between Unknown and I4 return cantProc || (!((DamageTypeCombo)(ref damageInfo.damageType)).IsDamageSourceSkillBased && (int)damageInfo.damageType.damageSource != 64); } internal bool b__106_0(Instruction x) { return ILPatternMatchingExt.MatchLdfld(x, "RoR2.HealthComponent/ItemCounts", "parentEgg"); } internal void b__111_1(orig_TrackBeadExperience orig, CharacterMaster self, ulong idk) { } internal bool b__115_0(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC2Content/Items", "ExtraStatsOnLevelUp"); } internal bool b__115_1(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt(x, "GetItemCountPermanent"); } internal bool b__115_4(Instruction x) { return ILPatternMatchingExt.MatchLdarg(x, 0); } internal bool b__115_5(Instruction x) { return ILPatternMatchingExt.MatchLdfld(x, "extraStatsOnLevelUpCount_CachedLastApplied"); } internal void b__115_7(int itemCount, CharacterBody self) { //IL_0067: Unknown result type (might be due to invalid IL or missing references) int num = self.extraStatsOnLevelUpCount_CachedLastApplied - itemCount; self.extraStatsOnLevelUpCount_CachedLastApplied = itemCount; Inventory inventory = self.inventory; inventory.beadAppliedHealth += (float)num; Inventory inventory2 = self.inventory; inventory2.beadAppliedShield += (float)num; Inventory inventory3 = self.inventory; inventory3.beadAppliedRegen += (float)num; Inventory inventory4 = self.inventory; inventory4.beadAppliedDamage += (float)num; self.SetBuffCount(Buffs.ExtraStatsOnLevelUpBuff.buffIndex, (int)self.inventory.beadAppliedHealth); } internal bool b__115_8(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC2Content/Buffs", "ExtraStatsOnLevelUpBuff"); } internal bool b__115_9(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt(x, "GetBuffCount"); } internal int b__115_10(int buffCount) { return 0; } internal bool b__115_17(Instruction x) { float num = default(float); return ILPatternMatchingExt.MatchLdcR4(x, ref num); } internal bool b__115_18(Instruction x) { ILLabel val = default(ILLabel); return ILPatternMatchingExt.MatchBleUn(x, ref val); } internal bool b__129_0(Instruction x) { return ILPatternMatchingExt.MatchLdfld(x, "healthComponent"); } internal HealthComponent b__129_3(HealthComponent hc, LightningOrb orb) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 if ((int)orb.lightningType == 6 && (Object)(object)hc != (Object)null) { for (int i = 0; (float)i < orb.procCoefficient; i++) { DotController.InflictDot(((Component)hc).gameObject, orb.attacker, hc.body.mainHurtBox, (DotIndex)0, razorwireBleedDuration, orb.damageValue, (uint?)null); } return null; } return hc; } internal bool b__130_0(Instruction x) { return ILPatternMatchingExt.MatchLdflda(x, "itemCounts"); } internal bool b__130_1(Instruction x) { return ILPatternMatchingExt.MatchLdfld(x, "thorns"); } internal bool b__130_2(Instruction x) { int num = default(int); return ILPatternMatchingExt.MatchLdcI4(x, ref num); } internal bool b__130_3(Instruction x) { int num = default(int); return ILPatternMatchingExt.MatchLdcI4(x, ref num); } internal bool b__130_4(Instruction x) { return ILPatternMatchingExt.MatchLdflda(x, "itemCounts"); } internal bool b__130_5(Instruction x) { return ILPatternMatchingExt.MatchLdfld(x, "thorns"); } internal bool b__130_6(Instruction x) { return ILPatternMatchingExt.MatchLdcI4(x, 0); } internal bool b__130_8(Instruction x) { return ILPatternMatchingExt.MatchLdflda(x, "itemCounts"); } internal bool b__130_9(Instruction x) { return ILPatternMatchingExt.MatchLdfld(x, "thorns"); } internal bool b__130_10(Instruction x) { int num = default(int); return ILPatternMatchingExt.MatchLdcI4(x, ref num); } internal bool b__130_11(Instruction x) { int num = default(int); return ILPatternMatchingExt.MatchLdcI4(x, ref num); } internal bool b__130_12(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt(x, "AddOrb"); } internal void b__205_0(CraftableDef craftableDef) { craftableDef.recipes = (Recipe[])(object)new Recipe[0]; } } public static int ignitionTankBurnChance = 15; public float ignitionBurnDamage = 2f; public float ignitionBurnDuration = 2f; private bool shouldIgnitionDamageAndDurationCompound = false; public static int stacheBurnChance = 25; public static int brandBurnChance = 30; public static float _aegisBarrierFlat = 40f; public static float _aegisBarrierPercent = 10f; public static BuffDef aegisDecayBuff; public static int brittleCrownStealCountBase = 2; public static int brittleCrownStealCountStack = 1; public static float crownCommonStealSoulCost = 0.25f; public static float crownUncommonStealSoulCost = 0.5f; public static float crownRareStealSoulCost = 0.8f; private string common = Tools.ConvertDecimal(crownCommonStealSoulCost); private string uncommon = Tools.ConvertDecimal(crownUncommonStealSoulCost); private string rare = Tools.ConvertDecimal(crownRareStealSoulCost); public static float cooldown = 90f; public static float secondsPerCost = 0.5f; public static float foconMinRadius = 8f; public static float foconRadiusMultiplier = 0.5f; public static float foconChargeBonus = 1f; public static int foconMaxStack = 5; public static float gestureEquipBreakChance = 40f; public static int gestureStockBase = 4; public static int gestureStockStack = 2; public static float gestureCdiBase = 1f; public static float gestureCdiStack = 0.5f; public static float hauntExecutionThreshold = 0.25f; private float ghostSpawnChanceOnExecute = 100f; private float ghostDurationPerStack = 6.66f; public int scopeBaseCrit = 5; public int scopeStackCrit = 0; public int scopeBaseStationaryCrit = 40; public int scopeStackStationaryCrit = 0; public static ItemDef seedItemDef; public static float seedRegenDurationBase = 0.25f; public static float seedRegenDurationStack = 0.25f; public static float sunDurationBase = 10f; public static float sunDurationStack = 5f; public static float beadsPermanentStatBonus = 0.07f; private static float razorwireArmorBase = 8f; private static float razorwireArmorStack = 8f; private static float razorwireRangeBase = 40f; private static float razorwireRangeStack = 0f; private static float razorwireTargetsBase = 5f; private static float razorwireTargetsStack = 2f; private static float razorwireBleedDuration = 5f; private static float razorwireDamage = 3.6f; private static float razorwireProcCoeff = 0.2f; private static float razorwireCooldown = 1f; public static GameObject laserTurbineControllerPrefab; private readonly Dictionary resDiscStateContext = new Dictionary(); public const string guid = "com.RiskOfBrainrot.SwanSongExtended"; public const string teamName = "RiskOfBrainrot"; public const string modName = "SwanSongExtended"; public const string version = "0.1.0"; public const string expansionName = "Swan Song"; public const string expansionName2 = "Secrets of the Scug"; public const string expansionToken = "EXPANSION2R4R"; public const string expansionToken2 = "EXPANSIONSOTS"; public const string DEVELOPER_PREFIX = "FRUIT"; public static SwanSongPlugin instance; public static ExpansionDef expansionDefSS2; public static ExpansionDef expansionDefSOTS; public const string iconsPath = ""; private BuffDef brittleCrownBuff => CommonAssets.brittleCrownCursePurchase; private static float minSpin => LaserTurbineController.minSpin; private static float maxSpin => LaserTurbineController.maxSpin; private static float spinPerKill => LaserTurbineController.spinGeneratedOnKill; private static float spinDecayRate => LaserTurbineController.spinDecayPerSecondAfterRefresh; private GameObject meatballNapalmPool => CommonAssets.meatballNapalmPool; public static AssetBundle mainAssetBundle => CommonAssets.mainAssetBundle; public static AssetBundle retierAssetBundle => CommonAssets.retierAssetBundle; public static bool iabMissilesLoaded => ModLoaded("com.RiskOfBrainrot.IAmBecomeMissiles"); public static bool isAELoaded => ModLoaded("com.Borbo.ArtificerExtended"); public static bool is2R4RLoaded => ModLoaded("com.RiskOfBrainrot.RiskierRain"); public static bool isHBULoaded => ModLoaded("com.Borbo.HuntressBuffULTIMATE"); public static bool isScepterLoaded => ModLoaded("com.DestroyedClone.AncientScepter"); public static bool autosprintLoaded => ModLoaded("com.johnedwa.RTAutoSprintEx"); public static bool acridLungeLoaded => ModLoaded("Withor.AcridBiteLunge"); public static bool ucrLoaded => ModLoaded("HIFU.UltimateCustomRun"); public static bool fabricatorsLoaded => ModLoaded("com.RiskOfBrainrot.Fabricators"); private void BurnReworks() { IgnitionTankRework(); } private void IgnitionTankRework() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown StatHooks.GetMoreStatCoefficients += new MoreStatHookEventHandler(IgniTankBurnChance); StrengthenBurnUtils.CheckDotForUpgrade += new hook_CheckDotForUpgrade(OverrideIgnitionBurn); LanguageAPI.Add("ITEM_STRENGTHENBURN_PICKUP", "Your ignite effects deal triple damage."); LanguageAPI.Add("ITEM_STRENGTHENBURN_DESC", $"Gain {ignitionTankBurnChance}% ignite chance. " + "All ignition effects deal +" + Tools.ConvertDecimal(ignitionBurnDamage) + " (+" + Tools.ConvertDecimal(ignitionBurnDamage) + " per stack) more damage and last +" + Tools.ConvertDecimal(ignitionBurnDuration) + " (+" + Tools.ConvertDecimal(ignitionBurnDuration) + " per stack) longer."); } private void IgniTankBurnChance(CharacterBody sender, MoreStatHookEventArgs args) { Inventory inventory = sender.inventory; if (Object.op_Implicit((Object)(object)inventory) && inventory.GetItemCountEffective(Items.StrengthenBurn) > 0) { args.burnChanceOnHit += (float)ignitionTankBurnChance; } } private void OverrideIgnitionBurn(orig_CheckDotForUpgrade orig, Inventory inventory, ref InflictDotInfo dotInfo) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Invalid comparison between Unknown and I4 //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) if ((int)dotInfo.dotIndex != 1 && (int)dotInfo.dotIndex != 2) { return; } int itemCountEffective = inventory.GetItemCountEffective(Items.StrengthenBurn); if (itemCountEffective > 0) { dotInfo.preUpgradeDotIndex = dotInfo.dotIndex; dotInfo.dotIndex = (DotIndex)7; float num = 1f + ignitionBurnDamage * (float)itemCountEffective; float num2 = 1f + ignitionBurnDuration * (float)itemCountEffective; if (shouldIgnitionDamageAndDurationCompound) { dotInfo.totalDamage *= num * num2; dotInfo.damageMultiplier *= num; } else { dotInfo.totalDamage *= num; dotInfo.damageMultiplier *= num / num2; } } } public static int GetBurnCount(CharacterBody victimBody) { return victimBody.GetBuffCount(Buffs.OnFire) + victimBody.GetBuffCount(Buffs.StrongerBurn); } public void ReworkAegis() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown CreateBuff(); Hooks(); HealthComponent.Heal += new Manipulator(RemoveAegisOverheal); LanguageAPI.Add("ITEM_BARRIERONOVERHEAL_PICKUP", "Gain barrier on any interaction. While out of danger, barrier stops decaying."); LanguageAPI.Add("ITEM_BARRIERONOVERHEAL_DESC", "Using any interactable grants a temporary barrier " + $"for {_aegisBarrierFlat} health (+{_aegisBarrierFlat} per stack) " + "plus an additional " + $"{_aegisBarrierPercent}% (+{_aegisBarrierPercent}% per stack) " + "of maximum health. While outside of danger, barrier will not decay."); } private void RemoveAegisOverheal(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); val.GotoNext((MoveType)2, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "barrierOnOverHeal") }); val.Emit(OpCodes.Pop); val.Emit(OpCodes.Ldc_I4_0); } private void CreateBuff() { //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_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) aegisDecayBuff = ScriptableObject.CreateInstance(); ((Object)aegisDecayBuff).name = "AegisDecayFreeze"; aegisDecayBuff.buffColor = new Color(0.95f, 0.85f, 0.08f); aegisDecayBuff.canStack = false; aegisDecayBuff.isDebuff = false; aegisDecayBuff.iconSprite = Addressables.LoadAssetAsync((object)"RoR2/Base/Common/texBuffGenericShield.tif").WaitForCompletion(); ContentAddition.AddBuffDef(aegisDecayBuff); } public void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown MultiShopCardUtils.OnMoneyPurchase += new hook_OnMoneyPurchase(OnMoneyPurchase); MultiShopCardUtils.OnNonMoneyPurchase += new hook_OnNonMoneyPurchase(OnNonMoneyPurchase); CharacterBody.OnInventoryChanged += new hook_OnInventoryChanged(AddItemBehavior); StatHooks.GetMoreStatCoefficients += new MoreStatHookEventHandler(AegisDecayFreeze); } private void AegisDecayFreeze(CharacterBody body, MoreStatHookEventArgs args) { if (body.HasBuff(aegisDecayBuff)) { args.barrierFreezeCount++; } } private void OnNonMoneyPurchase(orig_OnNonMoneyPurchase orig, PayCostContext context) { AegisBarrierGrant(context); orig.Invoke(context); } private void OnMoneyPurchase(orig_OnMoneyPurchase orig, PayCostContext context) { AegisBarrierGrant(context); orig.Invoke(context); } private void AddItemBehavior(orig_OnInventoryChanged orig, CharacterBody self) { orig.Invoke(self); if (NetworkServer.active) { self.AddItemBehavior(self.inventory.GetItemCountEffective(Items.BarrierOnOverHeal)); } } private void AegisBarrierGrant(PayCostContext context) { CharacterMaster activatorMaster = context.activatorMaster; CharacterBody val = ((activatorMaster != null) ? activatorMaster.GetBody() : null); if (Object.op_Implicit((Object)(object)val)) { int itemCountEffective = val.inventory.GetItemCountEffective(Items.BarrierOnOverHeal); HealthComponent healthComponent = val.healthComponent; if (itemCountEffective > 0 && (Object)(object)healthComponent != (Object)null) { float num = Util.ConvertAmplificationPercentageIntoReductionNormalized(_aegisBarrierPercent * 0.01f) * healthComponent.fullCombinedHealth; float num2 = (float)itemCountEffective * _aegisBarrierFlat; healthComponent.AddBarrierAuthority(num + num2); } } } public void BrittleCrownChanges() { //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Expected O, but got Unknown //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Expected O, but got Unknown //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Expected O, but got Unknown //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Expected O, but got Unknown LanguageAPI.Add("ITEM_GOLDONHIT_NAME", "Sunken Crown"); LanguageAPI.Add("ITEM_GOLDONHIT_PICKUP", "Steal from chests... " + Language.Styling.HealthColor("at the cost of health.")); LanguageAPI.Add("ITEM_GOLDONHIT_DESC", "Allows interacting with chests without the ability to afford them, opening the chest " + Language.Styling.UtilityColor("without spending ANY money") + ". Stealing from chests costs " + Language.Styling.HealthColor("[ " + common + " / " + uncommon + " / " + rare + " ]") + " of your " + Language.Styling.HealthColor("maximum health") + ", depending on the size of the chest. " + $"Can steal up to {brittleCrownStealCountBase} {Language.Styling.StackText($"+{brittleCrownStealCountStack}")} times per stage."); HealthComponent.TakeDamageProcess += new Manipulator(RemoveCrownPenalty); GlobalEventManager.ProcessHitEnemy += new Manipulator(RemoveCrownReward); PurchaseInteraction.CanBeAffordedByInteractor += new hook_CanBeAffordedByInteractor(PurchaseInteraction_CanBeAffordedByInteractor); CharacterBody.OnInventoryChanged += new hook_OnInventoryChanged(AddBrittleCrownBehavior); } private void AddBrittleCrownBehavior(orig_OnInventoryChanged orig, CharacterBody self) { orig.Invoke(self); if (NetworkServer.active) { self.AddItemBehavior(self.inventory.GetItemCountEffective(Items.GoldOnHit)); } } private void RemoveCrownReward(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); val.GotoNext((MoveType)2, new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.RoR2Content/Items", "GoldOnHit"), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "GetItemCountEffective") }); val.Emit(OpCodes.Pop); val.Emit(OpCodes.Ldc_I4, 0); } private void RemoveCrownPenalty(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); val.GotoNext((MoveType)2, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "goldOnHit") }); val.Emit(OpCodes.Pop); val.Emit(OpCodes.Ldc_I4, 0); } private void CTCInit(orig_Init orig) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown orig.Invoke(); CostTypeDef costTypeDef = CostTypeCatalog.GetCostTypeDef((CostTypeIndex)1); MethodInfo method = ((Delegate)(object)costTypeDef.payCost).Method; ILHook val = new ILHook((MethodBase)method, new Manipulator(PatchMoneyCostForBrittleCrown)); } private void PatchMoneyCostForBrittleCrown(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0009: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); val.Emit(OpCodes.Ldarg_1); val.EmitDelegate>((Action)delegate(PayCostContext ctx) { CharacterBody activatorBody = ctx.activatorBody; if (Object.op_Implicit((Object)(object)activatorBody) && Object.op_Implicit((Object)(object)ctx.activatorMaster) && ctx.activatorMaster.money < ctx.cost) { ctx.cost = 0; } }); } private bool PurchaseInteraction_CanBeAffordedByInteractor(orig_CanBeAffordedByInteractor orig, PurchaseInteraction self, Interactor activator) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Invalid comparison between Unknown and I4 bool flag = orig.Invoke(self, activator); if (flag) { return flag; } CharacterBody val = null; if ((int)self.costType == 1 && self.saleStarCompatible && ((Component)activator).gameObject.TryGetComponent(ref val) && val.HasBuff(brittleCrownBuff) && val.master.money < self.cost) { int num = 1; int difficultyScaledCost = Run.instance.GetDifficultyScaledCost(45, Stage.instance.entryDifficultyCoefficient); int difficultyScaledCost2 = Run.instance.GetDifficultyScaledCost(245, Stage.instance.entryDifficultyCoefficient); if (self.cost >= num && self.cost < difficultyScaledCost) { CounterfeitCalculations(val, crownCommonStealSoulCost); } else if (self.cost >= difficultyScaledCost && self.cost < difficultyScaledCost2) { CounterfeitCalculations(val, crownUncommonStealSoulCost); } else { CounterfeitCalculations(val, crownRareStealSoulCost); } flag = true; } return flag; } public void CounterfeitCalculations(CharacterBody activator, float soulCost) { SoulCostPlugin.AddSoulCostToBody(activator, soulCost); Util.PlaySound("sfx_lunarmoney_start", ((Component)activator).gameObject); if (NetworkServer.active) { activator.AddBuff(Buffs.FreeUnlocks); activator.RemoveBuff(brittleCrownBuff); } } public void ExecutiveCardChanges() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Expected O, but got Unknown //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Expected O, but got Unknown //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown EquipmentDef val = Addressables.LoadAssetAsync((object)"RoR2/DLC1/MultiShopCard/MultiShopCard.asset").WaitForCompletion(); val.cooldown = cooldown; LanguageAPI.Add("EQUIPMENT_MULTISHOPCARD_PICKUP", "Hack a targeted interactable. Hacked Multishops remain open."); LanguageAPI.Add("EQUIPMENT_MULTISHOPCARD_DESC", "Target an interactable to hack it, unlocking its contents for free. If the target is a multishop terminal, the other terminals will remain open."); MultiShopCardUtils.OnPurchase += new Manipulator(FreezeCard); EquipmentSlot.UpdateTargets += new hook_UpdateTargets(CardTargetInteractables); EquipmentSlot.PerformEquipmentAction += new hook_PerformEquipmentAction(PerformEquipmentAction); } private void FreezeCard(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val = new ILCursor(il); val.GotoNext((MoveType)0, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "get_currentEquipmentIndex") }); val.Remove(); val.EmitDelegate>((Func)((Inventory inv) => -1)); } private bool PerformEquipmentAction(orig_PerformEquipmentAction orig, EquipmentSlot self, EquipmentDef equipmentDef) { if ((Object)(object)equipmentDef == (Object)(object)Equipment.MultiShopCard) { return ActivateEquipment(self); } return orig.Invoke(self, equipmentDef); static bool ActivateEquipment(EquipmentSlot slot) { bool result = false; GameObject rootObject = slot.currentTarget.rootObject; if ((Object)(object)rootObject != (Object)null) { PurchaseInteraction component = rootObject.GetComponent(); if ((Object)(object)component != (Object)null && HackingMainState.PurchaseInteractionIsValidTarget(component)) { component.Networkcost = 0; ShopTerminalBehavior val = default(ShopTerminalBehavior); if (rootObject.TryGetComponent(ref val) && Object.op_Implicit((Object)(object)val.serverMultiShopController)) { val.serverMultiShopController.SetCloseOnTerminalPurchase(component, false); } DroneVendorTerminalBehavior val2 = default(DroneVendorTerminalBehavior); if (rootObject.TryGetComponent(ref val2) && Object.op_Implicit((Object)(object)val2.serverMultiShopController)) { val2.serverMultiShopController.SetCloseOnTerminalPurchase(component, false); } Interactor val3 = default(Interactor); if ((Object)(object)slot.characterBody != (Object)null && ((Component)slot.characterBody).TryGetComponent(ref val3)) { val3.AttemptInteraction(rootObject); } slot.InvalidateCurrentTarget(); result = true; } } return result; } } private void CardTargetInteractables(orig_UpdateTargets orig, EquipmentSlot self, EquipmentIndex targetingEquipmentIndex, bool userShouldAnticipateTarget) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) if (targetingEquipmentIndex != Equipment.MultiShopCard.equipmentIndex || !userShouldAnticipateTarget) { orig.Invoke(self, targetingEquipmentIndex, userShouldAnticipateTarget); return; } float num = 150f; float num2 = 10f; float num3 = Mathf.Cos(Mathf.Clamp(num2, 0f, 180f) * MathF.PI / 180f); float num4 = default(float); Ray val = CameraRigController.ModifyAimRayIfApplicable(self.GetAimRay(), ((Component)self.characterBody).gameObject, ref num4); Collider[] array = Physics.OverlapSphere(((Ray)(ref val)).origin, num + num4, -1, (QueryTriggerInteraction)2); bool flag = false; GameObject rootObject = self.currentTarget.rootObject; Vector3 val3; if ((Object)(object)rootObject != (Object)null) { PurchaseInteraction val2 = ((rootObject != null) ? rootObject.GetComponent() : null); if ((Object)(object)val2 != (Object)null) { flag = HackingMainState.PurchaseInteractionIsValidTarget(val2) && val2.available; } Vector3 origin = ((Ray)(ref val)).origin; Vector3 position = rootObject.transform.position; if (flag) { val3 = position - origin; if (!(((Vector3)(ref val3)).sqrMagnitude > num * num)) { Vector3 direction = ((Ray)(ref val)).direction; val3 = position - origin; if (!(Vector3.Dot(direction, ((Vector3)(ref val3)).normalized) < num3)) { goto IL_0146; } } } self.InvalidateCurrentTarget(); } goto IL_0146; IL_0146: bool flag2 = false; PurchaseInteraction val4 = null; Collider[] array2 = array; foreach (Collider val5 in array2) { Vector3 direction2 = ((Ray)(ref val)).direction; val3 = ((Component)val5).transform.position - ((Ray)(ref val)).origin; float num5 = Vector3.Dot(direction2, ((Vector3)(ref val3)).normalized); if (num5 < num3) { continue; } Vector3 origin2 = ((Ray)(ref val)).origin; Vector3 position2 = ((Component)val5).transform.position; if (!HasLos(origin2, position2)) { continue; } EntityLocator component = ((Component)val5).GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { continue; } PurchaseInteraction component2 = component.entity.GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { flag2 = HackingMainState.PurchaseInteractionIsValidTarget(component2); if (flag2) { flag2 = true; val4 = component2; break; } if ((Object)(object)val4 == (Object)null && component2.available) { val4 = component2; } } } if ((Object)(object)val4 != (Object)null) { if (flag2 && userShouldAnticipateTarget) { self.targetIndicator.visualizerPrefab = LegacyResourcesAPI.Load("Prefabs/RecyclerIndicator"); } else { self.targetIndicator.visualizerPrefab = LegacyResourcesAPI.Load("Prefabs/RecyclerBadIndicator"); } self.currentTarget = new UserTargetInfo { transformToIndicateAt = ((Component)val4).gameObject.transform, pickupController = null, hurtBox = null, rootObject = ((Component)val4).gameObject }; self.targetIndicator.active = true; self.targetIndicator.targetTransform = self.currentTarget.transformToIndicateAt; } else { self.InvalidateCurrentTarget(); self.targetIndicator.active = false; } } public bool HasLos(Vector3 origin, Vector3 targetPosition) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) Vector3 val = targetPosition - origin; RaycastHit val2 = default(RaycastHit); return !Physics.Raycast(origin, val, ref val2, ((Vector3)(ref val)).magnitude - 1f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1); } private void FreezeCardf(orig_OnPurchase orig, PayCostContext context, int moneyCost) { } public void FocusedConvergenceChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown FocusConvergenceController.ApplyRadius += new hook_ApplyRadius(FoconNewRadius); FocusConvergenceController.ApplyRate += new Manipulator(FoconApplyRate); FocusConvergenceController.DoUpdate += new Manipulator(FoconUpdate); LanguageAPI.Add("ITEM_FOCUSEDCONVERGENCE_PICKUP", $"Increase the speed Holdout Zones charge... BUT reduce the size of the zone. Max of {foconMaxStack}."); LanguageAPI.Add("ITEM_FOCUSEDCONVERGENCE_DESC", "Holdout Zones charge " + Tools.ConvertDecimal(foconChargeBonus) + " (+" + Tools.ConvertDecimal(foconChargeBonus) + " per stack) faster, but are " + Tools.ConvertDecimal(1f - foconRadiusMultiplier) + " smaller (-" + Tools.ConvertDecimal(1f - foconRadiusMultiplier) + " per stack). " + $"Max of {foconMaxStack}."); } private void FoconUpdate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val = new ILCursor(il); val.GotoNext((MoveType)2, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "cap") }); val.EmitDelegate>((Func)((int cap) => foconMaxStack)); } private void FoconNewRadius(orig_ApplyRadius orig, MonoBehaviour self, ref float radius) { FocusConvergenceController val = (FocusConvergenceController)(object)((self is FocusConvergenceController) ? self : null); if (val.currentFocusConvergenceCount > 0) { radius -= foconMinRadius; radius *= Mathf.Pow(foconRadiusMultiplier, (float)val.currentFocusConvergenceCount); radius += foconMinRadius; } } private void FoconApplyRadius(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); val.GotoNext((MoveType)0, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "convergenceRadiusDivisor") }); val.Emit(OpCodes.Ldc_R4, foconMinRadius); val.Emit(OpCodes.Sub); val.GotoNext((MoveType)2, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "convergenceRadiusDivisor") }); val.Remove(); val.Emit(OpCodes.Ldc_R4, 2); val.GotoNext((MoveType)0, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchStindR4(x) }); val.Emit(OpCodes.Ldc_R4, foconMinRadius); val.Emit(OpCodes.Add); } private void FoconApplyRate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val = new ILCursor(il); val.GotoNext((MoveType)2, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "convergenceChargeRateBonus") }); val.EmitDelegate>((Func)((float chargeBonus) => foconChargeBonus)); } public void GestureChanges() { //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Expected O, but got Unknown //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Expected O, but got Unknown //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Expected O, but got Unknown //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Expected O, but got Unknown //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Expected O, but got Unknown //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Expected O, but got Unknown //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Expected O, but got Unknown //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Expected O, but got Unknown LanguageAPI.Add("ITEM_AUTOCASTEQUIPMENT_PICKUP", "Greatly increase equipment stock... " + Language.Styling.HealthColor("BUT greatly increase equipment cooldown.") + " Equipments can be activated during their cooldown, " + Language.Styling.HealthColor("with a chance to break.")); LanguageAPI.Add("ITEM_AUTOCASTEQUIPMENT_DESC", "Hold " + Language.Styling.UtilityColor($"{gestureStockBase} additional equipment charges") + " " + Language.Styling.StackText($"+{gestureStockStack}") + "... " + Language.Styling.HealthColor("BUT increase equipment cooldown by +" + Tools.ConvertDecimal(gestureCdiBase)) + " " + Language.Styling.StackText("+" + Tools.ConvertDecimal(gestureCdiStack)) + ". Using your equipment without charges " + Language.Styling.UtilityColor("under-casts") + " it, allowing it to be used " + Language.Styling.HealthColor($"with a {gestureEquipBreakChance}% chance to break") + ". " + Language.Styling.UtilityColor("Unaffected by luck.")); EquipmentSlot.MyFixedUpdate += new Manipulator(RemoveGestureAutocast); Inventory.CalculateEquipmentCooldownScale += new Manipulator(RemoveGestureCdr); EquipmentSlot.ExecuteIfReady += new Manipulator(AllowGestureUndercast); EquipmentSlot.OnEquipmentExecuted += new hook_OnEquipmentExecuted(AddGestureUndercast); Inventory.CalculateEquipmentCooldownScale += new hook_CalculateEquipmentCooldownScale(AddGestureCdi); Inventory.GetEquipmentSlotMaxCharges += new hook_GetEquipmentSlotMaxCharges(AddGestureStock); EquipmentSlot.MyFixedUpdate += new hook_MyFixedUpdate(AddGestureBreak); Inventory.UpdateEquipment += new Manipulator(FixMaxStock); } private void AllowGestureUndercast(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); val.GotoNext((MoveType)2, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "get_stock") }); val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)delegate(int stock, EquipmentSlot slot) { if (stock > 0) { return stock; } return (slot.inventory.GetItemCountEffective(Items.AutoCastEquipment) > 0) ? 1 : 0; }); } private void FixMaxStock(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_008b: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); val.GotoNext((MoveType)2, new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.RoR2Content/Items", "EquipmentMagazine"), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "GetItemCountEffective") }); int num = default(int); val.GotoNext((MoveType)0, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref num) }); val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)delegate(int stock, Inventory inv) { stock += GetGestureStockFromInventory(inv); return stock; }); } private int AddGestureStock(orig_GetEquipmentSlotMaxCharges orig, Inventory self) { int num = orig.Invoke(self); return num + GetGestureStockFromInventory(self); } public static int GetGestureStockFromInventory(Inventory inv) { int itemCountEffective = inv.GetItemCountEffective(Items.AutoCastEquipment); if (itemCountEffective > 0) { return 4 + 2 * (itemCountEffective - 1); } return 0; } private float AddGestureCdi(orig_CalculateEquipmentCooldownScale orig, Inventory self) { float num = orig.Invoke(self); int itemCountEffective = self.GetItemCountEffective(Items.AutoCastEquipment); if (itemCountEffective > 0) { num *= 1f + gestureCdiBase + gestureCdiStack * (float)(itemCountEffective - 1); } return num; } private void RemoveGestureCdr(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); val.GotoNext((MoveType)2, new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.RoR2Content/Items", "AutoCastEquipment"), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "GetItemCountEffective") }); val.Emit(OpCodes.Pop); val.Emit(OpCodes.Ldc_I4, 0); } private void AddGestureUndercast(orig_OnEquipmentExecuted orig, EquipmentSlot self) { bool flag = false; if (NetworkServer.active && self.stock <= 0 && self.inventory.GetItemCountEffective(Items.AutoCastEquipment) > 0) { self.inventory.RestockEquipmentCharges(self.activeEquipmentSlot, 1); flag = true; } orig.Invoke(self); if (NetworkServer.active && flag) { self.characterBody.AddBuff(CommonAssets.gestureQueueEquipBreak); if (self.subcooldownTimer <= 0f) { TryGestureEquipmentBreak(self); } } } private void AddGestureBreak(orig_MyFixedUpdate orig, EquipmentSlot self, float deltaTime) { orig.Invoke(self, deltaTime); if (NetworkServer.active && self.subcooldownTimer <= 0f) { TryGestureEquipmentBreak(self); } } private void AddPreonAccumulatorBreak(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_005b: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); val.GotoNext((MoveType)2, new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 0f), (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "bfgChargeTimer") }); val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Action)delegate(EquipmentSlot self) { TryGestureEquipmentBreak(self); }); } public static void TryGestureEquipmentBreak(EquipmentSlot self) { if (NetworkServer.active && self.characterBody.HasBuff(CommonAssets.gestureQueueEquipBreak)) { if (Util.CheckRoll(gestureEquipBreakChance, 0f, (CharacterMaster)null)) { self.inventory.SetEquipmentIndex((EquipmentIndex)(-1)); } self.characterBody.RemoveBuff(CommonAssets.gestureQueueEquipBreak); } } private void RemoveGestureAutocast(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); val.GotoNext((MoveType)2, new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.RoR2Content/Items", "AutoCastEquipment"), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "GetItemCountEffective") }); val.Emit(OpCodes.Pop); val.Emit(OpCodes.Ldc_I4, 0); } public void HappiestMaskRework() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown StatHooks.GetMoreStatCoefficients += new MoreStatHookEventHandler(MaskExecution); GlobalEventManager.onServerCharacterExecuted += HappiestMaskGhostSpawn; GlobalEventManager.OnCharacterDeath += new Manipulator(RevokeHappiestMaskRights); CharacterBody.OnInventoryChanged += new hook_OnInventoryChanged(AddMaskBehavior); LanguageAPI.Add("ITEM_GHOSTONKILL_PICKUP", "Haunt nearby enemies, marking them for execution. Executing enemies summons a ghost."); LanguageAPI.Add("ITEM_GHOSTONKILL_DESC", $"Once every {HappiestMaskBehavior.baseHauntInterval} seconds, " + "Haunt a nearby non-boss enemy, marking them for Execution below " + Tools.ConvertDecimal(hauntExecutionThreshold) + " health. Execution spawns a ghost of the killed enemy with 1500% damage, " + $"lasting for {ghostDurationPerStack}s (+{ghostDurationPerStack}s per stack) " + Language.Styling.UtilityColor("(double for Haunted enemies)") + "."); LanguageAPI.Add("ITEM_GHOSTONKILL_LORE", "\r\n//--AUTO-TRANSCRIPTION FROM RALLYPOINT DELTA --//\r\n\r\n“Sir, the ghosts are back.”\r\n\r\nThe man sighed. After a routine expedition, one of the crew members – a simple soldier - had recovered an artifact thought to have been aboard the Contact Light – a simple mask, adorned with a painfully happy grin. \r\n\r\n“I’ll take care of it.” The man trudged down the hall towards the barracks. The Lemurians he had killed earlier that day walked down the hall by him, barely earning a second glance from the man. This had become so commonplace that most of the crew members in this block had grown accustomed to having a ghostly room-mate.\r\n\r\nBut enough was enough. Stepping through the ghost of an Imp, the man slammed the door open. The lights were off, and in the corner sat the soldier.\r\n\r\n“Alright, we’ve had enough fun playing with the dead. Fork it over.”\r\n\r\nNo response. The man grunted and hoisted the soldier to his feet, giving him a few rough shakes. “Hey, can you hear me!? I said hand over the mask! I’m tired of waking up next to Beetles, so give it a rest already--”\r\n\r\nThe soldier’s limp body moved. Slowly, the soldier raised his finger – pointing directly at the man.\r\n\r\n“What are you...?” With a sense of dread, the man turned and saw the Lemurians he had killed earlier step into the room. Their mouths began to glow with an otherworldly light.\r\n\r\nThe man cursed under his breath as he loaded his shotgun. “This planet, I tell you...”"); } private void MaskExecution(CharacterBody sender, MoreStatHookEventArgs args) { bool flag = sender.HasBuff(CommonAssets.hauntDebuff); args.ModifyBaseExecutionThreshold(hauntExecutionThreshold, flag); } private void AddMaskBehavior(orig_OnInventoryChanged orig, CharacterBody self) { orig.Invoke(self); int itemCountEffective = self.inventory.GetItemCountEffective(Items.GhostOnKill); self.AddItemBehavior(itemCountEffective); } private void HappiestMaskGhostSpawn(DamageReport damageReport, float executionHealthLost) { CharacterBody victimBody = damageReport.victimBody; CharacterBody attackerBody = damageReport.attackerBody; if (!Object.op_Implicit((Object)(object)victimBody) || !Object.op_Implicit((Object)(object)attackerBody)) { return; } Inventory inventory = attackerBody.inventory; if (!Object.op_Implicit((Object)(object)inventory)) { return; } int num = inventory.GetItemCountEffective(Items.GhostOnKill); if (num > 0 && Object.op_Implicit((Object)(object)victimBody) && Util.CheckRoll(ghostSpawnChanceOnExecute, attackerBody.master)) { if (victimBody.HasBuff(CommonAssets.hauntDebuff)) { num *= 2; } Util.TryToCreateGhost(victimBody, attackerBody, Mathf.CeilToInt((float)num * ghostDurationPerStack)); } } private void RevokeHappiestMaskRights(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); val.GotoNext((MoveType)2, new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.RoR2Content/Items", "GhostOnKill"), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "GetItemCountEffective") }); val.Emit(OpCodes.Ldc_I4, 0); val.Emit(OpCodes.Mul); } public void HuntersHarpoonRework() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown CharacterBody.RecalculateStats += new Manipulator(ChangeMoveSpeed); GlobalEventManager.OnCharacterDeath += new Manipulator(ChangeDuration); LanguageAPI.Add("ITEM_MOVESPEEDONKILL_DESC", "Killing an enemy increases movement speed by 125% for 1 (+1 per stack) seconds. Consecutive kills increase buff duration to up to 25 seconds."); } public static void ChangeMoveSpeed(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val = new ILCursor(il); float num = default(float); if (!val.TryGotoNext((MoveType)0, new Func[4] { (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, ref num), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC1Content/Buffs", "KillMoveSpeed"), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "GetBuffCount") })) { Log.DebugBreakpoint("ChangeMoveSpeed"); return; } val.Next.Operand = 1.25f; val.Index += 4; val.EmitDelegate>((Func)((int buffCount) => (buffCount > 0) ? 1 : 0)); } private void ChangeDuration(ILContext il) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_029d: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); int attackerBodyLoc = 16; int itemCountLoc = 54; int buffCountLoc = 86; int iteratorLoc = 91; ILLabel val2 = val.DefineLabel(); ILLabel val3 = val.DefineLabel(); if (!val.TryGotoNext((MoveType)2, new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC1Content/Items", "MoveSpeedOnKill"), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "GetItemCountEffective"), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref itemCountLoc) })) { Log.DebugBreakpoint("ChangeDuration", 1); return; } if (!val.TryGotoNext((MoveType)0, new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 5), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref buffCountLoc) })) { Log.DebugBreakpoint("ChangeDuration", 2); return; } int index = val.Index; val.Index = index + 1; val2 = val.MarkLabel(); if (!val.TryGotoNext((MoveType)0, new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref attackerBodyLoc), (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC1Content/Buffs", "KillMoveSpeed"), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "ClearTimedBuffs") })) { Log.DebugBreakpoint("ChangeDuration", 3); return; } if (!val.TryGotoNext((MoveType)0, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "AddTimedBuff") })) { Log.DebugBreakpoint("ChangeDuration", 4); return; } val3 = val.MarkLabel(); if (!val.TryGotoNext((MoveType)0, new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref iteratorLoc), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, buffCountLoc) })) { Log.DebugBreakpoint("ChangeDuration", 5); return; } val.GotoLabel(val3, (MoveType)1, false); val.Emit(OpCodes.Ldloc, iteratorLoc); val.EmitDelegate>((Func)((float baseBuffDuration, int iterator) => iterator + 1)); val.GotoLabel(val2, (MoveType)1, false); val.Emit(OpCodes.Ldloc, itemCountLoc); val.Emit(OpCodes.Ldloc, attackerBodyLoc); val.EmitDelegate>((Func)delegate(int vanillaBuffCount, int itemCount, CharacterBody attackerBody) { if (itemCount > 25) { return itemCount; } int buffCount = attackerBody.GetBuffCount(Buffs.KillMoveSpeed); return Mathf.Min(25, buffCount + itemCount); }); } public void ReworkLaserScope() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003e: 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 ItemDef val = Addressables.LoadAssetAsync((object)"RoR2/DLC1/CritDamage/CritDamage.asset").WaitForCompletion(); RetierItemAsync(RoR2_DLC1_CritDamage.CritDamage_asset, (ItemTier)1, FixIcon); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(ScopeCritChance); CharacterBody.OnInventoryChanged += new hook_OnInventoryChanged(AddScopeItemBehavior); LanguageAPI.Add("ITEM_CRITDAMAGE_NAME", "Combat Telescope"); LanguageAPI.Add("ITEM_CRITDAMAGE_PICKUP", "Increases 'Critical Strike' chance and damage while stationary."); LanguageAPI.Add("ITEM_CRITDAMAGE_DESC", "Critical Strikes deal an additional 100% damage (+100% per stack). " + $"Gain {scopeBaseCrit}% critical chance, " + $"or {scopeBaseStationaryCrit}% after standing still " + $"for {CombatTelescopeBehavior.combatTelescopeWaitTime} seconds."); static void FixIcon(ItemDef itemDef) { Sprite val2 = retierAssetBundle.LoadAsset("Assets/Icons/Laser_Scope.png"); if (Object.op_Implicit((Object)(object)val2)) { itemDef.pickupIconSprite = val2; } } } private void AddScopeItemBehavior(orig_OnInventoryChanged orig, CharacterBody self) { orig.Invoke(self); self.AddItemBehavior(self.inventory.GetItemCountEffective(Items.CritDamage)); } private void ScopeCritChance(CharacterBody sender, StatHookEventArgs args) { if (!Object.op_Implicit((Object)(object)sender.inventory)) { return; } int itemCountEffective = sender.inventory.GetItemCountEffective(Items.CritDamage); if (itemCountEffective > 0) { int num = scopeBaseCrit; int buffCount = sender.GetBuffCount(CommonAssets.combatTelescopeCritChance); if (buffCount > 0) { num = scopeBaseStationaryCrit; } args.critAdd += (float)num; } } private void RevokeScopeRights(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); val.GotoNext((MoveType)2, new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC1Content/Items", "CritDamage"), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "GetItemCountEffective") }); val.Emit(OpCodes.Ldc_I4, 0); val.Emit(OpCodes.Mul); } public void ReworkLeechingSeed() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown RetierItemAsync(RoR2_Base_Seed.Seed_asset, (ItemTier)0, FixIcon); GlobalEventManager.ProcessHitEnemy += new Manipulator(FuckLeechingSeed); static void FixIcon(ItemDef itemDef) { Sprite val = retierAssetBundle.LoadAsset("Assets/Icons/Leeching_Seed.png"); if (Object.op_Implicit((Object)(object)val)) { itemDef.pickupIconSprite = val; } } } private void NewSeedBehavior(CharacterBody body, DamageInfo damageInfo, CharacterBody victimBody) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) if (((ProcChainMask)(ref damageInfo.procChainMask)).HasProc((ProcType)6)) { return; } Inventory inventory = body.inventory; if ((Object)(object)inventory != (Object)null) { int itemCountEffective = inventory.GetItemCountEffective(seedItemDef); if (itemCountEffective > 0) { ProcChainMask procChainMask = damageInfo.procChainMask; ((ProcChainMask)(ref procChainMask)).AddProc((ProcType)6); body.AddTimedBuff(Buffs.MeatRegenBoost, (seedRegenDurationBase + seedRegenDurationStack * (float)(itemCountEffective - 1)) * damageInfo.procCoefficient); } } } private void FuckLeechingSeed(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0065: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (val.TryGotoNext((MoveType)2, new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 6), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "RoR2.ProcChainMask", "HasProc") })) { val.Emit(OpCodes.Ldarg_1); val.EmitDelegate>((Func)((bool cantProc, DamageInfo damageInfo) => cantProc || (!((DamageTypeCombo)(ref damageInfo.damageType)).IsDamageSourceSkillBased && (int)damageInfo.damageType.damageSource != 64))); } } public void ReworkFreshMeat() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown ChangeBuffStacking("MeatRegenBoost", canStack: true); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(LetMeatActuallyStack); GlobalEventManager.OnCharacterDeath += new hook_OnCharacterDeath(MeatRegen); LanguageAPI.Add("ITEM_FLATHEALTH_PICKUP", "Regenerate health after killing an enemy."); LanguageAPI.Add("ITEM_FLATHEALTH_DESC", "Increases base health regeneration by +2 hp/s for 3s (+3s per stack) after killing an enemy."); } private void MeatRegen(orig_OnCharacterDeath orig, GlobalEventManager self, DamageReport damageReport) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) CharacterBody attackerBody = damageReport.attackerBody; if ((Object)(object)attackerBody != (Object)null && (Object)(object)attackerBody.inventory != (Object)null) { Inventory inventory = attackerBody.inventory; int itemCountEffective = inventory.GetItemCountEffective(Items.FlatHealth); if (itemCountEffective > 0) { attackerBody.AddTimedBuffAuthority(Buffs.MeatRegenBoost.buffIndex, (float)(3 * itemCountEffective)); } } orig.Invoke(self, damageReport); } private void LetMeatActuallyStack(CharacterBody sender, StatHookEventArgs args) { int buffCount = sender.GetBuffCount(Buffs.MeatRegenBoost); if (buffCount > 1) { args.baseRegenAdd += 2f * (1f + 0.2f * (sender.level - 1f)) * (float)(buffCount - 1); } Inventory inventory = sender.inventory; if ((Object)(object)inventory != (Object)null) { args.baseHealthAdd -= (float)(inventory.GetItemCountEffective(Items.FlatHealth) * 25); } } private void PlanulaChanges() { //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Expected O, but got Unknown //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Expected O, but got Unknown //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Expected O, but got Unknown //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Expected O, but got Unknown LanguageAPI.Add("ITEM_PARENTEGG_PICKUP", "The unmatched power of the sun!"); LanguageAPI.Add("ITEM_PARENTEGG_DESC", "After beginning the teleporter event, " + Language.Styling.DamageColor("summon a sun overhead") + " that lasts for " + Language.Styling.DamageColor(sunDurationBase.ToString()) + " seconds " + Language.Styling.StackText($"+{sunDurationStack}") + ". " + Language.Styling.HealthColor("All enemies and allies burn near the sun") + "."); HealthComponent.TakeDamageProcess += new Manipulator(FuckPlanula); IdleToChargingState.OnEnter += new hook_OnEnter(OnTeleporterEventPreStart); ChargingState.OnEnter += new hook_OnEnter(OnTeleporterEventStart); ChargingState.FixedUpdate += new hook_FixedUpdate(OnTeleporterEventUpdate); } private void FuckPlanula(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); val.GotoNext((MoveType)2, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "RoR2.HealthComponent/ItemCounts", "parentEgg") }); val.Emit(OpCodes.Pop); val.Emit(OpCodes.Ldc_I4_0); } private void OnTeleporterEventPreStart(orig_OnEnter orig, IdleToChargingState self) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (!NetworkServer.active) { return; } int itemCountForTeam = Util.GetItemCountForTeam((TeamIndex)1, Items.ParentEgg.itemIndex, false, false); if (itemCountForTeam <= 0) { return; } TeleporterInteraction teleporterInteraction = ((BaseTeleporterState)self).teleporterInteraction; GameObject chargeActivatorServer = teleporterInteraction.chargeActivatorServer; PlanulaSunController planulaSunController = ((Component)teleporterInteraction).gameObject.AddComponent(); Debug.Log((object)((Object)(object)planulaSunController != (Object)null)); if ((Object)(object)planulaSunController != (Object)null) { planulaSunController.holdoutZoneController = teleporterInteraction.holdoutZoneController; Transform val = ((EntityState)self).transform.Find("FireworkOrigin"); if ((Object)(object)val == (Object)null) { val = ((Component)teleporterInteraction).transform; } planulaSunController.activator = chargeActivatorServer; planulaSunController.CreateBeamEffect(val); planulaSunController.SetSunDuration(itemCountForTeam); } } private void OnTeleporterEventStart(orig_OnEnter orig, ChargingState self) { orig.Invoke(self); if (NetworkServer.active) { PlanulaSunController component = ((EntityState)self).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { component.EndBeamEffect(); component.CreateSun(); } } } private void OnTeleporterEventUpdate(orig_FixedUpdate orig, ChargingState self) { orig.Invoke(self); if (NetworkServer.active) { } } public void PrayerBeadsRework() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Expected O, but got Unknown //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Expected O, but got Unknown //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown RetierItemAsync(RoR2_DLC2_Items_ExtraStatsOnLevelUp.ExtraStatsOnLevelUp_asset, (ItemTier)1, ChangeTags); CharacterMaster.OnBodyStart += new hook_OnBodyStart(InitializeBeadBuff); object obj = <>c.<>9__111_1; if (obj == null) { hook_TrackBeadExperience val = delegate { }; <>c.<>9__111_1 = val; obj = (object)val; } CharacterMaster.TrackBeadExperience += (hook_TrackBeadExperience)obj; CharacterBody.RecalculateStats += new Manipulator(ChangeBeadAppliedStats); ExperienceManager.AwardExperience += new hook_AwardExperience(BeadExperience); StatHooks.GetMoreStatCoefficients += new MoreStatHookEventHandler(BeadScrapCount); LanguageAPI.Add("ITEM_EXTRASTATSONLEVELUP_PICKUP", "Prioritized when used with Uncommon 3D Printers. Permanently increase ALL stats after removal."); LanguageAPI.Add("ITEM_EXTRASTATSONLEVELUP_DESC", "Prioritized when used with Uncommon 3D Printers. After removal, permanently grants a " + Language.Styling.ConvertDecimal(beadsPermanentStatBonus) + " increase to experience gain, health, shield, regeneration, and damage."); static void ChangeTags(ItemDef itemDef) { ItemTag[] array = new ItemTag[6]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); itemDef.tags = (ItemTag[])(object)array; } } private void BeadScrapCount(CharacterBody sender, MoreStatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender.inventory)) { args.scrapGreenCountAdd += sender.inventory.GetItemCountEffective(Items.ExtraStatsOnLevelUp); } } private void BeadExperience(orig_AwardExperience orig, ExperienceManager self, Vector3 origin, CharacterBody body, ulong amount) { //IL_004d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)body.master != (Object)null && (Object)(object)body.inventory != (Object)null) { float num = 1f + body.inventory.beadAppliedHealth * beadsPermanentStatBonus; amount += (ulong)((float)amount * num); } orig.Invoke(self, origin, body, amount); } private void InitializeBeadBuff(orig_OnBodyStart orig, CharacterMaster self, CharacterBody body) { //IL_0039: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, body); Inventory inventory = body.inventory; if (!((Object)(object)inventory == (Object)null) && !(inventory.beadAppliedHealth <= 0f)) { body.SetBuffCount(Buffs.ExtraStatsOnLevelUpBuff.buffIndex, (int)inventory.beadAppliedHealth); } } private void ChangeBeadAppliedStats(ILContext il) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) ILCursor c = new ILCursor(il); int itemCountLoc = 69; ILLabel label = null; if (!c.TryGotoNext((MoveType)2, new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC2Content/Items", "ExtraStatsOnLevelUp"), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "GetItemCountPermanent"), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref itemCountLoc) })) { Log.DebugBreakpoint("ChangeBeadAppliedStats", 1); return; } if (!c.TryGotoNext((MoveType)2, new Func[4] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, itemCountLoc), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "extraStatsOnLevelUpCount_CachedLastApplied"), (Instruction x) => ILPatternMatchingExt.MatchBge(x, ref label) })) { Log.DebugBreakpoint("ChangeBeadAppliedStats", 2); return; } c.Emit(OpCodes.Ldloc, itemCountLoc); c.Emit(OpCodes.Ldarg_0); c.EmitDelegate>((Action)delegate(int itemCount, CharacterBody self) { //IL_0067: Unknown result type (might be due to invalid IL or missing references) int num6 = self.extraStatsOnLevelUpCount_CachedLastApplied - itemCount; self.extraStatsOnLevelUpCount_CachedLastApplied = itemCount; Inventory inventory = self.inventory; inventory.beadAppliedHealth += (float)num6; Inventory inventory2 = self.inventory; inventory2.beadAppliedShield += (float)num6; Inventory inventory3 = self.inventory; inventory3.beadAppliedRegen += (float)num6; Inventory inventory4 = self.inventory; inventory4.beadAppliedDamage += (float)num6; self.SetBuffCount(Buffs.ExtraStatsOnLevelUpBuff.buffIndex, (int)self.inventory.beadAppliedHealth); }); if (!c.TryGotoNext((MoveType)2, new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC2Content/Buffs", "ExtraStatsOnLevelUpBuff"), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "GetBuffCount") })) { Log.DebugBreakpoint("ChangeBeadAppliedStats", 3); return; } c.EmitDelegate>((Func)((int buffCount) => 0)); c.GotoLabel(label, (MoveType)1, false); ChangeBeadStat("beadAppliedHealth", ChangeBeadHealthBonus); ChangeBeadStat("beadAppliedShield", ChangeBeadShieldBonus); ChangeBeadStat("beadAppliedRegen", ChangeBeadRegenBonus); ChangeBeadStat("beadAppliedDamage", ChangeBeadDamageBonus); static float ChangeBeadDamageBonus(float beadBonusStacks, CharacterBody self, float level) { float num = self.baseDamage + self.levelDamage * level; return num * beadsPermanentStatBonus * beadBonusStacks; } static float ChangeBeadHealthBonus(float beadBonusStacks, CharacterBody self, float level) { float num5 = self.baseMaxHealth + self.levelMaxHealth * level; return num5 * beadsPermanentStatBonus * beadBonusStacks; } static float ChangeBeadRegenBonus(float beadBonusStacks, CharacterBody self, float level) { float num2 = Mathf.Abs(self.baseRegen + self.levelRegen * level); return num2 * beadsPermanentStatBonus * beadBonusStacks; } static float ChangeBeadShieldBonus(float beadBonusStacks, CharacterBody self, float level) { float num3 = self.baseMaxHealth + self.levelMaxHealth * level; return num3 * beadsPermanentStatBonus * beadBonusStacks; } void ChangeBeadStat(string beadStatName, Func callback) { //IL_00c9: Unknown result type (might be due to invalid IL or missing references) float num4 = default(float); ILLabel val = default(ILLabel); if (!c.TryGotoNext((MoveType)2, new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, beadStatName), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, ref num4), (Instruction x) => ILPatternMatchingExt.MatchBleUn(x, ref val) }) || !c.TryGotoNext((MoveType)2, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, beadStatName) })) { Log.DebugBreakpoint("ChangeBeadStat:" + beadStatName, 3); } else { c.Emit(OpCodes.Ldarg_0); c.EmitDelegate>((Func)delegate(float beadBonus, CharacterBody self) { float arg = self.level - 1f; return callback(beadBonus, self, arg); }); } } } public void RazorwireRework() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RazorwireArmor); CharacterBody.OnInventoryChanged += new hook_OnInventoryChanged(AddRazorBehavior); HealthComponent.TakeDamageProcess += new Manipulator(RazorwireBegin); LightningOrb.OnArrival += new Manipulator(RazorwireArrival); LanguageAPI.Add("ITEM_THORNS_PICKUP", "Retaliate in a burst of bleeding razors on taking damage. Recharges over time."); LanguageAPI.Add("ITEM_THORNS_DESC", $"Increase armor by {razorwireArmorBase} (+{razorwireArmorStack} per stack)" + "Getting hit causes you to explode in a burst of razors, " + $"bleeding up to {razorwireTargetsBase} " + $"(+{razorwireTargetsStack} per stack) nearby enemies " + "for " + Tools.ConvertDecimal(razorwireBleedDuration * 0.8f) + " base damage per razor charge expelled. " + $"You can hold up to {RazorwireBehavior.baseRazors} (+{RazorwireBehavior.stackRazors} per stack) " + $"razor charges, all reloading over {RazorwireBehavior.rechargeTime} seconds."); } private void RazorwireArmor(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender.inventory)) { int itemCountEffective = sender.inventory.GetItemCountEffective(Items.Thorns); if (itemCountEffective > 0) { args.armorAdd += razorwireArmorBase + razorwireArmorStack * (float)(itemCountEffective - 1); } } } private void AddRazorBehavior(orig_OnInventoryChanged orig, CharacterBody self) { orig.Invoke(self); int itemCountEffective = self.inventory.GetItemCountEffective(Items.Thorns); self.AddItemBehavior(itemCountEffective); } private void RazorwireArrival(ILContext il) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_0072: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); int healthComponentLoc = 0; val.GotoNext((MoveType)2, new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "healthComponent"), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref healthComponentLoc) }); val.GotoNext((MoveType)2, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, healthComponentLoc) }); val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)delegate(HealthComponent hc, LightningOrb orb) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 if ((int)orb.lightningType == 6 && (Object)(object)hc != (Object)null) { for (int i = 0; (float)i < orb.procCoefficient; i++) { DotController.InflictDot(((Component)hc).gameObject, orb.attacker, hc.body.mainHurtBox, (DotIndex)0, razorwireBleedDuration, orb.damageValue, (uint?)null); } return null; } return hc; }); } private void RazorwireBegin(ILContext il) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); int buffCount = 0; val.GotoNext((MoveType)2, new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdflda(x, "itemCounts"), (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "thorns") }); int num4 = default(int); int num3 = default(int); val.GotoPrev((MoveType)0, new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, ref num4), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, ref num3) }); val.Next.Operand = razorwireTargetsBase; int index = val.Index; val.Index = index + 1; val.Next.Operand = razorwireTargetsStack; val.GotoNext((MoveType)2, new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchLdflda(x, "itemCounts"), (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "thorns"), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 0) }); index = val.Index; val.Index = index - 1; val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)delegate(int itemCount, HealthComponent hc) { if (!NetworkServer.active) { return 0; } CharacterBody body2 = hc.body; buffCount = 0; while (body2.HasBuff(CommonAssets.razorChargeBuff)) { body2.RemoveBuff(CommonAssets.razorChargeBuff); buffCount++; } return (buffCount > 0) ? itemCount : 0; }); val.GotoNext((MoveType)2, new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdflda(x, "itemCounts"), (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "thorns") }); int num2 = default(int); int num = default(int); val.GotoPrev((MoveType)0, new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, ref num2), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, ref num) }); val.Next.Operand = razorwireRangeBase; index = val.Index; val.Index = index + 1; val.Next.Operand = razorwireRangeStack; val.GotoNext((MoveType)0, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "AddOrb") }); val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)delegate(LightningOrb razorwireOrb, HealthComponent hc) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Invalid comparison between Unknown and I4 CharacterBody body = hc.body; razorwireOrb.procCoefficient = buffCount; razorwireOrb.damageValue = (((int)body.teamComponent.teamIndex == 1) ? 1f : 0.2f); return razorwireOrb; }); } private void NerfRazorwireOrb(orig_Begin orig, LightningOrb self) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 //IL_0025: Unknown result type (might be due to invalid IL or missing references) if ((int)self.lightningType == 6) { self.procCoefficient = razorwireProcCoeff; self.damageType.damageType = (DamageType)1024; } orig.Invoke(self); } public void DeworkResonanceDisc() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0032: 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_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Expected O, but got Unknown //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Expected O, but got Unknown //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Expected O, but got Unknown //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Expected O, but got Unknown //IL_0299: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Expected O, but got Unknown //IL_02ca: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: Expected O, but got Unknown //IL_02fb: Unknown result type (might be due to invalid IL or missing references) //IL_0302: Expected O, but got Unknown AsyncOperationHandle val = Addressables.LoadAssetAsync((object)"bfba6e51566cdb5419002a0035f60af7"); val.Completed += delegate(AsyncOperationHandle ctx) { ReplaceLaserTurbineController(ctx.Result); }; LaserTurbineBaseState.OnEnter += new hook_OnEnter(TurbineState_OnEnter); EntityState.FixedUpdate += new hook_FixedUpdate(TurbineState_FixedUpdate); EntityState.OnExit += new hook_OnExit(RechargeTurbine_OnExit); string text = "launches itself toward a target for 300% base damage (+300% per stack), piercing all enemies it doesn't kill, and then explodes for 1000% base damage (+1000% per stack). Then returns to the user, striking all enemies along the way for 300% base damage (+300% per stack)."; bool flag = true; string text2 = "Obtain a Resonance Disc charged by killing enemies. Fires automatically when fully charged."; string text3 = "Killing enemies charges the Resonance Disc. The disc " + text; string text4 = "Gain a Resonance Disc that spins " + Language.Styling.DamageColor(Language.Styling.ConvertDecimal(spinPerKill / minSpin) + " faster") + " after killing enemies, up to " + Language.Styling.DamageColor((maxSpin / minSpin - 1f).ToString()) + " times. While spinning, the Resonance Disc continuously slows down to a minimum of " + Language.Styling.DamageColor(Language.Styling.ConvertDecimal(minSpin * 10f) + " Spin") + " at a rate of " + Language.Styling.DamageColor("-" + Language.Styling.ConvertDecimal(spinDecayRate) + " current Spin per second per second") + ", converting " + Language.Styling.DamageColor(Language.Styling.ConvertDecimal(spinDecayRate / minSpin) + " of lost Spin") + " into " + Language.Styling.UtilityColor("Charge") + ". " + Environment.NewLine + "When the Resonance Disc reaches " + Language.Styling.UtilityColor("100% Charge") + ", it consumes all " + Language.Styling.UtilityColor("Charge") + ". The disc then " + text; LanguageAPI.Add("ITEM_LASERTURBINE_PICKUP", flag ? text4 : text2); LanguageAPI.Add("ITEM_LASERTURBINE_DESC", flag ? text4 : text3); Hook val2 = new Hook((MethodBase)typeof(LaserTurbineController).GetMethod("Awake", (BindingFlags)(-1)), typeof(SwanSongPlugin).GetMethod("ReflectOnThatThang", (BindingFlags)(-1))); Hook val3 = new Hook((MethodBase)typeof(LaserTurbineController).GetMethod("Update", (BindingFlags)(-1)), typeof(SwanSongPlugin).GetMethod("ReflectOnThatThang", (BindingFlags)(-1))); Hook val4 = new Hook((MethodBase)typeof(LaserTurbineController).GetMethod("FixedUpdate", (BindingFlags)(-1)), typeof(SwanSongPlugin).GetMethod("ReflectOnThatThang", (BindingFlags)(-1))); Hook val5 = new Hook((MethodBase)typeof(LaserTurbineController).GetMethod("OnEnable", (BindingFlags)(-1)), typeof(SwanSongPlugin).GetMethod("ReflectOnThatThang", (BindingFlags)(-1))); Hook val6 = new Hook((MethodBase)typeof(LaserTurbineController).GetMethod("OnDisable", (BindingFlags)(-1)), typeof(SwanSongPlugin).GetMethod("ReflectOnThatThang", (BindingFlags)(-1))); Hook val7 = new Hook((MethodBase)typeof(LaserTurbineController).GetMethod("ExpendCharge", (BindingFlags)(-1)), typeof(SwanSongPlugin).GetMethod("ReflectOnThatThang", (BindingFlags)(-1))); } private static void ReflectOnThatThang(orig_idc orig, LaserTurbineController self) { } private void TurbineState_OnEnter(orig_OnEnter orig, LaserTurbineBaseState self) { if (self is FireMainBeamState || self is RechargeState) { GameObject gameObject = ((Component)((EntityState)self).outer).gameObject; LaserTurbineController component = gameObject.GetComponent(); ResDiscContext resDiscContext = new ResDiscContext(component); resDiscStateContext[(EntityState)(object)self] = resDiscContext; if (self is FireMainBeamState) { if (NetworkServer.active) { resDiscContext.laserTurbineController.ExpendCharge(); } resDiscContext.laserTurbineController.showTurbineDisplay = false; } } orig.Invoke(self); } private void TurbineState_FixedUpdate(orig_FixedUpdate orig, EntityState self) { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Expected O, but got Unknown if (resDiscStateContext.ContainsKey(self)) { ResDiscContext resDiscContext = resDiscStateContext[self]; if (self is RechargeState) { if (self.isAuthority && resDiscContext.laserTurbineController.charge >= 1f) { self.outer.SetNextState((EntityState)new ReadyState()); } return; } } orig.Invoke(self); } private void RechargeTurbine_OnExit(orig_OnExit orig, EntityState self) { if (resDiscStateContext.ContainsKey(self)) { ResDiscContext resDiscContext = resDiscStateContext[self]; if (self is FireMainBeamState) { resDiscContext.laserTurbineController.showTurbineDisplay = true; } resDiscStateContext.Remove(self); } orig.Invoke(self); } private void ReplaceLaserTurbineController(GameObject result) { laserTurbineControllerPrefab = result; LaserTurbineController component = result.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { LaserTurbineController laserTurbineController = result.AddComponent(); laserTurbineController.chargeIndicator = component.chargeIndicator; laserTurbineController.spinIndicator = component.spinIndicator; laserTurbineController.turbineDisplayRoot = component.turbineDisplayRoot; laserTurbineController.chargeIndicator = component.chargeIndicator; } } public void SquolypRework() { SquolypChangeAttack(); SquolypChangeStats(); } private void SquolypChangeAttack() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) SkillDef val = Addressables.LoadAssetAsync((object)"RoR2/Base/Squid/SquidTurretBodyTurret.asset").WaitForCompletion(); Content.AddEntityState(typeof(SquidBlaster)); SerializableEntityStateType activationState = default(SerializableEntityStateType); ((SerializableEntityStateType)(ref activationState))..ctor(typeof(SquidBlaster)); val.activationState = activationState; } private void SquolypChangeStats() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) GameObject val = Addressables.LoadAssetAsync((object)"RoR2/Base/Squid/SquidTurretBody.prefab").WaitForCompletion(); CharacterBody component = val.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.baseDamage = 12f; component.levelDamage = 2.4f; } } public static bool ModLoaded(string modGuid) { return modGuid != "" && Chainloader.PluginInfos.ContainsKey(modGuid); } public static bool IsMissileArtifactEnabled() { if (ModLoaded("com.RiskOfBrainrot.IAmBecomeMissiles")) { return GetMissileArtifactEnabled(); } return false; } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private static bool GetMissileArtifactEnabled() { return RunArtifactManager.instance.IsArtifactEnabled(MissileReworkPlugin.MissileArtifact); } private void Awake() { instance = this; Config.Init(); Log.Init(((BaseUnityPlugin)this).Logger); CreateExpansionDef(); ShockUtilsModule.UseShockSparks = true; Language.Init(); SwanSongExtended.Modules.Hooks.Init(); CommonAssets.Init(); EliteModule.Init(); Spawnlists.Init(); StormsCore.Init(); Materials.SwapShadersFromMaterialsInBundle(mainAssetBundle); ConfigManager.HandleConfigAttributes(((object)this).GetType(), "SwanSong", Config.MyConfig); InitializeContent(); InitializeChanges(); Config.Save(); new ContentPacks().Initialize(); } public static void DebugBreakpoint(string methodName, int breakpointNumber = -1) { Log.DebugBreakpoint(methodName, breakpointNumber); } private void CreateExpansionDef() { expansionDefSS2 = ScriptableObject.CreateInstance(); expansionDefSS2.nameToken = "EXPANSION2R4R_NAME"; expansionDefSS2.descriptionToken = "EXPANSION2R4R_DESCRIPTION"; expansionDefSS2.iconSprite = null; expansionDefSS2.disabledIconSprite = null; LanguageAPI.Add("EXPANSION2R4R_NAME", "Swan Song"); LanguageAPI.Add("EXPANSION2R4R_DESCRIPTION", "Adds content from the 'Swan Song' expansion to the game."); Content.AddExpansionDef(expansionDefSS2); expansionDefSOTS = ScriptableObject.CreateInstance(); expansionDefSOTS.nameToken = "EXPANSIONSOTS_NAME"; expansionDefSOTS.descriptionToken = "EXPANSIONSOTS_DESCRIPTION"; expansionDefSOTS.iconSprite = null; expansionDefSOTS.disabledIconSprite = null; } private void InitializeContent() { Type[] types = Assembly.GetExecutingAssembly().GetTypes(); BeginInitializing(types, "SwanSongItems.txt"); BeginInitializing(types, "SwanSongEquipment.txt"); BeginInitializing(types, "SwanSongElites.txt"); BeginInitializing(types, "SwanSongInteractables.txt"); BeginInitializing(types, "SwanSongArtifacts.txt"); BeginInitializing(types, "SwanSongSkills.txt"); BeginInitializing(types, "SwanSongScavengers.txt"); } private void InitializeChanges() { BurnReworks(); if (GetConfigBool(defaultValue: true, "Reworks : Aegis")) { ReworkAegis(); } if (GetConfigBool(defaultValue: true, "Reworks : Razorwire")) { RazorwireRework(); } if (GetConfigBool(defaultValue: true, "Reworks : Laser Scope")) { ReworkLaserScope(); } if (GetConfigBool(defaultValue: true, "Reworks : Happiest Mask")) { HappiestMaskRework(); } if (GetConfigBool(defaultValue: true, "Reworks : Hunters Harpoon")) { HuntersHarpoonRework(); } if (GetConfigBool(defaultValue: true, "Reworks : Focused Convergence")) { FocusedConvergenceChanges(); } if (GetConfigBool(defaultValue: true, "Reworks : Squid Polyp")) { SquolypRework(); } if (GetConfigBool(defaultValue: true, "Reworks : Executive Card")) { ExecutiveCardChanges(); } if (GetConfigBool(defaultValue: true, "Reworks : Leeching Seed")) { ReworkLeechingSeed(); } if (GetConfigBool(defaultValue: true, "Reworks : Bison Steak")) { ReworkFreshMeat(); } if (GetConfigBool(defaultValue: true, "Reworks : Gesture of the Drowned")) { GestureChanges(); } if (GetConfigBool(defaultValue: true, "Reworks : Brittle Crown")) { BrittleCrownChanges(); } if (GetConfigBool(defaultValue: true, "Reworks : Planula")) { PlanulaChanges(); } if (GetConfigBool(defaultValue: true, "Reworks : Resonance Disc")) { DeworkResonanceDisc(); } if (GetConfigBool(defaultValue: true, "Reworks : Prayer Beads")) { PrayerBeadsRework(); } Secrets.AddSecrets(); } private void BeginInitializing(Type[] allTypes, string fileName = "") where T : SharedBase { Type baseType = typeof(T); if (!baseType.IsAbstract) { Log.Error(Log.Combine() + "Incorrect BaseType: " + baseType.Name); return; } IEnumerable enumerable = allTypes.Where((Type type) => !type.IsAbstract && type.IsSubclassOf(baseType)); if (enumerable.Count() <= 0) { return; } Log.Debug(Log.Combine(baseType.Name) + "Initializing"); foreach (Type item in enumerable) { string text = Log.Combine(baseType.Name, item.Name); Log.Debug(text); T obj = (T)Activator.CreateInstance(item); if (ValidateBaseType(obj)) { Log.Debug(text + "Validated"); InitializeBaseType(obj); Log.Debug(text + "Initialized"); } } if (!string.IsNullOrEmpty(fileName)) { Language.TryPrintOutput(fileName); } } private bool ValidateBaseType(SharedBase obj) { bool isEnabled = obj.isEnabled; if (obj.lockEnabled) { return isEnabled; } return obj.Bind(isEnabled, "Should This Content Be Enabled"); } private void InitializeBaseType(SharedBase obj) { obj.Init(); } private bool GetConfigBool(bool defaultValue, string packetTitle, string desc = "") { return ConfigManager.DualBindToConfig(packetTitle, Config.MyConfig, "Should This Content Be Enabled", defaultValue, desc); } public static Sprite TryLoadSpriteFromBundle(string path, AssetBundle assetBundle = null, bool fallBackOnWrench = false) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) Sprite val = SwanSongPlugin.TryLoadFromBundle(path, assetBundle); if (Object.op_Implicit((Object)(object)val)) { return val; } return Addressables.LoadAssetAsync((object)(fallBackOnWrench ? RoR2_Base_Core.texNullIcon_png : RoR2_Base_Common_MiscIcons.texWIPIcon_png)).WaitForCompletion(); } public static T TryLoadFromBundle(string path, AssetBundle assetBundle = null) where T : Object { if ((Object)(object)assetBundle == (Object)null) { assetBundle = mainAssetBundle; } if (Object.op_Implicit((Object)(object)assetBundle) && !string.IsNullOrWhiteSpace(path) && assetBundle.Contains(path)) { return assetBundle.LoadAsset(path); } return default(T); } public static AssetReferenceT LoadAsync(string guid, Action callback) where T : Object { //IL_0018: 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_0040: Unknown result type (might be due to invalid IL or missing references) AssetReferenceT val = new AssetReferenceT(guid); AsyncOperationHandle handle2 = AssetAsyncReferenceManager.LoadAsset(val, (AsyncReferenceHandleUnloadType)2); if (callback == null) { return val; } if (handle2.IsDone) { onCompleted(handle2); return val; } handle2.Completed += onCompleted; return val; void onCompleted(AsyncOperationHandle handle) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Invalid comparison between Unknown and I4 if (handle.Result == null || (int)handle.Status != 1) { Debug.LogError((object)$"Failed to load asset [{handle.DebugName}] : {handle.OperationException}"); } else { callback(handle.Result); } } } public static void RemoveCraftingRecipe(string guid) { SwanSongPlugin.LoadAsync(guid, (Action)delegate(CraftableDef craftableDef) { craftableDef.recipes = (Recipe[])(object)new Recipe[0]; }); } public static void RetierItemAsync(string itemGuid, ItemTier tier = 5, Action callback = null) { //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) //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) AssetReferenceT val = new AssetReferenceT(itemGuid); AsyncOperationHandle val2 = AssetAsyncReferenceManager.LoadAsset(val, (AsyncReferenceHandleUnloadType)2); val2.Completed += delegate(AsyncOperationHandle ctx) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) ItemDef result = ctx.Result; result.tier = tier; result.deprecatedTier = tier; if (callback != null) { callback(result); } }; } public static void RemoveEquipmentAsync(string equipmentGuid, Action callback = null) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) AssetReferenceT val = new AssetReferenceT(equipmentGuid); AsyncOperationHandle val2 = AssetAsyncReferenceManager.LoadAsset(val, (AsyncReferenceHandleUnloadType)2); val2.Completed += delegate(AsyncOperationHandle ctx) { EquipmentDef result = ctx.Result; result.canDrop = false; result.canBeRandomlyTriggered = false; result.enigmaCompatible = false; result.dropOnDeathChance = 0f; if (callback != null) { callback(result); } }; } internal static void BlacklistSingleItem(ItemDef itemDef, ItemTag itemTag = 4) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)itemDef != (Object)null) { List list = new List(itemDef.tags); list.Add(itemTag); itemDef.tags = list.ToArray(); } else { Log.Error("ItemDef null - unable to blacklist"); } } internal static void BlacklistSingleItem(string name, ItemTag itemTag = 4) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) ItemDef itemDef = LoadItemDef(name); BlacklistSingleItem(itemDef, itemTag); } public static void ChangeBuffStacking(string buffName, bool canStack) { BuffDef val = LoadBuffDef(buffName); if ((Object)(object)val != (Object)null) { val.canStack = canStack; } } private static ItemDef LoadItemDef(string name) { return LegacyResourcesAPI.Load("ItemDefs/" + name); } private static EquipmentDef LoadEquipDef(string name) { return LegacyResourcesAPI.Load("EquipmentDefs/" + name); } private static BuffDef LoadBuffDef(string name) { return LegacyResourcesAPI.Load("BuffDefs/" + name); } } public class AegisDecayBehavior : ItemBehavior { private bool decayFrozen = false; public void FixedUpdate() { if (base.body.outOfDanger != decayFrozen) { if (!decayFrozen) { FreezeDecay(); } else { UnfreezeDecay(); } } } private void FreezeDecay() { if (NetworkServer.active) { decayFrozen = true; base.body.AddBuff(SwanSongPlugin.aegisDecayBuff); } } private void UnfreezeDecay() { if (NetworkServer.active) { decayFrozen = false; base.body.RemoveBuff(SwanSongPlugin.aegisDecayBuff); } } private void OnDisable() { if (decayFrozen) { UnfreezeDecay(); } } } public class BrittleCrownBehavior : ItemBehavior { public void Start() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) if (NetworkServer.active) { base.body.SetBuffCount(CommonAssets.brittleCrownCursePurchase.buffIndex, SwanSongPlugin.brittleCrownStealCountBase + SwanSongPlugin.brittleCrownStealCountStack * (base.stack - 1)); } } public void OnDisable() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) if (NetworkServer.active) { base.body.SetBuffCount(CommonAssets.brittleCrownCursePurchase.buffIndex, 0); } } } public class HappiestMaskBehavior : ItemBehavior { public static float baseHauntRadius = 35f; public static float baseHauntInterval = 10f; private float hauntStopwatch = 0f; private void FixedUpdate() { //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_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: 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_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_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Expected O, but got Unknown //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) hauntStopwatch += Time.fixedDeltaTime; if (!(hauntStopwatch >= baseHauntInterval)) { return; } hauntStopwatch -= baseHauntInterval; if (!NetworkServer.active) { return; } SphereSearch val = new SphereSearch { mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask, origin = base.body.transform.position, queryTriggerInteraction = (QueryTriggerInteraction)2, radius = baseHauntRadius }; TeamMask val2 = TeamMask.AllExcept(base.body.teamComponent.teamIndex); List list = new List(); val.RefreshCandidates().FilterCandidatesByHurtBoxTeam(val2).FilterCandidatesByDistinctHurtBoxEntities() .GetHurtBoxes(list); int num = list.Count; while (num > 0) { int index = Random.Range(0, num - 1); HealthComponent healthComponent = list[index].healthComponent; CharacterBody body = healthComponent.body; if (body.isBoss || !Object.op_Implicit((Object)(object)body)) { list.Remove(list[index]); num--; continue; } for (int i = 0; i < base.stack; i++) { body.AddBuff(CommonAssets.hauntDebuff.buffIndex); } break; } } private void OnDisable() { hauntStopwatch = 0f; } } public class CombatTelescopeBehavior : ItemBehavior { public static float combatTelescopeWaitTime = 0.2f; private void FixedUpdate() { if (!NetworkServer.active) { return; } float notMovingStopwatch = base.body.notMovingStopwatch; if (base.stack > 0 && notMovingStopwatch >= combatTelescopeWaitTime) { if (!base.body.HasBuff(CommonAssets.combatTelescopeCritChance)) { base.body.AddBuff(CommonAssets.combatTelescopeCritChance); } } else if (base.body.HasBuff(CommonAssets.combatTelescopeCritChance)) { base.body.RemoveBuff(CommonAssets.combatTelescopeCritChance); } } private void OnDisable() { if (NetworkServer.active) { base.body.RemoveBuff(CommonAssets.combatTelescopeCritChance); } } } public class PlanulaSunController : MonoBehaviour { public GameObject activator; public HoldoutZoneController holdoutZoneController; private Vector3 sunSpawnPosition; private ParticleSystem beamEffectInstance; private GameObject sunInstance; private float sunDuration; private float sunAge = 0f; public void SetSunDuration(int stack) { sunDuration = ItemBase.GetStackValue(SwanSongPlugin.sunDurationBase, SwanSongPlugin.sunDurationStack, stack); } public void CreateBeamEffect(Transform parent) { //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_0018: 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) if (Object.op_Implicit((Object)(object)parent)) { sunSpawnPosition = FindSunSpawnPosition(parent.position); ChildLocator component = Object.Instantiate(ChannelSunStart.beamVfxPrefab, parent).GetComponent(); component.FindChild("EndPoint").SetPositionAndRotation(sunSpawnPosition, Quaternion.identity); Transform val = component.FindChild("BeamParticles"); beamEffectInstance = ((Component)val).GetComponent(); } else { beamEffectInstance = null; } } public void EndBeamEffect() { //IL_0018: 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) if ((Object)(object)beamEffectInstance != (Object)null) { MainModule main = beamEffectInstance.main; ((MainModule)(ref main)).loop = false; beamEffectInstance.Stop(); } } public static Vector3 FindSunSpawnPosition(Vector3 searchOrigin) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0018: 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_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0062: 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) Vector3 val = searchOrigin; bool flag = true; float num = ChannelSun.sunPlacementIdealAltitudeBonus; float num2 = ChannelSun.sunPrefabDiameter * 0.5f; RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(val, Vector3.up, ref val2, num + num2, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1)) { num = Mathf.Clamp(((RaycastHit)(ref val2)).distance - num2, 0f, num); } val.y += num; return val; } private void FixedUpdate() { if (NetworkServer.active && (Object)(object)sunInstance != (Object)null) { sunAge += Time.fixedDeltaTime; if (sunAge >= sunDuration) { DestroySun(); } } } public void CreateSun() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) if (NetworkServer.active) { sunInstance = Object.Instantiate(ChannelSun.sunPrefab, sunSpawnPosition, Quaternion.identity); sunInstance.GetComponent().ownerObject = activator; NetworkServer.Spawn(sunInstance); } } private void DestroySun() { if (Object.op_Implicit((Object)(object)sunInstance)) { Object.Destroy((Object)(object)sunInstance); sunInstance = null; } } } public class RazorwireBehavior : ItemBehavior { public static float rechargeTime = 5f; public static int baseRazors = 2; public static int stackRazors = 1; private float reloadTimer; private BuffDef razorBuff => CommonAssets.razorChargeBuff; private void Awake() { ((Behaviour)this).enabled = false; } private void OnDisable() { if ((Object)(object)base.body != (Object)null && NetworkServer.active) { while (base.body.HasBuff(razorBuff)) { base.body.RemoveBuff(razorBuff); } } } private void FixedUpdate() { int num = baseRazors + (base.stack - 1) * stackRazors; int num2 = base.body.GetBuffCount(razorBuff); if (num2 < num) { float num3 = rechargeTime / (float)num; reloadTimer += Time.fixedDeltaTime; while (reloadTimer > num3 && num2 < num && NetworkServer.active) { num2++; base.body.AddBuff(razorBuff); reloadTimer -= num3; } } } } public static class Secrets { private const bool DEBUG = true; public static void AddSecrets() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_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_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: 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_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0334: Unknown result type (might be due to invalid IL or missing references) //IL_0339: Unknown result type (might be due to invalid IL or missing references) //IL_0350: Unknown result type (might be due to invalid IL or missing references) //IL_0355: Unknown result type (might be due to invalid IL or missing references) //IL_0384: Unknown result type (might be due to invalid IL or missing references) //IL_03ae: Unknown result type (might be due to invalid IL or missing references) //IL_03b3: Unknown result type (might be due to invalid IL or missing references) //IL_03ca: Unknown result type (might be due to invalid IL or missing references) //IL_03cf: Unknown result type (might be due to invalid IL or missing references) //IL_03e6: Unknown result type (might be due to invalid IL or missing references) //IL_03eb: Unknown result type (might be due to invalid IL or missing references) //IL_041a: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Unknown result type (might be due to invalid IL or missing references) //IL_0466: Unknown result type (might be due to invalid IL or missing references) //IL_048c: Unknown result type (might be due to invalid IL or missing references) //IL_04b2: Unknown result type (might be due to invalid IL or missing references) //IL_04dc: Unknown result type (might be due to invalid IL or missing references) //IL_04e1: Unknown result type (might be due to invalid IL or missing references) //IL_04f8: Unknown result type (might be due to invalid IL or missing references) //IL_04fd: Unknown result type (might be due to invalid IL or missing references) //IL_0514: Unknown result type (might be due to invalid IL or missing references) //IL_0519: Unknown result type (might be due to invalid IL or missing references) //IL_054c: Unknown result type (might be due to invalid IL or missing references) //IL_0551: Unknown result type (might be due to invalid IL or missing references) //IL_0568: Unknown result type (might be due to invalid IL or missing references) //IL_056d: Unknown result type (might be due to invalid IL or missing references) if (SwanSongPlugin.fabricatorsLoaded) { AddDoubleChestSecrets(); } InteractableSpawnCard val = Addressables.LoadAssetAsync((object)RoR2_Base_ShrineCombat.iscShrineCombat_asset).WaitForCompletion(); InteractableSpawnCard val2 = Addressables.LoadAssetAsync((object)RoR2_Base_EquipmentBarrel.iscEquipmentBarrel_asset).WaitForCompletion(); InteractableSpawnCard spawnCard = Addressables.LoadAssetAsync((object)"RoR2/Base/DuplicatorLarge/iscDuplicatorLarge.asset").WaitForCompletion(); InteractableSpawnCard spawnCard2 = Addressables.LoadAssetAsync((object)"RoR2/Base/Chest2/iscChest2.asset").WaitForCompletion(); InteractableSpawnCard spawnCard3 = Addressables.LoadAssetAsync((object)"RoR2/Base/LunarChest/iscLunarChest.asset").WaitForCompletion(); InteractableSpawnCard spawnCard4 = InteractableBase.instance.customInteractable.spawnCard; InteractableSpawnCard spawnCard5 = null; InteractableSpawnCard spawnCard6 = null; InteractableSpawnCard spawnCard7 = null; InteractableSpawnCard spawnCard8 = null; SpawnSecret("ancientloft", (SpawnCard)(object)spawnCard, new Vector3(-86f, 29f, 34f)); SpawnSecret("ancientloft", (SpawnCard)(object)spawnCard2, new Vector3(-104f, 106f, 265f)); SpawnSecret("ancientloft", (SpawnCard)(object)spawnCard, new Vector3(-68f, 40f, -59f)); SpawnSecret("foggyswamp", (SpawnCard)(object)spawnCard, new Vector3(257f, 84f, -140f)); SpawnSecret("foggyswamp", (SpawnCard)(object)spawnCard, new Vector3(145f, -75f, -75f)); SpawnSecret("foggyswamp", (SpawnCard)(object)spawnCard, new Vector3(-108f, -104f, -138f)); SpawnSecret("foggyswamp", (SpawnCard)(object)spawnCard, new Vector3(-86f, 29f, 34f)); SpawnSecret("foggyswamp", (SpawnCard)(object)spawnCard2, new Vector3(-128f, -127f, 98f)); SpawnSecret("foggyswamp", (SpawnCard)(object)spawnCard3, new Vector3(-137f, -356f)); SpawnSecret("foggyswamp", (SpawnCard)(object)spawnCard4, new Vector3(258f, -150f, -170f), 0.3f); SpawnSecret("goolake", (SpawnCard)(object)spawnCard2, new Vector3(22f, -158f, -371f)); SpawnSecret("goolake", (SpawnCard)(object)spawnCard, new Vector3(-7f, -81f, -174f)); SpawnSecret("goolake", (SpawnCard)(object)spawnCard, new Vector3(221f, -100f, 296f)); SpawnSecret("goolake", (SpawnCard)(object)spawnCard5, new Vector3(351f, -78f, 108f)); SpawnSecret("goolake", (SpawnCard)(object)spawnCard, new Vector3(118f, -91f, -7f)); SpawnSecret("goolake", (SpawnCard)(object)spawnCard2, new Vector3(174f, -11f, -252f)); SpawnSemiRandom("wispgraveyard", (SpawnCard)(object)spawnCard5, (Vector3[])(object)new Vector3[4] { new Vector3(-412f, 6f, -20f), new Vector3(-418f, 6f, -67f), new Vector3(-383f, 6f, -102f), new Vector3(-421f, 6f, -39f) }); SpawnSecret("wispgraveyard", (SpawnCard)(object)spawnCard6, new Vector3(46f, 29f, -62f)); SpawnSemiRandom("frozenwall", (SpawnCard)(object)spawnCard7, (Vector3[])(object)new Vector3[3] { new Vector3(74f, 121f, 147f), new Vector3(66f, 115f, 109f), new Vector3(54f, 111f, 72f) }); SpawnSecret("frozenwall", (SpawnCard)(object)spawnCard8, new Vector3(0f, 34f, 5f)); SpawnSecret("sulfurpools", (SpawnCard)(object)spawnCard6, new Vector3(9f, -7f, -51f), 0.5f); SpawnSecret("sulfurpools", (SpawnCard)(object)spawnCard6, new Vector3(-155f, 27f, 46f), 0.5f); SpawnSecret("sulfurpools", (SpawnCard)(object)spawnCard6, new Vector3(176f, 28f, 45f), 0.5f); SpawnSecret("sulfurpools", (SpawnCard)(object)spawnCard6, new Vector3(94f, 22f, -133f), 0.5f); SpawnSemiRandom("sulfurpools", (SpawnCard)(object)spawnCard4, (Vector3[])(object)new Vector3[3] { new Vector3(23f, -35f, 65f), new Vector3(26f, -34f, 99f), new Vector3(28f, -34f, 36f) }); SpawnSemiRandom("sulfurpools", (SpawnCard)(object)spawnCard4, (Vector3[])(object)new Vector3[2] { new Vector3(173f, 2f, -154f), new Vector3(128f, 0f, -194f) }, 0.5f); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private static void AddDoubleChestSecrets() { //IL_001a: 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_006c: 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_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_0325: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0377: Unknown result type (might be due to invalid IL or missing references) //IL_03a0: Unknown result type (might be due to invalid IL or missing references) //IL_03c9: Unknown result type (might be due to invalid IL or missing references) //IL_03f2: Unknown result type (might be due to invalid IL or missing references) //IL_041b: Unknown result type (might be due to invalid IL or missing references) //IL_0443: Unknown result type (might be due to invalid IL or missing references) //IL_0448: Unknown result type (might be due to invalid IL or missing references) //IL_045e: Unknown result type (might be due to invalid IL or missing references) //IL_0463: Unknown result type (might be due to invalid IL or missing references) //IL_0479: Unknown result type (might be due to invalid IL or missing references) //IL_047e: Unknown result type (might be due to invalid IL or missing references) //IL_04b2: Unknown result type (might be due to invalid IL or missing references) //IL_04db: Unknown result type (might be due to invalid IL or missing references) //IL_0504: Unknown result type (might be due to invalid IL or missing references) //IL_052d: Unknown result type (might be due to invalid IL or missing references) //IL_0556: Unknown result type (might be due to invalid IL or missing references) //IL_057f: Unknown result type (might be due to invalid IL or missing references) SpawnSecret("golemplains", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(-109f, -100f, 42f)); SpawnSecret("golemplains", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(133f, -100f, 29f), 0.4f); SpawnSecret("golemplains", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(183f, -92f, -144f)); SpawnSecret("golemplains", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(100f, -155f, -342f), 0.4f); SpawnSemiRandom(posList: (Vector3[])(object)new Vector3[5] { new Vector3(139f, -119f, 194f), new Vector3(156f, -120f, -196f), new Vector3(152f, -112f, -222f), new Vector3(120f, -112f, -209f), new Vector3(89f, -116f, -192f) }, scene: "golemplains", spawnCard: (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard); SpawnSecret("golemplains2", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(-33f, 61f, -57f)); SpawnSecret("golemplains2", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(-77f, 54f, -102f)); SpawnSecret("golemplains2", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(-214f, 42f, -29f), 0.8f); SpawnSecret("golemplains2", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(141f, 60f, -4f), 0.4f); SpawnSecret("golemplains2", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(151f, 14f, -230f)); SpawnSecret("blackbeach", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(-23f, -175f, -387f)); SpawnSecret("blackbeach", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(93f, -125f, -299f)); SpawnSecret("blackbeach", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(31f, -213f, -120f)); SpawnSecret("blackbeach", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(-288f, -16f, -181f), 0.3f); SpawnSecret("blackbeach", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(-337f, -199f, -230f), 0.5f); SpawnSecret("blackbeach2", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(-101f, 28f, 11f), 0.8f); SpawnSecret("blackbeach2", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(-134f, 47f, -103f), 0.4f); SpawnSecret("blackbeach2", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(12f, 88f, -126f)); SpawnSecret("blackbeach2", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(117f, 65f, 151f)); SpawnSecret("snowyforest", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(-252f, 22f, 57f), 0.5f); SpawnSecret("snowyforest", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(24f, 67f, 2f)); SpawnSecret("snowyforest", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(-34f, 70f, -193f)); SpawnSecret("snowyforest", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(38f, 42f, -27f), 0.5f); SpawnSemiRandom(posList: (Vector3[])(object)new Vector3[3] { new Vector3(136f, 53f, 191f), new Vector3(92f, 41f, -32f), new Vector3(110f, 79f, 19f) }, scene: "snowyforest", spawnCard: (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard); SpawnSecret("ancientloft", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(165f, 62f, -31f), 0.8f); SpawnSecret("wispgraveyard", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(-22f, 59f, 286f)); SpawnSecret("frozenwall", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(87f, 82f, -250f), 0.5f); SpawnSecret("frozenwall", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(-104f, 35f, 49f)); SpawnSecret("frozenwall", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(196f, 25f, 32f)); SpawnSecret("sulfurpools", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(11f, -19f, 37f)); } public static void SpawnSecret(string scene, SpawnCard spawnCard, Vector3 pos, float chance = -1f) { //IL_0015: 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) if ((Object)(object)spawnCard == (Object)null) { return; } Stage.onStageStartGlobal += delegate(Stage self) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Expected O, but got Unknown //IL_00fc: 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_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Expected O, but got Unknown //IL_011d: 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_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Invalid comparison between Unknown and I4 Vector3 val = default(Vector3); SceneDef sceneDef = self.sceneDef; if (!((Object)(object)sceneDef == (Object)null) && !(self.sceneDef.cachedName != scene) && (chance == -1f || RollForSecret(chance))) { if (!CheckForGeometry(pos + new Vector3(0f, 2f, 0f))) { Debug.Log((object)"no floor!!"); } else { DirectorPlacementRule val2 = new DirectorPlacementRule { placementMode = (PlacementMode)0 }; if ((Object)(object)spawnCard == (Object)null) { Debug.Log((object)"spawncardnullwtf"); } if (val2 == null) { Debug.Log((object)"placementrulenulwtf"); } GameObject spawnedInstance = spawnCard.DoSpawn(pos, Quaternion.Euler(val), new DirectorSpawnRequest(spawnCard, val2, Run.instance.runRNG)).spawnedInstance; spawnedInstance.transform.eulerAngles = val; if (Object.op_Implicit((Object)(object)spawnedInstance)) { PurchaseInteraction component = spawnedInstance.GetComponent(); if (Object.op_Implicit((Object)(object)component) && (int)component.costType == 1) { component.Networkcost = Run.instance.GetDifficultyScaledCost(component.cost); } } NetworkServer.Spawn(spawnedInstance); } } }; } public static void SpawnSemiRandom(string scene, SpawnCard spawnCard, Vector3[] posList, float chance = -1f) { if ((Object)(object)spawnCard == (Object)null) { return; } Stage.onStageStartGlobal += delegate(Stage self) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_005a: 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_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Expected O, but got Unknown //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_0079: 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_0099: Expected O, but got Unknown //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Invalid comparison between Unknown and I4 Vector3 val = default(Vector3); if (!(self.sceneDef.cachedName != scene) && (chance == -1f || RollForSecret(chance))) { DirectorPlacementRule val2 = new DirectorPlacementRule { placementMode = (PlacementMode)0 }; GameObject spawnedInstance = spawnCard.DoSpawn(SemiRandomLocation(posList), Quaternion.Euler(val), new DirectorSpawnRequest(spawnCard, val2, Run.instance.runRNG)).spawnedInstance; spawnedInstance.transform.eulerAngles = val; if (Object.op_Implicit((Object)(object)spawnedInstance)) { PurchaseInteraction component = spawnedInstance.GetComponent(); if (Object.op_Implicit((Object)(object)component) && (int)component.costType == 1) { component.Networkcost = Run.instance.GetDifficultyScaledCost(component.cost); } } NetworkServer.Spawn(spawnedInstance); } }; } public static Vector3 SemiRandomLocation(Vector3[] locations) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0035: 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_003a: Unknown result type (might be due to invalid IL or missing references) int num = locations.Length; int num2 = Random.RandomRangeInt(0, num); Vector3 result = locations[num2]; bool flag = true; Debug.LogWarning((object)$"{num} spots, chose spot {num2}"); return result; } public static bool RollForSecret(float chance) { return Random.RandomRange(0f, 1f) < chance; } public static bool CheckForGeometry(Vector3 cords) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) return Physics.Raycast(cords, Vector3.down, 5f); } } internal static class Log { public static bool enableDebugging; internal static ManualLogSource _logSource; public static void DebugBreakpoint(string methodName, int breakpointNumber = -1) { string text = "SwanSongExtended: " + methodName + " IL hook failed!"; if (breakpointNumber >= 0) { text += $" (breakpoint {breakpointNumber})"; } Error(text); } internal static void Init(ManualLogSource logSource) { enableDebugging = ConfigManager.DualBindToConfig("Swan Song", Config.MyConfig, "Enable Debugging", defaultValue: false, "Enable debug outputs to the log for troubleshooting purposes. Enabling this will slow down the game."); _logSource = logSource; } internal static string Combine(params string[] parameters) { string text = "SwanSongExtended : "; foreach (string text2 in parameters) { text = text + text2 + " : "; } return text; } internal static void Debug(object data) { if (enableDebugging) { _logSource.LogDebug(data); } } internal static void Error(object data) { _logSource.LogError(data); } internal static void ErrorAssetBundle(string assetName, string bundleName) { Error("failed to load asset, " + assetName + ", because it does not exist in asset bundle, " + bundleName); } internal static void Fatal(object data) { _logSource.LogFatal(data); } internal static void Info(object data) { _logSource.LogInfo(data); } internal static void Message(object data) { _logSource.LogMessage(data); } internal static void Warning(object data) { _logSource.LogWarning(data); } } public abstract class SharedBase { public virtual bool lockEnabled { get; } = false; public abstract string ConfigName { get; } public virtual bool isEnabled { get; } = true; public static ManualLogSource Logger => Log._logSource; public abstract AssetBundle assetBundle { get; } public abstract void Hooks(); public abstract void Lang(); public virtual void Init() { ConfigManager.HandleConfigAttributes(GetType(), ConfigName, Config.MyConfig); Hooks(); Lang(); } public T Bind(T defaultValue, string configName, string configDesc = "") { return ConfigManager.DualBindToConfig(ConfigName, Config.MyConfig, configName, defaultValue, configDesc); } public static float GetHyperbolic(float firstStack, float cap, float chance) { if (firstStack >= cap) { return cap * (chance / firstStack); } float num = chance / firstStack; float num2 = 100f * firstStack / (cap - firstStack); return cap * (1f - 100f / (num * num2 + 100f)); } public static ExpansionDef SotvExpansionDef() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) return Addressables.LoadAssetAsync((object)"RoR2/DLC1/Common/DLC1.asset").WaitForCompletion(); } } public static class PersistentListeners { public static GameObject FixItemModel(this GameObject prefab) { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Expected O, but got Unknown //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Expected O, but got Unknown //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_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_00e4: 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_00f3: 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) if ((Object)(object)prefab == (Object)null) { prefab = Resources.Load("prefabs/NullModel"); } ModelPanelParameters val = prefab.AddComponent(); val.minDistance = 1f; val.maxDistance = 15f; Transform val2 = prefab.transform.Find("FocusPos"); if ((Object)(object)val2 == (Object)null) { GameObject val3 = new GameObject("FocusPos"); val2 = val3.transform; val2.parent = prefab.transform; val2.localPosition = Vector3.zero; } val.focusPointTransform = val2; Transform val4 = prefab.transform.Find("CameraPos"); if ((Object)(object)val4 == (Object)null) { GameObject val5 = new GameObject("CameraPos"); val4 = val5.transform; val4.parent = prefab.transform; val4.SetPositionAndRotation(val2.position + Vector3.forward * -7f + Vector3.right * -1f, val4.rotation); } val.cameraPositionTransform = val4; return prefab; } public static void AddPersistentListener(this HoldoutZoneControllerChargedUnityEvent unityEvent, UnityAction action) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Expected O, but got Unknown //IL_004c: 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) PersistentCallGroup persistentCalls = ((UnityEventBase)unityEvent).m_PersistentCalls; PersistentCall val = new PersistentCall(); ref Object target = ref val.m_Target; object? target2 = ((Delegate)(object)action).Target; target = (Object)((target2 is Object) ? target2 : null); val.m_TargetAssemblyTypeName = UnityEventTools.TidyAssemblyTypeName(((Delegate)(object)action).Method.DeclaringType.AssemblyQualifiedName); val.m_MethodName = ((Delegate)(object)action).Method.Name; val.m_CallState = (UnityEventCallState)2; val.m_Mode = (PersistentListenerMode)0; persistentCalls.AddListener(val); } public static void AddPersistentListener(this UnityEvent unityEvent, UnityAction action) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Expected O, but got Unknown //IL_004c: 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) PersistentCallGroup persistentCalls = ((UnityEventBase)unityEvent).m_PersistentCalls; PersistentCall val = new PersistentCall(); ref Object target = ref val.m_Target; object? target2 = ((Delegate)(object)action).Target; target = (Object)((target2 is Object) ? target2 : null); val.m_TargetAssemblyTypeName = UnityEventTools.TidyAssemblyTypeName(((Delegate)(object)action).Method.DeclaringType.AssemblyQualifiedName); val.m_MethodName = ((Delegate)(object)action).Method.Name; val.m_CallState = (UnityEventCallState)2; val.m_Mode = (PersistentListenerMode)0; persistentCalls.AddListener(val); } public static void AddPersistentListener(this UnityEvent unityEvent, UnityAction action) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Expected O, but got Unknown //IL_004c: 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) PersistentCallGroup persistentCalls = ((UnityEventBase)unityEvent).m_PersistentCalls; PersistentCall val = new PersistentCall(); ref Object target = ref val.m_Target; object? target2 = ((Delegate)(object)action).Target; target = (Object)((target2 is Object) ? target2 : null); val.m_TargetAssemblyTypeName = UnityEventTools.TidyAssemblyTypeName(((Delegate)(object)action).Method.DeclaringType.AssemblyQualifiedName); val.m_MethodName = ((Delegate)(object)action).Method.Name; val.m_CallState = (UnityEventCallState)2; val.m_Mode = (PersistentListenerMode)0; persistentCalls.AddListener(val); } public static void AddPersistentListener(this UnityEvent unityEvent, UnityAction action) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Expected O, but got Unknown //IL_004c: 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) PersistentCallGroup persistentCalls = ((UnityEventBase)unityEvent).m_PersistentCalls; PersistentCall val = new PersistentCall(); ref Object target = ref val.m_Target; object? target2 = ((Delegate)(object)action).Target; target = (Object)((target2 is Object) ? target2 : null); val.m_TargetAssemblyTypeName = UnityEventTools.TidyAssemblyTypeName(((Delegate)(object)action).Method.DeclaringType.AssemblyQualifiedName); val.m_MethodName = ((Delegate)(object)action).Method.Name; val.m_CallState = (UnityEventCallState)2; val.m_Mode = (PersistentListenerMode)0; persistentCalls.AddListener(val); } } public static class Tools { public static string modPrefix = string.Format("@{0}+{1}", "ArtificerExtended", "artiskillicons"); public static AssetBundle LoadAssetBundle(byte[] resourceBytes) { if (resourceBytes == null) { throw new ArgumentNullException("resourceBytes"); } return AssetBundle.LoadFromMemory(resourceBytes); } public static string GetModPrefix(this BaseUnityPlugin plugin, string bundleName) { return $"@{plugin.Info.Metadata.Name}+{bundleName}"; } internal static bool isLoaded(string modguid) { foreach (KeyValuePair pluginInfo in Chainloader.PluginInfos) { string key = pluginInfo.Key; PluginInfo value = pluginInfo.Value; if (key == modguid) { return true; } } return false; } internal static string ConvertDecimal(float d) { return d * 100f + "%"; } internal static void GetMaterial(GameObject model, string childObject, Color color, ref Material material, float scaleMultiplier = 1f, bool replaceAll = false) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Expected O, but got Unknown //IL_0092: Unknown result type (might be due to invalid IL or missing references) Renderer[] componentsInChildren = model.GetComponentsInChildren(); Renderer[] array = componentsInChildren; foreach (Renderer val in array) { Renderer val2 = val; if (string.Equals(((Object)val).name, childObject)) { if (color == Color.clear) { Object.Destroy((Object)(object)val); break; } if ((Object)(object)material == (Object)null) { material = new Material(val.material); material.mainTexture = val.material.mainTexture; material.shader = val.material.shader; material.color = color; } val.material = material; Transform transform = ((Component)val).transform; transform.localScale *= scaleMultiplier; if (!replaceAll) { break; } } } } internal static void DebugMaterial(GameObject model) { Renderer[] componentsInChildren = model.GetComponentsInChildren(); Renderer[] array = componentsInChildren; foreach (Renderer val in array) { Renderer val2 = val; Debug.Log((object)("Material: " + ((Object)val2).name.ToString())); } } internal static void GetParticle(GameObject model, string childObject, Color color, float sizeMultiplier = 1f, bool replaceAll = false) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) ParticleSystem[] componentsInChildren = model.GetComponentsInChildren(); ParticleSystem[] array = componentsInChildren; foreach (ParticleSystem val in array) { ParticleSystem val2 = val; MainModule main = val2.main; ColorOverLifetimeModule colorOverLifetime = val2.colorOverLifetime; ColorBySpeedModule colorBySpeed = val2.colorBySpeed; if (string.Equals(((Object)val2).name, childObject)) { ((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(color); ((MainModule)(ref main)).startSizeMultiplier = ((MainModule)(ref main)).startSizeMultiplier * sizeMultiplier; ((ColorOverLifetimeModule)(ref colorOverLifetime)).color = MinMaxGradient.op_Implicit(color); ((ColorBySpeedModule)(ref colorBySpeed)).color = MinMaxGradient.op_Implicit(color); if (!replaceAll) { break; } } } } internal static void DebugParticleSystem(GameObject model) { ParticleSystem[] components = model.GetComponents(); ParticleSystem[] array = components; foreach (ParticleSystem val in array) { ParticleSystem val2 = val; Debug.Log((object)("Particle: " + ((Object)val2).name.ToString())); } } internal static void GetLight(GameObject model, string childObject, Color color, bool replaceAll = false) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) Light[] componentsInChildren = model.GetComponentsInChildren(); Light[] array = componentsInChildren; foreach (Light val in array) { Light val2 = val; if (string.Equals(((Object)val2).name, childObject)) { val2.color = color; if (!replaceAll) { break; } } } } internal static void DebugLight(GameObject model) { Light[] componentsInChildren = model.GetComponentsInChildren(); Light[] array = componentsInChildren; foreach (Light val in array) { Light val2 = val; Debug.Log((object)("Light: " + ((Object)val2).name.ToString())); } } public static void ClearDotStacksForType(this DotController dotController, DotIndex dotIndex) { //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) for (int num = dotController.dotStackList.Count - 1; num >= 0; num--) { if (dotController.dotStackList[num].dotIndex == dotIndex) { dotController.RemoveDotStackAtServer(num); } } } public static void ApplyCooldownScale(GenericSkill skillSlot, float cooldownScale) { if ((Object)(object)skillSlot != (Object)null) { skillSlot.cooldownScale *= cooldownScale; } } public static int CountOverspillTriangular(float totalValue, float incrementor = 1f) { int num = 0; while (totalValue > 0f) { num++; totalValue -= incrementor * (float)num; } return num; } public static int CountOverspillFibonacci(float totalValue, float thresholdScale = 1f, int startingIndex = 1) { int num = 1; int num2 = 1; int num3 = 0; while (totalValue > (float)num2 * thresholdScale) { num2 += num; num = num2 - num; if (num3 > startingIndex) { num3++; } } return num3; } } } namespace SwanSongExtended.Storms { [RequireComponent(typeof(EntityStateMachine), typeof(CombatDirector))] public class StormController : MonoBehaviour { public enum StormState { Idle, Approaching, ApproachWarning, Active } internal abstract class BaseStormState : BaseState { private float runDeltaTimeThisFrame = 0f; private float runTimeStamp = float.NegativeInfinity; public abstract StormState stormState { get; } private protected StormType stormType => StormRunBehavior.instance.stormType; private protected StormController stormController { get; private set; } public override void OnEnter() { Debug.Log((object)stormState.ToString()); ((BaseState)this).OnEnter(); if (runTimeStamp == float.NegativeInfinity) { runTimeStamp = Run.instance.GetRunStopwatch(); } stormController = ((EntityState)this).GetComponent(); } public float GetRunDeltaTime() { return runDeltaTimeThisFrame; } public override void FixedUpdate() { if (Object.op_Implicit((Object)(object)Run.instance)) { runDeltaTimeThisFrame = Run.instance.GetRunStopwatch() - runTimeStamp; ((EntityState)this).fixedAge = ((EntityState)this).fixedAge + runDeltaTimeThisFrame; runTimeStamp = Run.instance.GetRunStopwatch(); } if (stormState >= StormState.ApproachWarning && Object.op_Implicit((Object)(object)TeleporterInteraction.instance)) { if (Object.op_Implicit((Object)(object)TeleporterInteraction.instance)) { stormController.SetShelterObjective(!TeleporterInteraction.instance.isCharging); } } else { stormController.SetShelterObjective(enable: false); } } public void EnableDirector() { bool flag = true; Debug.LogError((object)"StormController: Combat Director null!"); } public float GetStormIntensityIncrement() { if (!DifficultyUtilsModule.ValidateCachedDifficultyStats()) { return 0f; } return DifficultyUtilsModule.cachedDifficultyStats.stormIntensifyStrength_ForSwanSong; } public virtual void SetNextState() { BaseStormState nextState = GetNextState(); nextState.runTimeStamp = runTimeStamp; nextState.runDeltaTimeThisFrame = runDeltaTimeThisFrame; ((EntityState)this).outer.SetNextState((EntityState)(object)nextState); } public abstract BaseStormState GetNextState(); } internal class StormActive : BaseStormState { private List meteorsToDetonate; private List meteorWaves; private float waveTimer; private float stormStrength = 0f; private float stormStrengthIncreaseCountdown = 0f; public override StormState stormState => StormState.Active; public override BaseStormState GetNextState() { return new IdleState(); } public override void OnEnter() { base.OnEnter(); if (!Object.op_Implicit((Object)(object)Run.instance)) { SetNextState(); } else if (NetworkServer.active) { BroadcastStormActiveMessage(base.stormType); WishboneCarcassComponent.ClearAllCarcasses(); stormStrengthIncreaseCountdown = 90f; meteorsToDetonate = new List(); meteorWaves = new List(); EnableDirector(); } } public override void OnExit() { ((EntityState)this).OnExit(); } public override void FixedUpdate() { //IL_011a: 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_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Expected O, but got Unknown base.FixedUpdate(); if (!NetworkServer.active) { return; } stormStrengthIncreaseCountdown -= GetRunDeltaTime(); if (stormStrengthIncreaseCountdown <= 0f && Object.op_Implicit((Object)(object)Run.instance)) { stormStrengthIncreaseCountdown += 90f; stormStrength += GetStormIntensityIncrement(); BroadcastStormIntensifyMessage(base.stormType); } waveTimer -= Time.fixedDeltaTime; if (waveTimer <= 0f) { waveTimer = Random.Range(StormsCore.waveMinInterval, StormsCore.waveMaxInterval) / (1f + stormStrength); MeteorWave val = new MeteorWave(CharacterBody.readOnlyInstancesList.Where((CharacterBody body) => ((int)body.teamComponent.teamIndex == 1 && !body.isFlying) || StormsCore.IsCharacterStormElite(body) || Util.CheckRoll(StormsCore.meteorTargetEnemyChance, 0f, (CharacterMaster)null)).ToArray(), Object.op_Implicit((Object)(object)TeleporterInteraction.instance) ? ((Component)TeleporterInteraction.instance).transform.position : ((EntityState)this).transform.position); val.hitChance = 1f - StormsCore.waveMissChance; meteorWaves.Add(val); meteorWaves.Add(val); AddShelterPerimeterStrikes(); AddCharacterTargetedStrikes(); } } private void AddCharacterTargetedStrikes() { //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Expected O, but got Unknown for (int num = meteorWaves.Count - 1; num >= 0; num--) { MeteorWave val = meteorWaves[num]; val.timer -= GetRunDeltaTime(); if (val.timer <= 0f) { val.timer = Random.Range(0.05f, 1f); Meteor nextMeteor = val.GetNextMeteor(); if (!GetMeteorViable(nextMeteor)) { meteorWaves.RemoveAt(num); } else { SpawnMeteor(nextMeteor); meteorsToDetonate.Add(nextMeteor); EffectManager.SpawnEffect(StormsCore.meteorWarningEffectPrefab, new EffectData { origin = nextMeteor.impactPosition, scale = StormsCore.meteorBlastRadius }, true); } } } } private void AddShelterPerimeterStrikes() { //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_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_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: 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_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Expected O, but got Unknown //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: 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_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_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_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0173: 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_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) RaycastHit val4 = default(RaycastHit); foreach (ShelterProviderBehavior readOnlyInstances in ShelterProviderBehavior.readOnlyInstancesList) { if (readOnlyInstances.fallbackRadius <= 1f) { continue; } if (readOnlyInstances.isHazardZone) { float num = 3f * readOnlyInstances.fallbackRadius * readOnlyInstances.fallbackRadius; continue; } float num2 = 6f * readOnlyInstances.fallbackRadius; float num3 = num2 / (StormsCore.meteorBlastRadius * StormsCore.shelterPerimeterStrikeGap); float num4 = num3 - (float)Math.Truncate(num3); if (Util.CheckRoll0To1(num4, 0f, (CharacterMaster)null)) { Mathf.CeilToInt(num3); } else { Mathf.FloorToInt(num3); } for (int i = 0; (float)i < num3; i++) { float num5 = Random.Range(0f, 2f); float num6 = readOnlyInstances.fallbackRadius + StormsCore.meteorBlastRadius * num5; Vector2 insideUnitCircle = Random.insideUnitCircle; Vector2 normalized = ((Vector2)(ref insideUnitCircle)).normalized; Vector3 val = new Vector3(normalized.x, 0f, normalized.y) * num6; Meteor val2 = new Meteor(); val2.startTime = Run.instance.time; val2.impactPosition = ((Component)readOnlyInstances).transform.position + val; Vector3 val3 = val2.impactPosition + Vector3.up * 6f; Vector3 onUnitSphere = Random.onUnitSphere; onUnitSphere.y = -1f; if (Physics.Raycast(val3, onUnitSphere, ref val4, 12f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1)) { val2.impactPosition = ((RaycastHit)(ref val4)).point; } else if (Physics.Raycast(val2.impactPosition, Vector3.down, ref val4, float.PositiveInfinity, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1)) { val2.impactPosition = ((RaycastHit)(ref val4)).point; } else { val2.valid = false; } if (GetMeteorViable(val2)) { SpawnMeteor(val2); } } } } private void SpawnMeteor(Meteor meteor) { //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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_0104: 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) if (!NetworkServer.active) { return; } GameObject val = Object.Instantiate(LegacyResourcesAPI.Load("Prefabs/NetworkedObjects/GenericDelayBlast"), meteor.impactPosition, Quaternion.identity); val.transform.localScale = Vector3.one * StormsCore.meteorBlastRadius; DelayBlast component = val.GetComponent(); int num = 1; if (Object.op_Implicit((Object)(object)Run.instance)) { num = Run.instance.ambientLevelFloor; } if (Object.op_Implicit((Object)(object)component)) { component.position = meteor.impactPosition; component.baseDamage = StormsCore.meteorBlastDamageCoefficient * (1f + StormsCore.meteorBlastDamageScalarPerLevel * (float)num); component.baseForce = StormsCore.meteorBlastForce; component.attacker = ((EntityState)this).gameObject; component.radius = StormsCore.meteorBlastRadius; component.crit = false; component.procCoefficient = 0f; component.maxTimer = StormsCore.meteorImpactDelay; component.falloffModel = StormsCore.meteorFalloffModel; component.explosionEffect = StormsCore.meteorImpactEffectPrefab; component.delayEffect = StormsCore.meteorWarningEffectPrefab; component.damageType = DamageTypeCombo.op_Implicit((DamageType)0); TeamFilter component2 = val.GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { component2.teamIndex = (TeamIndex)2; } } } private bool GetMeteorViable(Meteor nextMeteor) { //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_0025: Unknown result type (might be due to invalid IL or missing references) if (nextMeteor == null) { return false; } if (!nextMeteor.valid) { return false; } Vector3 impactPosition = nextMeteor.impactPosition; if (ShelterUtilsModule.IsPositionSheltered(impactPosition, StormsCore.meteorBlastRadius)) { return false; } return true; } private void DetonateMeteor(Meteor meteor) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //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: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0081: 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_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) int num = 1; if (Object.op_Implicit((Object)(object)Run.instance)) { num = Run.instance.ambientLevelFloor; } EffectData val = new EffectData { origin = meteor.impactPosition }; EffectManager.SpawnEffect(StormsCore.meteorImpactEffectPrefab, val, true); BlastAttack val2 = new BlastAttack { inflictor = ((EntityState)this).gameObject, baseDamage = StormsCore.meteorBlastDamageCoefficient * (1f + StormsCore.meteorBlastDamageScalarPerLevel * (float)num), baseForce = StormsCore.meteorBlastForce, attackerFiltering = (AttackerFiltering)0, crit = false, falloffModel = StormsCore.meteorFalloffModel, attacker = ((EntityState)this).gameObject, bonusForce = Vector3.zero, damageColorIndex = (DamageColorIndex)11, position = meteor.impactPosition, procChainMask = default(ProcChainMask), procCoefficient = 0f, teamIndex = (TeamIndex)2, radius = StormsCore.meteorBlastRadius }; DamageAPI.AddModdedDamageType(val2, StormsCore.stormDamageType); val2.Fire(); } private Meteor MeteorWave_GetNextMeteor(orig_GetNextMeteor orig, MeteorWave self) { //IL_000d: 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) Meteor val = orig.Invoke(self); if (val != null && val.impactPosition == self.targets[self.currentStep].corePosition) { return null; } return val; } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)9; } } internal class StormWarning : BaseStormState { private Dictionary hudPanels; public override StormState stormState => StormState.ApproachWarning; public override BaseStormState GetNextState() { if (!NetworkServer.active) { return new IdleState(); } return new StormActive(); } public override void OnEnter() { hudPanels = new Dictionary(); base.OnEnter(); foreach (HUD readOnlyInstance in HUD.readOnlyInstanceList) { SetHudCountdownEnabled(readOnlyInstance, (Object)(object)readOnlyInstance.targetBodyObject != (Object)null); } SetCountdownTime(Mathf.Max(0f, base.stormController.stormWarningTime - ((EntityState)this).fixedAge)); BroadcastStormWarningMessage(base.stormType); } public override void OnExit() { ((EntityState)this).OnExit(); foreach (HUD readOnlyInstance in HUD.readOnlyInstanceList) { SetHudCountdownEnabled(readOnlyInstance, shouldEnableCountdownPanel: false); } } public override void FixedUpdate() { base.FixedUpdate(); if (((EntityState)this).fixedAge >= base.stormController.stormWarningTime) { SetNextState(); } if (base.stormType == StormType.None || !Object.op_Implicit((Object)(object)Run.instance)) { if (hudPanels.Count <= 0) { return; } { foreach (HUD readOnlyInstance in HUD.readOnlyInstanceList) { SetHudCountdownEnabled(readOnlyInstance, shouldEnableCountdownPanel: false); } return; } } foreach (HUD readOnlyInstance2 in HUD.readOnlyInstanceList) { SetHudCountdownEnabled(readOnlyInstance2, (Object)(object)readOnlyInstance2.targetBodyObject != (Object)null); } SetCountdownTime(Mathf.Max(0f, base.stormController.stormWarningTime - ((EntityState)this).fixedAge)); } private void SetHudCountdownEnabled(HUD hud, bool shouldEnableCountdownPanel) { shouldEnableCountdownPanel &= ((Behaviour)((EntityState)this).outer).enabled; if (hudPanels.TryGetValue(hud, out var value) == shouldEnableCountdownPanel) { return; } if (shouldEnableCountdownPanel && base.stormType != 0) { Transform obj = ((Component)hud).GetComponent().FindChild("TopCenterCluster"); RectTransform val = (RectTransform)(object)((obj is RectTransform) ? obj : null); if (Object.op_Implicit((Object)(object)val)) { GameObject val2 = Object.Instantiate(LegacyResourcesAPI.Load("Prefabs/UI/HudModules/HudCountdownPanel"), (Transform)(object)val); LanguageTextMeshController componentInChildren = val2.GetComponentInChildren(); componentInChildren._token = "OBJECTIVE_" + base.stormType.ToString().ToUpper() + "_2R4R"; componentInChildren.token = "OBJECTIVE_" + base.stormType.ToString().ToUpper() + "_2R4R"; hudPanels[hud] = val2; } } else { Object.Destroy((Object)(object)value); hudPanels.Remove(hud); } } private void SetCountdownTime(double secondsRemaining) { foreach (KeyValuePair hudPanel in hudPanels) { hudPanel.Value.GetComponent().seconds = secondsRemaining; } } public override void Update() { ((EntityState)this).Update(); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)9; } } internal class StormApproach : BaseStormState { public override StormState stormState => StormState.Approaching; public override BaseStormState GetNextState() { if (base.stormType > StormType.None) { if (base.stormController.stormWarningTime > 0f) { return new StormWarning(); } return new StormActive(); } return new IdleState(); } public override void OnEnter() { base.OnEnter(); } public override void FixedUpdate() { base.FixedUpdate(); if (((EntityState)this).fixedAge >= base.stormController.stormDelayTime) { SetNextState(); } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)9; } } internal class IdleState : BaseStormState { public override StormState stormState => StormState.Idle; public override BaseStormState GetNextState() { return new IdleState(); } } private CombatDirector combatDirector; public EntityStateMachine mainStateMachine; internal float stormDelayTime = 0f; internal float stormWarningTime = 0f; private bool shelterObjectiveActive = false; public StormState stormState { get { if (currentState == null) { return StormState.Idle; } return currentState.stormState; } } private BaseStormState currentState => mainStateMachine.state as BaseStormState; protected List holdoutZones => StormRunBehavior.holdoutZones; public void Awake() { combatDirector = ((Component)this).GetComponent(); ((Behaviour)combatDirector).enabled = false; mainStateMachine = ((Component)this).GetComponent(); } private void OnDestroy() { SetShelterObjective(enable: false); } public void SetShelterObjective(bool enable) { if (enable) { if (!shelterObjectiveActive) { Log.Debug("Enabling storm shelter objective"); ObjectivePanelController.collectObjectiveSources += OnCollectObjectiveSources; shelterObjectiveActive = true; } } else if (shelterObjectiveActive) { Log.Debug("Disabling storm shelter objective"); ObjectivePanelController.collectObjectiveSources -= OnCollectObjectiveSources; shelterObjectiveActive = false; } } private void OnCollectObjectiveSources(CharacterMaster master, List objectiveSourcesList) { //IL_0004: 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) objectiveSourcesList.Add(new ObjectiveSourceDescriptor { master = master, objectiveType = typeof(StormObjectiveTracker), source = (Object)(object)((Component)this).gameObject }); } public void BeginStormApproach(float stormDelayTime, float stormWarningTime) { this.stormDelayTime = stormDelayTime * 60f; this.stormWarningTime = stormWarningTime * 60f; Log.Debug("Starting storm approach"); mainStateMachine.SetNextState((EntityState)(object)new StormApproach()); } public void ForceBeginStorm() { if (stormState < StormState.ApproachWarning) { mainStateMachine.SetNextState((EntityState)(object)new StormWarning()); } } public static void BroadcastStormWarningMessage(StormType stormType) { if (NetworkServer.active) { string text = ""; switch (stormType) { case StormType.MeteorDefault: text = "A meteor storm is approaching..."; break; case StormType.Lightning: text = "A storm approaches..."; break; case StormType.Fire: text = "A meteor storm is approaching..."; break; case StormType.Cold: text = "The air around you begins to freeze..."; break; } Chat.ServerAttemptBroadcastChat(text); } } public static void BroadcastStormActiveMessage(StormType stormType) { if (NetworkServer.active) { string text = ""; if (stormType == StormType.MeteorDefault) { text = "A shower of meteors begins to fall..."; } Chat.ServerAttemptBroadcastChat(text); } } public static void BroadcastStormIntensifyMessage(StormType stormType) { string text = ""; if (stormType == StormType.MeteorDefault) { text = "The storm intensifies..."; } Chat.ServerAttemptBroadcastChat(text); } } public class StormObjectiveTracker : ObjectiveTracker { public StormObjectiveTracker() { base.baseToken = "OBJECTIVE_SHELTER"; } } public class StormRunBehavior : MonoBehaviour { public static List holdoutZones = new List(); public static StormRunBehavior instance; public StormController stormControllerInstance; public StormType stormType { get; private set; } = StormType.None; public bool hasBegunStorm { get { if ((Object)(object)stormControllerInstance == (Object)null) { return false; } if (stormControllerInstance.stormState >= StormController.StormState.Active) { return true; } return false; } } public static StormType GetStormType(SceneDef currentScene) { StormType result = StormType.None; if (IsStormStage(currentScene)) { string baseSceneName = currentScene.baseSceneName; string text = baseSceneName; result = StormType.MeteorDefault; } return result; } public static bool IsStormStage(SceneDef currentScene) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 if ((int)currentScene.sceneType != 1) { return false; } if (currentScene.isFinalStage) { return false; } if (currentScene.sceneAddress == SceneCatalog.GetSceneDefFromSceneName("conduitcanyon").sceneAddress) { return false; } return true; } public void Start() { if ((Object)(object)instance != (Object)null && (Object)(object)instance != (Object)(object)this) { Object.Destroy((Object)(object)this); return; } instance = this; Stage.onStageStartGlobal += OnStageBeginGlobal; } private void OnStageBeginGlobal(Stage obj) { stormType = GetStormType(obj.sceneDef); if (stormType == StormType.None || !DifficultyUtilsModule.ValidateCachedDifficultyStats()) { return; } float num = DifficultyUtilsModule.cachedDifficultyStats.desiredStormTime_ForSwanSong; float desiredStormWarningTime_ForSwanSong = DifficultyUtilsModule.cachedDifficultyStats.desiredStormWarningTime_ForSwanSong; if (num != -1f) { GameObject val = Object.Instantiate(StormsCore.StormsControllerPrefab); stormControllerInstance = val.GetComponent(); if (Run.instance.stageClearCount == 0 && DifficultyUtilsModule.cachedDifficultyStats.delayFirstStorm_ForSwanSong) { num += 1f; } num += Run.instance.stageRng.RangeFloat(0f, 0.5f); stormControllerInstance.BeginStormApproach(num, desiredStormWarningTime_ForSwanSong); if (NetworkServer.active) { WishboneCarcass.ScatterWishbones(); } } } public void OnDestroy() { if ((Object)(object)instance == (Object)(object)this) { Stage.onStageStartGlobal -= OnStageBeginGlobal; } } } public static class StormsCore { public static bool stormsEnabled = true; public const string stormShelterObjectiveToken = "OBJECTIVE_SHELTER"; public const string wishboneObjectiveToken = "OBJECTIVE_WISHBONE"; public static GameObject StormsRunBehaviorPrefab; public static GameObject StormsControllerPrefab; public static EliteTierDef StormEliteT1; public static EliteTierDef StormEliteT2; public const float drizzleStormDelayMinutes = 10f; public const float drizzleStormWarningMinutes = 3f; public const float rainstormStormDelayMinutes = 7f; public const float rainstormStormWarningMinutes = 2f; public const float monsoonStormDelayMinutes = 4f; public const float monsoonStormWarningMinutes = 1f; public const float stormMaxRandomDelayMinutes = 0.5f; public const float firstStageStormDelayMinutes = 1f; public const float stormStrengthIncreaseTimerSeconds = 90f; public const float stormStrengthIncreasePerDifficulty = 0.15f; public const float stormStrengthIncreaseBase = 0.1f; public static GameObject meteorDelayBlastPrefab; public static GameObject meteorWarningEffectPrefab = Addressables.LoadAssetAsync((object)RoR2_Base_Meteor.MeteorStrikePredictionEffect_prefab).WaitForCompletion(); public static GameObject meteorImpactEffectPrefab = Addressables.LoadAssetAsync((object)RoR2_Base_Meteor.MeteorStrikeImpact_prefab).WaitForCompletion(); public static float waveMinInterval = 0.7f; public static float waveMaxInterval = 1f; public static float waveMissChance = 0.6f; public static float meteorTargetEnemyChance = 15f; public static float meteorTravelEffectDuration = 0f; public static float meteorImpactDelay = 2.5f; public static float meteorBlastDamageCoefficient = 13f; public static float meteorBlastDamageScalarPerLevel = 0.5f; public static float meteorBlastRadius = 10f; public static float meteorBlastForce = 0f; public static float shelterPerimeterStrikeGap = 20f; public static FalloffModel meteorFalloffModel = (FalloffModel)0; public static ModdedDamageType stormDamageType; public static bool IsCharacterStormElite(CharacterBody body) { return false; } public static void Init() { //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) ShelterUtilsModule.UseGlobalShelters = true; RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(AddDifficultyStats)); stormDamageType = DamageAPI.ReserveDamageType(); CreateStormEliteTiers(); CreateStormsRunBehaviorPrefab(); LanguageAPI.Add("OBJECTIVE_SHELTER", "Seek shelter from the Storm!"); LanguageAPI.Add("OBJECTIVE_WISHBONE", "Collect Wishbones"); SwanSongPlugin.LoadAsync(RoR2_Base_Common.GenericDelayBlast_prefab, (Action)CreateMeteorDelayBlast); LanguageAPI.Add("OBJECTIVE_METEORDEFAULT_2R4R", "Meteor Storm Imminent"); LanguageAPI.Add("OBJECTIVE_LIGHTNING_2R4R", "Thunderstorm Imminent"); LanguageAPI.Add("OBJECTIVE_FIRE_2R4R", "Fire Storm Imminent"); LanguageAPI.Add("OBJECTIVE_COLD_2R4R", "Blizzard Imminent"); } private static void CreateMeteorDelayBlast(GameObject delayBlastPrefab) { meteorDelayBlastPrefab = PrefabAPI.InstantiateClone(delayBlastPrefab, "StormStrikeDelayBlastProjectile", true); NetworkIdentity val = default(NetworkIdentity); if (meteorDelayBlastPrefab.TryGetComponent(ref val)) { val.localPlayerAuthority = true; } SwanSongPlugin.LoadAsync(RoR2_Base_Meteor.MeteorStrikePredictionEffect_prefab, (Action)delegate(GameObject predictionEffect) { //IL_003c: 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_0141: Unknown result type (might be due to invalid IL or missing references) meteorWarningEffectPrefab = PrefabAPI.InstantiateClone(predictionEffect, "StormStrikePredictionEffect"); meteorWarningEffectPrefab.transform.localScale = new Vector3(meteorBlastRadius * 0.85f, meteorBlastRadius * 5f, meteorBlastRadius * 0.85f); DestroyOnTimer component = meteorWarningEffectPrefab.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.duration = meteorImpactDelay + 1f; } Transform val2 = meteorWarningEffectPrefab.transform.Find("GroundSlamIndicator"); if (Object.op_Implicit((Object)(object)val2)) { AnimateShaderAlpha component2 = ((Component)val2).GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { component2.timeMax = meteorImpactDelay + 0.1f; } MeshRenderer component3 = ((Component)val2).GetComponent(); if (Object.op_Implicit((Object)(object)component3)) { Material val3 = Object.Instantiate(((Renderer)component3).material); ((Object)val3).name = "matStormStrikeImpactIndicator"; ((Renderer)component3).material = val3; val3.SetFloat("_Boost", 0.64f); val3.SetFloat("_AlphaBoost", 4.29f); val3.SetTexture("_RemapTex", Addressables.LoadAssetAsync((object)"RoR2/Base/Common/ColorRamps/texRampArtifactShellSoft.png").WaitForCompletion()); val3.SetColor("_TintColor", Color.white); } } Content.CreateAndAddEffectDef(meteorWarningEffectPrefab); }); } private static void AddDifficultyStats() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0013: 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_002d: 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_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected I4, but got Unknown //IL_0049: 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_007b: 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_00dd: 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) for (int i = 0; i < 11; i++) { DifficultyIndex val = (DifficultyIndex)i; DifficultyDef difficultyDef = DifficultyCatalog.GetDifficultyDef(val); StartingDifficulty val2 = (StartingDifficulty)0; float num = -1f; float num2 = -1f; float num3 = -1f; bool delayFirstStorm_ForSwanSong = true; DifficultyIndex val3 = val; DifficultyIndex val4 = val3; switch ((int)val4) { case 0: val2 = (StartingDifficulty)0; num = 10f; num2 = 3f; num3 = 0.25f; break; case 1: val2 = (StartingDifficulty)3; num = 7f; num2 = 2f; num3 = 0.4f; break; case 2: val2 = (StartingDifficulty)6; num = 4f; num2 = 1f; num3 = 0.55f; break; default: val2 = (StartingDifficulty)6; num = 4f; num2 = 1f; num3 = 0.55f; break; } MoreDifficultyStats moreDifficultyStats = DifficultyUtilsModule.GetMoreDifficultyStats(val); moreDifficultyStats.desiredStormTime_ForSwanSong = num; moreDifficultyStats.desiredStormWarningTime_ForSwanSong = num2; moreDifficultyStats.delayFirstStorm_ForSwanSong = delayFirstStorm_ForSwanSong; moreDifficultyStats.stormIntensifyStrength_ForSwanSong = num3; DifficultyUtilsModule.difficultyCustomStats[val] = moreDifficultyStats; } } private static void RegisterHoldoutZone(orig_OnEnable orig, HoldoutZoneController self) { orig.Invoke(self); if (!StormRunBehavior.holdoutZones.Contains(self)) { StormRunBehavior.holdoutZones.Add(self); } } private static void UnregisterHoldoutZone(orig_OnDisable orig, HoldoutZoneController self) { orig.Invoke(self); if (StormRunBehavior.holdoutZones.Contains(self)) { StormRunBehavior.holdoutZones.Remove(self); } } private static void CreateStormEliteTiers() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Expected O, but got Unknown StormEliteT1 = new EliteTierDef(); StormEliteT1.costMultiplier = 2f; StormEliteT1.canSelectWithoutAvailableEliteDef = false; StormEliteT1.isAvailable = (EliteRules rules) => (int)rules == 0 && Object.op_Implicit((Object)(object)StormRunBehavior.instance) && StormRunBehavior.instance.hasBegunStorm; StormEliteT1.eliteTypes = (EliteDef[])(object)new EliteDef[0]; StormEliteT2 = new EliteTierDef(); StormEliteT2.costMultiplier = 2f; StormEliteT2.canSelectWithoutAvailableEliteDef = false; StormEliteT2.isAvailable = (EliteRules rules) => ((int)rules == 0 && Object.op_Implicit((Object)(object)StormRunBehavior.instance) && StormRunBehavior.instance.hasBegunStorm && !SwanSongPlugin.is2R4RLoaded) ? (Run.instance.loopClearCount > 0) : ((Run.instance.stageClearCount >= 10 && (int)rules == 0 && (int)Run.instance.selectedDifficulty <= 0) || (Run.instance.stageClearCount >= 5 && (int)rules == 0 && (int)Run.instance.selectedDifficulty == 1) || (Run.instance.stageClearCount >= 3 && (int)rules == 0 && (int)Run.instance.selectedDifficulty == 2) || (Run.instance.stageClearCount >= 3 && (int)rules == 0 && (int)Run.instance.selectedDifficulty > 2)); StormEliteT2.eliteTypes = (EliteDef[])(object)new EliteDef[0]; } private static void CreateStormsRunBehaviorPrefab() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) StormsRunBehaviorPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)"RoR2/DLC1/Common/DLC1RunBehavior.prefab").WaitForCompletion(), "2R4RExpansionRunBehavior", true); ExpansionRequirementComponent component = StormsRunBehaviorPrefab.GetComponent(); component.requiredExpansion = SwanSongPlugin.expansionDefSS2; StormsRunBehaviorPrefab.AddComponent(); SwanSongPlugin.expansionDefSS2.runBehaviorPrefab = StormsRunBehaviorPrefab; StormsControllerPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)"RoR2/Base/Common/Director.prefab").WaitForCompletion(), "2R4RStormController", true); MonoBehaviour[] componentsInChildren = StormsControllerPrefab.GetComponentsInChildren(); bool flag = false; MonoBehaviour[] array = componentsInChildren; foreach (MonoBehaviour val in array) { CombatDirector val2 = (CombatDirector)(object)((val is CombatDirector) ? val : null); if (val2 != null && !flag) { val2.creditMultiplier = 0.5f; val2.expRewardCoefficient = 1f; val2.goldRewardCoefficient = 1f; val2.minRerollSpawnInterval = 15f; val2.maxRerollSpawnInterval = 25f; val2.teamIndex = (TeamIndex)2; flag = true; ((UnityEvent)(object)val2.onSpawnedServer).AddListener((UnityAction)OnStormDirectorSpawnServer); } else { Object.DestroyImmediate((Object)(object)val); } } EntityStateMachine val3 = StormsControllerPrefab.AddComponent(); val3.initialStateType = new SerializableEntityStateType(typeof(StormController.StormApproach)); val3.mainStateType = new SerializableEntityStateType(typeof(StormController.StormApproach)); StormsControllerPrefab.AddComponent(); StormsControllerPrefab.AddComponent(); StormsControllerPrefab.AddComponent().stateMachines = (EntityStateMachine[])(object)new EntityStateMachine[1] { val3 }; Content.AddNetworkedObjectPrefab(StormsRunBehaviorPrefab); Content.AddNetworkedObjectPrefab(StormsControllerPrefab); Content.AddEntityState(typeof(StormController.IdleState)); Content.AddEntityState(typeof(StormController.StormApproach)); Content.AddEntityState(typeof(StormController.StormWarning)); Content.AddEntityState(typeof(StormController.StormActive)); static void OnStormDirectorSpawnServer(GameObject masterObject) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Invalid comparison between Unknown and I4 //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) EliteDef eliteDef = T1EliteEquipmentBase.instance.EliteDef; if (Util.CheckRoll(50f, 0f, (CharacterMaster)null)) { eliteDef = T1EliteEquipmentBase.instance.EliteDef; } EquipmentIndex val4 = (EquipmentIndex)(-1); if ((Object)(object)eliteDef != (Object)null) { EquipmentDef eliteEquipmentDef = eliteDef.eliteEquipmentDef; val4 = (EquipmentIndex)((!((Object)(object)eliteEquipmentDef != (Object)null)) ? (-1) : ((int)eliteEquipmentDef.equipmentIndex)); } CharacterMaster component2 = masterObject.GetComponent(); GameObject bodyObject = component2.GetBodyObject(); if (Object.op_Implicit((Object)(object)bodyObject)) { EntityStateMachine[] components = bodyObject.GetComponents(); foreach (EntityStateMachine val5 in components) { val5.initialStateType = val5.mainStateType; } } if ((int)val4 != -1) { Log.Warning("Spawning Storm Elite: " + ((Object)eliteDef).name); component2.inventory.SetEquipmentIndex(val4); } } } } public enum StormType { None, MeteorDefault, Lightning, Fire, Cold } } namespace SwanSongExtended.Modules { public static class CommonAssets { private static AssetBundle _mainAssetBundle; private static AssetBundle _retierAssetBundle; public static string dropPrefabsPath = "Assets/Models/DropPrefabs"; public static string iconsPath = "Assets/Textures/Icons/"; public static string eliteMaterialsPath = "Assets/Textures/Materials/Elite/"; public static BuffDef gestureQueueEquipBreak; public static BuffDef brittleCrownCursePurchase; public static string executeKeywordToken = "DUCK_EXECUTION_KEYWORD"; public static BuffDef razorChargeBuff; public static BuffDef hauntDebuff; public static GameObject hauntEffectPrefab; public static BuffDef harpoonDebuff; public static GameObject harpoonEffectPrefab; public static GameObject squidBlasterBall; public static GameObject squidBlasterBallGhost; public static float survivorExecuteThreshold = 0.15f; public static float banditExecutionThreshold = 0.1f; public static float harvestExecutionThreshold = 0.2f; public static BuffDef bossHunterDebuffWithScalpel; public static BuffDef combatTelescopeCritChance; public static GameObject meatballNapalmPool; public static AssetBundle mainAssetBundle { get { if ((Object)(object)_mainAssetBundle == (Object)null) { _mainAssetBundle = Assets.LoadAssetBundle("itmightbebad"); } return _mainAssetBundle; } set { _mainAssetBundle = value; } } public static AssetBundle retierAssetBundle { get { if ((Object)(object)_retierAssetBundle == (Object)null) { _retierAssetBundle = Assets.LoadAssetBundle("retier"); } return _retierAssetBundle; } set { _retierAssetBundle = value; } } public static void Init() { CreateMeatballNapalmPool(); CreateSquidBlasterBall(); AddTrophyHunterDebuffs(); AddCombatTelescopeCritChance(); AddMaskHauntAssets(); AddHarpoonAssets(); AddRazorwireAssets(); AddBrittleCrownAssets(); AddGestureAssets(); } private static void AddGestureAssets() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) gestureQueueEquipBreak = Content.CreateAndAddBuff("bdGestureBreakPending", Addressables.LoadAssetAsync((object)"RoR2/Base/LunarSkillReplacements/texBuffLunarDetonatorIcon.tif").WaitForCompletion(), Color.cyan, canStack: false, isDebuff: false, (StackingDisplayMethod)0); gestureQueueEquipBreak.isHidden = true; } private static void AddBrittleCrownAssets() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) brittleCrownCursePurchase = Content.CreateAndAddBuff("bdBrittleCrownCursePurchase", Addressables.LoadAssetAsync((object)"RoR2/Base/LunarSkillReplacements/texBuffLunarDetonatorIcon.tif").WaitForCompletion(), Color.cyan, canStack: true, isDebuff: false, (StackingDisplayMethod)0); } private static void AddRazorwireAssets() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) razorChargeBuff = Content.CreateAndAddBuff("bdRazorChargeBuff", Addressables.LoadAssetAsync((object)"RoR2/DLC1/MoveSpeedOnKill/texBuffKillMoveSpeed.tif").WaitForCompletion(), Color.white, canStack: true, isDebuff: false, (StackingDisplayMethod)0); razorChargeBuff.isCooldown = true; } private static void AddMaskHauntAssets() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0027: 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_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) hauntDebuff = Content.CreateAndAddBuff("bdHappiestMaskHauntDebuff", Addressables.LoadAssetAsync((object)"RoR2/DLC1/MoveSpeedOnKill/texBuffKillMoveSpeed.tif").WaitForCompletion(), new Color(0.9f, 0.7f, 1f), canStack: false, isDebuff: true, (StackingDisplayMethod)0); BuffDef obj = hauntDebuff; obj.flags = (Flags)(obj.flags | 1); GameObject val = Addressables.LoadAssetAsync((object)"RoR2/Base/DeathMark/DeathMarkEffect.prefab").WaitForCompletion(); hauntEffectPrefab = PrefabAPI.InstantiateClone(val, "HauntVisualEffect"); } private static void AddHarpoonAssets() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0027: 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_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) harpoonDebuff = Content.CreateAndAddBuff("bdHarpoonTargetDebuff", Addressables.LoadAssetAsync((object)"RoR2/DLC1/MoveSpeedOnKill/texBuffKillMoveSpeed.tif").WaitForCompletion(), new Color(0.9f, 0.7f, 0.1f), canStack: true, isDebuff: true, (StackingDisplayMethod)0); BuffDef obj = harpoonDebuff; obj.flags = (Flags)(obj.flags | 1); GameObject val = Addressables.LoadAssetAsync((object)"RoR2/Base/DeathMark/DeathMarkEffect.prefab").WaitForCompletion(); harpoonEffectPrefab = PrefabAPI.InstantiateClone(val, "HarpoonTargetVisualEffect"); } private static void CreateSquidBlasterBall() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: 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) squidBlasterBall = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)"RoR2/Base/Toolbot/ToolbotGrenadeLauncherProjectile.prefab").WaitForCompletion(), "MiredUrnTarball", true); squidBlasterBallGhost = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)"RoR2/Base/ClayBoss/TarballGhost.prefab").WaitForCompletion(), "SquidBlasterBallGhost", false); ProjectileController component = squidBlasterBall.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.ghostPrefab = squidBlasterBallGhost; } else { Log.Error("squid projectile conrroller rip"); } ProjectileSteerTowardTarget component2 = squidBlasterBall.GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { Object.Destroy((Object)(object)component2); } ProjectileDirectionalTargetFinder component3 = squidBlasterBall.GetComponent(); if (Object.op_Implicit((Object)(object)component3)) { component3.ignoreAir = false; } ProjectileImpactExplosion component4 = squidBlasterBall.GetComponent(); if (Object.op_Implicit((Object)(object)component4)) { component4.lifetime = 1f; component4.impactEffect = Addressables.LoadAssetAsync((object)"RoR2/Base/ClayBoss/TarballExplosion.prefab").WaitForCompletion(); } ContentAddition.AddProjectile(squidBlasterBall); } private static void AddTrophyHunterDebuffs() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) bossHunterDebuffWithScalpel = Content.CreateAndAddBuff("bdTrophyHunterScalpelDebuff", Addressables.LoadAssetAsync((object)"RoR2/Base/LunarSkillReplacements/texBuffLunarDetonatorIcon.tif").WaitForCompletion(), new Color(0.2f, 0.9f, 0.8f, 1f), canStack: false, isDebuff: true, (StackingDisplayMethod)0); BuffDef obj = bossHunterDebuffWithScalpel; obj.flags = (Flags)(obj.flags | 1); } private static void AddCombatTelescopeCritChance() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) combatTelescopeCritChance = Content.CreateAndAddBuff("bdCombatTelescopeCrit", Addressables.LoadAssetAsync((object)"RoR2/Base/CritOnUse/texBuffFullCritIcon.tif").WaitForCompletion(), Color.red, canStack: false, isDebuff: false, (StackingDisplayMethod)0); } private static void CreateMeatballNapalmPool() { //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_0032: 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_0059: Expected O, but got Unknown //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_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_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0171: 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_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_0299: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: Unknown result type (might be due to invalid IL or missing references) meatballNapalmPool = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("prefabs/projectiles/beetlequeenacid"), "NapalmFire", true); Color val = Color32.op_Implicit(new Color32(byte.MaxValue, (byte)120, (byte)0, byte.MaxValue)); Transform val2 = meatballNapalmPool.transform.Find("FX/Decal"); Material val3 = new Material(((Component)val2).GetComponent().Material); val3.SetColor("_Color", val); ((Component)val2).GetComponent().Material = val3; ProjectileDotZone component = meatballNapalmPool.GetComponent(); component.lifetime = 5f; component.fireFrequency = 2f; component.damageCoefficient = 0.5f; component.overlapProcCoefficient = 0.5f; component.attackerFiltering = (AttackerFiltering)0; meatballNapalmPool.GetComponent().damageType = DamageTypeCombo.op_Implicit((DamageType)128); meatballNapalmPool.GetComponent().procCoefficient = 1f; float num = 2.5f; meatballNapalmPool.GetComponent().localScale = new Vector3(num, num, num); Transform val4 = meatballNapalmPool.transform.Find("FX"); ((Component)val4.Find("Spittle")).gameObject.SetActive(false); GameObject val5 = Object.Instantiate(LegacyResourcesAPI.Load("prefabs/FireTrail").GetComponent().segmentPrefab, ((Component)val4).transform); MainModule main = val5.GetComponent().main; ((MainModule)(ref main)).duration = 8f; ((MainModule)(ref main)).gravityModifier = MinMaxCurve.op_Implicit(-0.075f); MinMaxCurve startSizeX = ((MainModule)(ref main)).startSizeX; ((MinMaxCurve)(ref startSizeX)).constantMin = ((MinMaxCurve)(ref startSizeX)).constantMin * 0.6f; ((MinMaxCurve)(ref startSizeX)).constantMax = ((MinMaxCurve)(ref startSizeX)).constantMax * 0.8f; MinMaxCurve startSizeY = ((MainModule)(ref main)).startSizeY; ((MinMaxCurve)(ref startSizeY)).constantMin = ((MinMaxCurve)(ref startSizeY)).constantMin * 0.8f; ((MinMaxCurve)(ref startSizeY)).constantMax = ((MinMaxCurve)(ref startSizeY)).constantMax * 1f; MinMaxCurve startSizeZ = ((MainModule)(ref main)).startSizeZ; ((MinMaxCurve)(ref startSizeZ)).constantMin = ((MinMaxCurve)(ref startSizeZ)).constantMin * 0.6f; ((MinMaxCurve)(ref startSizeZ)).constantMax = ((MinMaxCurve)(ref startSizeZ)).constantMax * 0.8f; MinMaxCurve startLifetime = ((MainModule)(ref main)).startLifetime; ((MinMaxCurve)(ref startLifetime)).constantMin = 0.9f; ((MinMaxCurve)(ref startLifetime)).constantMax = 1.1f; ((Behaviour)val5.GetComponent()).enabled = false; val5.transform.localPosition = Vector3.zero; val5.transform.localPosition = Vector3.zero; val5.transform.localScale = Vector3.one; ShapeModule shape = val5.GetComponent().shape; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)0; ((ShapeModule)(ref shape)).scale = Vector3.one * 0.5f; GameObject gameObject = ((Component)val4.Find("Point Light")).gameObject; Light component2 = gameObject.GetComponent(); component2.color = new Color(1f, 0.5f, 0f); component2.intensity = 6f; component2.range = 12f; Content.AddProjectilePrefab(meatballNapalmPool); } } public class CustomRendererInfo { public string childName; public Material material = null; public bool dontHotpoo = false; public bool ignoreOverlays = false; } internal static class Assets { internal static Dictionary loadedBundles = new Dictionary(); internal static AssetBundle LoadAssetBundle(string bundleName) { if (loadedBundles.ContainsKey(bundleName)) { return loadedBundles[bundleName]; } AssetBundle val = null; val = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)SwanSongPlugin.instance).Info.Location), bundleName)); loadedBundles[bundleName] = val; return val; } internal static GameObject CloneTracer(string originalTracerName, string newTracerName) { if ((Object)(object)LegacyResourcesAPI.Load("Prefabs/Effects/Tracers/" + originalTracerName) == (Object)null) { return null; } GameObject val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("Prefabs/Effects/Tracers/" + originalTracerName), newTracerName, true); if (!Object.op_Implicit((Object)(object)val.GetComponent())) { val.AddComponent(); } if (!Object.op_Implicit((Object)(object)val.GetComponent())) { val.AddComponent(); } if (!Object.op_Implicit((Object)(object)val.GetComponent())) { val.AddComponent(); } val.GetComponent().speed = 250f; val.GetComponent().length = 50f; Content.CreateAndAddEffectDef(val); return val; } internal static void ConvertAllRenderersToHopooShader(GameObject objectToConvert) { if (!Object.op_Implicit((Object)(object)objectToConvert)) { return; } MeshRenderer[] componentsInChildren = objectToConvert.GetComponentsInChildren(); foreach (MeshRenderer val in componentsInChildren) { if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)((Renderer)val).sharedMaterial)) { ((Renderer)val).sharedMaterial.ConvertDefaultShaderToHopoo(); } } SkinnedMeshRenderer[] componentsInChildren2 = objectToConvert.GetComponentsInChildren(); foreach (SkinnedMeshRenderer val2 in componentsInChildren2) { if (Object.op_Implicit((Object)(object)val2) && Object.op_Implicit((Object)(object)((Renderer)val2).sharedMaterial)) { ((Renderer)val2).sharedMaterial.ConvertDefaultShaderToHopoo(); } } } internal static GameObject LoadCrosshair(string crosshairName) { GameObject val = LegacyResourcesAPI.Load("Prefabs/Crosshair/" + crosshairName + "Crosshair"); if ((Object)(object)val == (Object)null) { Log.Error("could not load crosshair with the name " + crosshairName + ". defaulting to Standard"); return LegacyResourcesAPI.Load("Prefabs/Crosshair/StandardCrosshair"); } return val; } internal static GameObject LoadEffect(this AssetBundle assetBundle, string resourceName, bool parentToTransform) { return assetBundle.LoadEffect(resourceName, "", parentToTransform); } internal static GameObject LoadEffect(this AssetBundle assetBundle, string resourceName, string soundName = "", bool parentToTransform = false) { //IL_0046: 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) GameObject val = assetBundle.LoadAsset(resourceName); if (!Object.op_Implicit((Object)(object)val)) { Log.ErrorAssetBundle(resourceName, ((Object)assetBundle).name); return null; } val.AddComponent().duration = 12f; val.AddComponent(); val.AddComponent().vfxPriority = (VFXPriority)2; EffectComponent val2 = val.AddComponent(); val2.applyScale = false; val2.effectIndex = (EffectIndex)(-1); val2.parentToReferencedTransform = parentToTransform; val2.positionAtReferencedTransform = true; val2.soundName = soundName; Content.CreateAndAddEffectDef(val); return val; } internal static GameObject CreateProjectileGhostPrefab(this AssetBundle assetBundle, string ghostName) { GameObject val = assetBundle.LoadAsset(ghostName); if ((Object)(object)val == (Object)null) { Log.Error("Failed to load ghost prefab " + ghostName); } if (!Object.op_Implicit((Object)(object)val.GetComponent())) { val.AddComponent(); } if (!Object.op_Implicit((Object)(object)val.GetComponent())) { val.AddComponent(); } ConvertAllRenderersToHopooShader(val); return val; } internal static GameObject CreateProjectileGhostPrefab(GameObject ghostObject, string newName) { if ((Object)(object)ghostObject == (Object)null) { Log.Error("Failed to load ghost prefab " + ((Object)ghostObject).name); } GameObject val = PrefabAPI.InstantiateClone(ghostObject, newName); if (!Object.op_Implicit((Object)(object)val.GetComponent())) { val.AddComponent(); } if (!Object.op_Implicit((Object)(object)val.GetComponent())) { val.AddComponent(); } return val; } internal static GameObject CloneProjectilePrefab(string prefabName, string newPrefabName) { return PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("Prefabs/Projectiles/" + prefabName), newPrefabName); } internal static GameObject LoadAndAddProjectilePrefab(this AssetBundle assetBundle, string newPrefabName) { GameObject val = assetBundle.LoadAsset(newPrefabName); if ((Object)(object)val == (Object)null) { Log.ErrorAssetBundle(newPrefabName, ((Object)assetBundle).name); return null; } Content.AddProjectilePrefab(val); return val; } } internal static class Prefabs { private static PhysicMaterial ragdollMaterial; public static GameObject CreateDisplayPrefab(AssetBundle assetBundle, string displayPrefabName, GameObject prefab) { GameObject val = assetBundle.LoadAsset(displayPrefabName); if ((Object)(object)val == (Object)null) { Log.Error("could not load display prefab " + displayPrefabName + ". Make sure this prefab exists in assetbundle " + ((Object)assetBundle).name); return null; } CharacterModel val2 = val.GetComponent(); if (!Object.op_Implicit((Object)(object)val2)) { val2 = val.AddComponent(); } val2.baseRendererInfos = prefab.GetComponentInChildren().baseRendererInfos; Assets.ConvertAllRenderersToHopooShader(val); return val; } public static GameObject LoadCharacterModel(AssetBundle assetBundle, string modelName) { GameObject val = assetBundle.LoadAsset(modelName); if ((Object)(object)val == (Object)null) { Log.Error("could not load model prefab " + modelName + ". Make sure this prefab exists in assetbundle " + ((Object)assetBundle).name); return null; } return val; } public static GameObject LoadCharacterBody(AssetBundle assetBundle, string bodyName) { GameObject val = assetBundle.LoadAsset(bodyName); if ((Object)(object)val == (Object)null) { Log.Error("could not load body prefab " + bodyName + ". Make sure this prefab exists in assetbundle " + ((Object)assetBundle).name); return null; } return val; } public static GameObject CloneCharacterBody(BodyInfo bodyInfo) { GameObject val = LegacyResourcesAPI.Load("Prefabs/CharacterBodies/" + bodyInfo.bodyNameToClone + "Body"); if (!Object.op_Implicit((Object)(object)val)) { Log.Error(bodyInfo.bodyNameToClone + " Body to clone is not a valid body, character creation failed"); return null; } GameObject val2 = PrefabAPI.InstantiateClone(val, bodyInfo.bodyName); for (int num = val2.transform.childCount - 1; num >= 0; num--) { Object.DestroyImmediate((Object)(object)((Component)val2.transform.GetChild(num)).gameObject); } return val2; } public static GameObject CreateBodyPrefab(AssetBundle assetBundle, string modelPrefabName, BodyInfo bodyInfo) { return CreateBodyPrefab(LoadCharacterModel(assetBundle, modelPrefabName), bodyInfo); } public static GameObject CreateBodyPrefab(GameObject model, BodyInfo bodyInfo) { return CreateBodyPrefab(CloneCharacterBody(bodyInfo), model, bodyInfo); } public static GameObject CreateBodyPrefab(GameObject newBodyPrefab, AssetBundle assetBundle, string modelName, BodyInfo bodyInfo) { return CreateBodyPrefab(newBodyPrefab, LoadCharacterModel(assetBundle, modelName), bodyInfo); } public static GameObject CreateBodyPrefab(AssetBundle assetBundle, string bodyPrefabName, string modelPrefabName, BodyInfo bodyInfo) { return CreateBodyPrefab(LoadCharacterBody(assetBundle, bodyPrefabName), LoadCharacterModel(assetBundle, modelPrefabName), bodyInfo); } public static GameObject CreateBodyPrefab(GameObject newBodyPrefab, GameObject model, BodyInfo bodyInfo) { if ((Object)(object)model == (Object)null || (Object)(object)newBodyPrefab == (Object)null) { Log.Error($"Character creation failed. Model: {model}, Body: {newBodyPrefab}"); return null; } SetupCharacterBody(newBodyPrefab, bodyInfo); Transform modelBaseTransform = AddCharacterModelToSurvivorBody(newBodyPrefab, model.transform, bodyInfo); SetupModelLocator(newBodyPrefab, modelBaseTransform, model.transform); SetupCharacterDirection(newBodyPrefab, modelBaseTransform, model.transform); SetupCameraTargetParams(newBodyPrefab, bodyInfo); SetupCapsuleCollider(newBodyPrefab); Content.AddCharacterBodyPrefab(newBodyPrefab); return newBodyPrefab; } private static void SetupCharacterBody(GameObject newBodyPrefab, BodyInfo bodyInfo) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) CharacterBody component = newBodyPrefab.GetComponent(); component.baseNameToken = bodyInfo.bodyNameToken; component.subtitleNameToken = bodyInfo.subtitleNameToken; component.portraitIcon = bodyInfo.characterPortrait; component.bodyColor = bodyInfo.bodyColor; component._defaultCrosshairPrefab = bodyInfo.crosshair; component.hideCrosshair = false; component.preferredPodPrefab = bodyInfo.podPrefab; component.baseMaxHealth = bodyInfo.maxHealth; component.baseRegen = bodyInfo.healthRegen; component.baseArmor = bodyInfo.armor; component.baseMaxShield = bodyInfo.shield; component.baseDamage = bodyInfo.damage; component.baseAttackSpeed = bodyInfo.attackSpeed; component.baseCrit = bodyInfo.crit; component.baseMoveSpeed = bodyInfo.moveSpeed; component.baseJumpPower = bodyInfo.jumpPower; component.autoCalculateLevelStats = bodyInfo.autoCalculateLevelStats; if (bodyInfo.autoCalculateLevelStats) { component.levelMaxHealth = Mathf.Round(component.baseMaxHealth * 0.3f); component.levelMaxShield = Mathf.Round(component.baseMaxShield * 0.3f); component.levelRegen = component.baseRegen * 0.2f; component.levelMoveSpeed = 0f; component.levelJumpPower = 0f; component.levelDamage = component.baseDamage * 0.2f; component.levelAttackSpeed = 0f; component.levelCrit = 0f; component.levelArmor = 0f; } else { component.levelMaxHealth = bodyInfo.healthGrowth; component.levelMaxShield = bodyInfo.shieldGrowth; component.levelRegen = bodyInfo.regenGrowth; component.levelMoveSpeed = bodyInfo.moveSpeedGrowth; component.levelJumpPower = bodyInfo.jumpPowerGrowth; component.levelDamage = bodyInfo.damageGrowth; component.levelAttackSpeed = bodyInfo.attackSpeedGrowth; component.levelCrit = bodyInfo.critGrowth; component.levelArmor = bodyInfo.armorGrowth; } component.baseAcceleration = bodyInfo.acceleration; component.baseJumpCount = bodyInfo.jumpCount; component.sprintingSpeedMultiplier = 1.45f; component.bodyFlags = (BodyFlags)16; component.rootMotionInMainState = false; component.hullClassification = (HullClassification)0; component.isChampion = false; } private static Transform AddCharacterModelToSurvivorBody(GameObject bodyPrefab, Transform modelTransform, BodyInfo bodyInfo) { //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0049: 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_00b8: 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_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) Transform val = bodyPrefab.transform.Find("ModelBase"); if ((Object)(object)val == (Object)null) { val = new GameObject("ModelBase").transform; val.parent = bodyPrefab.transform; val.localPosition = bodyInfo.modelBasePosition; val.localRotation = Quaternion.identity; } modelTransform.parent = ((Component)val).transform; modelTransform.localPosition = Vector3.zero; modelTransform.localRotation = Quaternion.identity; Transform val2 = bodyPrefab.transform.Find("CameraPivot"); if ((Object)(object)val2 == (Object)null) { val2 = new GameObject("CameraPivot").transform; val2.parent = bodyPrefab.transform; val2.localPosition = bodyInfo.cameraPivotPosition; val2.localRotation = Quaternion.identity; } Transform val3 = bodyPrefab.transform.Find("AimOrigin"); if ((Object)(object)val3 == (Object)null) { val3 = new GameObject("AimOrigin").transform; val3.parent = bodyPrefab.transform; val3.localPosition = bodyInfo.aimOriginPosition; val3.localRotation = Quaternion.identity; } bodyPrefab.GetComponent().aimOriginTransform = val3; return ((Component)val).transform; } private static void SetupCharacterDirection(GameObject prefab, Transform modelBaseTransform, Transform modelTransform) { if (Object.op_Implicit((Object)(object)prefab.GetComponent())) { CharacterDirection component = prefab.GetComponent(); component.targetTransform = modelBaseTransform; component.overrideAnimatorForwardTransform = null; component.rootMotionAccumulator = null; component.modelAnimator = ((Component)modelTransform).GetComponent(); component.driveFromRootRotation = false; component.turnSpeed = 720f; } } private static void SetupCameraTargetParams(GameObject prefab, BodyInfo bodyInfo) { CameraTargetParams component = prefab.GetComponent(); component.cameraParams = bodyInfo.cameraParams; component.cameraPivotTransform = prefab.transform.Find("CameraPivot"); } private static void SetupModelLocator(GameObject prefab, Transform modelBaseTransform, Transform modelTransform) { ModelLocator component = prefab.GetComponent(); component.modelTransform = modelTransform; component.modelBaseTransform = modelBaseTransform; } private static void SetupCapsuleCollider(GameObject prefab) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) CapsuleCollider component = prefab.GetComponent(); component.center = new Vector3(0f, 0f, 0f); component.radius = 0.5f; component.height = 1.82f; component.direction = 1; } public static CharacterModel SetupCharacterModel(GameObject bodyPrefab, CustomRendererInfo[] customInfos = null) { CharacterModel val = ((Component)bodyPrefab.GetComponent().modelTransform).gameObject.GetComponent(); bool flag = (Object)(object)val != (Object)null; if (!flag) { val = ((Component)bodyPrefab.GetComponent().modelTransform).gameObject.AddComponent(); } val.body = bodyPrefab.GetComponent(); val.autoPopulateLightInfos = true; val.invisibilityCount = 0; val.temporaryOverlays = new List(); if (!flag) { SetupCustomRendererInfos(val, customInfos); } else { SetupPreAttachedRendererInfos(val); } SetupHurtboxGroup(bodyPrefab, ((Component)val).gameObject); SetupAimAnimator(bodyPrefab, ((Component)val).gameObject); SetupFootstepController(((Component)val).gameObject); SetupRagdoll(((Component)val).gameObject); return val; } public static void SetupPreAttachedRendererInfos(CharacterModel characterModel) { for (int i = 0; i < characterModel.baseRendererInfos.Length; i++) { if ((Object)(object)characterModel.baseRendererInfos[i].defaultMaterial == (Object)null) { characterModel.baseRendererInfos[i].defaultMaterial = characterModel.baseRendererInfos[i].renderer.sharedMaterial; } if ((Object)(object)characterModel.baseRendererInfos[i].defaultMaterial == (Object)null) { Log.Error($"no material for rendererinfo of this renderer: {characterModel.baseRendererInfos[i].renderer}"); } characterModel.baseRendererInfos[i].defaultMaterial.ConvertDefaultShaderToHopoo(); } } public static void SetupCustomRendererInfos(CharacterModel characterModel, CustomRendererInfo[] customInfos) { //IL_00de: 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_010d: Unknown result type (might be due to invalid IL or missing references) ChildLocator component = ((Component)characterModel).GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { Log.Error("Failed CharacterModel setup: ChildLocator component does not exist on the model"); return; } List list = new List(); for (int i = 0; i < customInfos.Length; i++) { if (!Object.op_Implicit((Object)(object)component.FindChild(customInfos[i].childName))) { Log.Error("Trying to add a RendererInfo for a renderer that does not exist: " + customInfos[i].childName); continue; } Renderer component2 = ((Component)component.FindChild(customInfos[i].childName)).GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { Material val = customInfos[i].material; if ((Object)(object)val == (Object)null) { val = ((!customInfos[i].dontHotpoo) ? component2.sharedMaterial.ConvertDefaultShaderToHopoo() : component2.sharedMaterial); } list.Add(new RendererInfo { renderer = component2, defaultMaterial = val, ignoreOverlays = customInfos[i].ignoreOverlays, defaultShadowCastingMode = (ShadowCastingMode)1 }); } } characterModel.baseRendererInfos = list.ToArray(); } private static void SetupHurtboxGroup(GameObject bodyPrefab, GameObject model) { SetupMainHurtboxesFromChildLocator(bodyPrefab, model); SetHurtboxesHealthComponents(bodyPrefab); } private static void SetupMainHurtboxesFromChildLocator(GameObject bodyPrefab, GameObject model) { //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)bodyPrefab.GetComponent() != (Object)null) { Log.Debug("Hitboxgroup already exists on model prefab. aborting code setup"); return; } ChildLocator component = model.GetComponent(); if (!Object.op_Implicit((Object)(object)component.FindChild("MainHurtbox"))) { Log.Error("Could not set up main hurtbox: make sure you have a transform pair in your prefab's ChildLocator called 'MainHurtbox'"); return; } HurtBoxGroup val = model.AddComponent(); HurtBox val2 = null; GameObject val3 = component.FindChildGameObject("HeadHurtbox"); if (Object.op_Implicit((Object)(object)val3)) { Log.Debug("HeadHurtboxFound. Setting up"); val2 = val3.AddComponent(); ((Component)val2).gameObject.layer = LayerIndex.entityPrecise.intVal; val2.healthComponent = bodyPrefab.GetComponent(); val2.isBullseye = false; val2.isSniperTarget = true; val2.damageModifier = (DamageModifier)0; val2.hurtBoxGroup = val; val2.indexInGroup = 1; } HurtBox val4 = component.FindChildGameObject("MainHurtbox").AddComponent(); ((Component)val4).gameObject.layer = LayerIndex.entityPrecise.intVal; val4.healthComponent = bodyPrefab.GetComponent(); val4.isBullseye = true; val4.isSniperTarget = (Object)(object)val2 == (Object)null; val4.damageModifier = (DamageModifier)0; val4.hurtBoxGroup = val; val4.indexInGroup = 0; if (Object.op_Implicit((Object)(object)val2)) { val.hurtBoxes = (HurtBox[])(object)new HurtBox[2] { val4, val2 }; } else { val.hurtBoxes = (HurtBox[])(object)new HurtBox[1] { val4 }; } val.mainHurtBox = val4; val.bullseyeCount = 1; } public static void SetHurtboxesHealthComponents(GameObject bodyPrefab) { HealthComponent component = bodyPrefab.GetComponent(); HurtBoxGroup[] componentsInChildren = bodyPrefab.GetComponentsInChildren(); foreach (HurtBoxGroup val in componentsInChildren) { val.mainHurtBox.healthComponent = component; for (int j = 0; j < val.hurtBoxes.Length; j++) { val.hurtBoxes[j].healthComponent = component; } } } private static void SetupFootstepController(GameObject model) { FootstepHandler val = model.AddComponent(); val.baseFootstepString = "Play_player_footstep"; val.sprintFootstepOverrideString = ""; val.enableFootstepDust = true; val.footstepDustPrefab = LegacyResourcesAPI.Load("Prefabs/GenericFootstepDust"); } private static void SetupRagdoll(GameObject model) { RagdollController component = model.GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { return; } if ((Object)(object)ragdollMaterial == (Object)null) { ragdollMaterial = ((Component)LegacyResourcesAPI.Load("Prefabs/CharacterBodies/CommandoBody").GetComponentInChildren().bones[1]).GetComponent().material; } Transform[] bones = component.bones; foreach (Transform val in bones) { if (Object.op_Implicit((Object)(object)val)) { ((Component)val).gameObject.layer = LayerIndex.ragdoll.intVal; Collider component2 = ((Component)val).GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { component2.sharedMaterial = ragdollMaterial; } else { Log.Error($"Ragdoll bone {((Component)val).gameObject} doesn't have a collider. Ragdoll will break."); } } } } private static void SetupAimAnimator(GameObject prefab, GameObject model) { AimAnimator val = model.AddComponent(); val.directionComponent = prefab.GetComponent(); val.pitchRangeMax = 60f; val.pitchRangeMin = -60f; val.yawRangeMin = -80f; val.yawRangeMax = 80f; val.pitchGiveupRange = 30f; val.yawGiveupRange = 10f; val.giveupDuration = 3f; val.inputBank = prefab.GetComponent(); } public static void CreateGenericDoppelganger(GameObject bodyPrefab, string masterName, string masterToCopy) { CloneDopplegangerMaster(bodyPrefab, masterName, masterToCopy); } public static GameObject CloneDopplegangerMaster(GameObject bodyPrefab, string masterName, string masterToCopy) { GameObject val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("Prefabs/CharacterMasters/" + masterToCopy + "MonsterMaster"), masterName, true); val.GetComponent().bodyPrefab = bodyPrefab; Content.AddMasterPrefab(val); return val; } public static GameObject CreateBlankMasterPrefab(GameObject bodyPrefab, string masterName) { GameObject val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("Prefabs/CharacterMasters/CommandoMonsterMaster"), masterName, true); ContentPacks.masterPrefabs.Add(val); CharacterMaster component = val.GetComponent(); component.bodyPrefab = bodyPrefab; AISkillDriver[] components = val.GetComponents(); for (int i = 0; i < components.Length; i++) { Object.Destroy((Object)(object)components[i]); } return val; } public static GameObject LoadMaster(this AssetBundle assetBundle, GameObject bodyPrefab, string assetName) { //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) GameObject val = assetBundle.LoadAsset(assetName); BaseAI val2 = val.GetComponent(); if ((Object)(object)val2 == (Object)null) { val2 = val.AddComponent(); val2.aimVectorDampTime = 0.1f; val2.aimVectorMaxSpeed = 360f; } val2.scanState = new SerializableEntityStateType(typeof(Wander)); EntityStateMachine component = val.GetComponent(); if ((Object)(object)component == (Object)null) { AddEntityStateMachine(val, "AI", typeof(Wander), typeof(Wander)); } val2.stateMachine = component; CharacterMaster val3 = val.GetComponent(); if ((Object)(object)val3 == (Object)null) { val3 = val.AddComponent(); } val3.bodyPrefab = bodyPrefab; val3.teamIndex = (TeamIndex)2; Content.AddMasterPrefab(val); return val; } public static void ClearEntityStateMachines(GameObject bodyPrefab) { EntityStateMachine[] components = bodyPrefab.GetComponents(); for (int num = components.Length - 1; num >= 0; num--) { Object.DestroyImmediate((Object)(object)components[num]); } NetworkStateMachine component = bodyPrefab.GetComponent(); component.stateMachines = Array.Empty(); CharacterDeathBehavior component2 = bodyPrefab.GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { component2.idleStateMachine = Array.Empty(); } SetStateOnHurt component3 = bodyPrefab.GetComponent(); if (Object.op_Implicit((Object)(object)component3)) { component3.idleStateMachine = Array.Empty(); } } public static void AddMainEntityStateMachine(GameObject bodyPrefab, string machineName = "Body", Type mainStateType = null, Type initalStateType = null) { //IL_005d: 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_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) EntityStateMachine val = EntityStateMachine.FindByCustomName(bodyPrefab, machineName); if ((Object)(object)val == (Object)null) { val = bodyPrefab.AddComponent(); } else { Log.Message("An Entity State Machine already exists with the name " + machineName + ". replacing."); } val.customName = machineName; if (mainStateType == null) { mainStateType = typeof(GenericCharacterMain); } val.mainStateType = new SerializableEntityStateType(mainStateType); if (initalStateType == null) { initalStateType = typeof(SpawnTeleporterState); } val.initialStateType = new SerializableEntityStateType(initalStateType); NetworkStateMachine component = bodyPrefab.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.stateMachines = component.stateMachines.Append(val).ToArray(); } CharacterDeathBehavior component2 = bodyPrefab.GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { component2.deathStateMachine = val; } SetStateOnHurt component3 = bodyPrefab.GetComponent(); if (Object.op_Implicit((Object)(object)component3)) { component3.targetStateMachine = val; } } public static void AddEntityStateMachine(GameObject prefab, string machineName, Type mainStateType = null, Type initalStateType = null) { //IL_005d: 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_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) EntityStateMachine val = EntityStateMachine.FindByCustomName(prefab, machineName); if ((Object)(object)val == (Object)null) { val = prefab.AddComponent(); } else { Log.Message("An Entity State Machine already exists with the name " + machineName + ". replacing."); } val.customName = machineName; if (mainStateType == null) { mainStateType = typeof(Idle); } val.mainStateType = new SerializableEntityStateType(mainStateType); if (initalStateType == null) { initalStateType = typeof(Idle); } val.initialStateType = new SerializableEntityStateType(initalStateType); NetworkStateMachine component = prefab.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.stateMachines = component.stateMachines.Append(val).ToArray(); } CharacterDeathBehavior component2 = prefab.GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { component2.idleStateMachine = component2.idleStateMachine.Append(val).ToArray(); } SetStateOnHurt component3 = prefab.GetComponent(); if (Object.op_Implicit((Object)(object)component3)) { component3.idleStateMachine = component3.idleStateMachine.Append(val).ToArray(); } } public static void SetupHitBoxGroup(GameObject modelPrefab, string hitBoxGroupName, params string[] hitboxChildNames) { ChildLocator component = modelPrefab.GetComponent(); Transform[] array = (Transform[])(object)new Transform[hitboxChildNames.Length]; for (int i = 0; i < hitboxChildNames.Length; i++) { array[i] = component.FindChild(hitboxChildNames[i]); if ((Object)(object)array[i] == (Object)null) { Log.Error("missing hitbox for " + hitboxChildNames[i]); } } SetupHitBoxGroup(modelPrefab, hitBoxGroupName, array); } public static void SetupHitBoxGroup(GameObject prefab, string hitBoxGroupName, params Transform[] hitBoxTransforms) { List list = new List(); foreach (Transform val in hitBoxTransforms) { if ((Object)(object)val == (Object)null) { Log.Error("Error setting up hitboxGroup for " + hitBoxGroupName + ": hitbox transform was null"); continue; } HitBox item = ((Component)val).gameObject.AddComponent(); ((Component)val).gameObject.layer = LayerIndex.projectile.intVal; list.Add(item); } if (list.Count == 0) { Log.Error("No hitboxes were set up. aborting setting up hitboxGroup for " + hitBoxGroupName); return; } HitBoxGroup val2 = prefab.AddComponent(); val2.hitBoxes = list.ToArray(); val2.groupName = hitBoxGroupName; } } internal static class Materials { private static List cachedMaterials = new List(); internal static Shader hotpoo = LegacyResourcesAPI.Load("Shaders/Deferred/HGStandard"); public static List MaterialsWithSwappedShaders { get; } = new List(); internal static void GetMaterial(GameObject model, string childObject, Color color, ref Material material, float scaleMultiplier = 1f, bool replaceAll = false) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Expected O, but got Unknown //IL_0092: Unknown result type (might be due to invalid IL or missing references) Renderer[] componentsInChildren = model.GetComponentsInChildren(); Renderer[] array = componentsInChildren; foreach (Renderer val in array) { Renderer val2 = val; if (string.Equals(((Object)val).name, childObject)) { if (color == Color.clear) { Object.Destroy((Object)(object)val); break; } if ((Object)(object)material == (Object)null) { material = new Material(val.material); material.mainTexture = val.material.mainTexture; material.shader = val.material.shader; material.color = color; } val.material = material; Transform transform = ((Component)val).transform; transform.localScale *= scaleMultiplier; if (!replaceAll) { break; } } } } internal static void DebugMaterial(GameObject model) { Renderer[] componentsInChildren = model.GetComponentsInChildren(); Renderer[] array = componentsInChildren; foreach (Renderer val in array) { Renderer val2 = val; Debug.Log((object)("Material: " + ((Object)val2).name.ToString())); } } public static void SwapShadersFromMaterialsInBundle(AssetBundle bundle) { SwapAllShaders(bundle); } internal static void SwapAllShaders(AssetBundle assetBundle) { Material[] array = assetBundle.LoadAllAssets(); foreach (Material val in array) { Log.Debug("Trying to swap shader for " + ((Object)val).name); TrySwapShader(val); } } internal static void TrySwapShader(Material material) { //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_0105: Unknown result type (might be due to invalid IL or missing references) string name = ((Object)material.shader).name; if (name.Contains("Stubbed")) { name = name.Replace("Stubbed", string.Empty) + ".shader"; Shader val = Addressables.LoadAssetAsync((object)name).WaitForCompletion(); if ((Object)(object)val != (Object)null) { material.shader = val; } else { Log.Error("Failed to load shader " + name); } } else if (name == "Standard") { Texture texture = material.GetTexture("_BumpMap"); float @float = material.GetFloat("_BumpScale"); Texture texture2 = material.GetTexture("_EmissionMap"); material.shader = Resources.Load("Shaders/Deferred/HGStandard"); material.SetTexture("_NormalMap", texture); material.SetFloat("_NormalStrength", @float); material.SetTexture("_EmTex", texture2); material.SetColor("_EmColor", new Color(0.2f, 0.2f, 0.2f)); material.SetFloat("_EmPower", 0.15f); } } private static void SwapShader(Material material) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) string text = ((Object)material.shader).name.Substring("Stubbed".Length); string text2 = text + ".shader"; Shader shader = Addressables.LoadAssetAsync((object)text2).WaitForCompletion(); material.shader = shader; MaterialsWithSwappedShaders.Add(material); } public static Material LoadMaterial(this AssetBundle assetBundle, string materialName) { return assetBundle.CreateHopooMaterialFromBundle(materialName); } public static Material CreateHopooMaterialFromBundle(this AssetBundle assetBundle, string materialName) { //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Expected O, but got Unknown Material val = cachedMaterials.Find(delegate(Material mat) { materialName.Replace(" (Instance)", ""); return ((Object)mat).name.Contains(materialName); }); if (Object.op_Implicit((Object)(object)val)) { Log.Debug(((Object)val).name + " has already been loaded. returning cached"); return val; } val = assetBundle.LoadAsset(materialName); if (!Object.op_Implicit((Object)(object)val)) { Log.ErrorAssetBundle(materialName, ((Object)assetBundle).name); return new Material(hotpoo); } return val.ConvertDefaultShaderToHopoo(); } public static Material SetHopooMaterial(this Material tempMat) { return tempMat.ConvertDefaultShaderToHopoo(); } public static Material ConvertDefaultShaderToHopoo(this Material tempMat) { //IL_007d: 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) if (cachedMaterials.Contains(tempMat)) { Log.Debug(((Object)tempMat).name + " has already been loaded. returning cached"); return tempMat; } float? num = null; Color? val = null; if (tempMat.IsKeywordEnabled("_NORMALMAP")) { num = tempMat.GetFloat("_BumpScale"); } if (tempMat.IsKeywordEnabled("_EMISSION")) { val = tempMat.GetColor("_EmissionColor"); } tempMat.shader = hotpoo; tempMat.SetTexture("_EmTex", tempMat.GetTexture("_EmissionMap")); tempMat.EnableKeyword("DITHER"); if (num.HasValue) { tempMat.SetFloat("_NormalStrength", num.Value); tempMat.SetTexture("_NormalTex", tempMat.GetTexture("_BumpMap")); } if (val.HasValue) { tempMat.SetColor("_EmColor", val.Value); tempMat.SetFloat("_EmPower", 1f); } if (tempMat.IsKeywordEnabled("NOCULL")) { tempMat.SetInt("_Cull", 0); } if (tempMat.IsKeywordEnabled("LIMBREMOVAL")) { tempMat.SetInt("_LimbRemovalOn", 1); } cachedMaterials.Add(tempMat); return tempMat; } public static Material MakeUnique(this Material material) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown if (cachedMaterials.Contains(material)) { return new Material(material); } return material; } public static Material SetColor(this Material material, Color color) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) material.SetColor("_Color", color); return material; } public static Material SetNormal(this Material material, float normalStrength = 1f) { material.SetFloat("_NormalStrength", normalStrength); return material; } public static Material SetEmission(this Material material) { return material.SetEmission(1f); } public static Material SetEmission(this Material material, float emission) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return material.SetEmission(emission, Color.white); } public static Material SetEmission(this Material material, float emission, Color emissionColor) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) material.SetFloat("_EmPower", emission); material.SetColor("_EmColor", emissionColor); return material; } public static Material SetCull(this Material material, bool cull = false) { material.SetInt("_Cull", cull ? 1 : 0); return material; } public static Material SetSpecular(this Material material, float strength) { material.SetFloat("_SpecularStrength", strength); return material; } public static Material SetSpecular(this Material material, float strength, float exponent) { material.SetFloat("_SpecularStrength", strength); material.SetFloat("SpecularExponent", exponent); return material; } } internal static class Particles { internal static void GetParticle(GameObject model, string childObject, Color color, float sizeMultiplier = 1f, bool replaceAll = false) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) ParticleSystem[] componentsInChildren = model.GetComponentsInChildren(); ParticleSystem[] array = componentsInChildren; foreach (ParticleSystem val in array) { ParticleSystem val2 = val; MainModule main = val2.main; ColorOverLifetimeModule colorOverLifetime = val2.colorOverLifetime; ColorBySpeedModule colorBySpeed = val2.colorBySpeed; if (string.Equals(((Object)val2).name, childObject)) { ((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(color); ((MainModule)(ref main)).startSizeMultiplier = ((MainModule)(ref main)).startSizeMultiplier * sizeMultiplier; ((ColorOverLifetimeModule)(ref colorOverLifetime)).color = MinMaxGradient.op_Implicit(color); ((ColorBySpeedModule)(ref colorBySpeed)).color = MinMaxGradient.op_Implicit(color); if (!replaceAll) { break; } } } } internal static void DebugParticleSystem(GameObject model) { ParticleSystem[] componentsInChildren = model.GetComponentsInChildren(); ParticleSystem[] array = componentsInChildren; foreach (ParticleSystem val in array) { ParticleSystem val2 = val; Debug.Log((object)("Particle: " + ((Object)val2).name.ToString())); } } } internal class Content { internal static void AddExpansionDef(ExpansionDef expansion) { ContentPacks.expansionDefs.Add(expansion); } internal static void AddCharacterBodyPrefab(GameObject bprefab) { ContentPacks.bodyPrefabs.Add(bprefab); } internal static void AddMasterPrefab(GameObject prefab) { ContentPacks.masterPrefabs.Add(prefab); } internal static void AddProjectilePrefab(GameObject prefab) { ContentPacks.projectilePrefabs.Add(prefab); } internal static void AddSurvivorDef(SurvivorDef survivorDef) { ContentPacks.survivorDefs.Add(survivorDef); } internal static void AddItemDef(ItemDef itemDef) { ContentPacks.itemDefs.Add(itemDef); } internal static void AddEliteDef(EliteDef eliteDef) { ContentPacks.eliteDefs.Add(eliteDef); } internal static void AddArtifactDef(ArtifactDef artifactDef) { ContentPacks.artifactDefs.Add(artifactDef); } internal static void AddNetworkedObjectPrefab(GameObject prefab) { ContentPacks.networkedObjectPrefabs.Add(prefab); } internal static void CreateSurvivor(GameObject bodyPrefab, GameObject displayPrefab, Color charColor, string tokenPrefix) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) CreateSurvivor(bodyPrefab, displayPrefab, charColor, tokenPrefix, null, 100f); } internal static void CreateSurvivor(GameObject bodyPrefab, GameObject displayPrefab, Color charColor, string tokenPrefix, float sortPosition) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) CreateSurvivor(bodyPrefab, displayPrefab, charColor, tokenPrefix, null, sortPosition); } internal static void CreateSurvivor(GameObject bodyPrefab, GameObject displayPrefab, Color charColor, string tokenPrefix, UnlockableDef unlockableDef) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) CreateSurvivor(bodyPrefab, displayPrefab, charColor, tokenPrefix, unlockableDef, 100f); } internal static void CreateSurvivor(GameObject bodyPrefab, GameObject displayPrefab, Color charColor, string tokenPrefix, UnlockableDef unlockableDef, float sortPosition) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) SurvivorDef val = ScriptableObject.CreateInstance(); val.bodyPrefab = bodyPrefab; val.displayPrefab = displayPrefab; val.primaryColor = charColor; val.cachedName = ((Object)bodyPrefab).name.Replace("Body", ""); val.displayNameToken = tokenPrefix + "NAME"; val.descriptionToken = tokenPrefix + "DESCRIPTION"; val.outroFlavorToken = tokenPrefix + "OUTRO_FLAVOR"; val.mainEndingEscapeFailureFlavorToken = tokenPrefix + "OUTRO_FAILURE"; val.desiredSortPosition = sortPosition; val.unlockableDef = unlockableDef; AddSurvivorDef(val); } internal static void AddUnlockableDef(UnlockableDef unlockableDef) { ContentPacks.unlockableDefs.Add(unlockableDef); } internal static UnlockableDef CreateAndAddUnlockbleDef(string identifier, string nameToken, Sprite achievementIcon) { UnlockableDef val = ScriptableObject.CreateInstance(); val.cachedName = identifier; val.nameToken = nameToken; val.achievementIcon = achievementIcon; AddUnlockableDef(val); return val; } internal static void AddSkillDef(SkillDef skillDef) { ContentPacks.skillDefs.Add(skillDef); } internal static void AddSkillFamily(SkillFamily skillFamily) { ContentPacks.skillFamilies.Add(skillFamily); } internal static void AddEntityState(Type entityState) { ContentPacks.entityStates.Add(entityState); } internal static void AddBuffDef(BuffDef buffDef) { ContentPacks.buffDefs.Add(buffDef); } internal static BuffDef CreateAndAddBuff(string buffName, Sprite buffIcon, Color buffColor, bool canStack, bool isDebuff, StackingDisplayMethod stackingDisplayMethod = 0) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0034: 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) BuffDef val = ScriptableObject.CreateInstance(); ((Object)val).name = buffName; val.buffColor = buffColor; val.canStack = canStack; val.isDebuff = isDebuff; val.eliteDef = null; val.iconSprite = buffIcon; val.stackingDisplayMethod = stackingDisplayMethod; AddBuffDef(val); return val; } internal static void AddEffectDef(EffectDef effectDef) { ContentPacks.effectDefs.Add(effectDef); } internal static EffectDef CreateAndAddEffectDef(GameObject effectPrefab) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown EffectDef val = new EffectDef(effectPrefab); AddEffectDef(val); return val; } internal static void AddNetworkSoundEventDef(NetworkSoundEventDef networkSoundEventDef) { ContentPacks.networkSoundEventDefs.Add(networkSoundEventDef); } internal static NetworkSoundEventDef CreateAndAddNetworkSoundEventDef(string eventName) { NetworkSoundEventDef val = ScriptableObject.CreateInstance(); val.akId = AkSoundEngine.GetIDFromString(eventName); val.eventName = eventName; AddNetworkSoundEventDef(val); return val; } } internal static class Skills { public static Dictionary characterSkillLocators = new Dictionary(); public static void CreateSkillFamilies(GameObject targetPrefab) { SkillSlot[] array = new SkillSlot[4]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); CreateSkillFamilies(targetPrefab, (SkillSlot[])(object)array); } public static void CreateSkillFamilies(GameObject targetPrefab, params SkillSlot[] slots) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_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_0015: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected I4, but got Unknown SkillLocator component = targetPrefab.GetComponent(); foreach (SkillSlot val in slots) { SkillSlot val2 = val; switch (val2 - -1) { case 1: component.primary = CreateGenericSkillWithSkillFamily(targetPrefab, "Primary"); break; case 2: component.secondary = CreateGenericSkillWithSkillFamily(targetPrefab, "Secondary"); break; case 3: component.utility = CreateGenericSkillWithSkillFamily(targetPrefab, "Utility"); break; case 4: component.special = CreateGenericSkillWithSkillFamily(targetPrefab, "Special"); break; } } } public static void ClearGenericSkills(GameObject targetPrefab) { GenericSkill[] componentsInChildren = targetPrefab.GetComponentsInChildren(); foreach (GenericSkill val in componentsInChildren) { Object.DestroyImmediate((Object)(object)val); } } public static GenericSkill CreateGenericSkillWithSkillFamily(GameObject targetPrefab, SkillSlot skillSlot, bool hidden = false) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected I4, but got Unknown SkillLocator component = targetPrefab.GetComponent(); switch (skillSlot - -1) { case 1: return component.primary = CreateGenericSkillWithSkillFamily(targetPrefab, "Primary", hidden); case 2: return component.secondary = CreateGenericSkillWithSkillFamily(targetPrefab, "Secondary", hidden); case 3: return component.utility = CreateGenericSkillWithSkillFamily(targetPrefab, "Utility", hidden); case 4: return component.special = CreateGenericSkillWithSkillFamily(targetPrefab, "Special", hidden); case 0: Log.Error("Failed to create GenericSkill with skillslot None. If making a GenericSkill outside of the main 4, specify a familyName, and optionally a genericSkillName"); return null; default: return null; } } public static GenericSkill CreateGenericSkillWithSkillFamily(GameObject targetPrefab, string familyName, bool hidden = false) { return CreateGenericSkillWithSkillFamily(targetPrefab, familyName, familyName, hidden); } public static GenericSkill CreateGenericSkillWithSkillFamily(GameObject targetPrefab, string genericSkillName, string familyName, bool hidden = false) { GenericSkill val = targetPrefab.AddComponent(); val.skillName = genericSkillName; val.hideInCharacterSelect = hidden; SkillFamily val2 = ScriptableObject.CreateInstance(); ((Object)val2).name = ((Object)targetPrefab).name + familyName + "Family"; val2.variants = (Variant[])(object)new Variant[0]; val._skillFamily = val2; Content.AddSkillFamily(val2); return val; } public static void AddSkillToFamily(SkillFamily skillFamily, SkillDef skillDef, UnlockableDef unlockableDef = null) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Expected O, but got Unknown //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1); Variant[] variants = skillFamily.variants; int num = skillFamily.variants.Length - 1; Variant val = new Variant { skillDef = skillDef, unlockableDef = unlockableDef }; ((Variant)(ref val)).viewableNode = new Node(skillDef.skillNameToken, false, (Node)null); variants[num] = val; } public static void AddSkillsToFamily(SkillFamily skillFamily, params SkillDef[] skillDefs) { foreach (SkillDef skillDef in skillDefs) { AddSkillToFamily(skillFamily, skillDef); } } public static void AddPrimarySkills(GameObject targetPrefab, params SkillDef[] skillDefs) { AddSkillsToFamily(targetPrefab.GetComponent().primary.skillFamily, skillDefs); } public static void AddSecondarySkills(GameObject targetPrefab, params SkillDef[] skillDefs) { AddSkillsToFamily(targetPrefab.GetComponent().secondary.skillFamily, skillDefs); } public static void AddUtilitySkills(GameObject targetPrefab, params SkillDef[] skillDefs) { AddSkillsToFamily(targetPrefab.GetComponent().utility.skillFamily, skillDefs); } public static void AddSpecialSkills(GameObject targetPrefab, params SkillDef[] skillDefs) { AddSkillsToFamily(targetPrefab.GetComponent().special.skillFamily, skillDefs); } public static void AddUnlockablesToFamily(SkillFamily skillFamily, params UnlockableDef[] unlockableDefs) { //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_0024: 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) for (int i = 0; i < unlockableDefs.Length; i++) { Variant val = skillFamily.variants[i]; val.unlockableDef = unlockableDefs[i]; skillFamily.variants[i] = val; } } public static Combo ComboFromType(Type t) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) Combo result = default(Combo); result.activationStateType = new SerializableEntityStateType(t); return result; } } [AttributeUsage(AttributeTargets.Field, AllowMultiple = false)] public class AutoConfigAttribute : Attribute { public string name; public string desc; public object defaultValue; public AutoConfigAttribute(string name, object defaultValue) { Init(name, string.Empty, defaultValue); } public AutoConfigAttribute(string name, string desc, object defaultValue) { Init(name, desc, defaultValue); } public void Init(string name, string desc, object defaultValue) { this.name = name; this.desc = desc; this.defaultValue = defaultValue; } } public static class Config { public static ConfigFile MyConfig; public static ConfigFile BackupConfig; public static void Init() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: 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 MyConfig = new ConfigFile(Paths.ConfigPath + "\\SwanSongExtended.cfg", true); MyConfig.SaveOnConfigSet = false; BackupConfig = new ConfigFile(Paths.ConfigPath + "\\SwanSongExtended.Backup.cfg", true); BackupConfig.SaveOnConfigSet = false; BackupConfig.Bind(": DO NOT MODIFY THIS FILES CONTENTS :", ": DO NOT MODIFY THIS FILES CONTENTS :", ": DO NOT MODIFY THIS FILES CONTENTS :", ": DO NOT MODIFY THIS FILES CONTENTS :"); } public static void Save() { MyConfig.SaveOnConfigSet = true; MyConfig.Save(); BackupConfig.SaveOnConfigSet = true; BackupConfig.Save(); } public static ConfigEntry CharacterEnableConfig(string section, string characterName, string description = "", bool enabledByDefault = true) { if (string.IsNullOrEmpty(description)) { description = "Set to false to disable this character and as much of its code and content as possible"; } return BindAndOptions(section, "Enable " + characterName, enabledByDefault, description, restartRequired: true); } public static ConfigEntry BindAndOptions(string section, string name, T defaultValue, string description = "", bool restartRequired = false) { return BindAndOptions(section, name, defaultValue, 0f, 20f, description, restartRequired); } public static ConfigEntry BindAndOptions(string section, string name, T defaultValue, float min, float max, string description = "", bool restartRequired = false) { if (string.IsNullOrEmpty(description)) { description = name; } if (restartRequired) { description += " (restart required)"; } ConfigEntry val = MyConfig.Bind(section, name, defaultValue, description); if (Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions")) { TryRegisterOption(val, min, max, restartRequired); } return val; } public static ConfigEntry BindAndOptionsSlider(string section, string name, float defaultValue, string description, float min = 0f, float max = 20f, bool restartRequired = false) { return BindAndOptions(section, name, defaultValue, min, max, description, restartRequired); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private static void TryRegisterOption(ConfigEntry entry, float min, float max, bool restartRequired) { } public static bool GetKeyPressed(KeyboardShortcut entry) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) foreach (KeyCode modifier in ((KeyboardShortcut)(ref entry)).Modifiers) { if (!Input.GetKey(modifier)) { return false; } } return Input.GetKeyDown(((KeyboardShortcut)(ref entry)).MainKey); } } public class ConfigManager { internal static bool ConfigChanged; internal static bool VersionChanged; public static void HandleConfigAttributes(Type type, string section, ConfigFile config) { TypeInfo typeInfo = type.GetTypeInfo(); FieldInfo[] fields = typeInfo.GetFields(); foreach (FieldInfo fieldInfo in fields) { if (fieldInfo.IsStatic) { Type fieldType = fieldInfo.FieldType; AutoConfigAttribute customAttribute = fieldInfo.GetCustomAttribute(); if (customAttribute != null) { string name = customAttribute.name; object defaultValue = customAttribute.defaultValue; string desc = customAttribute.desc; fieldInfo.SetValue(null, DualBindToConfig(fieldType, section, config, name, defaultValue, desc)); } } } } private static object DualBindToConfig(Type t, string section, ConfigFile config, string configName, object defaultValue, string configDesc) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Expected O, but got Unknown //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Expected O, but got Unknown //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Expected O, but got Unknown if (string.IsNullOrWhiteSpace(section) || string.IsNullOrWhiteSpace(configName)) { return defaultValue; } ConfigDescription val = new ConfigDescription(configDesc, (AcceptableValueBase)null, Array.Empty()); MethodInfo methodInfo = (from x in typeof(ConfigFile).GetMethods() where x.Name == "Bind" select x).First(); methodInfo = methodInfo.MakeGenericMethod(t); ConfigEntryBase val2 = (ConfigEntryBase)methodInfo.Invoke(config, new object[3] { (object)new ConfigDefinition(section, configName), defaultValue, val }); ConfigEntryBase val3 = (ConfigEntryBase)methodInfo.Invoke(Config.BackupConfig, new object[3] { (object)new ConfigDefinition(Regex.Replace(config.ConfigFilePath, "\\W", "") + " : " + section, configName), defaultValue, val }); if (!ConfigEqual(val3.DefaultValue, val3.BoxedValue)) { bool flag = true; Log.Warning("Syncing config to new version"); val2.BoxedValue = val2.DefaultValue; val3.BoxedValue = val3.DefaultValue; } if (!ConfigEqual(val2.DefaultValue, val2.BoxedValue)) { ConfigChanged = true; } return val2.BoxedValue; } public static T DualBindToConfig(string section, ConfigFile config, string configName, T defaultValue, string configDesc) { return (T)DualBindToConfig(typeof(T), section, config, configName, defaultValue, configDesc); } private static bool ConfigEqual(object a, object b) { if (a.Equals(b)) { return true; } if (float.TryParse(a.ToString(), out var result) && float.TryParse(b.ToString(), out var result2) && (double)Mathf.Abs(result - result2) < 0.0001) { return true; } return false; } } internal class ContentPacks : IContentPackProvider { internal ContentPack contentPack = new ContentPack(); public static List expansionDefs = new List(); public static List bodyPrefabs = new List(); public static List masterPrefabs = new List(); public static List projectilePrefabs = new List(); public static List survivorDefs = new List(); public static List unlockableDefs = new List(); public static List skillFamilies = new List(); public static List skillDefs = new List(); public static List entityStates = new List(); public static List buffDefs = new List(); public static List effectDefs = new List(); public static List itemDefs = new List(); public static List eliteDefs = new List(); public static List artifactDefs = new List(); public static List networkSoundEventDefs = new List(); public static List networkedObjectPrefabs = new List(); public string identifier => "com.RiskOfBrainrot.SwanSongExtended"; public void Initialize() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown ContentManager.collectContentPackProviders += new CollectContentPackProvidersDelegate(ContentManager_collectContentPackProviders); } private void ContentManager_collectContentPackProviders(AddContentPackProviderDelegate addContentPackProvider) { addContentPackProvider.Invoke((IContentPackProvider)(object)this); } public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args) { contentPack.identifier = identifier; contentPack.expansionDefs.Add(expansionDefs.ToArray()); contentPack.bodyPrefabs.Add(bodyPrefabs.ToArray()); contentPack.masterPrefabs.Add(masterPrefabs.ToArray()); contentPack.projectilePrefabs.Add(projectilePrefabs.ToArray()); contentPack.survivorDefs.Add(survivorDefs.ToArray()); contentPack.eliteDefs.Add(eliteDefs.ToArray()); contentPack.itemDefs.Add(itemDefs.ToArray()); contentPack.buffDefs.Add(buffDefs.ToArray()); contentPack.artifactDefs.Add(artifactDefs.ToArray()); contentPack.skillDefs.Add(skillDefs.ToArray()); contentPack.skillFamilies.Add(skillFamilies.ToArray()); contentPack.entityStateTypes.Add(entityStates.ToArray()); contentPack.unlockableDefs.Add(unlockableDefs.ToArray()); contentPack.effectDefs.Add(effectDefs.ToArray()); contentPack.networkSoundEventDefs.Add(networkSoundEventDefs.ToArray()); contentPack.networkedObjectPrefabs.Add(networkedObjectPrefabs.ToArray()); args.ReportProgress(1f); yield break; } public IEnumerator GenerateContentPackAsync(GetContentPackAsyncArgs args) { ContentPack.Copy(contentPack, args.output); args.ReportProgress(1f); yield break; } public IEnumerator FinalizeAsync(FinalizeAsyncArgs args) { args.ReportProgress(1f); yield break; } } public static class EliteModule { public class CustomEliteDef : ScriptableObject { public EliteDef eliteDef; public EliteDef honorEliteDef; public EliteTiers eliteTier; public Color lightColor = Color.clear; public Texture eliteRamp; public Material overlayMaterial; public GameObject spawnEffect; } public enum EliteTiers { Tier1, Tier1AndHalf, Tier2, StormT1, StormT2, Lunar, Other } public static List Elites = new List(); public static Texture defaultShaderRamp = CommonAssets.mainAssetBundle.LoadAsset(CommonAssets.eliteMaterialsPath + "texRampFrenzied.tex"); public static void Init() { RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(AddElites)); } private static void AddElites() { foreach (CustomEliteDef elite in Elites) { switch (elite.eliteTier) { case EliteTiers.Tier1: { ArrayUtils.ArrayAppend(ref EliteAPI.VanillaEliteTiers[1].eliteTypes, ref elite.eliteDef); ref EliteDef[] eliteTypes2 = ref EliteAPI.VanillaEliteTiers[2].eliteTypes; EliteDef val = (((Object)(object)elite.honorEliteDef != (Object)null) ? elite.honorEliteDef : elite.eliteDef); ArrayUtils.ArrayAppend(ref eliteTypes2, ref val); ref EliteDef[] eliteTypes3 = ref EliteAPI.VanillaEliteTiers[3].eliteTypes; val = (((Object)(object)elite.honorEliteDef != (Object)null) ? elite.honorEliteDef : elite.eliteDef); ArrayUtils.ArrayAppend(ref eliteTypes3, ref val); ArrayUtils.ArrayAppend(ref EliteAPI.VanillaEliteTiers[4].eliteTypes, ref elite.eliteDef); break; } case EliteTiers.Tier1AndHalf: { ref EliteDef[] eliteTypes = ref EliteAPI.VanillaEliteTiers[3].eliteTypes; EliteDef val = (((Object)(object)elite.honorEliteDef != (Object)null) ? elite.honorEliteDef : elite.eliteDef); ArrayUtils.ArrayAppend(ref eliteTypes, ref val); ArrayUtils.ArrayAppend(ref EliteAPI.VanillaEliteTiers[4].eliteTypes, ref elite.eliteDef); break; } case EliteTiers.Tier2: ArrayUtils.ArrayAppend(ref EliteAPI.VanillaEliteTiers[5].eliteTypes, ref elite.eliteDef); break; case EliteTiers.StormT1: ArrayUtils.ArrayAppend(ref StormsCore.StormEliteT1.eliteTypes, ref elite.eliteDef); break; case EliteTiers.StormT2: ArrayUtils.ArrayAppend(ref StormsCore.StormEliteT2.eliteTypes, ref elite.eliteDef); break; case EliteTiers.Lunar: ArrayUtils.ArrayAppend(ref EliteAPI.VanillaEliteTiers[6].eliteTypes, ref elite.eliteDef); break; } } } } public static class Spawnlists { public static void Init() { SpawnCards.Init(); DirectorCards.Init(); } public static void AddMonsterCardToSpawnlist(DirectorCardCategorySelection categorySelection, DirectorCard directorCard, MonsterCategory monsterCategory) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Expected I4, but got Unknown categorySelection.AddCard((int)monsterCategory, directorCard); } } public static class SpawnCards { public static bool initialized; public static CharacterSpawnCard AlphaConstruct; public static CharacterSpawnCard Beetle; public static CharacterSpawnCard Lemurian; public static CharacterSpawnCard Larva; public static CharacterSpawnCard Wisp; public static CharacterSpawnCard Jellyfish; public static CharacterSpawnCard BlindPestSnowy; public static CharacterSpawnCard BlindVerminSnowy; public static CharacterSpawnCard Imp; public static CharacterSpawnCard Vulture; public static CharacterSpawnCard Golem; public static CharacterSpawnCard BeetleGuard; public static CharacterSpawnCard Mushrum; public static CharacterSpawnCard Bison; public static CharacterSpawnCard ClayApothecary; public static CharacterSpawnCard ElderLemurian; public static CharacterSpawnCard Parent; public static CharacterSpawnCard Gup; public static CharacterSpawnCard Bronzong; public static CharacterSpawnCard GreaterWisp; public static CharacterSpawnCard TitanBlackBeach; public static CharacterSpawnCard TitanDampCave; public static CharacterSpawnCard TitanGolemPlains; public static CharacterSpawnCard TitanGooLake; public static CharacterSpawnCard Vagrant; public static CharacterSpawnCard BeetleQueen; public static CharacterSpawnCard Dunestrider; public static CharacterSpawnCard MagmaWorm; public static CharacterSpawnCard ImpOverlord; public static CharacterSpawnCard Grovetender; public static CharacterSpawnCard RoboBall; public static CharacterSpawnCard XiConstruct; public static CharacterSpawnCard OverloadingWorm; public static void LoadSpawnCardAsync(string guid, Action callback) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) AssetReferenceT val = new AssetReferenceT(guid); AsyncOperationHandle val2 = AssetAsyncReferenceManager.LoadAsset(val, (AsyncReferenceHandleUnloadType)2); val2.Completed += delegate(AsyncOperationHandle ctx) { CharacterSpawnCard result = ctx.Result; if (callback != null) { callback(result); } }; } public static void Init() { //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_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: 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_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //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_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) if (!initialized) { initialized = true; AlphaConstruct = Addressables.LoadAssetAsync((object)RoR2_DLC1_MajorAndMinorConstruct.cscMinorConstruct_asset).WaitForCompletion(); Beetle = LegacyResourcesAPI.Load("spawncards/characterspawncards/cscbeetle"); Lemurian = LegacyResourcesAPI.Load("spawncards/characterspawncards/csclemurian"); Wisp = LegacyResourcesAPI.Load("spawncards/characterspawncards/csclesserwisp"); Jellyfish = LegacyResourcesAPI.Load("spawncards/characterspawncards/cscjellyfish"); Imp = LegacyResourcesAPI.Load("spawncards/characterspawncards/cscimp"); Vulture = LegacyResourcesAPI.Load("spawncards/characterspawncards/cscvulture"); Golem = Addressables.LoadAssetAsync((object)"RoR2/Base/Golem/cscGolem.asset").WaitForCompletion(); BeetleGuard = LegacyResourcesAPI.Load("spawncards/characterspawncards/cscbeetleguard"); Mushrum = LegacyResourcesAPI.Load("spawncards/characterspawncards/cscminimushroom"); Bison = Addressables.LoadAssetAsync((object)"RoR2/Base/Bison/cscBison.asset").WaitForCompletion(); ElderLemurian = Addressables.LoadAssetAsync((object)"RoR2/Base/LemurianBruiser/cscLemurianBruiser.asset").WaitForCompletion(); Parent = Addressables.LoadAssetAsync((object)"RoR2/Base/Parent/cscParent.asset").WaitForCompletion(); Gup = Addressables.LoadAssetAsync((object)"RoR2/DLC1/Gup/cscGupBody.asset").WaitForCompletion(); Bronzong = LegacyResourcesAPI.Load("spawncards/characterspawncards/cscbell"); GreaterWisp = LegacyResourcesAPI.Load("spawncards/characterspawncards/cscgreaterwisp"); TitanBlackBeach = LegacyResourcesAPI.Load("spawncards/characterspawncards/csctitanblackbeach"); TitanDampCave = LegacyResourcesAPI.Load("spawncards/characterspawncards/csctitandampcave"); TitanGolemPlains = LegacyResourcesAPI.Load("spawncards/characterspawncards/csctitangolemplains"); TitanGooLake = LegacyResourcesAPI.Load("spawncards/characterspawncards/csctitangoolake"); Vagrant = LegacyResourcesAPI.Load("spawncards/characterspawncards/cscvagrant"); BeetleQueen = LegacyResourcesAPI.Load("spawncards/characterspawncards/cscbeetlequeen"); Dunestrider = LegacyResourcesAPI.Load("spawncards/characterspawncards/cscclayboss"); MagmaWorm = LegacyResourcesAPI.Load("spawncards/characterspawncards/cscmagmaworm"); ImpOverlord = LegacyResourcesAPI.Load("spawncards/characterspawncards/cscimpboss"); Grovetender = LegacyResourcesAPI.Load("spawncards/characterspawncards/cscgravekeeper"); RoboBall = LegacyResourcesAPI.Load("spawncards/characterspawncards/cscroboballboss"); OverloadingWorm = LegacyResourcesAPI.Load("spawncards/characterspawncards/cscelectricworm"); BlindVerminSnowy = Addressables.LoadAssetAsync((object)"RoR2/DLC1/Vermin/cscVerminSnowy.asset").WaitForCompletion(); BlindPestSnowy = Addressables.LoadAssetAsync((object)"RoR2/DLC1/FlyingVermin/cscFlyingVerminSnowy.asset").WaitForCompletion(); ClayApothecary = Addressables.LoadAssetAsync((object)"RoR2/DLC1/ClayGrenadier/cscClayGrenadier.asset").WaitForCompletion(); Larva = Addressables.LoadAssetAsync((object)"RoR2/DLC1/AcidLarva/cscAcidLarva.asset").WaitForCompletion(); XiConstruct = Addressables.LoadAssetAsync((object)"RoR2/DLC1/MajorAndMinorConstruct/cscMegaConstruct.asset").WaitForCompletion(); } } } public static class DirectorCards { public static bool initialized; public static DirectorCard AlphaConstruct; public static DirectorCard AlphaConstructNear; public static DirectorCard Beetle; public static DirectorCard Lemurian; public static DirectorCard Larva; public static DirectorCard Wisp; public static DirectorCard Jellyfish; public static DirectorCard BlindPestSnowy; public static DirectorCard BlindVerminSnowy; public static DirectorCard Imp; public static DirectorCard Vulture; public static DirectorCard Golem; public static DirectorCard BeetleGuard; public static DirectorCard Mushrum; public static DirectorCard ClayApothecary; public static DirectorCard Bison; public static DirectorCard BisonLoop; public static DirectorCard ElderLemurian; public static DirectorCard Parent; public static DirectorCard Gup; public static DirectorCard Bronzong; public static DirectorCard GreaterWisp; public static DirectorCard TitanBlackBeach; public static DirectorCard TitanDampCave; public static DirectorCard TitanGolemPlains; public static DirectorCard TitanGooLake; public static DirectorCard Vagrant; public static DirectorCard BeetleQueen; public static DirectorCard Dunestrider; public static DirectorCard MagmaWorm; public static DirectorCard ImpOverlord; public static DirectorCard Grovetender; public static DirectorCard RoboBall; public static DirectorCard OverloadingWorm; public static DirectorCard XiConstruct; public static DirectorCard LunarGolemSkyMeadow; public static DirectorCard LunarGolemSkyMeadowBasic; public static bool logCardInfo; public static void Init() { if (!initialized) { initialized = true; AlphaConstruct = BuildDirectorCard(SpawnCards.AlphaConstruct, 1, 1, (MonsterSpawnDistance)0); AlphaConstructNear = BuildDirectorCard(SpawnCards.AlphaConstruct, 1, 1, (MonsterSpawnDistance)1); Beetle = BuildDirectorCard(SpawnCards.Beetle); Lemurian = BuildDirectorCard(SpawnCards.Lemurian); Larva = BuildDirectorCard(SpawnCards.Larva); Wisp = BuildDirectorCard(SpawnCards.Wisp); Jellyfish = BuildDirectorCard(SpawnCards.Jellyfish, 1, 0, (MonsterSpawnDistance)2); BlindPestSnowy = BuildDirectorCard(SpawnCards.BlindPestSnowy); BlindVerminSnowy = BuildDirectorCard(SpawnCards.BlindVerminSnowy); Imp = BuildDirectorCard(SpawnCards.Imp); Vulture = BuildDirectorCard(SpawnCards.Vulture, 1, 3, (MonsterSpawnDistance)0); Golem = BuildDirectorCard(SpawnCards.Golem); BeetleGuard = BuildDirectorCard(SpawnCards.BeetleGuard); Mushrum = BuildDirectorCard(SpawnCards.Mushrum); ClayApothecary = BuildDirectorCard(SpawnCards.ClayApothecary); Bison = BuildDirectorCard(SpawnCards.Bison, 1, 2, (MonsterSpawnDistance)0); Bronzong = BuildDirectorCard(SpawnCards.Bronzong); GreaterWisp = BuildDirectorCard(SpawnCards.GreaterWisp); ElderLemurian = BuildDirectorCard(SpawnCards.ElderLemurian, 1, 3, (MonsterSpawnDistance)0); Parent = BuildDirectorCard(SpawnCards.Parent, 1, 3, (MonsterSpawnDistance)0); Gup = BuildDirectorCard(SpawnCards.Gup, 1, 3, (MonsterSpawnDistance)0); TitanBlackBeach = BuildDirectorCard(SpawnCards.TitanBlackBeach); TitanDampCave = BuildDirectorCard(SpawnCards.TitanDampCave); TitanGolemPlains = BuildDirectorCard(SpawnCards.TitanGolemPlains); TitanGooLake = BuildDirectorCard(SpawnCards.TitanGooLake); Vagrant = BuildDirectorCard(SpawnCards.Vagrant); BeetleQueen = BuildDirectorCard(SpawnCards.BeetleQueen); Dunestrider = BuildDirectorCard(SpawnCards.Dunestrider); ImpOverlord = BuildDirectorCard(SpawnCards.ImpOverlord, 1, 1, (MonsterSpawnDistance)0); Grovetender = BuildDirectorCard(SpawnCards.Grovetender); RoboBall = BuildDirectorCard(SpawnCards.RoboBall, 1, 3, (MonsterSpawnDistance)0); MagmaWorm = BuildDirectorCard(SpawnCards.MagmaWorm, 1, 2, (MonsterSpawnDistance)0); OverloadingWorm = BuildDirectorCard(SpawnCards.OverloadingWorm); XiConstruct = BuildDirectorCard(SpawnCards.XiConstruct, 1, 2, (MonsterSpawnDistance)0); } } public static DirectorCard BuildDirectorCard(CharacterSpawnCard spawnCard) { return BuildDirectorCard(spawnCard, 1, 0, (MonsterSpawnDistance)0); } public static DirectorCard BuildDirectorCard(CharacterSpawnCard spawnCard, int weight, int minStages, MonsterSpawnDistance spawnDistance) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown return new DirectorCard { spawnCard = (SpawnCard)(object)spawnCard, selectionWeight = weight, preventOverhead = false, minimumStageCompletions = minStages, spawnDistance = spawnDistance }; } public static DirectorCard BuildDirectorCard(InteractableSpawnCard spawnCard, int weight, int minStages) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown return new DirectorCard { spawnCard = (SpawnCard)(object)spawnCard, selectionWeight = weight, preventOverhead = false, minimumStageCompletions = minStages }; } } public static class Hooks { public static void Init() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown GlobalEventManager.OnCharacterDeath += new hook_OnCharacterDeath(SquidOnDeath); } private static void SquidOnDeath(orig_OnCharacterDeath orig, GlobalEventManager self, DamageReport damageReport) { orig.Invoke(self, damageReport); int num = CountSquids(damageReport.victimBody); if (num != 0) { SquidDeathBlast(damageReport.victimBody, num); } } private static void SquidDeathBlast(CharacterBody body, int squidCount) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Expected O, but got Unknown //IL_00a4: Unknown result type (might be due to invalid IL or missing references) float radius = 28f; BlastAttack val = new BlastAttack { baseDamage = (4f + 1f * (float)(squidCount - 1)) * body.damage, radius = radius, procCoefficient = 1f, position = body.transform.position, attacker = ((Component)body).gameObject, baseForce = 900f, crit = Util.CheckRoll(body.crit, body.master), falloffModel = (FalloffModel)0, damageType = DamageTypeCombo.op_Implicit((DamageType)512), teamIndex = TeamComponent.GetObjectTeam(((Component)body).gameObject) }; val.Fire(); } private static int CountSquids(CharacterBody body) { //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_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)body)) { return 0; } TeamIndex teamIndex = body.teamComponent.teamIndex; int num = 0; using (IEnumerator enumerator = CharacterMaster.readOnlyInstancesList.GetEnumerator()) { while (enumerator.MoveNext()) { int itemCountEffective = enumerator.Current.inventory.GetItemCountEffective(Items.Squid); if (itemCountEffective > 0 && enumerator.Current.teamIndex == teamIndex) { num += itemCountEffective; } } } return num; } } internal static class ItemDisplayCheck { public static List allDisplayedItems; public static void PrintUnused(ItemDisplayRuleSet itemDisplayRuleSet, string bodyName = "") { PrintUnused((IEnumerable)itemDisplayRuleSet.keyAssetRuleGroups.ToList(), bodyName); } public static void PrintUnused(IEnumerable ruleSet = null, string bodyName = "") { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0050: 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_0069: 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_0085: Unknown result type (might be due to invalid IL or missing references) string text = "generating item displays for " + bodyName; if (allDisplayedItems == null) { LazyGatherAllItems(); } List list = new List(allDisplayedItems); string text2 = ""; if (ruleSet != null) { foreach (KeyAssetRuleGroup item in ruleSet) { if (item.displayRuleGroup.rules.Length != 0) { list.Remove(item.keyAsset); if (string.IsNullOrEmpty(text2)) { text2 = item.displayRuleGroup.rules[0].childName; } } } } if (string.IsNullOrEmpty(text2)) { text2 = "Chest"; } foreach (Object item2 in list) { string text3 = ""; if (ItemDisplays.KeyAssetDisplayPrefabs.ContainsKey(item2)) { text3 += SpitOutNewRule(item2, text2, ItemDisplays.KeyAssetDisplayPrefabs[item2]); } else { Log.Error($"COULD NOT FIND DISPLAY PREFABS FOR KEYASSET {item2}"); } text += text3; } Log.Message(text); } private static void LazyGatherAllItems() { allDisplayedItems = new List(ItemDisplays.KeyAssetDisplayPrefabs.Keys); allDisplayedItems.Sort(delegate(Object item1, Object item2) { if (item1 is ItemDef && item2 is ItemDef) { return item1.name.CompareTo(item2.name); } if (item1 is EquipmentDef && item2 is EquipmentDef) { return item1.name.CompareTo(item2.name); } if (item1 is ItemDef && item2 is EquipmentDef) { return -1; } return (item1 is EquipmentDef && item2 is ItemDef) ? 1 : 0; }); } private static string SpitOutNewRule(Object asset, string firstCompatibleChild, ItemDisplayRule[] displayRules) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Invalid comparison between Unknown and I4 //IL_00a5: Unknown result type (might be due to invalid IL or missing references) if (displayRules.Length == 0) { return $"\n[NO DISPLAY RULES FOUND FOR THE KEYASSET {asset}"; } string text = "\n itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets[\"" + asset.name + "\"]"; for (int i = 0; i < displayRules.Length; i++) { text = (((int)displayRules[i].limbMask != 0) ? (text + ",\n" + $" ItemDisplays.CreateLimbMaskDisplayRule(LimbFlags.{displayRules[i].limbMask})") : (text + ",\n ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay(\"" + ((Object)displayRules[i].followerPrefab).name + "\"),\n \"" + firstCompatibleChild + "\",\n new Vector3(2, 2, 2),\n new Vector3(0, 0, 0),\n new Vector3(1, 1, 1)\n )")); } return text + "\n ));"; } } internal static class ItemDisplays { private static Dictionary itemDisplayPrefabs = new Dictionary(); public static Dictionary KeyAssetDisplayPrefabs = new Dictionary(); public static Dictionary KeyAssets = new Dictionary(); public static int queuedDisplays; public static bool initialized = false; public static void LazyInit() { if (!initialized) { initialized = true; PopulateDisplays(); } } internal static void DisposeWhenDone() { queuedDisplays--; if (queuedDisplays <= 0 && initialized) { initialized = false; itemDisplayPrefabs = null; KeyAssetDisplayPrefabs = null; KeyAssets = null; } } internal static void PopulateDisplays() { PopulateFromBody("LoaderBody"); } private static void PopulateFromBody(string bodyName) { ItemDisplayRuleSet itemDisplayRuleSet = ((Component)LegacyResourcesAPI.Load("Prefabs/CharacterBodies/" + bodyName).GetComponent().modelTransform).GetComponent().itemDisplayRuleSet; KeyAssetRuleGroup[] keyAssetRuleGroups = itemDisplayRuleSet.keyAssetRuleGroups; for (int i = 0; i < keyAssetRuleGroups.Length; i++) { ItemDisplayRule[] rules = keyAssetRuleGroups[i].displayRuleGroup.rules; KeyAssetDisplayPrefabs[keyAssetRuleGroups[i].keyAsset] = rules; KeyAssets[keyAssetRuleGroups[i].keyAsset.name] = keyAssetRuleGroups[i].keyAsset; for (int j = 0; j < rules.Length; j++) { GameObject followerPrefab = rules[j].followerPrefab; if (Object.op_Implicit((Object)(object)followerPrefab)) { string key = ((Object)followerPrefab).name?.ToLowerInvariant(); if (!itemDisplayPrefabs.ContainsKey(key)) { itemDisplayPrefabs[key] = followerPrefab; } } } } } private static void PopulateCustomLightningArm() { GameObject val = PrefabAPI.InstantiateClone(itemDisplayPrefabs["displaylightningarmright"], "DisplayLightningCustom", false); LimbMatcher component = val.GetComponent(); component.limbPairs[0].targetChildLimb = "LightningArm1"; component.limbPairs[1].targetChildLimb = "LightningArm2"; component.limbPairs[2].targetChildLimb = "LightningArmEnd"; itemDisplayPrefabs["displaylightningarmcustom"] = val; } public static GameObject LoadDisplay(string name) { if (itemDisplayPrefabs.ContainsKey(name.ToLowerInvariant()) && Object.op_Implicit((Object)(object)itemDisplayPrefabs[name.ToLowerInvariant()])) { return itemDisplayPrefabs[name.ToLowerInvariant()]; } Log.Error("item display " + name + " returned null"); return null; } public static KeyAssetRuleGroup CreateDisplayRuleGroupWithRules(string itemName, params ItemDisplayRule[] rules) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) return CreateDisplayRuleGroupWithRules(GetKeyAssetFromString(itemName), rules); } public static KeyAssetRuleGroup CreateDisplayRuleGroupWithRules(Object keyAsset_, params ItemDisplayRule[] rules) { //IL_0019: 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_0039: 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_0040: 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) if (keyAsset_ == (Object)null) { Log.Error("could not find keyasset"); } KeyAssetRuleGroup result = default(KeyAssetRuleGroup); result.keyAsset = keyAsset_; result.displayRuleGroup = new DisplayRuleGroup { rules = rules }; return result; } public static ItemDisplayRule CreateDisplayRule(string prefabName, string childName, Vector3 position, Vector3 rotation, Vector3 scale) { //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) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) return CreateDisplayRule(LoadDisplay(prefabName), childName, position, rotation, scale); } public static ItemDisplayRule CreateDisplayRule(GameObject itemPrefab, string childName, Vector3 position, Vector3 rotation, Vector3 scale) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: 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_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0043: 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) ItemDisplayRule result = default(ItemDisplayRule); result.ruleType = (ItemDisplayRuleType)0; result.childName = childName; result.followerPrefab = itemPrefab; result.limbMask = (LimbFlags)0; result.localPos = position; result.localAngles = rotation; result.localScale = scale; return result; } public static ItemDisplayRule CreateLimbMaskDisplayRule(LimbFlags limb) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) ItemDisplayRule result = default(ItemDisplayRule); result.ruleType = (ItemDisplayRuleType)1; result.limbMask = limb; result.childName = ""; result.followerPrefab = null; return result; } private static Object GetKeyAssetFromString(string itemName) { Object val = (Object)(object)LegacyResourcesAPI.Load("ItemDefs/" + itemName); if (val == (Object)null) { val = (Object)(object)LegacyResourcesAPI.Load("EquipmentDefs/" + itemName); } if (val == (Object)null) { Log.Error("Could not load keyasset for " + itemName); } return val; } } internal static class Language { public static class Styling { public static string ConvertDecimal(float value) { return value * 100f + "%"; } public static string DamageColor(string text) { return "" + text + ""; } public static string HealingColor(string text) { return "" + text + ""; } public static string DamageValueText(float value) { return DamageColor(ConvertDecimal(value) + " damage"); } public static string UtilityColor(string text) { return "" + text + ""; } public static string RedText(string text) { return HealthColor(text); } public static string HealthColor(string text) { return "" + text + ""; } public static string KeywordText(string keyword, string sub) { return "" + keyword + "" + sub + ""; } public static string ScepterDescription(string desc) { return "\nSCEPTER: " + desc + ""; } public static string VoidColor(string text) { return "" + text + ""; } public static string StackText(string text) { return StackColor("(" + text + " per stack)"); } public static string StackColor(string text) { return "" + text + ""; } public static string GetAchievementNameToken(string identifier) { return "ACHIEVEMENT_" + identifier.ToUpperInvariant() + "_NAME"; } public static string GetAchievementDescriptionToken(string identifier) { return "ACHIEVEMENT_" + identifier.ToUpperInvariant() + "_DESCRIPTION"; } public static string NumToAdj(int num) { return num switch { 1 => num + "st", 2 => num + "nd", 3 => num + "rd", _ => num + "th", }; } } public static string TokensOutput = ""; public static bool usingLanguageFolder = false; public static bool printingEnabled = false; public static void Init() { if (usingLanguageFolder) { Language.collectLanguageRootFolders += Language_collectLanguageRootFolders; } } private static void Language_collectLanguageRootFolders(List obj) { string text = Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)SwanSongPlugin.instance).Info.Location), "Language"); if (Directory.Exists(text)) { obj.Add(text); } } public static void Add(string token, string text) { if (!usingLanguageFolder) { LanguageAPI.Add(token, text); } if (printingEnabled) { TokensOutput = TokensOutput + "\n \"" + token + "\" : \"" + text.Replace(Environment.NewLine, "\\n").Replace("\n", "\\n") + "\","; } } public static void TryPrintOutput(string fileName = "") { if (usingLanguageFolder && printingEnabled) { PrintOutput(fileName); } } public static void PrintOutput(string fileName = "") { if (printingEnabled) { string text = "{\n strings:\n {" + TokensOutput + "\n }\n}"; Log.Message(fileName + ": \n" + text); if (!string.IsNullOrEmpty(fileName)) { string path = Path.Combine(Directory.GetParent(((BaseUnityPlugin)SwanSongPlugin.instance).Info.Location).FullName, "Language", "en", fileName); File.WriteAllText(path, text); } TokensOutput = ""; } } } internal static class Skins { internal struct SkinDefInfo { internal SkinDef[] BaseSkins; internal Sprite Icon; internal string NameToken; internal UnlockableDef UnlockableDef; internal GameObject RootObject; internal RendererInfo[] RendererInfos; internal MeshReplacement[] MeshReplacements; internal GameObjectActivation[] GameObjectActivations; internal ProjectileGhostReplacement[] ProjectileGhostReplacements; internal MinionSkinReplacement[] MinionSkinReplacements; internal string Name; } internal static SkinDef CreateSkinDef(string skinName, Sprite skinIcon, RendererInfo[] defaultRendererInfos, GameObject root, UnlockableDef unlockableDef = null) { //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Expected O, but got Unknown //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Expected O, but got Unknown SkinDefInfo skinDefInfo = default(SkinDefInfo); skinDefInfo.BaseSkins = Array.Empty(); skinDefInfo.GameObjectActivations = (GameObjectActivation[])(object)new GameObjectActivation[0]; skinDefInfo.Icon = skinIcon; skinDefInfo.MeshReplacements = (MeshReplacement[])(object)new MeshReplacement[0]; skinDefInfo.MinionSkinReplacements = (MinionSkinReplacement[])(object)new MinionSkinReplacement[0]; skinDefInfo.Name = skinName; skinDefInfo.NameToken = skinName; skinDefInfo.ProjectileGhostReplacements = (ProjectileGhostReplacement[])(object)new ProjectileGhostReplacement[0]; skinDefInfo.RendererInfos = (RendererInfo[])(object)new RendererInfo[defaultRendererInfos.Length]; skinDefInfo.RootObject = root; skinDefInfo.UnlockableDef = unlockableDef; SkinDefInfo skinDefInfo2 = skinDefInfo; SkinDef.Awake += new hook_Awake(DoNothing); SkinDef val = ScriptableObject.CreateInstance(); val.baseSkins = skinDefInfo2.BaseSkins; val.icon = skinDefInfo2.Icon; val.unlockableDef = skinDefInfo2.UnlockableDef; val.rootObject = skinDefInfo2.RootObject; defaultRendererInfos.CopyTo(skinDefInfo2.RendererInfos, 0); val.rendererInfos = skinDefInfo2.RendererInfos; val.gameObjectActivations = skinDefInfo2.GameObjectActivations; val.meshReplacements = skinDefInfo2.MeshReplacements; val.projectileGhostReplacements = skinDefInfo2.ProjectileGhostReplacements; val.minionSkinReplacements = skinDefInfo2.MinionSkinReplacements; val.nameToken = skinDefInfo2.NameToken; ((Object)val).name = skinDefInfo2.Name; SkinDef.Awake -= new hook_Awake(DoNothing); return val; } private static void DoNothing(orig_Awake orig, SkinDef self) { } private static RendererInfo[] getRendererMaterials(RendererInfo[] defaultRenderers, params Material[] materials) { RendererInfo[] array = (RendererInfo[])(object)new RendererInfo[defaultRenderers.Length]; defaultRenderers.CopyTo(array, 0); for (int i = 0; i < array.Length; i++) { try { array[i].defaultMaterial = materials[i]; } catch { Log.Error("error adding skin rendererinfo material. make sure you're not passing in too many"); } } return array; } internal static MeshReplacement[] getMeshReplacements(AssetBundle assetBundle, RendererInfo[] defaultRendererInfos, params string[] meshes) { //IL_001d: 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) List list = new List(); for (int i = 0; i < defaultRendererInfos.Length; i++) { if (!string.IsNullOrEmpty(meshes[i])) { list.Add(new MeshReplacement { renderer = defaultRendererInfos[i].renderer, mesh = assetBundle.LoadAsset(meshes[i]) }); } } return list.ToArray(); } } } namespace SwanSongExtended.Modules.BaseStates { public abstract class BaseMeleeAttack : BaseSkillState, IStepSetter { public int swingIndex; protected string hitboxGroupName = "SwordGroup"; protected DamageType damageType = (DamageType)0; protected float damageCoefficient = 3.5f; protected float procCoefficient = 1f; protected float pushForce = 300f; protected Vector3 bonusForce = Vector3.zero; protected float baseDuration = 1f; protected float attackStartPercentTime = 0.2f; protected float attackEndPercentTime = 0.4f; protected float earlyExitPercentTime = 0.4f; protected float hitStopDuration = 0.012f; protected float attackRecoil = 0.75f; protected float hitHopVelocity = 4f; protected string swingSoundString = ""; protected string hitSoundString = ""; protected string muzzleString = "SwingCenter"; protected string playbackRateParam = "Slash.playbackRate"; protected GameObject swingEffectPrefab; protected GameObject hitEffectPrefab; protected NetworkSoundEventIndex impactSound = (NetworkSoundEventIndex)(-1); public float duration; private bool hasFired; private float hitPauseTimer; private OverlapAttack attack; protected bool inHitPause; private bool hasHopped; protected float stopwatch; protected Animator animator; private HitStopCachedState hitStopCachedState; private Vector3 storedVelocity; public override void OnEnter() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown //IL_0054: 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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_0121: 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) ((BaseState)this).OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; animator = ((EntityState)this).GetModelAnimator(); ((BaseState)this).StartAimMode(0.5f + duration, false); PlayAttackAnimation(); attack = new OverlapAttack(); attack.damageType = DamageTypeCombo.op_Implicit(damageType); attack.attacker = ((EntityState)this).gameObject; attack.inflictor = ((EntityState)this).gameObject; attack.teamIndex = ((BaseState)this).GetTeam(); attack.damage = damageCoefficient * ((BaseState)this).damageStat; attack.procCoefficient = procCoefficient; attack.hitEffectPrefab = hitEffectPrefab; attack.forceVector = bonusForce; attack.pushAwayForce = pushForce; attack.hitBoxGroup = ((BaseState)this).FindHitBoxGroup(hitboxGroupName); attack.isCrit = ((BaseState)this).RollCrit(); attack.impactSound = impactSound; } protected virtual void PlayAttackAnimation() { ((EntityState)this).PlayCrossfade("Gesture, Override", "Slash" + (1 + swingIndex), playbackRateParam, duration, 0.05f); } public override void OnExit() { if (inHitPause) { RemoveHitstop(); } ((EntityState)this).OnExit(); } protected virtual void PlaySwingEffect() { EffectManager.SimpleMuzzleFlash(swingEffectPrefab, ((EntityState)this).gameObject, muzzleString, false); } protected virtual void OnHitEnemyAuthority() { Util.PlaySound(hitSoundString, ((EntityState)this).gameObject); if (!hasHopped) { if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !((EntityState)this).characterMotor.isGrounded && hitHopVelocity > 0f) { ((BaseState)this).SmallHop(((EntityState)this).characterMotor, hitHopVelocity); } hasHopped = true; } ApplyHitstop(); } protected void ApplyHitstop() { //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_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) if (!inHitPause && hitStopDuration > 0f) { storedVelocity = ((EntityState)this).characterMotor.velocity; hitStopCachedState = ((BaseState)this).CreateHitStopCachedState(((EntityState)this).characterMotor, animator, playbackRateParam); hitPauseTimer = hitStopDuration / ((BaseState)this).attackSpeedStat; inHitPause = true; } } private void FireAttack() { if (((EntityState)this).isAuthority && attack.Fire((List)null)) { OnHitEnemyAuthority(); } } private void EnterAttack() { hasFired = true; Util.PlayAttackSpeedSound(swingSoundString, ((EntityState)this).gameObject, ((BaseState)this).attackSpeedStat); PlaySwingEffect(); if (((EntityState)this).isAuthority) { ((BaseState)this).AddRecoil(-1f * attackRecoil, -2f * attackRecoil, -0.5f * attackRecoil, 0.5f * attackRecoil); } } public override void FixedUpdate() { //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); hitPauseTimer -= Time.fixedDeltaTime; if (hitPauseTimer <= 0f && inHitPause) { RemoveHitstop(); } if (!inHitPause) { stopwatch += Time.fixedDeltaTime; } else { if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.velocity = Vector3.zero; } if (Object.op_Implicit((Object)(object)animator)) { animator.SetFloat(playbackRateParam, 0f); } } bool flag = stopwatch >= duration * attackStartPercentTime; bool flag2 = stopwatch >= duration * attackEndPercentTime; if ((flag && !flag2) || (flag && flag2 && !hasFired)) { if (!hasFired) { EnterAttack(); } FireAttack(); } if (stopwatch >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } private void RemoveHitstop() { //IL_0003: 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) ((BaseState)this).ConsumeHitStopCachedState(hitStopCachedState, ((EntityState)this).characterMotor, animator); inHitPause = false; ((EntityState)this).characterMotor.velocity = storedVelocity; } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0023: 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_0026: Unknown result type (might be due to invalid IL or missing references) if (stopwatch >= duration * earlyExitPercentTime) { return (InterruptPriority)0; } return (InterruptPriority)1; } public override void OnSerialize(NetworkWriter writer) { ((BaseSkillState)this).OnSerialize(writer); writer.Write(swingIndex); } public override void OnDeserialize(NetworkReader reader) { ((BaseSkillState)this).OnDeserialize(reader); swingIndex = reader.ReadInt32(); } public void SetStep(int i) { swingIndex = i; } } public class BaseTimedSkillState : BaseSkillState { public float TimedBaseDuration; public float TimedBaseCastStartTime; public float TimedBaseCastEndTime; protected float duration; protected float castStartPercentTime; protected float castEndPercentTime; protected bool hasFired; protected bool isFiring; protected bool hasExited; protected virtual void InitDurationValues(float baseDuration, float castStartPercentTime, float castEndPercentTime = 1f) { TimedBaseDuration = baseDuration; TimedBaseCastStartTime = castStartPercentTime; TimedBaseCastEndTime = castEndPercentTime; duration = TimedBaseDuration / ((BaseState)this).attackSpeedStat; this.castStartPercentTime = castStartPercentTime * duration; this.castEndPercentTime = castEndPercentTime * duration; } protected virtual void OnCastEnter() { } protected virtual void OnCastFixedUpdate() { } protected virtual void OnCastUpdate() { } protected virtual void OnCastExit() { } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (!hasFired && ((EntityState)this).fixedAge > castStartPercentTime) { hasFired = true; OnCastEnter(); } bool flag = ((EntityState)this).fixedAge >= castStartPercentTime; bool flag2 = ((EntityState)this).fixedAge >= castEndPercentTime; isFiring = false; if ((flag && !flag2) || (flag && flag2 && !hasFired)) { isFiring = true; OnCastFixedUpdate(); } if (flag2 && !hasExited) { hasExited = true; OnCastExit(); } if (((EntityState)this).fixedAge > duration) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void Update() { ((EntityState)this).Update(); if (isFiring) { OnCastUpdate(); } } } public class ExampleTimedSkillState : BaseTimedSkillState { public static float SkillBaseDuration = 1.5f; public static float SkillStartTime = 0.2f; public static float SkillEndTime = 0.9f; public override void OnEnter() { ((BaseState)this).OnEnter(); InitDurationValues(SkillBaseDuration, SkillStartTime, SkillEndTime); } protected override void OnCastEnter() { } protected override void OnCastFixedUpdate() { } protected override void OnCastExit() { } } public class ExampleDelayedSkillState : BaseTimedSkillState { public static float SkillBaseDuration = 1.5f; public static float SkillStartTime = 0.2f; public override void OnEnter() { ((BaseState)this).OnEnter(); InitDurationValues(SkillBaseDuration, SkillStartTime); } protected override void OnCastEnter() { } } } namespace SwanSongExtended.Modules.Achievements { public abstract class BaseMasteryAchievement : BaseAchievement { public abstract string RequiredCharacterBody { get; } public abstract float RequiredDifficultyCoefficient { get; } public override BodyIndex LookUpRequiredBodyIndex() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) return BodyCatalog.FindBodyIndex(RequiredCharacterBody); } public override void OnBodyRequirementMet() { ((BaseAchievement)this).OnBodyRequirementMet(); Run.onClientGameOverGlobal += OnClientGameOverGlobal; } public override void OnBodyRequirementBroken() { Run.onClientGameOverGlobal -= OnClientGameOverGlobal; ((BaseAchievement)this).OnBodyRequirementBroken(); } private void OnClientGameOverGlobal(Run run, RunReport runReport) { //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_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Invalid comparison between Unknown and I4 //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Invalid comparison between Unknown and I4 if (!Object.op_Implicit((Object)(object)runReport.gameEnding) || !runReport.gameEnding.isWin) { return; } DifficultyIndex val = runReport.ruleBook.FindDifficulty(); DifficultyDef difficultyDef = DifficultyCatalog.GetDifficultyDef(val); if (difficultyDef != null) { bool flag = difficultyDef.countsAsHardMode && difficultyDef.scalingValue >= RequiredDifficultyCoefficient; bool flag2 = difficultyDef.nameToken == "INFERNO_NAME"; bool flag3 = (int)val >= 3 && (int)val <= 10; if (flag || flag2 || flag3) { ((BaseAchievement)this).Grant(); } } } } } namespace SwanSongExtended.Scavengers { public abstract class TwistedScavengerBase : TwistedScavengerBase where T : TwistedScavengerBase { public static T instance { get; private set; } public TwistedScavengerBase() { if (instance != null) { throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting ItemBoilerplate/Item was instantiated twice"); } instance = this as T; } } public abstract class TwistedScavengerBase : SharedBase { public static string baseTscavTokenName = "BorboTScav"; private MultiCharacterSpawnCard twistedScavengerSpawnCard = LegacyResourcesAPI.Load("SpawnCards/CharacterSpawnCards/cscScavLunar"); public GameObject ScavObject; public CharacterBody ScavBody; public abstract string ScavName { get; } public abstract string ScavTitle { get; } public abstract string ScavLangTokenName { get; } public abstract string ScavEquipName { get; } public virtual List ItemDefInfos { get; set; } = new List(); public virtual List ItemInfos { get; set; } = new List(); public virtual string ScavFullNameOverride { get; set; } = ""; public abstract void PopulateItemInfos(ConfigFile config); public abstract void Init(ConfigFile config); internal void AddItemDefInfo(ItemDef itemDef, int count) { //IL_0010: 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) if (count > 0) { ItemDefInfo item = default(ItemDefInfo); item.itemDef = itemDef; item.count = count; ItemDefInfos.Add(item); } } internal void AddItemInfo(string name, int count) { //IL_0010: 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) if (count > 0) { ItemInfo item = default(ItemInfo); item.itemString = name; item.count = count; ItemInfos.Add(item); } } internal void GenerateTwistedScavenger() { string text = ((ScavFullNameOverride == "") ? (ScavName + " the " + ScavTitle) : ScavFullNameOverride); Debug.Log((object)("Generating Twisted Scavenger: " + text)); string text2 = baseTscavTokenName + ScavLangTokenName; LanguageAPI.Add(text2, text); GameObject val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("prefabs/charactermasters/ScavLunar1Master"), text2 + "Master", true); GameObject val2 = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("prefabs/characterbodies/ScavLunar1Body"), text2 + "Body", true); CharacterMaster component = val.GetComponent(); component.bodyPrefab = val2; CharacterBody component2 = val2.GetComponent(); component2.baseNameToken = text2; int num = twistedScavengerSpawnCard.masterPrefabs.Length; ArrayUtils.ArrayAppend(ref twistedScavengerSpawnCard.masterPrefabs, ref num, ref val); GivePickupsOnStart[] components = val.GetComponents(); foreach (GivePickupsOnStart val3 in components) { ((Behaviour)val3).enabled = false; } GivePickupsOnStart val4 = val.AddComponent(); val4.itemDefInfos = ItemDefInfos.ToArray(); val4.itemInfos = ItemInfos.ToArray(); if (ScavEquipName != "") { val4.equipmentString = ScavEquipName; } Content.AddCharacterBodyPrefab(val2); Content.AddMasterPrefab(val); ScavBody = component2; ScavObject = val2; } } } namespace SwanSongExtended.Skills { internal class VoidLaserTurbineSkill : SkillBase { public static GameObject tracerLaser; [AutoConfig("Damage Coefficient", 32f)] public static float damageCoefficient = 32f; [AutoConfig("Proc Coefficient", 1f)] public static float procCoefficient = 1f; [AutoConfig("Base Duration", 0.5f)] public static float baseDuration = 0.5f; [AutoConfig("Force", 2500f)] public static float force = 2500f; [AutoConfig("Self Force", 1500f)] public static float selfForce = 1500f; public static string _SkillName = "Heaven-Piercer"; public override string ConfigName => "Skills : Misc : HeavenPiercer"; public override string SkillName => _SkillName; public override string SkillDescription => "Fire a " + Language.Styling.VoidColor("devastating laser beam") + ", piercing ALL enemies and terrain for " + Language.Styling.DamageValueText(VoidLaserBeam.damageCoefficient) + "."; public override string SkillLangTokenName => "VOIDLASERTURBINESKILL"; public override UnlockableDef UnlockDef => null; public override Sprite Icon => assetBundle.LoadAsset("Assets/Icons/heavenpiercer.png"); public override Type ActivationState => typeof(VoidLaserBeam); public override string CharacterName => ""; public override SkillSlot SkillSlot => (SkillSlot)0; public override float BaseCooldown => 0f; public override InterruptPriority InterruptPriority => (InterruptPriority)2; public override Type BaseSkillDef => typeof(SkillDef); public override SimpleSkillData SkillData => new SimpleSkillData(1, beginSkillCooldownOnSkillEnd: false, canceledFromSprinting: false, cancelSprintingOnActivation: true, forceSprintingDuringState: false, dontAllowPastMaxStocks: true, fullRestockOnAssign: true, isCombatSkill: true, mustKeyPress: true, 0); public override void Hooks() { } public override void Init() { CreateTracer(); base.Init(); } private void CreateTracer() { //IL_0054: 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_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) tracerLaser = PrefabAPI.InstantiateClone(Resources.Load("prefabs/effects/tracers/TracerGolem"), "VoidTurbineLaser", false); Tracer component = tracerLaser.GetComponent(); component.speed = 200f; component.length = 50f; component.beamDensity = 100f; VFXAttributes val = tracerLaser.AddComponent(); val.vfxPriority = (VFXPriority)2; val.vfxIntensity = (VFXIntensity)2; Tools.GetParticle(tracerLaser, "SmokeBeam", new Color(0.15f, 0.05f, 0.3f), 5f); MainModule main = tracerLaser.GetComponentInChildren().main; ((MainModule)(ref main)).startSizeXMultiplier = ((MainModule)(ref main)).startSizeXMultiplier * 5f; ((MainModule)(ref main)).startSizeYMultiplier = ((MainModule)(ref main)).startSizeYMultiplier * 5f; ((MainModule)(ref main)).startSizeZMultiplier = ((MainModule)(ref main)).startSizeZMultiplier * 0.1f; Content.CreateAndAddEffectDef(tracerLaser); } } public abstract class SkillBase : SkillBase where T : SkillBase { public static T instance { get; private set; } public SkillBase() { if (instance != null) { throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting SwanSongExtended " + typeof(SkillBase).Name + " was instantiated twice"); } instance = this as T; } } public abstract class SkillBase : SharedBase { public class SimpleSkillData { internal int baseMaxStock; internal bool beginSkillCooldownOnSkillEnd; internal bool canceledFromSprinting; internal bool cancelSprintingOnActivation; internal bool forceSprintingDuringState; internal bool dontAllowPastMaxStocks; internal bool fullRestockOnAssign; internal bool isCombatSkill; internal bool mustKeyPress; internal int rechargeStock; internal int requiredStock; internal bool resetCooldownTimerOnUse; internal int stockToConsume; public SimpleSkillData(int baseMaxStock = 1, bool beginSkillCooldownOnSkillEnd = false, bool canceledFromSprinting = false, bool cancelSprintingOnActivation = true, bool forceSprintingDuringState = false, bool dontAllowPastMaxStocks = true, bool fullRestockOnAssign = true, bool isCombatSkill = true, bool mustKeyPress = false, int rechargeStock = 1, int requiredStock = 1, bool resetCooldownTimerOnUse = false, int stockToConsume = 1) { this.baseMaxStock = baseMaxStock; this.beginSkillCooldownOnSkillEnd = beginSkillCooldownOnSkillEnd; this.canceledFromSprinting = canceledFromSprinting; this.cancelSprintingOnActivation = cancelSprintingOnActivation; this.forceSprintingDuringState = forceSprintingDuringState; this.dontAllowPastMaxStocks = dontAllowPastMaxStocks; this.fullRestockOnAssign = fullRestockOnAssign; this.isCombatSkill = isCombatSkill; this.mustKeyPress = mustKeyPress; this.rechargeStock = rechargeStock; this.requiredStock = requiredStock; this.resetCooldownTimerOnUse = resetCooldownTimerOnUse; this.stockToConsume = stockToConsume; } } public static string Token = "FRUITSKILL"; public string[] KeywordTokens; private SkillDef _SkillDef; public override AssetBundle assetBundle => SwanSongPlugin.mainAssetBundle; public abstract string SkillName { get; } public abstract string SkillDescription { get; } public abstract string SkillLangTokenName { get; } public abstract UnlockableDef UnlockDef { get; } public abstract Sprite Icon { get; } public abstract Type ActivationState { get; } public abstract Type BaseSkillDef { get; } public abstract string CharacterName { get; } public abstract SkillSlot SkillSlot { get; } public abstract float BaseCooldown { get; } public abstract InterruptPriority InterruptPriority { get; } public abstract SimpleSkillData SkillData { get; } public virtual string ActivationStateMachineName { get; set; } = "Weapon"; public SkillDef SkillDef { get { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown if ((Object)(object)_SkillDef == (Object)null) { _SkillDef = (SkillDef)ScriptableObject.CreateInstance(BaseSkillDef); } return _SkillDef; } set { _SkillDef = value; } } public override void Init() { base.Init(); CreateSkill(); AddSkillToSkillFamily(); } public override void Lang() { LanguageAPI.Add(Token + SkillLangTokenName, SkillName); LanguageAPI.Add(Token + SkillLangTokenName + "_DESCRIPTION", SkillDescription); } public Sprite LoadSpriteFromBundle(string name) { return assetBundle.LoadAsset("Skill/" + name + ".png"); } public Sprite LoadSpriteFromRor(string path) { //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) return Addressables.LoadAssetAsync((object)path).WaitForCompletion(); } public Sprite LoadSpriteFromRorSkill(string path) { //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) return Addressables.LoadAssetAsync((object)path).WaitForCompletion().icon; } private void CreateSkill() { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown if ((Object)(object)SkillDef == (Object)null) { SkillDef = (SkillDef)ScriptableObject.CreateInstance(BaseSkillDef); } Content.AddEntityState(ActivationState); SkillDef.activationState = new SerializableEntityStateType(ActivationState); SkillDef.skillNameToken = Token + SkillLangTokenName; SkillDef.skillName = SkillName; SkillDef.skillDescriptionToken = Token + SkillLangTokenName + "_DESCRIPTION"; SkillDef.activationStateMachineName = ActivationStateMachineName; SkillDef.keywordTokens = KeywordTokens; SkillDef.icon = Icon; SkillDef.baseRechargeInterval = Bind(BaseCooldown, "Base Cooldown"); SkillDef.baseMaxStock = Bind(SkillData.baseMaxStock, "Base Max Stock"); SkillDef.rechargeStock = Mathf.Min(Bind(SkillData.rechargeStock, "Recharge Stock"), SkillDef.baseMaxStock); SkillDef.interruptPriority = InterruptPriority; SkillDef.beginSkillCooldownOnSkillEnd = SkillData.beginSkillCooldownOnSkillEnd; SkillDef.dontAllowPastMaxStocks = SkillData.dontAllowPastMaxStocks; SkillDef.fullRestockOnAssign = SkillData.fullRestockOnAssign; SkillDef.isCombatSkill = Bind(SkillData.isCombatSkill, "Is Combat Skill"); SkillDef.mustKeyPress = Bind(SkillData.mustKeyPress, "Must Key Press", "Setting to FALSE will allow the skill to be recast after it ends as long as the button is held."); SkillDef.requiredStock = SkillData.requiredStock; SkillDef.resetCooldownTimerOnUse = SkillData.resetCooldownTimerOnUse; SkillDef.stockToConsume = SkillData.stockToConsume; SkillDef.cancelSprintingOnActivation = Bind(SkillData.cancelSprintingOnActivation, "Cancels Sprinting", "Recommended to use HuntressBuffULTIMATE for intended behavior."); SkillDef.forceSprintDuringState = Bind(SkillData.forceSprintingDuringState, "Force Sprinting During State", "Used by mobility skills."); SkillDef.canceledFromSprinting = !SwanSongPlugin.autosprintLoaded && SkillData.cancelSprintingOnActivation && !SkillData.forceSprintingDuringState && Bind(SkillData.canceledFromSprinting, "Canceled From Sprinting", "Note: Only set to true if AUTOSPRINT isnt loaded, the skill cancels sprinting, and the skill doesn't force sprinting. This avoids situations where the skill can cancel itself without additional input."); Content.AddSkillDef(SkillDef); } protected void AddSkillToSkillFamily() { //IL_00ad: 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_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Expected I4, but got Unknown //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Expected O, but got Unknown //IL_01af: 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) if (string.IsNullOrEmpty(CharacterName)) { return; } string text = Log.Combine("Skills", SkillName); string characterName = CharacterName; SkillLocator val; if (SwanSongExtended.Modules.Skills.characterSkillLocators.ContainsKey(characterName)) { val = SwanSongExtended.Modules.Skills.characterSkillLocators[characterName]; } else { GameObject val2 = LegacyResourcesAPI.Load("prefabs/characterbodies/" + characterName); val = ((val2 != null) ? val2.GetComponent() : null); if (Object.op_Implicit((Object)(object)val)) { SwanSongExtended.Modules.Skills.characterSkillLocators.Add(characterName, val); } } if ((Object)(object)val != (Object)null) { SkillFamily val3 = null; SkillSlot skillSlot = SkillSlot; SkillSlot val4 = skillSlot; switch (val4 - -1) { case 1: val3 = val.primary.skillFamily; break; case 2: val3 = val.secondary.skillFamily; break; case 3: val3 = val.utility.skillFamily; break; case 4: val3 = val.special.skillFamily; break; case 0: Log.Warning(text + "Special case!"); break; } if ((Object)(object)val3 != (Object)null) { Log.Debug(text + "initializing!"); Array.Resize(ref val3.variants, val3.variants.Length + 1); Variant[] variants = val3.variants; int num = val3.variants.Length - 1; Variant val5 = new Variant { skillDef = SkillDef, unlockableDef = UnlockDef }; ((Variant)(ref val5)).viewableNode = new Node(SkillDef.skillNameToken, false, (Node)null); variants[num] = val5; Log.Debug(text + "success!"); } else { string[] obj = new string[5] { text, "No skill family ", null, null, null }; SkillSlot skillSlot2 = SkillSlot; obj[2] = ((object)(SkillSlot)(ref skillSlot2)).ToString(); obj[3] = " found from "; obj[4] = CharacterName; Log.Error(string.Concat(obj)); } } else { Log.Error(text + "No skill locator found from " + CharacterName); } } internal UnlockableDef GetUnlockDef(Type type) { return null; } } public enum SkillFamilyName { Misc = -1, Passive, Primary, Secondary, Utility, Special } } namespace SwanSongExtended.Skills.SkillDefTypes { internal class DualSkillDef : SkillDef { private class InstanceData : BaseSkillInstanceData { private CharacterBody _body; public bool isPlayerControlled { get { if ((Object)(object)body == (Object)null) { return false; } return body.isPlayerControlled; } } public CharacterBody body { get { return _body; } set { if (!((Object)(object)_body == (Object)(object)value)) { _body = value; } } } } public SerializableEntityStateType alternateActivationState; public override BaseSkillInstanceData OnAssigned(GenericSkill skillSlot) { return (BaseSkillInstanceData)(object)new InstanceData { body = skillSlot.characterBody }; } public override void OnUnassigned(GenericSkill skillSlot) { ((InstanceData)(object)skillSlot.skillInstanceData).body = null; } public override EntityState InstantiateNextState(GenericSkill skillSlot) { EntityState val = null; InstanceData instanceData = (InstanceData)(object)skillSlot.skillInstanceData; val = ((!instanceData.isPlayerControlled) ? EntityStateCatalog.InstantiateState(ref alternateActivationState) : EntityStateCatalog.InstantiateState(ref base.activationState)); ISkillState val2; if ((val2 = (ISkillState)(object)((val is ISkillState) ? val : null)) != null) { val2.activatorSkillSlot = skillSlot; } return val; } } } namespace SwanSongExtended.Items { internal class Aglet : ItemBase { public static float baseSpeedBuff = 0.3f; public static float stackSpeedBuff = 0.3f; public const float maxGroundTimeForMaxBuff = 5f; public const float minGroundTimeForMinBuff = 1f; public const float buffPerSecond = 5f; public const float ungroundedLossRate = 1f; public static BuffDef agletSpeed; public override bool isEnabled => false; public override ExpansionDef RequiredExpansion => SwanSongPlugin.expansionDefSS2; public override string ItemName => "Aglet"; public override string ItemLangTokenName => "AGLET"; public override string ItemPickupDesc => "Increase movement speed while grounded."; public override string ItemFullDescription => "Your movement speed gradually increases while grounded, up to " + Tools.ConvertDecimal(baseSpeedBuff) + " (+" + Tools.ConvertDecimal(stackSpeedBuff) + " per stack) " + $"after {5f} seconds."; public override string ItemLore => ""; public override ItemTier Tier => (ItemTier)1; public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)3 }; public override GameObject ItemModel => Resources.Load("prefabs/NullModel"); public override Sprite ItemIcon => Resources.Load("textures/miscicons/texWIPIcon"); public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Init() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) agletSpeed = Content.CreateAndAddBuff("bdAgletSpeed", assetBundle.LoadAsset("Assets/Textures/Icons/Buff/texBuffCobaltShield.png"), new Color(0.9f, 0.9f, 0.2f), canStack: true, isDebuff: false, (StackingDisplayMethod)0); base.Init(); } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(AgletSpeedBuff); CharacterBody.OnInventoryChanged += new hook_OnInventoryChanged(AddItemBehavior); } private void AgletSpeedBuff(CharacterBody sender, StatHookEventArgs args) { int count = GetCount(sender); int buffCount = sender.GetBuffCount(agletSpeed); if (buffCount > 0 && count > 0) { float num = baseSpeedBuff + stackSpeedBuff * (float)(count - 1); float num2 = (float)buffCount / 20f; float num3 = num * num2; args.moveSpeedMultAdd += num3; } } private void AddItemBehavior(orig_OnInventoryChanged orig, CharacterBody self) { orig.Invoke(self); if (NetworkServer.active) { self.AddItemBehavior(GetCount(self)); } } } public class AgletItemBehavior : ItemBehavior { private CharacterMotor motor; private int buffCount; private float timeGrounded; private void Start() { motor = base.body.characterMotor; } private void FixedUpdate() { if (!NetworkServer.active || !((Object)(object)motor != (Object)null)) { return; } if (motor.isGrounded) { if (timeGrounded < 5f) { timeGrounded = Mathf.Min(timeGrounded + Time.fixedDeltaTime, 5f); } } else if (timeGrounded > 0f) { timeGrounded = Mathf.Max(timeGrounded - Time.fixedDeltaTime, 0f); } int num = Mathf.Max(Mathf.CeilToInt((timeGrounded - 1f) * 5f), 0); if (num > buffCount) { base.body.AddBuff(Aglet.agletSpeed); buffCount++; } else if (num < buffCount) { base.body.RemoveBuff(Aglet.agletSpeed); buffCount--; } } private void OnDisable() { while (base.body.HasBuff(Aglet.agletSpeed) && NetworkServer.active) { base.body.RemoveBuff(Aglet.agletSpeed); } } } internal class Beans : ItemBase { public static int maxBuffs = 4; public static float buffDuration = 2f; public static int baseHeal = 8; public static int buffHeal = 12; public static float stackMultiplierAdd = 0.5f; public static BuffDef beansHealBuff; public override bool isEnabled => false; public override AssetBundle assetBundle => SwanSongPlugin.mainAssetBundle; public override string ConfigName => "Items : Beans"; public override string ItemName => "The Beans of Tragedy"; public override string ItemLangTokenName => "BORBOBAKEDBEANS"; public override string ItemPickupDesc => "Heal instantly on kill. Rapid kills heal for more."; public override string ItemFullDescription => $"On kill, heal for {baseHeal} health " + $"(+{(int)((float)baseHeal * stackMultiplierAdd)} per stack). " + $"Also gain a temporary buff that increases this healing by {buffHeal} per buff " + $"(+{(int)((float)buffHeal * stackMultiplierAdd)} per stack), " + $"up to a maximum cap of {maxBuffs} times."; public override string ItemLore => "There's nothing inside."; public override ItemTier Tier => (ItemTier)1; public override ItemTag[] ItemTags { get { ItemTag[] array = new ItemTag[3]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); return (ItemTag[])(object)array; } } public override GameObject ItemModel => ItemBase.LoadDropPrefab("mdlBeans"); public override Sprite ItemIcon => ItemBase.LoadItemIcon("texIconBeans"); public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Init() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) beansHealBuff = Content.CreateAndAddBuff("bdBeansHealingCombo", Resources.Load("textures/bufficons/texBuffMedkitHealIcon"), Color.yellow, canStack: true, isDebuff: false, (StackingDisplayMethod)0); base.Init(); } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown GlobalEventManager.OnCharacterDeath += new hook_OnCharacterDeath(OnKillStuff); } private void OnKillStuff(orig_OnCharacterDeath orig, GlobalEventManager self, DamageReport damageReport) { //IL_0066: 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_009d: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, damageReport); CharacterBody victimBody = damageReport.victimBody; CharacterBody attackerBody = damageReport.attackerBody; int count = GetCount(attackerBody); if (count > 0) { int buffCount = attackerBody.GetBuffCount(beansHealBuff); float num = (float)(baseHeal + buffHeal * buffCount) * (1f + stackMultiplierAdd * (float)(count - 1)); attackerBody.healthComponent.Heal(num, default(ProcChainMask), true); attackerBody.ClearTimedBuffs(beansHealBuff); int num2 = Mathf.Min(buffCount + 1, maxBuffs); for (int i = 0; i < num2; i++) { attackerBody.AddTimedBuffAuthority(beansHealBuff.buffIndex, buffDuration); } } } } internal class ChefReference : ItemBase { private GameObject meatChunk; private int fruitChanceBase = 1; private int fruitChanceStack = 1; private int maxBurnStacksBase = 10; private int maxBurnStacksStack = 3; private int meatNuggets = 2; private float healFraction = 0f; private float healFlat = 25f; private float chunkLifetime = 5f; public override bool isEnabled => false; public override string ConfigName => "Items : Chef Stache"; public override string ItemName => "Chef ’Stache"; public override string ItemLangTokenName => "CHEFITEM"; public override string ItemPickupDesc => "Burning enemies drop chunks of healing meat."; public override string ItemFullDescription => $"Gain {SwanSongPlugin.stacheBurnChance}% ignite chance. " + $"Hitting burning enemies has a {fruitChanceBase}% chance " + $"(+{fruitChanceStack}% per stack) to create {meatNuggets} " + $"healing nuggets that restore {healFlat} HP. " + "Nugget chance increases per stack of burn, " + $"up to {maxBurnStacksBase} times."; public override string ItemLore => ""; public override ItemTier Tier => (ItemTier)2; public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)1 }; public override GameObject ItemModel => ItemBase.LoadDropPrefab("mdlChefStache"); public override Sprite ItemIcon => ItemBase.LoadItemIcon("chefreference"); public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Init() { CreateMeatChunk(); base.Init(); } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown StatHooks.GetMoreStatCoefficients += new MoreStatHookEventHandler(AddBurnChance); OnHit.GetHitBehavior += new HitHookEventHandler(MeatOnHit); } private void AddBurnChance(CharacterBody sender, MoreStatHookEventArgs args) { if (GetCount(sender) > 0) { args.burnChanceOnHit += (float)SwanSongPlugin.stacheBurnChance; } } private void CreateMeatChunk() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) meatChunk = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)"RoR2/Base/Treebot/TreebotFruitPack.prefab").WaitForCompletion(), "MeatChunk", true); HealthPickup componentInChildren = meatChunk.GetComponentInChildren(); if (Object.op_Implicit((Object)(object)componentInChildren)) { componentInChildren.fractionalHealing = healFraction; componentInChildren.flatHealing = healFlat; } DestroyOnTimer componentInChildren2 = meatChunk.GetComponentInChildren(); componentInChildren2.duration = chunkLifetime; Content.AddNetworkedObjectPrefab(meatChunk); } private void MeatOnHit(CharacterBody aBody, DamageInfo damageInfo, CharacterBody victimBody) { //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: 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_00ce: Unknown result type (might be due to invalid IL or missing references) int count = GetCount(aBody); int burnCount = SwanSongPlugin.GetBurnCount(victimBody); if (count <= 0 || burnCount <= 0) { return; } float num = fruitChanceBase + fruitChanceStack * (count - 1); float num2 = num * (float)Mathf.Min(burnCount, maxBurnStacksBase); float num3 = Util.ConvertAmplificationPercentageIntoReductionPercentage(num2) * damageInfo.procCoefficient; if (!Util.CheckRoll(num3, aBody.master)) { return; } for (int i = 0; i < meatNuggets; i++) { GameObject val = Object.Instantiate(meatChunk, damageInfo.position + Random.insideUnitSphere * victimBody.radius * 0.5f, Random.rotation); TeamFilter component = val.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.teamIndex = aBody.teamComponent.teamIndex; } val.GetComponentInChildren(); val.transform.localScale = new Vector3(1f, 1f, 1f); NetworkServer.Spawn(val); } } } internal class GreedyRing : ItemBase { public static BuffDef greedyRingBuff; public static int bonusMoney = 10; public static int discountedChests = 3; private int discountAmountBase = 8; private int discountAmountStack = 2; public override bool isEnabled => false; public override ExpansionDef RequiredExpansion => SwanSongPlugin.expansionDefSS2; public override string ItemName => "Greedy Ring"; public override string ItemLangTokenName => "BORBODISCOUNT"; public override string ItemPickupDesc => $"Get a flat discount on the first {discountedChests} chests in every stage."; public override string ItemFullDescription => "At the beginning of each stage, " + $"receive {bonusMoney} gold " + "and a coupon code that reduces the cost of " + $"up to {discountedChests} chests " + $"by ${discountAmountBase} (+{discountAmountStack} per stack). " + "Scales over time."; public override string ItemLore => "Order: Mapel Coupon Getter (Lite)\r\nTracking Number: 06***********\r\nEstimated Delivery: 11/04/2056\r\nShipping Method: Priority\r\nShipping Address: 308, Belfast Station, Earth\r\nShipping Details:\r\n\r\nAlright, here you are. As promised, it (legally of course) views the code on electronic purchases to find promo codes and discounts and apply them to the purchase, no user input needed! It’s very legal.\r\nIt may be a little scuffed in practice, since you need to have the full cost on hand and the coupon codes might not be the best ones offered. Legal reasons for that, naturally. Oh, and there’s a limit on how many purchases you can do- you gotta wait a bit for it to refresh if you wanna get those coupons.\r\nOf course, you can always buy the premium version for unlimited discounts~\r\n"; public override ItemTier Tier => (ItemTier)1; public override ItemTag[] ItemTags { get { ItemTag[] array = new ItemTag[5]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); return (ItemTag[])(object)array; } } public override GameObject ItemModel => ItemBase.LoadDropPrefab("mdlGreedyRing"); public override Sprite ItemIcon => ItemBase.LoadItemIcon("texIconPickupITEM_BORBODISCOUNT"); public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Init() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) greedyRingBuff = Content.CreateAndAddBuff("bdGreedyCoupon", Addressables.LoadAssetAsync((object)"RoR2/Base/ElementalRings/texBuffElementalRingsReadyIcon.tif").WaitForCompletion(), new Color(0.9f, 0.8f, 0f), canStack: true, isDebuff: false, (StackingDisplayMethod)0); base.Init(); } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown CharacterBody.OnInventoryChanged += new hook_OnInventoryChanged(AddItemBehavior); MultiShopCardUtils.OnMoneyPurchase += new hook_OnMoneyPurchase(GreedyRingRefund); } private void GreedyRingRefund(orig_OnMoneyPurchase orig, PayCostContext context) { //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Expected O, but got Unknown //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00db: 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) orig.Invoke(context); CharacterMaster activatorMaster = context.activatorMaster; if (!Object.op_Implicit((Object)(object)activatorMaster) || !activatorMaster.hasBody || context.cost == 0 || !NetworkServer.active) { return; } CharacterBody body = activatorMaster.GetBody(); int count = GetCount(body); if (count > 0 && body.GetBuffCount(greedyRingBuff) > 0) { body.RemoveBuff(greedyRingBuff); GoldOrb val = new GoldOrb(); GameObject purchasedObject = context.purchasedObject; Vector3? val2; if ((Object)(object)purchasedObject == (Object)null) { val2 = null; } else { Transform transform = purchasedObject.transform; val2 = (((Object)(object)transform != (Object)null) ? new Vector3?(transform.position) : null); } ((Orb)val).origin = (Vector3)(((??)val2) ?? body.corePosition); ((Orb)val).target = body.mainHurtBox; val.goldAmount = GetGreedyRefundAmt(count, context.cost); OrbManager.instance.AddOrb((Orb)(object)val); } } private uint GetGreedyRefundAmt(int stack, int moneyCost) { int num = discountAmountBase + discountAmountStack * (stack - 1); return (uint)Mathf.Min(num, moneyCost - 1); } private void AddItemBehavior(orig_OnInventoryChanged orig, CharacterBody self) { orig.Invoke(self); if (NetworkServer.active && Object.op_Implicit((Object)(object)self.master)) { GreedyRingBehavior greedyRingBehavior = self.AddItemBehavior(GetCount(self)); } } } public class GreedyRingBehavior : ItemBehavior { private void Start() { base.body.master.GiveMoney((uint)Run.instance.GetDifficultyScaledCost(GreedyRing.bonusMoney)); if (NetworkServer.active) { for (int i = 0; i < GreedyRing.discountedChests; i++) { base.body.AddBuff(GreedyRing.greedyRingBuff); } } } private void OnDestroy() { int num = base.body.GetBuffCount(GreedyRing.greedyRingBuff); while (num > 0 && NetworkServer.active) { base.body.RemoveBuff(GreedyRing.greedyRingBuff); num--; } } } internal class LightningAttractor : ItemBase { public static BuffDef forkReadyBuff; public static BuffDef forkRechargeBuff; public static BuffDef forkRepeatHitBuff; public static BuffDef forkedBuff; public static float forkRecharge = 5f; public static float forkDuration = 3f; public static int forkAttackRequirement = 6; public static float forkTotalDamageBase = 1.5f; public static float forkTotalDamageStack = 1.5f; public static float forkStrikeRange = 25f; public override bool isEnabled => false; public override string ItemName => "Copper Fork"; public override string ItemLangTokenName => "LIGHTNINGATTRACTOR"; public override string ItemPickupDesc => "Attract lightning on repeated hits."; public override string ItemFullDescription => "Damage from any " + Language.Styling.DamageColor("skill or equipment") + " also sticks the enemy with a copper fork for " + Language.Styling.UtilityColor($"{forkDuration}") + " seconds. Repeatedly attacking a forked enemy resets the fork's duration and attracts lightning, " + Language.Styling.DamageColor("Stunning") + " a nearby enemy for " + Language.Styling.DamageColor(Language.Styling.ConvertDecimal(forkTotalDamageStack) + " TOTAL damage") + " " + Language.Styling.StackText("+" + Language.Styling.ConvertDecimal(forkTotalDamageStack)) + ". 1 max, recharges " + Language.Styling.UtilityColor($"{forkRecharge}s") + " after the fork expires."; public override string ItemLore => "New, from CuCo!\r\n\r\nThe CopperWare Utensil set offers countless benefits over your mundane Stainless Steel silverware.\r\n\r\nA stylish reddish-brown color to match your tableware, and a perfect match for your CuCo CopperWare Pots and Pans set!\r\n\r\nSupplemental Copper intake directly from your eating utensils!\r\n\r\nEasy cleaning! A rub down with any household acid like Vinegar or Lemon Juice will bring your CopperWare back to a factory shine!\r\n\r\nTry CopperWare today!\r\n\r\nPRODUCT WARNINGS\r\n\r\nTo avoid risk of galvanic corrosion, do not allow CopperWare in contact with other metal surfaces, especially in the presence of electrolytes like salt.\r\n\r\nDo not use CopperWare utensils in cooking. This presents a significant burn risk and may leach copper into the dish.\r\n\r\nCustomers over the age of 65 are not recommended to use CopperWare due to links between copper and Alzheimer's Disease.\r\n\r\nDue to copper's high electrical condicuctivity, it is recommended not to use any CopperWare products in close proximity to electrical currents or appliances.\r\n\r\nTo mitigate risk of fatal electrocution, please do not use CopperWare products when dining outside.\r\n\r\nWith your agreement to purchase and use this product, CuCo is released of liability from any consumer complaints relating to the nature of copper kitchenware."; public override ItemTier Tier => (ItemTier)1; public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[2] { (ItemTag)1, (ItemTag)4 }; public override GameObject ItemModel => ItemBase.LoadDropPrefab("mdlLightningAttractor"); public override Sprite ItemIcon => ItemBase.LoadItemIcon("texIconLightningAttractor"); public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown return new ItemDisplayRuleDict(Array.Empty()); } public override void Init() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001f: 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_0048: 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_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_009b: 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_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: 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_00fa: Unknown result type (might be due to invalid IL or missing references) base.Init(); forkReadyBuff = Content.CreateAndAddBuff("bdForkReady", Addressables.LoadAssetAsync((object)RoR2_Base_Common_MiscIcons.texAttackIcon_png).WaitForCompletion(), Color.yellow, canStack: false, isDebuff: false, (StackingDisplayMethod)0); forkRechargeBuff = Content.CreateAndAddBuff("bdForkRecharge", Addressables.LoadAssetAsync((object)RoR2_Base_Common_MiscIcons.texAttackIcon_png).WaitForCompletion(), Color.gray, canStack: false, isDebuff: false, (StackingDisplayMethod)0); forkRepeatHitBuff = Content.CreateAndAddBuff("bdForkStack", Addressables.LoadAssetAsync((object)RoR2_Base_Common_MiscIcons.texAttackIcon_png).WaitForCompletion(), Color32.op_Implicit(new Color32(byte.MaxValue, (byte)125, (byte)0, byte.MaxValue)), canStack: true, isDebuff: false, (StackingDisplayMethod)0); BuffDef obj = forkRepeatHitBuff; obj.flags = (Flags)(obj.flags | 1); forkedBuff = Content.CreateAndAddBuff("bdForked", Addressables.LoadAssetAsync((object)RoR2_Base_Common_MiscIcons.texAttackIcon_png).WaitForCompletion(), Color32.op_Implicit(new Color32(byte.MaxValue, (byte)125, (byte)0, byte.MaxValue)), canStack: false, isDebuff: false, (StackingDisplayMethod)0); forkedBuff.isHidden = true; BuffDef obj2 = forkedBuff; obj2.flags = (Flags)(obj2.flags | 1); } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown OnHit.GetHitBehavior += new HitHookEventHandler(ForkOnHit); CharacterBody.OnInventoryChanged += new hook_OnInventoryChanged(AddForkItemBehavior); } private void AddForkItemBehavior(orig_OnInventoryChanged orig, CharacterBody self) { orig.Invoke(self); if (NetworkServer.active) { self.AddItemBehavior(GetCount(self)); } } private void ForkOnHit(CharacterBody attackerBody, DamageInfo damageInfo, CharacterBody victimBody) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Invalid comparison between Unknown and I4 //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) int count = GetCount(attackerBody); if (count <= 0 || !NetworkServer.active || (!((DamageTypeCombo)(ref damageInfo.damageType)).IsDamageSourceSkillBased && (int)damageInfo.damageType.damageSource != 64)) { return; } int buffCount = victimBody.GetBuffCount(forkRepeatHitBuff); bool flag = victimBody.HasBuff(forkedBuff); bool flag2 = attackerBody.HasBuff(forkReadyBuff); if (!(flag2 || flag)) { return; } if (!victimBody.healthComponent.alive) { DoForkLightningStrike(attackerBody, damageInfo, victimBody, count); return; } if (flag2) { attackerBody.RemoveBuff(forkReadyBuff); } attackerBody.AddTimedBuff(forkRechargeBuff, forkRecharge); victimBody.AddTimedBuff(forkedBuff, forkDuration); float totalValue = damageInfo.damage / attackerBody.damage; int num = Tools.CountOverspillFibonacci(totalValue); if (buffCount + num >= forkAttackRequirement) { int num2 = forkAttackRequirement; num2 -= buffCount; num -= num2; if (num >= forkAttackRequirement) { num = forkAttackRequirement - 1; } victimBody.ClearTimedBuffs(forkRepeatHitBuff); buffCount = 0; DoForkLightningStrike(attackerBody, damageInfo, victimBody, count); } for (int i = 0; i < victimBody.timedBuffs.Count; i++) { TimedBuff val = victimBody.timedBuffs[i]; if (val.buffIndex == forkRepeatHitBuff.buffIndex && val.timer < forkDuration) { val.timer = forkDuration; val.totalDuration = forkDuration; } } for (int j = 0; j <= num; j++) { victimBody.AddTimedBuff(forkRepeatHitBuff, forkDuration); } } private static void DoForkLightningStrike(CharacterBody attackerBody, DamageInfo damageInfo, CharacterBody victimBody, int itemCount) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_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_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Expected O, but got Unknown //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: 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_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: 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_0106: 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_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Expected O, but got Unknown float radius = forkStrikeRange; float damage = damageInfo.damage; float num = forkTotalDamageBase + forkTotalDamageStack * (float)(itemCount - 1); ProcChainMask procChainMask = damageInfo.procChainMask; SphereSearch val = new SphereSearch { mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask, origin = victimBody.transform.position, queryTriggerInteraction = (QueryTriggerInteraction)2, radius = radius }; TeamMask enemyTeams = TeamMask.GetEnemyTeams(attackerBody.teamComponent.teamIndex); List list = new List(); val.RefreshCandidates().FilterCandidatesByHurtBoxTeam(enemyTeams).FilterCandidatesByDistinctHurtBoxEntities() .GetHurtBoxes(list); int index = Random.Range(0, list.Count); HurtBox val2 = list[index]; SetStateOnHurt component = ((Component)val2.healthComponent).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.SetStun(1f); } OrbManager.instance.AddOrb((Orb)new SimpleLightningStrikeOrb { attacker = ((Component)attackerBody).gameObject, damageColorIndex = (DamageColorIndex)0, damageValue = damage * num, isCrit = damageInfo.crit, procChainMask = procChainMask, procCoefficient = 1f, target = val2, damageType = DamageTypeCombo.op_Implicit((DamageType)32) }); } } public class LightningAttractorBehavior : ItemBehavior { private void FixedUpdate() { if (NetworkServer.active) { int buffCount = base.body.GetBuffCount(LightningAttractor.forkReadyBuff); if (!base.body.HasBuff(LightningAttractor.forkRechargeBuff) && !base.body.HasBuff(LightningAttractor.forkReadyBuff)) { base.body.AddBuff(LightningAttractor.forkReadyBuff); } } } private void OnDisable() { if (NetworkServer.active) { base.body.RemoveBuff(LightningAttractor.forkReadyBuff); base.body.ClearTimedBuffs(LightningAttractor.forkRechargeBuff); } } } internal class LunarBrand : ItemBase { public static BuffDef CauterizeBuff; public static int duration = 5; public static int durationStack = 5; public static int cauterizeBlockChance = 15; public static float cauterizeDamageCoef = 4f; public static float cauterizeDamageStack = 2f; public static float cauterizeProcCoef = 0f; public static int burnThreshold = 5; public override bool isEnabled => false; public override ExpansionDef RequiredExpansion => SwanSongPlugin.expansionDefSS2; public override string ItemName => "Starfire Brand"; public override string ItemLangTokenName => "LUNARBRAND"; public override string ItemPickupDesc => "Cauterize burning enemies, inflicting heavy damage AND increasing their armor, rendering them invulnerable to Bleed."; public override string ItemFullDescription => $"Gain {SwanSongPlugin.brandBurnChance}% ignite chance. " + $"Inflicting {burnThreshold} stacks of burn Cauterizes enemies " + $"for {duration} seconds (+{durationStack} per stack), " + "dealing " + Tools.ConvertDecimal(cauterizeDamageCoef) + " (+" + Tools.ConvertDecimal(cauterizeDamageStack) + " per stack) damage through armor. " + $"Cauterized enemies are invulnerable to Bleed and have +{cauterizeBlockChance} armor."; public override string ItemLore => ""; public override ItemTier Tier => (ItemTier)3; public override ItemTag[] ItemTags { get { ItemTag[] array = new ItemTag[3]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); return (ItemTag[])(object)array; } } public override GameObject ItemModel => ItemBase.LoadDropPrefab("mdlLunarBrand"); public override Sprite ItemIcon => ItemBase.LoadItemIcon("texIconLunarBrand"); public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Init() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) CauterizeBuff = Content.CreateAndAddBuff("bdCauterize", Addressables.LoadAssetAsync((object)"RoR2/Base/ElementalRings/texBuffElementalRingsReadyIcon.tif").WaitForCompletion(), new Color(0.2f, 0f, 0.1f), canStack: true, isDebuff: false, (StackingDisplayMethod)0); base.Init(); } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown StatHooks.GetMoreStatCoefficients += new MoreStatHookEventHandler(AddBurnChance); GlobalEventManager.ProcessHitEnemy += new hook_ProcessHitEnemy(BrandOnHit); HealthComponent.TakeDamageProcess += new hook_TakeDamageProcess(CauterizeBuffBehavior); } private void CauterizeBuffBehavior(orig_TakeDamageProcess orig, HealthComponent self, DamageInfo damageInfo) { //IL_0024: 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_006b: 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_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0091: 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_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Expected O, but got Unknown int num = ((Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.body)) ? self.body.GetBuffCount(CauterizeBuff.buffIndex) : 0); if (num <= 0) { orig.Invoke(self, damageInfo); return; } if (Util.CheckRoll((float)(cauterizeBlockChance * Math.Min(num, 6)), 0f, (CharacterMaster)null)) { EffectData val = new EffectData { origin = damageInfo.position, rotation = Util.QuaternionSafeLookRotation((damageInfo.force != Vector3.zero) ? damageInfo.force : Random.onUnitSphere) }; EffectManager.SpawnEffect(AssetReferences.bearEffectPrefab, val, true); damageInfo.rejected = true; } orig.Invoke(self, damageInfo); } private void AddBurnChance(CharacterBody sender, MoreStatHookEventArgs args) { if (GetCount(sender) > 0) { args.burnChanceOnHit += (float)SwanSongPlugin.brandBurnChance; } } private void BrandOnHit(orig_ProcessHitEnemy orig, GlobalEventManager self, DamageInfo damageInfo, GameObject victim) { orig.Invoke(self, damageInfo, victim); CharacterBody val = (Object.op_Implicit((Object)(object)victim) ? victim.GetComponent() : null); CharacterBody val2 = (Object.op_Implicit((Object)(object)damageInfo.attacker) ? damageInfo.attacker.GetComponent() : null); int count = GetCount(val2); if (count <= 0) { return; } int num = val.GetBuffCount(Buffs.OnFire); int num2 = val.GetBuffCount(Buffs.StrongerBurn); int buffCount = val.GetBuffCount(CauterizeBuff); for (int i = burnThreshold; num + num2 >= i * (buffCount + 1); i += burnThreshold) { int num3 = 0; while (num3 < i) { if (num > 0) { val.healthComponent.body.RemoveOldestTimedBuff(Buffs.OnFire); num--; num3++; continue; } if (num2 > 0) { val.healthComponent.body.RemoveOldestTimedBuff(Buffs.StrongerBurn); num2--; num3++; continue; } break; } Cauterize(val2, damageInfo, val); } } private void Cauterize(CharacterBody attackerBody, DamageInfo damageInfo, CharacterBody victim) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0012: 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_0036: 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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Expected O, but got Unknown //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Expected O, but got Unknown DamageInfo val = new DamageInfo { attacker = ((Component)attackerBody).gameObject, crit = damageInfo.crit, damage = (cauterizeDamageCoef + cauterizeDamageStack) * attackerBody.damage, damageType = DamageTypeCombo.op_Implicit((DamageType)66), damageColorIndex = (DamageColorIndex)3, force = Vector3.zero, position = victim.transform.position, procChainMask = damageInfo.procChainMask, procCoefficient = cauterizeProcCoef }; victim.healthComponent.TakeDamage(val); DotController dotController = DotController.FindDotController(((Component)victim).gameObject); dotController.ClearDotStacksForType((DotIndex)0); victim.AddTimedBuffAuthority(CauterizeBuff.buffIndex, (float)(duration + durationStack)); EffectManager.SpawnEffect(LegacyResourcesAPI.Load("prefabs/effects/JellyfishNova"), new EffectData { origin = victim.corePosition, scale = victim.bestFitRadius + 4f }, true); } } internal class MiniAmethyst : ItemBase { public static float equipmentCooldownFractionToGiveAsRecharge = 0.1f; public override bool isEnabled => false; public override string ConfigName => "Items : Amethyst"; public override ExpansionDef RequiredExpansion => SwanSongPlugin.expansionDefSS2; public override string ItemName => "Amethyst Fragment"; public override string ItemLangTokenName => "AMETHYST"; public override string ItemPickupDesc => "Activating your Equipment reduces your ability cooldowns."; public override string ItemFullDescription => "Activating your Equipment resets your Utility skill's cooldown, and reduces all other cooldowns by " + Tools.ConvertDecimal(equipmentCooldownFractionToGiveAsRecharge) + " (+" + Tools.ConvertDecimal(equipmentCooldownFractionToGiveAsRecharge) + " per stack) of your Equipment's base cooldown."; public override string ItemLore => ""; public override ItemTier Tier => (ItemTier)1; public override ItemTag[] ItemTags { get { ItemTag[] array = new ItemTag[3]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); return (ItemTag[])(object)array; } } public override GameObject ItemModel => Addressables.LoadAssetAsync((object)"RoR2/Base/Core/NullModel.prefab").WaitForCompletion(); public override Sprite ItemIcon => Addressables.LoadAssetAsync((object)"RoR2/Base/Core/texNullIcon.png").WaitForCompletion(); public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Hooks() { EquipmentSlot.onServerEquipmentActivated += AmethystOnEquipUse; } private void AmethystOnEquipUse(EquipmentSlot activator, EquipmentIndex equipment) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) CharacterBody characterBody = activator.characterBody; Inventory inventory = activator.inventory; if (!Object.op_Implicit((Object)(object)characterBody) || !Object.op_Implicit((Object)(object)inventory)) { return; } int count = GetCount(inventory); if (count <= 0) { return; } float cooldown = EquipmentCatalog.GetEquipmentDef(equipment).cooldown; float num = cooldown * equipmentCooldownFractionToGiveAsRecharge * (float)count; SkillLocator skillLocator = characterBody.skillLocator; if ((Object)(object)skillLocator != (Object)null) { if (Object.op_Implicit((Object)(object)skillLocator.primary)) { skillLocator.primary.RunRecharge(num); } if (Object.op_Implicit((Object)(object)skillLocator.secondary)) { skillLocator.secondary.RunRecharge(num); } if (Object.op_Implicit((Object)(object)skillLocator.utility)) { skillLocator.utility.RunRecharge(Mathf.Max(skillLocator.utility.cooldownRemaining, num)); } if (Object.op_Implicit((Object)(object)skillLocator.special)) { skillLocator.special.RunRecharge(num); } } } } internal class RandomBarrierTarget : ItemBase { public static float harpoonBarrierBase = 6f; public static float harpoonBarrierStack = 6f; public static float harpoonTargetTime = 15f; public static float harpoonDecayReduction = 0.2f; public static Material harpoonTargetMaterial; public override bool isEnabled => false; public override string ItemName => "Borbo’s Arrowhead"; public override string ItemLangTokenName => "RANDOMBARRIERTARGET"; public override string ItemPickupDesc => "Target a nearby enemy, gaining barrier on hit."; public override string ItemFullDescription => "Reduce barrier decay by -" + Language.Styling.ConvertDecimal(harpoonDecayReduction) + "." + $"Once every {harpoonTargetTime} seconds, target a random enemy. " + "Attacking the targeted enemy grants a temporary barrier " + $"for {harpoonBarrierBase} health (+{harpoonBarrierStack} per stack)."; public override string ItemLore => "Not to be confused with Hunter's Harpoon!"; public override ItemTier Tier => (ItemTier)1; public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)2 }; public override GameObject ItemModel => ItemBase.LoadDropPrefab(); public override Sprite ItemIcon => ItemBase.LoadItemIcon(); public override ItemDisplayRuleDict CreateItemDisplayRules() { throw new NotImplementedException(); } public override void Hooks() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Expected O, but got Unknown harpoonTargetMaterial = CreateMatRecolor(new Color32((byte)210, (byte)140, (byte)32, (byte)100)); CharacterBody.OnInventoryChanged += new hook_OnInventoryChanged(AddHarpoonBehavior); OnHit.GetHitBehavior += new HitHookEventHandler(HarpoonOnHit); StatHooks.GetMoreStatCoefficients += new MoreStatHookEventHandler(HarpoonDecay); } private void HarpoonDecay(CharacterBody sender, MoreStatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender.inventory) && Object.op_Implicit((Object)(object)sender.inventory)) { int count = GetCount(sender); if (count > 0) { args.barrierDecayRatePercentIncreaseMult *= 1f - harpoonDecayReduction; } } } public static Material CreateMatRecolor(Color32 blueEquivalent) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) Material val = Object.Instantiate(Addressables.LoadAssetAsync((object)"RoR2/Base/Huntress/matHuntressFlashExpanded.mat").WaitForCompletion()); val.SetColor("_TintColor", Color32.op_Implicit(blueEquivalent)); val.SetInt("_Cull", 1); return val; } private void HarpoonOnHit(CharacterBody attackerBody, DamageInfo damageInfo, CharacterBody victimBody) { Inventory inventory = attackerBody.inventory; HealthComponent healthComponent = attackerBody.healthComponent; if ((Object)(object)inventory != (Object)null && (Object)(object)healthComponent != (Object)null && (Object)(object)victimBody != (Object)null && victimBody.HasBuff(CommonAssets.harpoonDebuff)) { int itemCountEffective = inventory.GetItemCountEffective(Items.MoveSpeedOnKill); if (itemCountEffective > 0) { float num = harpoonBarrierBase + harpoonBarrierStack * (float)(itemCountEffective - 1); healthComponent.AddBarrierAuthority(num * damageInfo.procCoefficient); } } } private void AddHarpoonBehavior(orig_OnInventoryChanged orig, CharacterBody self) { orig.Invoke(self); int itemCountEffective = self.inventory.GetItemCountEffective(Items.MoveSpeedOnKill); self.AddItemBehavior(itemCountEffective); } private void RevokeHarpoonRights(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); val.GotoNext((MoveType)2, new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC1Content/Items", "MoveSpeedOnKill"), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "GetItemCountEffective") }); val.Emit(OpCodes.Pop); val.Emit(OpCodes.Ldc_I4, 0); } } public class RandomBarrierTargetBehavior : ItemBehavior { public static float baseHauntRadius = 35f; public static float hauntRetryTime = 1f; private float hauntStopwatch = 0f; private void Start() { hauntStopwatch = RandomBarrierTarget.harpoonTargetTime; } private void FixedUpdate() { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_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_004d: 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_0063: 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_0076: Expected O, but got Unknown //IL_0081: 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_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) hauntStopwatch += Time.fixedDeltaTime; if (!(hauntStopwatch >= RandomBarrierTarget.harpoonTargetTime) || !NetworkServer.active) { return; } SphereSearch val = new SphereSearch { mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask, origin = base.body.transform.position, queryTriggerInteraction = (QueryTriggerInteraction)2, radius = baseHauntRadius }; TeamMask val2 = TeamMask.AllExcept(base.body.teamComponent.teamIndex); List list = new List(); val.RefreshCandidates().FilterCandidatesByHurtBoxTeam(val2).FilterCandidatesByDistinctHurtBoxEntities() .GetHurtBoxes(list); int num = list.Count; while (num > 0) { int index = Random.Range(0, num - 1); HealthComponent healthComponent = list[index].healthComponent; CharacterBody body = healthComponent.body; if (!Object.op_Implicit((Object)(object)body)) { list.Remove(list[index]); num--; continue; } DebuffEnemy(body); hauntStopwatch -= RandomBarrierTarget.harpoonTargetTime; return; } hauntStopwatch -= hauntRetryTime; } private void DebuffEnemy(CharacterBody enemyBody) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < base.stack; i++) { enemyBody.AddTimedBuffAuthority(CommonAssets.harpoonDebuff.buffIndex, RandomBarrierTarget.harpoonTargetTime); } ModelLocator modelLocator = enemyBody.modelLocator; Transform val = ((modelLocator != null) ? modelLocator.modelTransform : null); if ((Object)(object)val != (Object)null) { TemporaryOverlayInstance val2 = TemporaryOverlayManager.AddOverlay(((Component)val).gameObject); val2.duration = RandomBarrierTarget.harpoonTargetTime; val2.animateShaderAlpha = true; val2.alphaCurve = AnimationCurve.Linear(0f, 1f, 1f, 0f); val2.destroyComponentOnEnd = true; val2.originalMaterial = RandomBarrierTarget.harpoonTargetMaterial; val2.AddToCharacterModel(((Component)val).GetComponent()); } } private void OnDisable() { hauntStopwatch = 0f; } } internal class ShieldAmp : ItemBase { public static float shieldFlatBase = 40f; public static float shieldDrainFractionBase = 0.4f; public static float shieldDrainFractionStack = -0.08f; public static float amplifyDamageIncreaseBase = 9f; public static float amplifyDamageIncreaseStack = 3f; public static float amplifyDamageMultiplierForFullShield = 2f; public override bool isEnabled => false; public override string ItemName => "Jellyfish Necklace"; public override string ItemLangTokenName => "SHIELDAMP"; public override string ItemPickupDesc => "While shields are full, dealing damage drains shield and creates energizing sparks."; public override string ItemFullDescription => "Gain " + Language.Styling.HealingColor(shieldFlatBase + " shield") + ". While shields are full, " + Language.Styling.DamageColor("amplify") + " damage from skills. " + Language.Styling.DamageColor("Amplified") + " hits " + Language.Styling.DamageColor("drain " + Tools.ConvertDecimal(shieldDrainFractionBase)) + " of your max shield " + Language.Styling.StackText(Language.Styling.ConvertDecimal(shieldDrainFractionStack) ?? "") + ", dealing " + Language.Styling.DamageColor("+" + Language.Styling.ConvertDecimal(amplifyDamageIncreaseBase) + " BASE damage") + Language.Styling.StackText("+" + Language.Styling.ConvertDecimal(amplifyDamageIncreaseStack)) + ", and creating " + Language.Styling.UtilityColor("Energizing Sparks") + ", temporarily increasing " + Language.Styling.DamageColor("attack speed") + " by " + Language.Styling.DamageColor(Language.Styling.ConvertDecimal(Assets.sparkBoosterAspdBonus)) + "."; public override string ItemLore => ""; public override ItemTier Tier => (ItemTier)1; public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)1 }; public override GameObject ItemModel => ItemBase.LoadDropPrefab("mdlShieldAmp"); public override Sprite ItemIcon => ItemBase.LoadItemIcon("texIconShieldAmp"); public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown HealthComponent.TakeDamageProcess += new hook_TakeDamageProcess(ShieldAmpOnTakeDamage); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(ShieldAmpStats); } private void ShieldAmpStats(CharacterBody sender, StatHookEventArgs args) { int count = GetCount(sender); if (count > 0) { args.baseShieldAdd += shieldFlatBase; } } private void ShieldAmpOnTakeDamage(orig_TakeDamageProcess orig, HealthComponent self, DamageInfo damageInfo) { //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)damageInfo.attacker) && ((DamageTypeCombo)(ref damageInfo.damageType)).IsDamageSourceSkillBased && NetworkServer.active) { CharacterBody component = damageInfo.attacker.GetComponent(); if ((Object)(object)component != (Object)null) { int count = GetCount(component); if (count > 0) { HealthComponent healthComponent = component.healthComponent; float maxShield = component.maxShield; if (healthComponent.shield >= maxShield - 1f) { float num = amplifyDamageIncreaseBase + amplifyDamageIncreaseStack * (float)(count - 1); float num2 = ((component.maxShield > shieldFlatBase) ? Mathf.Lerp(1f, amplifyDamageMultiplierForFullShield, maxShield / healthComponent.fullCombinedHealth) : 1f); damageInfo.damage += component.damage * num * num2; float num3 = shieldDrainFractionBase * Mathf.Pow(1f + shieldDrainFractionStack, (float)count); DrainShield(healthComponent, maxShield * num3); NebulaPickup.CreateBoosterPickup(damageInfo.position, component.teamComponent.teamIndex, Assets.sparkBoosterObject, 2); } } } } orig.Invoke(self, damageInfo); } public static void DrainShield(HealthComponent healthComponent, float shieldToDrain) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown //IL_003c: 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_0050: 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_007c: Unknown result type (might be due to invalid IL or missing references) if (NetworkServer.active) { float barrier = healthComponent.barrier; healthComponent.Networkbarrier = 0f; DamageInfo val = new DamageInfo(); val.damage = shieldToDrain; val.attacker = ((Component)healthComponent).gameObject; val.damageType = new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)1), (DamageTypeExtended)0, (DamageSource)0); val.damageColorIndex = (DamageColorIndex)11; val.procCoefficient = 0f; val.position = ((Component)healthComponent).transform.position; TeamDef teamDef = TeamCatalog.GetTeamDef(healthComponent.body.teamComponent.teamIndex); if (teamDef != null) { val.damage /= teamDef.friendlyFireScaling; } healthComponent.TakeDamage(val); healthComponent.Networkbarrier = barrier; } } private void ShieldAmpOnHit(CharacterBody attackerBody, DamageInfo damageInfo, CharacterBody victimBody) { } } internal class VoidLeptonDaisy : ItemBase { public static BuffDef lilyRageBuff; public static int duration = 20; public static float aspdBoostBase = 0.3f; public static float aspdBoostStack = 0.15f; private float cdrBase = 1f - aspdBoostBase; private float cdrStack = 1f - aspdBoostStack; public override bool isEnabled => false; public override ExpansionDef RequiredExpansion => SwanSongPlugin.expansionDefSS2; public override string ItemName => "Phrygian Lily"; public override string ItemLangTokenName => "PHRYGIANLILY"; public override string ItemPickupDesc => "Enter a rage after activating the teleporter. Corrupts all Lepton Daisies."; public override string ItemFullDescription => $"Enter a rage for {duration} seconds upon activating the teleporter. " + "While enraged, increases attack speed by +" + Tools.ConvertDecimal(aspdBoostBase) + " (+" + Tools.ConvertDecimal(aspdBoostStack) + " per stack) and reduces skill cooldowns by " + Tools.ConvertDecimal(aspdBoostBase) + " (" + Tools.ConvertDecimal(aspdBoostStack) + " per stack)"; public override string ItemLore => ""; public override ItemTier Tier => (ItemTier)7; public override ItemTag[] ItemTags { get { ItemTag[] array = new ItemTag[4]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); return (ItemTag[])(object)array; } } public override GameObject ItemModel => assetBundle.LoadAsset("Assets/Prefabs/mdlPhrygianLily.prefab"); public override Sprite ItemIcon => assetBundle.LoadAsset("Assets/Icons/texIconPickupITEM_PHRYGIANLILY.png"); public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Init() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) lilyRageBuff = Content.CreateAndAddBuff("bdLilyRage", Addressables.LoadAssetAsync((object)"RoR2/Base/ElementalRings/texBuffElementalRingsReadyIcon.tif").WaitForCompletion(), new Color(0.8f, 0f, 0f), canStack: false, isDebuff: false, (StackingDisplayMethod)0); base.Init(); } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown ChargingState.OnEnter += new hook_OnEnter(PhrygianLilyEnrage); CharacterBody.RecalculateStats += new hook_RecalculateStats(LilyCDR); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(LilySpeed); ContagiousItemManager.Init += new hook_Init(CreateTransformation); } private void PhrygianLilyEnrage(orig_OnEnter orig, ChargingState self) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); CharacterBody body = PlayerCharacterMasterController.instances[0].body; if ((Object)(object)body != (Object)null) { int count = GetCount(body); if (count > 0) { body.AddTimedBuffAuthority(lilyRageBuff.buffIndex, (float)duration); } } } private void LilyCDR(orig_RecalculateStats orig, CharacterBody self) { orig.Invoke(self); int count = GetCount(self); if (count > 0 && self.HasBuff(lilyRageBuff)) { SkillLocator skillLocator = self.skillLocator; if ((Object)(object)skillLocator != (Object)null) { float cooldownScale = cdrBase * Mathf.Pow(cdrStack, (float)(count - 1)); Tools.ApplyCooldownScale(skillLocator.primary, cooldownScale); Tools.ApplyCooldownScale(skillLocator.secondary, cooldownScale); Tools.ApplyCooldownScale(skillLocator.utility, cooldownScale); Tools.ApplyCooldownScale(skillLocator.special, cooldownScale); } } } private void LilySpeed(CharacterBody sender, StatHookEventArgs args) { int count = GetCount(sender); if (count > 0 && sender.HasBuff(lilyRageBuff)) { float num = aspdBoostBase + aspdBoostStack * (float)(count - 1); args.attackSpeedMultAdd += num; } } private void CreateTransformation(orig_Init orig) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: 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) Pair val = default(Pair); val.itemDef1 = Items.TPHealingNova; val.itemDef2 = ItemBase.instance.ItemsDef; Pair val2 = val; ItemCatalog.itemRelationships[ItemRelationshipTypes.ContagiousItem] = CollectionExtensions.AddToArray(ItemCatalog.itemRelationships[ItemRelationshipTypes.ContagiousItem], val2); orig.Invoke(); } } internal class VoidVampirism : ItemBase { private int vampireBleedChance = 10; private int maxHealing = 2; private int maxHealingStack = 1; private float healthPerBleed = 0.2f; public override bool isEnabled => false; public override ExpansionDef RequiredExpansion => SwanSongPlugin.expansionDefSS2; public override string ItemName => "Bloodsucking Coralite"; public override string ItemLangTokenName => "HEALFROMBLEEDINGENEMIES"; public override string ItemPickupDesc => "Bleeding enemies heal you on hit. Corrupts all Leeching Seeds."; public override string ItemFullDescription => $"Gain {vampireBleedChance}% bleed chance. " + $"Bleeding enemies heal you for +{healthPerBleed} health when hit " + "per stack of bleed, up to a maximum of " + $"{maxHealing} (+{maxHealingStack} per stack) health. " + "Corrupts all Leeching Seeds."; public override string ItemLore => ""; public override ItemTier Tier => (ItemTier)6; public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[2] { (ItemTag)2, (ItemTag)1 }; public override GameObject ItemModel => ItemBase.LoadDropPrefab("mdlCoralite"); public override Sprite ItemIcon => ItemBase.LoadItemIcon("texIconVoidVampirism"); public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown CharacterBody.RecalculateStats += new hook_RecalculateStats(VampireBleedChance); ContagiousItemManager.Init += new hook_Init(CreateTransformation); HealthComponent.TakeDamageProcess += new hook_TakeDamageProcess(TakeMoreDamageWhileBurning); GlobalEventManager.OnCharacterDeath += new hook_OnCharacterDeath(VampireOnKill); } private void VampireOnKill(orig_OnCharacterDeath orig, GlobalEventManager self, DamageReport damageReport) { //IL_0095: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, damageReport); CharacterBody victimBody = damageReport.victimBody; CharacterBody attackerBody = damageReport.attackerBody; if ((Object)(object)victimBody == (Object)null || (Object)(object)attackerBody == (Object)null) { return; } Inventory inventory = attackerBody.inventory; if ((Object)(object)inventory != (Object)null) { int count = GetCount(inventory); if (count > 0) { int buffCount = victimBody.GetBuffCount(Buffs.Bleeding); int num = maxHealing + maxHealingStack * count; float num2 = MathF.Min(healthPerBleed * (float)buffCount, num); attackerBody.AddTimedBuffAuthority(Buffs.MeatRegenBoost.buffIndex, num2 * 3f); } } } private void TakeMoreDamageWhileBurning(orig_TakeDamageProcess orig, HealthComponent self, DamageInfo damageInfo) { //IL_0095: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)damageInfo.attacker != (Object)null && Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.body)) { CharacterBody component = damageInfo.attacker.GetComponent(); int count = GetCount(component); if ((Object)(object)component != (Object)null && count > 0) { CharacterBody body = self.body; int buffCount = body.GetBuffCount(Buffs.Bleeding); int num = maxHealing + maxHealingStack * count; float num2 = MathF.Min(healthPerBleed * (float)buffCount, num); component.AddTimedBuffAuthority(Buffs.MeatRegenBoost.buffIndex, num2); } } orig.Invoke(self, damageInfo); } private void VampireBleedChance(orig_RecalculateStats orig, CharacterBody self) { orig.Invoke(self); if (GetCount(self) > 0) { self.bleedChance += (float)vampireBleedChance; } } private void CreateTransformation(orig_Init orig) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: 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) Pair val = default(Pair); val.itemDef1 = Items.Seed; val.itemDef2 = ItemBase.instance.ItemsDef; Pair val2 = val; ItemCatalog.itemRelationships[ItemRelationshipTypes.ContagiousItem] = CollectionExtensions.AddToArray(ItemCatalog.itemRelationships[ItemRelationshipTypes.ContagiousItem], val2); orig.Invoke(); } } internal class Watch2 : ItemBase { [AutoConfig("Free Attack Speed Bonus", 0.075f)] public static float aspdBonusFree = 0.075f; [AutoConfig("Base Attack Speed Bonus", 0.32f)] public static float aspdBonusBase = 0.32f; [AutoConfig("Stack Attack Speed Bonus", 0.22f)] public static float aspdBonusStack = 0.22f; [AutoConfig("Stationary Wait Time", 0.1f)] public static float watchWaitTime = 0.1f; public static BuffDef watchAspdBuff; public override bool isEnabled => false; public override string ConfigName => "Reworks : Delicate Watch"; public override AssetBundle assetBundle => null; public override string ItemName => "Delicate Watch"; public override string ItemLangTokenName => "WATCH2"; public override string ItemPickupDesc => "Greatly increase attack speed while standing still. Breaks on low health."; public override string ItemFullDescription => "Increase " + Language.Styling.DamageColor("attack speed") + " by " + Language.Styling.DamageColor(Language.Styling.ConvertDecimal(aspdBonusFree)) + " " + Language.Styling.StackText("+" + Language.Styling.ConvertDecimal(aspdBonusFree)) + ". After standing still for " + Language.Styling.DamageColor(watchWaitTime.ToString()) + " seconds, increase " + Language.Styling.DamageColor("attack speed") + " by " + Language.Styling.ConvertDecimal(aspdBonusBase) + " " + Language.Styling.StackText("+" + Language.Styling.ConvertDecimal(aspdBonusStack) + " per stack") + ". Taking damage to below 25% health breaks this item."; public override string ItemLore => "The wind blows over the plains. Two soldiers trudge along on their routine patrol, filling their boredom with casual conversation. \"Hm. Hey, Shelly, have I ever showed you my new Patex?\" Quinton mused. Shelly shot him a quizzical look. \"Tell me you didn't bring a $75,000 watch with you on a dangerous expedition into unknown territories...\"\n\nWhirling around to face his partner, Quinton gave a hearty laugh. \"Why, yes I did!\" Rolling up his sleeve, a glint of gold revealed his collector's watch. The metal surface gleamed proudly, reflecting a ray of sunlight into the eyes of a hidden Lemurian. \"What's the point of going through trials and tribulations in the middle of nowhere if I can't STYLE all over my fellow soldiers!?\" Quinton laughed, pounding his fist to his chest. \"I'm going to rub it in your face SO HARD when that thing inevitably breaks,\" Shelly chuckled. Quinton scoffed. \"Oh, please. We've been along this route countless times, and nothing's happened. We're lucky to be stationed on a quiet sector of this hellhole, and I doubt our luck will run out any time soon.\"\n\nAs if on cue, the aggrivated Lemurian, annoyed by the glare, leapt from the bushes and shot a fireball. \"Woah!\" Shelly shouted, raising her gun and killing the beast. \"Hah... So much about a quiet, sector, huh?\" Shelly turned to her partner, who was doubled over on the ground. Shelly's face blanched.\n\n\"Oh no... Were you hit? We need to get you to a medic, fast...!\"\n\n\"No.\" Quinton's voice was small and full of grief. \"I'm perfectly fine, but...\" Quinton looked up, revealing his gleaming Patex, having taken the fireball dead-on, had been reduced to a mangled mess of twisted metal and smoking polish. \"L-Look what that BEAST did to my precious watch!\"\n\nFor a moment, all was quiet on the plains. Then, the silence was yet again broken by Shelly's laughter and Quinton's desperate pleading."; public override ItemTier Tier => (ItemTier)0; public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)1 }; public override GameObject ItemModel => Addressables.LoadAssetAsync((object)"RoR2/DLC1/FragileDamageBonus/PickupDelicateWatch.prefab").WaitForCompletion(); public override Sprite ItemIcon => Addressables.LoadAssetAsync((object)"RoR2/DLC1/FragileDamageBonus/texDelicateWatchIcon.png").WaitForCompletion(); public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(WatchAspdBuff); CharacterBody.OnInventoryChanged += new hook_OnInventoryChanged(AddItemBehavior); HealthComponent.UpdateLastHitTime += new hook_UpdateLastHitTime(WatchBreak); } private void AddItemBehavior(orig_OnInventoryChanged orig, CharacterBody self) { orig.Invoke(self); if (NetworkServer.active) { self.AddItemBehavior(GetCount(self)); } } private void WatchAspdBuff(CharacterBody sender, StatHookEventArgs args) { int count = GetCount(sender); if (count > 0) { float num = aspdBonusFree * (float)count; if (sender.HasBuff(watchAspdBuff)) { num += aspdBonusBase + aspdBonusStack * (float)(count - 1); } args.attackSpeedMultAdd += num; } } private void WatchBreak(orig_UpdateLastHitTime orig, HealthComponent self, float damageValue, Vector3 damagePosition, bool damageIsSilent, GameObject attacker, bool delayedDamage, bool firstHitOfDelayedDamage) { //IL_0004: 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_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Expected O, but got Unknown orig.Invoke(self, damageValue, damagePosition, damageIsSilent, attacker, delayedDamage, firstHitOfDelayedDamage); CharacterBody body = self.body; if (NetworkServer.active && Object.op_Implicit((Object)(object)body) && damageValue > 0f) { int count = GetCount(body); if (count > 0 && self.isHealthLow) { body.inventory.GiveItem(Items.FragileDamageBonusConsumed, count); body.inventory.RemoveItem(ItemBase.instance.ItemsDef, count); CharacterMasterNotificationQueue.SendTransformNotification(body.master, ItemBase.instance.ItemsDef.itemIndex, Items.FragileDamageBonusConsumed.itemIndex, (TransformationType)0); EffectData val = new EffectData { origin = ((Component)self).transform.position }; val.SetNetworkedObjectReference(((Component)self).gameObject); EffectManager.SpawnEffect(AssetReferences.fragileDamageBonusBreakEffectPrefab, val, true); } } } public override void Init() { //IL_0018: 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_0025: Unknown result type (might be due to invalid IL or missing references) SwanSongPlugin.RetierItemAsync(RoR2_DLC1_FragileDamageBonus.FragileDamageBonus_asset, (ItemTier)5); watchAspdBuff = Content.CreateAndAddBuff("bdWatchAspd", Addressables.LoadAssetAsync((object)"RoR2/Base/CritOnUse/texBuffFullCritIcon.tif").WaitForCompletion(), Color.yellow, canStack: true, isDebuff: false, (StackingDisplayMethod)0); base.Init(); } } public class WatchItemBehavior : ItemBehavior { private void FixedUpdate() { if (!NetworkServer.active) { return; } float notMovingStopwatch = base.body.notMovingStopwatch; if (base.stack > 0 && notMovingStopwatch >= Watch2.watchWaitTime) { if (!base.body.HasBuff(Watch2.watchAspdBuff)) { base.body.AddBuff(Watch2.watchAspdBuff); } } else if (base.body.HasBuff(Watch2.watchAspdBuff)) { base.body.RemoveBuff(Watch2.watchAspdBuff); } } private void OnDisable() { if (NetworkServer.active) { base.body.RemoveBuff(Watch2.watchAspdBuff); } } } internal class WeirdlyShapedOpal : ItemBase { [AutoConfig("Armor Increase Unconditional", 10)] public static int opalArmorBase = 10; [AutoConfig("Regen Increase Unconditional", "Scales with level", 1f)] public static float opalRegenBase = 1f; [AutoConfig("Armor Increase Per Buff", 5)] public static int opalArmorPerBuff = 5; [AutoConfig("Regen Increase Per Buff", "Scales with level", 0.5f)] public static float opalRegenPerBuff = 0.5f; [AutoConfig("Max Opal Buff", 5)] public static int opalMaxBuff = 5; [AutoConfig("Opal Area Radius", 20)] public static float opalAreaRadius = 20f; public static BuffDef opalStatBuff; public static GameObject opalAreaIndicator = null; private static ItemDisplayRuleDict IDR = new ItemDisplayRuleDict(Array.Empty()); public override bool isEnabled => false; public override string ConfigName => "Reworks : Opal"; public static float opalAreaRadiusSqr => opalAreaRadius * opalAreaRadius; public override AssetBundle assetBundle => SwanSongPlugin.retierAssetBundle; public override string ItemName => "Weirdly-shaped Opal"; public override string ItemLangTokenName => "BORBOOPAL"; public override string ItemPickupDesc => "Increases armor and regen while enemies are nearby."; public override string ItemFullDescription => "Increases base health regeneration by " + Language.Styling.HealingColor($"+{opalRegenBase} hp/s") + " " + Language.Styling.StackText($"+{opalRegenBase} hp/s") + " and armor by " + Language.Styling.HealingColor($"+{opalArmorBase}") + " " + Language.Styling.StackText("+" + opalArmorBase) + ". For each enemy within " + Language.Styling.UtilityColor(opalAreaRadius + "m") + ", also gain " + Language.Styling.HealingColor($"+{opalRegenPerBuff} hp/s") + " " + Language.Styling.StackText($"+{opalRegenPerBuff} hp/s") + " base health regeneration and " + Language.Styling.HealingColor($"+{opalArmorPerBuff}") + " " + Language.Styling.StackText("+" + opalArmorPerBuff) + " armor, up to " + Language.Styling.UtilityColor(opalMaxBuff.ToString()) + " times."; public override string ItemLore => "//--AUTO-TRANSCRIPTION FROM UES [Redacted] --//\n\n\"...You think this planet is as bad as they say?\"\n\nLiz sat in silence among her fellow soldiers. She, like the rest of her squadron, had been taken from the middle of a firefight in the galactic outback and brought before an old UES veteran. Liz was used to debriefing by now, it all blended together in her head. Something about monsters, and the missing UES Contact Light.\n\n\"...Dunno.\" Liz murmured as she turned a small, oddly-shaped hunk of opal in her hand. It was one of the only things she had that reminded her of Parker. Of when things were calm, and peaceful.\n\n\"...Heh, I don't think a shiny rock will do much,\" A soldier joked. Liz's brow furrowed under her helmet. \"Yeah, probably not... but...\"\n\nLiz took a deep breath and slipped the opal back into her pocket. \"It just helps.\""; public override ItemTier Tier => (ItemTier)1; public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)2 }; public override GameObject ItemModel => Resources.Load("prefabs/pickupmodels/PickupOddlyShapedOpal"); public override Sprite ItemIcon => assetBundle.LoadAsset("Assets/Icons/Oddly-shaped_Opal.png"); public override ExpansionDef RequiredExpansion => SharedBase.SotvExpansionDef(); public override ItemDisplayRuleDict CreateItemDisplayRules() { return IDR; } public override void Hooks() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Expected O, but got Unknown //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Expected O, but got Unknown ((ResourceAvailability)(ref BodyCatalog.availability)).onAvailable += delegate { ItemBase.CloneVanillaDisplayRules((Object)(object)ItemBase.instance.ItemsDef, (Object)(object)Items.OutOfCombatArmor); }; CharacterBody.OnInventoryChanged += new hook_OnInventoryChanged(AddOpalItemBehavior); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(OpalStatCoefficients); } public override void Init() { base.Init(); SwanSongPlugin.RetierItemAsync(RoR2_DLC1_OutOfCombatArmor.OutOfCombatArmor_asset, (ItemTier)5); CreateAssets(); } private void CreateAssets() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) opalStatBuff = Addressables.LoadAssetAsync((object)"RoR2/DLC1/OutOfCombatArmor/bdOutOfCombatArmorBuff.asset").WaitForCompletion(); opalStatBuff.canStack = true; opalAreaIndicator = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("Prefabs/NetworkedObjects/NearbyDamageBonusIndicator"), "OpalAreaIndicator", true); Transform val = opalAreaIndicator.transform.Find("Radius, Spherical"); val.localScale = Vector3.one * opalAreaRadius * 2f; Content.AddNetworkedObjectPrefab(opalAreaIndicator); } private void OpalStatCoefficients(CharacterBody sender, StatHookEventArgs args) { int count = GetCount(sender); int buffCount = sender.GetBuffCount(opalStatBuff); args.armorAdd += (float)(count * (buffCount * opalArmorPerBuff + opalArmorBase)); args.baseRegenAdd += (float)count * ((float)buffCount * opalRegenPerBuff + opalRegenBase) * (1f + 0.2f * sender.level); } private void AddOpalItemBehavior(orig_OnInventoryChanged orig, CharacterBody self) { orig.Invoke(self); if (NetworkServer.active) { self.AddItemBehavior(GetCount(self)); } } } public class WeirdOpalBehavior : ItemBehavior { private GameObject areaIndicatorInstance; public float frequency = 6f; private float timer; private float interval => 1f / frequency; private bool indicatorEnabled { get { return Object.op_Implicit((Object)(object)areaIndicatorInstance); } set { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) if (indicatorEnabled == value) { if (value) { areaIndicatorInstance = Object.Instantiate(WeirdlyShapedOpal.opalAreaIndicator, base.body.corePosition, Quaternion.identity); areaIndicatorInstance.GetComponent().AttachToGameObjectAndSpawn(((Component)this).gameObject, (string)null); } else { Object.Destroy((Object)(object)areaIndicatorInstance); areaIndicatorInstance = null; } } } } public void FixedUpdate() { //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_0053: 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_0102: Invalid comparison between Unknown and I4 //IL_005a: 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_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Invalid comparison between Unknown and I4 //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) timer += Time.fixedDeltaTime; if (!(timer >= interval)) { return; } timer -= interval; TeamIndex teamIndex = base.body.teamComponent.teamIndex; int num = 0; TeamIndex val = (TeamIndex)0; while ((int)val < 5) { if (val != teamIndex && (int)val > 0 && num < WeirdlyShapedOpal.opalMaxBuff) { foreach (TeamComponent teamMember in TeamComponent.GetTeamMembers(val)) { Vector3 val2 = ((Component)teamMember).transform.position - base.body.corePosition; if (((Vector3)(ref val2)).sqrMagnitude <= WeirdlyShapedOpal.opalAreaRadiusSqr) { num++; if (num >= WeirdlyShapedOpal.opalMaxBuff) { break; } } } } val = (TeamIndex)(sbyte)(val + 1); } SetBuffCount(num); } public void SetBuffCount(int nearbyEnemies) { if (!NetworkServer.active) { return; } int buffCount = base.body.GetBuffCount(WeirdlyShapedOpal.opalStatBuff); if (buffCount == nearbyEnemies) { return; } if (buffCount < nearbyEnemies) { for (int i = 0; i < nearbyEnemies - buffCount; i++) { base.body.AddBuff(WeirdlyShapedOpal.opalStatBuff); } } else if (buffCount > nearbyEnemies) { for (int j = 0; j < buffCount - nearbyEnemies; j++) { base.body.RemoveBuff(WeirdlyShapedOpal.opalStatBuff); } } } private void Start() { indicatorEnabled = true; } private void OnDestroy() { indicatorEnabled = false; } } internal class WickedBand : ItemBase { private float cooldownTime = 1f; public static BuffDef wickedCooldown; private float damageCoefficientThreshold = 4f; private float cooldownRefreshBase = 0f; private float cooldownRefreshStack = 1f; private static ItemDisplayRuleDict IDR = new ItemDisplayRuleDict(Array.Empty()); public override bool isEnabled => false; public override string ItemName => "Wicked Band"; public override string ItemLangTokenName => "WICKEDBAND"; public override string ItemPickupDesc => "High damage hits reduce cooldowns by 1 second."; public override string ItemFullDescription => "Hits that deal more than " + Tools.ConvertDecimal(damageCoefficientThreshold) + " damage will also " + $"reduce ALL cooldowns by {cooldownRefreshBase + cooldownRefreshStack}s (+{cooldownRefreshStack} per stack). " + $"{cooldownTime} second cooldown."; public override string ItemLore => ""; public override ItemTier Tier => (ItemTier)2; public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)3 }; public override GameObject ItemModel => ItemBase.LoadDropPrefab("mdlWickedBand"); public override Sprite ItemIcon => ItemBase.LoadItemIcon("texIconWickedBand"); public override ItemDisplayRuleDict CreateItemDisplayRules() { return IDR; } public IEnumerator GetDisplayRules(orig_Init orig) { orig.Invoke(); if (!ItemBase.DefDictionary.ContainsKey("BorboWickedBand")) { yield break; } ItemDef def = ItemBase.instance.ItemsDef; if (!((Object)(object)def != (Object)null)) { yield break; } GameObject[] bodyPrefabs = BodyCatalog.bodyPrefabs; foreach (GameObject bodyPrefab in bodyPrefabs) { CharacterModel model = bodyPrefab.GetComponentInChildren(); if (Object.op_Implicit((Object)(object)model)) { ItemDisplayRuleSet idrs = model.itemDisplayRuleSet; if (Object.op_Implicit((Object)(object)idrs)) { Array.Resize(ref idrs.keyAssetRuleGroups, idrs.keyAssetRuleGroups.Length + 1); idrs.keyAssetRuleGroups[idrs.keyAssetRuleGroups.Length - 1].displayRuleGroup = idrs.FindDisplayRuleGroup((Object)(object)Items.CooldownOnCrit); idrs.keyAssetRuleGroups[idrs.keyAssetRuleGroups.Length - 1].keyAsset = (Object)(object)def; idrs.GenerateRuntimeValues(); } } } } public override void Init() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0018: 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_0041: 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) wickedCooldown = Content.CreateAndAddBuff("bdWickedCooldown", Addressables.LoadAssetAsync((object)"RoR2/Base/ElementalRings/texBuffElementalRingsReadyIcon.tif").WaitForCompletion(), Color.gray, canStack: false, isDebuff: true, (StackingDisplayMethod)0); wickedCooldown.isCooldown = true; BuffDef obj = wickedCooldown; obj.flags = (Flags)(obj.flags | 1); base.Init(); } public override void Hooks() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Expected O, but got Unknown ((ResourceAvailability)(ref BodyCatalog.availability)).onAvailable += delegate { ItemBase.CloneVanillaDisplayRules((Object)(object)ItemBase.instance.ItemsDef, (Object)(object)Items.CooldownOnCrit); }; OnHit.GetHitBehavior += new HitHookEventHandler(WickedBandCdr); } private void WickedBandCdr(CharacterBody body, DamageInfo damageInfo, CharacterBody victim) { //IL_004a: Unknown result type (might be due to invalid IL or missing references) int count = GetCount(body); if (count <= 0 || !(damageInfo.damage / body.damage >= damageCoefficientThreshold) || body.HasBuff(wickedCooldown)) { return; } body.AddTimedBuffAuthority(wickedCooldown.buffIndex, cooldownTime); float num = (cooldownRefreshBase + cooldownRefreshStack * (float)count) * damageInfo.procCoefficient; Util.PlaySound("Play_item_proc_crit_cooldown", ((Component)body).gameObject); if (NetworkServer.active) { GenericSkill[] allSkills = body.skillLocator.allSkills; GenericSkill[] array = allSkills; foreach (GenericSkill val in array) { val.RunRecharge(num); } } EquipmentSlot equipmentSlot = body.equipmentSlot; if (Object.op_Implicit((Object)(object)equipmentSlot)) { body.inventory.DeductActiveEquipmentCooldown(num); } } } internal class EnemyDamageUp : ItemBase { private GameObject enemySpawned; public override bool lockEnabled => true; public override string ConfigName => ""; public override string ItemName => "Enemy Damage Up"; public override string ItemLangTokenName => "ENEMYDAMAGEUP"; public override string ItemPickupDesc => "guess what idiot"; public override string ItemFullDescription => ""; public override string ItemLore => ""; public override ItemTier Tier => (ItemTier)5; public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)12 }; public override GameObject ItemModel => Addressables.LoadAssetAsync((object)"RoR2/Base/Core/NullModel.prefab").WaitForCompletion(); public override Sprite ItemIcon => LegacyResourcesAPI.Load("textures/miscicons/texWIPIcon"); public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown DirectorCore.TrySpawnObject += new hook_TrySpawnObject(StoreEnemyAsVariable); CombatDirector.Spawn += new hook_Spawn(GiveEnemyItem); } private bool GiveEnemyItem(orig_Spawn orig, CombatDirector self, SpawnCard spawnCard, EliteDef eliteDef, Transform spawnTarget, MonsterSpawnDistance spawnDistance, bool preventOverhead, float valueMultiplier, PlacementMode placementMode, bool singleScaledBoss) { //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) bool flag = orig.Invoke(self, spawnCard, eliteDef, spawnTarget, spawnDistance, preventOverhead, valueMultiplier, placementMode, singleScaledBoss); if (flag) { Inventory component = enemySpawned.GetComponent(); int num = 0; foreach (CharacterMaster readOnlyInstances in CharacterMaster.readOnlyInstancesList) { int itemCountEffective = readOnlyInstances.inventory.GetItemCountEffective(ItemsDef); if (itemCountEffective > 0) { num += itemCountEffective; } } if ((Object)(object)component != (Object)null && num > 0) { component.GiveItem(Items.BoostDamage, num); } } return flag; } private GameObject StoreEnemyAsVariable(orig_TrySpawnObject orig, DirectorCore self, DirectorSpawnRequest directorSpawnRequest) { enemySpawned = orig.Invoke(self, directorSpawnRequest); return enemySpawned; } } internal class EnemyHealthUp : ItemBase { private GameObject enemySpawned; public override bool lockEnabled => true; public override string ConfigName => ""; public override string ItemName => "Enemy Health Up"; public override string ItemLangTokenName => "ENEMYHEALTHUP"; public override string ItemPickupDesc => "guess what idiot"; public override string ItemFullDescription => ""; public override string ItemLore => ""; public override ItemTier Tier => (ItemTier)5; public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)12 }; public override GameObject ItemModel => assetBundle.LoadAsset("Assets/Prefabs/enemyHealthUp.prefab"); public override Sprite ItemIcon => LegacyResourcesAPI.Load("Assets/Icons/texIconPickupITEM_ENEMYHEALTHUP.png"); public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown DirectorCore.TrySpawnObject += new hook_TrySpawnObject(StoreEnemyAsVariable); CombatDirector.Spawn += new hook_Spawn(GiveEnemyItem); } private bool GiveEnemyItem(orig_Spawn orig, CombatDirector self, SpawnCard spawnCard, EliteDef eliteDef, Transform spawnTarget, MonsterSpawnDistance spawnDistance, bool preventOverhead, float valueMultiplier, PlacementMode placementMode, bool singleScaledBoss) { //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) bool flag = orig.Invoke(self, spawnCard, eliteDef, spawnTarget, spawnDistance, preventOverhead, valueMultiplier, placementMode, singleScaledBoss); if (flag) { Inventory component = enemySpawned.GetComponent(); int num = 0; foreach (CharacterMaster readOnlyInstances in CharacterMaster.readOnlyInstancesList) { int itemCountEffective = readOnlyInstances.inventory.GetItemCountEffective(ItemsDef); if (itemCountEffective > 0) { num += itemCountEffective; } } if ((Object)(object)component != (Object)null && num > 0) { component.GiveItem(ItemBase.instance.ItemsDef, num); } } return flag; } private GameObject StoreEnemyAsVariable(orig_TrySpawnObject orig, DirectorCore self, DirectorSpawnRequest directorSpawnRequest) { enemySpawned = orig.Invoke(self, directorSpawnRequest); return enemySpawned; } } internal class GalleryItemDrop : ItemBase { public ItemTag[] requiredItemTags = Array.Empty(); public ItemTag[] bannedItemTags = Array.Empty(); private WeightedSelection weightedSelection; private Xoroshiro128Plus rng; public Transform dropletOrigin; public override bool lockEnabled => true; public override string ConfigName => ""; public override string ItemName => "Gallery Item Drop"; public override string ItemLangTokenName => "GALLERY_ITEM_DROP"; public override string ItemPickupDesc => "You shouldn't see this lol"; public override string ItemFullDescription => ""; public override string ItemLore => ""; public override ItemTier Tier => (ItemTier)5; public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)12 }; public override GameObject ItemModel => LegacyResourcesAPI.Load("prefabs/NullModel"); public override Sprite ItemIcon => LegacyResourcesAPI.Load("textures/miscicons/texWIPIcon"); public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown GlobalEventManager.OnCharacterDeath += new hook_OnCharacterDeath(GalleryReward); } private void GalleryReward(orig_OnCharacterDeath orig, GlobalEventManager self, DamageReport damageReport) { orig.Invoke(self, damageReport); CharacterBody victimBody = damageReport.victimBody; Inventory inventory = victimBody.inventory; if (inventory != null && inventory.GetItemCountEffective(ItemsDef) > 0) { RollReward(victimBody); } } private void RollReward(CharacterBody body) { //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_0082: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) int num = Random.RandomRangeInt(0, 9); if (num > 1) { Debug.Log((object)"roll failed loser"); return; } if ((Object)(object)body == (Object)null) { Debug.Log((object)"body null"); return; } if ((Object)(object)body.inventory == (Object)null) { Debug.Log((object)"inv null??"); return; } PickupIndex none = PickupIndex.none; GenerateWeightedSelection(body.inventory); rng = new Xoroshiro128Plus(Run.instance.treasureRng.nextUlong); none = PickupDropTable.GenerateDropFromWeightedSelection(rng, weightedSelection); dropletOrigin = ((Component)body).gameObject.transform; PickupDropletController.CreatePickupDroplet(none, dropletOrigin.position, Vector3.zero); } private void GenerateWeightedSelection(Inventory inv) { //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) //IL_0025: 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_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) weightedSelection = new WeightedSelection(8); foreach (ItemIndex item in inv.itemAcquisitionOrder) { ItemDef itemDef = ItemCatalog.GetItemDef(item); PickupIndex val = PickupCatalog.FindPickupIndex(item); if (CanSelectItem(itemDef)) { weightedSelection.AddChoice(val, 0.9f); Debug.Log((object)"added an item!"); } } weightedSelection.AddChoice(PickupCatalog.FindPickupIndex(Items.RandomlyLunar.itemIndex), 0.1f); weightedSelection.AddChoice(PickupCatalog.FindPickupIndex("LunarCoin.Coin0"), 1f); } private bool CanSelectItem(ItemDef itemDef) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002e: 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_006a: Unknown result type (might be due to invalid IL or missing references) if ((int)itemDef.tier == 5) { return false; } ItemTag[] array = requiredItemTags; foreach (ItemTag value in array) { if (Array.IndexOf(itemDef.tags, value) == -1) { return false; } } ItemTag[] array2 = bannedItemTags; foreach (ItemTag value2 in array2) { if (Array.IndexOf(itemDef.tags, value2) != -1) { return false; } } return itemDef.canRemove; } } internal class HealthUp : ItemBase { public override bool lockEnabled => true; public override string ConfigName => ""; public override string ItemName => "HealthUp"; public override string ItemLangTokenName => "HEALTHUP"; public override string ItemPickupDesc => ""; public override string ItemFullDescription => ""; public override string ItemLore => ""; public override ItemTier Tier => (ItemTier)5; public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)12 }; public override GameObject ItemModel => LegacyResourcesAPI.Load("prefabs/NullModel"); public override Sprite ItemIcon => LegacyResourcesAPI.Load("textures/miscicons/texWIPIcon"); public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(ApplyStats); } private void ApplyStats(CharacterBody sender, StatHookEventArgs args) { int count = GetCount(sender); if (count > 0) { args.healthMultAdd += 0.1f * (float)count; } } } public abstract class ItemBase : ItemBase where T : ItemBase { public static T instance { get; private set; } public ItemBase() { if (instance != null) { throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting ItemBoilerplate/Item was instantiated twice"); } instance = this as T; } } public abstract class ItemBase : SharedBase { public static Dictionary DefDictionary = new Dictionary(); public ItemDef ItemsDef; public override AssetBundle assetBundle => SwanSongPlugin.mainAssetBundle; public override string ConfigName => "Items : " + ItemName; public abstract string ItemName { get; } public abstract string ItemLangTokenName { get; } public abstract string ItemPickupDesc { get; } public abstract string ItemFullDescription { get; } public abstract string ItemLore { get; } public abstract ItemTier Tier { get; } public abstract ItemTag[] ItemTags { get; } public abstract GameObject ItemModel { get; } public abstract Sprite ItemIcon { get; } public virtual bool CanRemove { get; } = false; public virtual bool IsHidden { get; } = false; public virtual ExpansionDef RequiredExpansion { get; } = null; public virtual bool CanBeTemporary { get; } = true; public override void Init() { CreateItem(); base.Init(); } internal static bool CheckDLC1Entitlement() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) EntitlementDef expansion = Addressables.LoadAssetAsync((object)"RoR2/DLC1/Common/entitlementDLC1.asset").WaitForCompletion(); return CheckDLCEntitlement(expansion); } internal static bool CheckDLCEntitlement(EntitlementDef expansion) { if (EntitlementAbstractions.VerifyLocalSteamUser(expansion)) { return true; } return false; } internal static void CloneVanillaDisplayRules(Object newDef, Object vanillaDef) { Debug.LogError((object)"Unable to clone vanilla display rules!"); } public override void Lang() { DoLangForItem(ItemsDef, ItemName, ItemPickupDesc, ItemFullDescription, ItemLore); } public abstract ItemDisplayRuleDict CreateItemDisplayRules(); protected void CreateItem() { //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_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Expected O, but got Unknown ItemTier tier = Tier; string text = ((object)(ItemTier)(ref tier)).ToString(); if (!text.Contains("Tier")) { text += "Tier"; } ItemsDef = CreateNewItem(ItemLangTokenName, ItemModel, ItemIcon, Tier, ItemTags, RequiredExpansion, IsHidden); ItemDisplayRuleDict val = CreateItemDisplayRules(); if (val == null) { val = new ItemDisplayRuleDict(Array.Empty()); } } public static ItemDef CreateNewItem(string langTokenName, GameObject modelPrefab, Sprite iconSprite, ItemTier tier, ItemTag[] itemTags = null, ExpansionDef requiredExpansion = null, bool isHidden = false, bool canBeTemporary = true) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) ItemDef val = CreateNewUntieredItem(langTokenName, iconSprite, tier, itemTags, isHidden); val.pickupModelPrefab = modelPrefab; val.requiredExpansion = requiredExpansion; return val; } public static ItemDef CreateNewUntieredItem(string langTokenName, Sprite iconSprite, ItemTier tier = 5, ItemTag[] itemTags = null, bool isHidden = false, bool canBeTemporary = true) { //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Invalid comparison between Unknown and I4 //IL_00cc: Unknown result type (might be due to invalid IL or missing references) ItemDef val = ScriptableObject.CreateInstance(); ((Object)val).name = "ITEM_" + langTokenName; val.nameToken = "ITEM_" + langTokenName + "_NAME"; val.pickupToken = "ITEM_" + langTokenName + "_PICKUP"; val.descriptionToken = "ITEM_" + langTokenName + "_DESCRIPTION"; val.loreToken = "ITEM_" + langTokenName + "_LORE"; val.pickupIconSprite = iconSprite; val.tier = tier; val.deprecatedTier = tier; val.hidden = isHidden; if (itemTags != null && itemTags.Length != 0) { val.tags = itemTags; if (canBeTemporary && (int)tier != 3) { int num = val.tags.Length; ref ItemTag[] tags = ref val.tags; ItemTag val2 = (ItemTag)31; ArrayUtils.ArrayAppend(ref tags, ref num, ref val2); } } Content.AddItemDef(val); return val; } public static void DoLangForItem(ItemDef itemDef, string name, string pickupDesc, string fullDesc = "", string lore = "") { LanguageAPI.Add(itemDef.nameToken, name); LanguageAPI.Add(itemDef.pickupToken, pickupDesc); LanguageAPI.Add(itemDef.descriptionToken, string.IsNullOrWhiteSpace(fullDesc) ? pickupDesc : fullDesc); LanguageAPI.Add(itemDef.loreToken, lore); } public int GetCount(CharacterBody body, bool permanentOnly = false) { if ((Object)(object)body == (Object)null) { return 0; } return GetCount(body.inventory, permanentOnly); } public int GetCount(Inventory inventory, bool permanentOnly = false) { if ((Object)(object)inventory == (Object)null) { return 0; } if (permanentOnly) { return inventory.GetItemCountPermanent(ItemsDef); } return inventory.GetItemCountEffective(ItemsDef); } public int GetCount(CharacterMaster master, bool permanentOnly = false) { if ((Object)(object)master == (Object)null) { return 0; } return GetCount(master.inventory, permanentOnly); } public int GetCountSpecific(CharacterBody body, ItemDef itemIndex) { if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.inventory)) { return 0; } return body.inventory.GetItemCountEffective(itemIndex); } public static float GetStackValue(float baseValue, float stackValue, int itemCount) { return baseValue + stackValue * (float)(itemCount - 1); } public static GameObject LoadDropPrefab(string prefabName = "", AssetBundle bundle = null) { return SwanSongPlugin.TryLoadFromBundle("Assets/Models/DropPrefabs/Item/" + prefabName + ".prefab", bundle).FixItemModel(); } public static GameObject LoadDisplayPrefab(string prefabName = "", AssetBundle bundle = null) { return SwanSongPlugin.TryLoadFromBundle("Assets/Models/DisplayPrefabs/Item/" + prefabName + ".prefab", bundle) ?? Resources.Load("prefabs/NullModel"); } public static Sprite LoadItemIcon(string spriteName = "", AssetBundle bundle = null, bool fallBackOnWrench = false) { return SwanSongPlugin.TryLoadSpriteFromBundle("Assets/Textures/Icons/Item/" + spriteName + ".png", bundle, fallBackOnWrench); } } internal class ChimeraScrap : ItemBase { public static ItemDef usedItemDef; [AutoConfig("Common Item Credit", 10)] public static int regenScrapCommonCredit = 10; [AutoConfig("Uncommon Item Credit", 5)] public static int regenScrapUncommonCredit = 5; [AutoConfig("Rare Item Credit", 2)] public static int regenScrapRareCredit = 2; [AutoConfig("Boss Item Credit", 1)] public static int regenScrapBossCredit = 1; [AutoConfig("Should Chimera Scrap Overbuy", "If set to true, Chimera Scraps payment will round up in the case of large item costs ie Lunar Cauldrons", false)] public static bool shouldSuperScrapOverBuy = false; public override AssetBundle assetBundle => SwanSongPlugin.retierAssetBundle; public override string ConfigName => "Reworks : Regenerating Scrap"; public override string ItemName => "Chimera Scrap"; public override string ItemLangTokenName => "SUPERSCRAP"; public override string ItemPickupDesc => "Prioritized when used with " + Language.Styling.RedText("ANY") + " 3D Printer. Creates extra items for lower tiers."; public override string ItemFullDescription => "Does nothing. Prioritized when used with " + Language.Styling.RedText("ALL") + " 3D Printers. Creates " + Language.Styling.StackColor("(") + " " + string.Format("{0} {1} ", regenScrapCommonCredit, Language.Styling.StackColor("/")) + Language.Styling.HealingColor(regenScrapUncommonCredit.ToString()) + " " + Language.Styling.StackColor("/") + " " + Language.Styling.RedText(regenScrapRareCredit.ToString()) + " " + Language.Styling.StackColor(")") + " items, " + Language.Styling.UtilityColor("depending on the quality of the printer") + "."; public override string ItemLore => "//--AUTO-TRANSCRIPTION FROM UES [Redacted] --//\n\n\"Hey, Joe, how's the work in engineering?\"\n\n\"Terrible. We have a shipment of this... weird, prototype material. Some kind of metal? They want us to make stuff out of it, which isn't too bad. Thing is, no matter how much I take, there always seems to be more. Did you know I made twenty-five hundred units of .300 caliber rounds from a 10 kilo crate of metal?\"\n\n\"How much!?\"\n\n\"Right!? I feel like I'm losing my mind. It's not even half-way empty. Hell, I bet there's more in there than when I started!\"\n\n\"Well, at least you won't have to worry about running out...\""; public override ItemTier Tier => (ItemTier)2; public override ItemTag[] ItemTags { get { ItemTag[] array = new ItemTag[7]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); return (ItemTag[])(object)array; } } public override GameObject ItemModel => Addressables.LoadAssetAsync((object)"RoR2/DLC1/RegeneratingScrap/PickupRegeneratingScrap.prefab").WaitForCompletion(); public override Sprite ItemIcon => assetBundle.LoadAsset("Assets/Icons/Regenerating_Scrap.png"); public override ExpansionDef RequiredExpansion => SharedBase.SotvExpansionDef(); public override bool CanBeTemporary => false; public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Hooks() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Expected O, but got Unknown //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Expected O, but got Unknown //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Expected O, but got Unknown //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Expected O, but got Unknown ((ResourceAvailability)(ref BodyCatalog.availability)).onAvailable += delegate { ItemBase.CloneVanillaDisplayRules((Object)(object)ItemBase.instance.ItemsDef, (Object)(object)Items.RegeneratingScrap); }; CostTypeDef.IsAffordable += new hook_IsAffordable(SuperScrapIsAffordable); CostTypeDef.PayCost += new hook_PayCost(SuperScrapPayCost); CharacterMaster.TryRegenerateScrap += new hook_TryRegenerateScrap(SuperScrapRegenerate); StatHooks.GetMoreStatCoefficients += new MoreStatHookEventHandler(ChimeraScrapCount); } private void ChimeraScrapCount(CharacterBody sender, MoreStatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender.inventory)) { args.scrapWhiteCountAdd += GetCount(sender) * regenScrapCommonCredit; args.scrapGreenCountAdd += GetCount(sender) * regenScrapUncommonCredit; args.scrapRedCountAdd += GetCount(sender) * regenScrapRareCredit; args.scrapYellowCountAdd += GetCount(sender) * regenScrapBossCredit; } } public override void Init() { SwanSongPlugin.RetierItemAsync(RoR2_DLC1_RegeneratingScrap.RegeneratingScrap_asset, (ItemTier)5); SwanSongPlugin.LoadAsync(RoR2_DLC1_RegeneratingScrap.texRegeneratingScrapConsumedIcon_png, (Action)delegate(Sprite icon) { usedItemDef = ItemBase.CreateNewUntieredItem("SUPERSCRAPUSED", icon, (ItemTier)5, ItemTags); ItemBase.DoLangForItem(usedItemDef, ItemName + " (Consumed)", "It's dead and not coming back.", "It's dead and not coming back."); }); base.Init(); } private void SuperScrapRegenerate(orig_TryRegenerateScrap orig, CharacterMaster self) { } private int GetSuperScrapPrinterCredit(ItemTier tier) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0004: 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_001f: Expected I4, but got Unknown return (int)tier switch { 0 => regenScrapCommonCredit, 1 => regenScrapUncommonCredit, 2 => regenScrapRareCredit, 4 => regenScrapBossCredit, _ => 1, }; } private void SuperScrapPayCost2(orig_PayCost orig, CostTypeDef self, PayCostContext context, PayCostResults result) { orig.Invoke(self, context, result); } private void SuperScrapPayCost(orig_PayCost orig, CostTypeDef self, PayCostContext context, PayCostResults result) { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Invalid comparison between Unknown and I4 //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Expected O, but got Unknown //IL_009a: 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_00ba: 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_00e4: 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_013c: 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_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_0193: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) int cost = context.cost; Interactor activator = context.activator; GameObject purchasedObject = context.purchasedObject; CharacterBody component = ((Component)activator).GetComponent(); if (self.costStringFormatToken == "COST_ITEM_FORMAT" && (Object)(object)component != (Object)null && (int)self.itemTier != 3) { Inventory inventory = component.inventory; if (Object.op_Implicit((Object)(object)inventory)) { int itemCountEffective = inventory.GetItemCountEffective(ItemBase.instance.ItemsDef.itemIndex); if (itemCountEffective > 0) { PayCostResults val = new PayCostResults(); ItemTransformation val2 = default(ItemTransformation); ((ItemTransformation)(ref val2)).originalItemIndex = ItemsDef.itemIndex; ((ItemTransformation)(ref val2)).newItemIndex = usedItemDef.itemIndex; ((ItemTransformation)(ref val2)).maxToTransform = 1; val2.transformationType = (ItemTransformationTypeIndex)3; TryTransformResult val3 = default(TryTransformResult); ((ItemTransformation)(ref val2)).TryTransform(inventory, ref val3); int superScrapPrinterCredit = GetSuperScrapPrinterCredit(self.itemTier); if (cost > superScrapPrinterCredit) { inventory.RemoveItemPermanent(ItemBase.instance.ItemsDef.itemIndex, itemCountEffective - 1); int cost2 = cost - superScrapPrinterCredit; context.cost = cost2; orig.Invoke(self, context, result); inventory.GiveItemPermanent(ItemBase.instance.ItemsDef.itemIndex, itemCountEffective - 1); } else if (superScrapPrinterCredit > cost) { SuperScrapPaymentController superScrapPaymentController = purchasedObject.AddComponent(); superScrapPaymentController.paymentCreditsRemaining = superScrapPrinterCredit - cost; } ItemAndStackValues item = default(ItemAndStackValues); item.itemIndex = ItemBase.instance.ItemsDef.itemIndex; item.stackValues = default(ItemStackValues); item.stackValues.permanentStacks = superScrapPrinterCredit; item.stackValues.totalStacks = superScrapPrinterCredit; val._itemStacksTaken.Add(item); return; } } } orig.Invoke(self, context, result); } private bool SuperScrapIsAffordable(orig_IsAffordable orig, CostTypeDef self, int cost, Interactor activator) { //IL_0047: 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_0080: Unknown result type (might be due to invalid IL or missing references) CharacterBody component = ((Component)activator).GetComponent(); if (self.costStringFormatToken == "COST_ITEM_FORMAT" && (Object)(object)component != (Object)null) { Inventory inventory = component.inventory; if (Object.op_Implicit((Object)(object)inventory)) { int itemCountEffective = inventory.GetItemCountEffective(ItemBase.instance.ItemsDef.itemIndex); if (itemCountEffective > 0) { int num = GetSuperScrapPrinterCredit(self.itemTier) * itemCountEffective; return num >= cost || inventory.HasAtLeastXTotalItemsOfTier(self.itemTier, cost - num); } } } return orig.Invoke(self, cost, activator); } } internal class ChocolateCoin : ItemBase { private GameObject chocolate; private float gravRadius = 4f; private int fruitChanceBase = 9; private int goldBase = 1; private int goldStack = 2; private float healFraction = 0f; private float healFlatBase = 5f; private float healFlatStack = 5f; private float chocolateLifetime = 10f; public override string ConfigName => "Items : Chocolate Coin"; public override string ItemName => "Chocolate Coin"; public override string ItemLangTokenName => "CHOCYCOIN"; public override string ItemPickupDesc => "Chance on hit to spawn a chocolate coin for gold and healing."; public override string ItemFullDescription => "On hit, gain a " + Language.Styling.UtilityColor($"{fruitChanceBase}% chance") + " to drop a chocolate coin that heals for " + Language.Styling.HealingColor(healFlatBase + " health") + " " + Language.Styling.StackText($"+{healFlatStack}") + " plus " + Language.Styling.UtilityColor(goldBase + " gold") + " " + Language.Styling.StackText($"+{goldStack}") + ". " + Language.Styling.UtilityColor("Scales over time") + "."; public override string ItemLore => "don't eat the wrapping!"; public override ItemTier Tier => (ItemTier)0; public override ItemTag[] ItemTags { get { ItemTag[] array = new ItemTag[3]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); return (ItemTag[])(object)array; } } public override GameObject ItemModel => Addressables.LoadAssetAsync((object)"RoR2/DLC1/GoldOnHurt/PickupRollOfPennies.prefab").WaitForCompletion(); public override Sprite ItemIcon => Addressables.LoadAssetAsync((object)"RoR2/DLC1/GoldOnHurt/texRollOfPenniesIcon.png").WaitForCompletion(); public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown return new ItemDisplayRuleDict(Array.Empty()); } public override void Init() { SwanSongPlugin.RetierItemAsync(RoR2_DLC1_GoldOnHurt.GoldOnHurt_asset, (ItemTier)5); CreateChocolate(); base.Init(); } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown OnHit.GetHitBehavior += new HitHookEventHandler(ChocolateCoinOnHit); } private void CreateChocolate() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) chocolate = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)"RoR2/Base/Tooth/HealPack.prefab").WaitForCompletion(), "Chocolate", true); TeamFilter component = chocolate.GetComponent(); HealthPickup componentInChildren = chocolate.GetComponentInChildren(); if (Object.op_Implicit((Object)(object)componentInChildren)) { MoneyPickup val = ((Component)componentInChildren).gameObject.AddComponent(); val.baseGoldReward = 1; val.shouldScale = false; val.teamFilter = component; } GravitatePickup componentInChildren2 = chocolate.GetComponentInChildren(); if ((Object)(object)componentInChildren2 != (Object)null) { componentInChildren2.gravitateAtFullHealth = true; Collider component2 = ((Component)componentInChildren2).gameObject.GetComponent(); if (component2.isTrigger) { ((Component)component2).transform.localScale = Vector3.one * gravRadius; } } else { Debug.Log((object)"No gravitatepickup"); } DestroyOnTimer componentInChildren3 = chocolate.GetComponentInChildren(); if (Object.op_Implicit((Object)(object)componentInChildren3)) { componentInChildren3.duration = chocolateLifetime; BeginRapidlyActivatingAndDeactivating component3 = chocolate.GetComponent(); if (Object.op_Implicit((Object)(object)component3)) { component3.delayBeforeBeginningBlinking = chocolateLifetime - 2f; } } ParticleSystemRenderer[] componentsInChildren = chocolate.GetComponentsInChildren(); foreach (ParticleSystemRenderer val2 in componentsInChildren) { string name = ((Object)((Component)val2).gameObject).name; Color32 val3 = Color32.op_Implicit(Color.white); string text = ""; if (name == "Core") { text = "matCholocateTrail"; ((Color32)(ref val3))..ctor((byte)62, (byte)37, (byte)0, byte.MaxValue); } if (name == "PulseGlow") { text = "matChocolateGlow"; ((Color32)(ref val3))..ctor((byte)79, (byte)46, (byte)0, byte.MaxValue); } if (text != "") { Material val5 = (((Renderer)val2).material = Object.Instantiate(((Renderer)val2).material)); ((Object)val5).name = text; val5.DisableKeyword("VERTEXCOLOR"); val5.SetFloat("_VertexColorOn", 0f); val5.SetColor("_TintColor", Color32.op_Implicit(val3)); } } Content.AddNetworkedObjectPrefab(chocolate); } private void ChocolateCoinOnHit(CharacterBody attackerBody, DamageInfo damageInfo, CharacterBody victimBody) { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: 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) if (!NetworkServer.active) { return; } int count = GetCount(attackerBody); if (count <= 0) { return; } float num = (float)fruitChanceBase * damageInfo.procCoefficient; if (Util.CheckRoll(num, attackerBody.master)) { GameObject val = Object.Instantiate(chocolate, damageInfo.position + Random.insideUnitSphere * victimBody.radius * 0.5f, Random.rotation); TeamFilter component = val.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.teamIndex = attackerBody.teamComponent.teamIndex; } HealthPickup componentInChildren = val.GetComponentInChildren(); if (Object.op_Implicit((Object)(object)componentInChildren)) { componentInChildren.fractionalHealing = healFraction; componentInChildren.flatHealing = healFlatBase + healFlatStack * (float)(count - 1); } MoneyPickup component2 = val.GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { int num2 = goldBase + goldStack * (count - 1); component2.baseGoldReward = num2 * Mathf.RoundToInt(attackerBody.level); } NetworkServer.Spawn(val); } } } internal class Elixir2 : ItemBase { public static ItemDef brokenItemDef; [AutoConfig("Barrier Fraction On Use", 1)] public static float barrierFraction = 1f; [AutoConfig("Move Speed Bonus", 0.14f)] public static float moveSpeedBuff = 0.14f; [AutoConfig("Attack Speed Bonus", 0.15f)] public static float attackSpeedBuff = 0.15f; [AutoConfig("Cooldown Reduction Bonus", 0.06f)] public static float cooldownReduction = 0.06f; public float buffDurationBase = 0f; public float buffDurationStack = 0f; public float damageBuff = 0.8f; public float msBuff = 0.45f; public int armorBuff = 60; public float instantHeal = 0.35f; public static BuffDef brewActiveBuff; public override string ConfigName => "Reworks : Elixir"; public override AssetBundle assetBundle => SwanSongPlugin.retierAssetBundle; public override string ItemName => "Berserker’s Brew"; public override string ItemLangTokenName => "LEGALLYDISTINCTELIXIR"; public override string ItemPickupDesc => "At low health, gain barrier, cleanse debuffs, and reset all cooldowns. Usable once per stage."; public override string ItemFullDescription => "Taking damage to below " + Tools.ConvertDecimal(0.25f) + " health consumes this item, instantly granting " + Tools.ConvertDecimal(barrierFraction) + " of maximum health in barrier and resetting all cooldowns. Each empty bottle increases attack speed by " + Tools.ConvertDecimal(attackSpeedBuff) + ", movement speed by " + Tools.ConvertDecimal(moveSpeedBuff) + ", and reduces cooldowns by " + Tools.ConvertDecimal(cooldownReduction) + ". Regenerates at the start of each stage."; public override string ItemLore => "Order: 16 oz. Flask, Healing Potion (Not my Strongest)\r\nTracking Number: 10******\r\nEstimated Delivery: 12/31/2058\r\nShipping Method: Priority\r\nShipping Address: Cargo Bay 10-C, Terminal 504-B, UES Port Trailing Comet\nShipping Details: \n- Re: Potion seller, I am going into battle. I require your strongest potions.\n\nMy potions are too strong for you, buyer. I've instead downgraded you to a weaker brew. My strongest potions would kill a dragon, let alone a man!"; public override ItemTier Tier => (ItemTier)1; public override GameObject ItemModel => Addressables.LoadAssetAsync((object)"RoR2/DLC1/HealingPotion/PickupHealingPotion.prefab").WaitForCompletion(); public override Sprite ItemIcon => assetBundle.LoadAsset("Assets/Icons/Power_Elixir.png"); public override ItemTag[] ItemTags { get; } public override ExpansionDef RequiredExpansion => SharedBase.SotvExpansionDef(); public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Init() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) brokenItemDef = ItemBase.CreateNewUntieredItem("LEGALLYDISTINCTBOTTLE", Addressables.LoadAssetAsync((object)"RoR2/DLC1/HealingPotion/texHealingPotionConsumed.png").WaitForCompletion(), (ItemTier)5); string fullDesc = "Increases attack speed by " + Tools.ConvertDecimal(attackSpeedBuff) + " (+" + Tools.ConvertDecimal(attackSpeedBuff) + " per stack), movement speed by " + Tools.ConvertDecimal(moveSpeedBuff) + " (+" + Tools.ConvertDecimal(moveSpeedBuff) + " per stack), and reduces cooldowns by " + Tools.ConvertDecimal(cooldownReduction) + " (-" + Tools.ConvertDecimal(cooldownReduction) + " per stack). "; ItemBase.DoLangForItem(brokenItemDef, "Empty Flask", "You feel lightweight.", fullDesc); SwanSongPlugin.RetierItemAsync(RoR2_DLC1_HealingPotion.HealingPotion_asset, (ItemTier)5); brewActiveBuff = Content.CreateAndAddBuff("bdBerserkerBrewActive", Addressables.LoadAssetAsync((object)"RoR2/Base/Common/texMovespeedBuffIcon.tif").WaitForCompletion(), new Color(1f, 0.3f, 0.1f), canStack: false, isDebuff: false, (StackingDisplayMethod)0); base.Init(); } public override void Hooks() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Expected O, but got Unknown //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Expected O, but got Unknown //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Expected O, but got Unknown //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Expected O, but got Unknown //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Expected O, but got Unknown ((ResourceAvailability)(ref BodyCatalog.availability)).onAvailable += delegate { ItemBase.CloneVanillaDisplayRules((Object)(object)ItemBase.instance.ItemsDef, (Object)(object)Items.HealingPotion); }; HealthComponent.UpdateLastHitTime += new hook_UpdateLastHitTime(ElixirHook); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(BerserkerBrewBuff); CharacterMaster.OnServerStageBegin += new hook_OnServerStageBegin(TryRegenerateElixir); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(BerserkerBrewBuff); CharacterBody.RecalculateStats += new hook_RecalculateStats(BerserkerBrewCdr); } private void BerserkerBrewCdr(orig_RecalculateStats orig, CharacterBody self) { orig.Invoke(self); int count = GetCount(self); if (count > 0) { float cooldownScale = Mathf.Pow(1f - cooldownReduction, (float)count); SkillLocator skillLocator = self.skillLocator; if ((Object)(object)skillLocator != (Object)null) { Tools.ApplyCooldownScale(skillLocator.primary, cooldownScale); Tools.ApplyCooldownScale(skillLocator.secondary, cooldownScale); Tools.ApplyCooldownScale(skillLocator.utility, cooldownScale); Tools.ApplyCooldownScale(skillLocator.special, cooldownScale); } } } private void TryRegenerateElixir(orig_OnServerStageBegin orig, CharacterMaster self, Stage stage) { orig.Invoke(self, stage); if (NetworkServer.active && Object.op_Implicit((Object)(object)self.inventory)) { int itemCountEffective = self.inventory.GetItemCountEffective(brokenItemDef); if (itemCountEffective > 0) { RegeneratePotions(itemCountEffective, self); } } } private void RegeneratePotions(int count, CharacterMaster master) { //IL_002d: 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) Inventory inventory = master.inventory; inventory.RemoveItem(brokenItemDef, count); inventory.GiveItem(ItemBase.instance.ItemsDef, count); CharacterMasterNotificationQueue.SendTransformNotification(master, brokenItemDef.itemIndex, ItemBase.instance.ItemsDef.itemIndex, (TransformationType)5); } private void BerserkerBrewBuff(CharacterBody sender, StatHookEventArgs args) { if (sender.HasBuff(brewActiveBuff)) { args.armorAdd += (float)armorBuff; args.moveSpeedMultAdd += msBuff; args.damageMultAdd += damageBuff; } if (Object.op_Implicit((Object)(object)sender.inventory)) { int itemCountEffective = sender.inventory.GetItemCountEffective(brokenItemDef); if (itemCountEffective > 0) { args.attackSpeedMultAdd += attackSpeedBuff * (float)itemCountEffective; args.moveSpeedMultAdd += attackSpeedBuff * (float)itemCountEffective; } } } private void ElixirHook(orig_UpdateLastHitTime orig, HealthComponent self, float damageValue, Vector3 damagePosition, bool damageIsSilent, GameObject attacker, bool delayedDamage, bool firstHitOfDelayedDamage) { //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Expected O, but got Unknown CharacterBody body = self.body; if (NetworkServer.active && Object.op_Implicit((Object)(object)body) && damageValue > 0f) { int count = GetCount(body); if (count > 0 && self.isHealthLow) { float num = buffDurationBase + buffDurationStack * (float)(count - 1); if (num > 0f) { body.AddTimedBuff(brewActiveBuff, num); } self.AddBarrier(body.maxHealth * barrierFraction); body.skillLocator.ApplyAmmoPack(); Util.CleanseBody(body, true, false, true, true, true, true); TransformPotions(count, body); EffectData val = new EffectData { origin = ((Component)self).transform.position }; val.SetNetworkedObjectReference(((Component)self).gameObject); EffectManager.SpawnEffect(LegacyResourcesAPI.Load("Prefabs/Effects/HealingPotionEffect"), val, true); } } orig.Invoke(self, damageValue, damagePosition, damageIsSilent, attacker, delayedDamage, firstHitOfDelayedDamage); } private void TransformPotions(int count, CharacterBody body) { //IL_0037: 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) Inventory inventory = body.inventory; inventory.RemoveItem(ItemBase.instance.ItemsDef, count); inventory.GiveItem(brokenItemDef, count); CharacterMasterNotificationQueue.SendTransformNotification(body.master, ItemBase.instance.ItemsDef.itemIndex, brokenItemDef.itemIndex, (TransformationType)0); } public Elixir2() { ItemTag[] array = new ItemTag[3]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); ItemTags = (ItemTag[])(object)array; base..ctor(); } } internal class LunarHealthDegen : ItemBase { public static BuffDef lunarRotBuff; public static BuffDef lunarRotBarrierCooldown; private static ItemDisplayRuleDict IDR = new ItemDisplayRuleDict(Array.Empty()); public static int luckBase = 2; public static int luckStack = 2; public static float healthRegenBase = -2f; public static float healthRegenStack = -2f; public static float healthRegenLevelBase = -0.3f; public static float healthRegenLevelStack = -0.3f; public static int rotStacksForFirstBonus = 3; public static int rotStacksForSecondBonus = 6; public static float damageBase = 4f; public static float damageStack = 2f; public override string ConfigName => "Reworks : Corpsebloom"; public override AssetBundle assetBundle => null; public override string ItemName => "Corpsebloom"; public override string ItemLangTokenName => "LUNARHEALTHDEGEN"; public override string ItemPickupDesc => "Your health degenerates over time. Gain barrier and luck at low health."; public override string ItemFullDescription => "For every missing " + Language.Styling.ConvertDecimal(1f / (float)LunarHealthDegenBehavior.maxBuffCount) + " of health, gain Rot. " + $"After {rotStacksForFirstBonus} Rot has accumulated, increase base damage by {damageBase} {Language.Styling.StackText($"+{damageStack}")}. " + $"After {rotStacksForSecondBonus} Rot, gain {Language.Styling.ConvertDecimal(LunarHealthDegenBehavior.barrierFraction)} barrier " + $"and increase Luck by {luckBase} {Language.Styling.StackText($"+{luckStack}")}. " + Language.Styling.RedText($"Reduce base health regeneration by {healthRegenBase} hp/s") + " " + Language.Styling.StackText($"{healthRegenStack}") + "."; public override string ItemLore => ""; public override ItemTier Tier => (ItemTier)3; public override ItemTag[] ItemTags { get { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected I4, but got Unknown ItemTag[] array = new ItemTag[4]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); array[3] = (ItemTag)(int)FreeLunarArtifact.FreeLunarBlacklist; return (ItemTag[])(object)array; } } public override GameObject ItemModel => Addressables.LoadAssetAsync((object)"RoR2/Base/RepeatHeal/PickupCorpseflower.prefab").WaitForCompletion(); public override Sprite ItemIcon => Addressables.LoadAssetAsync((object)"RoR2/Base/RepeatHeal/texCorpseflowerIcon.png").WaitForCompletion(); public override ItemDisplayRuleDict CreateItemDisplayRules() { return IDR; } public override void Init() { //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_0037: 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_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) Log.Warning("Corpsebloom rework not fully implemented"); base.Init(); SwanSongPlugin.RetierItemAsync(RoR2_Base_RepeatHeal.RepeatHeal_asset, (ItemTier)5); lunarRotBuff = Content.CreateAndAddBuff("bdLunarFlowerRotBuff", Addressables.LoadAssetAsync((object)"RoR2/Base/Common/texBuffGenericShield.tif").WaitForCompletion(), Color.blue, canStack: true, isDebuff: false, (StackingDisplayMethod)0); lunarRotBarrierCooldown = Content.CreateAndAddBuff("bdLunarFlowerBarrierCooldown", Addressables.LoadAssetAsync((object)"RoR2/Base/Common/texBuffGenericShield.tif").WaitForCompletion(), Color.white, canStack: false, isDebuff: false, (StackingDisplayMethod)0); lunarRotBarrierCooldown.isCooldown = true; } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Expected O, but got Unknown //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Expected O, but got Unknown CharacterBody.OnInventoryChanged += new hook_OnInventoryChanged(AddItemBehavior); CharacterBody.RecalculateStats += new hook_RecalculateStats(AddBuffStats); ((ResourceAvailability)(ref BodyCatalog.availability)).onAvailable += delegate { ItemBase.CloneVanillaDisplayRules((Object)(object)ItemBase.instance.ItemsDef, (Object)(object)Items.RepeatHeal); }; StatHooks.GetMoreStatCoefficients += new MoreStatHookEventHandler(ElegyLuck); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(ElegyStats); } private void ElegyStats(CharacterBody sender, StatHookEventArgs args) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) int count = GetCount(sender); if (count <= 0) { return; } float num = 1f; int num2 = count - 1; float num3 = 1f + 0.2f * sender.level; int buffCount = sender.GetBuffCount(lunarRotBuff.buffIndex); if (buffCount >= rotStacksForFirstBonus) { args.baseDamageAdd += (damageBase + damageStack * (float)num2) * num3; if (buffCount >= rotStacksForSecondBonus) { num = 0.5f; } } args.baseRegenAdd += (healthRegenBase + healthRegenStack * (float)num2) * num * num3; } private void ElegyLuck(CharacterBody sender, MoreStatHookEventArgs args) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) if (sender.GetBuffCount(lunarRotBuff.buffIndex) >= rotStacksForSecondBonus) { args.luckAdd += (float)(luckBase + luckStack * (GetCount(sender) - 1)); } } private void AddBuffStats(orig_RecalculateStats orig, CharacterBody self) { orig.Invoke(self); } private void AddItemBehavior(orig_OnInventoryChanged orig, CharacterBody self) { orig.Invoke(self); if (NetworkServer.active && (Object)(object)self.healthComponent != (Object)null) { self.AddItemBehavior(GetCount(self)); } } } public class LunarHealthDegenBehavior : ItemBehavior { private HealthComponent healthComponent; private BuffIndex luckUpBuffIndex = LunarHealthDegen.lunarRotBuff.buffIndex; private BuffIndex barrierCooldownBuffIndex = LunarHealthDegen.lunarRotBarrierCooldown.buffIndex; public static int maxBuffCount = 8; private int buffCount = 0; public static float barrierFraction = 0.5f; public static float barrierCoolDown = 30f; private void Start() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) healthComponent = base.body.healthComponent; buffCount = base.body.GetBuffCount(luckUpBuffIndex); } private void FixedUpdate() { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { return; } float num = 1f - (healthComponent.health + healthComponent.shield) / healthComponent.fullCombinedHealth; int num2 = Mathf.CeilToInt(num * (float)maxBuffCount); while (num2 > buffCount && buffCount < maxBuffCount) { base.body.AddBuff(luckUpBuffIndex); buffCount++; if ((buffCount >= LunarHealthDegen.rotStacksForSecondBonus) & !base.body.HasBuff(barrierCooldownBuffIndex)) { healthComponent.AddBarrier(healthComponent.fullCombinedHealth * barrierFraction); base.body.AddTimedBuff(barrierCooldownBuffIndex, barrierCoolDown); } } while (num2 < buffCount && buffCount > 0) { base.body.RemoveBuff(luckUpBuffIndex); buffCount--; } } private void OnDestroy() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) if (NetworkServer.active) { while (buffCount > 0) { base.body.RemoveBuff(luckUpBuffIndex); buffCount--; } } } } internal class Mocha2 : ItemBase { [AutoConfig("Seconds Of Boost On Stage Start", 60)] public static int stageDuration = 60; [AutoConfig("Seconds Of Boost On Item Pickup", 30)] public static int pickupDuration = 30; [AutoConfig("Seconds Of Boost On Interactable Use", 15)] public static int interactDuration = 15; [AutoConfig("Free Movement/Atk Speed Bonus", 0.05f)] public static float spdBoostFree = 0.05f; [AutoConfig("Buffed Movement/Atk Speed Bonus", 0.2f)] public static float spdBoostBuff = 0.2f; [AutoConfig("Free Cooldown Reduction Bonus", 0f)] public static float cdrBoostFree = 0f; [AutoConfig("Buffed Cooldown Reduction Bonus", 0.12f)] public static float cdrBoostBuff = 0.12f; private static ItemDisplayRuleDict IDR = new ItemDisplayRuleDict(Array.Empty()); public static BuffDef mochaBuffActive; public static BuffDef mochaBuffInactive; public static Sprite mochaCustomSprite = Addressables.LoadAssetAsync((object)"RoR2/Base/Common/texMovespeedBuffIcon.tif").WaitForCompletion(); public override string ConfigName => "Reworks : Mocha"; public override AssetBundle assetBundle => null; public override string ItemName => "Morning Mocha"; public override string ItemLangTokenName => "LEGALLYDISTINCTCOFFEE"; public override string ItemPickupDesc => "Gain a temporary speed boost after beginning a stage."; public override string ItemFullDescription => $"For {stageDuration} seconds after entering any stage, " + "increase " + Language.Styling.DamageColor("attack speed") + " and " + Language.Styling.DamageColor("movement speed") + " by " + Language.Styling.DamageColor(Tools.ConvertDecimal(spdBoostBuff)) + " " + Language.Styling.StackText("+" + Tools.ConvertDecimal(spdBoostBuff)) + ", and reduce " + Language.Styling.UtilityColor("skill cooldowns") + " by " + Language.Styling.UtilityColor("-" + Tools.ConvertDecimal(cdrBoostBuff)) + " " + Language.Styling.StackText("-" + Tools.ConvertDecimal(cdrBoostBuff)) + "Using " + Language.Styling.UtilityColor("any interactable") + " while this buff is active will extend the duration of the buff by " + Language.Styling.UtilityColor($"{interactDuration} seconds") + "."; public override string ItemLore => "Order: To-Go Coffee Cup, 16 ounces\r\nTracking Number: 32******\\r\nEstimated Delivery: 05/04/2058\r\nShipping Method: Standard\r\nShipping Address: Museum of Natural History, Ninten Island, Earth\r\nShipping Details:\nMy finest brew. Hope it doesn't spoil during transit. Remember to heat it back up to 176.23 degrees... that's when it's freshest. See you soon... Coo."; public override ItemTier Tier => (ItemTier)0; public override ItemTag[] ItemTags { get { ItemTag[] array = new ItemTag[3]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); return (ItemTag[])(object)array; } } public override GameObject ItemModel => Addressables.LoadAssetAsync((object)"RoR2/DLC1/AttackSpeedAndMoveSpeed/PickupCoffee.prefab").WaitForCompletion(); public override Sprite ItemIcon => Addressables.LoadAssetAsync((object)"RoR2/DLC1/AttackSpeedAndMoveSpeed/texCoffeeIcon.png").WaitForCompletion(); public override ExpansionDef RequiredExpansion => SharedBase.SotvExpansionDef(); public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public void GetDisplayRules() { ItemBase.CloneVanillaDisplayRules((Object)(object)ItemBase.instance.ItemsDef, (Object)(object)Items.AttackSpeedAndMoveSpeed); } public override void Init() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) mochaBuffActive = Content.CreateAndAddBuff("bdCoffeeActive", mochaCustomSprite, new Color(0.6f, 0.3f, 0.1f), canStack: true, isDebuff: false, (StackingDisplayMethod)0); mochaBuffInactive = Content.CreateAndAddBuff("bdCoffeeInctive", mochaCustomSprite, new Color(0.1f, 0.1f, 0.2f), canStack: false, isDebuff: false, (StackingDisplayMethod)0); base.Init(); } public override void Hooks() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Expected O, but got Unknown SwanSongPlugin.RetierItemAsync(RoR2_DLC1_AttackSpeedAndMoveSpeed.AttackSpeedAndMoveSpeed_asset, (ItemTier)5); CharacterBody.OnBuffFinalStackLost += new hook_OnBuffFinalStackLost(MochaExpiredBuff); MultiShopCardUtils.OnPurchase += new hook_OnPurchase(MochaExtend); TeleporterInteraction.onTeleporterBeginChargingGlobal += MochaExtendTP; RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(MochaSpeed); RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(YoinkMochaAssets)); } private void MochaExtendTP(TeleporterInteraction obj) { if (NetworkServer.active) { ExtendMochaBuff(obj.chargeActivatorServer.GetComponent()); } } private void MochaExtend(orig_OnPurchase orig, PayCostContext context, int moneyCost) { orig.Invoke(context, moneyCost); if (NetworkServer.active) { ExtendMochaBuff(context.activatorBody); } } private static void ExtendMochaBuff(CharacterBody body) { //IL_004a: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)body)) { return; } int buffCount = body.GetBuffCount(mochaBuffActive); if (buffCount > 0) { float num = Mathf.Min(buffCount + interactDuration, stageDuration - 1); for (int i = buffCount; (float)i < num; i++) { body.AddTimedBuffAuthority(mochaBuffActive.buffIndex, (float)(i + 1)); } } } private void YoinkMochaAssets() { //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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) if (ItemBase.CheckDLC1Entitlement()) { Sprite pickupIconSprite = Addressables.LoadAssetAsync((object)"RoR2/DLC1/AttackSpeedAndMoveSpeed/texCoffeeIcon.png").WaitForCompletion(); ItemBase.instance.ItemsDef.pickupIconSprite = pickupIconSprite; GameObject pickupModelPrefab = Addressables.LoadAssetAsync((object)"RoR2/DLC1/AttackSpeedAndMoveSpeed/DisplayCoffee.prefab").WaitForCompletion(); ItemBase.instance.ItemsDef.pickupModelPrefab = pickupModelPrefab; ItemBase.CloneVanillaDisplayRules((Object)(object)ItemBase.instance.ItemsDef, (Object)(object)Items.AttackSpeedAndMoveSpeed); } } private void MochaExpiredBuff(orig_OnBuffFinalStackLost orig, CharacterBody self, BuffDef buffDef) { if ((Object)(object)buffDef == (Object)(object)mochaBuffActive) { self.AddBuff(mochaBuffInactive); } orig.Invoke(self, buffDef); } private void MochaSpeed(CharacterBody sender, StatHookEventArgs args) { int count = GetCount(sender); if (count > 0) { float num = spdBoostFree; float num2 = Mathf.Pow(1f - cdrBoostFree, (float)count); if (sender.HasBuff(mochaBuffActive)) { num += spdBoostBuff; num2 *= Mathf.Pow(1f - cdrBoostBuff, (float)count); } args.moveSpeedMultAdd += num * (float)count; args.attackSpeedMultAdd += num * (float)count; args.allSkills.cooldownMultiplier *= num2; } } } public class BorboMochaBehavior : BaseItemBodyBehavior { private bool addingBuffs = false; public int remainingTime = 0; private float durationPerBuff = 1f; [ItemDefAssociation(useOnServer = true, useOnClient = false)] private static ItemDef GetItemDef() { return ItemBase.instance.ItemsDef; } private void Start() { if (!((BaseItemBodyBehavior)this).body.HasBuff(Mocha2.mochaBuffActive)) { if (remainingTime < Mocha2.stageDuration) { remainingTime = Mocha2.stageDuration; } SetMochaTime(remainingTime); } } public void UpdateTime(int newTime) { remainingTime = newTime; SetMochaTime(newTime); } private void SetMochaTime(int targetCount) { int num = 0; if (!NetworkServer.active) { return; } if (((BaseItemBodyBehavior)this).body.HasBuff(Mocha2.mochaBuffInactive)) { ((BaseItemBodyBehavior)this).body.RemoveBuff(Mocha2.mochaBuffInactive); } else { num = ((BaseItemBodyBehavior)this).body.GetBuffCount(Mocha2.mochaBuffActive); } float num2 = (float)targetCount / durationPerBuff; if (num2 > (float)num) { for (int i = num; (float)i < num2; i++) { AddMochaBuff((float)(i + 1) * durationPerBuff); } } } private void AddMochaBuff(float duration) { ((BaseItemBodyBehavior)this).body.AddTimedBuff(Mocha2.mochaBuffActive, duration); } } internal class Molotov : ItemBase { [AutoConfig("Disable Molotov Equipment", false)] public static bool disableMolotovEquipment = false; [AutoConfig("Molotov Equipment Damage Coefficient", 2.5f)] public static float molotovEquipmentDamage = 2.5f; [AutoConfig("Molotov Equipment Damage Multiplier Per Second", 0.4f)] public static float molotovEquipmentDotDamage = 0.4f; [AutoConfig("Molotov Equipment Damage Frequency", 0.4f)] public static float molotovEquipmentDotFrequency = 3f; [AutoConfig("Molotov Item Proc Chance", 9)] public static float procChance = 9f; [AutoConfig("Molotov Item Base Damage Coefficient", 0.6f)] public static float baseDamageCoefficient = 0.6f; [AutoConfig("Molotov Item Stacking Damage Coefficient", 0.6f)] public static float stackDamageCoefficient = 0.6f; [AutoConfig("Molotov Item Impact Proc Coefficient", 0.5f)] public static float impactProcCoefficient = 0.5f; [AutoConfig("Molotov Item Damage Multiplier Per Second", 0.25f)] public static float dotDamageCoefficient = 0.25f; [AutoConfig("Molotov Item Damage Frequency", 2f)] public static float dotFrequency = 2f; [AutoConfig("Molotov Item Proc Coefficient Per Tick", 0.33f)] public static float dotProcCoefficient = 0.33f; [AutoConfig("Molotov Item Blast Radius", 12)] public static float blastRadius = 12f; [AutoConfig("Molotov Item Napalm Duration", 5)] public static float napalmDuration = 5f; public static GameObject molotovProjectile; public static GameObject molotovDotZone; public override string ConfigName => "Reworks : Molotovs"; public override AssetBundle assetBundle => SwanSongPlugin.retierAssetBundle; public override ExpansionDef RequiredExpansion => SharedBase.SotvExpansionDef(); public override string ItemName => "Molotov (1-Pack)"; public override string ItemLangTokenName => "BORBOMOLOTOV"; public override string ItemPickupDesc => "Chance on hit to lob a flaming molotov."; public override string ItemFullDescription => $"{procChance}% chance on hit to " + "lob a molotov cocktail that ignites enemies for " + Tools.ConvertDecimal(baseDamageCoefficient) + " (+" + Tools.ConvertDecimal(stackDamageCoefficient) + " per stack) TOTAL damage and leaves a burning area for " + Tools.ConvertDecimal(baseDamageCoefficient * dotDamageCoefficient * dotFrequency) + " (+" + Tools.ConvertDecimal(stackDamageCoefficient * dotDamageCoefficient * dotFrequency) + " per stack) TOTAL damage per second."; public override string ItemLore => "Order: Ethanol Bottle (32 oz.), 6 Pack\r\nTracking Number: 81******\r\nEstimated Delivery: 05/8/2058\r\nShipping Method: Priority\r\nShipping Address: Teromere Manor, Privet Road, Mars\nShipping Details: Let our friends inside know that we're coming over for drinks on the 16th of June. It'll be a hell of a party, they should probably hit the road before things get too out of hand."; public override ItemTier Tier => (ItemTier)0; public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)1 }; public override GameObject ItemModel => Addressables.LoadAssetAsync((object)"RoR2/DLC1/Molotov/PickupMolotov.prefab").WaitForCompletion(); public override Sprite ItemIcon => assetBundle.LoadAsset("Assets/Icons/Molotov_29.png"); public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Init() { //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) base.Init(); CreateProjectile(); Debug.LogWarning((object)"Still need to replace the molotov equipment icon"); EquipmentDef val = Addressables.LoadAssetAsync((object)"RoR2/DLC1/Molotov/Molotov.asset").WaitForCompletion(); if (disableMolotovEquipment) { val.canDrop = false; val.enigmaCompatible = false; val.canBeRandomlyTriggered = false; return; } LanguageAPI.Add("EQUIPMENT_MOLOTOV_DESC", "Throw 6 molotov cocktails that ignite enemies for " + Tools.ConvertDecimal(molotovEquipmentDamage) + " base damage. Each molotov leaves a burning area for " + Tools.ConvertDecimal(molotovEquipmentDamage * molotovEquipmentDotDamage * molotovEquipmentDotFrequency) + " damage per second."); } public override void Hooks() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Expected O, but got Unknown ((ResourceAvailability)(ref BodyCatalog.availability)).onAvailable += delegate { ItemBase.CloneVanillaDisplayRules((Object)(object)ItemBase.instance.ItemsDef, (Object)(object)Equipment.Molotov); }; OnHit.GetHitBehavior += new HitHookEventHandler(MolotovOnHit); } private void MolotovOnHit(CharacterBody attackerBody, DamageInfo damageInfo, CharacterBody victim) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Invalid comparison between Unknown and I4 //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_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: 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_010b: Unknown result type (might be due to invalid IL or missing references) //IL_010d: 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_0124: Unknown result type (might be due to invalid IL or missing references) int count = GetCount(attackerBody); if (count > 0 && (((DamageTypeCombo)(ref damageInfo.damageType)).IsDamageSourceSkillBased || (int)damageInfo.damageType.damageSource == 64) && Util.CheckRoll(procChance * damageInfo.procCoefficient, attackerBody.master)) { float num = baseDamageCoefficient + stackDamageCoefficient * (float)(count - 1); Vector3 aimDirection = attackerBody.inputBank.aimDirection; aimDirection.y = 0f; Vector3 val = aimDirection + Vector3.up * 0.5f; ProjectileManager obj = ProjectileManager.instance; FireProjectileInfo val2 = new FireProjectileInfo { damage = attackerBody.damage * num, crit = damageInfo.crit, damageColorIndex = (DamageColorIndex)3, position = attackerBody.corePosition, procChainMask = damageInfo.procChainMask, force = 0f, owner = damageInfo.attacker, projectilePrefab = molotovProjectile, rotation = Util.QuaternionSafeLookRotation(val) }; ((FireProjectileInfo)(ref val2)).speedOverride = 20f; obj.FireProjectile(val2); } } private void CreateProjectile() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_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_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0095: 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_0198: Unknown result type (might be due to invalid IL or missing references) GameObject val = Addressables.LoadAssetAsync((object)"RoR2/DLC1/Molotov/MolotovSingleProjectile.prefab").WaitForCompletion(); GameObject val2 = Addressables.LoadAssetAsync((object)"RoR2/DLC1/Molotov/MolotovProjectileDotZone.prefab").WaitForCompletion(); ProjectileController component = val.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.procCoefficient = 1f; } ProjectileImpactExplosion component2 = val.GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { ((ProjectileExplosion)component2).blastRadius = blastRadius; ((ProjectileExplosion)component2).blastDamageCoefficient = molotovEquipmentDamage; ((ProjectileExplosion)component2).childrenProjectilePrefab = val2; } val2.transform.localScale = Vector3.one * blastRadius / 6f; ProjectileDotZone component3 = val2.GetComponent(); if (Object.op_Implicit((Object)(object)component3)) { component3.damageCoefficient = molotovEquipmentDotDamage; component3.resetFrequency = molotovEquipmentDotFrequency; component3.fireFrequency = molotovEquipmentDotFrequency * 2f; component3.lifetime = napalmDuration; } molotovProjectile = PrefabAPI.InstantiateClone(val, "BorboMolotovProjectile", true); molotovDotZone = PrefabAPI.InstantiateClone(val2, "BorboMolotovDotZone", true); ProjectileImpactExplosion component4 = molotovProjectile.GetComponent(); if (Object.op_Implicit((Object)(object)component4)) { ((ProjectileExplosion)component4).blastDamageCoefficient = 1f; ((ProjectileExplosion)component4).blastProcCoefficient = impactProcCoefficient; ((ProjectileExplosion)component4).childrenProjectilePrefab = molotovDotZone; } ProjectileDamage component5 = molotovProjectile.GetComponent(); if (Object.op_Implicit((Object)(object)component5)) { component5.damageType.damageSource = (DamageSource)0; } ProjectileDamage component6 = molotovDotZone.GetComponent(); if (Object.op_Implicit((Object)(object)component6)) { component6.damageType.damageSource = (DamageSource)0; } ProjectileDotZone component7 = molotovDotZone.GetComponent(); if (Object.op_Implicit((Object)(object)component7)) { component7.overlapProcCoefficient = dotProcCoefficient; component7.damageCoefficient = dotDamageCoefficient; component7.resetFrequency = dotFrequency; component7.fireFrequency = dotFrequency * 2f; } Content.AddProjectilePrefab(molotovProjectile); Content.AddProjectilePrefab(molotovDotZone); } } internal class RejuvRack : ItemBase { [AutoConfig("Passive Reserve Fill Per Second", 0.02f)] public static float reserveFillPerSecond = 0.02f; [AutoConfig("Reserve Draw Per Second", 0.1f)] public static float healthFractionToRestorePerSecond = 0.1f; [AutoConfig("Overheal Efficiency Base", 0.5f)] public static float baseOverhealEfficiency = 0.5f; [AutoConfig("Overheal Efficiency Stack", 0.5f)] public static float stackOverhealEfficiency = 0.5f; [AutoConfig("Base Reserve Capacity", 0.3f)] public static float baseReserveCapacityFraction = 0.3f; [AutoConfig("Stack Reserve Capacity", 0f)] public static float stackReserveCapacityFraction = 0f; public override string ConfigName => "Reworks : Planula"; public override AssetBundle assetBundle => null; public override string ItemName => "Rejuvenation Rack"; public override string ItemLangTokenName => "REWORKRACK"; public override string ItemPickupDesc => "Stores overheal for later."; public override string ItemFullDescription => "Healing past full will store the excess in a healing reserve at " + Tools.ConvertDecimal(baseOverhealEfficiency) + " (+" + Tools.ConvertDecimal(stackOverhealEfficiency) + " per stack) efficiency, up to " + Tools.ConvertDecimal(baseReserveCapacityFraction) + " (+" + Tools.ConvertDecimal(stackReserveCapacityFraction) + " per stack) of your maximum health. When injured, heal for " + Tools.ConvertDecimal(healthFractionToRestorePerSecond) + " of your health per second, drawing from the healing reserve until it is empty."; public override string ItemLore => "\"Nature has a way of nurturing the physical. The mind, by perseverance and dedication. The soul, however... is healed by fantasy, and fantasy alone.\"\r\n-Unknown Venetian monk\r\n"; public override ItemTier Tier => (ItemTier)2; public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[2] { (ItemTag)2, (ItemTag)4 }; public override GameObject ItemModel => Addressables.LoadAssetAsync((object)"RoR2/Base/IncreaseHealing/PickupAntler.prefab").WaitForCompletion(); public override Sprite ItemIcon => Addressables.LoadAssetAsync((object)"RoR2/Base/IncreaseHealing/texAntlerIcon.png").WaitForCompletion(); public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Hooks() { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Expected O, but got Unknown //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Expected O, but got Unknown //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Expected O, but got Unknown SwanSongPlugin.RetierItemAsync(RoR2_Base_RepeatHeal.RepeatHeal_asset, (ItemTier)5); SwanSongPlugin.RetierItemAsync(RoR2_Base_IncreaseHealing.IncreaseHealing_asset, (ItemTier)5); ((ResourceAvailability)(ref BodyCatalog.availability)).onAvailable += delegate { ItemBase.CloneVanillaDisplayRules((Object)(object)ItemBase.instance.ItemsDef, (Object)(object)Items.IncreaseHealing); }; Inventory.GetItemCountEffective_ItemIndex += new hook_GetItemCountEffective_ItemIndex(OverrideItemCount); RepeatHealComponent.FixedUpdate += new hook_FixedUpdate(RepeatHealWhileHurt); HealthComponent.Heal += new Manipulator(RejuvOverheal); } private void RejuvOverheal(ILContext il) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0111: 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_0130: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); MethodReference val3 = default(MethodReference); val.GotoNext((MoveType)2, new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "repeatHealComponent"), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, ref val3) }); val.Emit(OpCodes.Pop); val.Emit(OpCodes.Ldc_I4_0); int overhealLoc = 2; val.GotoNext((MoveType)2, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "RoR2.HealthComponent/ItemCounts", "barrierOnOverHeal") }); ILLabel val2 = default(ILLabel); val.GotoPrev((MoveType)0, new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref overhealLoc), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 0f), (Instruction x) => ILPatternMatchingExt.MatchBleUn(x, ref val2) }); val.Emit(OpCodes.Ldloc, overhealLoc); val.Emit(OpCodes.Ldarg, 0); val.Emit(OpCodes.Ldarg, 3); val.EmitDelegate>((Action)delegate(float overhealAmt, HealthComponent self, bool nonRegen) { int repeatHeal = self.itemCounts.repeatHeal; if (overhealAmt > 0f && nonRegen && repeatHeal > 0 && Object.op_Implicit((Object)(object)self.repeatHealComponent)) { float num = overhealAmt * (baseOverhealEfficiency + stackOverhealEfficiency * (float)(repeatHeal - 1)); float num2 = self.fullHealth * (baseReserveCapacityFraction + stackReserveCapacityFraction * (float)(repeatHeal - 1)); self.repeatHealComponent.AddReserve(num, num2); } }); } private void RepeatHealWhileHurt(orig_FixedUpdate orig, RepeatHealComponent mono) { HealthComponent healthComponent = mono.healthComponent; mono.AddReserve(healthComponent.fullHealth * reserveFillPerSecond * Time.fixedDeltaTime, healthComponent.fullHealth * (baseReserveCapacityFraction + stackReserveCapacityFraction * (float)(healthComponent.itemCounts.repeatHeal - 1))); if (!Object.op_Implicit((Object)(object)healthComponent) || healthComponent.health < healthComponent.fullHealth) { mono.healthFractionToRestorePerSecond = healthFractionToRestorePerSecond; orig.Invoke(mono); } } private int OverrideItemCount(orig_GetItemCountEffective_ItemIndex orig, Inventory self, ItemIndex itemIndex) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) if (itemIndex == Items.RepeatHeal.itemIndex) { return GetCount(self); } return orig.Invoke(self, itemIndex); } } internal class BigBattery : ItemBase { public static float shieldPercentBase = 0.04f; public static float rechargeRateIncrease = 1f; public static float aspdIncrease = 0.2f; public override ExpansionDef RequiredExpansion => SwanSongPlugin.expansionDefSS2; public override string ItemName => "AAAAAAA Battery"; public override string ItemLangTokenName => "BORBOBIGBATTERY"; public override string ItemPickupDesc => "Increase shield recharge rate. While shields are active, gain an attack speed bonus."; public override string ItemFullDescription => "Gain a shield equal to " + Tools.ConvertDecimal(shieldPercentBase) + " of your maximum health. Reduces shield recharge delay " + $"by {rechargeRateIncrease}s. " + "While shields are active, increase attack speed by " + Tools.ConvertDecimal(aspdIncrease) + " (+" + Tools.ConvertDecimal(aspdIncrease) + " per stack)."; public override string ItemLore => "Order: Prototype Battery\r\nTracking Number: 11***********\r\nEstimated Delivery: 5/6/2056\r\nShipping Method: Priority\r\nShipping Address: Palia Research Station, Sun\r\nShipping Details:\r\n\r\nOkay, how’s this one?\r\n\r\nWe’ve uh,\r\n\r\n*snicker*\r\n\r\nUh, we’ve reviewed your notes on the last prototype, and, uh\r\n\r\n(background chatter)\r\n\r\nWe’ve adjusted the dimensions slightly\r\n\r\n*snicker*\r\n\r\nNow, it is slightly longer than your generator thing, but, uh\r\n\r\n(muffled laughter)\r\n\r\nWe also drew up this little, uh, connector thing…\r\n\r\n(Shut the fuck up guys)\r\n\r\nUh, anyway, you can just, like, stick it right in there, like in the demo video\r\n\r\n(loud footsteps)\r\n\r\nAnd honestly I think we’re,\r\n\r\n*snicker*\r\n\r\nI think we’re really onto something here, man\r\n\r\nLike this could be the uh\r\n\r\nThe new standard power supply\r\n\r\n*snicker*\r\n\r\nYou know?"; public override ItemTier Tier => (ItemTier)0; public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)3 }; public override GameObject ItemModel => ItemBase.LoadDropPrefab("mdlBigBattery"); public override Sprite ItemIcon => ItemBase.LoadItemIcon("texIconBigBattery"); public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown StatHooks.GetMoreStatCoefficients += new MoreStatHookEventHandler(BatteryRecharge); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(BatteryAspd); } private void BatteryRecharge(CharacterBody sender, MoreStatHookEventArgs args) { if (GetCount(sender) > 0) { args.shieldDelaySecondsIncreaseAddPreMult -= rechargeRateIncrease; } } private void BatteryAspd(CharacterBody sender, StatHookEventArgs args) { int count = GetCount(sender); if (count <= 0) { return; } HealthComponent healthComponent = sender.healthComponent; if ((Object)(object)healthComponent != (Object)null) { args.baseShieldAdd += sender.maxHealth * shieldPercentBase; if (Fuse.HasShield(healthComponent)) { args.attackSpeedMultAdd += aspdIncrease * (float)count; } } } } internal class BirdBand : ItemBase { public static BuffDef birdBuff; public static BuffDef birdDebuff; public float regenDurationBase = 1.5f; public float regenDurationStack = 0.75f; public int cooldownTime = 7; public override string ConfigName => "Items : Devs Item"; public override ExpansionDef RequiredExpansion => SwanSongPlugin.expansionDefSS2; public override string ItemName => "Dev’s Item"; public override string ItemLangTokenName => "BIRDBAND"; public override string ItemPickupDesc => "High damage hits also make you Regenerative for a short duration. Recharges over time."; public override string ItemFullDescription => "Hits that deal more than 400% damage also make you Regenerative " + $"for {regenDurationBase} seconds (+{regenDurationStack} seconds per stack), " + $"restoring 10% of your maximum health per second. Recharges every {cooldownTime} seconds."; public override string ItemLore => "“I’m telling you, they’re real.”\r\n\r\n“No way, dude. It’s ridiculous even for a ghost story.”\r\n\r\n“Yeah! ‘Even higher than the gods themselves’? Get real.”\r\n\r\n“I’ve seen proof, I’m telling you. Shit that defies explanation.”\r\n\r\n“Oh, do tell. I’m on the edge of my seat.”\r\n\r\n“You know those missile launchers? The ones that used to shoot one big fuckoff rocket? Why’d they start vomiting those little stingers all of a sudden?”\r\n\r\n“I dunno.”\r\n\r\n“It was them. They rewrote it. And- and that all that shit that just disappeared, like it was never there. And all our medical supplies that suddenly got way less effective. You notice that all the monsters don’t hit as hard as they used to?”\r\n\r\n“Dude…”\r\n\r\n“It’s real, I’m telling you! And all our suits got so much… clunkier. All at once. Even though nothing’s wrong with them.”\r\n\r\n“...”\r\n\r\n“And my wungus only heals one hp now.”\r\n\r\n“Dude. What the fuck are you talking about?”\r\n\r\n“He’s lost it.”"; public override ItemTier Tier => (ItemTier)1; public override ItemTag[] ItemTags { get { ItemTag[] array = new ItemTag[3]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); return (ItemTag[])(object)array; } } public override GameObject ItemModel => ItemBase.LoadDropPrefab("mdlBirdBand"); public override Sprite ItemIcon => ItemBase.LoadItemIcon("texIconBirdBand"); public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown return new ItemDisplayRuleDict(Array.Empty()); } public override void Init() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0018: 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_0039: 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_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) //IL_0060: Unknown result type (might be due to invalid IL or missing references) birdBuff = Content.CreateAndAddBuff("bdBirdBandReady", Addressables.LoadAssetAsync((object)"RoR2/Base/ElementalRings/texBuffElementalRingsReadyIcon.tif").WaitForCompletion(), Color.green, canStack: false, isDebuff: false, (StackingDisplayMethod)0); birdDebuff = Content.CreateAndAddBuff("bdBirdBandCooldown", Addressables.LoadAssetAsync((object)"RoR2/Base/ElementalRings/texBuffElementalRingsCooldownIcon.tif").WaitForCompletion(), Color.blue, canStack: true, isDebuff: true, (StackingDisplayMethod)0); BuffDef obj = birdDebuff; obj.flags = (Flags)(obj.flags | 1); base.Init(); } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown CharacterBody.OnInventoryChanged += new hook_OnInventoryChanged(AddItemBehavior); OnHit.GetHitBehavior += new HitHookEventHandler(BirdBand_GetHitBehavior); } private void AddItemBehavior(orig_OnInventoryChanged orig, CharacterBody self) { orig.Invoke(self); if (NetworkServer.active) { self.AddItemBehavior(GetCount(self)); } } private void BirdBand_GetHitBehavior(CharacterBody body, DamageInfo damageInfo, CharacterBody victim) { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { return; } int count = GetCount(body); float num = damageInfo.damage / body.damage; if (count > 0 && num >= 4f && body.HasBuff(birdBuff)) { body.RemoveBuff(birdBuff); for (int i = 0; i < cooldownTime; i++) { body.AddTimedBuffAuthority(birdDebuff.buffIndex, (float)(i + 1)); } body.AddTimedBuffAuthority(Buffs.CrocoRegen.buffIndex, regenDurationBase + regenDurationStack * (float)(count - 1)); } } } public class BirdBandBehavior : ItemBehavior { private void FixedUpdate() { if (NetworkServer.active) { bool flag = base.body.HasBuff(BirdBand.birdBuff); bool flag2 = base.body.HasBuff(BirdBand.birdDebuff); if (!flag && !flag2) { base.body.AddBuff(BirdBand.birdBuff); } if (flag && flag2) { base.body.RemoveBuff(BirdBand.birdBuff); } } } } internal class BottleCloud : ItemBase { public static float verticalBonusOnCloudJump = 0.15f; private static GameObject novaEffectPrefab = null; public static BuffDef cloudReadyBuff; internal static float smokeBombRadius = 13f; private static float smokeBombDamageCoefficient = 1f; private static float smokeBombProcCoefficient = 1f; public override string ConfigName => "Items : Cloud In A Bottle"; public override ExpansionDef RequiredExpansion => SwanSongPlugin.expansionDefSS2; public override string ItemName => "Cloud In A Bottle"; public override string ItemLangTokenName => "CLOUDBOTTLE"; public override string ItemPickupDesc => "Gain an extra jump. Double jumping near enemies stuns them."; public override string ItemFullDescription => "Gain an extra jump. " + $"Double jumping within {smokeBombRadius}m of any enemy " + "drops a smoke bomb, stunning them " + $"for {smokeBombProcCoefficient} second. " + $"Cannot be reactivated for {CloudBottleBehavior.cooldownDuration} seconds " + "(-" + Tools.ConvertDecimal(CloudBottleBehavior.cooldownReductionPerStack) + " per stack)."; public override string ItemLore => ""; public override ItemTier Tier => (ItemTier)0; public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)3 }; public override GameObject ItemModel => ItemBase.LoadDropPrefab("mdlBottleCloud"); public override Sprite ItemIcon => ItemBase.LoadItemIcon("texIconBottleCloud"); public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Init() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) cloudReadyBuff = Content.CreateAndAddBuff("bdCloudReady", Addressables.LoadAssetAsync((object)"RoR2/Base/Common/texBuffGenericShield.tif").WaitForCompletion(), Color.white, canStack: false, isDebuff: false, (StackingDisplayMethod)0); base.Init(); } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown StatHooks.GetMoreStatCoefficients += new MoreStatHookEventHandler(CloudJumpStat); CharacterBody.OnInventoryChanged += new hook_OnInventoryChanged(AddItemBehavior); } private void CloudJumpStat(CharacterBody sender, MoreStatHookEventArgs args) { if (GetCount(sender) > 0) { args.jumpCountAdd++; } } private void AddItemBehavior(orig_OnInventoryChanged orig, CharacterBody self) { orig.Invoke(self); if (NetworkServer.active && Object.op_Implicit((Object)(object)self.master)) { CloudBottleBehavior cloudBottleBehavior = self.AddItemBehavior(GetCount(self)); } } internal static void CreateNinjaSmokeBomb(CharacterBody self) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0024: 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_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_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_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Expected O, but got Unknown //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00df: 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_00fb: Expected O, but got Unknown BlastAttack val = new BlastAttack(); val.radius = smokeBombRadius; val.procCoefficient = smokeBombProcCoefficient; val.position = self.transform.position; val.attacker = ((Component)self).gameObject; val.crit = Util.CheckRoll(self.crit, self.master); val.baseDamage = self.damage * smokeBombDamageCoefficient; val.falloffModel = (FalloffModel)0; val.damageType = DamageTypeCombo.op_Implicit((DamageType)32); val.baseForce = StealthMode.blastAttackForce; val.teamIndex = TeamComponent.GetObjectTeam(val.attacker); val.attackerFiltering = (AttackerFiltering)2; val.Fire(); EffectManager.SpawnEffect(StealthMode.smokeBombEffectPrefab, new EffectData { origin = self.footPosition }, true); if (Object.op_Implicit((Object)(object)novaEffectPrefab)) { EffectManager.SpawnEffect(novaEffectPrefab, new EffectData { origin = self.transform.position, scale = smokeBombRadius }, true); } } } public class CloudBottleBehavior : ItemBehavior { public static float cooldownDuration = 16f; public static float cooldownReductionPerStack = 0.25f; private float cooldownTimer = 0f; private float bombRadiusSqr; private void Start() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown bombRadiusSqr = BottleCloud.smokeBombRadius * BottleCloud.smokeBombRadius; OnJump.OnJumpEvent += new OnJumpHandler(CloudBottleJump); } private void OnDestroy() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown OnJump.OnJumpEvent -= new OnJumpHandler(CloudBottleJump); } private void CloudBottleJump(CharacterMotor motor, CharacterBody body, ref float verticalBonus) { //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Invalid comparison between Unknown and I4 //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Invalid comparison between Unknown and I4 //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0175: 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_0188: Expected O, but got Unknown //IL_009b: 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: 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_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) if (cooldownTimer > 0f) { return; } Inventory inventory = body.inventory; if (inventory != null && inventory.GetItemCountEffective(ItemBase.instance.ItemsDef) <= 0) { return; } int maxJumpCount = body.maxJumpCount; int baseJumpCount = body.baseJumpCount; if (OnJump.IsBaseJump(motor, body)) { return; } TeamIndex teamIndex = base.body.teamComponent.teamIndex; int num = 0; TeamIndex val = (TeamIndex)0; while ((int)val < 5) { if (val != teamIndex && (int)val > 0) { foreach (TeamComponent teamMember in TeamComponent.GetTeamMembers(val)) { Vector3 val2 = ((Component)teamMember).transform.position - base.body.corePosition; if (((Vector3)(ref val2)).sqrMagnitude <= bombRadiusSqr) { num++; break; } } } if (num > 0) { break; } val = (TeamIndex)(sbyte)(val + 1); } if (num > 0) { ResetCooldown(); BottleCloud.CreateNinjaSmokeBomb(motor.body); verticalBonus += BottleCloud.verticalBonusOnCloudJump; } else if (OnJump.IsLastJump(motor, body)) { EffectManager.SpawnEffect(StealthMode.smokeBombEffectPrefab, new EffectData { origin = body.footPosition }, true); } } private void ResetCooldown() { cooldownTimer = cooldownDuration * Mathf.Pow(1f - cooldownReductionPerStack, (float)(base.stack - 1)); if (NetworkServer.active && base.body.HasBuff(BottleCloud.cloudReadyBuff)) { base.body.RemoveBuff(BottleCloud.cloudReadyBuff); } } private void FixedUpdate() { if (cooldownTimer > 0f) { cooldownTimer -= Time.fixedDeltaTime; } else if (NetworkServer.active && !base.body.HasBuff(BottleCloud.cloudReadyBuff)) { base.body.AddBuff(BottleCloud.cloudReadyBuff); } } } internal class BottleFart : ItemBase { private static GameObject fartZone; private static GameObject novaEffectPrefab = null; public static BuffDef fartReadyBuff; internal static float smokeBombRadius = 9f; private static float resetFrequency = 3f; private static float fartBaseDamageCoefficient = 1f; private static float fartStackDamageCoefficient = 1f; private static float fartZoneDuration = 5f; public override string ConfigName => "Items : Fart In A Jar"; public override ExpansionDef RequiredExpansion => SwanSongPlugin.expansionDefSS2; public override string ItemName => "Quarantined Contaminant"; public override string ItemLangTokenName => "FARTBOTTLE"; public override string ItemPickupDesc => "Gain an extra jump. Jumping near enemies cripples and damages them. Corrupts all Cloud In A Bottles."; public override string ItemFullDescription => $"Gain an extra jump. Double jumping within {smokeBombRadius}m of an enemy " + "produces a toxic gas, dealing " + Tools.ConvertDecimal(fartBaseDamageCoefficient) + " (+" + Tools.ConvertDecimal(fartStackDamageCoefficient) + " per stack) damage per second and Crippling enemies inside. " + $"Cannot be reactivated for {FartBottleBehavior.cooldownDuration} seconds. " + "Corrupts all Cloud In A Bottles."; public override string ItemLore => ""; public override ItemTier Tier => (ItemTier)6; public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)3 }; public override GameObject ItemModel => ItemBase.LoadDropPrefab("mdlBottleFart"); public override Sprite ItemIcon => ItemBase.LoadItemIcon("texIconBottleFart"); public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Init() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) fartReadyBuff = Content.CreateAndAddBuff("bdCloudReady", Addressables.LoadAssetAsync((object)"RoR2/Base/Common/texBuffGenericShield.tif").WaitForCompletion(), Color.magenta, canStack: false, isDebuff: false, (StackingDisplayMethod)0); CreateProjectile(); base.Init(); } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown StatHooks.GetMoreStatCoefficients += new MoreStatHookEventHandler(FartJumpCount); ContagiousItemManager.Init += new hook_Init(CreateTransformation); CharacterBody.OnInventoryChanged += new hook_OnInventoryChanged(AddItemBehavior); } private void FartJumpCount(CharacterBody sender, MoreStatHookEventArgs args) { if (GetCount(sender) > 0) { args.jumpCountAdd++; } } private void AddItemBehavior(orig_OnInventoryChanged orig, CharacterBody self) { orig.Invoke(self); if (NetworkServer.active && Object.op_Implicit((Object)(object)self.master)) { FartBottleBehavior fartBottleBehavior = self.AddItemBehavior(GetCount(self)); } } private void CreateTransformation(orig_Init orig) { //IL_0003: 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_002c: 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) Pair val = default(Pair); val.itemDef1 = ItemBase.instance.ItemsDef; val.itemDef2 = ItemBase.instance.ItemsDef; Pair val2 = val; ItemCatalog.itemRelationships[ItemRelationshipTypes.ContagiousItem] = CollectionExtensions.AddToArray(ItemCatalog.itemRelationships[ItemRelationshipTypes.ContagiousItem], val2); orig.Invoke(); } private void CreateProjectile() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: 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) GameObject val = Addressables.LoadAssetAsync((object)"RoR2/Base/MiniMushroom/SporeGrenadeProjectileDotZone.prefab").WaitForCompletion(); if (!((Object)(object)val == (Object)null)) { fartZone = PrefabAPI.InstantiateClone(val, "FartJarGas", true); fartZone.transform.localScale = Vector3.one * smokeBombRadius / 6f; ProjectileDotZone component = fartZone.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.resetFrequency = resetFrequency; component.damageCoefficient = 1f / resetFrequency; component.overlapProcCoefficient = 1f / resetFrequency / 3f; component.lifetime = fartZoneDuration; } ProjectileDamage component2 = fartZone.GetComponent(); if ((Object)(object)component2 != (Object)null) { component2.damageType = DamageTypeCombo.op_Implicit((DamageType)4194304); } } } internal static void CreateFartCloud(CharacterBody self, int stack) { //IL_0017: 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_005a: 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_0098: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)fartZone == (Object)null)) { FireProjectileInfo val = default(FireProjectileInfo); val.owner = ((Component)self).gameObject; val.crit = Util.CheckRoll(self.crit, self.master); val.position = self.transform.position - Vector3.down * self.radius; val.projectilePrefab = fartZone; val.damage = self.damage * ItemBase.GetStackValue(fartBaseDamageCoefficient, fartStackDamageCoefficient, stack); ProjectileManager.instance.FireProjectile(val); } } } public class FartBottleBehavior : ItemBehavior { public static float cooldownDuration = 5f; public static float cooldownReductionPerStack = 0.2f; private float cooldownTimer = 0f; private float bombRadiusSqr; private void Start() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown bombRadiusSqr = BottleFart.smokeBombRadius * BottleFart.smokeBombRadius; OnJump.OnJumpEvent += new OnJumpHandler(CloudBottleJump); } private void OnDestroy() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown OnJump.OnJumpEvent -= new OnJumpHandler(CloudBottleJump); } private void CloudBottleJump(CharacterMotor motor, CharacterBody body, ref float verticalBonus) { //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: 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_0123: Invalid comparison between Unknown and I4 //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Invalid comparison between Unknown and I4 //IL_0097: 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_011c: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) if (cooldownTimer > 0f) { return; } if (Object.op_Implicit((Object)(object)body)) { Inventory inventory = body.inventory; if (inventory != null && inventory.GetItemCountEffective(ItemBase.instance.ItemsDef) <= 0) { return; } } if (!OnJump.IsDoubleJump(motor, body)) { return; } TeamIndex teamIndex = base.body.teamComponent.teamIndex; int num = 0; TeamIndex val = (TeamIndex)0; while ((int)val < 5) { if (val != teamIndex && (int)val > 0) { foreach (TeamComponent teamMember in TeamComponent.GetTeamMembers(val)) { Vector3 val2 = ((Component)teamMember).transform.position - base.body.corePosition; if (((Vector3)(ref val2)).sqrMagnitude <= bombRadiusSqr) { num++; break; } } } if (num > 0) { break; } val = (TeamIndex)(sbyte)(val + 1); } if (num > 0) { BottleFart.CreateFartCloud(motor.body, base.stack); verticalBonus += BottleCloud.verticalBonusOnCloudJump; ResetCooldown(); } } private void ResetCooldown() { cooldownTimer = cooldownDuration; if (NetworkServer.active && base.body.HasBuff(BottleFart.fartReadyBuff)) { base.body.RemoveBuff(BottleFart.fartReadyBuff); } } private void FixedUpdate() { if (cooldownTimer > 0f) { cooldownTimer -= Time.fixedDeltaTime; } else if (NetworkServer.active && !base.body.HasBuff(BottleFart.fartReadyBuff)) { base.body.AddBuff(BottleFart.fartReadyBuff); } } } internal class Chicken : ItemBase { public static BuffDef foodPoisoning; public static float baseMaxHealth = 0.3f; public static float stackMaxHealth = 0.2f; public static float baseRegenPenalty = 2f; public static float stackRegenPenalty = 2f; public static float regenPenaltyChance = 40f; public override ExpansionDef RequiredExpansion => SwanSongPlugin.expansionDefSS2; public override string ItemName => "Raw Chicken"; public override string ItemLangTokenName => "CHICKEN"; public override string ItemPickupDesc => "Substantially increase max health, at risk of food poisoning."; public override string ItemFullDescription => "Increase your maximum health by " + Tools.ConvertDecimal(baseMaxHealth) + " (+" + Tools.ConvertDecimal(stackMaxHealth) + " per stack). " + $"At the start of each stage, has a {regenPenaltyChance}% chance to inflict " + "food poisoning, reducing your base health regeneration " + $"by -{baseRegenPenalty} hp/s (-{baseRegenPenalty} hp/s per stack)."; public override string ItemLore => ""; public override ItemTier Tier => (ItemTier)1; public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[2] { (ItemTag)2, (ItemTag)20 }; public override GameObject ItemModel => ItemBase.LoadDropPrefab("mdlChicken"); public override Sprite ItemIcon => ItemBase.LoadItemIcon("texIconChicken"); public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Init() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) foodPoisoning = Content.CreateAndAddBuff("bdFoodPoisoning", Addressables.LoadAssetAsync((object)"RoR2/Base/Croco/texBuffRegenBoostIcon.tif").WaitForCompletion(), Color.magenta, canStack: true, isDebuff: true, (StackingDisplayMethod)0); base.Init(); } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(ChickenStats); CharacterBody.onBodyStartGlobal += DoFoodPoisoning; } private void DoFoodPoisoning(CharacterBody body) { //IL_0054: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { return; } int count = GetCount(body); if (count <= 0) { return; } float num = GetPoisonChance(body); if (!Util.CheckRoll(100f - num, body.master)) { for (int i = 0; i < count; i++) { body.AddTimedBuff(foodPoisoning.buffIndex, 120f); } } static float GetPoisonChance(CharacterBody body) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) if (body.bodyIndex == BodyCatalog.FindBodyIndex("FalseSonBody")) { return 100f; } if (Run.instance.stageClearCount < 1) { return Math.Min(0.01f, regenPenaltyChance); } if (Run.instance.stageClearCount < 2) { return regenPenaltyChance / 2f; } return regenPenaltyChance; } } private void ChickenStats(CharacterBody sender, StatHookEventArgs args) { int count = GetCount(sender); if (count > 0) { args.healthMultAdd += baseMaxHealth + stackMaxHealth * (float)(count - 1); } int buffCount = sender.GetBuffCount(foodPoisoning); if (buffCount > 0) { args.baseRegenAdd -= (baseRegenPenalty + stackRegenPenalty * (float)(buffCount - 1)) * (1f + 0.2f * sender.level); } } } internal class CoinGun : ItemBase { public static int baseGoldChunk = 25; public static bool includeDeploys = true; private static float bonusDamageMin = 0.2f; private static float bonusDamagePerChunk = 0.04f; private float bonusGold = 0.1f; public static BuffDef bronzeDamageBuff; public static int maxBronze = 3; public static BuffDef silverDamageBuff; public static int maxSilver = 6; public static BuffDef goldDamageBuff; public static int maxGold = 9; public static BuffDef platinumDamageBuff; public static int maxPlatinum = 10; private string damageBoostPerChestPerStack = Tools.ConvertDecimal(bonusDamagePerChunk); private static Sprite defaultSprite = Addressables.LoadAssetAsync((object)"RoR2/Base/CritOnUse/texBuffFullCritIcon.tif").WaitForCompletion(); public override ExpansionDef RequiredExpansion => SwanSongPlugin.expansionDefSS2; public override string ItemName => "Coin Gun"; public override string ItemLangTokenName => "ECONOMYWEAPON"; public override string ItemPickupDesc => "Deal bonus damage for each chest you can afford."; public override string ItemFullDescription => $"Begin each stage with ${baseGoldChunk}. " + $"While holding ${baseGoldChunk} or more, " + "deal " + Tools.ConvertDecimal(bonusDamageMin) + " bonus damage (+" + Tools.ConvertDecimal(bonusDamageMin) + " per stack), plus " + damageBoostPerChestPerStack + " (+" + damageBoostPerChestPerStack + " per stack) " + $"per additional ${baseGoldChunk} held, " + $"for up to a maximum of {maxPlatinum} times."; public override string ItemLore => "Man, this thing is so cool. B-zap! Haha.\r\n\r\nHey. Dude. Check this out.\r\n\r\nWhat the hell is that thing?\r\n\r\nNo. Watch this.\r\n\r\n…Huh? That sucks.\r\n\r\nListen, dude. TWO. MONEY. GUNS.\r\n\r\nYou're an idiot. This one charges using gold. That one shoots gold. What happens if you shoot all our gold, Cooper? We can't charge our guns.\r\n\r\nIt's fine, dude. The monsters on this planet are loaded. Look at all this!\r\n\r\n…Huh. What is that thing?\r\n\r\nIt's this, like, hat thing I found? It attracts money or something. If we survive this we're gonna be rich.\r\n\r\nYou've gotta stop picking up those things. They've all tried to kill us at some point.\r\n\r\nNot this one, dude. Look- oops. Ow.\r\n\r\nUh.\r\n\r\nWhat?\r\n\r\nWhat happened to all of our gold?"; public override ItemTier Tier => (ItemTier)1; public override ItemTag[] ItemTags { get; } public override GameObject ItemModel => ItemBase.LoadDropPrefab("mdlCoinGun"); public override Sprite ItemIcon => ItemBase.LoadItemIcon("texIconCoinGun"); public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Init() { CreateBuff(); base.Init(); } private void CreateBuff() { //IL_0015: 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_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) bronzeDamageBuff = GenerateCoinDamageBuff("Bronze", new Color(0.7f, 0.5f, 0.2f), null); silverDamageBuff = GenerateCoinDamageBuff("Silver", new Color(0.6f, 0.6f, 0.6f), null); goldDamageBuff = GenerateCoinDamageBuff("Gold", new Color(1f, 0.8f, 0.15f), null); platinumDamageBuff = GenerateCoinDamageBuff("Platinum", new Color(0.9f, 0.9f, 1f), null); static BuffDef GenerateCoinDamageBuff(string coinType, Color color, Sprite sprite) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) return Content.CreateAndAddBuff("bdCoinDamageBoost" + coinType, ((Object)(object)sprite == (Object)null) ? defaultSprite : sprite, color, canStack: true, isDebuff: false, (StackingDisplayMethod)0); } } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown CharacterBody.OnInventoryChanged += new hook_OnInventoryChanged(AddItemBehavior); HealthComponent.TakeDamageProcess += new hook_TakeDamageProcess(GoldGunDamageBoost); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(GiveBonusDamage); CharacterMaster.OnBodyStart += new hook_OnBodyStart(GoldenGunBonusMoney); } private void GoldenGunBonusMoney(orig_OnBodyStart orig, CharacterMaster self, CharacterBody body) { orig.Invoke(self, body); if (GetCount(body) > 0) { uint difficultyScaledCost = (uint)Run.instance.GetDifficultyScaledCost(baseGoldChunk, Stage.instance.entryDifficultyCoefficient); self.GiveMoney(difficultyScaledCost); } } private void GiveBonusDamage(CharacterBody sender, StatHookEventArgs args) { int count = GetCount(sender); if (count <= 0) { return; } CoinGunBehavior component = ((Component)sender).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { int damageBoostCount = component.damageBoostCount; if (damageBoostCount > 0) { float num = bonusDamageMin + bonusDamagePerChunk * (float)(damageBoostCount - 1); args.damageMultAdd += num * (float)count; } } } private void AddItemBehavior(orig_OnInventoryChanged orig, CharacterBody self) { orig.Invoke(self); if (NetworkServer.active) { CoinGunBehavior coinGunBehavior = self.AddItemBehavior(GetCount(self)); } } private void GoldGunMoneyBoost(orig_GiveMoney orig, CharacterMaster self, uint amount) { int count = GetCount(self); if (count > 0) { amount = (uint)((float)amount * (1f + bonusGold)); } orig.Invoke(self, amount); } private void GoldGunDamageBoost(orig_TakeDamageProcess orig, HealthComponent self, DamageInfo damageInfo) { //IL_007f: 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 ((Object)(object)damageInfo.attacker != (Object)null) { CharacterBody component = damageInfo.attacker.GetComponent(); if ((Object)(object)component != (Object)null) { int count = GetCount(component); if (count > 0) { CoinGunBehavior component2 = ((Component)component).GetComponent(); int damageBoostCount = component2.damageBoostCount; CharacterMaster master = component.master; if (Util.CheckRoll((float)(damageBoostCount / maxPlatinum * 100), master)) { EffectManager.SimpleImpactEffect(LegacyResourcesAPI.Load("Prefabs/Effects/ImpactEffects/CoinImpact"), damageInfo.position, Vector3.up, true); } } } } orig.Invoke(self, damageInfo); } public CoinGun() { ItemTag[] array = new ItemTag[3]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); ItemTags = (ItemTag[])(object)array; base..ctor(); } } public class CoinGunBehavior : ItemBehavior { public CharacterMaster master; public uint currentMoney = 0u; public int damageBoostCount = 0; private int fixedBaseChestCost => Run.instance.GetDifficultyScaledCost(CoinGun.baseGoldChunk, Stage.instance.entryDifficultyCoefficient); private void FixedUpdate() { if (!((Object)(object)master == (Object)null) && master.money != currentMoney) { UpdateCurrentGold(master.money); } } internal void UpdateCurrentGold(uint money) { //IL_00a2: 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_015b: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0131: 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_0153: Unknown result type (might be due to invalid IL or missing references) currentMoney = money; if (CoinGun.includeDeploys) { Deployable component = ((Component)master).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { uint money2 = component.ownerMaster.money; if (money2 > currentMoney) { currentMoney = money2; } } } int num = Mathf.Clamp((int)(currentMoney / fixedBaseChestCost), 0, CoinGun.maxPlatinum); if (damageBoostCount != num) { damageBoostCount = num; Debug.Log((object)damageBoostCount); ResetAllBuffs(); BuffIndex val = (BuffIndex)(-1); if (damageBoostCount <= CoinGun.maxBronze) { val = CoinGun.bronzeDamageBuff.buffIndex; } else if (damageBoostCount > CoinGun.maxBronze && damageBoostCount <= CoinGun.maxSilver) { val = CoinGun.silverDamageBuff.buffIndex; } else if (damageBoostCount > CoinGun.maxSilver && damageBoostCount <= CoinGun.maxGold) { val = CoinGun.goldDamageBuff.buffIndex; } else if (damageBoostCount > CoinGun.maxGold) { val = CoinGun.platinumDamageBuff.buffIndex; } base.body.SetBuffCount(val, damageBoostCount); } } private void ResetAllBuffs() { //IL_000c: 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_003a: 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) base.body.SetBuffCount(CoinGun.bronzeDamageBuff.buffIndex, 0); base.body.SetBuffCount(CoinGun.silverDamageBuff.buffIndex, 0); base.body.SetBuffCount(CoinGun.goldDamageBuff.buffIndex, 0); base.body.SetBuffCount(CoinGun.platinumDamageBuff.buffIndex, 0); } private void Start() { master = base.body.master; UpdateCurrentGold(master.money); } private void OnDestroy() { ResetAllBuffs(); } } internal class DiscountCard : ItemBase { public static ItemDef usedItemDef; public static ItemDef spentItemDef; public static int cashBackValue = 25; private static string fullDescPartial = "When purchasing from " + Language.Styling.UtilityColor("multishop") + " terminals, the other terminals " + Language.Styling.UtilityColor("stay open") + ", refunding " + Language.Styling.UtilityColor($"${cashBackValue}") + "."; public string itemName = "Loyalty Card"; public override string ItemName => itemName; public override string ItemLangTokenName => "DISCOUNTCARDNEW"; public override string ItemPickupDesc => "Gain cash back on shop purchases, up to two times."; public override string ItemFullDescription => fullDescPartial + " Usable up to two times."; public override string ItemLore => ""; public override ItemTier Tier => (ItemTier)0; public override ItemTag[] ItemTags { get { ItemTag[] array = new ItemTag[3]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); return (ItemTag[])(object)array; } } public override GameObject ItemModel => ItemBase.LoadDropPrefab("mdlDiscountCard"); public override Sprite ItemIcon => ItemBase.LoadItemIcon("texIconDiscountCard"); public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown return new ItemDisplayRuleDict(Array.Empty()); } public override void Init() { usedItemDef = ItemBase.CreateNewUntieredItem("DISCOUNTCARDUSED", ItemBase.LoadItemIcon("texIconDiscountCardUsed"), (ItemTier)5, ItemTags); ItemBase.DoLangForItem(usedItemDef, itemName + " (Used)", "Gain cash back on shop purchases. One use remaining.", fullDescPartial + " One use remaining."); spentItemDef = ItemBase.CreateNewUntieredItem("DISCOUNTCARDSPENT", ItemBase.LoadItemIcon("texIconDiscountCardSpent"), (ItemTier)5, ItemTags); ItemBase.DoLangForItem(spentItemDef, itemName + " (Spent)", "It's just a piece of paper with a bunch of holes.", "It's just a piece of paper with a bunch of holes."); base.Init(); } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown MultiShopCardUtils.OnPurchase += new hook_OnPurchase(DiscountCardOnPurchase); } private void DiscountCardOnPurchase(orig_OnPurchase orig, PayCostContext context, int moneyCost) { //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Expected O, but got Unknown //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(context, moneyCost); CharacterMaster activatorMaster = context.activatorMaster; if (!Object.op_Implicit((Object)(object)activatorMaster) || !activatorMaster.hasBody || moneyCost <= 0) { return; } CharacterBody body = activatorMaster.GetBody(); Inventory inventory = body.inventory; if (!Object.op_Implicit((Object)(object)inventory)) { return; } ItemDef itemsDef = usedItemDef; ItemDef nextItem = spentItemDef; if (inventory.GetItemCountEffective(itemsDef) <= 0) { nextItem = itemsDef; itemsDef = ItemBase.instance.ItemsDef; if (inventory.GetItemCountEffective(itemsDef) <= 0) { return; } } bool flag = false; GameObject purchasedObject = context.purchasedObject; PurchaseInteraction component = purchasedObject.GetComponent(); ShopTerminalBehavior val = null; DroneVendorTerminalBehavior val2 = null; if ((purchasedObject.TryGetComponent(ref val) || purchasedObject.TryGetComponent(ref val2)) && Object.op_Implicit((Object)(object)component)) { if ((Object)(object)val != (Object)null && Object.op_Implicit((Object)(object)val.serverMultiShopController)) { val.serverMultiShopController.SetCloseOnTerminalPurchase(component, false); } if ((Object)(object)val2 != (Object)null && Object.op_Implicit((Object)(object)val2.serverMultiShopController)) { val2.serverMultiShopController.SetCloseOnTerminalPurchase(component, false); } GoldOrb val3 = new GoldOrb(); Vector3? val4; if ((Object)(object)purchasedObject == (Object)null) { val4 = null; } else { Transform transform = purchasedObject.transform; val4 = (((Object)(object)transform != (Object)null) ? new Vector3?(transform.position) : null); } ((Orb)val3).origin = (Vector3)(((??)val4) ?? body.corePosition); ((Orb)val3).target = body.mainHurtBox; val3.goldAmount = GetCashBackValue(); OrbManager.instance.AddOrb((Orb)(object)val3); DegradeItem(activatorMaster, inventory, itemsDef, nextItem); } } public void DegradeItem(CharacterMaster master, Inventory inventory, ItemDef currentItem, ItemDef nextItem) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_001b: 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) ItemTransformation val = default(ItemTransformation); ((ItemTransformation)(ref val)).originalItemIndex = currentItem.itemIndex; ((ItemTransformation)(ref val)).newItemIndex = nextItem.itemIndex; ((ItemTransformation)(ref val)).maxToTransform = 1; val.transformationType = (ItemTransformationTypeIndex)3; TryTransformResult val2 = default(TryTransformResult); ((ItemTransformation)(ref val)).TryTransform(inventory, ref val2); } private uint GetCashBackValue() { return (uint)Run.instance.GetDifficultyScaledCost(cashBackValue, Stage.instance.entryDifficultyCoefficient); } } internal class DisposableScalpel : ItemBase { public static ItemDef brokenItemDef; public static int bonusDropChance = 50; public override string ConfigName => "Items : Scalpel"; public override ExpansionDef RequiredExpansion => SwanSongPlugin.expansionDefSS2; public override string ItemName => "Obsidian Scalpel"; public override string ItemLangTokenName => "BOSSITEMCONSUMABLE"; public override string ItemPickupDesc => "Large monsters have a much greater chance of dropping a trophy. Consumed on drop."; public override string ItemFullDescription => "Killing enemies who are capable of dropping trophy items " + $"yields an additional {bonusDropChance}% chance " + "to drop the trophy. Consumed on successful use."; public override string ItemLore => "Order: Medical Scalpel (Obsidian)\r\nTracking Number: 91***********\r\nEstimated Delivery: 09/30/2056\r\nShipping Method: Priority/Fragile\r\nShipping Address: Mt Goliath, Mars\r\nShipping Details:\r\n\r\nCustom made according to your specifications. Very sharp. Blade thickness is measured in planck lengths. This will definitely cut whatever you need it for.\r\nCan’t speak for the durability, though. Try to get it right the first time.\r\nAnd one more thing – when it breaks, it won’t wait ‘till your operation is finished. Don’t use it on anything you care about not damaging. Or killing.\r\nYou already knew all that, though. Can’t help but wonder what you keep ordering these things for."; public override ItemTier Tier => (ItemTier)1; public override GameObject ItemModel => ItemBase.LoadDropPrefab("mdlDisposableScalpel"); public override Sprite ItemIcon => ItemBase.LoadItemIcon("texIconDisposableScalpel"); public override ItemTag[] ItemTags { get { ItemTag[] array = new ItemTag[4]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); return (ItemTag[])(object)array; } } public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Init() { brokenItemDef = ItemBase.CreateNewUntieredItem("BROKENSCALPEL", ItemBase.LoadItemIcon("texIconDisposableScalpelUsed"), (ItemTier)5); ItemBase.DoLangForItem(brokenItemDef, "Broken Scalpel", "The blade has shattered into innumerous pieces.", "It is no longer usable."); base.Init(); } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown BossDropReworkPlugin.ShouldTricornFireAndBreak += new TricornFireHandler(ScalpelTricornSynergy); BossDropReworkPlugin.ModifyBossItemDropChance += new BossDropChanceHandler(ScalpelDropChance); } private void ScalpelTricornSynergy(CharacterBody attacker, CharacterBody victim, ref bool shouldFire) { if (GetCount(attacker) > 0) { shouldFire = false; victim.AddBuff(CommonAssets.bossHunterDebuffWithScalpel); ConsumeScalpel(attacker); } } private void ScalpelDropChance(CharacterBody victim, CharacterBody attacker, ref float dropChance) { if (victim.HasBuff(CommonAssets.bossHunterDebuffWithScalpel)) { dropChance = 100f; } else if (dropChance < 100f && GetCount(attacker) > 0 && Util.CheckRoll((float)bonusDropChance, 0f, (CharacterMaster)null)) { dropChance = 100f; ConsumeScalpel(attacker); } } public static void ConsumeScalpel(CharacterBody attackerBody) { //IL_0003: 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_0027: 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) ItemTransformation val = default(ItemTransformation); ((ItemTransformation)(ref val)).originalItemIndex = ItemBase.instance.ItemsDef.itemIndex; ((ItemTransformation)(ref val)).newItemIndex = brokenItemDef.itemIndex; ((ItemTransformation)(ref val)).maxToTransform = 1; val.transformationType = (ItemTransformationTypeIndex)0; TryTransformResult val2 = default(TryTransformResult); ((ItemTransformation)(ref val)).TryTransform(attackerBody.inventory, ref val2); } } internal class Egg : ItemBase { public int eggHealth = 5; private WeightedSelection weightedSelection; private Xoroshiro128Plus rng; public Transform dropletOrigin; public override bool lockEnabled => true; public override ExpansionDef RequiredExpansion => SwanSongPlugin.expansionDefSS2; public override string ItemName => "Egg"; public override string ItemLangTokenName => "EGG"; public override string ItemPickupDesc => "Slightly increase health. Start an egg hunt.Corrupts most edible and animal matter."; public override string ItemFullDescription => $"Gain {eggHealth} max health. " + "Start an egg hunt. Corrupts all Infusion, Bison Steak, and Alien Heads."; public override string ItemLore => "this egg is so fuckign yummuy"; public override ItemTier Tier => (ItemTier)7; public override ItemTag[] ItemTags { get { ItemTag[] array = new ItemTag[6]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); return (ItemTag[])(object)array; } } public override GameObject ItemModel => ItemBase.LoadDropPrefab("mdlEgg"); public override Sprite ItemIcon => ItemBase.LoadItemIcon("texIconEgg"); public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Init() { base.Init(); Log.Error("Egg Cant Hide Eggpiles Because Eggpile Not Implemented !!"); } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown GlobalEventManager.OnCharacterDeath += new hook_OnCharacterDeath(EggOnDeath); GlobalEventManager.OnInteractionBegin += new hook_OnInteractionBegin(EggOnPurchase); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(EggStats); ContagiousItemManager.Init += new hook_Init(CreateTransformation); } private void EggStats(CharacterBody sender, StatHookEventArgs args) { int count = GetCount(sender); if (count > 0) { args.baseHealthAdd += (float)(eggHealth * count); } } private void EggOnPurchase(orig_OnInteractionBegin orig, GlobalEventManager self, Interactor interactor, IInteractable interactable, GameObject interactableObject) { orig.Invoke(self, interactor, interactable, interactableObject); GameObject gameObject = ((Component)interactor).gameObject; if ((Object)(object)gameObject == (Object)null) { return; } CharacterBody component = gameObject.GetComponent(); if (!((Object)(object)component == (Object)null) && component.inventory.GetItemCountEffective(ItemsDef) > 0) { int num = Random.RandomRangeInt(0, 99); if (num <= 6) { EggReward(interactableObject); } } } private void EggOnDeath(orig_OnCharacterDeath orig, GlobalEventManager self, DamageReport damageReport) { orig.Invoke(self, damageReport); if (!((Object)(object)damageReport.attackerBody == (Object)null) && !((Object)(object)damageReport.attackerBody.inventory == (Object)null) && damageReport.attackerBody.inventory.GetItemCountEffective(ItemsDef) > 0) { int num = Random.RandomRangeInt(0, 99); if (num <= 3) { CharacterBody victimBody = damageReport.victimBody; EggReward(victimBody); } } } private void EggReward(CharacterBody body) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_0034: 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_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) PickupIndex none = PickupIndex.none; GenerateWeightedSelection(); rng = new Xoroshiro128Plus(Run.instance.treasureRng.nextUlong); none = PickupDropTable.GenerateDropFromWeightedSelection(rng, weightedSelection); dropletOrigin = ((Component)body).gameObject.transform; PickupDropletController.CreatePickupDroplet(none, dropletOrigin.position, Vector3.zero); } public void EggReward(GameObject interactableObject) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_0034: 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_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: 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_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) PickupIndex none = PickupIndex.none; GenerateWeightedSelection(); rng = new Xoroshiro128Plus(Run.instance.treasureRng.nextUlong); none = PickupDropTable.GenerateDropFromWeightedSelection(rng, weightedSelection); dropletOrigin = interactableObject.transform; PickupDropletController.CreatePickupDroplet(none, dropletOrigin.position + dropletOrigin.forward * 3f + dropletOrigin.up * 3f, dropletOrigin.forward * 3f + dropletOrigin.up * 5f); } private void GenerateWeightedSelection() { //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_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) weightedSelection = new WeightedSelection(8); weightedSelection.AddChoice(PickupCatalog.FindPickupIndex(ItemBase.instance.ItemsDef.itemIndex), 1f); weightedSelection.AddChoice(PickupCatalog.FindPickupIndex(ItemBase.instance.ItemsDef.itemIndex), 0.1f); } private void CreateTransformation(orig_Init orig) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: 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_004d: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0075: 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_00b4: 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) Pair val = default(Pair); val.itemDef1 = Items.Infusion; val.itemDef2 = ItemBase.instance.ItemsDef; Pair val2 = val; val = default(Pair); val.itemDef1 = Items.FlatHealth; val.itemDef2 = ItemBase.instance.ItemsDef; Pair val3 = val; val = default(Pair); val.itemDef1 = Items.AlienHead; val.itemDef2 = ItemBase.instance.ItemsDef; Pair val4 = val; ItemCatalog.itemRelationships[ItemRelationshipTypes.ContagiousItem] = CollectionExtensions.AddToArray(ItemCatalog.itemRelationships[ItemRelationshipTypes.ContagiousItem], val2); ItemCatalog.itemRelationships[ItemRelationshipTypes.ContagiousItem] = CollectionExtensions.AddToArray(ItemCatalog.itemRelationships[ItemRelationshipTypes.ContagiousItem], val3); ItemCatalog.itemRelationships[ItemRelationshipTypes.ContagiousItem] = CollectionExtensions.AddToArray(ItemCatalog.itemRelationships[ItemRelationshipTypes.ContagiousItem], val4); orig.Invoke(); } } internal class FrozenShell : ItemBase { internal static BuffDef frozenShellArmorBuff; internal static int freeArmor = 10; internal static int maxBonusArmor = 50; public static int maxBuffCount = 10; public override ExpansionDef RequiredExpansion => SwanSongPlugin.expansionDefSS2; public override string ItemName => "Frozen Turtle Shell"; public override string ItemLangTokenName => "FROZENSHELL"; public override string ItemPickupDesc => "Reduce incoming damage while at low health."; public override string ItemFullDescription => "Increase armor by " + $"{freeArmor} (+{freeArmor} per stack). " + $"For every missing {Mathf.RoundToInt(100f / (float)maxBuffCount)}% of max health, " + $"gain {Mathf.RoundToInt((float)(maxBonusArmor / maxBuffCount))} " + $"(+{Mathf.RoundToInt((float)(maxBonusArmor / maxBuffCount))} per stack) additional armor."; public override string ItemLore => ""; public override ItemTier Tier => (ItemTier)1; public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)3 }; public override GameObject ItemModel => ItemBase.LoadDropPrefab("mdlFrozenShell"); public override Sprite ItemIcon => ItemBase.LoadItemIcon("texIconFrozenShell"); public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown ItemDisplayRuleDict val = new ItemDisplayRuleDict(Array.Empty()); return null; } public override void Init() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) frozenShellArmorBuff = Content.CreateAndAddBuff("bdIceBarrier", Addressables.LoadAssetAsync((object)"RoR2/Base/Common/texBuffGenericShield.tif").WaitForCompletion(), Color.cyan, canStack: true, isDebuff: false, (StackingDisplayMethod)0); base.Init(); } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown CharacterBody.OnInventoryChanged += new hook_OnInventoryChanged(AddItemBehavior); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(GiveBonusArmor); } private void GiveBonusArmor(CharacterBody sender, StatHookEventArgs args) { int count = GetCount(sender); if (count > 0) { int buffCount = sender.GetBuffCount(frozenShellArmorBuff); float num = buffCount / maxBuffCount; int num2 = Mathf.RoundToInt((float)maxBonusArmor * num); args.armorAdd += (float)(count * (freeArmor + num2 * buffCount)); } } private void AddItemBehavior(orig_OnInventoryChanged orig, CharacterBody self) { orig.Invoke(self); if (NetworkServer.active && (Object)(object)self.healthComponent != (Object)null) { self.AddItemBehavior(GetCount(self)); } } } public class FrozenShellBehavior : ItemBehavior { private HealthComponent healthComponent; private BuffIndex iceBarrierBuffIndex = FrozenShell.frozenShellArmorBuff.buffIndex; private int buffCount = 0; private void Start() { healthComponent = base.body.healthComponent; } private void FixedUpdate() { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) if (NetworkServer.active) { float combinedHealthFraction = healthComponent.combinedHealthFraction; float num = 1f - combinedHealthFraction; int num2 = Mathf.CeilToInt(num * (float)FrozenShell.maxBuffCount); while (num2 > buffCount && buffCount < FrozenShell.maxBuffCount) { base.body.AddBuff(iceBarrierBuffIndex); buffCount++; } while (num2 < buffCount && buffCount > 0) { base.body.RemoveBuff(iceBarrierBuffIndex); buffCount--; } } } private void OnDestroy() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) if (NetworkServer.active) { while (buffCount > 0) { base.body.RemoveBuff(iceBarrierBuffIndex); buffCount--; } } } } internal class Fuse : ItemBase { public static GameObject fuseNovaEffectPrefab = Resources.Load("prefabs/effects/JellyfishNova"); public static BuffDef fuseRecharge; public static float fuseRechargeTime = 1f; public static float baseShield = 25f; public static float radiusBase = 40f; public static float radiusStack = 4f; public static float minStunDuration = 2f; public static float maxStunDuration = 10f; public static int targetCountBase = 3; public static int targetCountStack = 1; public override string ConfigName => "Items : Fuse"; public override ExpansionDef RequiredExpansion => SwanSongPlugin.expansionDefSS2; public override string ItemName => "Volatile Fuse"; public override string ItemLangTokenName => "BORBOFUSE"; public override string ItemPickupDesc => "Creates a stunning nova when your shields break."; public override string ItemFullDescription => $"Gain {baseShield} shield (+{baseShield} per stack). " + "Breaking your shields Shocks up to " + $"{targetCountBase} {Language.Styling.StackText($"+{targetCountStack}")} enemies within {radiusBase}m " + $"(+{radiusStack} per stack). " + "Shock duration scales with shield health."; public override string ItemLore => ""; public override ItemTier Tier => (ItemTier)0; public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)3 }; public override GameObject ItemModel => ItemBase.LoadDropPrefab("mdlFuse"); public override Sprite ItemIcon => ItemBase.LoadItemIcon("texIconFuse"); public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Init() { //IL_0010: 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_002e: 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) fuseRecharge = Content.CreateAndAddBuff("bdFuseCooldown", LegacyResourcesAPI.Load("textures/bufficons/texBuffTeslaIcon"), Color.gray, canStack: false, isDebuff: true, (StackingDisplayMethod)0); BuffDef obj = fuseRecharge; obj.flags = (Flags)(obj.flags | 1); fuseRecharge.isHidden = true; base.Init(); } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown HealthComponent.TakeDamageProcess += new hook_TakeDamageProcess(FuseTakeDamage); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(FuseShieldBonus); } private void FuseShieldBonus(CharacterBody sender, StatHookEventArgs args) { int count = GetCount(sender); if (count > 0) { args.baseShieldAdd += baseShield * (float)count; } } private void FuseTakeDamage(orig_TakeDamageProcess orig, HealthComponent self, DamageInfo damageInfo) { //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0129: 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_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Expected O, but got Unknown //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Expected O, but got Unknown //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_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) if (!Object.op_Implicit((Object)(object)self)) { orig.Invoke(self, damageInfo); return; } bool flag = HasShield(self); CharacterBody body = self.body; int count = GetCount(body); orig.Invoke(self, damageInfo); if (!flag || HasShield(self) || !self.alive || count <= 0 || body.HasBuff(fuseRecharge)) { return; } float maxShield = self.body.maxShield; float maxHealth = self.body.maxHealth; float num = maxShield / (maxHealth + maxShield); TeamIndex val = (TeamIndex)1; if (Object.op_Implicit((Object)(object)self.body.teamComponent)) { val = self.body.teamComponent.teamIndex; } bool isCrit = Util.CheckRoll(self.body.crit, self.body.master); float procCoefficient = Mathf.Lerp(minStunDuration, maxStunDuration, num) / 5f; float num2 = radiusBase + radiusStack * (float)(count - 1); int num3 = targetCountBase + targetCountStack * (count - 1); BullseyeSearch val2 = new BullseyeSearch(); val2.searchOrigin = ((Component)self).transform.position; val2.maxDistanceFilter = num2; ((TeamMask)(ref val2.teamMaskFilter)).RemoveTeam(val); val2.sortMode = (SortMode)1; val2.RefreshCandidates(); List list = val2.GetResults().ToList(); for (int i = 0; i < Mathf.Min(num3, list.Count()); i++) { HurtBox val3 = list[i]; if (Object.op_Implicit((Object)(object)val3)) { LightningOrb val4 = new LightningOrb(); val4.bouncedObjects = new List(); val4.attacker = ((Component)self).gameObject; val4.teamIndex = val; val4.damageValue = self.body.damage; val4.isCrit = isCrit; ((Orb)val4).origin = self.body.corePosition; val4.bouncesRemaining = 0; val4.lightningType = (LightningType)5; val4.procCoefficient = procCoefficient; ((Orb)val4).target = val3; val4.damageType = new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)16777216), (DamageTypeExtended)0, (DamageSource)0); OrbManager.instance.AddOrb((Orb)(object)val4); } } self.body.AddTimedBuffAuthority(fuseRecharge.buffIndex, fuseRechargeTime); EffectManager.SpawnEffect(fuseNovaEffectPrefab, new EffectData { origin = ((Component)self).transform.position, scale = num2 }, true); } public static bool HasShield(HealthComponent hc) { if ((Object)(object)hc == (Object)null) { return false; } return hc.shield > 1f; } } internal class GammaKnife : ItemBase { public static ItemDef statBoostItemDef; public static bool hideStatBoost = false; public static BuffDef gammaKnifeTemporaryBuff; public static int gammaKnifeMaxBuffs = 9; public static float attackSpeedBonus = 0.04f; public static float cdrBonus = 0.04f; public static float luckBonusDuration = 9f; public override ExpansionDef RequiredExpansion => SwanSongPlugin.expansionDefSS2; public override string ItemName => "Gamma Knife"; public override string ItemLangTokenName => "GAMMAKNIFE"; public override string ItemPickupDesc => "Killing champions permanently increases attack speed and temporarily increases Luck. " + Language.Styling.VoidColor("Corrupts all Obsidian Scalpels."); public override string ItemFullDescription => "Killing a Champion increases your Luck by " + $"1 (+1 per stack) for {luckBonusDuration} seconds " + "AND permanently increases your attack speed by " + Tools.ConvertDecimal(attackSpeedBonus) + " and reduces your cooldowns by " + Tools.ConvertDecimal(cdrBonus) + ", " + $"up to {gammaKnifeMaxBuffs} (+{gammaKnifeMaxBuffs} per stack) times. " + "Corrupts all Obsidian Scalpels."; public override string ItemLore => ""; public override ItemTier Tier => (ItemTier)7; public override ItemTag[] ItemTags { get { ItemTag[] array = new ItemTag[3]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); return (ItemTag[])(object)array; } } public override GameObject ItemModel => ItemBase.LoadDropPrefab("mdlGammaKnife"); public override Sprite ItemIcon => ItemBase.LoadItemIcon("texIconGammaKnife"); public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Init() { //IL_0093: Unknown result type (might be due to invalid IL or missing references) statBoostItemDef = ItemBase.CreateNewUntieredItem("GAMMAKNIFESTATBOOST", ItemBase.LoadItemIcon("texIconGammaKnifeUsed"), (ItemTier)5, null, hideStatBoost); string fullDesc = "Permanently increases your attack speed by " + Tools.ConvertDecimal(attackSpeedBonus) + " and reduces your cooldowns by " + Tools.ConvertDecimal(cdrBonus) + " per stack."; ItemBase.DoLangForItem(statBoostItemDef, "Fake-Soul Butter", "Cut the skin and bend the truth...", fullDesc); base.Init(); gammaKnifeTemporaryBuff = Content.CreateAndAddBuff("bdGammaKnifeBoost", LegacyResourcesAPI.Load("textures/bufficons/texBuffMedkitHealIcon"), Color.green, canStack: false, isDebuff: false, (StackingDisplayMethod)0); } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown ContagiousItemManager.Init += new hook_Init(CreateTransformation); GlobalEventManager.OnCharacterDeath += new hook_OnCharacterDeath(GammaKnifeOnKill); CharacterBody.RecalculateStats += new hook_RecalculateStats(GammaKnifeCdr); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(GammaKnifeStatBoosts); StatHooks.GetMoreStatCoefficients += new MoreStatHookEventHandler(GammaKnifeLuck); } private void GammaKnifeLuck(CharacterBody sender, MoreStatHookEventArgs args) { if (sender.HasBuff(gammaKnifeTemporaryBuff)) { args.luckAdd += (float)GetCount(sender); } } private void GammaKnifeCdr(orig_RecalculateStats orig, CharacterBody self) { orig.Invoke(self); Inventory inventory = self.inventory; if (!Object.op_Implicit((Object)(object)inventory)) { return; } int count = GetCount(inventory); int itemCountEffective = inventory.GetItemCountEffective(statBoostItemDef); if (count > 0 && itemCountEffective > 0) { float cooldownScale = Mathf.Pow(1f - cdrBonus, (float)itemCountEffective); SkillLocator skillLocator = self.skillLocator; if ((Object)(object)skillLocator != (Object)null) { Tools.ApplyCooldownScale(skillLocator.primary, cooldownScale); Tools.ApplyCooldownScale(skillLocator.secondary, cooldownScale); Tools.ApplyCooldownScale(skillLocator.utility, cooldownScale); Tools.ApplyCooldownScale(skillLocator.special, cooldownScale); } } } private void GammaKnifeStatBoosts(CharacterBody sender, StatHookEventArgs args) { Inventory inventory = sender.inventory; if (Object.op_Implicit((Object)(object)inventory)) { int count = GetCount(inventory); int itemCountEffective = inventory.GetItemCountEffective(statBoostItemDef); if (count > 0 && itemCountEffective > 0) { args.baseAttackSpeedAdd += attackSpeedBonus * (float)itemCountEffective; } } } private void GammaKnifeOnKill(orig_OnCharacterDeath orig, GlobalEventManager self, DamageReport damageReport) { //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, damageReport); CharacterBody victimBody = damageReport.victimBody; CharacterBody attackerBody = damageReport.attackerBody; if ((Object)(object)victimBody == (Object)null || (Object)(object)attackerBody == (Object)null || !victimBody.isChampion || victimBody.healthComponent.alive) { return; } Inventory inventory = attackerBody.inventory; if (!((Object)(object)inventory != (Object)null)) { return; } int count = GetCount(inventory); if (count <= 0) { return; } float num = luckBonusDuration; attackerBody.AddTimedBuffAuthority(gammaKnifeTemporaryBuff.buffIndex, num); int itemCountEffective = inventory.GetItemCountEffective(statBoostItemDef); if (itemCountEffective < gammaKnifeMaxBuffs * count) { inventory.GiveItem(statBoostItemDef, 1); if (!statBoostItemDef.hidden) { CharacterMasterNotificationQueue.PushItemNotification(attackerBody.master, statBoostItemDef.itemIndex); } } } private void CreateTransformation(orig_Init orig) { //IL_0003: 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_002c: 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) Pair val = default(Pair); val.itemDef1 = ItemBase.instance.ItemsDef; val.itemDef2 = ItemBase.instance.ItemsDef; Pair val2 = val; ItemCatalog.itemRelationships[ItemRelationshipTypes.ContagiousItem] = CollectionExtensions.AddToArray(ItemCatalog.itemRelationships[ItemRelationshipTypes.ContagiousItem], val2); orig.Invoke(); } } internal class GoldenEgg : ItemBase { private Xoroshiro128Plus rng; public BasicPickupDropTable dropTable; public override bool lockEnabled => true; public override ExpansionDef RequiredExpansion => SwanSongPlugin.expansionDefSS2; public override string ItemName => "Golden Egg"; public override string ItemLangTokenName => "GOLDEN_EGG"; public override string ItemPickupDesc => "There's something inside..."; public override string ItemFullDescription => "At the start of the next stage, one golden egg will hatch into a void item."; public override string ItemLore => ""; public override ItemTier Tier => (ItemTier)9; public override ItemTag[] ItemTags { get { ItemTag[] array = new ItemTag[4]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); return (ItemTag[])(object)array; } } public override GameObject ItemModel => ItemBase.LoadDropPrefab("mdlGoldenEgg"); public override Sprite ItemIcon => ItemBase.LoadItemIcon("texIconGoldenEgg"); public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Init() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) dropTable = Addressables.LoadAssetAsync((object)"RoR2/Base/Common/dtVoidChest.asset").WaitForCompletion(); base.Init(); } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown Stage.RespawnCharacter += new hook_RespawnCharacter(EggHatch); } private void EggHatch(orig_RespawnCharacter orig, Stage self, CharacterMaster characterMaster) { orig.Invoke(self, characterMaster); if (NetworkServer.active) { int count = GetCount(characterMaster); if (count > 0) { SpawnItem(characterMaster); characterMaster.inventory.RemoveItem(ItemBase.instance.ItemsDef, 1); } } } private void SpawnItem(CharacterMaster characterMaster) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0041: 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_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_005c: 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_0071: 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) UniquePickup none = UniquePickup.none; rng = new Xoroshiro128Plus(Run.instance.treasureRng.nextUlong); none = ((PickupDropTable)dropTable).GeneratePickup(rng); Transform transform = characterMaster.bodyInstanceObject.transform; PickupDropletController.CreatePickupDroplet(none, transform.position + transform.forward * 3f + transform.up * 3f, transform.forward * 10f, false); } } internal class LunarIncreaseCD : ItemBase { private GameObject lunarShardProjectile; [AutoConfig("Damage Coefficient", 1.6f)] public static float shardDamageCoefficient = 1.6f; [AutoConfig("Proc Coefficient", 0.5f, desc = "Vanilla is 1.0")] public static float shardProcCoefficient = 0.5f; [AutoConfig("Shard Steer Speed", 55, desc = "Vanilla is 20")] public static float shardSteerSpeed = 55f; [AutoConfig("Cooldown Increase Base", 1)] public static float cdIncreaseBase = 1f; [AutoConfig("Cooldown Increase Stack", 1)] public static float cdIncreaseStack = 1f; [AutoConfig("Seconds Per Shard Base", 1)] public static float secondsPerShardBase = 1f; [AutoConfig("Seconds Per Shard Reduction Per Stack", 0.2f)] public static float secondsPerShardReductionStack = 0.2f; public override bool isEnabled => false; private GameObject lunarShardMuzzleFlash => FireLunarShards.muzzleFlashEffectPrefab; public override ExpansionDef RequiredExpansion => SwanSongPlugin.expansionDefSS2; public override string ItemName => "Compression Loop"; public override string ItemLangTokenName => "LUNARINCREASECD"; public override string ItemPickupDesc => "All skills fire lunar shards... " + Language.Styling.RedText("BUT all skills have increased cooldowns"); public override string ItemFullDescription => "On any skill use, fire " + Language.Styling.DamageColor("lunar shards") + " for " + Language.Styling.DamageValueText(shardDamageCoefficient) + " (increases with ability cooldown). " + Language.Styling.RedText($"Increase the cooldowns of all skills by {cdIncreaseBase} second") + " " + Language.Styling.StackText($"+{cdIncreaseStack}") + "."; public override string ItemLore => ""; public override ItemTier Tier => (ItemTier)3; public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)5 }; public override GameObject ItemModel => ItemBase.LoadDropPrefab("mdlLunarIncreaseCD"); public override Sprite ItemIcon => ItemBase.LoadItemIcon("texIconLunarIncreaseCD"); public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Init() { CreateProjectile(); base.Init(); } private void CreateProjectile() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) lunarShardProjectile = Addressables.LoadAssetAsync((object)"RoR2/Base/Brother/LunarShardProjectile.prefab").WaitForCompletion(); ProjectileImpactExplosion component = lunarShardProjectile.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { ((ProjectileExplosion)component).blastDamageCoefficient = 1f; ((ProjectileExplosion)component).blastProcCoefficient = shardProcCoefficient; } ProjectileSteerTowardTarget component2 = lunarShardProjectile.GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { component2.rotationSpeed = shardSteerSpeed; } Content.AddProjectilePrefab(lunarShardProjectile); } public override void Hooks() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Expected O, but got Unknown //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Expected O, but got Unknown //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Expected O, but got Unknown //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Expected O, but got Unknown ((ResourceAvailability)(ref BodyCatalog.availability)).onAvailable += delegate { ItemBase.CloneVanillaDisplayRules((Object)(object)ItemBase.instance.ItemsDef, (Object)(object)Equipment.LunarPortalOnUse); }; GenericSkill.CalculateFinalRechargeInterval += new hook_CalculateFinalRechargeInterval(EnableCooldownAddition); CharacterBody.OnSkillActivated += new hook_OnSkillActivated(FireShards); CharacterBody.RecalculateStats += new hook_RecalculateStats(IncreaseCDs); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(IncreaseCooldowns); } private void IncreaseCooldowns(CharacterBody sender, StatHookEventArgs args) { int count = GetCount(sender); if (count <= 0) { return; } float num = cdIncreaseBase + (cdIncreaseStack * (float)count - 1f); args.allSkills.cooldownFlatReduction -= num; SkillLocator skillLocator = sender.skillLocator; if ((Object)(object)skillLocator != (Object)null) { if (Object.op_Implicit((Object)(object)skillLocator.primary)) { args.primarySkill.cooldownFlatReduction -= num * (float)Tools.CountOverspillFibonacci(skillLocator.primary.rechargeStock); } if (Object.op_Implicit((Object)(object)skillLocator.secondary)) { args.secondarySkill.cooldownFlatReduction -= num * (float)Tools.CountOverspillFibonacci(skillLocator.secondary.rechargeStock); } if (Object.op_Implicit((Object)(object)skillLocator.utility)) { args.utilitySkill.cooldownFlatReduction -= num * (float)Tools.CountOverspillFibonacci(skillLocator.utility.rechargeStock); } if (Object.op_Implicit((Object)(object)skillLocator.special)) { args.specialSkill.cooldownFlatReduction -= num * (float)Tools.CountOverspillFibonacci(skillLocator.special.rechargeStock); } } } private float EnableCooldownAddition(orig_CalculateFinalRechargeInterval orig, GenericSkill self) { float num = self.baseRechargeInterval * self.cooldownScale - self.flatCooldownReduction; if (self.baseRechargeInterval <= 0f && num <= self.baseRechargeInterval) { return 0f; } return Mathf.Max(0.5f, num); } private void IncreaseCDs(orig_RecalculateStats orig, CharacterBody self) { orig.Invoke(self); SkillLocator skillLocator = self.skillLocator; if ((Object)(object)skillLocator != (Object)null) { GenericSkill primary = skillLocator.primary; if (!((Object)(object)primary != (Object)null)) { } } } private void FireShards(orig_OnSkillActivated orig, CharacterBody self, GenericSkill skill) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0046: 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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: 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_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_0270: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, skill); int count = GetCount(self); if (count <= 0) { return; } int num = 0; DamageTypeCombo generic = DamageTypeCombo.Generic; if ((Object)(object)skill == (Object)(object)self.skillLocator.primary) { num++; generic.damageSource = (DamageSource)1; } else if ((Object)(object)skill == (Object)(object)self.skillLocator.secondary) { generic.damageSource = (DamageSource)2; } else if ((Object)(object)skill == (Object)(object)self.skillLocator.utility) { generic.damageSource = (DamageSource)4; } else if ((Object)(object)skill == (Object)(object)self.skillLocator.special) { generic.damageSource = (DamageSource)8; } float num2 = secondsPerShardBase; if (count > 1) { num2 *= Mathf.Pow(1f - secondsPerShardReductionStack, (float)(count - 1)); } float finalRechargeInterval = skill.finalRechargeInterval; float num3 = skill.rechargeStock; if ((Object)(object)lunarShardMuzzleFlash != (Object)null) { EffectManager.SimpleMuzzleFlash(lunarShardMuzzleFlash, ((Component)self).gameObject, "Head", false); } else { Debug.Log((object)"muzzleflash null"); } Ray val = default(Ray); ((Ray)(ref val))..ctor(self.inputBank.aimOrigin, self.inputBank.aimDirection); int num4 = num + Mathf.CeilToInt(finalRechargeInterval / (num3 * num2)); if ((Object)(object)lunarShardProjectile != (Object)null) { bool crit = Util.CheckRoll(self.crit, self.master); for (int i = 0; i < num4; i++) { float num5 = Random.Range(-1f, 1f); float num6 = Random.Range(-1f, 1f); float speedOverride = 200f * (0.3f * (float)(i + 1)); Vector3 val2 = Util.ApplySpread(((Ray)(ref val)).direction, 0f, 0f, 1f, 1f, num5 * (float)i, num6 * (float)i); FireProjectileInfo val3 = default(FireProjectileInfo); val3.projectilePrefab = lunarShardProjectile; val3.position = ((Ray)(ref val)).origin; val3.rotation = Util.QuaternionSafeLookRotation(val2); val3.owner = ((Component)self).gameObject; val3.damage = self.damage * shardDamageCoefficient; val3.force = 0f; val3.crit = crit; val3.damageColorIndex = (DamageColorIndex)3; ((FireProjectileInfo)(ref val3)).speedOverride = speedOverride; val3.useSpeedOverride = true; val3.damageTypeOverride = generic; FireProjectileInfo val4 = val3; ProjectileManager.instance.FireProjectile(val4); } } else { Debug.Log((object)"lunarshard null"); } } } internal class MagicQuiver : ItemBase { private float refundChargeChanceBase = 10f; private float refundChargeChanceStack = 10f; private float refundChanceCourtesy = 5f; private float endChanceMultiplier = 0.5f; public override ExpansionDef RequiredExpansion => SwanSongPlugin.expansionDefSS2; public override string ItemName => "Magic Quiver"; public override string ItemLangTokenName => "MAGICQUIVER"; public override string ItemPickupDesc => "Using skills has a chance to not consume stock."; public override string ItemFullDescription => $"Grants a {refundChargeChanceBase}% " + $"(+{refundChargeChanceStack}% per stack) chance to not consume a charge on skill cast. " + "Unaffected by luck."; public override string ItemLore => ""; public override ItemTier Tier => (ItemTier)1; public override ItemTag[] ItemTags { get { ItemTag[] array = new ItemTag[3]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); return (ItemTag[])(object)array; } } public override GameObject ItemModel => ItemBase.LoadDropPrefab("mdlMagicQuiver"); public override Sprite ItemIcon => ItemBase.LoadItemIcon("texIconMagicQuiver"); public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown return new ItemDisplayRuleDict(Array.Empty()); } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown CharacterBody.OnSkillActivated += new hook_OnSkillActivated(OnSkillActivated); SkillLocator.ApplyAmmoPack += new hook_ApplyAmmoPack(ClearUtilityBeltDebuffOnBandolier); } private void ClearUtilityBeltDebuffOnBandolier(orig_ApplyAmmoPack orig, SkillLocator self) { orig.Invoke(self); if (Object.op_Implicit((Object)(object)self.utility)) { CharacterBody characterBody = self.utility.characterBody; } } private void OnSkillActivated(orig_OnSkillActivated orig, CharacterBody self, GenericSkill skill) { orig.Invoke(self, skill); if (!((Object)(object)self.inventory != (Object)null) || !skill.CanApplyAmmoPack()) { return; } int itemCountEffective = self.inventory.GetItemCountEffective(ItemsDef); if (itemCountEffective > 0) { float num = refundChargeChanceBase + refundChargeChanceStack * (float)(itemCountEffective - 1) + refundChanceCourtesy; float num2 = Util.ConvertAmplificationPercentageIntoReductionPercentage(num / endChanceMultiplier) * endChanceMultiplier; if (Util.CheckRoll(num2, 0f, (CharacterMaster)null)) { skill.AddOneStock(); } } } } internal class ManaFlower : ItemBase { public static float cdrAmtBase = 0.08f; public static float cdrAmtStack = 0.08f; public override string ConfigName => "Items : Natures Gift"; public override ExpansionDef RequiredExpansion => SwanSongPlugin.expansionDefSS2; public override string ItemName => "Nature’s Gift"; public override string ItemLangTokenName => "BORBOMANAFLOWER"; public override string ItemPickupDesc => "It's pretty, oh so pretty..."; public override string ItemFullDescription => "Increases attack speed by " + Tools.ConvertDecimal(cdrAmtBase) + " (+" + Tools.ConvertDecimal(cdrAmtStack) + " per stack), and reduces Primary and Secondary skill cooldowns by " + Tools.ConvertDecimal(cdrAmtBase) + " (+" + Tools.ConvertDecimal(cdrAmtStack) + " per stack)."; public override string ItemLore => "Order: Jupiter Rose\r\nTracking Number: 58***********\r\nEstimated Delivery: 07/30/2056\r\nShipping Method: Standard\r\nShipping Address: 280 Oak Boulevard, Venus\r\nShipping Details:\r\n\r\nIsn’t it pretty?\r\nJust looking at it fills me with energy.\r\nNature is so magical :)"; public override ItemTier Tier => (ItemTier)0; public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)1 }; public override GameObject ItemModel => ItemBase.LoadDropPrefab("mdlManaFlower"); public override Sprite ItemIcon => ItemBase.LoadItemIcon("texIconManaFlower"); public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown CharacterBody.RecalculateStats += new hook_RecalculateStats(ManaFlowerCdr); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(ManaFlowerAspd); } private void ManaFlowerAspd(CharacterBody sender, StatHookEventArgs args) { int count = GetCount(sender); if (count > 0) { float num = cdrAmtBase + cdrAmtStack * (float)(count - 1); args.attackSpeedMultAdd += num; } } private void ManaFlowerCdr(orig_RecalculateStats orig, CharacterBody self) { orig.Invoke(self); int count = GetCount(self); if (count > 0) { float cooldownScale = (1f - cdrAmtBase) * Mathf.Pow(1f - cdrAmtStack, (float)(count - 1)); SkillLocator skillLocator = self.skillLocator; if ((Object)(object)skillLocator != (Object)null) { Tools.ApplyCooldownScale(skillLocator.primary, cooldownScale); Tools.ApplyCooldownScale(skillLocator.secondary, cooldownScale); } } } } internal class NewLopper : ItemBase { internal static float maxHealthThreshold = 0.3f; private int freeCritChance = 15; private float freeCritDamage = 0.1f; private int dangerCritChance = 50; private float bonusCritDamageLowHealthBase = 0f; private float bonusCritDamageLowHealthStack = 2.5f; public static float rampageExtendTime = 4f; public static BuffDef dangerCritBuff; public override string ConfigName => "Items : New Lopper"; public override ExpansionDef RequiredExpansion => SwanSongPlugin.expansionDefSS2; public override string ItemName => "The New Lopper"; public override string ItemLangTokenName => "DANGERCRIT"; public override string ItemPickupDesc => "Massively increase 'Critical Strike' damage at low health."; public override string ItemFullDescription => $"Gain {freeCritChance}% critical chance. " + "Falling below " + Tools.ConvertDecimal(maxHealthThreshold) + " health sends you into a rampage, increasing critical strike damage by " + Tools.ConvertDecimal(bonusCritDamageLowHealthBase + bonusCritDamageLowHealthStack) + " (+" + Tools.ConvertDecimal(bonusCritDamageLowHealthStack) + " per stack), and " + $"critical strike chance by {dangerCritChance - freeCritChance}%. " + $"Killing enemies extends the rampage for {rampageExtendTime} seconds."; public override string ItemLore => "Name: [REDACTED]\r\nDate of birth: June 21st, 1961\r\nOccupation: Executioner\r\n\r\nTime of death: August 23rd, 2058\r\nLocation of death: [REDACTED], Mercury\r\nCause of death: Severe blood loss due to bodily mutilation\r\n\r\nNotes:\r\nAn axe in pristine condition was found next to the body. Examination determined the weapon to be highly resistant to both wear and stains, particularly of blood. The axe’s construction is consistent with a smith on Sues Drive, Jupiter, that [REDACTED] was in contact with shortly before his death. \r\n\r\n[REDACTED] committed 126 known homicides in the hour preceding his death. Every victim was killed by decapitation and had no other wounds. Witnesses report [REDACTED] accidentally struck himself and bisected his body at the waist, bleeding to death moments later. \r\n\r\nAutopsy reveals degradation of internal organs predating [REDACTED]’s death. Symptoms appear to be consistent with certain strains of [REDACTED] found on Jupiter. No degradation was found in the brain, however it is possible that the illness influenced his mental state.\r\n"; public override ItemTier Tier => (ItemTier)2; public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[2] { (ItemTag)1, (ItemTag)16 }; public override GameObject ItemModel => ItemBase.LoadDropPrefab("mdlNewLopper"); public override Sprite ItemIcon => ItemBase.LoadItemIcon("texIconNewLopper"); public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown return new ItemDisplayRuleDict(Array.Empty()); } public override void Init() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) dangerCritBuff = Content.CreateAndAddBuff("bdLopperDangerCrit", Addressables.LoadAssetAsync((object)"RoR2/Base/CritOnUse/texBuffFullCritIcon.tif").WaitForCompletion(), Color.black, canStack: false, isDebuff: false, (StackingDisplayMethod)0); base.Init(); } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown CharacterBody.OnInventoryChanged += new hook_OnInventoryChanged(AddItemBehavior); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(GiveBonusCrit); } private void GiveBonusCrit(CharacterBody sender, StatHookEventArgs args) { int count = GetCount(sender); if (count > 0) { int num = freeCritChance; float num2 = 0f; if (sender.HasBuff(dangerCritBuff)) { num = dangerCritChance; num2 = bonusCritDamageLowHealthBase + bonusCritDamageLowHealthStack * (float)count; } args.critAdd += (float)num; args.critDamageMultAdd += num2; } } private void AddItemBehavior(orig_OnInventoryChanged orig, CharacterBody self) { orig.Invoke(self); if (NetworkServer.active && (Object)(object)self.healthComponent != (Object)null) { self.AddItemBehavior(GetCount(self)); } } } public class NewLopperBehavior : ItemBehavior { private bool isLowHealth = false; private BuffIndex dangerCrit => NewLopper.dangerCritBuff.buffIndex; private void Start() { GlobalEventManager.onCharacterDeathGlobal += ExtendRampage; } private void ExtendRampage(DamageReport damageReport) { //IL_002e: 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_0064: Unknown result type (might be due to invalid IL or missing references) if (NetworkServer.active) { CharacterBody attackerBody = damageReport.attackerBody; if ((Object)(object)attackerBody == (Object)(object)base.body && base.body.HasBuff(dangerCrit) && !isLowHealth) { base.body.RemoveOldestTimedBuff(dangerCrit); base.body.AddTimedBuff(dangerCrit, NewLopper.rampageExtendTime); } } } private void FixedUpdate() { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_00af: 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_007f: 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) if (!NetworkServer.active || base.stack <= 0) { return; } float combinedHealthFraction = base.body.healthComponent.combinedHealthFraction; if (combinedHealthFraction <= NewLopper.maxHealthThreshold && !isLowHealth) { if (base.body.HasBuff(dangerCrit)) { base.body.RemoveOldestTimedBuff(dangerCrit); } base.body.AddBuff(dangerCrit); isLowHealth = true; } else if (isLowHealth) { isLowHealth = false; base.body.RemoveBuff(dangerCrit); base.body.AddTimedBuffAuthority(dangerCrit, NewLopper.rampageExtendTime); } } private void OnDestroy() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) GlobalEventManager.onCharacterDeathGlobal -= ExtendRampage; if (NetworkServer.active && isLowHealth) { base.body.RemoveBuff(dangerCrit); } } } internal class Permafrost : ItemBase { private float freezeChancePerPercentBase = 1f; private float freezeChancePerPercentStack = 2f; private float freezeDamageHealthFraction = 0.05f; private float freezeProcCoefficient = 0.75f; public override ExpansionDef RequiredExpansion => SwanSongPlugin.expansionDefSS2; public override string ItemName => "Permafrost"; public override string ItemLangTokenName => "GOODEXECUTIONITEM"; public override string ItemPickupDesc => "Chance to Freeze enemies on heavy hits, instantly killing them at low health."; public override string ItemFullDescription => $"{freezeChancePerPercentBase + freezeChancePerPercentStack}% " + $"(+{freezeChancePerPercentStack}% per stack) chance on hit " + "per % of enemy maximum health dealt in damage " + $"to Freeze enemies in place for {freezeProcCoefficient * 2f} seconds. " + "Frozen enemies are instantly killed at low health."; public override string ItemLore => ""; public override ItemTier Tier => (ItemTier)2; public override ItemTag[] ItemTags { get { ItemTag[] array = new ItemTag[3]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); return (ItemTag[])(object)array; } } public override GameObject ItemModel => ItemBase.LoadDropPrefab("mdlPermafrost"); public override Sprite ItemIcon => ItemBase.LoadItemIcon("texIconPermafrost"); public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown return new ItemDisplayRuleDict(Array.Empty()); } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown HealthComponent.TakeDamageProcess += new hook_TakeDamageProcess(PermafrostBehavior); } private void PermafrostBehavior(orig_TakeDamageProcess orig, HealthComponent self, DamageInfo damageInfo) { //IL_000b: 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_0025: Invalid comparison between Unknown and I4 //IL_010b: 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_011c: 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_0137: 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_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Expected O, but got Unknown orig.Invoke(self, damageInfo); bool flag = (int)DamageTypeCombo.op_Implicit(damageInfo.damageType & DamageTypeCombo.op_Implicit((DamageType)256)) > 0 && damageInfo.procCoefficient == freezeProcCoefficient; if (!Object.op_Implicit((Object)(object)self) || !self.alive || !((Object)(object)damageInfo.attacker != (Object)null) || flag) { return; } CharacterBody component = damageInfo.attacker.GetComponent(); if (!((Object)(object)component != (Object)null) || !(damageInfo.procCoefficient > 0f)) { return; } CharacterMaster master = component.master; int count = GetCount(component); if (count > 0) { float fullCombinedHealth = self.fullCombinedHealth; float damage = damageInfo.damage; float num = damage / fullCombinedHealth * 100f; float num2 = freezeChancePerPercentBase + freezeChancePerPercentStack * (float)count; if (Util.CheckRoll(num * num2 * damageInfo.procCoefficient, component.master)) { DamageInfo val = new DamageInfo { attacker = damageInfo.attacker, crit = damageInfo.crit, damage = fullCombinedHealth * freezeDamageHealthFraction, damageType = DamageTypeCombo.op_Implicit((DamageType)256), force = Vector3.zero, position = ((Component)self).transform.position, procChainMask = damageInfo.procChainMask, procCoefficient = freezeProcCoefficient }; self.TakeDamage(val); GlobalEventManager.instance.OnHitEnemy(val, ((Component)self).gameObject); } } } } internal class ChargedSpine : ItemBase { public static float baseShield = 50f; public static float stackShield = 50f; public static float baseDuration = 5f; public static float stackDuration = 5f; public static float baseArmor = 200f; public override ExpansionDef RequiredExpansion => SwanSongPlugin.expansionDefSS2; public override string ItemName => "Charged Malachite Spine"; public override string ItemLangTokenName => "CHARGEDMALACHITESPINE"; public override string ItemPickupDesc => "Poison yourself when shields are broken, gaining great damage resistence."; public override string ItemFullDescription => "Gain " + Language.Styling.HealingColor($"{baseShield} shield") + " " + Language.Styling.StackText($"+{stackShield}") + ". While poisoned, gain " + Language.Styling.HealingColor($"{baseArmor} armor") + ". " + Language.Styling.RedText($"Poison is inflicted for {baseDuration} seconds on shield break") + " " + Language.Styling.StackText($"+{stackDuration} seconds") + "."; public override string ItemLore => ""; public override ItemTier Tier => (ItemTier)3; public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)5 }; public override GameObject ItemModel => ItemBase.LoadDropPrefab("mdlChargedSpine"); public override Sprite ItemIcon => ItemBase.LoadItemIcon("texIconChargedSpine"); public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown HealthComponent.TakeDamageProcess += new hook_TakeDamageProcess(ChargedSpineTakeDamage); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(ChargedSpineStats); } private void ChargedSpineStats(CharacterBody sender, StatHookEventArgs args) { int count = GetCount(sender); if (count > 0) { args.baseShieldAdd += baseShield * (float)count; if (sender.HasBuff(Buffs.HealingDisabled)) { args.armorAdd += baseArmor; } } } private void ChargedSpineTakeDamage(orig_TakeDamageProcess orig, HealthComponent self, DamageInfo damageInfo) { if (!Object.op_Implicit((Object)(object)self)) { orig.Invoke(self, damageInfo); return; } bool flag = HasShield(self); CharacterBody body = self.body; int count = GetCount(body); orig.Invoke(self, damageInfo); if (flag && !HasShield(self) && self.alive && count > 0) { body.AddTimedBuff(Buffs.HealingDisabled, baseDuration + stackDuration * (float)(count - 1)); } } public static bool HasShield(HealthComponent hc) { return hc.shield > 1f; } } internal class Wishbone : ItemBase { private static ItemDef brokenItemDef; public static int upgradeChance = 30; private static bool upgradeAlt1 = false; private static bool upgradeAlt2 = false; private static int serverWishboneCount = 0; private static PickupIndex wishPickupAlt1 = PickupIndex.none; private static PickupIndex wishPickupAlt2 = PickupIndex.none; public override bool lockEnabled => true; public override bool CanBeTemporary => false; public override string ItemName => "Wishbone"; public override string ItemLangTokenName => "WISHBONE"; public override string ItemPickupDesc => "Breaks during storms. If taken to the Teleporter, a wish will be granted."; public override string ItemFullDescription => ItemPickupDesc; public override string ItemLore => "loooorrrrreeeeeeee"; public override ItemTier Tier => (ItemTier)4; public override ItemTag[] ItemTags { get { ItemTag[] array = new ItemTag[8]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); return (ItemTag[])(object)array; } } public override GameObject ItemModel => ItemBase.LoadDropPrefab("mdlWishbone"); public override Sprite ItemIcon => ItemBase.LoadItemIcon("texIconWishbone"); public static bool UseSimpleWishboneBehavior() { return RunArtifactManager.instance.IsArtifactEnabled(Artifacts.Command); } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown return new ItemDisplayRuleDict(Array.Empty()); } public override void Init() { brokenItemDef = ItemBase.CreateNewUntieredItem("BROKENWISH", ItemBase.LoadItemIcon("texIconWishboneBroken"), (ItemTier)5); ItemBase.DoLangForItem(brokenItemDef, "Bone", "The mundane half of a broken wishbone. Better luck next time."); base.Init(); } public override void Hooks() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown TeleporterInteraction.onTeleporterBeginChargingGlobal += StealWishboneOnTeleCharge; BossGroup.DropRewards += new Manipulator(WishboneRewards); BossGroup.DropRewards += new hook_DropRewards(WishboneRewardMessage); CharacterBody.Start += new hook_Start(DestroyWishboneOnStart); HealthComponent.TakeDamageProcess += new hook_TakeDamageProcess(DestroyWishboneOnDamage); } private void BreakWishbones(CharacterBody body, int wishboneCount, bool badBreak = true) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0056: 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_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Expected O, but got Unknown //IL_0026: Unknown result type (might be due to invalid IL or missing references) if (wishboneCount > 0) { if (!badBreak) { body.inventory.RemoveItemPermanent(ItemsDef.itemIndex, wishboneCount); return; } ItemTransformation val = default(ItemTransformation); ((ItemTransformation)(ref val)).originalItemIndex = ItemsDef.itemIndex; ((ItemTransformation)(ref val)).newItemIndex = brokenItemDef.itemIndex; ((ItemTransformation)(ref val)).maxToTransform = int.MaxValue; val.transformationType = (ItemTransformationTypeIndex)0; TryTransformResult val2 = default(TryTransformResult); ((ItemTransformation)(ref val)).TryTransform(body.inventory, ref val2); EffectData val3 = new EffectData { origin = body.corePosition }; val3.SetNetworkedObjectReference(((Component)body).gameObject); EffectManager.SpawnEffect(AssetReferences.fragileDamageBonusBreakEffectPrefab, val3, true); } } private static void CreateBossRewardDroplet(UniquePickup pickup, Vector3 position, Vector3 velocity, int indexOfCurrentReward, BossGroup bossGroup) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: 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_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_0026: 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_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: 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_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0099: 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_00d7: 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) CreatePickupInfo val = default(CreatePickupInfo); val.rotation = Quaternion.identity; ((CreatePickupInfo)(ref val)).pickup = pickup; val.position = position; CreatePickupInfo val2 = val; if (indexOfCurrentReward % (1 + bossGroup.bonusRewardCount) == 0 && serverWishboneCount > 0) { serverWishboneCount--; UniquePickup wishPickup = GetWishPickup(ref wishPickupAlt1, upgradeAlt1); UniquePickup wishPickup2 = GetWishPickup(ref wishPickupAlt2, upgradeAlt2); val2.pickerOptions = PickupPickerController.GenerateOptionsFromList>(new List(3) { wishPickup, pickup, wishPickup2 }); val2.prefabOverride = Addressables.LoadAssetAsync((object)"RoR2/DLC1/OptionPickup/OptionPickup.prefab").WaitForCompletion(); ((CreatePickupInfo)(ref val2)).pickupIndex = (UseSimpleWishboneBehavior() ? PickupCatalog.FindPickupIndex((ItemTier)2) : PickupCatalog.FindPickupIndex((ItemTier)1)); } PickupDropletController.CreatePickupDroplet(val2, position, velocity); } private static bool GetWishUpgraded() { if (serverWishboneCount <= Run.instance.participatingPlayerCount) { return false; } if (UseSimpleWishboneBehavior()) { return true; } serverWishboneCount--; return true; } private static UniquePickup GetWishPickup(ref PickupIndex pickupIndex, bool isUpgraded) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_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_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) List list = Run.instance.availableTier2DropList; if (isUpgraded && Util.CheckRoll((float)upgradeChance, 0f, (CharacterMaster)null)) { list = Run.instance.availableTier3DropList; } pickupIndex = Run.instance.bossRewardRng.NextElementUniform(list); return new UniquePickup(pickupIndex); } private void WishboneRewardMessage(orig_DropRewards orig, BossGroup self) { if (serverWishboneCount > 0) { Chat.ServerAttemptBroadcastChat("A wish is granted..."); } orig.Invoke(self); serverWishboneCount = 0; upgradeAlt1 = false; upgradeAlt2 = false; } private void WishboneRewards(ILContext il) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); int rewardLoc = 1; int rewardCountLoc = 2; int rewardIndexLoc = 8; ILLabel val2 = default(ILLabel); if (!val.TryGotoNext((MoveType)2, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "get_bonusRewardCount") }) || !val.TryGotoNext((MoveType)2, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref rewardCountLoc) }) || !val.TryGotoNext((MoveType)2, new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref rewardIndexLoc), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, rewardCountLoc), (Instruction x) => ILPatternMatchingExt.MatchBlt(x, ref val2) })) { return; } val.Index = 0; if (val.TryGotoNext((MoveType)2, new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "none"), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref rewardLoc) }) && val.TryGotoNext((MoveType)0, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "CreatePickupDroplet") })) { val.Remove(); val.Emit(OpCodes.Ldloc, rewardIndexLoc); val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Action)delegate(UniquePickup pickup, Vector3 position, Vector3 velocity, int rewardIndex, BossGroup bossGroup) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) CreateBossRewardDroplet(pickup, position, velocity, rewardIndex, bossGroup); }); } } private void DestroyWishboneOnDamage(orig_TakeDamageProcess orig, HealthComponent self, DamageInfo damageInfo) { orig.Invoke(self, damageInfo); if (!NetworkServer.active || damageInfo.procCoefficient <= 0f || (Object.op_Implicit((Object)(object)damageInfo.attacker) && (Object)(object)damageInfo.attacker == (Object)(object)((Component)self).gameObject)) { return; } int count = GetCount(self.body); if (count > 0) { StormRunBehavior stormRunBehavior = StormRunBehavior.instance; if ((stormRunBehavior != null && stormRunBehavior.hasBegunStorm) || !self.alive) { BreakWishbones(self.body, count); } } } private void DestroyWishboneOnStart(orig_Start orig, CharacterBody self) { orig.Invoke(self); if (NetworkServer.active) { int count = GetCount(self, permanentOnly: true); BreakWishbones(self, count, badBreak: false); } } private void StealWishboneOnTeleCharge(TeleporterInteraction obj) { //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: 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_00b6: Expected I4, but got Unknown //IL_00bd: Expected O, but got Unknown WishboneCarcassComponent.ClearAllCarcasses(); if (!NetworkServer.active) { return; } serverWishboneCount = 0; foreach (CharacterMaster readOnlyInstances in CharacterMaster.readOnlyInstancesList) { CharacterBody body = readOnlyInstances.GetBody(); if (!Object.op_Implicit((Object)(object)body)) { continue; } int count = GetCount(readOnlyInstances.inventory, permanentOnly: true); if (body.healthComponent.alive) { serverWishboneCount += count; if (count > 0) { EffectData val = new EffectData { origin = body.corePosition, genericFloat = 1f, genericUInt = Util.IntToUintPlusOne((int)ItemsDef.itemIndex) }; val.SetNetworkedObjectReference(((Component)obj).gameObject); EffectManager.SpawnEffect(ItemTransferOrb.orbEffectPrefab, val, true); } } BreakWishbones(body, count, badBreak: false); } upgradeAlt1 = GetWishUpgraded(); upgradeAlt2 = GetWishUpgraded(); } } internal class StarVeil : ItemBase { private static float iframeDurationBase = 0.33f; private static float iframeDurationStack = 0.33f; private static float stormDamageCoefficient = 3f; private static int stormWavesBase = 3; private static int stormWavesStack = 2; public override ExpansionDef RequiredExpansion => SwanSongPlugin.expansionDefSS2; public override string ItemName => "Star Veil"; public override string ItemLangTokenName => "STARVEIL"; public override string ItemPickupDesc => "Taking damage causes you to become invincible... BUT meteors will fall nearby, hurting both enemies and allies."; public override string ItemFullDescription => "After getting hit, become invincible to all incoming damage " + $"for {iframeDurationBase} (+{iframeDurationStack} per stack) seconds. " + $"Then, cause {Mathf.RoundToInt((float)stormWavesBase)} (+{Mathf.RoundToInt((float)stormWavesStack)} per stack) " + "waves of meteors to fall from the sky, damaging ALL characters for " + Tools.ConvertDecimal(stormDamageCoefficient) + " damage per blast."; public override string ItemLore => "ITS ME. I HAVE IT.\r\n\r\nARE YOU EXCITED? ARE YOU SCARED? ARE YOU CONTRITE? ARE YOU DISBELIEVING?\r\n\r\nMURDERER.\r\n\r\nYOU SLEW MY ?????. YOU DESECRATED THEIR FORMS. YOU USED THEIR SOULS TO SLAUGHTER MY ?????. YOU PERFORMED HIDEOUS EXPERIMENTS IN THE NAME OF FALSE GODS. AND THE RESULT GAVE YOU POWER.\r\n\r\nBUT YOU LOST IT.\r\n\r\nAND NOW I HAVE IT. I AM SURROUNDED BY THE SOULS OF MY ????? AND I AM FULL OF VENGEANCE.\r\n\r\nWHAT ARE YOU FULL OF? FEAR AND REGRET?\r\n\r\nWHERE IS YOUR “INVINCIBILITY” NOW? WHERE IS YOUR “GOD SLAYING POWER?” WHERE ARE YOUR “STARS?”\r\n\r\nTHEY ARE WITH ME. YOU ARE SO MUCH MORE THAN A MURDERER. YOU ARE A FOOL. IMBECILE. LACKWIT. AND YOU WILL COME TO REGRET EVERYTHING YOU HAVE DONE TO ME AND MY ?????.\r\n\r\nBECAUSE I AM COMING FOR YOU. EVERY PATHETIC BLOW YOU GIVE TO ME I WILL USE TO RAIN DEATH UPON EVERYTHING YOU HAVE EVER KNOWN.\r\n\r\nWHAT WILL YOU DO? YOUR FALSE GODS WILL NOT ANSWER PRAYER. THERE IS NOTHING YOU CAN DO. IF YOU RUN I WILL ONLY BE ANGRIER.\r\n\r\nI WILL BE THERE SOON. YOU WILL NOT HAVE TO DESPAIR FOR LONG.\r\n\r\nTHE SOULS OF MY ????? WILL DRINK YOUR SCREAMS LIKE NECTAR."; public override ItemTier Tier => (ItemTier)3; public override ItemTag[] ItemTags { get { ItemTag[] array = new ItemTag[4]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); return (ItemTag[])(object)array; } } public override GameObject ItemModel => ItemBase.LoadDropPrefab("mdlStarVeil"); public override Sprite ItemIcon => ItemBase.LoadItemIcon("texIconStarVeil"); public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown HealthComponent.TakeDamageProcess += new hook_TakeDamageProcess(StarVeilTakeDamage); } private void StarVeilTakeDamage(orig_TakeDamageProcess orig, HealthComponent self, DamageInfo damageInfo) { //IL_0052: 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_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, damageInfo); if (damageInfo.rejected || !Object.op_Implicit((Object)(object)self.body)) { return; } int count = GetCount(self.body); if (count > 0 && !self.body.HasBuff(Buffs.Immune) && !((Enum)damageInfo.damageType.damageType).HasFlag((Enum)(object)(DamageType)2048)) { float stackValue = ItemBase.GetStackValue(iframeDurationBase, iframeDurationStack, count); self.body.AddTimedBuffAuthority(Buffs.Immune.buffIndex, stackValue); bool flag = false; if (damageInfo.procCoefficient > 0f || flag) { MeteorStormController component = Object.Instantiate(Resources.Load("Prefabs/NetworkedObjects/MeteorStorm"), self.body.corePosition, Quaternion.identity).GetComponent(); component.owner = ((Component)self).gameObject; component.ownerDamage = self.body.damage; component.isCrit = Util.CheckRoll(self.body.crit, self.body.master); component.waveCount = (int)ItemBase.GetStackValue(stormWavesBase, stormWavesStack, count); component.impactDelay = 1f; component.blastRadius = 6f; component.waveMinInterval = 0.2f; component.waveMaxInterval = 0.4f; component.blastDamageCoefficient = stormDamageCoefficient; NetworkServer.Spawn(((Component)component).gameObject); } } } } internal class UtilityBelt : ItemBase { public static List blacklistedSkillNameTokens = new List(1) { "MAGE_UTILITY_ICE_NAME", "ENGI_SKILL_HARPOON_NAME", "CAPTAIN_UTILITY_NAME", "CAPTAIN_UTILITY_ALT_NAME" }; private static float minBaseCooldown = 2f; private static float maxBaseCooldown = 20f; public static float castBarrierBase = 0.03f; public static float castBarrierStack = 0.015f; public override ExpansionDef RequiredExpansion => SwanSongPlugin.expansionDefSS2; public override string ItemName => "Utility Knife"; public override string ItemLangTokenName => "UTILITYBARRIER"; public override string ItemPickupDesc => "Casting your Utility skill grants a temporary barrier."; public override string ItemFullDescription => "Activating your Utility skill also grants you a temporary barrier for " + Tools.ConvertDecimal(castBarrierBase) + " of your maximum health (+" + Tools.ConvertDecimal(castBarrierStack) + " per stack) per second of the skill's base cooldown."; public override string ItemLore => ""; public override ItemTier Tier => (ItemTier)1; public override GameObject ItemModel => ItemBase.LoadDropPrefab("mdlUtilityBelt"); public override Sprite ItemIcon => ItemBase.LoadItemIcon("texIconUtilityBelt"); public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)2 }; public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown CharacterBody.OnSkillActivated += new hook_OnSkillActivated(UtilityBeltBarrierGrant); } private void UtilityBeltBarrierGrant(orig_OnSkillActivated orig, CharacterBody self, GenericSkill skill) { orig.Invoke(self, skill); if ((Object)(object)skill == (Object)(object)self.skillLocator.utility) { GiveUtilityBarrier(self, skill.baseRechargeInterval); } } public static void GiveUtilityBarrier(CharacterBody body, GenericSkill skill) { if ((Object)(object)skill != (Object)null) { GiveUtilityBarrier(body, skill.baseRechargeInterval); } } public static void GiveUtilityBarrier(CharacterBody body, float skillBaseCooldown) { if (Object.op_Implicit((Object)(object)body.healthComponent)) { float num = ItemBase.instance.GetCount(body); if (num > 0f) { float num2 = castBarrierBase + castBarrierStack * (num - 1f); float num3 = num2 * Mathf.Clamp(skillBaseCooldown, minBaseCooldown, maxBaseCooldown); body.healthComponent.AddBarrier(body.healthComponent.fullCombinedHealth * num3); } } } } internal class VoidIchorRed : ItemBase { private int critBase = 5; private int critStack = 5; private float attackSpeedBase = 0.075f; private float attackSpeedStack = 0.075f; public override ExpansionDef RequiredExpansion => SwanSongPlugin.expansionDefSS2; public override string ItemName => "Metamorphic Ichor (Red)"; public override string ItemLangTokenName => "ICHORRED"; public override string ItemPickupDesc => "Increase attack speed and critical strike chance. ."; public override string ItemFullDescription => "Increase " + Language.Styling.DamageColor("attack speed") + " by " + Language.Styling.DamageColor(Language.Styling.ConvertDecimal(attackSpeedBase)) + " " + Language.Styling.StackText("+" + Language.Styling.ConvertDecimal(attackSpeedStack)) + ". Increase " + Language.Styling.DamageColor("critical strike chance") + " by " + Language.Styling.DamageColor($"{critBase}%") + " " + Language.Styling.StackText($"+{critStack}%") + ". " + Language.Styling.VoidColor("Corrupts all Replusion Armor Plates and Yellow Ichors") + "."; public override string ItemLore => ""; public override ItemTier Tier => (ItemTier)6; public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)1 }; public override GameObject ItemModel => ItemBase.LoadDropPrefab("mdlVoidIchorR"); public override Sprite ItemIcon => ItemBase.LoadItemIcon("texIconVoidIchorR"); public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RedIchorStats); ContagiousItemManager.Init += new hook_Init(CreateTransformation); } private void RedIchorStats(CharacterBody sender, StatHookEventArgs args) { int count = GetCount(sender); args.critAdd += (float)(critBase + critStack * (count - 1)); args.attackSpeedMultAdd += attackSpeedBase + attackSpeedStack * (float)(count - 1); } private void CreateTransformation(orig_Init orig) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: 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_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) Pair val = default(Pair); val.itemDef1 = Items.ArmorPlate; val.itemDef2 = ItemBase.instance.ItemsDef; Pair val2 = val; ItemCatalog.itemRelationships[ItemRelationshipTypes.ContagiousItem] = CollectionExtensions.AddToArray(ItemCatalog.itemRelationships[ItemRelationshipTypes.ContagiousItem], val2); val = default(Pair); val.itemDef1 = ItemBase.instance.ItemsDef; val.itemDef2 = ItemBase.instance.ItemsDef; Pair val3 = val; ItemCatalog.itemRelationships[ItemRelationshipTypes.ContagiousItem] = CollectionExtensions.AddToArray(ItemCatalog.itemRelationships[ItemRelationshipTypes.ContagiousItem], val3); orig.Invoke(); } } internal class VoidIchorViolet : ItemBase { public float cooldown = 1f; private int barrierBase = 22; private int barrierStack = 22; public static BuffDef violetBuff; public override ExpansionDef RequiredExpansion => SwanSongPlugin.expansionDefSS2; public override string ItemName => "Metamorphic Ichor (Violet)"; public override string ItemLangTokenName => "ICHORVIOLET"; public override string ItemPickupDesc => "Gain barrier when hurt. " + Language.Styling.VoidColor("Corrupts all Medkits and Red Ichors") + "."; public override string ItemFullDescription => "Gain " + Language.Styling.HealingColor($"{barrierBase} barrier") + " when hurt " + Language.Styling.StackText($"+{barrierStack}") + ". " + Language.Styling.VoidColor("Corrupts all Medkits and Red Ichors") + "."; public override string ItemLore => ""; public override ItemTier Tier => (ItemTier)6; public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)6 }; public override GameObject ItemModel => ItemBase.LoadDropPrefab("mdlVoidIchorV"); public override Sprite ItemIcon => ItemBase.LoadItemIcon("texIconVoidIchorV"); public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Init() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) violetBuff = Content.CreateAndAddBuff("bdVioletCooldown", Addressables.LoadAssetAsync((object)"RoR2/Base/ElementalRings/texBuffElementalRingsReadyIcon.tif").WaitForCompletion(), new Color(0.9f, 0.8f, 0f), canStack: false, isDebuff: true, (StackingDisplayMethod)0); violetBuff.isHidden = true; BuffDef obj = violetBuff; obj.flags = (Flags)(obj.flags | 1); base.Init(); } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown ContagiousItemManager.Init += new hook_Init(CreateTransformation); HealthComponent.TakeDamageProcess += new hook_TakeDamageProcess(VioletIchorOnTakeDamage); } private void VioletIchorOnTakeDamage(orig_TakeDamageProcess orig, HealthComponent self, DamageInfo damageInfo) { //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, damageInfo); if (!Object.op_Implicit((Object)(object)self) || !self.alive) { return; } CharacterBody body = self.body; if ((Object)(object)body == (Object)null) { return; } int count = GetCount(body); if (!body.HasBuff(violetBuff) && count > 0) { DamageType damageType = damageInfo.damageType.damageType; bool flag = ((Enum)damageType).HasFlag((Enum)(object)(DamageType)67108864); bool flag2 = (Object)(object)((Component)self).gameObject == (Object)(object)damageInfo.attacker; if (!flag) { int num = barrierBase + barrierStack * (count - 1); self.AddBarrier((float)num); body.AddTimedBuffAuthority(violetBuff.buffIndex, cooldown); } } } private void CreateTransformation(orig_Init orig) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: 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_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) Pair val = default(Pair); val.itemDef1 = Items.Medkit; val.itemDef2 = ItemBase.instance.ItemsDef; Pair val2 = val; ItemCatalog.itemRelationships[ItemRelationshipTypes.ContagiousItem] = CollectionExtensions.AddToArray(ItemCatalog.itemRelationships[ItemRelationshipTypes.ContagiousItem], val2); val = default(Pair); val.itemDef1 = ItemBase.instance.ItemsDef; val.itemDef2 = ItemBase.instance.ItemsDef; Pair val3 = val; ItemCatalog.itemRelationships[ItemRelationshipTypes.ContagiousItem] = CollectionExtensions.AddToArray(ItemCatalog.itemRelationships[ItemRelationshipTypes.ContagiousItem], val3); orig.Invoke(); } } internal class VoidIchorYellow : ItemBase { private float regenBase = 0.8f; private float regenStack = 0.8f; public override ExpansionDef RequiredExpansion => SwanSongPlugin.expansionDefSS2; public override string ItemName => "Metamorphic Ichor (Yellow)"; public override string ItemLangTokenName => "ICHORYELLOW"; public override string ItemPickupDesc => "Gain health regeneration. " + Language.Styling.VoidColor("Corrupts all Soldier's Syringes and Violet Ichors") + "."; public override string ItemFullDescription => "Increase " + Language.Styling.HealingColor("base health regeneration") + " by " + Language.Styling.HealingColor($"{regenBase} hp/s") + " " + Language.Styling.StackText($"+{regenStack} hp/s") + ". " + Language.Styling.VoidColor("Corrupts all Soldier's Syringes and Violet Ichors") + "."; public override string ItemLore => ""; public override ItemTier Tier => (ItemTier)6; public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)2 }; public override GameObject ItemModel => ItemBase.LoadDropPrefab("mdlVoidIchorY"); public override Sprite ItemIcon => ItemBase.LoadItemIcon("texIconVoidIchorY"); public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown ContagiousItemManager.Init += new hook_Init(CreateTransformation); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(IchorRegenBoost); } private void IchorRegenBoost(CharacterBody sender, StatHookEventArgs args) { int count = GetCount(sender); args.baseRegenAdd += regenBase + regenStack * (float)(count - 1) * (1f + sender.level * 0.2f); } private void CreateTransformation(orig_Init orig) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: 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_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) Pair val = default(Pair); val.itemDef1 = Items.Syringe; val.itemDef2 = ItemBase.instance.ItemsDef; Pair val2 = val; ItemCatalog.itemRelationships[ItemRelationshipTypes.ContagiousItem] = CollectionExtensions.AddToArray(ItemCatalog.itemRelationships[ItemRelationshipTypes.ContagiousItem], val2); val = default(Pair); val.itemDef1 = ItemBase.instance.ItemsDef; val.itemDef2 = ItemBase.instance.ItemsDef; Pair val3 = val; ItemCatalog.itemRelationships[ItemRelationshipTypes.ContagiousItem] = CollectionExtensions.AddToArray(ItemCatalog.itemRelationships[ItemRelationshipTypes.ContagiousItem], val3); orig.Invoke(); } } internal class VoidLaserTurbine : ItemBase { public static BuffDef turbineChargeBuff; public static BuffDef turbineReadyBuff; public static float secondsOfChargeRequired = 90f; public override ExpansionDef RequiredExpansion => SwanSongPlugin.expansionDefSS2; public override string ItemName => "Super Solenoid Engine"; public override string ItemLangTokenName => "VOIDLASERTURBINE"; public override string ItemPickupDesc => "Using skills charges a devastating laser primary attack. Corrupts all Brilliant Behemoths and Resonance Discs."; public override string ItemFullDescription => "Using your skills builds charge. " + $"After {secondsOfChargeRequired} seconds worth of charge has accumulated, " + "prime 1 use (+1 per stack) of " + VoidLaserTurbineSkill._SkillName + ", replacing your Primary attack. Firing " + VoidLaserTurbineSkill._SkillName + " deals " + Tools.ConvertDecimal(VoidLaserBeam.damageCoefficient) + " damage, piercing ALL enemies and terrain. Corrupts all Brilliant Behemoths and Resonance Discs."; public override string ItemLore => ""; public override ItemTier Tier => (ItemTier)8; public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)1 }; public override GameObject ItemModel => ItemBase.LoadDropPrefab("mdlVoidLaserTurbine"); public override Sprite ItemIcon => ItemBase.LoadItemIcon("texIconVoidLaserTurbine"); public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown CharacterBody.OnInventoryChanged += new hook_OnInventoryChanged(AddItemBehavior); ContagiousItemManager.Init += new hook_Init(CreateTransformation); } private void AddItemBehavior(orig_OnInventoryChanged orig, CharacterBody self) { orig.Invoke(self); if (NetworkServer.active && Object.op_Implicit((Object)(object)self.master)) { VoidTurbineBehavior voidTurbineBehavior = self.AddItemBehavior(GetCount(self)); } } public override void Init() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0027: 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_005f: Unknown result type (might be due to invalid IL or missing references) turbineChargeBuff = Content.CreateAndAddBuff("bdSuperSolenoidCharge", Addressables.LoadAssetAsync((object)"RoR2/Base/ElementalRings/texBuffElementalRingsReadyIcon.tif").WaitForCompletion(), new Color(0.5f, 0f, 0.4f), canStack: true, isDebuff: false, (StackingDisplayMethod)1); turbineReadyBuff = Content.CreateAndAddBuff("bdSuperSolenoidReady", Addressables.LoadAssetAsync((object)"RoR2/Base/ElementalRings/texBuffElementalRingsReadyIcon.tif").WaitForCompletion(), new Color(0.9f, 0.2f, 0.8f), canStack: false, isDebuff: false, (StackingDisplayMethod)0); base.Init(); } private void CreateTransformation(orig_Init orig) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: 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_004d: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) Pair val = default(Pair); val.itemDef1 = Items.Behemoth; val.itemDef2 = ItemBase.instance.ItemsDef; Pair val2 = val; val = default(Pair); val.itemDef1 = Items.LaserTurbine; val.itemDef2 = ItemBase.instance.ItemsDef; Pair val3 = val; ItemCatalog.itemRelationships[ItemRelationshipTypes.ContagiousItem] = CollectionExtensions.AddToArray(ItemCatalog.itemRelationships[ItemRelationshipTypes.ContagiousItem], val2); ItemCatalog.itemRelationships[ItemRelationshipTypes.ContagiousItem] = CollectionExtensions.AddToArray(ItemCatalog.itemRelationships[ItemRelationshipTypes.ContagiousItem], val3); orig.Invoke(); } } public class VoidTurbineBehavior : ItemBehavior { private GenericSkill primarySkill; private GenericSkill overriddenSkill; private SkillDef primaryOverride => SkillBase.instance.SkillDef; private void Start() { SkillLocator skillLocator = base.body.skillLocator; primarySkill = (Object.op_Implicit((Object)(object)skillLocator) ? skillLocator.primary : null); if (Object.op_Implicit((Object)(object)primarySkill)) { primarySkill.onSkillChanged += TryOverrideSkill; } base.body.onSkillActivatedServer += OnSkillActivated; } private void OnSkillActivated(GenericSkill skill) { if (base.body.HasBuff(VoidLaserTurbine.turbineReadyBuff) || !(skill.baseRechargeInterval > 0f) || skill.rechargeStock <= 0) { return; } float num = skill.baseRechargeInterval; if (skill.rechargeStock > 1) { num /= (float)skill.rechargeStock; } int num2 = Mathf.CeilToInt(Mathf.Floor(num) * (100f / VoidLaserTurbine.secondsOfChargeRequired)); if (num2 > 0) { for (int i = 0; i < num2; i++) { base.body.AddBuff(VoidLaserTurbine.turbineChargeBuff); } } } private void OnDestroy() { if (Object.op_Implicit((Object)(object)primarySkill)) { if (base.body.HasBuff(VoidLaserTurbine.turbineReadyBuff) && NetworkServer.active) { base.body.RemoveBuff(VoidLaserTurbine.turbineReadyBuff); } primarySkill.onSkillChanged -= TryOverrideSkill; TryOverrideSkill(primarySkill); } base.body.onSkillActivatedServer -= OnSkillActivated; } private void FixedUpdate() { if (base.body.HasBuff(VoidLaserTurbine.turbineReadyBuff)) { if ((Object)(object)overriddenSkill != (Object)null && overriddenSkill.stock > 0) { return; } UnreadyTurbineSkill(); } int num = base.body.GetBuffCount(VoidLaserTurbine.turbineChargeBuff); if (num < 100) { return; } if (NetworkServer.active) { while (num > 0) { base.body.RemoveBuff(VoidLaserTurbine.turbineChargeBuff); num--; } } ReadyTurbineSkill(); } private void UnreadyTurbineSkill() { if (NetworkServer.active) { base.body.RemoveBuff(VoidLaserTurbine.turbineReadyBuff); } if (Object.op_Implicit((Object)(object)primarySkill)) { TryOverrideSkill(primarySkill); } } private void ReadyTurbineSkill() { base.body.AddBuff(VoidLaserTurbine.turbineReadyBuff); if (Object.op_Implicit((Object)(object)primarySkill)) { TryOverrideSkill(primarySkill); } } private void TryOverrideSkill(GenericSkill skill) { if (!Object.op_Implicit((Object)(object)skill)) { return; } if (base.body.HasBuff(VoidLaserTurbine.turbineReadyBuff)) { if ((Object)(object)overriddenSkill == (Object)null && !skill.HasSkillOverrideOfPriority((SkillOverridePriority)4)) { overriddenSkill = skill; overriddenSkill.SetSkillOverride((object)this, primaryOverride, (SkillOverridePriority)4); overriddenSkill.maxStock = base.stack; overriddenSkill.stock = base.stack; } } else if (Object.op_Implicit((Object)(object)overriddenSkill)) { overriddenSkill.UnsetSkillOverride((object)this, primaryOverride, (SkillOverridePriority)4); overriddenSkill = null; } } } internal class CobaltShield : ItemBase { public static BuffDef cobaltDefense; public static float cobaltWaitTime = 0.1f; [AutoConfig("Armor Base", 20)] public static int baseArmor = 20; [AutoConfig("Armor Stack", 20)] public static int stackArmor = 20; [AutoConfig("Barrier Generation Base", 6f)] public static float baseBarrierGen = 6f; [AutoConfig("Barrier Generation Stack", 6f)] public static float stackBarrierGen = 6f; public static int stationaryStatMultiplier = 5; public override AssetBundle assetBundle => SwanSongPlugin.mainAssetBundle; public override string ConfigName => "Items : Cobalt Shield"; public override string ItemName => "Cobalt Shield"; public override string ItemLangTokenName => "CUCKLER"; public override string ItemPickupDesc => "Negate all knockback. Reduce incoming damage and gain barrier while stationary."; public override string ItemFullDescription => "Negates " + Language.Styling.UtilityColor("ALL knockback") + ". Increase " + Language.Styling.HealingColor("armor") + " by " + Language.Styling.HealingColor(baseArmor.ToString()) + " " + Language.Styling.StackText("+" + stackArmor) + " and barrier generation by " + Language.Styling.HealingColor($"{baseBarrierGen} hp/s") + " " + Language.Styling.StackText($"+{baseBarrierGen} hp/s") + ". While stationary, these effects are " + Language.Styling.UtilityColor("quintupled") + "."; public override string ItemLore => "I cannot let you enter until you free me of my curse."; public override ItemTier Tier => (ItemTier)2; public override ItemTag[] ItemTags { get; } = (ItemTag[])(object)new ItemTag[1] { (ItemTag)3 }; public override GameObject ItemModel => ItemBase.LoadDropPrefab("mdlCobaltShield"); public override Sprite ItemIcon => ItemBase.LoadItemIcon("texIconCobaltShield"); public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Init() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) cobaltDefense = Content.CreateAndAddBuff("bdCobaltDefense", assetBundle.LoadAsset("Assets/Textures/Icons/Buff/texBuffCobaltShield.png"), new Color(0.15f, 0.4f, 0.9f), canStack: false, isDebuff: false, (StackingDisplayMethod)0); base.Init(); } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown StatHooks.GetMoreStatCoefficients += new MoreStatHookEventHandler(CobaltBarrierGen); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(CobaltArmorBuff); CharacterBody.OnInventoryChanged += new hook_OnInventoryChanged(AddItemBehavior); CharacterMotor.ApplyForce += new hook_ApplyForce(ConditionalRemoveSelfForce); HealthComponent.TakeDamageProcess += new hook_TakeDamageProcess(RemoveDamageForce); } private void CobaltBarrierGen(CharacterBody body, MoreStatHookEventArgs args) { int count = GetCount(body); if (count > 0) { float num = baseBarrierGen + stackBarrierGen * (float)(count - 1); if (body.HasBuff(cobaltDefense)) { num *= (float)stationaryStatMultiplier; } args.barrierGenerationRateAddPostMult += num; } } private void CobaltArmorBuff(CharacterBody sender, StatHookEventArgs args) { int count = GetCount(sender); if (count > 0) { int num = baseArmor + stackArmor * (count - 1); if (sender.HasBuff(cobaltDefense)) { num *= stationaryStatMultiplier; } args.armorAdd += (float)num; } } private void RemoveDamageForce(orig_TakeDamageProcess orig, HealthComponent self, DamageInfo damageInfo) { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.body)) { int count = GetCount(self.body); if ((Object)(object)self.body != (Object)null && count > 0) { damageInfo.force = Vector3.zero; } } orig.Invoke(self, damageInfo); } private void ConditionalRemoveSelfForce(orig_ApplyForce orig, CharacterMotor self, Vector3 force, bool alwaysApply, bool disableAirControlUntilCollision) { //IL_003f: 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_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) CharacterBody body = self.body; if ((Object)(object)body != (Object)null && GetCount(body) > 0 && body.HasBuff(cobaltDefense)) { force *= 0f; } orig.Invoke(self, force, alwaysApply, disableAirControlUntilCollision); } private void AddItemBehavior(orig_OnInventoryChanged orig, CharacterBody self) { orig.Invoke(self); if (NetworkServer.active) { self.AddItemBehavior(GetCount(self)); } } } public class ShieldItemBehavior : ItemBehavior { private void FixedUpdate() { if (!NetworkServer.active) { return; } float notMovingStopwatch = base.body.notMovingStopwatch; if (base.stack > 0 && notMovingStopwatch >= CobaltShield.cobaltWaitTime) { if (!base.body.HasBuff(CobaltShield.cobaltDefense)) { base.body.AddBuff(CobaltShield.cobaltDefense); } } else if (base.body.HasBuff(CobaltShield.cobaltDefense)) { base.body.RemoveBuff(CobaltShield.cobaltDefense); } } private void OnDisable() { if (NetworkServer.active) { base.body.RemoveBuff(CobaltShield.cobaltDefense); } } } internal class CritRetaliate : ItemBase { public static BuffDef watchCritBuff; [AutoConfig("Critical Strike Chance Bonus", 100)] public static float critChanceBonus = 100f; [AutoConfig("Total Buffs", 10)] public static int buffTotal = 10; [AutoConfig("Base Duration Of Buffs", 6f)] public static float buffDurationBase = 6f; [AutoConfig("Stack Duration Of Buffs", 4f)] public static float buffDurationStack = 4f; public override string ConfigName => "Items : Destroyer Emblem"; public static float critChancePerBuff => critChanceBonus / (float)buffTotal; public override string ItemName => "Destroyer Emblem"; public override string ItemLangTokenName => "CRITRETALIATE"; public override string ItemPickupDesc => "Increase critical strike chance for a short time after being hit."; public override string ItemFullDescription => $"After getting hit, gain a {critChanceBonus}% chance " + "to Critically Strike, fading over " + $"{buffDurationBase} seconds (+{buffDurationStack} per stack)."; public override string ItemLore => ""; public override ItemTier Tier => (ItemTier)1; public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)1 }; public override GameObject ItemModel => ItemBase.LoadDropPrefab("mdlCritRetaliate"); public override Sprite ItemIcon => ItemBase.LoadItemIcon("texIconCritRetaliate"); public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Init() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) watchCritBuff = Content.CreateAndAddBuff("bdWatchCritChance", Addressables.LoadAssetAsync((object)"RoR2/Base/CritOnUse/texBuffFullCritIcon.tif").WaitForCompletion(), Color.yellow, canStack: true, isDebuff: false, (StackingDisplayMethod)0); base.Init(); } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(WatchCritChance); GlobalEventManager.ProcessHitEnemy += new hook_ProcessHitEnemy(DoCritRetaliateBuff); } private void DoCritRetaliateBuff(orig_ProcessHitEnemy orig, GlobalEventManager self, DamageInfo damageInfo, GameObject victim) { //IL_007d: Unknown result type (might be due to invalid IL or missing references) CharacterBody val = default(CharacterBody); if (damageInfo.damage > 0f && !damageInfo.rejected && victim.TryGetComponent(ref val)) { Inventory inventory = val.inventory; if (Object.op_Implicit((Object)(object)inventory)) { int count = GetCount(val); if (count > 0) { val.ClearTimedBuffs(watchCritBuff); float num = buffDurationStack * (float)(count - 1) + buffDurationBase; for (int i = 0; i < buffTotal; i++) { val.AddTimedBuffAuthority(watchCritBuff.buffIndex, num * (float)(i + 1) / (float)buffTotal); } } } } orig.Invoke(self, damageInfo, victim); } private void WatchGetHit(CharacterBody body, DamageInfo damageInfo, CharacterBody victimBody) { //IL_007f: Unknown result type (might be due to invalid IL or missing references) if (!(damageInfo.procCoefficient > 0f) || !(damageInfo.damage > 0f) || damageInfo.rejected) { return; } Inventory inventory = victimBody.inventory; if (!Object.op_Implicit((Object)(object)inventory)) { return; } int count = GetCount(victimBody); if (count > 0) { victimBody.ClearTimedBuffs(watchCritBuff); float num = buffDurationStack * (float)(count - 1) + buffDurationBase; for (int i = 0; i < buffTotal; i++) { victimBody.AddTimedBuffAuthority(watchCritBuff.buffIndex, num * (float)(i + 1) / (float)buffTotal); } } } private void WatchCritChance(CharacterBody sender, StatHookEventArgs args) { int buffCount = sender.GetBuffCount(watchCritBuff); args.critAdd += critChancePerBuff * (float)buffCount; if (GetCount(sender) > 0) { args.critAdd += 2f; } } } internal class FlowerCrown : ItemBase { public static float shieldPercentBase = 0.12f; public static float rechargeRateIncrease = 1.5f; private float moveSpeedIncreaseBase = 0.18f; private float moveSpeedIncreaseStack = 0.18f; private int armorIncreaseBase = 20; private int armorIncreaseStack = 30; public override string ItemName => "Flower Crown"; public override string ItemLangTokenName => "FLOWERCROWN"; public override string ItemPickupDesc => "Increase shield recharge rate. Gain armor while shields are active, or gain movement speed."; public override string ItemFullDescription => "Gain a shield equal to " + Tools.ConvertDecimal(shieldPercentBase) + " of your maximum health. Reduces shield recharge delay " + $"by {rechargeRateIncrease}s. " + "While shields are active, increase " + $"armor by {armorIncreaseBase} " + $"(+{armorIncreaseStack} per stack). " + "While shields are down, increase movement speed by " + Tools.ConvertDecimal(moveSpeedIncreaseBase) + " (+" + Tools.ConvertDecimal(moveSpeedIncreaseStack) + " per stack). "; public override string ItemLore => "Order: Flower Crown\r\nTracking Number: 10***********\r\nEstimated Delivery: 11/02/2056\r\nShipping Method: Priority/Fragile\r\nShipping Address: Floor 16, Spiral Gardens, Earth\r\nShipping Details:\r\n\r\nThank you for always sending us gifts. I made some of them into this flower crown for you. Wearing it makes me feel strong, like nothing can get me down. Hopefully it does the same for you! <3\r\n"; public override ItemTier Tier => (ItemTier)1; public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)3 }; public override GameObject ItemModel => ItemBase.LoadDropPrefab("mdlFlowerCrown"); public override Sprite ItemIcon => ItemBase.LoadItemIcon("texIconFlowerCrown"); public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown return new ItemDisplayRuleDict(Array.Empty()); } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown StatHooks.GetMoreStatCoefficients += new MoreStatHookEventHandler(FlowerCrownRecharge); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(FlowerCrownStats); } private void FlowerCrownRecharge(CharacterBody sender, MoreStatHookEventArgs args) { if (GetCount(sender) > 0) { args.shieldDelaySecondsIncreaseAddPreMult -= rechargeRateIncrease; } } private void FlowerCrownStats(CharacterBody sender, StatHookEventArgs args) { int count = GetCount(sender); if (count <= 0) { return; } HealthComponent healthComponent = sender.healthComponent; if ((Object)(object)healthComponent != (Object)null) { args.baseShieldAdd += sender.maxHealth * shieldPercentBase; if (Fuse.HasShield(healthComponent)) { args.armorAdd += (float)(armorIncreaseBase + armorIncreaseStack * (count - 1)); } else { args.moveSpeedMultAdd += moveSpeedIncreaseBase + moveSpeedIncreaseStack * (float)(count - 1); } } } } public class Slungus : ItemBase { public static GameObject slungusSlowFieldPrefab; public static BuffDef slungusBuff; public static float slungusWaitTime = 0.2f; public float movespeedIncreaseBase = 0.2f; public float movespeedIncreaseStack = 0.3f; public static float radiusBase = 24f; public static float radiusStack = 0f; public float projectileSlowCoefficient = 0.2f; public override ExpansionDef RequiredExpansion => SharedBase.SotvExpansionDef(); public override string ItemName => "Slumbering Spores"; public override string ItemLangTokenName => "SLUNGUS"; public override string ItemPickupDesc => "Standing still shelters you, slowing nearby enemies and projectiles. Move faster until hit."; public override string ItemFullDescription => "While stationary, create a sheltering " + $"stasis field reaching {radiusBase}m around you, " + "slowing nearby enemes and projectiles by " + Tools.ConvertDecimal(1f - projectileSlowCoefficient) + ". Move " + Tools.ConvertDecimal(movespeedIncreaseBase) + " faster (" + Tools.ConvertDecimal(movespeedIncreaseStack) + " per stack) until the next time you get hit."; public override string ItemLore => "Order: Lay-Z Mushroom Travel Buddy\r\nTracking Number: 58***********\r\nEstimated Delivery: 09/23/2056\r\nShipping Method: Priority/Biological\r\nShipping Address: 444 Slate Drive, Mars\r\nShipping Details:\r\n\r\nThank you for your purchase!\r\n\r\nDirections:\r\nTurn nozzle to ‘open’. Spores will disperse into the air, causing time to warp and pass slower, thus shortening your wait as the rest of reality will be experiencing time faster. It may take some time for the warping effects to occur; leave the spore bottle in one area to maximize spore count. If traveling in a small enclosed space, the spores may eventually fill the entire area. Ventilate regularly to prevent oversaturation.\r\nTo end time warp effect, close nozzle and leave or ventilate the affected area. Always close nozzle before leaving affected area; partial bodily exposure to time warpage may have unwanted effects.\r\nNote- you may experience time normally for several seconds or minutes after the warping begins; this is normal. Simply wait for time to slow for you too (the slow-moving objects will resume their normal speed and unaffected objects will appear to speed up) and then happy waiting!\r\n\r\nWarnings:\r\nObjects appear to move slower, but carry the same force as they would normally. Do not interact with normally fast moving or forceful objects in an unsafe manner.\r\nThe affected area experiences lowered temperature; you may want to wear warm clothes or turn your heater up. Thermometers do not accurately measure temperature in affected area; assume practical temperatures to be up to 50 degrees lower than measured.\r\nDo not open bottle. Handle with extreme care. Ventilate regularly.\r\n\r\nFUN-GUYS Inc. is not liable for any illness, injury, death, extended or permanent change in time perception, spacial warping, mania or lethargy, hallucination, paranoia, acute panic attack, or otherwise dissatisfactory results. All purchases are final."; public override ItemTier Tier => (ItemTier)1; public override ItemTag[] ItemTags { get { ItemTag[] array = new ItemTag[3]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); return (ItemTag[])(object)array; } } public override GameObject ItemModel => ItemBase.LoadDropPrefab("mdlSlungus"); public override Sprite ItemIcon => ItemBase.LoadItemIcon("texIconSlungus"); public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Init() { //IL_0011: 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_002d: Unknown result type (might be due to invalid IL or missing references) ShelterUtilsModule.UseCustomShelters = true; slungusBuff = Content.CreateAndAddBuff("bdSlungusActive", Addressables.LoadAssetAsync((object)"RoR2/Base/ElementalRings/texBuffElementalRingsReadyIcon.tif").WaitForCompletion(), new Color(0.9f, 0.9f, 0f), canStack: false, isDebuff: false, (StackingDisplayMethod)0); CreateSlowField(); base.Init(); } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown CharacterBody.OnInventoryChanged += new hook_OnInventoryChanged(AddItemBehavior); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(SlungusDamage); HealthComponent.TakeDamageProcess += new hook_TakeDamageProcess(RemoveSlungusBuff); } private void CreateSlowField() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) GameObject val = Addressables.LoadAssetAsync((object)"RoR2/DLC1/Railgunner/RailgunnerMineAltDetonated.prefab").WaitForCompletion(); slungusSlowFieldPrefab = PrefabAPI.InstantiateClone(val, "SlungusSlowField"); SlowDownProjectiles component = slungusSlowFieldPrefab.GetComponent(); component.slowDownCoefficient = projectileSlowCoefficient; BuffWard component2 = slungusSlowFieldPrefab.GetComponent(); component2.expires = false; component2.expireDuration = 10f; component2.radius = radiusBase; ShelterProviderBehavior val2 = slungusSlowFieldPrefab.AddComponent(); if (Object.op_Implicit((Object)(object)val2)) { val2.fallbackRadius = radiusBase; } } private void RemoveSlungusBuff(orig_TakeDamageProcess orig, HealthComponent self, DamageInfo damageInfo) { orig.Invoke(self, damageInfo); if (NetworkServer.active && !damageInfo.rejected && (Object)(object)self != (Object)null && self.alive) { CharacterBody body = self.body; if (body.HasBuff(slungusBuff)) { body.RemoveBuff(slungusBuff); } } } private void SlungusDamage(CharacterBody sender, StatHookEventArgs args) { Inventory inventory = sender.inventory; if (Object.op_Implicit((Object)(object)inventory) && sender.HasBuff(slungusBuff)) { int count = GetCount(sender); args.moveSpeedMultAdd += movespeedIncreaseBase + movespeedIncreaseStack * (float)(count - 1); } } private void AddItemBehavior(orig_OnInventoryChanged orig, CharacterBody self) { orig.Invoke(self); if (NetworkServer.active) { self.AddItemBehavior(GetCount(self)); } } } public class SlungusItemBehavior : ItemBehavior { public static float slungusBuffReapplicationTime = 1f; private float buffTimer = 0f; public GameObject slungusFieldInstance; public float radius => Slungus.radiusBase + Slungus.radiusStack * (float)(base.stack - 1); private void FixedUpdate() { if (NetworkServer.active) { float notMovingStopwatch = base.body.notMovingStopwatch; if (base.stack > 0 && notMovingStopwatch >= Slungus.slungusWaitTime) { EnableSlungus(); } else { DisableSlungus(); } } } private void EnableSlungus() { //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) if (!base.body.HasBuff(Slungus.slungusBuff)) { buffTimer -= Time.fixedDeltaTime; if (buffTimer <= 0f) { buffTimer = slungusBuffReapplicationTime; GrantSlungusBuff(); } } if (!Object.op_Implicit((Object)(object)slungusFieldInstance)) { slungusFieldInstance = Object.Instantiate(Slungus.slungusSlowFieldPrefab, base.body.transform); TeamComponent component = ((Component)base.body).GetComponent(); TeamIndex teamIndex = component.teamIndex; slungusFieldInstance.GetComponent().teamIndex = teamIndex; ProjectileController component2 = slungusFieldInstance.GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { component2.Networkowner = ((Component)base.body).gameObject; } UpdateSlungusRadius(); NetworkServer.Spawn(slungusFieldInstance); if (!base.body.HasBuff(Slungus.slungusBuff)) { buffTimer = slungusBuffReapplicationTime; GrantSlungusBuff(); } } } private void GrantSlungusBuff() { if (((NetworkBehaviour)base.body).hasAuthority) { base.body.AddBuff(Slungus.slungusBuff); } } private void UpdateSlungusRadius() { BuffWard component = slungusFieldInstance.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.radius = radius; } SphereCollider component2 = slungusFieldInstance.GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { component2.radius = radius; } } private void DisableSlungus() { if (Object.op_Implicit((Object)(object)slungusFieldInstance)) { Object.Destroy((Object)(object)slungusFieldInstance, 0.5f); } } private void OnDisable() { DisableSlungus(); } } internal class VoidElixir : ItemBase { public static GameObject infernoAuraPrefab; [AutoConfig("Inferno Duration", 20f)] public static float infernoDuration = 20f; [AutoConfig("Inferno Radius Base", 25f)] public static float infernoRadiusBase = 25f; [AutoConfig("Inferno Radius Stack", 5f)] public static float infernoRadiusStack = 5f; [AutoConfig("Inferno Tick Interval", 0.5f)] public static float infernoTickInterval = 0.5f; [AutoConfig("Inferno Tick Damage Coefficient", 1f)] public static float infernoTickDamageCoeff = 1f; [AutoConfig("Inferno Ignite Damage Coefficient", 2f)] public static float infernoIgniteDamageCoeff = 2f; [AutoConfig("Inferno Ignite Duration", 3f)] public static float infernoIgniteDuration = 3f; [AutoConfig("Consumed Regen Bonus", 2f)] public static float regenBuff = 2f; [AutoConfig("Consumed Armor Bonus", 8)] public static int armorBuff = 8; public override ExpansionDef RequiredExpansion => SharedBase.SotvExpansionDef(); public override bool isEnabled => false; public override string ItemName => "Hadal Brine or whatevber"; public override string ItemLangTokenName => "INFERNOPOTION"; public override string ItemPickupDesc => "At low health, summon a ring of fire. Usable once per stage."; public override string ItemFullDescription => "Taking damage to below " + Language.Styling.RedText(Tools.ConvertDecimal(0.25f) + " health") + " " + Language.Styling.UtilityColor("consumes") + " this item, " + $"summoning a ring of fire for {infernoDuration} seconds, " + $"which continuously ignites enemies within {infernoRadiusBase}m (+Z per stack). " + "Each empty bottle increases " + Language.Styling.HealingColor("armor") + " by " + Language.Styling.HealingColor(armorBuff.ToString()) + " and " + Language.Styling.HealingColor("base health regeneration") + " by " + Language.Styling.HealingColor(regenBuff + " hp/s") + ". Regenerates at the start of each stage."; public override string ItemLore => ""; public override ItemTier Tier => (ItemTier)7; public override ItemTag[] ItemTags { get { ItemTag[] array = new ItemTag[3]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); return (ItemTag[])(object)array; } } public override GameObject ItemModel => Resources.Load("prefabs/NullModel"); public override Sprite ItemIcon => Resources.Load("textures/miscicons/texWIPIcon"); public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown HealthComponent.UpdateLastHitTime += new hook_UpdateLastHitTime(ElixirHook); } private void ElixirHook(orig_UpdateLastHitTime orig, HealthComponent self, float damageValue, Vector3 damagePosition, bool damageIsSilent, GameObject attacker, bool delayedDamage, bool firstHitOfDelayedDamage) { //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Expected O, but got Unknown CharacterBody body = self.body; if (NetworkServer.active && Object.op_Implicit((Object)(object)body) && damageValue > 0f) { int count = GetCount(body); if (count > 0 && self.isHealthLow) { Util.CleanseBody(body, true, false, true, true, true, true); TransformPotions(count, body); EffectData val = new EffectData { origin = ((Component)self).transform.position }; val.SetNetworkedObjectReference(((Component)self).gameObject); EffectManager.SpawnEffect(LegacyResourcesAPI.Load("Prefabs/Effects/HealingPotionEffect"), val, true); } } orig.Invoke(self, damageValue, damagePosition, damageIsSilent, attacker, delayedDamage, firstHitOfDelayedDamage); } private void TransformPotions(int count, CharacterBody body) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) Inventory inventory = body.inventory; inventory.RemoveItem(ItemBase.instance.ItemsDef, count); inventory.GiveItem(ItemBase.instance.ItemsDef, count); CharacterMasterNotificationQueue.SendTransformNotification(body.master, ItemBase.instance.ItemsDef.itemIndex, ItemBase.instance.ItemsDef.itemIndex, (TransformationType)0); } public override void Init() { CreateInfernoAura(); base.Init(); } private static void CreateInfernoAura() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_005c: 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) infernoAuraPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)"RoR2/Base/Icicle/IcicleAura.prefab").WaitForCompletion(), "InfernoPotionAura", true); Content.AddNetworkedObjectPrefab(infernoAuraPrefab); DotWard val = null; BuffWard component = infernoAuraPrefab.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { Object.Destroy((Object)(object)component); val = infernoAuraPrefab.AddComponent(); val.dotIndex = (DotIndex)1; val.damageCoefficient = infernoIgniteDamageCoeff; ((BuffWard)val).rangeIndicator = null; ((BuffWard)val).radius = 0f; ((BuffWard)val).expireDuration = 0f; ((BuffWard)val).interval = infernoTickInterval; ((BuffWard)val).buffDuration = infernoIgniteDuration; ((BuffWard)val).buffTimer = infernoTickInterval; ((BuffWard)val).shape = (BuffWardShape)0; ((BuffWard)val).invertTeamFilter = true; ((BuffWard)val).requireGrounded = false; } IcicleAuraController component2 = infernoAuraPrefab.GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { component2.icicleBaseRadius = infernoRadiusBase; component2.icicleRadiusPerIcicle = infernoRadiusStack; component2.icicleDuration = infernoDuration; component2.baseIcicleMax = 1; component2.icicleMaxPerStack = 0; component2.buffWard = (BuffWard)(object)val; } } } internal class VoidElixirConsumed : ItemBase { public override ExpansionDef RequiredExpansion => SharedBase.SotvExpansionDef(); public override bool lockEnabled => true; private static float armorBoost => VoidElixir.armorBuff; private static float regenBoost => VoidElixir.regenBuff; public override string ItemName => "A"; public override string ItemLangTokenName => "INFERNOPOTIONEMPTY"; public override string ItemPickupDesc => "An empty flask. You feel iron-skinned."; public override string ItemFullDescription => "A"; public override string ItemLore => "A"; public override ItemTier Tier => (ItemTier)5; public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)20 }; public override GameObject ItemModel => Resources.Load("prefabs/NullModel"); public override Sprite ItemIcon => Resources.Load("textures/miscicons/texWIPIcon"); public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown CharacterMaster.OnServerStageBegin += new hook_OnServerStageBegin(TryRegenerateElixir); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(BerserkerBrewBuff); } private void BerserkerBrewBuff(CharacterBody sender, StatHookEventArgs args) { int count = GetCount(sender); if (count > 0) { args.armorAdd += armorBoost * (float)count; args.baseRegenAdd += regenBoost * (float)count * (1f + 0.2f * sender.level); } } private void TryRegenerateElixir(orig_OnServerStageBegin orig, CharacterMaster self, Stage stage) { orig.Invoke(self, stage); if (NetworkServer.active) { int count = GetCount(self); if (count > 0) { TransformPotions(count, self); } } } private void TransformPotions(int count, CharacterMaster master) { //IL_0037: 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) Inventory inventory = master.inventory; inventory.RemoveItem(ItemBase.instance.ItemsDef, count); inventory.GiveItem(ItemBase.instance.ItemsDef, count); CharacterMasterNotificationQueue.SendTransformNotification(master, ItemBase.instance.ItemsDef.itemIndex, ItemBase.instance.ItemsDef.itemIndex, (TransformationType)5); } } internal class VoidHappyMask : ItemBase { public float procChance = 7f; public int baseInfestors = 2; public int stackInfestors = 1; public static SpawnCard infestorSpawnCard = LegacyResourcesAPI.Load("SpawnCards/CharacterSpawnCards/cscVoidInfestor"); public override string ConfigName => "Items : Forgotten Facade"; public override string ItemName => "Forgotten Facade"; public override string ItemLangTokenName => "VOIDHAPPIESTMASK"; public override string ItemPickupDesc => "Chance on killing an enemy to summon void infestors. Corrupts all Happiest Masks."; public override string ItemFullDescription => "Killing monsters has a " + $"{procChance}% chance " + $"to spawn {baseInfestors} (+{stackInfestors} per stack) " + "void infestors in their place. Corrupts all Happiest Masks."; public override string ItemLore => ""; public override ItemTier Tier => (ItemTier)8; public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[2] { (ItemTag)6, (ItemTag)3 }; public override GameObject ItemModel => ItemBase.LoadDropPrefab("mdlVoidHappyMask"); public override Sprite ItemIcon => ItemBase.LoadItemIcon("texIconVoidHappyMask"); public override ExpansionDef RequiredExpansion => SharedBase.SotvExpansionDef(); public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown ContagiousItemManager.Init += new hook_Init(CreateTransformation); GlobalEventManager.OnCharacterDeath += new hook_OnCharacterDeath(CreateVoidInfestors); } private void CreateVoidInfestors(orig_OnCharacterDeath orig, GlobalEventManager self, DamageReport damageReport) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Invalid comparison between Unknown and I4 //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)damageReport.attackerBody != (Object)null && (Object)(object)damageReport.attackerMaster != (Object)null && (int)damageReport.victimTeamIndex != 4) { int count = GetCount(damageReport.attackerBody); if (count > 0 && Util.CheckRoll(procChance, damageReport.attackerMaster)) { int num = baseInfestors + stackInfestors * (count - 1); for (int i = 0; i < num; i++) { SpawnInfo spawnInfo = default(SpawnInfo); spawnInfo.explicitSpawnPosition = damageReport.victimBody.transform; spawnInfo.spawnCard = Addressables.LoadAssetAsync((object)"RoR2/DLC1/EliteVoid/cscVoidInfestor.asset").WaitForCompletion(); Spawn(ref spawnInfo); } } } orig.Invoke(self, damageReport); } private void Spawn(ref SpawnInfo spawnInfo) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_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_0018: 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_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_0041: Expected O, but got Unknown //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Expected O, but got Unknown DirectorPlacementRule val = new DirectorPlacementRule { placementMode = (PlacementMode)0, minDistance = 0f, maxDistance = 1000f, position = spawnInfo.explicitSpawnPosition.position, spawnOnTarget = spawnInfo.explicitSpawnPosition }; DirectorSpawnRequest val2 = new DirectorSpawnRequest(spawnInfo.spawnCard, val, RoR2Application.rng); val2.ignoreTeamMemberLimit = true; val2.teamIndexOverride = (TeamIndex)4; DirectorCore.instance.TrySpawnObject(val2); } private void CreateTransformation(orig_Init orig) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: 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) Pair val = default(Pair); val.itemDef1 = Items.GhostOnKill; val.itemDef2 = ItemBase.instance.ItemsDef; Pair val2 = val; ItemCatalog.itemRelationships[ItemRelationshipTypes.ContagiousItem] = CollectionExtensions.AddToArray(ItemCatalog.itemRelationships[ItemRelationshipTypes.ContagiousItem], val2); orig.Invoke(); } } internal class VoidIgnitionTank : ItemBase { public override bool lockEnabled => true; public override bool isEnabled => false; public override string ItemName => "Supercoagulant Floater"; public override string ItemLangTokenName => "VOIDIGNITIONTANK"; public override string ItemPickupDesc => "Bleed lasts longer. Heavy hits inflict multiple stacks of bleed."; public override string ItemFullDescription => "later"; public override string ItemLore => ""; public override ItemTier Tier => (ItemTier)7; public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)1 }; public override GameObject ItemModel => LegacyResourcesAPI.Load("prefabs/NullModel"); public override Sprite ItemIcon => LegacyResourcesAPI.Load("textures/miscicons/texWIPIcon"); public override ExpansionDef RequiredExpansion => SharedBase.SotvExpansionDef(); public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown ContagiousItemManager.Init += new hook_Init(CreateTransformation); } private void CreateTransformation(orig_Init orig) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: 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) Pair val = default(Pair); val.itemDef1 = Items.StrengthenBurn; val.itemDef2 = ItemBase.instance.ItemsDef; Pair val2 = val; ItemCatalog.itemRelationships[ItemRelationshipTypes.ContagiousItem] = CollectionExtensions.AddToArray(ItemCatalog.itemRelationships[ItemRelationshipTypes.ContagiousItem], val2); orig.Invoke(); } } } namespace SwanSongExtended.Items.Helpers { internal class Attackspeed : ItemBase { private float attackSpeedBuff = 0.1f; public override bool lockEnabled => true; public override string ConfigName => ""; public override AssetBundle assetBundle => null; public override string ItemName => "AttackspeedHelper"; public override string ItemLangTokenName => "ATTACKSPEEDHELPER"; public override string ItemPickupDesc => ""; public override string ItemFullDescription => ""; public override string ItemLore => ""; public override ItemTier Tier => (ItemTier)5; public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)12 }; public override GameObject ItemModel => LegacyResourcesAPI.Load("prefabs/NullModel"); public override Sprite ItemIcon => LegacyResourcesAPI.Load("textures/miscicons/texWIPIcon"); public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(AttackSpeedUp); } private void AttackSpeedUp(CharacterBody sender, StatHookEventArgs args) { int count = GetCount(sender); if (count > 0) { args.attackSpeedMultAdd += attackSpeedBuff * (float)count; } } } } namespace SwanSongExtended.Interactables { public abstract class InteractableBase : InteractableBase where T : InteractableBase { public static T instance { get; private set; } public InteractableBase() { if (instance != null) { throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting ItemBoilerplate/Item was instantiated twice"); } instance = this as T; } } public abstract class InteractableBase : SharedBase { public GameObject interactablePrefab; public CustomInteractable customInteractable = new CustomInteractable(); public PurchaseInteraction InteractionComponent; public static InteractableSpawnCard interactableSpawnCard; public static DirectorCard interactableDirectorCard; public override AssetBundle assetBundle => SwanSongPlugin.mainAssetBundle; public override string ConfigName => "Interactables : " + InteractableName; public abstract string InteractableName { get; } public abstract string InteractableContext { get; } public abstract string InteractableLangToken { get; } public abstract GameObject InteractableModel { get; } public abstract string modelName { get; } public abstract string prefabName { get; } public abstract bool ShouldCloneModel { get; } public abstract InteractableCategory category { get; } public abstract CostTypeIndex costTypeIndex { get; } public abstract float voidSeedWeight { get; } public abstract int normalWeight { get; } public abstract int favoredWeight { get; } public abstract int spawnCost { get; } public abstract int interactionCost { get; } public abstract string[] validScenes { get; } public abstract string[] favoredScenes { get; } public abstract SimpleInteractableData InteractableData { get; } public override void Init() { base.Init(); CreateInteractablePrefab(); CreateInteractable(); } private void CreateInteractable() { (DirectorCard, InteractableSpawnCard) tuple = CreateInteractableSpawnCard(); if (favoredScenes == null || favoredScenes.Length == 0) { customInteractable.CreateCustomInteractable(tuple.Item2, tuple.Item1, validScenes); return; } (DirectorCard, InteractableSpawnCard) tuple2 = CreateInteractableSpawnCard(isFavored: true); customInteractable.CreateCustomInteractable(tuple.Item2, tuple.Item1, validScenes, tuple2.Item2, tuple2.Item1, favoredScenes); } public override void Lang() { LanguageAPI.Add("2R4R_INTERACTABLE_" + InteractableLangToken + "_NAME", InteractableName); LanguageAPI.Add("2R4R_INTERACTABLE_" + InteractableLangToken + "_CONTEXT", InteractableContext); } public abstract UnityAction GetInteractionAction(PurchaseInteraction interaction); public virtual Sprite GetPingIcon() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) return Addressables.LoadAssetAsync((object)"RoR2/Base/Common/MiscIcons/texShrineIconOutlined.png").WaitForCompletion(); } public void CreateInteractablePrefab() { //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Expected O, but got Unknown //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Expected O, but got Unknown //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Expected O, but got Unknown //IL_0405: Unknown result type (might be due to invalid IL or missing references) //IL_04d0: Unknown result type (might be due to invalid IL or missing references) //IL_04fe: Unknown result type (might be due to invalid IL or missing references) //IL_0500: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)InteractableModel == (Object)null) { Debug.Log((object)"interactableModel null :("); return; } if (!ShouldCloneModel) { interactablePrefab = InteractableModel; } else { interactablePrefab = PrefabAPI.InstantiateClone(InteractableModel, prefabName, true); } interactablePrefab.AddComponent(); PurchaseInteraction component = interactablePrefab.GetComponent(); if ((Object)(object)component != (Object)null) { Object.Destroy((Object)(object)component); } InteractionComponent = interactablePrefab.AddComponent(); InteractionComponent.displayNameToken = "2R4R_INTERACTABLE_" + InteractableLangToken + "_NAME"; InteractionComponent.contextToken = "2R4R_INTERACTABLE_" + InteractableLangToken + "_CONTEXT"; InteractionComponent.costType = costTypeIndex; InteractionComponent.automaticallyScaleCostWithDifficulty = InteractableData.automaticallyScaleCostWithDifficulty; InteractionComponent.cost = interactionCost; InteractionComponent.available = true; InteractionComponent.SetAvailable(true); InteractionComponent.setUnavailableOnTeleporterActivated = InteractableData.unavailableDuringTeleporter; InteractionComponent.isShrine = InteractableData.isShrine; InteractionComponent.isGoldShrine = false; InteractionComponent.onPurchase = new PurchaseEvent(); InteractionComponent.saleStarCompatible = InteractableData.saleStarCompatible; UnityAction interactionAction = GetInteractionAction(InteractionComponent); if (interactionAction != null) { Debug.Log((object)("adding purchase action for " + InteractableName)); ((UnityEvent)(object)InteractionComponent.onPurchase).AddPersistentListener(interactionAction); } PingInfoProvider component2 = interactablePrefab.GetComponent(); if ((Object)(object)component2 == (Object)null) { component2 = interactablePrefab.AddComponent(); component2.pingIconOverride = GetPingIcon(); } GenericDisplayNameProvider val = interactablePrefab.GetComponent(); if ((Object)(object)val == (Object)null) { val = interactablePrefab.AddComponent(); } val.displayToken = "2R4R_INTERACTABLE_" + InteractableLangToken + "_NAME"; if (normalWeight > 0 || favoredWeight > 0) { ClassicStageInfo.RebuildCards += new hook_RebuildCards(AddInteractable); } if (voidSeedWeight > 0f) { CampDirector.SelectCard += new hook_SelectCard(VoidCampAddInteractable); } Collider componentInChildren = interactablePrefab.GetComponentInChildren(); if ((Object)(object)componentInChildren == (Object)null) { Debug.Log((object)"child null"); return; } EntityLocator val2 = interactablePrefab.GetComponent(); if ((Object)(object)val2 == (Object)null) { Debug.Log((object)"entitylocator null, adding component"); val2 = interactablePrefab.AddComponent(); } if ((Object)(object)val2 != (Object)null) { val2.entity = interactablePrefab; ModelLocator component3 = interactablePrefab.GetComponent(); if ((Object)(object)component3 == (Object)null) { Debug.Log((object)"modellocator null, adding component"); component3 = interactablePrefab.AddComponent(); component3.modelTransform = interactablePrefab.transform.Find(modelName); component3.modelBaseTransform = component3.modelTransform; component3.dontDetatchFromParent = true; component3.autoUpdateModelTransform = true; Highlight val3 = interactablePrefab.GetComponent(); if ((Object)(object)val3 == (Object)null) { Debug.Log((object)"highlight null, adding component"); val3 = interactablePrefab.AddComponent(); } if ((Object)(object)val3 != (Object)null) { val3.targetRenderer = (Renderer)(object)(from x in interactablePrefab.GetComponentsInChildren() where ((Object)((Component)x).gameObject).name.Contains(modelName) select x).FirstOrDefault(); val3.strength = 1f; val3.highlightColor = (HighlightColor)0; } HologramProjector val4 = interactablePrefab.GetComponent(); if ((Object)(object)val4 == (Object)null) { Debug.Log((object)"hologramProjector null, adding component"); val4 = interactablePrefab.AddComponent(); } if ((Object)(object)val4 != (Object)null) { val4.hologramPivot = interactablePrefab.transform.Find("HologramPivot"); val4.displayDistance = 10f; val4.disableHologramRotation = false; } ChildLocator val5 = interactablePrefab.GetComponent(); if ((Object)(object)val5 == (Object)null) { Debug.Log((object)"childLocator null, adding component"); val5 = interactablePrefab.AddComponent(); } if ((Object)(object)val5 != (Object)null) { val5.transformPairs = (NameTransformPair[])(object)new NameTransformPair[1] { new NameTransformPair { name = "FireworkOrigin", transform = interactablePrefab.transform.Find("FireworkEmitter") } }; Debug.Log((object)"interactable registered"); } } } PrefabAPI.RegisterNetworkPrefab(interactablePrefab); } public (DirectorCard directorCard, InteractableSpawnCard interactableSpawnCard) CreateInteractableSpawnCard(bool isFavored = false) { //IL_0021: 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_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Expected O, but got Unknown interactableSpawnCard = ScriptableObject.CreateInstance(); ((SpawnCard)interactableSpawnCard).directorCreditCost = spawnCost; ((SpawnCard)interactableSpawnCard).eliteRules = (EliteRules)0; ((SpawnCard)interactableSpawnCard).sendOverNetwork = true; ((SpawnCard)interactableSpawnCard).occupyPosition = true; interactableSpawnCard.orientToFloor = InteractableData.orientToFloor; interactableSpawnCard.skipSpawnWhenSacrificeArtifactEnabled = InteractableData.sacrificeWeightScalar <= 0f; interactableSpawnCard.weightScalarWhenSacrificeArtifactEnabled = InteractableData.sacrificeWeightScalar; interactableSpawnCard.maxSpawnsPerStage = InteractableData.maxSpawnsPerStage; ((SpawnCard)interactableSpawnCard).hullSize = (HullClassification)0; ((SpawnCard)interactableSpawnCard).prefab = interactablePrefab; ((SpawnCard)interactableSpawnCard).nodeGraphType = (GraphType)0; ((Object)interactableSpawnCard).name = "2R4R_INTERACTABLE_" + InteractableLangToken + "_NAME"; interactableDirectorCard = new DirectorCard { selectionWeight = (isFavored ? favoredWeight : normalWeight), spawnCard = (SpawnCard)(object)interactableSpawnCard, preventOverhead = false, minimumStageCompletions = InteractableData.minimumStageCompletions }; Debug.Log((object)("Created spawncard for 2R4R_INTERACTABLE_" + InteractableLangToken + "_NAME; " + ((Object)interactableDirectorCard.spawnCard).name + ", " + ((Object)interactableSpawnCard).name)); return (interactableDirectorCard, interactableSpawnCard); } public DirectorCard VoidCampAddInteractable(orig_SelectCard orig, CampDirector self, WeightedSelection deck, int maxCost) { //IL_0070: Unknown result type (might be due to invalid IL or missing references) if (voidSeedWeight <= 0f) { Debug.LogWarning((object)("weight was 0; " + ((Object)customInteractable.spawnCard).name)); return orig.Invoke(self, deck, maxCost); } bool flag = false; if (((Object)self).name == "Camp 1 - Void Monsters & Interactables") { for (int num = deck.Count - 1; num >= 0; num--) { if (((Object)deck.GetChoice(num).value.spawnCard).name == ((Object)customInteractable.spawnCard).name) { flag = true; break; } } if (!flag) { Debug.LogWarning((object)$"added {((Object)interactableDirectorCard.spawnCard).name}/{customInteractable.directorCard} to void seed"); deck.AddChoice(customInteractable.directorCard, voidSeedWeight); } } return orig.Invoke(self, deck, maxCost); } public void AddInteractable(orig_RebuildCards orig, ClassicStageInfo self, DirectorCardCategorySelection forcedMonsterCategory, DirectorCardCategorySelection forcedInteractableCategory) { //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_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Expected I4, but got Unknown //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Expected I4, but got Unknown orig.Invoke(self, forcedMonsterCategory, forcedInteractableCategory); Scene activeScene; if (customInteractable.HasFavoredStages()) { List list = customInteractable.favoredScenes.ToList(); activeScene = SceneManager.GetActiveScene(); if (list.Contains(((Scene)(ref activeScene)).name)) { self.interactableCategories.AddCard((int)category, customInteractable.directorCardFavored); return; } } List list2 = customInteractable.validScenes.ToList(); activeScene = SceneManager.GetActiveScene(); if (list2.Contains(((Scene)(ref activeScene)).name)) { self.interactableCategories.AddCard((int)category, customInteractable.directorCard); } } public static GameObject LoadInteractableModel(string prefabName = "", AssetBundle bundle = null) { return SwanSongPlugin.TryLoadFromBundle("Assets/Models/Interactables/" + prefabName + ".prefab", bundle); } } public class SimpleInteractableData { internal bool addToHackBlacklist; internal bool automaticallyScaleCostWithDifficulty; internal bool unavailableDuringTeleporter; internal bool isShrine; internal bool orientToFloor; internal bool saleStarCompatible; internal float sacrificeWeightScalar; internal int minimumStageCompletions; internal int maxSpawnsPerStage; public SimpleInteractableData(bool addToHackBlacklist = false, bool automaticallyScaleCostWithDifficulty = false, bool unavailableDuringTeleporter = true, bool isShrine = false, bool orientToFloor = true, bool saleStarCompatible = false, int minimumStageCompletions = 0, int sacrificeWeightScalar = 1, int maxSpawnsPerStage = -1) { this.addToHackBlacklist = addToHackBlacklist; this.automaticallyScaleCostWithDifficulty = automaticallyScaleCostWithDifficulty; this.unavailableDuringTeleporter = unavailableDuringTeleporter; this.isShrine = isShrine; this.orientToFloor = orientToFloor; this.saleStarCompatible = saleStarCompatible; this.minimumStageCompletions = minimumStageCompletions; this.sacrificeWeightScalar = sacrificeWeightScalar; this.maxSpawnsPerStage = maxSpawnsPerStage; } } public class CustomInteractable { public InteractableSpawnCard spawnCard; public DirectorCard directorCard; public InteractableSpawnCard spawnCardFavored; public DirectorCard directorCardFavored; public string[] validScenes; public string[] favoredScenes; public bool hasFavoredStages = false; public ExpansionDef requiredExpansionDef = null; public CustomInteractable CreateCustomInteractable(InteractableSpawnCard spawnCard, DirectorCard directorCard, string[] validScenes) { this.spawnCard = spawnCard; this.directorCard = directorCard; this.validScenes = validScenes; return this; } public CustomInteractable CreateCustomInteractable(InteractableSpawnCard spawnCard, DirectorCard directorCard, string[] validScenes, InteractableSpawnCard spawnCardF, DirectorCard directorCardF, string[] favoredScenes) { this.spawnCard = spawnCard; this.directorCard = directorCard; this.validScenes = validScenes; spawnCardFavored = spawnCardF; directorCardFavored = directorCardF; this.favoredScenes = favoredScenes; hasFavoredStages = true; return this; } public bool HasFavoredStages() { return hasFavoredStages; } } internal class CombatShrineLunar : InteractableBase { public static string baseUseMessage = "SHRINE_LUNARGALLERY_USE_MESSAGE"; private GameObject enemySpawned; private ItemDef[] itemPool; public static ItemIndex itemToGive; public override string InteractableName => "Lunar Gallery"; public override string InteractableContext => "eat my transgendence nerd"; public override string InteractableLangToken => "LUNAR_GALLERY"; public override GameObject InteractableModel => InteractableBase.LoadInteractableModel(modelName); public override bool ShouldCloneModel => false; public override float voidSeedWeight => 0f; public override int normalWeight => 10; public override int spawnCost => 20; public override CostTypeIndex costTypeIndex => (CostTypeIndex)0; public override int interactionCost => 0; public override SimpleInteractableData InteractableData => new SimpleInteractableData(addToHackBlacklist: false, automaticallyScaleCostWithDifficulty: false, unavailableDuringTeleporter: true, isShrine: true, orientToFloor: false, saleStarCompatible: false, 0, 1, 2); public override string modelName => "mdlLunarGallery"; public override string prefabName => "lunarGallery"; public override InteractableCategory category => (InteractableCategory)4; public override int favoredWeight => 25; public override string[] validScenes => new string[15] { "golemplains", "golemplains2", "snowyforest", "foggyswamp", "goolake", "wispgraveyard", "dampcavesimple", "shipgraveyard", "arena", "artifactworld", "ancientloft", "sulfurpools", "slumberingsatellite", "forgottenhaven", "drybasin" }; public override string[] favoredScenes => new string[6] { "blackbeach", "blackbeach2", "frozenwall", "rootjungle", "skymeadow", "FBLScene" }; public override void Init() { //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_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_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) LanguageAPI.Add(baseUseMessage, "You have invoked {1} in battle."); LanguageAPI.Add(baseUseMessage + "_2P", "{0} has invoked {1} in battle."); base.Init(); SwanSongPlugin.BlacklistSingleItem("GoldOnHit", (ItemTag)4); SwanSongPlugin.BlacklistSingleItem("RepeatHeal", (ItemTag)4); SwanSongPlugin.BlacklistSingleItem("AutoCastEquipment", (ItemTag)4); SwanSongPlugin.BlacklistSingleItem("LunarPrimaryReplacement", (ItemTag)4); SwanSongPlugin.BlacklistSingleItem("LunarUtilityReplacement", (ItemTag)4); SwanSongPlugin.BlacklistSingleItem("LunarSpecialReplacement", (ItemTag)4); SwanSongPlugin.BlacklistSingleItem("LunarTrinket", (ItemTag)4); SwanSongPlugin.BlacklistSingleItem("FocusConvergence", (ItemTag)4); SwanSongPlugin.BlacklistSingleItem("MonstersOnShrineUse", (ItemTag)4); AsyncOperationHandle val = Addressables.LoadAssetAsync((object)RoR2_DLC1_LunarSun.LunarSun_asset); val.Completed += delegate(AsyncOperationHandle ctx) { SwanSongPlugin.BlacklistSingleItem(ctx.Result, (ItemTag)4); }; val = Addressables.LoadAssetAsync((object)RoR2_DLC1_RandomlyLunar.RandomlyLunar_asset); val.Completed += delegate(AsyncOperationHandle ctx) { SwanSongPlugin.BlacklistSingleItem(ctx.Result, (ItemTag)4); }; val = Addressables.LoadAssetAsync((object)RoR2_DLC2_Items_OnLevelUpFreeUnlock.OnLevelUpFreeUnlock_asset); val.Completed += delegate(AsyncOperationHandle ctx) { SwanSongPlugin.BlacklistSingleItem(ctx.Result, (ItemTag)4); }; } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown Run.BuildDropTable += new hook_BuildDropTable(GalleryItemPool); } private void GalleryItemPool(orig_BuildDropTable orig, Run self) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); itemPool = ((IEnumerable)(object)ItemCatalog.allItemDefs).Where((ItemDef item) => (int)item.tier == 3 && !item.ContainsTag((ItemTag)9) && !item.ContainsTag((ItemTag)4)).ToArray(); } public void ChooseItem() { //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) int num = Random.RandomRangeInt(0, itemPool.Length - 1); itemToGive = itemPool[num].itemIndex; } public override UnityAction GetInteractionAction(PurchaseInteraction interaction) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Expected O, but got Unknown //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Expected O, but got Unknown CombatSquad combatSquad = ((Component)interaction).gameObject.AddComponent(); CombatDirector val = ((Component)interaction).gameObject.AddComponent(); val.expRewardCoefficient = 1f; val.goldRewardCoefficient = 1f; val.eliteBias = 0f; val.maximumNumberToSpawnBeforeSkipping = 6; val.teamIndex = (TeamIndex)3; val.shouldSpawnOneWave = true; val.fallBackToStageMonsterCards = true; val.onSpawnedServer = new OnSpawnedServer(); val.combatSquad = combatSquad; ((Behaviour)val).enabled = false; LunarCombatShrineBehavior lunarCombatShrineBehavior = ((Component)interaction).gameObject.AddComponent(); ((ShrineCombatBehavior)lunarCombatShrineBehavior).baseMonsterCredit = 40; ((ShrineCombatBehavior)lunarCombatShrineBehavior).maxPurchaseCount = 1; ((ShrineCombatBehavior)lunarCombatShrineBehavior).monsterCreditCoefficientPerPurchase = 2f; GameObject val2 = new GameObject(); val2.transform.parent = ((Component)interaction).transform; ((ShrineCombatBehavior)lunarCombatShrineBehavior).symbolTransform = val2.transform; return lunarCombatShrineBehavior.OnInteractionBegin; } } public class LunarCombatShrineBehavior : ShrineCombatBehavior { public void OnInteractionBegin(Interactor activator) { //IL_0055: 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_0073: Expected O, but got Unknown if (base.purchaseCount < base.maxPurchaseCount) { ((UnityEvent)(object)base.combatDirector.onSpawnedServer).AddListener((UnityAction)OnGalleryDirectorSpawnServer); InteractableBase.instance.ChooseItem(); CharacterBody component = ((Component)activator).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { string text = ItemCatalog.GetItemDef(CombatShrineLunar.itemToGive)?.nameToken; SubjectFormatChatMessage val = new SubjectFormatChatMessage(); ((SubjectChatMessage)val).subjectAsCharacterBody = component; ((SubjectChatMessage)val).baseToken = CombatShrineLunar.baseUseMessage; val.paramTokens = new string[1] { text }; Chat.SendBroadcastChat((ChatMessageBase)(object)val); } ((ShrineCombatBehavior)this).AddShrineStack(activator); base.purchaseInteraction.SetAvailable(false); } static void OnGalleryDirectorSpawnServer(GameObject masterObject) { CharacterMaster component2 = masterObject.GetComponent(); OnGallerySquadSpawnServer(component2); } static void OnGallerySquadSpawnServer(CharacterMaster master) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)master != (Object)null) { Inventory inventory = master.inventory; if ((Object)(object)inventory != (Object)null) { inventory.GiveItem(CombatShrineLunar.itemToGive, 1); inventory.GiveItem(ItemBase.instance.ItemsDef, 1); inventory.SetEquipmentIndex(Equipment.AffixLunar.equipmentIndex); } } } } } internal class ConstructConstruct : InteractableBase { public class ConstructCombatShrineBehavior : ShrineCombatBehavior { private void OnEnable() { } public void OnInteractionBegin(Interactor activator) { if (base.purchaseCount < base.maxPurchaseCount) { base.chosenDirectorCard = DirectorCards.AlphaConstructNear; ((ShrineCombatBehavior)this).AddShrineStack(activator); base.purchaseInteraction.SetAvailable(false); } } } public override string InteractableName => "Decayed Construct"; public override string InteractableContext => "Kick the Construct"; public override string InteractableLangToken => "CONSTRUCTCONSTRUCT"; public override GameObject InteractableModel => InteractableBase.LoadInteractableModel(modelName); public override string modelName => "mdlConstructConstruct"; public override string prefabName => "constructConstruct"; public override bool ShouldCloneModel => false; public override float voidSeedWeight => 0f; public override int normalWeight => 5; public override int favoredWeight => 0; public override InteractableCategory category => (InteractableCategory)4; public override int spawnCost => 15; public override CostTypeIndex costTypeIndex => (CostTypeIndex)0; public override int interactionCost => 0; public override SimpleInteractableData InteractableData => new SimpleInteractableData(addToHackBlacklist: false, automaticallyScaleCostWithDifficulty: false, unavailableDuringTeleporter: true, isShrine: true, orientToFloor: false, saleStarCompatible: false, 1, 3, 3); public override string[] validScenes => new string[4] { "foggyswamp", "dampcavesimple", "sulfurpools", "drybasin" }; public override string[] favoredScenes => null; public override void Init() { base.Init(); } public override UnityAction GetInteractionAction(PurchaseInteraction interaction) { //IL_0043: 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_0085: Expected O, but got Unknown //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Expected O, but got Unknown CombatSquad combatSquad = ((Component)interaction).gameObject.AddComponent(); CombatDirector val = ((Component)interaction).gameObject.AddComponent(); val.expRewardCoefficient = 1f; val.goldRewardCoefficient = 1f; val.eliteBias = 2f; val.maximumNumberToSpawnBeforeSkipping = 6; val.teamIndex = (TeamIndex)2; val.fallBackToStageMonsterCards = false; val.shouldSpawnOneWave = true; val.skipSpawnIfTooCheap = false; val.increaseSpawnDistanceOnFailure = true; val.goldRewardCoefficient = 1f; val.maxSpawnDistance = float.PositiveInfinity; val.onSpawnedServer = new OnSpawnedServer(); ((UnityEvent)(object)val.onSpawnedServer).AddPersistentListener(OnGalleryDirectorSpawnServer); val.combatSquad = combatSquad; ((Behaviour)val).enabled = false; ConstructCombatShrineBehavior constructCombatShrineBehavior = ((Component)interaction).gameObject.AddComponent(); ((ShrineCombatBehavior)constructCombatShrineBehavior).baseMonsterCredit = 60; ((ShrineCombatBehavior)constructCombatShrineBehavior).maxPurchaseCount = 1; ((ShrineCombatBehavior)constructCombatShrineBehavior).monsterCreditCoefficientPerPurchase = 2f; GameObject val2 = new GameObject(); val2.transform.parent = ((Component)interaction).transform; ((ShrineCombatBehavior)constructCombatShrineBehavior).symbolTransform = val2.transform; return constructCombatShrineBehavior.OnInteractionBegin; static void OnGalleryDirectorSpawnServer(GameObject masterObject) { } } private ExplicitPickupDropTable GenerateWeightedSelection() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) ExplicitPickupDropTable val = ScriptableObject.CreateInstance(); List list = new List(); list.Add(new PickupDefEntry { pickupDef = (Object)(object)ItemBase.instance.ItemsDef, pickupWeight = 1f }); val.pickupEntries = list.ToArray(); return val; } public override void Hooks() { } } internal class EggPile : InteractableBase { [AutoConfig("Hideable Eggs Per Player", 3)] public static int eggsPerPlayer = 3; private Xoroshiro128Plus rng; public override string InteractableName => "Egg"; public override string InteractableContext => "Found an egg"; public override string InteractableLangToken => "EGG_PILE"; public override GameObject InteractableModel => InteractableBase.LoadInteractableModel(modelName); public override string modelName => "mdlEggPile"; public override string prefabName => "eggPile"; public override bool ShouldCloneModel => true; public override float voidSeedWeight => 0.05f; public override int normalWeight => 100; public override int favoredWeight => 0; public override InteractableCategory category => (InteractableCategory)3; public override int spawnCost => 1; public override CostTypeIndex costTypeIndex => (CostTypeIndex)0; public override int interactionCost => 0; public override SimpleInteractableData InteractableData => new SimpleInteractableData(addToHackBlacklist: false, automaticallyScaleCostWithDifficulty: false, unavailableDuringTeleporter: false, isShrine: false, orientToFloor: true, saleStarCompatible: false, 0, 1, 3); public override string[] validScenes => new string[10] { "blackbeach", "blackbeach2", "wispgraveyard", "shipgraveyard", "rootjungle", "habitat", "habitatfall", "lakes", "lakesnight", "foggyswamp" }; public override string[] favoredScenes => new string[0]; public override void Init() { base.Init(); } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown SceneDirector.PopulateScene += new hook_PopulateScene(HideEggs); } private void HideEggs(orig_PopulateScene orig, SceneDirector self) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Expected O, but got Unknown //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Expected O, but got Unknown orig.Invoke(self); rng = new Xoroshiro128Plus(Run.instance.stageRng.nextUlong); int num = 0; foreach (CharacterMaster readOnlyInstances in CharacterMaster.readOnlyInstancesList) { if (readOnlyInstances.inventory.GetItemCountEffective(ItemBase.instance.ItemsDef) > 0) { num += eggsPerPlayer; } } if (num > 0) { for (int i = 0; i < num; i++) { DirectorCore.instance.TrySpawnObject(new DirectorSpawnRequest((SpawnCard)(object)InteractableBase.instance.customInteractable.spawnCard, new DirectorPlacementRule { placementMode = (PlacementMode)4 }, rng)); } } } public override UnityAction GetInteractionAction(PurchaseInteraction interaction) { InteractableDropPickup interactableDropPickup = ((Component)interaction).gameObject.AddComponent(); interactableDropPickup.dropTable = GenerateWeightedSelection(); interactableDropPickup.destroyOnUse = true; return interactableDropPickup.OnInteractionBegin; } private ExplicitPickupDropTable GenerateWeightedSelection() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) ExplicitPickupDropTable val = ScriptableObject.CreateInstance(); List list = new List(); list.Add(new PickupDefEntry { pickupDef = (Object)(object)ItemBase.instance.ItemsDef, pickupWeight = 1f }); list.Add(new PickupDefEntry { pickupDef = (Object)(object)ItemBase.instance.ItemsDef, pickupWeight = 0.2f }); val.pickupEntries = list.ToArray(); return val; } } internal class ShrineConverge : InteractableBase { public static string ShrineConvergeUseToken = "SHRINE_CONVERGE_USE_MESSAGE"; public static string ShrineConvergeBeginToken = "SHRINE_CONVERGE_BEGIN_MESSAGE"; public string ShrineConvergeUseMessage = "You have invited the challenge of Convergence.."; public string ShrineConvergeUseMessage2P = "{0} has invited the challenge of Convergence.."; public string ShrineConvergeBeginMessage = "Let the challenge of Convergence... begin!"; public override bool isEnabled => false; public override string ConfigName => "Shrine of Convergence"; public override string InteractableName => "Shrine of Convergence"; public override string InteractableContext => "Pray to the Shrine of Convergence"; public override string InteractableLangToken => "SHRINE_CONVERGE"; public override GameObject InteractableModel => Addressables.LoadAssetAsync((object)"RoR2/Base/ShrineBoss/ShrineBoss.prefab").WaitForCompletion(); public override string modelName => "mdlShrineBoss"; public override string prefabName => "ShrineConvergence"; public override bool ShouldCloneModel => true; public override float voidSeedWeight => 0f; public override int normalWeight => 12; public override int favoredWeight => 300000; public override InteractableCategory category => (InteractableCategory)4; public override int spawnCost => 15; public override CostTypeIndex costTypeIndex => (CostTypeIndex)0; public override int interactionCost => 0; public override SimpleInteractableData InteractableData => new SimpleInteractableData(addToHackBlacklist: false, automaticallyScaleCostWithDifficulty: false, unavailableDuringTeleporter: true, isShrine: true, orientToFloor: true, saleStarCompatible: false, 3, 1, 1); public override string[] validScenes => new string[27] { "golemplains", "golemplains2", "blackbeach", "blackbeach2", "snowyforest", "foggyswamp", "goolake", "frozenwall", "wispgraveyard", "dampcavesimple", "shipgraveyard", "skymeadow", "rootjungle", "ancientloft", "sulfurpools", "lakes", "lakesnight", "village", "villagenight", "lemuriantemple", "habitat", "habitatfall", "helminthroost", "slumberingsatellite", "forgottenhaven", "drybasin", "FBLScene" }; public override string[] favoredScenes => new string[8] { "lakes", "lakesnight", "goolake", "dampcavesimple", "skymeadow", "lemuriantemple", "habitat", "habitatfall" }; public override UnityAction GetInteractionAction(PurchaseInteraction interaction) { ShrineBossBehavior component = ((Component)interaction).gameObject.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { Object.Destroy((Object)(object)component); } ShrineConvergeBehavior shrineConvergeBehavior = ((Component)interaction).gameObject.AddComponent(); shrineConvergeBehavior.purchaseInteraction = interaction; return shrineConvergeBehavior.AddShrineStack; } public override void Init() { LanguageAPI.Add(ShrineConvergeUseToken, ShrineConvergeUseMessage); LanguageAPI.Add(ShrineConvergeUseToken + "_2P", ShrineConvergeUseMessage2P); LanguageAPI.Add(ShrineConvergeBeginToken, ShrineConvergeBeginMessage); base.Init(); InteractionComponent.currentInspectIndex = 0; } public override void Hooks() { } } public class ShrineConvergeBehavior : ShrineBehavior { public PurchaseInteraction purchaseInteraction; private bool purchased = false; private Transform symbolTransform; private void Start() { Debug.Log((object)"Shrine converge behavior"); if ((Object)(object)symbolTransform == (Object)null) { symbolTransform = ((Component)this).transform.Find("Symbol"); } } public void AddShrineStack(Interactor activator) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Expected O, but got Unknown //IL_00a2: 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_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_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_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Expected O, but got Unknown if (purchased) { return; } purchased = true; if (Object.op_Implicit((Object)(object)TeleporterInteraction.instance) && (int)TeleporterInteraction.instance.activationState <= 1) { ((Component)TeleporterInteraction.instance).gameObject.AddComponent(); if (NetworkServer.active) { BossGroup bossGroup = TeleporterInteraction.instance.bossGroup; bossGroup.bonusRewardCount += 2; } } CharacterBody component = ((Component)activator).GetComponent(); Chat.SendBroadcastChat((ChatMessageBase)new SubjectFormatChatMessage { subjectAsCharacterBody = component, baseToken = ShrineConverge.ShrineConvergeUseToken }); EffectManager.SpawnEffect(LegacyResourcesAPI.Load("Prefabs/Effects/ShrineUseEffect"), new EffectData { origin = ((Component)this).transform.position, rotation = Quaternion.identity, scale = 1f, color = Color32.op_Implicit(new Color(0.94509804f, 77f / 85f, 0.7372549f)) }, false); if (NetworkServer.active) { if (Object.op_Implicit((Object)(object)symbolTransform)) { ((Component)symbolTransform).gameObject.SetActive(false); } ((ShrineBehavior)this).CallRpcSetPingable(false); purchaseInteraction.SetAvailable(false); } } } public class ConvergenceShrinkController : MonoBehaviour { private bool hasSentMessage = false; private static readonly float convergenceRadiusDivisor = 2f; private static readonly Color convergenceMaterialColor = new Color(0f, 3.9411764f, 5f, 1f); private float currentValue; private HoldoutZoneController holdoutZoneController; private FixedTimeStamp enabledTime; private void Awake() { holdoutZoneController = ((Component)this).GetComponent(); } private void OnEnable() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown holdoutZoneController.calcRadius += new CalcRadiusDelegate(ApplyRadius); } private void OnDisable() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown holdoutZoneController.calcRadius -= new CalcRadiusDelegate(ApplyRadius); } private void ApplyRadius(ref float radius) { //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_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_002f: Expected O, but got Unknown if (!hasSentMessage) { enabledTime = FixedTimeStamp.now; Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage { baseToken = ShrineConverge.ShrineConvergeBeginToken }); hasSentMessage = true; } radius /= convergenceRadiusDivisor; } private void ApplyColor(ref Color color) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_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) color = Color.Lerp(color, convergenceMaterialColor, FocusConvergenceController.colorCurve.Evaluate(currentValue)); } private void Update() { DoUpdate(Time.deltaTime); } private void DoUpdate(float deltaTime) { if (((Behaviour)holdoutZoneController).enabled) { float num = ((((FixedTimeStamp)(ref enabledTime)).timeSince < FocusConvergenceController.startupDelay) ? 1f : 0f); float num2 = Mathf.MoveTowards(currentValue, num, FocusConvergenceController.rampUpTime * deltaTime); if (currentValue <= 0f && num2 > 0f) { Util.PlaySound("Play_item_lunar_focusedConvergence", ((Component)this).gameObject); } currentValue = num2; } } } internal class VoidHusk : InteractableBase { private WeightedSelection weightedSelection; private Xoroshiro128Plus rng; public Transform dropletOrigin; public override string InteractableName => "Fractured Husk"; public override string InteractableContext => "Break open"; public override string InteractableLangToken => "VOID_HUSK"; public override GameObject InteractableModel => InteractableBase.LoadInteractableModel("mdlVoidHusk"); public override string modelName => "mdlVoidHusk"; public override string prefabName => "VoidHusk"; public override bool ShouldCloneModel => false; public override float voidSeedWeight => 0.4f; public override int normalWeight => 5; public override int favoredWeight => 20; public override InteractableCategory category => (InteractableCategory)7; public override int spawnCost => 20; public override CostTypeIndex costTypeIndex => (CostTypeIndex)14; public override int interactionCost => 1; public override string[] validScenes => new string[5] { "foggyswamp", "shipgraveyard", "ancientloft", "slumberingsatellite", "FBLScene" }; public override string[] favoredScenes => new string[4] { "dampcavesimple", "sulfurpools", "forgottenhaven", "drybasin" }; public override SimpleInteractableData InteractableData => new SimpleInteractableData(addToHackBlacklist: false, automaticallyScaleCostWithDifficulty: false, unavailableDuringTeleporter: false, isShrine: false, orientToFloor: true, saleStarCompatible: false, 1, 1, 1); public override void Init() { base.Init(); } private void VoidHuskBehavior(orig_OnInteractionBegin orig, PurchaseInteraction self, Interactor activator) { orig.Invoke(self, activator); if (self.displayNameToken == "2R4R_INTERACTABLE_" + InteractableLangToken + "_NAME") { HuskReward(((Component)self).gameObject); Object.Destroy((Object)(object)((Component)self).gameObject); } } private void HuskReward(GameObject gameObject) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_0034: 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_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: 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_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) PickupIndex none = PickupIndex.none; GenerateWeightedSelection(); rng = new Xoroshiro128Plus(Run.instance.treasureRng.nextUlong); none = PickupDropTable.GenerateDropFromWeightedSelection(rng, weightedSelection); dropletOrigin = gameObject.transform; PickupDropletController.CreatePickupDroplet(none, dropletOrigin.position + dropletOrigin.forward * 3f + dropletOrigin.up * 3f, dropletOrigin.forward * 3f + dropletOrigin.up * 5f); } private ExplicitPickupDropTable GenerateWeightedSelection() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) ExplicitPickupDropTable val = ScriptableObject.CreateInstance(); List list = new List(); list.Add(new PickupDefEntry { pickupDef = (Object)(object)ItemBase.instance.ItemsDef, pickupWeight = 1f }); list.Add(new PickupDefEntry { pickupDef = (Object)(object)ItemBase.instance.ItemsDef, pickupWeight = 1f }); list.Add(new PickupDefEntry { pickupDef = (Object)(object)ItemBase.instance.ItemsDef, pickupWeight = 1f }); val.pickupEntries = list.ToArray(); return val; } public override UnityAction GetInteractionAction(PurchaseInteraction interaction) { InteractableDropPickup interactableDropPickup = ((Component)interaction).gameObject.AddComponent(); interactableDropPickup.dropTable = GenerateWeightedSelection(); interactableDropPickup.destroyOnUse = true; return interactableDropPickup.OnInteractionBegin; } public override void Hooks() { } } internal class WishboneCarcass : InteractableBase { public static int omensPerPlayer = 1; public static int omensBonus = 2; private static Xoroshiro128Plus rng; public override string InteractableName => "Omen"; public override string InteractableContext => "Break Omen"; public override string InteractableLangToken => "WISHBONECARCASS"; public override GameObject InteractableModel => InteractableBase.LoadInteractableModel(modelName); public override string modelName => "mdlWishboneCarcass"; public override string prefabName => "omen"; public override bool ShouldCloneModel => true; public override InteractableCategory category => (InteractableCategory)3; public override CostTypeIndex costTypeIndex => (CostTypeIndex)0; public override float voidSeedWeight => 0f; public override int normalWeight => 0; public override int favoredWeight => 0; public override int spawnCost => 0; public override int interactionCost => 0; public override string[] validScenes => new string[0]; public override string[] favoredScenes => new string[0]; public override SimpleInteractableData InteractableData => new SimpleInteractableData(addToHackBlacklist: false, automaticallyScaleCostWithDifficulty: false, unavailableDuringTeleporter: false, isShrine: false, orientToFloor: true, saleStarCompatible: false, 0, 1, 0); public static void ScatterWishbones() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Expected O, but got Unknown //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Expected O, but got Unknown rng = new Xoroshiro128Plus(Run.instance.stageRng.nextUlong); int num = Run.instance.participatingPlayerCount * omensPerPlayer; if (!Wishbone.UseSimpleWishboneBehavior()) { num += omensBonus; } Log.Warning($"Hiding {num} wishbones"); DirectorPlacementRule val = new DirectorPlacementRule { placementMode = (PlacementMode)((Object.op_Implicit((Object)(object)SceneInfo.instance) && Object.op_Implicit((Object)(object)SceneInfo.instance.approximateMapBoundMesh)) ? 5 : 4) }; for (int i = 0; i < num; i++) { DirectorCore.instance.TrySpawnObject(new DirectorSpawnRequest((SpawnCard)(object)InteractableBase.instance.customInteractable.spawnCard, val, rng)); } } public override UnityAction GetInteractionAction(PurchaseInteraction interaction) { InteractableDropPickup interactableDropPickup = ((Component)interaction).gameObject.AddComponent(); interactableDropPickup.dropTable = GenerateWeightedSelection(); interactableDropPickup.destroyOnUse = true; interactableDropPickup.canBeReplaced = false; return interactableDropPickup.OnInteractionBegin; } private ExplicitPickupDropTable GenerateWeightedSelection() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) ExplicitPickupDropTable val = ScriptableObject.CreateInstance(); List list = new List(); list.Add(new PickupDefEntry { pickupDef = (Object)(object)ItemBase.instance.ItemsDef, pickupWeight = 1f }); val.pickupEntries = list.ToArray(); return val; } public override void Init() { //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_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) base.Init(); interactablePrefab.AddComponent(); GameObject val = Addressables.LoadAssetAsync((object)RoR2_Base_TreasureCache.Lockbox_prefab).WaitForCompletion(); if (!Object.op_Implicit((Object)(object)val)) { return; } ParticleSystem[] componentsInChildren = val.GetComponentsInChildren(); ParticleSystem[] array = componentsInChildren; foreach (ParticleSystem val2 in array) { if (!(((Object)val2).name != "ActiveGlow")) { GameObject val3 = PrefabAPI.InstantiateClone(((Component)val2).gameObject, "CarcassGlow"); val3.transform.parent = interactablePrefab.transform; val3.transform.localPosition = Vector3.zero; Transform transform = val3.transform; transform.localScale *= 0.35f; break; } } } public override void Hooks() { } } } namespace SwanSongExtended.Equipment { public abstract class EquipmentBase : EquipmentBase where T : EquipmentBase { public static T instance { get; private set; } public EquipmentBase() { if (instance != null) { throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting ItemBoilerplate/Item was instantiated twice"); } instance = this as T; } } public abstract class EquipmentBase : SharedBase { public EquipmentDef EquipDef; public override AssetBundle assetBundle => SwanSongPlugin.mainAssetBundle; public abstract string EquipmentName { get; } public abstract string EquipmentLangTokenName { get; } public abstract string EquipmentPickupDesc { get; } public abstract string EquipmentFullDescription { get; } public abstract string EquipmentLore { get; } public abstract GameObject EquipmentModel { get; } public abstract Sprite EquipmentIcon { get; } public virtual bool AppearsInSinglePlayer { get; } = true; public virtual bool AppearsInMultiPlayer { get; } = true; public virtual bool CanDrop { get; } = true; public virtual bool IsBoss { get; } = false; public virtual bool IsLunar { get; } = false; public virtual ColorIndex ColorIndex { get; } = (ColorIndex)5; public virtual ExpansionDef RequiredExpansion { get; } = null; public abstract float BaseCooldown { get; } public abstract bool EnigmaCompatible { get; } public abstract bool CanBeRandomlyActivated { get; } internal static void CloneVanillaDisplayRules(Object newDef, Object vanillaDef) { } public override void Init() { base.Init(); CreateEquipment(); } public abstract ItemDisplayRuleDict CreateItemDisplayRules(); public override void Lang() { LanguageAPI.Add("EQUIPMENT_" + EquipmentLangTokenName + "_NAME", EquipmentName); LanguageAPI.Add("EQUIPMENT_" + EquipmentLangTokenName + "_PICKUP", EquipmentPickupDesc); LanguageAPI.Add("EQUIPMENT_" + EquipmentLangTokenName + "_DESCRIPTION", EquipmentFullDescription); LanguageAPI.Add("EQUIPMENT_" + EquipmentLangTokenName + "_LORE", EquipmentLore); } protected void CreateEquipment() { //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_018f: 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_01d3: 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_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Expected O, but got Unknown EquipDef = ScriptableObject.CreateInstance(); ((Object)EquipDef).name = "EQUIPMENT_" + EquipmentLangTokenName; EquipDef.nameToken = "EQUIPMENT_" + EquipmentLangTokenName + "_NAME"; EquipDef.pickupToken = "EQUIPMENT_" + EquipmentLangTokenName + "_PICKUP"; EquipDef.descriptionToken = "EQUIPMENT_" + EquipmentLangTokenName + "_DESCRIPTION"; EquipDef.loreToken = "EQUIPMENT_" + EquipmentLangTokenName + "_LORE"; EquipDef.pickupModelPrefab = EquipmentModel; EquipDef.pickupIconSprite = EquipmentIcon; EquipDef.appearsInSinglePlayer = AppearsInSinglePlayer; EquipDef.appearsInMultiPlayer = AppearsInMultiPlayer; EquipDef.canDrop = CanDrop; EquipDef.cooldown = Bind(BaseCooldown, "Base Cooldown"); EquipDef.enigmaCompatible = Bind(EnigmaCompatible, "Enigma-Compatible"); EquipDef.canBeRandomlyTriggered = Bind(CanBeRandomlyActivated, "Bottled Chaos-Compatible"); EquipDef.isBoss = IsBoss; EquipDef.isLunar = IsLunar; EquipDef.colorIndex = ColorIndex; EquipDef.requiredExpansion = RequiredExpansion; ItemDisplayRuleDict val = CreateItemDisplayRules(); if (val == null) { val = new ItemDisplayRuleDict(Array.Empty()); } ItemAPI.Add(new CustomEquipment(EquipDef, val)); EquipmentSlot.PerformEquipmentAction += new hook_PerformEquipmentAction(PerformEquipmentAction); } internal bool PerformEquipmentAction(orig_PerformEquipmentAction orig, EquipmentSlot self, EquipmentDef equipmentDef) { if ((Object)(object)equipmentDef == (Object)(object)EquipDef) { return ActivateEquipment(self); } return orig.Invoke(self, equipmentDef); } protected abstract bool ActivateEquipment(EquipmentSlot slot); public Ray GetAimRay(InputBankTest inputBank) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_001a: 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_0026: 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) Ray result = default(Ray); ((Ray)(ref result)).direction = inputBank.aimDirection; ((Ray)(ref result)).origin = inputBank.aimOrigin; return result; } public Ray GetAimRay(CharacterBody body) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0017: 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_004d: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)body.inputBank)) { return new Ray(body.inputBank.aimOrigin, body.inputBank.aimDirection); } return new Ray(body.transform.position, body.transform.forward); } public static GameObject LoadDropPrefab(string prefabName = "", AssetBundle bundle = null) { return SwanSongPlugin.TryLoadFromBundle("Assets/Models/DropPrefabs/Equipment/" + prefabName + ".prefab", bundle).FixItemModel(); } public static GameObject LoadDisplayPrefab(string prefabName = "", AssetBundle bundle = null) { return SwanSongPlugin.TryLoadFromBundle("Assets/Models/DisplayPrefabs/Equipment/" + prefabName + ".prefab", bundle); } public static Sprite LoadItemIcon(string spriteName = "", AssetBundle bundle = null, bool fallBackOnWrench = false) { return SwanSongPlugin.TryLoadSpriteFromBundle("Assets/Textures/Icons/Equipment/" + spriteName + ".png", bundle, fallBackOnWrench); } } internal class BrokenZapinator : EquipmentBase { private BasicPickupDropTable zapinatorDropTable; public float itemChance = 1f; private float maxAimDistance = 500f; private static GameObject supplyDropMuzzleFlash = Resources.Load("prefabs/effects/muzzleflashes/CaptainAirstrikeMuzzleEffect"); private float freeChargeBaseChance = 5f; private float bonusMultiplierBaseChance = 25f; private float tinyDamageDivider = 2f; private float bigDamageMultiplier = 2f; private float bigProcMultiplier = 5f; private float bigAoeMultiplier = 3f; private float bigForceMultiplier = 3f; private float selfForceAmt = 0.6f; private float slowVelocityMultiplier = 0.3f; private float fastVelocityMultiplier = 1.5f; private float backwardsVelocityMultiplier = -0.5f; private float badAccuracy = 0.8f; private float multiShotAccuracy = 0.7f; private int multiShotBonus = 3; public override string ConfigName => "Equipment : Zapinator"; public override ExpansionDef RequiredExpansion => SwanSongPlugin.expansionDefSS2; public override string EquipmentName => "Orange Zapinator"; public override string EquipmentLangTokenName => "BROKENZAPINATOR"; public override string EquipmentPickupDesc => Language.Styling.UtilityColor("I can't believe we left this in the game!"); public override string EquipmentFullDescription => "Fires a projectile."; public override string EquipmentLore => ""; public override GameObject EquipmentModel => EquipmentBase.LoadDropPrefab("mdlBrokenZapinator"); public override Sprite EquipmentIcon => EquipmentBase.LoadItemIcon("texIconBrokenZapinator"); public override float BaseCooldown => 35f; public override bool EnigmaCompatible => true; public override bool CanBeRandomlyActivated => true; public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Hooks() { ZapinatorProjectileCatalog.Init(); } public override void Init() { zapinatorDropTable = ScriptableObject.CreateInstance(); zapinatorDropTable.tier1Weight = 1f; zapinatorDropTable.tier2Weight = 1f; zapinatorDropTable.tier3Weight = 1f; zapinatorDropTable.voidTier1Weight = 1f; zapinatorDropTable.voidTier2Weight = 1f; zapinatorDropTable.voidTier3Weight = 1f; zapinatorDropTable.equipmentWeight = 1f; zapinatorDropTable.lunarItemWeight = 1f; zapinatorDropTable.lunarEquipmentWeight = 1f; zapinatorDropTable.bossWeight = 1f; base.Init(); } protected override bool ActivateEquipment(EquipmentSlot slot) { //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_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_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0081: 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_0091: 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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) bool result = false; CharacterBody characterBody = slot.characterBody; if ((Object)(object)characterBody != (Object)null) { if (Util.CheckRoll(itemChance, 0f, (CharacterMaster)null)) { PickupIndex none = PickupIndex.none; if (Object.op_Implicit((Object)(object)zapinatorDropTable)) { none = ((PickupDropTable)zapinatorDropTable).GenerateDrop(characterBody.equipmentSlot.rng); Ray aimRay = GetAimRay(characterBody); ((Ray)(ref aimRay)).direction = ((Ray)(ref aimRay)).direction + Vector3.up * 0.25f; PickupDropletController.CreatePickupDroplet(none, ((Ray)(ref aimRay)).origin, ((Ray)(ref aimRay)).direction * 25f); characterBody.characterMotor.ApplyForce(((Ray)(ref aimRay)).direction * -1500f, true, false); result = true; } } else { int index = Random.Range(0, ZapinatorProjectileCatalog.zapinatorProjectileCount); ZapinatorProjectileData projectileDataFromIndex = ZapinatorProjectileCatalog.GetProjectileDataFromIndex(index); ZapinatorRollData roll = RollModifiersFromProjectileData(projectileDataFromIndex, characterBody); bool crit = Util.CheckRoll(characterBody.crit, characterBody.master); if ((projectileDataFromIndex.type & ZapinatorProjectileType.Captain) > ZapinatorProjectileType.MovesFromSpawn) { result = CreateSupplyDrop(slot, characterBody, projectileDataFromIndex, roll, crit); } else if ((projectileDataFromIndex.type & ZapinatorProjectileType.Defensive) <= ZapinatorProjectileType.MovesFromSpawn) { result = CreateOrdinaryProjectile(slot, characterBody, projectileDataFromIndex, roll, crit); } } if (Util.CheckRoll(freeChargeBaseChance, characterBody.master)) { result = false; } } return result; } private bool CreateOrdinaryProjectile(EquipmentSlot slot, CharacterBody ownerBody, ZapinatorProjectileData projectileData, ZapinatorRollData roll, bool crit) { //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_000b: 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_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_002d: 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_0053: 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_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00af: 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_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: 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_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_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_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_019e: 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_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: 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) bool flag = false; bool flag2 = false; Vector3 zero = Vector3.zero; Vector3 val = Random.insideUnitSphere * (1f - roll.accuracy); Ray aimRay = GetAimRay(ownerBody); RaycastHit val2 = CheckPlacementFromAimRay(aimRay, ((Component)ownerBody).gameObject); GameObject projectilePrefab = ProcessProjectile(Object.Instantiate(projectileData.prefab), roll); FireProjectileInfo val3 = default(FireProjectileInfo); val3.projectilePrefab = projectilePrefab; val3.owner = ((Component)ownerBody).gameObject; val3.crit = crit; val3.force = roll.forceMultiplier; val3.damage = roll.damageCoefficient * ownerBody.damage; val3.position = ownerBody.transform.position; FireProjectileInfo val4 = val3; zero = ((Ray)(ref aimRay)).direction; if ((projectileData.type & ZapinatorProjectileType.RequiresSurface) > ZapinatorProjectileType.MovesFromSpawn) { if (((RaycastHit)(ref val2)).point == Vector3.negativeInfinity) { return false; } flag = true; val4.position = ((RaycastHit)(ref val2)).point; zero = Vector3.up; } else if ((projectileData.type & ZapinatorProjectileType.RequiresTarget) > ZapinatorProjectileType.MovesFromSpawn) { if (((RaycastHit)(ref val2)).point == Vector3.negativeInfinity) { return false; } flag2 = true; val4.target = ((Component)((RaycastHit)(ref val2)).collider).gameObject; zero = Vector3.up; } if (Object.op_Implicit((Object)(object)ownerBody.characterMotor) && !flag) { ownerBody.characterMotor.ApplyForce(((Ray)(ref aimRay)).direction * ((0f - roll.forceMultiplier) * roll.selfForceMultiplier), false, false); } for (int i = 0; i < roll.totalProjectiles; i++) { val4.rotation = Util.QuaternionSafeLookRotation(zero + Random.insideUnitSphere * (1f - roll.accuracy)); ProjectileManager.instance.FireProjectile(val4); } return true; } private GameObject ProcessProjectile(GameObject projectile, ZapinatorRollData roll) { //IL_0050: 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_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)projectile != (Object)null) { ProjectileSimple component = projectile.GetComponent(); if ((Object)(object)component != (Object)null) { component.desiredForwardSpeed *= roll.velocityMultiplier; } ProjectileDamage component2 = projectile.GetComponent(); if ((Object)(object)component2 != (Object)null) { component2.damageType |= DamageTypeCombo.op_Implicit(roll.damageTypes); } ProjectileImpactExplosion component3 = projectile.GetComponent(); if ((Object)(object)component3 != (Object)null) { ((ProjectileExplosion)component3).blastRadius = ((ProjectileExplosion)component3).blastRadius * roll.aoeSizeMultiplier; ((ProjectileExplosion)component3).blastProcCoefficient = roll.procCoefficient; if (((ProjectileExplosion)component3).childrenCount > 0 && ((ProjectileExplosion)component3).fireChildren) { ((ProjectileExplosion)component3).childrenProjectilePrefab = ProcessProjectile(((ProjectileExplosion)component3).childrenProjectilePrefab, roll); } } ProjectileOverlapAttack component4 = projectile.GetComponent(); if ((Object)(object)component4 != (Object)null) { component4.damageCoefficient = roll.damageCoefficient / 5f; component4.overlapProcCoefficient = roll.procCoefficient / 5f; } ProjectileDotZone component5 = projectile.GetComponent(); if ((Object)(object)component5 != (Object)null) { component5.damageCoefficient = roll.damageCoefficient / 5f; component5.overlapProcCoefficient = roll.procCoefficient / 5f; } } return projectile; } private bool CreateSupplyDrop(EquipmentSlot slot, CharacterBody ownerBody, ZapinatorProjectileData projectileData, ZapinatorRollData roll, bool crit) { //IL_0005: 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_0018: 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_0064: 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_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) bool result = false; PlacementInfo val = default(PlacementInfo); if (((NetworkBehaviour)slot).hasAuthority) { val = SetupSupplyDrop.GetPlacementInfo(GetAimRay(ownerBody), ((Component)ownerBody).gameObject); } if (val.ok) { EffectManager.SimpleMuzzleFlash(supplyDropMuzzleFlash, ((Component)ownerBody).gameObject, CallSupplyDropBase.muzzleString, false); if (NetworkServer.active) { GameObject val2 = Object.Instantiate(projectileData.prefab, val.position, val.rotation); val2.GetComponent().teamIndex = ownerBody.teamComponent.teamIndex; val2.GetComponent().ownerObject = ((Component)ownerBody).gameObject; ProjectileDamage component = val2.GetComponent(); component.damageColorIndex = (DamageColorIndex)0; component.crit = crit; component.damage = ownerBody.damage * roll.damageCoefficient; component.force = CallSupplyDropBase.impactDamageForce * roll.forceMultiplier; component.damageType = DamageTypeCombo.op_Implicit((DamageType)(0 | roll.damageTypes)); NetworkServer.Spawn(val2); } result = true; } return result; } private ZapinatorRollData RollModifiersFromProjectileData(ZapinatorProjectileData data, CharacterBody body) { //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: 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_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: 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_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0207: 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) ZapinatorRollData zapinatorRollData = new ZapinatorRollData(); ZapinatorModifiers[] possibleModifiers = data.possibleModifiers; int num = data.maxModifiers; if (Util.CheckRoll(bonusMultiplierBaseChance, body.master)) { num += data.bonusModifiers; } for (int i = 0; i < num; i++) { int num2 = Random.Range(0, possibleModifiers.Length); switch (possibleModifiers[num2]) { case ZapinatorModifiers.TinyDamage: zapinatorRollData.damageCoefficient /= tinyDamageDivider; break; case ZapinatorModifiers.BigDamage: zapinatorRollData.damageCoefficient *= bigDamageMultiplier; break; case ZapinatorModifiers.BigProcs: zapinatorRollData.procCoefficient *= bigProcMultiplier; break; case ZapinatorModifiers.BigAoe: zapinatorRollData.aoeSizeMultiplier *= bigAoeMultiplier; break; case ZapinatorModifiers.BigKnockback: zapinatorRollData.forceMultiplier *= bigForceMultiplier; break; case ZapinatorModifiers.SelfKnockback: zapinatorRollData.selfForceMultiplier += selfForceAmt; break; case ZapinatorModifiers.NegativeKnockback: zapinatorRollData.damageCoefficient *= -1f; break; case ZapinatorModifiers.VerySlow: zapinatorRollData.velocityMultiplier *= slowVelocityMultiplier; break; case ZapinatorModifiers.VeryFast: zapinatorRollData.damageCoefficient *= fastVelocityMultiplier; break; case ZapinatorModifiers.Backwards: zapinatorRollData.velocityMultiplier *= backwardsVelocityMultiplier; zapinatorRollData.selfForceMultiplier *= -1f; break; case ZapinatorModifiers.BadAccuracy: zapinatorRollData.accuracy *= badAccuracy; break; case ZapinatorModifiers.MultiShot: zapinatorRollData.accuracy *= multiShotAccuracy; zapinatorRollData.totalProjectiles += multiShotBonus; break; case ZapinatorModifiers.Debuff: zapinatorRollData.damageTypes |= GetRandomDamageType(); zapinatorRollData.damageTypes |= GetRandomDamageType(); zapinatorRollData.damageTypes |= GetRandomDamageType(); break; } } return zapinatorRollData; } private DamageType GetRandomDamageType() { //IL_0002: 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_0063: 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_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009f: 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_00af: 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_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) DamageType result = (DamageType)0; switch (Random.Range(1, 16)) { case 1: result = (DamageType)8388608; break; case 2: result = (DamageType)1024; break; case 3: result = (DamageType)1048576; break; case 4: result = (DamageType)524288; break; case 5: result = (DamageType)2; break; case 6: result = (DamageType)512; break; case 7: result = (DamageType)4194304; break; case 8: result = (DamageType)256; break; case 9: result = (DamageType)128; break; case 10: result = (DamageType)32768; break; case 11: result = (DamageType)4096; break; case 12: result = (DamageType)16777216; break; case 13: result = (DamageType)8; break; case 14: result = (DamageType)32; break; case 15: result = (DamageType)16384; break; } return result; } private RaycastHit CheckPlacementFromAimRay(Ray ray, GameObject obj) { //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) //IL_0012: 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_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) float num = maxAimDistance; float num2 = 0f; RaycastHit result = default(RaycastHit); ((RaycastHit)(ref result)).point = Vector3.negativeInfinity; if (Physics.Raycast(CameraRigController.ModifyAimRayIfApplicable(ray, obj, ref num2), ref result, num + num2, LayerMask.op_Implicit(CommonMasks.bullet))) { } return result; } } public static class ZapinatorProjectileCatalog { public delegate void ZapinatorProjectileEventHandler(List projectileData); public static List projectileData = new List(); public static int zapinatorProjectileCount => projectileData.Count; public static event ZapinatorProjectileEventHandler GetZapinatorProjectiles; public static ZapinatorProjectileData GetProjectileDataFromIndex(int index) { if (index > zapinatorProjectileCount) { Debug.Log((object)"How do you break what's already broken?"); ZapinatorProjectileData result = default(ZapinatorProjectileData); result.prefab = Resources.Load("prefabs/projectiles/BeetleQueenSpit"); result.type = ZapinatorProjectileType.MovesFromSpawn; result.possibleModifiers = new ZapinatorModifiers[6] { ZapinatorModifiers.SelfKnockback, ZapinatorModifiers.SelfKnockback, ZapinatorModifiers.SelfKnockback, ZapinatorModifiers.SelfKnockback, ZapinatorModifiers.BigKnockback, ZapinatorModifiers.BadAccuracy }; result.maxModifiers = 3; result.bonusModifiers = 2; return result; } return projectileData[index]; } internal static void Init() { List list = new List(); ZapinatorProjectileCatalog.GetZapinatorProjectiles?.Invoke(list); projectileData = list; projectileData.Add(new ZapinatorProjectileData { prefab = Resources.Load("prefabs/projectiles/BellBall"), type = ZapinatorProjectileType.MovesFromSpawn, possibleModifiers = new ZapinatorModifiers[7] { ZapinatorModifiers.VerySlow, ZapinatorModifiers.VeryFast, ZapinatorModifiers.SelfKnockback, ZapinatorModifiers.BigKnockback, ZapinatorModifiers.BigKnockback, ZapinatorModifiers.BigDamage, ZapinatorModifiers.BadAccuracy }, maxModifiers = 3, bonusModifiers = 2 }); projectileData.Add(new ZapinatorProjectileData { prefab = Resources.Load("prefabs/projectiles/CommandoGrenadeProjectile"), type = ZapinatorProjectileType.MovesFromSpawn, possibleModifiers = new ZapinatorModifiers[8] { ZapinatorModifiers.VeryFast, ZapinatorModifiers.VeryFast, ZapinatorModifiers.BigProcs, ZapinatorModifiers.NegativeKnockback, ZapinatorModifiers.BigKnockback, ZapinatorModifiers.TinyDamage, ZapinatorModifiers.SelfKnockback, ZapinatorModifiers.SelfKnockback }, maxModifiers = 3, bonusModifiers = 2 }); projectileData.Add(new ZapinatorProjectileData { prefab = Resources.Load("prefabs/projectiles/CrocoDiseaseProjectile"), type = ZapinatorProjectileType.MovesFromSpawn, possibleModifiers = new ZapinatorModifiers[8] { ZapinatorModifiers.MultiShot, ZapinatorModifiers.SelfKnockback, ZapinatorModifiers.SelfKnockback, ZapinatorModifiers.BigKnockback, ZapinatorModifiers.TinyDamage, ZapinatorModifiers.TinyDamage, ZapinatorModifiers.BigProcs, ZapinatorModifiers.Debuff }, maxModifiers = 3, bonusModifiers = 2 }); projectileData.Add(new ZapinatorProjectileData { prefab = Resources.Load("prefabs/projectiles/EngiMine"), type = ZapinatorProjectileType.MovesFromSpawn, possibleModifiers = new ZapinatorModifiers[8] { ZapinatorModifiers.VeryFast, ZapinatorModifiers.BigDamage, ZapinatorModifiers.BigAoe, ZapinatorModifiers.BigAoe, ZapinatorModifiers.NegativeKnockback, ZapinatorModifiers.BigKnockback, ZapinatorModifiers.BigKnockback, ZapinatorModifiers.BigProcs }, maxModifiers = 3, bonusModifiers = 2 }); projectileData.Add(new ZapinatorProjectileData { prefab = Resources.Load("prefabs/projectiles/LoaderPylon"), type = ZapinatorProjectileType.Turret, possibleModifiers = new ZapinatorModifiers[10] { ZapinatorModifiers.SelfKnockback, ZapinatorModifiers.BigKnockback, ZapinatorModifiers.VerySlow, ZapinatorModifiers.VerySlow, ZapinatorModifiers.BadAccuracy, ZapinatorModifiers.BadAccuracy, ZapinatorModifiers.MultiShot, ZapinatorModifiers.MultiShot, ZapinatorModifiers.MultiShot, ZapinatorModifiers.Nothing }, maxModifiers = 3, bonusModifiers = 2 }); projectileData.Add(new ZapinatorProjectileData { prefab = Resources.Load("prefabs/projectiles/LunarWispTrackingBomb"), type = ZapinatorProjectileType.MovesFromSpawn, possibleModifiers = new ZapinatorModifiers[8] { ZapinatorModifiers.TinyDamage, ZapinatorModifiers.Debuff, ZapinatorModifiers.BigKnockback, ZapinatorModifiers.BigKnockback, ZapinatorModifiers.SelfKnockback, ZapinatorModifiers.BadAccuracy, ZapinatorModifiers.BadAccuracy, ZapinatorModifiers.Nothing }, maxModifiers = 3, bonusModifiers = 2 }); projectileData.Add(new ZapinatorProjectileData { prefab = Resources.Load("prefabs/projectiles/MageFirebolt"), type = ZapinatorProjectileType.MovesFromSpawn, possibleModifiers = new ZapinatorModifiers[12] { ZapinatorModifiers.TinyDamage, ZapinatorModifiers.TinyDamage, ZapinatorModifiers.BigAoe, ZapinatorModifiers.VeryFast, ZapinatorModifiers.VeryFast, ZapinatorModifiers.MultiShot, ZapinatorModifiers.Debuff, ZapinatorModifiers.SelfKnockback, ZapinatorModifiers.SelfKnockback, ZapinatorModifiers.SelfKnockback, ZapinatorModifiers.Nothing, ZapinatorModifiers.Nothing }, maxModifiers = 3, bonusModifiers = 2 }); projectileData.Add(new ZapinatorProjectileData { prefab = Resources.Load("prefabs/projectiles/Sawmerang"), type = ZapinatorProjectileType.MovesFromSpawn, possibleModifiers = new ZapinatorModifiers[9] { ZapinatorModifiers.BigProcs, ZapinatorModifiers.Debuff, ZapinatorModifiers.TinyDamage, ZapinatorModifiers.TinyDamage, ZapinatorModifiers.TinyDamage, ZapinatorModifiers.Backwards, ZapinatorModifiers.BadAccuracy, ZapinatorModifiers.BadAccuracy, ZapinatorModifiers.Nothing }, maxModifiers = 3, bonusModifiers = 2 }); projectileData.Add(new ZapinatorProjectileData { prefab = Resources.Load("prefabs/projectiles/SpiderMine"), type = ZapinatorProjectileType.MovesFromSpawn, possibleModifiers = new ZapinatorModifiers[9] { ZapinatorModifiers.BigDamage, ZapinatorModifiers.BigAoe, ZapinatorModifiers.BigAoe, ZapinatorModifiers.Backwards, ZapinatorModifiers.BadAccuracy, ZapinatorModifiers.BadAccuracy, ZapinatorModifiers.MultiShot, ZapinatorModifiers.MultiShot, ZapinatorModifiers.MultiShot }, maxModifiers = 3, bonusModifiers = 2 }); projectileData.Add(new ZapinatorProjectileData { prefab = Resources.Load("prefabs/projectiles/SyringeProjectileHealing"), type = ZapinatorProjectileType.MovesFromSpawn, possibleModifiers = new ZapinatorModifiers[9] { ZapinatorModifiers.MultiShot, ZapinatorModifiers.BadAccuracy, ZapinatorModifiers.SelfKnockback, ZapinatorModifiers.BigKnockback, ZapinatorModifiers.BigKnockback, ZapinatorModifiers.VerySlow, ZapinatorModifiers.VerySlow, ZapinatorModifiers.Nothing, ZapinatorModifiers.BigProcs }, maxModifiers = 3, bonusModifiers = 2 }); projectileData.Add(new ZapinatorProjectileData { prefab = Resources.Load("prefabs/projectiles/CryoCanisterProjectile"), type = ZapinatorProjectileType.MovesFromSpawn, possibleModifiers = new ZapinatorModifiers[7] { ZapinatorModifiers.MultiShot, ZapinatorModifiers.Debuff, ZapinatorModifiers.VerySlow, ZapinatorModifiers.SelfKnockback, ZapinatorModifiers.SelfKnockback, ZapinatorModifiers.BigKnockback, ZapinatorModifiers.Nothing }, maxModifiers = 3, bonusModifiers = 2 }); projectileData.Add(new ZapinatorProjectileData { prefab = Resources.Load("prefabs/projectiles/TreebotFlowerSeed"), type = ZapinatorProjectileType.Turret, possibleModifiers = new ZapinatorModifiers[8] { ZapinatorModifiers.BigAoe, ZapinatorModifiers.BigAoe, ZapinatorModifiers.BigAoe, ZapinatorModifiers.BigKnockback, ZapinatorModifiers.SelfKnockback, ZapinatorModifiers.MultiShot, ZapinatorModifiers.VerySlow, ZapinatorModifiers.VerySlow }, maxModifiers = 3, bonusModifiers = 2 }); projectileData.Add(new ZapinatorProjectileData { prefab = Resources.Load("prefabs/projectiles/TreebotMortar2"), type = ZapinatorProjectileType.RequiresSurface, possibleModifiers = new ZapinatorModifiers[5] { ZapinatorModifiers.TinyDamage, ZapinatorModifiers.BigDamage, ZapinatorModifiers.BigAoe, ZapinatorModifiers.Debuff, ZapinatorModifiers.Nothing }, maxModifiers = 3, bonusModifiers = 2 }); projectileData.Add(new ZapinatorProjectileData { prefab = Resources.Load("prefabs/projectiles/TreebotMortarRain"), type = ZapinatorProjectileType.RequiresSurface, possibleModifiers = new ZapinatorModifiers[7] { ZapinatorModifiers.BigKnockback, ZapinatorModifiers.NegativeKnockback, ZapinatorModifiers.TinyDamage, ZapinatorModifiers.TinyDamage, ZapinatorModifiers.Debuff, ZapinatorModifiers.BigAoe, ZapinatorModifiers.BigAoe }, maxModifiers = 3, bonusModifiers = 2 }); projectileData.Add(new ZapinatorProjectileData { prefab = Resources.Load("prefabs/projectiles/VagrantTrackingBomb"), type = ZapinatorProjectileType.MovesFromSpawn, possibleModifiers = new ZapinatorModifiers[6] { ZapinatorModifiers.TinyDamage, ZapinatorModifiers.BigDamage, ZapinatorModifiers.SelfKnockback, ZapinatorModifiers.VeryFast, ZapinatorModifiers.VerySlow, ZapinatorModifiers.Debuff }, maxModifiers = 3, bonusModifiers = 2 }); projectileData.Add(new ZapinatorProjectileData { prefab = Resources.Load("prefabs/projectiles/TarSeeker"), type = ZapinatorProjectileType.MovesFromSpawn, possibleModifiers = new ZapinatorModifiers[6] { ZapinatorModifiers.TinyDamage, ZapinatorModifiers.BigAoe, ZapinatorModifiers.BigKnockback, ZapinatorModifiers.SelfKnockback, ZapinatorModifiers.NegativeKnockback, ZapinatorModifiers.Backwards }, maxModifiers = 3, bonusModifiers = 2 }); projectileData.Add(new ZapinatorProjectileData { prefab = Resources.Load("prefabs/networkedobjects/captainsupplydrops/CaptainSupplyDrop, EquipmentRestock"), type = ZapinatorProjectileType.Captain, possibleModifiers = new ZapinatorModifiers[4] { ZapinatorModifiers.TinyDamage, ZapinatorModifiers.BigDamage, ZapinatorModifiers.BigKnockback, ZapinatorModifiers.NegativeKnockback }, maxModifiers = 3, bonusModifiers = 2 }); } } internal class NinjaGear : EquipmentBase { private static GameObject novaEffectPrefab = LegacyResourcesAPI.Load("prefabs/effects/JellyfishNova"); private static bool createSmokeBomb = true; [AutoConfig("Smoke Bomb Radius", 13f)] private static float smokeBombRadius = 13f; [AutoConfig("Smoke Bomb Damage Coefficient", 1f)] private static float smokeBombDamageCoefficient = 1f; [AutoConfig("Smoke Bomb Proc Coefficient", 1f)] private static float smokeBombProcCoefficient = 1f; [AutoConfig("Vertical Dash Velocity", 1.5f)] private static float dashVelocityVertical = 1.5f; [AutoConfig("Horizontal Dash Velocity", 25f)] private static float dashVelocityHorizontal = 25f; [AutoConfig("Dodge Chance", 20)] private static int dodgeChance = 20; public override string ConfigName => "Equipment : Master Ninja Gear"; public override string EquipmentName => "Master Ninja Gear"; public override string EquipmentLangTokenName => "NINJAGEAR"; public override string EquipmentPickupDesc => "Have a chance to dodge incoming attacks. Activate to dash and drop smoke bombs."; public override string EquipmentFullDescription => "Activate to " + Language.Styling.UtilityColor($"dash forward {dashVelocityHorizontal}m") + ((dodgeChance > 0) ? (", and gain a " + Language.Styling.HealingColor($"{dodgeChance}% chance") + " to " + Language.Styling.HealingColor("dodge") + " incoming attacks. ") : ". ") + "Dashing and dodging will drop a " + Language.Styling.DamageColor("smoke bomb") + ", " + Language.Styling.UtilityColor("stunning enemies") + " " + $"within {smokeBombRadius}m for {Language.Styling.UtilityColor($"{smokeBombProcCoefficient} second")}."; public override string EquipmentLore => ""; public override GameObject EquipmentModel => EquipmentBase.LoadDropPrefab("mdlNinjaGear"); public override Sprite EquipmentIcon => EquipmentBase.LoadItemIcon("texIconNinjaGear"); public override float BaseCooldown => 7f; public override bool EnigmaCompatible => true; public override bool CanBeRandomlyActivated => false; public override ExpansionDef RequiredExpansion => SwanSongPlugin.expansionDefSS2; public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown HealthComponent.TakeDamageProcess += new hook_TakeDamageProcess(NinjaGearDodge); } private void NinjaGearDodge(orig_TakeDamageProcess orig, HealthComponent self, DamageInfo damageInfo) { //IL_0034: 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_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_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Expected O, but got Unknown if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.body)) { EquipmentSlot equipmentSlot = self.body.equipmentSlot; if (Object.op_Implicit((Object)(object)equipmentSlot) && equipmentSlot.equipmentIndex == EquipDef.equipmentIndex) { if (Util.CheckRoll((float)dodgeChance, 0f, (CharacterMaster)null)) { EffectData val = new EffectData { origin = damageInfo.position, rotation = Util.QuaternionSafeLookRotation((damageInfo.force != Vector3.zero) ? damageInfo.force : Random.onUnitSphere) }; EffectManager.SpawnEffect(AssetReferences.bearEffectPrefab, val, true); damageInfo.rejected = true; } if (damageInfo.rejected && NetworkServer.active) { CreateNinjaSmokeBomb(self.body); } } } orig.Invoke(self, damageInfo); } protected override bool ActivateEquipment(EquipmentSlot slot) { //IL_009a: 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_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_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_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Expected O, but got Unknown bool result = false; CharacterMotor characterMotor = slot.characterBody.characterMotor; if ((Object)(object)characterMotor != (Object)null) { float num = slot.characterBody.acceleration * characterMotor.airControl; float num2 = 15f; float num3 = dashVelocityVertical; if (slot.characterBody.moveSpeed > 0f && num > 0f) { float num4 = Mathf.Sqrt(dashVelocityHorizontal / num); float num5 = slot.characterBody.moveSpeed / num; num2 = (num4 + num5) / num5; Debug.Log((object)num2); } characterMotor.velocity *= 0.1f; ((BaseCharacterController)characterMotor).Motor.ForceUnground(0.1f); GenericCharacterMain.ApplyJumpVelocity(characterMotor, slot.characterBody, num2, num3, false); EffectManager.SpawnEffect(LegacyResourcesAPI.Load("Prefabs/Effects/BoostJumpEffect"), new EffectData { origin = slot.characterBody.footPosition, rotation = Util.QuaternionSafeLookRotation(characterMotor.velocity) }, true); if (NetworkServer.active) { CreateNinjaSmokeBomb(slot.characterBody); } result = true; } return result; } private static void CreateNinjaSmokeBomb(CharacterBody self) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: 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) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: 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_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_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Expected O, but got Unknown if (createSmokeBomb) { BlastAttack val = new BlastAttack(); val.radius = smokeBombRadius; val.procCoefficient = smokeBombProcCoefficient; val.position = self.transform.position; val.attacker = ((Component)self).gameObject; val.crit = Util.CheckRoll(self.crit, self.master); val.baseDamage = self.damage * smokeBombDamageCoefficient; val.falloffModel = (FalloffModel)0; val.damageType = DamageTypeCombo.op_Implicit((DamageType)32); val.baseForce = StealthMode.blastAttackForce; val.teamIndex = TeamComponent.GetObjectTeam(val.attacker); val.attackerFiltering = (AttackerFiltering)2; val.Fire(); EffectManager.SpawnEffect(StealthMode.smokeBombEffectPrefab, new EffectData { origin = self.footPosition }, true); EffectManager.SpawnEffect(novaEffectPrefab, new EffectData { origin = self.transform.position, scale = smokeBombRadius }, true); } } } internal class QuickStartEquipment : EquipmentBase { public override bool lockEnabled => true; public override string EquipmentName => "Stillborn Prayer"; public override string EquipmentLangTokenName => "QUICKSTARTEQUIPMENT"; public override string EquipmentPickupDesc => "Grants a single wish..."; public override string EquipmentFullDescription => "Grants an " + QuickStartArtifact.GetRarityName() + " item of your choice."; public override string EquipmentLore => ""; public override GameObject EquipmentModel => EquipmentBase.LoadDropPrefab(); public override Sprite EquipmentIcon => EquipmentBase.LoadItemIcon("texIconQuickStartEquipment"); public override float BaseCooldown => 0f; public override bool EnigmaCompatible => false; public override bool CanBeRandomlyActivated => false; public override bool CanDrop => false; public override string ConfigName => "Equipment : Quick Start (Stillborn Prayer)"; public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Hooks() { } protected override bool ActivateEquipment(EquipmentSlot slot) { //IL_001a: 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_0030: 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_004e: Unknown result type (might be due to invalid IL or missing references) Transform transform = ((Component)slot.characterBody).gameObject.transform; UniquePickup val = default(UniquePickup); ((UniquePickup)(ref val))..ctor(PickupCatalog.itemTierToPickupIndex[(ItemTier)1]); GameObject val2 = Object.Instantiate(CommandArtifactManager.commandCubePrefab, transform.position, transform.rotation); val2.GetComponent().NetworkpickupState = val; val2.GetComponent().SetOptionsFromPickupForCommandArtifact(val); NetworkServer.Spawn(val2); slot.inventory.SetEquipmentIndex((EquipmentIndex)(-1), false); return true; } } internal class TeslaEquipment : EquipmentBase { [AutoConfig("Base Shield Gain", 0.2f)] private float extraShields = 0.2f; [AutoConfig("Buff Duration", 10)] private float buffDuration = 10f; [AutoConfig("Max Health Fraction Cap For Shield Restoration", 0.05f)] private float healthFraction = 0.05f; [AutoConfig("Max Shield Fraction To Restore As Shields", 0.15f)] private float shieldFraction = 0.15f; [AutoConfig("Zap Damage Coefficient", 2f)] private float zapDamageCoefficient = 2f; [AutoConfig("Total Zaps", 4)] private float totalZaps = 4f; private static ItemDisplayRuleDict IDR = new ItemDisplayRuleDict(Array.Empty()); public override bool isEnabled => false; public override AssetBundle assetBundle => SwanSongPlugin.retierAssetBundle; public override string ConfigName => "Reworks : Unstable Tesla Coil"; public override string EquipmentName => "Remarkably Stable Tesla Coil"; public override string EquipmentLangTokenName => "TESLAEQUIPMENT"; public override string EquipmentPickupDesc => "Zap nearby enemies and restore Shields on kill."; public override string EquipmentFullDescription => Language.Styling.UtilityColor("Electrify") + " yourself for " + Language.Styling.UtilityColor($"{buffDuration} seconds") + ". Kills while " + Language.Styling.UtilityColor("Electrified") + " will zap " + Language.Styling.DamageColor(totalZaps.ToString()) + " nearby enemies for " + Language.Styling.DamageValueText(zapDamageCoefficient) + " and " + Language.Styling.HealingColor("restore " + Tools.ConvertDecimal(shieldFraction) + " of your shields") + ". Passively gain a " + Language.Styling.HealingColor("shield") + " equal to " + Language.Styling.HealingColor(Tools.ConvertDecimal(extraShields) + " of your maximum health") + "."; public override string EquipmentLore => "Tesla Presentation Software v1.14\nPowering on...\n10...\nIssuing welcome statement...\n9...\nWelcome one and all!\n8...\nPlease take a seat.\n7...\nMake sure those behind you can see.\n6...\nThe presentation will start shortly.\n5...\nPlease obey the staff for your safety.\n4...\nInitiating room mood lighting...\n3...\nGet ready to behold...\n2...\nThe marvelous wonders...\n1...\nOf electricity!\nPower anomaly detected..." + $"\nInitiating reboot procedure in {buffDuration}..."; public override GameObject EquipmentModel => LegacyResourcesAPI.Load("prefabs/pickupmodels/PickupTeslaCoil"); public override Sprite EquipmentIcon => assetBundle.LoadAsset("Assets/Icons/Unstable_Tesla_Coil.png"); public override float BaseCooldown => 45f; public override bool EnigmaCompatible => false; public override bool CanBeRandomlyActivated => false; public override ItemDisplayRuleDict CreateItemDisplayRules() { return IDR; } public override void Hooks() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Expected O, but got Unknown //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Expected O, but got Unknown ((ResourceAvailability)(ref BodyCatalog.availability)).onAvailable += delegate { EquipmentBase.CloneVanillaDisplayRules((Object)(object)EquipmentBase.instance.EquipDef, (Object)(object)Items.ShockNearby); }; GlobalEventManager.OnCharacterDeath += new hook_OnCharacterDeath(GrantShieldOnKill); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(AddBonusShield); SwanSongPlugin.RetierItemAsync(RoR2_Base_ShockNearby.ShockNearby_asset, (ItemTier)5); } private void AddBonusShield(CharacterBody sender, StatHookEventArgs args) { //IL_0018: 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) if ((Object)(object)sender.equipmentSlot != (Object)null && sender.equipmentSlot.equipmentIndex == EquipDef.equipmentIndex) { args.baseShieldAdd = sender.maxHealth * extraShields; } } private void GrantShieldOnKill(orig_OnCharacterDeath orig, GlobalEventManager self, DamageReport damageReport) { //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_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_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: 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_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010e: 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_0115: 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_0129: Expected O, but got Unknown //IL_0131: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, damageReport); CharacterBody attackerBody = damageReport.attackerBody; CharacterBody victimBody = damageReport.victimBody; if (!((Object)(object)attackerBody != (Object)null) || !attackerBody.HasBuff(Buffs.TeslaField)) { return; } HealthComponent healthComponent = attackerBody.healthComponent; if (!((Object)(object)healthComponent != (Object)null)) { return; } float num = attackerBody.maxHealth * healthFraction; float num2 = attackerBody.maxShield * shieldFraction; float num3 = Mathf.Max(num, num2); healthComponent.RechargeShield(num3); List list = new List(); for (int i = 0; (float)i < totalZaps; i++) { LightningOrb val = new LightningOrb { origin = damageReport.damageInfo.position, damageValue = attackerBody.damage * zapDamageCoefficient, isCrit = Util.CheckRoll(attackerBody.crit, 0f, (CharacterMaster)null), bouncesRemaining = 0, teamIndex = attackerBody.teamComponent.teamIndex, attacker = ((Component)attackerBody).gameObject, procCoefficient = 0.5f, bouncedObjects = list, lightningType = (LightningType)1, damageColorIndex = (DamageColorIndex)3, range = 50f }; HurtBox val2 = val.PickNextTarget(damageReport.damageInfo.position); if (Object.op_Implicit((Object)(object)val2)) { list.Add(val2.healthComponent); ((Orb)val).target = val2; OrbManager.instance.AddOrb((Orb)(object)val); } } } protected override bool ActivateEquipment(EquipmentSlot slot) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) bool result = false; CharacterBody characterBody = slot.characterBody; if ((Object)(object)characterBody != (Object)null) { characterBody.AddTimedBuffAuthority(Buffs.TeslaField.buffIndex, buffDuration); result = true; } return result; } } } namespace SwanSongExtended.Equipment.Zapinator { public enum ZapinatorModifiers { Nothing, TinyDamage, BigDamage, BigProcs, BigAoe, BigKnockback, SelfKnockback, NegativeKnockback, VerySlow, VeryFast, Backwards, BadAccuracy, MultiShot, Debuff } public struct ZapinatorProjectileData { public GameObject prefab; public ZapinatorProjectileType type; public ZapinatorModifiers[] possibleModifiers; public int maxModifiers; public int bonusModifiers; } public enum ZapinatorProjectileType { Captain = -2, Defensive, MovesFromSpawn, Stationary, RequiresTarget, RequiresSurface, Turret } public class ZapinatorRollData { public bool hasRolledBonusMultipliers = false; public float damageCoefficient = 10f; public float procCoefficient = 0.5f; public float aoeSizeMultiplier = 1f; public float forceMultiplier = 1000f; public float selfForceMultiplier = 0.5f; public float velocityMultiplier = 1f; public float accuracy = 1f; public int totalProjectiles = 1; public DamageType damageTypes; } } namespace SwanSongExtended.States { public class LeechingHealNovaPulse : BaseState { private class HealPulse { private readonly List healedTargets = new List(); private readonly SphereSearch sphereSearch; private float rate; private float t; private float finalRadius; private TeamMask teamMask; private readonly List hurtBoxesList = new List(); private float baseHealFraction; private float healMax; private float procCoeff; public bool isFinished => t >= 1f; public HealPulse(Vector3 origin, float finalRadius, float baseHeal, float healMax, float procCoeff, float duration, TeamIndex teamIndex) { //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_0035: 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_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Expected O, but got Unknown //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) sphereSearch = new SphereSearch { mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask, origin = origin, queryTriggerInteraction = (QueryTriggerInteraction)2, radius = 0f }; this.finalRadius = finalRadius; rate = 1f / duration; teamMask = default(TeamMask); ((TeamMask)(ref teamMask)).AddTeam(teamIndex); baseHealFraction = baseHeal; this.healMax = healMax; this.procCoeff = procCoeff; } public void Update(float deltaTime) { //IL_0064: Unknown result type (might be due to invalid IL or missing references) t += rate * deltaTime; t = ((t > 1f) ? 1f : t); sphereSearch.radius = finalRadius * TeleporterHealNovaPulse.novaRadiusCurve.Evaluate(t); sphereSearch.RefreshCandidates().FilterCandidatesByHurtBoxTeam(teamMask).FilterCandidatesByDistinctHurtBoxEntities() .GetHurtBoxes(hurtBoxesList); int i = 0; for (int count = hurtBoxesList.Count; i < count; i++) { HealthComponent healthComponent = hurtBoxesList[i].healthComponent; if (!healedTargets.Contains(healthComponent)) { healedTargets.Add(healthComponent); if (!EliteEquipmentBase.instance.IsElite(healthComponent.body)) { HealTarget(healthComponent); } } } hurtBoxesList.Clear(); } private void HealTarget(HealthComponent target) { //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) float num = baseHealFraction * target.fullHealth; float num2 = Mathf.Min(num, healMax) * procCoeff; target.Heal(num2, default(ProcChainMask), true); Util.PlaySound("Play_item_proc_TPhealingNova_hitPlayer", ((Component)target).gameObject); } } public static float duration = 1f; private Transform effectTransform; private HealPulse healPulse; private float radius; public static float baseRadius = 25f; public static float baseHealFraction = 0.25f; public static float maxHealFraction = 1.5f; internal LeechingHealingPulseComponent leechingHealingPulseComponent; public override void OnEnter() { //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_005b: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); radius = baseRadius + leechingHealingPulseComponent.bodyRadius; TeamFilter component = ((EntityState)this).GetComponent(); TeamIndex teamIndex = (TeamIndex)((!Object.op_Implicit((Object)(object)component)) ? (-1) : ((int)component.teamIndex)); if (NetworkServer.active) { float healMax = leechingHealingPulseComponent.maxHealth * maxHealFraction; healPulse = new HealPulse(((EntityState)this).transform.position, radius, baseHealFraction, healMax, leechingHealingPulseComponent.procCoefficient, duration, teamIndex); } effectTransform = ((EntityState)this).transform.Find("PulseEffect"); if (Object.op_Implicit((Object)(object)effectTransform)) { ((Component)effectTransform).gameObject.SetActive(true); } } public override void OnExit() { if (Object.op_Implicit((Object)(object)effectTransform)) { ((Component)effectTransform).gameObject.SetActive(false); } ((EntityState)this).OnExit(); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (NetworkServer.active) { healPulse.Update(Time.fixedDeltaTime); if (duration < ((EntityState)this).fixedAge) { EntityState.Destroy((Object)(object)((Component)((EntityState)this).outer).gameObject); } } } public override void Update() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)effectTransform)) { float num = baseRadius * TeleporterHealNovaPulse.novaRadiusCurve.Evaluate(((EntityState)this).fixedAge / duration); effectTransform.localScale = new Vector3(num, num, num); } } } internal class SquidBlaster : BaseSkillState { public static float damageCoefficient = 3f; private float force = 10f; public static float procCoefficient = 1f; public static float forceScalar = 1f; public static float fuseTime = 0.4f; public static float baseDuration = 2f; private float duration; private bool hasBlasted; private BullseyeSearch enemyFinder; public bool fullVision = true; public override void OnEnter() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; ((BaseState)this).GetAimRay(); ((EntityState)this).PlayAnimation("Gesture", "FireGoo"); if (((EntityState)this).isAuthority) { FireBomb(); } } private void FireBomb() { //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_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown //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_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_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: 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_0125: Unknown result type (might be due to invalid IL or missing references) if (!hasBlasted && NetworkServer.active) { Ray aimRay = ((BaseState)this).GetAimRay(); enemyFinder = new BullseyeSearch(); enemyFinder.viewer = ((EntityState)this).characterBody; enemyFinder.maxDistanceFilter = float.PositiveInfinity; enemyFinder.searchOrigin = ((Ray)(ref aimRay)).origin; enemyFinder.searchDirection = ((Ray)(ref aimRay)).direction; enemyFinder.sortMode = (SortMode)1; enemyFinder.teamMaskFilter = TeamMask.allButNeutral; enemyFinder.minDistanceFilter = 0f; enemyFinder.maxAngleFilter = (fullVision ? 180f : 90f); enemyFinder.filterByLoS = true; if (Object.op_Implicit((Object)(object)((EntityState)this).teamComponent)) { ((TeamMask)(ref enemyFinder.teamMaskFilter)).RemoveTeam(((EntityState)this).teamComponent.teamIndex); } enemyFinder.RefreshCandidates(); HurtBox val = enemyFinder.GetResults().FirstOrDefault(); if (Object.op_Implicit((Object)(object)val)) { Blast(aimRay, val); } } } private void Blast(Ray aimRay, HurtBox hurtBox) { //IL_0007: 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_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_002b: 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_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: 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_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) Vector3 position = ((Component)hurtBox).transform.position; Ray aimRay2 = ((BaseState)this).GetAimRay(); Vector3 val = position - ((Ray)(ref aimRay2)).origin; aimRay2 = ((BaseState)this).GetAimRay(); ((Ray)(ref aimRay)).origin = ((Ray)(ref aimRay2)).origin; ((Ray)(ref aimRay)).direction = val; ((EntityState)this).inputBank.aimDirection = val; ((BaseState)this).StartAimMode(aimRay, 2f, false); hasBlasted = true; FireProjectileInfo val2 = default(FireProjectileInfo); val2.projectilePrefab = CommonAssets.squidBlasterBall; val2.position = ((Ray)(ref aimRay)).origin; val2.rotation = Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction); val2.owner = ((EntityState)this).gameObject; val2.damage = damageCoefficient * ((EntityState)this).characterBody.damage; val2.force = force; val2.crit = Util.CheckRoll(((BaseState)this).critStat, ((EntityState)this).characterBody.master); ((FireProjectileInfo)(ref val2)).speedOverride = 60f; val2.useSpeedOverride = true; ((FireProjectileInfo)(ref val2)).fuseOverride = fuseTime; val2.useFuseOverride = true; FireProjectileInfo val3 = val2; ProjectileManager.instance.FireProjectile(val3); } public override void OnExit() { ((EntityState)this).OnExit(); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)3; } } internal class VoidLaserBeam : BaseSkillState { public GameObject muzzleflashEffectPrefab = LegacyResourcesAPI.Load("prefabs/effects/muzzleflashes/MuzzleflashMageLightningLarge"); public string attackSoundString = FireLaserbolt.attackString; public string attackSoundString2 = "Play_mage_m2_impact"; private float duration; private bool hasFiredGauntlet = false; private string muzzleString = "Head"; private Transform muzzleTransform; private Animator animator; private ChildLocator childLocator; public static float baseRecoilAmplitude = 10f; public static float maxRange = 1000f; public float procCoefficient => VoidLaserTurbineSkill.procCoefficient; public static float damageCoefficient => VoidLaserTurbineSkill.damageCoefficient; public float force => VoidLaserTurbineSkill.force; public float selfForce => VoidLaserTurbineSkill.selfForce; public float baseDuration => VoidLaserTurbineSkill.baseDuration; public override void OnEnter() { ((BaseState)this).OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; Util.PlaySound(attackSoundString, ((EntityState)this).gameObject); Util.PlaySound(attackSoundString2, ((EntityState)this).gameObject); float num = baseRecoilAmplitude / ((BaseState)this).attackSpeedStat; ((BaseState)this).AddRecoil(0f - num, -2f * num, 0f - num, num); ((EntityState)this).characterBody.SetAimTimer(2f); animator = ((EntityState)this).GetModelAnimator(); if (Object.op_Implicit((Object)(object)animator)) { childLocator = ((Component)animator).GetComponent(); } FireLaser(); } public override void OnExit() { ((EntityState)this).OnExit(); } private void FireLaser() { //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_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: 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_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0177: 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_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019c: 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_009b: 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) if (hasFiredGauntlet) { return; } hasFiredGauntlet = true; Ray aimRay = ((BaseState)this).GetAimRay(); if (Object.op_Implicit((Object)(object)childLocator)) { muzzleTransform = childLocator.FindChild(muzzleString); } if (Object.op_Implicit((Object)(object)muzzleflashEffectPrefab)) { EffectManager.SimpleMuzzleFlash(muzzleflashEffectPrefab, ((EntityState)this).gameObject, muzzleString, false); } if (((EntityState)this).isAuthority) { if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.ApplyForce(((Ray)(ref aimRay)).direction * (0f - selfForce), false, false); } new BulletAttack { owner = ((EntityState)this).gameObject, weapon = ((EntityState)this).gameObject, origin = ((Ray)(ref aimRay)).origin, aimVector = ((Ray)(ref aimRay)).direction, minSpread = 0f, maxSpread = 0f, damage = damageCoefficient * ((BaseState)this).damageStat, procCoefficient = procCoefficient, stopperMask = LayerMask.op_Implicit(0), force = force, tracerEffectPrefab = VoidLaserTurbineSkill.tracerLaser, muzzleName = muzzleString, hitEffectPrefab = FireLaserbolt.impactEffectPrefab, isCrit = Util.CheckRoll(((BaseState)this).critStat, ((EntityState)this).characterBody.master), radius = 5f, falloffModel = (FalloffModel)0, maxDistance = maxRange, smartCollision = false, damageType = DamageTypeCombo.GenericPrimary }.Fire(); } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)3; } } } namespace SwanSongExtended.Elites { public abstract class EliteEquipmentBase : EliteEquipmentBase where T : EliteEquipmentBase { public static T instance { get; private set; } public EliteEquipmentBase() { if (instance != null) { throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting EquipmentBoilerplate/Equipment was instantiated twice"); } instance = this as T; } } public abstract class EliteEquipmentBase : SharedBase { public class EliteOverlayManager : MonoBehaviour { public TemporaryOverlay Overlay; public CharacterBody Body; public BuffDef EliteBuffDef; public void FixedUpdate() { if (!Body.HasBuff(EliteBuffDef)) { Object.Destroy((Object)(object)Overlay); Object.Destroy((Object)(object)this); } } } public enum TargetingType { Enemies, Friendlies } public class TargetingControllerComponent : MonoBehaviour { public GameObject TargetObject; public GameObject VisualizerPrefab; public Indicator Indicator; public BullseyeSearch TargetFinder; public Action AdditionalBullseyeFunctionality = delegate { }; public void Awake() { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown Indicator = new Indicator(((Component)this).gameObject, (GameObject)null); } public void OnDestroy() { Invalidate(); } public void Invalidate() { TargetObject = null; Indicator.targetTransform = null; } public void ConfigureTargetFinderBase(EquipmentSlot self) { //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_003f: 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_0063: 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_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown if (TargetFinder == null) { TargetFinder = new BullseyeSearch(); } TargetFinder.teamMaskFilter = TeamMask.allButNeutral; ((TeamMask)(ref TargetFinder.teamMaskFilter)).RemoveTeam(self.characterBody.teamComponent.teamIndex); TargetFinder.sortMode = (SortMode)2; TargetFinder.filterByLoS = true; float num = default(float); Ray val = CameraRigController.ModifyAimRayIfApplicable(self.GetAimRay(), ((Component)self).gameObject, ref num); TargetFinder.searchOrigin = ((Ray)(ref val)).origin; TargetFinder.searchDirection = ((Ray)(ref val)).direction; TargetFinder.maxAngleFilter = 10f; TargetFinder.viewer = self.characterBody; } public void ConfigureTargetFinderForEnemies(EquipmentSlot self) { //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_0024: Unknown result type (might be due to invalid IL or missing references) ConfigureTargetFinderBase(self); TargetFinder.teamMaskFilter = TeamMask.GetUnprotectedTeams(self.characterBody.teamComponent.teamIndex); TargetFinder.RefreshCandidates(); TargetFinder.FilterOutGameObject(((Component)self).gameObject); AdditionalBullseyeFunctionality(TargetFinder); PlaceTargetingIndicator(TargetFinder.GetResults()); } public void ConfigureTargetFinderForFriendlies(EquipmentSlot self) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) ConfigureTargetFinderBase(self); TargetFinder.teamMaskFilter = TeamMask.none; ((TeamMask)(ref TargetFinder.teamMaskFilter)).AddTeam(self.characterBody.teamComponent.teamIndex); TargetFinder.RefreshCandidates(); TargetFinder.FilterOutGameObject(((Component)self).gameObject); AdditionalBullseyeFunctionality(TargetFinder); PlaceTargetingIndicator(TargetFinder.GetResults()); } public void PlaceTargetingIndicator(IEnumerable TargetFinderResults) { HurtBox val = (TargetFinderResults.Any() ? TargetFinderResults.First() : null); if (Object.op_Implicit((Object)(object)val)) { TargetObject = ((Component)val.healthComponent).gameObject; Indicator.visualizerPrefab = VisualizerPrefab; Indicator.targetTransform = ((Component)val).transform; } else { Invalidate(); } Indicator.active = Object.op_Implicit((Object)(object)val); } } public EquipmentDef EliteEquipmentDef; public BuffDef EliteBuffDef; public EliteDef EliteDef; public GameObject TargetingIndicatorPrefabBase = null; public abstract string EliteEquipmentName { get; } public abstract string EliteAffixToken { get; } public abstract string EliteEquipmentPickupDesc { get; } public abstract string EliteEquipmentFullDescription { get; } public abstract string EliteEquipmentLore { get; } public abstract string EliteModifier { get; } public abstract float EliteHealthModifier { get; } public abstract float EliteDamageModifier { get; } public virtual bool AppearsInSinglePlayer { get; } = true; public virtual bool AppearsInMultiPlayer { get; } = true; public virtual bool CanDrop { get; } = false; public virtual float Cooldown { get; } = 60f; public virtual bool EnigmaCompatible { get; } = false; public virtual bool IsBoss { get; } = false; public virtual bool IsLunar { get; } = false; public abstract GameObject EliteEquipmentModel { get; } public abstract Sprite EliteEquipmentIcon { get; } public abstract Texture2D EliteBuffIcon { get; } public virtual Color EliteBuffColor { get; set; } = Color32.op_Implicit(new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue)); public virtual EliteModule.EliteTiers EliteTier { get; set; } = EliteModule.EliteTiers.Other; public virtual Material EliteOverlayMaterial { get; set; } = null; public virtual string EliteRampTextureName { get; set; } = null; public virtual float DropOnDeathChance { get; set; } = 0f; public virtual ExpansionDef RequiredExpansion { get; } = null; public virtual bool UseTargeting { get; } = false; public virtual TargetingType TargetingTypeEnum { get; } = TargetingType.Enemies; public EliteTierDef[] VanillaTier1() { List list = new List(); EliteTierDef[] vanillaEliteTiers = EliteAPI.VanillaEliteTiers; foreach (EliteTierDef val in vanillaEliteTiers) { if (val.eliteTypes.Contains(Elites.Fire)) { list.Add(val); } } return list.ToArray(); } public EliteTierDef[] VanillaTier2() { List list = new List(); EliteTierDef[] vanillaEliteTiers = EliteAPI.VanillaEliteTiers; foreach (EliteTierDef val in vanillaEliteTiers) { EliteDef[] array = (EliteDef[])(object)new EliteDef[2] { Elites.Poison, Elites.Haunted }; if (val.eliteTypes.Contains(Elites.Poison)) { list.Add(val); } } return list.ToArray(); } public override void Init() { base.Init(); CreateEliteEquipment(); CreateElite(); } public abstract ItemDisplayRuleDict CreateItemDisplayRules(); public override void Lang() { LanguageAPI.Add("BORBO_ELITE_EQUIPMENT_" + EliteAffixToken + "_NAME", EliteEquipmentName); LanguageAPI.Add("BORBO_ELITE_EQUIPMENT_" + EliteAffixToken + "_PICKUP", EliteEquipmentPickupDesc); LanguageAPI.Add("BORBO_ELITE_EQUIPMENT_" + EliteAffixToken + "_DESCRIPTION", EliteEquipmentFullDescription); LanguageAPI.Add("BORBO_ELITE_EQUIPMENT_" + EliteAffixToken + "_LORE", EliteEquipmentLore); LanguageAPI.Add("BORBO_ELITE_" + EliteAffixToken + "_MODIFIER", EliteModifier + " {0}"); } protected virtual void CreateEliteEquipment() { //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: 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_004d: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Expected O, but got Unknown //IL_0315: Unknown result type (might be due to invalid IL or missing references) //IL_031b: Expected O, but got Unknown //IL_0335: Unknown result type (might be due to invalid IL or missing references) //IL_033f: Expected O, but got Unknown //IL_0364: Unknown result type (might be due to invalid IL or missing references) //IL_036e: Expected O, but got Unknown //IL_0389: Unknown result type (might be due to invalid IL or missing references) //IL_0393: Expected O, but got Unknown Sprite buffIcon = null; if ((Object)(object)EliteBuffIcon != (Object)null) { buffIcon = Sprite.Create(EliteBuffIcon, new Rect(0f, 0f, (float)((Texture)EliteBuffIcon).width, (float)((Texture)EliteBuffIcon).height), new Vector2(0.5f, 0.5f)); } EliteBuffDef = Content.CreateAndAddBuff("bd" + EliteAffixToken, buffIcon, EliteBuffColor, canStack: false, isDebuff: false, (StackingDisplayMethod)0); EliteDef = ScriptableObject.CreateInstance(); ((Object)EliteDef).name = "BORBO_ELITE_" + EliteAffixToken; EliteDef.modifierToken = "BORBO_ELITE_" + EliteAffixToken + "_MODIFIER"; EliteDef.color = Color32.op_Implicit(EliteBuffColor); EliteDef.shaderEliteRampIndex = 0; EliteDef.damageBoostCoefficient = EliteDamageModifier - 1f; EliteDef.healthBoostCoefficient = EliteHealthModifier - 1f; Texture2D val = CommonAssets.mainAssetBundle.LoadAsset(CommonAssets.eliteMaterialsPath + EliteRampTextureName + ".png"); if ((Object)(object)val != (Object)null) { EliteRamp.AddRamp(EliteDef, val); } EliteEquipmentDef = ScriptableObject.CreateInstance(); ((Object)EliteEquipmentDef).name = "BORBO_ELITE_EQUIPMENT_" + EliteAffixToken; EliteEquipmentDef.nameToken = "BORBO_ELITE_EQUIPMENT_" + EliteAffixToken + "_NAME"; EliteEquipmentDef.pickupToken = "BORBO_ELITE_EQUIPMENT_" + EliteAffixToken + "_PICKUP"; EliteEquipmentDef.descriptionToken = "BORBO_ELITE_EQUIPMENT_" + EliteAffixToken + "_DESCRIPTION"; EliteEquipmentDef.loreToken = "BORBO_ELITE_EQUIPMENT_" + EliteAffixToken + "_LORE"; EliteEquipmentDef.pickupModelPrefab = EliteEquipmentModel; EliteEquipmentDef.pickupIconSprite = EliteEquipmentIcon; EliteEquipmentDef.appearsInSinglePlayer = AppearsInSinglePlayer; EliteEquipmentDef.appearsInMultiPlayer = AppearsInMultiPlayer; EliteEquipmentDef.canDrop = CanDrop; EliteEquipmentDef.cooldown = Cooldown; EliteEquipmentDef.enigmaCompatible = EnigmaCompatible; EliteEquipmentDef.isBoss = IsBoss; EliteEquipmentDef.isLunar = IsLunar; EliteEquipmentDef.dropOnDeathChance = DropOnDeathChance; EliteEquipmentDef.requiredExpansion = RequiredExpansion; EliteDef.eliteEquipmentDef = EliteEquipmentDef; EliteEquipmentDef.passiveBuffDef = EliteBuffDef; EliteBuffDef.eliteDef = EliteDef; ItemAPI.Add(new CustomEquipment(EliteEquipmentDef, CreateItemDisplayRules())); Content.AddEliteDef(EliteDef); CustomElite val2 = new CustomElite(EliteDef, (IEnumerable)(object)new EliteTierDef[0]); EliteModule.CustomEliteDef customElite = GetCustomElite(); EliteModule.Elites.Add(customElite); EquipmentSlot.PerformEquipmentAction += new hook_PerformEquipmentAction(PerformEquipmentAction); if (UseTargeting && Object.op_Implicit((Object)(object)TargetingIndicatorPrefabBase)) { EquipmentSlot.Update += new hook_Update(UpdateTargeting); } if (Object.op_Implicit((Object)(object)EliteOverlayMaterial)) { CharacterBody.FixedUpdate += new hook_FixedUpdate(OverlayManager); } } protected virtual EliteModule.CustomEliteDef GetCustomElite() { EliteModule.CustomEliteDef customEliteDef = ScriptableObject.CreateInstance(); customEliteDef.eliteDef = EliteDef; customEliteDef.eliteTier = EliteTier; customEliteDef.eliteRamp = CommonAssets.mainAssetBundle.LoadAsset(CommonAssets.eliteMaterialsPath + EliteRampTextureName + ".png"); customEliteDef.overlayMaterial = EliteOverlayMaterial; customEliteDef.spawnEffect = null; return customEliteDef; } private void OverlayManager(orig_FixedUpdate orig, CharacterBody self) { if (Object.op_Implicit((Object)(object)self.modelLocator) && Object.op_Implicit((Object)(object)self.modelLocator.modelTransform) && self.HasBuff(EliteBuffDef) && !Object.op_Implicit((Object)(object)((Component)self).GetComponent())) { TemporaryOverlay val = ((Component)self.modelLocator.modelTransform).gameObject.AddComponent(); val.duration = float.PositiveInfinity; val.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); val.animateShaderAlpha = true; val.destroyComponentOnEnd = true; val.originalMaterial = EliteOverlayMaterial; val.AddToCharacerModel(((Component)self.modelLocator.modelTransform).GetComponent()); EliteOverlayManager eliteOverlayManager = ((Component)self).gameObject.AddComponent(); eliteOverlayManager.Overlay = val; eliteOverlayManager.Body = self; eliteOverlayManager.EliteBuffDef = EliteBuffDef; ((Component)self.modelLocator.modelTransform).GetComponent().UpdateOverlays(); self.RecalculateStats(); } orig.Invoke(self); } protected void CreateElite() { } internal bool IsElite(CharacterBody body, BuffDef buffDef = null) { if ((Object)(object)buffDef == (Object)null) { buffDef = EliteBuffDef; } return body.HasBuff(buffDef); } protected bool PerformEquipmentAction(orig_PerformEquipmentAction orig, EquipmentSlot self, EquipmentDef equipmentDef) { if ((Object)(object)equipmentDef == (Object)(object)EliteEquipmentDef) { return ActivateEquipment(self); } return orig.Invoke(self, equipmentDef); } protected abstract bool ActivateEquipment(EquipmentSlot slot); protected void UpdateTargeting(orig_Update orig, EquipmentSlot self) { //IL_000a: 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) orig.Invoke(self); if (self.equipmentIndex != EliteEquipmentDef.equipmentIndex) { return; } TargetingControllerComponent targetingControllerComponent = ((Component)self).GetComponent(); if (!Object.op_Implicit((Object)(object)targetingControllerComponent)) { targetingControllerComponent = ((Component)self).gameObject.AddComponent(); targetingControllerComponent.VisualizerPrefab = TargetingIndicatorPrefabBase; } if (self.stock > 0) { switch (TargetingTypeEnum) { case TargetingType.Enemies: targetingControllerComponent.ConfigureTargetFinderForEnemies(self); break; case TargetingType.Friendlies: targetingControllerComponent.ConfigureTargetFinderForFriendlies(self); break; } } else { targetingControllerComponent.Invalidate(); targetingControllerComponent.Indicator.active = false; } } } internal class FrenziedAspect : T1EliteEquipmentBase { [AutoConfig("Transfer Buff Duration", 6f)] public static float frenziedTransferDuration = 6f; [AutoConfig("Transfer Buff Count Base", 1f)] public static float transferCountBase = 1f; [AutoConfig("Transfer Buff Count Per Radius", 1f)] public static float transferCountPerRadius = 1f; [AutoConfig("Transfer Buff Range Base", 24f)] public static float transferRangeBase = 24f; [AutoConfig("Transfer Buff Range Per Radius", 12f)] public static float transferRangePerRadius = 12f; [AutoConfig("Cooldown Reduction Fraction", 0.4f)] public static float cooldownReduction = 0.4f; [AutoConfig("Bonus Movement Speed Multiplier", 1.2f)] public static float moveSpeedBonus = 1.2f; [AutoConfig("Bonus Attack Speed Multiplier", 1.8f)] public static float atkSpeedBonus = 1.8f; public override string ConfigName => "Elites : " + EliteModifier; public override AssetBundle assetBundle => SwanSongPlugin.mainAssetBundle; public override string EliteEquipmentName => "Chir’s Tempo"; public override string EliteEquipmentPickupDesc => "Become an aspect of velocity."; public override string EliteAffixToken => "AFFIX_SPEED"; public override string EliteModifier => "Hallowed"; public override string EliteEquipmentFullDescription => "Increase movement, attack, and ability recharge speed."; public override string EliteEquipmentLore => ""; public override float EliteHealthModifier => 2f; public override GameObject EliteEquipmentModel => LegacyResourcesAPI.Load("prefabs/NullModel"); public override Sprite EliteEquipmentIcon => LegacyResourcesAPI.Load("textures/miscicons/texWIPIcon"); public override string EliteRampTextureName { get; set; } = "texRampFrenzied"; public override EliteModule.EliteTiers EliteTier { get; set; } = EliteModule.EliteTiers.Tier1AndHalf; public override bool CanDrop { get; } = false; public override float Cooldown { get; } = 0f; public override Texture2D EliteBuffIcon => Addressables.LoadAssetAsync((object)"RoR2/Base/EliteLightning/texBuffAffixBlue.tif").WaitForCompletion(); public override Color EliteBuffColor => new Color(1f, 0.7f, 0f, 1f); public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Init() { base.Init(); } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(FrenziedStatBuff); CharacterBody.RecalculateStats += new hook_RecalculateStats(FrenziedCooldownBuff); GlobalEventManager.OnCharacterDeath += new hook_OnCharacterDeath(FrenziedTransferDeath); } private void FrenziedTransferDeath(orig_OnCharacterDeath orig, GlobalEventManager self, DamageReport damageReport) { //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_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_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: 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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0182: 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_01a6: Expected O, but got Unknown CharacterBody victimBody = damageReport.victimBody; CharacterBody attackerBody = damageReport.attackerBody; if ((Object)(object)victimBody != (Object)null && (Object)(object)attackerBody != (Object)null && victimBody.HasBuff(EliteBuffDef)) { int num = Mathf.CeilToInt(transferCountBase + victimBody.radius * transferCountPerRadius); float radius = transferRangeBase + victimBody.radius * transferRangePerRadius; SphereSearch val = new SphereSearch { mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask, origin = victimBody.transform.position, queryTriggerInteraction = (QueryTriggerInteraction)2, radius = radius }; TeamMask enemyTeams = TeamMask.GetEnemyTeams(attackerBody.teamComponent.teamIndex); List list = new List(); val.RefreshCandidates().FilterCandidatesByHurtBoxTeam(enemyTeams).FilterCandidatesByDistinctHurtBoxEntities() .OrderCandidatesByDistance() .GetHurtBoxes(list); int count = list.Count; for (int i = 0; i < num && i < count; i++) { HurtBox val2 = list[i]; if (!((Object)(object)val2 == (Object)null)) { HealthComponent healthComponent = val2.healthComponent; CharacterBody body = healthComponent.body; if (!((Object)(object)body == (Object)null) && !((Object)(object)body == (Object)(object)victimBody) && !body.HasBuff(EliteBuffDef)) { body.AddTimedBuff(EliteBuffDef, frenziedTransferDuration); EffectManager.SpawnEffect(LegacyResourcesAPI.Load("prefabs/effects/JellyfishNova"), new EffectData { origin = body.corePosition, scale = body.bestFitRadius + 4f }, true); } } } } orig.Invoke(self, damageReport); } private void FrenziedCooldownBuff(orig_RecalculateStats orig, CharacterBody self) { orig.Invoke(self); if (IsElite(self, EliteBuffDef)) { float num = 1f - cooldownReduction; if (Object.op_Implicit((Object)(object)self.skillLocator.primary)) { GenericSkill primary = self.skillLocator.primary; primary.cooldownScale *= num; } if (Object.op_Implicit((Object)(object)self.skillLocator.secondary)) { GenericSkill secondary = self.skillLocator.secondary; secondary.cooldownScale *= num; } if (Object.op_Implicit((Object)(object)self.skillLocator.utility)) { GenericSkill utility = self.skillLocator.utility; utility.cooldownScale *= num; } if (Object.op_Implicit((Object)(object)self.skillLocator.special)) { GenericSkill special = self.skillLocator.special; special.cooldownScale *= num; } } } private void FrenziedStatBuff(CharacterBody sender, StatHookEventArgs args) { if (IsElite(sender, EliteBuffDef)) { args.moveSpeedMultAdd += moveSpeedBonus; args.baseAttackSpeedAdd += atkSpeedBonus; } } protected override bool ActivateEquipment(EquipmentSlot slot) { return false; } } internal class LeechingAspect : EliteEquipmentBase { public static float healPulseRadius = 25.135456f; public static float healFraction = 0.1f; public static float maxHealFraction = 2f; public static GameObject pulsePrefab; public override bool lockEnabled => true; public override bool isEnabled => false; public override string ConfigName => "Elites : " + EliteModifier; public override AssetBundle assetBundle => SwanSongPlugin.mainAssetBundle; public override string EliteEquipmentName => "N’Kuhana’s Concession"; public override string EliteAffixToken => "AFFIX_LEECH"; public override string EliteEquipmentPickupDesc => "Become an aspect of eternity."; public override string EliteEquipmentFullDescription => ""; public override string EliteEquipmentLore => ""; public override string EliteModifier => "Serpentine"; public override float EliteHealthModifier => 9f; public override float EliteDamageModifier => 4.5f; public override GameObject EliteEquipmentModel => LegacyResourcesAPI.Load("prefabs/NullModel"); public override Sprite EliteEquipmentIcon => LegacyResourcesAPI.Load("textures/miscicons/texWIPIcon"); public override Texture2D EliteBuffIcon => Addressables.LoadAssetAsync((object)"RoR2/Base/EliteHaunted/texBuffAffixHaunted.tif").WaitForCompletion(); public override Color EliteBuffColor => Color.magenta; public override string EliteRampTextureName { get; set; } = "texRampLeeching"; public override EliteModule.EliteTiers EliteTier { get; set; } = EliteModule.EliteTiers.Tier2; public override bool CanDrop { get; } = false; public override float Cooldown { get; } = 0f; public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown GlobalEventManager.ProcessHitEnemy += new hook_ProcessHitEnemy(LeechingOnHit); TeleporterHealNovaWindup.OnEnter += new hook_OnEnter(LeechingHealingPulseIntercept); CharacterBody.OnInventoryChanged += new hook_OnInventoryChanged(LeechingPulseRangeIndicator); } private void LeechingPulseRangeIndicator(orig_OnInventoryChanged orig, CharacterBody self) { orig.Invoke(self); self.AddItemBehavior(IsElite(self) ? 1 : 0); } public override void Init() { CreatePulsePrefab(); base.Init(); } private void CreatePulsePrefab() { pulsePrefab = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("prefabs/networkedobjects/teleporterhealnovapulse"), "LeechingHealNovaPulse", true); LeechingHealingPulseComponent leechingHealingPulseComponent = pulsePrefab.AddComponent(); Content.AddEntityState(typeof(LeechingHealNovaPulse)); Transform val = pulsePrefab.transform.Find("PP"); if ((Object)(object)val == (Object)null) { Debug.Log((object)"No PP found"); PostProcessDuration componentInChildren = pulsePrefab.GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { val = ((Component)componentInChildren).transform; } } if ((Object)(object)val != (Object)null) { Object.Destroy((Object)(object)((Component)val).gameObject); } } private void LeechingOnHit(orig_ProcessHitEnemy orig, GlobalEventManager self, DamageInfo damageInfo, GameObject victim) { if (Object.op_Implicit((Object)(object)damageInfo.attacker) && Object.op_Implicit((Object)(object)victim) && NetworkServer.active && damageInfo.procCoefficient > 0f) { CharacterBody component = damageInfo.attacker.GetComponent(); CharacterBody component2 = victim.GetComponent(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component2) && IsElite(component)) { CreatePulse(component, damageInfo); } } orig.Invoke(self, damageInfo, victim); } protected void CreatePulse(CharacterBody body, DamageInfo damageInfo) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_001f: 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_0036: Unknown result type (might be due to invalid IL or missing references) TeamIndex teamIndex = body.teamComponent.teamIndex; Transform transform = damageInfo.attacker.transform; GameObject val = Object.Instantiate(pulsePrefab, transform.position, transform.rotation); val.GetComponent().teamIndex = teamIndex; LeechingHealingPulseComponent leechingHealingPulseComponent = val.GetComponent(); if ((Object)(object)leechingHealingPulseComponent == (Object)null) { Debug.Log((object)"LHP null!"); leechingHealingPulseComponent = val.AddComponent(); } leechingHealingPulseComponent.procCoefficient = damageInfo.procCoefficient; leechingHealingPulseComponent.maxHealth = body.healthComponent.fullCombinedHealth; leechingHealingPulseComponent.bodyRadius = body.radius; NetworkServer.Spawn(val); } private void LeechingHealingPulseIntercept(orig_OnEnter orig, TeleporterHealNovaWindup self) { orig.Invoke(self); LeechingHealingPulseComponent component = ((EntityState)self).gameObject.GetComponent(); if (Object.op_Implicit((Object)(object)component) && ((EntityState)self).isAuthority) { ((EntityState)self).outer.SetNextState((EntityState)(object)new LeechingHealNovaPulse { leechingHealingPulseComponent = component }); } } private void LeechingHealingPulse(orig_OnEnter orig, TeleporterHealNovaPulse self) { //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_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_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Expected O, but got Unknown //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); LeechingHealingPulseComponent component = ((EntityState)self).gameObject.GetComponent(); if (!((Object)(object)component != (Object)null)) { return; } self.radius = healPulseRadius; self.healPulse.finalRadius = healPulseRadius; self.healPulse.healFractionValue = 0f; TeamFilter component2 = ((EntityState)self).GetComponent(); TeamIndex val = (TeamIndex)((!Object.op_Implicit((Object)(object)component2)) ? (-1) : ((int)component2.teamIndex)); float num = component.maxHealth * maxHealFraction; float procCoefficient = component.procCoefficient; SphereSearch val2 = new SphereSearch { mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask, origin = ((EntityState)self).transform.position, queryTriggerInteraction = (QueryTriggerInteraction)2, radius = healPulseRadius }; TeamMask val3 = default(TeamMask); List list = new List(); List list2 = new List(); ((TeamMask)(ref val3)).AddTeam(val); val2.RefreshCandidates().FilterCandidatesByHurtBoxTeam(val3).FilterCandidatesByDistinctHurtBoxEntities() .GetHurtBoxes(list); for (int i = 0; i < list.Count; i++) { HealthComponent healthComponent = list[i].healthComponent; if (!list2.Contains(healthComponent)) { list2.Add(healthComponent); if (!IsElite(healthComponent.body)) { float num2 = healthComponent.fullHealth * healFraction; float num3 = Mathf.Max(num2, num) * procCoefficient; healthComponent.Heal(num3, default(ProcChainMask), true); } } } } private void AssignEliteTier() { EliteTierDef[] eliteTiers = CombatDirector.eliteTiers; foreach (EliteTierDef val in eliteTiers) { EliteDef[] array = (EliteDef[])(object)new EliteDef[2] { Elites.Poison, Elites.Haunted }; if (val.eliteTypes == array) { } } } protected override bool ActivateEquipment(EquipmentSlot slot) { return false; } } public class AffixSerpentineBehavior : ItemBehavior { private const float scaleMultiplier = 1.9f; private GameObject affixLeechingWard; private void FixedUpdate() { //IL_0089: 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_00a9: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { return; } bool flag = base.stack > 0; if (Object.op_Implicit((Object)(object)affixLeechingWard) != flag) { if (flag) { affixLeechingWard = Object.Instantiate(LegacyResourcesAPI.Load("Prefabs/NetworkedObjects/NearbyDamageBonusIndicator"), base.body.transform); affixLeechingWard.GetComponent().AttachToGameObjectAndSpawn(((Component)this).gameObject, (string)null); affixLeechingWard.transform.Find("Radius, Spherical").localScale = Vector3.one * (LeechingHealNovaPulse.baseRadius + base.body.radius) * 1.9f; } else { Object.Destroy((Object)(object)affixLeechingWard); affixLeechingWard = null; } } } private void OnDisable() { if (Object.op_Implicit((Object)(object)affixLeechingWard)) { Object.Destroy((Object)(object)affixLeechingWard); } } } internal class SimulatedAspect : EliteEquipmentBase { private int maxDuration = 30; private int minDuration = 7; public override bool isEnabled => false; public override string ConfigName => "Elites : " + EliteModifier; public override AssetBundle assetBundle => SwanSongPlugin.mainAssetBundle; public override string EliteEquipmentName => "Abyssal gaze"; public override string EliteAffixToken => "AFFIX_SIMULATED"; public override string EliteEquipmentPickupDesc => "Become an aspect of the simulacrum"; public override string EliteEquipmentFullDescription => "Some stats up idk, lol"; public override string EliteEquipmentLore => ""; public override string EliteModifier => "Simulated"; public override float EliteHealthModifier => 0.7f; public override float EliteDamageModifier => 2f; public override GameObject EliteEquipmentModel => LegacyResourcesAPI.Load("prefabs/NullModel"); public override Sprite EliteEquipmentIcon => LegacyResourcesAPI.Load("textures/miscicons/texWIPIcon"); public override Texture2D EliteBuffIcon => Addressables.LoadAssetAsync((object)"RoR2/Base/EliteLightning/texBuffAffixBlue.tif").WaitForCompletion(); public override Color EliteBuffColor => new Color(0.4f, 0f, 0.4f, 1f); public override EliteModule.EliteTiers EliteTier { get; set; } = EliteModule.EliteTiers.Other; public override string EliteRampTextureName { get; set; } = "texRampLeeching"; public override float Cooldown { get; } = 6f; public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Hooks() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Expected O, but got Unknown //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown Log.Warning("simu elites dont have config cause fuck that for now lol"); CharacterBody.onBodyInventoryChangedGlobal += AddSimulatedBodyBehavior; RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(SimulatedStatBuff); GlobalEventManager.onCharacterDeathGlobal += SpawnSimulatedElite; CharacterBody.UpdateHurtBoxesEnabled += new Manipulator(SimulatedHurtbox); CharacterModel.UpdateOverlays += new Manipulator(SimulatedOverlay); } private void AddSimulatedBodyBehavior(CharacterBody obj) { obj.AddItemBehavior(IsElite(obj) ? 1 : 0); } private void SpawnSimulatedElite(DamageReport damageReport) { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) CharacterBody victimBody = damageReport.victimBody; if (victimBody.isPlayerControlled) { return; } CharacterBody attackerBody = damageReport.attackerBody; if (damageReport.damageInfo == null || !((Enum)damageReport.damageInfo.damageType.damageType).HasFlag((Enum)(object)(DamageType)65536) || Util.CheckRoll(50f, 0f, (CharacterMaster)null)) { return; } int val = (int)(damageReport.combinedHealthBeforeDamage / victimBody.healthComponent.fullCombinedHealth * (float)maxDuration); CharacterBody val2 = Util.TryToCreateGhost(victimBody, attackerBody, Math.Max(val, minDuration)); if (Object.op_Implicit((Object)(object)val2)) { CharacterMaster master = val2.master; if (!((Object)(object)master == (Object)null) && !((Object)(object)master.inventory == (Object)null)) { val2.inventory.SetEquipmentIndex(EliteEquipmentDef.equipmentIndex, false); val2.inventory.GiveItemPermanent(Items.UseAmbientLevel, 1); } } } private void SimulatedOverlay(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); val.GotoNext((MoveType)0, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "set_isGhost") }); val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)delegate(bool isGhost, CharacterModel self) { if (isGhost) { return true; } CharacterBody body = self.body; return (Object.op_Implicit((Object)(object)self.body) && body.HasBuff(EliteBuffDef)) ? true : false; }); } private void SimulatedHurtbox(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); val.GotoNext((MoveType)2, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 0) }); val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)delegate(CharacterBody body) { if (body.HasBuff(Buffs.Intangible)) { return true; } if (body.HasBuff(EliteBuffDef)) { return false; } Inventory inventory = body.inventory; return (Object.op_Implicit((Object)(object)inventory) && inventory.GetItemCountEffective(Items.Ghost) > 0) ? true : false; }); val.Emit(OpCodes.Stloc_0); } private void SimulatedStatBuff(CharacterBody sender, StatHookEventArgs args) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_004f: 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_0060: 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) if (IsElite(sender, EliteBuffDef)) { SetTeamToVoid(sender); args.moveSpeedMultAdd += 0.25f; args.baseAttackSpeedAdd += 1f; sender.bodyFlags = (BodyFlags)(sender.bodyFlags | 0x800); sender.bodyFlags = (BodyFlags)(sender.bodyFlags | 0x400); Debug.Log((object)sender.bodyFlags); if (Object.op_Implicit((Object)(object)sender.inventory) && sender.inventory.GetItemCountEffective(Items.HealthDecay) <= 0) { args.baseRegenAdd -= 8f; } float num = 0.85f; args.allSkills.cooldownMultiplier *= num; } } internal static void RemoveAllOfItem(Inventory inv, ItemDef itemDef) { int itemCountEffective = inv.GetItemCountEffective(itemDef); inv.RemoveItemPermanent(itemDef, itemCountEffective); } public void SetTeamToVoid(CharacterBody body) { if (!body.isPlayerControlled) { TeamComponent teamComponent = body.teamComponent; teamComponent.teamIndex = (TeamIndex)4; } } protected override bool ActivateEquipment(EquipmentSlot slot) { AffixSimulatedBehavior component = ((Component)slot.characterBody).GetComponent(); if ((Object)(object)component != (Object)null) { component.AffixSimulatedAttack(); return true; } return false; } } internal class AffixSimulatedBehavior : ItemBehavior { public bool isAiming; public bool isFiring; public float attackStopWatch; public float volleyDelay = 1f; public float volleyStopWatch; public int sizeMod; public float randomRadius; public int chargeCount = 0; public static float aimBaseDuration = AimPortalBomb.baseDuration; public static float arcMultiplier = AimPortalBomb.arcMultiplier; public static GameObject portalBombProjectileEffect = FirePortalBomb.portalBombProjectileEffect; public static GameObject muzzleflashEffectPrefab = FirePortalBomb.muzzleflashEffectPrefab; public static string muzzleString = FirePortalBomb.muzzleString; public int portalBombCount; public static float attackBaseDuration = 3f; public static float maxDistance = FirePortalBomb.maxDistance * 4f; public static float damageCoefficient = FirePortalBomb.damageCoefficient; public static float procCoefficient = FirePortalBomb.procCoefficient; public static float baseRandomRadius = 20f; public static float force = FirePortalBomb.force; public static float minimumDistanceBetweenBombs = 5f; public Quaternion? startRotation; public Quaternion? endRotation; private float attackDuration; private int bombsFired; private float fireTimer; private float fireInterval; private int maxPortalBombs = 30; private int minPortalBombs = 5; public bool barrierBool = true; public void Start() { Inventory inventory = base.body.inventory; if (Object.op_Implicit((Object)(object)inventory)) { SimulatedAspect.RemoveAllOfItem(inventory, Items.BoostDamage); } CharacterModel[] componentsInChildren = ((Component)base.body).GetComponentsInChildren(); CharacterModel[] array = componentsInChildren; foreach (CharacterModel val in array) { val.UpdateOverlays(); } base.body.UpdateHurtBoxesEnabled(); base.body.healthComponent.AddBarrier(base.body.healthComponent.fullCombinedHealth); } public void AffixSimulatedAttack() { sizeMod = (int)Mathf.Ceil(base.body.radius); chargeCount = Mathf.Clamp(sizeMod, 5, 30); PortalBombVolley(); } public void PortalBombVolley() { portalBombCount = sizeMod + minPortalBombs; randomRadius = baseRandomRadius + (float)sizeMod; attackStopWatch = 0f; isFiring = true; bombsFired = 0; attackDuration = attackBaseDuration; fireInterval = attackBaseDuration / Mathf.Min((float)portalBombCount * base.body.attackSpeed, (float)maxPortalBombs); chargeCount--; volleyStopWatch = 0f; } public void FixedUpdate() { if (barrierBool) { } if (isFiring) { TimerTick(); } } private void TimerTick() { fireTimer += Time.fixedDeltaTime; if (fireTimer >= fireInterval) { NewPortalBombAttack(); fireTimer -= fireInterval; } attackStopWatch += Time.fixedDeltaTime; } private void NewPortalBombAttack() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_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_0011: 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_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0031: 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_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005a: 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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: 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_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //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_011e: 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_0127: 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_0144: 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_0193: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.zero; Ray aimRay = GetAimRay(); ((Ray)(ref aimRay)).origin = ((Ray)(ref aimRay)).origin + Random.insideUnitSphere * randomRadius; RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(aimRay, ref val2, (float)LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask))) { val = ((RaycastHit)(ref val2)).point; } if (!(val == Vector3.zero)) { TeamIndex enemyTeam = (TeamIndex)1; TeamIndex enemyTeam2 = (TeamIndex)2; Transform val3 = FindTargetClosest(val, enemyTeam, enemyTeam2); Vector3 val4 = val; if (Object.op_Implicit((Object)(object)val3)) { val4 = ((Component)val3).transform.position; } val4 += Random.insideUnitSphere * randomRadius; Ray val5 = default(Ray); ((Ray)(ref val5)).origin = val4 + Vector3.up * randomRadius; ((Ray)(ref val5)).direction = Vector3.down; if (Physics.Raycast(val5, ref val2, 500f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask))) { Vector3 point = ((RaycastHit)(ref val2)).point; Quaternion identity = Quaternion.identity; FireProjectileInfo val6 = default(FireProjectileInfo); val6.projectilePrefab = portalBombProjectileEffect; val6.position = point; val6.rotation = identity; val6.owner = ((Component)this).gameObject; val6.damage = base.body.damage * damageCoefficient; val6.force = 0f; val6.crit = base.body.RollCrit(); ProjectileManager.instance.FireProjectile(val6); } bombsFired++; if (attackStopWatch >= attackDuration) { isFiring = false; } } } private Transform FindTargetClosest(Vector3 point, TeamIndex enemyTeam1, TeamIndex enemyTeam2) { //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_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_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) ReadOnlyCollection teamMembers = TeamComponent.GetTeamMembers(enemyTeam1); ReadOnlyCollection teamMembers2 = TeamComponent.GetTeamMembers(enemyTeam2); float num = 99999f; Transform result = null; for (int i = 0; i < teamMembers.Count; i++) { float num2 = Vector3.SqrMagnitude(((Component)teamMembers[i]).transform.position - point); if (num2 < num) { num = num2; result = ((Component)teamMembers[i]).transform; } } for (int j = 0; j < teamMembers2.Count; j++) { float num3 = Vector3.SqrMagnitude(((Component)teamMembers2[j]).transform.position - point); if (num3 < num) { num = num3; result = ((Component)teamMembers2[j]).transform; } } return result; } private void OneTimeBarrierGain() { base.body.healthComponent.AddBarrier(base.body.healthComponent.fullCombinedHealth); barrierBool = false; } protected Ray GetAimRay() { //IL_0044: 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) //IL_0059: 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_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_005c: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)base.body.inputBank)) { return new Ray(base.body.inputBank.aimOrigin, base.body.inputBank.aimDirection); } return new Ray(((Component)this).transform.position, ((Component)this).transform.forward); } } public class SimulatedBallsManager : ItemBehavior { public CharacterBody body; public GameObject prefab = FirePortalBomb.portalBombProjectileEffect; private float timer = 0f; public float interval = 5f; public int ballCount; private HurtBox target; public static float maxDistance = FirePortalBomb.maxDistance * 2f; private void Start() { body = ((Component)this).GetComponent(); ballCount = 5; } private void FixedUpdate() { //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: 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_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0104: 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_010c: Unknown result type (might be due to invalid IL or missing references) timer += Time.fixedDeltaTime; if (!(timer >= interval)) { return; } FindTarget(); if ((Object)(object)target != (Object)null) { for (int i = 0; i < ballCount; i++) { FireProjectileInfo val = default(FireProjectileInfo); val.projectilePrefab = prefab; val.damage = (Object.op_Implicit((Object)(object)Run.instance) ? (5f + Mathf.Sqrt(Run.instance.ambientLevel * 200f)) : 0f); val.rotation = Quaternion.identity; val.owner = ((Component)this).gameObject; val.crit = body.RollCrit(); val.position = Util.ApplySpread(((Component)target).transform.position, 6f * (float)i, 7f * (float)i, 1f, 0.08f, 0f, 0f); FireProjectileInfo val2 = val; ProjectileManager.instance.FireProjectile(val2); timer = 0f; } } } private void FindTarget() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //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_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_0045: 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) BullseyeSearch val = new BullseyeSearch(); val.viewer = body; val.searchOrigin = body.corePosition; val.maxDistanceFilter = maxDistance; val.teamMaskFilter = TeamMask.GetEnemyTeams(body.teamComponent.teamIndex); val.sortMode = (SortMode)1; val.RefreshCandidates(); target = val.GetResults().FirstOrDefault(); } } internal class VolatileAspect : T1EliteEquipmentBase { [AutoConfig("Mortar Fire Interval", "Affected by attack speed", 6f)] public static float mortarFireInterval = 6f; [AutoConfig("Mortar Count Per Size", 1f)] public static float mortarsPerSize = 1f; [AutoConfig("Mortar Count Bonus", 1f)] public static float mortarsBonus = 1f; [AutoConfig("Mortar Damage", "Scales with level", 10f)] public static float volatileMortarDamage = 10f; public static float volatileMortarForce = 400f; [AutoConfig("Mortar Velocity", 30f)] public static float mortarSpeed = 30f; [AutoConfig("Mortar Blast Radius", 15f)] public static float volatileMortarRadius = 15f; [AutoConfig("Landmine Count Per Size", 1f)] public static float minesPerSize = 1f; [AutoConfig("Landmine Damage", "Scales with level", 10)] public static float volatileLandmineDamage = 15f; [AutoConfig("On Hit Force Multiplier", 3f)] public static float forceMultiplier = 3f; [AutoConfig("On Hit Force Bonus", 200f)] public static float forceBonus = 200f; [AutoConfig("On Hit Force Radius", 4f)] public static float forceRadius = 4f; public static GameObject volatileMortarPrefab; public static GameObject volatileLandminePrefab; public override string ConfigName => "Elites : " + EliteModifier; public override AssetBundle assetBundle => SwanSongPlugin.mainAssetBundle; public override string EliteEquipmentName => "Bava’s Refrain"; public override string EliteAffixToken => "AFFIX_EXPLOSIVE"; public override string EliteEquipmentPickupDesc => "Become an aspect of force."; public override string EliteEquipmentFullDescription => "All attacks are explosive. Periodically fire a mortar."; public override string EliteEquipmentLore => ""; public override string EliteModifier => "Volatile"; public override GameObject EliteEquipmentModel => LegacyResourcesAPI.Load("prefabs/NullModel"); public override Sprite EliteEquipmentIcon => LegacyResourcesAPI.Load("textures/miscicons/texWIPIcon"); public override string EliteRampTextureName { get; set; } = "texRampVolatile"; public override bool CanDrop { get; } = false; public override float Cooldown { get; } = 0f; public override Texture2D EliteBuffIcon => Addressables.LoadAssetAsync((object)"RoR2/Base/EliteIce/texBuffAffixWhite.tif").WaitForCompletion(); public override Color EliteBuffColor => new Color(1f, 0.6f, 0f, 1f); public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown GlobalEventManager.OnHitAllProcess += new hook_OnHitAllProcess(VolatileOnHit); CharacterBody.AddBuff_BuffIndex += new hook_AddBuff_BuffIndex(VolatileBuffCheck); GlobalEventManager.OnCharacterDeath += new hook_OnCharacterDeath(SpiteOnDeath); } private void SpiteOnDeath(orig_OnCharacterDeath orig, GlobalEventManager self, DamageReport damageReport) { //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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0056: 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_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0135: 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_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) CharacterBody victimBody = damageReport.victimBody; CharacterMaster victimMaster = damageReport.victimMaster; if (Object.op_Implicit((Object)(object)victimBody) && victimBody.HasBuff(EliteBuffDef)) { Vector3 corePosition = Util.GetCorePosition(victimBody); ProjectileManager.instance.FireProjectile(new FireProjectileInfo { projectilePrefab = volatileLandminePrefab, position = corePosition, rotation = Util.QuaternionSafeLookRotation(Vector3.up), owner = ((Component)victimBody).gameObject, damage = (1f + 0.3f * victimBody.level) * volatileLandmineDamage, force = volatileMortarForce, crit = Util.CheckRoll(victimBody.crit, victimBody.master) }); float num = Mathf.Round(victimBody.radius - 1f); int num2 = (int)Mathf.Ceil(num * minesPerSize); if (num2 > 0) { for (int i = 0; i <= num2; i++) { Vector3 val = Random.insideUnitSphere + Vector3.up * 1.6f; ProjectileManager.instance.FireProjectile(new FireProjectileInfo { projectilePrefab = volatileLandminePrefab, position = corePosition, rotation = Util.QuaternionSafeLookRotation(val), owner = ((Component)victimBody).gameObject, damage = (1f + 0.3f * victimBody.level) * volatileLandmineDamage, force = volatileMortarForce, crit = Util.CheckRoll(victimBody.crit, victimBody.master) }); } } } orig.Invoke(self, damageReport); } private void VolatileBuffCheck(orig_AddBuff_BuffIndex orig, CharacterBody self, BuffIndex buffType) { //IL_0003: 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_0011: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, buffType); if (buffType == EliteBuffDef.buffIndex) { GameObject gameObject = ((Component)self).gameObject; VolatileMortarAttachment volatileMortarAttachment = ((gameObject != null) ? gameObject.GetComponent() : null); if ((Object)(object)volatileMortarAttachment == (Object)null) { ((Component)self).gameObject.AddComponent(); } } } private void VolatileMortar(orig_FixedUpdate orig, CharacterBody self) { orig.Invoke(self); if (self.HasBuff(EliteBuffDef)) { VolatileMortarAttachment component = ((Component)self).gameObject.GetComponent(); if ((Object)(object)component == (Object)null) { ((Component)self).gameObject.AddComponent(); } } } private void VolatileOnHit(orig_OnHitAllProcess orig, GlobalEventManager self, DamageInfo damageInfo, GameObject victim) { //IL_00a2: 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_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_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Expected O, but got Unknown //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Expected O, but got Unknown //IL_00de: 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_0136: 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_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0169: 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_0179: 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_0185: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)damageInfo.attacker)) { CharacterBody component = damageInfo.attacker.GetComponent(); if (Object.op_Implicit((Object)(object)component) && IsElite(component, EliteBuffDef) && !((ProcChainMask)(ref damageInfo.procChainMask)).HasProc((ProcType)0) && damageInfo.procCoefficient != 0f) { float num = forceRadius * damageInfo.procCoefficient; float num2 = 0.1f; float baseDamage = Util.OnHitProcDamage(damageInfo.damage, component.damage, num2); EffectManager.SpawnEffect(LegacyResourcesAPI.Load("Prefabs/Effects/OmniEffect/OmniExplosionVFXQuick"), new EffectData { origin = damageInfo.position, scale = num, rotation = Util.QuaternionSafeLookRotation(damageInfo.force) }, true); BlastAttack val = new BlastAttack(); val.position = damageInfo.position; val.baseDamage = baseDamage; val.baseForce = ((Vector3)(ref damageInfo.force)).magnitude * forceMultiplier + forceBonus; val.radius = num; val.attacker = damageInfo.attacker; val.inflictor = null; val.teamIndex = TeamComponent.GetObjectTeam(val.attacker); val.crit = damageInfo.crit; val.procChainMask = damageInfo.procChainMask; val.procCoefficient = 0f; val.damageColorIndex = (DamageColorIndex)3; val.falloffModel = (FalloffModel)2; val.damageType = damageInfo.damageType; val.Fire(); } } orig.Invoke(self, damageInfo, victim); } public override void Init() { CreateProjectile(); base.Init(); VolatileMortarAttachment.buffDef = EliteBuffDef; } private void CreateProjectile() { //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0058: 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_00b8: 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_01f0: 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_0193: 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_028f: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) volatileMortarPrefab = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("prefabs/projectiles/ToolbotGrenadeLauncherProjectile"), "BorboVolatileMortar", true); if ((Object)(object)volatileMortarPrefab != (Object)null) { GameObject val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("prefabs/projectileghosts/ToolbotGrenadeGhost"), "BorboVolatileMortarGhost", false); volatileMortarPrefab.transform.localScale = Vector3.one * 0.2f; ProjectileController component = volatileMortarPrefab.GetComponent(); ProjectileGhostController component2 = val.GetComponent(); component.ghost = component2; Material material = assetBundle.LoadAsset(CommonAssets.eliteMaterialsPath + "matVolatile.mat"); Tools.GetMaterial(val, "Mesh", Color.red, ref material); Tools.GetMaterial(val, "GameObject (1)", Color.green, ref material); Tools.GetParticle(val, "Fire", Color.blue); ProjectileDamage component3 = volatileMortarPrefab.GetComponent(); component3.force = 1500f; ProjectileSimple component4 = volatileMortarPrefab.GetComponent(); component4.desiredForwardSpeed = mortarSpeed; Rigidbody component5 = volatileMortarPrefab.GetComponent(); component5.useGravity = true; component5.freezeRotation = false; AntiGravityForce val2 = volatileMortarPrefab.GetComponent(); if ((Object)(object)val2 == (Object)null) { val2 = volatileMortarPrefab.AddComponent(); } val2.rb = component5; val2.antiGravityCoefficient = 0f; ProjectileImpactExplosion component6 = volatileMortarPrefab.GetComponent(); ((ProjectileExplosion)component6).blastProcCoefficient = 0f; ((ProjectileExplosion)component6).blastRadius = volatileMortarRadius; ((ProjectileExplosion)component6).bonusBlastForce = Vector3.up * 1000f; Content.AddProjectilePrefab(volatileMortarPrefab); } volatileLandminePrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)"RoR2/Base/Engi/EngiMine.prefab").WaitForCompletion(), "BorboVolatileLandmine", true); if ((Object)(object)volatileLandminePrefab != (Object)null) { GameObject val3 = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)"RoR2/Base/Engi/EngiMineGhost.prefab").WaitForCompletion(), "BorboVolatileLandmineGhost", false); ProjectileDeployToOwner component7 = volatileLandminePrefab.GetComponent(); if (Object.op_Implicit((Object)(object)component7)) { Object.Destroy((Object)(object)component7); } Deployable component8 = volatileLandminePrefab.GetComponent(); if (Object.op_Implicit((Object)(object)component8)) { Object.Destroy((Object)(object)component8); } ProjectileController component9 = volatileLandminePrefab.GetComponent(); ProjectileGhostController component10 = val3.GetComponent(); component9.ghost = component10; Material material2 = assetBundle.LoadAsset(CommonAssets.eliteMaterialsPath + "matVolatile.mat"); Tools.GetMaterial(val3, "EngiMineMesh", Color.red, ref material2); Tools.GetMaterial(val3, "GameObject (1)", Color.green, ref material2); Tools.GetParticle(val3, "Fire", Color.blue); ProjectileDamage component11 = volatileLandminePrefab.GetComponent(); component11.force = 2500f; ProjectileSphereTargetFinder component12 = volatileLandminePrefab.GetComponent(); if (Object.op_Implicit((Object)(object)component12)) { component12.targetSearchInterval = 0.2f; } ChangeLandmineIndicator(volatileLandminePrefab, "WeakIndicator"); ChangeLandmineIndicator(volatileLandminePrefab, "StrongIndicator"); Content.AddProjectilePrefab(volatileLandminePrefab); } void ChangeLandmineIndicator(GameObject prefab, string transformName) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //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) Transform val4 = prefab.transform.Find(transformName); if (Object.op_Implicit((Object)(object)val4)) { MeshRenderer componentInChildren = ((Component)val4).gameObject.GetComponentInChildren(); if (Object.op_Implicit((Object)(object)componentInChildren)) { Material val5 = new Material(((Renderer)componentInChildren).material); ((Object)val5).name = "matVolatileIndicatorIntersection"; val5.SetTexture("_RemapTex", CommonAssets.mainAssetBundle.LoadAsset(CommonAssets.eliteMaterialsPath + EliteRampTextureName + ".png")); val5.SetColor("_TintColor", Color32.op_Implicit(new Color32((byte)134, (byte)134, (byte)134, byte.MaxValue))); val5.SetFloat("_IntersectionStrength", 5.91f); val5.SetFloat("_AlphaBoost", 1.76f); val5.SetFloat("_RimStrength", 0.06f); val5.SetFloat("_RimPower", 1.5f); ((Renderer)componentInChildren).material = val5; } Light componentInChildren2 = ((Component)val4).gameObject.GetComponentInChildren(); if (Object.op_Implicit((Object)(object)componentInChildren2)) { componentInChildren2.color = Color32.op_Implicit(new Color32(byte.MaxValue, (byte)146, (byte)66, byte.MaxValue)); } } } } protected override bool ActivateEquipment(EquipmentSlot slot) { return false; } } internal class VolatileMortarAttachment : MonoBehaviour { public static BuffDef buffDef; public CharacterBody body; private static float mortarTimer = 0f; private static float mortarInterval = VolatileAspect.mortarFireInterval; private static float maxYawSpread = 60f; public static GameObject projectilePrefab => VolatileAspect.volatileMortarPrefab; public static float mortarDamageCoefficient => VolatileAspect.volatileMortarDamage; private void Start() { if ((Object)(object)body == (Object)null) { body = ((Component)this).gameObject.GetComponent(); } } private void FixedUpdate() { //IL_00ad: 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_014a: 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_0143: 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_014e: 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_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_016d: 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_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)body != (Object)null) || !((Object)(object)body.healthComponent != (Object)null)) { return; } HealthComponent healthComponent = body.healthComponent; if (body.HasBuff(buffDef) && healthComponent.alive && !healthComponent.isInFrozenState) { mortarTimer += Time.fixedDeltaTime * body.attackSpeed; if (mortarTimer >= mortarInterval) { mortarTimer = 0f; Vector3 aimDirection = body.inputBank.aimDirection; aimDirection.y = 0f; float num = Mathf.Ceil(body.radius * VolatileAspect.mortarsPerSize) + VolatileAspect.mortarsBonus; float num2 = maxYawSpread * 2f / (num + 1f); for (int i = 0; (float)i < num; i++) { float num3 = ((num == 1f) ? 0f : (num2 * (float)(i + 1) - maxYawSpread)); Vector3 val = ((num == 1f) ? aimDirection : Util.ApplySpread(aimDirection, 2f, 10f, 1f, 1f, num3, 0f)); Vector3 val2 = val + Vector3.up * 1.2f; ProjectileManager.instance.FireProjectile(new FireProjectileInfo { projectilePrefab = projectilePrefab, position = body.corePosition, rotation = Util.QuaternionSafeLookRotation(val2), owner = ((Component)body).gameObject, damage = (1f + 0.3f * body.level) * mortarDamageCoefficient, force = 0f, crit = Util.CheckRoll(body.crit, body.master), damageColorIndex = (DamageColorIndex)0, target = null }); } } } else { mortarTimer = 0f; } } } internal class DeuteriumAspect : EliteEquipmentBase { public override string ConfigName => "Elites : Storm : " + EliteModifier; public override AssetBundle assetBundle => SwanSongPlugin.mainAssetBundle; public override string EliteAffixToken => "AFFIX_DEUTERIUM"; public override string EliteModifier => "Deuterium"; public override string EliteEquipmentName => "Edge of Extinction"; public override string EliteEquipmentPickupDesc => "Become an aspect of sorrow."; public override string EliteEquipmentFullDescription => ""; public override string EliteEquipmentLore => ""; public override float EliteHealthModifier => 9f; public override float EliteDamageModifier => 4.5f; public override GameObject EliteEquipmentModel => LegacyResourcesAPI.Load("prefabs/NullModel"); public override Sprite EliteEquipmentIcon => LegacyResourcesAPI.Load("textures/miscicons/texWIPIcon"); public override Texture2D EliteBuffIcon => Addressables.LoadAssetAsync((object)"RoR2/Base/EliteLightning/texBuffAffixBlue.tif").WaitForCompletion(); public override Color EliteBuffColor => Color.blue; public override string EliteRampTextureName { get; set; } = "texRampLeeching"; public override EliteModule.EliteTiers EliteTier { get; set; } = EliteModule.EliteTiers.StormT2; public override bool CanDrop { get; } = false; public override float Cooldown { get; } = 0f; public override ExpansionDef RequiredExpansion => SwanSongPlugin.expansionDefSS2; public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Hooks() { } protected override bool ActivateEquipment(EquipmentSlot slot) { return false; } } internal class SurgingAspect : T1EliteEquipmentBase { public override string ConfigName => "Elites : Storm : " + EliteModifier; public override AssetBundle assetBundle => SwanSongPlugin.mainAssetBundle; public override EliteModule.EliteTiers EliteTier { get; set; } = EliteModule.EliteTiers.StormT1; public override string EliteAffixToken => "AFFIX_SURGE"; public override string EliteModifier => "Surging"; public override string EliteEquipmentName => "Tantalizing Feast"; public override string EliteEquipmentPickupDesc => "Become an aspect of relentless flood."; public override string EliteEquipmentFullDescription => ""; public override string EliteEquipmentLore => ""; public override GameObject EliteEquipmentModel => LegacyResourcesAPI.Load("prefabs/NullModel"); public override Sprite EliteEquipmentIcon => LegacyResourcesAPI.Load("textures/miscicons/texWIPIcon"); public override Texture2D EliteBuffIcon => Addressables.LoadAssetAsync((object)"RoR2/Base/EliteFire/texBuffAffixRed.tif").WaitForCompletion(); public override Color EliteBuffColor => Color.cyan; public override string EliteRampTextureName { get; set; } = "texRampLeeching"; public override bool CanDrop { get; } = false; public override float Cooldown { get; } = 0f; public override ExpansionDef RequiredExpansion => SwanSongPlugin.expansionDefSS2; public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Hooks() { } protected override bool ActivateEquipment(EquipmentSlot slot) { return false; } } internal class WhirlwindAspect : T1EliteEquipmentBase { public override string ConfigName => "Elites : Storm : " + EliteModifier; public override AssetBundle assetBundle => SwanSongPlugin.mainAssetBundle; public override EliteModule.EliteTiers EliteTier { get; set; } = EliteModule.EliteTiers.StormT1; public override string EliteAffixToken => "AFFIX_WHIRLWIND"; public override string EliteModifier => "Howling"; public override string EliteEquipmentName => "Twisted Stare"; public override string EliteEquipmentPickupDesc => "Become an aspect of sundering wind."; public override string EliteEquipmentFullDescription => ""; public override string EliteEquipmentLore => ""; public override GameObject EliteEquipmentModel => LegacyResourcesAPI.Load("prefabs/NullModel"); public override Sprite EliteEquipmentIcon => LegacyResourcesAPI.Load("textures/miscicons/texWIPIcon"); public override Texture2D EliteBuffIcon => Addressables.LoadAssetAsync((object)"RoR2/Base/EliteHaunted/texBuffAffixHaunted.tif").WaitForCompletion(); public override Color EliteBuffColor => Color.gray; public override string EliteRampTextureName { get; set; } = "texRampLeeching"; public override bool CanDrop { get; } = false; public override float Cooldown { get; } = 0f; public override ExpansionDef RequiredExpansion => SwanSongPlugin.expansionDefSS2; public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } public override void Hooks() { } protected override bool ActivateEquipment(EquipmentSlot slot) { return false; } } public abstract class T1EliteEquipmentBase : T1EliteEquipmentBase where T : T1EliteEquipmentBase { public static T instance { get; private set; } public T1EliteEquipmentBase() { if (instance != null) { throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting EquipmentBoilerplate/Equipment was instantiated twice"); } instance = this as T; } } public abstract class T1EliteEquipmentBase : EliteEquipmentBase { public EliteDef HonorEliteDef; public override float EliteHealthModifier => 3f; public override float EliteDamageModifier => 1.5f; public override EliteModule.EliteTiers EliteTier { get; set; } = EliteModule.EliteTiers.Tier1; protected override EliteModule.CustomEliteDef GetCustomElite() { HonorEliteDef = Object.Instantiate(EliteDef); HonorEliteDef.healthBoostCoefficient = EliteDef.healthBoostCoefficient / 2f; EliteModule.CustomEliteDef customElite = base.GetCustomElite(); customElite.honorEliteDef = HonorEliteDef; return customElite; } } } namespace SwanSongExtended.Survivors { public abstract class SurvivorBase : SurvivorBase where T : SurvivorBase { public static T instance { get; private set; } public SurvivorBase() { if (instance != null) { throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting SwanSongExtended " + typeof(SurvivorBase).Name + " was instantiated twice"); } instance = this as T; } } public abstract class SurvivorBase : CharacterBase { public abstract string SurvivorSubtitle { get; } public abstract string SurvivorDescription { get; } public abstract string SurvivorOutroWin { get; } public abstract string SurvivorOutroFailure { get; } public abstract string masterName { get; } public abstract string displayPrefabName { get; } public abstract string survivorTokenPrefix { get; } public abstract UnlockableDef characterUnlockableDef { get; } public abstract GameObject displayPrefab { get; protected set; } public override void InitializeCharacter() { base.InitializeCharacter(); InitializeDisplayPrefab(); InitializeSurvivor(); } protected virtual void InitializeDisplayPrefab() { displayPrefab = Prefabs.CreateDisplayPrefab(assetBundle, displayPrefabName, bodyPrefab); } protected virtual void InitializeSurvivor() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) RegisterNewSurvivor(bodyPrefab, displayPrefab, bodyInfo.bodyColor, survivorTokenPrefix, characterUnlockableDef, bodyInfo.sortPosition); } public static void RegisterNewSurvivor(GameObject bodyPrefab, GameObject displayPrefab, Color charColor, string tokenPrefix, UnlockableDef unlockableDef, float sortPosition) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) Content.CreateSurvivor(bodyPrefab, displayPrefab, charColor, tokenPrefix, unlockableDef, sortPosition); } protected virtual void AddCssPreviewSkill(int indexFromEditor, SkillFamily skillFamily, SkillDef skillDef) { CharacterSelectSurvivorPreviewDisplayController component = displayPrefab.GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { Log.Error("trying to add skillChangeResponse to null CharacterSelectSurvivorPreviewDisplayController.\nMake sure you created one on your Display prefab in editor"); return; } component.skillChangeResponses[indexFromEditor].triggerSkillFamily = skillFamily; component.skillChangeResponses[indexFromEditor].triggerSkill = skillDef; } protected virtual void AddCssPreviewSkin(int indexFromEditor, SkinDef skinDef) { CharacterSelectSurvivorPreviewDisplayController component = displayPrefab.GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { Log.Error("trying to add skinChangeResponse to null CharacterSelectSurvivorPreviewDisplayController.\nMake sure you created one on your Display prefab in editor"); } else { component.skinChangeResponses[indexFromEditor].triggerSkin = skinDef; } } protected virtual void FinalizeCSSPreviewDisplayController() { //IL_0073: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)displayPrefab)) { return; } CharacterSelectSurvivorPreviewDisplayController component = displayPrefab.GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { return; } component.bodyPrefab = bodyPrefab; List list = new List(); for (int i = 0; i < component.skillChangeResponses.Length; i++) { if ((Object)(object)component.skillChangeResponses[i].triggerSkillFamily != (Object)null) { list.Add(component.skillChangeResponses[i]); } } component.skillChangeResponses = list.ToArray(); } public override void Lang() { Language.Add(bodyInfo.bodyNameToken, CharacterName); Language.Add(bodyInfo.subtitleNameToken, SurvivorSubtitle); Language.Add(survivorTokenPrefix + "LORE", CharacterLore); Language.Add(survivorTokenPrefix + "DESCRIPTION", SurvivorDescription); Language.Add(survivorTokenPrefix + "OUTRO_FLAVOR", SurvivorOutroWin); Language.Add(survivorTokenPrefix + "OUTRO_FAILURE", SurvivorOutroFailure); } } } namespace SwanSongExtended.Characters { public abstract class CharacterBase : SharedBase { public abstract string CharacterName { get; } public abstract string CharacterLore { get; } public abstract string bodyName { get; } public abstract string modelPrefabName { get; } public abstract BodyInfo bodyInfo { get; } public virtual CustomRendererInfo[] customRendererInfos { get; } public virtual ItemDisplaysBase itemDisplays { get; } public abstract GameObject bodyPrefab { get; protected set; } public abstract CharacterBody prefabCharacterBody { get; protected set; } public abstract GameObject characterModelObject { get; protected set; } public abstract CharacterModel prefabCharacterModel { get; protected set; } public override void Init() { base.Init(); InitializeCharacter(); } public virtual void InitializeCharacter() { InitializeCharacterBodyPrefab(); InitializeItemDisplays(); } protected virtual void InitializeCharacterBodyPrefab() { characterModelObject = Prefabs.LoadCharacterModel(assetBundle, modelPrefabName); bodyPrefab = Prefabs.CreateBodyPrefab(characterModelObject, bodyInfo); prefabCharacterBody = bodyPrefab.GetComponent(); prefabCharacterModel = Prefabs.SetupCharacterModel(bodyPrefab, customRendererInfos); } public virtual void InitializeItemDisplays() { ItemDisplayRuleSet val = ScriptableObject.CreateInstance(); ((Object)val).name = "idrs" + bodyName; prefabCharacterModel.itemDisplayRuleSet = val; if (itemDisplays != null) { ItemDisplays.queuedDisplays++; ContentManager.onContentPacksAssigned += SetItemDisplays; } } public void SetItemDisplays(ReadOnlyArray obj) { itemDisplays.SetItemDisplays(prefabCharacterModel.itemDisplayRuleSet); } public abstract void InitializeEntityStateMachines(); public abstract void InitializeSkills(); public abstract void InitializeSkins(); public abstract void InitializeCharacterMaster(); } public class BodyInfo { public string bodyName = ""; public string bodyNameToken = ""; public string subtitleNameToken = ""; public string bodyNameToClone = "Commando"; public Color bodyColor = Color.white; public Texture characterPortrait = null; public float sortPosition = 100f; public GameObject crosshair = null; public GameObject podPrefab = null; public float maxHealth = 100f; public float healthRegen = 1f; public float armor = 0f; public float shield = 0f; public int jumpCount = 1; public float damage = 12f; public float attackSpeed = 1f; public float crit = 1f; public float moveSpeed = 7f; public float acceleration = 80f; public float jumpPower = 15f; public bool autoCalculateLevelStats = true; public float healthGrowth = 30.000002f; public float regenGrowth = 0.2f; public float armorGrowth = 0f; public float shieldGrowth = 0f; public float damageGrowth = 2.4f; public float attackSpeedGrowth = 0f; public float critGrowth = 0f; public float moveSpeedGrowth = 0f; public float jumpPowerGrowth = 0f; public Vector3 aimOriginPosition = new Vector3(0f, 1.6f, 0f); public Vector3 modelBasePosition = new Vector3(0f, -0.92f, 0f); public Vector3 cameraPivotPosition = new Vector3(0f, 0.8f, 0f); public float cameraParamsVerticalOffset = 1.37f; public float cameraParamsDepth = -10f; private CharacterCameraParams _cameraParams; public CharacterCameraParams cameraParams { get { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_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_00ae: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_cameraParams == (Object)null) { _cameraParams = ScriptableObject.CreateInstance(); _cameraParams.data.minPitch = BlendableFloat.op_Implicit(-70f); _cameraParams.data.maxPitch = BlendableFloat.op_Implicit(70f); _cameraParams.data.wallCushion = BlendableFloat.op_Implicit(0.1f); _cameraParams.data.pivotVerticalOffset = BlendableFloat.op_Implicit(cameraParamsVerticalOffset); _cameraParams.data.idealLocalCameraPos = BlendableVector3.op_Implicit(new Vector3(0f, 0f, cameraParamsDepth)); } return _cameraParams; } set { _cameraParams = value; } } } public abstract class ItemDisplaysBase { public void SetItemDisplays(ItemDisplayRuleSet itemDisplayRuleSet) { List list = new List(); ItemDisplays.LazyInit(); SetItemDisplayRules(list); itemDisplayRuleSet.keyAssetRuleGroups = list.ToArray(); ItemDisplays.DisposeWhenDone(); } protected abstract void SetItemDisplayRules(List itemDisplayRules); } } namespace SwanSongExtended.Artifacts { public abstract class ArtifactBase : ArtifactBase where T : ArtifactBase { public static T instance { get; private set; } public ArtifactBase() { if (instance != null) { throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting ItemBoilerplate/Item was instantiated twice"); } instance = this as T; } } public abstract class ArtifactBase : SharedBase { public ArtifactDef ArtifactDef; public override string ConfigName => "Artifacts : " + ArtifactName; public override AssetBundle assetBundle => SwanSongPlugin.mainAssetBundle; public abstract string ArtifactName { get; } public abstract string ArtifactDescription { get; } public abstract string ArtifactLangTokenName { get; } public abstract Sprite ArtifactSelectedIcon { get; } public abstract Sprite ArtifactDeselectedIcon { get; } public abstract void OnArtifactEnabledServer(); public abstract void OnArtifactDisabledServer(); public override void Init() { base.Init(); CreateArtifact(); } public override void Lang() { LanguageAPI.Add("ARTIFACT_" + ArtifactLangTokenName + "_NAME", "Artifact of " + ArtifactName); LanguageAPI.Add("ARTIFACT_" + ArtifactLangTokenName + "_DESCRIPTION", ArtifactDescription); } protected void CreateArtifact() { //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Expected O, but got Unknown //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Expected O, but got Unknown ArtifactDef = ScriptableObject.CreateInstance(); ArtifactDef.cachedName = "2r4r" + ArtifactName; ArtifactDef.nameToken = "ARTIFACT_" + ArtifactLangTokenName + "_NAME"; ArtifactDef.descriptionToken = "ARTIFACT_" + ArtifactLangTokenName + "_DESCRIPTION"; ArtifactDef.smallIconDeselectedSprite = ArtifactDeselectedIcon; ArtifactDef.smallIconSelectedSprite = ArtifactSelectedIcon; Content.AddArtifactDef(ArtifactDef); RunArtifactManager.onArtifactEnabledGlobal += new ArtifactStateChangeDelegate(OnArtifactEnabled); RunArtifactManager.onArtifactDisabledGlobal += new ArtifactStateChangeDelegate(OnArtifactDisabled); } private void OnArtifactEnabled(RunArtifactManager runArtifactManager, ArtifactDef artifactDef) { if (!((Object)(object)artifactDef != (Object)(object)ArtifactDef) && NetworkServer.active) { OnArtifactEnabledServer(); } } private void OnArtifactDisabled(RunArtifactManager runArtifactManager, ArtifactDef artifactDef) { if (!((Object)(object)artifactDef != (Object)(object)ArtifactDef)) { OnArtifactDisabledServer(); } } public bool IsArtifactEnabled() { return RunArtifactManager.instance.IsArtifactEnabled(ArtifactDef); } public static Sprite LoadArtifactIcon(string spriteName = "", AssetBundle bundle = null, bool fallBackOnWrench = false) { return SwanSongPlugin.TryLoadSpriteFromBundle("Assets/Textures/Icons/Artifact/" + spriteName + ".png", bundle, fallBackOnWrench); } } internal class FreeLunarArtifact : ArtifactBase { private const int _FreeLunarBlacklist = 32; private ItemDef[] itemPool; public static ItemTag FreeLunarBlacklist => (ItemTag)32; public override string ArtifactName => "the Zealot"; public override string ArtifactDescription => "Begin each run with a random lunar. At the end of each stage, a blue portal always appears."; public override string ArtifactLangTokenName => "FREELUNAR"; public override Sprite ArtifactSelectedIcon => ArtifactBase.LoadArtifactIcon("texIconFreeLunar", null, fallBackOnWrench: true); public override Sprite ArtifactDeselectedIcon => ArtifactBase.LoadArtifactIcon("texIconFreeLunarOff"); public override void Init() { //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_002d: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_004d: 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_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_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_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) base.Init(); SwanSongPlugin.BlacklistSingleItem("LunarPrimaryReplacement", FreeLunarBlacklist); SwanSongPlugin.BlacklistSingleItem("LunarSecondaryReplacement", FreeLunarBlacklist); SwanSongPlugin.BlacklistSingleItem("LunarUtilityReplacement", FreeLunarBlacklist); SwanSongPlugin.BlacklistSingleItem("LunarSpecialReplacement", FreeLunarBlacklist); SwanSongPlugin.BlacklistSingleItem("RepeatHeal", FreeLunarBlacklist); SwanSongPlugin.BlacklistSingleItem("LunarTrinket", FreeLunarBlacklist); AsyncOperationHandle val = Addressables.LoadAssetAsync((object)RoR2_DLC1_LunarSun.LunarSun_asset); val.Completed += delegate(AsyncOperationHandle ctx) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) SwanSongPlugin.BlacklistSingleItem(ctx.Result, FreeLunarBlacklist); }; val = Addressables.LoadAssetAsync((object)RoR2_DLC1_HalfAttackSpeedHalfCooldowns.HalfAttackSpeedHalfCooldowns_asset); val.Completed += delegate(AsyncOperationHandle ctx) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) SwanSongPlugin.BlacklistSingleItem(ctx.Result, FreeLunarBlacklist); }; val = Addressables.LoadAssetAsync((object)RoR2_DLC1_HalfSpeedDoubleHealth.HalfSpeedDoubleHealth_asset); val.Completed += delegate(AsyncOperationHandle ctx) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) SwanSongPlugin.BlacklistSingleItem(ctx.Result, FreeLunarBlacklist); }; } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown CharacterBody.Start += new hook_Start(GiveQuickStart); TeleporterInteraction.Start += new hook_Start(OnTeleporterStart); Run.OnServerTeleporterPlaced += new hook_OnServerTeleporterPlaced(OnTeleporterPlaced); } private void OnTeleporterStart(orig_Start orig, TeleporterInteraction self) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (!IsArtifactEnabled()) { return; } self.shouldAttemptToSpawnShopPortal = true; PortalStatueBehavior[] array = Object.FindObjectsOfType(); PurchaseInteraction val2 = default(PurchaseInteraction); foreach (PortalStatueBehavior val in array) { if ((int)val.portalType == 0 && ((Component)val).TryGetComponent(ref val2)) { val2.Networkavailable = false; val.CallRpcSetPingable(((Component)val).gameObject, false); } } } public override void OnArtifactEnabledServer() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) itemPool = ((IEnumerable)(object)ItemCatalog.allItemDefs).Where((ItemDef item) => (int)item.tier == 3 && !item.ContainsTag((ItemTag)9) && !item.ContainsTag((ItemTag)32)).ToArray(); } private void OnTeleporterPlaced(orig_OnServerTeleporterPlaced orig, Run self, SceneDirector sceneDirector, GameObject teleporter) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, sceneDirector, teleporter); TeleporterInteraction val = default(TeleporterInteraction); if (!IsArtifactEnabled() || !teleporter.TryGetComponent(ref val)) { return; } val.shouldAttemptToSpawnShopPortal = true; PortalStatueBehavior[] array = Object.FindObjectsOfType(); PurchaseInteraction val3 = default(PurchaseInteraction); foreach (PortalStatueBehavior val2 in array) { if ((int)val2.portalType == 0 && ((Component)val2).TryGetComponent(ref val3)) { val3.Networkavailable = false; val2.CallRpcSetPingable(((Component)val2).gameObject, false); } } } public override void OnArtifactDisabledServer() { } private void GiveQuickStart(orig_Start orig, CharacterBody self) { orig.Invoke(self); if (IsArtifactEnabled() && NetworkServer.active && Object.op_Implicit((Object)(object)Run.instance) && Run.instance.stageClearCount == 0 && Run.instance.GetRunStopwatch() <= 20f && self.isPlayerControlled) { OnPlayerCharacterBodyStartServer(self); } } private void OnPlayerCharacterBodyStartServer(CharacterBody characterBody) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) Inventory inventory = characterBody.inventory; if ((Object)(object)inventory != (Object)null) { int num = Random.RandomRangeInt(0, itemPool.Length - 1); ItemIndex itemIndex = itemPool[num].itemIndex; inventory.GiveItem(itemIndex, 1); } } } internal class QuickStartArtifact : ArtifactBase { [AutoConfig("Wish Pickup Index", "0 is Common, 1 is Uncommon, 2 is Rare", 1)] public static int wishPickupIndex = 1; public override string ArtifactName => "the Stillborn"; public override string ArtifactDescription => "Begin your run with an " + GetRarityName() + " item of your choice."; public override string ArtifactLangTokenName => "QUICKSTART"; public override Sprite ArtifactSelectedIcon => ArtifactBase.LoadArtifactIcon("texIconQuickStart", null, fallBackOnWrench: true); public override Sprite ArtifactDeselectedIcon => ArtifactBase.LoadArtifactIcon("texIconQuickStartOff"); public static string ConvertPickupIndexToRarityName(int n) { string result = ""; switch (n) { case 0: result = "Common"; break; case 1: result = "Uncommon"; break; case 2: result = "Rare"; break; } return result; } public static string GetRarityName() { return ConvertPickupIndexToRarityName(wishPickupIndex); } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown CharacterBody.Start += new hook_Start(GiveQuickStart); } public override void OnArtifactEnabledServer() { } public override void OnArtifactDisabledServer() { } private void GiveQuickStart(orig_Start orig, CharacterBody self) { orig.Invoke(self); if (IsArtifactEnabled() && NetworkServer.active && Object.op_Implicit((Object)(object)Run.instance) && Run.instance.stageClearCount == 0 && Run.instance.GetRunStopwatch() <= 20f && self.isPlayerControlled) { OnPlayerCharacterBodyStartServer(self); } } private static void OnPlayerCharacterBodyStartServer(CharacterBody characterBody) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) Inventory inventory = characterBody.inventory; if ((Object)(object)inventory != (Object)null) { EquipmentState val = default(EquipmentState); ((EquipmentState)(ref val))..ctor(EquipmentBase.instance.EquipDef.equipmentIndex, FixedTimeStamp.negativeInfinity, (byte)1, false); inventory.SetEquipment(val, 0u); } } } } namespace SwanSongExtended.Components { internal class CopyInventoryFromOwner : MonoBehaviour { public Func inventoryItemCopyFilter = Inventory.defaultItemCopyFilterDelegate.Invoke; public bool copyInventory = true; public bool copyEquipment = true; public void Start() { CharacterMaster component = ((Component)this).gameObject.GetComponent(); MinionOwnership component2 = ((Component)this).gameObject.GetComponent(); if ((Object)(object)component2 != (Object)null && (Object)(object)component != (Object)null) { CharacterMaster ownerMaster = component2.ownerMaster; Inventory val = ((ownerMaster != null) ? ownerMaster.inventory : null); if (Object.op_Implicit((Object)(object)val)) { component.inventory.CopyEquipmentFrom(val); component.inventory.CopyItemsFrom(val); } } } } public class CustomChestBehavior : ChestBehavior { public virtual void OnInteractionBegin(Interactor activator) { ((ChestBehavior)this).ItemDrop(); } } internal class InfernoPotionAuraController : NetworkBehaviour { } public class InteractableDropPickup : MonoBehaviour { public PurchaseInteraction purchaseInteraction; public bool destroyOnUse = true; public ExplicitPickupDropTable dropTable; private Xoroshiro128Plus rng; public Transform dropletOrigin; public bool canActivate = true; public bool canBeReplaced = true; private void Start() { if ((Object)(object)dropletOrigin == (Object)null) { dropletOrigin = ((Component)this).transform; } } public void OnInteractionBegin(Interactor activator) { //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_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Expected O, but got Unknown //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_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_008b: 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_009d: 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_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_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: 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 (!((Object)(object)dropTable == (Object)null) && canActivate) { Debug.Log((object)"AAAAAAAAAAAAAHHHHHHHHHHHHHHH"); UniquePickup none = UniquePickup.none; rng = new Xoroshiro128Plus(Run.instance.treasureRng.nextUlong); dropTable.GenerateWeightedSelection(); none = ((!canBeReplaced) ? ((PickupDropTable)dropTable).GeneratePickupPreReplacement(rng) : ((PickupDropTable)dropTable).GeneratePickup(rng)); PickupDropletController.CreatePickupDroplet(none, dropletOrigin.position + dropletOrigin.forward * 3f + Vector3.up * 3f, dropletOrigin.forward * 3f + Vector3.up * 5f, false); if (destroyOnUse) { canActivate = false; Object.Destroy((Object)(object)((Component)this).gameObject); } } } } public class LaserTurbineController : NetworkBehaviour { public struct SpinChargeState : IEquatable { public static readonly SpinChargeState zero = new SpinChargeState { initialCharge = 0f, initialSpin = 0f, snapshotTime = FixedTimeStamp.negativeInfinity }; public float initialCharge; public float initialSpin; public FixedTimeStamp snapshotTime; public float CalcCurrentSpinValue(FixedTimeStamp currentTime, float spinDecayRate, float minSpin) { //IL_0008: 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) return Mathf.Max(initialSpin - spinDecayRate * (currentTime - snapshotTime), minSpin); } public float CalcCurrentChargeValue(FixedTimeStamp currentTime, float spinDecayRate, float minSpin) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) float num = currentTime - snapshotTime; float num2 = minSpin * num; float num3 = initialSpin - minSpin; float num4 = Mathf.Min(Trajectory.CalculateFlightDuration(num3, 0f - spinDecayRate) * 0.5f, num); float num5 = Trajectory.CalculatePositionYAtTime(0f, num3, num4, 0f - spinDecayRate); return Mathf.Min(initialCharge + num2 + num5, 1f); } public bool Equals(SpinChargeState other) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) return initialCharge.Equals(other.initialCharge) && initialSpin.Equals(other.initialSpin) && ((FixedTimeStamp)(ref snapshotTime)).Equals(other.snapshotTime); } public override bool Equals(object obj) { if (obj is SpinChargeState other) { return Equals(other); } return false; } public override int GetHashCode() { return (((initialCharge.GetHashCode() * 397) ^ initialSpin.GetHashCode()) * 397) ^ ((object)(FixedTimeStamp)(ref snapshotTime)).GetHashCode(); } } public static float spinGeneratedOnKill = 0.025f; public static float spinDecayPerSecondAfterRefresh = 0.0125f; public static float minSpin = 0.025f; public static float maxSpin = 0.2f; public static float visualSpinRate = 7200f; public Transform chargeIndicator; public Transform spinIndicator; public Transform turbineDisplayRoot; public bool showTurbineDisplay = true; public string spinRtpc; public float spinRtpcScale; private GenericOwnership genericOwnership; [SyncVar] private SpinChargeState spinChargeState = SpinChargeState.zero; private CharacterBody cachedOwnerBody; public float charge { get; private set; } public float spin { get; private set; } public SpinChargeState NetworkspinChargeState { get { return spinChargeState; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar(value, ref spinChargeState, 1u); } } public CharacterBody ownerBody => cachedOwnerBody; private void Awake() { genericOwnership = ((Component)this).GetComponent(); genericOwnership.onOwnerChanged += OnOwnerChanged; } public override void OnStartServer() { //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) ((NetworkBehaviour)this).OnStartServer(); SpinChargeState networkspinChargeState = spinChargeState; networkspinChargeState.initialSpin = minSpin; networkspinChargeState.snapshotTime = FixedTimeStamp.now; NetworkspinChargeState = networkspinChargeState; } private void Update() { if (NetworkClient.active) { UpdateClient(); } } private void FixedUpdate() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000e: 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) FixedTimeStamp now = FixedTimeStamp.now; spin = spinChargeState.CalcCurrentSpinValue(now, spinDecayPerSecondAfterRefresh, minSpin); charge = spinChargeState.CalcCurrentChargeValue(now, spinDecayPerSecondAfterRefresh, minSpin); if (Object.op_Implicit((Object)(object)turbineDisplayRoot)) { ((Component)turbineDisplayRoot).gameObject.SetActive(showTurbineDisplay); } } private void OnEnable() { if (NetworkServer.active) { GlobalEventManager.onCharacterDeathGlobal += OnCharacterDeathGlobalServer; } } private void OnDisable() { GlobalEventManager.onCharacterDeathGlobal -= OnCharacterDeathGlobalServer; } [Server] public void ExpendCharge() { //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_0027: 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_005f: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { Debug.LogWarning((object)"[Server] function 'System.Void RoR2.LaserTurbineController::ExpendCharge()' called on client"); return; } FixedTimeStamp now = FixedTimeStamp.now; float num = this.spinChargeState.CalcCurrentSpinValue(now, spinDecayPerSecondAfterRefresh, minSpin); num += spinGeneratedOnKill; SpinChargeState spinChargeState = default(SpinChargeState); spinChargeState.initialSpin = num; spinChargeState.initialCharge = 0f; spinChargeState.snapshotTime = now; SpinChargeState networkspinChargeState = spinChargeState; NetworkspinChargeState = networkspinChargeState; } private void OnCharacterDeathGlobalServer(DamageReport damageReport) { if ((Object)(object)damageReport.attacker == (Object)(object)genericOwnership.ownerObject && (Object)(object)damageReport.attacker != (Object)null) { OnOwnerKilledOtherServer(); } } private void OnOwnerKilledOtherServer() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000d: 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_0061: 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) FixedTimeStamp now = FixedTimeStamp.now; float num = this.spinChargeState.CalcCurrentSpinValue(now, spinDecayPerSecondAfterRefresh, minSpin); float initialCharge = this.spinChargeState.CalcCurrentChargeValue(now, spinDecayPerSecondAfterRefresh, minSpin); num = Mathf.Min(num + spinGeneratedOnKill, maxSpin); SpinChargeState spinChargeState = default(SpinChargeState); spinChargeState.initialSpin = num; spinChargeState.initialCharge = initialCharge; spinChargeState.snapshotTime = now; SpinChargeState networkspinChargeState = spinChargeState; NetworkspinChargeState = networkspinChargeState; } private void OnOwnerChanged(GameObject newOwner) { cachedOwnerBody = (Object.op_Implicit((Object)(object)newOwner) ? newOwner.GetComponent() : null); } private void UNetVersion() { } [Client] private void UpdateClient() { //IL_003e: 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) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) if (!NetworkClient.active) { Debug.LogWarning((object)"[Client] function 'System.Void RoR2.LaserTurbineController::UpdateClient()' called on server"); return; } float num = HGMath.CircleAreaToRadius(charge * HGMath.CircleRadiusToArea(1f)); chargeIndicator.localScale = new Vector3(num, num, num); Vector3 localEulerAngles = spinIndicator.localEulerAngles; localEulerAngles.y += spin * Time.deltaTime * visualSpinRate; spinIndicator.localEulerAngles = localEulerAngles; AkSoundEngine.SetRTPCValue(spinRtpc, spin * spinRtpcScale, ((Component)this).gameObject); } public override bool OnSerialize(NetworkWriter writer, bool forceAll) { if (forceAll) { _WriteSpinChargeState_LaserTurbineController(writer, spinChargeState); return true; } bool flag = false; if ((((NetworkBehaviour)this).syncVarDirtyBits & (true ? 1u : 0u)) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } _WriteSpinChargeState_LaserTurbineController(writer, spinChargeState); } if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); } return flag; } public override void OnDeserialize(NetworkReader reader, bool initialState) { if (initialState) { spinChargeState = _ReadSpinChargeState_LaserTurbineController(reader); return; } int num = (int)reader.ReadPackedUInt32(); if (((uint)num & (true ? 1u : 0u)) != 0) { spinChargeState = _ReadSpinChargeState_LaserTurbineController(reader); } } public static void _WriteSpinChargeState_LaserTurbineController(NetworkWriter writer, SpinChargeState value) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) writer.Write(value.initialCharge); writer.Write(value.initialSpin); GeneratedNetworkCode._WriteFixedTimeStamp_Run(writer, value.snapshotTime); } public static SpinChargeState _ReadSpinChargeState_LaserTurbineController(NetworkReader reader) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) SpinChargeState result = default(SpinChargeState); result.initialCharge = reader.ReadSingle(); result.initialSpin = reader.ReadSingle(); result.snapshotTime = GeneratedNetworkCode._ReadFixedTimeStamp_Run(reader); return result; } } internal class LeechingHealingPulseComponent : MonoBehaviour { public float damageCoefficient; public float procCoefficient; public float maxHealth; public float bodyRadius; } public class SuperScrapPaymentController : MonoBehaviour { public static float pollInterval = 0.1f; private float pollCountdown = 0.2f; public PurchaseInteraction purchaseInteraction; public int paymentCreditsRemaining; public void Start() { purchaseInteraction = ((Component)this).GetComponent(); if ((Object)(object)purchaseInteraction == (Object)null) { Debug.LogError((object)"No PurchaseInteraction on SuperScrapPaymentController. Aborting!"); Object.Destroy((Object)(object)this); } } public void FixedUpdate() { //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { return; } pollCountdown -= Time.fixedDeltaTime; if (pollCountdown > 0f) { return; } pollCountdown += pollInterval; Interactor lastActivator = purchaseInteraction.lastActivator; if (purchaseInteraction.available && (Object)(object)lastActivator != (Object)null) { PayCostContext val = default(PayCostContext); DisposableRental val2 = ((BasePool)(object)PayCostContext.pool).Request(ref val); try { CharacterBody component = ((Component)lastActivator).GetComponent(); CostTypeDef costTypeDef = CostTypeCatalog.GetCostTypeDef(purchaseInteraction.costType); val.activator = lastActivator; val.activatorBody = component; val.activatorMaster = (Object.op_Implicit((Object)(object)component) ? component.master : null); val.activatorInventory = (Object.op_Implicit((Object)(object)component) ? component.inventory : null); val.purchasedObject = ((Component)this).gameObject; val.purchaseInteraction = purchaseInteraction; val.costTypeDef = costTypeDef; val.cost = purchaseInteraction.cost; val.rng = purchaseInteraction.rng; PayCostResults val3 = default(PayCostResults); DisposableRental val4 = ((BasePool)(object)PayCostResults.pool).Request(ref val3); try { MultiShopCardUtils.OnNonMoneyPurchase(val); ((UnityEvent)(object)purchaseInteraction.onPurchase).Invoke(lastActivator); ((UnityEvent)(object)purchaseInteraction.onDetailedPurchaseServer).Invoke(val, val3); paymentCreditsRemaining -= purchaseInteraction.cost; } finally { val4.Dispose(); } } finally { val2.Dispose(); } } if ((paymentCreditsRemaining < purchaseInteraction.cost && !ChimeraScrap.shouldSuperScrapOverBuy) || paymentCreditsRemaining <= 0) { Object.Destroy((Object)(object)this); } } } public class WishboneObjectiveTracker : ObjectiveTracker { public WishboneObjectiveTracker() { base.baseToken = "OBJECTIVE_WISHBONE"; } } internal class WishboneCarcassComponent : MonoBehaviour { private static List instancesList = new List(); public static ReadOnlyCollection readonlyInstancesList = new ReadOnlyCollection(instancesList); public static bool objectiveOn = false; public static void ClearAllCarcasses() { for (int num = readonlyInstancesList.Count - 1; num >= 0; num--) { WishboneCarcassComponent wishboneCarcassComponent = readonlyInstancesList[num]; if ((Object)(object)wishboneCarcassComponent != (Object)null) { GameObject gameObject = ((Component)wishboneCarcassComponent).gameObject; Object.Destroy((Object)(object)wishboneCarcassComponent); Object.Destroy((Object)(object)gameObject); } } } private void OnEnable() { if (instancesList.Count == 0) { SetWishboneObjective(enable: true); } instancesList.Add(this); } private void OnDisable() { if (instancesList.Contains(this)) { instancesList.Remove(this); } if (instancesList.Count == 0) { SetWishboneObjective(enable: false); } } private void SetWishboneObjective(bool enable) { if (enable) { if (!objectiveOn) { ObjectivePanelController.collectObjectiveSources += OnCollectObjectiveSources; objectiveOn = true; } } else if (objectiveOn) { ObjectivePanelController.collectObjectiveSources -= OnCollectObjectiveSources; objectiveOn = false; } } private static void OnCollectObjectiveSources(CharacterMaster master, List objectiveSourcesList) { //IL_0004: 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) objectiveSourcesList.Add(new ObjectiveSourceDescriptor { master = master, objectiveType = typeof(WishboneObjectiveTracker), source = (Object)(object)StormRunBehavior.instance }); } } }