private void Actor_Hurt(object sender, AttackEventArgs e)
 {
     Actor hurtActor = (Actor)sender;
     if (healthBars.ContainsKey(hurtActor))
     {
     }
     else
     {
         if (hurtActor.className == "player")
             healthBars[hurtActor] = new HealthBar(hurtActor, guiTextures["healthBar"]);
         else
             healthBars[hurtActor] = new HealthBar(hurtActor, guiTextures["enemyHealthBar"]);
     }
     
 }
 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 void Actor_Attack(Object sender, AttackEventArgs attackEventArgs)
 {
     Actor attacker = (Actor) sender;
     if (sender.Equals(this))
         return;
     else
         handleActorAttack(attackEventArgs.damageInfo);
 }
Exemple #5
0
 public void onAttack(DamageInfo damageInfo)
 {
     AttackEventArgs attackEventArgs = new AttackEventArgs(damageInfo);
     debugSquares.AddRange(attackEventArgs.damageInfo.attackRects);
     DamagedPoint(this, attackEventArgs);
 }
Exemple #6
0
        public void Actor_Attacked(Object sender, AttackEventArgs attackEventArgs)
        {
            DamageInfo damageInfo = attackEventArgs.damageInfo;
            Actor attacker = (Actor) sender;

            if (this.id != attacker.id)
            {
                if (this.className != "player" && attacker.className == "player")
                    handleActorAttack(attackEventArgs.damageInfo);
                else if (this.className == "player" && attacker.className != "player")
                    handleActorAttack(attackEventArgs.damageInfo);
            }
                
        }
 public void Actor_Attacked(Object sender, AttackEventArgs attackEventArgs)
 {
     DamageInfo damageInfo = attackEventArgs.damageInfo;
     Actor attacker = (Actor) sender;
     if (this.id != attacker.id)
         handleActorAttack(attackEventArgs.damageInfo);
 }