From 9c0ce5f7bf37ca78f66d6cb79985925ac67bd5a7 Mon Sep 17 00:00:00 2001 From: "omegablast2002@yahoo.com" Date: Fri, 15 Mar 2013 02:08:03 +0000 Subject: [PATCH] more changes to fix the combo system. --- projects/mtg/src/AIHints.cpp | 2 +- projects/mtg/src/AIPlayerBaka.cpp | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/projects/mtg/src/AIHints.cpp b/projects/mtg/src/AIHints.cpp index 66a355b70..d1f4aa25e 100644 --- a/projects/mtg/src/AIHints.cpp +++ b/projects/mtg/src/AIHints.cpp @@ -160,7 +160,7 @@ bool AIHints::HintSaysItsForCombo(GameObserver* observer,MTGCardInstance * card) for(unsigned int hPart = 0; hPart < hints[i]->hold.size(); hPart++) { hintTc = tfc.createTargetChooser(hints[i]->hold[hPart],card); - if(hintTc && hintTc->canTarget(card,true) && hintTc->countValidTargets() <= hintTc->maxtargets) + if(hintTc && hintTc->canTarget(card,true)) { forCombo = true; } diff --git a/projects/mtg/src/AIPlayerBaka.cpp b/projects/mtg/src/AIPlayerBaka.cpp index 4fbdc9221..32886f4e6 100644 --- a/projects/mtg/src/AIPlayerBaka.cpp +++ b/projects/mtg/src/AIPlayerBaka.cpp @@ -1846,8 +1846,15 @@ MTGCardInstance * AIPlayerBaka::FindCardToPlay(ManaCost * pMana, const char * ty { if(!pMana->canAfford(nextCardToPlay->getManaCost()) || nextCardToPlay->getManaCost()->kicker) gotPayments = canPayMana(nextCardToPlay,nextCardToPlay->getManaCost()); - DebugTrace(" AI wants to play card." << endl + DebugTrace(" AI wants to play card." << endl << "- Next card to play: " << (nextCardToPlay ? nextCardToPlay->name : "None" ) << endl ); + + if(hints && hints->HintSaysItsForCombo(observer,nextCardToPlay)) + { + DebugTrace(" AI wants to play a card that belongs to a combo.") + nextCardToPlay = NULL; + } + } return nextCardToPlay; }