Example #1
0
        void VerificaQualFala()
        {
            KeyVar myKeys = AbstractGameController.Instance.MyKeys;

            Debug.Log("ultimo indice no inicio: " + ultimoIndice);


            int indiceFinal = ultimoIndice > 0 ? Mathf.Min(ultimoIndice, falas.Length) : falas.Length;


            for (int i = 0; i < indiceFinal; i++)
            {
                if (myKeys.VerificaAutoShift(falas[i].ChaveCondicionalDaConversa))
                {
                    conversa     = TextBank.RetornaListaDeTextoDoIdioma(falas[i].ChaveDeTextoDaConversa).ToArray();
                    ultimoIndice = i;
                }
            }

            Debug.Log(indiceFinal + " : " + ultimoIndice);

            if (falas[ultimoIndice].Repetir >= 0)
            {
                string kCont = falas[ultimoIndice].ChaveCondicionalDaConversa.ToString();

                myKeys.SomaAutoCont(kCont, 1);
                if (falas[ultimoIndice].Repetir < myKeys.VerificaAutoCont(kCont))
                {
                    myKeys.MudaShift(falas[ultimoIndice].ChaveCondicionalDaConversa, false);
                }
            }
        }
    new void Start()
    {
        if (ExistenciaDoController.AgendaExiste(Start, this))
        {
            KeyVar keys = GameController.g.MyKeys;


            Debug.Log("Conversou primeiro com Derek: " + keys.VerificaAutoShift(KeyShift.conversouPrimeiroComDerek) +
                      " - venceu Derek: " + keys.VerificaAutoShift(KeyShift.venceuDerekPrimeiraVez));


            if (keys.VerificaAutoShift(KeyShift.conversouPrimeiroComDerek) && keys.VerificaAutoShift(KeyShift.venceuDerekPrimeiraVez))
            {
                if (keys.VerificaAutoShift(KeyShift.entreouCanetaDeIan))
                {
                    npc = npcIan;
                }
                else
                {
                    MbItens.RetirarUmItem(GameController.g.Manager, PegaUmItem.Retorna(nomeIDitem.canetaSagradaDeLog), 1);
                }
            }
            else if (!keys.VerificaAutoShift(KeyShift.conversouPrimeiroComDerek) && !keys.VerificaAutoShift(KeyShift.venceuDerekPrimeiraVez))
            {
                Debug.Log("Ué....");
                npc = npcMov;
            }

            base.Start();
        }
    }
    protected override int SetarOpcoes()
    {
        List <ItensAVenda> I      = new List <ItensAVenda>();
        KeyVar             myKeys = GameController.g.MyKeys;

        for (int i = 0; i < itensParaVender.Length; i++)
        {
            Debug.Log("Id daqui: " + ID);

            if (myKeys.VerificaAutoShift("concluido, loja " + ID + " item " + i))
            {
                itensParaVender[i].quantidadeDisponivel = 0;
            }
            else if (myKeys.VerificaAutoCont("quantidade disponivel, loja " + ID + " item " + i) > 0)
            {
                itensParaVender[i].quantidadeDisponivel = myKeys.VerificaAutoCont("quantidade disponivel, loja " + ID + " item " + i);
            }
        }

        for (int i = 0; i < itensParaVender.Length; i++)
        {
            if (myKeys.VerificaAutoShift(itensParaVender[i].preRequisito) &&
                (itensParaVender[i].quantidadeDisponivel > 0 || itensParaVender[i].quantidadeDisponivel == -1))
            {
                I.Add(itensParaVender[i]);
            }
        }

        itensPossiveisDeVender = I.ToArray();


        ChangeOption(0);

        return(I.Count);
    }
        // Use this for initialization
        new void Start()
        {
            KeyVar myKeys = AbstractGameController.Instance.MyKeys;

            if (!myKeys.VerificaAutoShift(ID))
            {
                for (int i = 0; i < colocarTrue.Length; i++)
                {
                    myKeys.MudaShift(colocarTrue[i], true);
                }
            }

            if (colocarTrueCondicional != null)
            {
                for (int i = 0; i < colocarTrueCondicional.Length; i++)
                {
                    if (!myKeys.VerificaAutoShift(colocarTrueCondicional[i].condicao))
                    {
                        myKeys.MudaShift(colocarTrueCondicional[i].alvo, true);
                    }
                }
            }

            //myKeys.MudaAutoShift(ID, true);// Herika buga com esse mudaShift aqui
            myKeys.MudaShift(KeyShift.sempretrue, true);
            textoDoBotao = TextBank.RetornaFraseDoIdioma(TextKey.textoBaseDeAcao);

            NPC = esseNpc;
            base.Start();
        }
