예제 #1
0
파일: Quest.cs 프로젝트: dcmorse/phial
 public void TakeCasualty(Companion c)
 {
     if (c is Gandalf)
     {
         GandalfDeadTheFirstTime = true;
     }
     Fellowship = Fellowship.RemoveCompanion(c);
 }
예제 #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);
     }
 }
예제 #3
0
파일: Quest.cs 프로젝트: dcmorse/phial
 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;
 }