Beispiel #1
0
    void recebePontosDaVitoria()
    {
        Criature vencedor   = X.GetComponent <umCriature> ().criature();
        uint     derrotadoM = inimigoUC.criature().cAtributos[0].Maximo;
        heroi    H          = oHeroi.GetComponent <heroi> ();

        vencedor.mNivel.XP += (uint)Mathf.Round((float)((double)derrotadoM / (double)2));
        if (vencedor.mNivel.verificaPassaNivel(vencedor.cAtributos))
        {
            passoDePassarDeNivel();
        }
        H.cristais += derrotadoM;
    }
    protected void facaImpacto(GameObject emQ, bool colocaImpactos = false, bool destroiAqui = true, bool noTransform = false)
    {
        if (emQ.gameObject.tag == "eventoComGolpe")
        {
            eventoComGolpe eCG = emQ.GetComponent <eventoComGolpe>();
            acaoDeGolpe    aG2 = dono.GetComponent <acaoDeGolpe>();
            if (eCG && aG2)
            {
                eCG.disparaEvento(aG2.ativa.nomeID);
            }
        }

        GameObject impacto  = GameObject.Find("elementosDoJogo").GetComponent <elementosDoJogo>().retorna(noImpacto);
        GameObject impacto2 = null;

        if (!noTransform)
        {
            impacto2 = (GameObject)Instantiate(impacto, transform.position, Qparticles);
        }

        umCriature umC = emQ.transform.GetComponent <umCriature>();

        if (umC)
        {
            if (umC.criature().cAtributos[0].Corrente > 0)
            {
                if (dono.GetComponent <acaoDeGolpe>())
                {
                    acaoDeGolpe aG = dono.GetComponent <acaoDeGolpe>();
                    aG.tomaDanoUm(emQ.transform);

                    if (noTransform)
                    {
                        impacto2 = (GameObject)Instantiate(impacto, umC.transform.position, Qparticles);
                    }

                    if (colocaImpactos)
                    {
                        aG.impactos++;
                    }
                }
            }
        }

        if (impacto2)
        {
            Destroy(impacto2, 1.5f);
        }
        if (destroiAqui)
        {
            Destroy(gameObject);
        }
    }
Beispiel #3
0
    protected void verifiqueVida()
    {
        Criature M = inimigoUC.criature();

        if (!meuCriatureUC)
        {
            meuCriatureUC = X.GetComponent <umCriature> ();
        }

        Criature X1 = meuCriatureUC.criature();

        contadorDeTempo = 0;

        if (M.cAtributos[0].Corrente <= 0 && X1.cAtributos[0].Corrente > 0)
        {
            umaVitoria();
        }

        if (X1.cAtributos[0].Corrente <= 0)
        {
            umaDerrota();
        }
    }