示例#1
0
 public void handleActorAttack(DamageInfo damageInfo)
 {
     if (this.hitBox.Intersects(damageInfo.attackRect))
     {
             damageInfo.attacker.onHitActor();
             this.velocity += damageInfo.attacker.sightVector * 20;
             this.onHurt(damageInfo);
             if (this.health <= 0)
             {
                 this.onKill(damageInfo);
             }
     }
 }
示例#2
0
 public void onKill(DamageInfo damageInfo)
 {
     Death(this, EventArgs.Empty);
 }
示例#3
0
 public void onHurt(DamageInfo damageInfo)
 {
     AttackEventArgs attackEventArgs = new AttackEventArgs(damageInfo);
     health -= damageInfo.damage;
     Hurt(this, attackEventArgs);
 }
示例#4
0
 public void onAttack(DamageInfo damageInfo)
 {
     AttackEventArgs attackEventArgs = new AttackEventArgs(damageInfo);
     Attack(this, attackEventArgs);
 }
 public AttackEventArgs(DamageInfo damageInfo):base()
 {
     this.damageInfo = damageInfo;
 }
示例#6
0
 public void onKill(DamageInfo damageInfo)
 {
     Actor.DamagedPoint -= new EventHandler<AttackEventArgs>(Actor_Attacked);
     Death(this, EventArgs.Empty);
 }
示例#7
0
 public void onAttack(DamageInfo damageInfo)
 {
     AttackEventArgs attackEventArgs = new AttackEventArgs(damageInfo);
     debugSquares.AddRange(attackEventArgs.damageInfo.attackRects);
     DamagedPoint(this, attackEventArgs);
 }
示例#8
0
 public void onKill(DamageInfo damageInfo)
 {
     Actor.DamagedPoint -= new EventHandler <AttackEventArgs>(Actor_Attacked);
     Death(this, EventArgs.Empty);
 }