/// <summary>
 /// Try to attack our enemy target.
 /// </summary>
 protected virtual void AttackEnemy()
 {
     // First check that we can attack.
     if (CanAttack())
     {
         m_enemyTarget.TakeDamage(this,
                                  m_attackDamage.GetValue()
                                  );
     }
 }
Example #2
0
 protected virtual void Hit()
 {
     // If we still have a valid target, damage it.
     if (m_intendedTarget != null &&
         !m_intendedTarget.IsDead())
     {
         // Inflict it random damage.
         m_intendedTarget.TakeDamage(this,
                                     m_attackDamage.GetValue());
     }
     Die();
 }