Пример #1
0
    public static void InsereEstouEmDano(CreatureManager doAtacado, Animator animatorDoAtacado, IGolpeBase golpe)
    {
        EstouEmDano eED = doAtacado.gameObject.AddComponent <EstouEmDano>();

        eED.esseGolpe = golpe;
        eED.animator  = animatorDoAtacado;
        eED.gerente   = doAtacado;
    }
Пример #2
0
    // Start is called before the first frame update
    void Start()
    {
        positionRequest = new ExternalPositionRequest(transform, mov);
        mov.Iniciar(transform);
        dash.IniciarCampos(transform);

        emDano   = new EstouEmDano(GetComponent <Rigidbody2D>());
        animador = new AnimadorDoPersonagem(transform);

        EventAgregator.Publish(new StandardSendGameEvent(gameObject, EventKey.starterHudForTest, dados));


        EventAgregator.AddListener(EventKey.heroDamage, OnHeroDamage);
        EventAgregator.AddListener(EventKey.enemyContactDamage, OnEnemyContactDamage);
        EventAgregator.AddListener(EventKey.curaCancelada, OnCancelCure);
        EventAgregator.AddListener(EventKey.curaDisparada, OnCureInvoke);
        EventAgregator.AddListener(EventKey.requestMagicAttack, OnRequestMagicAttack);
        EventAgregator.AddListener(EventKey.requestDownArrowMagic, OnRequestDownArrowMagic);
        EventAgregator.AddListener(EventKey.colorButtonPressed, OnColorButtonPressed);
        EventAgregator.AddListener(EventKey.requestToFillDates, OnRequestFillDates);
        EventAgregator.AddListener(EventKey.startCheckPoint, OnStartCheckPoint);
        EventAgregator.AddListener(EventKey.checkPointLoad, OnCheckPointLoad);
        EventAgregator.AddListener(EventKey.getCoin, OnGetCoin);
        EventAgregator.AddListener(EventKey.getCoinBag, OnGetCoinBag);
        EventAgregator.AddListener(EventKey.enterPause, OnOpenExternalPanel);
        EventAgregator.AddListener(EventKey.exitPause, OnExitPause);
        EventAgregator.AddListener(EventKey.abriuPainelSuspenso, OnOpenExternalPanel);
        EventAgregator.AddListener(EventKey.fechouPainelSuspenso, OnCloseExternalPanel);
        EventAgregator.AddListener(EventKey.getEmblem, OnGetEmblem);
        EventAgregator.AddListener(EventKey.getUpdateGeometry, OnGetUpdateGeometry);
        //EventAgregator.AddListener(EventKey.getPentagon, OnGetPentagon);
        EventAgregator.AddListener(EventKey.inicializaDisparaTexto, OnOpenExternalPanel);
        EventAgregator.AddListener(EventKey.finalizaDisparaTexto, OnCloseExternalPanel);
        EventAgregator.AddListener(EventKey.getNotch, OnGetNotch);
        EventAgregator.AddListener(EventKey.colisorNoQuicavel, OnRequestKick);
        EventAgregator.AddListener(EventKey.requestCharRepulse, OnRequestRepulse);
        EventAgregator.AddListener(EventKey.requestHeroPosition, OnRequestPosition);
        EventAgregator.AddListener(EventKey.getColorSword, OnGetColorSword);
        EventAgregator.AddListener(EventKey.getStamp, OnGetStamp);
        EventAgregator.AddListener(EventKey.getItem, OnGetItem);
        EventAgregator.AddListener(EventKey.colorChanged, OnSwordColorChanged);
        EventAgregator.AddListener(EventKey.getMagicAttack, OnGetMagicAttack);
        EventAgregator.AddListener(EventKey.updateGeometryComplete, OnUpdateGeometryComplete);
        EventAgregator.AddListener(EventKey.allAbilityOn, OnRequestAllAbility);
        EventAgregator.AddListener(EventKey.endTeleportDamage, OnEndTeleportDamage);
        EventAgregator.AddListener(EventKey.animaIniciaPulo, OnStartJumpAnimate);
        EventAgregator.AddListener(EventKey.animationPointCheck, OnFinishJump);


        GameController.g.Manager = this;
    }
Пример #3
0
    public static void AplicaDano(CreatureManager doAtacado, GameObject atacante, IGolpeBase golpe)
    {
        doAtacado.MudaParaEstouEmDano();
        //Transform T = doAtacado.transform;
        Animator animatorDoAtacado = doAtacado.GetComponent <Animator>();

        //  doAtacado.MudaEmDano();

        animatorDoAtacado.Play("dano2");
        animatorDoAtacado.SetBool("dano1", true);
        animatorDoAtacado.Play("dano1");

        CalculaDano(doAtacado, atacante, golpe);

        EstouEmDano eED = doAtacado.gameObject.AddComponent <EstouEmDano>();

        eED.esseGolpe = golpe;
        eED.animator  = animatorDoAtacado;
        eED.gerente   = doAtacado;

        VerificaVida(atacante, doAtacado, animatorDoAtacado);
    }