Some mods may be broken due to the recent Alloyed Collective update.
Decompiled source of Expedition v0.1.6
EXPEDITION.dll
Decompiled 2 weeks ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Timers; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using EntityStates; using ExpeditionDemo; using HG; using HG.Reflection; using IL.RoR2; using Microsoft.CodeAnalysis; using Mono.Cecil; using Mono.Cecil.Cil; using MonoMod.Cil; using MoreStats; using On.RoR2; using On.RoR2.UI; using R2API; using R2API.ScriptableObjects; using RoR2; using RoR2.Achievements; using RoR2.Achievements.Artifacts; using RoR2.ExpansionManagement; using RoR2.Projectile; using RoR2.UI; using ShaderSwapper; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.Rendering; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: OptIn] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: AssemblyCompany("EXPEDITION")] [assembly: AssemblyProduct("EXPEDITION")] [assembly: AssemblyTitle("EXPEDITION")] [assembly: AssemblyInformationalVersion("1.0.0+503a29858cdc09f3deb6f46ce97aa0a5aeb737d2")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [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 { [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] [Microsoft.CodeAnalysis.Embedded] [CompilerGenerated] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace EXPEDITION.Junk { public class WingsRotation : NetworkBehaviour { [SyncVar] public GameObject currentWings; [SyncVar] private Transform wingsTransform; [SyncVar] public float wingsSizeModifier; [SyncVar] public GameObject theOneWhoIsWinging; private NetworkInstanceId ___currentWingsNetId; private NetworkInstanceId ___theOneWhoIsWingingNetId; private static int kRpcRpcSetupWings; public GameObject NetworkcurrentWings { get { return currentWings; } [param: In] set { ((NetworkBehaviour)this).SetSyncVarGameObject(value, ref currentWings, 1u, ref ___currentWingsNetId); } } public Transform NetworkwingsTransform { get { return wingsTransform; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar<Transform>(value, ref wingsTransform, 2u); } } public float NetworkwingsSizeModifier { get { return wingsSizeModifier; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar<float>(value, ref wingsSizeModifier, 4u); } } public GameObject NetworktheOneWhoIsWinging { get { return theOneWhoIsWinging; } [param: In] set { ((NetworkBehaviour)this).SetSyncVarGameObject(value, ref theOneWhoIsWinging, 8u, ref ___theOneWhoIsWingingNetId); } } private void OnEnable() { } private void OnDestroy() { Object.Destroy((Object)(object)currentWings); } [ClientRpc] public void RpcSetupWings() { //IL_005c: Unknown result type (might be due to invalid IL or missing references) NetworkcurrentWings = theOneWhoIsWinging.GetComponent<Feathers2Behaviour>().wingusDingus; NetworkwingsSizeModifier = theOneWhoIsWinging.GetComponent<CharacterBody>().radius; currentWings.transform.localScale = new Vector3(1.5f * wingsSizeModifier, 1.5f * wingsSizeModifier, 1.5f * wingsSizeModifier); currentWings.transform.SetParent(theOneWhoIsWinging.GetComponent<CharacterBody>().coreTransform); } private void UNetVersion() { } protected static void InvokeRpcRpcSetupWings(NetworkBehaviour obj, NetworkReader reader) { if (!NetworkClient.active) { Debug.LogError((object)"RPC RpcSetupWings called on server."); } else { ((WingsRotation)(object)obj).RpcSetupWings(); } } public void CallRpcSetupWings() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { Debug.LogError((object)"RPC Function RpcSetupWings called on client."); return; } NetworkWriter val = new NetworkWriter(); val.Write((short)0); val.Write((short)2); val.WritePackedUInt32((uint)kRpcRpcSetupWings); val.Write(((Component)this).GetComponent<NetworkIdentity>().netId); ((NetworkBehaviour)this).SendRPCInternal(val, 0, "RpcSetupWings"); } static WingsRotation() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown kRpcRpcSetupWings = -214307129; NetworkBehaviour.RegisterRpcDelegate(typeof(WingsRotation), kRpcRpcSetupWings, new CmdDelegate(InvokeRpcRpcSetupWings)); NetworkCRC.RegisterBehaviour("WingsRotation", 0); } public override bool OnSerialize(NetworkWriter writer, bool forceAll) { if (forceAll) { writer.Write(currentWings); writer.Write(wingsTransform); writer.Write(wingsSizeModifier); writer.Write(theOneWhoIsWinging); return true; } bool flag = false; if ((((NetworkBehaviour)this).syncVarDirtyBits & (true ? 1u : 0u)) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } writer.Write(currentWings); } if ((((NetworkBehaviour)this).syncVarDirtyBits & 2u) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } writer.Write(wingsTransform); } if ((((NetworkBehaviour)this).syncVarDirtyBits & 4u) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } writer.Write(wingsSizeModifier); } if ((((NetworkBehaviour)this).syncVarDirtyBits & 8u) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } writer.Write(theOneWhoIsWinging); } if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); } return flag; } public override void OnDeserialize(NetworkReader reader, bool initialState) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) if (initialState) { ___currentWingsNetId = reader.ReadNetworkId(); wingsTransform = reader.ReadTransform(); wingsSizeModifier = reader.ReadSingle(); ___theOneWhoIsWingingNetId = reader.ReadNetworkId(); return; } int num = (int)reader.ReadPackedUInt32(); if (((uint)num & (true ? 1u : 0u)) != 0) { currentWings = reader.ReadGameObject(); } if (((uint)num & 2u) != 0) { wingsTransform = reader.ReadTransform(); } if (((uint)num & 4u) != 0) { wingsSizeModifier = reader.ReadSingle(); } if (((uint)num & 8u) != 0) { theOneWhoIsWinging = reader.ReadGameObject(); } } public override void PreStartClient() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) if (!((NetworkInstanceId)(ref ___currentWingsNetId)).IsEmpty()) { NetworkcurrentWings = ClientScene.FindLocalObject(___currentWingsNetId); } if (!((NetworkInstanceId)(ref ___theOneWhoIsWingingNetId)).IsEmpty()) { NetworktheOneWhoIsWinging = ClientScene.FindLocalObject(___theOneWhoIsWingingNetId); } } } } namespace ExpeditionDemo { [RegisterAchievement("ARTIFACT_DESTINATION", "ACHIEVEMENT_EXPEDITION_DESTINATION", null, 3u, null)] public class DestinationAchievement : BaseObtainArtifactAchievement { public override ArtifactDef artifactDef => Destination.Instance.artifactDef; } [RegisterAchievement("EXPEDITION_BIODUDE", "ACHIEVEMENT_EXPEDITION_BIODUDE", null, 3u, typeof(BiodudeAchievementTracker))] public class BiodudeAchievement : BaseAchievement { public class BiodudeAchievementTracker : BaseServerAchievement { public override void OnInstall() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown ((BaseServerAchievement)this).OnInstall(); CharacterBody.FixedUpdate += new hook_FixedUpdate(CheckDebuffsOnCharacter); } private void CheckDebuffsOnCharacter(orig_FixedUpdate orig, CharacterBody self) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Invalid comparison between Unknown and I4 //IL_0076: 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_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Invalid comparison between Unknown and I4 //IL_00a3: 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_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); int num = 0; BuffIndex[] debuffBuffIndices = BuffCatalog.debuffBuffIndices; BuffIndex[] array = debuffBuffIndices; foreach (BuffIndex val in array) { if (Object.op_Implicit((Object)(object)self) && self.HasBuff(val) && ((BaseServerAchievement)this).IsCurrentBody(self)) { num++; } } DotController val2 = DotController.FindDotController(((Component)self).gameObject); if (Object.op_Implicit((Object)(object)val2)) { for (DotIndex val3 = (DotIndex)0; (int)val3 < 12; val3 = (DotIndex)(val3 + 1)) { if (val2.HasDotActive(val3)) { num++; } } for (DotIndex val4 = (DotIndex)1; (int)val4 < 12; val4 = (DotIndex)(val4 + 1)) { if (val2.HasDotActive(val4)) { num++; } } } if (Object.op_Implicit((Object)(object)self) && num >= 6) { num = 0; ((BaseServerAchievement)this).Grant(); } } public override void OnUninstall() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown CharacterBody.FixedUpdate -= new hook_FixedUpdate(CheckDebuffsOnCharacter); ((BaseServerAchievement)this).OnUninstall(); } } public override void OnInstall() { ((BaseAchievement)this).OnInstall(); ((BaseAchievement)this).SetServerTracked(true); } public override void OnUninstall() { ((BaseAchievement)this).OnUninstall(); } } [RegisterAchievement("EXPEDITION_COMPASS", "ACHIEVEMENT_EXPEDITION_COMPASS", null, 2u, null)] public class CompassAchievement : BaseAchievement { public override void OnInstall() { ((BaseAchievement)this).OnInstall(); SceneExitController.onBeginExit += OnSceneBeginExit; } private void OnSceneBeginExit(SceneExitController controller) { Check(); } private void Check() { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Invalid comparison between Unknown and I4 //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Invalid comparison between Unknown and I4 //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Invalid comparison between Unknown and I4 //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Invalid comparison between Unknown and I4 if (!Object.op_Implicit((Object)(object)SceneCatalog.currentSceneDef.destinationsGroup)) { return; } List<PurchaseInteraction> instancesList = InstanceTracker.GetInstancesList<PurchaseInteraction>(); List<BarrelInteraction> instancesList2 = InstanceTracker.GetInstancesList<BarrelInteraction>(); short num = 0; for (int i = 0; i < instancesList.Count; i++) { if (instancesList[i].available && (int)instancesList[i].costType != 4 && (int)instancesList[i].costType != 5 && (int)instancesList[i].costType != 6 && (int)instancesList[i].costType != 10) { return; } num++; } short num2 = 0; for (int j = 0; j < instancesList2.Count; j++) { if (!instancesList2[j].opened) { return; } num2++; } if (num == instancesList.Count && num2 == instancesList2.Count) { instancesList = null; num = 0; instancesList2 = null; num2 = 0; ((BaseAchievement)this).Grant(); } } public override void OnUninstall() { SceneExitController.onBeginExit -= OnSceneBeginExit; ((BaseAchievement)this).OnUninstall(); } } [RegisterAchievement("EXPEDITION_CYCLE", "ACHIEVEMENT_EXPEDITION_CYCLE", null, 2u, typeof(CycleAchievementTracker))] public class CycleAchievement : BaseAchievement { public class CycleAchievementTracker : BaseServerAchievement { public override void OnInstall() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown ((BaseServerAchievement)this).OnInstall(); CharacterBody.FixedUpdate += new hook_FixedUpdate(CheckHoursToGrant); } private void CheckHoursToGrant(orig_FixedUpdate orig, CharacterBody self) { orig.Invoke(self); if (Object.op_Implicit((Object)(object)self) && ((BaseServerAchievement)this).IsCurrentBody(self)) { LocalUser val = LocalUserManager.localUsersList[((NetworkBehaviour)self).playerControllerId + 1]; if (val.userProfile.totalLoginSeconds >= 360000) { val = null; ((BaseServerAchievement)this).Grant(); } } } public override void OnUninstall() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown CharacterBody.FixedUpdate -= new hook_FixedUpdate(CheckHoursToGrant); ((BaseServerAchievement)this).OnUninstall(); } } public override void OnInstall() { ((BaseAchievement)this).OnInstall(); ((BaseAchievement)this).SetServerTracked(true); } public override void OnUninstall() { ((BaseAchievement)this).OnUninstall(); } } [RegisterAchievement("EXPEDITION_HEATCORE", "ACHIEVEMENT_EXPEDITION_HEATCORE", null, 5u, typeof(HeatcoreAchievementTracker))] public class HeatcoreAchievement : BaseAchievement { public class HeatcoreAchievementTracker : BaseServerAchievement { private bool flag = false; public override void OnInstall() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown ((BaseServerAchievement)this).OnInstall(); CharacterBody.FixedUpdate += new hook_FixedUpdate(CheckCharacterEquip); Run.onServerGameOver += Run_onServerGameOver; } private void CheckCharacterEquip(orig_FixedUpdate orig, CharacterBody self) { //IL_0026: 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) orig.Invoke(self); if (Object.op_Implicit((Object)(object)self) && ((BaseServerAchievement)this).IsCurrentBody(self)) { if (self.equipmentSlot.equipmentIndex == Equipment.QuestVolatileBattery.equipmentIndex) { flag = true; } else { flag = false; } } } private void Run_onServerGameOver(Run run, GameEndingDef gameEndingDef) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown CharacterBody.FixedUpdate -= new hook_FixedUpdate(CheckCharacterEquip); if (flag && (Object)(object)gameEndingDef == (Object)(object)GameEndings.MainEnding) { flag = false; ((BaseServerAchievement)this).Grant(); } } public override void OnUninstall() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown CharacterBody.FixedUpdate -= new hook_FixedUpdate(CheckCharacterEquip); Run.onServerGameOver -= Run_onServerGameOver; ((BaseServerAchievement)this).OnUninstall(); } } public override void OnInstall() { ((BaseAchievement)this).OnInstall(); ((BaseAchievement)this).SetServerTracked(true); } public override void OnUninstall() { ((BaseAchievement)this).OnUninstall(); } } [RegisterAchievement("EXPEDITION_SHITTYCAPE", "ACHIEVEMENT_EXPEDITION_SHITTYCAPE", null, 1u, typeof(ShittyCapeAchievementTracker))] public class ShittyCapeAchievement : BaseAchievement { public class ShittyCapeAchievementTracker : BaseServerAchievement { private float timer = 2f; private bool isTimerActive = false; private int amountOfStrikes = 1; public override void OnInstall() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown ((BaseServerAchievement)this).OnInstall(); CharacterBody.FixedUpdate += new hook_FixedUpdate(FixedUpdate); GlobalEventManager.onServerDamageDealt += onServerDamageDealt; } private void onServerDamageDealt(DamageReport report) { if (((BaseServerAchievement)this).IsCurrentBody(report.victimBody) && !report.isFallDamage && (Object)(object)report.attackerBody != (Object)(object)report.victimBody) { if (isTimerActive) { amountOfStrikes++; } else { isTimerActive = true; } } } private void FixedUpdate(orig_FixedUpdate orig, CharacterBody self) { orig.Invoke(self); if (!((BaseServerAchievement)this).IsCurrentBody(self)) { return; } if (timer > 0f) { if (isTimerActive) { timer -= Time.fixedDeltaTime; if (amountOfStrikes >= 20) { isTimerActive = false; timer = 0f; amountOfStrikes = 0; ((BaseServerAchievement)this).Grant(); } } } else { isTimerActive = false; timer = 2f; amountOfStrikes = 1; } } public override void OnUninstall() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown CharacterBody.FixedUpdate -= new hook_FixedUpdate(FixedUpdate); GlobalEventManager.onServerDamageDealt -= onServerDamageDealt; ((BaseServerAchievement)this).OnUninstall(); } } public override void OnInstall() { ((BaseAchievement)this).OnInstall(); ((BaseAchievement)this).SetServerTracked(true); } public override void OnUninstall() { ((BaseAchievement)this).OnUninstall(); } } public abstract class ArtifactBase { public ArtifactDef artifactDef; public abstract string ArtifactName { get; } public abstract string ArtifactLangTokenName { get; } public abstract string ArtifactDescription { get; } public abstract Sprite ArtifactEnabledIcon { get; } public abstract Sprite ArtifactDisabledIcon { get; } public abstract Sprite ArtifactUnlockIcon { get; } public abstract GameObject ArtifactModelPrefab { get; } public bool ArtifactEnabled => RunArtifactManager.instance.IsArtifactEnabled(artifactDef); public virtual string AchievementName { get; } = string.Empty; public virtual string AchievementDesc { get; } = string.Empty; public virtual Func<string> GetHowToUnlock => () => AchievementName + "\n<style=cStack>" + AchievementDesc + "</style>"; public virtual Func<string> GetUnlocked => () => AchievementName + "\n<style=cStack>" + AchievementDesc + "</style>"; public abstract void Init(ConfigFile config); protected void CreateLang() { LanguageAPI.Add("ARTIFACT_" + ArtifactLangTokenName + "_NAME", ArtifactName); LanguageAPI.Add("ARTIFACT_" + ArtifactLangTokenName + "_DESCRIPTION", ArtifactDescription); } protected void CreateArtifact() { artifactDef = ScriptableObject.CreateInstance<ArtifactDef>(); artifactDef.cachedName = "ARTIFACT_" + ArtifactLangTokenName; artifactDef.nameToken = "ARTIFACT_" + ArtifactLangTokenName + "_NAME"; artifactDef.descriptionToken = "ARTIFACT_" + ArtifactLangTokenName + "_DESCRIPTION"; artifactDef.smallIconSelectedSprite = ArtifactEnabledIcon; artifactDef.smallIconDeselectedSprite = ArtifactDisabledIcon; artifactDef.pickupModelPrefab = ArtifactModelPrefab; if (AchievementName != string.Empty && AchievementDesc != string.Empty) { artifactDef.unlockableDef = CreateUnlock(); } ContentAddition.AddArtifactDef(artifactDef); } protected UnlockableDef CreateUnlock() { artifactDef.unlockableDef = ScriptableObject.CreateInstance<UnlockableDef>(); ((Object)artifactDef.unlockableDef).name = "ACHIEVEMENT_EXPEDITION_" + ArtifactLangTokenName; artifactDef.unlockableDef.cachedName = "ACHIEVEMENT_EXPEDITION_" + ArtifactLangTokenName; artifactDef.unlockableDef.nameToken = "ACHIEVEMENT_EXPEDITION_" + ArtifactLangTokenName + "_NAME"; artifactDef.unlockableDef.getHowToUnlockString = GetHowToUnlock; artifactDef.unlockableDef.getUnlockedString = GetUnlocked; artifactDef.unlockableDef.achievementIcon = ArtifactUnlockIcon; UnlockableDef unlockableDef = artifactDef.unlockableDef; ContentAddition.AddUnlockableDef(unlockableDef); return unlockableDef; } public abstract void Hooks(); } internal class Destination : ArtifactBase { public static ConfigEntry<int> TimesToPrintMessageOnStart; public static GameObject expeditionStagePickerPrefab; public static SceneDef pickedSceneDef; public static ArtifactCode artifactCode; public static GameObject panelPrefab; public static SceneDef seerStationStaff; public static SceneDef infiniteTowerStaff; public static bool stopSpawningPortalsPlease; internal static Destination Instance { get; private set; } public override string ArtifactName => "Artifact of Destination"; public override string ArtifactLangTokenName => "DESTINATION"; public override string ArtifactDescription => "Choose your destination."; public override Sprite ArtifactEnabledIcon => Assets.mainAssetBundle.LoadAsset<Sprite>("Assets/Textures/Icons/Artifacts/Destination/destinationIconEnabled.png"); public override Sprite ArtifactDisabledIcon => Assets.mainAssetBundle.LoadAsset<Sprite>("Assets/Textures/Icons/Artifacts/Destination/destinationIconDisabled.png"); public override Sprite ArtifactUnlockIcon => Assets.mainAssetBundle.LoadAsset<Sprite>("Assets/Textures/Icons/Artifacts/Destination/destinationIconUnlock.png"); public override GameObject ArtifactModelPrefab => Assets.mainAssetBundle.LoadAsset<GameObject>("Assets/Artifacts/PickupDestination.prefab"); public static DestinationStagePicker destinationStagePicker { get; private set; } public override string AchievementName => "Trial of Destination"; public override string AchievementDesc => "Complete the Trial of Destination"; public override void Init(ConfigFile config) { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_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_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) CreateConfig(config); CreateLang(); CreateArtifact(); Hooks(); Instance = this; expeditionStagePickerPrefab = Assets.mainAssetBundle.LoadAsset<GameObject>("Assets/Artifacts/ExpeditionStagePicker.prefab"); artifactCode = ScriptableObject.CreateInstance<ArtifactCode>(); artifactCode.topRow = new Vector3Int(5, 3, 5); artifactCode.middleRow = new Vector3Int(3, 1, 3); artifactCode.bottomRow = new Vector3Int(5, 3, 5); ArtifactCodeAPI.AddCode(artifactDef, artifactCode); } private void CreateConfig(ConfigFile config) { TimesToPrintMessageOnStart = config.Bind<int>("Artifact: " + ArtifactName, "Times to Print Message in Chat", 5, "How many times should a message be printed to the chat on run start?"); } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown SceneExitController.SetState += new Manipulator(SceneExitController_SetState); SceneExitController.UpdateServer += new Manipulator(SceneExitController_UpdateServer); ChargedState.OnEnter += new Manipulator(ChargedState_OnEnter); SeerStationController.SetRunNextStageToTarget += new hook_SetRunNextStageToTarget(SetRunNextStageToTarget); Run.AdvanceStage += new hook_AdvanceStage(AdvanceStage); Stage.onStageStartGlobal += StageStartGlobal; } private void StageStartGlobal(Stage obj) { if (Run.instance is InfiniteTowerRun) { infiniteTowerStaff = obj.sceneDef; } } private void ChargedState_OnEnter(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0071: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); Instruction val2 = val.Instrs[val.Instrs.Count - 1]; if (val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1] { (Instruction x) => ILPatternMatchingExt.MatchStfld<ChargeIndicatorController>(x, "isCharged") })) { Instruction next = val.Next; val.EmitDelegate<Func<bool>>((Func<bool>)Check); val.Emit(OpCodes.Brtrue_S, val2); } else { Debug.LogError((object)(((MemberReference)il.Method).Name + " IL Hook failed!")); } static bool Check() { if (stopSpawningPortalsPlease) { stopSpawningPortalsPlease = false; return true; } return false; } } private void SetRunNextStageToTarget(orig_SetRunNextStageToTarget orig, SeerStationController self) { orig.Invoke(self); if (NetworkServer.active && base.ArtifactEnabled) { seerStationStaff = SceneCatalog.GetSceneDef((SceneIndex)self.targetSceneDefIndex); } } private void AdvanceStage(orig_AdvanceStage orig, Run self, SceneDef nextScene) { orig.Invoke(self, nextScene); if (NetworkServer.active && base.ArtifactEnabled) { seerStationStaff = null; } } private void SceneExitController_UpdateServer(ILContext il) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Expected O, but got Unknown //IL_00b8: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); ILLabel iLLabel = null; if (val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[4] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdfld<SceneExitController>(x, "experienceCollector"), (Instruction x) => ILPatternMatchingExt.MatchCall<Object>(x, "op_Implicit"), (Instruction x) => ILPatternMatchingExt.MatchBrtrue(x, ref iLLabel) })) { val.EmitDelegate<Func<bool>>((Func<bool>)Check); val.Emit(OpCodes.Brtrue_S, (object)iLLabel); } else { Debug.LogError((object)(((MemberReference)il.Method).Name + " IL Hook failed!")); } bool Check() { if (NetworkServer.active && base.ArtifactEnabled) { if (Object.op_Implicit((Object)(object)pickedSceneDef)) { return false; } return true; } return false; } } private void SceneExitController_SetState(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0063: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); Instruction val2 = null; ILLabel val3 = null; if (val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[2] { (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 1), (Instruction x) => ILPatternMatchingExt.MatchCall<SceneExitController>(x, "set_isRunning") })) { val.Emit(OpCodes.Ldarg_0); val.EmitDelegate<Action<SceneExitController>>((Action<SceneExitController>)Check); } else { Debug.LogError((object)(((MemberReference)il.Method).Name + " IL Hook failed!")); } void Check(SceneExitController sceneExitController) { pickedSceneDef = null; if (NetworkServer.active && base.ArtifactEnabled) { PullUp(sceneExitController); } } } public static void PullUp(SceneExitController sceneExitController) { CreatePicker(); destinationStagePicker.Init(sceneExitController); ((Component)destinationStagePicker).gameObject.SetActive(true); } public static void CreatePicker() { //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Expected O, but got Unknown if (!Object.op_Implicit((Object)(object)Destination.destinationStagePicker)) { panelPrefab = Object.Instantiate<GameObject>(expeditionStagePickerPrefab, HUD.instancesList[0].mainContainer.transform); panelPrefab.AddComponent<StagePickerSizeAdjuster>(); DestinationStagePicker destinationStagePicker = panelPrefab.AddComponent<DestinationStagePicker>(); DestinationCancelExit destinationCancelExit = ((Component)panelPrefab.transform.Find("body/BeetleJuice/cancelbutton")).gameObject.AddComponent<DestinationCancelExit>(); destinationStagePicker.childLocator = panelPrefab.GetComponent<ChildLocator>(); destinationStagePicker.destinationCancelExit = destinationCancelExit; destinationCancelExit.hGButton = ((Component)destinationCancelExit).gameObject.GetComponent<HGButton>(); destinationCancelExit.destinationStagePicker = destinationStagePicker; ((UnityEvent)((Button)destinationCancelExit.hGButton).onClick).AddListener(new UnityAction(destinationCancelExit.Cancel)); destinationCancelExit.hGButton.imageOnHover = ((Component)((Component)destinationCancelExit.hGButton).gameObject.transform.Find("cancelbutton, outline")).gameObject.GetComponent<Image>(); destinationCancelExit.hGButton.showImageOnHover = true; destinationCancelExit.hGButton.uiClickSoundOverride = "Play_UI_menuBack"; Destination.destinationStagePicker = destinationStagePicker; ((Behaviour)((Component)HUD.instancesList[0].mainContainer.transform.Find("MainUIArea")).GetComponent<Canvas>()).enabled = false; stopSpawningPortalsPlease = true; } } } public class DestinationCancelExit : MonoBehaviour { public HGButton hGButton; public SceneExitController sceneExitController; public DestinationStagePicker destinationStagePicker; public void OnDisable() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown ((UnityEvent)((Button)hGButton).onClick).RemoveListener(new UnityAction(Cancel)); } public void Cancel() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown if (Object.op_Implicit((Object)(object)((Component)sceneExitController).GetComponent<TeleporterInteraction>())) { EntityStateMachine component = ((Component)sceneExitController).GetComponent<EntityStateMachine>(); if ((Object)(object)component == (Object)null) { return; } component.SetNextState((EntityState)new ChargedState()); sceneExitController.SetState((ExitState)0); ((Component)destinationStagePicker).gameObject.SetActive(false); Object.Destroy((Object)(object)Destination.panelPrefab); ((Behaviour)((Component)HUD.instancesList[0].mainContainer.transform.Find("MainUIArea")).GetComponent<Canvas>()).enabled = true; } if (Object.op_Implicit((Object)(object)((Component)sceneExitController).GetComponent<GenericInteraction>())) { sceneExitController.SetState((ExitState)0); ((Component)destinationStagePicker).gameObject.SetActive(false); Object.Destroy((Object)(object)Destination.panelPrefab); ((Behaviour)((Component)HUD.instancesList[0].mainContainer.transform.Find("MainUIArea")).GetComponent<Canvas>()).enabled = true; ((Component)sceneExitController).GetComponent<GenericInteraction>().SetInteractabilityAvailable(); } } } public class DestinationStagePicker : MonoBehaviour { public ChildLocator childLocator; public DestinationCancelExit destinationCancelExit; public void Init(SceneExitController sceneExitController) { //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Invalid comparison between Unknown and I4 //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Expected O, but got Unknown //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_05ec: Unknown result type (might be due to invalid IL or missing references) //IL_05f2: Invalid comparison between Unknown and I4 //IL_0d01: Unknown result type (might be due to invalid IL or missing references) //IL_0d0b: Expected O, but got Unknown //IL_0a3c: Unknown result type (might be due to invalid IL or missing references) //IL_0a4b: Unknown result type (might be due to invalid IL or missing references) destinationCancelExit.sceneExitController = sceneExitController; GameObject gameObject = ((Component)childLocator.FindChild("Button")).gameObject; Transform val = childLocator.FindChild("Content"); SceneDef nextStageScene = Run.instance.nextStageScene; bool flag = !Object.op_Implicit((Object)(object)nextStageScene) || (int)nextStageScene.sceneType == 1; ((UnityEvent)((Button)((Component)this).gameObject.GetComponent<MPButton>()).onClick).AddListener(new UnityAction(destinationCancelExit.Cancel)); int num = (Object.op_Implicit((Object)(object)nextStageScene) ? nextStageScene.stageOrder : (-1)); List<SceneDef> list = (Object.op_Implicit((Object)(object)nextStageScene) ? ((IEnumerable<SceneDef>)(object)SceneCatalog.allSceneDefs).ToList() : new List<SceneDef> { Stage.instance.sceneDef }); if (Object.op_Implicit((Object)(object)sceneExitController.destinationScene) && (!Object.op_Implicit((Object)(object)sceneExitController.destinationScene.destinationsGroup) || !Object.op_Implicit((Object)(object)sceneExitController.destinationScene.loopedDestinationsGroup)) && !Object.op_Implicit((Object)(object)((Component)sceneExitController).GetComponent<TeleporterInteraction>()) && (Object)(object)sceneExitController.destinationScene != (Object)(object)Destination.seerStationStaff) { list.Clear(); list.Add(sceneExitController.destinationScene); } if (Object.op_Implicit((Object)(object)sceneExitController.destinationScene) && sceneExitController.destinationScene.cachedName == "moon2" && !sceneExitController.useRunNextStageScene) { list.Clear(); list.Add(SceneCatalog.FindSceneDef("moon2")); } if (sceneExitController.isColossusPortal) { int stageOrder = Stage.instance.sceneDef.stageOrder; int num2 = Run.instance.nextStageScene.stageOrder; if (num2 != stageOrder + 1 && stageOrder <= 5) { num2 = stageOrder + 1; } switch (num2) { case 2: list.Clear(); list.Add(SceneCatalog.FindSceneDef("lemuriantemple")); break; case 3: list.Clear(); if (Run.instance.stageClearCount <= 4) { list.Add(SceneCatalog.FindSceneDef("habitat")); } else { list.Add(SceneCatalog.FindSceneDef("habitatfall")); } break; case 4: list.Clear(); list.Add(SceneCatalog.FindSceneDef("meridian")); break; } } if (!flag) { list.Clear(); list.Add(nextStageScene); } if (Object.op_Implicit((Object)(object)sceneExitController.destinationScene)) { if (sceneExitController.destinationScene.cachedName == "conduitcanyon") { list.Clear(); list.Add(SceneCatalog.FindSceneDef("conduitcanyon")); } if (sceneExitController.destinationScene.cachedName == "solutionalhaunt") { list.Clear(); list.Add(SceneCatalog.FindSceneDef("solutionalhaunt")); } } if (Object.op_Implicit((Object)(object)sceneExitController.destinationScene) && (sceneExitController.destinationScene.cachedName == "artifactworld" || sceneExitController.destinationScene.cachedName == "artifactworld01" || sceneExitController.destinationScene.cachedName == "artifactworld02" || sceneExitController.destinationScene.cachedName == "artifactworld03")) { list.Remove(SceneCatalog.FindSceneDef(sceneExitController.destinationScene.cachedName)); list.Add(SceneCatalog.FindSceneDef("artifactworld")); list.Add(SceneCatalog.FindSceneDef("artifactworld01")); list.Add(SceneCatalog.FindSceneDef("artifactworld02")); list.Add(SceneCatalog.FindSceneDef("artifactworld03")); } if (Run.instance is InfiniteTowerRun) { list.Clear(); list.Add(SceneCatalog.FindSceneDef("itancientloft")); list.Add(SceneCatalog.FindSceneDef("itdampcave")); list.Add(SceneCatalog.FindSceneDef("itfrozenwall")); list.Add(SceneCatalog.FindSceneDef("itgolemplains")); list.Add(SceneCatalog.FindSceneDef("itgoolake")); list.Add(SceneCatalog.FindSceneDef("itskymeadow")); list.Add(SceneCatalog.FindSceneDef("itmoon")); list.Remove(SceneCatalog.FindSceneDef(Destination.infiniteTowerStaff.cachedName)); } foreach (SceneDef item in list) { SceneDef sceneDef = item; if (((!flag || (Object.op_Implicit((Object)(object)sceneDef.requiredExpansion) && !Run.instance.IsExpansionEnabled(sceneDef.requiredExpansion)) || (Object.op_Implicit((Object)(object)nextStageScene) && (!Object.op_Implicit((Object)(object)sceneExitController.destinationScene) || (Object)(object)sceneDef != (Object)(object)sceneExitController.destinationScene) && (sceneDef.stageOrder != num || (int)sceneDef.sceneType != 1))) && sceneDef.cachedName != "artifactworld" && sceneDef.cachedName != "artifactworld01" && sceneDef.cachedName != "artifactworld02" && sceneDef.cachedName != "artifactworld03") || (Object.op_Implicit((Object)(object)sceneExitController.destinationScene) && sceneExitController.destinationScene.cachedName != "conduitcanyon" && sceneDef.cachedName == "conduitcanyon") || (Object.op_Implicit((Object)(object)sceneExitController.destinationScene) && sceneExitController.destinationScene.cachedName != "artifactworld" && sceneExitController.destinationScene.cachedName != "artifactworld01" && sceneExitController.destinationScene.cachedName != "artifactworld02" && sceneExitController.destinationScene.cachedName != "artifactworld03" && (sceneDef.cachedName == "artifactworld" || sceneDef.cachedName == "artifactworld01" || sceneDef.cachedName == "artifactworld02" || sceneDef.cachedName == "artifactworld03")) || (Run.instance.stageClearCount < 4 && sceneDef.isLockedBeforeLooping && ((Object)(object)Destination.seerStationStaff == (Object)null || Destination.seerStationStaff.cachedName != sceneDef.cachedName)) || (Run.instance.stageClearCount >= 4 && Object.op_Implicit((Object)(object)sceneDef.loopedSceneDef) && ((Object)(object)Destination.seerStationStaff == (Object)null || Destination.seerStationStaff.cachedName != sceneDef.cachedName)) || sceneDef.cachedName == "golemplains2" || sceneDef.cachedName == "blackbeach2" || (!sceneExitController.isColossusPortal && ((Object)(object)Destination.seerStationStaff == (Object)null || Destination.seerStationStaff.cachedName != sceneDef.cachedName) && (sceneDef.cachedName == "habitat" || sceneDef.cachedName == "habitatfall" || sceneDef.cachedName == "lemuriantemple" || sceneDef.cachedName == "meridian")) || (sceneDef.cachedName == "moon2" && sceneExitController.useRunNextStageScene)) { continue; } HGButton component = Object.Instantiate<GameObject>(gameObject, val).GetComponent<HGButton>(); ((Component)component).gameObject.SetActive(true); if (Object.op_Implicit((Object)(object)((Selectable)component).image) && Object.op_Implicit((Object)(object)sceneDef.previewTexture)) { Texture previewTexture = sceneDef.previewTexture; Texture2D val2 = (Texture2D)(object)((previewTexture is Texture2D) ? previewTexture : null); Sprite sprite = Sprite.Create(val2, new Rect(0f, 0f, (float)((Texture)val2).width, (float)((Texture)val2).height), new Vector2(0f, 0f)); ((Selectable)component).image.sprite = sprite; if (sceneDef.cachedName == "nest") { ((Selectable)component).image.sprite = Assets.mainAssetBundle.LoadAsset<Sprite>("Assets/Artifacts/GearboxAreStupid/texNest_GearboxAreStupid.png"); } if (sceneDef.cachedName == "villagenight") { ((Selectable)component).image.sprite = Assets.mainAssetBundle.LoadAsset<Sprite>("Assets/Artifacts/GearboxAreStupid/texVillageNight_GearboxAreStupid.png"); } if (sceneDef.cachedName == "solusweb") { ((Selectable)component).image.sprite = Assets.mainAssetBundle.LoadAsset<Sprite>("Assets/Artifacts/GearboxAreStupid/texSolusWeb_GearboxAreStupid.png"); } if (Run.instance is InfiniteTowerRun) { if (sceneDef.cachedName == "itancientloft") { ((Selectable)component).image.sprite = Assets.mainAssetBundle.LoadAsset<Sprite>("Assets/Artifacts/ForSimulacrum/itAncientLoft.png"); } if (sceneDef.cachedName == "itdampcave") { ((Selectable)component).image.sprite = Assets.mainAssetBundle.LoadAsset<Sprite>("Assets/Artifacts/ForSimulacrum/itDampCave.png"); } if (sceneDef.cachedName == "itfrozenwall") { ((Selectable)component).image.sprite = Assets.mainAssetBundle.LoadAsset<Sprite>("Assets/Artifacts/ForSimulacrum/itFrozenWall.png"); } if (sceneDef.cachedName == "itgolemplains") { ((Selectable)component).image.sprite = Assets.mainAssetBundle.LoadAsset<Sprite>("Assets/Artifacts/ForSimulacrum/itGolemPlains.png"); } if (sceneDef.cachedName == "itgoolake") { ((Selectable)component).image.sprite = Assets.mainAssetBundle.LoadAsset<Sprite>("Assets/Artifacts/ForSimulacrum/itGooLake.png"); } if (sceneDef.cachedName == "itmoon") { ((Selectable)component).image.sprite = Assets.mainAssetBundle.LoadAsset<Sprite>("Assets/Artifacts/ForSimulacrum/itMoon.png"); } if (sceneDef.cachedName == "itskymeadow") { ((Selectable)component).image.sprite = Assets.mainAssetBundle.LoadAsset<Sprite>("Assets/Artifacts/ForSimulacrum/itSkyMeadow.png"); } } } component.imageOnHover = ((Component)((Component)component).gameObject.transform.Find("button, outline")).gameObject.GetComponent<Image>(); component.showImageOnHover = true; ((UnityEvent)((Button)component).onClick).AddListener(new UnityAction(sus)); void sus() { string cachedName = sceneDef.cachedName; string text = cachedName; if (!(text == "golemplains")) { if (text == "blackbeach") { float num3 = Mathf.Round(Random.Range(0f, 1f)); if (num3 == 0f) { Destination.pickedSceneDef = sceneDef; sceneExitController.destinationScene = sceneDef; } if (num3 == 1f) { Destination.pickedSceneDef = SceneCatalog.FindSceneDef("blackbeach2"); sceneExitController.destinationScene = SceneCatalog.FindSceneDef("blackbeach2"); } } else { Destination.pickedSceneDef = sceneDef; sceneExitController.destinationScene = sceneDef; } } else { float num4 = Mathf.Round(Random.Range(0f, 1f)); if (num4 == 0f) { Destination.pickedSceneDef = sceneDef; sceneExitController.destinationScene = sceneDef; } if (num4 == 1f) { Destination.pickedSceneDef = SceneCatalog.FindSceneDef("golemplains2"); sceneExitController.destinationScene = SceneCatalog.FindSceneDef("golemplains2"); } } ((Component)this).gameObject.SetActive(false); Object.Destroy((Object)(object)Destination.panelPrefab); ((Behaviour)((Component)HUD.instancesList[0].mainContainer.transform.Find("MainUIArea")).GetComponent<Canvas>()).enabled = true; Destination.stopSpawningPortalsPlease = false; if (Util.HasEffectiveAuthority(HUD.instancesList[0].oldTarget.GetComponent<CharacterBody>().networkIdentity)) { AkSoundEngine.PostEvent(3652871718u, HUD.instancesList[0].oldTarget); } } } if (Object.op_Implicit((Object)(object)((Component)this).gameObject.GetComponent<StagePickerSizeAdjuster>())) { ((Component)this).gameObject.GetComponent<StagePickerSizeAdjuster>().MikeRebuildMyPanel(); } } private void FixedUpdate() { if ((Object)(object)HUD.instancesList[0].mainContainer.GetComponentInChildren<ScoreboardController>() != (Object)null) { destinationCancelExit.Cancel(); } } } public class StagePickerSizeAdjuster : MonoBehaviour { private int buttonCount; private float normalSizeX; private float normalSizeY; private void MikeFindVariables() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) normalSizeX = ((Component)((Component)this).gameObject.transform.Find("body")).gameObject.GetComponent<RectTransform>().sizeDelta.x; normalSizeY = ((Component)((Component)this).gameObject.transform.Find("body")).gameObject.GetComponent<RectTransform>().sizeDelta.y; } public void MikeRebuildMyPanel() { //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) MikeFindVariables(); for (buttonCount = ((Component)((Component)this).gameObject.transform.Find("body/BeetleJuice/content")).gameObject.transform.childCount; buttonCount > 7; buttonCount -= 3) { ((Component)((Component)this).gameObject.transform.Find("body")).gameObject.GetComponent<RectTransform>().sizeDelta = new Vector2(normalSizeX + 300f, normalSizeY); normalSizeX = ((Component)((Component)this).gameObject.transform.Find("body")).gameObject.GetComponent<RectTransform>().sizeDelta.x; } } } public class Feathers2Behaviour : ItemBehavior { public float maxTimerNumber; private float realTimerNumber; public CharacterBody playerBody; public static FireProjectileInfo fireProjectileInfo; public GameObject wingusDingus; private void Awake() { ((Behaviour)this).enabled = false; } private void Start() { //IL_0012: 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_005d: Unknown result type (might be due to invalid IL or missing references) wingusDingus = Object.Instantiate<GameObject>(Feathers2.Feather2WingsEffectPrefab, playerBody.coreTransform.position, playerBody.coreTransform.rotation); float radius = playerBody.radius; wingusDingus.transform.localScale = new Vector3(1.5f * radius, 1.5f * radius, 1.5f * radius); wingusDingus.transform.SetParent(playerBody.coreTransform); } private void OnEnable() { } private void OnDisable() { } private void OnDestroy() { Object.Destroy((Object)(object)wingusDingus); } private void FixedUpdate() { CharacterMotor val = default(CharacterMotor); CharacterMotor val2 = default(CharacterMotor); if (((((Component)playerBody).TryGetComponent<CharacterMotor>(ref val) && !val.isGrounded) || !((Component)playerBody).TryGetComponent<CharacterMotor>(ref val2)) && playerBody.inputBank.skill1.down) { realTimerNumber -= Time.deltaTime; if (realTimerNumber <= 0f) { FireProjectile(playerBody); AkSoundEngine.PostEvent(623304158u, ((Component)playerBody).gameObject); realTimerNumber = maxTimerNumber; } if (!wingusDingus.activeSelf) { wingusDingus.SetActive(true); } } else { realTimerNumber = maxTimerNumber; if (wingusDingus.activeSelf) { wingusDingus.SetActive(false); } } } private void FireProjectile(CharacterBody characterBody) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0065: 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_0070: Unknown result type (might be due to invalid IL or missing references) FireProjectileInfo val = default(FireProjectileInfo); val.owner = ((Component)characterBody).gameObject; val.damage = 0.8f * characterBody.damage; val.force = 10f; val.position = characterBody.corePosition; val.rotation = Util.QuaternionSafeLookRotation(characterBody.inputBank.aimDirection); val.projectilePrefab = Feathers2.Projectile; fireProjectileInfo = val; ProjectileManager.instance.FireProjectile(fireProjectileInfo); } } public class georevealer : NetworkBehaviour { private struct PendingReveal : IComparable<PendingReveal> { public GameObject gameObject; public FixedTimeStamp time; public float duration; public int CompareTo(PendingReveal other) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) return ((FixedTimeStamp)(ref time)).CompareTo(other.time); } } private class RevealedObject : MonoBehaviour { private float lifetime; private static readonly Dictionary<GameObject, RevealedObject> currentlyRevealedObjects = new Dictionary<GameObject, RevealedObject>(); private PositionIndicator positionIndicator; public static void RevealObject(GameObject gameObject, float duration) { if (!currentlyRevealedObjects.TryGetValue(gameObject, out var value)) { if ((Object)(object)gameObject.GetComponent<ShrineBloodBehavior>() != (Object)null) { value = gameObject.AddComponent<RevealedObject>(); } else if ((Object)(object)gameObject.GetComponent<ShrineBossBehavior>() != (Object)null) { value = gameObject.AddComponent<RevealedObject>(); } else if ((Object)(object)gameObject.GetComponent<ShrineChanceBehavior>() != (Object)null) { value = gameObject.AddComponent<RevealedObject>(); } else if ((Object)(object)gameObject.GetComponent<ShrineCleanseBehavior>() != (Object)null) { value = gameObject.AddComponent<RevealedObject>(); } else if ((Object)(object)gameObject.GetComponent<ShrineCombatBehavior>() != (Object)null) { value = gameObject.AddComponent<RevealedObject>(); } else if ((Object)(object)gameObject.GetComponent<ShrineHealingBehavior>() != (Object)null) { value = gameObject.AddComponent<RevealedObject>(); } else if ((Object)(object)gameObject.GetComponent<ShrineRestackBehavior>() != (Object)null) { value = gameObject.AddComponent<RevealedObject>(); } else if ((Object)(object)gameObject.GetComponent<TeleporterInteraction>() != (Object)null) { value = gameObject.AddComponent<RevealedObject>(); } else if ((Object)(object)gameObject.GetComponent<PortalStatueBehavior>() != (Object)null) { value = gameObject.AddComponent<RevealedObject>(); } else if ((Object)(object)gameObject.GetComponent<PressurePlateController>() != (Object)null) { value = gameObject.AddComponent<RevealedObject>(); } else if ((Object)(object)gameObject.GetComponent<ShrineRebirthController>() != (Object)null) { value = gameObject.AddComponent<RevealedObject>(); } else if ((Object)(object)gameObject.GetComponent<HalcyoniteShrineInteractable>() != (Object)null) { value = gameObject.AddComponent<RevealedObject>(); } else if ((Object)(object)gameObject.GetComponent<ShrineColossusAccessBehavior>() != (Object)null) { value = gameObject.AddComponent<RevealedObject>(); } else { if (!((Object)(object)gameObject.GetComponent<ShrineCombatTroopBehavior>() != (Object)null)) { return; } value = gameObject.AddComponent<RevealedObject>(); } } if (value.lifetime < duration) { value.lifetime = duration; } } private void OnEnable() { //IL_007e: 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_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) NetworkIdentity component = ((Component)this).gameObject.GetComponent<NetworkIdentity>(); if (Object.op_Implicit((Object)(object)component)) { foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances) { if (!((Object)(object)instance == (Object)null) && instance.isPingTheSameNetworkObject(component)) { Object.Destroy((Object)(object)this); return; } } } GameObject val = Object.Instantiate<GameObject>(LegacyResourcesAPI.Load<GameObject>("Prefabs/PositionIndicators/PoiPositionIndicator"), ((Component)this).transform.position, ((Component)this).transform.rotation); positionIndicator = val.GetComponent<PositionIndicator>(); positionIndicator.insideViewObject.GetComponent<SpriteRenderer>().sprite = GetInteractableIcon(((Component)this).gameObject); positionIndicator.insideViewObject.GetComponent<SpriteRenderer>().color = new Color(0.63f, 0.87f, 1f, 1f); positionIndicator.outsideViewObject.GetComponentInChildren<SpriteRenderer>().color = new Color(0.63f, 0.87f, 1f, 1f); positionIndicator.targetTransform = ((Component)this).transform; currentlyRevealedObjects[((Component)this).gameObject] = this; } private void OnDisable() { currentlyRevealedObjects.Remove(((Component)this).gameObject); if (Object.op_Implicit((Object)(object)positionIndicator)) { Object.Destroy((Object)(object)((Component)positionIndicator).gameObject); } positionIndicator = null; } private void FixedUpdate() { lifetime -= Time.fixedDeltaTime; if (lifetime <= 0f) { Object.Destroy((Object)(object)this); } } } [SyncVar] public float radius; public float pulseTravelSpeed; public float revealDuration; public float pulseInterval; private FixedTimeStamp nextPulse = FixedTimeStamp.negativeInfinity; public GameObject pulseEffectPrefab; public float pulseEffectScale; private static readonly List<PendingReveal> pendingReveals = new List<PendingReveal>(); private static Type[] typesToCheck; private Vector3 spawn; public float Networkradius { get { return radius; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar<float>(value, ref radius, 1u); } } public static Sprite GetInteractableIcon(GameObject gameObject) { //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Invalid comparison between Unknown and I4 //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Invalid comparison between Unknown and I4 PingInfoProvider component = gameObject.GetComponent<PingInfoProvider>(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.pingIconOverride)) { return component.pingIconOverride; } string text = "Assets/Models/Prefabs/VFX/geolocator/texGeoIndicatorMystery.png"; if (((Object)gameObject).name.Contains("Shrine")) { text = "Assets/Models/Prefabs/VFX/geolocator/texGeoIndicatorShrine.png"; } else if (Object.op_Implicit((Object)(object)gameObject.GetComponent<ShrineColossusAccessBehavior>())) { text = "Assets/Textures/Icons/Item/geolocator/pingShrine.png"; } else if (Object.op_Implicit((Object)(object)gameObject.GetComponent<HalcyoniteShrineInteractable>())) { text = "Assets/Textures/Icons/Item/geolocator/pingShrine.png"; } else if (Object.op_Implicit((Object)(object)gameObject.GetComponent<TeleporterInteraction>())) { text = "Assets/Models/Prefabs/VFX/geolocator/texGeoIndicatorTeleporter.png"; } else { PortalStatueBehavior component2 = gameObject.GetComponent<PortalStatueBehavior>(); if (Object.op_Implicit((Object)(object)component2) && (int)component2.portalType == 0) { text = "Assets/Models/Prefabs/VFX/geolocator/texGeoIndicatorMystery.png"; } else { PurchaseInteraction component3 = gameObject.GetComponent<PurchaseInteraction>(); if (Object.op_Implicit((Object)(object)component3) && (int)component3.costType == 3) { text = "Assets/Models/Prefabs/VFX/geolocator/texGeoIndicatorShrine.png"; } } } return Assets.mainAssetBundle.LoadAsset<Sprite>(text); } [InitDuringStartupPhase(/*Could not decode attribute arguments.*/)] private static void Init() { RoR2Application.onFixedUpdate += StaticFixedUpdate; typesToCheck = (from t in typeof(ChestRevealer).Assembly.GetTypes() where typeof(IInteractable).IsAssignableFrom(t) select t).ToArray(); } private static void StaticFixedUpdate() { pendingReveals.Sort(); while (pendingReveals.Count > 0) { PendingReveal pendingReveal = pendingReveals[0]; if (((FixedTimeStamp)(ref pendingReveal.time)).hasPassed) { if (Object.op_Implicit((Object)(object)pendingReveal.gameObject)) { RevealedObject.RevealObject(pendingReveal.gameObject, pendingReveal.duration); } pendingReveals.RemoveAt(0); continue; } break; } } public void Pulse() { //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_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) Vector3 origin = ((Component)this).transform.position; float radiusSqr = radius * radius; float invPulseTravelSpeed = 1f / pulseTravelSpeed; Type[] array = typesToCheck; for (int i = 0; i < array.Length; i++) { foreach (MonoBehaviour item2 in InstanceTracker.FindInstancesEnumerable(array[i])) { if (((IInteractable)item2).ShouldShowOnScanner()) { TryAddRevealable(((Component)item2).transform); } } } spawn = origin; ((MonoBehaviour)this).Invoke("SpawnEffect", 0.5f); void TryAddRevealable(Transform revealableTransform) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) Vector3 val = revealableTransform.position - origin; float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude; if (!(sqrMagnitude > radiusSqr) && (!((Object)(object)((Component)revealableTransform).gameObject.GetComponent<TeleporterInteraction>() != (Object)null) || !((Component)revealableTransform).gameObject.GetComponent<TeleporterInteraction>().TrySetTeleporterIndicatorDiscovered(true))) { foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances) { if (!((Object)(object)instance == (Object)null) && instance.isPingTheSameNetworkObject(((Component)revealableTransform).gameObject.GetComponent<NetworkIdentity>())) { return; } } float num = Mathf.Sqrt(sqrMagnitude) * invPulseTravelSpeed; PendingReveal pendingReveal = default(PendingReveal); pendingReveal.gameObject = ((Component)revealableTransform).gameObject; pendingReveal.time = FixedTimeStamp.now + num; pendingReveal.duration = revealDuration; PendingReveal item = pendingReveal; pendingReveals.Add(item); } } } private void SpawnEffect() { //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_000e: 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_0032: Expected O, but got Unknown EffectManager.SpawnEffect(pulseEffectPrefab, new EffectData { origin = spawn, scale = radius * pulseEffectScale }, false); } private void FixedUpdate() { //IL_0019: 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) if (((FixedTimeStamp)(ref nextPulse)).hasPassed) { Pulse(); nextPulse = FixedTimeStamp.now + pulseInterval; } } private void UNetVersion() { } public override bool OnSerialize(NetworkWriter writer, bool forceAll) { if (forceAll) { writer.Write(radius); return true; } bool flag = false; if ((((NetworkBehaviour)this).syncVarDirtyBits & (true ? 1u : 0u)) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } writer.Write(radius); } if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); } return flag; } public override void OnDeserialize(NetworkReader reader, bool initialState) { if (initialState) { radius = reader.ReadSingle(); return; } int num = (int)reader.ReadPackedUInt32(); if (((uint)num & (true ? 1u : 0u)) != 0) { radius = reader.ReadSingle(); } } } public class HandleHeatcore : MonoBehaviour { public GameObject theresholdInstance; public float theEndIsNear; private bool playBuildUpSound; private float segmentMoveX; private float theresholdMoveX; private float theresholdCurrentPositionX; private float heatcoreTimer = 360f; public GameObject theDifficultyBar; public CharacterBody heatHolder; private int stopSearching = 0; private void OnEnable() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown try { FindСorrespondingDificultyBar(); DifficultyBarController.SetSegmentScroll += new hook_SetSegmentScroll(MoveThereshold); theEndIsNear = heatcoreTimer; playBuildUpSound = true; } catch (Exception) { ((Behaviour)this).enabled = false; } } private void OnDisable() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown try { if (Object.op_Implicit((Object)(object)theDifficultyBar)) { DifficultyBarController.SetSegmentScroll -= new hook_SetSegmentScroll(MoveThereshold); } } catch (Exception) { } } private void OnDestroy() { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown try { if (Object.op_Implicit((Object)(object)theDifficultyBar)) { AkSoundEngine.PostEvent(199676870u, ((Component)heatHolder).gameObject); Object.Destroy((Object)(object)theresholdInstance.gameObject); DifficultyBarController.SetSegmentScroll -= new hook_SetSegmentScroll(MoveThereshold); } } catch (Exception) { } } private void FixedUpdate() { if (!Run.instance.isRunStopwatchPaused) { theEndIsNear -= Time.deltaTime; if (theEndIsNear <= 30f && playBuildUpSound) { AkSoundEngine.PostEvent(3779037176u, ((Component)heatHolder).gameObject); playBuildUpSound = false; } } } private void MoveThereshold(orig_SetSegmentScroll orig, DifficultyBarController self, float segmentScroll) { //IL_0024: 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_00ad: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, segmentScroll); if (!Object.op_Implicit((Object)(object)theresholdInstance)) { return; } segmentMoveX = self.segmentContainer.offsetMin.x; if (theresholdMoveX != segmentMoveX) { float num = theresholdMoveX - segmentMoveX; if (num >= 9f || num <= -9f) { num = 1f; } if (theresholdCurrentPositionX - num <= 72f) { theresholdInstance.GetComponent<RectTransform>().anchoredPosition = new Vector2(theresholdCurrentPositionX - num, 0f); } else { theresholdInstance.GetComponent<RectTransform>().anchoredPosition = new Vector2(72f, 0f); } theresholdMoveX = segmentMoveX; theresholdCurrentPositionX -= num; } } private void SetupThereshold() { //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0154: 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) if (Object.op_Implicit((Object)(object)theDifficultyBar)) { if ((Object)(object)theresholdInstance != (Object)null) { Object.Destroy((Object)(object)theresholdInstance.gameObject); } theresholdInstance = Object.Instantiate<GameObject>(Heatcore.HeatcoreThereshold, theDifficultyBar.transform); if (23f * (0.85f + (float)Run.instance.participatingPlayerCount * 0.15f) * DifficultyCatalog.GetDifficultyDef(Run.instance.selectedDifficulty).scalingValue * Mathf.Pow(1.15f, (float)Run.instance.stageClearCount) <= 72f) { theresholdInstance.GetComponent<RectTransform>().anchoredPosition = new Vector2(23f * (0.85f + (float)Run.instance.participatingPlayerCount * 0.15f) * DifficultyCatalog.GetDifficultyDef(Run.instance.selectedDifficulty).scalingValue * Mathf.Pow(1.15f, (float)Run.instance.stageClearCount), 0f); } else { theresholdInstance.GetComponent<RectTransform>().anchoredPosition = new Vector2(72f, 0f); } theresholdCurrentPositionX = 23f * (0.85f + (float)Run.instance.participatingPlayerCount * 0.15f) * DifficultyCatalog.GetDifficultyDef(Run.instance.selectedDifficulty).scalingValue * Mathf.Pow(1.15f, (float)Run.instance.stageClearCount); segmentMoveX = theDifficultyBar.GetComponent<DifficultyBarController>().segmentContainer.offsetMin.x; theresholdMoveX = segmentMoveX; } } private void FindСorrespondingDificultyBar() { using List<HUD>.Enumerator enumerator = HUD.instancesList.GetEnumerator(); if (enumerator.MoveNext()) { HUD current = enumerator.Current; if ((Object)(object)current.oldTarget == (Object)(object)((Component)heatHolder).gameObject) { theDifficultyBar = ((Component)((Component)current).gameObject.GetComponentInChildren<DifficultyBarController>()).gameObject; SetupThereshold(); } else { ((MonoBehaviour)this).Invoke("FindСorrespondingDificultyBar", 0.1f); stopSearching++; } } } } public class HandleTalisman : MonoBehaviour { public CharacterBody self; private float healingTimer; public float healingInterval = 1f; public int timesHealed; private void OnEnable() { try { self.onSkillActivatedServer += OnSkillActivatedServer; timesHealed = 0; if (Util.HasEffectiveAuthority(self.networkIdentity)) { AkSoundEngine.PostEvent(2303086811u, ((Component)self).gameObject); } } catch (Exception) { ((Behaviour)this).enabled = false; } } private void OnDisable() { try { self.onSkillActivatedServer -= OnSkillActivatedServer; } catch (Exception) { } } private void OnDestroy() { try { self.onSkillActivatedServer -= OnSkillActivatedServer; self.RemoveBuff(Buffs.Cloak); self.RemoveBuff(Talisman.TalismanRegen); if (Util.HasEffectiveAuthority(self.networkIdentity)) { AkSoundEngine.PostEvent(1911342449u, ((Component)self).gameObject); } } catch (Exception) { } } private void FixedUpdate() { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) if (self.HasBuff(Talisman.TalismanRegen)) { healingTimer -= Time.fixedDeltaTime; if (healingTimer <= 0f) { healingTimer = healingInterval; self.healthComponent.HealFraction(0.01f, default(ProcChainMask)); timesHealed++; } } if (timesHealed == 11) { Object.Destroy((Object)(object)this); } } private void OnSkillActivatedServer(GenericSkill genericSkill) { if (self.HasBuff(Talisman.TalismanRegen)) { Object.Destroy((Object)(object)this); } } } public class PaperdogBehaviour : ItemBehavior { private bool playSound; private bool inPeace; private bool providingBuff; public float outOfCombatStopwatch2; public float outOfDangerStopwatch2; private void OnEnable() { try { } catch (Exception) { ((Behaviour)this).enabled = false; } } private void OnDisable() { try { ((Component)this).gameObject.GetComponent<CharacterBody>().RemoveBuff(Paperdog.Continuity); } catch (Exception) { } } private void OnDestroy() { try { ((Component)this).gameObject.GetComponent<CharacterBody>().RemoveBuff(Paperdog.Continuity); } catch (Exception) { } } private void SetProvidingBuff(bool shouldProvideBuff, CharacterBody body) { if (shouldProvideBuff != providingBuff) { providingBuff = shouldProvideBuff; if (providingBuff) { body.AddBuff(Paperdog.Continuity); } else { body.RemoveBuff(Paperdog.Continuity); } } } private void FixedUpdate() { outOfCombatStopwatch2 += Time.fixedDeltaTime; outOfDangerStopwatch2 += Time.fixedDeltaTime; if (outOfDangerStopwatch2 >= 3f && outOfCombatStopwatch2 >= 3f) { inPeace = true; if (playSound) { AkSoundEngine.PostEvent(1179956560u, ((Component)this).gameObject); playSound = false; } } else { inPeace = false; playSound = true; } SetProvidingBuff(inPeace, ((Component)this).gameObject.GetComponent<CharacterBody>()); } } public class RedGuitarBehaviour : ItemBehavior { private CharacterBody Chris; public int itemCount; private void OnEnable() { try { BossGroup.onBossGroupStartServer += OnBossGroupStartServer; Chris = ((Component)this).gameObject.GetComponent<CharacterBody>(); } catch (Exception) { ((Behaviour)this).enabled = false; } } private void OnDisable() { try { BossGroup.onBossGroupStartServer -= OnBossGroupStartServer; } catch (Exception) { } } private void OnDestroy() { try { BossGroup.onBossGroupStartServer -= OnBossGroupStartServer; } catch (Exception) { } } private void OnBossGroupStartServer(BossGroup bossGroup) { //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_0053: Unknown result type (might be due to invalid IL or missing references) AkSoundEngine.PostEvent(3245283788u, ((Component)Chris).gameObject); ReadOnlyCollection<TeamComponent> teamMembers = TeamComponent.GetTeamMembers(Chris.teamComponent.teamIndex); foreach (TeamComponent item in teamMembers) { if (item.teamIndex == Chris.teamComponent.teamIndex) { ((Component)item).GetComponent<CharacterBody>().AddTimedBuff(RedGuitar.Jamming, (float)(10 + 10 * itemCount), 1); Transform modelTransform = item.body.modelLocator.modelTransform; if (Object.op_Implicit((Object)(object)modelTransform)) { TemporaryOverlayInstance val = TemporaryOverlayManager.AddOverlay(((Component)modelTransform).gameObject); val.duration = 10f + 10f * (float)itemCount; val.animateShaderAlpha = true; val.alphaCurve = AnimationCurve.EaseInOut(1f, 1f, 1f, 0f); val.destroyComponentOnEnd = true; val.originalMaterial = Assets.mainAssetBundle.LoadAsset<Material>("Jamming_material.mat"); val.AddToCharacterModel(((Component)modelTransform).gameObject.GetComponent<CharacterModel>()); } } } } } public class SmilingPlantOverlayHelper : MonoBehaviour { private Transform thisModel; private TemporaryOverlayInstance smilingPlantOverlayInstance; private void Awake() { thisModel = ((Component)this).GetComponent<CharacterBody>().modelLocator.modelTransform; } public void AddOverlay(float duration) { if (smilingPlantOverlayInstance != null) { smilingPlantOverlayInstance.Destroy(); } smilingPlantOverlayInstance = TemporaryOverlayManager.AddOverlay(((Component)thisModel).gameObject); smilingPlantOverlayInstance.duration = duration; smilingPlantOverlayInstance.animateShaderAlpha = true; smilingPlantOverlayInstance.alphaCurve = AnimationCurve.EaseInOut(1f, 1f, 1f, 0f); smilingPlantOverlayInstance.destroyComponentOnEnd = true; smilingPlantOverlayInstance.originalMaterial = SmilingPlant.GrowMaterial; smilingPlantOverlayInstance.AddToCharacterModel(((Component)thisModel).gameObject.GetComponent<CharacterModel>()); } } public class TerraComponent : NetworkBehaviour { public enum TerraformerType { Grounded, Air } public CharacterBody CharacterBody; public float Damage; public TerraformerType terraformerType; private int _repeats = 6; private float _realTimeNumber = 1.7f; private float _maxTimeNumber = 1f; private bool _airKick = true; protected Transform _transform { get; private set; } private void Awake() { _transform = ((Component)this).GetComponent<Transform>(); } private void FixedUpdate() { Timer(); } private void Timer() { if (_repeats > 0) { _realTimeNumber -= Time.fixedDeltaTime; if (_realTimeNumber <= 0f) { MakeALittleDamage(); _realTimeNumber = _maxTimeNumber; _repeats--; } } else if (terraformerType == TerraformerType.Air && _airKick) { TerraRadialForce component = ((Component)this).gameObject.GetComponent<TerraRadialForce>(); component.DoIAmuseYou(); _airKick = false; } } private void MakeALittleDamage() { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: 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_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_02bf: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: Unknown result type (might be due to invalid IL or missing references) //IL_02de: Unknown result type (might be due to invalid IL or missing references) //IL_02e9: Unknown result type (might be due to invalid IL or missing references) //IL_02f6: Unknown result type (might be due to invalid IL or missing references) //IL_02fb: Unknown result type (might be due to invalid IL or missing references) //IL_0305: Expected O, but got Unknown //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Expected O, but got Unknown //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) if (terraformerType == TerraformerType.Grounded) { AkSoundEngine.PostEvent(1060323310u, ((Component)this).gameObject); EffectManager.SpawnEffect(Terraformer.TerraformerEarthEffectPrefab, new EffectData { origin = ((Component)this).transform.position }, true); } Collider[] array = Physics.OverlapSphere(_transform.position, 30f); Collider[] array2 = array; CharacterMotor val2 = default(CharacterMotor); CharacterMotor val4 = default(CharacterMotor); foreach (Collider val in array2) { CharacterBody component = ((Component)val).GetComponent<CharacterBody>(); if (!Object.op_Implicit((Object)(object)component) || (Object)(object)component == (Object)(object)CharacterBody || component.teamComponent.teamIndex == CharacterBody.teamComponent.teamIndex) { continue; } Vector3 position = ((Component)component).gameObject.transform.position; if (!(Vector2.Distance(Vector2.op_Implicit(_transform.position), Vector2.op_Implicit(position)) <= 30f)) { continue; } if (terraformerType == TerraformerType.Grounded) { if (((Component)component).TryGetComponent<CharacterMotor>(ref val2) && val2.isGrounded) { component.healthComponent.TakeDamage(new DamageInfo { attacker = ((Component)CharacterBody).gameObject, canRejectForce = false, crit = CharacterBody.RollCrit(), damage = Damage, damageColorIndex = (DamageColorIndex)3, inflictor = ((Component)CharacterBody).gameObject, procChainMask = default(ProcChainMask), procCoefficient = 1f, position = ((Component)component).gameObject.transform.position }); SetStateOnHurt.SetStunOnObject(((Component)component).gameObject, 1.5f); float num = KnockbackFinUtil.CalculateImpulseForce(component.characterMotor.mass, 1, component.isChampion, component.isBoss); float num2 = num; float y = component.characterMotor.velocity.y; if (y < 0f) { num2 -= y * component.characterMotor.mass; } Vector3 val3 = num2 * Vector3.up; component.characterMotor.ApplyForce(val3, false, false); } } else if (!((Component)component).TryGetComponent<CharacterMotor>(ref val4) || !val4.isGrounded) { component.healthComponent.TakeDamage(new DamageInfo { attacker = ((Component)CharacterBody).gameObject, canRejectForce = false, crit = CharacterBody.RollCrit(), damage = Damage, damageColorIndex = (DamageColorIndex)3, inflictor = ((Component)this).gameObject, procChainMask = default(ProcChainMask), procCoefficient = 1f, position = ((Component)component).gameObject.transform.position }); SetStateOnHurt.SetStunOnObject(((Component)component).gameObject, 1.5f); } } } private void UNetVersion() { } public override bool OnSerialize(NetworkWriter writer, bool forceAll) { bool result = default(bool); return result; } public override void OnDeserialize(NetworkReader reader, bool initialState) { } } public class TerraRadialForce : MonoBehaviour { public CharacterBody CharacterBody; private float _radius = 30f; public float RotationForce = 50f; private float _duration = 6f; private float _currentSpeedMultiplier = 1f; private float _elapsedTime = 0f; private bool _slap = false; public float RepulsePower = 300f; public float RetractionPower = 1800f; protected Transform _transform { get; private set; } protected void Awake() { _transform = ((Component)this).GetComponent<Transform>(); } protected void FixedUpdate() { HandleRotation(); } private void HandleRotation() { //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0196: 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_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_02d7: Unknown result type (might be due to invalid IL or missing references) //IL_02f8: Unknown result type (might be due to invalid IL or missing references) //IL_0302: Unknown result type (might be due to invalid IL or missing references) if (_slap) { return; } if (_elapsedTime < _duration) { _elapsedTime += Time.fixedDeltaTime; _currentSpeedMultiplier = Mathf.Lerp(1f, 1.7f, _elapsedTime / _duration); } else { _currentSpeedMultiplier = 1.7f; } Collider[] array = Physics.OverlapSphere(_transform.position, _radius); Collider[] array2 = array; CharacterMotor val2 = default(CharacterMotor); Vector3 val4 = default(Vector3); foreach (Collider val in array2) { CharacterBody component = ((Component)val).GetComponent<CharacterBody>(); if (!Object.op_Implicit((Object)(object)component) || (((Component)component.healthComponent).TryGetComponent<CharacterMotor>(ref val2) && val2.isGrounded) || (Object)(object)component == (Object)(object)CharacterBody || component.teamComponent.teamIndex == CharacterBody.teamComponent.teamIndex) { continue; } Rigidbody component2 = ((Component)val).GetComponent<Rigidbody>(); if (!Object.op_Implicit((Object)(object)component2)) { continue; } float num = Vector3.Distance(component.transform.position, _transform.position); if (!(num > 30f)) { if (num >= _radius * 0.2f) { component2.AddForce(-(component.transform.position - ((Component)this).transform.position) * (Mathf.Pow(component.rigidbody.mass, 0.3f) / 2.5f) * Mathf.Lerp(0.1f, 1.2f, num / _radius), (ForceMode)5); } Vector3 val3 = component.transform.position - _transform.position; val3.y = 0f; ((Vector3)(ref val4))..ctor(0f - val3.z, 0f, val3.x); Quaternion val5 = Quaternion.AngleAxis(-45f, Vector3.up); val4 = val5 * val4; component2.AddForce(val4 * RotationForce * _currentSpeedMultiplier * (Mathf.Pow(component.rigidbody.mass, 0.8f) / 18f) * _radius / num); if (IsInsideEllipse(val3)) { Vector3 val6 = _transform.position - component.transform.position; val6.y = 0f; component2.AddForce(-((Vector3)(ref val6)).normalized * (Mathf.Pow(component.rigidbody.mass, 0.8f) / 18f) * 0.6f, (ForceMode)5); } } } } public void DoIAmuseYou() { //IL_000e: 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_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: 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_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) _slap = true; Collider[] array = Physics.OverlapSphere(_transform.position, _radius); Collider[] array2 = array; CharacterMotor val2 = default(CharacterMotor); Vector3 val5 = default(Vector3); foreach (Collider val in array2) { CharacterBody component = ((Component)val).GetComponent<CharacterBody>(); if (!Object.op_Implicit((Object)(object)component) || (((Component)component.healthComponent).TryGetComponent<CharacterMotor>(ref val2) && val2.isGrounded) || (Object)(object)component == (Object)(object)CharacterBody || component.teamComponent.teamIndex == CharacterBody.teamComponent.teamIndex) { continue; } Rigidbody component2 = ((Component)val).GetComponent<Rigidbody>(); if (!Object.op_Implicit((Object)(object)component2)) { continue; } float num = Vector3.Distance(component.transform.position, _transform.position); if (!(num > _radius)) { Vector3 val3 = component.transform.position - _transform.position; float num2 = 500f; Vector3 val4 = component.transform.position - _transform.position; val4.y = 0f; ((Vector3)(ref val5))..ctor(0f - val4.z, 0f, val4.x); if (((Vector3)(ref val3)).sqrMagnitude == 0f) { ((Vector3)(ref val5))..ctor(Random.Range(-1f, 1f), 0f, Random.Range(-1f, 1f)); } ((Vector3)(ref val5)).Normalize(); component2.AddForce(val5 * num2 * component.rigidbody.mass / 20f, (ForceMode)1); } } } private bool IsInsideEllipse(Vector3 delta) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) float x = delta.x; float y = delta.y; float z = delta.z; float num = x / (_radius / 4f); float num2 = z / (_radius / 4f); float num3 = y / _radius; return num * num + num2 * num2 + num3 * num3 <= 1f; } } public abstract class EliteEquipmentBase<T> : EliteEquipmentBase where T : EliteEquipmentBase<T> { public static T Instance { get; private set; } public EliteEquipmentBase() { if (Instance != null) { throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting EliteEquipmentBase was instantiated twice"); } Instance = this as T; } } public abstract class EliteEquipmentBase { public enum EliteTier { Tier1, Tier2 } public enum TargetingType { Enemies, Friendlies } public class TargetingControllerComponent : MonoBehaviour { public GameObject TargetObject; public GameObject VisualizerPrefab; public Indicator Indicator; public BullseyeSearch TargetFinder; public Action<BullseyeSearch> AdditionalBullseyeFunctionality = delegate { }; public void Awake() { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown Indicator = new Indicator(((Component)this).gameObject, (GameObject)null); Invalidate(); } public void Invalidate() { TargetObject = null; Indicator.targetTransform = null; } public void ConfigureTargetFinderBase(EquipmentSlot self) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown if (TargetFinder == null) { TargetFinder = new BullseyeSearch(); } TargetFinder.teamMaskFilter = TeamMask.allButNeutral; ((TeamMask)(ref TargetFinder.teamMaskFilter)).RemoveTeam(self.characterBody.teamComponent.teamIndex); TargetFinder.sortMode = (SortMode)2; TargetFinder.filterByLoS = true; float num = default(float); Ray val = CameraRigController.ModifyAimRayIfApplicable(self.GetAimRay(), ((Component)self).gameObject, ref num); TargetFinder.searchOrigin = ((Ray)(ref val)).origin; TargetFinder.searchDirection = ((Ray)(ref val)).direction; TargetFinder.maxAngleFilter = 10f; TargetFinder.viewer = self.characterBody; } public void ConfigureTargetFinderForEnemies(EquipmentSlot self) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) ConfigureTargetFinderBase(self); TargetFinder.teamMaskFilter = TeamMask.GetUnprotectedTeams(self.characterBody.teamComponent.teamIndex); TargetFinder.RefreshCandidates(); TargetFinder.FilterOutGameObject(((Component)self).gameObject); AdditionalBullseyeFunctionality(TargetFinder); PlaceTargetingIndicator(TargetFinder.GetResults()); } public void ConfigureTargetFinderForFriendlies(EquipmentSlot self) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) ConfigureTargetFinderBase(self); TargetFinder.teamMaskFilter = TeamMask.none; ((TeamMask)(ref TargetFinder.teamMaskFilter)).AddTeam(self.characterBody.teamComponent.teamIndex); TargetFinder.RefreshCandidates(); TargetFinder.FilterOutGameObject(((Component)self).gameObject); AdditionalBullseyeFunctionality(TargetFinder); PlaceTargetingIndicator(TargetFinder.GetResults()); } public void PlaceTargetingIndicator(IEnumerable<HurtBox> TargetFinderResults) { HurtBox val = (TargetFinderResults.Any() ? TargetFinderResults.First() : null); if (Object.op_Implicit((Object)(object)val)) { TargetObject = ((Component)val.healthComponent).gameObject; Indicator.visualizerPrefab = VisualizerPrefab; Indicator.targetTransform = ((Component)val).transform; } else { Invalidate(); } Indicator.active = Object.op_Implicit((Object)(object)val); } } public EquipmentDef EliteEquipmentDef; public BuffDef EliteBuffDef; public EliteDef EliteDef; private static GameObject hauntedPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/EliteHaunted/PickupEliteHaunted.prefab").WaitForCompletion(); private static GameObject firePrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/EliteFire/PickupEliteFire.prefab").WaitForCompletion(); public static Dictionary<string, Dictionary<object, List<ItemDisplayRule>>> perBodyDisplayRules = new Dictionary<string, Dictionary<object, List<ItemDisplayRule>>>(); public GameObject TargetingIndicatorPrefabBase = null; public abstract string EliteEquipmentName { get; } public abstract string EliteAffixToken { get; } public abstract string EliteEquipmentPickupDesc { get; } public abstract string EliteEquipmentFullDescription { get; } public abstract string EliteEquipmentLore { get; } public abstract string EliteModifier { get; } public virtual bool AppearsInSinglePlayer { get; } = true; public virtual bool AppearsInMultiPlayer { get; } = true; public abstract GameObject EliteEquipmentModel { get; } public abstract Sprite EliteEquipmentIcon { get; } public virtual GameObject EliteCro