Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of HallowedMod v1.1.0
HallowedPlugin.dll
Decompiled 2 years agousing System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HallowedPlugin.Assets; using HallowedPlugin.Buffs; using HallowedPlugin.CustomBehavior; using HallowedPlugin.ItemBehaviors; using HallowedPlugin.ItemTiers; using HallowedPlugin.Items; using Microsoft.CodeAnalysis; using On.RoR2; using On.RoR2.Items; using R2API; using RoR2; using RoR2.Orbs; 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.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("HallowedPlugin")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("HallowedPlugin")] [assembly: AssemblyTitle("HallowedPlugin")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace HallowedPlugin { [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("imulki.HallowedPlugin", "HallowedPlugin", "0.1")] public class HallowedPlugin : BaseUnityPlugin { public const string PluginGUID = "imulki.HallowedPlugin"; public const string PluginAuthor = "imulki"; public const string PluginName = "HallowedPlugin"; public const string PluginVersion = "0.1"; public static ConfigEntry<float> VoidStuffSpawnRateConfig { get; set; } public void Awake() { Log.Init(((BaseUnityPlugin)this).Logger); InitiateConfig(); AssetFactory.InitiateAssets(); BuffFactory.InitiateBuffFactory(); ItemTierFactory.InitiateItemTierFactory(); ItemFactory.InitiateItemFactory(); CustomBehaviorInitiator.Initiate(); StuffChecking(); } private void InitiateConfig() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown VoidStuffSpawnRateConfig = ((BaseUnityPlugin)this).Config.Bind<float>("TheSection", "VoidSpawnRateKey", 1f, "A Multiplier. How common will the void thing spawn, the default value is 1. Personally, I recommend to set it 1.5 to 2, as this mod almost double the void item pool."); ClassicStageInfo.Start += new hook_Start(ClassicStageInfo_Start); } private void StuffChecking() { } private void ClassicStageInfo_Start(orig_Start orig, ClassicStageInfo self) { orig.Invoke(self); if ((Object)(object)self.interactableCategories == (Object)null || self.interactableCategories.categories == null || VoidStuffSpawnRateConfig.Value == 1f) { return; } for (int i = 0; i < self.interactableCategories.categories.Length; i++) { if (self.interactableCategories.categories[i].name == "Void Stuff") { self.interactableCategories.categories[i].selectionWeight *= VoidStuffSpawnRateConfig.Value; } } } } internal static class Log { private static ManualLogSource _logSource; internal static void Init(ManualLogSource logSource) { _logSource = logSource; } internal static void Debug(object data) { _logSource.LogDebug(data); } internal static void Error(object data) { _logSource.LogError(data); } internal static void Fatal(object data) { _logSource.LogFatal(data); } internal static void Info(object data) { _logSource.LogInfo(data); } internal static void Message(object data) { _logSource.LogMessage(data); } internal static void Warning(object data) { _logSource.LogWarning(data); } } } namespace HallowedPlugin.ItemTiers { public class ItemTierFactory { public enum AdditionItemTier { hallowedTier1 = 1024, hallowedTier2, hallowedTier3, hallowedTierBoss } public static ItemTierDef hallowedTier1; public static ItemTierDef hallowedTier2; public static ItemTierDef hallowedTier3; public static ItemTierDef hallowedTierBoss; public static void InitiateItemTierFactory() { CreateHallowedTiers(); } public static ItemTierDef CreateItemTierDef(string tierName, Texture bgIconTexture, ColorIndex colorIndex, ColorIndex darkColorIndex, bool isDroppable, bool canScrap, bool canRestack, PickupRules pickupRules, GameObject highlightPrefab, GameObject dropletDisplayPrefab, Enum tierIndex) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_003d: 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_0057: Unknown result type (might be due to invalid IL or missing references) ItemTierDef val = ScriptableObject.CreateInstance<ItemTierDef>(); ((Object)val).name = tierName; val.bgIconTexture = bgIconTexture; val.colorIndex = colorIndex; val.darkColorIndex = darkColorIndex; val.isDroppable = isDroppable; val.canRestack = canRestack; val.canScrap = canScrap; val.pickupRules = pickupRules; val.highlightPrefab = highlightPrefab; val.dropletDisplayPrefab = dropletDisplayPrefab; val.tier = (ItemTier)(object)tierIndex; ContentAddition.AddItemTierDef(val); return val; } private static void CreateHallowedTiers() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) Texture bgIconTexture = Addressables.LoadAssetAsync<Texture>((object)"RoR2/Base/Common/texBossBGIcon.png").WaitForCompletion(); ColorIndex colorIndex = (ColorIndex)13; ColorIndex darkColorIndex = (ColorIndex)22; GameObject dropletDisplayPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Common/PickupDroplet.prefab").WaitForCompletion(); hallowedTier1 = CreateItemTierDef("hallowedTier1", bgIconTexture, colorIndex, darkColorIndex, isDroppable: true, canScrap: false, canRestack: true, (PickupRules)1, null, dropletDisplayPrefab, AdditionItemTier.hallowedTier1); hallowedTier2 = CreateItemTierDef("hallowedTier2", bgIconTexture, colorIndex, darkColorIndex, isDroppable: true, canScrap: false, canRestack: true, (PickupRules)1, null, null, AdditionItemTier.hallowedTier2); hallowedTier3 = CreateItemTierDef("hallowedTier3", bgIconTexture, colorIndex, darkColorIndex, isDroppable: true, canScrap: false, canRestack: true, (PickupRules)1, null, null, AdditionItemTier.hallowedTier3); hallowedTierBoss = CreateItemTierDef("hallowedTierBoss", bgIconTexture, colorIndex, darkColorIndex, isDroppable: true, canScrap: false, canRestack: true, (PickupRules)1, null, null, AdditionItemTier.hallowedTierBoss); } } } namespace HallowedPlugin.ItemBehaviors { public class FlyingFungusBehavior : ItemBehavior { private const float healPercentagePerStack = 0.01f; private const float healPeriodSeconds = 0.5f; private bool wasFlying; private HealthComponent healthComponent; private float healTimer; private void Awake() { ((Behaviour)this).enabled = false; } private void OnEnable() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)base.body)) { wasFlying = base.body.GetBuffCount(BuffFactory.FlyingFungusBuff.buffIndex) > 0; healthComponent = ((Component)base.body).GetComponent<HealthComponent>(); } healTimer = 0f; } private void OnDisable() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)base.body) && wasFlying) { base.body.RemoveBuff(BuffFactory.FlyingFungusBuff.buffIndex); } healthComponent = null; } private void FixedUpdate() { //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)base.body)) { if (!base.body.characterMotor.isGrounded) { healTimer += Time.fixedDeltaTime; if (!wasFlying) { wasFlying = true; base.body.AddBuff(BuffFactory.FlyingFungusBuff.buffIndex); } } else if (wasFlying) { base.body.RemoveBuff(BuffFactory.FlyingFungusBuff.buffIndex); wasFlying = false; } } while (healTimer > 0.5f) { healthComponent.HealFraction(0.01f * (float)base.stack, default(ProcChainMask)); healTimer -= 0.5f; } } } internal class LivingRobotBehavior : ItemBehavior { public static DeployableSlot dsLivingRobot = (DeployableSlot)52; private const float baseSecondsPerSpawn = 30f; private const int baseMaxAllies = 3; private const int maxAlliesPerStack = 2; private const float minSpawnDist = 3f; private const float maxSpawnDist = 40f; private float spawnTimer; private Xoroshiro128Plus rng; private WeightedSelection<CharacterSpawnCard> spawnSelection; private DirectorPlacementRule placementRule; public static int GetMaxProjectiles(Inventory inventory) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) return 3 + 2 * (inventory.GetItemCount(ItemFactory.LivingRobot.itemIndex) - 1); } private void Awake() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: 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_00f8: Expected O, but got Unknown ((Behaviour)this).enabled = false; ulong num = Run.instance.seed ^ (ulong)Run.instance.stageClearCount; rng = new Xoroshiro128Plus(num); spawnSelection = new WeightedSelection<CharacterSpawnCard>(8); spawnSelection.AddChoice(Addressables.LoadAssetAsync<CharacterSpawnCard>((object)"RoR2/Base/Drones/cscDrone1.asset").WaitForCompletion(), 15f); spawnSelection.AddChoice(Addressables.LoadAssetAsync<CharacterSpawnCard>((object)"RoR2/Base/Drones/cscDrone2.asset").WaitForCompletion(), 15f); spawnSelection.AddChoice(Addressables.LoadAssetAsync<CharacterSpawnCard>((object)"RoR2/Base/Drones/cscBackupDrone.asset").WaitForCompletion(), 5f); spawnSelection.AddChoice(Addressables.LoadAssetAsync<CharacterSpawnCard>((object)"RoR2/DLC1/DroneCommander/cscDroneCommander.asset").WaitForCompletion(), 1f); placementRule = new DirectorPlacementRule { placementMode = (PlacementMode)1, minDistance = 3f, maxDistance = 40f, spawnOnTarget = ((Component)this).transform }; } private void FixedUpdate() { //IL_001e: 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_007a: Expected O, but got Unknown spawnTimer += Time.fixedDeltaTime; if (!base.body.master.IsDeployableLimited(dsLivingRobot) && spawnTimer > 60f / (float)base.stack) { spawnTimer = 0f; DirectorSpawnRequest val = new DirectorSpawnRequest((SpawnCard)(object)spawnSelection.Evaluate(rng.nextNormalizedFloat), placementRule, rng); val.summonerBodyObject = ((Component)this).gameObject; val.onSpawnedServer = OnMasterSpawned; val.summonerBodyObject = ((Component)this).gameObject; DirectorCore.instance.TrySpawnObject(val); } } private void OnMasterSpawned(SpawnResult spawnResult) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) GameObject spawnedInstance = spawnResult.spawnedInstance; if (!Object.op_Implicit((Object)(object)spawnedInstance)) { return; } CharacterMaster component = spawnedInstance.GetComponent<CharacterMaster>(); if (Object.op_Implicit((Object)(object)component)) { Deployable component2 = ((Component)component).GetComponent<Deployable>(); if (Object.op_Implicit((Object)(object)component2)) { base.body.master.AddDeployable(component2, dsLivingRobot); } } } } } namespace HallowedPlugin.Items { public class ItemFactory : MonoBehaviour { [CompilerGenerated] private static class <>O { public static Func<int> <0>__BenaluEffect; public static hook_RespawnLocalPlayers <1>__Stage_RespawnLocalPlayers; public static Func<int> <2>__CatastrophicEraEffect; public static Action<DamageReport> <3>__CatastrophicEra_GlobalEventManager_onServerDamageDealt; public static hook_UpdateAllTemporaryVisualEffects <4>__CatastrophicEra_UpdateAllTemporaryVisualEffects; public static hook_TakeDamageProcess <5>__CatastrophicEra_TakeDamageProcess; public static hook_RemoveBuff_BuffIndex <6>__CatastrophicEra_CharacterBody_RemoveBuff_BuffIndex; public static Func<int> <7>__DelayedDoomEffect; public static Action<DamageReport> <8>__DelayedDoom_OnServerDamageDealt; public static hook_RemoveBuff_BuffIndex <9>__DelayedDoom_OnRemoveBuff; public static Func<int> <10>__FaultyEgoEffect; public static hook_UpdateLastHitTime <11>__FaultyEgo_UpdateLastHitTime; public static Action<DamageReport> <12>__FaultyEgo_onServerDamageDealt; public static hook_RemoveBuff_BuffIndex <13>__FaultyEgo_RemoveBuff_BuffIndex; public static hook_Heal <14>__FaultyEgo_HealthComponent_Heal; public static Func<int> <15>__FaultyEgoConsumedEffect; public static Func<int> <16>__FlyingFungusEffect; public static Action<CharacterBody> <17>__FlyingFungus_onBodyInventoryChangedGlobal; public static Func<int> <18>__GuitarEffect; public static Action<DamageReport> <19>__Guitar_onServerDamageDealt; public static Func<int> <20>__HypnoBaubleEffect; public static Action<DamageReport> <21>__HypnoBauble_onServerDamageDealt; public static hook_UpdateAllTemporaryVisualEffects <22>__HypnoBauble_UpdateAllTemporaryVisualEffects; public static hook_RemoveBuff_BuffIndex <23>__HypnoBauble_RemoveBuff_BuffIndex; public static Func<int> <24>__IlluminationEffect; public static Action<DamageReport> <25>__Illumination_onServerDamageDealt; public static hook_Init <26>__ContagiousItemManager_Init; public static hook_BuildDropTable <27>__ItemFactory_BuildDropTable; public static Func<int> <28>__LivingRobotEffect; public static Action<CharacterBody> <29>__LivingRobot_onBodyInventoryChangedGlobal; public static hook_GetDeployableSameSlotLimit <30>__LivingRobot_GetDeployableSameSlotLimit; public static Func<int> <31>__MagnifierEffect; public static Action<DamageReport> <32>__Magnifier_OnServerDamageDealt; public static Func<int> <33>__MulticastEffect; public static Action<EquipmentSlot, EquipmentIndex> <34>__Multicast_onServerEquipmentActivated; public static hook_RemoveBuff_BuffIndex <35>__Multicast_RemoveBuff_BuffIndex; public static Func<int> <36>__SacredMissileEffect; public static Action<DamageReport> <37>__SacredMissile_onServerDamageDealt; } public static ItemDef Benalu; public static ItemDef CatastrophicEra; public static ItemDef DelayedDoom; public static ItemDef FaultyEgo; public static ItemDef FaultyEgoConsumed; public static ItemDef FlyingFungus; public static ItemDef Guitar; public static ItemDef HypnoBauble; public static ItemDef Illumination; public static string modNameCode = "HALLOWED"; public static List<Pair> itemPairs = new List<Pair>(); public static ItemDef LivingRobot; public static ItemDef Magnifier; public static ItemDef Multicast; public static ItemDef SacredMissile; public static ItemDef InitiateBenalu() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) Sprite pickupIconSprite = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/DLC1/CloverVoid/texCloverVoidIcon.png").WaitForCompletion(); Benalu = CreateItem("BENALU", ItemTierFactory.hallowedTier3, pickupIconSprite, Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/CloverVoid/PickupCloverVoid.prefab").WaitForCompletion(), canRemove: true, hidden: false, null, BenaluEffect, (ItemTag[])(object)new ItemTag[1] { (ItemTag)3 }); return Benalu; } private static int BenaluEffect() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown object obj = <>O.<1>__Stage_RespawnLocalPlayers; if (obj == null) { hook_RespawnLocalPlayers val = Stage_RespawnLocalPlayers; <>O.<1>__Stage_RespawnLocalPlayers = val; obj = (object)val; } Stage.RespawnLocalPlayers += (hook_RespawnLocalPlayers)obj; return 0; } private static void Stage_RespawnLocalPlayers(orig_RespawnLocalPlayers orig, Stage self) { //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Expected O, but got Unknown //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); ReadOnlyCollection<NetworkUser> readOnlyInstancesList = NetworkUser.readOnlyInstancesList; for (int i = 0; i < readOnlyInstancesList.Count; i++) { NetworkUser val = readOnlyInstancesList[i]; CharacterMaster val2 = null; if (((NetworkBehaviour)val).isLocalPlayer && Object.op_Implicit((Object)(object)val.masterObject)) { val2 = val.masterObject.GetComponent<CharacterMaster>(); } if (Object.op_Implicit((Object)(object)val2)) { Xoroshiro128Plus val3 = val2.cloverVoidRng; if (val3 == null) { val3 = new Xoroshiro128Plus(Run.instance.seed); } Inventory component = ((Component)val2).GetComponent<Inventory>(); int itemCount = component.GetItemCount(Benalu.itemIndex); List<ItemIndex> list = new List<ItemIndex>(component.itemAcquisitionOrder); Util.ShuffleList<ItemIndex>(list, val3); int num = itemCount * 3; for (int j = 0; j < num; j++) { ItemDef itemDef = ItemCatalog.GetItemDef(list[j]); component.GiveItem(itemDef.itemIndex, 1); } } } } public static ItemDef InitiateCatastrophicEra() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_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) CatastrophicEra = CreateItem("CATASTROPHICERA", ItemTierFactory.hallowedTier1, Addressables.LoadAssetAsync<Sprite>((object)"RoR2/DLC1/BearVoid/texBearVoidIcon.png").WaitForCompletion(), Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/BearVoid/PickupBearVoid.prefab").WaitForCompletion(), canRemove: true, hidden: false, null, CatastrophicEraEffect, (ItemTag[])(object)new ItemTag[2] { (ItemTag)3, (ItemTag)11 }); return CatastrophicEra; } private static int CatastrophicEraEffect() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Expected O, but got Unknown GlobalEventManager.onServerDamageDealt += CatastrophicEra_GlobalEventManager_onServerDamageDealt; object obj = <>O.<4>__CatastrophicEra_UpdateAllTemporaryVisualEffects; if (obj == null) { hook_UpdateAllTemporaryVisualEffects val = CatastrophicEra_UpdateAllTemporaryVisualEffects; <>O.<4>__CatastrophicEra_UpdateAllTemporaryVisualEffects = val; obj = (object)val; } CharacterBody.UpdateAllTemporaryVisualEffects += (hook_UpdateAllTemporaryVisualEffects)obj; object obj2 = <>O.<5>__CatastrophicEra_TakeDamageProcess; if (obj2 == null) { hook_TakeDamageProcess val2 = CatastrophicEra_TakeDamageProcess; <>O.<5>__CatastrophicEra_TakeDamageProcess = val2; obj2 = (object)val2; } HealthComponent.TakeDamageProcess += (hook_TakeDamageProcess)obj2; object obj3 = <>O.<6>__CatastrophicEra_CharacterBody_RemoveBuff_BuffIndex; if (obj3 == null) { hook_RemoveBuff_BuffIndex val3 = CatastrophicEra_CharacterBody_RemoveBuff_BuffIndex; <>O.<6>__CatastrophicEra_CharacterBody_RemoveBuff_BuffIndex = val3; obj3 = (object)val3; } CharacterBody.RemoveBuff_BuffIndex += (hook_RemoveBuff_BuffIndex)obj3; return 0; } private static void CatastrophicEra_UpdateAllTemporaryVisualEffects(orig_UpdateAllTemporaryVisualEffects orig, CharacterBody self) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); self.UpdateSingleTemporaryVisualEffect(ref self.bearVoidTempEffectInstance, AssetReferences.bearVoidTempEffectPrefab, self.radius, self.HasBuff(BuffFactory.CatastrophicEraBuff.buffIndex) || self.HasBuff(BuffFactory.CatastrophicEraLongerBuff.buffIndex) || self.HasBuff(Buffs.BearVoidReady), ""); } private static void CatastrophicEra_CharacterBody_RemoveBuff_BuffIndex(orig_RemoveBuff_BuffIndex orig, CharacterBody self, BuffIndex buffType) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: 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_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, buffType); if (buffType == BuffFactory.CatastrophicEraBuff.buffIndex) { self.AddTimedBuff(BuffFactory.CatastrophicEraCooldownBuff.buffIndex, 0.75f); } else if (buffType == BuffFactory.CatastrophicEraLongerBuff.buffIndex && !((Object)(object)self.inventory == (Object)null)) { int itemCount = self.inventory.GetItemCount(CatastrophicEra.itemIndex); self.AddTimedBuff(BuffFactory.CatastrophicEraCooldownBuff.buffIndex, 10f - 8f * Util.ConvertAmplificationPercentageIntoReductionNormalized(20f * (float)itemCount)); } } private static void CatastrophicEra_GlobalEventManager_onServerDamageDealt(DamageReport report) { //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) if (report == null || (Object)(object)report.attackerMaster == (Object)null || (Object)(object)report.attackerMaster.inventory == (Object)null || (Object)(object)report.attackerBody == (Object)null || report.damageInfo == null) { return; } CharacterBody attackerBody = report.attackerBody; Inventory inventory = report.attackerMaster.inventory; int itemCount = inventory.GetItemCount(CatastrophicEra.itemIndex); if (itemCount <= 0) { return; } float damage = report.damageInfo.damage; if (!attackerBody.HasBuff(BuffFactory.CatastrophicEraCooldownBuff.buffIndex) && !attackerBody.HasBuff(BuffFactory.CatastrophicEraBuff.buffIndex) && !attackerBody.HasBuff(BuffFactory.CatastrophicEraLongerBuff.buffIndex)) { if (damage / attackerBody.damage >= 4f) { attackerBody.AddTimedBuff(BuffFactory.CatastrophicEraLongerBuff.buffIndex, 3f); } else if (Util.CheckRoll(Util.ConvertAmplificationPercentageIntoReductionPercentage(15f * (float)itemCount) * report.damageInfo.procCoefficient, 0f, (CharacterMaster)null)) { attackerBody.AddTimedBuff(BuffFactory.CatastrophicEraBuff.buffIndex, 0.75f); } } } private static void CatastrophicEra_TakeDamageProcess(orig_TakeDamageProcess orig, HealthComponent self, DamageInfo damageInfo) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0059: 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_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Expected O, but got Unknown if ((Object)(object)self != (Object)null && (Object)(object)self.body != (Object)null) { CharacterBody body = self.body; if (body.HasBuff(BuffFactory.CatastrophicEraBuff.buffIndex) || body.HasBuff(BuffFactory.CatastrophicEraLongerBuff.buffIndex)) { EffectData val = new EffectData { origin = damageInfo.position, rotation = Util.QuaternionSafeLookRotation((damageInfo.force != Vector3.zero) ? damageInfo.force : Random.onUnitSphere) }; EffectManager.SpawnEffect(AssetReferences.bearEffectPrefab, val, true); damageInfo.rejected = true; } } orig.Invoke(self, damageInfo); } public static ItemDef InitiateDelayedDoom() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_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) DelayedDoom = CreateItem("DELAYEDDOOM", ItemTierFactory.hallowedTier1, Addressables.LoadAssetAsync<Sprite>((object)"RoR2/DLC1/BleedOnHitVoid/texTriTipVoidIcon.png").WaitForCompletion(), Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/BleedOnHitVoid/PickupTriTipVoid.prefab").WaitForCompletion(), canRemove: true, hidden: false, null, DelayedDoomEffect, (ItemTag[])(object)new ItemTag[1] { (ItemTag)1 }); return DelayedDoom; } public static int DelayedDoomEffect() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown GlobalEventManager.onServerDamageDealt += DelayedDoom_OnServerDamageDealt; object obj = <>O.<9>__DelayedDoom_OnRemoveBuff; if (obj == null) { hook_RemoveBuff_BuffIndex val = DelayedDoom_OnRemoveBuff; <>O.<9>__DelayedDoom_OnRemoveBuff = val; obj = (object)val; } CharacterBody.RemoveBuff_BuffIndex += (hook_RemoveBuff_BuffIndex)obj; return 0; } private static void DelayedDoom_OnRemoveBuff(orig_RemoveBuff_BuffIndex orig, CharacterBody self, BuffIndex buffType) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, buffType); if (buffType == BuffFactory.DelayedDoomBuff.buffIndex) { DamageInfo val = new DamageInfo(); val.damage = self.baseDamage * 100f; val.crit = false; val.attacker = self.masterObject; val.inflictor = self.masterObject; val.position = self.corePosition; val.rejected = false; val.procChainMask = default(ProcChainMask); val.procCoefficient = 0.01f; val.damageType = DamageTypeCombo.Generic; val.damageColorIndex = (DamageColorIndex)12; self.healthComponent.TakeDamage(val); } } private static void DelayedDoom_OnServerDamageDealt(DamageReport report) { //IL_0054: 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) HealthComponent victim = report.victim; CharacterMaster attackerMaster = report.attackerMaster; if ((Object)(object)attackerMaster == (Object)null) { return; } Inventory inventory = attackerMaster.inventory; if ((Object)(object)victim == (Object)null || (Object)(object)inventory == (Object)null) { return; } int itemCount = inventory.GetItemCount(DelayedDoom.itemIndex); float num = 80f * report.damageInfo.procCoefficient; if (itemCount <= 0 || !Util.CheckRoll(num, attackerMaster)) { return; } CharacterBody body = victim.body; BuffDef ddBuff = BuffFactory.DelayedDoomBuff; if (body.HasBuff(ddBuff)) { TimedBuff val = body.timedBuffs.Find((TimedBuff tb) => tb.buffIndex == ddBuff.buffIndex); float timer = val.timer - 1f * (float)itemCount; val.timer = timer; } else { body.AddTimedBuff(ddBuff.buffIndex, 15f); } } public static ItemDef InitiateFaultyEgo() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_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) FaultyEgo = CreateItem("FAULTYEGO", ItemTierFactory.hallowedTier3, Addressables.LoadAssetAsync<Sprite>((object)"RoR2/DLC1/ExtraLifeVoid/texHippoVoidIcon.png").WaitForCompletion(), Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/ExtraLifeVoid/PickupHippoVoid.prefab").WaitForCompletion(), canRemove: true, hidden: false, null, FaultyEgoEffect, (ItemTag[])(object)new ItemTag[1] { (ItemTag)3 }); return FaultyEgo; } public static int FaultyEgoEffect() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Expected O, but got Unknown object obj = <>O.<11>__FaultyEgo_UpdateLastHitTime; if (obj == null) { hook_UpdateLastHitTime val = FaultyEgo_UpdateLastHitTime; <>O.<11>__FaultyEgo_UpdateLastHitTime = val; obj = (object)val; } HealthComponent.UpdateLastHitTime += (hook_UpdateLastHitTime)obj; GlobalEventManager.onServerDamageDealt += FaultyEgo_onServerDamageDealt; object obj2 = <>O.<13>__FaultyEgo_RemoveBuff_BuffIndex; if (obj2 == null) { hook_RemoveBuff_BuffIndex val2 = FaultyEgo_RemoveBuff_BuffIndex; <>O.<13>__FaultyEgo_RemoveBuff_BuffIndex = val2; obj2 = (object)val2; } CharacterBody.RemoveBuff_BuffIndex += (hook_RemoveBuff_BuffIndex)obj2; object obj3 = <>O.<14>__FaultyEgo_HealthComponent_Heal; if (obj3 == null) { hook_Heal val3 = FaultyEgo_HealthComponent_Heal; <>O.<14>__FaultyEgo_HealthComponent_Heal = val3; obj3 = (object)val3; } HealthComponent.Heal += (hook_Heal)obj3; return 0; } private static float FaultyEgo_HealthComponent_Heal(orig_Heal orig, HealthComponent self, float amount, ProcChainMask procChainMask, bool nonRegen) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) float num = orig.Invoke(self, amount, procChainMask, nonRegen); float num2 = amount - num; CharacterBody body = self.body; int buffCount = body.GetBuffCount(BuffFactory.BurntFaultyEgoBuff.buffIndex); if (body.GetBuffCount(BuffFactory.FaultyEgoBuff.buffIndex) > 0) { int num3 = Mathf.FloorToInt(num2); body.SetBuffCount(BuffFactory.BurntFaultyEgoBuff.buffIndex, buffCount + num3); } return num; } private static void FaultyEgo_RemoveBuff_BuffIndex(orig_RemoveBuff_BuffIndex orig, CharacterBody cb, BuffIndex buffType) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0078: 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_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(cb, buffType); if (buffType == BuffFactory.FaultyEgoBuff.buffIndex) { HealthComponent healthComponent = cb.healthComponent; int buffCount = cb.GetBuffCount(BuffFactory.BurntFaultyEgoBuff.buffIndex); if ((float)buffCount < healthComponent.fullHealth) { cb.master.TrueKill(); } else { cb.inventory.GiveItem(Items.ShinyPearl, 1); CharacterMasterNotificationQueue.SendTransformNotification(cb.master, FaultyEgoConsumed.itemIndex, Items.ShinyPearl.itemIndex, (TransformationType)0); } cb.SetBuffCount(BuffFactory.BurntFaultyEgoBuff.buffIndex, 1); cb.RemoveBuff(BuffFactory.BurntFaultyEgoBuff.buffIndex); } } private static void FaultyEgo_onServerDamageDealt(DamageReport damageReport) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) CharacterBody attackerBody = damageReport.attackerBody; if (!((Object)(object)attackerBody == (Object)null) && attackerBody.GetBuffCount(BuffFactory.FaultyEgoBuff.buffIndex) > 0) { float num = Util.OnHitProcDamage(damageReport.damageInfo.damage, attackerBody.damage, 0.4f); attackerBody.healthComponent.Heal(num, damageReport.damageInfo.procChainMask, true); } } private static void FaultyEgo_UpdateLastHitTime(orig_UpdateLastHitTime orig, HealthComponent self, float damageValue, Vector3 damagePosition, bool damageIsSilent, GameObject attacker) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_0109: 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) orig.Invoke(self, damageValue, damagePosition, damageIsSilent, attacker); CharacterBody body = self.body; if (NetworkServer.active && Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.inventory) && Object.op_Implicit((Object)(object)body.master) && damageValue > 0f && self.health < 0f) { if (body.GetBuffCount(BuffFactory.FaultyEgoBuff.buffIndex) > 0) { self.health = 1f; } else if (body.inventory.GetItemCount(FaultyEgo.itemIndex) > 0) { self.health = 1f; body.AddTimedBuff(BuffFactory.FaultyEgoBuff.buffIndex, 10f); body.inventory.RemoveItem(FaultyEgo.itemIndex, 1); body.inventory.GiveItem(FaultyEgoConsumed.itemIndex, 1); CharacterMasterNotificationQueue.SendTransformNotification(body.master, FaultyEgo.itemIndex, FaultyEgoConsumed.itemIndex, (TransformationType)0); } } } public static ItemDef InitiateFaultyEgoConsumed() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_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) FaultyEgoConsumed = CreateItem("FAULTYEGOCONSUMED", ItemTierFactory.hallowedTierBoss, Addressables.LoadAssetAsync<Sprite>((object)"RoR2/DLC1/ExtraLifeVoid/texHippoVoidIconConsumed.png").WaitForCompletion(), Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/ExtraLifeVoid/PickupHippoVoid.prefab").WaitForCompletion(), canRemove: true, hidden: false, null, FaultyEgoConsumedEffect, (ItemTag[])(object)new ItemTag[0]); return FaultyEgoConsumed; } public static int FaultyEgoConsumedEffect() { return 0; } public static ItemDef InitiateFlyingFungus() { FlyingFungus = CreateItem("FFUNGUS", ItemTierFactory.hallowedTier1, AssetFactory.FFungusAssets.icon, AssetFactory.FFungusAssets.pickup, canRemove: true, hidden: false, null, FlyingFungusEffect, (ItemTag[])(object)new ItemTag[1] { (ItemTag)2 }); return FlyingFungus; } public static int FlyingFungusEffect() { CharacterBody.onBodyInventoryChangedGlobal += FlyingFungus_onBodyInventoryChangedGlobal; return 0; } private static void FlyingFungus_onBodyInventoryChangedGlobal(CharacterBody cb) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) Inventory inventory = cb.inventory; if ((Object)(object)inventory != (Object)null) { cb.AddItemBehavior<FlyingFungusBehavior>(inventory.GetItemCount(FlyingFungus.itemIndex)); } } public static ItemDef InitiateGuitar() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_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) Guitar = CreateItem("GUITAR", ItemTierFactory.hallowedTier2, Addressables.LoadAssetAsync<Sprite>((object)"RoR2/DLC1/ChainLightningVoid/texUkuleleVoidIcon.png").WaitForCompletion(), Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/ChainLightningVoid/PickupUkuleleVoid.prefab").WaitForCompletion(), canRemove: true, hidden: false, null, GuitarEffect, (ItemTag[])(object)new ItemTag[2] { (ItemTag)3, (ItemTag)11 }); return Guitar; } private static int GuitarEffect() { GlobalEventManager.onServerDamageDealt += Guitar_onServerDamageDealt; return 0; } private static void Guitar_onServerDamageDealt(DamageReport report) { //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active || report == null || (Object)(object)report.attackerMaster == (Object)null || (Object)(object)report.attackerMaster.inventory == (Object)null || (Object)(object)report.attackerBody == (Object)null || (Object)(object)report.attackerBody.teamComponent == (Object)null || report.damageInfo == null || (Object)(object)report.victim == (Object)null || (Object)(object)report.victimBody == (Object)null) { return; } Inventory inventory = report.attackerMaster.inventory; CharacterBody attackerBody = report.attackerBody; int itemCount = inventory.GetItemCount(Guitar.itemIndex); TeamComponent component = ((Component)report.attackerBody).GetComponent<TeamComponent>(); TeamIndex teamIndex = (TeamIndex)(Object.op_Implicit((Object)(object)component) ? ((int)component.teamIndex) : 0); if (itemCount <= 0) { return; } DamageInfo damageInfo = report.damageInfo; if (Util.CheckRoll(50f * damageInfo.procCoefficient, report.attackerMaster) && !((ProcChainMask)(ref damageInfo.procChainMask)).HasProc((ProcType)3)) { attackerBody.AddBuff(BuffFactory.GuitarBuff.buffIndex); switch (attackerBody.GetBuffCount(BuffFactory.GuitarBuff.buffIndex)) { case 4: CreateUkuleleAttack(damageInfo, attackerBody, report.victim, teamIndex, 0.8f, 2 * itemCount, 2f * (float)itemCount); break; case 7: CreatePolyluteAttack(damageInfo, attackerBody, report.victimBody, teamIndex, 0.6f, 3 * itemCount); break; case 10: CreateUkuleleAttack(damageInfo, attackerBody, report.victim, teamIndex, 0.8f, 2 * itemCount, 2f * (float)itemCount); CreatePolyluteAttack(damageInfo, attackerBody, report.victimBody, teamIndex, 0.6f, 3 * itemCount); attackerBody.SetBuffCount(BuffFactory.GuitarBuff.buffIndex, 1); attackerBody.RemoveBuff(BuffFactory.GuitarBuff.buffIndex); break; default: CreateUkuleleAttack(damageInfo, attackerBody, report.victim, teamIndex, 0.4f, 0, 0f); break; } } } private static void CreateUkuleleAttack(DamageInfo damageInfo, CharacterBody attackerBody, HealthComponent victimHealthComp, TeamIndex teamIndex, float damageCoefficiant, int bounceCount, float rangeIncrease) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_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_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) float damageValue = Util.OnHitProcDamage(damageInfo.damage, attackerBody.damage, damageCoefficiant); LightningOrb val = new LightningOrb(); ((Orb)val).origin = damageInfo.position; val.damageValue = damageValue; val.isCrit = damageInfo.crit; val.bouncesRemaining = bounceCount; val.teamIndex = teamIndex; val.attacker = damageInfo.attacker; val.bouncedObjects = new List<HealthComponent> { victimHealthComp }; val.procChainMask = damageInfo.procChainMask; ((ProcChainMask)(ref val.procChainMask)).AddProc((ProcType)3); val.procCoefficient = 0.2f; val.lightningType = (LightningType)0; val.damageColorIndex = (DamageColorIndex)3; val.range += 2f * rangeIncrease; HurtBox val2 = val.PickNextTarget(damageInfo.position); if (Object.op_Implicit((Object)(object)val2)) { ((Orb)val).target = val2; OrbManager.instance.AddOrb((Orb)(object)val); } } private static void CreatePolyluteAttack(DamageInfo damageInfo, CharacterBody attackerBody, CharacterBody victimBody, TeamIndex teamIndex, float damageCoefficiant, int strikeCount) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) float damageValue = Util.OnHitProcDamage(damageInfo.damage, attackerBody.damage, damageCoefficiant); VoidLightningOrb val = new VoidLightningOrb(); ((Orb)val).origin = damageInfo.position; val.damageValue = damageValue; val.isCrit = damageInfo.crit; val.totalStrikes = strikeCount; val.teamIndex = teamIndex; val.attacker = damageInfo.attacker; val.procChainMask = damageInfo.procChainMask; ((ProcChainMask)(ref val.procChainMask)).AddProc((ProcType)3); val.procCoefficient = 0.2f; val.damageColorIndex = (DamageColorIndex)9; val.secondsPerStrike = 0.1f; HurtBox mainHurtBox = victimBody.mainHurtBox; if (Object.op_Implicit((Object)(object)mainHurtBox)) { ((Orb)val).target = mainHurtBox; OrbManager.instance.AddOrb((Orb)(object)val); } } public static ItemDef InitiateHypnoBauble() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_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) HypnoBauble = CreateItem("HYPNOBAUBLE", ItemTierFactory.hallowedTier2, Addressables.LoadAssetAsync<Sprite>((object)"RoR2/DLC1/SlowOnHitVoid/texBaubleVoidIcon.png").WaitForCompletion(), Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/SlowOnHitVoid/PickupBaubleVoid.prefab").WaitForCompletion(), canRemove: true, hidden: false, null, HypnoBaubleEffect, (ItemTag[])(object)new ItemTag[2] { (ItemTag)3, (ItemTag)11 }); return HypnoBauble; } private static int HypnoBaubleEffect() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown GlobalEventManager.onServerDamageDealt += HypnoBauble_onServerDamageDealt; object obj = <>O.<22>__HypnoBauble_UpdateAllTemporaryVisualEffects; if (obj == null) { hook_UpdateAllTemporaryVisualEffects val = HypnoBauble_UpdateAllTemporaryVisualEffects; <>O.<22>__HypnoBauble_UpdateAllTemporaryVisualEffects = val; obj = (object)val; } CharacterBody.UpdateAllTemporaryVisualEffects += (hook_UpdateAllTemporaryVisualEffects)obj; object obj2 = <>O.<23>__HypnoBauble_RemoveBuff_BuffIndex; if (obj2 == null) { hook_RemoveBuff_BuffIndex val2 = HypnoBauble_RemoveBuff_BuffIndex; <>O.<23>__HypnoBauble_RemoveBuff_BuffIndex = val2; obj2 = (object)val2; } CharacterBody.RemoveBuff_BuffIndex += (hook_RemoveBuff_BuffIndex)obj2; return 0; } private static void HypnoBauble_UpdateAllTemporaryVisualEffects(orig_UpdateAllTemporaryVisualEffects orig, CharacterBody self) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); self.UpdateSingleTemporaryVisualEffect(ref self.voidJailerSlowEffectInstance, AssetReferences.voidJailerSlowEffectPrefab, self.radius, self.HasBuff(Buffs.JailerSlow) || self.HasBuff(BuffFactory.HypnoBaubleBuff.buffIndex), ""); } private static void HypnoBauble_RemoveBuff_BuffIndex(orig_RemoveBuff_BuffIndex orig, CharacterBody self, BuffIndex buffType) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, buffType); if (buffType == BuffFactory.HypnoBaubleBuff.buffIndex) { self.baseMoveSpeed *= -1f; } } private static void HypnoBauble_onServerDamageDealt(DamageReport report) { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) if (report == null || (Object)(object)report.attackerMaster == (Object)null || (Object)(object)report.attackerMaster.inventory == (Object)null || report.damageInfo == null || (Object)(object)report.victimBody == (Object)null) { return; } CharacterBody victimBody = report.victimBody; Inventory inventory = report.attackerMaster.inventory; int itemCount = inventory.GetItemCount(HypnoBauble.itemIndex); if (itemCount > 0) { float damage = report.damageInfo.damage; if (Util.CheckRoll(5f * (float)itemCount * report.damageInfo.procCoefficient, report.attackerMaster)) { victimBody.baseMoveSpeed *= -1f; victimBody.AddTimedBuff(BuffFactory.HypnoBaubleBuff.buffIndex, 1f + 0.5f * (float)itemCount); } } } public static ItemDef InitiateIllumination() { Illumination = CreateItem("ILLUMINATION", ItemTierFactory.hallowedTier2, AssetFactory.IlluminationAssets.icon, AssetFactory.IlluminationAssets.pickup, canRemove: true, hidden: false, null, IlluminationEffect, (ItemTag[])(object)new ItemTag[2] { (ItemTag)3, (ItemTag)11 }); return Illumination; } private static int IlluminationEffect() { GlobalEventManager.onServerDamageDealt += Illumination_onServerDamageDealt; GlobalEventManager.onCharacterDeathGlobal += Illumination_onServerDamageDealt; return 0; } private static void Illumination_onServerDamageDealt(DamageReport report) { //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_0127: 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_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active || report == null || (Object)(object)report.attackerMaster == (Object)null || (Object)(object)report.attackerMaster.inventory == (Object)null || (Object)(object)report.attackerBody == (Object)null || report.damageInfo == null || (Object)(object)report.victim == (Object)null || (Object)(object)report.victimBody == (Object)null) { return; } Inventory inventory = report.attackerMaster.inventory; int itemCount = inventory.GetItemCount(Illumination.itemIndex); int buffCount = report.victimBody.GetBuffCount(BuffFactory.IlluminationBuff.buffIndex); if (itemCount <= 0 || buffCount > 0) { return; } HealthComponent victim = report.victim; DamageInfo damageInfo = report.damageInfo; float num = victim.health / victim.fullHealth; if (Util.CheckRoll(50f * (1f - num) * damageInfo.procCoefficient, report.attackerMaster) || num <= 0f) { CharacterBody attackerBody = report.attackerBody; Vector3 corePosition = report.victimBody.corePosition; float num2 = (1.5f + 4f * num) * (1f + 0.7f * (float)itemCount); float baseDamage = Util.OnKillProcDamage(attackerBody.damage, num2); GameObject val = Object.Instantiate<GameObject>(CommonAssets.explodeOnDeathPrefab, corePosition, Quaternion.identity); DelayBlast component = val.GetComponent<DelayBlast>(); if (Object.op_Implicit((Object)(object)component)) { component.position = corePosition; component.baseDamage = baseDamage; component.baseForce = 2000f; component.bonusForce = Vector3.up * 1000f; component.radius = 12f + 2.4f * ((float)itemCount - 1f); component.attacker = damageInfo.attacker; component.inflictor = null; component.crit = Util.CheckRoll(attackerBody.crit, report.attackerMaster); component.maxTimer = 0.5f; component.damageColorIndex = (DamageColorIndex)3; component.falloffModel = (FalloffModel)2; } TeamFilter component2 = val.GetComponent<TeamFilter>(); if (Object.op_Implicit((Object)(object)component2)) { component2.teamIndex = report.attackerTeamIndex; } NetworkServer.Spawn(val); report.victimBody.AddBuff(BuffFactory.IlluminationBuff.buffIndex); } } public static void InitiateItemFactory() { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Expected O, but got Unknown //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Expected O, but got Unknown InitiateBenalu(); InitiateMagnifier(); InitiateMulticast(); InitiateDelayedDoom(); InitiateFlyingFungus(); InitiateLivingRobot(); InitiateSacredMissile(); InitiateFaultyEgo(); InitiateFaultyEgoConsumed(); InitiateCatastrophicEra(); InitiateHypnoBauble(); InitiateIllumination(); InitiateGuitar(); object obj = <>O.<26>__ContagiousItemManager_Init; if (obj == null) { hook_Init val = ContagiousItemManager_Init; <>O.<26>__ContagiousItemManager_Init = val; obj = (object)val; } ContagiousItemManager.Init += (hook_Init)obj; object obj2 = <>O.<27>__ItemFactory_BuildDropTable; if (obj2 == null) { hook_BuildDropTable val2 = ItemFactory_BuildDropTable; <>O.<27>__ItemFactory_BuildDropTable = val2; obj2 = (object)val2; } Run.BuildDropTable += (hook_BuildDropTable)obj2; } private static void ItemFactory_BuildDropTable(orig_BuildDropTable orig, Run self) { //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Expected I4, but got Unknown //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); List<ItemDef> list = new List<ItemDef> { Benalu, Magnifier, Multicast, DelayedDoom, FlyingFungus, LivingRobot, SacredMissile, FaultyEgo, CatastrophicEra, HypnoBauble, Illumination, Guitar }; foreach (ItemDef item in list) { List<PickupIndex> list2 = null; ItemTier tier = item.tier; ItemTier val = tier; switch (val - 1024) { case 0: list2 = self.availableVoidTier1DropList; break; case 1: list2 = self.availableVoidTier2DropList; break; case 2: list2 = self.availableVoidTier3DropList; break; } if (list2 != null && item.DoesNotContainTag((ItemTag)9)) { list2.Add(PickupCatalog.FindPickupIndex(item.itemIndex)); } } } private static void ContagiousItemManager_Init(orig_Init orig) { InitiateContaminationPairs(); List<Pair> list = new List<Pair>(); list.AddRange(itemPairs); list.AddRange(ItemCatalog.itemRelationships[ItemRelationshipTypes.ContagiousItem]); ItemCatalog.itemRelationships[ItemRelationshipTypes.ContagiousItem] = list.ToArray(); orig.Invoke(); } public static ItemDef CreateItem(string itemToken, ItemTierDef tier, Sprite pickupIconSprite, GameObject pickupModelPrefab, bool canRemove, bool hidden, ItemDisplayRuleDict displayRule, Func<int> effect, ItemTag[] tags) { //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Expected O, but got Unknown ItemDef val = ScriptableObject.CreateInstance<ItemDef>(); ((Object)val).name = modNameCode + "_" + itemToken + "_NAME"; val.nameToken = modNameCode + "_" + itemToken + "_NAME_TOKEN"; val.pickupToken = modNameCode + "_" + itemToken + "_PICKUP"; val.descriptionToken = modNameCode + "_" + itemToken + "_DESC"; val.loreToken = modNameCode + "_" + itemToken + "_LORE"; val._itemTierDef = tier; val.pickupIconSprite = pickupIconSprite; val.pickupModelPrefab = pickupModelPrefab; val.canRemove = canRemove; val.hidden = hidden; val.tags = tags; ItemAPI.Add(new CustomItem(val, displayRule)); effect(); return val; } public static ItemDef CreateItem(string itemToken, ItemTier tier, Sprite pickupIconSprite, GameObject pickupModelPrefab, bool canRemove, bool hidden, ItemDisplayRuleDict displayRule, Func<int> effect, ItemTag[] tags) { //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Expected O, but got Unknown ItemDef val = ScriptableObject.CreateInstance<ItemDef>(); ((Object)val).name = modNameCode + "_" + itemToken + "_NAME"; val.nameToken = modNameCode + "_" + itemToken + "_NAME_TOKEN"; val.pickupToken = modNameCode + "_" + itemToken + "_PICKUP"; val.descriptionToken = modNameCode + "_" + itemToken + "_DESC"; val.loreToken = modNameCode + "_" + itemToken + "_LORE"; val.tier = tier; val.pickupIconSprite = pickupIconSprite; val.pickupModelPrefab = pickupModelPrefab; val.canRemove = canRemove; val.hidden = hidden; val.tags = tags; ItemAPI.Add(new CustomItem(val, displayRule)); effect(); return val; } private static void AddContaminationPair(ItemDef contaminated, ItemDef contaminator) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) Pair val = default(Pair); val.itemDef1 = contaminated; val.itemDef2 = contaminator; Pair item = val; itemPairs.Add(item); } private static void InitiateContaminationPairs() { AddContaminationPair(Items.Clover, Benalu); AddContaminationPair(Items.BleedOnHit, DelayedDoom); AddContaminationPair(Items.CritGlasses, Magnifier); AddContaminationPair(Items.EquipmentMagazine, Multicast); AddContaminationPair(Items.Mushroom, FlyingFungus); AddContaminationPair(Items.Missile, SacredMissile); AddContaminationPair(Items.ScrapRed, LivingRobot); AddContaminationPair(Items.ScrapYellow, LivingRobot); AddContaminationPair(Items.ExtraLife, FaultyEgo); AddContaminationPair(Items.Bear, CatastrophicEra); AddContaminationPair(Items.SlowOnHit, HypnoBauble); AddContaminationPair(Items.ExplodeOnDeath, Illumination); AddContaminationPair(Items.ChainLightning, Guitar); } public static ItemDef InitiateLivingRobot() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_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) LivingRobot = CreateItem("LIVINGROBOT", ItemTierFactory.hallowedTier3, Addressables.LoadAssetAsync<Sprite>((object)"RoR2/DLC1/texMegaCrabItem.png").WaitForCompletion(), Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/PickupMegaCrabItem.prefab").WaitForCompletion(), canRemove: true, hidden: false, null, LivingRobotEffect, (ItemTag[])(object)new ItemTag[1] { (ItemTag)3 }); return LivingRobot; } private static int LivingRobotEffect() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown CharacterBody.onBodyInventoryChangedGlobal += LivingRobot_onBodyInventoryChangedGlobal; object obj = <>O.<30>__LivingRobot_GetDeployableSameSlotLimit; if (obj == null) { hook_GetDeployableSameSlotLimit val = LivingRobot_GetDeployableSameSlotLimit; <>O.<30>__LivingRobot_GetDeployableSameSlotLimit = val; obj = (object)val; } CharacterMaster.GetDeployableSameSlotLimit += (hook_GetDeployableSameSlotLimit)obj; return 0; } private static void LivingRobot_onBodyInventoryChangedGlobal(CharacterBody cb) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) Inventory inventory = cb.inventory; if ((Object)(object)inventory != (Object)null) { cb.AddItemBehavior<LivingRobotBehavior>(inventory.GetItemCount(LivingRobot.itemIndex)); } } private static int LivingRobot_GetDeployableSameSlotLimit(orig_GetDeployableSameSlotLimit orig, CharacterMaster self, DeployableSlot slot) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) if (slot == LivingRobotBehavior.dsLivingRobot) { return LivingRobotBehavior.GetMaxProjectiles(self.inventory); } return orig.Invoke(self, slot); } public static ItemDef InitiateMagnifier() { Magnifier = CreateItem("TWOTAP", ItemTierFactory.hallowedTier1, AssetFactory.MagnifierAssets.icon, AssetFactory.MagnifierAssets.pickup, canRemove: true, hidden: false, null, MagnifierEffect, (ItemTag[])(object)new ItemTag[1] { (ItemTag)1 }); return Magnifier; } public static int MagnifierEffect() { GlobalEventManager.onServerDamageDealt += Magnifier_OnServerDamageDealt; return 0; } private static void Magnifier_OnServerDamageDealt(DamageReport report) { //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Expected O, but got Unknown //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) HealthComponent victim = report.victim; CharacterMaster attackerMaster = report.attackerMaster; if ((Object)(object)attackerMaster == (Object)null) { return; } Inventory component = ((Component)attackerMaster).GetComponent<Inventory>(); if ((Object)(object)victim != (Object)null && (Object)(object)component != (Object)null) { DamageInfo damageInfo = report.damageInfo; int itemCount = component.GetItemCount(Magnifier.itemIndex); float num = Math.Min((float)(5 + 5 * itemCount) * damageInfo.procCoefficient, 90f); if (itemCount > 0 && Util.CheckRoll(num, attackerMaster)) { DamageInfo val = new DamageInfo(); val.procCoefficient = damageInfo.procCoefficient / 2f; val.damage = damageInfo.damage / 4f; val.crit = true; val.position = damageInfo.position; val.force = damageInfo.force; val.attacker = damageInfo.attacker; val.canRejectForce = damageInfo.canRejectForce; val.damageColorIndex = damageInfo.damageColorIndex; val.damageType = damageInfo.damageType; val.delayedDamageSecondHalf = damageInfo.delayedDamageSecondHalf; val.dotIndex = damageInfo.dotIndex; val.rejected = damageInfo.rejected; val.inflictor = damageInfo.inflictor; victim.TakeDamage(val); } } } public static ItemDef InitiateMulticast() { Multicast = CreateItem("MULTICAST", ItemTierFactory.hallowedTier2, AssetFactory.OgreCellAssets.icon, AssetFactory.OgreCellAssets.pickup, canRemove: true, hidden: false, null, MulticastEffect, (ItemTag[])(object)new ItemTag[1] { (ItemTag)3 }); return Multicast; } public static int MulticastEffect() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown EquipmentSlot.onServerEquipmentActivated += Multicast_onServerEquipmentActivated; object obj = <>O.<35>__Multicast_RemoveBuff_BuffIndex; if (obj == null) { hook_RemoveBuff_BuffIndex val = Multicast_RemoveBuff_BuffIndex; <>O.<35>__Multicast_RemoveBuff_BuffIndex = val; obj = (object)val; } CharacterBody.RemoveBuff_BuffIndex += (hook_RemoveBuff_BuffIndex)obj; return 0; } private static void Multicast_RemoveBuff_BuffIndex(orig_RemoveBuff_BuffIndex orig, CharacterBody self, BuffIndex buffType) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) if (buffType == BuffFactory.DoublecastBuff.buffIndex || buffType == BuffFactory.TriplecastBuff.buffIndex) { EquipmentSlot equipmentSlot = self.equipmentSlot; if ((Object)(object)equipmentSlot != (Object)null) { equipmentSlot.Execute(); } } if (buffType == BuffFactory.TriplecastBuff.buffIndex) { self.AddTimedBuff(BuffFactory.DoublecastBuff.buffIndex, 0.5f); } orig.Invoke(self, buffType); } private static void Multicast_onServerEquipmentActivated(EquipmentSlot slot, EquipmentIndex index) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_003f: 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_009d: Unknown result type (might be due to invalid IL or missing references) CharacterBody characterBody = slot.characterBody; Inventory inventory = characterBody.inventory; CharacterMaster master = characterBody.master; int itemCount = inventory.GetItemCount(Multicast.itemIndex); if (characterBody.HasBuff(BuffFactory.DoublecastBuff.buffIndex) || characterBody.HasBuff(BuffFactory.TriplecastBuff.buffIndex) || itemCount <= 0) { return; } float num = 40f + 10f * (float)itemCount; if (Util.CheckRoll(num, master)) { float num2 = 20f + 5f * (float)itemCount; if (Util.CheckRoll(num2, master)) { characterBody.AddTimedBuff(BuffFactory.TriplecastBuff.buffIndex, 0.5f); } else { characterBody.AddTimedBuff(BuffFactory.DoublecastBuff.buffIndex, 0.5f); } } } public static ItemDef InitiateSacredMissile() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_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) SacredMissile = CreateItem("SACREDMISSILE", ItemTierFactory.hallowedTier2, Addressables.LoadAssetAsync<Sprite>((object)"RoR2/DLC1/MissileVoid/texMissileLauncherVoidIcon.png").WaitForCompletion(), Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/MissileVoid/PickupMissileLauncherVoid.prefab").WaitForCompletion(), canRemove: true, hidden: false, null, SacredMissileEffect, (ItemTag[])(object)new ItemTag[1] { (ItemTag)1 }); return SacredMissile; } public static int SacredMissileEffect() { GlobalEventManager.onServerDamageDealt += SacredMissile_onServerDamageDealt; return 0; } private static void SacredMissile_onServerDamageDealt(DamageReport report) { //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Expected O, but got Unknown //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) if (report.damageInfo == null || (Object)(object)report.victim == (Object)null || (Object)(object)((Component)report.victim).gameObject == (Object)null) { return; } DamageInfo damageInfo = report.damageInfo; GameObject gameObject = ((Component)report.victim).gameObject; GameObject attacker = damageInfo.attacker; if ((Object)(object)attacker == (Object)null) { return; } CharacterBody component = attacker.GetComponent<CharacterBody>(); if (!Object.op_Implicit((Object)(object)component)) { return; } CharacterMaster master = component.master; if (!Object.op_Implicit((Object)(object)master)) { return; } Inventory inventory = master.inventory; if (((ProcChainMask)(ref damageInfo.procChainMask)).HasProc((ProcType)1)) { return; } int itemCount = inventory.GetItemCount(SacredMissile.itemIndex); if (itemCount > 0) { float num = component.healthComponent.health / component.maxHealth; if (num > 0.91f && Util.CheckRoll(100f * damageInfo.procCoefficient, master)) { float num2 = 0.7f * (float)itemCount; float num3 = Util.OnHitProcDamage(damageInfo.damage, component.damage, num2); GameObject missilePrefab = CommonAssets.missilePrefab; MissileUtils.FireMissile(component.corePosition, component, damageInfo.procChainMask, gameObject, num3, damageInfo.crit, missilePrefab, (DamageColorIndex)3, true); DamageInfo val = new DamageInfo(); val.damage = component.maxHealth / 40f; val.crit = false; val.position = component.corePosition; val.rejected = false; val.procChainMask = default(ProcChainMask); val.procCoefficient = 0f; val.damageType = DamageTypeCombo.Generic; val.damageColorIndex = (DamageColorIndex)0; component.healthComponent.TakeDamage(val); } } } } } namespace HallowedPlugin.CustomBehavior { public class CustomBehaviorInitiator { public static void Initiate() { EqualContamination.InitiateEqualContamination(); } } internal class EqualContamination { [CompilerGenerated] private static class <>O { public static hook_GiveItem_ItemIndex_int <0>__Inventory_GiveItem_ItemIndex_int; public static hook_Init <1>__ContagiousItemManager_Init; } private static Dictionary<ItemIndex, List<ItemIndex>> transformedToOriginal = new Dictionary<ItemIndex, List<ItemIndex>>(); private static List<ItemIndex> toBeCheckedIndex = new List<ItemIndex>(); public static void InitiateEqualContamination() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown object obj = <>O.<0>__Inventory_GiveItem_ItemIndex_int; if (obj == null) { hook_GiveItem_ItemIndex_int val = Inventory_GiveItem_ItemIndex_int; <>O.<0>__Inventory_GiveItem_ItemIndex_int = val; obj = (object)val; } Inventory.GiveItem_ItemIndex_int += (hook_GiveItem_ItemIndex_int)obj; object obj2 = <>O.<1>__ContagiousItemManager_Init; if (obj2 == null) { hook_Init val2 = ContagiousItemManager_Init; <>O.<1>__ContagiousItemManager_Init = val2; obj2 = (object)val2; } ContagiousItemManager.Init += (hook_Init)obj2; } private static void Inventory_GiveItem_ItemIndex_int(orig_GiveItem_ItemIndex_int orig, Inventory self, ItemIndex contaminator, int contaminatorCount) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) if (toBeCheckedIndex.Contains(contaminator)) { transformedToOriginal.TryGetValue(contaminator, out var value); foreach (ItemIndex item in value) { int itemCount = self.GetItemCount(item); if (itemCount > 0) { self.RemoveItem(item, itemCount); contaminatorCount += itemCount; CharacterMaster component = ((Component)self).GetComponent<CharacterMaster>(); if (Object.op_Implicit((Object)(object)component)) { CharacterMasterNotificationQueue.SendTransformNotification(component, item, contaminator, (TransformationType)1); } } } } orig.Invoke(self, contaminator, contaminatorCount); } private static void ContagiousItemManager_Init(orig_Init orig) { InitiateContaminationPairs(); orig.Invoke(); } private static void InitiateContaminationPairs() { AddContaminationPair(Items.CloverVoid, ItemFactory.Benalu); AddContaminationPair(Items.BleedOnHitVoid, ItemFactory.DelayedDoom); AddContaminationPair(Items.CritGlassesVoid, ItemFactory.Magnifier); AddContaminationPair(Items.EquipmentMagazineVoid, ItemFactory.Multicast); AddContaminationPair(Items.MushroomVoid, ItemFactory.FlyingFungus); AddContaminationPair(Items.VoidMegaCrabItem, ItemFactory.LivingRobot); AddContaminationPair(Items.MissileVoid, ItemFactory.SacredMissile); AddContaminationPair(Items.ExtraLifeVoid, ItemFactory.FaultyEgo); AddContaminationPair(Items.ElementalRingVoid, Items.FireRing); AddContaminationPair(Items.ElementalRingVoid, Items.IceRing); AddContaminationPair(Items.BearVoid, ItemFactory.CatastrophicEra); AddContaminationPair(Items.SlowOnHitVoid, ItemFactory.HypnoBauble); AddContaminationPair(Items.ExplodeOnDeathVoid, ItemFactory.Illumination); AddContaminationPair(Items.ChainLightningVoid, ItemFactory.Guitar); } private static void AddContaminationPair(ItemDef itemDef1, ItemDef itemDef2) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) ItemIndex val = ItemCatalog.FindItemIndex(((Object)itemDef1).name); ItemIndex val2 = ItemCatalog.FindItemIndex(((Object)itemDef2).name); List<ItemIndex> value = null; if (transformedToOriginal.TryGetValue(val, out value)) { value.Add(val2); transformedToOriginal[val] = value; } else { transformedToOriginal.Add(val, new List<ItemIndex> { val2 }); } List<ItemIndex> value2 = null; if (transformedToOriginal.TryGetValue(val2, out value2)) { value.Add(val); transformedToOriginal[val2] = value2; } else { transformedToOriginal.Add(val2, new List<ItemIndex> { val }); } toBeCheckedIndex.Add(val); toBeCheckedIndex.Add(val2); } } } namespace HallowedPlugin.Buffs { public class BuffFactory { public static BuffDef affixHallowedBuff; public static BuffDef CatastrophicEraBuff; public static BuffDef CatastrophicEraLongerBuff; public static BuffDef CatastrophicEraCooldownBuff; public static BuffDef DelayedDoomBuff; public static BuffDef FaultyEgoBuff; public static BuffDef BurntFaultyEgoBuff; public static BuffDef FlyingFungusBuff; public static BuffDef GuitarBuff; public static BuffDef HypnoBaubleBuff; public static BuffDef IlluminationBuff; public static BuffDef DoublecastBuff; public static BuffDef TriplecastBuff; public static BuffDef CreateAffixHallowedBuff() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) affixHallowedBuff = CreateBuff("AffixHallowed", isDebuff: false, Color.yellow, canStack: false, null, isHidden: true); GlobalEventManager.onCharacterDeathGlobal += AffixHallowedBuff_onCharacterDeathGlobal; EliteDef val = ScriptableObject.CreateInstance<EliteDef>(); return affixHallowedBuff; } private static void AffixHallowedBuff_onCharacterDeathGlobal(DamageReport obj) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: 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) CharacterBody victimBody = obj.victimBody; if (victimBody.HasBuff(affixHallowedBuff.buffIndex)) { Transform component = ((Component)victimBody).GetComponent<Transform>(); if ((Object)(object)component != (Object)null) { Vector3 val = Vector3.up * 1.5f + component.position; Vector3 val2 = Vector3.up * 1.5f + Vector3.forward * 1.5f; PickupDropletController.CreatePickupDroplet(PickupCatalog.FindPickupIndex(ItemFactory.Magnifier.itemIndex), val, val2); } } } public static void InitiateBuffFactory() { CreateDoublecastBuff(); CreateTriplecastBuff(); CreateDelayedDoomBuff(); CreateFlyingFungusBuff(); CreateFaultyEgoBuff(); CreateCatastrophicEraBuff(); CreateHypnoBaubleBuff(); CreateIlluminationBuff(); CreateGuitarBuff(); } public static BuffDef CreateBuff(string name, bool isDebuff, Color buffColor, bool canStack, Sprite iconSprite, bool isHidden) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) BuffDef val = ScriptableObject.CreateInstance<BuffDef>(); ((Object)val).name = name; val.isDebuff = isDebuff; val.buffColor = buffColor; val.canStack = canStack; val.iconSprite = iconSprite; val.isHidden = isHidden; ContentAddition.AddBuffDef(val); return val; } public static BuffDef CreateCatastrophicEraBuff() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) CatastrophicEraBuff = CreateBuff("Hallowed: Catastrophic Era Buff", isDebuff: false, Color.yellow, canStack: false, Addressables.LoadAssetAsync<Sprite>((object)"RoR2/DLC1/BearVoid/texBuffBearVoidReady.tif").WaitForCompletion(), isHidden: false); CatastrophicEraLongerBuff = CreateBuff("Hallowed: Catastrophic Era Buff, but longer", isDebuff: false, Color.white, canStack: false, Addressables.LoadAssetAsync<Sprite>((object)"RoR2/DLC1/BearVoid/texBuffBearVoidReady.tif").WaitForCompletion(), isHidden: false); CatastrophicEraCooldownBuff = CreateBuff("Hallowed: Catastrophic Era Cooldown Buff", isDebuff: false, Color.gray, canStack: false, Addressables.LoadAssetAsync<Sprite>((object)"RoR2/DLC1/BearVoid/texBuffBearVoidReady.tif").WaitForCompletion(), isHidden: false); return CatastrophicEraBuff; } public static BuffDef CreateDelayedDoomBuff() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) DelayedDoomBuff = CreateBuff("Hallowed: Delayed Doom countdown", isDebuff: true, Color.black, canStack: false, Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/Bandit2/texBuffBanditSkullIcon.tif").WaitForCompletion(), isHidden: false); return DelayedDoomBuff; } public static BuffDef CreateFaultyEgoBuff() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) FaultyEgoBuff = CreateBuff("Hallowed: E.G.O!", isDebuff: false, Color.blue, canStack: true, Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/Common/texBuffOnFireIcon.tif").WaitForCompletion(), isHidden: false); BurntFaultyEgoBuff = CreateBuff("Hallowed: Burnt E.G.O", isDebuff: false, Color.black, canStack: true, Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/Common/texBuffOnFireIcon.tif").WaitForCompletion(), isHidden: false); return FaultyEgoBuff; } public static BuffDef CreateFlyingFungusBuff() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) FlyingFungusBuff = CreateBuff("Hallowed: Healing flight", isDebuff: false, Color.yellow, canStack: true, Addressables.LoadAssetAsync<Sprite>((object)"RoR2/DLC1/MushroomVoid/texBuffMushroomVoidIcon.tif").WaitForCompletion(), isHidden: false); return FlyingFungusBuff; } public static BuffDef CreateGuitarBuff() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) GuitarBuff = CreateBuff("Hallowed: Guitar Buff", isDebuff: false, Color.yellow, canStack: true, Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/ShockNearby/texBuffTeslaIcon.tif").WaitForCompletion(), isHidden: true); return GuitarBuff; } public static BuffDef CreateHypnoBaubleBuff() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) HypnoBaubleBuff = CreateBuff("Hallowed: Fypno Bauble Buff", isDebuff: true, Color.yellow, canStack: false, Addressables.LoadAssetAsync<Sprite>((object)"RoR2/DLC1/MushroomVoid/texBuffMushroomVoidIcon.tif").WaitForCompletion(), isHidden: true); return HypnoBaubleBuff; } public static BuffDef CreateIlluminationBuff() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) IlluminationBuff = CreateBuff("Hallowed: Illumination Buff", isDebuff: false, Color.yellow, canStack: false, Addressables.LoadAssetAsync<Sprite>((object)"RoR2/DLC1/MushroomVoid/texBuffMushroomVoidIcon.tif").WaitForCompletion(), isHidden: true); return IlluminationBuff; } public static BuffDef CreateDoublecastBuff() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) DoublecastBuff = CreateBuff("Hallowed: Doublecast countdown", isDebuff: false, Color.gray, canStack: true, Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/EnergizedOnEquipmentUse/texBuffWarHornIcon.tif").WaitForCompletion(), isHidden: false); return DoublecastBuff; } public static BuffDef CreateTriplecastBuff() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) TriplecastBuff = CreateBuff("Hallowed: Triplecast countdown", isDebuff: false, Color.white, canStack: true, Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/EnergizedOnEquipmentUse/texBuffWarHornIcon.tif").WaitForCompletion(), isHidden: false); return TriplecastBuff; } } public class BuffDefWithAttacker : BuffDef { public GameObject attacker; public BuffDefWithAttacker() { attacker = null; } public BuffDefWithAttacker(GameObject attacker) { this.attacker = attacker; } } } namespace HallowedPlugin.Assets { internal static class AssetFactory { internal struct ItemAssets { public GameObject pickup; public Sprite icon; } internal static ItemAssets OgreCellAssets; internal static ItemAssets MagnifierAssets; internal static ItemAssets FFungusAssets; internal static ItemAssets IlluminationAssets; internal static void InitiateAssets() { using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("HallowedPlugin.hallowedmod"); AssetBundle val = AssetBundle.LoadFromStream(stream); OgreCellAssets.pickup = val.LoadAsset<GameObject>("Assets/Import/OgreCell/OgreCellPickup.prefab"); OgreCellAssets.icon = val.LoadAsset<Sprite>("Assets/Import/OgreCell/OgreCellIcon.png"); MagnifierAssets.pickup = val.LoadAsset<GameObject>("Assets/Import/Magnifier/MagnifierPickup.prefab"); MagnifierAssets.icon = val.LoadAsset<Sprite>("Assets/Import/Magnifier/MagnifierIcon.png"); FFungusAssets.pickup = val.LoadAsset<GameObject>("Assets/Import/FFungus/FFungusPickup.prefab"); FFungusAssets.icon = val.LoadAsset<Sprite>("Assets/Import/FFungus/FFungusIcon.png"); IlluminationAssets.pickup = val.LoadAsset<GameObject>("Assets/Import/InnerFlame/InnerFlamePickup.prefab"); IlluminationAssets.icon = val.LoadAsset<Sprite>("Assets/Import/InnerFlame/InnerFlameIcon.png"); } } }