void TributeCard::OnActionPhase( Engine* pEngine ) { Player* pPlayer = pEngine->GetCurrentPlayer(); Player* pPlayerToLeft = pEngine->GetNextPlayer( pPlayer ); CardList cardsDrawnList = pPlayerToLeft->RevealCardsFromDeck( 2 ); CardListIter cardIter; Card* pFirstCard = *cardIter; if( pFirstCard->IsActionCard() ) { pPlayer->PlusActions( 2 ); } if( pFirstCard->IsTreasureCard() ) { pPlayer->PlusCoins( 2 ); } if( pFirstCard->IsVictoryCard() ) { pPlayer->DrawCardsToHand( 2 ); } cardIter++; Card* pSecondCard = *cardIter; if( pSecondCard->CardId() != pFirstCard->CardId() ) { if( pSecondCard->IsActionCard() ) { pPlayer->PlusActions( 2 ); } if( pSecondCard->IsTreasureCard() ) { pPlayer->PlusCoins( 2 ); } if( pSecondCard->IsVictoryCard() ) { pPlayer->DrawCardsToHand( 2 ); } } }
void HerbalistCard::OnCleanUpPhase( Engine* pEngine ) { Player* pPlayer = pEngine->GetCurrentPlayer(); IAI* pAI = pPlayer->GetAI(); if( pPlayer->GetCardCountInDeckType( CARDTYPE::TREASURE ) > 0 ) { Card* pTreasureToPutBack = pAI->OnHerbalist(); if( pPlayer->IsCardInPlay( pTreasureToPutBack ) && pTreasureToPutBack->IsTreasureCard() ) { pPlayer->TakeCardFromInPlay( pTreasureToPutBack ); pPlayer->PutCardOnDraw( pTreasureToPutBack ); } else { // TODO: report error throw std::wstring( L"Error: HerbalistCard::OnCleanUpPhase" ); } } }