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