Exemplo n.º 1
0
 void SetPlayerActive()
 {
     player.SetActive(true);
     dannyWeapons.SetDannyPause();
     exitTurret          = false;
     turnOnTurret        = false;
     releaseFromTurret   = true;
     northlv1Power       = false;
     westlv1Power        = false;
     eastlv1Power        = false;
     eastTSwitch         = false;
     westTSwitch         = false;
     cam2.enabled        = false;
     cam3.enabled        = false;
     cam4.enabled        = false;
     cam5.enabled        = false;
     mount2.enabled      = false;
     mount3.enabled      = false;
     mount4.enabled      = false;
     mount5.enabled      = false;
     lookAround2.enabled = false;
     lookAround3.enabled = false;
     lookAround4.enabled = false;
     lookAround5.enabled = false;
 }
Exemplo n.º 2
0
    void Death()
    {
        HUDHealthText.currentNumHealth = currentHealth;
        healthSlider.value             = 0;
        armorHealthSlider.value        = 0;
        healthGaugeSlider.value        = 0;
        isDead            = true;
        gameObject.tag    = "DEFEATED";
        poisoned          = false;
        poisonEffects     = 1;
        poisonLeakageTime = 1;

        if (dannyWeapons != null)
        {
            dannyWeapons.SetDannyPause();
            dannyWeapons.enabled = false;
        }
        if (currentHealth != 0)
        {
            currentHealth = 0;
        }
        if (dannyActive)
        {
            deathFlag = dannyDeathFlag;
            Instantiate(deathFlag, transform.position, Quaternion.Euler(Vector3.right + new Vector3(-90f, 0f, 0f)));
            GameMasterObject.dannysDead = true;
            if (userInput != null)
            {
                if (userInput.objToCarry.activeInHierarchy)
                {
                    userInput.objToCarry.SetActive(false);
                    HUDCurrency.currentGold -= 150;
                    HUDEXP.currentEXP       += 100;
                }
                if (userInput.objToCarry2.activeInHierarchy)
                {
                    userInput.objToCarry2.SetActive(false);
                    HUDCurrency.currentGold -= 150;
                    HUDEXP.currentEXP       += 100;
                }
            }
        }
        else if (strongmanActive)
        {
            GameMasterObject.strongmansDead = true;
            deathFlag = strongmanDeathFlag;
            sUinput.SetFinalStrikeInactive();
            Instantiate(deathFlag, transform.position, Quaternion.Euler(Vector3.right + new Vector3(-90f, 0f, 0f)));
            if (sUinput != null)
            {
                if (sUinput.objToCarry.activeInHierarchy)
                {
                    sUinput.objToCarry.SetActive(false);
                    HUDCurrency.currentGold -= 150;
                    HUDEXP.currentEXP       += 100;
                }
                if (sUinput.objToCarry2.activeInHierarchy)
                {
                    sUinput.objToCarry2.SetActive(false);
                    HUDCurrency.currentGold -= 150;
                    HUDEXP.currentEXP       += 100;
                }
                if (sUinput.objToCarry3.activeInHierarchy)
                {
                    sUinput.objToCarry3.SetActive(false);
                    HUDCurrency.currentGold -= 150;
                    HUDEXP.currentEXP       += 100;
                }
                if (sUinput.objToCarry4.activeInHierarchy)
                {
                    sUinput.objToCarry4.SetActive(false);
                    HUDCurrency.currentGold -= 150;
                    HUDEXP.currentEXP       += 100;
                }
                if (sUinput.objToCarry5.activeInHierarchy)
                {
                    sUinput.objToCarry5.SetActive(false);
                    HUDCurrency.currentGold -= 150;
                    HUDEXP.currentEXP       += 100;
                }
                if (sUinput.objToCarry6.activeInHierarchy)
                {
                    sUinput.objToCarry6.SetActive(false);
                    HUDCurrency.currentGold -= 150;
                    HUDEXP.currentEXP       += 100;
                }
            }
        }
        HUDEXP.currentEXP += 100;
        this.gameObject.SetActive(false);
        if (ragDoll != null)
        {
            Instantiate(ragDoll, transform.position, transform.rotation);
        }
        //playerAudio.clip = deathClip;
        //playerAudio.Play ();

        if (dannyMovement != null)
        {
            dannyMovement.enabled = false;
        }
        if (charMove != null)
        {
            charMove.enabled = false;
        }
    }
