Esempio n. 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);
             }
     }
 }
Esempio n. 2
0
 public void onKill(DamageInfo damageInfo)
 {
     Death(this, EventArgs.Empty);
 }
Esempio n. 3
0
 public void onHurt(DamageInfo damageInfo)
 {
     AttackEventArgs attackEventArgs = new AttackEventArgs(damageInfo);
     health -= damageInfo.damage;
     Hurt(this, attackEventArgs);
 }
Esempio n. 4
0
 public void onAttack(DamageInfo damageInfo)
 {
     AttackEventArgs attackEventArgs = new AttackEventArgs(damageInfo);
     Attack(this, attackEventArgs);
 }
 public AttackEventArgs(DamageInfo damageInfo):base()
 {
     this.damageInfo = damageInfo;
 }
Esempio n. 6
0
 public void onKill(DamageInfo damageInfo)
 {
     Actor.DamagedPoint -= new EventHandler<AttackEventArgs>(Actor_Attacked);
     Death(this, EventArgs.Empty);
 }
Esempio n. 7
0
 public void onAttack(DamageInfo damageInfo)
 {
     AttackEventArgs attackEventArgs = new AttackEventArgs(damageInfo);
     debugSquares.AddRange(attackEventArgs.damageInfo.attackRects);
     DamagedPoint(this, attackEventArgs);
 }
Esempio n. 8
0
 public void onKill(DamageInfo damageInfo)
 {
     Actor.DamagedPoint -= new EventHandler <AttackEventArgs>(Actor_Attacked);
     Death(this, EventArgs.Empty);
 }