本文整理汇总了C#中Player.GainCard方法的典型用法代码示例。如果您正苦于以下问题:C# Player.GainCard方法的具体用法?C# Player.GainCard怎么用?C# Player.GainCard使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Player
的用法示例。
在下文中一共展示了Player.GainCard方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReactToAttack
public override bool ReactToAttack(GameModel gameModel, Player targetPlayer)
{
int choice = targetPlayer.Chooser.ChooseOneEffect(EffectChoiceType.DiscardBeggar, "You may discard Beggar to gain two Silvers", choices, choiceText);
if (choice == 0)
{
targetPlayer.DiscardCard(this);
targetPlayer.GainCard(typeof(Silver), GainLocation.TopOfDeck);
targetPlayer.GainCard(typeof(Silver));
}
return false;
}
示例2: OnTrash
public override void OnTrash(GameModel gameModel, Player owner)
{
int choice = owner.Chooser.ChooseOneEffect(EffectChoiceType.GainForHuntingGrounds, "Gain a Duchy or 3 Estates", choices, choices);
if (choice == 0)
{
owner.GainCard(typeof(Duchy));
}
else
{
for (int i = 0; i < 3; i++)
{
owner.GainCard(typeof(Estate));
}
}
}
示例3: OnTrash
public override void OnTrash(GameModel gameModel, Player owner)
{
Pile pile = owner.Chooser.ChooseOnePile(CardChoiceType.Gain, "Gain an Attack card", gameModel.SupplyPiles.Where(p => p.Count > 0 && p.Card.Is(CardType.Attack)));
if (pile != null)
{
owner.GainCard(pile);
}
}
示例4: OnTrash
public override void OnTrash(GameModel gameModel, Player owner)
{
IEnumerable<Pile> piles = gameModel.SupplyPiles.Where(p => (p.GetCost() < gameModel.GetCost(this) && (!p.CostsPotion || this.CostsPotion)) || p.GetCost() == gameModel.GetCost(this) && !p.CostsPotion && this.CostsPotion);
if(piles.Any())
{
Pile choice = owner.Chooser.ChooseOnePile(CardChoiceType.Gain, "Gain a card costing less than $" + gameModel.GetCost(this), piles);
owner.GainCard(choice);
}
}
示例5: OnTrash
public override void OnTrash(GameModel gameModel, Player owner)
{
owner.GainCard(typeof(Gold));
}
示例6: OnGain
public override void OnGain(GameModel gameModel, Player player)
{
player.GainCard(gameModel.Ruins);
player.GainCard(gameModel.Ruins);
}
示例7: OnGain
public override void OnGain(GameModel gameModel, Player player)
{
Pile pile = gameModel.SupplyPiles.FirstOrDefault(p => p.Card is Duchess);
if (pile != null && pile.Count > 0)
{
int choice = player.Chooser.ChooseOneEffect(EffectChoiceType.GainDuchess, "Do you want to gain a duchess?", choices, choices);
if (choice == 0)
{
player.GainCard(pile);
}
}
}