Please disclose if your mod was created primarily using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of Tartarus v1.4.3
BepInEx/plugins/com.github.Teaisnt.Tartarus.dll
Decompiled 18 hours ago
The result has been truncated due to the large size, download it to view full contents!
#define DEBUG using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Cryptography; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using CodeRebirthLib; using CodeRebirthLib.AssetManagement; using CodeRebirthLib.ContentManagement; using GameNetcodeStuff; using HarmonyLib; using LethalLevelLoader; using Microsoft.CodeAnalysis; using Unity.Netcode; using UnityEngine; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("com.github.Teaisnt.Tartarus")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.3.0.0")] [assembly: AssemblyInformationalVersion("1.3.0")] [assembly: AssemblyProduct("com.github.Teaisnt.Tartarus")] [assembly: AssemblyTitle("Tartarus")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.3.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace BepInEx { [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)] [Conditional("CodeGeneration")] internal sealed class BepInAutoPluginAttribute : Attribute { public BepInAutoPluginAttribute(string? id = null, string? name = null, string? version = null) { } } } namespace BepInEx.Preloader.Core.Patching { [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)] [Conditional("CodeGeneration")] internal sealed class PatcherAutoPluginAttribute : Attribute { public PatcherAutoPluginAttribute(string? id = null, string? name = null, string? version = null) { } } } namespace Tartarus { public class Block2FloodTrapController : MonoBehaviour { [SerializeField] private List<AudioSource> faceAudioSources; [SerializeField] private AudioSource doorAudioSource; [SerializeField] private Animator m_Animator; [SerializeField] private Transform purpleIdolDetectBox; [SerializeField] private AudioClip doorCloseSound; [SerializeField] private AudioClip doorOpenSound; [SerializeField] private AudioClip tentaclesShiftSound; private bool foundIdol = false; private PurpleIdol purpleIdol; private Vector3 purpleIdolSpawnPosition; private bool startedFloodTrap = false; private float timeSinceAlive = 0f; private void Start() { CheckForIdol(); } private void CheckForIdol() { ((MonoBehaviour)this).StartCoroutine(Ext.WaitAndDo(delegate { }, 1f, delegate { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: 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_0068: Unknown result type (might be due to invalid IL or missing references) int num = 64; Collider[] array = Physics.OverlapBox(purpleIdolDetectBox.position, purpleIdolDetectBox.localScale, Quaternion.identity, num); if (array.Length != 0) { Collider[] array2 = array; PurpleIdol purpleIdol = default(PurpleIdol); foreach (Collider val in array2) { if (((Component)val).TryGetComponent<PurpleIdol>(ref purpleIdol)) { this.purpleIdol = purpleIdol; purpleIdolSpawnPosition = ((Component)this.purpleIdol).transform.position; break; } } } if ((Object)(object)this.purpleIdol == (Object)null) { CheckForIdol(); } })); } private void Update() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) timeSinceAlive += Time.deltaTime; if ((Object)(object)purpleIdol != (Object)null && ((Component)purpleIdol).transform.position != purpleIdolSpawnPosition && !startedFloodTrap && timeSinceAlive > 2f) { startedFloodTrap = true; FloodStart(); } } private void FloodStart() { m_Animator.SetTrigger("FloodStart"); doorAudioSource.PlayOneShot(doorCloseSound); doorAudioSource.PlayOneShot(tentaclesShiftSound); foreach (AudioSource faceAudioSource in faceAudioSources) { ((MonoBehaviour)this).StartCoroutine(FadeSource(faceAudioSource, fadeIn: true)); } } private void FloodStop() { doorAudioSource.PlayOneShot(doorOpenSound); doorAudioSource.PlayOneShot(tentaclesShiftSound); foreach (AudioSource faceAudioSource in faceAudioSources) { ((MonoBehaviour)this).StartCoroutine(FadeSource(faceAudioSource, fadeIn: false)); } } private IEnumerator FadeSource(AudioSource audioSource, bool fadeIn) { float timeElapsed = 0f; while (timeElapsed < 0.25f) { if (!fadeIn) { audioSource.volume = Mathf.Lerp(0.3f, 0f, timeElapsed / 0.25f); } else { audioSource.volume = Mathf.Lerp(0f, 0.3f, timeElapsed / 0.25f); } timeElapsed += Time.deltaTime; yield return null; } if (fadeIn) { audioSource.volume = 0.3f; } else { audioSource.volume = 0f; } } } public class Block2TentacleController : NetworkBehaviour { [SerializeField] private AudioSource audioSource; [SerializeField] private AudioClip tentacleAttack; [SerializeField] private AudioClip tentacleSearch; private bool exploring = false; private bool canKill = false; public bool collidedWithPlayer = false; [SerializeField] private Animator animator; [SerializeField] private Transform grabPosition; private void Start() { } private void Update() { } private void OnTriggerEnter(Collider other) { if (((Component)other).CompareTag("Player") && !collidedWithPlayer && !exploring) { Explore(); } } private void OnTriggerStay(Collider other) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) if (canKill && ((Component)other).CompareTag("Player")) { exploring = false; canKill = false; CheckAnimationGrabPlayerServerRpc(new NetworkBehaviourReference((NetworkBehaviour)(object)((Component)other).GetComponent<PlayerControllerB>())); } } public void Explore() { exploring = true; ((MonoBehaviour)this).StartCoroutine(Ext.WaitAndDo(delegate { ((MonoBehaviour)this).StartCoroutine(Ext.WaitAndDo(delegate { animator.SetTrigger("Explore"); audioSource.PlayOneShot(tentacleSearch); }, 0.5f, delegate { canKill = true; })); }, 4f, delegate { if (exploring) { exploring = false; } })); } [ServerRpc(RequireOwnership = false)] public void CheckAnimationGrabPlayerServerRpc(NetworkBehaviourReference playerRef) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) if (!collidedWithPlayer) { collidedWithPlayer = true; ConfirmAnimationGrabPlayerClientRpc(playerRef); } } [ClientRpc] public void ConfirmAnimationGrabPlayerClientRpc(NetworkBehaviourReference playerRef) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) collidedWithPlayer = true; ((MonoBehaviour)this).StartCoroutine(AnimationGrabPlayer(playerRef)); } private IEnumerator AnimationGrabPlayer(NetworkBehaviourReference playerRef) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB playerDying = default(PlayerControllerB); ((NetworkBehaviourReference)(ref playerRef)).TryGet<PlayerControllerB>(ref playerDying, (NetworkManager)null); animator.SetBool("grabbingPlayer", true); audioSource.PlayOneShot(tentacleAttack); grabPosition.position = ((Component)playerDying).transform.position; yield return (object)new WaitForSeconds(0.05f); if (((NetworkBehaviour)playerDying).IsOwner) { playerDying.KillPlayer(Vector3.zero, true, (CauseOfDeath)0, 0, default(Vector3)); } float startTime = Time.timeSinceLevelLoad; yield return (object)new WaitUntil((Func<bool>)(() => (Object)(object)playerDying.deadBody != (Object)null || Time.timeSinceLevelLoad - startTime > 4f)); if ((Object)(object)playerDying.deadBody != (Object)null) { playerDying.deadBody.attachedTo = grabPosition; playerDying.deadBody.attachedLimb = playerDying.deadBody.bodyParts[6]; playerDying.deadBody.matchPositionExactly = true; } else { Debug.Log((object)"Player body was not spawned in time for animation."); } animator.SetBool("grabbingPlayer", false); yield return (object)new WaitForSeconds(5f); if ((Object)(object)playerDying.deadBody != (Object)null) { playerDying.deadBody.attachedTo = null; playerDying.deadBody.attachedLimb = null; playerDying.deadBody.matchPositionExactly = false; ((Component)playerDying.deadBody).gameObject.SetActive(false); } } } public class BreakableObject : NetworkBehaviour, IHittable { [SerializeField] private List<GameObject> possibleDropsBlock1; [SerializeField] private List<GameObject> possibleDropsBlock2; [SerializeField] private List<GameObject> possibleDropsBlock3; [SerializeField] private List<GameObject> possibleDropsBlock4; [SerializeField] private List<GameObject> possibleDropsBlock5; [SerializeField] private List<GameObject> possibleDropsBlock6; [SerializeField] private GameObject worldTarot; [Range(0f, 100f)] [SerializeField] private int spawnChance; private Animator animator; private AudioSource audioSource; [SerializeField] private AudioClip breakSound; private void Start() { animator = ((Component)this).GetComponent<Animator>(); audioSource = ((Component)this).GetComponent<AudioSource>(); } bool IHittable.Hit(int force, Vector3 hitDirection, PlayerControllerB playerWhoHit, bool playHitSFX, int hitID = -1) { int currTartarusFloor = TartarusInteriorController.Instance.currTartarusFloor; OnHitServerRpc(currTartarusFloor); return true; } [ServerRpc(RequireOwnership = false)] private void OnHitServerRpc(int currBlock) { //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) List<GameObject> list = new List<GameObject>(); switch (currBlock) { case 0: list = possibleDropsBlock1; break; case 1: list = possibleDropsBlock2; break; case 2: list = possibleDropsBlock3; break; case 3: list = possibleDropsBlock4; break; case 4: list = possibleDropsBlock5; break; case 5: list = possibleDropsBlock6; break; } int num = Random.Range(0, 101); if (num <= Plugin.TarotSpawnChance.Value) { int num2 = Random.Range(0, 101); if (num <= Plugin.WorldTarotSpawnChance.Value) { GameObject val = Object.Instantiate<GameObject>(worldTarot, ((Component)((Component)this).GetComponentInChildren<Light>()).transform.position, ((Component)this).transform.rotation); if ((Object)(object)val != (Object)null) { val.GetComponent<NetworkObject>().Spawn(false); val.GetComponent<TarotCard>().tarotRarity = 20; } } else { int index = Random.Range(0, list.Count); GameObject val2 = Object.Instantiate<GameObject>(list[index], ((Component)((Component)this).GetComponentInChildren<Light>()).transform.position, ((Component)this).transform.rotation); if ((Object)(object)val2 != (Object)null) { val2.GetComponent<NetworkObject>().Spawn(false); val2.GetComponent<TarotCard>().tarotRarity = currBlock; } } } OnHitClientRpc(); } [ClientRpc] private void OnHitClientRpc() { animator.SetTrigger("Break"); audioSource.PlayOneShot(breakSound); } } public class ContentHandler : ContentHandler<ContentHandler> { public class NormalShadowBundle : AssetBundleLoader<NormalShadowBundle> { public NormalShadowBundle(CRMod mod, string filePath) : base(mod, filePath) { } } public class TheReaperBundle : AssetBundleLoader<TheReaperBundle> { public TheReaperBundle(CRMod mod, string filePath) : base(mod, filePath) { } } public class WealthHandBundle : AssetBundleLoader<WealthHandBundle> { public WealthHandBundle(CRMod mod, string filePath) : base(mod, filePath) { } } public ContentHandler(CRMod mod) : base(mod) { NormalShadowBundle normalShadowBundle = default(NormalShadowBundle); ((ContentHandler)this).RegisterContent<NormalShadowBundle>("normalshadowbundle", ref normalShadowBundle, false); TheReaperBundle theReaperBundle = default(TheReaperBundle); ((ContentHandler)this).RegisterContent<TheReaperBundle>("thereaperbundle", ref theReaperBundle, false); WealthHandBundle wealthHandBundle = default(WealthHandBundle); ((ContentHandler)this).RegisterContent<WealthHandBundle>("wealthhandbundle", ref wealthHandBundle, false); } } public class EnterAnimationController : NetworkBehaviour { public Animator animator; private AudioSource audioSource; private void Start() { audioSource = ((Component)this).GetComponent<AudioSource>(); if (Plugin.TartarusMoonEntryAnimation.Value && Plugin.moonEntryPlayCount < Plugin.TartarusMoonEntryAnimationPlayCount.Value) { ((ExtendedEvent)DungeonManager.GlobalDungeonEvents.onSpawnedScrapObjects).AddListener((Action)PlayAnimation); } } private void PlayAnimation() { ((ExtendedEvent)DungeonManager.GlobalDungeonEvents.onSpawnedScrapObjects).RemoveListener((Action)PlayAnimation); Plugin.moonEntryPlayCount++; PlayAnimationServerRpc(); } [ServerRpc] private void PlayAnimationServerRpc() { PlayAnimationClientRpc(); } [ClientRpc] private void PlayAnimationClientRpc() { animator.SetTrigger("playAnimation"); audioSource.Play(); } } public static class Extensions { public static void SetLayer(this GameObject obj, LayerMask layerMask, bool children) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) obj.layer = LayerMask.op_Implicit(layerMask); if (children && obj.transform.childCount > 0) { Transform[] componentsInChildren = obj.GetComponentsInChildren<Transform>(); Transform[] array = componentsInChildren; foreach (Transform val in array) { ((Component)val).gameObject.layer = LayerMask.op_Implicit(layerMask); } } } public static void SetLayer(this GameObject obj, string layerName, bool children) { //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_0054: Unknown result type (might be due to invalid IL or missing references) LayerMask val = LayerMask.op_Implicit(LayerMask.NameToLayer(layerName)); obj.layer = LayerMask.op_Implicit(val); if (children && obj.transform.childCount > 0) { Transform[] componentsInChildren = obj.GetComponentsInChildren<Transform>(); Transform[] array = componentsInChildren; foreach (Transform val2 in array) { ((Component)val2).gameObject.layer = LayerMask.op_Implicit(val); } } } public static Transform GetClosest(this Transform _transform, params Component[] array) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) Transform result = null; float num = float.PositiveInfinity; foreach (Component val in array) { float num2 = Vector3.Distance(_transform.position, val.transform.position); if (num2 < num) { num = num2; result = val.transform; } } return result; } public static void SetColliderEnabled(this GameObject obj, bool enable, bool children) { obj.GetComponent<Collider>().enabled = enable; if (children) { Collider[] componentsInChildren = obj.GetComponentsInChildren<Collider>(); Collider[] array = componentsInChildren; foreach (Collider val in array) { val.enabled = enable; } } } public static void SetTag(this GameObject obj, string newTag, bool children) { obj.tag = newTag; if (children) { Transform[] componentsInChildren = obj.GetComponentsInChildren<Transform>(); Transform[] array = componentsInChildren; foreach (Transform val in array) { ((Component)val).gameObject.tag = newTag; } } } public static void AddComponent<T>(this GameObject obj, bool children) where T : Component { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown obj.AddComponent<T>(); if (!children) { return; } foreach (Transform item in obj.transform) { Transform val = item; ((Component)val).gameObject.AddComponent<T>(); } } public static T GetVariableFromString<T>(this Component comp, string varName) { return (T)((object)comp).GetType().GetField(varName).GetValue(comp); } public static void MoveTowards(this Transform trans, Vector3 target, float maxDistanceDelta) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) trans.position = Vector3.MoveTowards(trans.position, target, maxDistanceDelta); } public static Vector3 GetCenter(this GameObject obj) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0037: 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_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) List<float> list = new List<float>(); List<float> list2 = new List<float>(); List<float> list3 = new List<float>(); Renderer[] componentsInChildren = obj.GetComponentsInChildren<Renderer>(); Renderer[] array = componentsInChildren; foreach (Renderer val in array) { Bounds bounds = val.bounds; list.Add(((Bounds)(ref bounds)).center.x); bounds = val.bounds; list2.Add(((Bounds)(ref bounds)).center.y); bounds = val.bounds; list3.Add(((Bounds)(ref bounds)).center.z); } float num = (Mathf.Max(list.ToArray()) + Mathf.Min(list.ToArray())) / 2f; float num2 = (Mathf.Max(list2.ToArray()) + Mathf.Min(list2.ToArray())) / 2f; float num3 = (Mathf.Max(list3.ToArray()) + Mathf.Min(list3.ToArray())) / 2f; return new Vector3(num, num2, num3); } public static Vector3 GetBottom(this GameObject obj) { //IL_0009: 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_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) MeshFilter[] componentsInChildren = obj.GetComponentsInChildren<MeshFilter>(); Vector3 center = obj.GetCenter(); Vector3 val = componentsInChildren[0].mesh.vertices[0]; MeshFilter[] array = componentsInChildren; foreach (MeshFilter val2 in array) { Mesh mesh = val2.mesh; Vector3[] vertices = mesh.vertices; foreach (Vector3 val3 in vertices) { if (val3.y < val.y) { val = val3; } } } center.y = val.y; return center; } public static Vector3 GetCenterNew(this GameObject obj) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) Bounds val = default(Bounds); bool flag = true; foreach (Transform item in obj.transform) { Transform val2 = item; if (Object.op_Implicit((Object)(object)((Component)val2).GetComponent<MeshRenderer>())) { if (flag) { flag = false; val = ((Renderer)((Component)val2).GetComponent<MeshRenderer>()).bounds; } else { ((Bounds)(ref val)).Encapsulate(((Renderer)((Component)val2).GetComponent<MeshRenderer>()).bounds); } } } return ((Bounds)(ref val)).center; } public static Transform[] GetAllChildren(this Transform trans) { return ((Component)trans).GetComponentsInChildren<Transform>(); } public static void SetAlpha(this Image image, float alpha) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) Color color = ((Graphic)image).color; color.a = alpha; ((Graphic)image).color = color; } public static void SetAlpha(this Material mat, float alpha) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) Color color = mat.color; color.a = alpha; mat.color = color; } public static void SetX(this Transform trans, float newX, bool relative) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) Vector3 position = trans.position; position.x = (relative ? (position.x + newX) : newX); trans.position = position; } public static void SetY(this Transform trans, float newY, bool relative) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) Vector3 position = trans.position; position.y = (relative ? (position.y + newY) : newY); trans.position = position; } public static void SetZ(this Transform trans, float newZ, bool relative) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) Vector3 position = trans.position; position.z = (relative ? (position.z + newZ) : newZ); trans.position = position; } public static bool IsSimilar(this Material mat, Material other) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Expected O, but got Unknown //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) Texture2D val = (Texture2D)mat.mainTexture; Texture2D val2 = (Texture2D)other.mainTexture; if ((Object)(object)mat.mainTexture == (Object)null && (Object)(object)other.mainTexture == (Object)null) { return mat.color == other.color; } return mat.color == other.color && (Object)(object)val == (Object)(object)val2; } } public class Ext { public static void LoadSceneOffline(string sceneName) { SceneManager.LoadScene(sceneName); } public static Scene GetActiveScene() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) return SceneManager.GetActiveScene(); } public static int CryptoRandomInt(int min, int max) { return RandomNumberGenerator.GetInt32(min, max); } public static float CryptoRandomFloat(float min, float max) { RandomNumberGenerator randomNumberGenerator = RandomNumberGenerator.Create(); byte[] array = new byte[4]; randomNumberGenerator.GetBytes(array); float num = BitConverter.ToSingle(array, 0); return num * (max - min) + min; } public static IEnumerator WaitAndDo(Action firstAction, float time, Action secondAction) { firstAction(); yield return (object)new WaitForSeconds(time); secondAction(); } public static IEnumerator WaitAndDo(Func<bool> condition, Action action) { while (condition()) { yield return null; } action(); } } public class MathExt { public static float Wrap(float value, float min, float max) { if (value % 1f == 0f) { while (value > max || value < min) { if (value > max) { value += min - max - 1f; } else if (value < min) { value += max - min + 1f; } } return value; } float num = value + 1f; while (value != num) { num = value; if (value < min) { value = max - (min - value); } else if (value > max) { value = min + (value - max); } } return value; } public static int Wrap(int value, int min, int max) { if (value % 1 == 0) { while (value > max || value < min) { if (value > max) { value += min - max - 1; } else if (value < min) { value += max - min + 1; } } return value; } int num = value + 1; while (value != num) { num = value; if (value < min) { value = max - (min - value); } else if (value > max) { value = min + (value - max); } } return value; } public static bool Chance(float chance) { return chance > Random.Range(0f, 1f); } public static bool CryptoChance(float chance) { return chance > Ext.CryptoRandomFloat(0f, 1f); } public static T Choose<T>(params T[] array) { int num = array.Length; return array[Random.Range(0, num)]; } public static T Choose<T>(List<T> list) { return Choose(list.ToArray()); } public static T CryptoChoose<T>(params T[] array) { int max = array.Length; return array[Ext.CryptoRandomInt(0, max)]; } public static T CryptoChoose<T>(List<T> list) { return CryptoChoose(list.ToArray()); } } public class FunnyDoor : NetworkBehaviour { private Animator animator; private AudioSource audioSource; public int inTriggerCount = 0; private bool isOpen = false; public AudioClip doorOpenSound; public AudioClip doorCloseSound; public bool inverseOpenAndClose; private void Start() { animator = ((Component)this).GetComponent<Animator>(); audioSource = ((Component)this).GetComponent<AudioSource>(); } [ServerRpc(RequireOwnership = false)] private void OpenDoorServerRpc() { OpenDoorClientRpc(); } [ClientRpc] private void OpenDoorClientRpc() { animator.SetTrigger("Open"); audioSource.PlayOneShot(doorOpenSound); } [ServerRpc(RequireOwnership = false)] private void CloseDoorServerRpc() { CloseDoorClientRpc(); } [ClientRpc] private void CloseDoorClientRpc() { animator.SetTrigger("Close"); audioSource.PlayOneShot(doorCloseSound); } private void OnTriggerEnter(Collider other) { if (((Component)other).CompareTag("Player") || ((Component)other).CompareTag("Enemy")) { UpdateCount(1); } } private void OnTriggerExit(Collider other) { if (((Component)other).CompareTag("Player") || ((Component)other).CompareTag("Enemy")) { UpdateCount(-1); } } private void UpdateCount(int update) { inTriggerCount += update; if (inTriggerCount == 1 && !isOpen) { if (inverseOpenAndClose) { CloseDoorServerRpc(); } else { OpenDoorServerRpc(); } isOpen = true; } else if (inTriggerCount == 0 && isOpen) { if (inverseOpenAndClose) { OpenDoorServerRpc(); } else { CloseDoorServerRpc(); } isOpen = false; } } } public class InteractAnimator : NetworkBehaviour { private Animator animator; private AudioSource audioSource; private bool isOpen = false; public AudioClip doorOpenSound; public AudioClip doorCloseSound; private void Start() { animator = ((Component)this).GetComponent<Animator>(); audioSource = ((Component)this).GetComponent<AudioSource>(); } public void ToggleDoor() { ToggleDoorServerRpc(); } [ServerRpc(RequireOwnership = false)] private void ToggleDoorServerRpc() { ToggleDoorClientRpc(); } [ClientRpc] private void ToggleDoorClientRpc() { isOpen = !isOpen; animator.SetBool("Opened", isOpen); if (isOpen && (Object)(object)doorOpenSound != (Object)null) { audioSource.PlayOneShot(doorOpenSound); } else if (!isOpen && (Object)(object)doorOpenSound != (Object)null) { audioSource.PlayOneShot(doorCloseSound); } } [ServerRpc(RequireOwnership = false)] private void OpenDoorServerRpc() { OpenDoorClientRpc(); } [ClientRpc] private void OpenDoorClientRpc() { animator.SetBool("Opened", true); if ((Object)(object)doorOpenSound != (Object)null) { audioSource.PlayOneShot(doorOpenSound); } } [ServerRpc(RequireOwnership = false)] private void CloseDoorServerRpc() { CloseDoorClientRpc(); } [ClientRpc] private void CloseDoorClientRpc() { animator.SetBool("Opened", false); if ((Object)(object)doorCloseSound != (Object)null) { audioSource.PlayOneShot(doorCloseSound); } } } public class MoveBackAndForth : MonoBehaviour { [SerializeField] private Vector3 frequency; [SerializeField] private Vector3 magnitude; [SerializeField] private Vector3 offset; private void Update() { //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Sin(Time.time * frequency.x + offset.x) * magnitude.x; float num2 = Mathf.Sin(Time.time * frequency.y + offset.y) * magnitude.y; float num3 = Mathf.Sin(Time.time * frequency.z + offset.z) * magnitude.z; Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(num, num2, num3); ((Component)this).transform.Translate(val * Time.deltaTime); } } public class MovingHall : NetworkBehaviour { public enum State { Rotating, Moving } [Header("State")] public State stateType; [SerializeField] private Animator animator; private AudioSource audioSource; public int inTriggerCount = 0; private bool isOpen = false; public AudioClip rotateInSound; public AudioClip rotateOutSound; private void Start() { animator = ((Component)this).GetComponent<Animator>(); audioSource = ((Component)this).GetComponent<AudioSource>(); ChooseRandomStateServerRpc(); } [ServerRpc(RequireOwnership = false)] private void ChooseRandomStateServerRpc() { if (Random.Range(0, 2) == 0) { ChooseMovingStateClientRpc(); } else { ChooseRotatingStateClientRpc(); } } [ClientRpc] private void ChooseMovingStateClientRpc() { stateType = State.Moving; animator.SetTrigger("MoveIn"); } [ClientRpc] private void ChooseRotatingStateClientRpc() { stateType = State.Rotating; animator.SetTrigger("RotateIn"); } [ServerRpc(RequireOwnership = false)] private void MoveHallInServerRpc() { MoveHallInClientRpc(); } [ClientRpc] private void MoveHallInClientRpc() { animator.SetTrigger("MoveIn"); audioSource.PlayOneShot(rotateInSound); isOpen = false; } [ServerRpc(RequireOwnership = false)] private void MoveHallOutServerRpc() { MoveHallOutClientRpc(); } [ClientRpc] private void MoveHallOutClientRpc() { animator.SetTrigger("MoveOut"); audioSource.PlayOneShot(rotateOutSound); isOpen = true; } [ServerRpc(RequireOwnership = false)] private void RotateHallInServerRpc() { RotateHallInClientRpc(); } [ClientRpc] private void RotateHallInClientRpc() { animator.SetTrigger("RotateIn"); audioSource.PlayOneShot(rotateInSound); isOpen = false; } [ServerRpc(RequireOwnership = false)] private void RotateHallOutServerRpc() { RotateHallOutClientRpc(); } [ClientRpc] private void RotateHallOutClientRpc() { animator.SetTrigger("RotateOut"); audioSource.PlayOneShot(rotateOutSound); isOpen = true; } private void OnTriggerEnter(Collider other) { if (((Component)other).CompareTag("Player") || ((Component)other).CompareTag("Enemy")) { UpdateCount(1); } } private void OnTriggerExit(Collider other) { if (((Component)other).CompareTag("Player") || ((Component)other).CompareTag("Enemy")) { UpdateCount(-1); } } private void UpdateCount(int update) { inTriggerCount += update; if (inTriggerCount == 1 && !isOpen) { TriggerOut(); } else if (inTriggerCount == 0 && isOpen) { TriggerIn(); } } private void TriggerOut() { if (stateType == State.Rotating) { RotateHallOutServerRpc(); } else { MoveHallOutServerRpc(); } } private void TriggerIn() { if (stateType == State.Rotating) { RotateHallInServerRpc(); } else { MoveHallInServerRpc(); } } } internal class NormalShadowAI : EnemyAI { public enum State { Wander, Attack, Chase, Alert } [SerializeField] private List<GameObject> possibleDrops; public List<AudioClip> audioClips = new List<AudioClip>(); public Transform turnCompass = null; public Transform attackArea = null; public ParticleSystem deathParticles; public float wanderMoveSpeed; public float chaseMoveSpeed; private float timeSinceNewRandPos; private float timeSinceAttacking; private float timeSinceAlerted; private Vector3 StalkPos; private Random enemyRandom = null; private bool isDeadAnimationDone; [Header("State")] public State stateType; [Conditional("DEBUG")] private void LogIfDebugBuild(string text) { } public override void Start() { //IL_0065: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Start(); LogIfDebugBuild("Example Enemy Spawned"); base.creatureAnimator.SetTrigger("startWalk"); timeSinceNewRandPos = 0f; timeSinceAlerted = 0f; enemyRandom = new Random(StartOfRound.Instance.randomMapSeed + base.thisEnemyIndex); isDeadAnimationDone = false; ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); } public override void Update() { //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Update(); if (base.isEnemyDead) { if (!isDeadAnimationDone) { LogIfDebugBuild("Stopping enemy voice with janky code."); isDeadAnimationDone = true; StopSfxClientRpc(); PlaySoundClientRpc(3); } return; } timeSinceAttacking += Time.deltaTime; timeSinceNewRandPos += Time.deltaTime; timeSinceAlerted += Time.deltaTime; if ((Object)(object)base.targetPlayer != (Object)null && (stateType == State.Chase || stateType == State.Attack)) { turnCompass.LookAt(((Component)base.targetPlayer.gameplayCamera).transform.position); ((Component)this).transform.rotation = Quaternion.Lerp(((Component)this).transform.rotation, Quaternion.Euler(new Vector3(0f, turnCompass.eulerAngles.y, 0f)), 4f * Time.deltaTime); } } public override void DoAIInterval() { //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0169: 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_014a: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).DoAIInterval(); if (base.isEnemyDead || StartOfRound.Instance.allPlayersDead) { return; } switch (stateType) { case State.Wander: base.agent.speed = Plugin.ShadowWanderSpeed.Value; if (FoundClosestPlayerInRange(25f, 1f)) { LogIfDebugBuild("Start Target Player"); ((EnemyAI)this).StopSearch(base.currentSearch, true); DoAnimationClientRpc("alert"); PlaySoundClientRpc(0); ChangeSfxClipClientRpc(6); timeSinceAlerted = 0f; ChangeStateClientRpc(State.Alert); } break; case State.Alert: base.agent.speed = 0f; if (timeSinceAlerted > 1f) { ChangeStateClientRpc(State.Chase); } break; case State.Chase: base.agent.speed = Plugin.ShadowChaseSpeed.Value; if (!TargetClosestPlayerInAnyCase() || (Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position) > 25f && !((EnemyAI)this).CheckLineOfSightForPosition(((Component)base.targetPlayer).transform.position, 45f, 60, -1f, (Transform)null)) || Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position) > 50f) { LogIfDebugBuild("Stop Target Player"); ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); ChangeStateClientRpc(State.Wander); ChangeSfxClipClientRpc(5); DoAnimationClientRpc("wander"); } else { ChasingPlayer(); } break; case State.Attack: base.agent.speed = 1f; break; default: LogIfDebugBuild("This Behavior State doesn't exist!"); break; } } [ClientRpc(/*Could not decode attribute arguments.*/)] public void StopSfxClientRpc() { base.creatureVoice.Stop(); } [ClientRpc(/*Could not decode attribute arguments.*/)] public void ChangeSfxClipClientRpc(int clipNum) { base.creatureSFX.clip = audioClips[clipNum]; base.creatureSFX.Play(); } private bool FoundClosestPlayerInRange(float range, float senseRange) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).TargetClosestPlayer(1.5f, true, 70f); return (Object)(object)base.targetPlayer != (Object)null && Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position) < range; } private bool TargetClosestPlayerInAnyCase() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) base.mostOptimalDistance = 2000f; base.targetPlayer = null; for (int i = 0; i < StartOfRound.Instance.connectedPlayersAmount + 1; i++) { base.tempDist = Vector3.Distance(((Component)this).transform.position, ((Component)StartOfRound.Instance.allPlayerScripts[i]).transform.position); if (base.tempDist < base.mostOptimalDistance) { base.mostOptimalDistance = base.tempDist; base.targetPlayer = StartOfRound.Instance.allPlayerScripts[i]; } } if ((Object)(object)base.targetPlayer == (Object)null) { return false; } return true; } private void ChasingPlayer() { //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)base.targetPlayer == (Object)null) && ((NetworkBehaviour)this).IsOwner) { if (enemyRandom.Next(0, 1) == 0 && timeSinceAttacking > 1f && Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position) < 4f) { ((MonoBehaviour)this).StartCoroutine(SwingAttack()); } else { StalkPos = ((Component)base.targetPlayer).transform.position - ((Component)this).transform.forward * 2f; } ((EnemyAI)this).SetDestinationToPosition(StalkPos, false); } } private IEnumerator SwingAttack() { timeSinceAttacking = 0f; ChangeStateClientRpc(State.Attack); PlaySoundClientRpc(1); yield return (object)new WaitForSeconds(0.5f); if (!base.isEnemyDead) { DoAnimationClientRpc("startAttack"); yield return (object)new WaitForSeconds(0.3f); SwingAttackHitServerRpc(); if (stateType == State.Attack) { ChangeStateClientRpc(State.Chase); } } } public override void OnCollideWithPlayer(Collider other) { } public override void HitEnemy(int force = 1, PlayerControllerB? playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { ((EnemyAI)this).HitEnemy(force, playerWhoHit, playHitSFX, hitID); if (base.isEnemyDead) { return; } base.enemyHP -= force; PlaySoundClientRpc(2); if (((NetworkBehaviour)this).IsOwner) { if (base.enemyHP <= 0 && !base.isEnemyDead) { DeathServerRpc(); ((MonoBehaviour)this).StopCoroutine(SwingAttack()); ((MonoBehaviour)this).StopCoroutine(base.searchCoroutine); ((EnemyAI)this).KillEnemyOnOwnerClient(false); } else { ((MonoBehaviour)this).StartCoroutine(TakeDamage()); } } } [ServerRpc] public void DeathServerRpc() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) int index = Random.Range(0, possibleDrops.Count); GameObject val = Object.Instantiate<GameObject>(possibleDrops[index], ((Component)turnCompass).transform.position, ((Component)this).transform.rotation); if ((Object)(object)val != (Object)null) { val.GetComponent<NetworkObject>().Spawn(false); val.GetComponent<TarotCard>().tarotRarity = 4; } DeathClientRpc(); } [ClientRpc(/*Could not decode attribute arguments.*/)] public void DeathClientRpc() { ((MonoBehaviour)this).StartCoroutine(DeathCoroutine()); } public IEnumerator DeathCoroutine() { base.creatureVoice.PlayOneShot(audioClips[3]); base.creatureSFX.Stop(); deathParticles.Play(); List<Material> materialList = new List<Material>(); float duration = 0f; SkinnedMeshRenderer[] skinnedMeshRenderers = base.skinnedMeshRenderers; foreach (SkinnedMeshRenderer renderer in skinnedMeshRenderers) { Material[] materials = ((Renderer)renderer).materials; foreach (Material material in materials) { materialList.Add(material); } } while (duration < 1f) { foreach (Material material2 in materialList) { material2.SetFloat("_DissolveAmount", duration); } duration += Time.deltaTime / 3f; yield return null; } foreach (Material material3 in materialList) { material3.SetFloat("_DissolveAmount", 1f); } } private IEnumerator TakeDamage() { DoAnimationClientRpc("takeDamage"); yield return (object)new WaitForSeconds(1f); if (base.currentBehaviourStateIndex == 0) { DoAnimationClientRpc("stopChase"); } else { DoAnimationClientRpc("alert"); } } [ClientRpc(/*Could not decode attribute arguments.*/)] public void DoAnimationClientRpc(string animationName) { LogIfDebugBuild("Animation: " + animationName); base.creatureAnimator.SetTrigger(animationName); } [ClientRpc(/*Could not decode attribute arguments.*/)] public void PlaySoundClientRpc(int index) { base.creatureVoice.PlayOneShot(audioClips[index]); } [ClientRpc] public void ChangeStateClientRpc(State state) { stateType = state; } [ServerRpc] public void SwingAttackHitServerRpc() { DamagePlayerClientRpc(); } [ClientRpc] public void DamagePlayerClientRpc() { //IL_0009: 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_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) int num = 8; Collider[] array = Physics.OverlapBox(attackArea.position, attackArea.lossyScale, Quaternion.identity, num, (QueryTriggerInteraction)1); if (array.Length == 0) { return; } if (((NetworkBehaviour)this).IsServer) { PlaySoundClientRpc(4); } Collider[] array2 = array; foreach (Collider val in array2) { if (!((Object)(object)((Component)val).GetComponent<PlayerControllerB>() != (Object)(object)GameNetworkManager.Instance.localPlayerController)) { ((Component)val).GetComponent<PlayerControllerB>().DamagePlayer(Plugin.ShadowSlashDamage.Value, true, true, (CauseOfDeath)6, 0, false, default(Vector3)); } } } } public class NormalTeleport : MonoBehaviour { [SerializeField] private Transform telePoint; public void Teleport() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) GameNetworkManager.Instance.localPlayerController.TeleportPlayer(telePoint.position, false, 0f, false, true); } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.github.Teaisnt.Tartarus", "Tartarus", "1.3.0")] public class Plugin : BaseUnityPlugin { [HarmonyPatch(typeof(HangarShipDoor))] internal class HangarShipDoorPatch : NetworkBehaviour { [HarmonyPatch(typeof(HangarShipDoor), "SetDoorOpen")] [HarmonyPostfix] public static void OpenDoorPatch(HangarShipDoor __instance) { if ((Object)(object)TartarusInteriorController.Instance != (Object)null && RoundManager.Instance.currentLevel.sceneName == "Tartarus") { TartarusInteriorNetworkController.Instance.SetScrapToChestsServerRpc(); } } } internal static int moonEntryPlayCount = 0; internal static int velvetRoomEntryPlayCount = 0; public const string ModGUID = "Tartarus"; internal static readonly Harmony Harmony = new Harmony("Tartarus"); public const string Id = "com.github.Teaisnt.Tartarus"; internal static ConfigEntry<bool> TartarusMoonEntryAnimation { get; private set; } internal static ConfigEntry<int> TartarusMoonEntryAnimationPlayCount { get; private set; } internal static ConfigEntry<bool> VelvetRoomEntryAnimation { get; private set; } internal static ConfigEntry<float> VelvetRoomScrapValueMultiplier { get; private set; } internal static ConfigEntry<float> VelvetRoomLightBrightness { get; private set; } internal static ConfigEntry<int> TarotSpawnChance { get; private set; } internal static ConfigEntry<int> WorldTarotSpawnChance { get; private set; } internal static ConfigEntry<int> ReaperGunDamage { get; private set; } internal static ConfigEntry<int> ReaperBashDamage { get; private set; } internal static ConfigEntry<int> ReaperMaxBullets { get; private set; } internal static ConfigEntry<int> ReaperWanderSpeed { get; private set; } internal static ConfigEntry<int> ReaperStalkingSpeed { get; private set; } internal static ConfigEntry<int> ReaperRewardValue { get; private set; } internal static ConfigEntry<int> ShadowSlashDamage { get; private set; } internal static ConfigEntry<int> ShadowWanderSpeed { get; private set; } internal static ConfigEntry<int> ShadowChaseSpeed { get; private set; } internal static ConfigEntry<int> WealthHandWanderSpeed { get; private set; } internal static ConfigEntry<int> WealthHandFleeSpeed { get; private set; } internal static ConfigEntry<int> WealthHandRewardRarity { get; private set; } internal static ConfigEntry<float> MusicMaxVolume { get; private set; } internal static ConfigEntry<bool> MusicEnabled { get; private set; } public static CRMod Mod { get; private set; } internal static ManualLogSource Log { get; private set; } = null; public static string Name => "Tartarus"; public static string Version => "1.3.0"; private void Awake() { Log = ((BaseUnityPlugin)this).Logger; Log.LogDebug((object)"Thank you for trying out Tartarus! I sincerely hope you enjoy the mod :) -Teaisnt"); AssetBundle val = CRLib.LoadBundle(Assembly.GetExecutingAssembly(), "contentcontainer"); Mod = CRLib.RegisterMod((BaseUnityPlugin)(object)this, val); Mod.RegisterContentHandlers(); BindConfigs(); Harmony.PatchAll(); NetcodePatch(); } private void BindConfigs() { //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Expected O, but got Unknown //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Expected O, but got Unknown //IL_02f7: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Expected O, but got Unknown TartarusMoonEntryAnimation = ((BaseUnityPlugin)this).Config.Bind<bool>("Animations", "Enable Tartarus Moon Entry Animation", true, "Toggles whether or not the animation for landing on Tartarus plays."); TartarusMoonEntryAnimationPlayCount = ((BaseUnityPlugin)this).Config.Bind<int>("Animations", "Times Tartarus Moon Entry Animation plays per session", 1, "Configure how many times animation for landing on Tartarus can play consecutively per session. (Only works if animation is Enabled)"); VelvetRoomEntryAnimation = ((BaseUnityPlugin)this).Config.Bind<bool>("Animations", "Enable velvet room Entry Animation", true, "Toggles whether or not the animation for entering the Velvet Room plays."); VelvetRoomScrapValueMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>("Velvet Room", "Velvet room scrap value multiplier", 1f, "Configure how much to multiply the value of scrap traded in the Velvet Room (1.0 is default, 0.5 would be half value, and 2.0 would be double)"); VelvetRoomLightBrightness = ((BaseUnityPlugin)this).Config.Bind<float>("Velvet Room", "Velvet room light brightness", 45f, "Controls how bright the massive light in the Velvet Room is"); TarotSpawnChance = ((BaseUnityPlugin)this).Config.Bind<int>("Tarot Cards", "Tarot card spawn chance", 30, new ConfigDescription("Configure the spawn chance in % of a Tarot Card from breaking a Breakable Object. (0% - 100%", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>())); WorldTarotSpawnChance = ((BaseUnityPlugin)this).Config.Bind<int>("Tarot Cards", "World tarot card spawn chance", 1, new ConfigDescription("Configure the spawn chance in % of a Tarot Card from the 6th block being the World tarot. (0% - 100%", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>())); ReaperGunDamage = ((BaseUnityPlugin)this).Config.Bind<int>("The Reaper Options", "The Reaper gun damage", 3, "Configure the amount of damage dealt by each shot from The Reaper"); ReaperBashDamage = ((BaseUnityPlugin)this).Config.Bind<int>("The Reaper Options", "The Reapers bash damage", 25, "Configure the amount of damage dealt by the bash attack from The Reaper"); ReaperMaxBullets = ((BaseUnityPlugin)this).Config.Bind<int>("The Reaper Options", "The reaper bullet count", 6, "Configure the amount of bullets The Reaper can have when fully reloaded (WARNING: Animation/sound effect is designed to work around having 6 bullets, experiment with caution)"); ReaperWanderSpeed = ((BaseUnityPlugin)this).Config.Bind<int>("The Reaper Options", "The Reaper wander speed", 3, "Configure how fast The Reaper moves while wandering."); ReaperStalkingSpeed = ((BaseUnityPlugin)this).Config.Bind<int>("The Reaper Options", "The Reaper stalk speed", 5, "Configure how fast The Reaper moves while stalking players."); ReaperRewardValue = ((BaseUnityPlugin)this).Config.Bind<int>("The Reaper Options", "Reaper reward value", 500, "Configure the value of the reward for killing The Reaper."); ShadowSlashDamage = ((BaseUnityPlugin)this).Config.Bind<int>("Normal Shadow Options", "Normal Shadow slash damage", 5, "Configure the amount of damage dealt by the slash attack from Normal Shadows"); ShadowWanderSpeed = ((BaseUnityPlugin)this).Config.Bind<int>("Normal Shadow Options", "Normal Shadow wander speed", 3, "Configure how fast Normal Shadows move when wandering."); ShadowChaseSpeed = ((BaseUnityPlugin)this).Config.Bind<int>("Normal Shadow Options", "Normal Shadow chase speed", 7, "Configure how fast Normal Shadows move when chasing players."); WealthHandWanderSpeed = ((BaseUnityPlugin)this).Config.Bind<int>("Wealth Hand Options", "Wealth Hand wander speed", 2, "Configure how fast Wealth Hands move when wandering."); WealthHandFleeSpeed = ((BaseUnityPlugin)this).Config.Bind<int>("Wealth Hand Options", "Wealth Hand flee speed", 9, "Configure how fast Wealth Hands move when fleeing."); WealthHandRewardRarity = ((BaseUnityPlugin)this).Config.Bind<int>("Wealth Hand Options", "Wealth Hand reward rarity", 10, "Configure how expensive the tarots Wealth Hands drop are when exchanged."); MusicEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Music", "Enable music", true, "Configure whether music plays in the interior of Tartarus."); MusicMaxVolume = ((BaseUnityPlugin)this).Config.Bind<float>("Music", "Max volume of songs", 0.15f, new ConfigDescription("Configure how loud each song will be when playing at max volume. Not recommended to set that high but if you want to lose your ears then go for it.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>())); } private void NetcodePatch() { try { Type[] types = Assembly.GetExecutingAssembly().GetTypes(); Type[] array = types; foreach (Type type in array) { MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); MethodInfo[] array2 = methods; foreach (MethodInfo methodInfo in array2) { object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false); if (customAttributes.Length != 0) { methodInfo.Invoke(null, null); } } } } catch { Log.LogError((object)"NetcodePatcher Failed! This Is Very Bad."); } } } public class PurpleIdol : GrabbableObject { private bool activated = false; [SerializeField] private Animator animator; [SerializeField] private AudioClip pickupSound; [SerializeField] private AudioSource pickupSource; public override void Start() { ((GrabbableObject)this).Start(); } public override void Update() { ((GrabbableObject)this).Update(); if (base.hasBeenHeld && !activated) { activated = true; pickupSource.PlayOneShot(pickupSound); animator.SetTrigger("Activate"); } } } internal class ReaperEnemyAI : EnemyAI { public enum State { SearchingForPlayer, StickingInFrontOfPlayer, SwingAttackInProgress, GunAttackInProgress } public GrabbableObject reaperEyePrefab; public List<AudioClip> audioClips = new List<AudioClip>(); public Transform turnCompass = null; public Transform attackArea = null; public Transform leftGunAttackPoint; public Transform rightGunAttackPoint; public ParticleSystem leftGunFlare; public ParticleSystem rightGunFlare; public ParticleSystem deathParticles; public ParticleSystem redAuraParticles; public LayerMask bulletLayerMask; public TrailRenderer bulletLeft; public TrailRenderer bulletRight; public float bullets = 6f; public float searchMoveSpeed; public float stalkMoveSpeed; public float timeBeforeShooting; public float timeBeforePlayingShootSound; public float timeBetweenShots; public float bulletAimOffsetY; public float bulletAimCrouchOffsetY; public float swingDistance; private float timeSinceHittingLocalPlayer; private float timeSinceNewRandPos; private float timeSinceShooting; private float timeSinceSwinging; private float timeSinceAttacking; private Vector3 positionRandomness; private Vector3 StalkPos; private Random enemyRandom = null; private bool isDeadAnimationDone; [Header("State")] public State stateType; [Conditional("DEBUG")] private void LogIfDebugBuild(string text) { } public override void Start() { //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_0086: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Start(); LogIfDebugBuild("Example Enemy Spawned"); timeSinceHittingLocalPlayer = 0f; base.creatureAnimator.SetTrigger("startWalk"); timeSinceNewRandPos = 0f; positionRandomness = new Vector3(0f, 0f, 0f); enemyRandom = new Random(StartOfRound.Instance.randomMapSeed + base.thisEnemyIndex); isDeadAnimationDone = false; base.currentBehaviourStateIndex = 0; ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); bullets = Plugin.ReaperMaxBullets.Value; } public override void Update() { //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0123: 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_0147: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Update(); if (base.isEnemyDead) { if (!isDeadAnimationDone) { LogIfDebugBuild("Stopping enemy voice with janky code."); isDeadAnimationDone = true; base.creatureVoice.Stop(); base.creatureVoice.PlayOneShot(base.dieSFX); } return; } timeSinceAttacking += Time.deltaTime; timeSinceShooting += Time.deltaTime; timeSinceSwinging += Time.deltaTime; timeSinceHittingLocalPlayer += Time.deltaTime; timeSinceNewRandPos += Time.deltaTime; if ((Object)(object)base.targetPlayer != (Object)null && (stateType == State.StickingInFrontOfPlayer || stateType == State.SwingAttackInProgress || stateType == State.GunAttackInProgress)) { turnCompass.LookAt(((Component)base.targetPlayer.gameplayCamera).transform.position); ((Component)this).transform.rotation = Quaternion.Lerp(((Component)this).transform.rotation, Quaternion.Euler(new Vector3(0f, turnCompass.eulerAngles.y, 0f)), 4f * Time.deltaTime); } if (base.stunNormalizedTimer > 0f) { base.agent.speed = 0f; } if (timeSinceShooting > 5f && timeSinceAttacking > 2f && stateType == State.StickingInFrontOfPlayer) { bullets = Plugin.ReaperMaxBullets.Value; } } public override void DoAIInterval() { //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).DoAIInterval(); if (base.isEnemyDead || StartOfRound.Instance.allPlayersDead) { return; } switch (stateType) { case State.SearchingForPlayer: base.agent.speed = Plugin.ReaperWanderSpeed.Value; if (FoundClosestPlayerInRange(25f, 7f)) { ((EnemyAI)this).StopSearch(base.currentSearch, true); ChangeStateClientRpc(State.StickingInFrontOfPlayer); DoAnimationClientRpc("startWalk"); } break; case State.StickingInFrontOfPlayer: base.agent.speed = Plugin.ReaperStalkingSpeed.Value; if (!TargetClosestPlayerInAnyCase() || (Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position) > 20f && !((EnemyAI)this).CheckLineOfSightForPosition(((Component)base.targetPlayer).transform.position, 45f, 60, -1f, (Transform)null))) { ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); ChangeStateClientRpc(State.SearchingForPlayer); DoAnimationClientRpc("startWalk"); } else if (Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position) < swingDistance) { ((MonoBehaviour)this).StartCoroutine(SwingAttack()); ChangeStateClientRpc(State.SwingAttackInProgress); } else { StickingInFrontOfPlayer(); } break; case State.GunAttackInProgress: base.agent.speed = 1f; break; case State.SwingAttackInProgress: base.agent.speed = 0f; break; default: LogIfDebugBuild("This Behavior State doesn't exist!"); break; } } private bool FoundClosestPlayerInRange(float range, float senseRange) { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).TargetClosestPlayer(1.5f, true, 70f); if ((Object)(object)base.targetPlayer == (Object)null) { ((EnemyAI)this).TargetClosestPlayer(1.5f, false, 70f); range = senseRange; } return (Object)(object)base.targetPlayer != (Object)null && Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position) < range; } private bool TargetClosestPlayerInAnyCase() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) base.mostOptimalDistance = 2000f; base.targetPlayer = null; for (int i = 0; i < StartOfRound.Instance.connectedPlayersAmount + 1; i++) { base.tempDist = Vector3.Distance(((Component)this).transform.position, ((Component)StartOfRound.Instance.allPlayerScripts[i]).transform.position); if (base.tempDist < base.mostOptimalDistance) { base.mostOptimalDistance = base.tempDist; base.targetPlayer = StartOfRound.Instance.allPlayerScripts[i]; } } if ((Object)(object)base.targetPlayer == (Object)null) { return false; } return true; } private void StickingInFrontOfPlayer() { //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)base.targetPlayer == (Object)null) && ((NetworkBehaviour)this).IsOwner) { if (enemyRandom.Next(0, 3) == 0 && timeSinceShooting > 3f && timeSinceAttacking > 2f && Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position) > 10f) { ((MonoBehaviour)this).StartCoroutine(GunAttack()); } else { StalkPos = ((Component)base.targetPlayer).transform.position - ((Component)this).transform.forward * 3f; } ((EnemyAI)this).SetDestinationToPosition(StalkPos, false); } } private IEnumerator SwingAttack() { timeSinceAttacking = 0f; timeSinceSwinging = 0f; StalkPos = ((Component)base.targetPlayer).transform.position - ((Component)this).transform.forward * 1f; ((EnemyAI)this).SetDestinationToPosition(StalkPos, false); yield return (object)new WaitForSeconds(0.5f); if (!base.isEnemyDead) { DoAnimationClientRpc("startSwing"); PlaySoundClientRpc(1); yield return (object)new WaitForSeconds(1f); SwingAttackHitServerRpc(); if (stateType == State.SwingAttackInProgress) { ChangeStateClientRpc(State.StickingInFrontOfPlayer); } } } private IEnumerator GunAttack() { timeSinceAttacking = 0f; timeSinceShooting = 0f; ChangeStateClientRpc(State.GunAttackInProgress); DoAnimationClientRpc("startShoot"); yield return (object)new WaitForSeconds(timeBeforePlayingShootSound); PlaySoundClientRpc(0); yield return (object)new WaitForSeconds(timeBeforeShooting); ShootAttackHitServerRpc(); } public override void HitEnemy(int force = 1, PlayerControllerB? playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { ((EnemyAI)this).HitEnemy(force, playerWhoHit, playHitSFX, hitID); if (!base.isEnemyDead) { base.enemyHP -= force; PlaySoundClientRpc(2); if (((NetworkBehaviour)this).IsOwner && base.enemyHP <= 0 && !base.isEnemyDead) { DeathServerRpc(); ((MonoBehaviour)this).StopCoroutine(GunAttack()); ((MonoBehaviour)this).StopCoroutine(SwingAttack()); ((MonoBehaviour)this).StopCoroutine(base.searchCoroutine); ((EnemyAI)this).KillEnemyOnOwnerClient(false); } else if (stateType == State.SearchingForPlayer || stateType == State.StickingInFrontOfPlayer) { DoAnimationClientRpc("takeDamage"); } } } [ServerRpc] public void DeathServerRpc() { DeathClientRpc(); } [ClientRpc] public void SpawnItemClientRpc(int scrapValueSpawned, NetworkObjectReference objectSpawned) { NetworkObject val = default(NetworkObject); ((NetworkObjectReference)(ref objectSpawned)).TryGet(ref val, (NetworkManager)null); ((Component)val).GetComponent<GrabbableObject>().SetScrapValue(scrapValueSpawned); RoundManager instance = RoundManager.Instance; instance.totalScrapValueInLevel += (float)scrapValueSpawned; } [ClientRpc(/*Could not decode attribute arguments.*/)] public void DeathClientRpc() { ((MonoBehaviour)this).StartCoroutine(DeathCoroutine()); ((MonoBehaviour)this).StartCoroutine(Ext.WaitAndDo(delegate { }, 0.7f, delegate { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate<GameObject>(((Component)reaperEyePrefab).gameObject, base.eye.position, ((Component)this).transform.rotation); if ((Object)(object)val != (Object)null) { val.GetComponent<NetworkObject>().Spawn(false); SpawnItemClientRpc(Plugin.ReaperRewardValue.Value, NetworkObjectReference.op_Implicit(val)); } })); } public IEnumerator DeathCoroutine() { base.creatureVoice.PlayOneShot(base.dieSFX); redAuraParticles.Stop(); deathParticles.Play(); List<Material> materialList = new List<Material>(); float duration = 0f; SkinnedMeshRenderer[] skinnedMeshRenderers = base.skinnedMeshRenderers; foreach (SkinnedMeshRenderer renderer in skinnedMeshRenderers) { Material[] materials = ((Renderer)renderer).materials; foreach (Material material in materials) { materialList.Add(material); } } while (duration < 1f) { foreach (Material material2 in materialList) { material2.SetFloat("_DissolveAmount", duration); } duration += Time.deltaTime / 3f; yield return null; } foreach (Material material3 in materialList) { material3.SetFloat("_DissolveAmount", 1f); } } [ClientRpc(/*Could not decode attribute arguments.*/)] public void PlaySoundClientRpc(int index) { base.creatureSFX.PlayOneShot(audioClips[index]); } [ClientRpc(/*Could not decode attribute arguments.*/)] public void DoAnimationClientRpc(string animationName) { LogIfDebugBuild("Animation: " + animationName); base.creatureAnimator.SetTrigger(animationName); } [ClientRpc] public void ChangeStateClientRpc(State state) { stateType = state; } [ServerRpc] public void SwingAttackHitServerRpc() { DamagePlayerClientRpc(); } [ClientRpc] public void DamagePlayerClientRpc() { //IL_0014: 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) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: 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_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0168: 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_0172: Unknown result type (might be due to invalid IL or missing references) timeSinceHittingLocalPlayer = 0f; int num = 8; Collider[] array = Physics.OverlapBox(attackArea.position, attackArea.lossyScale, Quaternion.identity, num, (QueryTriggerInteraction)1); if (array.Length == 0) { return; } if (((NetworkBehaviour)this).IsServer) { PlaySoundClientRpc(3); } Collider[] array2 = array; foreach (Collider val in array2) { if (!((Object)(object)((Component)val).GetComponent<PlayerControllerB>() != (Object)(object)GameNetworkManager.Instance.localPlayerController)) { PlayerControllerB val2 = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(val, false, false); val2.externalForceAutoFade = Vector3.zero; val2.DamagePlayer(Plugin.ReaperBashDamage.Value, true, true, (CauseOfDeath)1, 0, false, Vector3.Normalize(((Component)val2.gameplayCamera).transform.position - ((Component)this).transform.position) * 150f / Vector3.Distance(((Component)val2.gameplayCamera).transform.position, ((Component)this).transform.position)); val2.externalForceAutoFade += Vector3.Normalize(((Component)val2).transform.position - ((Component)this).transform.position + Vector3.up) * 80f / Vector3.Distance(((Component)val2.gameplayCamera).transform.position, ((Component)this).transform.position); HUDManager.Instance.ShakeCamera((ScreenShakeType)1); } } } [ServerRpc] public void ShootAttackHitServerRpc() { //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0239: 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 (!(bullets > 0f)) { return; } bullets -= 1f; if ((Object)(object)base.targetPlayer != (Object)null) { Vector3 position = ((Component)base.targetPlayer).transform.position; if (base.targetPlayer.isCrouching) { position.y += bulletAimCrouchOffsetY; } position.y += bulletAimOffsetY; Transform val = leftGunAttackPoint; if (bullets % 2f != 0f) { val = rightGunAttackPoint; } GunFlareClientRpc(); RaycastHit val2 = default(RaycastHit); if (Physics.Linecast(val.position, position, ref val2, ((LayerMask)(ref bulletLayerMask)).value)) { if (((Component)((RaycastHit)(ref val2)).collider).gameObject.layer == LayerMask.NameToLayer("MapHazards")) { BreakableObject breakableObject = default(BreakableObject); Turret val3 = default(Turret); Landmine val4 = default(Landmine); if (((Component)((RaycastHit)(ref val2)).collider).gameObject.TryGetComponent<BreakableObject>(ref breakableObject)) { ((Component)breakableObject).GetComponent<IHittable>().Hit(1, Vector3.forward, (PlayerControllerB)null, false, -1); } else if (((Component)((RaycastHit)(ref val2)).collider).gameObject.TryGetComponent<Turret>(ref val3)) { ((Component)val3).GetComponent<IHittable>().Hit(1, Vector3.forward, (PlayerControllerB)null, false, -1); } else if (((Component)((RaycastHit)(ref val2)).collider).gameObject.TryGetComponent<Landmine>(ref val4)) { ((Component)val4).GetComponent<IHittable>().Hit(1, Vector3.forward, (PlayerControllerB)null, false, -1); } } BulletTrailClientRpc(((RaycastHit)(ref val2)).point); } else { BulletTrailClientRpc(val.position + ((Component)this).transform.forward * 100f); } RaycastHit val5 = default(RaycastHit); if (Physics.Linecast(val.position, position, ref val5, ((LayerMask)(ref bulletLayerMask)).value) && (Object)(object)base.targetPlayer != (Object)null && ((Component)((RaycastHit)(ref val5)).transform).gameObject.CompareTag("Player")) { LogIfDebugBuild("Bullet hit player!"); timeSinceHittingLocalPlayer = 0f; DamagePlayerClientRpc(NetworkBehaviourReference.op_Implicit((NetworkBehaviour)(object)base.targetPlayer), NetworkObjectReference.op_Implicit(((Component)((RaycastHit)(ref val5)).transform).gameObject)); } } if (bullets > 0f) { ((MonoBehaviour)this).StartCoroutine(Ext.WaitAndDo(delegate { }, timeBetweenShots, delegate { ShootAttackHitServerRpc(); })); } else if (stateType == State.GunAttackInProgress) { stateType = State.StickingInFrontOfPlayer; bullets = Plugin.ReaperMaxBullets.Value; } } [ClientRpc] public void DamagePlayerClientRpc(NetworkBehaviourReference playerRef, NetworkObjectReference hit2Ref) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB val = default(PlayerControllerB); ((NetworkBehaviourReference)(ref playerRef)).TryGet<PlayerControllerB>(ref val, (NetworkManager)null); NetworkObject val2 = default(NetworkObject); ((NetworkObjectReference)(ref hit2Ref)).TryGet(ref val2, (NetworkManager)null); if ((Object)(object)val == (Object)(object)GameNetworkManager.Instance.localPlayerController) { val.externalForceAutoFade = Vector3.zero; val.DamagePlayer(Plugin.ReaperGunDamage.Value, true, true, (CauseOfDeath)7, 0, false, Vector3.Normalize(((Component)val.gameplayCamera).transform.position - ((Component)this).transform.position) * 60f / Vector3.Distance(((Component)val.gameplayCamera).transform.position, ((Component)this).transform.position)); PlayerControllerB obj = val; obj.externalForceAutoFade += Vector3.Normalize(((Component)val).transform.position - ((Component)this).transform.position + Vector3.up) * 32f / Vector3.Distance(((Component)val.gameplayCamera).transform.position, ((Component)this).transform.position); } } [ClientRpc] public void BulletTrailClientRpc(Vector3 HitPoint) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) ((MonoBehaviour)this).StartCoroutine(BulletTrail(HitPoint)); } private IEnumerator BulletTrail(Vector3 HitPoint) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) TrailRenderer trail = ((bullets % 2f == 0f) ? bulletLeft : bulletRight); Vector3 startPosition = ((bullets % 2f == 0f) ? leftGunAttackPoint.position : rightGunAttackPoint.position); ((Component)trail).transform.position = startPosition; float distance = Vector3.Distance(((Component)trail).transform.position, HitPoint); float remainingDistance = distance; ((Component)trail).gameObject.SetActive(true); while (remainingDistance > 0f) { ((Component)trail).transform.position = Vector3.Lerp(startPosition, HitPoint, 1f - remainingDistance / distance); remainingDistance -= 150f * Time.deltaTime; yield return null; } ((Component)trail).transform.position = HitPoint; ((Component)trail).gameObject.SetActive(false); } [ClientRpc] public void GunFlareClientRpc() { if (bullets % 2f == 0f) { leftGunFlare.Play(); } else { rightGunFlare.Play(); } } } public class RotateObject : MonoBehaviour { public Vector3 rotationVelocity; private void Update() { //IL_0008: 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) ((Component)this).transform.Rotate(rotationVelocity * Time.deltaTime, (Space)1); } } public class TarotCard : GrabbableObject { public int tarotRarity = 0; public GameObject tarotLight; private Vector3 rotationVelocity; public override void Start() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).Start(); ((Component)this).transform.rotation = new Quaternion(0f, 0f, 0f, 0f); rotationVelocity = new Vector3(0f, 8f, 0f); } public override void Update() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).Update(); ((Component)this).transform.Rotate(rotationVelocity * Time.deltaTime, (Space)1); if (base.hasBeenHeld && rotationVelocity == new Vector3(0f, 8f, 0f)) { rotationVelocity = new Vector3(0f, 0f, 0f); tarotLight.SetActive(false); } } } public class TartarusChestController : NetworkBehaviour { [SerializeField] private AudioSource audioSource; public Transform detectArea; private bool openingChest = false; [SerializeField] private Transform instantiatePosition; public GameObject objectToSpawn; private Item objectToSpawnItem; private int scrapValueSpawned; [SerializeField] private Animator animator; private void Start() { TartarusInteriorNetworkController.Instance.chests.Add(((Component)this).gameObject); } public void ChestConfirmedOpenable(GameObject prop) { GameObject prop2 = prop; ((MonoBehaviour)this).StartCoroutine(Ext.WaitAndDo(delegate { //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) objectToSpawn = prop2; GrabbableObject val = default(GrabbableObject); if (objectToSpawn.TryGetComponent<GrabbableObject>(ref val)) { val.targetFloorPosition = instantiatePosition.position; scrapValueSpawned = val.scrapValue; } objectToSpawn.transform.rotation = Quaternion.identity; }, 1f, delegate { prop2.gameObject.SetActive(false); })); } public void OpenChest() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) if (!openingChest) { if ((Object)(object)objectToSpawn == (Object)null) { Debug.LogError((object)"Tartarus (TartarusChestController) Error: Object to spawn is NULL. Please report this!"); } PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; OpenChestServerRpc(new NetworkBehaviourReference((NetworkBehaviour)(object)localPlayerController)); } } [ServerRpc(RequireOwnership = false)] public void OpenChestServerRpc(NetworkBehaviourReference playerRef) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) SpawnItemClientRpc(playerRef, NetworkObjectReference.op_Implicit(objectToSpawn)); } [ClientRpc] public void SpawnItemClientRpc(NetworkBehaviourReference playerRef, NetworkObjectReference objectSpawned) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) ((MonoBehaviour)this).StartCoroutine(Ext.WaitAndDo(delegate { animator.SetTrigger("OpenChest"); openingChest = true; audioSource.Play(); }, 0.4f, delegate { List<int> list = new List<int>(RoundManager.Instance.currentLevel.spawnableScrap.Count); for (int i = 0; i < RoundManager.Instance.currentLevel.spawnableScrap.Count; i++) { if (RoundManager.Instance.currentLevel.spawnableScrap[i].spawnableItem.itemId == 152767) { list.Add(0); } else { list.Add(RoundManager.Instance.currentLevel.spawnableScrap[i].rarity); } } PlayerControllerB val = default(PlayerControllerB); ((NetworkBehaviourReference)(ref playerRef)).TryGet<PlayerControllerB>(ref val, (NetworkManager)null); Transform val2 = ((((!((Object)(object)val != (Object)null) || !val.isInElevator) && !StartOfRound.Instance.inShipPhase) || !((Object)(object)RoundManager.Instance.spawnedScrapContainer != (Object)null)) ? StartOfRound.Instance.elevatorTransform : RoundManager.Instance.spawnedScrapContainer); objectToSpawn.SetActive(true); openingChest = false; })); } } public class TartarusInteriorController : MonoBehaviour { public bool inVelvetRoom = false; public Transform entranceTeleportPoint; [SerializeField] private AudioSource musicSource1; [SerializeField] private AudioSource musicSource2; public int currTartarusFloor = 0; public List<AudioClip> tartarusSongs = new List<AudioClip>(); [SerializeField] private AudioClip velvetRoomSong; private PlayerControllerB player; [SerializeField] private float fadeSourceSpeed; [SerializeField] private float songMaxVolume; private bool isPlayingSong1; private Coroutine fadeSourceCoroutine; public static TartarusInteriorController Instance { get; private set; } private void Awake() { Instance = this; } private void Start() { player = GameNetworkManager.Instance.localPlayerController; if (!Plugin.MusicEnabled.Value) { musicSource1.Stop(); musicSource2.Stop(); } musicSource1.volume = Plugin.MusicMaxVolume.Value; musicSource2.volume = Plugin.MusicMaxVolume.Value; } private void Update() { CheckIfStopSource(); } public void UpdateTartarusFloor(GameObject volume) { currTartarusFloor = volume.GetComponent<TartarusVolumeController>().blockNum; if (Plugin.MusicEnabled.Value) { ChangeSong(tartarusSongs[currTartarusFloor]); } } private void CheckIfStopSource() { if (player.isPlayerDead && (Object)(object)player.spectatedPlayerScript != (Object)null) { if (isPlayingSong1) { if (player.spectatedPlayerScript.isInsideFactory && !musicSource1.isPlaying) { musicSource1.Play(); } else if (!player.spectatedPlayerScript.isInsideFactory && musicSource1.isPlaying) { musicSource1.Stop(); } } else if (player.spectatedPlayerScript.isInsideFactory && !musicSource2.isPlaying) { musicSource2.Play(); } else if (!player.spectatedPlayerScript.isInsideFactory && musicSource2.isPlaying) { musicSource2.Stop(); } } else if (isPlayingSong1) { if (player.isInsideFactory && !musicSource1.isPlaying) { musicSource1.Play(); } else if (!player.isInsideFactory && musicSource1.isPlaying) { musicSource1.Stop(); } } else if (player.isInsideFactory && !musicSource2.isPlaying) { musicSource2.Play(); } else if (!player.isInsideFactory && musicSource2.isPlaying) { musicSource2.Stop(); } } public void EnterVelvetRoom() { if (Plugin.MusicEnabled.Value) { ChangeSongToVelvetRoom(velvetRoomSong); } } public void ExitVelvetRoom() { if (Plugin.MusicEnabled.Value) { ChangeSong(tartarusSongs[currTartarusFloor]); } } public void ChangeSongToVelvetRoom(AudioClip newSong) { if (fadeSourceCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(fadeSourceCoroutine); } fadeSourceCoroutine = ((MonoBehaviour)this).StartCoroutine(FadeSource(newSong, 2f)); isPlayingSong1 = !isPlayingSong1; } public void ChangeSong(AudioClip newSong) { if (fadeSourceCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(fadeSourceCoroutine); } fadeSourceCoroutine = ((MonoBehaviour)this).StartCoroutine(FadeSource(newSong, 0f)); isPlayingSong1 = !isPlayingSong1; } private IEnumerator FadeSource(AudioClip newSong, float delayBeforeSwitching) { float timeToFade = fadeSourceSpeed + delayBeforeSwitching; float timeElapsed = 0f; if (isPlayingSong1) { musicSource2.clip = newSong; musicSource2.Play(); while (timeElapsed < timeToFade) { musicSource2.volume = Mathf.Lerp(0f, Plugin.MusicMaxVolume.Value, timeElapsed / timeToFade); musicSource1.volume = Mathf.Lerp(Plugin.MusicMaxVolume.Value, 0f, timeElapsed / timeToFade); timeElapsed += Time.deltaTime; yield return null; } musicSource2.volume = Plugin.MusicMaxVolume.Value; musicSource1.volume = 0f; } else { musicSource1.clip = newSong; musicSource1.Play(); while (timeElapsed < timeToFade) { musicSource2.volume = Mathf.Lerp(Plugin.MusicMaxVolume.Value, 0f, timeElapsed / timeToFade); musicSource1.volume = Mathf.Lerp(0f, Plugin.MusicMaxVolume.Value, timeElapsed / timeToFade); timeElapsed += Time.deltaTime; yield return null; } musicSource2.volume = 0f; musicSource1.volume = Plugin.MusicMaxVolume.Value; } } } public class TartarusInteriorNetworkController : NetworkBehaviour { public List<GameObject> scrapTakenByChests = new List<GameObject>(); public List<GameObject> chests = new List<GameObject>(); private bool hasSetScrap = false; public static TartarusInteriorNetworkController Instance { get; private set; } private void Awake() { Instance = this; } [ServerRpc] public void SetScrapToChestsServerRpc() { //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) if (hasSetScrap || !((NetworkBehaviour)this).IsServer) { return; } hasSetScrap = true; int num = 64; GrabbableObject val2 = default(GrabbableObject); foreach (GameObject chest in chests) { TartarusChestController component = chest.GetComponent<TartarusChestController>(); Collider[] array = Physics.OverlapBox(component.detectArea.position, component.detectArea.localScale, Quaternion.identity, num); if (array.Length != 0 && (Object)(object)component.objectToSpawn == (Object)null) { Collider[] array2 = array; foreach (Collider val in array2) { if (!ScrapAlreadyTaken(((Component)val).gameObject) && ((Component)val).TryGetComponent<GrabbableObject>(ref val2) && !(val2.itemProperties.itemName == "Bus Stop Sign")) { scrapTakenByChests.Add(((Component)val2).gameObject); SetScrapToChestsClientRpc(val2, component); break; } } } if ((Object)(object)component.objectToSpawn == (Object)null) { chest.SetActive(false); } } } [ClientRpc] public void SetScrapToChestsClientRpc(GrabbableObject prop, TartarusChestController chestController) { chestController.ChestConfirmedOpenable(((Component)prop).gameObject); } private bool ScrapAlreadyTaken(GameObject scrap) { int num = 0; foreach (GameObject scrapTakenByChest in scrapTakenByChests) { if ((Object)(object)scrap == (Object)(object)scrapTakenByChest) { return true; } num++; } return false; } } public class TartarusQuicksand : NetworkBehaviour { public Animator handsTrapAnimator; public bool isWater; public bool isInsideWater; public int audioClipIndex; [Space(5f)] public bool sinkingLocalPlayer; public float movementHinderance = 1.6f; public float sinkingSpeedMultiplier = 0.15f; private void OnTriggerStay(Collider other) { if (isWater) { if (!((Component)other).gameObject.CompareTag("Player")) { return; } PlayerControllerB component = ((Component)other).gameObject.GetComponent<PlayerControllerB>(); if ((Object)(object)component != (Object)(object)GameNetworkManager.Instance.localPlayerController && (Object)(object)component != (Object)null && (Object)(object)component.underwaterCollider != (Object)(object)this) { component.underwaterCollider = ((Component)this).gameObject.GetComponent<Collider>(); return; } } if (!isWater && !((Component)other).gameObject.CompareTag("Player")) { return; } PlayerControllerB component2 = ((Component)other).gameObject.GetComponent<PlayerControllerB>(); if ((Object)(object)component2 != (Object)(object)GameNetworkManager.Instance.localPlayerController) { return; } if (isWater) { if (sinkingLocalPlayer) { StopSinkingLocalPlayer(component2); } return; } if (isWater && !component2.isUnderwater) { component2.underwaterCollider = ((Component)this).gameObject.GetComponent<Collider>(); component2.isUnderwater = true; } component2.statusEffectAudioIndex = audioClipIndex; if (component2.isSinking) { return; } if (sinkingLocalPlayer) { if (!CheckConditionsForSinkingInQuicksand()) { StopSinkingLocalPlayer(component2); } } else if (CheckConditionsForSinkingInQuicksand()) { if ((Object)(object)handsTrapAnimator != (Object)null) { HandsTrapServerRpc(startSinking: true); } sinkingLocalPlayer = true; component2.sourcesCausingSinking++; component2.isMovementHindered++; component2.hinderedMultiplier *= movementHinderance; if (isWater) { component2.sinkingSpeedMultiplier = 0f; } else { component2.sinkingSpeedMultiplier = sinkingSpeedMultiplier; } } } [ServerRpc(RequireOwnership = false)] private void HandsTrapServerRpc(bool startSinking) { HandsTrapClientRpc(startSinking); } [ClientRpc] private void HandsTrapClientRpc(bool startSinking) { if (startSinking) { handsTrapAnimator.SetTrigger("startSinking"); } else { handsTrapAnimator.SetTrigger("stopSinking"); } } private void OnTriggerExit(Collider other) { OnExit(other); } public void OnExit(Collider other) { if (!sinkingLocalPlayer) { if (isWater && ((Component)other).CompareTag("Player") && !((Object)(object)((Component)other).gameObject.GetComponent<PlayerControllerB>() == (Object)(object)GameNetworkManager.Instance.localPlayerController))