Ejemplo n.º 1
0
 public void TakeCasualty(Companion c)
 {
     if (c is Gandalf)
     {
         GandalfDeadTheFirstTime = true;
     }
     Fellowship = Fellowship.RemoveCompanion(c);
 }
Ejemplo n.º 2
0
 public Fellowship RemoveCompanion(Companion casualty)
 {
     if (casualty.IsRemovable())
     {
         if (Companions.Length == 1)
         {
             Companion[] gollums = { new Gollum() };
             return(new Fellowship(gollums));
         }
         else
         {
             return(new Fellowship(Companions.Where(companion => companion != casualty).ToArray()));
         }
     }
     else
     {
         return(this);
     }
 }
Ejemplo n.º 3
0
 public void ResolveTileWithCasualty(Companion companion, int tileValue, bool reveal, Tile tile)
 {
     if (tileValue > 0)
     {
         int damage = Math.Max(0, tileValue - companion.Level());
         // more companion separation here.
         Corruption += damage;
         if (companion.IsRemovable())
         {
             Log.Log($"    {companion} falls to {tileValue} damage");
             TakeCasualty(companion);
         }
     }
     else
     {
         Corruption = Math.Max(0, Corruption + tileValue); // heal from hunt tiles
         if (tileValue < 0)
         {
             Log.Log($"    Frodo heals to {Corruption} corruption");
         }
     }
     Revealed = Revealed || reveal;
 }