Example #1
0
 void OnTriggerStay(Collider other)
 {
     if ((other.tag == "Guard" || other.tag == "QuestGiver" || other.tag == "PickUp") && !DialogHappening)
     {
         HighlightTarget        = other.transform;
         CurrentInteractionType = other.tag;
     }
     if (other.tag == "Guard" && Input.GetKeyDown(KeyCode.E) && questInteraction.ReadCurrentQuest() != 0)
     {
         print(choosenTime);
         StartCoroutine(ChooseALine());
         print(choosenAudio + " - " + choosenText);
         if (!other.GetComponent <GuardDialogScript>().GetVoiceLineBool())
         {
             StartCoroutine(other.GetComponent <GuardDialogScript>().PlayTheVoiceLine(choosenAudio, choosenText, choosenTime));
         }
     }
     else if (other.tag == "Guard" && Input.GetKeyDown(KeyCode.E) && questInteraction.ReadCurrentQuest() == 0)
     {
         print(choosenTime);
         StartCoroutine(ChosenLine());
         print(choosenAudio + " - " + choosenText);
         if (!other.GetComponent <GuardDialogScript>().GetVoiceLineBool())
         {
             StartCoroutine(other.GetComponent <GuardDialogScript>().PlayTheVoiceLine(choosenAudio, choosenText, choosenTime));
         }
     }
 }
Example #2
0
 public void DealDamageToDummy(int damage)
 {
     ThisAudioSource.PlayOneShot(ImpactSound, 0.5f);
     if (!hasBeenStruck)
     {
         StartCoroutine(GetHitAnimation(0.5f));
     }
     if (Qinteraction.ReadCurrentQuest() == 3)
     {
         Health -= damage;
     }
     IsDummydead();
 }
Example #3
0
    private void OverviewOfStoryProgression()
    {
        //first Conversation

        if (questInteraction.ReadCurrentQuest() == 1 && ConversationProgress == 0 && HasConversationStarted)
        {
            SetDialogAndAnswerText(ConversationProgress);
            MainCamera.SetActive(false);
        }
        else if (questInteraction.ReadCurrentQuest() == 1 && ConversationProgress == 1 && HasConversationStarted)
        {
            SetDialogAndAnswerText(ConversationProgress);
        }
        else if (questInteraction.ReadCurrentQuest() == 1 && ConversationProgress == 2 && HasConversationStarted)
        {
            SetDialogAndAnswerText(ConversationProgress);
        }
        else if (questInteraction.ReadCurrentQuest() == 1 && ConversationProgress == 3 && HasConversationStarted)
        {
            SetDialogAndAnswerText(ConversationProgress);
            print(AnswerTextLines[ConversationProgress]);
        }
        else if (questInteraction.ReadCurrentQuest() == 1 && ConversationProgress == 4 && HasConversationStarted)
        {
            SetDialogAndAnswerText(ConversationProgress);
            UseCutsceneCamera();
            CurrentCutsceneCamera.SetActive(true);
            QuestCamera.SetActive(false);
            MyQuestUI.SetActive(false);
            MainUI.SetActive(true);
            Cursor.visible = false;
            questInteraction.AddToCurrentQuest();
            playerController.isDialogActive(false);
            havePlayedAudio = false;
            ThisAudioSource.Stop();
        }

        //second conversation
        if (questInteraction.ReadCurrentQuest() == 2 && ConversationProgress == 5 && HasConversationStarted)
        {
            if (!ThisAudioSource.isPlaying && !havePlayedAudio)
            {
                ThisAudioSource.PlayOneShot(VoiceLines[ConversationProgress], 1f);
                havePlayedAudio = true;
            }
            SetDialogAndAnswerText(ConversationProgress);
        }
        else if (questInteraction.ReadCurrentQuest() == 2 && ConversationProgress == 6 && HasConversationStarted)
        {
            SetDialogAndAnswerText(ConversationProgress);
        }
        else if (questInteraction.ReadCurrentQuest() == 2 && ConversationProgress == 7 && HasConversationStarted)
        {
            SetDialogAndAnswerText(ConversationProgress);
        }
        else if (questInteraction.ReadCurrentQuest() == 2 && ConversationProgress == 8 && HasConversationStarted)
        {
            SetDialogAndAnswerText(ConversationProgress);
            UseCutsceneCamera();
            CurrentCutsceneCamera.SetActive(true);
            QuestCamera.SetActive(false);
            MyQuestUI.SetActive(false);
            MainUI.SetActive(true);
            Cursor.visible = false;
            questInteraction.AddToCurrentQuest();
            playerController.isDialogActive(false);
            havePlayedAudio = false;
            ThisAudioSource.Stop();
        }

        //Third Conversation
        else if (questInteraction.ReadCurrentQuest() == 3 && ConversationProgress == 9 && HasConversationStarted)
        {
            if (!ThisAudioSource.isPlaying && !havePlayedAudio)
            {
                ThisAudioSource.PlayOneShot(VoiceLines[ConversationProgress], 1f);
                havePlayedAudio = true;
            }
            SetDialogAndAnswerText(ConversationProgress);
        }
        else if (questInteraction.ReadCurrentQuest() == 3 && ConversationProgress == 10 && HasConversationStarted)
        {
            SetDialogAndAnswerText(ConversationProgress);
        }
        else if (questInteraction.ReadCurrentQuest() == 3 && ConversationProgress == 11 && HasConversationStarted)
        {
            SetDialogAndAnswerText(ConversationProgress);
            UseCutsceneCamera();
            CurrentCutsceneCamera.SetActive(true);
            QuestCamera.SetActive(false);
            MyQuestUI.SetActive(false);
            MainUI.SetActive(true);
            Cursor.visible = false;
            questInteraction.AddToCurrentQuest();
            playerController.isDialogActive(false);
            havePlayedAudio = false;
            ThisAudioSource.Stop();
        }
    }