public void TextUpdateStatus()
 {
     pontos.text          = player.currentPontos.ToString();
     StatusTotais[0].text = player.danoTotal.ToString();
     StatusTotais[1].text = player.defTotal.ToString();
     StatusTotais[2].text = player.totalStamina.ToString();
     StatusTotais[3].text = player.totalLife.ToString();
     StatusTotais[4].text = PlayerStatsController.GetCurrentLevel().ToString();
     StatusTotais[5].text = PlayerStatsController.GetCurrentReputation().ToString();
 }
 public void ApplayDamage(int damage)
 {
     currentLife -= damage;
     if (currentLife <= 0)
     {
         OnDestroyed();
     }
     if (PlayerStatsController.GetCurrentReputation() <= -20)
     {
         Destroy(this.gameObject);
         destructive.gameObject.SetActive(true);
     }
 }
Exemple #3
0
    // Update is called once per frame
    void Update()
    {
        AbrirStatusPontos();
        ContadorDeTempo += 1;
        if (ContadorDeTempo < tempoLoad && ativo)
        {
            inventario.gameObject.SetActive(!inventario.gameObject.activeSelf); // liga e desliga o inventario

            inventarioDoVendedor.gameObject.SetActive(false);
            ativo = false;
            Destroy(destruction.gameObject);
        }
        if (Input.GetKeyDown(KeyCode.I) && !inventarioDoVendedor.activeSelf)
        {
            miniMapa.gameObject.SetActive(!miniMapa.gameObject.activeSelf);
            HUD.gameObject.SetActive(!HUD.gameObject.activeSelf);
            TexTMissao.gameObject.SetActive(!TexTMissao.gameObject.activeSelf);
            inventario.gameObject.SetActive(!inventario.gameObject.activeSelf); // liga e desliga o inventario
            if (inventario.gameObject.activeSelf)                               //CONDICIONAL QUE PAUSE O GAME.
            {
                Time.timeScale = 0;
            }
            else
            {
                Time.timeScale = defaultTimeScale;
            }
        }
        if (messageItemToTake.gameObject.activeSelf)
        {
            currentTimeToShowMessage += Time.deltaTime;
            if (currentTimeToShowMessage > timeToShowMessage)
            {
                messageItemToTake.gameObject.SetActive(false);
            }
        }

        if (Input.GetKeyDown(KeyCode.Escape) && inventario.gameObject.activeSelf && !inventarioDoVendedor.activeSelf && !pause)
        {
            inventario.gameObject.SetActive(!inventario.gameObject.activeSelf); // liga e desliga o inventario
            Time.timeScale = defaultTimeScale;
        }
        testaPotion();

        nivel.text = PlayerPrefs.GetInt("currentLevel").ToString();
        SetReputation(100, PlayerStatsController.GetCurrentReputation());
    }
Exemple #4
0
    public void FalaMestreDaVila(int op = 1)
    {
        switch (op)
        {
        case 0:
            if (ativaCientista)
            {
                conversa.text = "RÁPIDO, ENCONTRE O CIENTISTA";
            }
            else
            {
                conversa.text = " ";
            }
            break;

        case 1:
            if (ativaCientista)
            {
                i             = 0;
                conversa.text = " ";
                fechaTudo();
            }
            if (PlayerStatsController.GetCurrentReputation() < 100)
            {
                conversa.text = "Olá amigo\n As regras são claras, siga-as e você terá futuro em nossa civilização.\n Saia daqui e volte quando conseguir!";
            }
            else if (PlayerStatsController.GetCurrentReputation() >= 100 && nivelDeMissao == 0)
            {
                conversa.text = "Meu garoto, você se mostrou digno de confiança!\n" +
                                "Seu destino foi traçado a muito tempo atrás. Mostre que você é digno desta reputação.";
            }

            else if (PlayerStatsController.GetCurrentReputation() >= 100 && nivelDeMissao == 1)
            {
                conversa.text = "Oh não o cientista se esqueceu da mochila, nela está contida a unica receita que pode destruir o fungo e os equipamentos necessarios para fazer este feito!\n" +
                                "Por favor, volte até la e encontre a mochila onde ela estiver." +
                                "\nDica: Encontre a carroça quebrada";
                instrucoes.text = "Encontre a mochila!";
                buscarMochila();
            }
            else if (PlayerStatsController.GetCurrentReputation() >= 100 && nivelDeMissao == 2)
            {
                conversa.text = "Finalmente, achei que tivesse morrido...\n" +
                                "Você trouxe a mochila?";
            }
            break;

        case 2:
            if (PlayerStatsController.GetCurrentReputation() >= 100 && nivelDeMissao == 4)
            {
                conversa.text = "Ótimo, agora só basta esperar para o cientista concluir a receita e nós seremos livres novamente!\n Muito obrigado!";
                break;
            }
            else if (PlayerStatsController.GetCurrentReputation() >= 100 && nivelDeMissao == 0)
            {
                conversa.text = "Nosso amado cientista está perdido (Se já não estiver morto)\n" +
                                "Encontre-o e o leve um pergaminho de teletransporte. Você é nossa unica esperança. Não nos desaponte!";
                instrucoes.text = "Compre e leve um pergaminho até o cientista que está perdido.";
                iniciaMissaoSalvamento();
                break;
            }
            else if (PlayerStatsController.GetCurrentReputation() < 100)
            {
                i = 0;
                fechaTudo();
            }
            break;

        case 3:
            i = 0;
            fechaTudo();
            break;
        }
    }