本文整理汇总了C#中Dominion.PlayerState.AttackOtherPlayers方法的典型用法代码示例。如果您正苦于以下问题:C# PlayerState.AttackOtherPlayers方法的具体用法?C# PlayerState.AttackOtherPlayers怎么用?C# PlayerState.AttackOtherPlayers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dominion.PlayerState
的用法示例。
在下文中一共展示了PlayerState.AttackOtherPlayers方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DoSpecializedAction
public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
{
Card revealedCard = currentPlayer.RequestPlayerRevealCardFromHand(acceptableCard => true, gameState);
PlayerState.AttackAction attackAction = this.DoEmptyAttack;
if (revealedCard != null && !revealedCard.isShelter)
{
int maxReturnCount = Math.Max(currentPlayer.Hand.CountOf(revealedCard), 2);
int returnCount = currentPlayer.actions.GetCountToReturnToSupply(revealedCard, gameState);
returnCount = Math.Min(returnCount, maxReturnCount);
returnCount = Math.Max(returnCount, 0);
for (int i = 0; i < returnCount; ++i)
{
if (currentPlayer.hand.HasCard(revealedCard))
{
currentPlayer.ReturnCardFromHandToSupply(revealedCard, gameState);
}
}
attackAction = delegate(PlayerState currentPlayer2, PlayerState otherPlayer, GameState gameState2)
{
otherPlayer.GainCardFromSupply(gameState, revealedCard);
};
}
currentPlayer.AttackOtherPlayers(gameState, attackAction);
}
示例2: DoSpecializedAction
public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
{
PlayerActionChoice choice = currentPlayer.RequestPlayerChooseBetween(gameState,
acceptableChoice =>
acceptableChoice == PlayerActionChoice.PlusCoin ||
acceptableChoice == PlayerActionChoice.Trash);
PlayerState.AttackAction attackAction = this.DoEmptyAttack;
bool wasACardTrashed = false;
if (choice == PlayerActionChoice.PlusCoin)
{
currentPlayer.AddCoins(currentPlayer.pirateShipTokenCount);
}
else if (choice == PlayerActionChoice.Trash)
{
throw new NotImplementedException();
}
currentPlayer.AttackOtherPlayers(gameState, attackAction);
if (wasACardTrashed)
{
currentPlayer.pirateShipTokenCount++;
}
}
示例3: DoSpecializedAction
public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
{
Card trashedCard = currentPlayer.RequestPlayerTrashCardFromHand(gameState, acceptableCard => acceptableCard.isTreasure, isOptional: true);
PlayerState.AttackAction attackAction = this.DoEmptyAttack;
if (trashedCard != null)
{
attackAction = delegate(PlayerState currentPlayer2, PlayerState otherPlayer, GameState gameState2)
{
if (otherPlayer.Hand.Count >= 5)
{
otherPlayer.DiscardCardFromHand(gameState, trashedCard);
}
};
currentPlayer.RequestPlayerGainCardFromSupply(gameState,
acceptableCard => acceptableCard.isTreasure &&
acceptableCard.CurrentCoinCost(currentPlayer) <= trashedCard.CurrentCoinCost(currentPlayer) + 3 &&
acceptableCard.potionCost == 0,
"Gain a card costing up to 3 more than the trashed card",
isOptional: false,
defaultLocation: DeckPlacement.TopOfDeck);
}
currentPlayer.AttackOtherPlayers(gameState, attackAction);
}
示例4: DoSpecializedAction
public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
{
// Choose one: ...
PlayerActionChoice actionChoice = currentPlayer.RequestPlayerChooseBetween(
gameState,
acceptableChoice => acceptableChoice == PlayerActionChoice.Discard || acceptableChoice == PlayerActionChoice.PlusCoin);
PlayerState.AttackAction attackAction = this.DoEmptyAttack;
if (actionChoice == PlayerActionChoice.PlusCoin)
{
// +2 coin;
currentPlayer.AddCoins(2);
}
else
{
// discard your hand,
currentPlayer.DiscardHand(gameState);
// +4 cards
currentPlayer.DrawAdditionalCardsIntoHand(4);
attackAction = this.DoSpecializedAttackInternal;
}
currentPlayer.AttackOtherPlayers(gameState, attackAction);
}
示例5: DoSpecializedAction
public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
{
currentPlayer.MoveCardFromPlayToTrash(gameState);
PlayerState.AttackAction attackAction = delegate(PlayerState currentPlayer2, PlayerState otherPlayer, GameState gameState2)
{
if (otherPlayer.Hand.Count >= 5)
{
// TODO: make other player discard a good card
otherPlayer.RequestPlayerDiscardCardFromOtherPlayersHand(gameState, otherPlayer);
}
};
currentPlayer.AttackOtherPlayers(gameState, attackAction);
currentPlayer.GainCardsFromSupply(gameState, Cards.Spoils, 2);
}
示例6: DoSpecializedAction
public override void DoSpecializedAction(PlayerState currentPlayer, GameState gameState)
{
PlayerState.AttackAction attackAction = this.DoEmptyAttack;
CardPredicate acceptableCard = card => Card.DoesCardCost3To6(card, currentPlayer);
if (gameState.trash.AnyWhere(acceptableCard))
{
currentPlayer.RequestPlayerGainCardFromTrash(gameState, acceptableCard, "Card from 3 to 6");
}
else
{
attackAction = Rogue.AttackAction;
}
currentPlayer.AttackOtherPlayers(gameState, attackAction);
}