本文整理汇总了C++中cutpurseEffect函数的典型用法代码示例。如果您正苦于以下问题:C++ cutpurseEffect函数的具体用法?C++ cutpurseEffect怎么用?C++ cutpurseEffect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cutpurseEffect函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: cardEffect
//.........这里部分代码省略.........
if (DEBUG)
printf("Player %d reveals card number: %d\n", currentPlayer, state->hand[currentPlayer][choice1]);
//increase supply count for choosen card by amount being discarded
state->supplyCount[state->hand[currentPlayer][choice1]] += choice2;
//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);
}
}
//trash copies of cards returned to supply
for (j = 0; j < choice2; j++)
{
for (i = state->handCount[currentPlayer] - 1; i >= 0; i--)
{
if (state->hand[currentPlayer][i] == state->hand[currentPlayer][choice1])
{
discardCard(i, currentPlayer, state, 1);
break;
}
}
}
endPlayed(state, 0);
return 0;
case cutpurse:
return cutpurseEffect(currentPlayer, handPos, state, bonus);
case embargo:
if (choice1 < curse || choice1 > treasure_map)
return -1;
//see if selected pile is in play
if (state->supplyCount[choice1] == -1)
{
return -1;
}
playedCard(handPos, NULL, NULL, state);
//+2 Coins
*bonus += 2;
//add embargo token to selected supply pile
state->embargoTokens[choice1]++;
//trash card
endPlayed(state, 1);
return 0;
case outpost:
if (state->outpostTurn == 1)
return -1;
playedCard(handPos, NULL, NULL, state);
//set outpost flag
state->outpostPlayed = 1;
//we actually don't call endPlayed() here on purpose
return 0;
开发者ID:cs362sp16,项目名称:cs362sp16_berezam,代码行数:67,代码来源:mutant100384_dominion.c
示例2: cardEffect
//.........这里部分代码省略.........
printf("Player %d reveals card number: %d\n", currentPlayer, state->hand[currentPlayer][choice1]);
//increase supply count for choosen card by amount being discarded
state->supplyCount[state->hand[currentPlayer][choice1]] += choice2;
//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++){
开发者ID:CS362-Winter-2016,项目名称:cs362w16_chenj2,代码行数:67,代码来源:dominion.c
注:本文中的cutpurseEffect函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论