示例#1
0
    /*public RespawnFlagMgt LastRespawnMgt
     * {
     *  get{return gm.m_LastRespawnMgt;}
     *  set{ gm.m_LastRespawnMgt = value;}
     * }*/

    private void Start()
    {
        m_CameraShake = CameraShake.instance;

        m_AudioManager = AudioManager.instance;

        m_SpawnArray = GameObject.FindGameObjectsWithTag("Flag");
        if (m_SpawnArray.Length >= 1)
        {
            m_SpawnPoint = m_SpawnArray[0];
            m_SpawnPoint.GetComponent <RespawnFlagMgt>().State = RespawnFlagMgt.FlagState.GREEN;
        }

        PlayerSpit playerspit = FindObjectOfType <PlayerSpit>();

        if (playerspit != null && gm.m_IntroSceneEnded == false)
        {
            playerspit.IsSpittingAllowed = false;
        }

        GameObject coincounter = GameObject.FindGameObjectWithTag("CoinCounter");

        if (coincounter != null)
        {
            coincounter.SetActive(false);
        }
        if (m_DebugMode)
        {
            if (playerspit != null)
            {
                playerspit.IsSpittingAllowed = true;
            }
            if (coincounter != null)
            {
                coincounter.SetActive(true);
            }
            gm.m_IntroSceneEnded = true;
        }

        if (OnPlayerRespawn != null)
        {
            OnPlayerRespawn(); // called to relink the statusindicator in the new player instance
        }
        if (GeneralSceneMgt.instance.m_GameMode == GeneralSceneMgt.GameMode.NORMAL)
        {
            PlayerStats.Instance.m_MaxHealth      = 250;
            PlayerStats.Instance.m_MaxOxygen      = 120;
            PlayerStats.Instance.m_DrowningDamage = 30;
        }
        else
        {
            PlayerStats.Instance.m_MaxHealth      = 100;
            PlayerStats.Instance.m_MaxOxygen      = 100;
            PlayerStats.Instance.m_DrowningDamage = 12;
        }
    }
示例#2
0
    void PlayerStandStill()
    {
        PlayerMovement playermov = FindObjectOfType <PlayerMovement>();

        if (playermov != null)
        {
            playermov.IsMovementAllowed = false;
        }

        PlayerSpit playerspit = FindObjectOfType <PlayerSpit>();

        if (playerspit != null)
        {
            playerspit.IsSpittingAllowed = false;
        }
    }
示例#3
0
    // Specific methods may have to be re written in cas of new import
    public void SpecificEndDialogue()
    {
        //specific operations
        m_PlayerMov.IsMovementAllowed = true;
        PlayerSpit playerspit3 = FindObjectOfType <PlayerSpit>();

        if (playerspit3 != null)
        {
            playerspit3.IsSpittingAllowed = true;
        }
        m_CameraFollow.target = m_Player.transform;
        m_AudioManager.CrossFade("MusicSorcerer", "Music", 3f, 3f, 0.1f);
        GameMaster.gm.m_IntroSceneEnded = true;
        Destroy(m_Barrier1);
        Destroy(m_Barrier2);
    }
示例#4
0
    // Specific methods may have to be re written in cas of new import
    public IEnumerator SpecificSceneAction(int sceneIndex)
    {
        switch (sceneIndex)
        {
        case 27:
            m_CameraFollow.target = transform.parent;
            break;

        case 26:
            m_DialogueManager.ShutOffContinueButton();
            yield return(new WaitForSeconds(3f));

            m_AudioManager.PlaySound("Fire");
            m_CameraShake.Shake(0.02f, 1.25f);
            yield return(new WaitForSeconds(1.17f));

            yield return(new WaitForSeconds(0.2f));

            m_AudioManager.StopSound("Fire");
            yield return(new WaitForSeconds(0.38f));

            m_AudioManager.PlaySound("DragonFire");
            yield return(new WaitForSeconds(1.35f));

            m_AudioManager.StopSound("DragonFire");
            m_AudioManager.PlaySound("DragonDie");
            yield return(new WaitForSeconds(0.07f));

            m_CameraShake.Shake(0.5f, 0.2f);
            m_AudioManager.PlaySound("WoodImpact");
            yield return(new WaitForSeconds(m_CurrentDialogue.scenes[1].sceneClip.length - 6.17f));

            Destroy(m_FirstDragon);
            Destroy(m_SecondDragon);
            m_DialogueManager.DisplayNextSentence();
            m_DialogueManager.ShutOnContinueButton();
            break;

        case 11:
            if (m_CoinCounter != null)
            {
                m_CoinCounter.SetActive(true);
            }
            m_AudioManager.PlaySound("Coin");
            break;

        case 4:
            m_DialogueManager.ShutOffContinueButton();
            yield return(new WaitForSeconds(1f));

            GameObject burnprefab;

            m_PlayerMov.RollPlayer(true);

            burnprefab = Instantiate(m_BurnEffectPrefab, m_Player.transform);
            ParticleSystem.MainModule main = m_BurnEffectPrefab.GetComponent <ParticleSystem>().main;
            main.loop     = true;
            main.duration = 3f;
            burnprefab.GetComponent <ParticleSystem>().Play();
            m_AudioManager.PlaySound("Fire");

            yield return(new WaitForSeconds(3f));


            m_PlayerMov.RollPlayer(false);
            m_AudioManager.StopSound("Fire");
            Destroy(burnprefab);

            yield return(new WaitForSeconds(1f));

            m_DialogueManager.ShutOnContinueButton();
            break;


        case 3:
            m_DialogueManager.ShutOffContinueButton();
            yield return(new WaitForSeconds(0.52f));

            m_SausageTrigger.enabled = true;
            m_SausageImage.enabled   = true;
            yield return(new WaitForSeconds(0.5f));

            m_PlayerMov.IsMovementAllowed = true;
            PlayerSpit playerspit = FindObjectOfType <PlayerSpit>();
            if (playerspit != null)
            {
                playerspit.IsSpittingAllowed = true;
            }
            m_ArrowRed.SetActive(true);


            break;

        case 2:

            m_DialogueManager.ShutOffContinueButton();
            m_ArrowRed.SetActive(false);
            m_PlayerMov.IsMovementAllowed = false;
            PlayerSpit playerspit2 = FindObjectOfType <PlayerSpit>();
            if (playerspit2 != null)
            {
                playerspit2.IsSpittingAllowed = false;
            }
            yield return(new WaitForSeconds(1.5f));

            m_SausageTrigger.enabled = false;
            m_SausageImage.enabled   = false;
            m_DialogueManager.ShutOnContinueButton();
            yield return(new WaitForSeconds(2f));

            Destroy(m_SausageObject);

            break;

        case 1:

            yield return(new WaitForSeconds(0.25f));

            m_AudioManager.PlaySound("WoodImpact");
            yield return(new WaitForSeconds(0.75f));

            m_AudioManager.PlaySound("WoodImpact");
            yield return(new WaitForSeconds(0.5f));

            m_AudioManager.PlaySound("WoodImpact");
            break;

        default:
            break;
        }


        yield return(null);
    }