Example #5
0
    // Use this for initialization
    new void Start()
    {
        KeyVar myKeys = GameController.g.MyKeys;

        if (!myKeys.VerificaAutoShift(ID))
        {
            for (int i = 0; i < colocarTrue.Length; i++)
            {
                myKeys.MudaShift(colocarTrue[i], true);
            }
        }

        if (colocarTrueCondicional != null)
        {
            for (int i = 0; i < colocarTrueCondicional.Length; i++)
            {
                if (!myKeys.VerificaAutoShift(colocarTrueCondicional[i].condicao))
                {
                    myKeys.MudaShift(colocarTrueCondicional[i].alvo, true);
                }
            }
        }

        myKeys.MudaAutoShift(ID, true);
        myKeys.MudaShift(KeyShift.sempretrue, true);

        npc = esseNpc;
        base.Start();
    }
Example #6
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        KeyVar myKeys = GameController.g.MyKeys;

        if (collision.tag == "attackCollisor")
        {
            Debug.Log(myKeys.VerificaAutoCont(ID) + " os hits");
            myKeys.SomaAutoCont(ID, 1);
            int  moedasAgora;
            bool foi = myKeys.VerificaAutoCont(ID) < numHits;

            moedasAgora = numMoedas / (numHits + 1);

            if (!foi)
            {
                moedasAgora = numMoedas - (numHits - 1) * moedasAgora;
            }


            SpawnMoedas.Spawn(transform.position, moedasAgora);
            new MyInvokeMethod().InvokeNoTempoDeJogo(() =>
            {
                EventAgregator.Publish(new StandardSendGameEvent(EventKey.disparaSom, "Break"));
            }, .3f);

            if (!foi)
            {
                myKeys.MudaAutoShift(ID, true);
                particulaDaFinalizacao.SetActive(true);
                Destroy(GetComponent <Collider2D>());
                Destroy(GetComponent <SpriteRenderer>());
                Destroy(gameObject, 5);
            }
        }
    }
Example #7
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        KeyVar kv = GameController.g.MyKeys;

        if (collision.tag == "attackCollisor" && !kv.VerificaEnemyShift(ID))
        {
            //kv.SomaAutoCont(ID, 1);
            EventAgregator.Publish(new StandardSendGameEvent(EventKey.disparaSom, som));
            EventAgregator.Publish(new StandardSendGameEvent(EventKey.sumContShift, ID, 1));
            EventAgregator.Publish(new StandardSendGameEvent(EventKey.requestChangeEnemyKey, "limparContPentagono" + ID));

            if (kv.VerificaAutoCont(ID) >= contCargasTotais)
            {
                EventAgregator.Publish(new StandardSendGameEvent(EventKey.requestChangeEnemyKey, ID));
                Desativar();
                new MyInvokeMethod().InvokeNoTempoDeJogo(() => {
                    EventAgregator.Publish(new StandardSendGameEvent(EventKey.disparaSom, SoundEffectID.exitCheckPoint));
                }, .5f);
            }

            InstanciaLigando.Instantiate(particulaDeAcao, 0.5f * (collision.transform.position + transform.position), 5);
            DadosDoJogador dj = GameController.g.Manager.Dados;

            if (dj.PontosDeMana < dj.MaxMana)
            {
                dj.AdicionarMana(taxaDeRecuperacao);
                EventAgregator.Publish(new StandardSendGameEvent(EventKey.changeMagicPoints, dj.PontosDeMana, dj.MaxMana));
            }
        }
    }
