Ejemplo n.º 1
0
    public void PlayGame()
    {
        // music: trigger only if preset is not already running, to avoid unnessessary retriggering
        if (!eliasEndMusic)
        {
            eliasPlayer.RunActionPreset("Title End", true);
            eliasEndMusic = true;
        }

        SceneManager.LoadScene("StartingArea");
    }
Ejemplo n.º 2
0
 private void OnTriggerEnter(Collider other)
 {
     if (!other.CompareTag("Player"))
     {
         return;
     }
     Debug.Log("ONTRIGGERENTER ELIAS: " + this.gameObject.name);
     if (useSetLevel)
     {
         eliasPlayer.QueueEvent(setLevel.CreateSetLevelEvent(eliasPlayer.Elias));
     }
     if (useSetLevelOnTrack)
     {
         eliasPlayer.QueueEvent(setLevelOnTrack.CreateSetLevelOnTrackEvent(eliasPlayer.Elias));
     }
     if (usePlayStinger)
     {
         eliasPlayer.QueueEvent(playStinger.CreatePlayerStingerEvent(eliasPlayer.Elias));
     }
     if (useActionPreset)
     {
         eliasPlayer.RunActionPreset(actionPresetName, allowRequiredThemeMissmatch);
     }
     if (useDoubleEffectParam)
     {
         eliasPlayer.QueueEvent(doubleEffectParam.CreateSetEffectParameterEvent(eliasPlayer.Elias));
     }
     if (useSetSendVolume)
     {
         eliasPlayer.QueueEvent(setSendVolume.CreateSetSendVolumeEvent(eliasPlayer.Elias));
     }
 }
Ejemplo n.º 3
0
    private void OnTriggerEnter(Collider other)
    {
        if (useSetLevel)
        {
            eliasPlayer.QueueEvent(setLevel.CreateSetLevelEvent(eliasPlayer.Elias));
        }
        if (usePlayStinger)
        {
            eliasPlayer.QueueEvent(playStinger.CreatePlayerStingerEvent(eliasPlayer.Elias));
        }
        if (useActionPreset)
        {
            eliasPlayer.RunActionPreset(actionPresetName, allowRequiredThemeMissmatch);
        }
        if (useDoubleEffectParam)
        {
            eliasPlayer.QueueEvent(doubleEffectParam.CreateSetEffectParameterEvent(eliasPlayer.Elias));
        }
        if (useSetSendVolume)
        {
            eliasPlayer.QueueEvent(setSendVolume.CreateSetSendVolumeEvent(eliasPlayer.Elias));
        }

        //CUSTOM
        LevelChanger changer = gameObject.GetComponent <LevelChanger>();

        if (changer != null)
        {
            changer.ChangeLevel();
        }
        //
    }
Ejemplo n.º 4
0
 private void OnTriggerEnter(Collider other)
 {
     if (useSetLevel)
     {
         eliasPlayer.QueueEvent(setLevel.CreateSetLevelEvent(eliasPlayer.Elias));
     }
     if (useSetLevelOnTrack)
     {
         eliasPlayer.QueueEvent(setLevelOnTrack.CreateSetLevelOnTrackEvent(eliasPlayer.Elias));
         setLevel.level     = 1;
         setLevel.themeName = "";
     }
     if (usePlayStinger)
     {
         eliasPlayer.QueueEvent(playStinger.CreatePlayerStingerEvent(eliasPlayer.Elias));
     }
     if (useActionPreset)
     {
         eliasPlayer.RunActionPreset(actionPresetName, allowRequiredThemeMissmatch);
     }
     if (useDoubleEffectParam)
     {
         eliasPlayer.QueueEvent(doubleEffectParam.CreateSetEffectParameterEvent(eliasPlayer.Elias));
     }
     if (useSetSendVolume)
     {
         eliasPlayer.QueueEvent(setSendVolume.CreateSetSendVolumeEvent(eliasPlayer.Elias));
     }
 }
