当前位置: 首页>>代码示例>>C++>>正文


C++ embargoEffect函数代码示例

本文整理汇总了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
	}
开发者ID:CS362-Winter-2016,项目名称:cs362w16_chenj2,代码行数:67,代码来源:dominion.c

示例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
                        }
开发者ID:TheTallPaul,项目名称:cs362sp16_melloc,代码行数:67,代码来源:mutant100502_dominion.c

示例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
开发者ID:cs362sp15,项目名称:projects,代码行数:101,代码来源:dominion_their.c


注:本文中的embargoEffect函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。