// Update is called once per frame
    void Update()
    {
        // This only happens when we are able to move on in the game and the empathy bar is full.
        if (NPC.GetComponent <UpdateBars>() != null && NPC.GetComponent <UpdateBars>().isEmpathyFull() && NPC.gameObject.tag != "Fie")
        {
            NextConversation = "end";
        }
        else if (NPC.GetComponent <UpdateBars>() != null && NPC.GetComponent <UpdateBars>().isEmpathyFull() && NPC.gameObject.tag == "Fie")
        {
            NextConversation = "winGame";
        }

        // We always want Fie to have the first conversation and we do not need the player to press space; we always want it to happen.
        if (!IsTalking && WithinRadius && NPC.name == "Fie Ronndly" && !player.GetComponent <PlayerInteraction>().isTalkingToNPC() && NextConversation == "AwakenInTown0")
        {
            AudioManager.Get().TriggerSoundEffect(SoundEffect.uiConfirmation);
            NPC.GetComponent <InteractionPanel>().setInteractionPanel(false);
            PlayerMovement.AllowMovement(false);
            player.GetComponent <PlayerInteraction>().setTalkingToNPC(true);
            StartTalking();
        }
        if (!IsTalking && WithinRadius && Input.GetButtonDown("Jump") && !player.GetComponent <PlayerInteraction>().isTalkingToNPC())
        {
            AudioManager.Get().TriggerSoundEffect(SoundEffect.uiConfirmation);
            NPC.GetComponent <InteractionPanel>().setInteractionPanel(false);
            PlayerMovement.AllowMovement(false);
            player.GetComponent <PlayerInteraction>().setTalkingToNPC(true);
            StartTalking();
        }
        else if (IsTalking && Input.GetKeyDown(KeyCode.C) && !DisplayingLastTextScreen)
        {
            DisplayNextTextScreen();
        }
        else if (DisplayingLastTextScreen && Input.GetKeyDown(KeyCode.C) && TextObject.choice1 == "") // Means they do not have any choices available on screen.
        {
            DisplayingLastTextScreen = false;

            if (IsConversationOver())
            {
                IsTalking = false;
                player.GetComponent <PlayerInteraction>().setTalkingToNPC(false);
                NPC.GetComponent <InteractionPanel>().setInteractionPanel(true);
                PlayerMovement.AllowMovement(true);
                modalPanel.ClosePanel();
            }
            else // Else we know they just pressed Jump and there is still more to the conversation.
            {
                GetAndStartDisplayingText(TextObject.choice1id);
            }
        }
    }
Exemplo n.º 2
0
    IEnumerator StartSequenceHiders()
    {
        playerObject1.BlockMovement();
        playerObject2.BlockMovement();
        foreach (GameObject AI in GameObject.FindGameObjectsWithTag("NPC"))
        {
            AIMove = AI.GetComponent <AIMovement>();
            AIMove.BlockMovement();
        }
        //AIMove.BlockMovement();
        hunterLookScreen.SetActive(true);
        yield return(new WaitForSeconds(2));

        vampireAwayMessage.SetActive(true);
        yield return(new WaitForSeconds(4));

        vampireAwayMessage.SetActive(false);
        hunterLocationMessage.SetActive(true);
        yield return(new WaitForSeconds(4));

        hunterLookScreen.SetActive(false);
        playerObject1.DisplayRing();
        yield return(new WaitForSeconds(4));

        vampireLookScreen.SetActive(true);
        hunterAwayMessage.SetActive(true);
        yield return(new WaitForSeconds(4));

        hunterAwayMessage.SetActive(false);
        vampireLocationMessage.SetActive(true);
        yield return(new WaitForSeconds(4));

        vampireLookScreen.SetActive(false);
        playerObject2.DisplayRing();
        yield return(new WaitForSeconds(4));

        countdownScreen.SetActive(true);
        count3.SetActive(true);
        yield return(new WaitForSeconds(1));

        count2.SetActive(true);
        count3.SetActive(false);
        yield return(new WaitForSeconds(1));

        count1.SetActive(true);
        count2.SetActive(false);
        yield return(new WaitForSeconds(1));

        countdownScreen.SetActive(false);
        playerObject1.AllowMovement();
        playerObject2.AllowMovement();
        foreach (GameObject AI in GameObject.FindGameObjectsWithTag("NPC"))
        {
            AIMove = AI.GetComponent <AIMovement>();
            AIMove.AllowMovement();
        }
        countDown.StartCounting();
    }
Exemplo n.º 3
0
 void AllowActions()
 {
     pMove.AllowMovement();
     bMove.AllowMovement();
     bShoot.AllowShooting();
     pShoot.AllowShooting();
     bHealth.DoneWithDialogue();
     pHealth.AllowDamage();
 }
Exemplo n.º 4
0
 // This is ugly, just to unfreeze movement after pickup animation
 private void internalUnfreeze()
 {
     _playerMovement.AllowMovement();
 }