Exemplo n.º 1
0
        public override void BuildingDestroyed(IBuilding building, ITile tile)
        {
            walker.Stop();
            Unit.MoveTo(Unit.Position.WithY(Level.Map.GetTerrainHeightAt(Unit.Position.XZ2())));

            if (healthBar.ChangeHitPoints(-30))
            {
                walker.Enabled = false;
                Unit.RemoveFromLevel();
            }
        }
Exemplo n.º 2
0
Arquivo: Keep.cs Projeto: MK4H/MHUrho
        public override void OnHit(IEntity byEntity, object userData)
        {
            if (Building.Player.IsFriend(byEntity.Player) || !(byEntity is IProjectile))
            {
                return;
            }

            int damage = (int)userData;

            healthBar.ChangeHitPoints(-damage);
            //Checked in OnUpdate
        }
Exemplo n.º 3
0
Arquivo: Wall.cs Projeto: MK4H/MHUrho
        public override void OnHit(IEntity byEntity, object userData)
        {
            if (Building.Player.IsFriend(byEntity.Player) || !(byEntity is IProjectile))
            {
                return;
            }

            int damage = (int)userData;

            if (!healthBar.ChangeHitPoints(-damage))
            {
                Building.RemoveFromLevel();
            }
        }
Exemplo n.º 4
0
        public override void OnHit(IEntity other, object userData)
        {
            if (Unit.Player.IsFriend(other.Player))
            {
                return;
            }

            int damage = (int)userData;

            if (!healthBar.ChangeHitPoints(-damage))
            {
                animationController.PlayExclusive("Assets/Units/Chicken/Models/Dying.ani", 0, false);
                dying           = true;
                Shooter.Enabled = false;
                Walker.Enabled  = false;
            }
        }