Exemplo n.º 1
0
    // CHECK COMBO ----------------------------------------------------------------------------------------- check combo ------------------------------------------------------------------------------------
    private void CheckCombo(General_Controls player)
    {
        player.CheckMyCombo();                          // the player controls if his arrow contains elements required by the quest

        if (player.collected_combo >= QuestList.Length) // if all the items in the combo have been collected, the combo is complete
        {
            Reward(player);                             // reward the player
        }
    }
Exemplo n.º 2
0
    // THE REWARD FOR THE COMPLETED QUEST IS ASSIGNED TO THE PLAYER -------------------------------------------------------------------- quest reward ------------------------------------
    private void Reward(General_Controls player)
    {
        Debug.Log("REWARD is assigned to: " + player.gameObject.name);

        #region NEW CODE


        if (player.GetComponent <IA_controller>() != null)
        {
            questCompletedP2.Play();
            questCompletedP2b.Play();
        }
        else
        {
            questCompletedP1.Play();
            questCompletedP1a.Play();
        }

        #endregion
        quest_sound_completed.Play();
        player.player_score += match_quests[current_quest].quest_reward; // quest reward is assigned to the player

        for (int i = 0; i < player.player_combo.Length; i++)
        {
            player.player_combo[i] = null;
            QuestList[i]           = null;
        }

        //the combo icon is generated to show the value of the quest
        GameObject combo_icon;
        combo_icon = Instantiate(player.GetComponent <General_Controls>().combo_icon, transform.position, Quaternion.identity);
        combo_icon.GetComponent <Arrow_Score>().score = match_quests[current_quest].quest_reward;
        combo_icon.transform.parent = null;

        //the quest icon is generated to enfatize the player who completed the quest
        Instantiate(player.quest_icon, transform.position, Quaternion.identity);


        StopAllCoroutines(); // PROVVISORIO --> perchè non posso fermare la singola coroutine?

        RemoveQuest();       // removes the current quest

        NextWave();          // prepares the next wave
    }