Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of J n Q Valuable Pack v1.2.0
BepInEx/plugins/J n Q.dll
Decompiled a week agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using Photon.Pun; using UnityEngine; using loaforcsSoundAPI; using loaforcsSoundAPI.SoundPacks.Data.Conditions; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: IgnoresAccessChecksTo("")] [assembly: AssemblyCompany("Jaunteru")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("J n Q")] [assembly: AssemblyTitle("J n Q")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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] [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] [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; } } } public class MichaelJacksonHeeHee : Trap { public enum State { Inactive, Idle, MoveForward } [Header("Animation")] public Animator animator; [Header("Sounds")] public Sound HeeHee; public Sound SongLoop; public Sound MJSoundsSource; public List<AudioClip> MJSounds; private bool grabbedPrev; private bool loopPlaying; private bool loopPlayingPrevious; [Header("Colliders")] public List<Collider> MJColliders; public PhysicMaterial defaultPhysicMaterial; public PhysicMaterial movingPhysicMaterial; public Transform centerTransform; private PhysGrabObjectImpactDetector impactDetector; private Vector3 boxSize = new Vector3(0.16f, 0.1f, 0.42f); [Header("Other Floats Integers and Bools")] private bool stuck; private float stuckTime; private Vector3 previousPosition; private State currentState; private bool stateImpulse; private float playerNearTimer; private float MJSoundsTimer; public float MJSoundsCooldown; public override void Start() { ((Trap)this).Start(); impactDetector = ((Component)this).GetComponent<PhysGrabObjectImpactDetector>(); ((Behaviour)animator).enabled = true; currentState = State.Inactive; MJSoundsTimer = Time.time; } public override void Update() { //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: 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_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) ((Trap)this).Update(); loopPlaying = currentState == State.MoveForward; SongLoop.PlayLoop(loopPlaying, 0.5f, 0.8f, 1f, 1f); if (base.physGrabObject.grabbed) { if (!grabbedPrev) { grabbedPrev = true; if (SemiFunc.IsMasterClientOrSingleplayer()) { PlayHeeHee(); Animate(animated: false); Grabbed(animated: true); Quaternion val = Quaternion.Euler(-45f, 0f, 0f); Quaternion val2 = Quaternion.Euler(0f, 0f, 0f); Quaternion identity = Quaternion.identity; base.physGrabObject.TurnXYZ(val, val2, identity); } } } else { grabbedPrev = false; Grabbed(animated: false); } if (currentState == State.MoveForward) { if (SemiFunc.IsMasterClientOrSingleplayer()) { Grabbed(animated: false); Animate(animated: true); PlayMJSounds(Random.Range(0, MJSounds.Count)); } } else if (!stateImpulse) { } StateMachine(_fixedUpdate: false); if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } if (SemiFunc.PerSecond(5f, (Object)(object)this)) { if (currentState == State.Inactive) { return; } if (impactDetector.inCart || base.physGrabObject.playerGrabbing.Count > 0) { UpdateState(State.Idle); Grabbed(animated: true); return; } bool flag = false; Collider[] array = Physics.OverlapBox(centerTransform.position, boxSize / 2f, ((Component)this).transform.rotation, LayerMask.op_Implicit(SemiFunc.LayerMaskGetVisionObstruct())); for (int i = 0; i < array.Length; i++) { if (!Object.op_Implicit((Object)(object)((Component)array[i]).GetComponentInParent<ValuableCar>())) { flag = true; if (currentState != State.MoveForward && currentState != State.Inactive) { UpdateState(State.MoveForward); } break; } } if (!flag) { UpdateState(State.Idle); } else { StuckCheck(); } } if (stuck) { stuckTime += Time.deltaTime; if (stuckTime >= 3f) { UpdateState(State.Inactive); } } } public void FixedUpdate() { StateMachine(_fixedUpdate: true); } private void StateInactive(bool _fixedUpdate) { if (!_fixedUpdate && base.physGrabObject.grabbed) { UpdateState(State.Idle); Animate(animated: false); Grabbed(animated: false); } } private void StateIdle(bool _fixedUpdate) { Animate(animated: false); if (_fixedUpdate || !stateImpulse) { return; } foreach (Collider mJCollider in MJColliders) { if (!((Object)(object)mJCollider == (Object)null)) { mJCollider.material = defaultPhysicMaterial; } } stateImpulse = false; } private void StateMoveForward(bool _fixedUpdate) { //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_00ab: 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_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) if (!_fixedUpdate) { return; } if (stateImpulse) { foreach (Collider mJCollider in MJColliders) { if (!((Object)(object)mJCollider == (Object)null)) { mJCollider.material = movingPhysicMaterial; } } stateImpulse = false; } Vector3 velocity = base.physGrabObject.rb.velocity; float num = 4f - ((Vector3)(ref velocity)).magnitude; base.physGrabObject.rb.AddForce(((Component)this).transform.forward * num * Time.fixedDeltaTime, (ForceMode)1); Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(0f, Mathf.Sin(Time.time * 10f) * 0.006f, 0f); base.physGrabObject.rb.AddTorque(val, (ForceMode)1); if (playerNearTimer >= 0f) { playerNearTimer -= Time.deltaTime; return; } playerNearTimer = 1f; bool flag = false; foreach (PlayerAvatar item in SemiFunc.PlayerGetList()) { if (Vector3.Distance(((Component)item).transform.position, ((Component)this).transform.position) < 25f) { flag = true; break; } } if (!flag) { UpdateState(State.Inactive); } } private void Animate(bool animated) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.IsMasterClientOrSingleplayer()) { if (SemiFunc.IsMultiplayer()) { base.photonView.RPC("AnimateRPC", (RpcTarget)0, new object[1] { animated }); } else { AnimateRPC(animated); } } } [PunRPC] public void AnimateRPC(bool animated, PhotonMessageInfo _info = default(PhotonMessageInfo)) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.MasterOnlyRPC(_info)) { animator.SetBool("active", animated); } } private void Grabbed(bool animated) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.IsMasterClientOrSingleplayer()) { if (SemiFunc.IsMultiplayer()) { base.photonView.RPC("GrabbedRPC", (RpcTarget)0, new object[1] { animated }); } else { GrabbedRPC(animated); } } } [PunRPC] public void GrabbedRPC(bool animated, PhotonMessageInfo _info = default(PhotonMessageInfo)) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.MasterOnlyRPC(_info)) { animator.SetBool("grabbed", animated); } } private void UpdateState(State _state) { //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.IsMasterClientOrSingleplayer() && _state != currentState) { stuck = false; stuckTime = 0f; currentState = _state; stateImpulse = true; if (SemiFunc.IsMultiplayer()) { base.photonView.RPC("UpdateStateRPC", (RpcTarget)0, new object[1] { currentState }); } else { UpdateStateRPC(currentState); } } } [PunRPC] private void UpdateStateRPC(State _state, PhotonMessageInfo _info = default(PhotonMessageInfo)) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.MasterOnlyRPC(_info)) { currentState = _state; } } private void PlayHeeHee() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) EnemyDirector.instance.SetInvestigate(((Component)this).transform.position, 15f, false); if (SemiFunc.IsMultiplayer()) { base.photonView.RPC("PlayHeeHeeRPC", (RpcTarget)0, Array.Empty<object>()); } else { PlayHeeHeeRPC(); } } [PunRPC] private void PlayHeeHeeRPC(PhotonMessageInfo _info = default(PhotonMessageInfo)) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.MasterOnlyRPC(_info)) { HeeHee.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); } } private void PlayMJSounds(int index) { //IL_000c: 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_0056: Unknown result type (might be due to invalid IL or missing references) EnemyDirector.instance.SetInvestigate(((Component)this).transform.position, 15f, false); if (SemiFunc.IsMultiplayer()) { base.photonView.RPC("PlayMJSoundRPC", (RpcTarget)0, new object[1] { index }); } else { PlayMJSoundRPC(index); } } [PunRPC] private void PlayMJSoundRPC(int index, PhotonMessageInfo _info = default(PhotonMessageInfo)) { //IL_0001: 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) if (SemiFunc.MasterOnlyRPC(_info)) { MJSoundsCooldown = 1.5f; if (Time.time - MJSoundsTimer > MJSoundsCooldown && !impactDetector.inCart) { AudioClip val = MJSounds[index]; AudioClip[] sounds = (AudioClip[])(object)new AudioClip[1] { val }; MJSoundsSource.Sounds = sounds; MJSoundsSource.Play(base.physGrabObject.centerPoint, 1f, 1f, 1f, 1f); MJSoundsTimer = Time.time; MJSoundsCooldown = Random.Range(0.75f, 1.5f); } } } private void StateMachine(bool _fixedUpdate) { if (SemiFunc.IsMasterClientOrSingleplayer()) { switch (currentState) { case State.Inactive: StateInactive(_fixedUpdate); break; case State.Idle: StateIdle(_fixedUpdate); break; case State.MoveForward: StateMoveForward(_fixedUpdate); break; } } } private void StuckCheck() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) if (currentState != State.Inactive && currentState != State.Idle) { Vector3 val = ((Component)this).transform.position - previousPosition; float magnitude = ((Vector3)(ref val)).magnitude; previousPosition = ((Component)this).transform.position; if (magnitude >= 0.2f) { stuck = false; stuckTime = 0f; } else { stuck = true; } } } } public class MikuMesmerizer : Trap { [Header("Transforms")] public Transform eyeBallMesh; public Transform eyeLockTransform; public Transform HypnosisLinesParenTransform; [Header("Line of sight transforms")] public Transform top; public Transform bottom; public Transform front; public Transform back; [Header("Lights")] public Light pointLight; public AnimationCurve lightIntensityCurve; [Header("Hypnosis Line GameObject")] public GameObject hypnosisLine; [Header("Particles")] public List<ParticleSystem> particles = new List<ParticleSystem>(); [Header("Camera Shake")] public float cameraShakeTime = 0.2f; public float cameraShakeStrength = 3f; public Vector2 cameraShakeBounds = new Vector2(1.5f, 5f); [Header("Vignette")] public float vignetteIntensity = 0.5f; [Header("Camera Zoom")] public float cameraZoomSpeedIn = 0.5f; public float cameraZoomSpeedOut = 0.5f; public float cameraZoomAmount = 20f; [Header("EyeLock")] public float noAimStrength = 1.5f; [Header("Spiral on screen")] public GameObject screenSpiralEffect; [Header("Sounds")] public Sound hypnosisSoundLoop; [Header("Spooky Material")] public Material materialSpooky; public MeshRenderer meshRenderer; private float lightIntensityOriginal; private float lightRangeOriginal; private float animationCurveEval; private int playerCount; private List<PlayerAvatar> allPlayers; private List<bool> playerInSight = new List<bool>(); private List<GameObject> hypnosisLines = new List<GameObject>(); private SpiralOnScreen spiralScreenEffect; private EyeLines eyeLines; private bool isActive; private int oldPlayerCount; private List<bool> previouslySeenList = new List<bool>(); private PhysGrabObjectImpactDetector impactDetector; private PhysGrabObject physGrabObject; private bool trapTriggered; private PhotonView photonView; private ValuableObject valuableObject; protected void Awake() { ((Trap)this).Start(); GetValues(); InstantiateHypnosisLines(); ToggleParticles(_state: false); } public override void Start() { physGrabObject = ((Component)this).GetComponent<PhysGrabObject>(); impactDetector = ((Component)this).GetComponent<PhysGrabObjectImpactDetector>(); photonView = ((Component)this).GetComponent<PhotonView>(); valuableObject = ((Component)this).GetComponent<ValuableObject>(); } public override void Update() { //IL_008e: 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_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) ((Trap)this).Update(); if (physGrabObject.grabbed) { if (SemiFunc.IsMasterClientOrSingleplayer()) { bool flag = false; foreach (PhysGrabber item in physGrabObject.playerGrabbing) { if (item.isRotating) { flag = true; } } if (!flag) { Quaternion val = Quaternion.Euler(0f, 180f, 0f); Quaternion val2 = Quaternion.Euler(0f, 0f, 0f); Quaternion identity = Quaternion.identity; physGrabObject.TurnXYZ(val, val2, identity); } } if (!isActive) { OpenEyes(); } } else if (!physGrabObject.grabbed && isActive) { CloseEyes(); } CheckForLeftPlayers(); ClientEffectsLoop(); if (SemiFunc.IsMasterClientOrSingleplayer() && isActive) { CheckForListChange(); } } private void InstantiateHypnosisLines() { //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_004d: 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) for (int i = 0; i < playerCount; i++) { GameObject val = Object.Instantiate<GameObject>(hypnosisLine, ((Component)this).transform.position, Quaternion.identity); val.transform.SetParent(allPlayers[i].localCamera.GetOverrideTransform()); val.transform.localPosition = Vector3.zero; val.transform.localRotation = Quaternion.identity; val.GetComponent<EyeLines>().InitializeLine(allPlayers[i]); val.transform.SetParent(HypnosisLinesParenTransform); hypnosisLines.Add(val); val.SetActive(false); } } private void GetValues() { allPlayers = SemiFunc.PlayerGetList(); playerCount = allPlayers.Count; for (int i = 0; i < playerCount; i++) { playerInSight.Add(item: false); previouslySeenList.Add(item: false); } lightIntensityOriginal = pointLight.intensity; lightRangeOriginal = pointLight.range; } public void ClientEffectsLoop() { hypnosisSoundLoop.PlayLoop(isActive, 1f, 1f, 1f, 1f); for (int i = 0; i < playerCount; i++) { if (playerCount == 0) { break; } EyeLines component = hypnosisLines[i].GetComponent<EyeLines>(); if (playerInSight[i]) { hypnosisLines[i].SetActive(true); component.SetIsActive(true); if (allPlayers[i].isLocal) { VignetteOverride(); ScreenSpiralOn(); CameraAimAndZoom(allPlayers[i]); PlayerAvatarOverride(allPlayers[i]); PostProcessing.Instance.SaturationOverride(-50f, 0.8f, 5f, 0.1f, ((Component)this).gameObject); } } else { component.SetIsActive(false); } if (!allPlayers[i].isLocal) { DrawHypnosisLines(allPlayers[i], hypnosisLines[i]); } } if (((Behaviour)pointLight).enabled && !isActive) { LerpLightOff(pointLight); } else if (isActive) { LerpLightOn(pointLight); } } private void CheckForListChange() { if (SemiFunc.PerSecond(5f, (Object)(object)this)) { GetAffectedPlayers(); } } private void CheckForLeftPlayers() { if (playerCount != SemiFunc.PlayerGetList().Count) { RedoPlayersInSightList(); UpdateHypnosisLinesList(); playerCount = SemiFunc.PlayerGetList().Count; allPlayers = SemiFunc.PlayerGetList(); } } private void TurnOffHypnosisLines() { for (int i = 0; i < playerCount; i++) { hypnosisLines[i].SetActive(false); } } private void OpenEyes() { isActive = true; GetAffectedPlayers(); ToggleParticles(_state: true); ScreenSpiralOn(); CameraShake(); if (!((Behaviour)pointLight).enabled) { SetLightEnableState(_state: true); } } private void CloseEyes() { isActive = false; ToggleParticles(_state: false); CameraShake(); EmptyPlayersInSightList(); } private void CameraAimAndZoom(PlayerAvatar _player) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) if (!physGrabObject.playerGrabbing.Contains(_player.physGrabber)) { CameraAim.Instance.AimTargetSoftSet(eyeLockTransform.position, 0.1f, 2f, noAimStrength, ((Component)this).gameObject, 100); } CameraZoom.Instance.OverrideZoomSet(cameraZoomAmount, 0.1f, 2f, 2f, ((Component)this).gameObject, 100); } private void PlayerAvatarOverride(PlayerAvatar _player) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) _player.playerHealth.EyeMaterialOverride((EyeOverrideState)5, 0.25f, 0); _player.OverridePupilSize(3f, 4, 3f, 1f, 15f, 0.3f, 0.1f); SemiFunc.PlayerEyesOverride(_player, eyeBallMesh.position, 0.1f, ((Component)this).gameObject); } private void DrawHypnosisLines(PlayerAvatar _player, GameObject _hypnosisLine) { EyeLines component = _hypnosisLine.GetComponent<EyeLines>(); if (_hypnosisLine.activeSelf) { component.DrawLines(); } } private void CameraShake() { //IL_0021: 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) GameDirector.instance.CameraShake.ShakeDistance(cameraShakeStrength, 3f, 8f, ((Component)this).transform.position, cameraShakeTime); GameDirector.instance.CameraImpact.ShakeDistance(cameraShakeStrength, cameraShakeBounds.x, cameraShakeBounds.y, ((Component)this).transform.position, cameraShakeTime); } private void ToggleParticles(bool _state) { if (_state) { foreach (ParticleSystem particle in particles) { particle.Play(); } return; } foreach (ParticleSystem particle2 in particles) { particle2.Stop(); } } private void VignetteOverride() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) PostProcessing.Instance.VignetteOverride(new Color(0f, 0f, 0f), vignetteIntensity, 0.5f, 0.1f, 2f, 0.1f, ((Component)this).gameObject); } private void ScreenSpiralOn() { //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: 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) if (!Object.op_Implicit((Object)(object)spiralScreenEffect) && Object.op_Implicit((Object)(object)PlayerAvatar.instance)) { spiralScreenEffect = ((Component)PlayerAvatar.instance.localCamera.GetOverrideTransform()).GetComponentInChildren<SpiralOnScreen>(); } if (!Object.op_Implicit((Object)(object)spiralScreenEffect)) { for (int i = 0; i < playerCount; i++) { if (allPlayers[i].isLocal && playerInSight[i]) { Transform overrideTransform = allPlayers[i].localCamera.GetOverrideTransform(); GameObject val = Object.Instantiate<GameObject>(screenSpiralEffect, ((Component)this).transform.position, Quaternion.identity, overrideTransform); val.transform.localPosition = Vector3.zero; val.transform.localRotation = Quaternion.identity; spiralScreenEffect = val.GetComponent<SpiralOnScreen>(); break; } } } if (Object.op_Implicit((Object)(object)spiralScreenEffect) && !SemiFunc.Photosensitivity() && !PlayerAvatar.instance.localCamera.GetOverrideActive()) { spiralScreenEffect.Active(); } } private void SetLightEnableState(bool _state) { pointLight.intensity = 0f; pointLight.range = 0f; animationCurveEval = 0f; ((Behaviour)pointLight).enabled = _state; } private void LerpLightOn(Light _light) { if (_light.intensity < lightIntensityOriginal - 0.01f) { animationCurveEval += Time.deltaTime * 0.2f; float num = lightIntensityCurve.Evaluate(animationCurveEval); _light.intensity = Mathf.Lerp(_light.intensity, lightIntensityOriginal, num); _light.range = Mathf.Lerp(_light.range, lightRangeOriginal, num); } } private void LerpLightOff(Light _light) { animationCurveEval += Time.deltaTime * 1f; float num = lightIntensityCurve.Evaluate(animationCurveEval); _light.intensity = Mathf.Lerp(_light.intensity, 0f, num); _light.range = Mathf.Lerp(_light.range, 0f, num); if (pointLight.intensity < 0.01f) { SetLightEnableState(_state: false); } } private void EmptyPlayersInSightList() { if (SemiFunc.IsMasterClientOrSingleplayer()) { for (int i = 0; i < playerCount; i++) { PlayerStateChanged(_state: false, allPlayers[i].photonView.ViewID); } } } private void GetAffectedPlayers() { if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } for (int i = 0; i < playerCount; i++) { if (!allPlayers[i].isDisabled) { if (InLineOfSight(allPlayers[i], i) && !playerInSight[i]) { PlayerStateChanged(_state: true, allPlayers[i].photonView.ViewID); } else if (!InLineOfSight(allPlayers[i], i) && playerInSight[i]) { PlayerStateChanged(_state: false, allPlayers[i].photonView.ViewID); } } } } public void PlayerStateChanged(bool _state, int _playerID) { //IL_0048: 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) if (SemiFunc.IsMasterClientOrSingleplayer()) { if (SemiFunc.IsMultiplayer()) { photonView.RPC("PlayerStateChangedRPC", (RpcTarget)0, new object[2] { _state, _playerID }); } else { PlayerStateChangedRPC(_state, _playerID); } } } [PunRPC] public void PlayerStateChangedRPC(bool _state, int _playerID, PhotonMessageInfo _info = default(PhotonMessageInfo)) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) if (!SemiFunc.MasterOnlyRPC(_info)) { return; } for (int i = 0; i < playerCount; i++) { if (allPlayers[i].photonView.ViewID == _playerID) { playerInSight[i] = _state; break; } } } private bool InLineOfSight(PlayerAvatar _player, int i) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_002b: 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_0073: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.PlayerVisionCheck(top.position, 10f, _player, previouslySeenList[i]) || SemiFunc.PlayerVisionCheck(bottom.position, 10f, _player, previouslySeenList[i]) || SemiFunc.PlayerVisionCheck(front.position, 10f, _player, previouslySeenList[i]) || SemiFunc.PlayerVisionCheck(back.position, 10f, _player, previouslySeenList[i])) { previouslySeenList[i] = true; } else { previouslySeenList[i] = false; } return previouslySeenList[i]; } private void RedoPlayersInSightList() { for (int i = 0; i < playerCount; i++) { playerInSight[i] = false; } } private void UpdateHypnosisLinesList() { TurnOffHypnosisLines(); List<PlayerAvatar> list = SemiFunc.PlayerGetList(); for (int i = 0; i < list.Count; i++) { hypnosisLines[i].GetComponent<EyeLines>().InitializeLine(list[i]); hypnosisLines[i].SetActive(false); } } private void OnDestroy() { TurnOffHypnosisLines(); } public void TrapActivate() { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (!trapTriggered && SemiFunc.IsMasterClientOrSingleplayer()) { if (SemiFunc.IsMultiplayer()) { photonView.RPC("TrapActivateRPC", (RpcTarget)0, Array.Empty<object>()); } else { TrapActivateRPC(); } } } [PunRPC] private void TrapActivateRPC(PhotonMessageInfo _info = default(PhotonMessageInfo)) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.MasterOnlyRPC(_info) && !trapTriggered) { GrabRelease(); ((Renderer)meshRenderer).material = materialSpooky; trapTriggered = true; } } public void GrabRelease() { //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } bool flag = false; foreach (PhysGrabber item in physGrabObject.playerGrabbing.ToList()) { if (!SemiFunc.IsMultiplayer()) { item.ReleaseObject(photonView.ViewID, 0.1f); } else { item.photonView.RPC("ReleaseObjectRPC", (RpcTarget)0, new object[3] { false, 0.1f, photonView.ViewID }); } flag = true; } if (flag) { if (GameManager.instance.gameMode == 0) { GrabReleaseRPC(); } else { photonView.RPC("GrabReleaseRPC", (RpcTarget)0, Array.Empty<object>()); } } } [PunRPC] private void GrabReleaseRPC(PhotonMessageInfo _info = default(PhotonMessageInfo)) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.MasterOnlyRPC(_info)) { GameDirector.instance.CameraShake.ShakeDistance(5f, 3f, 8f, ((Component)this).transform.position, 0.5f); GameDirector.instance.CameraImpact.ShakeDistance(5f, 3f, 8f, ((Component)this).transform.position, 0.1f); physGrabObject.grabDisableTimer = 1f; } } } namespace J_n_Q { public class CaballeritoFumado : Trap { public enum State { Idle, Grabbed } [Header("Music")] public Sound songLoop; private PhysGrabObject physGrabObject; private PhotonView photonView; private State currentState; private bool loopPlaying; private bool stateStart; [Header("Lights")] private float lightIntensityOriginal; private float lightRangeOriginal; private float animationCurveEval; public Light pointLight; public AnimationCurve lightIntensityCurve; protected void Awake() { ((Trap)this).Start(); GetValues(); currentState = State.Idle; } public override void Start() { physGrabObject = ((Component)this).GetComponent<PhysGrabObject>(); photonView = ((Component)this).GetComponent<PhotonView>(); } public override void Update() { loopPlaying = currentState == State.Grabbed; songLoop.PlayLoop(loopPlaying, 1f, 0.7f, 1f, 1f); switch (currentState) { case State.Idle: StateIdle(); break; case State.Grabbed: StateGrabbed(); break; } } private void StateIdle() { if (stateStart) { stateStart = false; } if (SemiFunc.IsMasterClientOrSingleplayer()) { LerpLightOff(pointLight); if (physGrabObject.grabbed) { SetState(State.Grabbed); } } } private void StateGrabbed() { if (stateStart) { stateStart = false; } if (SemiFunc.IsMasterClientOrSingleplayer()) { LerpLightOn(pointLight); if (!((Behaviour)pointLight).enabled) { SetLightEnableState(_state: true); } if (!physGrabObject.grabbed) { SetState(State.Idle); } } } private void GetValues() { lightIntensityOriginal = pointLight.intensity; lightRangeOriginal = pointLight.range; } private void SetLightEnableState(bool _state) { pointLight.intensity = 0f; pointLight.range = 0f; animationCurveEval = 0f; ((Behaviour)pointLight).enabled = _state; } private void LerpLightOn(Light _light) { if (_light.intensity < lightIntensityOriginal - 0.01f) { animationCurveEval += Time.deltaTime * 0.2f; float num = lightIntensityCurve.Evaluate(animationCurveEval); _light.intensity = Mathf.Lerp(_light.intensity, lightIntensityOriginal, num); _light.range = Mathf.Lerp(_light.range, lightRangeOriginal, num); } } private void LerpLightOff(Light _light) { animationCurveEval += Time.deltaTime * 1f; float num = lightIntensityCurve.Evaluate(animationCurveEval); _light.intensity = Mathf.Lerp(_light.intensity, 0f, num); _light.range = Mathf.Lerp(_light.range, 0f, num); if (pointLight.intensity < 0.01f) { SetLightEnableState(_state: false); } } private void SetState(State state) { //IL_001c: 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) if (SemiFunc.IsMasterClientOrSingleplayer()) { if (!SemiFunc.IsMultiplayer()) { SetStateRPC(state); return; } photonView.RPC("SetStateRPC", (RpcTarget)0, new object[1] { state }); } } [PunRPC] private void SetStateRPC(State state, PhotonMessageInfo _info = default(PhotonMessageInfo)) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.MasterOnlyRPC(_info)) { currentState = state; stateStart = true; } } } [HarmonyPatch(typeof(PlayerController))] internal static class ExamplePlayerControllerPatch { [HarmonyPrefix] [HarmonyPatch("Start")] private static void Start_Prefix(PlayerController __instance) { J_n_Q_Valuable_Pack.Logger.LogDebug((object)$"{__instance} Start Prefix"); } [HarmonyPostfix] [HarmonyPatch("Start")] private static void Start_Postfix(PlayerController __instance) { J_n_Q_Valuable_Pack.Logger.LogDebug((object)$"{__instance} Start Postfix"); } } [BepInPlugin("JnQ.J_n_Q_Valuable_Pack", "J_n_Q_Valuable_Pack", "1.2.0")] public class J_n_Q_Valuable_Pack : BaseUnityPlugin { internal static J_n_Q_Valuable_Pack Instance { get; private set; } internal static ManualLogSource Logger => Instance._logger; private ManualLogSource _logger => ((BaseUnityPlugin)this).Logger; internal Harmony? Harmony { get; set; } private void Awake() { Instance = this; ((Component)this).gameObject.transform.parent = null; ((Object)((Component)this).gameObject).hideFlags = (HideFlags)61; SoundAPI.RegisterAll(Assembly.GetExecutingAssembly()); Patch(); Logger.LogInfo((object)$"{((BaseUnityPlugin)this).Info.Metadata.GUID} v{((BaseUnityPlugin)this).Info.Metadata.Version} has loaded!"); } internal void Patch() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_0026: Expected O, but got Unknown if (Harmony == null) { Harmony val = new Harmony(((BaseUnityPlugin)this).Info.Metadata.GUID); Harmony val2 = val; Harmony = val; } Harmony.PatchAll(); } internal void Unpatch() { Harmony? harmony = Harmony; if (harmony != null) { harmony.UnpatchSelf(); } } private void Update() { } } [SoundAPICondition("REPO:is_final_extraction_escape", false, null)] public class FinalExtractionState : Condition { public enum Statetype { NO, YES } internal static bool CurrentlyFinalExtraction; public Statetype? Value { get; private set; } public void CurrentlyFinalExtractionFunc() { CurrentlyFinalExtraction = false; if (RoundDirector.instance.allExtractionPointsCompleted) { CurrentlyFinalExtraction = true; } } public override bool Evaluate(IContext context) { CurrentlyFinalExtractionFunc(); Statetype statetype = ((!CurrentlyFinalExtraction) ? Statetype.YES : Statetype.NO); return statetype == Value.GetValueOrDefault(); } } public class WheatleyTrap : Trap { public enum States { Idle, Grabbed } internal States currentState; private bool stateStart; [Header("Animator")] public Animator animator; private PhotonView photonView; private PhysGrabObject physGrabObject; private PhysGrabObjectImpactDetector impactDetector; [Header("Sounds and Sound Config")] public Sound wheatleySound; public List<AudioClip> voiceHello; public List<AudioClip> voiceHeld; public List<AudioClip> voiceDropped; public float voiceCooldownMin = 9f; public float voiceCooldownMax = 11f; private float voiceHeldTime; private float idleTimer; public override void Start() { ((Trap)this).Start(); physGrabObject = ((Component)this).GetComponent<PhysGrabObject>(); photonView = ((Component)this).GetComponent<PhotonView>(); impactDetector = ((Component)this).GetComponent<PhysGrabObjectImpactDetector>(); voiceHeldTime = Time.time; idleTimer = Time.time; } public override void Update() { switch (currentState) { case States.Idle: StateIdle(); break; case States.Grabbed: StateGrabbed(); break; } } private void StateGrabbed() { //IL_0094: 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_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) if (stateStart) { stateStart = false; } ((Behaviour)animator).enabled = true; if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } bool flag = false; foreach (PhysGrabber item in physGrabObject.playerGrabbing) { if (item.isRotating) { flag = true; } } if (!flag) { Quaternion val = Quaternion.Euler(0f, 180f, 0f); Quaternion val2 = Quaternion.Euler(0f, 0f, 0f); Quaternion identity = Quaternion.identity; physGrabObject.TurnXYZ(val, val2, identity); } if (!physGrabObject.grabbed) { if (!impactDetector.inCart) { PlayDropLine(Random.Range(0, voiceDropped.Count)); } idleTimer = Time.time; SetState(States.Idle); } else if (Time.time - voiceHeldTime > Random.Range(voiceCooldownMin, voiceCooldownMax)) { Animate(Random.Range(0, 3)); PlayHeldLine(Random.Range(0, voiceHeld.Count)); voiceHeldTime = Time.time; } } private void StateIdle() { if (stateStart) { stateStart = false; } if (SemiFunc.IsMasterClientOrSingleplayer()) { if (!physGrabObject.grabbed) { PlayHello(Random.Range(0, voiceHello.Count)); } else { SetState(States.Grabbed); } } } private void PlayHeldLine(int index) { //IL_000c: 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_0056: Unknown result type (might be due to invalid IL or missing references) EnemyDirector.instance.SetInvestigate(((Component)this).transform.position, 15f, false); if (SemiFunc.IsMultiplayer()) { photonView.RPC("PlayHeldLineRPC", (RpcTarget)0, new object[1] { index }); } else { PlayHeldLineRPC(index); } } [PunRPC] private void PlayHeldLineRPC(int index, PhotonMessageInfo _info = default(PhotonMessageInfo)) { //IL_0001: 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) if (SemiFunc.MasterOnlyRPC(_info)) { AudioClip val = voiceHeld[index]; AudioClip[] sounds = (AudioClip[])(object)new AudioClip[1] { val }; wheatleySound.Sounds = sounds; wheatleySound.Play(physGrabObject.centerPoint, 1f, 1f, 1f, 1f); } } private void PlayDropLine(int index) { //IL_000c: 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_0056: Unknown result type (might be due to invalid IL or missing references) EnemyDirector.instance.SetInvestigate(((Component)this).transform.position, 15f, false); if (SemiFunc.IsMultiplayer()) { photonView.RPC("PlayDropLineRPC", (RpcTarget)0, new object[1] { index }); } else { PlayDropLineRPC(index); } } [PunRPC] private void PlayDropLineRPC(int index, PhotonMessageInfo _info = default(PhotonMessageInfo)) { //IL_0001: 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) if (SemiFunc.MasterOnlyRPC(_info)) { AudioClip val = voiceDropped[index]; AudioClip[] sounds = (AudioClip[])(object)new AudioClip[1] { val }; wheatleySound.Sounds = sounds; wheatleySound.Play(physGrabObject.centerPoint, 1f, 1f, 1f, 1f); } } private void PlayHello(int index) { //IL_0034: 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) if (SemiFunc.IsMultiplayer()) { photonView.RPC("PlayHelloRPC", (RpcTarget)0, new object[1] { index }); } else { PlayHelloRPC(index); } } [PunRPC] private void PlayHelloRPC(int index, PhotonMessageInfo _info = default(PhotonMessageInfo)) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004f: 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) if (!SemiFunc.MasterOnlyRPC(_info)) { return; } float num = 10f; using List<PlayerAvatar>.Enumerator enumerator = SemiFunc.PlayerGetList().GetEnumerator(); if (enumerator.MoveNext()) { PlayerAvatar current = enumerator.Current; if (Time.time - idleTimer > num && Vector3.Distance(((Component)current).transform.position, ((Component)this).transform.position) < 5f && !impactDetector.inCart) { AudioClip val = voiceHello[index]; AudioClip[] sounds = (AudioClip[])(object)new AudioClip[1] { val }; wheatleySound.Sounds = sounds; wheatleySound.Play(physGrabObject.centerPoint, 1f, 1f, 1f, 1f); idleTimer = Time.time; } } } private void Animate(int animationIndex) { //IL_0034: 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) if (SemiFunc.IsMultiplayer()) { photonView.RPC("AnimateRPC", (RpcTarget)0, new object[1] { animationIndex }); } else { AnimateRPC(animationIndex); } } [PunRPC] public void AnimateRPC(int animationIndex, PhotonMessageInfo _info = default(PhotonMessageInfo)) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.MasterOnlyRPC(_info)) { animator.SetInteger("wheatleyAnimationIndex", animationIndex); animator.SetTrigger("grabbedTrigger"); } } private void SetState(States state) { //IL_001c: 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) if (SemiFunc.IsMasterClientOrSingleplayer()) { if (!SemiFunc.IsMultiplayer()) { SetStateRPC(state); return; } photonView.RPC("SetStateRPC", (RpcTarget)0, new object[1] { state }); } } [PunRPC] public void SetStateRPC(States state, PhotonMessageInfo _info = default(PhotonMessageInfo)) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.MasterOnlyRPC(_info)) { currentState = state; stateStart = true; } } } }