Example #8
0
 // Start is called before the first frame update
 void Start()
 {
     if (ExistenciaDoController.AgendaExiste(Start, this))
     {
         myKeys = GameController.g.MyKeys;
     }
 }
    private void OnRequestFillDates(IGameEvent e)
    {
        StandardSendGameEvent ssge = (StandardSendGameEvent)e;
        SaveDates             S    = (SaveDates)ssge.MyObject[0];

        if (S == null)
        {
            MyKeys = new KeyVar();
        }
        else
        {
            VerifiqueDinheiroCaido(S.Dados.DinheiroCaido);

            MyKeys = S.VariaveisChave;
        }


        new MyInvokeMethod().InvokeAoFimDoQuadro(() => {
            new MyInvokeMethod().InvokeAoFimDoQuadro(() => {
                //new MyInvokeMethod().InvokeAoFimDoQuadro(() =>{
                new MyInvokeMethod().InvokeAoFimDoQuadro(() =>
                {
//                    Debug.Log(mapConstruct+" : "+MyKeys.MapDates);

                    mapConstruct.GetMapDates = MyKeys.MapDates;
                    OnChangeActiveScene(null);
                });
            });
            // });
        });
    }
    public override void FuncaoDoBotao()
    {
        KeyVar keys = GameController.g.MyKeys;

        keys.MudaShift(KeyShift.conversouPrimeiroComIan, true);


        if (keys.VerificaAutoShift(KeyShift.conversouPrimeiroComDerek)
            &&
            keys.VerificaAutoShift(KeyShift.venceuDerekPrimeiraVez)
            &&
            !keys.VerificaAutoShift(KeyShift.entreouCanetaDeIan)
            )
        {
            npc = new NPCdeConversa();
            Start();
            npc.MudaChaveDaConversa(ChaveDeTexto.IanComCaneta);
            GameController.g.MyKeys.MudaShift(KeyShift.entreouCanetaDeIan, true);
        }
        else if (keys.VerificaAutoShift(KeyShift.conversouPrimeiroComDerek) && !keys.VerificaAutoShift(KeyShift.venceuDerekPrimeiraVez))
        {
            npc = new NPCdeConversa();
            Start();
            npc.MudaChaveDaConversa(ChaveDeTexto.IanDepoisDeDerek);
        }
        else
        {
            Start();
        }

        base.FuncaoDoBotao();
    }
    private void OnTriggerEnter2D(Collider2D collision)
    {
        KeyVar myKeys = GameController.g.MyKeys;

        if (collision.tag == "Player")
        {
            if (myKeys.VerificaCont(KeyCont.losangulosPegos) >= InicioDeAcao
                &&
                myKeys.VerificaCont(KeyCont.losangulosConfirmados) < FinalDeAcao
                &&
                myKeys.VerificaCont(KeyCont.losangulosPegos) > myKeys.VerificaCont(KeyCont.losangulosConfirmados))
            {
                if (UnicidadeDoPlayer.Verifique(collision))
                {
                    EventAgregator.Publish(new StandardSendGameEvent(gameObject, EventKey.cofreRequisitado));

                    if (myKeys.VerificaCont(KeyCont.losangulosPegos) >= FinalDeAcao)
                    {
                        new MyInvokeMethod().InvokeNoTempoDeJogo(() =>
                        {
                            premio.SetActive(true);
                            GetComponent <SpriteRenderer>().sprite = spriteAberto;
                            Destroy(Instantiate(LosanguloManager.l.ParticulaPoeira, transform.position, Quaternion.identity), 5);

                            EventAgregator.Publish(new StandardSendGameEvent(EventKey.disparaSom, SoundEffectID.rockFalseAttack));

                            TrophiesManager.VerifyTrophy(TrophyId.abraUmCofre);
                        }, 1);
                    }
                }
            }
        }
    }
Example #12
0
    // Start is called before the first frame update
    void Start()
    {
        KeyVar mykeys = GameController.g.MyKeys;

        if (mykeys.VerificaAutoShift(autoShiftID) == autoShiftDisableWith
            &&
            mykeys.VerificaAutoShift(shift) == shiftDisableWith)
        {
            Destroy(gameObject);
        }
    }
    public bool VerifiqueCompra()
    {
        if (itensPossiveisDeVender.Length > 0)
        {
            DadosDoJogador d = GameController.g.Manager.Dados;

            if (d.Dinheiro >= itensPossiveisDeVender[OpcaoEscolhida].valorDeVenda)
            {
                EventAgregator.Publish(new StandardSendGameEvent(EventKey.getCoin, -itensPossiveisDeVender[OpcaoEscolhida].valorDeVenda));
                new MyInvokeMethod().InvokeNoTempoReal(() =>
                {
                    EventAgregator.Publish(new StandardSendGameEvent(EventKey.disparaSom, SoundEffectID.Shop));
                }, .5f);
                TradeManager.OnBuy(itensPossiveisDeVender[OpcaoEscolhida].nome);

                // itens possivel de vender vs itens para vender


                itensPossiveisDeVender[OpcaoEscolhida].quantidadeDisponivel--;


                KeyVar myKeys = GameController.g.MyKeys;
                int    val    = itensPossiveisDeVender[OpcaoEscolhida].quantidadeDisponivel;
                int    index  = (new List <ItensAVenda>(itensParaVender)).IndexOf(itensPossiveisDeVender[OpcaoEscolhida]);

                myKeys.MudaAutoCont("quantidade disponivel, loja " + ID + " item " + index, val);

                if (val == 0)
                {
                    myKeys.MudaAutoShift("concluido, loja " + ID + " item " + index, true);
                }

                FinalizarHud();
                IniciarHud();


                return(true);
            }
            else
            {
                return(false);
            }
        }
        else
        {
            new MyInvokeMethod().InvokeAoFimDoQuadro(() =>
            {
                EventAgregator.Publish(EventKey.compraConcluida);
            });
            return(true);
        }
    }