Exemplo n.º 3
0
    // Update is called once per frame
    void Update()
    {
//		Debug.Log (SceneManager.GetActiveScene ().name);
        if (SceneManager.GetActiveScene().name == "Intro Scene")
        {
            wantedMode       = CursorLockMode.None;
            Cursor.lockState = wantedMode;
            Cursor.visible   = true;
        }
        if (SceneManager.GetActiveScene().name != "Intro Scene")
        {
            eventSystem.SetActive(isPaused);
            if (isPaused)
            {
                wantedMode       = CursorLockMode.None;
                Cursor.lockState = wantedMode;
            }
            else
            {
//				wantedMode = CursorLockMode.Locked;
//				Cursor.lockState = wantedMode;
            }
//			Cursor.visible = isPaused;
            if (getDannyCamInfo)
            {
                GetDannyCamInfo();
                getDannyCamInfo = false;
            }
            if (getDannyInfo)
            {
                GetDannyInfo();
                getDannyInfo = false;
            }
            if (getStrongmanInfo)
            {
                GetStrongmanInfo();
                getStrongmanInfo = false;
            }
            if (Input.GetButtonDown("Submit"))
            {
                canvas.enabled = !canvas.enabled;
                Pause();
                isPaused = !isPaused;
                if (dannyShutCameraOff != null)
                {
                    dannyShutCameraOff.enabled = !dannyShutCameraOff.enabled;
                    if (shutWeaponsOff != null)
                    {
                        shutWeaponsOff.enabled = !isPaused;
                    }
                }
                if (strongmanCameraOff != null)
                {
                    strongmanCameraOff.enabled = !strongmanCameraOff.enabled;
                }
                if (GameMasterObject.dannyActive)
                {
                    shutWeaponsOff.SetDannyPause();
                }
                sfxSlider.enabled   = !sfxSlider.enabled;
                musicSlider.enabled = !musicSlider.enabled;
                quit.enabled        = !quit.enabled;
                DisableShotsDisplay();
                DisablePotionDisplay();
                DisableControlsDisplay();
                DisableDannyDisplay();
                DisableJasonDisplay();

                /*
                 * if(!turretsActive)
                 * {
                 * continue;
                 * }
                 * else
                 * {
                 * mouseLookScripts.enabled = !mouseLookScripts.enabled;
                 * }*/
            }

            if (isPaused)
            {
                if (Input.GetButtonDown("Melee"))
                {
                    canvas.enabled = !canvas.enabled;
                    Pause();
                    isPaused = !isPaused;
                    if (dannyShutCameraOff != null)
                    {
                        dannyShutCameraOff.enabled = !dannyShutCameraOff.enabled;
                        if (shutWeaponsOff != null)
                        {
                            shutWeaponsOff.enabled = !isPaused;
                        }
                    }
                    if (strongmanCameraOff != null)
                    {
                        strongmanCameraOff.enabled = !strongmanCameraOff.enabled;
                    }
                    if (GameMasterObject.dannyActive)
                    {
                        shutWeaponsOff.SetDannyPause();
                    }
                    sfxSlider.enabled   = !sfxSlider.enabled;
                    musicSlider.enabled = !musicSlider.enabled;
                    quit.enabled        = !quit.enabled;
                    DisableShotsDisplay();
                    DisablePotionDisplay();
                    DisableControlsDisplay();
                    DisableDannyDisplay();
                    DisableJasonDisplay();
                }
            }
        }
    }