Decompiled source of TooManyItems v0.1.11
plugins/TooManyItems.dll
Decompiled 3 weeks ago
The result has been truncated due to the large size, download it to view full contents!
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 System.Text; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using BetterUI; using HG; using On.RoR2; using On.RoR2.Items; using On.RoR2.UI.LogBook; using R2API; using R2API.Networking; using R2API.Networking.Interfaces; using RoR2; using RoR2.ExpansionManagement; 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: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")] [assembly: AssemblyCompany("TooManyItems")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("TooManyItems")] [assembly: AssemblyTitle("TooManyItems")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace TooManyItems; internal static class BetterUIIntegration { public static class BetterUIItemStats { public static StatFormatter GlassMarbleBonusFormatter = new StatFormatter { suffix = "", style = "cIsDamage", statFormatter = (Formatter)delegate(StringBuilder sb, float value, CharacterMaster master) { if (Object.op_Implicit((Object)(object)master.inventory) && master.hasBody) { int itemCount = master.inventory.GetItemCount(GlassMarble.itemDef); if (itemCount > 0) { string text8 = $"{(float)itemCount * master.GetBody().level * (float)GlassMarble.damagePerLevelPerStack.Value:#}"; text8 = ((text8 == string.Empty) ? "0" : text8); sb.AppendFormat(text8); } else { sb.Append("0"); } } } }; public static StatFormatter IronHeartOnHitFormatter = new StatFormatter { suffix = "", style = "cIsDamage", statFormatter = (Formatter)delegate(StringBuilder sb, float value, CharacterMaster master) { if (master.hasBody) { float num = IronHeart.CalculateDamageOnHit(master.GetBody(), value); string format = ((num == 0f) ? "0" : $"{num:#.#}"); sb.AppendFormat(format); } } }; public static StatFormatter IronHeartDamageFormatter = new StatFormatter { suffix = "", style = "cIsDamage", statFormatter = (Formatter)delegate(StringBuilder sb, float value, CharacterMaster master) { if (Object.op_Implicit((Object)(object)master.inventory)) { IronHeart.Statistics component7 = ((Component)master.inventory).GetComponent<IronHeart.Statistics>(); if (Object.op_Implicit((Object)(object)component7)) { string text7 = $"{component7.TotalDamageDealt:#}"; text7 = ((text7 == string.Empty) ? "0" : text7); sb.AppendFormat(text7); } else { sb.Append("0"); } } } }; private static StatFormatter CarvingBladeDamageFormatter = new StatFormatter { suffix = "", style = "cIsDamage", statFormatter = (Formatter)delegate(StringBuilder sb, float value, CharacterMaster master) { if (Object.op_Implicit((Object)(object)master.inventory)) { CarvingBlade.Statistics component6 = ((Component)master.inventory).GetComponent<CarvingBlade.Statistics>(); if (Object.op_Implicit((Object)(object)component6)) { string text6 = $"{component6.TotalDamageDealt:#}"; text6 = ((text6 == string.Empty) ? "0" : text6); sb.AppendFormat(text6); } else { sb.Append("0"); } } } }; private static StatFormatter RustedTrowelHealingFormatter = new StatFormatter { suffix = "", style = "cIsHealing", statFormatter = (Formatter)delegate(StringBuilder sb, float value, CharacterMaster master) { if (Object.op_Implicit((Object)(object)master.inventory)) { RustyTrowel.Statistics component5 = ((Component)master.inventory).GetComponent<RustyTrowel.Statistics>(); if (Object.op_Implicit((Object)(object)component5)) { string text5 = $"{component5.TotalHealingDone:#}"; text5 = ((text5 == string.Empty) ? "0" : text5); sb.AppendFormat(text5); } else { sb.Append("0"); } } } }; private static StatFormatter SoulRingRegenFormatter = new StatFormatter { suffix = "", style = "cIsHealing", statFormatter = (Formatter)delegate(StringBuilder sb, float value, CharacterMaster master) { if (Object.op_Implicit((Object)(object)master.inventory)) { SoulRing.Statistics component4 = ((Component)master.inventory).GetComponent<SoulRing.Statistics>(); if (Object.op_Implicit((Object)(object)component4)) { string text4 = $"{component4.HealthRegen:#.#}"; text4 = ((text4 == string.Empty) ? "0.0" : text4); sb.AppendFormat(text4); } else { sb.Append("0.0"); } sb.Append(" HP/s"); } } }; private static StatFormatter BloodDiceHealthFormatter = new StatFormatter { suffix = "", style = "cIsHealth", statFormatter = (Formatter)delegate(StringBuilder sb, float value, CharacterMaster master) { if (Object.op_Implicit((Object)(object)master.inventory)) { BloodDice.Statistics component3 = ((Component)master.inventory).GetComponent<BloodDice.Statistics>(); if (Object.op_Implicit((Object)(object)component3)) { string text3 = $"{component3.PermanentHealth:#}"; text3 = ((text3 == string.Empty) ? "0" : text3); sb.AppendFormat(text3); } else { sb.Append("0"); } sb.Append(" "); } } }; private static StatFormatter BrokenMaskDamageFormatter = new StatFormatter { suffix = "", style = "cIsDamage", statFormatter = (Formatter)delegate(StringBuilder sb, float value, CharacterMaster master) { if (Object.op_Implicit((Object)(object)master.inventory)) { BrokenMask.Statistics component2 = ((Component)master.inventory).GetComponent<BrokenMask.Statistics>(); if (Object.op_Implicit((Object)(object)component2)) { string text2 = $"{component2.TotalDamageDealt:#}"; text2 = ((text2 == string.Empty) ? "0" : text2); sb.AppendFormat(text2); } else { sb.Append("0"); } } } }; private static StatFormatter SpiritStoneFormatter = new StatFormatter { suffix = "", style = "cIsUtility", statFormatter = (Formatter)delegate(StringBuilder sb, float value, CharacterMaster master) { if (Object.op_Implicit((Object)(object)master.inventory)) { SpiritStone.Statistics component = ((Component)master.inventory).GetComponent<SpiritStone.Statistics>(); if (Object.op_Implicit((Object)(object)component)) { string text = $"{component.PermanentShield:#}"; text = ((text == string.Empty) ? "0" : text); sb.AppendFormat(text); } else { sb.Append("0"); } } } }; public static void RegisterItemStats() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Expected O, but got Unknown //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Expected O, but got Unknown //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Expected O, but got Unknown //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Expected O, but got Unknown //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Expected O, but got Unknown //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Expected O, but got Unknown //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Expected O, but got Unknown //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Expected O, but got Unknown //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Expected O, but got Unknown //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Expected O, but got Unknown //IL_02eb: Unknown result type (might be due to invalid IL or missing references) //IL_02fb: Expected O, but got Unknown //IL_0317: Unknown result type (might be due to invalid IL or missing references) //IL_032b: Expected O, but got Unknown //IL_0347: Unknown result type (might be due to invalid IL or missing references) //IL_0357: Expected O, but got Unknown //IL_0373: Unknown result type (might be due to invalid IL or missing references) //IL_0383: Expected O, but got Unknown //IL_039f: Unknown result type (might be due to invalid IL or missing references) //IL_03af: Expected O, but got Unknown //IL_03cb: Unknown result type (might be due to invalid IL or missing references) //IL_03db: Expected O, but got Unknown //IL_0403: Unknown result type (might be due to invalid IL or missing references) //IL_0413: Expected O, but got Unknown //IL_0434: Unknown result type (might be due to invalid IL or missing references) //IL_0444: Expected O, but got Unknown ItemStats.RegisterStat(AncientCoin.itemDef, "Gold Gain", AncientCoin.goldMultiplierAsPercent, AncientCoin.goldMultiplierAsPercent, new StackingFormula(ItemStats.LinearStacking), StatFormatter.Percent, (ItemTag)null); ItemStats.RegisterStat(AncientCoin.itemDef, "Damage Taken", AncientCoin.damageMultiplierAsPercent, AncientCoin.damageMultiplierAsPercent, new StackingFormula(ItemStats.LinearStacking), StatFormatter.Percent, (ItemTag)null); ItemStats.RegisterStat(BloodDice.itemDef, "Health Gained", 1f, 1f, (StackingFormula)null, BloodDiceHealthFormatter, (ItemTag)null); ItemStats.RegisterStat(BottleCap.itemDef, "Cooldown Reduction", BottleCap.ultimateCDRPercent, BottleCap.ultimateCDRPercent, new StackingFormula(ItemStats.HyperbolicStacking), StatFormatter.Percent, (ItemTag)null); ItemStats.RegisterStat(BreadLoaf.itemDef, "Healing On Kill", BreadLoaf.healthGainOnKillPercent, BreadLoaf.healthGainOnKillPercent, new StackingFormula(ItemStats.LinearStacking), StatFormatter.Percent, (ItemTag)null); ItemStats.RegisterStat(BrokenMask.itemDef, "Burn Damage", BrokenMask.burnDamage.Value / 100f, BrokenMask.burnDamage.Value / 100f, new StackingFormula(ItemStats.LinearStacking), StatFormatter.Percent, (ItemTag)null); ItemStats.RegisterStat(BrokenMask.itemDef, "Damage Dealt", 1f, 1f, (StackingFormula)null, BrokenMaskDamageFormatter, (ItemTag)null); ItemStats.RegisterStat(CarvingBlade.itemDef, "Damage On-Hit", CarvingBlade.multiplierPerStack, CarvingBlade.multiplierPerStack, new StackingFormula(ItemStats.HyperbolicStacking), StatFormatter.Percent, (ItemTag)null); ItemStats.RegisterStat(CarvingBlade.itemDef, "Total Damage Dealt", 1f, 1f, (StackingFormula)null, CarvingBladeDamageFormatter, (ItemTag)null); ItemStats.RegisterStat(DebitCard.itemDef, "Rebate On Purchase", DebitCard.rebatePercent, DebitCard.rebatePercent, new StackingFormula(ItemStats.HyperbolicStacking), StatFormatter.Percent, (ItemTag)null); ItemStats.RegisterStat(EdibleGlue.itemDef, "Slow Range", EdibleGlue.slowRadiusPerStack.Value, EdibleGlue.slowRadiusPerStack.Value, new StackingFormula(ItemStats.LinearStacking), StatFormatter.Range, (ItemTag)null); ItemStats.RegisterStat(Hoodie.itemDef, "Duration Bonus", Hoodie.durationIncreasePercent, Hoodie.durationIncreasePercent, new StackingFormula(ItemStats.LinearStacking), StatFormatter.Percent, (ItemTag)null); ItemStats.RegisterStat(Hoodie.itemDef, "Cooldown", Hoodie.rechargeTime.Value, Hoodie.rechargeTimeReductionPercent, new StackingFormula(ItemStats.NegativeExponentialStacking), StatFormatter.Seconds, (ItemTag)null); ItemStats.RegisterStat(GlassMarble.itemDef, "Base Damage", 1f, 1f, (StackingFormula)null, GlassMarbleBonusFormatter, (ItemTag)null); ItemStats.RegisterStat(HolyWater.itemDef, "Bonus Experience", HolyWater.experienceMultiplierAsPercent, HolyWater.experienceMultiplierAsPercent, new StackingFormula(ItemStats.HyperbolicStacking), StatFormatter.Percent, (ItemTag)null); ItemStats.RegisterStat(IronHeart.itemDef, "On-Hit Damage", 1f, 1f, (StackingFormula)null, IronHeartOnHitFormatter, (ItemTag)null); ItemStats.RegisterStat(IronHeart.itemDef, "Total Damage Dealt", 1f, 1f, (StackingFormula)null, IronHeartDamageFormatter, (ItemTag)null); ItemStats.RegisterStat(MilkCarton.itemDef, "Damage Reduction", MilkCarton.eliteDamageReductionPercent, MilkCarton.eliteDamageReductionPercent, new StackingFormula(ItemStats.HyperbolicStacking), StatFormatter.Percent, (ItemTag)null); ItemStats.RegisterStat(MagnifyingGlass.itemDef, "Analyze Chance", MagnifyingGlass.analyzeChancePercent, MagnifyingGlass.analyzeChancePercent, new StackingFormula(ItemStats.LinearStacking), StatFormatter.Percent, ItemTag.Luck); ItemStats.RegisterStat(PaperPlane.itemDef, "Movement Speed", PaperPlane.movespeedIncreasePercent, PaperPlane.movespeedIncreasePercent, new StackingFormula(ItemStats.LinearStacking), StatFormatter.Percent, (ItemTag)null); ItemStats.RegisterStat(Photodiode.itemDef, "Max Attack Speed", Photodiode.maxAttackSpeedAllowedPercent, Photodiode.maxAttackSpeedAllowedPercent, new StackingFormula(ItemStats.LinearStacking), StatFormatter.Percent, (ItemTag)null); ItemStats.RegisterStat(RedBlueGlasses.itemDef, "Crit Chance", RedBlueGlasses.critChancePercent, RedBlueGlasses.critChancePercent, new StackingFormula(ItemStats.LinearStacking), StatFormatter.Percent, (ItemTag)null); ItemStats.RegisterStat(RedBlueGlasses.itemDef, "Crit Damage", RedBlueGlasses.critDamagePercent, RedBlueGlasses.critDamagePercent, new StackingFormula(ItemStats.LinearStacking), StatFormatter.Percent, (ItemTag)null); ItemStats.RegisterStat(RubberDucky.itemDef, "Bonus Armor", (float)RubberDucky.armorPerStack.Value, (float)RubberDucky.armorPerStack.Value, new StackingFormula(ItemStats.LinearStacking), StatFormatter.Armor, (ItemTag)null); ItemStats.RegisterStat(RustyTrowel.itemDef, "Cooldown", RustyTrowel.rechargeTime.Value, RustyTrowel.rechargeTimeReductionPercent, new StackingFormula(ItemStats.NegativeExponentialStacking), StatFormatter.Seconds, (ItemTag)null); ItemStats.RegisterStat(RustyTrowel.itemDef, "Healing Done", 1f, 1f, (StackingFormula)null, RustedTrowelHealingFormatter, (ItemTag)null); ItemStats.RegisterStat(SoulRing.itemDef, "Bonus Regeneration", 1f, 1f, (StackingFormula)null, SoulRingRegenFormatter, (ItemTag)null); ItemStats.RegisterStat(SpiritStone.itemDef, "Shield Gained", 1f, 1f, (StackingFormula)null, SpiritStoneFormatter, (ItemTag)null); } } internal static void Init() { RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(BetterUIItemStats.RegisterItemStats)); } } internal class Integrations { internal static bool itemStatsEnabled; internal static void Init() { Dictionary<string, PluginInfo> pluginInfos = Chainloader.PluginInfos; if (pluginInfos.ContainsKey("com.xoxfaby.BetterUI")) { try { BetterUIIntegration.Init(); itemStatsEnabled = true; } catch (Exception data) { Log.Error(data); } } } } internal class BuffTotem { public enum Result { ARMOR, DAMAGE, ATTACK_SPEED, HEALTH_REGEN } [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static hook_PerformEquipmentAction <>9__19_0; public static StatHookEventHandler <>9__19_1; internal bool <Hooks>b__19_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); } internal void <Hooks>b__19_1(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender) && Object.op_Implicit((Object)(object)sender.inventory)) { if (sender.HasBuff(armorBuff)) { args.armorAdd += armorIncrease.Value; } if (sender.HasBuff(damageBuff)) { args.damageMultAdd += damageIncreasePercent; } if (sender.HasBuff(attackSpeedBuff)) { args.attackSpeedMultAdd += attackSpeedIncreasePercent; } if (sender.HasBuff(healthRegenBuff)) { args.baseRegenAdd += regenIncreasePercent * sender.healthComponent.fullCombinedHealth; } } } } public static EquipmentDef equipmentDef; public static BuffDef armorBuff; public static BuffDef damageBuff; public static BuffDef attackSpeedBuff; public static BuffDef healthRegenBuff; public static ConfigurableValue<float> armorIncrease = new ConfigurableValue<float>("Equipment: Totem of Prayer", "Armor Increase", 100f, "Armor increase if rolled.", new List<string> { "ITEM_BUFFTOTEM_DESC" }); public static ConfigurableValue<float> damageIncrease = new ConfigurableValue<float>("Equipment: Totem of Prayer", "Damage Increase", 30f, "Percent damage increase if rolled.", new List<string> { "ITEM_BUFFTOTEM_DESC" }); public static ConfigurableValue<float> attackSpeedIncrease = new ConfigurableValue<float>("Equipment: Totem of Prayer", "Attack Speed Increase", 75f, "Percent attack speed increase if rolled.", new List<string> { "ITEM_BUFFTOTEM_DESC" }); public static ConfigurableValue<float> regenIncrease = new ConfigurableValue<float>("Equipment: Totem of Prayer", "Health Regen Increase", 12f, "Health regeneration bonus (as max HP/s) if rolled.", new List<string> { "ITEM_BUFFTOTEM_DESC" }); public static ConfigurableValue<float> buffDuration = new ConfigurableValue<float>("Equipment: Totem of Prayer", "Buff Duration", 12f, "Duration of the buff given.", new List<string> { "ITEM_BUFFTOTEM_DESC" }); public static ConfigurableValue<int> equipCooldown = new ConfigurableValue<int>("Equipment: Totem of Prayer", "Cooldown", 55, "Equipment cooldown.", new List<string> { "ITEM_BUFFTOTEM_DESC" }); public static float damageIncreasePercent = damageIncrease.Value / 100f; public static float attackSpeedIncreasePercent = attackSpeedIncrease.Value / 100f; public static float regenIncreasePercent = regenIncrease.Value / 100f; public static Result lastBuffGiven = Result.ARMOR; internal static void Init() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown GenerateEquipment(); GenerateBuff(); AddTokens(); ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null); ItemAPI.Add(new CustomEquipment(equipmentDef, val)); ContentAddition.AddBuffDef(armorBuff); ContentAddition.AddBuffDef(damageBuff); ContentAddition.AddBuffDef(attackSpeedBuff); ContentAddition.AddBuffDef(healthRegenBuff); Hooks(); } private static void GenerateEquipment() { equipmentDef = ScriptableObject.CreateInstance<EquipmentDef>(); ((Object)equipmentDef).name = "BUFF_TOTEM"; equipmentDef.nameToken = "BUFF_TOTEM_NAME"; equipmentDef.pickupToken = "BUFF_TOTEM_PICKUP"; equipmentDef.descriptionToken = "BUFF_TOTEM_DESCRIPTION"; equipmentDef.loreToken = "BUFF_TOTEM_LORE"; equipmentDef.pickupIconSprite = Assets.bundle.LoadAsset<Sprite>("BuffTotem.png"); equipmentDef.pickupModelPrefab = Assets.bundle.LoadAsset<GameObject>("BuffTotem.prefab"); equipmentDef.appearsInMultiPlayer = true; equipmentDef.appearsInSinglePlayer = true; equipmentDef.canBeRandomlyTriggered = true; equipmentDef.enigmaCompatible = true; equipmentDef.canDrop = true; equipmentDef.cooldown = equipCooldown.Value; } private static void GenerateBuff() { armorBuff = ScriptableObject.CreateInstance<BuffDef>(); ((Object)armorBuff).name = "Prayer of Defense"; armorBuff.iconSprite = Assets.bundle.LoadAsset<Sprite>("DefensePrayer.png"); armorBuff.canStack = false; armorBuff.isHidden = false; armorBuff.isDebuff = false; armorBuff.isCooldown = false; damageBuff = ScriptableObject.CreateInstance<BuffDef>(); ((Object)damageBuff).name = "Prayer of Power"; damageBuff.iconSprite = Assets.bundle.LoadAsset<Sprite>("DamagePrayer.png"); damageBuff.canStack = false; damageBuff.isHidden = false; damageBuff.isDebuff = false; damageBuff.isCooldown = false; attackSpeedBuff = ScriptableObject.CreateInstance<BuffDef>(); ((Object)attackSpeedBuff).name = "Prayer of Cadence"; attackSpeedBuff.iconSprite = Assets.bundle.LoadAsset<Sprite>("CadencePrayer.png"); attackSpeedBuff.canStack = false; attackSpeedBuff.isHidden = false; attackSpeedBuff.isDebuff = false; attackSpeedBuff.isCooldown = false; healthRegenBuff = ScriptableObject.CreateInstance<BuffDef>(); ((Object)healthRegenBuff).name = "Prayer of Remedy"; healthRegenBuff.iconSprite = Assets.bundle.LoadAsset<Sprite>("RemedyPrayer.png"); healthRegenBuff.canStack = false; healthRegenBuff.isHidden = false; healthRegenBuff.isDebuff = false; healthRegenBuff.isCooldown = false; } 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 object obj = <>c.<>9__19_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__19_0 = val; obj = (object)val; } EquipmentSlot.PerformEquipmentAction += (hook_PerformEquipmentAction)obj; object obj2 = <>c.<>9__19_1; if (obj2 == null) { StatHookEventHandler val2 = delegate(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender) && Object.op_Implicit((Object)(object)sender.inventory)) { if (sender.HasBuff(armorBuff)) { args.armorAdd += armorIncrease.Value; } if (sender.HasBuff(damageBuff)) { args.damageMultAdd += damageIncreasePercent; } if (sender.HasBuff(attackSpeedBuff)) { args.attackSpeedMultAdd += attackSpeedIncreasePercent; } if (sender.HasBuff(healthRegenBuff)) { args.baseRegenAdd += regenIncreasePercent * sender.healthComponent.fullCombinedHealth; } } }; <>c.<>9__19_1 = val2; obj2 = (object)val2; } RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)obj2; } private static bool OnUse(EquipmentSlot slot) { CharacterBody characterBody = slot.characterBody; Array values = Enum.GetValues(typeof(Result)); Result result; for (result = (Result)values.GetValue(TooManyItems.rand.Next(values.Length)); result == lastBuffGiven; result = (Result)values.GetValue(TooManyItems.rand.Next(values.Length))) { } lastBuffGiven = result; switch (result) { case Result.ARMOR: characterBody.AddTimedBuff(armorBuff, buffDuration.Value); break; case Result.DAMAGE: characterBody.AddTimedBuff(damageBuff, buffDuration.Value); break; case Result.ATTACK_SPEED: characterBody.AddTimedBuff(attackSpeedBuff, buffDuration.Value); break; case Result.HEALTH_REGEN: characterBody.AddTimedBuff(healthRegenBuff, buffDuration.Value); break; } Utils.ForceRecalculate(characterBody); return true; } private static void AddTokens() { LanguageAPI.Add("BUFF_TOTEM", "Totem of Prayer"); LanguageAPI.Add("BUFF_TOTEM_NAME", "Totem of Prayer"); LanguageAPI.Add("BUFF_TOTEM_PICKUP", "Pray to the totem to receive a random buff."); string text = "On activation, permanently gain " + $"<style=cIsUtility>{armorIncrease.Value}</style> armor, " + $"<style=cIsDamage>{damageIncrease.Value}%</style> damage, " + $"<style=cIsUtility>{attackSpeedIncrease.Value}%</style> attack speed, " + $"or <style=cIsHealing>{regenIncrease.Value}% max HP/s</style> regeneration " + $"for {buffDuration.Value} seconds."; LanguageAPI.Add("BUFF_TOTEM_DESCRIPTION", text); string text2 = ""; LanguageAPI.Add("BUFF_TOTEM_LORE", text2); } } internal class Chalice { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static hook_PerformEquipmentAction <>9__11_0; public static hook_GetHealthBarValues <>9__11_1; public static StatHookEventHandler <>9__11_2; internal bool <Hooks>b__11_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); } internal HealthBarValues <Hooks>b__11_1(orig_GetHealthBarValues orig, HealthComponent self) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0084: 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) HealthBarValues val = orig.Invoke(self); if (Object.op_Implicit((Object)(object)self.body) && self.body.HasBuff(consecratedBuff)) { val.curseFraction += (1f - val.curseFraction) * consecrateMaxHealthLost.Value / 100f; val.healthFraction = self.health * (1f - val.curseFraction) / self.fullCombinedHealth; val.shieldFraction = self.shield * (1f - val.curseFraction) / self.fullCombinedHealth; } return val; } internal void <Hooks>b__11_2(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender) && Object.op_Implicit((Object)(object)sender.inventory) && sender.HasBuff(consecratedBuff)) { args.healthMultAdd -= consecrateMaxHealthLost.Value / 100f; args.attackSpeedMultAdd += consecrateAttackSpeedBonus.Value / 100f; args.damageMultAdd += consecrateDamageBonus.Value / 100f; } } } public static EquipmentDef equipmentDef; public static BuffDef consecratedBuff; public static DamageColorIndex damageColor = DamageColorAPI.RegisterDamageColor(new Color(0.55f, 0.12f, 0.09f, 1f)); public static ConfigurableValue<float> consecrateDuration = new ConfigurableValue<float>("Equipment: Chalice", "Consecrate Duration", 8f, "Duration of the Consecrate buff given.", new List<string> { "ITEM_CHALICE_DESC" }); public static ConfigurableValue<float> consecrateDamageBonus = new ConfigurableValue<float>("Equipment: Chalice", "Consecrate Damage Bonus", 40f, "Percent bonus damage dealt while Consecrated.", new List<string> { "ITEM_CHALICE_DESC" }); public static ConfigurableValue<float> consecrateAttackSpeedBonus = new ConfigurableValue<float>("Equipment: Chalice", "Consecrate Attack Speed Bonus", 110f, "Percent bonus attack speed gained while Consecrated.", new List<string> { "ITEM_CHALICE_DESC" }); public static ConfigurableValue<float> consecrateMaxHealthLost = new ConfigurableValue<float>("Equipment: Chalice", "Max Health Loss", 50f, "Percent of max health lost when Consecrated.", new List<string> { "ITEM_CHALICE_DESC" }); public static ConfigurableValue<int> equipCooldown = new ConfigurableValue<int>("Equipment: Chalice", "Cooldown", 60, "Equipment cooldown.", new List<string> { "ITEM_CHALICE_DESC" }); internal static void Init() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown GenerateEquipment(); GenerateBuff(); AddTokens(); ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null); ItemAPI.Add(new CustomEquipment(equipmentDef, val)); ContentAddition.AddBuffDef(consecratedBuff); Hooks(); } private static void GenerateEquipment() { //IL_009a: Unknown result type (might be due to invalid IL or missing references) equipmentDef = ScriptableObject.CreateInstance<EquipmentDef>(); ((Object)equipmentDef).name = "CHALICE"; equipmentDef.nameToken = "CHALICE_NAME"; equipmentDef.pickupToken = "CHALICE_PICKUP"; equipmentDef.descriptionToken = "CHALICE_DESCRIPTION"; equipmentDef.loreToken = "CHALICE_LORE"; equipmentDef.pickupIconSprite = Assets.bundle.LoadAsset<Sprite>("Chalice.png"); equipmentDef.pickupModelPrefab = Assets.bundle.LoadAsset<GameObject>("Chalice.prefab"); equipmentDef.isLunar = true; equipmentDef.colorIndex = (ColorIndex)4; equipmentDef.appearsInMultiPlayer = true; equipmentDef.appearsInSinglePlayer = true; equipmentDef.canBeRandomlyTriggered = true; equipmentDef.enigmaCompatible = true; equipmentDef.canDrop = true; equipmentDef.cooldown = equipCooldown.Value; } private static void GenerateBuff() { consecratedBuff = ScriptableObject.CreateInstance<BuffDef>(); ((Object)consecratedBuff).name = "Consecrated"; consecratedBuff.iconSprite = Assets.bundle.LoadAsset<Sprite>("ConsecratedBuff.png"); consecratedBuff.canStack = false; consecratedBuff.isHidden = false; consecratedBuff.isDebuff = false; consecratedBuff.isCooldown = false; } 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 object obj = <>c.<>9__11_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__11_0 = val; obj = (object)val; } EquipmentSlot.PerformEquipmentAction += (hook_PerformEquipmentAction)obj; object obj2 = <>c.<>9__11_1; if (obj2 == null) { hook_GetHealthBarValues val2 = delegate(orig_GetHealthBarValues orig, HealthComponent self) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0084: 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) HealthBarValues val4 = orig.Invoke(self); if (Object.op_Implicit((Object)(object)self.body) && self.body.HasBuff(consecratedBuff)) { val4.curseFraction += (1f - val4.curseFraction) * consecrateMaxHealthLost.Value / 100f; val4.healthFraction = self.health * (1f - val4.curseFraction) / self.fullCombinedHealth; val4.shieldFraction = self.shield * (1f - val4.curseFraction) / self.fullCombinedHealth; } return val4; }; <>c.<>9__11_1 = val2; obj2 = (object)val2; } HealthComponent.GetHealthBarValues += (hook_GetHealthBarValues)obj2; object obj3 = <>c.<>9__11_2; if (obj3 == null) { StatHookEventHandler val3 = delegate(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender) && Object.op_Implicit((Object)(object)sender.inventory) && sender.HasBuff(consecratedBuff)) { args.healthMultAdd -= consecrateMaxHealthLost.Value / 100f; args.attackSpeedMultAdd += consecrateAttackSpeedBonus.Value / 100f; args.damageMultAdd += consecrateDamageBonus.Value / 100f; } }; <>c.<>9__11_2 = val3; obj3 = (object)val3; } RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)obj3; } private static bool OnUse(EquipmentSlot slot) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)slot.characterBody)) { foreach (TeamComponent teamMember in TeamComponent.GetTeamMembers(slot.characterBody.teamComponent.teamIndex)) { teamMember.body.AddTimedBuff(consecratedBuff, consecrateDuration.Value); } } return true; } private static void AddTokens() { LanguageAPI.Add("CHALICE", "Chalice"); LanguageAPI.Add("CHALICE_NAME", "Chalice"); LanguageAPI.Add("CHALICE_PICKUP", "Consecrate all allies for a short duration. Consecrated allies gain bonus damage and attack speed, but lose max health."); string text = "Consecrate yourself and all allies. Consecrated allies gain " + $"<style=cIsDamage>{consecrateDamageBonus.Value}%</style> damage and " + $"<style=cIsUtility>{consecrateAttackSpeedBonus.Value}%</style> attack speed for " + $"<style=cIsUtility>{consecrateDuration.Value}</style> seconds, " + $"<style=cDeath>but lose {consecrateMaxHealthLost.Value}% max health.</style>"; LanguageAPI.Add("CHALICE_DESCRIPTION", text); string text2 = ""; LanguageAPI.Add("CHALICE_LORE", text2); } } internal class TatteredScroll { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static hook_PerformEquipmentAction <>9__11_0; public static hook_OnCharacterDeath <>9__11_1; internal bool <Hooks>b__11_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); } internal void <Hooks>b__11_1(orig_OnCharacterDeath orig, GlobalEventManager eventManager, DamageReport damageReport) { orig.Invoke(eventManager, damageReport); if (NetworkServer.active && Object.op_Implicit((Object)(object)damageReport.victimBody) && damageReport.victimBody.HasBuff(curseDebuff) && Object.op_Implicit((Object)(object)damageReport.attackerMaster)) { damageReport.attackerMaster.GiveMoney(Convert.ToUInt32(goldGranted.Value)); } } } public static EquipmentDef equipmentDef; public static BuffDef curseDebuff; public static Color siphonColor = new Color(0.902f, 0.78f, 0.573f, 1f); public static DamageColorIndex damageColor = DamageColorAPI.RegisterDamageColor(siphonColor); public static ConfigurableValue<int> curseDistance = new ConfigurableValue<int>("Equipment: Tattered Scroll", "Curse Distance", 60, "Max distance that the curse can reach.", new List<string> { "ITEM_TATTEREDSCROLL_DESC" }); public static ConfigurableValue<float> curseDuration = new ConfigurableValue<float>("Equipment: Tattered Scroll", "Curse Duration", 12f, "Duration of the curse.", new List<string> { "ITEM_TATTEREDSCROLL_DESC" }); public static ConfigurableValue<int> goldGranted = new ConfigurableValue<int>("Equipment: Tattered Scroll", "Gold Granted", 25, "Gold gained for each cursed enemy killed.", new List<string> { "ITEM_TATTEREDSCROLL_DESC" }); public static ConfigurableValue<int> equipCooldown = new ConfigurableValue<int>("Equipment: Tattered Scroll", "Cooldown", 75, "Equipment cooldown.", new List<string> { "ITEM_TATTEREDSCROLL_DESC" }); internal static void Init() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown GenerateEquipment(); GenerateBuff(); AddTokens(); ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null); ItemAPI.Add(new CustomEquipment(equipmentDef, val)); ContentAddition.AddBuffDef(curseDebuff); Hooks(); } private static void GenerateEquipment() { equipmentDef = ScriptableObject.CreateInstance<EquipmentDef>(); ((Object)equipmentDef).name = "TATTERED_SCROLL"; equipmentDef.nameToken = "TATTERED_SCROLL_NAME"; equipmentDef.pickupToken = "TATTERED_SCROLL_PICKUP"; equipmentDef.descriptionToken = "TATTERED_SCROLL_DESCRIPTION"; equipmentDef.loreToken = "TATTERED_SCROLL_LORE"; equipmentDef.pickupIconSprite = Assets.bundle.LoadAsset<Sprite>("TatteredScroll.png"); equipmentDef.pickupModelPrefab = Assets.bundle.LoadAsset<GameObject>("TatteredScroll.prefab"); equipmentDef.appearsInMultiPlayer = true; equipmentDef.appearsInSinglePlayer = true; equipmentDef.canBeRandomlyTriggered = true; equipmentDef.enigmaCompatible = true; equipmentDef.canDrop = true; equipmentDef.cooldown = equipCooldown.Value; } private static void GenerateBuff() { curseDebuff = ScriptableObject.CreateInstance<BuffDef>(); ((Object)curseDebuff).name = "Siphon"; curseDebuff.iconSprite = Assets.bundle.LoadAsset<Sprite>("TatteredCurse.png"); curseDebuff.canStack = false; curseDebuff.isHidden = false; curseDebuff.isDebuff = true; curseDebuff.isCooldown = false; } 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 object obj = <>c.<>9__11_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__11_0 = val; obj = (object)val; } EquipmentSlot.PerformEquipmentAction += (hook_PerformEquipmentAction)obj; object obj2 = <>c.<>9__11_1; if (obj2 == null) { hook_OnCharacterDeath val2 = delegate(orig_OnCharacterDeath orig, GlobalEventManager eventManager, DamageReport damageReport) { orig.Invoke(eventManager, damageReport); if (NetworkServer.active && Object.op_Implicit((Object)(object)damageReport.victimBody) && damageReport.victimBody.HasBuff(curseDebuff) && Object.op_Implicit((Object)(object)damageReport.attackerMaster)) { damageReport.attackerMaster.GiveMoney(Convert.ToUInt32(goldGranted.Value)); } }; <>c.<>9__11_1 = val2; obj2 = (object)val2; } GlobalEventManager.OnCharacterDeath += (hook_OnCharacterDeath)obj2; } private static bool OnUse(EquipmentSlot slot) { //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_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_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_00a1: 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_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Expected O, but got Unknown HurtBox[] hurtBoxes = new SphereSearch { mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask, origin = slot.characterBody.corePosition, queryTriggerInteraction = (QueryTriggerInteraction)2, radius = curseDistance.Value }.RefreshCandidates().FilterCandidatesByDistinctHurtBoxEntities().GetHurtBoxes(); HurtBox[] array = hurtBoxes; foreach (HurtBox val in array) { CharacterBody body = val.healthComponent.body; if (Object.op_Implicit((Object)(object)body) && (Object)(object)body != (Object)(object)slot.characterBody && !body.isPlayerControlled) { body.healthComponent.TakeDamage(new DamageInfo { damage = slot.characterBody.damage, attacker = ((Component)slot.characterBody).gameObject, inflictor = ((Component)slot.characterBody).gameObject, procCoefficient = 0f, position = body.corePosition, crit = false, damageColorIndex = damageColor, procChainMask = default(ProcChainMask), damageType = (DamageType)2048 }); body.AddTimedBuff(curseDebuff, curseDuration.Value); } } return true; } private static void AddTokens() { LanguageAPI.Add("TATTERED_SCROLL", "Tattered Scroll"); LanguageAPI.Add("TATTERED_SCROLL_NAME", "Tattered Scroll"); LanguageAPI.Add("TATTERED_SCROLL_PICKUP", "Curse nearby enemies when activated. Killing cursed enemies grants extra gold."); string text = $"On activation, curse enemies within a <style=cIsUtility>{curseDistance.Value}m</style> radius for {curseDuration.Value} seconds. " + $"Killing cursed enemies grants <style=cIsUtility>{goldGranted.Value}</style> extra gold."; LanguageAPI.Add("TATTERED_SCROLL_DESCRIPTION", text); string text2 = ""; LanguageAPI.Add("TATTERED_SCROLL_LORE", text2); } } internal class AncientCoin { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Action <>9__6_0; public static GenericGameEvents.DamageAttackerVictimEventHandler <>9__7_0; public static hook_GiveMoney <>9__7_1; internal void <GenerateItem>b__6_0() { if (Object.op_Implicit((Object)(object)itemDef)) { itemDef.tier = (ItemTier)3; } } internal void <Hooks>b__7_0(DamageInfo damageInfo, TooManyItems.GenericCharacterInfo attackerInfo, TooManyItems.GenericCharacterInfo victimInfo) { if (!((Object)(object)victimInfo.inventory == (Object)null) && !((Object)(object)victimInfo.body == (Object)null)) { int itemCount = victimInfo.inventory.GetItemCount(itemDef); if (itemCount > 0) { damageInfo.damage *= 1f + (float)itemCount * damageMultiplierAsPercent; } } } internal void <Hooks>b__7_1(orig_GiveMoney orig, CharacterMaster self, uint amount) { if (!((Object)(object)self.inventory == (Object)null)) { int itemCount = self.inventory.GetItemCount(itemDef); if (itemCount > 0) { float num = 1f + (float)itemCount * goldMultiplierAsPercent; amount = Convert.ToUInt32((float)amount * num); } orig.Invoke(self, amount); } } } public static ItemDef itemDef; public static ConfigurableValue<float> goldMultiplierPerStack = new ConfigurableValue<float>("Item: Ancient Coin", "Gold Multiplier", 100f, "Gold generation increase as a percentage.", new List<string> { "ITEM_ANCIENTCOIN_DESC" }); public static ConfigurableValue<float> damageMultiplierPerStack = new ConfigurableValue<float>("Item: Ancient Coin", "Damage Multiplier", 25f, "Damage taken increase as a percentage.", new List<string> { "ITEM_ANCIENTCOIN_DESC" }); public static float goldMultiplierAsPercent = goldMultiplierPerStack.Value / 100f; public static float damageMultiplierAsPercent = damageMultiplierPerStack.Value / 100f; internal static void Init() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown GenerateItem(); AddTokens(); ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null); ItemAPI.Add(new CustomItem(itemDef, val)); Hooks(); } private static void GenerateItem() { itemDef = ScriptableObject.CreateInstance<ItemDef>(); ((Object)itemDef).name = "ANCIENT_COIN"; itemDef.nameToken = "ANCIENT_COIN_NAME"; itemDef.pickupToken = "ANCIENT_COIN_PICKUP"; itemDef.descriptionToken = "ANCIENT_COIN_DESCRIPTION"; itemDef.loreToken = "ANCIENT_COIN_LORE"; ((ResourceAvailability)(ref ItemTierCatalog.availability)).CallWhenAvailable((Action)delegate { if (Object.op_Implicit((Object)(object)itemDef)) { itemDef.tier = (ItemTier)3; } }); itemDef.pickupIconSprite = Assets.bundle.LoadAsset<Sprite>("AncientCoin.png"); itemDef.pickupModelPrefab = Assets.bundle.LoadAsset<GameObject>("AncientCoin.prefab"); itemDef.canRemove = true; itemDef.hidden = false; } 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 GenericGameEvents.BeforeTakeDamage += delegate(DamageInfo damageInfo, TooManyItems.GenericCharacterInfo attackerInfo, TooManyItems.GenericCharacterInfo victimInfo) { if (!((Object)(object)victimInfo.inventory == (Object)null) && !((Object)(object)victimInfo.body == (Object)null)) { int itemCount2 = victimInfo.inventory.GetItemCount(itemDef); if (itemCount2 > 0) { damageInfo.damage *= 1f + (float)itemCount2 * damageMultiplierAsPercent; } } }; object obj = <>c.<>9__7_1; if (obj == null) { hook_GiveMoney val = delegate(orig_GiveMoney orig, CharacterMaster self, uint amount) { if (!((Object)(object)self.inventory == (Object)null)) { int itemCount = self.inventory.GetItemCount(itemDef); if (itemCount > 0) { float num = 1f + (float)itemCount * goldMultiplierAsPercent; amount = Convert.ToUInt32((float)amount * num); } orig.Invoke(self, amount); } }; <>c.<>9__7_1 = val; obj = (object)val; } CharacterMaster.GiveMoney += (hook_GiveMoney)obj; } private static void AddTokens() { LanguageAPI.Add("ANCIENT_COIN", "Ancient Coin"); LanguageAPI.Add("ANCIENT_COIN_NAME", "Ancient Coin"); LanguageAPI.Add("ANCIENT_COIN_PICKUP", "Gain more gold. <style=cDeath>Take more damage.</style>"); string text = $"Gain <style=cIsUtility>{goldMultiplierPerStack.Value}%</style> <style=cStack>(+{goldMultiplierPerStack.Value}% per stack)</style> more gold. " + $"<style=cDeath>Take {damageMultiplierPerStack.Value}% <style=cStack>(+{damageMultiplierPerStack.Value}% per stack)</style> more damage.</style>"; LanguageAPI.Add("ANCIENT_COIN_DESCRIPTION", text); string text2 = ""; LanguageAPI.Add("ANCIENT_COIN_LORE", text2); } } internal class CarvingBlade { public class Statistics : MonoBehaviour { public class Sync : INetMessage, ISerializableObject { private NetworkInstanceId objId; private float totalDamageDealt; public Sync() { } public Sync(NetworkInstanceId objId, float totalDamage) { //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; totalDamageDealt = totalDamage; } 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(); totalDamageDealt = 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<Statistics>(); if ((Object)(object)component != (Object)null) { component.TotalDamageDealt = totalDamageDealt; } } } public void Serialize(NetworkWriter writer) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) writer.Write(objId); writer.Write(totalDamageDealt); } } private float _totalDamageDealt; public float TotalDamageDealt { get { return _totalDamageDealt; } set { //IL_001d: Unknown result type (might be due to invalid IL or missing references) _totalDamageDealt = value; if (NetworkServer.active) { NetMessageExtensions.Send((INetMessage)(object)new Sync(((Component)this).gameObject.GetComponent<NetworkIdentity>().netId, value), (NetworkDestination)1); } } } } [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Action <>9__8_0; public static Action<CharacterMaster> <>9__10_0; public static GenericGameEvents.DamageAttackerVictimEventHandler <>9__10_1; public static hook_OnHitEnemy <>9__10_2; internal void <GenerateItem>b__8_0() { if (Object.op_Implicit((Object)(object)itemDef)) { itemDef.tier = (ItemTier)3; } } internal void <Hooks>b__10_0(CharacterMaster obj) { Inventory inventory = obj.inventory; if (inventory != null) { ((Component)inventory).gameObject.AddComponent<Statistics>(); } } internal void <Hooks>b__10_1(DamageInfo damageInfo, TooManyItems.GenericCharacterInfo attackerInfo, TooManyItems.GenericCharacterInfo victimInfo) { if (!((Object)(object)attackerInfo.inventory == (Object)null) && attackerInfo.inventory.GetItemCount(itemDef) > 0) { damageInfo.crit = false; } } internal void <Hooks>b__10_2(orig_OnHitEnemy orig, GlobalEventManager self, DamageInfo damageInfo, GameObject victim) { //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Expected O, but got Unknown //IL_0145: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, damageInfo, victim); if (!NetworkServer.active || (Object)(object)damageInfo.attacker == (Object)null || (Object)(object)victim == (Object)null) { return; } CharacterBody val = damageInfo.attacker.GetComponent<CharacterBody>(); CharacterBody component = victim.GetComponent<CharacterBody>(); if (!((Object)(object)val != (Object)null) || !((Object)(object)val.inventory != (Object)null)) { return; } int itemCount = val.inventory.GetItemCount(itemDef); if (itemCount > 0) { float num = CalculateDamageOnHit(component, itemCount); if ((float)damageCapMultiplier > 0f) { num = Mathf.Min(num, val.damage * (float)damageCapMultiplier); } DamageInfo val2 = new DamageInfo { damage = num, attacker = damageInfo.attacker.gameObject, inflictor = damageInfo.attacker.gameObject, procCoefficient = 0f, position = damageInfo.position, crit = false, damageColorIndex = damageColor, procChainMask = damageInfo.procChainMask, damageType = (DamageType)2048 }; DamageAPI.AddModdedDamageType(val2, damageType); component.healthComponent.TakeDamage(val2); if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.master) && Object.op_Implicit((Object)(object)val.master.minionOwnership) && Object.op_Implicit((Object)(object)val.master.minionOwnership.ownerMaster) && Object.op_Implicit((Object)(object)val.master.minionOwnership.ownerMaster.GetBody())) { val = val.master.minionOwnership.ownerMaster.GetBody(); } ((Component)val.inventory).GetComponent<Statistics>().TotalDamageDealt += num; } } } public static ItemDef itemDef; public static ModdedDamageType damageType; public static DamageColorIndex damageColor = DamageColorAPI.RegisterDamageColor(new Color(0.09f, 0.67f, 0.42f, 1f)); public static ConfigurableValue<float> percentDamagePerStack = new ConfigurableValue<float>("Item: Carving Blade", "On-Hit Damage Scaling", 1f, "Percent of enemy's current health dealt as bonus on-hit damage.", new List<string> { "ITEM_CARVINGBLADE_DESC" }); public static ConfigurableValue<float> damageCapMultiplier = new ConfigurableValue<float>("Item: Carving Blade", "Damage Cap", 200f, "Maximum damage on-hit. This value is multiplied by the user's base damage.\nSet this value to -1 to remove the cap.", new List<string> { "ITEM_CARVINGBLADE_DESC" }); public static float multiplierPerStack = percentDamagePerStack.Value / 100f; internal static void Init() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_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) GenerateItem(); AddTokens(); ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null); ItemAPI.Add(new CustomItem(itemDef, val)); NetworkingAPI.RegisterMessageType<Statistics.Sync>(); damageType = DamageAPI.ReserveDamageType(); Hooks(); } private static void GenerateItem() { itemDef = ScriptableObject.CreateInstance<ItemDef>(); ((Object)itemDef).name = "CARVING_BLADE"; itemDef.nameToken = "CARVING_BLADE_NAME"; itemDef.pickupToken = "CARVING_BLADE_PICKUP"; itemDef.descriptionToken = "CARVING_BLADE_DESCRIPTION"; itemDef.loreToken = "CARVING_BLADE_LORE"; ((ResourceAvailability)(ref ItemTierCatalog.availability)).CallWhenAvailable((Action)delegate { if (Object.op_Implicit((Object)(object)itemDef)) { itemDef.tier = (ItemTier)3; } }); itemDef.pickupIconSprite = Assets.bundle.LoadAsset<Sprite>("CarvingBlade.png"); itemDef.pickupModelPrefab = Assets.bundle.LoadAsset<GameObject>("CarvingBlade.prefab"); itemDef.canRemove = true; itemDef.hidden = false; } public static float CalculateDamageOnHit(CharacterBody sender, float itemCount) { float num = 1f - 1f / (1f + multiplierPerStack * itemCount); return sender.healthComponent.health * num; } 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 CharacterMaster.onStartGlobal += delegate(CharacterMaster obj) { Inventory inventory = obj.inventory; if (inventory != null) { ((Component)inventory).gameObject.AddComponent<Statistics>(); } }; GenericGameEvents.BeforeTakeDamage += delegate(DamageInfo damageInfo, TooManyItems.GenericCharacterInfo attackerInfo, TooManyItems.GenericCharacterInfo victimInfo) { if (!((Object)(object)attackerInfo.inventory == (Object)null) && attackerInfo.inventory.GetItemCount(itemDef) > 0) { damageInfo.crit = false; } }; object obj2 = <>c.<>9__10_2; if (obj2 == null) { hook_OnHitEnemy val = delegate(orig_OnHitEnemy orig, GlobalEventManager self, DamageInfo damageInfo, GameObject victim) { //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Expected O, but got Unknown //IL_0145: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, damageInfo, victim); if (NetworkServer.active && !((Object)(object)damageInfo.attacker == (Object)null) && !((Object)(object)victim == (Object)null)) { CharacterBody val2 = damageInfo.attacker.GetComponent<CharacterBody>(); CharacterBody component = victim.GetComponent<CharacterBody>(); if ((Object)(object)val2 != (Object)null && (Object)(object)val2.inventory != (Object)null) { int itemCount = val2.inventory.GetItemCount(itemDef); if (itemCount > 0) { float num = CalculateDamageOnHit(component, itemCount); if ((float)damageCapMultiplier > 0f) { num = Mathf.Min(num, val2.damage * (float)damageCapMultiplier); } DamageInfo val3 = new DamageInfo { damage = num, attacker = damageInfo.attacker.gameObject, inflictor = damageInfo.attacker.gameObject, procCoefficient = 0f, position = damageInfo.position, crit = false, damageColorIndex = damageColor, procChainMask = damageInfo.procChainMask, damageType = (DamageType)2048 }; DamageAPI.AddModdedDamageType(val3, damageType); component.healthComponent.TakeDamage(val3); if (Object.op_Implicit((Object)(object)val2) && Object.op_Implicit((Object)(object)val2.master) && Object.op_Implicit((Object)(object)val2.master.minionOwnership) && Object.op_Implicit((Object)(object)val2.master.minionOwnership.ownerMaster) && Object.op_Implicit((Object)(object)val2.master.minionOwnership.ownerMaster.GetBody())) { val2 = val2.master.minionOwnership.ownerMaster.GetBody(); } ((Component)val2.inventory).GetComponent<Statistics>().TotalDamageDealt += num; } } } }; <>c.<>9__10_2 = val; obj2 = (object)val; } GlobalEventManager.OnHitEnemy += (hook_OnHitEnemy)obj2; } private static void AddTokens() { LanguageAPI.Add("CARVING_BLADE", "Carving Blade"); LanguageAPI.Add("CARVING_BLADE_NAME", "Carving Blade"); LanguageAPI.Add("CARVING_BLADE_PICKUP", "Deal bonus damage on-hit based on the enemy's current health. <style=cDeath>You cannot critically strike.</style>"); string text = $"Deal <style=cIsDamage>{percentDamagePerStack.Value}%</style> <style=cStack>(+{percentDamagePerStack.Value}% per stack)</style> of enemy current health as bonus on-hit damage. " + "<style=cDeath>You cannot critically strike.</style>"; LanguageAPI.Add("CARVING_BLADE_DESCRIPTION", text); string text2 = ""; LanguageAPI.Add("CARVING_BLADE_LORE", text2); } } internal class Crucifix { public static ItemDef itemDef; public static ConfigurableValue<float> damageReduction = new ConfigurableValue<float>("Item: Crucifix", "Damage Reduction", 40f, "Percentage of damage reduced.", new List<string> { "ITEM_CRUCIFIX_DESC" }); public static ConfigurableValue<float> maxHealthBurnAmount = new ConfigurableValue<float>("Item: Crucifix", "Burn Amount", 5f, "Percentage of max health taken over the duration of the burn.", new List<string> { "ITEM_CRUCIFIX_DESC" }); public static ConfigurableValue<int> fireDuration = new ConfigurableValue<int>("Item: Crucifix", "Duration of Fire", 3, "Duration of fire debuff when taking damage.", new List<string> { "ITEM_CRUCIFIX_DESC" }); public static float damageReductionPercent = damageReduction.Value / 100f; internal static void Init() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown GenerateItem(); AddTokens(); ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null); ItemAPI.Add(new CustomItem(itemDef, val)); Hooks(); } private static void GenerateItem() { itemDef = ScriptableObject.CreateInstance<ItemDef>(); ((Object)itemDef).name = "CRUCIFIX"; itemDef.nameToken = "CRUCIFIX_NAME"; itemDef.pickupToken = "CRUCIFIX_PICKUP"; itemDef.descriptionToken = "CRUCIFIX_DESCRIPTION"; itemDef.loreToken = "CRUCIFIX_LORE"; ((ResourceAvailability)(ref ItemTierCatalog.availability)).CallWhenAvailable((Action)delegate { if (Object.op_Implicit((Object)(object)itemDef)) { itemDef.tier = (ItemTier)3; } }); itemDef.pickupIconSprite = Assets.bundle.LoadAsset<Sprite>("ProfaneCrucifix.png"); itemDef.pickupModelPrefab = Assets.bundle.LoadAsset<GameObject>("ProfaneCrucifix.prefab"); itemDef.canRemove = true; itemDef.hidden = false; } public static void Hooks() { GenericGameEvents.BeforeTakeDamage += delegate(DamageInfo damageInfo, TooManyItems.GenericCharacterInfo attackerInfo, TooManyItems.GenericCharacterInfo victimInfo) { //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)victimInfo.inventory == (Object)null) && !((Object)(object)victimInfo.body == (Object)null) && !((Object)(object)attackerInfo.body == (Object)null) && victimInfo.inventory.GetItemCount(itemDef) > 0 && (Object)(object)attackerInfo.body != (Object)(object)victimInfo.body) { damageInfo.damage *= 1f - damageReductionPercent; InflictDotInfo val = default(InflictDotInfo); val.victimObject = ((Component)victimInfo.body).gameObject; val.attackerObject = ((Component)victimInfo.body).gameObject; val.totalDamage = victimInfo.body.healthComponent.fullCombinedHealth * maxHealthBurnAmount.Value / 100f; val.dotIndex = (DotIndex)1; val.duration = fireDuration.Value; val.damageMultiplier = 1f; InflictDotInfo val2 = val; DotController.InflictDot(ref val2); } }; } private static void AddTokens() { LanguageAPI.Add("CRUCIFIX", "Crucifix"); LanguageAPI.Add("CRUCIFIX_NAME", "Crucifix"); LanguageAPI.Add("CRUCIFIX_PICKUP", "Reduce damage taken. <style=cDeath>Taking damage sets you on fire.</style>"); string text = $"Reduce damage taken by <style=cIsUtility>{damageReduction.Value}%</style>. " + "<style=cDeath>Taking damage sets you on fire for " + $"{maxHealthBurnAmount.Value}% max health over {fireDuration.Value} seconds.</style>"; LanguageAPI.Add("CRUCIFIX_DESCRIPTION", text); string text2 = ""; LanguageAPI.Add("CRUCIFIX_LORE", text2); } } internal class SpiritStone { public class Statistics : MonoBehaviour { public class Sync : INetMessage, ISerializableObject { private NetworkInstanceId objId; private float permanentShield; public Sync() { } public Sync(NetworkInstanceId objId, float shield) { //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; permanentShield = shield; } 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(); permanentShield = 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<Statistics>(); if ((Object)(object)component != (Object)null) { component.PermanentShield = permanentShield; } } } public void Serialize(NetworkWriter writer) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) writer.Write(objId); writer.Write(permanentShield); } } private float _permanentShield; public float PermanentShield { get { return _permanentShield; } set { //IL_001d: Unknown result type (might be due to invalid IL or missing references) _permanentShield = value; if (NetworkServer.active) { NetMessageExtensions.Send((INetMessage)(object)new Sync(((Component)this).gameObject.GetComponent<NetworkIdentity>().netId, value), (NetworkDestination)1); } } } } [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Action <>9__4_0; public static Action<CharacterMaster> <>9__5_0; public static StatHookEventHandler <>9__5_1; public static hook_OnCharacterDeath <>9__5_2; public static GenericGameEvents.DamageReportEventHandler <>9__5_3; internal void <GenerateItem>b__4_0() { if (Object.op_Implicit((Object)(object)itemDef)) { itemDef.tier = (ItemTier)3; } } internal void <Hooks>b__5_0(CharacterMaster obj) { Inventory inventory = obj.inventory; if (inventory != null) { ((Component)inventory).gameObject.AddComponent<Statistics>(); } } internal void <Hooks>b__5_1(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender) && Object.op_Implicit((Object)(object)sender.inventory)) { int itemCount = sender.inventory.GetItemCount(itemDef); if (itemCount > 0) { Statistics component = ((Component)sender.inventory).GetComponent<Statistics>(); args.baseShieldAdd += component.PermanentShield; } } } internal void <Hooks>b__5_2(orig_OnCharacterDeath orig, GlobalEventManager eventManager, DamageReport damageReport) { orig.Invoke(eventManager, damageReport); if (!NetworkServer.active) { return; } CharacterBody attackerBody = damageReport.attackerBody; if (Object.op_Implicit((Object)(object)attackerBody) && Object.op_Implicit((Object)(object)attackerBody.inventory)) { int itemCount = attackerBody.inventory.GetItemCount(itemDef); if (itemCount > 0) { ((Component)attackerBody.inventory).GetComponent<Statistics>().PermanentShield += (float)shieldPerKill * (float)itemCount; Utils.ForceRecalculate(attackerBody); } } } internal void <Hooks>b__5_3(DamageReport damageReport) { if (Object.op_Implicit((Object)(object)damageReport.victimBody)) { CharacterBody victimBody = damageReport.victimBody; if (Object.op_Implicit((Object)(object)victimBody.inventory) && victimBody.inventory.GetItemCount(itemDef) > 0) { victimBody.AddBuff(Buffs.PermanentCurse); } } } } public static ItemDef itemDef; public static ConfigurableValue<float> shieldPerKill = new ConfigurableValue<float>("Item: Spirit Stone", "Shield Amount", 1f, "Health given as shield for every kill.", new List<string> { "ITEM_SPIRITSTONE_DESC" }); internal static void Init() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown GenerateItem(); AddTokens(); ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null); ItemAPI.Add(new CustomItem(itemDef, val)); NetworkingAPI.RegisterMessageType<Statistics.Sync>(); Hooks(); } private static void GenerateItem() { itemDef = ScriptableObject.CreateInstance<ItemDef>(); ((Object)itemDef).name = "SPIRIT_STONE"; itemDef.nameToken = "SPIRIT_STONE_NAME"; itemDef.pickupToken = "SPIRIT_STONE_PICKUP"; itemDef.descriptionToken = "SPIRIT_STONE_DESCRIPTION"; itemDef.loreToken = "SPIRIT_STONE_LORE"; ((ResourceAvailability)(ref ItemTierCatalog.availability)).CallWhenAvailable((Action)delegate { if (Object.op_Implicit((Object)(object)itemDef)) { itemDef.tier = (ItemTier)3; } }); itemDef.pickupIconSprite = Assets.bundle.LoadAsset<Sprite>("SpiritStone.png"); itemDef.pickupModelPrefab = Assets.bundle.LoadAsset<GameObject>("SpiritStone.prefab"); itemDef.canRemove = true; itemDef.hidden = false; itemDef.tags = (ItemTag[])(object)new ItemTag[1] { (ItemTag)6 }; } 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 //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 CharacterMaster.onStartGlobal += delegate(CharacterMaster obj) { Inventory inventory = obj.inventory; if (inventory != null) { ((Component)inventory).gameObject.AddComponent<Statistics>(); } }; object obj2 = <>c.<>9__5_1; if (obj2 == null) { StatHookEventHandler val = delegate(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender) && Object.op_Implicit((Object)(object)sender.inventory)) { int itemCount2 = sender.inventory.GetItemCount(itemDef); if (itemCount2 > 0) { Statistics component = ((Component)sender.inventory).GetComponent<Statistics>(); args.baseShieldAdd += component.PermanentShield; } } }; <>c.<>9__5_1 = val; obj2 = (object)val; } RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)obj2; object obj3 = <>c.<>9__5_2; if (obj3 == null) { hook_OnCharacterDeath val2 = delegate(orig_OnCharacterDeath orig, GlobalEventManager eventManager, DamageReport damageReport) { orig.Invoke(eventManager, damageReport); if (NetworkServer.active) { CharacterBody attackerBody = damageReport.attackerBody; if (Object.op_Implicit((Object)(object)attackerBody) && Object.op_Implicit((Object)(object)attackerBody.inventory)) { int itemCount = attackerBody.inventory.GetItemCount(itemDef); if (itemCount > 0) { ((Component)attackerBody.inventory).GetComponent<Statistics>().PermanentShield += (float)shieldPerKill * (float)itemCount; Utils.ForceRecalculate(attackerBody); } } } }; <>c.<>9__5_2 = val2; obj3 = (object)val2; } GlobalEventManager.OnCharacterDeath += (hook_OnCharacterDeath)obj3; GenericGameEvents.OnTakeDamage += delegate(DamageReport damageReport) { if (Object.op_Implicit((Object)(object)damageReport.victimBody)) { CharacterBody victimBody = damageReport.victimBody; if (Object.op_Implicit((Object)(object)victimBody.inventory) && victimBody.inventory.GetItemCount(itemDef) > 0) { victimBody.AddBuff(Buffs.PermanentCurse); } } }; } private static void AddTokens() { LanguageAPI.Add("SPIRIT_STONE", "Spirit Stone"); LanguageAPI.Add("SPIRIT_STONE_NAME", "Spirit Stone"); LanguageAPI.Add("SPIRIT_STONE_PICKUP", "Gain a permanent stacking shield when killing enemies. <style=cDeath>Taking damage reduces your max health.</style>"); string text = $"Killing an enemy grants <style=cIsUtility>{shieldPerKill.Value}</style> " + $"<style=cStack>(+{shieldPerKill.Value} per stack)</style> health as permanent shield. " + "<style=cDeath>Taking damage applies a stacking curse that lowers your max health.</style>"; LanguageAPI.Add("SPIRIT_STONE_DESCRIPTION", text); string text2 = ""; LanguageAPI.Add("SPIRIT_STONE_LORE", text2); } } internal class BottleCap { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Action <>9__4_0; public static StatHookEventHandler <>9__5_0; internal void <GenerateItem>b__4_0() { if (Object.op_Implicit((Object)(object)itemDef)) { itemDef.tier = (ItemTier)0; } } internal void <Hooks>b__5_0(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender) && Object.op_Implicit((Object)(object)sender.inventory)) { int itemCount = sender.inventory.GetItemCount(itemDef); if (itemCount > 0) { float num = 1f - 1f / (1f + ultimateCDRPercent * (float)itemCount); args.specialCooldownMultAdd -= num; } } } } public static ItemDef itemDef; public static ConfigurableValue<float> ultimateCDR = new ConfigurableValue<float>("Item: Bottle Cap", "Cooldown Reduction", 8f, "Percent cooldown reduction on ultimate skill.", new List<string> { "ITEM_BOTTLECAP_DESC" }); public static float ultimateCDRPercent = ultimateCDR.Value / 100f; internal static void Init() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown GenerateItem(); AddTokens(); ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null); ItemAPI.Add(new CustomItem(itemDef, val)); Hooks(); } private static void GenerateItem() { itemDef = ScriptableObject.CreateInstance<ItemDef>(); ((Object)itemDef).name = "BOTTLE_CAP"; itemDef.nameToken = "BOTTLE_CAP_NAME"; itemDef.pickupToken = "BOTTLE_CAP_PICKUP"; itemDef.descriptionToken = "BOTTLE_CAP_DESCRIPTION"; itemDef.loreToken = "BOTTLE_CAP_LORE"; ((ResourceAvailability)(ref ItemTierCatalog.availability)).CallWhenAvailable((Action)delegate { if (Object.op_Implicit((Object)(object)itemDef)) { itemDef.tier = (ItemTier)0; } }); itemDef.pickupIconSprite = Assets.bundle.LoadAsset<Sprite>("BottleCap.png"); itemDef.pickupModelPrefab = Assets.bundle.LoadAsset<GameObject>("BottleCap.prefab"); itemDef.canRemove = true; itemDef.hidden = false; itemDef.tags = (ItemTag[])(object)new ItemTag[1] { (ItemTag)3 }; } 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__5_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 itemCount = sender.inventory.GetItemCount(itemDef); if (itemCount > 0) { float num = 1f - 1f / (1f + ultimateCDRPercent * (float)itemCount); args.specialCooldownMultAdd -= num; } } }; <>c.<>9__5_0 = val; obj = (object)val; } RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)obj; } private static void AddTokens() { LanguageAPI.Add("BOTTLE_CAP", "Bottle Cap"); LanguageAPI.Add("BOTTLE_CAP_NAME", "Bottle Cap"); LanguageAPI.Add("BOTTLE_CAP_PICKUP", "Reduce the cooldown of your ultimate skill."); string text = $"Reduce your ultimate skill cooldown by <style=cIsUtility>{ultimateCDR.Value}%</style> " + $"<style=cStack>(+{ultimateCDR.Value}% per stack)</style>."; LanguageAPI.Add("BOTTLE_CAP_DESCRIPTION", text); string text2 = ""; LanguageAPI.Add("BOTTLE_CAP_LORE", text2); } } internal class BreadLoaf { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Action <>9__4_0; public static hook_OnCharacterDeath <>9__5_0; internal void <GenerateItem>b__4_0() { if (Object.op_Implicit((Object)(object)itemDef)) { itemDef.tier = (ItemTier)0; } } internal void <Hooks>b__5_0(orig_OnCharacterDeath orig, GlobalEventManager eventManager, DamageReport damageReport) { //IL_00b3: 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) orig.Invoke(eventManager, damageReport); if (!NetworkServer.active) { return; } CharacterBody attackerBody = damageReport.attackerBody; if (!Object.op_Implicit((Object)(object)attackerBody) || !Object.op_Implicit((Object)(object)attackerBody.inventory)) { return; } int itemCount = attackerBody.inventory.GetItemCount(itemDef); if (itemCount <= 0) { return; } foreach (HoldoutZoneController instances in InstanceTracker.GetInstancesList<HoldoutZoneController>()) { if (((Behaviour)instances).isActiveAndEnabled && instances.IsBodyInChargingRadius(attackerBody)) { float num = healthGainOnKillPercent * (float)itemCount * attackerBody.healthComponent.missingCombinedHealth; attackerBody.healthComponent.Heal(num, default(ProcChainMask), true); } } } } public static ItemDef itemDef; public static ConfigurableValue<float> healthGainOnKill = new ConfigurableValue<float>("Item: Loaf of Bread", "Healing On Kill", 4f, "Percent missing health gained after killing an enemy during the teleporter event.", new List<string> { "ITEM_BREADLOAF_DESC" }); public static float healthGainOnKillPercent = healthGainOnKill.Value / 100f; internal static void Init() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown GenerateItem(); AddTokens(); ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null); ItemAPI.Add(new CustomItem(itemDef, val)); Hooks(); } private static void GenerateItem() { itemDef = ScriptableObject.CreateInstance<ItemDef>(); ((Object)itemDef).name = "BREAD_LOAF"; itemDef.nameToken = "BREAD_LOAF_NAME"; itemDef.pickupToken = "BREAD_LOAF_PICKUP"; itemDef.descriptionToken = "BREAD_LOAF_DESCRIPTION"; itemDef.loreToken = "BREAD_LOAF_LORE"; ((ResourceAvailability)(ref ItemTierCatalog.availability)).CallWhenAvailable((Action)delegate { if (Object.op_Implicit((Object)(object)itemDef)) { itemDef.tier = (ItemTier)0; } }); itemDef.pickupIconSprite = Assets.bundle.LoadAsset<Sprite>("BreadLoaf.png"); itemDef.pickupModelPrefab = Assets.bundle.LoadAsset<GameObject>("BreadLoaf.prefab"); itemDef.canRemove = true; itemDef.hidden = false; ItemDef obj = itemDef; ItemTag[] array = new ItemTag[3]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); obj.tags = (ItemTag[])(object)array; } 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__5_0; if (obj == null) { hook_OnCharacterDeath val = delegate(orig_OnCharacterDeath orig, GlobalEventManager eventManager, DamageReport damageReport) { //IL_00b3: 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) orig.Invoke(eventManager, damageReport); if (NetworkServer.active) { CharacterBody attackerBody = damageReport.attackerBody; if (Object.op_Implicit((Object)(object)attackerBody) && Object.op_Implicit((Object)(object)attackerBody.inventory)) { int itemCount = attackerBody.inventory.GetItemCount(itemDef); if (itemCount > 0) { foreach (HoldoutZoneController instances in InstanceTracker.GetInstancesList<HoldoutZoneController>()) { if (((Behaviour)instances).isActiveAndEnabled && instances.IsBodyInChargingRadius(attackerBody)) { float num = healthGainOnKillPercent * (float)itemCount * attackerBody.healthComponent.missingCombinedHealth; attackerBody.healthComponent.Heal(num, default(ProcChainMask), true); } } } } } }; <>c.<>9__5_0 = val; obj = (object)val; } GlobalEventManager.OnCharacterDeath += (hook_OnCharacterDeath)obj; } private static void AddTokens() { LanguageAPI.Add("BREAD_LOAF", "Loaf of Bread"); LanguageAPI.Add("BREAD_LOAF_NAME", "Loaf of Bread"); LanguageAPI.Add("BREAD_LOAF_PICKUP", "While the teleporter is charging, killing enemies heals you."); string text = "While the teleporter is charging, killing enemies heals you for " + $"<style=cIsUtility>{healthGainOnKill.Value}%</style> " + $"<style=cStack>(+{healthGainOnKill.Value}% per stack)</style> of your missing health."; LanguageAPI.Add("BREAD_LOAF_DESCRIPTION", text); string text2 = ""; LanguageAPI.Add("BREAD_LOAF_LORE", text2); } } internal class DebitCard { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Action <>9__4_0; public static hook_OnPurchase <>9__5_0; internal void <GenerateItem>b__4_0() { if (Object.op_Implicit((Object)(object)itemDef)) { itemDef.tier = (ItemTier)0; } } internal void <Hooks>b__5_0(orig_OnPurchase orig, PayCostContext context, int moneyCost) { //IL_0002: 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) orig.Invoke(context, moneyCost); CharacterMaster activatorMaster = context.activatorMaster; if (Object.op_Implicit((Object)(object)activatorMaster) && activatorMaster.hasBody && Object.op_Implicit((Object)(object)activatorMaster.inventory)) { int itemCount = activatorMaster.inventory.GetItemCount(itemDef); if (itemCount > 0) { float num = 1f - 1f / (1f + rebatePercent * (float)itemCount); activatorMaster.GiveMoney(Convert.ToUInt32((float)moneyCost * num)); } } } } public static ItemDef itemDef; public static ConfigurableValue<float> rebate = new ConfigurableValue<float>("Item: Debit Card", "Rebate Amount", 8f, "Percentage of spent gold refunded as rebate.", new List<string> { "ITEM_DEBITCARD_DESC" }); public static float rebatePercent = rebate.Value / 100f; internal static void Init() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown GenerateItem(); AddTokens(); ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null); ItemAPI.Add(new CustomItem(itemDef, val)); Hooks(); } private static void GenerateItem() { itemDef = ScriptableObject.CreateInstance<ItemDef>(); ((Object)itemDef).name = "DEBIT_CARD"; itemDef.nameToken = "DEBIT_CARD_NAME"; itemDef.pickupToken = "DEBIT_CARD_PICKUP"; itemDef.descriptionToken = "DEBIT_CARD_DESCRIPTION"; itemDef.loreToken = "DEBIT_CARD_LORE"; ((ResourceAvailability)(ref ItemTierCatalog.availability)).CallWhenAvailable((Action)delegate { if (Object.op_Implicit((Object)(object)itemDef)) { itemDef.tier = (ItemTier)0; } }); itemDef.pickupIconSprite = Assets.bundle.LoadAsset<Sprite>("DebitCard.png"); itemDef.pickupModelPrefab = Assets.bundle.LoadAsset<GameObject>("DebitCard.prefab"); itemDef.canRemove = true; itemDef.hidden = false; itemDef.tags = (ItemTag[])(object)new ItemTag[1] { (ItemTag)3 }; } 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__5_0; if (obj == null) { hook_OnPurchase val = delegate(orig_OnPurchase orig, PayCostContext context, int moneyCost) { //IL_0002: 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) orig.Invoke(context, moneyCost); CharacterMaster activatorMaster = context.activatorMaster; if (Object.op_Implicit((Object)(object)activatorMaster) && activatorMaster.hasBody && Object.op_Implicit((Object)(object)activatorMaster.inventory)) { int itemCount = activatorMaster.inventory.GetItemCount(itemDef); if (itemCount > 0) { float num = 1f - 1f / (1f + rebatePercent * (float)itemCount); activatorMaster.GiveMoney(Convert.ToUInt32((float)moneyCost * num)); } } }; <>c.<>9__5_0 = val; obj = (object)val; } MultiShopCardUtils.OnPurchase += (hook_OnPurchase)obj; } private static void AddTokens() { LanguageAPI.Add("DEBIT_CARD", "Debit Card"); LanguageAPI.Add("DEBIT_CARD_NAME", "Debit Card"); LanguageAPI.Add("DEBIT_CARD_PICKUP", "Get a rebate on purchases."); string text = $"Get a <style=cIsUtility>{rebate.Value}%</style> <style=cStack>(+{rebate.Value}% per stack) rebate</style> on purchases."; LanguageAPI.Add("DEBIT_CARD_DESCRIPTION", text); string text2 = ""; LanguageAPI.Add("DEBIT_CARD_LORE", text2); } } internal class EdibleGlue { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Action <>9__4_0; public static hook_OnCharacterDeath <>9__5_0; internal void <GenerateItem>b__4_0() { if (Object.op_Implicit((Object)(object)itemDef)) { itemDef.tier = (ItemTier)0; } } internal void <Hooks>b__5_0(orig_OnCharacterDeath orig, GlobalEventManager eventManager, DamageReport damageReport) { //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: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0082: 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) orig.Invoke(eventManager, damageReport); if (!NetworkServer.active) { return; } CharacterBody attackerBody = damageReport.attackerBody; if (!Object.op_Implicit((Object)(object)attackerBody) || !Object.op_Implicit((Object)(object)attackerBody.inventory)) { return; } int itemCount = attackerBody.inventory.GetItemCount(itemDef); if (itemCount <= 0) { return; } HurtBox[] hurtBoxes = new SphereSearch { mask = ((LayerIndex)(ref LayerIndex.enemyBody)).mask, origin = attackerBody.corePosition, queryTriggerInteraction = (QueryTriggerInteraction)2, radius = slowRadiusPerStack.Value * (float)itemCount }.RefreshCandidates().FilterCandidatesByDistinctHurtBoxEntities().GetHurtBoxes(); HurtBox[] array = hurtBoxes; foreach (HurtBox val in array) { CharacterBody body = val.healthComponent.body; if (Object.op_Implicit((Object)(object)body) && (Object)(object)body != (Object)(object)attackerBody) { body.AddTimedBuff(Buffs.Slow80, slowDuration); } } } } public static ItemDef itemDef; public static ConfigurableValue<float> slowRadiusPerStack = new ConfigurableValue<float>("Item: Edible Glue", "Slow Radius", 8f, "Slow radius amount for each stack of item.", new List<string> { "ITEM_EDIBLEGLUE_DESC" }); public static float slowDuration = 4f; internal static void Init() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown GenerateItem(); AddTokens(); ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null); ItemAPI.Add(new CustomItem(itemDef, val)); Hooks(); } private static void GenerateItem() { itemDef = ScriptableObject.CreateInstance<ItemDef>(); ((Object)itemDef).name = "EDIBLE_GLUE"; itemDef.nameToken = "EDIBLE_GLUE_NAME"; itemDef.pickupToken = "EDIBLE_GLUE_PICKUP"; itemDef.descriptionToken = "EDIBLE_GLUE_DESCRIPTION"; itemDef.loreToken = "EDIBLE_GLUE_LORE"; ((ResourceAvailability)(ref ItemTierCatalog.availability)).CallWhenAvailable((Action)delegate { if (Object.op_Implicit((Object)(object)itemDef)) { itemDef.tier = (ItemTier)0; } }); itemDef.pickupIconSprite = Assets.bundle.LoadAsset<Sprite>("EdibleGlue.png"); itemDef.pickupModelPrefab = Assets.bundle.LoadAsset<GameObject>("GlueBottle.prefab"); itemDef.canRemove = true; itemDef.hidden = false; itemDef.tags = (ItemTag[])(object)new ItemTag[2] { (ItemTag)3, (ItemTag)6 }; } 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__5_0; if (obj == null) { hook_OnCharacterDeath val = delegate(orig_OnCharacterDeath orig, GlobalEventManager eventManager, DamageReport damageReport) { //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: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0082: 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) orig.Invoke(eventManager, damageReport); if (NetworkServer.active) { CharacterBody attackerBody = damageReport.attackerBody; if (Object.op_Implicit((Object)(object)attackerBody) && Object.op_Implicit((Object)(object)attackerBody.inventory)) { int itemCount = attackerBody.inventory.GetItemCount(itemDef); if (itemCount > 0) { HurtBox[] hurtBoxes = new SphereSearch { mask = ((LayerIndex)(ref LayerIndex.enemyBody)).mask, origin = attackerBody.corePosition, queryTriggerInteraction = (QueryTriggerInteraction)2, radius = slowRadiusPerStack.Value * (float)itemCount }.RefreshCandidates().FilterCandidatesByDistinctHurtBoxEntities().GetHurtBoxes(); HurtBox[] array = hurtBoxes; foreach (HurtBox val2 in array) { CharacterBody body = val2.healthComponent.body; if (Object.op_Implicit((Object)(object)body) && (Object)(object)body != (Object)(object)attackerBody) { body.AddTimedBuff(Buffs.Slow80, slowDuration); } } } } } }; <>c.<>9__5_0 = val; obj = (object)val; } GlobalEventManager.OnCharacterDeath += (hook_OnCharacterDeath)obj; } private static void AddTokens() { LanguageAPI.Add("EDIBLE_GLUE", "Edible Glue"); LanguageAPI.Add("EDIBLE_GLUE_NAME", "Edible Glue"); LanguageAPI.Add("EDIBLE_GLUE_PICKUP", "On kill, slow nearby enemies."); string text = $"On kill, slow enemies within <style=cIsUtility>{slowRadiusPerStack.Value}m</style> <style=cStack>(+{slowRadiusPerStack.Value}m per stack)</style> by 80% for 2 seconds."; LanguageAPI.Add("EDIBLE_GLUE_DESCRIPTION", text); string text2 = ""; LanguageAPI.Add("EDIBLE_GLUE_LORE", text2); } } internal class MilkCarton { public static ItemDef itemDef; public static ConfigurableValue<float> eliteDamageReduction = new ConfigurableValue<float>("Item: Milk Carton", "Percent Damage Reduction", 8f, "Percent damage reduction agains elite enemies.", new List<string> { "ITEM_MILKCARTON_DESC" }); public static float eliteDamageReductionPercent = eliteDamageReduction.Value / 100f; internal static void Init() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown GenerateItem(); AddTokens(); ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null); ItemAPI.Add(new CustomItem(itemDef, val)); Hooks(); } private static void GenerateItem() { itemDef = ScriptableObject.CreateInstance<ItemDef>(); ((Object)itemDef).name = "MILK_CARTON"; itemDef.nameToken = "MILK_CARTON_NAME"; itemDef.pickupToken = "MILK_CARTON_PICKUP"; itemDef.descriptionToken = "MILK_CARTON_DESCRIPTION"; itemDef.loreToken = "MILK_CARTON_LORE"; ((ResourceAvailability)(ref ItemTierCatalog.availability)).CallWhenAvailable((Action)delegate { if (Object.op_Implicit((Object)(object)itemDef)) { itemDef.tier = (ItemTier)0; } }); itemDef.pickupIconSprite = Assets.bundle.LoadAsset<Sprite>("MilkCarton.png"); itemDef.pickupModelPrefab = Assets.bundle.LoadAsset<GameObject>("MilkCarton.prefab"); itemDef.canRemove = true; itemDef.hidden = false; itemDef.tags = (ItemTag[])(object)new ItemTag[1] { (ItemTag)3 }; } public static void Hooks() { GenericGameEvents.BeforeTakeDamage += delegate(DamageInfo damageInfo, TooManyItems.GenericCharacterInfo attackerInfo, TooManyItems.GenericCharacterInfo victimInfo) { if (Object.op_Implicit((Object)(object)victimInfo.inventory)) { int itemCount = victimInfo.inventory.GetItemCount(itemDef); if (Object.op_Implicit((Object)(object)attackerInfo.body) && attackerInfo.body.isElite && itemCount > 0) { float num = 1f - 1f / (1f + eliteDamageReductionPercent * (float)itemCount); damageInfo.damage *= 1f - num; } } }; } private static void AddTokens() { LanguageAPI.Add("MILK_CARTON", "Milk Carton"); LanguageAPI.Add("MILK_CARTON_NAME", "Milk Carton"); LanguageAPI.Add("MILK_CARTON_PICKUP", "Reduce damage taken from elites."); string text = $"Reduce damage taken from elite enemies by <style=cIsUtility>{eliteDamageReduction.Value}%</style> <style=cStack>(+{eliteDamageReduction.Value}% per stack)</style>."; LanguageAPI.Add("MILK_CARTON_DESCRIPTION", text); string text2 = ""; LanguageAPI.Add("MILK_CARTON_LORE", text2); } } internal class PaperPlane { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Action <>9__4_0; public static hook_FixedUpdate <>9__5_0; public static StatHookEventHandler <>9__5_1; internal void <GenerateItem>b__4_0() { if (Object.op_Implicit((Object)(object)itemDef)) { itemDef.tier = (ItemTier)0; } } internal void <Hooks>b__5_0(orig_FixedUpdate orig, CharacterBody self) { orig.Invoke(self); if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.inventory) && self.inventory.GetItemCount(itemDef) > 0) { Utils.ForceRecalculate(self); } } internal void <Hooks>b__5_1(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender) && Object.op_Implicit((Object)(object)sender.inventory)) { int itemCount = sender.inventory.GetItemCount(itemDef); if (itemCount > 0 && Object.op_Implicit((Object)(object)sender.characterMotor) && !sender.characterMotor.isGrounded) { args.moveSpeedMultAdd += movespeedIncreasePercent * (float)itemCount; } } } } public static ItemDef itemDef; public static ConfigurableValue<float> movespeedIncrease = new ConfigurableValue<float>("Item: Paper Plane", "Movement Speed Increase", 18f, "Percent movement speed gained per stack while airborne.", new List<string> { "ITEM_PAPERPLANE_DESC" }); public static float movespeedIncreasePercent = movespeedIncrease.Value / 100f; internal static void Init() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown GenerateItem(); AddTokens(); ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null); ItemAPI.Add(new CustomItem(itemDef, val)); Hooks(); } private static void GenerateItem() { itemDef = ScriptableObject.CreateInstance<ItemDef>(); ((Object)itemDef).name = "PAPER_PLANE"; itemDef.nameToken = "PAPER_PLANE_NAME"; itemDef.pickupToken = "PAPER_PLANE_PICKUP"; itemDef.descriptionToken = "PAPER_PLANE_DESCRIPTION"; itemDef.loreToken = "PAPER_PLANE_LORE"; ((ResourceAvailability)(ref ItemTierCatalog.availability)).CallWhenAvailable((Action)delegate { if (Object.op_Implicit((Object)(object)itemDef))