Example #14
0
    new void Start()
    {
        if (ExistenciaDoController.AgendaExiste(Start, this))
        {
            KeyVar keys = GameController.g.MyKeys;
            if (keys.VerificaAutoShift(KeyShift.conversouPrimeiroComIan) && !keys.VerificaAutoShift(KeyShift.venceuDerekPrimeiraVez))
            {
                npc = npcLuta;
            }

            base.Start();
        }
    }
Example #15
0
    string[] RetornaArgumentosPreVenda()
    {
        string[] retorno = new string[3];
        KeyVar   keys    = GameController.g.MyKeys;

        retorno[0] = !indice1?MbItens.NomeEmLinguas(nomeIDitem.pergSinara) : MbItens.NomeEmLinguas(nomeIDitem.pergAlana);

        retorno[1] = !indice1
            ? Mathf.Pow(2, keys.VerificaAutoCont(KeyCont.pergSinaraComprados)).ToString()
            : Mathf.Pow(2, keys.VerificaAutoCont(KeyCont.pergAlanaComprados)).ToString();

        retorno[2] = !indice1
            ? (100 * Mathf.Pow(2, keys.VerificaAutoCont(KeyCont.pergSinaraComprados))).ToString()
            : (100 * Mathf.Pow(2, keys.VerificaAutoCont(KeyCont.pergAlanaComprados))).ToString();
        return(retorno);
    }
    // Use this for initialization
    void Start()
    {
        if (ExistenciaDoController.AgendaExiste(Start, this))
        {
            KeyVar keys = GameController.g.MyKeys;
            if (keys.VerificaAutoShift(KeyShift.fezPrimeiraFalaDeTuto))
            {
                transform.position = pos2.position;
            }

            if (keys.VerificaAutoShift(KeyShift.fezSegundaFalaDeTuto))
            {
                transform.position = pos3.position;
            }
        }
    }
    void VerifiqueConfirmacao(GameObject qual)
    {
        CofreDosLosangulos c = null;

        for (int i = 0; i < cofres.Length; i++)
        {
            if (qual == cofres[i].gameObject)
            {
                Debug.Log("indice do cofre é: " + i);
                c = cofres[i];
            }
        }

        KeyVar myKeys = GameController.g.MyKeys;
        int    sum    = 0;

        for (int i = myKeys.VerificaCont(KeyCont.losangulosConfirmados); i < myKeys.VerificaCont(KeyCont.losangulosPegos); i++)
        {
            if (i >= c.InicioDeAcao - 1 && i < c.FinalDeAcao)
            {
                SouUmLosanguloGerenciavel s = transform.GetChild(i).GetComponent <SouUmLosanguloGerenciavel>();
                s.MySprite.sprite = spriteAmarelo;

                Debug.Log("filho " + i + " :" + s.name);

                GameObject G = Instantiate(particulaDaConfirmacao, s.transform.position, Quaternion.identity);
                G.SetActive(true);
                Destroy(G, 5);

                SpawnMoedas.Spawn(s.transform.position, Mathf.Max(5, i));
                sum++;
            }
        }

        if (sum > 0)
        {
            EventAgregator.Publish(new StandardSendGameEvent(EventKey.disparaSom, SoundEffectID.somParaGetLosangulo));
            new MyInvokeMethod().InvokeNoTempoDeJogo(() =>
            {
                EventAgregator.Publish(new StandardSendGameEvent(EventKey.disparaSom, SoundEffectID.VariasMoedas));
            }, .35f);
        }

        myKeys.SomaCont(KeyCont.losangulosConfirmados, sum);

        Debug.Log(myKeys.VerificaCont(KeyCont.losangulosConfirmados) + " confirmados");
    }
