Skip to content

Fix baseline bots, handle Saint Alessia deck for them #90

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions Bots/src/CardTierList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,22 +150,30 @@ public class CardTierList
new CardTier("Writ of Coin", PatronId.TREASURY, TierEnum.D),
new CardTier("Unknown", PatronId.TREASURY, TierEnum.UNKNOWN),
// Added Saint Alessia
new CardTier("Alessian Rebel", PatronId.SAINT_ALESSIA, TierEnum.C),
new CardTier("Ayleid Defector", PatronId.SAINT_ALESSIA, TierEnum.B),
new CardTier("Ayleid Quartermaster", PatronId.SAINT_ALESSIA, TierEnum.B),
new CardTier("Alessian Rebel", PatronId.SAINT_ALESSIA, TierEnum.D),
new CardTier("Ayleid Defector", PatronId.SAINT_ALESSIA, TierEnum.A),
new CardTier("Ayleid Quartermaster", PatronId.SAINT_ALESSIA, TierEnum.A),
new CardTier("Chainbreaker Captain", PatronId.SAINT_ALESSIA, TierEnum.A),
new CardTier("Chainbreaker Sergeant", PatronId.SAINT_ALESSIA, TierEnum.B),
new CardTier("Morihuas Sacred Bull", PatronId.SAINT_ALESSIA, TierEnum.S),
new CardTier("Morihuas the Archer", PatronId.SAINT_ALESSIA, TierEnum.A),
new CardTier("Morihaus, Sacred Bull", PatronId.SAINT_ALESSIA, TierEnum.S),
new CardTier("Morihaus, the Archer", PatronId.SAINT_ALESSIA, TierEnum.A),
new CardTier("Pelinal Whitestrake", PatronId.SAINT_ALESSIA, TierEnum.S),
new CardTier("Priestess of the Eight", PatronId.SAINT_ALESSIA, TierEnum.B),
new CardTier("Saints Wrath", PatronId.SAINT_ALESSIA, TierEnum.B),
new CardTier("Saint's Wrath", PatronId.SAINT_ALESSIA, TierEnum.B),
new CardTier("Soldier of the Empire", PatronId.SAINT_ALESSIA, TierEnum.C),
new CardTier("Whitestrake Ascendant", PatronId.SAINT_ALESSIA, TierEnum.S),
};

public static TierEnum GetCardTier(string cardName)
{
return Array.Find(CardTierArray, x => x.Name == cardName).Tier;
try
{
return Array.Find(CardTierArray, x => x.Name == cardName).Tier;
}
catch
{
return TierEnum.UNKNOWN;
}

}
}
19 changes: 15 additions & 4 deletions Bots/src/DecisionTreeBot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,10 @@ private int CoinNeed(GameState gameState)

private UniqueCard PlayCard()
{
if (!sortedByPatronCardsInHand.ContainsKey(deckInPlay))
{
throw new Exception($"deckInPlay = {deckInPlay} not found in sortedByPatronCardsInHand!");
}
if (sortedByPatronCardsInHand[deckInPlay].LeftToPlay <= 0)
{
for (int i = 0; i < 5; i++)
Expand Down Expand Up @@ -895,13 +899,13 @@ public override Move Play(GameState gameState, List<Move> possibleMoves, TimeSpa
if (startOfTurn)
{
startOfTurn = false;
if (gameState.Patrons.Contains(PatronId.PSIJIC))
if (gameState.Patrons.Contains(PatronId.PELIN))
{
deckInPlay = PatronId.PSIJIC;
deckInPlay = PatronId.PELIN;
}
else
{
deckInPlay = PatronId.TREASURY;
deckInPlay = gameState.Patrons[0];
}
coinsNeed = 0;
powerNeed = 0;
Expand Down Expand Up @@ -931,7 +935,14 @@ public override Move Play(GameState gameState, List<Move> possibleMoves, TimeSpa

if (playCardMoves.Count > 0)
{
chosenCard = PlayCard();
try
{
chosenCard = PlayCard();
}
catch
{
return Move.EndTurn();
}
if ((chosenCard.Type == CardType.AGENT || chosenCard.Type == CardType.CONTRACT_AGENT) && gameState.CurrentPlayer.Agents.Any(x => x.RepresentingCard.UniqueId == chosenCard.UniqueId))
{
return Move.ActivateAgent(chosenCard);
Expand Down
Loading