Ejemplo n.º 1
0
        private RelativeLocationData relconstr(Vector3 body_position, Quaternion body_rotation, Vector3 body_velocity, OWRigidbody relativeBody, Transform relativeTransform = null)
        {
            if (relativeTransform == null)
            {
                relativeTransform = relativeBody.transform;
            }
            RelativeLocationData res = new RelativeLocationData(Locator.GetPlayerBody(), relativeBody);

            res.localPosition         = relativeTransform.InverseTransformPoint(body_position);
            res.localRotation         = Quaternion.Inverse(relativeTransform.rotation) * body_rotation;
            res.localRelativeVelocity = relativeTransform.InverseTransformDirection(body_velocity - relativeBody.GetPointVelocity(body_position));
            return(res);
        }
Ejemplo n.º 2
0
        public override void OnReceiveRemote(bool server, MoonStateChangeMessage message)
        {
            if (!QSBCore.HasWokenUp)
            {
                return;
            }
            var moon = Locator.GetQuantumMoon();
            var wasPlayerEntangled   = moon.IsPlayerEntangled();
            var location             = new RelativeLocationData(Locator.GetPlayerTransform().GetComponent <OWRigidbody>(), moon.transform);
            var moonBody             = moon.GetValue <OWRigidbody>("_moonBody");
            var constantFoceDetector = (ConstantForceDetector)moonBody.GetAttachedForceDetector();
            var orbits      = moon.GetValue <QuantumOrbit[]>("_orbits");
            var orbit       = orbits.First(x => x.GetStateIndex() == message.StateIndex);
            var orbitRadius = orbit.GetOrbitRadius();
            var owRigidbody = orbit.GetAttachedOWRigidbody();
            var position    = (message.OnUnitSphere * orbitRadius) + owRigidbody.GetWorldCenterOfMass();

            moonBody.transform.position = position;
            if (!Physics.autoSyncTransforms)
            {
                Physics.SyncTransforms();
            }
            constantFoceDetector.AddConstantVolume(owRigidbody.GetAttachedGravityVolume(), true, true);
            moonBody.SetVelocity(OWPhysics.CalculateOrbitVelocity(owRigidbody, moonBody, message.OrbitAngle) + owRigidbody.GetVelocity());
            moon.SetValue("_stateIndex", message.StateIndex);

            if (moon.IsPlayerInside())
            {
                moon.GetType().GetMethod("SetSurfaceState", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(moon, new object[] { message.StateIndex });
            }
            else
            {
                moon.GetType().GetMethod("SetSurfaceState", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(moon, new object[] { -1 });
                moon.GetValue <AudioSignal>("_quantumSignal").SetSignalActivation(message.StateIndex != 5, 2f);
            }
            moon.GetValue <ReferenceFrameVolume>("_referenceFrameVolume").gameObject.SetActive(message.StateIndex != 5);
            moonBody.SetIsTargetable(message.StateIndex != 5);
            foreach (var obj in moon.GetValue <GameObject[]>("_deactivateAtEye"))
            {
                obj.SetActive(message.StateIndex != 5);
            }
            GlobalMessenger <OWRigidbody> .FireEvent("QuantumMoonChangeState", moonBody);

            if (wasPlayerEntangled)
            {
                Locator.GetPlayerTransform().GetComponent <OWRigidbody>().MoveToRelativeLocation(location, moon.transform);
            }
        }
        public override void OnReceiveRemote()
        {
            var moon = Locator.GetQuantumMoon();
            var wasPlayerEntangled    = moon.IsPlayerEntangled();
            var location              = new RelativeLocationData(Locator.GetPlayerTransform().GetComponent <OWRigidbody>(), moon.transform);
            var moonBody              = moon._moonBody;
            var constantForceDetector = (ConstantForceDetector)moonBody.GetAttachedForceDetector();
            var orbits      = moon._orbits;
            var orbit       = orbits.First(x => x.GetStateIndex() == StateIndex);
            var orbitRadius = orbit.GetOrbitRadius();
            var owRigidbody = orbit.GetAttachedOWRigidbody();
            var position    = OnUnitSphere * orbitRadius + owRigidbody.GetWorldCenterOfMass();

            moonBody.transform.position = position;
            if (!Physics.autoSyncTransforms)
            {
                Physics.SyncTransforms();
            }

            constantForceDetector.AddConstantVolume(owRigidbody.GetAttachedGravityVolume(), true, true);
            moonBody.SetVelocity(OWPhysics.CalculateOrbitVelocity(owRigidbody, moonBody, OrbitAngle) + owRigidbody.GetVelocity());
            moon._stateIndex = StateIndex;

            if (moon.IsPlayerInside())
            {
                moon.SetSurfaceState(StateIndex);
            }
            else
            {
                moon.SetSurfaceState(-1);
                moon._quantumSignal.SetSignalActivation(StateIndex != 5);
            }

            moon._referenceFrameVolume.gameObject.SetActive(StateIndex != 5);
            moonBody.SetIsTargetable(StateIndex != 5);
            foreach (var obj in moon._deactivateAtEye)
            {
                obj.SetActive(StateIndex != 5);
            }

            GlobalMessenger <OWRigidbody> .FireEvent("QuantumMoonChangeState", moonBody);

            if (wasPlayerEntangled)
            {
                Locator.GetPlayerTransform().GetComponent <OWRigidbody>().MoveToRelativeLocation(location, moon.transform);
            }
        }
Ejemplo n.º 4
0
        public void MoveToSocket(uint playerId, int socketId, Quaternion localRotation)
        {
            var qsbSocket = socketId.GetWorldObject <QSBQuantumSocket>();

            if (qsbSocket == null)
            {
                DebugLog.ToConsole($"Couldn't find socket id {socketId}", MessageType.Error);
                return;
            }

            var socket = qsbSocket.AttachedObject;

            if (socket == null)
            {
                DebugLog.ToConsole($"QSBSocket id {socketId} has no attached socket.", MessageType.Error);
                return;
            }

            var wasEntangled = AttachedObject.IsPlayerEntangled();
            var component    = Locator.GetPlayerTransform().GetComponent <OWRigidbody>();
            var location     = new RelativeLocationData(Locator.GetPlayerTransform().GetComponent <OWRigidbody>(), AttachedObject.transform);

            AttachedObject.MoveToSocket(socket);

            if (wasEntangled)
            {
                component.MoveToRelativeLocation(location, AttachedObject.transform);
            }

            if (QuantumManager.Shrine != AttachedObject)
            {
                AttachedObject.transform.localRotation = localRotation;
            }
            else
            {
                var playerToShrine = QSBPlayerManager.GetPlayer(playerId).Body.transform.position - AttachedObject.transform.position;
                var projectOnPlace = Vector3.ProjectOnPlane(playerToShrine, AttachedObject.transform.up);
                var angle          = OWMath.Angle(AttachedObject.transform.forward, projectOnPlace, AttachedObject.transform.up);
                angle = OWMath.RoundToNearestMultiple(angle, 120f);
                AttachedObject.transform.rotation = Quaternion.AngleAxis(angle, AttachedObject.transform.up) * AttachedObject.transform.rotation;
            }
        }
        public void MoveToSocket(SocketStateChangeMessage message)
        {
            var qsbSocket = QSBWorldSync.GetWorldFromId <QSBQuantumSocket>(message.SocketId);

            if (qsbSocket == null)
            {
                DebugLog.ToConsole($"Couldn't find socket id {message.SocketId}", MessageType.Error);
                return;
            }
            var socket = qsbSocket.AttachedObject;

            if (socket == null)
            {
                DebugLog.ToConsole($"QSBSocket id {message.SocketId} has no attached socket.", MessageType.Error);
                return;
            }

            var wasEntangled = AttachedObject.IsPlayerEntangled();
            var component    = Locator.GetPlayerTransform().GetComponent <OWRigidbody>();
            var location     = new RelativeLocationData(Locator.GetPlayerTransform().GetComponent <OWRigidbody>(), AttachedObject.transform);

            AttachedObject.GetType().GetMethod("MoveToSocket", BindingFlags.Instance | BindingFlags.NonPublic).Invoke(AttachedObject, new object[] { socket });

            if (wasEntangled)
            {
                component.MoveToRelativeLocation(location, AttachedObject.transform);
            }

            if (QuantumManager.Instance.Shrine != AttachedObject)
            {
                AttachedObject.transform.localRotation = message.LocalRotation;
            }
            else
            {
                var playerToShrine = QSBPlayerManager.GetPlayer(message.FromId).Body.transform.position - AttachedObject.transform.position;
                var projectOnPlace = Vector3.ProjectOnPlane(playerToShrine, AttachedObject.transform.up);
                var angle          = OWMath.Angle(AttachedObject.transform.forward, projectOnPlace, AttachedObject.transform.up);
                angle = OWMath.RoundToNearestMultiple(angle, 120f);
                AttachedObject.transform.rotation = Quaternion.AngleAxis(angle, AttachedObject.transform.up) * AttachedObject.transform.rotation;
            }
        }
Ejemplo n.º 6
0
        private void Update()
        {
            this.shiftPressed = global::Input.GetKey(KeyCode.LeftShift) || global::Input.GetKey(KeyCode.RightShift);
            this.ctrlPressed  = global::Input.GetKey(KeyCode.LeftControl) || global::Input.GetKey(KeyCode.RightControl);
            this.altPressed   = global::Input.GetKey(KeyCode.LeftAlt) || global::Input.GetKey(KeyCode.RightAlt);
            if (global::Input.GetKeyDown(KeyCode.BackQuote))
            {
                cheatsOn = !cheatsOn;
                if (cheatsOn)
                {
                    AudioSource.PlayClipAtPoint(Locator.GetAudioManager().GetAudioClipArray(global::AudioType.NomaiPowerOn)[0], Locator.GetActiveCamera().transform.position);
                }
                else
                {
                    AudioSource.PlayClipAtPoint(Locator.GetAudioManager().GetAudioClipArray(global::AudioType.NomaiPowerOff)[0], Locator.GetActiveCamera().transform.position);
                }
            }

            if (playersuit == null)
            {
                playersuit = Locator.GetPlayerSuit();
            }
            if (playersuit == null)
            {
                return;
            }
            if (!playersuit.enabled)
            {
                playersuit = Locator.GetPlayerSuit();
            }
            if (playersuit == null || !playersuit.enabled)
            {
                return;
            }
            if (cheatsOn)
            {
                /*if (global::Input.GetKeyDown(DebugKeyCode.destroyTimeline))
                 *              {
                 *                      Debug.Log("Try DestroyTimeline (Requires NomaiExperimentBlackHole)");
                 *                      GlobalMessenger.FireEvent("DebugTimelineDestroyed");
                 *              }
                 *              if (global::Input.GetKeyDown(DebugKeyCode.uiTestAndSuicide))
                 *              {
                 *                      Locator.GetPlayerTransform().GetComponent<PlayerResources>().SetDebugKillResources(true);
                 *              }
                 *              if (global::Input.GetKeyUp(DebugKeyCode.uiTestAndSuicide))
                 *              {
                 *                      Locator.GetPlayerTransform().GetComponent<PlayerResources>().SetDebugKillResources(false);
                 *              }*/
                if (ModHelper.Input.IsNewlyPressed(inputs["(tele) Save probe's pos"]))
                {
                    if (Locator.GetProbe().GetAnchor().IsAnchored())
                    {
                        Transform transform = Locator.GetProbe().transform;
                        _relativeBody[relIndex] = transform.parent.GetAttachedOWRigidbody(false);
                        _relativeData[relIndex] = new RelativeLocationData(Locator.GetProbe().GetAnchor().GetAttachedOWRigidbody(), _relativeBody[relIndex], null);
                        this.COn = true;
                    }
                }
                if (ModHelper.Input.IsNewlyPressed(inputs["(tele) Save RayCast pos"]))
                {
                    OWCamera activeCamera = Locator.GetActiveCamera();
                    Vector3  position     = new Vector3((float)(activeCamera.pixelWidth - 1) / 2f, (float)(activeCamera.pixelHeight - 1) / 2f);
                    if (!Physics.Raycast(activeCamera.ScreenPointToRay(position), out hit, float.PositiveInfinity, OWLayerMask.BuildPhysicalMask().value))
                    {
                        foreach (RaycastHit raycastHit in Physics.RaycastAll(activeCamera.ScreenPointToRay(position), float.PositiveInfinity, OWLayerMask.BuildPhysicalMask().value | 524288))
                        {
                            hit = raycastHit;
                            if (raycastHit.collider.GetAttachedOWRigidbody(false))
                            {
                                break;
                            }
                        }
                        if (!hit.collider.GetAttachedOWRigidbody(false))
                        {
                            foreach (RaycastHit raycastHit2 in Physics.RaycastAll(activeCamera.ScreenPointToRay(position)))
                            {
                                hit = raycastHit2;
                                if (raycastHit2.collider.GetAttachedOWRigidbody(false))
                                {
                                    break;
                                }
                            }
                        }
                    }
                    if (hit.collider.GetAttachedOWRigidbody(false))
                    {
                        _hasSetWarpPoint[relIndex] = true;
                        _relativeBody[relIndex]    = hit.rigidbody.GetAttachedOWRigidbody(false);
                        _relativeData[relIndex]    = relconstr(hit.point, Quaternion.FromToRotation(Locator.GetPlayerBody().transform.up, hit.normal) * Locator.GetPlayerBody().transform.rotation, _relativeBody[relIndex].GetPointVelocity(hit.point), _relativeBody[relIndex], null);
                        this.COn = true;
                    }
                }
                if (ModHelper.Input.IsNewlyPressed(inputs["(tele) Save player's pos"]) && Locator.GetPlayerSectorDetector().GetLastEnteredSector() != null)
                {
                    _hasSetWarpPoint[relIndex] = true;
                    _relativeBody[relIndex]    = Locator.GetPlayerSectorDetector().GetLastEnteredSector().GetOWRigidbody();
                    _relativeData[relIndex]    = new RelativeLocationData(Locator.GetPlayerBody(), _relativeBody[relIndex], null);
                    this.COn = true;
                }
                if (ModHelper.Input.IsNewlyPressed(inputs["(insp) Cycle through layers"]))
                {
                    rayMask++;
                    rayMask %= 32;
                }
                if (ModHelper.Input.IsNewlyPressed(inputs["(insp) RayCast"]))
                {
                    OWCamera activeCamera2 = Locator.GetActiveCamera();
                    Vector3  position2     = new Vector3((float)(activeCamera2.pixelWidth - 1) / 2f, (float)(activeCamera2.pixelHeight - 1) / 2f);
                    if (!Physics.Raycast(activeCamera2.ScreenPointToRay(position2), out hit, float.PositiveInfinity, 1 << rayMask) && hit.collider.GetAttachedOWRigidbody(false))
                    {
                        _hasSetWarpPoint[relIndex] = true;
                        _relativeBody[relIndex]    = hit.rigidbody.GetAttachedOWRigidbody(false);
                        _relativeData[relIndex]    = relconstr(hit.point, Quaternion.FromToRotation(Locator.GetPlayerBody().transform.up, hit.normal) * Locator.GetPlayerBody().transform.rotation, _relativeBody[relIndex].GetPointVelocity(hit.point), _relativeBody[relIndex], null);
                        this.COn = true;
                    }
                }
                if (ModHelper.Input.IsNewlyPressed(inputs["(tele) Cycle through pos"]))
                {
                    this.COn = true;
                    relIndex++;
                    relIndex %= 10;
                }
                if (ModHelper.Input.IsNewlyPressed(inputs["(tele) Tele to saved pos"]) && _hasSetWarpPoint[relIndex])
                {
                    this.COn = true;
                    this._gotoWarpPointNextFrame = true;
                }
                if (ModHelper.Input.IsNewlyPressed(inputs["Learn launchcode"]))
                {
                    if (PlayerData.IsLoaded())
                    {
                        PlayerData.LearnLaunchCodes();
                        this.COn = true;
                    }
                }
                if (ModHelper.Input.IsNewlyPressed(inputs["Toggle spacesuit"]))
                {
                    if (!Locator.GetPlayerSuit().IsWearingSuit(true))
                    {
                        Locator.GetPlayerSuit().SuitUp(false, false);
                        this.COn = true;
                    }
                    else
                    {
                        Locator.GetPlayerSuit().RemoveSuit(false);
                        this.COff = true;
                    }
                }
                if (ModHelper.Input.IsNewlyPressed(inputs["Toggle HUD"]))
                {
                    hiddenHUD = !hiddenHUD;
                    if (hiddenHUD)
                    {
                        oldmode = (int)typeof(GUIMode).GetAnyField("_renderMode").GetValue(null);
                        typeof(GUIMode).GetAnyField("_renderMode").SetValue(null, 7);
                        this.COn = true;
                    }
                    else
                    {
                        typeof(GUIMode).GetAnyField("_renderMode").SetValue(null, oldmode);
                        this.COff = true;
                    }
                    GlobalMessenger.FireEvent("OnChangeGUIMode");
                }
                if (ModHelper.Input.IsNewlyPressed(inputs["Toggle helmet"]) && Locator.GetPlayerSuit() && Locator.GetPlayerSuit().IsWearingSuit(true))
                {
                    if (Locator.GetPlayerSuit().IsWearingHelmet())
                    {
                        Locator.GetPlayerSuit().RemoveHelmet();
                        this.COff = true;
                    }
                    else
                    {
                        Locator.GetPlayerSuit().PutOnHelmet();
                        this.COn = true;
                    }
                }
                if (ModHelper.Input.IsNewlyPressed(inputs["Destroy ship"]) && Locator.GetShipTransform())
                {
                    UnityEngine.Object.Destroy(Locator.GetShipTransform().gameObject);
                    this.COn = true;
                }
                if (ModHelper.Input.IsNewlyPressed(inputs["Damage ship"]) && Locator.GetShipTransform())
                {
                    ShipComponent[] componentsInChildren = Locator.GetShipTransform().GetComponentsInChildren <ShipComponent>();
                    for (int k = 0; k < componentsInChildren.Length; k++)
                    {
                        componentsInChildren[k].SetDamaged(true);
                    }
                    this.COn = true;
                }
                if (ModHelper.Input.IsNewlyPressed(inputs["Fuel+heal"]))
                {
                    Locator.GetPlayerTransform().GetComponent <PlayerResources>().DebugRefillResources();
                    if (Locator.GetShipTransform())
                    {
                        ShipComponent[] componentsInChildren2 = Locator.GetShipTransform().GetComponentsInChildren <ShipComponent>();
                        for (int l = 0; l < componentsInChildren2.Length; l++)
                        {
                            componentsInChildren2[l].SetDamaged(false);
                        }
                    }
                    this.COn = true;
                }
                if (ModHelper.Input.IsPressed(inputs["Increase Ludicrous Speed"]))
                {
                    this.ludicrousMult *= 2f;
                    this.COn            = true;
                }
                if (ModHelper.Input.IsPressed(inputs["Decrease Ludicrous Speed"]))
                {
                    this.ludicrousMult /= 2f;
                    this.COff           = true;
                }
                if (ModHelper.Input.IsNewlyPressed(inputs["Engage Ludicrous Speed"]))
                {
                    this._engageLudicrousSpeed = true;
                    AudioSource.PlayClipAtPoint(Locator.GetAudioManager().GetAudioClipArray(global::AudioType.ToolProbeLaunch)[0], Locator.GetShipBody().transform.position);
                }
                if (ModHelper.Input.IsNewlyPressed(inputs["Toggle superjetpack"]) && Locator.GetPlayerSuit().GetComponent <JetpackThrusterModel>())
                {
                    if (!this.wasBoosted)
                    {
                        this.jetpackStanard = Locator.GetPlayerSuit().GetComponent <JetpackThrusterModel>().GetMaxTranslationalThrust();
                        Locator.GetPlayerSuit().GetComponent <JetpackThrusterModel>().TAIcheat_SetTranslationalThrust(50f);
                    }
                    else
                    {
                        Locator.GetPlayerSuit().GetComponent <JetpackThrusterModel>().TAIcheat_SetTranslationalThrust(this.jetpackStanard);
                    }
                    this.wasBoosted = !this.wasBoosted;
                    if (this.wasBoosted)
                    {
                        this.COn = true;
                    }
                    else
                    {
                        this.COff = true;
                    }
                }
                if (ModHelper.Input.IsNewlyPressed(inputs["Toggle PowerOverwhelming"]))
                {
                    Locator.GetPlayerTransform().GetComponent <PlayerResources>().ToggleInvincibility();
                    Locator.GetDeathManager().ToggleInvincibility();
                    Transform shipTransform = Locator.GetShipTransform();
                    if (shipTransform)
                    {
                        shipTransform.GetComponentInChildren <ShipDamageController>().ToggleInvincibility();
                        invincible = !invincible;
                    }
                    if (invincible)
                    {
                        this.COn = true;
                    }
                    else
                    {
                        this.COff = true;
                    }
                }
                if (ModHelper.Input.IsNewlyPressed(inputs["Learn all frequencies"]))
                {
                    if (PlayerData.KnowsMultipleFrequencies())
                    {
                        PlayerData.ForgetFrequency(SignalFrequency.Quantum);
                        PlayerData.ForgetFrequency(SignalFrequency.EscapePod);
                        PlayerData.ForgetFrequency(SignalFrequency.Statue);
                        PlayerData.ForgetFrequency(SignalFrequency.WarpCore);
                        PlayerData.ForgetFrequency(SignalFrequency.HideAndSeek);
                        this.COff = true;
                    }
                    else
                    {
                        this.COn = true;
                        for (int m = 10; m < 16; m++)
                        {
                            PlayerData.LearnSignal((SignalName)m);
                        }
                        PlayerData.LearnFrequency(SignalFrequency.Quantum);
                        for (int n = 20; n < 26; n++)
                        {
                            PlayerData.LearnSignal((SignalName)n);
                        }
                        PlayerData.LearnFrequency(SignalFrequency.EscapePod);
                        for (int num = 30; num < 33; num++)
                        {
                            PlayerData.LearnSignal((SignalName)num);
                        }
                        PlayerData.LearnFrequency(SignalFrequency.Statue);
                        PlayerData.LearnFrequency(SignalFrequency.WarpCore);
                        for (int num2 = 40; num2 < 50; num2++)
                        {
                            PlayerData.LearnSignal((SignalName)num2);
                        }
                        PlayerData.LearnFrequency(SignalFrequency.HideAndSeek);
                        for (int num3 = 60; num3 < 63; num3++)
                        {
                            PlayerData.LearnSignal((SignalName)num3);
                        }
                    }
                }
                if (ModHelper.Input.IsNewlyPressed(inputs["Reveal all facts"]))
                {
                    Locator.GetShipLogManager().RevealAllFacts(this._revealRumorsOnly);
                    this._revealRumorsOnly = false;
                    this.COn = true;
                }
                if (ModHelper.Input.IsNewlyPressed(inputs["Cycle DebugHUD"]))
                {
                    inputHUD++;
                    inputHUD %= 5;
                }
                if (ModHelper.Input.IsNewlyPressed(inputs["Toggle player collision extra"]))
                {
                    if (Locator.GetPlayerBody().GetRequiredComponent <Rigidbody>().detectCollisions)
                    {
                        Locator.GetPlayerBody().DisableCollisionDetection();
                        this.COn = true;
                    }
                    else
                    {
                        Locator.GetPlayerBody().EnableCollisionDetection();
                        this.COff = true;
                    }
                }
                if (ModHelper.Input.IsNewlyPressed(inputs["Toggle player collision"]))
                {
                    foreach (Collider collider in Locator.GetPlayerBody().GetComponentsInChildren <Collider>())
                    {
                        if (!collider.isTrigger)
                        {
                            collider.enabled = !collider.enabled;
                            if (collider.enabled)
                            {
                                this.COff = true;
                            }
                            else
                            {
                                this.COn = true;
                            }
                        }
                    }
                }
                if (ModHelper.Input.IsNewlyPressed(inputs["Toggle ship collision extra"]))
                {
                    if (Locator.GetShipBody().GetRequiredComponent <Rigidbody>().detectCollisions)
                    {
                        Locator.GetShipBody().DisableCollisionDetection();
                        this.COn = true;
                    }
                    else
                    {
                        Locator.GetShipBody().EnableCollisionDetection();
                        this.COff = true;
                    }
                }
                if (ModHelper.Input.IsNewlyPressed(inputs["Toggle ship collision"]))
                {
                    foreach (Collider collider2 in Locator.GetShipTransform().GetComponentsInChildren <Collider>())
                    {
                        if (!collider2.isTrigger)
                        {
                            collider2.enabled = !collider2.enabled;
                            if (collider2.enabled)
                            {
                                this.COff = true;
                            }
                            else
                            {
                                this.COn = true;
                            }
                        }
                    }
                }
                if (ModHelper.Input.IsNewlyPressed(inputs["Disable nearby Anglerfishes"]))
                {
                    foreach (AnglerfishController anglerfishController in UnityEngine.Object.FindObjectsOfType <AnglerfishController>())
                    {
                        anglerfishController.gameObject.SetActive(!anglerfishController.gameObject.activeInHierarchy);
                        if (anglerfishController.gameObject.activeInHierarchy)
                        {
                            this.COff = true;
                        }
                        else
                        {
                            this.COn = true;
                        }
                    }
                }
                if (ModHelper.Input.IsNewlyPressed(inputs["Toggle nearby Anglerfishes AI"]))
                {
                    foreach (AnglerfishController anglerfishController in UnityEngine.Object.FindObjectsOfType <AnglerfishController>())
                    {
                        anglerfishController.enabled = !anglerfishController.enabled;
                        if (anglerfishController.enabled)
                        {
                            this.COff = true;
                        }
                        else
                        {
                            this.COn = true;
                        }
                    }
                }
            }
            if (ModHelper.Input.IsNewlyPressed(inputs["Break all BH fragments"]))
            {
                this.COn = true;
                FragmentIntegrity[] array2 = UnityEngine.Object.FindObjectsOfType <FragmentIntegrity>();
                for (int j = 0; j < array2.Length; j++)
                {
                    array2[j].AddDamage(10000f);
                }
            }
            if (ModHelper.Input.IsNewlyPressed(inputs["Trigger Supernova"]))
            {
                this.COn = true;
                GlobalMessenger.FireEvent("TriggerSupernova");
            }
            if (ModHelper.Input.IsNewlyPressed(inputs["Debug Vessel Warp"]))
            {
                if (PlayerData.GetWarpedToTheEye())
                {
                    PlayerData.SaveEyeCompletion();
                }
                else
                {
                    GlobalMessenger.FireEvent("DebugWarpVessel");
                }
                this.COn = true;
            }
            if (Mathf.Abs(Time.timeScale - 1f) < 1e-4 || Mathf.Abs(Time.timeScale - 10f) < 1e-4)
            {
                if (ModHelper.Input.IsNewlyPressed(inputs["Timelapse"]))
                {
                    Time.timeScale = 10f;
                }
                else if (Mathf.Abs(Time.timeScale - 1f) > 1e-4 && !ModHelper.Input.IsPressed(inputs["Timelapse"]))
                {
                    Time.timeScale = 1f;
                }
            }

            if (this.COn)
            {
                AudioClip[] audioClipArray = Locator.GetAudioManager().GetAudioClipArray(global::AudioType.Menu_Confirm);
                AudioSource.PlayClipAtPoint(audioClipArray[UnityEngine.Random.Range(0, audioClipArray.Length)], Locator.GetActiveCamera().transform.position);
                this.COn = false;
            }
            if (this.COff)
            {
                AudioClip[] audioClipArray2 = Locator.GetAudioManager().GetAudioClipArray(global::AudioType.Menu_Cancel);
                AudioSource.PlayClipAtPoint(audioClipArray2[UnityEngine.Random.Range(0, audioClipArray2.Length)], Locator.GetActiveCamera().transform.position);
                this.COff = false;
            }
        }