Beispiel #1
0
 public override void Event(Player obj)
 {
     if (obj!=null && !obj.Invincible)
     {
         obj.GetDamage(20);
     }
 }
Beispiel #2
0
 public override void Event(Player obj)
 {
     if (obj!=null && !obj.Invincible)
     {
         obj.GetDamage(-_healAmount);
         _map.ObjectManager.Remove(this);
         _parent.RemoveChild();
     }
 }
Beispiel #3
0
        public int CheckPlayer(Player player)
        {
            int damage = 0;

            for (int x = 0; x < _attacks.Count; x++)
            {
                if (player.Collides(_attacks[x]) && player.ID != _attacks[x].parentID &&(_attacks[x].groupID==0 || _attacks[x].groupID!= player.GroupID) && !player.Invincible)
                {
                    _attacks[x].Hit();
                    damage += _attacks[x].Damage;
                    player.GetDamage(_attacks[x].Damage, _attacks[x].parentID);
                    if (_attacks[x].Knockback != Vector2.Zero)
                        player.Knockback(_attacks[x].Knockback);
                    if (_attacks[x].HitOnce)
                    {
                        Remove(x);
                        x--;
                    }
                }
            }
            return damage;
        }