using System; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using HG.Reflection; using IL.RoR2; using LookingGlass.ItemStatsNameSpace; using Microsoft.CodeAnalysis; using Mono.Cecil.Cil; using MonoMod.Cil; using On.RoR2; using On.RoR2.UI.LogBook; using R2API; using R2API.Networking; using R2API.Networking.Interfaces; using R2API.Utils; using RiskOfTactics.Content.Artifacts; using RiskOfTactics.Content.Buffs; using RiskOfTactics.Content.Equipment; using RiskOfTactics.Content.Items.Artifacts; using RiskOfTactics.Content.Items.Completes; using RiskOfTactics.Extensions; using RiskOfTactics.Managers; using RoR2; using RoR2.ExpansionManagement; using RoR2.Items; using RoR2.Orbs; using RoR2.Projectile; using RoR2.UI.LogBook; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Networking; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: OptIn] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("RiskOfTactics")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+dc47aeb227c0e20f4f402189db5396cd36afb2ac")] [assembly: AssemblyProduct("RiskOfTactics")] [assembly: AssemblyTitle("RiskOfTactics")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace RiskOfTactics { internal static class Log { private static ManualLogSource _logSource; internal static void Init(ManualLogSource logSource) { _logSource = logSource; } internal static void Debug(object data) { _logSource.LogDebug(data); } internal static void Error(object data) { _logSource.LogError(data); } 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); } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] [BepInPlugin("shirograhm.RiskOfTactics", "RiskOfTactics", "0.1.7")] public class RiskOfTactics : BaseUnityPlugin { public const string PluginGUID = "shirograhm.RiskOfTactics"; public const string PluginAuthor = "shirograhm"; public const string PluginName = "RiskOfTactics"; public const string PluginVersion = "0.1.7"; public static ExpansionDef sotvDLC = Addressables.LoadAssetAsync((object)"RoR2/DLC1/Common/DLC1.asset").WaitForCompletion(); public static ExpansionDef sotsDLC = Addressables.LoadAssetAsync((object)"RoR2/DLC2/Common/DLC2.asset").WaitForCompletion(); public static ExpansionDef acDLC = Addressables.LoadAssetAsync((object)"RoR2/DLC3/Common/DLC3.asset").WaitForCompletion(); public static PluginInfo PInfo { get; private set; } public void Awake() { PInfo = ((BaseUnityPlugin)this).Info; Log.Init(((BaseUnityPlugin)this).Logger); AssetManager.Init(); GameEventManager.Init(); ConfigOptions.Init(); Utilities.Init(); ((ResourceAvailability)(ref ItemCatalog.availability)).CallWhenAvailable((Action)Integrations.Init); Sunder.Init(); if (AdaptiveHelm.isEnabled.Value) { AdaptiveHelm.Init(); } if (ArchangelsStaff.isEnabled.Value) { ArchangelsStaff.Init(); } if (Bloodthirster.isEnabled.Value) { Bloodthirster.Init(); } if (BrambleVest.isEnabled.Value) { BrambleVest.Init(); } if (Crownguard.isEnabled.Value) { Crownguard.Init(); } if (DragonsClaw.isEnabled.Value) { DragonsClaw.Init(); } if (GuinsoosRageblade.isEnabled.Value) { GuinsoosRageblade.Init(); } if (HandOfJustice.isEnabled.Value) { HandOfJustice.Init(); } if (HextechGunblade.isEnabled.Value) { HextechGunblade.Init(); } if (Quicksilver.isEnabled.Value) { Quicksilver.Init(); } if (StrikersFlail.isEnabled.Value) { StrikersFlail.Init(); } if (SpearOfShojin.isEnabled.Value) { SpearOfShojin.Init(); } if (SunfireCape.isEnabled.Value) { SunfireCape.Init(); } if (TitansResolve.isEnabled.Value) { TitansResolve.Init(); } if (WarmogsArmor.isEnabled.Value) { WarmogsArmor.Init(); } if (GamblersBlade.isEnabled.Value) { GamblersBlade.Init(); } if (HellfireHatchet.isEnabled.Value) { HellfireHatchet.Init(); } if (HorizonFocus.isEnabled.Value) { HorizonFocus.Init(); } if (LightshieldCrest.isEnabled.Value) { LightshieldCrest.Init(); } if (Mittens.isEnabled.Value) { Mittens.Init(); } if (SnipersFocus.isEnabled.Value) { SnipersFocus.Init(); } if (StatikkShiv.isEnabled.Value) { StatikkShiv.Init(); } if (ZhonyasParadox.isEnabled.Value) { ZhonyasParadox.Init(); } if (LuckyItemChest.isEnabled.Value) { LuckyItemChest.Init(); } if (ArtifactOfTheGoldenSpat.isEnabled.Value) { ArtifactOfTheGoldenSpat.Init(); } if ((bool)ConfigManager.Scaling.useRadiantAutoConversion) { InjectRadiantItemTramsforms(); } Log.Message("Finished initializations."); } private void InjectRadiantItemTramsforms() { //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) ItemRelationshipProvider val = ScriptableObject.CreateInstance(); ((Object)val).name = "RiskOfTactics_RadiantItemProvider"; val.relationshipType = Addressables.LoadAssetAsync((object)"RoR2/DLC1/Common/ContagiousItem.asset").WaitForCompletion(); val.relationships = Utilities.GetRadiantUpgradePairs(); if (ContentAddition.AddItemRelationshipProvider(val)) { Log.Debug("Successfully injected radiant item transformations."); } else { Log.Error("Unable to inject radiant item transformations."); } } } public static class Utilities { private class SyncForceRecalculate : INetMessage, ISerializableObject { private NetworkInstanceId netID; public SyncForceRecalculate() { } public SyncForceRecalculate(NetworkInstanceId ID) { //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) netID = ID; } public void Deserialize(NetworkReader reader) { //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) netID = reader.ReadNetworkId(); } public void OnReceived() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) if (NetworkServer.active) { return; } GameObject val = Util.FindNetworkObject(netID); if (Object.op_Implicit((Object)(object)val)) { CharacterBody component = val.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.RecalculateStats(); } } } public void Serialize(NetworkWriter writer) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) writer.Write(netID); writer.FinishMessage(); } } public static List radiantPairs = new List(); internal static void Init() { NetworkingAPI.RegisterMessageType(); } public static void ForceRecalculate(CharacterBody body) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) body.RecalculateStats(); if (NetworkServer.active) { new SyncForceRecalculate(((NetworkBehaviour)body).netId); } } public static CharacterBody GetMinionOwnershipParentBody(CharacterBody body) { if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.master) && Object.op_Implicit((Object)(object)body.master.minionOwnership) && Object.op_Implicit((Object)(object)body.master.minionOwnership.ownerMaster) && Object.op_Implicit((Object)(object)body.master.minionOwnership.ownerMaster.GetBody())) { return body.master.minionOwnership.ownerMaster.GetBody(); } return body; } public static CharacterBody GetLowestHealthAlly(TeamIndex index) { //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) IEnumerable source = CharacterMaster.readOnlyInstancesList.Where((CharacterMaster el) => el.teamIndex == index); CharacterMaster val = source.OrderBy((CharacterMaster el) => (!Object.op_Implicit((Object)(object)el.GetBody())) ? 1f : (Object.op_Implicit((Object)(object)el.GetBody().healthComponent) ? el.GetBody().healthComponent.combinedHealthFraction : 1f)).FirstOrDefault(); return Object.op_Implicit((Object)(object)val) ? val.GetBody() : null; } public static uint ScaleGoldWithDifficulty(int goldGranted) { return Convert.ToUInt32((float)goldGranted * (1f + 50f * GetDifficultyAsPercentage())); } public static float GetChanceAfterLuck(float percent, float luckIn) { int num = Mathf.CeilToInt(luckIn); if (num > 0) { return 1f - Mathf.Pow(1f - percent, (float)(num + 1)); } if (num < 0) { return Mathf.Pow(percent, (float)(Mathf.Abs(num) + 1)); } return percent; } public static bool IsMeleeBodyPrefab(GameObject bodyPrefab) { if (!Object.op_Implicit((Object)(object)bodyPrefab)) { return false; } string text = ((Object)bodyPrefab).name; if (text.Contains("(Clone)")) { text = text.Replace("(Clone)", ""); } string[] source = ConfigManager.Scaling.meleeCharactersList.Value.Split(','); return source.Contains(text); } public static bool IsRangedBodyPrefab(GameObject bodyPrefab) { if (!Object.op_Implicit((Object)(object)bodyPrefab)) { return false; } string text = ((Object)bodyPrefab).name; if (text.Contains("(Clone)")) { text = text.Replace("(Clone)", ""); } string[] source = ConfigManager.Scaling.rangedCharactersList.Value.Split(','); return source.Contains(text); } public static float GetMissingHealth(HealthComponent healthComponent, bool includeShield) { if (includeShield) { return healthComponent.fullCombinedHealth * (1f - healthComponent.combinedHealthFraction); } return healthComponent.fullHealth * (1f - healthComponent.healthFraction); } public static float GetMissingHealthPercent(HealthComponent healthComponent, bool includeShield) { if (includeShield) { return 100f * (1f - healthComponent.combinedHealthFraction); } return 100f * (1f - healthComponent.healthFraction); } public static float GetDifficultyAsPercentage() { return (Stage.instance.entryDifficultyCoefficient - 1f) / 98f; } public static float GetDifficultyAsMultiplier() { return Stage.instance.entryDifficultyCoefficient; } public static float GetLinearStacking(float baseValue, int count) { return GetLinearStacking(baseValue, baseValue, count); } public static float GetLinearStacking(float baseValue, float extraValue, int count) { return baseValue + extraValue * (float)(count - 1); } public static float GetExponentialStacking(float percent, int count) { return GetExponentialStacking(percent, percent, count); } public static float GetExponentialStacking(float percent, float stackPercent, int count) { return 1f - (1f - percent) * Mathf.Pow(1f - stackPercent, (float)(count - 1)); } public static float GetReverseExponentialStacking(float baseValue, float reducePercent, int count) { return baseValue * Mathf.Pow(1f - reducePercent, (float)(count - 1)); } public static float GetHyperbolicStacking(float percent, int count) { return GetHyperbolicStacking(percent, percent, count); } public static float GetHyperbolicStacking(float percent, float extraPercent, int count) { float num = (1f + percent) * (1f + extraPercent * (float)(count - 1)); return 1f - 1f / num; } internal static BuffDef GenerateBuffDef(string name, Sprite sprite, bool canStack, bool isHidden, bool isDebuff, bool isCooldown) { BuffDef val = ScriptableObject.CreateInstance(); ((Object)val).name = name; val.iconSprite = sprite; val.canStack = canStack; val.isHidden = isHidden; val.isDebuff = isDebuff; val.isCooldown = isCooldown; return val; } internal static bool OnSameTeam(CharacterBody body1, CharacterBody body2) { //IL_0021: 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) return Object.op_Implicit((Object)(object)body1.teamComponent) && Object.op_Implicit((Object)(object)body2.teamComponent) && body1.teamComponent.teamIndex == body2.teamComponent.teamIndex; } internal static bool IsValidTargetBody(CharacterBody body) { return Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.healthComponent); } internal static void SpawnHealEffect(CharacterBody self) { //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_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown EffectData val = new EffectData { origin = self.transform.position, rootObject = ((Component)self).gameObject }; EffectManager.SpawnEffect(LegacyResourcesAPI.Load("Prefabs/Effects/MedkitHealEffect"), val, true); } internal static void SpawnGoldPack(CharacterBody attacker, CharacterBody victim, float moneyGain) { //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_0072: 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) GameObject val = Object.Instantiate(LegacyResourcesAPI.Load("Prefabs/NetworkedObjects/BonusMoneyPack"), victim.transform.position, Random.rotation); if (!Object.op_Implicit((Object)(object)val)) { return; } Collider component = val.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { TeamFilter component2 = val.GetComponent(); if (Object.op_Implicit((Object)(object)component2) && Object.op_Implicit((Object)(object)attacker.teamComponent)) { component2.teamIndex = attacker.teamComponent.teamIndex; } MoneyPickup componentInChildren = val.GetComponentInChildren(); if (Object.op_Implicit((Object)(object)componentInChildren)) { componentInChildren.baseGoldReward = Mathf.RoundToInt(moneyGain * GetDifficultyAsMultiplier()); Physics.IgnoreCollision(component, ((Component)componentInChildren).GetComponent()); } GravitatePickup componentInChildren2 = val.GetComponentInChildren(); if (Object.op_Implicit((Object)(object)componentInChildren2)) { Physics.IgnoreCollision(component, ((Component)componentInChildren2).GetComponent()); } val.transform.localScale = new Vector3(0.65f, 4.5f, 0.25f); NetworkServer.Spawn(val); } } internal static void UpdateSingleTemporaryVisualEffect(ref TemporaryVisualEffect tempEffect, GameObject tempEffectPrefab, CharacterBody userBody, bool active, string childLocatorOverride = "") { //IL_00ff: 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_0055: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)tempEffect != (Object)null != active) { if (active && Object.op_Implicit((Object)(object)tempEffectPrefab)) { GameObject val = Object.Instantiate(tempEffectPrefab, userBody.corePosition, Quaternion.identity); tempEffect = val.GetComponent(); tempEffect.parentTransform = userBody.coreTransform; tempEffect.visualState = (VisualState)0; tempEffect.healthComponent = userBody.healthComponent; tempEffect.radius = 1f; LocalCameraEffect component = val.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.targetCharacter = ((Component)userBody).gameObject; } if (!string.IsNullOrEmpty(childLocatorOverride)) { ModelLocator modelLocator = userBody.modelLocator; object obj; if (modelLocator == null) { obj = null; } else { Transform modelTransform = modelLocator.modelTransform; obj = ((modelTransform != null) ? ((Component)modelTransform).GetComponent() : null); } ChildLocator val2 = (ChildLocator)obj; if (Object.op_Implicit((Object)(object)val2)) { Transform val3 = val2.FindChild(childLocatorOverride); if (Object.op_Implicit((Object)(object)val3)) { tempEffect.parentTransform = val3; } } } } else { tempEffect.visualState = (VisualState)1; } } if ((Object)(object)tempEffect != (Object)null) { bool active2 = (Object)(object)userBody.currentVehicle == (Object)null || !userBody.currentVehicle.hidePassenger; if (Object.op_Implicit((Object)(object)tempEffect.visualTransform)) { ((Component)tempEffect.visualTransform).gameObject.SetActive(active2); } } } public static Pair[] GetRadiantUpgradePairs() { return radiantPairs.ToArray(); } internal static void RegisterRadiantUpgrade(ItemDef itemDef, ItemDef radiantDef) { //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) radiantPairs.Add(new Pair { itemDef1 = itemDef, itemDef2 = radiantDef }); } } } namespace RiskOfTactics.Managers { public static class AssetManager { public static AssetBundle bundle; public const string bundleName = "rotassets"; public static string AssetBundlePath => Path.Combine(Path.GetDirectoryName(RiskOfTactics.PInfo.Location), "rotassets"); public static void Init() { bundle = AssetBundle.LoadFromFile(AssetBundlePath); } } public static class ConfigManager { public static class Scaling { public static ConfigFile config = new ConfigFile(Paths.ConfigPath + "\\RiskOfTactics.cfg", true); public static string categoryName = "RiskOfTactics Config"; public static string categoryGUID = "shirograhm.RiskOfTactics_config"; public static ConfigOptions.ConfigurableValue useCustomValues = ConfigOptions.ConfigurableValue.CreateBool(categoryGUID, categoryName, config, "! Important !", "Use Custom Configs", defaultValue: false, "Set to true to enable the custom config values below."); public static ConfigOptions.ConfigurableValue meleeCharactersList = ConfigOptions.ConfigurableValue.CreateString(categoryGUID, categoryName, config, "! Important !", "Melee Characters", "MercBody,LoaderBody,CrocoBody,FalseSonBody,Executioner2Body,NemCommandoBody", "List of melee characters. Add modded charater bodies here to enable selective item effects (e.g. Adaptive Helm)."); public static ConfigOptions.ConfigurableValue rangedCharactersList = ConfigOptions.ConfigurableValue.CreateString(categoryGUID, categoryName, config, "! Important !", "Ranged Characters", "CommandoBody,HuntressBody,Bandit2Body,ToolbotBody,EngiBody,EngiTurretBody,MageBody,TreebotBody,CaptainBody,RailGunnerBody,VoidSurvivorBody,SeekerBody,ChefBody,ScavBody,RangerBody,ChirrBody,ElectricianBody", "List of ranged characters. Add modded charater bodies here to enable selective item effects (e.g. Adaptive Helm)."); public static ConfigOptions.ConfigurableValue radiantItemStatMultiplier = ConfigOptions.ConfigurableValue.CreateFloat(categoryGUID, categoryName, config, "! Important !", "Radiant Stat Multiplier", 2f, 1f, 1000000f, "Value all stats are multiplied by when upgraded to radiant."); public static ConfigOptions.ConfigurableValue useRadiantAutoConversion = ConfigOptions.ConfigurableValue.CreateBool(categoryGUID, categoryName, config, "! Important !", "Radiant Auto-Conversion", defaultValue: true, "Set to true to enable automatic conversion of items to their radiant versions if you have both in your inventory. WARNING: Disabling this may cause bugs."); } } public class ConfigurableValue : ConfigOptions.ConfigurableValue { public ConfigurableValue(string section, string key, float defaultValue, string description = "", List stringsToAffect = null, bool isRadiantStat = false, Action onChanged = null) : base(ConfigManager.Scaling.config, section, key, (T)Convert.ChangeType(defaultValue, typeof(T)), description, stringsToAffect, isRadiantStat, ConfigManager.Scaling.useCustomValues.bepinexConfigEntry, restartRequired: false, (Action)null) { ConfigOptions.ConfigurableValue.CreateFloat(ConfigManager.Scaling.categoryGUID, ConfigManager.Scaling.categoryName, ConfigManager.Scaling.config, section, key, defaultValue, 0f, 1000000f, description, stringsToAffect, isRadiantStat, ConfigManager.Scaling.useCustomValues.bepinexConfigEntry, restartRequired: false, onChanged); } public ConfigurableValue(string section, string key, int defaultValue, string description = "", List stringsToAffect = null, bool isRadiantStat = false, Action onChanged = null) : base(ConfigManager.Scaling.config, section, key, (T)Convert.ChangeType(defaultValue, typeof(T)), description, stringsToAffect, isRadiantStat, ConfigManager.Scaling.useCustomValues.bepinexConfigEntry, restartRequired: false, (Action)null) { ConfigOptions.ConfigurableValue.CreateInt(ConfigManager.Scaling.categoryGUID, ConfigManager.Scaling.categoryName, ConfigManager.Scaling.config, section, key, defaultValue, 0, 1000000, description, stringsToAffect, isRadiantStat, ConfigManager.Scaling.useCustomValues.bepinexConfigEntry, restartRequired: false, onChanged); } public ConfigurableValue(string section, string key, bool defaultValue, string description = "", List stringsToAffect = null, Action onChanged = null) : base(ConfigManager.Scaling.config, section, key, (T)Convert.ChangeType(defaultValue, typeof(T)), description, stringsToAffect, isRadiantStat: false, ConfigManager.Scaling.useCustomValues.bepinexConfigEntry, restartRequired: false, (Action)null) { ConfigOptions.ConfigurableValue.CreateBool(ConfigManager.Scaling.categoryGUID, ConfigManager.Scaling.categoryName, ConfigManager.Scaling.config, section, key, defaultValue, description, stringsToAffect, isRadiantStat: false, ConfigManager.Scaling.useCustomValues.bepinexConfigEntry, restartRequired: false, onChanged); } public ConfigurableValue(string section, string key, string defaultValue, string description = "", List stringsToAffect = null, Action onChanged = null) : base(ConfigManager.Scaling.config, section, key, (T)Convert.ChangeType(defaultValue, typeof(T)), description, stringsToAffect, isRadiantStat: false, ConfigManager.Scaling.useCustomValues.bepinexConfigEntry, restartRequired: false, (Action)null) { ConfigOptions.ConfigurableValue.CreateString(ConfigManager.Scaling.categoryGUID, ConfigManager.Scaling.categoryName, ConfigManager.Scaling.config, section, key, defaultValue, description, stringsToAffect, isRadiantStat: false, ConfigManager.Scaling.useCustomValues.bepinexConfigEntry, restartRequired: false, onChanged); } } public static class ConfigOptions { public abstract class ConfigurableValue { public static List instancesList = new List(); public List stringsToAffect = new List(); public bool isRadiantStat = false; public string key = ""; public string id = ""; public static ConfigurableValue Create(ConfigFile configFile, string section, string key, T defaultValue, string description = "", List stringsToAffect = null, bool isRadiantStat = false, ConfigEntry useCustomValueConfigEntry = null, bool restartRequired = false, Action onChanged = null) { return new ConfigurableValue(configFile, section, key, defaultValue, description, stringsToAffect, isRadiantStat, useCustomValueConfigEntry, restartRequired, onChanged); } public static ConfigurableValue CreateInt(string modGUID, string modName, ConfigFile configFile, string section, string key, int defaultValue, int min = 0, int max = 1000, string description = "", List stringsToAffect = null, bool isRadiantStat = false, ConfigEntry useCustomValueConfigEntry = null, bool restartRequired = false, Action onChanged = null) { return Create(configFile, section, key, defaultValue, description, stringsToAffect, isRadiantStat, useCustomValueConfigEntry, restartRequired, onChanged); } public static ConfigurableValue CreateFloat(string modGUID, string modName, ConfigFile configFile, string section, string key, float defaultValue, float min = 0f, float max = 1000f, string description = "", List stringsToAffect = null, bool isRadiantStat = false, ConfigEntry useCustomValueConfigEntry = null, bool restartRequired = false, Action onChanged = null) { return Create(configFile, section, key, defaultValue, description, stringsToAffect, isRadiantStat, useCustomValueConfigEntry, restartRequired, onChanged); } public static ConfigurableValue CreateBool(string modGUID, string modName, ConfigFile configFile, string section, string key, bool defaultValue, string description = "", List stringsToAffect = null, bool isRadiantStat = false, ConfigEntry useCustomValueConfigEntry = null, bool restartRequired = false, Action onChanged = null) { return Create(configFile, section, key, defaultValue, description, stringsToAffect, isRadiantStat, useCustomValueConfigEntry, restartRequired, onChanged); } public static ConfigurableValue CreateString(string modGUID, string modName, ConfigFile configFile, string section, string key, string defaultValue, string description = "", List stringsToAffect = null, bool isRadiantStat = false, ConfigEntry useCustomValueConfigEntry = null, bool restartRequired = false, Action onChanged = null) { return Create(configFile, section, key, defaultValue, description, stringsToAffect, isRadiantStat, useCustomValueConfigEntry, restartRequired, onChanged); } } public class ConfigurableValue : ConfigurableValue { public ConfigEntry bepinexConfigEntry; private ConfigEntry useCustomValueConfigEntry; private T defaultValue; public T Value { get { if (useCustomValueConfigEntry != null && useCustomValueConfigEntry.Value) { return bepinexConfigEntry.Value; } return defaultValue; } } public ConfigurableValue(ConfigFile configFile, string section, string key, T defaultValue, string description = "", List stringsToAffect = null, bool isRadiantStat = false, ConfigEntry useCustomValueConfigEntry = null, bool restartRequired = false, Action onChanged = null) { ConfigurableValue configurableValue = this; id = Path.GetFileNameWithoutExtension(configFile.ConfigFilePath) + "." + section + "." + key; ConfigurableValue configurableValue2 = ConfigurableValue.instancesList.FirstOrDefault((ConfigurableValue x) => x.id == configurableValue.id); if (configurableValue2 != null) { ConfigurableValue configurableValue3 = configurableValue2 as ConfigurableValue; bepinexConfigEntry = configurableValue3.bepinexConfigEntry; this.useCustomValueConfigEntry = useCustomValueConfigEntry; } else { bepinexConfigEntry = configFile.Bind(section, key, defaultValue, description); ConfigurableValue.instancesList.Add(this); } this.useCustomValueConfigEntry = useCustomValueConfigEntry; base.key = key; this.defaultValue = defaultValue; base.isRadiantStat = isRadiantStat; if (stringsToAffect != null) { base.stringsToAffect = stringsToAffect; } else { base.stringsToAffect = new List(); } if (onChanged != null) { bepinexConfigEntry.SettingChanged += delegate { onChanged(configurableValue.bepinexConfigEntry.Value); reloadLogbook = true; }; onChanged(bepinexConfigEntry.Value); reloadLogbook = true; } } public override string ToString() { return Convert.ToString(Value, CultureInfo.InvariantCulture); } public static implicit operator T(ConfigurableValue configurableValue) { return configurableValue.Value; } } [CompilerGenerated] private static class <>O { public static hook_Awake <0>__LogBookController_Awake; public static hook_GetLocalizedStringByToken <1>__Language_GetLocalizedStringByToken; } private static bool reloadLogbook; internal static 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_001c: Expected O, but got Unknown //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_003d: Expected O, but got Unknown object obj = <>O.<0>__LogBookController_Awake; if (obj == null) { hook_Awake val = LogBookController_Awake; <>O.<0>__LogBookController_Awake = val; obj = (object)val; } LogBookController.Awake += (hook_Awake)obj; object obj2 = <>O.<1>__Language_GetLocalizedStringByToken; if (obj2 == null) { hook_GetLocalizedStringByToken val2 = Language_GetLocalizedStringByToken; <>O.<1>__Language_GetLocalizedStringByToken = val2; obj2 = (object)val2; } Language.GetLocalizedStringByToken += (hook_GetLocalizedStringByToken)obj2; } private static void LogBookController_Awake(orig_Awake orig, LogBookController self) { orig.Invoke(self); if (reloadLogbook) { reloadLogbook = false; LogBookController.BuildStaticData(); } } private static string Language_GetLocalizedStringByToken(orig_GetLocalizedStringByToken orig, Language self, string token) { string text = orig.Invoke(self, token); bool flag = token.Contains("RADIANT_"); foreach (ConfigurableValue item in ConfigurableValue.instancesList.FindAll((ConfigurableValue x) => x.stringsToAffect.Contains(token.Replace("RADIANT_", "")))) { string newValue; if (flag && item.isRadiantStat) { if (1 == 0) { } string text2 = ((item is ConfigurableValue configurableValue) ? (configurableValue.Value * (float)ConfigManager.Scaling.radiantItemStatMultiplier).ToString() : ((!(item is ConfigurableValue configurableValue2)) ? item.ToString() : ((float)configurableValue2.Value * (float)ConfigManager.Scaling.radiantItemStatMultiplier).ToString())); if (1 == 0) { } newValue = text2; } else { newValue = item.ToString(); } text = text.Replace("{" + item.key + "}", newValue); text = text.Replace("{Sunder Reduction}", Sunder.armorReduction.Value.ToString()); } return text; } } internal class GameEventManager { public delegate void DamageAttackerVictimEventHandler(DamageInfo damageInfo, GenericCharacterInfo attackerInfo, GenericCharacterInfo victimInfo); public delegate void DamageReportEventHandler(DamageReport damageReport); public struct GenericCharacterInfo { public GameObject gameObject; public CharacterBody body; public CharacterMaster master; public TeamComponent teamComponent; public HealthComponent healthComponent; public Inventory inventory; public TeamIndex teamIndex; public Vector3 aimOrigin; public unsafe GenericCharacterInfo(CharacterBody body) { //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: 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_00b4: 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_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00a1->IL00a1: Incompatible stack types: Ref vs I4 //IL_0096->IL00a1: Incompatible stack types: I4 vs Ref //IL_0096->IL00a1: Incompatible stack types: Ref vs I4 this.body = body; gameObject = (Object.op_Implicit((Object)(object)body) ? ((Component)body).gameObject : null); master = (Object.op_Implicit((Object)(object)body) ? body.master : null); teamComponent = (Object.op_Implicit((Object)(object)body) ? body.teamComponent : null); healthComponent = (Object.op_Implicit((Object)(object)body) ? body.healthComponent : null); inventory = (Object.op_Implicit((Object)(object)master) ? master.inventory : null); ref GenericCharacterInfo reference = ref this; int num; if (Object.op_Implicit((Object)(object)teamComponent)) { reference = ref *(GenericCharacterInfo*)teamComponent.teamIndex; num = (int)(ref reference); } else { num = 0; reference = ref *(GenericCharacterInfo*)num; num = (int)(ref reference); } Unsafe.Write(&((GenericCharacterInfo*)num)->teamIndex, (TeamIndex)(ref reference)); Vector3 normalized; if (!Object.op_Implicit((Object)(object)body)) { Vector3 insideUnitSphere = Random.insideUnitSphere; normalized = ((Vector3)(ref insideUnitSphere)).normalized; } else { normalized = body.aimOrigin; } aimOrigin = normalized; } } public class GenericDamageEvent : MonoBehaviour, IOnIncomingDamageServerReceiver, IOnTakeDamageServerReceiver { public HealthComponent healthComponent; public CharacterBody victimBody; public void Start() { healthComponent = ((Component)this).GetComponent(); if (!Object.op_Implicit((Object)(object)healthComponent)) { Object.Destroy((Object)(object)this); } else { victimBody = healthComponent.body; } } public void OnIncomingDamageServer(DamageInfo damageInfo) { GenericCharacterInfo attackerInfo = default(GenericCharacterInfo); if (Object.op_Implicit((Object)(object)damageInfo.attacker)) { attackerInfo = new GenericCharacterInfo(damageInfo.attacker.GetComponent()); } GenericCharacterInfo victimInfo = new GenericCharacterInfo(victimBody); GameEventManager.BeforeTakeDamage?.Invoke(damageInfo, attackerInfo, victimInfo); } public void OnTakeDamageServer(DamageReport damageReport) { if (Object.op_Implicit((Object)(object)victimBody) && GameEventManager.OnTakeDamage != null) { GameEventManager.OnTakeDamage(damageReport); } } } [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static hook_Awake <>9__12_0; public static hook_OnHitEnemy <>9__12_1; internal void b__12_0(orig_Awake orig, HealthComponent self) { ((Component)self).gameObject.AddComponent(); orig.Invoke(self); } internal void b__12_1(orig_OnHitEnemy orig, GlobalEventManager self, DamageInfo damageInfo, GameObject victim) { orig.Invoke(self, damageInfo, victim); if (Object.op_Implicit((Object)(object)damageInfo.attacker)) { CharacterBody component = damageInfo.attacker.GetComponent(); CharacterBody body = (Object.op_Implicit((Object)(object)victim) ? victim.GetComponent() : null); GenericCharacterInfo attackerInfo = new GenericCharacterInfo(component); GenericCharacterInfo victimInfo = new GenericCharacterInfo(body); GameEventManager.OnHitEnemy?.Invoke(damageInfo, attackerInfo, victimInfo); } } } public static event DamageAttackerVictimEventHandler OnHitEnemy; public static event DamageAttackerVictimEventHandler BeforeTakeDamage; public static event DamageReportEventHandler OnTakeDamage; internal static void Init() { //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_0020: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected O, but got Unknown object obj = <>c.<>9__12_0; if (obj == null) { hook_Awake val = delegate(orig_Awake orig, HealthComponent self) { ((Component)self).gameObject.AddComponent(); orig.Invoke(self); }; <>c.<>9__12_0 = val; obj = (object)val; } HealthComponent.Awake += (hook_Awake)obj; object obj2 = <>c.<>9__12_1; if (obj2 == null) { hook_OnHitEnemy val2 = delegate(orig_OnHitEnemy orig, GlobalEventManager self, DamageInfo damageInfo, GameObject victim) { orig.Invoke(self, damageInfo, victim); if (Object.op_Implicit((Object)(object)damageInfo.attacker)) { CharacterBody component = damageInfo.attacker.GetComponent(); CharacterBody body = (Object.op_Implicit((Object)(object)victim) ? victim.GetComponent() : null); GenericCharacterInfo attackerInfo = new GenericCharacterInfo(component); GenericCharacterInfo victimInfo = new GenericCharacterInfo(body); GameEventManager.OnHitEnemy?.Invoke(damageInfo, attackerInfo, victimInfo); } }; <>c.<>9__12_1 = val2; obj2 = (object)val2; } GlobalEventManager.OnHitEnemy += (hook_OnHitEnemy)obj2; } } public static class ItemManager { public enum TacticTier { Normal, Radiant, Artifact } public static List normalList = new List(); public static List radiantList = new List(); public static List artifactList = new List(); public static ItemDef GenerateItem(string name, ItemTag[] tags, TacticTier tTier) { //IL_0027: 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: Expected O, but got Unknown //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Expected O, but got Unknown //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) ItemDef val = ScriptableObject.CreateInstance(); ((Object)val).name = "ROT_" + name.ToUpperInvariant(); val.AutoPopulateTokens(); SetItemTier(val, GetTierFromTacticTier(tTier)); GameObject val2 = AssetManager.bundle.LoadAsset(name + ".prefab"); if ((Object)(object)val2 == (Object)null) { Log.Warning("Missing prefab file for item " + ((Object)val).name + ". Substituting default..."); val2 = Addressables.LoadAssetAsync((object)"RoR2/Base/Mystery/PickupMystery.prefab").WaitForCompletion(); } ModelPanelParameters val3 = val2.AddComponent(); val3.focusPointTransform = val2.transform; val3.cameraPositionTransform = val2.transform; val3.maxDistance = 10f; val3.minDistance = 5f; val.pickupIconSprite = AssetManager.bundle.LoadAsset(name + ".png"); val.pickupModelPrefab = val2; val.canRemove = true; val.hidden = false; val.tags = tags; ItemDisplayRuleDict val4 = new ItemDisplayRuleDict((ItemDisplayRule[])null); ItemAPI.Add(new CustomItem(val, val4)); switch (tTier) { case TacticTier.Normal: normalList.Add(val); break; case TacticTier.Radiant: radiantList.Add(val); break; case TacticTier.Artifact: artifactList.Add(val); break; } return val; } public static EquipmentDef GenerateEquipment(string name, float cooldown, bool isLunar = false, bool appearsInMultiPlayer = true, bool appearsInSinglePlayer = true, bool canBeRandomlyTriggered = true, bool enigmaCompatible = true, bool canDrop = true) { //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Expected O, but got Unknown //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Expected O, but got Unknown //IL_00e0: Unknown result type (might be due to invalid IL or missing references) EquipmentDef val = ScriptableObject.CreateInstance(); ((Object)val).name = "ROT_" + name.ToUpperInvariant(); val.AutoPopulateTokens(); GameObject val2 = AssetManager.bundle.LoadAsset(name + ".prefab"); if ((Object)(object)val2 == (Object)null) { Log.Warning("Missing prefab file for equipment " + ((Object)val).name + ". Substituting default..."); val2 = Addressables.LoadAssetAsync((object)"RoR2/Base/Mystery/PickupMystery.prefab").WaitForCompletion(); } ModelPanelParameters val3 = val2.AddComponent(); val3.focusPointTransform = val2.transform; val3.cameraPositionTransform = val2.transform; val3.maxDistance = 10f; val3.minDistance = 5f; val.pickupIconSprite = AssetManager.bundle.LoadAsset(name + ".png"); val.pickupModelPrefab = val2; val.isLunar = isLunar; if (isLunar) { val.colorIndex = (ColorIndex)4; } val.appearsInMultiPlayer = appearsInMultiPlayer; val.appearsInSinglePlayer = appearsInSinglePlayer; val.canBeRandomlyTriggered = canBeRandomlyTriggered; val.enigmaCompatible = enigmaCompatible; val.canDrop = canDrop; val.cooldown = cooldown; ItemDisplayRuleDict val4 = new ItemDisplayRuleDict((ItemDisplayRule[])null); ItemAPI.Add(new CustomEquipment(val, val4)); return val; } public static ItemTier GetTierFromTacticTier(TacticTier tier) { //IL_001a: 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_0022: 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_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) if (1 == 0) { } ItemTier result = (ItemTier)(tier switch { TacticTier.Normal => 1, TacticTier.Radiant => 4, TacticTier.Artifact => 2, _ => 5, }); if (1 == 0) { } return result; } public static ItemDef GetRandomTacticItemOfTier(TacticTier tier) { if (1 == 0) { } ItemDef result = (ItemDef)(tier switch { TacticTier.Normal => normalList[Random.Range(0, normalList.Count)], TacticTier.Radiant => radiantList[Random.Range(0, radiantList.Count)], TacticTier.Artifact => artifactList[Random.Range(0, artifactList.Count)], _ => null, }); if (1 == 0) { } return result; } public static void SetItemTier(ItemDef itemDef, ItemTier tier) { //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_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Invalid comparison between Unknown and I4 //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) if ((int)tier == 5) { try { itemDef.deprecatedTier = tier; } catch (Exception arg) { Log.Warning($"Error setting deprecatedTier for {((Object)itemDef).name}: {arg}"); } } ((ResourceAvailability)(ref ItemTierCatalog.availability)).CallWhenAvailable((Action)delegate { //IL_0017: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)itemDef)) { itemDef.tier = tier; } }); } } internal class SoundManager { public static uint zhonyas_SFX_ID = 3923907719u; } } namespace RiskOfTactics.Extensions { internal class Integrations { internal static bool lookingGlassEnabled; internal static void Init() { Dictionary pluginInfos = Chainloader.PluginInfos; if (pluginInfos.ContainsKey("droppod.lookingglass")) { try { Log.Debug("Running code injection for LookingGlass."); LookingGlassIntegration.Init(); lookingGlassEnabled = true; } catch (Exception data) { Log.Error(data); } } } } internal static class LookingGlassIntegration { public static class LookingGlassStats { private readonly struct ItemStatLine { public string Name { get; } public ValueType ValueType { get; } public MeasurementUnits Units { get; } public ItemStatLine(string n, ValueType v, MeasurementUnits u) { //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_000f: 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) Name = n; ValueType = v; Units = u; } } public static void RegisterStats() { if (BrambleVest.isEnabled.Value) { RegisterStatsForItemWithRadiantVariant(BrambleVest.itemDef, BrambleVest.radiantDef, new List(1) { new ItemStatLine("Damage Reflected: ", (ValueType)1, (MeasurementUnits)4) }, delegate(CharacterMaster master, int itemCount) { List list3 = new List(); if (Object.op_Implicit((Object)(object)master) && Object.op_Implicit((Object)(object)master.inventory) && Object.op_Implicit((Object)(object)((Component)master.inventory).GetComponent())) { list3.Add(((Component)master.inventory).GetComponent().DamageReflected); } else { list3.Add(0f); } return list3; }); } if (HextechGunblade.isEnabled.Value) { RegisterStatsForItemWithRadiantVariant(HextechGunblade.itemDef, HextechGunblade.radiantDef, new List(1) { new ItemStatLine("Total Healing: ", (ValueType)0, (MeasurementUnits)4) }, delegate(CharacterMaster master, int itemCount) { List list2 = new List(); if (Object.op_Implicit((Object)(object)master) && Object.op_Implicit((Object)(object)master.inventory) && Object.op_Implicit((Object)(object)((Component)master.inventory).GetComponent())) { list2.Add(((Component)master.inventory).GetComponent().DamageHealed); } else { list2.Add(0f); } return list2; }); } if (SpearOfShojin.isEnabled.Value) { RegisterStatsForItem(SpearOfShojin.itemDef, new List(1) { new ItemStatLine("On-Hit Reduction: ", (ValueType)2, (MeasurementUnits)1) }, (CharacterMaster master, int itemCount) => new List(1) { Utilities.GetHyperbolicStacking(SpearOfShojin.percentCooldownOnHit, SpearOfShojin.percentCooldownOnHitExtraStacks, itemCount) }); RegisterStatsForItem(SpearOfShojin.radiantDef, new List(1) { new ItemStatLine("On-Hit Reduction: ", (ValueType)2, (MeasurementUnits)1) }, (CharacterMaster master, int itemCount) => new List(1) { Utilities.GetHyperbolicStacking(SpearOfShojin.percentCooldownOnHit, SpearOfShojin.percentCooldownOnHitExtraStacks, itemCount) * PercentRadiantItemStatMultiplier }); } if (WarmogsArmor.isEnabled.Value) { RegisterStatsForItem(WarmogsArmor.itemDef, new List(1) { new ItemStatLine("Bonus Health: ", (ValueType)2, (MeasurementUnits)2) }, delegate(CharacterMaster master, int itemCount) { float num2 = Utilities.GetLinearStacking(WarmogsArmor.flatHealth, WarmogsArmor.flatHealthExtraStacks, itemCount); CharacterBody body2 = master.GetBody(); if (Object.op_Implicit((Object)(object)((body2 != null) ? body2.healthComponent : null))) { num2 += master.GetBody().healthComponent.fullHealth * WarmogsArmor.percentHealthBonus; } return new List(1) { num2 }; }); RegisterStatsForItem(WarmogsArmor.radiantDef, new List(1) { new ItemStatLine("Bonus Health: ", (ValueType)2, (MeasurementUnits)2) }, delegate(CharacterMaster master, int itemCount) { float num = Utilities.GetLinearStacking(WarmogsArmor.flatHealth, WarmogsArmor.flatHealthExtraStacks, itemCount) * PercentRadiantItemStatMultiplier; CharacterBody body = master.GetBody(); if (Object.op_Implicit((Object)(object)((body != null) ? body.healthComponent : null))) { num += master.GetBody().healthComponent.fullHealth * WarmogsArmor.percentHealthBonus * PercentRadiantItemStatMultiplier; } return new List(1) { num }; }); } if (GamblersBlade.isEnabled.Value) { RegisterStatsForItem(GamblersBlade.itemDef, new List(1) { new ItemStatLine("Max Money Threshold: ", (ValueType)16, (MeasurementUnits)5) }, (CharacterMaster master, int itemCount) => new List(1) { (float)GamblersBlade.moneyEffectCap.Value * Utilities.GetDifficultyAsMultiplier() }); } if (HorizonFocus.isEnabled.Value) { RegisterStatsForItem(HorizonFocus.itemDef, new List(2) { new ItemStatLine("Stun Chance: ", (ValueType)2, (MeasurementUnits)1), new ItemStatLine("Explosion Damage: ", (ValueType)3, (MeasurementUnits)7) }, delegate(CharacterMaster master, int itemCount) { List list = new List(); if (Object.op_Implicit((Object)(object)master)) { list.Add(Utilities.GetChanceAfterLuck(HorizonFocus.percentStunChance, master.luck)); } else { list.Add(HorizonFocus.percentStunChance); } list.Add(Utilities.GetHyperbolicStacking(HorizonFocus.percentLightningDamage, HorizonFocus.percentLightningDamageExtraStacks, itemCount)); return list; }); } if (LightshieldCrest.isEnabled.Value) { RegisterStatsForItem(LightshieldCrest.itemDef, new List(1) { new ItemStatLine("Armor Conversion: ", (ValueType)17, (MeasurementUnits)1) }, (CharacterMaster master, int itemCount) => new List(1) { Utilities.GetLinearStacking(LightshieldCrest.percentArmor, LightshieldCrest.percentArmorExtraStacks, itemCount) }); } if (Mittens.isEnabled.Value) { RegisterStatsForItem(Mittens.itemDef, new List(2) { new ItemStatLine("Attack Speed: ", (ValueType)1, (MeasurementUnits)1), new ItemStatLine("Movement Speed: ", (ValueType)2, (MeasurementUnits)1) }, (CharacterMaster master, int itemCount) => new List(2) { Utilities.GetLinearStacking(Mittens.percentAttackSpeed, Mittens.percentAttackSpeedExtraStacks, itemCount), Utilities.GetLinearStacking(Mittens.percentMovementSpeed, Mittens.percentMovementSpeedExtraStacks, itemCount) }); } if (SnipersFocus.isEnabled.Value) { RegisterStatsForItem(SnipersFocus.itemDef, new List(1) { new ItemStatLine("Damage Per Meter: ", (ValueType)1, (MeasurementUnits)1) }, (CharacterMaster master, int itemCount) => new List(1) { Utilities.GetLinearStacking(SnipersFocus.percentDamageIncreasePerMeter, SnipersFocus.percentDamageIncreasePerMeterExtraStacks, itemCount) }); } } private static void RegisterStatsForItemWithRadiantVariant(ItemDef defaultItem, ItemDef radiantItem, List statLines, Func> func) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown //IL_006d: 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_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Expected I4, but got Unknown ItemDef[] array = (ItemDef[])(object)new ItemDef[2] { defaultItem, radiantItem }; foreach (ItemDef val in array) { if (!Object.op_Implicit((Object)(object)val)) { throw new ArgumentNullException("itemDef"); } ItemStatsDef val2 = new ItemStatsDef(); foreach (ItemStatLine statLine in statLines) { val2.descriptions.Add(statLine.Name); val2.valueTypes.Add(statLine.ValueType); val2.measurementUnits.Add(statLine.Units); } val2.calculateValues = func; ItemDefinitions.allItemDefinitions.Add((int)val.itemIndex, val2); } } private static void RegisterStatsForItem(ItemDef itemDef, List statLines, Func> func) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown //IL_004d: 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_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Expected I4, but got Unknown if (!Object.op_Implicit((Object)(object)itemDef)) { throw new ArgumentNullException("itemDef"); } ItemStatsDef val = new ItemStatsDef(); foreach (ItemStatLine statLine in statLines) { val.descriptions.Add(statLine.Name); val.valueTypes.Add(statLine.ValueType); val.measurementUnits.Add(statLine.Units); } val.calculateValues = func; ItemDefinitions.allItemDefinitions.Add((int)itemDef.itemIndex, val); } } private static float PercentRadiantItemStatMultiplier => ConfigManager.Scaling.radiantItemStatMultiplier; internal static void Init() { RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(LookingGlassStats.RegisterStats)); } } } namespace RiskOfTactics.Content.Items.Completes { public class AdaptiveHelmItemBehavior : BaseItemBodyBehavior { [ItemDefAssociation(useOnServer = true, useOnClient = false)] public static ItemDef GetItemDef() { return AdaptiveHelm.itemDef; } public void FixedUpdate() { AdaptiveHelm.FixedUpdateHook(((BaseItemBodyBehavior)this).body, base.stack, AdaptiveHelm.cooldownResetBuff); } } public class RadiantAdaptiveHelmItemBehavior : BaseItemBodyBehavior { [ItemDefAssociation(useOnServer = true, useOnClient = false)] public static ItemDef GetItemDef() { return AdaptiveHelm.radiantDef; } public void FixedUpdate() { AdaptiveHelm.FixedUpdateHook(((BaseItemBodyBehavior)this).body, base.stack, AdaptiveHelm.radiantCooldownResetBuff); } } internal class AdaptiveHelm { public static ItemDef itemDef; public static BuffDef cooldownResetBuff; public static ItemDef radiantDef; public static BuffDef radiantCooldownResetBuff; public static ConfigurableValue isEnabled = new ConfigurableValue("Item: Adaptive Helm", "Enabled", defaultValue: true, "Whether or not the item is enabled.", new List(1) { "ITEM_ROT_ADAPTIVEHELM_DESC" }); public static ConfigurableValue commonStatBoost = new ConfigurableValue("Item: Adaptive Helm", "Common Stat Boost", 20f, "Base armor and % max HP shield for all users.", new List(1) { "ITEM_ROT_ADAPTIVEHELM_DESC" }, isRadiantStat: true); public static ConfigurableValue meleeResistBonus = new ConfigurableValue("Item: Adaptive Helm", "Melee: Bonus Resist", 20f, "Melee: Armor and % shield bonus for melee users for the first stack.", new List(1) { "ITEM_ROT_ADAPTIVEHELM_DESC" }, isRadiantStat: true); public static ConfigurableValue meleeResistBonusExtraStacks = new ConfigurableValue("Item: Adaptive Helm", "Melee: Bonus Resist Extra Stacks", 20f, "Melee: Armor and % shield bonus for melee users with extra stacks.", new List(1) { "ITEM_ROT_ADAPTIVEHELM_DESC" }, isRadiantStat: true); public static ConfigurableValue cooldownRefundOnTakeDamage = new ConfigurableValue("Item: Adaptive Helm", "Melee: Cooldown Refund", 0.5f, "Melee: Seconds cooldown refunded when taking damage.", new List(1) { "ITEM_ROT_ADAPTIVEHELM_DESC" }, isRadiantStat: true); public static ConfigurableValue rangedDamageBonus = new ConfigurableValue("Item: Adaptive Helm", "Ranged: Bonus Damage", 1f, "Ranged: Flat damage bonus for ranged users for the first stack.", new List(1) { "ITEM_ROT_ADAPTIVEHELM_DESC" }, isRadiantStat: true); public static ConfigurableValue rangedDamageBonusExtraStacks = new ConfigurableValue("Item: Adaptive Helm", "Ranged: Bonus Damage Extra Stacks", 1f, "Ranged: Flat damage bonus for ranged users with extra stacks.", new List(1) { "ITEM_ROT_ADAPTIVEHELM_DESC" }, isRadiantStat: true); public static ConfigurableValue cooldownRefreshInterval = new ConfigurableValue("Item: Adaptive Helm", "Ranged: Cooldown Interval", 20f, "Ranged: All cooldowns are refunded on this interval for ranged item users.", new List(1) { "ITEM_ROT_ADAPTIVEHELM_DESC" }); public static ConfigurableValue cooldownRefreshIntervalReduction = new ConfigurableValue("Item: Adaptive Helm", "Ranged: Cooldown Interval Reduction", 20f, "Ranged: Cooldown refund timer for this item is reduced by this percentage per stack for ranged users.", new List(1) { "ITEM_ROT_ADAPTIVEHELM_DESC" }); public static readonly float percentCommonStatBoost = commonStatBoost.Value / 100f; public static readonly float percentMeleeResistBonus = meleeResistBonus.Value / 100f; public static readonly float percentMeleeResistBonusExtraStacks = meleeResistBonusExtraStacks.Value / 100f; public static readonly float percentCooldownRefreshIntervalReduction = cooldownRefreshIntervalReduction.Value / 100f; internal static void Init() { ItemTag[] array = new ItemTag[3]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); itemDef = ItemManager.GenerateItem("AdaptiveHelm", (ItemTag[])(object)array, ItemManager.TacticTier.Normal); ItemTag[] array2 = new ItemTag[3]; RuntimeHelpers.InitializeArray(array2, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); radiantDef = ItemManager.GenerateItem("Radiant_AdaptiveHelm", (ItemTag[])(object)array2, ItemManager.TacticTier.Radiant); cooldownResetBuff = Utilities.GenerateBuffDef("CooldownResetBuff", AssetManager.bundle.LoadAsset("AdaptiveHelm"), canStack: false, isHidden: false, isDebuff: false, isCooldown: true); ContentAddition.AddBuffDef(cooldownResetBuff); radiantCooldownResetBuff = Utilities.GenerateBuffDef("RadiantCooldownResetBuff", AssetManager.bundle.LoadAsset("Radiant_AdaptiveHelm"), canStack: false, isHidden: false, isDebuff: false, isCooldown: true); ContentAddition.AddBuffDef(radiantCooldownResetBuff); Utilities.RegisterRadiantUpgrade(itemDef, radiantDef); Hooks(itemDef, ItemManager.TacticTier.Normal, cooldownResetBuff); Hooks(radiantDef, ItemManager.TacticTier.Radiant, radiantCooldownResetBuff); } public static void Hooks(ItemDef def, ItemManager.TacticTier tier, BuffDef cooldownReset) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Expected O, but got Unknown //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Expected O, but got Unknown float radiantMultiplier = (tier.Equals(ItemManager.TacticTier.Radiant) ? ((float)ConfigManager.Scaling.radiantItemStatMultiplier) : 1f); RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)delegate(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender) && Object.op_Implicit((Object)(object)sender.inventory)) { int itemCountEffective2 = sender.inventory.GetItemCountEffective(def); if (itemCountEffective2 > 0) { args.armorAdd += Utilities.GetLinearStacking(commonStatBoost.Value * radiantMultiplier, 0f, itemCountEffective2); args.baseShieldAdd += sender.healthComponent.fullHealth * Utilities.GetLinearStacking(percentCommonStatBoost * radiantMultiplier, 0f, itemCountEffective2); if (Utilities.IsMeleeBodyPrefab(((Component)sender).gameObject)) { args.armorTotalMult *= 1f + Utilities.GetLinearStacking(percentMeleeResistBonus * radiantMultiplier, percentMeleeResistBonusExtraStacks * radiantMultiplier, itemCountEffective2); args.shieldTotalMult *= 1f + Utilities.GetLinearStacking(percentMeleeResistBonus * radiantMultiplier, percentMeleeResistBonusExtraStacks * radiantMultiplier, itemCountEffective2); } if (Utilities.IsRangedBodyPrefab(((Component)sender).gameObject)) { args.baseDamageAdd += Utilities.GetLinearStacking(rangedDamageBonus.Value * radiantMultiplier, rangedDamageBonusExtraStacks.Value * radiantMultiplier, itemCountEffective2); } } } }; CharacterBody.OnBuffFinalStackLost += (hook_OnBuffFinalStackLost)delegate(orig_OnBuffFinalStackLost orig, CharacterBody self, BuffDef buffDef) { orig.Invoke(self, buffDef); if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.skillLocator) && (Object)(object)buffDef == (Object)(object)cooldownReset) { self.skillLocator.ResetSkills(); } }; GameEventManager.OnTakeDamage += delegate(DamageReport damageReport) { CharacterBody victimBody = damageReport.victimBody; if (Object.op_Implicit((Object)(object)victimBody) && Object.op_Implicit((Object)(object)victimBody.inventory) && Object.op_Implicit((Object)(object)victimBody.skillLocator)) { int itemCountEffective = victimBody.inventory.GetItemCountEffective(def); if (itemCountEffective > 0 && Utilities.IsMeleeBodyPrefab(((Component)victimBody).gameObject)) { victimBody.skillLocator.DeductCooldownFromAllSkillsServer(cooldownRefundOnTakeDamage.Value * radiantMultiplier); } } }; } internal static void FixedUpdateHook(CharacterBody self, int itemCount, BuffDef cooldownReset) { if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.inventory) && itemCount > 0 && Utilities.IsRangedBodyPrefab(((Component)self).gameObject) && !self.HasBuff(cooldownReset)) { self.AddTimedBuff(cooldownReset, Utilities.GetReverseExponentialStacking(cooldownRefreshInterval.Value, percentCooldownRefreshIntervalReduction, itemCount)); } } } public class ArchangelsStaffItemBehavior : BaseItemBodyBehavior { [ItemDefAssociation(useOnServer = true, useOnClient = false)] public static ItemDef GetItemDef() { return ArchangelsStaff.itemDef; } public void FixedUpdate() { ArchangelsStaff.FixedUpdateHook(((BaseItemBodyBehavior)this).body, base.stack, ArchangelsStaff.staffIntervalCooldown); } } public class ArchangelsStaffRadiantItemBehavior : BaseItemBodyBehavior { [ItemDefAssociation(useOnServer = true, useOnClient = false)] public static ItemDef GetItemDef() { return ArchangelsStaff.radiantDef; } public void FixedUpdate() { ArchangelsStaff.FixedUpdateHook(((BaseItemBodyBehavior)this).body, base.stack, ArchangelsStaff.staffRadiantIntervalCooldown); } } internal class ArchangelsStaff { public static BuffDef foresightBuff; public static ItemDef itemDef; public static BuffDef staffIntervalCooldown; public static ItemDef radiantDef; public static BuffDef staffRadiantIntervalCooldown; public static ConfigurableValue isEnabled = new ConfigurableValue("Item: Archangels Staff", "Enabled", defaultValue: true, "Whether or not the item is enabled.", new List(1) { "ITEM_ROT_ARCHANGELSSTAFF_DESC" }); public static ConfigurableValue flatDamagePerTick = new ConfigurableValue("Item: Archangels Staff", "Flat Damage Per Tick", 0.5f, "Flat damage gained per item proc.", new List(1) { "ITEM_ROT_ARCHANGELSSTAFF_DESC" }, isRadiantStat: true); public static ConfigurableValue tickDuration = new ConfigurableValue("Item: Archangels Staff", "Tick Duration", 5f, "Number of seconds between item procs.", new List(1) { "ITEM_ROT_ARCHANGELSSTAFF_DESC" }); internal static void Init() { itemDef = ItemManager.GenerateItem("ArchangelsStaff", (ItemTag[])(object)new ItemTag[2] { (ItemTag)1, (ItemTag)31 }, ItemManager.TacticTier.Normal); radiantDef = ItemManager.GenerateItem("Radiant_ArchangelsStaff", (ItemTag[])(object)new ItemTag[2] { (ItemTag)1, (ItemTag)31 }, ItemManager.TacticTier.Radiant); foresightBuff = Utilities.GenerateBuffDef("Foresight", AssetManager.bundle.LoadAsset("Foresight.png"), canStack: true, isHidden: false, isDebuff: false, isCooldown: false); ContentAddition.AddBuffDef(foresightBuff); staffIntervalCooldown = Utilities.GenerateBuffDef("ArchangelIntervalCooldown", AssetManager.bundle.LoadAsset("ArchangelsStaff.png"), canStack: false, isHidden: true, isDebuff: false, isCooldown: true); ContentAddition.AddBuffDef(staffIntervalCooldown); staffRadiantIntervalCooldown = Utilities.GenerateBuffDef("RadiantArchangelIntervalCooldown", AssetManager.bundle.LoadAsset("Radiant_ArchangelsStaff.png"), canStack: false, isHidden: true, isDebuff: false, isCooldown: true); ContentAddition.AddBuffDef(staffRadiantIntervalCooldown); Utilities.RegisterRadiantUpgrade(itemDef, radiantDef); Hooks(itemDef, staffIntervalCooldown, ItemManager.TacticTier.Normal); Hooks(radiantDef, staffRadiantIntervalCooldown, ItemManager.TacticTier.Radiant); } public static void Hooks(ItemDef def, BuffDef cooldownBuff, ItemManager.TacticTier tier) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Expected O, but got Unknown //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Expected O, but got Unknown //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Expected O, but got Unknown float radiantMultiplier = (tier.Equals(ItemManager.TacticTier.Radiant) ? ((float)ConfigManager.Scaling.radiantItemStatMultiplier) : 1f); RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)delegate(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender)) { int buffCount = sender.GetBuffCount(foresightBuff); args.baseDamageAdd += (float)buffCount * flatDamagePerTick.Value * radiantMultiplier; } }; HoldoutZoneController.Start += (hook_Start)delegate(orig_Start orig, HoldoutZoneController self) { orig.Invoke(self); foreach (NetworkUser readOnlyInstances in NetworkUser.readOnlyInstancesList) { CharacterMaster val = readOnlyInstances.masterController.master ?? readOnlyInstances.master; if (Object.op_Implicit((Object)(object)val)) { CharacterBody body = val.GetBody(); if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.inventory) && body.inventory.GetItemCountEffective(def) > 0) { body.AddTimedBuff(cooldownBuff, tickDuration.Value); } } } }; CharacterBody.OnBuffFinalStackLost += (hook_OnBuffFinalStackLost)delegate(orig_OnBuffFinalStackLost orig, CharacterBody self, BuffDef buffDef) { orig.Invoke(self, buffDef); if ((Object)(object)buffDef == (Object)(object)cooldownBuff && Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.inventory)) { int itemCountEffective = self.inventory.GetItemCountEffective(def); if (itemCountEffective > 0 && InstanceTracker.GetInstancesList().Count > 0) { self.AddBuff(foresightBuff); self.AddTimedBuff(cooldownBuff, tickDuration.Value); } } }; } public static void FixedUpdateHook(CharacterBody body, int itemCount, BuffDef cooldownBuff) { foreach (HoldoutZoneController instances in InstanceTracker.GetInstancesList()) { if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.inventory) && itemCount > 0 && ((Behaviour)instances).isActiveAndEnabled && !body.HasBuff(cooldownBuff)) { body.AddTimedBuff(cooldownBuff, tickDuration.Value); } } } } internal class Bloodthirster { public static ItemDef itemDef; public static BuffDef satedBuff; public static ItemDef radiantDef; public static ConfigurableValue isEnabled = new ConfigurableValue("Item: Bloodthirster", "Enabled", defaultValue: true, "Whether or not the item is enabled.", new List(1) { "ITEM_ROT_BLOODTHIRSTER_DESC" }); public static ConfigurableValue effectCooldown = new ConfigurableValue("Item: Bloodthirster", "Effect Cooldown", 60f, "Cooldown of this item's effect.", new List(1) { "ITEM_ROT_BLOODTHIRSTER_DESC" }); public static ConfigurableValue barrierTriggerHP = new ConfigurableValue("Item: Bloodthirster", "HP Threshold", 25f, "Threshold needed to fall below in order to trigger this item's effect.", new List(1) { "ITEM_ROT_BLOODTHIRSTER_DESC" }, isRadiantStat: true); public static ConfigurableValue barrierSize = new ConfigurableValue("Item: Bloodthirster", "Percent Barrier", 20f, "Percent max HP barrier given when this item is procced.", new List(1) { "ITEM_ROT_BLOODTHIRSTER_DESC" }, isRadiantStat: true); public static ConfigurableValue barrierSizeExtraStacks = new ConfigurableValue("Item: Bloodthirster", "Percent Barrier Extra Stacks", 20f, "Percent max HP barrier given when extra stacks of item are procced.", new List(1) { "ITEM_ROT_BLOODTHIRSTER_DESC" }, isRadiantStat: true); private static readonly float percentBarrierTriggerHP = barrierTriggerHP.Value / 100f; private static readonly float percentBarrierSize = barrierSize.Value / 100f; private static readonly float percentBarrierSizeExtraStacks = barrierSizeExtraStacks.Value / 100f; internal static void Init() { ItemTag[] array = new ItemTag[4]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); itemDef = ItemManager.GenerateItem("Bloodthirster", (ItemTag[])(object)array, ItemManager.TacticTier.Normal); ItemTag[] array2 = new ItemTag[4]; RuntimeHelpers.InitializeArray(array2, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); radiantDef = ItemManager.GenerateItem("Radiant_Bloodthirster", (ItemTag[])(object)array2, ItemManager.TacticTier.Radiant); satedBuff = Utilities.GenerateBuffDef("Sated", AssetManager.bundle.LoadAsset("Sated.png"), canStack: false, isHidden: false, isDebuff: false, isCooldown: true); ContentAddition.AddBuffDef(satedBuff); Utilities.RegisterRadiantUpgrade(itemDef, radiantDef); Hooks(itemDef, ItemManager.TacticTier.Normal); Hooks(radiantDef, ItemManager.TacticTier.Radiant); } public static void Hooks(ItemDef def, ItemManager.TacticTier tier) { float radiantMultiplier = (tier.Equals(ItemManager.TacticTier.Radiant) ? ((float)ConfigManager.Scaling.radiantItemStatMultiplier) : 1f); GameEventManager.OnTakeDamage += delegate(DamageReport damageReport) { CharacterBody victimBody = damageReport.victimBody; if (Object.op_Implicit((Object)(object)victimBody) && Object.op_Implicit((Object)(object)victimBody.inventory) && Object.op_Implicit((Object)(object)victimBody.healthComponent)) { int itemCountEffective = victimBody.inventory.GetItemCountEffective(def); if (itemCountEffective > 0 && !victimBody.HasBuff(satedBuff) && victimBody.healthComponent.combinedHealthFraction < percentBarrierTriggerHP * radiantMultiplier) { victimBody.healthComponent.AddBarrier(victimBody.healthComponent.fullCombinedHealth * Utilities.GetLinearStacking(percentBarrierSize * radiantMultiplier, percentBarrierSizeExtraStacks * radiantMultiplier, itemCountEffective)); victimBody.AddTimedBuff(satedBuff, effectCooldown.Value); } } }; } } public class BrambleVest { public class Statistics : MonoBehaviour { public class Sync : INetMessage, ISerializableObject { private NetworkInstanceId objId; private float damageReflected; public Sync() { } public Sync(NetworkInstanceId objId, float damage) { //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) this.objId = objId; damageReflected = damage; } public void Deserialize(NetworkReader reader) { //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) objId = reader.ReadNetworkId(); damageReflected = reader.ReadSingle(); } public void OnReceived() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) if (NetworkServer.active) { return; } GameObject val = Util.FindNetworkObject(objId); if ((Object)(object)val != (Object)null) { Statistics component = val.GetComponent(); if ((Object)(object)component != (Object)null) { component.DamageReflected = damageReflected; } } } public void Serialize(NetworkWriter writer) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) writer.Write(objId); writer.Write(damageReflected); writer.FinishMessage(); } } private float _damageReflected; public float DamageReflected { get { return _damageReflected; } set { //IL_001d: Unknown result type (might be due to invalid IL or missing references) _damageReflected = value; if (NetworkServer.active) { NetMessageExtensions.Send((INetMessage)(object)new Sync(((Component)this).gameObject.GetComponent().netId, value), (NetworkDestination)1); } } } } public class BrambleOrb : Orb { private readonly float speed = 60f; private readonly float multi; private readonly DamageReport damageReport; public BrambleOrb(DamageReport report, float radiantMult) { //IL_005c: 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_0061: Unknown result type (might be due to invalid IL or missing references) damageReport = report; multi = radiantMult; if (Object.op_Implicit((Object)(object)report.victimBody) && Object.op_Implicit((Object)(object)report.attackerBody)) { base.origin = (Object.op_Implicit((Object)(object)report.victimBody) ? report.victimBody.corePosition : Vector3.zero); if (Object.op_Implicit((Object)(object)report.attackerBody)) { base.target = report.attackerBody.mainHurtBox; } } } public override void Begin() { //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_001c: 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_0034: Expected O, but got Unknown ((Orb)this).duration = ((Orb)this).distanceToTarget / speed; EffectData val = new EffectData { origin = base.origin, genericFloat = ((Orb)this).duration }; val.SetHurtBoxReference(base.target); EffectManager.SpawnEffect(OrbStorageUtility.Get("Prefabs/Effects/OrbEffects/ClayGooOrbEffect"), val, true); } public override void OnArrival() { //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_00a6: 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_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: 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_00dd: 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_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Expected O, but got Unknown if (Object.op_Implicit((Object)(object)damageReport.attackerBody) && Object.op_Implicit((Object)(object)damageReport.victimBody) && Object.op_Implicit((Object)(object)damageReport.victimBody.inventory)) { CharacterBody victimBody = damageReport.victimBody; CharacterBody attackerBody = damageReport.attackerBody; int itemCountEffective = damageReport.victimBody.inventory.GetItemCountEffective(itemDef); DamageInfo val = new DamageInfo { damage = damageReport.damageInfo.damage * Utilities.GetLinearStacking(percentReflectDamage * multi, itemCountEffective), damageColorIndex = (DamageColorIndex)4, damageType = DamageTypeCombo.op_Implicit((DamageType)0), attacker = ((Component)victimBody).gameObject, crit = victimBody.RollCrit(), inflictor = ((Component)victimBody).gameObject, procCoefficient = reflectProcCoefficient, procChainMask = default(ProcChainMask) }; attackerBody.healthComponent.TakeDamage(val); CharacterBody minionOwnershipParentBody = Utilities.GetMinionOwnershipParentBody(damageReport.victimBody); Statistics component = ((Component)minionOwnershipParentBody.inventory).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.DamageReflected += val.damage; } } } } public static ItemDef itemDef; public static ItemDef radiantDef; public static ConfigurableValue isEnabled = new ConfigurableValue("Item: Bramble Vest", "Enabled", defaultValue: true, "Whether or not the item is enabled.", new List(1) { "ITEM_ROT_BRAMBLEVEST_DESC" }); public static ConfigurableValue healthBonus = new ConfigurableValue("Item: Bramble Vest", "Health", 5f, "Percent health bonus when holding this item.", new List(1) { "ITEM_ROT_BRAMBLEVEST_DESC" }, isRadiantStat: true); public static ConfigurableValue flatDamageReduction = new ConfigurableValue("Item: Bramble Vest", "Damage Reduction", 5, "Flat damage reduction bonus when holding this item.", new List(1) { "ITEM_ROT_BRAMBLEVEST_DESC" }, isRadiantStat: true); public static ConfigurableValue reflectDamage = new ConfigurableValue("Item: Bramble Vest", "Reflect Percent", 100f, "Percent damage reflected back to the attacker when holding this item.", new List(1) { "ITEM_ROT_BRAMBLEVEST_DESC" }, isRadiantStat: true); public static ConfigurableValue reflectProcCoefficient = new ConfigurableValue("Item: Bramble Vest", "Reflect Proc Coefficient", 0.5f, "Proc coefficient for the reflected damage hit when holding this item.", new List(1) { "ITEM_ROT_BRAMBLEVEST_DESC" }); public static readonly float percentHealthBonus = healthBonus.Value / 100f; public static readonly float percentReflectDamage = reflectDamage.Value / 100f; internal static void Init() { ItemTag[] array = new ItemTag[3]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); itemDef = ItemManager.GenerateItem("BrambleVest", (ItemTag[])(object)array, ItemManager.TacticTier.Normal); ItemTag[] array2 = new ItemTag[3]; RuntimeHelpers.InitializeArray(array2, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); radiantDef = ItemManager.GenerateItem("Radiant_BrambleVest", (ItemTag[])(object)array2, ItemManager.TacticTier.Radiant); NetworkingAPI.RegisterMessageType(); Utilities.RegisterRadiantUpgrade(itemDef, radiantDef); Hooks(itemDef, ItemManager.TacticTier.Normal); Hooks(radiantDef, ItemManager.TacticTier.Radiant); } public static void Hooks(ItemDef def, ItemManager.TacticTier tier) { //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown float radiantMultiplier = (tier.Equals(ItemManager.TacticTier.Radiant) ? ((float)ConfigManager.Scaling.radiantItemStatMultiplier) : 1f); CharacterMaster.onStartGlobal += delegate(CharacterMaster obj) { Inventory inventory = obj.inventory; if (inventory != null) { ((Component)inventory).gameObject.AddComponent(); } }; RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)delegate(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender) && Object.op_Implicit((Object)(object)sender.inventory)) { int itemCountEffective3 = sender.inventory.GetItemCountEffective(def); if (itemCountEffective3 > 0) { args.healthTotalMult *= 1f + percentHealthBonus * radiantMultiplier; } } }; GameEventManager.BeforeTakeDamage += delegate(DamageInfo damageInfo, GameEventManager.GenericCharacterInfo attackerInfo, GameEventManager.GenericCharacterInfo victimInfo) { CharacterBody body = victimInfo.body; if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.inventory)) { int itemCountEffective2 = body.inventory.GetItemCountEffective(def); if (itemCountEffective2 > 0) { damageInfo.damage = ((damageInfo.damage > (float)flatDamageReduction.Value * radiantMultiplier + 1f) ? (damageInfo.damage - (float)flatDamageReduction.Value * radiantMultiplier) : 1f); } } }; GameEventManager.OnTakeDamage += delegate(DamageReport damageReport) { CharacterBody victimBody = damageReport.victimBody; CharacterBody attackerBody = damageReport.attackerBody; if (Object.op_Implicit((Object)(object)victimBody) && Object.op_Implicit((Object)(object)victimBody.inventory) && Object.op_Implicit((Object)(object)attackerBody) && Object.op_Implicit((Object)(object)attackerBody.healthComponent)) { int itemCountEffective = victimBody.inventory.GetItemCountEffective(def); if (itemCountEffective > 0 && !Utilities.OnSameTeam(victimBody, attackerBody)) { OrbManager.instance.AddOrb((Orb)(object)new BrambleOrb(damageReport, radiantMultiplier)); } } }; } } internal class Crownguard { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static hook_OnBuffFinalStackLost <>9__13_1; internal void b__13_1(orig_OnBuffFinalStackLost orig, CharacterBody self, BuffDef buffDef) { orig.Invoke(self, buffDef); if (Object.op_Implicit((Object)(object)self) && (Object)(object)buffDef == (Object)(object)guardedBuff) { self.AddBuff(crownedBuff); } } } public static ItemDef itemDef; public static BuffDef guardedBuff; public static BuffDef crownedBuff; public static ItemDef radiantDef; public static ConfigurableValue isEnabled = new ConfigurableValue("Item: Crownguard", "Enabled", defaultValue: true, "Whether or not the item is enabled.", new List(1) { "ITEM_ROT_CROWNGUARD_DESC" }); public static ConfigurableValue effectShield = new ConfigurableValue("Item: Crownguard", "Effect Shield", 25f, "Percent max HP shield bonus when teleporter is activated.", new List(1) { "ITEM_ROT_CROWNGUARD_DESC" }, isRadiantStat: true); public static ConfigurableValue effectShieldExtraStacks = new ConfigurableValue("Item: Crownguard", "Effect Shield Extra Stacks", 25f, "Percent max HP shield bonus with extra stacks when teleporter is activated.", new List(1) { "ITEM_ROT_CROWNGUARD_DESC" }, isRadiantStat: true); public static ConfigurableValue effectDuration = new ConfigurableValue("Item: Crownguard", "Effect Duration", 30f, "How long the shield effect lasts when teleporter is activated.", new List(1) { "ITEM_ROT_CROWNGUARD_DESC" }); public static ConfigurableValue effectDamage = new ConfigurableValue("Item: Crownguard", "Effect Damage", 2.5f, "Damage bonus given after the shield effect expires.", new List(1) { "ITEM_ROT_CROWNGUARD_DESC" }, isRadiantStat: true); public static ConfigurableValue effectDamageExtraStacks = new ConfigurableValue("Item: Crownguard", "Effect Damage Extra Stacks", 2f, "Damage bonus given after the shield effect expires.", new List(1) { "ITEM_ROT_CROWNGUARD_DESC" }, isRadiantStat: true); private static readonly float percentEffectShield = effectShield.Value / 100f; private static readonly float percentEffectShieldExtraStacks = effectShieldExtraStacks.Value / 100f; internal static void Init() { ItemTag[] array = new ItemTag[3]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); itemDef = ItemManager.GenerateItem("Crownguard", (ItemTag[])(object)array, ItemManager.TacticTier.Normal); ItemTag[] array2 = new ItemTag[3]; RuntimeHelpers.InitializeArray(array2, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); radiantDef = ItemManager.GenerateItem("Radiant_Crownguard", (ItemTag[])(object)array2, ItemManager.TacticTier.Radiant); guardedBuff = Utilities.GenerateBuffDef("Guarded", AssetManager.bundle.LoadAsset("Guarded.png"), canStack: false, isHidden: false, isDebuff: false, isCooldown: true); ContentAddition.AddBuffDef(guardedBuff); crownedBuff = Utilities.GenerateBuffDef("Crowned", AssetManager.bundle.LoadAsset("Crowned.png"), canStack: false, isHidden: false, isDebuff: false, isCooldown: false); ContentAddition.AddBuffDef(crownedBuff); Utilities.RegisterRadiantUpgrade(itemDef, radiantDef); Hooks(itemDef, ItemManager.TacticTier.Normal); Hooks(radiantDef, ItemManager.TacticTier.Radiant); } public static void Hooks(ItemDef def, ItemManager.TacticTier tier) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Expected O, but got Unknown //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Expected O, but got Unknown float radiantMultiplier = (tier.Equals(ItemManager.TacticTier.Radiant) ? ((float)ConfigManager.Scaling.radiantItemStatMultiplier) : 1f); RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)delegate(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender) && Object.op_Implicit((Object)(object)sender.inventory)) { int itemCountEffective = sender.inventory.GetItemCountEffective(def); if (itemCountEffective > 0) { if (sender.GetBuffCount(guardedBuff) > 0) { args.baseShieldAdd += sender.healthComponent.fullHealth * Utilities.GetLinearStacking(percentEffectShield * radiantMultiplier, percentEffectShieldExtraStacks * radiantMultiplier, itemCountEffective); } if (sender.GetBuffCount(crownedBuff) > 0) { args.baseDamageAdd += Utilities.GetLinearStacking(effectDamage.Value * radiantMultiplier, effectDamageExtraStacks.Value * radiantMultiplier, itemCountEffective); } } } }; object obj = <>c.<>9__13_1; if (obj == null) { hook_OnBuffFinalStackLost val = delegate(orig_OnBuffFinalStackLost orig, CharacterBody self, BuffDef buffDef) { orig.Invoke(self, buffDef); if (Object.op_Implicit((Object)(object)self) && (Object)(object)buffDef == (Object)(object)guardedBuff) { self.AddBuff(crownedBuff); } }; <>c.<>9__13_1 = val; obj = (object)val; } CharacterBody.OnBuffFinalStackLost += (hook_OnBuffFinalStackLost)obj; HoldoutZoneController.Start += (hook_Start)delegate(orig_Start orig, HoldoutZoneController self) { orig.Invoke(self); foreach (NetworkUser readOnlyInstances in NetworkUser.readOnlyInstancesList) { CharacterMaster val2 = readOnlyInstances.masterController.master ?? readOnlyInstances.master; if (Object.op_Implicit((Object)(object)val2)) { CharacterBody body = val2.GetBody(); if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.inventory) && body.inventory.GetItemCountEffective(def) > 0) { body.AddTimedBuff(guardedBuff, effectDuration.Value * radiantMultiplier); } } } }; } } public class DragonsClawItemBehavior : BaseItemBodyBehavior { [ItemDefAssociation(useOnServer = true, useOnClient = false)] public static ItemDef GetItemDef() { return DragonsClaw.itemDef; } public void FixedUpdate() { DragonsClaw.FixedUpdateHook(((BaseItemBodyBehavior)this).body, base.stack, DragonsClaw.dragonsClawCooldownBuff); } } public class RadiantDragonsClawItemBehavior : BaseItemBodyBehavior { [ItemDefAssociation(useOnServer = true, useOnClient = false)] public static ItemDef GetItemDef() { return DragonsClaw.radiantDef; } public void FixedUpdate() { DragonsClaw.FixedUpdateHook(((BaseItemBodyBehavior)this).body, base.stack, DragonsClaw.radiantDragonsClawCooldownBuff); } } internal class DragonsClaw { public static ItemDef itemDef; public static BuffDef dragonsClawCooldownBuff; public static ItemDef radiantDef; public static BuffDef radiantDragonsClawCooldownBuff; public static ConfigurableValue isEnabled = new ConfigurableValue("Item: Dragons Claw", "Enabled", defaultValue: true, "Whether or not the item is enabled.", new List(1) { "ITEM_ROT_DRAGONSCLAW_DESC" }); public static ConfigurableValue maxHealthBonus = new ConfigurableValue("Item: Dragons Claw", "Percent Health", 8f, "Percent max health bonus when holding this item.", new List(1) { "ITEM_ROT_DRAGONSCLAW_DESC" }, isRadiantStat: true); public static ConfigurableValue maxHealthBonusExtraStacks = new ConfigurableValue("Item: Dragons Claw", "Percent Health Per Stack", 8f, "Percent max health bonus when holding extra stacks of this item.", new List(1) { "ITEM_ROT_DRAGONSCLAW_DESC" }, isRadiantStat: true); public static ConfigurableValue healingPerTick = new ConfigurableValue("Item: Dragons Claw", "Healing Per Tick", 4f, "Percent max health healing per item proc.", new List(1) { "ITEM_ROT_DRAGONSCLAW_DESC" }, isRadiantStat: true); public static ConfigurableValue tickDuration = new ConfigurableValue("Item: Dragons Claw", "Tick Duration", 8f, "Number of seconds between item procs.", new List(1) { "ITEM_ROT_DRAGONSCLAW_DESC" }); public static readonly float percentHealingPerTick = healingPerTick.Value / 100f; public static readonly float percentMaxHealthBonus = maxHealthBonus.Value / 100f; public static readonly float percentMaxHealthBonusExtraStacks = maxHealthBonusExtraStacks.Value / 100f; internal static void Init() { ItemTag[] array = new ItemTag[3]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); itemDef = ItemManager.GenerateItem("DragonsClaw", (ItemTag[])(object)array, ItemManager.TacticTier.Normal); dragonsClawCooldownBuff = Utilities.GenerateBuffDef("DragonsClawCooldown", AssetManager.bundle.LoadAsset("DragonsClawCooldown"), canStack: false, isHidden: false, isDebuff: false, isCooldown: true); ContentAddition.AddBuffDef(dragonsClawCooldownBuff); ItemTag[] array2 = new ItemTag[3]; RuntimeHelpers.InitializeArray(array2, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); radiantDef = ItemManager.GenerateItem("Radiant_DragonsClaw", (ItemTag[])(object)array2, ItemManager.TacticTier.Radiant); radiantDragonsClawCooldownBuff = Utilities.GenerateBuffDef("DragonsClawRadiantCooldown", AssetManager.bundle.LoadAsset("DragonsClawRadiantCooldown"), canStack: false, isHidden: false, isDebuff: false, isCooldown: true); ContentAddition.AddBuffDef(radiantDragonsClawCooldownBuff); Utilities.RegisterRadiantUpgrade(itemDef, radiantDef); Hooks(itemDef, dragonsClawCooldownBuff, ItemManager.TacticTier.Normal); Hooks(radiantDef, radiantDragonsClawCooldownBuff, ItemManager.TacticTier.Radiant); } public static void Hooks(ItemDef def, BuffDef cooldownBuff, ItemManager.TacticTier tier) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Expected O, but got Unknown //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Expected O, but got Unknown float radiantMultiplier = (tier.Equals(ItemManager.TacticTier.Radiant) ? ((float)ConfigManager.Scaling.radiantItemStatMultiplier) : 1f); RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)delegate(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender) && Object.op_Implicit((Object)(object)sender.inventory)) { int itemCountEffective = sender.inventory.GetItemCountEffective(def); if (itemCountEffective > 0) { args.healthTotalMult *= 1f + Utilities.GetLinearStacking(percentMaxHealthBonus * radiantMultiplier, percentMaxHealthBonusExtraStacks * radiantMultiplier, itemCountEffective); } } }; CharacterBody.OnBuffFinalStackLost += (hook_OnBuffFinalStackLost)delegate(orig_OnBuffFinalStackLost orig, CharacterBody self, BuffDef buffDef) { //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) orig.Invoke(self, buffDef); if ((Object)(object)buffDef == (Object)(object)cooldownBuff) { self.healthComponent.Heal(self.maxHealth * percentHealingPerTick, default(ProcChainMask), true); Utilities.SpawnHealEffect(self); if (Object.op_Implicit((Object)(object)self.inventory) && self.inventory.GetItemCountEffective(def) > 0) { self.AddTimedBuff(cooldownBuff, tickDuration.Value); } } }; } internal static void FixedUpdateHook(CharacterBody body, int stack, BuffDef buff) { if (Object.op_Implicit((Object)(object)body) && body.GetBuffCount(buff) == 0 && stack > 0) { body.AddTimedBuff(buff, tickDuration.Value); } } } internal class GuinsoosRageblade { public class Statistics : MonoBehaviour { public class Sync : INetMessage, ISerializableObject { private NetworkInstanceId objId; private GameObject lastTarget; public Sync() { } public Sync(NetworkInstanceId objId, GameObject tick) { //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) this.objId = objId; lastTarget = tick; } public void Deserialize(NetworkReader reader) { //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) objId = reader.ReadNetworkId(); lastTarget = reader.ReadGameObject(); } public void OnReceived() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) if (NetworkServer.active) { return; } GameObject val = Util.FindNetworkObject(objId); if ((Object)(object)val != (Object)null) { Statistics component = val.GetComponent(); if ((Object)(object)component != (Object)null) { component.LastTarget = lastTarget; } } } public void Serialize(NetworkWriter writer) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) writer.Write(objId); writer.Write(lastTarget); writer.FinishMessage(); } } private GameObject _lastTarget; public GameObject LastTarget { get { return _lastTarget; } set { //IL_001d: Unknown result type (might be due to invalid IL or missing references) _lastTarget = value; if (NetworkServer.active) { NetMessageExtensions.Send((INetMessage)(object)new Sync(((Component)this).gameObject.GetComponent().netId, value), (NetworkDestination)1); } } } } public static ItemDef itemDef; public static BuffDef wrathBuff; public static ItemDef radiantDef; public static ConfigurableValue isEnabled = new ConfigurableValue("Item: Guinsoos Rageblade", "Enabled", defaultValue: true, "Whether or not the item is enabled.", new List(1) { "ITEM_ROT_GUINSOOSRAGEBLADE_DESC" }); public static ConfigurableValue attackSpeedOnHit = new ConfigurableValue("Item: Guinsoos Rageblade", "Attack Speed On-Hit", 3f, "Percent attack speed gained on-hit while hitting the same target.", new List(1) { "ITEM_ROT_GUINSOOSRAGEBLADE_DESC" }, isRadiantStat: true); public static readonly float percentAttackSpeedOnHit = attackSpeedOnHit.Value / 100f; internal static void Init() { ItemTag[] array = new ItemTag[3]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); itemDef = ItemManager.GenerateItem("GuinsoosRageblade", (ItemTag[])(object)array, ItemManager.TacticTier.Normal); ItemTag[] array2 = new ItemTag[3]; RuntimeHelpers.InitializeArray(array2, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); radiantDef = ItemManager.GenerateItem("Radiant_GuinsoosRageblade", (ItemTag[])(object)array2, ItemManager.TacticTier.Radiant); NetworkingAPI.RegisterMessageType(); wrathBuff = Utilities.GenerateBuffDef("Wrath", AssetManager.bundle.LoadAsset("Wrath.png"), canStack: true, isHidden: false, isDebuff: false, isCooldown: false); ContentAddition.AddBuffDef(wrathBuff); Utilities.RegisterRadiantUpgrade(itemDef, radiantDef); Hooks(itemDef, ItemManager.TacticTier.Normal); Hooks(radiantDef, ItemManager.TacticTier.Radiant); } public static void Hooks(ItemDef def, ItemManager.TacticTier tier) { //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown float radiantMultiplier = (tier.Equals(ItemManager.TacticTier.Radiant) ? ((float)ConfigManager.Scaling.radiantItemStatMultiplier) : 1f); CharacterMaster.onStartGlobal += delegate(CharacterMaster obj) { Inventory inventory = obj.inventory; if (inventory != null) { ((Component)inventory).gameObject.AddComponent(); } }; RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)delegate(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender) && Object.op_Implicit((Object)(object)sender.inventory)) { int itemCountEffective = sender.inventory.GetItemCountEffective(def); int buffCount = sender.GetBuffCount(wrathBuff); if (buffCount > 0) { args.attackSpeedMultAdd += (float)buffCount * Utilities.GetHyperbolicStacking(percentAttackSpeedOnHit * radiantMultiplier, itemCountEffective); } } }; GameEventManager.OnTakeDamage += delegate(DamageReport damageReport) { //IL_00b0: Unknown result type (might be due to invalid IL or missing references) CharacterBody victimBody = damageReport.victimBody; CharacterBody attackerBody = damageReport.attackerBody; if (Object.op_Implicit((Object)(object)victimBody) && Object.op_Implicit((Object)(object)attackerBody) && Object.op_Implicit((Object)(object)attackerBody.inventory) && attackerBody.inventory.GetItemCountEffective(def) > 0 && Object.op_Implicit((Object)(object)victimBody.healthComponent) && !Utilities.OnSameTeam(victimBody, attackerBody)) { Statistics component = ((Component)attackerBody.inventory).GetComponent(); if (Object.op_Implicit((Object)(object)component) && ((object)((Component)victimBody).gameObject).Equals((object?)component.LastTarget)) { attackerBody.AddBuff(wrathBuff); } else { attackerBody.SetBuffCount(wrathBuff.buffIndex, 1); component.LastTarget = ((Component)victimBody).gameObject; } } }; } } public class HandOfJusticeItemBehavior : BaseItemBodyBehavior { [ItemDefAssociation(useOnServer = true, useOnClient = false)] public static ItemDef GetItemDef() { return HandOfJustice.itemDef; } public void FixedUpdate() { HandOfJustice.FixedUpdateHook(((BaseItemBodyBehavior)this).body, base.stack); } } public class RadiantHandOfJusticeItemBehavior : BaseItemBodyBehavior { [ItemDefAssociation(useOnServer = true, useOnClient = false)] public static ItemDef GetItemDef() { return HandOfJustice.radiantDef; } public void FixedUpdate() { HandOfJustice.FixedUpdateHook(((BaseItemBodyBehavior)this).body, base.stack); } } internal class HandOfJustice { public static ItemDef itemDef; public static BuffDef aboveHalfBuff; public static BuffDef belowHalfBuff; public static ItemDef radiantDef; public static ConfigurableValue isEnabled = new ConfigurableValue("Item: Hand Of Justice", "Enabled", defaultValue: true, "Whether or not the item is enabled.", new List(1) { "ITEM_ROT_HANDOFJUSTICE_DESC" }); public static ConfigurableValue critChanceBonus = new ConfigurableValue("Item: Hand Of Justice", "Crit Chance", 5f, "Crit chance gained when holding this item.", new List(1) { "ITEM_ROT_HANDOFJUSTICE_DESC" }); public static ConfigurableValue scaledBonusDamageEffect = new ConfigurableValue("Item: Hand Of Justice", "Bonus Damage Percent", 10f, "Percent BASE damage scaling effect gained for this item.", new List(1) { "ITEM_ROT_HANDOFJUSTICE_DESC" }, isRadiantStat: true); public static ConfigurableValue scaledBonusDamageEffectExtraStacks = new ConfigurableValue("Item: Hand Of Justice", "Bonus Damage Percent Per Stack", 10f, "Percent BASE damage scaling effect gained for extra stacks of this item.", new List(1) { "ITEM_ROT_HANDOFJUSTICE_DESC" }, isRadiantStat: true); public static ConfigurableValue omnivampEffect = new ConfigurableValue("Item: Hand Of Justice", "Omnivamp", 10f, "Percent omnivamp scaling effect gained for this item.", new List(1) { "ITEM_ROT_HANDOFJUSTICE_DESC" }, isRadiantStat: true); public static ConfigurableValue omnivampEffectExtraStacks = new ConfigurableValue("Item: Hand Of Justice", "Omnivamp Per Stack", 10f, "Percent omnivamp scaling effect gained for extra stacks of this item.", new List(1) { "ITEM_ROT_HANDOFJUSTICE_DESC" }, isRadiantStat: true); private static readonly float percentScaledBonusDamageEffect = scaledBonusDamageEffect.Value / 100f; private static readonly float percentScaledBonusDamageEffectExtraStacks = scaledBonusDamageEffectExtraStacks.Value / 100f; private static readonly float percentOmnivampEffect = omnivampEffect.Value / 100f; private static readonly float percentOmnivampEffectExtraStacks = omnivampEffectExtraStacks.Value / 100f; internal static void Init() { ItemTag[] array = new ItemTag[3]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); itemDef = ItemManager.GenerateItem("HandOfJustice", (ItemTag[])(object)array, ItemManager.TacticTier.Normal); ItemTag[] array2 = new ItemTag[3]; RuntimeHelpers.InitializeArray(array2, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); radiantDef = ItemManager.GenerateItem("Radiant_HandOfJustice", (ItemTag[])(object)array2, ItemManager.TacticTier.Radiant); aboveHalfBuff = Utilities.GenerateBuffDef("Above", AssetManager.bundle.LoadAsset("HoJ Damage.png"), canStack: false, isHidden: false, isDebuff: false, isCooldown: false); ContentAddition.AddBuffDef(aboveHalfBuff); belowHalfBuff = Utilities.GenerateBuffDef("Below", AssetManager.bundle.LoadAsset("HoJ Omnivamp.png"), canStack: false, isHidden: false, isDebuff: false, isCooldown: false); ContentAddition.AddBuffDef(belowHalfBuff); Utilities.RegisterRadiantUpgrade(itemDef, radiantDef); Hooks(itemDef, ItemManager.TacticTier.Normal); Hooks(radiantDef, ItemManager.TacticTier.Radiant); } public static void Hooks(ItemDef def, ItemManager.TacticTier tier) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown float radiantMultiplier = (tier.Equals(ItemManager.TacticTier.Radiant) ? ((float)ConfigManager.Scaling.radiantItemStatMultiplier) : 1f); RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)delegate(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender) && Object.op_Implicit((Object)(object)sender.inventory)) { int itemCountEffective2 = sender.inventory.GetItemCountEffective(def); if (itemCountEffective2 > 0) { args.critAdd += critChanceBonus.Value; int num3 = ((!sender.HasBuff(aboveHalfBuff)) ? 1 : 2); args.damageTotalMult *= 1f + Utilities.GetLinearStacking(percentScaledBonusDamageEffect * radiantMultiplier, percentScaledBonusDamageEffectExtraStacks * radiantMultiplier, itemCountEffective2) * (float)num3; } } }; GameEventManager.OnTakeDamage += delegate(DamageReport damageReport) { //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) CharacterBody victimBody = damageReport.victimBody; CharacterBody attackerBody = damageReport.attackerBody; if (Object.op_Implicit((Object)(object)victimBody) && Object.op_Implicit((Object)(object)attackerBody) && Object.op_Implicit((Object)(object)attackerBody.inventory)) { int itemCountEffective = attackerBody.inventory.GetItemCountEffective(def); if (itemCountEffective > 0 && !Utilities.OnSameTeam(victimBody, attackerBody) && Object.op_Implicit((Object)(object)attackerBody.healthComponent)) { int num = ((!attackerBody.HasBuff(belowHalfBuff)) ? 1 : 2); float num2 = damageReport.damageInfo.damage * Utilities.GetHyperbolicStacking(percentOmnivampEffect * radiantMultiplier, percentOmnivampEffectExtraStacks * radiantMultiplier, itemCountEffective) * (float)num; attackerBody.healthComponent.Heal(num2, default(ProcChainMask), true); Utilities.SpawnHealEffect(attackerBody); } } }; } internal static void FixedUpdateHook(CharacterBody self, int count) { if (!Object.op_Implicit((Object)(object)self) || !Object.op_Implicit((Object)(object)self.inventory) || !Object.op_Implicit((Object)(object)self.healthComponent)) { return; } if (count > 0) { if (self.healthComponent.combinedHealthFraction >= 0.5f) { if (!self.HasBuff(aboveHalfBuff)) { self.AddBuff(aboveHalfBuff); } if (self.HasBuff(belowHalfBuff)) { self.RemoveBuff(belowHalfBuff); } } else { if (!self.HasBuff(belowHalfBuff)) { self.AddBuff(belowHalfBuff); } if (self.HasBuff(aboveHalfBuff)) { self.RemoveBuff(aboveHalfBuff); } } } else { self.RemoveBuff(aboveHalfBuff); self.RemoveBuff(belowHalfBuff); } } } public class HextechGunblade { public class Statistics : MonoBehaviour { public class Sync : INetMessage, ISerializableObject { private NetworkInstanceId objId; private float damageHealed; public Sync() { } public Sync(NetworkInstanceId objId, float damage) { //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) this.objId = objId; damageHealed = damage; } public void Deserialize(NetworkReader reader) { //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) objId = reader.ReadNetworkId(); damageHealed = reader.ReadSingle(); } public void OnReceived() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) if (NetworkServer.active) { return; } GameObject val = Util.FindNetworkObject(objId); if ((Object)(object)val != (Object)null) { Statistics component = val.GetComponent(); if ((Object)(object)component != (Object)null) { component.DamageHealed = damageHealed; } } } public void Serialize(NetworkWriter writer) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) writer.Write(objId); writer.Write(damageHealed); writer.FinishMessage(); } } private float _damageHealed; public float DamageHealed { get { return _damageHealed; } set { //IL_001d: Unknown result type (might be due to invalid IL or missing references) _damageHealed = value; if (NetworkServer.active) { NetMessageExtensions.Send((INetMessage)(object)new Sync(((Component)this).gameObject.GetComponent().netId, value), (NetworkDestination)1); } } } } public class HextechOrb : Orb { private readonly float speed = 55f; private readonly CharacterBody victim; private readonly CharacterBody toBeHealed; private readonly CharacterBody toBeTracked; private readonly float healing; public HextechOrb(CharacterBody targetBody, CharacterBody originBody, CharacterBody statisticsBody, float healAmount) { //IL_0050: 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_0055: Unknown result type (might be due to invalid IL or missing references) healing = healAmount; toBeHealed = targetBody; toBeTracked = statisticsBody; if (Object.op_Implicit((Object)(object)originBody) && Object.op_Implicit((Object)(object)targetBody)) { base.origin = (Object.op_Implicit((Object)(object)originBody) ? originBody.corePosition : Vector3.zero); if (Object.op_Implicit((Object)(object)targetBody)) { base.target = targetBody.mainHurtBox; } } victim = originBody; } public override void Begin() { //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_001c: 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_0034: Expected O, but got Unknown ((Orb)this).duration = ((Orb)this).distanceToTarget / speed; EffectData val = new EffectData { origin = base.origin, genericFloat = ((Orb)this).duration }; val.SetHurtBoxReference(base.target); EffectManager.SpawnEffect(OrbStorageUtility.Get("Prefabs/Effects/OrbEffects/HealthOrbEffect"), val, true); } public override void OnArrival() { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)toBeHealed) || !Object.op_Implicit((Object)(object)toBeHealed.healthComponent)) { return; } toBeHealed.healthComponent.Heal(healing, default(ProcChainMask), true); if (Object.op_Implicit((Object)(object)toBeTracked) && Object.op_Implicit((Object)(object)toBeTracked.inventory)) { CharacterBody minionOwnershipParentBody = Utilities.GetMinionOwnershipParentBody(victim); Statistics component = ((Component)minionOwnershipParentBody.inventory).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.DamageHealed += healing; } } } } public static ItemDef itemDef; public static BuffDef afterKillHealing; public static ItemDef radiantDef; public static ConfigurableValue isEnabled = new ConfigurableValue("Item: Hextech Gunblade", "Enabled", defaultValue: true, "Whether or not the item is enabled.", new List(1) { "ITEM_ROT_HEXTECHGUNBLADE_DESC" }); public static ConfigurableValue healingOnDamage = new ConfigurableValue("Item: Hextech Gunblade", "Percent Healing", 5f, "Percent of all special damage dealt returned as healing.", new List(1) { "ITEM_ROT_HEXTECHGUNBLADE_DESC" }, isRadiantStat: true); public static ConfigurableValue healingOnDamageExtraStacks = new ConfigurableValue("Item: Hextech Gunblade", "Percent Healing Extra Stacks", 5f, "Percent of all special damage dealt returned as healing.", new List(1) { "ITEM_ROT_HEXTECHGUNBLADE_DESC" }, isRadiantStat: true); public static readonly float percentHealingOnDamage = healingOnDamage.Value / 100f; public static readonly float percentHealingOnDamageExtraStacks = healingOnDamageExtraStacks.Value / 100f; internal static void Init() { ItemTag[] array = new ItemTag[3]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); itemDef = ItemManager.GenerateItem("HextechGunblade", (ItemTag[])(object)array, ItemManager.TacticTier.Normal); ItemTag[] array2 = new ItemTag[3]; RuntimeHelpers.InitializeArray(array2, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); radiantDef = ItemManager.GenerateItem("Radiant_HextechGunblade", (ItemTag[])(object)array2, ItemManager.TacticTier.Radiant); NetworkingAPI.RegisterMessageType(); Utilities.RegisterRadiantUpgrade(itemDef, radiantDef); Hooks(itemDef, ItemManager.TacticTier.Normal); Hooks(radiantDef, ItemManager.TacticTier.Radiant); } public static void Hooks(ItemDef def, ItemManager.TacticTier tier) { float radiantMultiplier = (tier.Equals(ItemManager.TacticTier.Radiant) ? ((float)ConfigManager.Scaling.radiantItemStatMultiplier) : 1f); CharacterMaster.onStartGlobal += delegate(CharacterMaster obj) { Inventory inventory = obj.inventory; if (inventory != null) { ((Component)inventory).gameObject.AddComponent(); } }; GlobalEventManager.onCharacterDeathGlobal += delegate(DamageReport damageReport) { //IL_0065: Unknown result type (might be due to invalid IL or missing references) CharacterBody victimBody = damageReport.victimBody; CharacterBody attackerBody = damageReport.attackerBody; if (Object.op_Implicit((Object)(object)victimBody) && Object.op_Implicit((Object)(object)attackerBody) && Object.op_Implicit((Object)(object)attackerBody.teamComponent) && Object.op_Implicit((Object)(object)attackerBody.inventory)) { int itemCountEffective = attackerBody.inventory.GetItemCountEffective(def); if (itemCountEffective > 0) { CharacterBody lowestHealthAlly = Utilities.GetLowestHealthAlly(attackerBody.teamComponent.teamIndex); if (Object.op_Implicit((Object)(object)lowestHealthAlly) && Object.op_Implicit((Object)(object)lowestHealthAlly.healthComponent) && lowestHealthAlly.healthComponent.alive) { float healAmount = lowestHealthAlly.healthComponent.fullHealth * Utilities.GetLinearStacking(percentHealingOnDamage, percentHealingOnDamageExtraStacks, itemCountEffective) * radiantMultiplier; OrbManager.instance.AddOrb((Orb)(object)new HextechOrb(lowestHealthAlly, victimBody, attackerBody, healAmount)); } } } }; } } internal class Quicksilver { public static ItemDef itemDef; public static BuffDef hiddenCooldownBuff; public static ItemDef radiantDef; public static BuffDef radiantHiddenCooldownBuff; public static BuffDef flowBuff; public static BuffDef cleanseBuff; public static GameObject ccShieldPrefab; public static TemporaryVisualEffect ccShieldEffectInstance; public static ConfigurableValue isEnabled = new ConfigurableValue("Item: Quicksilver", "Enabled", defaultValue: true, "Whether or not the item is enabled.", new List(1) { "ITEM_ROT_QUICKSILVER_DESC" }); public static ConfigurableValue ccImmunityDuration = new ConfigurableValue("Item: Quicksilver", "CC Immunity Duration", 20f, "Number of seconds immune to crowd control once the teleporter event starts.", new List(1) { "ITEM_ROT_QUICKSILVER_DESC" }, isRadiantStat: true); public static ConfigurableValue ccImmunityDurationExtraStacks = new ConfigurableValue("Item: Quicksilver", "CC Immunity Duration Extra Stacks", 20f, "Number of seconds immune to crowd control once the teleporter event starts.", new List(1) { "ITEM_ROT_QUICKSILVER_DESC" }); public static ConfigurableValue attackSpeedPerBuff = new ConfigurableValue("Item: Quicksilver", "Attack Speed", 1f, "Attack speed gained per second while immune to CC.", new List(1) { "ITEM_ROT_QUICKSILVER_DESC" }, isRadiantStat: true); private static readonly float percentAttackSpeedPerBuff = attackSpeedPerBuff.Value / 100f; internal static void Init() { //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) ItemTag[] array = new ItemTag[3]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); itemDef = ItemManager.GenerateItem("Quicksilver", (ItemTag[])(object)array, ItemManager.TacticTier.Normal); hiddenCooldownBuff = Utilities.GenerateBuffDef("QuicksilverTicker", AssetManager.bundle.LoadAsset("Quicksilver.png"), canStack: false, isHidden: true, isDebuff: false, isCooldown: true); ContentAddition.AddBuffDef(hiddenCooldownBuff); ItemTag[] array2 = new ItemTag[3]; RuntimeHelpers.InitializeArray(array2, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); radiantDef = ItemManager.GenerateItem("Radiant_Quicksilver", (ItemTag[])(object)array2, ItemManager.TacticTier.Radiant); radiantHiddenCooldownBuff = Utilities.GenerateBuffDef("RadiantQuicksilverTicker", AssetManager.bundle.LoadAsset("RadiantQuicksilver.png"), canStack: false, isHidden: true, isDebuff: false, isCooldown: true); ContentAddition.AddBuffDef(radiantHiddenCooldownBuff); flowBuff = Utilities.GenerateBuffDef("Flow", AssetManager.bundle.LoadAsset("Flow.png"), canStack: true, isHidden: false, isDebuff: false, isCooldown: false); ContentAddition.AddBuffDef(flowBuff); cleanseBuff = Utilities.GenerateBuffDef("Cleanse", AssetManager.bundle.LoadAsset("Cleanse.png"), canStack: false, isHidden: false, isDebuff: false, isCooldown: true); ContentAddition.AddBuffDef(cleanseBuff); ccShieldPrefab = Addressables.LoadAssetAsync((object)"RoR2/DLC1/OutOfCombatArmor/OutOfCombatArmorEffect.prefab").WaitForCompletion(); Utilities.RegisterRadiantUpgrade(itemDef, radiantDef); Hooks(itemDef, hiddenCooldownBuff, ItemManager.TacticTier.Normal); Hooks(radiantDef, radiantHiddenCooldownBuff, ItemManager.TacticTier.Radiant); } public static void Hooks(ItemDef def, BuffDef hiddenBuffDef, ItemManager.TacticTier tier) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Expected O, but got Unknown //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Expected O, but got Unknown //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Expected O, but got Unknown float radiantMultiplier = (tier.Equals(ItemManager.TacticTier.Radiant) ? ((float)ConfigManager.Scaling.radiantItemStatMultiplier) : 1f); RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)delegate(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender)) { int buffCount = sender.GetBuffCount(flowBuff); args.attackSpeedMultAdd += (float)buffCount * percentAttackSpeedPerBuff * radiantMultiplier; } }; HoldoutZoneController.Start += (hook_Start)delegate(orig_Start orig, HoldoutZoneController self) { orig.Invoke(self); foreach (NetworkUser readOnlyInstances in NetworkUser.readOnlyInstancesList) { CharacterMaster val = readOnlyInstances.masterController.master ?? readOnlyInstances.master; if (Object.op_Implicit((Object)(object)val)) { CharacterBody body = val.GetBody(); if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.inventory) && body.inventory.GetItemCountEffective(def) > 0) { body.AddTimedBuff(cleanseBuff, Utilities.GetLinearStacking(ccImmunityDuration.Value, ccImmunityDurationExtraStacks.Value, body.inventory.GetItemCountEffective(def))); Utilities.UpdateSingleTemporaryVisualEffect(ref ccShieldEffectInstance, ccShieldPrefab, body, active: true); body.AddTimedBuff(hiddenBuffDef, 1f); } } } }; CharacterBody.OnBuffFinalStackLost += (hook_OnBuffFinalStackLost)delegate(orig_OnBuffFinalStackLost orig, CharacterBody self, BuffDef buffDef) { orig.Invoke(self, buffDef); if ((Object)(object)buffDef == (Object)(object)cleanseBuff) { Utilities.UpdateSingleTemporaryVisualEffect(ref ccShieldEffectInstance, ccShieldPrefab, self, active: false); } if ((Object)(object)buffDef == (Object)(object)hiddenBuffDef && self.HasBuff(cleanseBuff)) { self.AddBuff(flowBuff); self.AddTimedBuff(hiddenBuffDef, 1f); } }; GameEventManager.BeforeTakeDamage += delegate(DamageInfo damageInfo, GameEventManager.GenericCharacterInfo attackerInfo, GameEventManager.GenericCharacterInfo victimInfo) { //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) if (Object.op_Implicit((Object)(object)victimInfo.body) && victimInfo.body.HasBuff(cleanseBuff)) { damageInfo.force = Vector3.zero; } }; } } internal class SpearOfShojin { public static ItemDef itemDef; public static ItemDef radiantDef; public static ConfigurableValue isEnabled = new ConfigurableValue("Item: Spear Of Shojin", "Enabled", defaultValue: true, "Whether or not the item is enabled.", new List(1) { "ITEM_ROT_SPEAROFSHOJIN_DESC" }); public static ConfigurableValue chanceToProc = new ConfigurableValue("Item: Spear Of Shojin", "On-Hit Chance", 10f, "Percentage chance to trigger the cooldown refund.", new List(1) { "ITEM_ROT_SPEAROFSHOJIN_DESC" }); public static ConfigurableValue cooldownOnHit = new ConfigurableValue("Item: Spear Of Shojin", "On-Hit Cooldown", 8f, "Percentage of remaining cooldown refunded on-hit.", new List(1) { "ITEM_ROT_SPEAROFSHOJIN_DESC" }, isRadiantStat: true); public static ConfigurableValue cooldownOnHitExtraStacks = new ConfigurableValue("Item: Spear Of Shojin", "On-Hit Cooldown Extra Stacks", 5f, "Percentage of remaining cooldown refunded on-hit with extra stacks.", new List(1) { "ITEM_ROT_SPEAROFSHOJIN_DESC" }, isRadiantStat: true); public static readonly float percentCooldownOnHit = cooldownOnHit.Value / 100f; public static readonly float percentCooldownOnHitExtraStacks = cooldownOnHitExtraStacks.Value / 100f; internal static void Init() { ItemTag[] array = new ItemTag[3]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); itemDef = ItemManager.GenerateItem("SpearOfShojin", (ItemTag[])(object)array, ItemManager.TacticTier.Normal); ItemTag[] array2 = new ItemTag[3]; RuntimeHelpers.InitializeArray(array2, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); radiantDef = ItemManager.GenerateItem("Radiant_SpearOfShojin", (ItemTag[])(object)array2, ItemManager.TacticTier.Radiant); Utilities.RegisterRadiantUpgrade(itemDef, radiantDef); Hooks(itemDef, ItemManager.TacticTier.Normal); Hooks(radiantDef, ItemManager.TacticTier.Radiant); } public static void Hooks(ItemDef def, ItemManager.TacticTier tier) { float radiantMultiplier = (tier.Equals(ItemManager.TacticTier.Radiant) ? ((float)ConfigManager.Scaling.radiantItemStatMultiplier) : 1f); GameEventManager.OnHitEnemy += delegate(DamageInfo damageInfo, GameEventManager.GenericCharacterInfo attackerInfo, GameEventManager.GenericCharacterInfo victimInfo) { //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_00c0: Unknown result type (might be due to invalid IL or missing references) CharacterBody body = victimInfo.body; CharacterBody body2 = attackerInfo.body; if (Object.op_Implicit((Object)(object)body2) && Object.op_Implicit((Object)(object)body2.inventory) && Utilities.IsValidTargetBody(body)) { int itemCountEffective = body2.inventory.GetItemCountEffective(def); if (itemCountEffective > 0 && Object.op_Implicit((Object)(object)body2.master) && Util.CheckRoll(chanceToProc.Value, body2.master) && Object.op_Implicit((Object)(object)body2.skillLocator)) { foreach (SkillSlot value in Enum.GetValues(typeof(SkillSlot))) { GenericSkill skill = body2.skillLocator.GetSkill(value); if (Object.op_Implicit((Object)(object)skill) && skill.stock < skill.maxStock) { float num = skill.finalRechargeInterval - skill.rechargeStopwatch; skill.rechargeStopwatch += num * Utilities.GetHyperbolicStacking(percentCooldownOnHit * radiantMultiplier, percentCooldownOnHitExtraStacks * radiantMultiplier, itemCountEffective); } } } } }; } } internal class StrikersFlail { public static ItemDef itemDef; public static BuffDef damageAmpBuff; public static ItemDef radiantDef; public static ConfigurableValue isEnabled = new ConfigurableValue("Item: Strikers Flail", "Enabled", defaultValue: true, "Whether or not the item is enabled.", new List(1) { "ITEM_ROT_HANDOFJUSTICE_DESC" }); public static ConfigurableValue critChanceBonus = new ConfigurableValue("Item: Strikers Flail", "Crit Chance", 5f, "Crit chance gained when holding this item.", new List(1) { "ITEM_ROT_STRIKERSFLAIL_DESC" }); public static ConfigurableValue damageAmp = new ConfigurableValue("Item: Strikers Flail", "Damage Amp", 5f, "Percent damage amp gained from the damage amp buff for the first item stack.", new List(1) { "ITEM_ROT_STRIKERSFLAIL_DESC" }, isRadiantStat: true); public static ConfigurableValue damageAmpExtraStacks = new ConfigurableValue("Item: Strikers Flail", "Damage Amp Extra Stacks", 5f, "Percent damage amp gained from the damage amp buff for additional item stacks.", new List(1) { "ITEM_ROT_STRIKERSFLAIL_DESC" }, isRadiantStat: true); public static ConfigurableValue damageAmpDuration = new ConfigurableValue("Item: Strikers Flail", "Damage Amp Duration", 5f, "Duration of the damage amp buff.", new List(1) { "ITEM_ROT_STRIKERSFLAIL_DESC" }, isRadiantStat: true); public static ConfigurableValue maxBuffStacks = new ConfigurableValue("Item: Strikers Flail", "Max Stacks", 5, "Max stacks of the damage amp buff.", new List(1) { "ITEM_ROT_STRIKERSFLAIL_DESC" }); private static readonly float percentdamageAmp = damageAmp.Value / 100f; private static readonly float percentDamageAmpExtraStacks = damageAmpExtraStacks.Value / 100f; internal static void Init() { itemDef = ItemManager.GenerateItem("StrikersFlail", (ItemTag[])(object)new ItemTag[2] { (ItemTag)1, (ItemTag)31 }, ItemManager.TacticTier.Normal); radiantDef = ItemManager.GenerateItem("Radiant_StrikersFlail", (ItemTag[])(object)new ItemTag[2] { (ItemTag)1, (ItemTag)31 }, ItemManager.TacticTier.Radiant); damageAmpBuff = Utilities.GenerateBuffDef("Damage Amp", AssetManager.bundle.LoadAsset("DamageAmp.png"), canStack: true, isHidden: false, isDebuff: false, isCooldown: false); ContentAddition.AddBuffDef(damageAmpBuff); Utilities.RegisterRadiantUpgrade(itemDef, radiantDef); Hooks(itemDef, ItemManager.TacticTier.Normal); Hooks(radiantDef, ItemManager.TacticTier.Radiant); } public static void Hooks(ItemDef def, ItemManager.TacticTier tier) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown float radiantMultiplier = (tier.Equals(ItemManager.TacticTier.Radiant) ? ((float)ConfigManager.Scaling.radiantItemStatMultiplier) : 1f); RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)delegate(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender) && Object.op_Implicit((Object)(object)sender.inventory)) { int itemCountEffective3 = sender.inventory.GetItemCountEffective(def); if (itemCountEffective3 > 0) { args.critAdd += critChanceBonus.Value; } } }; GameEventManager.BeforeTakeDamage += delegate(DamageInfo damageInfo, GameEventManager.GenericCharacterInfo attackerInfo, GameEventManager.GenericCharacterInfo victimInfo) { //IL_00a5: 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) CharacterBody body3 = victimInfo.body; CharacterBody body4 = attackerInfo.body; if (Object.op_Implicit((Object)(object)body3) && Object.op_Implicit((Object)(object)body4) && Object.op_Implicit((Object)(object)body4.inventory)) { int itemCountEffective2 = body4.inventory.GetItemCountEffective(def); int buffCount = body4.GetBuffCount(damageAmpBuff); if (itemCountEffective2 > 0 && buffCount > 0 && !Utilities.OnSameTeam(body3, body4)) { damageInfo.damage *= 1f + Utilities.GetLinearStacking(percentdamageAmp * radiantMultiplier, percentDamageAmpExtraStacks * radiantMultiplier, buffCount); damageInfo.damageColorIndex = (DamageColorIndex)5; if (buffCount == maxBuffStacks.Value) { damageInfo.damageColorIndex = (DamageColorIndex)13; } } } }; GameEventManager.OnHitEnemy += delegate(DamageInfo damageInfo, GameEventManager.GenericCharacterInfo attackerInfo, GameEventManager.GenericCharacterInfo victimInfo) { CharacterBody body = victimInfo.body; CharacterBody body2 = attackerInfo.body; if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body2) && Object.op_Implicit((Object)(object)body2.inventory)) { int itemCountEffective = body2.inventory.GetItemCountEffective(def); if (itemCountEffective > 0 && !Utilities.OnSameTeam(body, body2) && damageInfo.crit && body2.GetBuffCount(damageAmpBuff) < maxBuffStacks.Value) { body2.AddTimedBuff(damageAmpBuff, damageAmpDuration.Value * radiantMultiplier); } } }; } } public class SunfireCapeItemBehavior : BaseItemBodyBehavior { [ItemDefAssociation(useOnServer = true, useOnClient = false)] public static ItemDef GetItemDef() { return SunfireCape.itemDef; } public void FixedUpdate() { SunfireCape.FixedUpdateHook(((BaseItemBodyBehavior)this).body, base.stack, SunfireCape.sunfireCooldownBuff); } } public class RadiantSunfireCapeItemBehavior : BaseItemBodyBehavior { [ItemDefAssociation(useOnServer = true, useOnClient = false)] public static ItemDef GetItemDef() { return SunfireCape.radiantDef; } public void FixedUpdate() { SunfireCape.FixedUpdateHook(((BaseItemBodyBehavior)this).body, base.stack, SunfireCape.radiantSunfireCooldownBuff); } } internal class SunfireCape { public static GameObject sunfireEffectIndicator; public static ItemDef itemDef; public static BuffDef sunfireCooldownBuff; public static ItemDef radiantDef; public static BuffDef radiantSunfireCooldownBuff; public static ConfigurableValue isEnabled = new ConfigurableValue("Item: Sunfire Cape", "Enabled", defaultValue: true, "Whether or not the item is enabled.", new List(1) { "ITEM_ROT_SUNFIRECAPE_DESC" }); public static ConfigurableValue healthBonus = new ConfigurableValue("Item: Sunfire Cape", "Percent Health", 7f, "Percent health gained when holding this item.", new List(1) { "ITEM_ROT_SUNFIRECAPE_DESC" }, isRadiantStat: true); public static ConfigurableValue healthBonusExtraStacks = new ConfigurableValue("Item: Sunfire Cape", "Percent Health Extra Stacks", 7f, "Percent health gained when holding extra stacks of this item.", new List(1) { "ITEM_ROT_SUNFIRECAPE_DESC" }, isRadiantStat: true); public static ConfigurableValue debuffTickDuration = new ConfigurableValue("Item: Sunfire Cape", "Debuff Tick", 7f, "Seconds between Burn and Wound reapplication.", new List(1) { "ITEM_ROT_SUNFIRECAPE_DESC" }); public static ConfigurableValue maxHealthBurn = new ConfigurableValue("Item: Sunfire Cape", "Burn Percent", 15f, "Total burn damage as a percentage of max HP.", new List(1) { "ITEM_ROT_SUNFIRECAPE_DESC" }); public static ConfigurableValue debuffRadius = new ConfigurableValue("Item: Sunfire Cape", "Debuff Radius", 15, "Range of the debuff application (meters).", new List(1) { "ITEM_ROT_SUNFIRECAPE_DESC" }, isRadiantStat: true); public static ConfigurableValue healingDisableDuration = new ConfigurableValue("Item: Sunfire Cape", "Healing Disable Duration", 7f, "Healing disable duration once applied by this item.", new List(1) { "ITEM_ROT_SUNFIRECAPE_DESC" }); private static readonly float percentHealthBonus = healthBonus.Value / 100f; private static readonly float percentHealthBonusExtraStacks = healthBonusExtraStacks.Value / 100f; private static readonly float percentMaxHealthBurn = maxHealthBurn.Value / 100f; internal static void Init() { //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) ItemTag[] array = new ItemTag[3]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); itemDef = ItemManager.GenerateItem("SunfireCape", (ItemTag[])(object)array, ItemManager.TacticTier.Normal); sunfireCooldownBuff = Utilities.GenerateBuffDef("SunfireCapeCooldown", AssetManager.bundle.LoadAsset("SunfireCape"), canStack: false, isHidden: false, isDebuff: false, isCooldown: false); ContentAddition.AddBuffDef(sunfireCooldownBuff); ItemTag[] array2 = new ItemTag[3]; RuntimeHelpers.InitializeArray(array2, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); radiantDef = ItemManager.GenerateItem("Radiant_SunfireCape", (ItemTag[])(object)array2, ItemManager.TacticTier.Radiant); radiantSunfireCooldownBuff = Utilities.GenerateBuffDef("RadiantSunfireCapeCooldown", AssetManager.bundle.LoadAsset("Radiant_SunfireCape"), canStack: false, isHidden: false, isDebuff: false, isCooldown: false); ContentAddition.AddBuffDef(radiantSunfireCooldownBuff); sunfireEffectIndicator = LegacyResourcesAPI.LoadAsync("Prefabs/NetworkedObjects/ExplodeOnDeathVoidExplosion").WaitForCompletion(); Utilities.RegisterRadiantUpgrade(itemDef, radiantDef); Hooks(itemDef, sunfireCooldownBuff, ItemManager.TacticTier.Normal); Hooks(radiantDef, radiantSunfireCooldownBuff, ItemManager.TacticTier.Radiant); } public static void Hooks(ItemDef def, BuffDef cooldownBuff, ItemManager.TacticTier tier) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Expected O, but got Unknown float num = (tier.Equals(ItemManager.TacticTier.Radiant) ? ((float)ConfigManager.Scaling.radiantItemStatMultiplier) : 1f); RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)delegate(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender) && Object.op_Implicit((Object)(object)sender.inventory)) { int itemCountEffective2 = sender.inventory.GetItemCountEffective(def); if (itemCountEffective2 > 0) { args.healthMultAdd += Utilities.GetLinearStacking(percentHealthBonus, percentHealthBonusExtraStacks, itemCountEffective2); } } }; CharacterBody.OnBuffFinalStackLost += (hook_OnBuffFinalStackLost)delegate(orig_OnBuffFinalStackLost orig, CharacterBody self, BuffDef buffDef) { orig.Invoke(self, buffDef); if ((Object)(object)buffDef == (Object)(object)cooldownBuff && Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.inventory)) { int itemCountEffective = self.inventory.GetItemCountEffective(def); ApplySunfireEffect(self, itemCountEffective, cooldownBuff); if (itemCountEffective > 0) { self.AddTimedBuff(cooldownBuff, debuffTickDuration.Value); } } }; } internal static void ApplySunfireEffect(CharacterBody self, int count, BuffDef cooldownBuff) { //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_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_0022: 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_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: 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_00f1: 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_012a: 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) if (count <= 0) { return; } HurtBox[] hurtBoxes = new SphereSearch { mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask, origin = self.corePosition, queryTriggerInteraction = (QueryTriggerInteraction)2, radius = debuffRadius.Value }.RefreshCandidates().FilterCandidatesByDistinctHurtBoxEntities().GetHurtBoxes(); HurtBox[] array = hurtBoxes; foreach (HurtBox val in array) { HealthComponent healthComponent = val.healthComponent; if (Object.op_Implicit((Object)(object)healthComponent) && Object.op_Implicit((Object)(object)healthComponent.body) && !Utilities.OnSameTeam(healthComponent.body, self)) { InflictDotInfo val2 = default(InflictDotInfo); val2.attackerObject = ((Component)self).gameObject; val2.maxStacksFromAttacker = 1u; val2.totalDamage = healthComponent.fullCombinedHealth * percentMaxHealthBurn; val2.victimObject = ((Component)healthComponent.body).gameObject; InflictDotInfo val3 = val2; if (self.inventory.GetItemCountEffective(Items.StrengthenBurn) > 0) { val3.dotIndex = (DotIndex)7; val3.damageMultiplier = 3f; } else { val3.dotIndex = (DotIndex)1; val3.damageMultiplier = 1f; } DotController.InflictDot(ref val3); healthComponent.body.AddTimedBuff(Buffs.HealingDisabled, healingDisableDuration.Value); } } DisplaySunfireEffectIndicator(self); } private static void DisplaySunfireEffectIndicator(CharacterBody 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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: 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_00b9: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)self.teamComponent)) { GameObject val = Object.Instantiate(sunfireEffectIndicator, self.corePosition, Quaternion.identity); DelayBlast component = val.GetComponent(); component.position = self.corePosition; component.baseDamage = 0f; component.baseForce = 0f; component.radius = debuffRadius.Value; component.attacker = ((Component)self).gameObject; component.inflictor = ((Component)self).gameObject; component.crit = Util.CheckRoll(self.crit, self.master); component.maxTimer = 0.2f; component.damageColorIndex = (DamageColorIndex)16; component.falloffModel = (FalloffModel)2; val.GetComponent().teamIndex = self.teamComponent.teamIndex; NetworkServer.Spawn(val); } } internal static void FixedUpdateHook(CharacterBody body, int stack, BuffDef buff) { if (Object.op_Implicit((Object)(object)body) && body.GetBuffCount(buff) == 0 && stack > 0) { body.AddTimedBuff(buff, debuffTickDuration.Value); } } } internal class TitansResolve { public static ItemDef itemDef; public static BuffDef resolveBuff; public static ItemDef radiantDef; public static BuffDef radiantResolveBuff; public static ConfigurableValue isEnabled = new ConfigurableValue("Item: Titans Resolve", "Enabled", defaultValue: true, "Whether or not the item is enabled.", new List(1) { "ITEM_ROT_TITANSRESOLVE_DESC" }); public static ConfigurableValue damagePerStack = new ConfigurableValue("Item: Titans Resolve", "Damage Per Stack", 1f, "Total base damage bonus per stack of Resolve.", new List(1) { "ITEM_ROT_TITANSRESOLVE_DESC" }, isRadiantStat: true); public static ConfigurableValue damagePerStackExtraStacks = new ConfigurableValue("Item: Titans Resolve", "Damage Per Stack Extra Stacks", 1f, "Total base damage bonus per stack of Resolve with extra stacks.", new List(1) { "ITEM_ROT_TITANSRESOLVE_DESC" }, isRadiantStat: true); public static ConfigurableValue maxStacks = new ConfigurableValue("Item: Titans Resolve", "Max Stacks", 25, "Max stacks allowed of Resolve.", new List(1) { "ITEM_ROT_TITANSRESOLVE_DESC" }); public static ConfigurableValue duration = new ConfigurableValue("Item: Titans Resolve", "Stack Duration", 10f, "Duration of each stack of Resolve.", new List(1) { "ITEM_ROT_TITANSRESOLVE_DESC" }, isRadiantStat: true); public static readonly float percentDamagePerStack = damagePerStack.Value / 100f; public static readonly float percentDamagePerStackExtraStacks = damagePerStackExtraStacks.Value / 100f; internal static void Init() { itemDef = ItemManager.GenerateItem("TitansResolve", (ItemTag[])(object)new ItemTag[2] { (ItemTag)1, (ItemTag)31 }, ItemManager.TacticTier.Normal); resolveBuff = Utilities.GenerateBuffDef("TitansResolveBuff", AssetManager.bundle.LoadAsset("TitansResolve"), canStack: true, isHidden: false, isDebuff: false, isCooldown: false); ContentAddition.AddBuffDef(resolveBuff); radiantDef = ItemManager.GenerateItem("Radiant_TitansResolve", (ItemTag[])(object)new ItemTag[2] { (ItemTag)1, (ItemTag)31 }, ItemManager.TacticTier.Radiant); radiantResolveBuff = Utilities.GenerateBuffDef("RadiantTitansResolveBuff", AssetManager.bundle.LoadAsset("Radiant_TitansResolve"), canStack: true, isHidden: false, isDebuff: false, isCooldown: false); ContentAddition.AddBuffDef(radiantResolveBuff); Utilities.RegisterRadiantUpgrade(itemDef, radiantDef); Hooks(itemDef, resolveBuff, ItemManager.TacticTier.Normal); Hooks(radiantDef, radiantResolveBuff, ItemManager.TacticTier.Radiant); } public static void Hooks(ItemDef def, BuffDef bDef, ItemManager.TacticTier tier) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Expected O, but got Unknown float radiantMultiplier = (tier.Equals(ItemManager.TacticTier.Radiant) ? ((float)ConfigManager.Scaling.radiantItemStatMultiplier) : 1f); RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)delegate(CharacterBody self, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.inventory)) { int itemCountEffective = self.inventory.GetItemCountEffective(def); if (itemCountEffective > 0) { int buffCount = self.GetBuffCount(bDef); args.damageTotalMult *= 1f + Utilities.GetLinearStacking(percentDamagePerStack, percentDamagePerStackExtraStacks, itemCountEffective) * radiantMultiplier * (float)buffCount; } } }; GameEventManager.OnTakeDamage += delegate(DamageReport damageReport) { CharacterBody victimBody = damageReport.victimBody; CharacterBody attackerBody = damageReport.attackerBody; CharacterBody[] array = (CharacterBody[])(object)new CharacterBody[2] { victimBody, attackerBody }; foreach (CharacterBody val in array) { if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.inventory) && val.inventory.GetItemCountEffective(def) > 0 && val.GetBuffCount(bDef) < maxStacks.Value) { val.AddTimedBuff(bDef, duration.Value * radiantMultiplier); } } }; } } internal class WarmogsArmor { public static ItemDef itemDef; public static ItemDef radiantDef; public static ConfigurableValue isEnabled = new ConfigurableValue("Item: Warmogs Armor", "Enabled", defaultValue: true, "Whether or not the item is enabled.", new List(1) { "ITEM_ROT_WARMOGSARMOR_DESC" }); public static ConfigurableValue percentHealth = new ConfigurableValue("Item: Warmogs Armor", "Percent Health", 18f, "Percent max health bonus when holding this item.", new List(1) { "ITEM_ROT_WARMOGSARMOR_DESC" }, isRadiantStat: true); public static ConfigurableValue flatHealth = new ConfigurableValue("Item: Warmogs Armor", "Flat Health", 25f, "Flat max health bonus when holding this item.", new List(1) { "ITEM_ROT_WARMOGSARMOR_DESC" }, isRadiantStat: true); public static ConfigurableValue flatHealthExtraStacks = new ConfigurableValue("Item: Warmogs Armor", "Flat Health Extra Stacks", 50f, "Flat max health bonus per extra stack of this item.", new List(1) { "ITEM_ROT_WARMOGSARMOR_DESC" }, isRadiantStat: true); public static readonly float percentHealthBonus = percentHealth.Value / 100f; internal static void Init() { itemDef = ItemManager.GenerateItem("WarmogsArmor", (ItemTag[])(object)new ItemTag[2] { (ItemTag)2, (ItemTag)31 }, ItemManager.TacticTier.Normal); radiantDef = ItemManager.GenerateItem("Radiant_WarmogsArmor", (ItemTag[])(object)new ItemTag[2] { (ItemTag)2, (ItemTag)31 }, ItemManager.TacticTier.Radiant); Utilities.RegisterRadiantUpgrade(itemDef, radiantDef); Hooks(itemDef, ItemManager.TacticTier.Normal); Hooks(radiantDef, ItemManager.TacticTier.Radiant); } public static void Hooks(ItemDef def, ItemManager.TacticTier tier) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown float radiantMultiplier = (tier.Equals(ItemManager.TacticTier.Radiant) ? ((float)ConfigManager.Scaling.radiantItemStatMultiplier) : 1f); RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)delegate(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender) && Object.op_Implicit((Object)(object)sender.inventory)) { int itemCountEffective = sender.inventory.GetItemCountEffective(def); if (itemCountEffective > 0) { args.baseHealthAdd += Utilities.GetLinearStacking(flatHealth.Value * radiantMultiplier, flatHealthExtraStacks.Value * radiantMultiplier, itemCountEffective); args.healthTotalMult *= 1f + percentHealthBonus * radiantMultiplier; } } }; } } } namespace RiskOfTactics.Content.Items.Artifacts { internal class GamblersBlade { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static StatHookEventHandler <>9__9_0; public static GameEventManager.DamageAttackerVictimEventHandler <>9__9_1; internal void b__9_0(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender) && Object.op_Implicit((Object)(object)sender.inventory)) { int itemCountEffective = sender.inventory.GetItemCountEffective(itemDef); if (itemCountEffective > 0 && Object.op_Implicit((Object)(object)sender.master) && sender.master.money != 0) { float num = (float)moneyEffectCap.Value * Utilities.GetDifficultyAsMultiplier(); float num2 = Mathf.Min(1f, (float)sender.master.money / num); float num3 = num2 * Utilities.GetLinearStacking(attackSpeedEffectCap.Value, attackSpeedEffectCapExtraStacks.Value, itemCountEffective) / 100f; args.attackSpeedMultAdd += num3; } } } internal void b__9_1(DamageInfo damageInfo, GameEventManager.GenericCharacterInfo attackerInfo, GameEventManager.GenericCharacterInfo victimInfo) { CharacterBody body = attackerInfo.body; CharacterBody body2 = victimInfo.body; if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.master) && Object.op_Implicit((Object)(object)body.inventory) && body.inventory.GetItemCountEffective(itemDef) > 0 && Util.CheckRoll0To1(percentMoneyDropChance, body.master.luck, (CharacterMaster)null)) { Utilities.SpawnGoldPack(body, body2, (float)moneyGainOnDrop.Value * Utilities.GetDifficultyAsMultiplier()); } } } public static ItemDef itemDef; public static ConfigurableValue isEnabled = new ConfigurableValue("Item: Gamblers Blade", "Enabled", defaultValue: true, "Whether or not the item is enabled.", new List(1) { "ITEM_ROT_GAMBLERSBLADE_DESC" }); public static ConfigurableValue attackSpeedEffectCap = new ConfigurableValue("Item: Gamblers Blade", "Attack Speed Effect Cap", 75f, "Amount of attack speed granted at money cap.", new List(1) { "ITEM_ROT_GAMBLERSBLADE_DESC" }); public static ConfigurableValue attackSpeedEffectCapExtraStacks = new ConfigurableValue("Item: Gamblers Blade", "Attack Speed Effect Cap Extra Stacks", 75f, "Amount of attack speed granted at money cap for extra stacks.", new List(1) { "ITEM_ROT_GAMBLERSBLADE_DESC" }); public static ConfigurableValue moneyEffectCap = new ConfigurableValue("Item: Gamblers Blade", "Money Cap", 150, "Amount of money required to gain the attack speed cap. Scales with difficulty.", new List(1) { "ITEM_ROT_GAMBLERSBLADE_DESC" }); public static ConfigurableValue moneyDropChance = new ConfigurableValue("Item: Gamblers Blade", "Drop Chance", 5f, "Percent chance on-hit to gain money.", new List(1) { "ITEM_ROT_GAMBLERSBLADE_DESC" }); public static ConfigurableValue moneyGainOnDrop = new ConfigurableValue("Item: Gamblers Blade", "Money Gain", 30, "Money gained on drop.", new List(1) { "ITEM_ROT_GAMBLERSBLADE_DESC" }); public static readonly float percentMoneyDropChance = moneyDropChance.Value / 100f; internal static void Init() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown ItemTag[] array = new ItemTag[3]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); itemDef = ItemManager.GenerateItem("GamblersBlade", (ItemTag[])(object)array, ItemManager.TacticTier.Artifact); ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null); ItemAPI.Add(new CustomItem(itemDef, val)); Hooks(); } public static void Hooks() { //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_0020: Expected O, but got Unknown object obj = <>c.<>9__9_0; if (obj == null) { StatHookEventHandler val = delegate(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender) && Object.op_Implicit((Object)(object)sender.inventory)) { int itemCountEffective = sender.inventory.GetItemCountEffective(itemDef); if (itemCountEffective > 0 && Object.op_Implicit((Object)(object)sender.master) && sender.master.money != 0) { float num = (float)moneyEffectCap.Value * Utilities.GetDifficultyAsMultiplier(); float num2 = Mathf.Min(1f, (float)sender.master.money / num); float num3 = num2 * Utilities.GetLinearStacking(attackSpeedEffectCap.Value, attackSpeedEffectCapExtraStacks.Value, itemCountEffective) / 100f; args.attackSpeedMultAdd += num3; } } }; <>c.<>9__9_0 = val; obj = (object)val; } RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)obj; GameEventManager.OnHitEnemy += delegate(DamageInfo damageInfo, GameEventManager.GenericCharacterInfo attackerInfo, GameEventManager.GenericCharacterInfo victimInfo) { CharacterBody body = attackerInfo.body; CharacterBody body2 = victimInfo.body; if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.master) && Object.op_Implicit((Object)(object)body.inventory) && body.inventory.GetItemCountEffective(itemDef) > 0 && Util.CheckRoll0To1(percentMoneyDropChance, body.master.luck, (CharacterMaster)null)) { Utilities.SpawnGoldPack(body, body2, (float)moneyGainOnDrop.Value * Utilities.GetDifficultyAsMultiplier()); } }; } } public class HellfireHatchetItemBehavior : BaseItemBodyBehavior { [ItemDefAssociation(useOnServer = true, useOnClient = false)] public static ItemDef GetItemDef() { return HellfireHatchet.itemDef; } public void FixedUpdate() { if (Object.op_Implicit((Object)(object)((BaseItemBodyBehavior)this).body) & (base.stack > 0)) { Utilities.ForceRecalculate(((BaseItemBodyBehavior)this).body); } } } internal class HellfireHatchet { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static StatHookEventHandler <>9__12_0; public static GameEventManager.DamageAttackerVictimEventHandler <>9__12_1; internal void b__12_0(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender) && Object.op_Implicit((Object)(object)sender.inventory)) { int itemCountEffective = sender.inventory.GetItemCountEffective(itemDef); if (itemCountEffective > 0 && sender.healthComponent.healthFraction < 1f) { args.attackSpeedMultAdd += Utilities.GetLinearStacking(percentAttackSpeedPerPercent, percentAttackSpeedPerPercentExtraStacks, itemCountEffective) * Utilities.GetMissingHealthPercent(sender.healthComponent, includeShield: true); } } } internal void b__12_1(DamageInfo damageInfo, GameEventManager.GenericCharacterInfo attackerInfo, GameEventManager.GenericCharacterInfo victimInfo) { //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_007b: 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_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: 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_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown CharacterBody body = victimInfo.body; CharacterBody body2 = attackerInfo.body; if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body2) && Object.op_Implicit((Object)(object)body2.inventory) && Utilities.IsValidTargetBody(body)) { int itemCountEffective = body2.inventory.GetItemCountEffective(itemDef); if (itemCountEffective > 0 && !Utilities.OnSameTeam(body, body2)) { DamageInfo val = new DamageInfo { damage = CalculateDamageOnHit(body2, itemCountEffective), attacker = attackerInfo.gameObject, inflictor = attackerInfo.gameObject, procCoefficient = onHitProcCoefficient.Value, position = damageInfo.position, crit = body2.RollCrit(), damageColorIndex = (DamageColorIndex)7, procChainMask = damageInfo.procChainMask, damageType = DamageTypeCombo.op_Implicit((DamageType)2048) }; victimInfo.healthComponent.TakeDamage(val); } } } } public static ItemDef itemDef; public static ConfigurableValue isEnabled = new ConfigurableValue("Item: Hellfire Hatchet", "Enabled", defaultValue: true, "Whether or not the item is enabled.", new List(1) { "ITEM_ROT_HELLFIREHATCHET_DESC" }); public static ConfigurableValue maxHealthDamage = new ConfigurableValue("Item: Hellfire Hatchet", "Max Health Damage", 2f, "Percent of max HP dealt as damage on-hit.", new List(1) { "ITEM_ROT_HELLFIREHATCHET_DESC" }); public static ConfigurableValue maxHealthDamageExtraStacks = new ConfigurableValue("Item: Hellfire Hatchet", "Max Health Damage Extra Stacks", 2f, "Percent of max HP dealt as damage on-hit with extra stacks.", new List(1) { "ITEM_ROT_HELLFIREHATCHET_DESC" }); public static ConfigurableValue attackSpeedPerPercent = new ConfigurableValue("Item: Hellfire Hatchet", "Attack Speed Per Percent", 1f, "Percent attack speed gained for every 1% missing HP.", new List(1) { "ITEM_ROT_HELLFIREHATCHET_DESC" }); public static ConfigurableValue attackSpeedPerPercentExtraStacks = new ConfigurableValue("Item: Hellfire Hatchet", "Attack Speed Per Percent Extra Stacks", 1f, "Percent attack speed gained for every 1% missing HP with extra stacks.", new List(1) { "ITEM_ROT_HELLFIREHATCHET_DESC" }); public static ConfigurableValue onHitProcCoefficient = new ConfigurableValue("Item: Hellfire Hatchet", "On-Hit Proc", 0.5f, "Proc coefficient for the percent max HP on-hit damage.", new List(1) { "ITEM_ROT_HELLFIREHATCHET_DESC" }); public static float percentMaxHealthDamage = maxHealthDamage.Value / 100f; public static float percentMaxHealthDamageExtraStacks = maxHealthDamageExtraStacks.Value / 100f; public static float percentAttackSpeedPerPercent = attackSpeedPerPercent.Value / 100f; public static float percentAttackSpeedPerPercentExtraStacks = attackSpeedPerPercentExtraStacks.Value / 100f; internal static void Init() { ItemTag[] array = new ItemTag[3]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); itemDef = ItemManager.GenerateItem("HellfireHatchet", (ItemTag[])(object)array, ItemManager.TacticTier.Artifact); Hooks(); } public static void Hooks() { //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_0020: Expected O, but got Unknown object obj = <>c.<>9__12_0; if (obj == null) { StatHookEventHandler val = delegate(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender) && Object.op_Implicit((Object)(object)sender.inventory)) { int itemCountEffective2 = sender.inventory.GetItemCountEffective(itemDef); if (itemCountEffective2 > 0 && sender.healthComponent.healthFraction < 1f) { args.attackSpeedMultAdd += Utilities.GetLinearStacking(percentAttackSpeedPerPercent, percentAttackSpeedPerPercentExtraStacks, itemCountEffective2) * Utilities.GetMissingHealthPercent(sender.healthComponent, includeShield: true); } } }; <>c.<>9__12_0 = val; obj = (object)val; } RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)obj; GameEventManager.OnHitEnemy += delegate(DamageInfo damageInfo, GameEventManager.GenericCharacterInfo attackerInfo, GameEventManager.GenericCharacterInfo victimInfo) { //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_007b: 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_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: 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_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown CharacterBody body = victimInfo.body; CharacterBody body2 = attackerInfo.body; if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body2) && Object.op_Implicit((Object)(object)body2.inventory) && Utilities.IsValidTargetBody(body)) { int itemCountEffective = body2.inventory.GetItemCountEffective(itemDef); if (itemCountEffective > 0 && !Utilities.OnSameTeam(body, body2)) { DamageInfo val2 = new DamageInfo { damage = CalculateDamageOnHit(body2, itemCountEffective), attacker = attackerInfo.gameObject, inflictor = attackerInfo.gameObject, procCoefficient = onHitProcCoefficient.Value, position = damageInfo.position, crit = body2.RollCrit(), damageColorIndex = (DamageColorIndex)7, procChainMask = damageInfo.procChainMask, damageType = DamageTypeCombo.op_Implicit((DamageType)2048) }; victimInfo.healthComponent.TakeDamage(val2); } } }; } public static float CalculateDamageOnHit(CharacterBody sender, int count) { if (Object.op_Implicit((Object)(object)sender.healthComponent)) { return sender.healthComponent.fullHealth * Utilities.GetLinearStacking(percentMaxHealthDamage, percentMaxHealthDamageExtraStacks, count); } return 0f; } } internal class HorizonFocus { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static GameEventManager.DamageAttackerVictimEventHandler <>9__9_0; public static Func <>9__9_2; public static Func <>9__9_3; public static Manipulator <>9__9_1; internal void b__9_0(DamageInfo damageInfo, GameEventManager.GenericCharacterInfo attackerInfo, GameEventManager.GenericCharacterInfo victimInfo) { //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) CharacterBody body = victimInfo.body; CharacterBody body2 = attackerInfo.body; if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body2) && Object.op_Implicit((Object)(object)body2.inventory) && Utilities.IsValidTargetBody(body)) { int itemCountEffective = body2.inventory.GetItemCountEffective(itemDef); if (itemCountEffective > 0 && !Utilities.OnSameTeam(body, body2) && Util.CheckRoll0To1(percentStunChance * damageInfo.procCoefficient, body2.master)) { damageInfo.damageType |= DamageTypeCombo.op_Implicit((DamageType)32); damageInfo.damageColorIndex = (DamageColorIndex)16; } } } internal void b__9_1(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_000e: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); int num = 0; while (val.TryGotoNext((MoveType)0, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCall(x, "SetStun") })) { val.Emit(OpCodes.Ldarg_1); val.EmitDelegate>((Func)delegate(float duration, DamageReport damageReport) { if (Object.op_Implicit((Object)(object)damageReport.victimBody) && Object.op_Implicit((Object)(object)damageReport.attackerBody) && Object.op_Implicit((Object)(object)damageReport.attackerBody.inventory)) { int itemCountEffective = damageReport.attackerBody.inventory.GetItemCountEffective(itemDef); if (itemCountEffective > 0) { float hyperbolicStacking = Utilities.GetHyperbolicStacking(percentLightningDamage, percentLightningDamageExtraStacks, itemCountEffective); SpawnLightningStrike(damageReport.damageInfo, damageReport.attackerBody, damageReport.victimBody, hyperbolicStacking); } } return duration; }); int index = val.Index; val.Index = index + 1; num++; } Log.Info($"SetStun hook matched {num} times"); } internal float b__9_2(float duration, DamageReport damageReport) { if (Object.op_Implicit((Object)(object)damageReport.victimBody) && Object.op_Implicit((Object)(object)damageReport.attackerBody) && Object.op_Implicit((Object)(object)damageReport.attackerBody.inventory)) { int itemCountEffective = damageReport.attackerBody.inventory.GetItemCountEffective(itemDef); if (itemCountEffective > 0) { float hyperbolicStacking = Utilities.GetHyperbolicStacking(percentLightningDamage, percentLightningDamageExtraStacks, itemCountEffective); SpawnLightningStrike(damageReport.damageInfo, damageReport.attackerBody, damageReport.victimBody, hyperbolicStacking); } } return duration; } internal bool b__9_3(Instruction x) { return ILPatternMatchingExt.MatchCall(x, "SetStun"); } } public static ItemDef itemDef; public static ConfigurableValue isEnabled = new ConfigurableValue("Item: Horizon Focus", "Enabled", defaultValue: true, "Whether or not the item is enabled.", new List(1) { "ITEM_ROT_HORIZONFOCUS_DESC" }); public static ConfigurableValue stunChance = new ConfigurableValue("Item: Horizon Focus", "Stun Chance", 10f, "Percent chance to stun enemies when dealing damage.", new List(1) { "ITEM_ROT_HORIZONFOCUS_DESC" }); public static ConfigurableValue lightningDamage = new ConfigurableValue("Item: Horizon Focus", "Lightning Damage", 10f, "Percent enemy max HP damage dealt by the lightning orb caused by this item.", new List(1) { "ITEM_ROT_HORIZONFOCUS_DESC" }); public static ConfigurableValue lightningDamageExtraStacks = new ConfigurableValue("Item: Horizon Focus", "Lightning Damage Extra Stacks", 10f, "Percent enemy max HP damage dealt by the lightning orb caused by extra stacks this item.", new List(1) { "ITEM_ROT_HORIZONFOCUS_DESC" }); public static float percentStunChance = stunChance.Value / 100f; public static float percentLightningDamage = lightningDamage.Value / 100f; public static float percentLightningDamageExtraStacks = lightningDamageExtraStacks.Value / 100f; internal static void Init() { ItemTag[] array = new ItemTag[3]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); itemDef = ItemManager.GenerateItem("HorizonFocus", (ItemTag[])(object)array, ItemManager.TacticTier.Artifact); Hooks(); } public static void Hooks() { //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_0045: Expected O, but got Unknown GameEventManager.BeforeTakeDamage += delegate(DamageInfo damageInfo, GameEventManager.GenericCharacterInfo attackerInfo, GameEventManager.GenericCharacterInfo victimInfo) { //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) CharacterBody body = victimInfo.body; CharacterBody body2 = attackerInfo.body; if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body2) && Object.op_Implicit((Object)(object)body2.inventory) && Utilities.IsValidTargetBody(body)) { int itemCountEffective2 = body2.inventory.GetItemCountEffective(itemDef); if (itemCountEffective2 > 0 && !Utilities.OnSameTeam(body, body2) && Util.CheckRoll0To1(percentStunChance * damageInfo.procCoefficient, body2.master)) { damageInfo.damageType |= DamageTypeCombo.op_Implicit((DamageType)32); damageInfo.damageColorIndex = (DamageColorIndex)16; } } }; object obj = <>c.<>9__9_1; if (obj == null) { Manipulator val = delegate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_000e: Unknown result type (might be due to invalid IL or missing references) ILCursor val2 = new ILCursor(il); int num = 0; while (val2.TryGotoNext((MoveType)0, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCall(x, "SetStun") })) { val2.Emit(OpCodes.Ldarg_1); val2.EmitDelegate>((Func)delegate(float duration, DamageReport damageReport) { if (Object.op_Implicit((Object)(object)damageReport.victimBody) && Object.op_Implicit((Object)(object)damageReport.attackerBody) && Object.op_Implicit((Object)(object)damageReport.attackerBody.inventory)) { int itemCountEffective = damageReport.attackerBody.inventory.GetItemCountEffective(itemDef); if (itemCountEffective > 0) { float hyperbolicStacking = Utilities.GetHyperbolicStacking(percentLightningDamage, percentLightningDamageExtraStacks, itemCountEffective); SpawnLightningStrike(damageReport.damageInfo, damageReport.attackerBody, damageReport.victimBody, hyperbolicStacking); } } return duration; }); int index = val2.Index; val2.Index = index + 1; num++; } Log.Info($"SetStun hook matched {num} times"); }; <>c.<>9__9_1 = val; obj = (object)val; } SetStateOnHurt.OnTakeDamageServer += (Manipulator)obj; } private static void SpawnLightningStrike(DamageInfo info, CharacterBody attackerBody, CharacterBody victimBody, float mult) { //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 (Object.op_Implicit((Object)(object)victimBody.healthComponent)) { ProjectileManager.instance.FireProjectileWithoutDamageType(LegacyResourcesAPI.Load("Prefabs/Projectiles/LightningStake"), info.position, Quaternion.identity, ((Component)attackerBody).gameObject, victimBody.healthComponent.fullHealth * mult, 0f, info.crit, (DamageColorIndex)16, (GameObject)null, -1f); } } } internal class LightshieldCrest { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static StatHookEventHandler <>9__10_0; public static hook_OnBuffFinalStackLost <>9__10_1; public static hook_GiveItemPermanent_ItemIndex_int <>9__10_2; public static hook_GiveItemTemp <>9__10_3; internal void b__10_0(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender) && Object.op_Implicit((Object)(object)sender.inventory)) { int itemCountEffective = sender.inventory.GetItemCountEffective(itemDef); if (itemCountEffective > 0) { args.armorAdd += armor.Value; } } } internal void b__10_1(orig_OnBuffFinalStackLost orig, CharacterBody self, BuffDef buffDef) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, buffDef); if (!((Object)(object)buffDef == (Object)(object)crestShieldCooldownBuff)) { return; } CharacterBody lowestHealthAlly = Utilities.GetLowestHealthAlly(self.teamComponent.teamIndex); if (Object.op_Implicit((Object)(object)lowestHealthAlly) && Object.op_Implicit((Object)(object)lowestHealthAlly.healthComponent)) { int itemCountEffective = self.inventory.GetItemCountEffective(itemDef); float num = self.armor * Utilities.GetLinearStacking(percentArmor, percentArmorExtraStacks, itemCountEffective); lowestHealthAlly.healthComponent.AddBarrier(num); if (itemCountEffective > 0) { self.AddTimedBuff(crestShieldCooldownBuff, interval.Value); } } } internal void b__10_2(orig_GiveItemPermanent_ItemIndex_int orig, Inventory self, ItemIndex index, int count) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) CharacterMaster component = ((Component)self).GetComponent(); if (Object.op_Implicit((Object)(object)component) && index == itemDef.itemIndex && Object.op_Implicit((Object)(object)component.GetBody())) { component.GetBody().AddTimedBuff(crestShieldCooldownBuff, interval.Value); } orig.Invoke(self, index, count); } internal void b__10_3(orig_GiveItemTemp orig, Inventory self, ItemIndex index, float count) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) CharacterMaster component = ((Component)self).GetComponent(); if (Object.op_Implicit((Object)(object)component) && index == itemDef.itemIndex && Object.op_Implicit((Object)(object)component.GetBody())) { component.GetBody().AddTimedBuff(crestShieldCooldownBuff, interval.Value); } orig.Invoke(self, index, count); } } public static ItemDef itemDef; public static BuffDef crestShieldCooldownBuff; public static ConfigurableValue isEnabled = new ConfigurableValue("Item: Lightshield Crest", "Enabled", defaultValue: true, "Whether or not the item is enabled.", new List(1) { "ITEM_ROT_LIGHTSHIELDCREST_DESC" }); public static ConfigurableValue interval = new ConfigurableValue("Item: Lightshield Crest", "Interval", 10f, "Interval in seconds between each shield application.", new List(1) { "ITEM_ROT_LIGHTSHIELDCREST_DESC" }); public static ConfigurableValue armor = new ConfigurableValue("Item: Lightshield Crest", "Armor", 50f, "Amount of armor gained while holding this item.", new List(1) { "ITEM_ROT_LIGHTSHIELDCREST_DESC" }); public static ConfigurableValue armorPercent = new ConfigurableValue("Item: Lightshield Crest", "Percent Armor", 50f, "Percent of your armor to apply as a shield to the lowest health ally.", new List(1) { "ITEM_ROT_LIGHTSHIELDCREST_DESC" }); public static ConfigurableValue armorPercentExtraStacks = new ConfigurableValue("Item: Lightshield Crest", "Percent Armor Extra Stacks", 50f, "Percent of your armor to apply as a shield to the lowest health ally for each extra stack of this item.", new List(1) { "ITEM_ROT_LIGHTSHIELDCREST_DESC" }); public static float percentArmor = armorPercent.Value / 100f; public static float percentArmorExtraStacks = armorPercentExtraStacks.Value / 100f; internal static void Init() { itemDef = ItemManager.GenerateItem("LightshieldCrest", (ItemTag[])(object)new ItemTag[2] { (ItemTag)3, (ItemTag)31 }, ItemManager.TacticTier.Artifact); crestShieldCooldownBuff = Utilities.GenerateBuffDef("LightshieldCrestCooldown", AssetManager.bundle.LoadAsset("LightshieldCrestCooldown"), canStack: false, isHidden: false, isDebuff: false, isCooldown: true); ContentAddition.AddBuffDef(crestShieldCooldownBuff); Hooks(); } public static void Hooks() { //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_0020: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected O, but got Unknown //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_006a: Expected O, but got Unknown //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_008f: Expected O, but got Unknown object obj = <>c.<>9__10_0; if (obj == null) { StatHookEventHandler val = delegate(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender) && Object.op_Implicit((Object)(object)sender.inventory)) { int itemCountEffective2 = sender.inventory.GetItemCountEffective(itemDef); if (itemCountEffective2 > 0) { args.armorAdd += armor.Value; } } }; <>c.<>9__10_0 = val; obj = (object)val; } RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)obj; object obj2 = <>c.<>9__10_1; if (obj2 == null) { hook_OnBuffFinalStackLost val2 = delegate(orig_OnBuffFinalStackLost orig, CharacterBody self, BuffDef buffDef) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, buffDef); if ((Object)(object)buffDef == (Object)(object)crestShieldCooldownBuff) { CharacterBody lowestHealthAlly = Utilities.GetLowestHealthAlly(self.teamComponent.teamIndex); if (Object.op_Implicit((Object)(object)lowestHealthAlly) && Object.op_Implicit((Object)(object)lowestHealthAlly.healthComponent)) { int itemCountEffective = self.inventory.GetItemCountEffective(itemDef); float num = self.armor * Utilities.GetLinearStacking(percentArmor, percentArmorExtraStacks, itemCountEffective); lowestHealthAlly.healthComponent.AddBarrier(num); if (itemCountEffective > 0) { self.AddTimedBuff(crestShieldCooldownBuff, interval.Value); } } } }; <>c.<>9__10_1 = val2; obj2 = (object)val2; } CharacterBody.OnBuffFinalStackLost += (hook_OnBuffFinalStackLost)obj2; object obj3 = <>c.<>9__10_2; if (obj3 == null) { hook_GiveItemPermanent_ItemIndex_int val3 = delegate(orig_GiveItemPermanent_ItemIndex_int orig, Inventory self, ItemIndex index, int count) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) CharacterMaster component2 = ((Component)self).GetComponent(); if (Object.op_Implicit((Object)(object)component2) && index == itemDef.itemIndex && Object.op_Implicit((Object)(object)component2.GetBody())) { component2.GetBody().AddTimedBuff(crestShieldCooldownBuff, interval.Value); } orig.Invoke(self, index, count); }; <>c.<>9__10_2 = val3; obj3 = (object)val3; } Inventory.GiveItemPermanent_ItemIndex_int += (hook_GiveItemPermanent_ItemIndex_int)obj3; object obj4 = <>c.<>9__10_3; if (obj4 == null) { hook_GiveItemTemp val4 = delegate(orig_GiveItemTemp orig, Inventory self, ItemIndex index, float count) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) CharacterMaster component = ((Component)self).GetComponent(); if (Object.op_Implicit((Object)(object)component) && index == itemDef.itemIndex && Object.op_Implicit((Object)(object)component.GetBody())) { component.GetBody().AddTimedBuff(crestShieldCooldownBuff, interval.Value); } orig.Invoke(self, index, count); }; <>c.<>9__10_3 = val4; obj4 = (object)val4; } Inventory.GiveItemTemp += (hook_GiveItemTemp)obj4; } } internal class Mittens { [CompilerGenerated] private static class <>O { public static hook_InflictDot_refInflictDotInfo <0>__DotController_InflictDot_refInflictDotInfo; } [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static StatHookEventHandler <>9__11_0; public static hook_AddBuff_BuffDef <>9__11_1; public static hook_AddBuff_BuffIndex <>9__11_2; internal void b__11_0(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender) && Object.op_Implicit((Object)(object)sender.inventory)) { int itemCountEffective = sender.inventory.GetItemCountEffective(itemDef); if (itemCountEffective > 0) { args.moveSpeedMultAdd += Utilities.GetLinearStacking(percentMovementSpeed, percentMovementSpeedExtraStacks, itemCountEffective); args.attackSpeedMultAdd += Utilities.GetLinearStacking(percentAttackSpeed, percentAttackSpeedExtraStacks, itemCountEffective); } } } internal void b__11_1(orig_AddBuff_BuffDef orig, CharacterBody self, BuffDef buffDef) { if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.inventory)) { int itemCountEffective = self.inventory.GetItemCountEffective(itemDef); if (itemCountEffective > 0 && ((Object)(object)buffDef == (Object)(object)Buffs.OnFire || (Object)(object)buffDef == (Object)(object)Buffs.HealingDisabled || (Object)(object)buffDef == (Object)(object)Buffs.Cripple)) { return; } } orig.Invoke(self, buffDef); } internal void b__11_2(orig_AddBuff_BuffIndex orig, CharacterBody self, BuffIndex buffIndex) { //IL_0071: 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) if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.inventory)) { int itemCountEffective = self.inventory.GetItemCountEffective(itemDef); if (itemCountEffective > 0) { BuffDef buffDef = BuffCatalog.GetBuffDef(buffIndex); if ((Object)(object)buffDef == (Object)(object)Buffs.OnFire || (Object)(object)buffDef == (Object)(object)Buffs.HealingDisabled || (Object)(object)buffDef == (Object)(object)Buffs.Cripple) { return; } } } orig.Invoke(self, buffIndex); } } public static ItemDef itemDef; public static ConfigurableValue isEnabled = new ConfigurableValue("Item: Mittens", "Enabled", defaultValue: true, "Whether or not the item is enabled.", new List(1) { "ITEM_ROT_MITTENS_DESC" }); public static ConfigurableValue movementSpeed = new ConfigurableValue("Item: Mittens", "Movement Speed", 20f, "Percent movement speed gained when holding this item.", new List(1) { "ITEM_ROT_MITTENS_DESC" }); public static ConfigurableValue movementSpeedExtraStacks = new ConfigurableValue("Item: Mittens", "Movement Speed Extra Stacks", 20f, "Percent movement speed gained when holding extra stacks of this item.", new List(1) { "ITEM_ROT_MITTENS_DESC" }); public static ConfigurableValue attackSpeed = new ConfigurableValue("Item: Mittens", "Attack Speed", 20f, "Percent attack speed gained when holding this item.", new List(1) { "ITEM_ROT_MITTENS_DESC" }); public static ConfigurableValue attackSpeedExtraStacks = new ConfigurableValue("Item: Mittens", "Attack Speed Extra Stacks", 20f, "Percent attack speed gained when holding extra stacks of this item.", new List(1) { "ITEM_ROT_MITTENS_DESC" }); public static readonly float percentMovementSpeed = movementSpeed.Value / 100f; public static readonly float percentMovementSpeedExtraStacks = movementSpeedExtraStacks.Value / 100f; public static readonly float percentAttackSpeed = attackSpeed.Value / 100f; public static readonly float percentAttackSpeedExtraStacks = attackSpeedExtraStacks.Value / 100f; internal static void Init() { ItemTag[] array = new ItemTag[3]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); itemDef = ItemManager.GenerateItem("Mittens", (ItemTag[])(object)array, ItemManager.TacticTier.Artifact); Hooks(); } public static void Hooks() { //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_0020: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected O, but got Unknown //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_006a: Expected O, but got Unknown //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Expected O, but got Unknown object obj = <>c.<>9__11_0; if (obj == null) { StatHookEventHandler val = delegate(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender) && Object.op_Implicit((Object)(object)sender.inventory)) { int itemCountEffective3 = sender.inventory.GetItemCountEffective(itemDef); if (itemCountEffective3 > 0) { args.moveSpeedMultAdd += Utilities.GetLinearStacking(percentMovementSpeed, percentMovementSpeedExtraStacks, itemCountEffective3); args.attackSpeedMultAdd += Utilities.GetLinearStacking(percentAttackSpeed, percentAttackSpeedExtraStacks, itemCountEffective3); } } }; <>c.<>9__11_0 = val; obj = (object)val; } RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)obj; object obj2 = <>c.<>9__11_1; if (obj2 == null) { hook_AddBuff_BuffDef val2 = delegate(orig_AddBuff_BuffDef orig, CharacterBody self, BuffDef buffDef) { if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.inventory)) { int itemCountEffective2 = self.inventory.GetItemCountEffective(itemDef); if (itemCountEffective2 > 0 && ((Object)(object)buffDef == (Object)(object)Buffs.OnFire || (Object)(object)buffDef == (Object)(object)Buffs.HealingDisabled || (Object)(object)buffDef == (Object)(object)Buffs.Cripple)) { return; } } orig.Invoke(self, buffDef); }; <>c.<>9__11_1 = val2; obj2 = (object)val2; } CharacterBody.AddBuff_BuffDef += (hook_AddBuff_BuffDef)obj2; object obj3 = <>c.<>9__11_2; if (obj3 == null) { hook_AddBuff_BuffIndex val3 = delegate(orig_AddBuff_BuffIndex orig, CharacterBody self, BuffIndex buffIndex) { //IL_0071: 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) if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.inventory)) { int itemCountEffective = self.inventory.GetItemCountEffective(itemDef); if (itemCountEffective > 0) { BuffDef buffDef2 = BuffCatalog.GetBuffDef(buffIndex); if ((Object)(object)buffDef2 == (Object)(object)Buffs.OnFire || (Object)(object)buffDef2 == (Object)(object)Buffs.HealingDisabled || (Object)(object)buffDef2 == (Object)(object)Buffs.Cripple) { return; } } } orig.Invoke(self, buffIndex); }; <>c.<>9__11_2 = val3; obj3 = (object)val3; } CharacterBody.AddBuff_BuffIndex += (hook_AddBuff_BuffIndex)obj3; object obj4 = <>O.<0>__DotController_InflictDot_refInflictDotInfo; if (obj4 == null) { hook_InflictDot_refInflictDotInfo val4 = DotController_InflictDot_refInflictDotInfo; <>O.<0>__DotController_InflictDot_refInflictDotInfo = val4; obj4 = (object)val4; } DotController.InflictDot_refInflictDotInfo += (hook_InflictDot_refInflictDotInfo)obj4; } private static void DotController_InflictDot_refInflictDotInfo(orig_InflictDot_refInflictDotInfo orig, ref InflictDotInfo inflictDotInfo) { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Invalid comparison between Unknown and I4 //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Invalid comparison between Unknown and I4 CharacterBody val = (Object.op_Implicit((Object)(object)inflictDotInfo.victimObject) ? inflictDotInfo.victimObject.GetComponent() : null); if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.inventory)) { int itemCountEffective = val.inventory.GetItemCountEffective(itemDef); if (itemCountEffective > 0 && ((int)inflictDotInfo.dotIndex == 1 || (int)inflictDotInfo.dotIndex == 7)) { return; } } orig.Invoke(ref inflictDotInfo); } } public class SnipersFocus { public static ItemDef itemDef; public static GameObject missilePrefab; public static ConfigurableValue isEnabled = new ConfigurableValue("Item: Snipers Focus", "Enabled", defaultValue: true, "Whether or not the item is enabled.", new List(1) { "ITEM_ROT_SNIPERSFOCUS_DESC" }); public static ConfigurableValue damageIncreasePerMeter = new ConfigurableValue("Item: Snipers Focus", "Damage Increase", 1f, "Percent of additional damage dealt per meter of distance.", new List(1) { "ITEM_ROT_SNIPERSFOCUS_DESC" }); public static ConfigurableValue damageIncreasePerMeterExtraStacks = new ConfigurableValue("Item: Snipers Focus", "Damage Increase Extra Stacks", 1f, "Percent of additional damage dealt per meter of distance for additional item stacks.", new List(1) { "ITEM_ROT_SNIPERSFOCUS_DESC" }); public static ConfigurableValue missileDamageMult = new ConfigurableValue("Item: Snipers Focus", "Missile Damage Multiplier", 50f, "Missile damage dealt (multiplied by hit's damage).", new List(1) { "ITEM_ROT_SNIPERSFOCUS_DESC" }); public static ConfigurableValue maxDistance = new ConfigurableValue("Item: Snipers Focus", "Max Distance", 100f, "Maximum distance at which the damage increase is applied.", new List(1) { "ITEM_ROT_SNIPERSFOCUS_DESC" }); public static readonly float percentDamageIncreasePerMeter = damageIncreasePerMeter.Value / 100f; public static readonly float percentDamageIncreasePerMeterExtraStacks = damageIncreasePerMeterExtraStacks.Value / 100f; public static readonly float percentMissileDamageMult = missileDamageMult.Value / 100f; internal static void Init() { //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) itemDef = ItemManager.GenerateItem("SnipersFocus", (ItemTag[])(object)new ItemTag[2] { (ItemTag)1, (ItemTag)31 }, ItemManager.TacticTier.Artifact); missilePrefab = LegacyResourcesAPI.LoadAsync("Prefabs/Projectiles/MissileProjectile").WaitForCompletion(); Hooks(); } public static void Hooks() { GameEventManager.BeforeTakeDamage += delegate(DamageInfo damageInfo, GameEventManager.GenericCharacterInfo attackerInfo, GameEventManager.GenericCharacterInfo victimInfo) { //IL_0055: 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_00e6: 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_00f4: Unknown result type (might be due to invalid IL or missing references) CharacterBody body = attackerInfo.body; GameObject gameObject = victimInfo.gameObject; if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)gameObject) && Object.op_Implicit((Object)(object)body.inventory)) { int itemCountEffective = body.inventory.GetItemCountEffective(itemDef); if (itemCountEffective > 0) { float num = Vector3.Distance(attackerInfo.aimOrigin, gameObject.transform.position); float linearStacking = Utilities.GetLinearStacking(percentDamageIncreasePerMeter, percentDamageIncreasePerMeterExtraStacks, itemCountEffective); float num2 = Mathf.Min(num * linearStacking, maxDistance.Value * linearStacking); damageInfo.damage *= 1f + num2; if (num >= maxDistance.Value && !((ProcChainMask)(ref damageInfo.procChainMask)).HasProc((ProcType)1)) { int itemCountEffective2 = body.inventory.GetItemCountEffective(Items.MoreMissile); MissileUtils.FireMissile(body.corePosition, body, default(ProcChainMask), gameObject, damageInfo.damage * percentMissileDamageMult * (1f + Utilities.GetLinearStacking(0f, 0.5f, itemCountEffective2)), body.RollCrit(), missilePrefab, (DamageColorIndex)5, true); } } } }; } } public class StatikkShivItemBehavior : BaseItemBodyBehavior { [ItemDefAssociation(useOnServer = true, useOnClient = false)] public static ItemDef GetItemDef() { return StatikkShiv.itemDef; } public void FixedUpdate() { if (Object.op_Implicit((Object)(object)((BaseItemBodyBehavior)this).body) && Object.op_Implicit((Object)(object)((BaseItemBodyBehavior)this).body.inventory) && ((BaseItemBodyBehavior)this).body.inventory.GetItemCountEffective(StatikkShiv.itemDef) > 0 && ((BaseItemBodyBehavior)this).body.GetBuffCount(StatikkShiv.shockBuff) == 0 && ((BaseItemBodyBehavior)this).body.GetBuffCount(StatikkShiv.shockCooldown) == 0) { ((BaseItemBodyBehavior)this).body.AddBuff(StatikkShiv.shockBuff); } } } internal class StatikkShiv { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static hook_OnBuffFinalStackLost <>9__13_0; public static GameEventManager.DamageAttackerVictimEventHandler <>9__13_1; internal void b__13_0(orig_OnBuffFinalStackLost orig, CharacterBody self, BuffDef buffDef) { orig.Invoke(self, buffDef); if ((Object)(object)buffDef == (Object)(object)shockCooldown && Object.op_Implicit((Object)(object)self) && self.GetBuffCount(shockBuff) == 0) { self.AddBuff(shockBuff); } } internal void b__13_1(DamageInfo damageInfo, GameEventManager.GenericCharacterInfo attackerInfo, GameEventManager.GenericCharacterInfo victimInfo) { //IL_0069: 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) CharacterBody body = victimInfo.body; CharacterBody body2 = attackerInfo.body; if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body2) || !Object.op_Implicit((Object)(object)body2.inventory)) { return; } int itemCountEffective = body2.inventory.GetItemCountEffective(itemDef); if (body2.GetBuffCount(shockBuff) > 0 && !Utilities.OnSameTeam(body, body2) && !DamageAPI.HasModdedDamageType(ref damageInfo.damageType, Sunder.ApplySunder)) { float num = 1f + Utilities.GetLinearStacking(percentEffectOnHitDamage, percentEffectOnHitDamageExtraStacks, itemCountEffective); damageInfo.damage *= num; damageInfo.damageColorIndex = (DamageColorIndex)5; AddStatikkChainDamage(body2, body, damageInfo, num); body.AddBuff(Sunder.buffDef); body2.RemoveBuff(shockBuff); if (itemCountEffective > 0) { body2.AddTimedBuff(shockCooldown, effectCooldown.Value); } } } } public static ItemDef itemDef; public static BuffDef shockBuff; public static BuffDef shockCooldown; public static ConfigurableValue isEnabled = new ConfigurableValue("Item: Statikk Shiv", "Enabled", defaultValue: true, "Whether or not the item is enabled.", new List(1) { "ITEM_ROT_STATIKKSHIV_DESC" }); public static ConfigurableValue effectCooldown = new ConfigurableValue("Item: Statikk Shiv", "Effect Cooldown", 6f, "Cooldown of this item's effect.", new List(1) { "ITEM_ROT_STATIKKSHIV_DESC" }); public static ConfigurableValue effectOnHitDamage = new ConfigurableValue("Item: Statikk Shiv", "Bonus On-Hit", 100f, "Bonus on-hit damage (as a percentage of TOTAL damage) dealt by this item's effect.", new List(1) { "ITEM_ROT_STATIKKSHIV_DESC" }); public static ConfigurableValue effectOnHitDamageExtraStacks = new ConfigurableValue("Item: Statikk Shiv", "Bonus On-Hit Per Stack", 200f, "Bonus on-hit damage for extra stacks of this item.", new List(1) { "ITEM_ROT_STATIKKSHIV_DESC" }); public static ConfigurableValue shivRange = new ConfigurableValue("Item: Statikk Shiv", "Zap Range", 30, "Zap range of the item's chain effect in meters.", new List(1) { "ITEM_ROT_STATIKKSHIV_DESC" }); public static ConfigurableValue numberEnemiesChained = new ConfigurableValue("Item: Statikk Shiv", "Number of Enemies Chained", 3, "Number of additional enemies chained off the initial enemy with this effect.", new List(1) { "ITEM_ROT_STATIKKSHIV_DESC" }); public static ConfigurableValue shivProcCoeff = new ConfigurableValue("Item: Statikk Shiv", "Proc Coefficient", 0.5f, "Proc coefficient for the chain effect of this item.", new List(1) { "ITEM_ROT_STATIKKSHIV_DESC" }); public static float percentEffectOnHitDamage = effectOnHitDamage.Value / 100f; public static float percentEffectOnHitDamageExtraStacks = effectOnHitDamageExtraStacks.Value / 100f; internal static void Init() { ItemTag[] array = new ItemTag[3]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); itemDef = ItemManager.GenerateItem("StatikkShiv", (ItemTag[])(object)array, ItemManager.TacticTier.Artifact); shockBuff = Utilities.GenerateBuffDef("Shock", AssetManager.bundle.LoadAsset("Shock.png"), canStack: false, isHidden: false, isDebuff: false, isCooldown: false); ContentAddition.AddBuffDef(shockBuff); shockCooldown = Utilities.GenerateBuffDef("Shock Cooldown", AssetManager.bundle.LoadAsset("ShockCD.png"), canStack: false, isHidden: false, isDebuff: false, isCooldown: true); ContentAddition.AddBuffDef(shockCooldown); Hooks(); } public static void Hooks() { //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_0020: Expected O, but got Unknown object obj = <>c.<>9__13_0; if (obj == null) { hook_OnBuffFinalStackLost val = delegate(orig_OnBuffFinalStackLost orig, CharacterBody self, BuffDef buffDef) { orig.Invoke(self, buffDef); if ((Object)(object)buffDef == (Object)(object)shockCooldown && Object.op_Implicit((Object)(object)self) && self.GetBuffCount(shockBuff) == 0) { self.AddBuff(shockBuff); } }; <>c.<>9__13_0 = val; obj = (object)val; } CharacterBody.OnBuffFinalStackLost += (hook_OnBuffFinalStackLost)obj; GameEventManager.BeforeTakeDamage += delegate(DamageInfo damageInfo, GameEventManager.GenericCharacterInfo attackerInfo, GameEventManager.GenericCharacterInfo victimInfo) { //IL_0069: 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) CharacterBody body = victimInfo.body; CharacterBody body2 = attackerInfo.body; if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body2) && Object.op_Implicit((Object)(object)body2.inventory)) { int itemCountEffective = body2.inventory.GetItemCountEffective(itemDef); if (body2.GetBuffCount(shockBuff) > 0 && !Utilities.OnSameTeam(body, body2) && !DamageAPI.HasModdedDamageType(ref damageInfo.damageType, Sunder.ApplySunder)) { float num = 1f + Utilities.GetLinearStacking(percentEffectOnHitDamage, percentEffectOnHitDamageExtraStacks, itemCountEffective); damageInfo.damage *= num; damageInfo.damageColorIndex = (DamageColorIndex)5; AddStatikkChainDamage(body2, body, damageInfo, num); body.AddBuff(Sunder.buffDef); body2.RemoveBuff(shockBuff); if (itemCountEffective > 0) { body2.AddTimedBuff(shockCooldown, effectCooldown.Value); } } } }; } private static void AddStatikkChainDamage(CharacterBody attacker, CharacterBody victim, DamageInfo damageInfo, float mult) { //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_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_0026: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_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_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_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_00a2: 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_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Expected O, but got Unknown //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)attacker.teamComponent != (Object)null) { LightningOrb val = new LightningOrb { origin = damageInfo.position, damageValue = damageInfo.damage * mult, isCrit = damageInfo.crit, bouncesRemaining = numberEnemiesChained.Value, teamIndex = attacker.teamComponent.teamIndex, attacker = ((Component)attacker).gameObject, bouncedObjects = new List(1) { ((Component)victim).GetComponent() }, procChainMask = damageInfo.procChainMask, procCoefficient = shivProcCoeff, lightningType = (LightningType)8, damageColorIndex = (DamageColorIndex)5, range = (int)shivRange, canBounceOnSameTarget = false }; DamageAPI.AddModdedDamageType(val, Sunder.ApplySunder); HurtBox val2 = val.PickNextTarget(damageInfo.position); if (Object.op_Implicit((Object)(object)val2)) { ((Orb)val).target = val2; OrbManager.instance.AddOrb((Orb)(object)val); } } } } internal class ZhonyasParadox { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static GameEventManager.DamageReportEventHandler <>9__11_0; public static GameEventManager.DamageAttackerVictimEventHandler <>9__11_1; public static hook_OnBuffFinalStackLost <>9__11_2; internal void b__11_0(DamageReport damageReport) { CharacterBody victimBody = damageReport.victimBody; if (!Object.op_Implicit((Object)(object)victimBody) || !Object.op_Implicit((Object)(object)victimBody.inventory) || victimBody.HasBuff(zhonyasBuffCooldown)) { return; } int itemCountEffective = victimBody.inventory.GetItemCountEffective(itemDef); if (itemCountEffective > 0 && Object.op_Implicit((Object)(object)victimBody.healthComponent) && victimBody.healthComponent.healthFraction <= percentHealthThreshold && !victimBody.HasBuff(zhonyasBuff)) { float linearStacking = Utilities.GetLinearStacking(effectDuration.Value, effectDurationExtraStacks.Value, itemCountEffective); victimBody.AddTimedBuff(Buffs.EliteAurelionite, linearStacking); victimBody.AddTimedBuff(zhonyasBuff, linearStacking); if (shouldPlaySoundEffect.Value) { AkSoundEngine.PostEvent(SoundManager.zhonyas_SFX_ID, ((Component)victimBody).gameObject); } } } internal void b__11_1(DamageInfo damageInfo, GameEventManager.GenericCharacterInfo attackerInfo, GameEventManager.GenericCharacterInfo victimInfo) { CharacterBody body = victimInfo.body; if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.inventory)) { return; } int itemCountEffective = body.inventory.GetItemCountEffective(itemDef); if (itemCountEffective > 0 && Object.op_Implicit((Object)(object)body.healthComponent)) { float num = Mathf.Max(body.healthComponent.combinedHealth - damageInfo.damage, 0f); if (num < 0f && body.healthComponent.healthFraction > percentHealthThreshold) { damageInfo.damage = num - body.healthComponent.fullCombinedHealth * percentHealthThreshold; } if (body.HasBuff(zhonyasBuff)) { damageInfo.damage = 0f; } } } internal void b__11_2(orig_OnBuffFinalStackLost orig, CharacterBody self, BuffDef buffDef) { if (Object.op_Implicit((Object)(object)self) && (Object)(object)buffDef == (Object)(object)zhonyasBuff) { self.AddTimedBuff(zhonyasBuffCooldown, zhonyasCooldown.Value); } orig.Invoke(self, buffDef); } } public static ItemDef itemDef; public static BuffDef zhonyasBuff; public static BuffDef zhonyasBuffCooldown; public static ConfigurableValue isEnabled = new ConfigurableValue("Item: Zhonyas Paradox", "Enabled", defaultValue: true, "Whether or not the item is enabled.", new List(1) { "ITEM_ROT_ZHONYASPARADOX_DESC" }); public static ConfigurableValue healthThreshold = new ConfigurableValue("Item: Zhonyas Paradox", "Health Threshold", 40f, "Percent health threshold at which the effect activates.", new List(1) { "ITEM_ROT_ZHONYASPARADOX_DESC" }); public static ConfigurableValue effectDuration = new ConfigurableValue("Item: Zhonyas Paradox", "Effect Duration", 3f, "Duration of the Gilded effect.", new List(1) { "ITEM_ROT_ZHONYASPARADOX_DESC" }); public static ConfigurableValue effectDurationExtraStacks = new ConfigurableValue("Item: Zhonyas Paradox", "Effect Duration Extra Stacks", 3f, "Additional duration of the Gilded effect with extra stacks.", new List(1) { "ITEM_ROT_ZHONYASPARADOX_DESC" }); public static ConfigurableValue zhonyasCooldown = new ConfigurableValue("Item: Zhonyas Paradox", "Cooldown", 40f, "Cooldown of this effect in seconds.", new List(1) { "ITEM_ROT_ZHONYASPARADOX_DESC" }); public static ConfigurableValue shouldPlaySoundEffect = new ConfigurableValue("Item: Zhonyas Paradox", "Play Sound Effect", defaultValue: true, "Whether or not to play the sound effect when the effect activates.", new List(1) { "ITEM_ROT_ZHONYASPARADOX_DESC" }); public static readonly float percentHealthThreshold = healthThreshold.Value / 100f; internal static void Init() { itemDef = ItemManager.GenerateItem("ZhonyasParadox", (ItemTag[])(object)new ItemTag[2] { (ItemTag)3, (ItemTag)31 }, ItemManager.TacticTier.Artifact); zhonyasBuff = Utilities.GenerateBuffDef("ZhonyasParadoxBuff", AssetManager.bundle.LoadAsset("ZhonyasParadox"), canStack: false, isHidden: false, isDebuff: false, isCooldown: true); ContentAddition.AddBuffDef(zhonyasBuff); zhonyasBuffCooldown = Utilities.GenerateBuffDef("ZhonyasParadoxCooldown", AssetManager.bundle.LoadAsset("ZhonyasParadoxCooldown"), canStack: false, isHidden: false, isDebuff: false, isCooldown: true); ContentAddition.AddBuffDef(zhonyasBuffCooldown); Hooks(); } public static void Hooks() { //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_006a: Expected O, but got Unknown GameEventManager.OnTakeDamage += delegate(DamageReport damageReport) { CharacterBody victimBody = damageReport.victimBody; if (Object.op_Implicit((Object)(object)victimBody) && Object.op_Implicit((Object)(object)victimBody.inventory) && !victimBody.HasBuff(zhonyasBuffCooldown)) { int itemCountEffective2 = victimBody.inventory.GetItemCountEffective(itemDef); if (itemCountEffective2 > 0 && Object.op_Implicit((Object)(object)victimBody.healthComponent) && victimBody.healthComponent.healthFraction <= percentHealthThreshold && !victimBody.HasBuff(zhonyasBuff)) { float linearStacking = Utilities.GetLinearStacking(effectDuration.Value, effectDurationExtraStacks.Value, itemCountEffective2); victimBody.AddTimedBuff(Buffs.EliteAurelionite, linearStacking); victimBody.AddTimedBuff(zhonyasBuff, linearStacking); if (shouldPlaySoundEffect.Value) { AkSoundEngine.PostEvent(SoundManager.zhonyas_SFX_ID, ((Component)victimBody).gameObject); } } } }; GameEventManager.BeforeTakeDamage += delegate(DamageInfo damageInfo, GameEventManager.GenericCharacterInfo attackerInfo, GameEventManager.GenericCharacterInfo victimInfo) { CharacterBody body = victimInfo.body; if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.inventory)) { int itemCountEffective = body.inventory.GetItemCountEffective(itemDef); if (itemCountEffective > 0 && Object.op_Implicit((Object)(object)body.healthComponent)) { float num = Mathf.Max(body.healthComponent.combinedHealth - damageInfo.damage, 0f); if (num < 0f && body.healthComponent.healthFraction > percentHealthThreshold) { damageInfo.damage = num - body.healthComponent.fullCombinedHealth * percentHealthThreshold; } if (body.HasBuff(zhonyasBuff)) { damageInfo.damage = 0f; } } } }; object obj = <>c.<>9__11_2; if (obj == null) { hook_OnBuffFinalStackLost val = delegate(orig_OnBuffFinalStackLost orig, CharacterBody self, BuffDef buffDef) { if (Object.op_Implicit((Object)(object)self) && (Object)(object)buffDef == (Object)(object)zhonyasBuff) { self.AddTimedBuff(zhonyasBuffCooldown, zhonyasCooldown.Value); } orig.Invoke(self, buffDef); }; <>c.<>9__11_2 = val; obj = (object)val; } CharacterBody.OnBuffFinalStackLost += (hook_OnBuffFinalStackLost)obj; } } } namespace RiskOfTactics.Content.Equipment { internal class LuckyItemChest { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static hook_PerformEquipmentAction <>9__12_0; internal bool b__12_0(orig_PerformEquipmentAction orig, EquipmentSlot self, EquipmentDef equipDef) { if (NetworkServer.active && (Object)(object)equipDef == (Object)(object)equipmentDef) { return OnUse(self); } return orig.Invoke(self, equipDef); } } public static EquipmentDef equipmentDef; public static ConfigurableValue isEnabled = new ConfigurableValue("Equipment: Lucky Item Chest", "Enabled", defaultValue: true, "Whether or not the item is enabled.", new List(1) { "EQUIPMENT_ROT_LUCKYITEMCHEST_DESC" }); public static ConfigurableValue radiantChance = new ConfigurableValue("Equipment: Lucky Item Chest", "Radiant Chance", 8f, "Percent chance to roll a radiant on use.", new List(1) { "EQUIPMENT_ROT_LUCKYITEMCHEST_DESC" }); public static ConfigurableValue artifactChance = new ConfigurableValue("Equipment: Lucky Item Chest", "Artifact Chance", 8f, "Percent chance to roll an artifact on use.", new List(1) { "EQUIPMENT_ROT_LUCKYITEMCHEST_DESC" }); public static ConfigurableValue normalChance = new ConfigurableValue("Equipment: Lucky Item Chest", "Normal Chance", 84f, "Percent chance to roll a normal on use.", new List(1) { "EQUIPMENT_ROT_LUCKYITEMCHEST_DESC" }); public static ConfigurableValue numItems = new ConfigurableValue("Equipment: Lucky Item Chest", "Num Items", 3, "Number of items available to choose from.", new List(1) { "EQUIPMENT_ROT_LUCKYITEMCHEST_DESC" }); public static ConfigurableValue shouldConsumeOnUse = new ConfigurableValue("Equipment: Lucky Item Chest", "Consume On Use", defaultValue: true, "Whether the equipment should be consumed on use.", new List(1) { "EQUIPMENT_ROT_LUCKYITEMCHEST_DESC" }); public static ConfigurableValue cooldown = new ConfigurableValue("Equipment: Lucky Item Chest", "Cooldown", 0f, "Equipment cooldown. This value is only used if 'Consume On Use' is disabled or if 2 or more Lucky Item Chests are used back-to-back.", new List(1) { "EQUIPMENT_ROT_LUCKYITEMCHEST_DESC" }); public static float percentRadiantChance = radiantChance.Value / 100f; public static float percentArtifactChance = artifactChance.Value / 100f; public static float percentNormalChance = normalChance.Value / 100f; internal static void Init() { equipmentDef = ItemManager.GenerateEquipment("LuckyItemChest", cooldown.Value); Hooks(); } public static void Hooks() { //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_0020: Expected O, but got Unknown object obj = <>c.<>9__12_0; if (obj == null) { hook_PerformEquipmentAction val = (orig_PerformEquipmentAction orig, EquipmentSlot self, EquipmentDef equipDef) => (NetworkServer.active && (Object)(object)equipDef == (Object)(object)equipmentDef) ? OnUse(self) : orig.Invoke(self, equipDef); <>c.<>9__12_0 = val; obj = (object)val; } EquipmentSlot.PerformEquipmentAction += (hook_PerformEquipmentAction)obj; } private static bool OnUse(EquipmentSlot slot) { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_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_005d: 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_0086: 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_00a5: 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_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_00d4: 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_00e2: 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_00e9: 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_00fe: 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_0139: Unknown result type (might be due to invalid IL or missing references) List list = new List(); if (Object.op_Implicit((Object)(object)slot.characterBody) && Object.op_Implicit((Object)(object)slot.characterBody.inventory)) { for (int i = 0; i < (int)numItems; i++) { ItemManager.TacticTier tier = RollTier(); ItemDef randomTacticItemOfTier = ItemManager.GetRandomTacticItemOfTier(tier); PickupIndex pickupIndex = PickupCatalog.FindPickupIndex(randomTacticItemOfTier.itemIndex); list.Add(new UniquePickup { pickupIndex = pickupIndex }); } CreatePickupInfo val = default(CreatePickupInfo); val.pickerOptions = PickupPickerController.GenerateOptionsFromList>(list); val.prefabOverride = Addressables.LoadAssetAsync((object)"RoR2/DLC1/OptionPickup/OptionPickup.prefab").WaitForCompletion(); val.position = ((Component)slot).transform.position; val.rotation = Quaternion.identity; ((CreatePickupInfo)(ref val)).pickupIndex = PickupCatalog.FindPickupIndex((ItemTier)0); CreatePickupInfo val2 = val; PickupDropletController.CreatePickupDroplet(val2, val2.position, Vector3.up * 20f + ((Component)slot).transform.forward * 2f); if (shouldConsumeOnUse.Value) { CharacterMasterNotificationQueue.SendTransformNotification(slot.characterBody.master, equipmentDef.equipmentIndex, (EquipmentIndex)(-1), (TransformationType)0); slot.characterBody.inventory.SetEquipmentIndex((EquipmentIndex)(-1), true); } return true; } return false; } private static ItemManager.TacticTier RollTier() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown Xoroshiro128Plus val = new Xoroshiro128Plus(Run.instance.treasureRng.nextUlong); WeightedSelection val2 = new WeightedSelection(8); val2.AddChoice(ItemManager.TacticTier.Radiant, percentRadiantChance); val2.AddChoice(ItemManager.TacticTier.Artifact, percentArtifactChance); val2.AddChoice(ItemManager.TacticTier.Normal, percentNormalChance); return val2.Evaluate(val.nextNormalizedFloat); } } } namespace RiskOfTactics.Content.Buffs { internal class Sunder { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static StatHookEventHandler <>9__4_0; public static GameEventManager.DamageAttackerVictimEventHandler <>9__4_1; internal void b__4_0(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender) && sender.GetBuffCount(buffDef) > 0) { args.armorAdd -= (float)(armorReduction.Value * sender.GetBuffCount(buffDef)); } } internal void b__4_1(DamageInfo damageInfo, GameEventManager.GenericCharacterInfo attackerInfo, GameEventManager.GenericCharacterInfo victimInfo) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) CharacterBody body = victimInfo.body; if (Object.op_Implicit((Object)(object)body) && DamageAPI.HasModdedDamageType(damageInfo, ApplySunder)) { body.AddBuff(buffDef); } } } public static BuffDef buffDef; public static ModdedDamageType ApplySunder; public static ConfigurableValue armorReduction = new ConfigurableValue("Buff: Sunder", "Sunder Reduction", 10, "Armor reduction applied to enemies for each stack of this debuff.", new List(1) { "BUFF_SUNDER_DESC" }); internal static void Init() { //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) buffDef = Utilities.GenerateBuffDef("Sunder", AssetManager.bundle.LoadAsset("Sunder.png"), canStack: true, isHidden: false, isDebuff: true, isCooldown: false); ContentAddition.AddBuffDef(buffDef); ApplySunder = DamageAPI.ReserveDamageType(); Hooks(); } public static void Hooks() { //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_0020: Expected O, but got Unknown object obj = <>c.<>9__4_0; if (obj == null) { StatHookEventHandler val = delegate(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender) && sender.GetBuffCount(buffDef) > 0) { args.armorAdd -= (float)(armorReduction.Value * sender.GetBuffCount(buffDef)); } }; <>c.<>9__4_0 = val; obj = (object)val; } RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)obj; GameEventManager.BeforeTakeDamage += delegate(DamageInfo damageInfo, GameEventManager.GenericCharacterInfo attackerInfo, GameEventManager.GenericCharacterInfo victimInfo) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) CharacterBody body = victimInfo.body; if (Object.op_Implicit((Object)(object)body) && DamageAPI.HasModdedDamageType(damageInfo, ApplySunder)) { body.AddBuff(buffDef); } }; } } } namespace RiskOfTactics.Content.Artifacts { internal class ArtifactOfTheGoldenSpat { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static hook_BeginStage <>9__6_0; internal void b__6_0(orig_BeginStage orig, Run self) { //IL_006f: 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_0085: 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_00a8: 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_009d: Unknown result type (might be due to invalid IL or missing references) if (RunArtifactManager.instance.IsArtifactEnabled(artifactDef)) { foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances) { if (Object.op_Implicit((Object)(object)instance) && Object.op_Implicit((Object)(object)instance.master) && Object.op_Implicit((Object)(object)instance.master.inventory)) { Inventory inventory = instance.master.inventory; EquipmentIndex equipmentIndex = inventory.GetEquipment(0u, 0u).equipmentIndex; EquipmentIndex equipmentIndex2 = LuckyItemChest.equipmentDef.equipmentIndex; if ((int)equipmentIndex != -1) { CharacterMasterNotificationQueue.PushEquipmentTransformNotification(instance.master, equipmentIndex, equipmentIndex2, (TransformationType)4); } inventory.SetEquipmentIndexForSlot(equipmentIndex2, 0u, 0u); } } } orig.Invoke(self); } } public static ArtifactDef artifactDef; public static ConfigurableValue isEnabled = new ConfigurableValue("Artifact of the Golden Spatula", "Enabled", defaultValue: true, "Whether or not the artifact is enabled.", new List(1) { "ARTIFACT_ROT_GOLDEN_SPATULA_MODIFIER_DESC" }); public static GameObject PickupModelPrefab { get; } = null; internal static void Init() { artifactDef = ScriptableObject.CreateInstance(); artifactDef.cachedName = "ROT_GOLDEN_SPATULA_MODIFIER"; artifactDef.nameToken = "ROT_GOLDEN_SPATULA_MODIFIER_NAME"; artifactDef.descriptionToken = "ROT_GOLDEN_SPATULA_MODIFIER_DESC"; artifactDef.smallIconSelectedSprite = AssetManager.bundle.LoadAsset("GoldenSpatModifierEnabled.png"); artifactDef.smallIconDeselectedSprite = AssetManager.bundle.LoadAsset("GoldenSpatModifierDisabled.png"); artifactDef.pickupModelPrefab = AssetManager.bundle.LoadAsset("GoldenSpatModifierPickup.prefab"); ContentAddition.AddArtifactDef(artifactDef); Hooks(); } public static void Hooks() { //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_0020: Expected O, but got Unknown object obj = <>c.<>9__6_0; if (obj == null) { hook_BeginStage val = delegate(orig_BeginStage orig, Run self) { //IL_006f: 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_0085: 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_00a8: 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_009d: Unknown result type (might be due to invalid IL or missing references) if (RunArtifactManager.instance.IsArtifactEnabled(artifactDef)) { foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances) { if (Object.op_Implicit((Object)(object)instance) && Object.op_Implicit((Object)(object)instance.master) && Object.op_Implicit((Object)(object)instance.master.inventory)) { Inventory inventory = instance.master.inventory; EquipmentIndex equipmentIndex = inventory.GetEquipment(0u, 0u).equipmentIndex; EquipmentIndex equipmentIndex2 = LuckyItemChest.equipmentDef.equipmentIndex; if ((int)equipmentIndex != -1) { CharacterMasterNotificationQueue.PushEquipmentTransformNotification(instance.master, equipmentIndex, equipmentIndex2, (TransformationType)4); } inventory.SetEquipmentIndexForSlot(equipmentIndex2, 0u, 0u); } } } orig.Invoke(self); }; <>c.<>9__6_0 = val; obj = (object)val; } Run.BeginStage += (hook_BeginStage)obj; } } }