Example #1
0
 public Dracula()
 {
     EventHandSize = 4;
     EncounterHandSize = 5;
     EventHand = new List<EventCard>();
     EncounterHand = new List<EncounterTile>();
     Blood = 15;
     Trail = new DraculaCardSlot[6];
     Catacombs = new DraculaCardSlot[3];
 }
Example #2
0
 public void PlaceEncounterTileOnCard(EncounterTile encounterToPlace, DraculaCardSlot card)
 {
     if (encounterToPlace != null)
     {
         card.EncounterTiles.Add(encounterToPlace);
         EncounterHand.Remove(encounterToPlace);
     }
 }
Example #3
0
 public DraculaCardSlot MoveTo(Location destination, Power power, out int doubleBackSlot)
 {
     DraculaCardSlot doubleBackedCard = null;
     doubleBackSlot = -1;
     var catacombsSlot = 0;
     if (power == Power.DoubleBack)
     {
         for (var i = 0; i < 6; i++)
         {
             if (Trail[i] != null && Trail[i].DraculaCards.First().Location == destination)
             {
                 doubleBackSlot = i;
                 doubleBackedCard = Trail[i];
                 for (var j = i; j > 0; j--)
                 {
                     Trail[j] = Trail[j - 1];
                 }
                 Trail[0] = doubleBackedCard;
                 Trail[0].DraculaCards.Add(DraculaCardDeck.Find(card => card.Power == Power.DoubleBack));
                 DraculaCardDeck.Find(card => card.Power == Power.DoubleBack).IsRevealed = true;
                 CurrentLocation = destination;
                 return null;
             }
         }
         for (var i = 0; i < 3; i++)
         {
             if (Catacombs[i] != null && Catacombs[i].DraculaCards.First().Location == destination)
             {
                 doubleBackedCard = Catacombs[i];
                 catacombsSlot = i;
             }
         }
     }
     var cardSlotDroppedOffTrail = Trail[5];
     for (var i = 5; i > 0; i--)
     {
         Trail[i] = Trail[i - 1];
     }
     if (destination != Location.Nowhere)
     {
         CurrentLocation = destination;
         if (doubleBackedCard == null)
         {
             Trail[0] = new DraculaCardSlot(DraculaCardDeck.Find(card => card.Location == destination));
             if (destination == Location.CastleDracula)
             {
                 Trail[0].DraculaCards.First().IsRevealed = true;
             }
         }
         else
         {
             Trail[0] = doubleBackedCard;
             Catacombs[catacombsSlot] = null;
         }
     }
     else
     {
         Trail[0] = new DraculaCardSlot();
     }
     if (power != Power.None)
     {
         Trail[0].DraculaCards.Add(DraculaCardDeck.Find(card => card.Power == power));
         if (power != Power.Hide || CurrentLocation == Location.CastleDracula)
         {
             Trail[0].DraculaCards.Last().IsRevealed = true;
         }
     }
     if (power == Power.Hide)
     {
         LocationWhereHideWasUsed = CurrentLocation;
     }
     return cardSlotDroppedOffTrail;
 }
Example #4
0
        public void EscapeAsBat(GameState game, Location destination)
        {
            int currentLocationIndex = -1;
            for (int i = 0; i < 6; i++)
            {
                if (Trail[i].DraculaCards.First().Location == CurrentLocation)
                {
                    currentLocationIndex = i;
                    break;
                }
            }
            foreach (var card in Trail[currentLocationIndex].DraculaCards)
            {
                card.IsRevealed = false;
            }
            foreach (var enc in Trail[currentLocationIndex].EncounterTiles)
            {
                enc.IsRevealed = false;
                game.EncounterPool.Add(enc);
            }
            Trail[currentLocationIndex] = new DraculaCardSlot(DraculaCardDeck.Find(card => card.Location == destination));

            if (destination == Location.CastleDracula)
            {
                Trail[currentLocationIndex].DraculaCards.First().IsRevealed = true;
            }
            CurrentLocation = destination;
        }
Example #5
0
 public void DiscardEncounterTileFromCardSlot(EncounterTile encounterTileToDiscard,
     DraculaCardSlot draculaCardSlot, List<EncounterTile> encounterPool)
 {
     draculaCardSlot.EncounterTiles.Remove(encounterTileToDiscard);
     encounterPool.Add(encounterTileToDiscard);
 }
Example #6
0
 public int ChooseToPutDroppedOffCardInCatacombs(GameState game, DraculaCardSlot cardDroppedOffTrail)
 {
     if (cardDroppedOffTrail.DraculaCards.First().Location != Location.Nowhere &&
         game.Map.TypeOfLocation(cardDroppedOffTrail.DraculaCards.First().Location) != LocationType.Sea &&
         game.Map.TypeOfLocation(cardDroppedOffTrail.DraculaCards.First().Location) != LocationType.Castle)
     {
         if (cardDroppedOffTrail.EncounterTiles.Find(enc => enc.Encounter == Encounter.Ambush || enc.Encounter == Encounter.DesecratedSoil || enc.Encounter == Encounter.NewVampire) != null)
         {
             return -1;
         }
         if (new Random().Next(0, NumberOfPossibleCurrentLocations) < CATACOMBSCHANCE)
         {
             for (var i = 0; i < 3; i++)
             {
                 if (game.Dracula.Catacombs[i] == null)
                 {
                     return i;
                 }
             }
         }
     }
     return -1;
 }
Example #7
0
 public EncounterTile ChooseEncounterTileToPlaceOnDraculaCardSlot(GameState game, DraculaCardSlot slot)
 {
     if (game.Map.TypeOfLocation(slot.DraculaCards.First().Location) != LocationType.SmallCity &&
         game.Map.TypeOfLocation(slot.DraculaCards.First().Location) != LocationType.LargeCity &&
         (slot.DraculaCards.First().Power != Power.Hide || game.Dracula.CurrentLocation == Location.CastleDracula))
     {
         return null;
     }
     if (game.Dracula.EncounterHand.Find(enc => enc.Encounter == Encounter.NewVampire) != null)
     {
         if (NumberOfPossibleCurrentLocations > 3)
         {
             return game.Dracula.EncounterHand.Find(enc => enc.Encounter == Encounter.NewVampire);
         }
     }
     if (game.Dracula.EncounterHand.Find(enc => enc.Encounter == Encounter.Ambush) != null)
     {
         if (NumberOfPossibleCurrentLocations > 3)
         {
             return game.Dracula.EncounterHand.Find(enc => enc.Encounter == Encounter.Ambush);
         }
     }
     if (game.Dracula.EncounterHand.Find(enc => enc.Encounter == Encounter.DesecratedSoil) != null)
     {
         if (NumberOfPossibleCurrentLocations > 2)
         {
             return game.Dracula.EncounterHand.Find(enc => enc.Encounter == Encounter.DesecratedSoil);
         }
     }
     if (game.Dracula.EncounterHand.Find(enc => enc.Encounter == Encounter.Fog) != null)
     {
         if (NumberOfPossibleCurrentLocations < 4)
         {
             return game.Dracula.EncounterHand.Find(enc => enc.Encounter == Encounter.Fog);
         }
     }
     if (game.Dracula.EncounterHand.Find(enc => enc.Encounter == Encounter.Bats) != null)
     {
         if (NumberOfPossibleCurrentLocations < 4)
         {
             return game.Dracula.EncounterHand.Find(enc => enc.Encounter == Encounter.Bats);
         }
     }
     return game.Dracula.EncounterHand[new Random().Next(0, game.Dracula.EncounterHand.Count())];
 }