本文整理汇总了C#中IGame.TriggerEffect方法的典型用法代码示例。如果您正苦于以下问题:C# IGame.TriggerEffect方法的具体用法?C# IGame.TriggerEffect怎么用?C# IGame.TriggerEffect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IGame
的用法示例。
在下文中一共展示了IGame.TriggerEffect方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Trigger
public override void Trigger(IGame game, IEffectHandle handle)
{
var defeatedEnemies = new List<IEnemyInPlay>();
foreach (var enemy in game.StagingArea.CardsInStagingArea.OfType<IEnemyInPlay>())
{
if (enemy.Damage >= enemy.Card.PrintedHitPoints)
{
defeatedEnemies.Add(enemy);
}
}
foreach (var player in game.Players)
{
foreach (var enemy in player.EngagedEnemies)
{
if (enemy.Damage >= enemy.Card.PrintedHitPoints)
{
defeatedEnemies.Add(enemy);
}
}
}
foreach (var enemy in defeatedEnemies)
{
var defeatedEffect = new EnemyDefeatedEffect(game, enemy, attackers);
var defeatedHandle = defeatedEffect.GetHandle(game);
game.AddEffect(defeatedEffect);
game.TriggerEffect(defeatedHandle);
}
handle.Resolve(GetCompletedStatus());
}
示例2: TriggerResponse
private void TriggerResponse(IGame game, IEffectHandle handle)
{
var responseHandle = responseEffect.GetHandle(game);
game.TriggerEffect(responseHandle);
handle.Resolve(string.Format("{0} decided to trigger '{1}'", player.Name, responseEffect));
}
示例3: AfterCostPaid
protected override void AfterCostPaid(IGame game, IEffectHandle handle, IEnumerable<Tuple<ICharacterInPlay, byte>> charactersAndPayments)
{
var eventEffect = eventCard.Text.Effects.First();
var eventHandle = eventEffect.GetHandle(game);
player.Hand.RemoveCards(new List<IPlayerCard> { eventCard });
game.AddEffect(eventEffect);
game.TriggerEffect(eventHandle);
}
示例4: Trigger
public override void Trigger(IGame game, IEffectHandle handle)
{
foreach (var player in game.Players)
{
//TODO: Check for IDuringDrawingCards effects here
var drawEffect = new DrawingCardsEffect(game, player, 1);
var drawHandle = drawEffect.GetHandle(game);
game.AddEffect(drawEffect);
game.TriggerEffect(drawHandle);
}
handle.Resolve(GetCompletedStatus());
}
示例5: Trigger
public override void Trigger(IGame game, IEffectHandle handle)
{
var defeatedState = new EnemyDefeated(game, enemy, attackers);
foreach (var card in game.GetCardsInPlayWithEffect<ICardInPlay, IBeforeEnemyDefeated>())
{
foreach (var effect in card.BaseCard.Text.Effects.OfType<IBeforeEnemyDefeated>())
{
effect.BeforeEnemyDefeated(defeatedState);
}
}
foreach (var card in game.GetCardsInPlayWithEffect<ICardInPlay, IDuringEnemyDefeated>())
{
foreach (var effect in card.BaseCard.Text.Effects.OfType<IDuringEnemyDefeated>())
{
effect.DuringEnemyDefeated(defeatedState);
}
}
if (!defeatedState.IsEnemyDefeated)
{ handle.Cancel(GetCancelledString()); return; }
foreach (var card in game.GetCardsInPlayWithEffect<ICardInPlay, IAfterEnemyDefeated>())
{
foreach (var effect in card.BaseCard.Text.Effects.OfType<IAfterEnemyDefeated>())
{
effect.AfterEnemyDefeated(defeatedState);
}
}
var leavingPlayEffect = new CardLeavesPlayEffect(game, enemy);
game.AddEffect(leavingPlayEffect);
var leavingPlayHandle = leavingPlayEffect.GetHandle(game);
game.TriggerEffect(leavingPlayHandle);
handle.Resolve(GetCompletedStatus());
}
示例6: TriggerEffect
private void TriggerEffect(IGame game, IEffectHandle handle, ICardEffect cardEffect)
{
game.AddEffect(cardEffect);
var playEffectHandle = cardEffect.GetHandle(game);
game.TriggerEffect(playEffectHandle);
handle.Resolve(string.Format("{0} triggered {1}", player.Name, cardEffect.ToString()));
}
示例7: PlayCardFromHand
private void PlayCardFromHand(IGame game, IEffectHandle handle, IPlayableFromHand playableCard)
{
var playCardEffect = playableCard.GetPlayFromHandEffect(game, player);
game.AddEffect(playCardEffect);
var playCardHandle = playCardEffect.GetHandle(game);
game.TriggerEffect(playCardHandle);
handle.Resolve(string.Format("{0} played {1} from their hand", player.Name, playableCard.Title));
}