예제 #1
0
 private void OnAttack(EntityAttackEventArgs e)
 {
     foreach (EventListener el in Plugins)
     {
         if (el.Event == Event.ENTITY_ATTACK)
         {
             EntityListener l = el.Listener as EntityListener;
             l.OnAttack(e);
         }
     }
 }
예제 #2
0
파일: Player.cs 프로젝트: dekema2/c-raft
        public override void Attack(LivingEntity target)
        {
            if (target == null)
                return;
            short weaponDmg = GetWeaponDamage();

            //Start Event
            EntityAttackEventArgs e = new EntityAttackEventArgs(this, weaponDmg, target);
            Server.PluginManager.CallEvent(Event.EntityAttack, e);
            if(e.EventCanceled) return;
            target = (LivingEntity)e.EntityToAttack;
            weaponDmg = e.Damage;
            //End Event

            target.Damage(DamageCause.EntityAttack, weaponDmg, this);
        }
예제 #3
0
 public virtual void OnAttack(EntityAttackEventArgs e)
 {
 }