Example #18
0
    public override void FuncaoDoBotao()
    {
        KeyVar keys = GameController.g.MyKeys;

        if (keys.VerificaAutoShift(KeyShift.venceuDerekPrimeiraVez))
        {
            npc = new NPCdeConversa();
            base.Start();
            npc.MudaChaveDaConversa(ChaveDeTexto.DerekDerrotado);
        }
        else
        {
            Start();
        }

        keys.MudaShift(KeyShift.conversouPrimeiroComDerek, true);
        base.FuncaoDoBotao();
    }
    private void SetarSaveDates()
    {
        CharacterManager manager = GameController.g.Manager;

        variaveisChave = GameController.g.MyKeys;

        dados = manager.Dados;

        Vector3 X = manager.transform.position;
        Vector3 R = manager.transform.forward;

        posicao = new float[3] {
            X.x, X.y, X.z
        };
        rotacao = new float[3] {
            R.x, R.y, R.z
        };
    }
Example #20
0
    // Start is called before the first frame update
    void Start()
    {
        KeyVar kv = GameController.g.MyKeys;

        if (ExistenciaDoController.AgendaExiste(Start, this))
        {
            if (kv.VerificaEnemyShift(ID))
            {
                Desativar();
            }
            else
            {
                if (!kv.VerificaEnemyShift("limparContPentagono" + ID))
                {
                    kv.MudaAutoCont(ID, 0);
                }
            }
        }
    }
Example #21
0
    void ComprarOuNaoComprar(int indice)
    {
        GameController.g.HudM.Menu_Basico.FinalizarHud();
        DisparaTexto      disparaT = GameController.g.HudM.DisparaT;
        KeyVar            keys     = GameController.g.MyKeys;
        DadosDoPersonagem dados    = GameController.g.Manager.Dados;

        disparaT.DesligarPaineis();


        int val = !indice1
            ? (int)Mathf.Pow(2, keys.VerificaAutoCont(KeyCont.pergSinaraComprados))
            : (int)Mathf.Pow(2, keys.VerificaAutoCont(KeyCont.pergAlanaComprados));

        switch (indice)
        {
        case 0:
            if (dados.TemItem(nomeIDitem.tinteiroSagradoDeLog) >= val && dados.Cristais >= 100 * val)
            {
                dados.Cristais -= 100 * val;
                GameController.g.HudM.AtualizeImagemDeAtivos();
                MbItens.RetirarUmItem(GameController.g.Manager, nomeIDitem.tinteiroSagradoDeLog, val);
                dados.AdicionaItem(indice1 ? nomeIDitem.pergAlana : nomeIDitem.pergSinara);
                disparaT.ReligarPaineis();
                disparaT.Dispara(conversa[2], fotoDoNPC);
                estadoInterno = EstadoInterno.fraseDeBoaCompra;
                keys.SomaCont(indice1 ? KeyCont.pergAlanaComprados : KeyCont.pergSinaraComprados, 1);
            }
            else
            {
                disparaT.ReligarPaineis();
                disparaT.Dispara(conversa[1], fotoDoNPC);
                estadoInterno = EstadoInterno.fraseInsuficiente;
            }
            break;

        case 1:
            EntraNasEscolhas();
            break;
        }
    }
Example #22
0
    void VerificaQualFala()
    {
        KeyVar myKeys = GameController.g.MyKeys;

        Debug.Log("ultimo indice no inicio: " + ultimoIndice);

        //int indiceInicial = ultimoIndice < falas.Length ? Mathf.Max(ultimoIndice,0) : 0;
        int indiceFinal = ultimoIndice > 0 ? Mathf.Min(ultimoIndice, falas.Length) : falas.Length;


        for (int i = 0; i < indiceFinal; i++)
        //for (int i = falas.Length - 1; i >= indiceInicial; i--)
        {
            if (myKeys.VerificaAutoShift(falas[i].ChaveCondicionalDaConversa))
            {
                conversa     = BancoDeTextos.RetornaListaDeTextoDoIdioma(falas[i].ChaveDeTextoDaConversa).ToArray();
                ultimoIndice = i;
            }
        }

        Debug.Log(indiceFinal + " : " + ultimoIndice);

        if (falas[ultimoIndice].Repetir >= 0)
        {
            string kCont = falas[ultimoIndice].ChaveCondicionalDaConversa.ToString();

            myKeys.SomaAutoCont(kCont, 1);
            if (falas[ultimoIndice].Repetir < myKeys.VerificaAutoCont(kCont))
            {
                myKeys.MudaShift(falas[ultimoIndice].ChaveCondicionalDaConversa, false);
            }
        }

        //ultimoIndice--;

        /*
         * if (!GameController.g.MyKeys.VerificaAutoShift(falas[i].ChaveCondicionalDaConversa))
         *  conversa = BancoDeTextos.RetornaListaDeTextoDoIdioma(falas[i].ChaveDeTextoDaConversa).ToArray();
         * // conversa é uma variavel protected da classe pai*/
    }