Ejemplo n.º 5
0
    private void musicCheck()
    {
        playerHealthPercent = (playerStatHandler.Health / playerStatHandler.MaxHealth) * 100;

        //check if war is imminent (enemies targeting player)
        if (currentStateOfWar == "Peace")
        {
            if (nrOfEnemies > 1 && playerHealthPercent > 0)
            {
                currentStateOfWar = "War";
                print("Music: go to war");
                eliasPlayer.RunActionPreset("Enemies Approach", true);
                lastCalledActionPreset          = "Enemies Approach";
                playerHealthWhenEnemiesApproach = playerHealthPercent;
            }
        }

        if (currentStateOfWar == "War")

        {
            //check if Peace if imminent (PC killed everyone)
            if (nrOfEnemies <= 0 && playerHealthPercent > 0)
            {
                currentStateOfWar = "Peace";
                print("Music: go to peace");
                firstDamage = false;

                // trigger only if preset is not already running, to avoid unnessessary retriggering
                if (lastCalledActionPreset != "Peace")
                {
                    eliasPlayer.RunActionPreset("Peace", true);
                    lastCalledActionPreset = "Peace";
                }
            }

            //check if Death (PC died)
            else if (playerHealthPercent <= 0)
            {
                currentStateOfWar = "Player Death";
                print("Music: player death");

                // trigger only if preset is not already running, to avoid unnessessary retriggering
                if (lastCalledActionPreset != "Death")
                {
                    eliasPlayer.RunActionPreset("Death", true);
                    lastCalledActionPreset = "Death";
                }
            }

            //if PC gets damaged for the first time since enemies approached, trigger next ActionPreset once
            else if (!firstDamage && playerHealthPercent < playerHealthWhenEnemiesApproach)
            {
                firstDamage = true;

                // trigger only if preset is not already running, to avoid unnessessary retriggering
                if (lastCalledActionPreset != "Battle 1")
                {
                    eliasPlayer.RunActionPreset("Battle 1", true);
                    lastCalledActionPreset = "Battle 1";
                    print("Music: first damage / Battle 1");
                }
            }

            //trigger higher Battle levels
            else
            {
                //calculate a variable intensity expressing how intense this game feels, using nr of enemies and pc health
                //intensity = ((nrOfEnemies * 10) + (100 - playerHealthPercent)) / 25;
                //intensity = Math.Floor(intensity);
                intIntensity = clamp((nrOfEnemies + ((100 - playerHealthPercent) / 25)), 1, 4);
                //print("Music: intIntensity = " + intIntensity + ", Health = " + playerHealthPercent + ", Enemies = " + nrOfEnemies);


                switch (intIntensity)
                {
                case 1:
                    // trigger only if preset is not already running, to avoid unnessessary retriggering
                    if (lastCalledActionPreset != "Battle 1")
                    {
                        eliasPlayer.RunActionPreset("Battle 1", true);
                        lastCalledActionPreset = "Battle 1";
                        print("Music: Battle 1");
                    }
                    break;

                case 2:
                    // trigger only if preset is not already running, to avoid unnessessary retriggering
                    if (lastCalledActionPreset != "Battle 2")
                    {
                        eliasPlayer.RunActionPreset("Battle 2", true);
                        lastCalledActionPreset = "Battle 2";
                        print("Music: Battle 2");
                    }
                    break;

                case 3:
                    // trigger only if preset is not already running, to avoid unnessessary retriggering
                    if (lastCalledActionPreset != "Battle 3")
                    {
                        eliasPlayer.RunActionPreset("Battle 3", true);
                        lastCalledActionPreset = "Battle 3";
                        print("Music: Battle 3");
                    }
                    break;

                case 4:
                    // trigger only if preset is not already running, to avoid unnessessary retriggering
                    if (lastCalledActionPreset != "Battle 4")
                    {
                        eliasPlayer.RunActionPreset("Battle 4", true);
                        lastCalledActionPreset = "Battle 4";
                        print("Music: Battle 4");
                    }
                    break;

                default:
                    print("Music: default switch case");
                    break;
                }
            }
        }
    }