示例#1
0
    public void PushBugs(GlitchEffect effect)
    {
        if (this.IsDeath)
        {
            return;
        }
        GameManager.Instance.AddScore(scoreByBugs);
        Source.PlayOneShot(glitchSound);
        if (effect == null)
        {
            return;
        }
        if (currentGlitches.Any(item => item.GetType() == effect.GetType()) == false)
        {
            currentGlitches.Add(effect);

#if GAME_JOLT
            if (currentGlitches.Count >= GlitchEffect.allGlitchEffects.Length)
            {
                TrophiesManager.UnlockTrophy(Trophy.ICantSeeAnything);
            }
#endif

            global::Console.Instance.GetWriter().WriteLine($"<color=#FF3107>ERROR:: <color=#FFCD00>{effect.Description}</color></color>");
            effect.WhenCollect();
        }
    }
示例#2
0
    public void Kill()
    {
        if (IsDeath == false)
        {
            IsDeath = true;
            move    = 0;
            walkingEffect.SetBool("Spawn", false);
            musicSource.Stop();
            Source.PlayOneShot(gameOverSound);

#if GAME_JOLT
            if (GameManager.Instance.Score <= -200)
            {
                TrophiesManager.UnlockTrophy(Trophy.IsItSomethingWrong);
            }

            if (GameManager.Instance.Score >= 250)
            {
                TrophiesManager.UnlockTrophy(Trophy.TheWinner);
            }
#endif

            StartCoroutine(DeathProcess());
        }
    }
    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);
                    }
                }
            }
        }
    }
    private void OnEquipEmblem(IGameEvent obj)
    {
        StandardSendGameEvent ssge = (StandardSendGameEvent)obj;

        NomesEmblemas nomeID = (NomesEmblemas)ssge.MyObject[0];

        switch (nomeID)
        {
        default:
            MyKeys.MudaAutoShift("equiped_" + nomeID.ToString(), true);
            break;
        }

        TrophiesManager.VerifyTrophy(TrophyId.coloqueEmblemaNaEspada);
    }
示例#5
0
    void RetornoDoPainel()
    {
        EventAgregator.Publish(EventKey.fechouPainelSuspenso);
        EventAgregator.Publish(EventKey.getMagicAttack);
        EventAgregator.Publish(EventKey.requestSceneCamLimits);
        EventAgregator.Publish(new StandardSendGameEvent(EventKey.requestChangeShiftKey, KeyShift.venceuSetaSombria));


        for (int i = 0; i < barreiras.Length; i++)
        {
            barreiras[i].GetComponent <CollorBarrage>().Destruicao();
        }

        TrophiesManager.VerifyTrophy(TrophyId.derroteMagoSetaSombria);
    }
