Exemplo n.º 1
0
        public override void Hurt(int hurtValue, AttackPropertyType hurtType, bool isCrit, LogicUnit injurer)
        {
            if (Alive())
            {
                int value = GetActualHurtValue(hurtType, hurtValue);
                hp -= value;

                RenderMessage message = new RenderMessage();
                message.type     = RenderMessage.Type.NpcHurt;
                message.ownerId  = id;
                message.position = transform.position;
                message.arguments.Add("value", value);
                PostRenderMessage(message);

                if (hp <= 0)
                {
                    injurer.OnKillEnemy(killReward, injurer, this);
                    Dying();
                }
                else
                {
                    Attack(injurer);
                }
            }
        }
Exemplo n.º 2
0
        public override void Hurt(int hurtValue, AttackPropertyType type, bool isCrit, LogicUnit injurer)
        {
            if (Alive())
            {
                int value = GetActualHurtValue(hurtValue, hurtType);
                hp -= value;
                RenderMessage message = new RenderMessage();
                message.type    = RenderMessage.Type.DemolisherHurt;
                message.ownerId = id;
                message.arguments.Add("value", hurtValue);
                PostRenderMessage(message);

                if (hp <= 0)
                {
                    injurer.OnKillEnemy(killReward, injurer, this);
                    ChangeState(DemolisherState.DYING, fsmDying);
                }
            }
        }
Exemplo n.º 3
0
        public override void Hurt(int hurtValue, AttackPropertyType hurtType, bool isCrit, LogicUnit injurer)
        {
            if (Alive())
            {
                int value = GetInstituteActualHurtValue(hurtType, hurtValue);
                hp -= value;
                RenderMessage message = new RenderMessage();
                message.type     = RenderMessage.Type.InstituteHurt;
                message.ownerId  = this.id;
                message.position = position.vector3;
                message.arguments.Add("value", value);
                PostRenderMessage(message);

                if (hp <= 0)
                {
                    injurer.OnKillEnemy(destroyReward, injurer, this);
                    Destroy();
                }
            }
        }
Exemplo n.º 4
0
        public override void Hurt(int hurtValue, AttackPropertyType hurtType, bool isCrit, LogicUnit injurer)
        {
            if (Alive())
            {
                if (hurtType == AttackPropertyType.PhysicalAttack)
                {
                    int v = GetTowerActualHurtValue(hurtType, hurtValue);
                    hp -= v;

                    RenderMessage message = new RenderMessage();
                    message.type     = RenderMessage.Type.TowerHurt;
                    message.ownerId  = id;
                    message.position = position.vector3;
                    message.arguments.Add("value", v);
                    PostRenderMessage(message);

                    if (hp <= 0)
                    {
                        injurer.OnKillEnemy(killReward, injurer, this);
                        Destroy();
                    }
                }
            }
        }
Exemplo n.º 5
0
 public override void OnKillEnemy(int emberReward, LogicUnit killer, LogicUnit dead)
 {
     owner.OnKillEnemy(emberReward, owner, dead);
 }