Esempio n. 1
0
 /// <summary>
 /// Controls ambush behaviour, where a creature tries to sneak up next to another to get a high damage special attack
 /// </summary>
 /// <param name="c"></param>
 public void ambush(Creature c)
 {
     if (isStealthy())
     {
         if (!c.canSee(this))
         {
             if (isAdjacent(c))
             {
                 c.damage((getStrength() / 2) + getStealthVal());
                 spotted();
             }
             else
             {
                 moveTowards(c);
             }
         }
         else
         {
             spotted();
         }
     }
     else
     {
         hide();
     }
 }