void OnCollidingAgainstWall(GameObject wall) { wallStuckOn = wall; camPhysics.rigidCom.Body().SetLinearVelocity(new Vector3(0.0f)); // Stop the camera camPhysics.mColliderType = 0; // Static collider // Calculate the sticky camera angle when on wall Vector3 wallNormal = wallStuckOn.transform.GetForwardVector(); // Get the normal of the wall that is pointing towards the player if (Vector3.Dot(startThrowDir, wallNormal) > 0.0f) { wallNormal *= -1.0f; } Vector3 pointInFrontOfWall = wallNormal + gameObject.transform.position; cameraUp = new Vector3(0.0f, 1.0f, 0.0f); if (Vector3.Cross(cameraUp, wallNormal) == new Vector3(0.0f)) // Make sure up is not parallel to normal { cameraUp = new Vector3(1.0f, 0.0f, 0.0f); } gameObject.transform.LookAt(pointInFrontOfWall, cameraUp); // Shift the camera to be outside the wall gameObject.transform.SetPosition(gameObject.transform.position + startThrowDir * -distanceOffset); sound.PlayIndependentEvent("CAM_TOSS_IMP.vente", false, 0); smc.SetState(activeOnWall); }
public void State_unactive_Update() { if (myZone.IsPointWithin(Common.GetStealthPlayer().transform.position)) { smc.SetState(lightson); mySound.StopAllGlobalEvents(); mySound.PlayIndependentEvent("static.vente", true, 0); } }
public void FailAll() { mSound.PlayIndependentEvent("PINPAD_DENY.vente", false, 1); for (int i = 0; i < allButtons.Count; ++i) { allButtons[i].Fail(); } mLatestCorrect = 0; ocuConsole.MiniGameFourPlayerEvent("", "Sequence Invalid", -1, gameObject, 0, false); }
// The action when either player clicks on the game (0 - from Oculus, 1 - from Stealth) public void CenterPull(int pullFrom) { if (failed || passed) { return; // If error or already completed } mSound.PlayIndependentEvent("PINPAD_INPUT.vente", false, 1); // change to colour code pullFrom += 1; // 1 is oculus color, 2 is stealth color if (activeHeight == -1) { ++activeHeight; RefreshColorsOnBlocks(true); return; } if (center[activeHeight] == pullFrom) // Correct person pressing it { ++activeHeight; RefreshColorsOnBlocks(true); } else { controllerScript.FailAll(); } }
public override void OnStealthPlayerMouseInteract() { if (isButtonActive) { String buttonSoundName = "PINPAD_INPUT.vente";// requiresSurveillancePlayer ? "BUTTON_YELLOW.vente" : "BUTTON_GREEN.vente"; if (isButtonRed) { buttonSoundName = "PINPAD_DENY.vente"; requestAccessTimer = REQUEST_TIMEOUT; } else { if (requiresSurveillancePlayer) { requestAccessTimer = REQUEST_TIMEOUT; } else // just open the door immediately { AllowUnlockDoor(); } } // Signal to console screen ocuConsole.DoorButtonEvent(gameObject, (isButtonRed ? 2 : (requiresSurveillancePlayer ? 1 : 0))); doorButtonMesh.GetMaterial().SetColor(doorButtonColor.Mul(0.4f)); doorButtonMesh.mEmissiveColor = SharpMocha.BLACK; isButtonActive = false; sound.PlayIndependentEvent(buttonSoundName, false, 1); } }
public void State_lightson_Start() { MonsterEncounter1 me = GetScript <MonsterEncounter1>(GameObject.GetGameObjectByName("Monster1")); if (current_light == 0) { lightson.MaxTimeInState = (float)rand.NextDouble() + 0.4f; } if (current_light < lights.Count) { CLight light = lights[current_light]; light.setEnabled(true); CSound sound = light.gameObject.RequireComponent <CSound>(); sound.PlayIndependentEvent("LightTurnOn.vente", false, 1); } else { if (!me.gameObject.RequireComponent <CMeshRenderer>().isEnabled()) { lightson.MaxTimeInState = (float)rand.NextDouble() * 15.0f + 5.0f; } lightson.NextState = lightsoff; return; } current_light++; }
public override void OnAreaEnter() { if (activated) { return; } lightScript.activated = true; activated = true; scaryRender.setEnabled(true); light.setEnabled(true); distortScript.Activated = true; lit = true; _sound.PlayIndependentEvent("HORN.vente", false, 0); _sound.PlayIndependentEvent(monsterCroak, false, 0); }
public void Pass() { passed = true; for (int j = 0; j <= maxHeight - 1; j++) { center[j] = 3; // Set green } RefreshColorsOnBlocks(false); DoorMain doorMainScript = GetScript <DoorMain>(door); doorMainScript.isLocked = false; stealthDoorButton.completed = true; mSound.PlayIndependentEvent("PINPAD_CONFIRM.vente", false, 1); }
public void OnStart() { zone = GameObject.GetGameObjectByName("scp_zone").RequireComponent <CZone>(); rand = new Random(); target = null; speed = new Vector3(.3f, .8f, -.5f); sound = gameObject.RequireComponent <CSound>(); fx = GameObject.GetGameObjectByName("Camera").RequireComponent <CArtifactFX>(); sound.PlayIndependentEvent("CREATURE_CLOSE.vente", true, 1); }
public override void OnStealthPlayerMouseInteract() { isButtonActive = false; buttonMesh.GetMaterial().SetColor(buttonColor.Mul(0.3f)); buttonMesh.mEmissiveColor = SharpMocha.BLACK; bool isValidCode = seqController.AddPlayerInput(keyCode, gameObject); String buttonSoundName = isValidCode ? "PINPAD_INPUT.vente" : "BUTTON_RED.vente"; sound.PlayIndependentEvent(buttonSoundName, false, 1); }
public void TurnLightOn() { lightState = true; light.setEnabled(true); gameObject.GetComponent <CForwardRenderer>().mEmissiveColor = new Color(1.0f, 1.0f, 1.0f, 0.3f); sound.PlayIndependentEvent("GLASS_CRACK.vente", false, 2); if (trigger != null) { trigger.M4LightTurnedOn(); } }
public void TriggerMonster(Vector3 spawn) { faceTransform.SetPositionX(spawn.X); faceTransform.SetPositionZ(spawn.Z); //faceTransform.LookAt(Common.GetStealthPlayer().transform.GetPosition(CTransform.TransformSpace.GLOBAL)); faceRender.setEnabled(true); alive = true; currAliveTimer = MMath.GetRandomLimitedFloat(_monsterMinActiveTime, _monsterMaxActiveTime); sound.PlayIndependentEvent("C1_LAUGH", false, 1); }
public void OnUpdate() { if (activated) { if (mTimer > 0) { mTimer -= FrameController.DT(); } else { String filename = NonAmbientSound + ".vente"; sound.PlayIndependentEvent(filename, false, 0); activated = false; } } }
public override void OnAreaEnter() { if (activated) { return; } activated = true; Logger.Log("Boo!"); girl.gameObject.transform.SetPosition(player.transform.position - (Vector3)player.transform.GetForwardVector() * 1.5f); girl.gameObject.transform.SetPositionY(gameObject.transform.position.y - 0.1f); girl.setEnabled(true); timer = 1.5f; GetScript <FirstPersonPlayer>(player).LockMovement(); sound.PlayIndependentEvent("HORN.vente", false, 0); }
public void OnUpdate() { const float maxParamValue = 65.0f; switch (mState) { case 0: break; case 1: { mTimeElapsed += FrameController.DT(); float currParamValue = mTimeElapsed / mMaxTimeInMaze * maxParamValue; if (currParamValue > maxParamValue) // Cap to 65 (max) { mState = 0; currParamValue = maxParamValue; } mSound.SetUniqueEventParam(mMazeAmbientID, mMazeAmbientParam, currParamValue); // Play once the creepy sound when around the middle of the time elapsed if (!hasCreepSoundPlayed && mTimeElapsed >= mMaxTimeInMaze*0.4f) { hasCreepSoundPlayed = true; mSound.PlayIndependentEvent("PERCUSSIVE_A.vente", false, 0); } } break; case 2: { mTimeElapsed += FrameController.DT(); float currParamValue = mTimeElapsed / mTimeToRelease * maxParamValue; currParamValue = maxParamValue - currParamValue; // Count down from 65 to 0 if (currParamValue < 0.0f) { mState = 0; currParamValue = 0.0f; mSound.StopUniqueEvent(mMazeAmbientID, false); } else { mSound.SetUniqueEventParam(mMazeAmbientID, mMazeAmbientParam, currParamValue); } } break; } }
public void TriggerTrap() { if (activated) { return; } mSound.PlayIndependentEvent("PERCUSSIVE_A.vente", false, 0); // low pitched stab controllerScript.StartTrap(); panel1.ActivateButton(); panel2.ActivateButton(); panel3.ActivateButton(); panel4.ActivateButton(); ResetTrap(true); }
void State_Moving_Enter() { timer = 0; // sound_.StopAll(); // sound_.Play("Elevator Start.vente"); playerScript.LockMovement(); sound_.PlayIndependentEvent("CAUTIOUS.vente", false, 1); // Play clunky elevator starting up //reset has returned, in case this elevator is used twice if (ReturnAfterUse) { hasReturned = false; } LockDoors(); }
public override void OnStealthPlayerMouseInteract() { if (!isActivated) { return; } if (!isTrapUnlocked && !mIsPushedIn) { SetPushIn(); sound.PlayIndependentEvent("PINPAD_INPUT.vente", false, 1); controllerScript.CheckSequence(keyCode, gameObject); //controllerScript.AddPlayerInput(keyCode); //Console.Write(keyCode.ToString()); } }
public void State_lightson_Start() { if (current_light < lights.Count) { CLight light = lights[current_light]; light.setEnabled(true); CSound sound = light.gameObject.RequireComponent <CSound>(); sound.PlayIndependentEvent("LightTurnOn.vente", false, 1); } else { if (stage == 1) { foreach (GameObject g in GameObject.GetGameObjectsWithTag("FlickerLight")) { GetScriptClass <LightFlicker>(g).activated = true; } } //active monster lightson.MaxTimeInState = _lightson[stage]; if (stage != 0) { MonsterEncounter1 me = GetScript <MonsterEncounter1>(GameObject.GetGameObjectByName("Level4Monster1")); me.Advance(); if (me.gameObject.transform.position.z < 20) { lightsoff.NextState = finale; lightsoff.MaxTimeInState = 5.0f; } smc.SetState(lightsoff); } else { MonsterEncounter1 me = GetScript <MonsterEncounter1>(GameObject.GetGameObjectByName("Level4Monster1")); me.Advance(); smc.SetState(lightsonwait); } return; } current_light++; }
public override void OnStealthPlayerMouseInteract() { if (completed) { return; } if (isButtonActive) { if (doorName != null) { doorUnlockSeq.SetParticipants(gameObject, panelParent, doorName); } doorUnlockSeq.CenterPull(1); mSound.PlayIndependentEvent("PINPAD_INPUT.vente", false, 1); } }
public void OnStart() { mSound = gameObject.RequireComponent <CSound>(); mSound.PlayIndependentEvent("MUSIC_HUB_LOOP.vente", false, 0); menuPointer = GameObject.GetGameObjectByName(Common.prefix + menuPointerName); Common.SetOpacityToGameObject(0.0f, menuPointer); menuPointerInitPos = new Vector3(-2.75f, 1.23f, -0.11f); menuPointer.transform.SetPosition(menuPointerInitPos); screenImage = GameObject.GetGameObjectByName(Common.prefix + screenImageName); screenImageMesh = screenImage.RequireComponent <CDiffuseRenderer>(); fadeScreen = GameObject.GetGameObjectByName(Common.prefix + fadeScreenName); Common.SetOpacityToGameObject(fadeOpacity, fadeScreen); // Start with full black Common.GetMenuFullscreenX().setEnabled(false); Common.GetMenuMuteX().setEnabled(false); Common.GetMenuVolumeFont().setEnabled(false); mLoadingFirstTime = true; mPrevMainMenuState = -1; mMainMenuState = -1; }
public void OnUpdate() { String[] soundNames = new String[] /*{ * "Combat1", "Combat2", "Door Move", "Elevator Start", "Elevator Stop", * "Footstep", "heartbeat", "Hum", "LightTurnOn", "NonCombat", "static", * "swell_ambience", "Turret_LaserShot", "Turret_Rotate", "Turret_Targetting" * };*/ { "C_MOVEMENT", "C_RETREAT", "CAM_FLIGHT", "CAM_RETR", "CAM_TOSS_IMP", "CONSOLE_CLICK", "CONSOLE_CONFIRM", "CONSOLE_DENY", "CONSOLE_TV_CLICK", "CREATURE_CLOSE", "DOOR_CLOSE", "DOOR_OPEN", "DOOR_UNLOCK", "ENV_BIO_AC", "ENV_BIO_DEF", "ENV_SCI_AC", "ENV_SCI_DEF", "ENV_SCI_LIGHT", "GEN_ALARM", "GENERAL_LOOP", "LONG_STABS", "MED_STABS", "MON_TV_CHANNEL", "MON_TV_OFF", "MON_TV_ON", "P_CAM_RETR_A", "P_CAM_RETR_B", "P_CAM_TOSS", "P_CAM_TOSS_IMP", "P_FOOTSTEPS", "P_PAPER_DOWN", "P_PAPER_UP", "PINPAD_CONFIRM", "PINPAD_DENY", "PINPAD_INPUT", "RC_CAR_MOVE", "SHORT_STABS", "SPEAKER_CONFIRM", "SPEAKER_DENY", "TREE_RUSTLE", }; if (Input.GetTriggered(0, "ArrowUp") != 0.0f) { testIndex = Math.Min(testIndex + 1, soundNames.Length - 1); Logger.Log("sound: " + soundNames[testIndex]); } if (Input.GetTriggered(0, "ArrowDown") != 0.0f) { testIndex = Math.Max(testIndex - 1, 0); Logger.Log("sound: " + soundNames[testIndex]); } if (Input.GetTriggered(0, "2") != 0.0f) { bool toLoop = false; if (Input.GetHeld(0, "SnapGrid") != 0.0f) { toLoop = true; } sound.PlayIndependentEvent(soundNames[testIndex] + ".vente", toLoop, 1); } }
public void OnUpdate() { if (finished || !activated) { return; } float dt = FrameController.DT(); foreach (CLight obj in lights) { if (obj.isEnabled()) { continue; } else { if (currTimeBetweenLight < 0.0f) { currTimeBetweenLight = timeBetweenLights; _sound.PlayIndependentEvent(lightOnName, false, 1); obj.setEnabled(true); } else { currTimeBetweenLight -= dt; } break; } } if (CheckFinished()) { finished = true; } }
void State_Stalking_Start() { //turn on the mesh and move him near the player //cmesh.setEnabled(true); //find somewhere near the player to spawn STALK_RANGE = DEFAULT_STALK_RANGE; for (int times_to_attempt_spawn = 0; times_to_attempt_spawn <= 5; ++times_to_attempt_spawn) { gameObject.transform.SetPosition(MMath.GetRandomPointInCircle(stealth_player.transform.position, STALK_RANGE)); if (!helper.CheckLights(gameObject)) { break; } STALK_RANGE += 5.0f; if (times_to_attempt_spawn == 5) { smc.SetState(resetting); } } stalk_dir = MMath.GetRandomInt(0, 2); sound.PlayIndependentEvent("C1_CLOSE_LOOP.vente", false, 2); }
public bool CheckSequence(int seq, GameObject obj) { if (!sequence.accessGranted) { panels.Add(obj); playerInput.Add(seq); int isValidCode = -1; for (int i = 0; i < playerInput.Count; ++i) { if (playerInput[i] != sequence.validSequence[i]) { isValidCode = 0; break; } if ((i + 1) == sequence.validSequence.Count) { isValidCode = 1; } } if (isValidCode == 0) { foreach (GameObject go in panels) { BoobyTrapDeactivator script = GetScript <BoobyTrapDeactivator>(go); if (script != null) { script.ChangeState(false); // Update buttons to tween feedback } } // consoleScript.QueueMessage("INVALID CODE", 0.0f, false, true); playerInput.Clear(); panels.Clear(); Common.GetConsoleScreenScript().BoobyTrapEvent(-1, gameObject, false); // -1 to signal clearing the screen sound.PlayIndependentEvent("BUTTON_RED.vente", false, 0); // Access Granted sound } else // one more correct number code { Common.GetConsoleScreenScript().BoobyTrapEvent(seq, gameObject, false); } if (isValidCode == 1) // successfully finished trap { foreach (GameObject go in panels) { BoobyTrapDeactivator script = GetScript <BoobyTrapDeactivator>(go); if (script != null) { script.ChangeState(true); // Update buttons to tween feedback } } geneticsAccessRightLight.SetDiffuse(SharpMocha.GREEN); doorScript.UnlockDoor(); doorTerminalScript.UnlockDoor(); boobyTrapScript.DeactivateTrap(); Common.GetConsoleScreenScript().BoobyTrapEvent(seq, gameObject, true); playerInput.Clear(); sequence.accessGranted = true; sound.PlayIndependentEvent("BUTTON_GREEN.vente", false, 0); // Access Granted sound } //consoleScript.QueueMessage(seq.ToString(), 0.0f, false, true); } ////Send message to console on progress HERE // consoleScript.QueueMessage("ACCESS ALREADY GRANTED", 0.0f, false, true); return(true); }
public void OnStart() { sound = gameObject.RequireComponent <CSound>(); fx = Common.GetStealthPlayerCamera().RequireComponent <CArtifactFX>(); sound.PlayIndependentEvent("CREATURE_CLOSE.vente", true, 1); }
public void OnUpdate() { if (Input.GetTriggered(0, "1") == 1.0f) // Ctrl + 1 to lock mouse { if (Input.GetHeld(0, "SnapGrid") != 0.0f) { sound_.StopAllGlobalEvents(); } else { sound_.StopAllMyEvents(false); } } if (Input.GetTriggered(0, "2") == 1.0f) { } String[] soundNames = new String[] /*{ * "Combat1", "Combat2", "Door Move", "Elevator Start", "Elevator Stop", * "Footstep", "heartbeat", "Hum", "LightTurnOn", "NonCombat", "static", * "swell_ambience", "Turret_LaserShot", "Turret_Rotate", "Turret_Targetting" * };*/ /*{ * "C_MOVEMENT", "C_RETREAT", "CAM_FLIGHT", "CAM_RETR", "CAM_TOSS_IMP", * "CONSOLE_CLICK", "CONSOLE_CONFIRM", "CONSOLE_DENY", "CONSOLE_TV_CLICK", "CREATURE_CLOSE", "DOOR_CLOSE", * "DOOR_OPEN", "DOOR_UNLOCK", "ENV_BIO_AC", "ENV_BIO_DEF", "ENV_SCI_AC", "ENV_SCI_DEF", "ENV_SCI_LIGHT", * "GEN_ALARM", "GENERAL_LOOP", "LONG_STABS", "MED_STABS", "MON_TV_CHANNEL", "MON_TV_OFF", "MON_TV_ON", * "P_CAM_RETR_A", "P_CAM_RETR_B", "P_CAM_TOSS", "P_CAM_TOSS_IMP", "P_FOOTSTEPS", "P_PAPER_DOWN", "P_PAPER_UP", * "PINPAD_CONFIRM", "PINPAD_DENY", "PINPAD_INPUT", "RC_CAR_MOVE", "SHORT_STABS", "SPEAKER_CONFIRM", "SPEAKER_DENY", * "TREE_RUSTLE", * };*/ { "AMB_CAVES", "AMB_HALLWAY", "AMB_HUB", "AMB_MAZE", //"AMB_MONSTER_ROOM", "AMB_SCIENCE", //"B_LOOP", "BUTTON_GREEN", "BUTTON_RED", // LONG DELAY AT START, FIX "BUTTON_YELLOW", "C1_ANGRY", "C1_CHATTER", "C1_CLOSE_LOOP", "C1_LAUGH", "C1_PAIN", "C2_CLOSE_LOOP", "CAM_FLIGHT", "CAM_LIGHT", "CAM_RETR", "CAM_ROTATE", "CAM_TOSS_IMP", "CAUTIOUS", "CAV_V_DOOR_CLOSE", "CAV_V_DOOR_OPEN", "F_LIGHT_FIZZLE", "F_LIGHT_LOOP", "F_LIGHT_SWITCH_OFF", "F_LIGHT_SWITCH_ON", //"F_LOOP", "GEN_ALARM", "GLASS_CRACK", //"H_DOOR_CLOSE", //"H_DOOR_OPEN", "HORN", //"K_LOOP", "MUSIC_CREDITS", "MUSIC_ESCAPE", "MUSIC_HUB_LOOP", "MUSIC_INTRO_MENU", "ORCHESTRAL", "P1_CAM_RETR_A", "P1_CAM_RETR_B", "P1_CAM_TOSS", "P1_CAM_TOSS_IMP", "P1_FOOTSTEPS", //"P2_CLICK", //"P2_CONFIRM", //"P2_DENY", //"P2_PAPER_DOWN", //"P2_PAPER_UP", "P2_MON_TEXT", "P2_TV_CHANNEL", //"P2_TV_CLICK", //"P2_TV_OFF", //"P2_TV_ON", "PERCUSSIVE", "PERCUSSIVE_A", "PERCUSSIVE_B", "PINPAD_CONFIRM", "PINPAD_DENY", "PINPAD_INPUT", "RC_CAR_MOVE", "RISE_A", "RISE_B", "RISE_C", "RISE_D", "SPEAKER_CONFIRM", "SPEAKER_DENY", "SCI_H_DOOR_CLOSE", "SCI_H_DOOR_OPEN", "SCI_V_DOOR_CLOSE", "SCI_V_DOOR_OPEN", "TREE_RUSTLE", //"V_DOOR_CLOSE", //"V_DOOR_OPEN", }; if (Input.GetTriggered(0, "ArrowRight") != 0.0f) { testIndex = Math.Min(testIndex + 1, soundNames.Length - 1); Logger.Log("sound: " + soundNames[testIndex]); } if (Input.GetTriggered(0, "ArrowLeft") != 0.0f) { testIndex = Math.Max(testIndex - 1, 0); Logger.Log("sound: " + soundNames[testIndex]); } if (Input.GetTriggered(0, "3") != 0.0f) { sound_.PlayIndependentEvent(soundNames[testIndex] + ".vente", false, 1); } /* * timer_ += FrameController.DT(); * * if(timer_ > maxTime_) * { * timer_ = 0.0f; * switch(index_) * { * case 0: * sound_.Stop("NonCombat.vente"); * sound_.Play("Combat1.vente"); * break; * * case 1: * sound_.Stop("Combat1.vente"); * sound_.Play("Combat2.vente"); * break; * * case 2: * sound_.Stop("Combat2.vente"); * sound_.Play("NonCombat.vente"); * break; * } * index_ = (index_ + 1 ) % 3; * }*/ }
public bool AddPlayerInput(int input, GameObject obj) { if (accessGranted) { return(true); } buttons.Add(obj); playerSequence.Add(input); bool isValidCode = true; for (int i = 0; i < playerSequence.Count; ++i) { if (playerSequence[i] != sequence[i]) { // WRONG INPUT playerSequence.Clear(); isValidCode = false; // consoleScript.QueueMessage("INVALID CODE", 0.0f, false, true); break; } if (i == 2) { //Console.Write("ACCESS GRANTED!"); accessGranted = true; door1Script.UnlockDoor(); door1Script.isOneWayDoor = false; // Do not lock anymore door2Script.UnlockDoor(); lightAtDoor.setEnabled(true); foreach (CLight light in lights) { light.setEnabled(true); } geneticsAccessLeftLight.SetDiffuse(SharpMocha.GREEN); consoleScript.QueueMessage("Access sequence accepted.", 0.0f, false, true); buttons.Clear(); sound.PlayIndependentEvent("BUTTON_GREEN.vente", false, 0); // Access Granted sound // Activate checkpoint at the door checkpointScript.isActive = true; cFace.setEnabled(true); } } // If incorrect, reset all buttons if (!isValidCode) { foreach (GameObject go in buttons) { GenericButton buttonScript = GetScript <GenericButton>(go); if (buttonScript != null) { buttonScript.ResetButton(); } } buttons.Clear(); } return(isValidCode); }
void S_dying_Start() { //death sound.PlayIndependentEvent("C1_PAIN.vente", false, 2); }
public void OnStart() { sound_ = gameObject.RequireComponent <CSound>(); sound_.PlayIndependentEvent(soundtoplay, false, 0); }