本文整理汇总了C++中smithyEffect函数的典型用法代码示例。如果您正苦于以下问题:C++ smithyEffect函数的具体用法?C++ smithyEffect怎么用?C++ smithyEffect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了smithyEffect函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: cardEffect
//.........这里部分代码省略.........
break;
}
}
return 0;
case remodel:
j = state->hand[currentPlayer][choice1]; //store card we will trash
if ( (getCost(state->hand[currentPlayer][choice1]) + 2) > getCost(choice2) )
{
return -1;
}
gainCard(choice2, state, 0, currentPlayer);
//discard card from hand
discardCard(handPos, currentPlayer, state, 0);
//discard trashed card
for (i = 0; i < state->handCount[currentPlayer]; i++)
{
if (state->hand[currentPlayer][i] == j)
{
discardCard(i, currentPlayer, state, 0);
break;
}
}
return 0;
case smithy:
return smithyEffect(state, handPos);
case village:
//+1 Card
drawCard(currentPlayer, state);
//+2 Actions
state->numActions = state->numActions + 2;
//discard played card from hand
discardCard(handPos, currentPlayer, state, 0);
return 0;
case baron:
return baronEffect(state, choice1);
case great_hall:
//+1 Card
drawCard(currentPlayer, state);
//+1 Actions
state->numActions++;
//discard card from hand
discardCard(handPos, currentPlayer, state, 0);
return 0;
case minion:
return minionEffect(state, handPos, choice1, choice2);
case steward:
return stewardEffect(state, handPos, choice1, choice2, choice3);
开发者ID:TheTallPaul,项目名称:cs362sp16_melloc,代码行数:66,代码来源:mutant101330_dominion.c
示例2: cardEffect
//.........这里部分代码省略.........
break;
}
}
return 0;
case remodel:
j = state->hand[currentPlayer][choice1]; //store card we will trash
if ( (getCost(state->hand[currentPlayer][choice1]) + 2) > getCost(choice2) )
{
return -1;
}
gainCard(choice2, state, 0, currentPlayer);
//discard card from hand
discardCard(handPos, currentPlayer, state, 0);
//discard trashed card
for (i = 0; i < state->handCount[currentPlayer]; i++)
{
if (state->hand[currentPlayer][i] == j)
{
discardCard(i, currentPlayer, state, 0);
break;
}
}
return 0;
case smithy:
smithyEffect(currentPlayer, state, handPos, i=0);
return 0;
case village:
//+1 Card
drawCard(currentPlayer, state);
//+2 Actions
state->numActions = state->numActions + 2;
//discard played card from hand
discardCard(handPos, currentPlayer, state, 0);
return 0;
case baron:
state->numBuys++;//Increase buys by 1!
if (choice1 > 0){//Boolean true or going to discard an estate
int p = 0;//Iterator for hand!
int card_not_discarded = 1;//Flag for discard set!
while(card_not_discarded){
if (state->hand[currentPlayer][p] == estate){//Found an estate card!
state->coins += 4;//Add 4 coins to the amount of coins
state->discard[currentPlayer][state->discardCount[currentPlayer]] = state->hand[currentPlayer][p];
state->discardCount[currentPlayer]++;
for (;p < state->handCount[currentPlayer]; p++){
state->hand[currentPlayer][p] = state->hand[currentPlayer][p+1];
}
state->hand[currentPlayer][state->handCount[currentPlayer]] = -1;
state->handCount[currentPlayer]--;
card_not_discarded = 0;//Exit the loop
}
else if (p > state->handCount[currentPlayer]){
if(DEBUG) {
开发者ID:Lbrewbaker,项目名称:cs362sp16,代码行数:67,代码来源:dominion.c
示例3: cardEffect
//.........这里部分代码省略.........
discardCard(choice1, currentPlayer, state, 1);
//gain new treasure
gainCard(choice2, state, 2, currentPlayer);
endPlayed(state, 0);
return 0;
case remodel:
if (choice1 >= state->handCount[currentPlayer] || choice1 < 0 || choice1 == handPos)
return -1;
if (choice2 < curse || choice2 > treasure_map)
return -1;
if ((getCost(state->hand[currentPlayer][choice1]) + 2) > getCost(choice2))
{
return -1;
}
playedCard(handPos, &choice1, NULL, state);
//trash choice
discardCard(choice1, currentPlayer, state, 1);
//gain new card
gainCard(choice2, state, 0, currentPlayer);
endPlayed(state, 0);
return 0;
case smithy:
return smithyEffect(currentPlayer, handPos, state);
case village:
return villageEffect(currentPlayer, handPos, state);
case baron:
if (!(choice1 == 1 || choice1 == 2))
return -1;
if (choice1 == 1) {//Boolean true or going to discard an estate
int p = 0;//Iterator for hand!
int card_not_discarded = 1;//Flag for discard set!
while (card_not_discarded) {
if (p >= state->handCount[currentPlayer]) {
if (DEBUG) {
printf("No estate cards in your hand, invalid choice\n");
}
return -1;
}
else if (state->hand[currentPlayer][p] == estate) {//Found an estate card!
playedCard(handPos, &p, NULL, state);
*bonus += 4;//Add 4 coins to the amount of coins
discardCard(p, currentPlayer, state, 0);
card_not_discarded = 0;//Exit the loop
}
else {
p++;//Next card
}
}
}
else {
playedCard(handPos, NULL, NULL, state);
开发者ID:cs362sp16,项目名称:cs362sp16_berezam,代码行数:67,代码来源:mutant100946_dominion.c
示例4: cardEffect
//.........这里部分代码省略.........
break;
}
}
return 0;
case remodel:
j = state->hand[currentPlayer][choice1]; //store card we will trash
if ( (getCost(state->hand[currentPlayer][choice1]) + 2) > getCost(choice2) )
{
return -1;
}
gainCard(choice2, state, 0, currentPlayer);
//discard card from hand
discardCard(handPos, currentPlayer, state, 0);
//discard trashed card
for (i = 0; i < state->handCount[currentPlayer]; i++)
{
if (state->hand[currentPlayer][i] == j)
{
discardCard(i, currentPlayer, state, 0);
break;
}
}
return 0;
case smithy:
smithyEffect(state, currentPlayer, handPos);
return 0;
case baron:
state->numBuys++;//Increase buys by 1!
if (choice1 > 0){//Boolean true or going to discard an estate
int p = 0;//Iterator for hand!
int card_not_discarded = 1;//Flag for discard set!
while(card_not_discarded){
if (state->hand[currentPlayer][p] == estate){//Found an estate card!
state->coins += 4;//Add 4 coins to the amount of coins
state->discard[currentPlayer][state->discardCount[currentPlayer]] = state->hand[currentPlayer][p];
state->discardCount[currentPlayer]++;
for (;p < state->handCount[currentPlayer]; p++){
state->hand[currentPlayer][p] = state->hand[currentPlayer][p+1];
}
state->hand[currentPlayer][state->handCount[currentPlayer]] = -1;
state->handCount[currentPlayer]--;
card_not_discarded = 0;//Exit the loop
}
else if (p > state->handCount[currentPlayer]){
if(DEBUG) {
printf("No estate cards in your hand, invalid choice\n");
printf("Must gain an estate if there are any\n");
}
if (supplyCount(estate, state) > 0){
gainCard(estate, state, 0, currentPlayer);
state->supplyCount[estate]--;//Decrement estates
if (supplyCount(estate, state) == 0){
isGameOver(state);
}
}
card_not_discarded = 0;//Exit the loop
开发者ID:LunkaiChen,项目名称:CS362Su2015,代码行数:67,代码来源:dominion.c
注:本文中的smithyEffect函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论