示例#6
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.tag == "Player" && !iniciado)
        {
            if (UnicidadeDoPlayer.Verifique(collision))
            {
                animador.SetTrigger("coletado");
                InstanciaLigando.Instantiate(particulaDaColeta, transform.position);
                iniciado = true;
                EventAgregator.Publish(new StandardSendGameEvent(EventKey.requestChangeShiftKey, ID));
                EventAgregator.Publish(new StandardSendGameEvent(EventKey.sumContShift, KeyCont.losangulosPegos, 1));
                EventAgregator.Publish(new StandardSendGameEvent(EventKey.disparaSom, SoundEffectID.somParaGetLosangulo));
                EventAgregator.Publish(new StandardSendGameEvent(EventKey.disparaSom, "Wind1"));

                TrophiesManager.VerifyTrophy(TrophyId.coleteUmLosango);
                // Coletou();
            }
        }
    }
    /*
     * private void OnGetPentagon(IGameEvent e)
     * {
     *  dados.SomaPentagono();
     * }*/

    private void OnGetUpdateGeometry(IGameEvent e)
    {
        StandardSendGameEvent ssge = (StandardSendGameEvent)e;

        HexagonoColetavelBase.DadosDaGeometriaColetavel d = (HexagonoColetavelBase.DadosDaGeometriaColetavel)ssge.MyObject[0];

        OnOpenExternalPanel(null);

        if (d.ePentagono)
        {
            dados.SomaPentagono();
        }
        else
        {
            dados.SomaHexagono();
        }

        TrophiesManager.VerifyTrophy(d.ePentagono ? TrophyId.coleteUmFragmentoDePentagono : TrophyId.coleteUmFragmentoDeHexagono);
    }
    private void OnUpdateGeometryComplete(IGameEvent e)
    {
        StandardSendGameEvent ssge = (StandardSendGameEvent)e;
        bool ePentagono            = (bool)ssge.MyObject[0];

        if (ePentagono)
        {
            dados.PentagonosCompletados++;
            dados.MaxMana      = dados.BaseMaxMana + dados.PentagonosCompletados * dados.AddMagicBarAmount;
            dados.PontosDeMana = dados.MaxMana;
            dados.PartesDePentagonosObtidas = 0;
        }
        else
        {
            dados.PartesDeHexagonoObtidas = 0;
            dados.HexagonosCompletados++;
            dados.MaxVida      = dados.BaseMaxLife + dados.HexagonosCompletados * dados.AddLifeBarAmount;
            dados.PontosDeVida = dados.MaxVida;
        }

        TrophiesManager.VerifyTrophy(ePentagono ? TrophyId.completeUmPentagono : TrophyId.completeUmHexagono);

        EventAgregator.Publish(new StandardSendGameEvent(EventKey.starterHudForTest, dados));
    }
    // Start is called before the first frame update


    // Update is called once per frame
    void Update()
    {
        if (estado != EstadoDaqui.emEspera)
        {
            tempoDecorrido += Time.deltaTime;
        }

        switch (estado)
        {
        case EstadoDaqui.spriteFinalizador:
            if (tempoDecorrido > TEMPO_ESCALONANDO_SPRITE)
            {
                EventAgregator.Publish(new StandardSendGameEvent(EventKey.disparaSom, SoundEffectID.Wind1));
                interestObject = InstanciaLigando.Instantiate(particulasPreparaAnimaMorte, boss.position, 5);
                estado         = EstadoDaqui.aguardandoParticulas;
                tempoDecorrido = 0;
            }
            else
            {
                EscalonaSprite();
            }
            break;

        case EstadoDaqui.aguardandoParticulas:
            if (tempoDecorrido > TEMPO_AGUARDANDO_PARTICULAS)
            {
                interestObject = InstanciaLigando.Instantiate(particulasAnimaMorte, boss.position);
                estado         = EstadoDaqui.visualizandoParticulas;
                tempoDecorrido = 0;
                AudioDoAnimaMorte();
            }
            break;

        case EstadoDaqui.visualizandoParticulas:
            if (tempoDecorrido > TEMPO_DAS_PARTICULAS)
            {
                MonoBehaviour.Destroy(interestObject);

                EventAgregator.Publish(new StandardSendGameEvent(EventKey.disparaSom, dasParticulasFinalizadora));
                EventAgregator.Publish(new StandardSendGameEvent(EventKey.startSceneMusic));
                InstanciaLigando.Instantiate(particulaFinalizaAnimaMorte, boss.position, 5);
                interestObject            = InstanciaLigando.Instantiate(spriteFinalizador, boss.position);
                interestVector3           = interestObject.transform.localScale;
                meuSprite                 = interestObject.GetComponent <SpriteRenderer>();
                premio.transform.position = new Vector3(boss.position.x, alturaChao.position.y, 0);

                MonoBehaviour.Destroy(boss.gameObject);
                estado         = EstadoDaqui.aguardandoPremio;
                tempoDecorrido = 0;
            }
            break;

        case EstadoDaqui.aguardandoPremio:
            if (tempoDecorrido < TEMPO_ESCALONANDO_SPRITE)
            {
                EscalonaSprite();
            }
            else
            {
                EventAgregator.Publish(EventKey.requestSceneCamLimits);
                EventAgregator.Publish(EventKey.fechouPainelSuspenso);
                premio.SetActive(true);
                Destroy(interestObject);
                estado = EstadoDaqui.animaPremio;

                TrophiesManager.VerifyTrophy(TrophyId.derroteGrandeCirculo);
            }
            break;
        }
    }
示例#10
0
 protected void OnEnable()
 {
     TrophiesManager.UnlockTrophy(Trophy.ThankYou);
 }
示例#11
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     TrophiesManager.VerifyTrophy(tId);
 }