• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ embargoEffect函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ emit函数代码示例发布时间:2022-05-30
下一篇:
C++ embPattern_addStitchRel函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap