本文整理汇总了C++中embargoEffect函数的典型用法代码示例。如果您正苦于以下问题:C++ embargoEffect函数的具体用法?C++ embargoEffect怎么用?C++ embargoEffect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了embargoEffect函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: cardEffect
//.........这里部分代码省略.........
//each other player gains a copy of revealed card
for (i = 0; i < state->numPlayers; i++)
{
if (i != currentPlayer)
{
gainCard(state->hand[currentPlayer][choice1], state, 0, i);
}
}
//discard played card from hand
discardCard(handPos, currentPlayer, state, 0);
//trash copies of cards returned to supply
for (j = 0; j < choice2; j++)
{
for (i = 0; i < state->handCount[currentPlayer]; i++)
{
if (state->hand[currentPlayer][i] == state->hand[currentPlayer][choice1])
{
discardCard(i, currentPlayer, state, 1);
break;
}
}
}
return 0;
case cutpurse:
cutpurseEffect(currentPlayer, state, handPos);
return 0;
case embargo:
return embargoEffect(state, choice1, handPos, currentPlayer);
case outpost:
//set outpost flag
state->outpostPlayed++;
//discard card
discardCard(handPos, currentPlayer, state, 0);
return 0;
case salvager:
//+1 buy
state->numBuys++;
if (choice1)
{
//gain coins equal to trashed card
state->coins = state->coins + getCost( handCard(choice1, state) );
//trash card
discardCard(choice1, currentPlayer, state, 1);
}
//discard card
discardCard(handPos, currentPlayer, state, 0);
return 0;
case sea_hag:
for (i = 0; i < state->numPlayers; i++){
if (i != currentPlayer){
state->discard[i][state->discardCount[i]] = state->deck[i][state->deckCount[i]--]; state->deckCount[i]--;
state->discardCount[i]++;
state->deck[i][state->deckCount[i]--] = curse;//Top card now a curse
}
示例2: cardEffect
//.........这里部分代码省略.........
for (i = 0; i < state->numPlayers; i++)
{
if (i != currentPlayer)
{
for (j = 0; j < state->handCount[i]; j++)
{
if (state->hand[i][j] == copper)
{
discardCard(j, i, state, 0);
break;
}
if (j == state->handCount[i])
{
for (k = 0; k < state->handCount[i]; k++)
{
if (DEBUG)
printf("Player %d reveals card number %d\n", i, state->hand[i][k]);
}
break;
}
}
}
}
//discard played card from hand
discardCard(handPos, currentPlayer, state, 0);
return 0;
case embargo:
return embargoEffect(state, handPos, choice1);
case outpost:
//set outpost flag
state->outpostPlayed++;
//discard card
discardCard(handPos, state->whoseTurn, state, 0);
return 0;
case salvager:
//+1 buy
state->numBuys++;
if (choice1)
{
//gain coins equal to trashed card
state->coins = state->coins + getCost( handCard(choice1, state) );
//trash card
discardCard(choice1, currentPlayer, state, 1);
}
//discard card
discardCard(handPos, currentPlayer, state, 0);
return 0;
case sea_hag:
for (i = 0; i < state->numPlayers; i++) {
if (i != currentPlayer) {
state->discard[i][state->discardCount[i]] = state->deck[i][state->deckCount[i]--]; state->deckCount[i]--;
state->discardCount[i]++;
state->deck[i][state->deckCount[i]--] = curse;//Top card now a curse
}
示例3: cardEffect
//.........这里部分代码省略.........
discardCard(handPos, currentPlayer, state, 0);
//trash copies of cards returned to supply
for (j = 0; j < choice2; j++)
{
for (i = 0; i < state->handCount[currentPlayer]; i++)
{
if (state->hand[currentPlayer][i]
== state->hand[currentPlayer][choice1])
{
discardCard(i, currentPlayer, state, 1);
break;
}
}
}
return 0;
case cutpurse:
updateCoins(currentPlayer, state, 2);
for (i = 0; i < state->numPlayers; i++)
{
if (i != currentPlayer)
{
for (j = 0; j < state->handCount[i]; j++)
{
if (state->hand[i][j] == copper)
{
discardCard(j, i, state, 0);
break;
}
if (j == state->handCount[i])
{
for (k = 0; k < state->handCount[i]; k++)
{
if (DEBUG)
printf("Player %d reveals card number %d\n",
i, state->hand[i][k]);
}
break;
}
}
}
}
//discard played card from hand
discardCard(handPos, currentPlayer, state, 0);
return 0;
case embargo:
return embargoEffect(currentPlayer, choice1, state, handPos);
case outpost:
//set outpost flag
state->outpostPlayed++;
//discard card
discardCard(handPos, currentPlayer, state, 0);
return 0;
case salvager:
//+1 buy
state->numBuys++;
if (choice1)
{
//gain coins equal to trashed card
state->coins = state->coins + getCost(handCard(choice1, state));
//trash card
discardCard(choice1, currentPlayer, state, 1);
}
//discard card
discardCard(handPos, currentPlayer, state, 0);
return 0;
case sea_hag:
for (i = 0; i < state->numPlayers; i++)
{
if (i != currentPlayer)
{
state->discard[i][state->discardCount[i]] =
state->deck[i][state->deckCount[i]--];
state->deckCount[i]--;
state->discardCount[i]++;
state->deck[i][state->deckCount[i]--] = curse;//Top card now a curse
}
}
return 0;
case treasure_map:
return treasure_mapEffect(currentPlayer, state, handPos);
} // End Switch
return -1;
} // End Function