本文整理汇总了C#中Card.CreateAbility方法的典型用法代码示例。如果您正苦于以下问题:C# Card.CreateAbility方法的具体用法?C# Card.CreateAbility怎么用?C# Card.CreateAbility使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Card
的用法示例。
在下文中一共展示了Card.CreateAbility方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Create
public Card Create(Game game)
{
var card = new Card(game)
{
Type = CardType.Item,
Name = "Thunderstone Shard",
Gold = 1,
Cost = 0,
Text = "<b>Dungeon:</b> One hero gains Strength +2."
+ "<br/><br/>"
+ "<b>Spoils:</b> Gain 1 XP.",
Vp = 1
};
card.SetTags("Item", "Thunderstone");
card.CreateAbility()
.Description("One hero gains Strength +2")
.SelectCards(x => x.Select().FromHand().Filter(c => c.IsHero()).Caption("Select Hero").Message("Select hero to use Thunderstone Shard"))
.OnCardsSelected(x => x.Selected.First().AddModifier(new PlusMod(card, Attr.Strength, 2)))
// .Condition(player => player.Hand.Any(c => c.IsHero()))
.On(Phase.Dungeon);
card.CreateAbility()
.Description("Gain 1 XP")
.Action(x => x.Player.Xp++)
.On(Phase.Spoils);
return card;
}
示例2: Modify
protected override void Modify(Card card)
{
card.Text = "You cannot rest or prepare."
+ "<br/><br/>"
+ "<b>Trophy:</b> Attack -1"
+ "<br/><br/>" + "<b>Village/Dungeon:</b> Select 2 random cards from your hand <i>(excluding this card).</i> "
+ "You may destroy 1 of them to destroy this card.";
card.AddEventHandler(
events => events.Subscribe<CardDrawnToHand>(
ev =>
{
if (ev.Card == card)
card.Player.ValidActions = card.Player.ValidActions.Except(new[] {PlayerAction.Prepare, PlayerAction.Rest});
}));
card.CreateAbility()
.Description("Select 2 random cards from your hand. You may destroy 1 of them to destroy this card.")
.SelectCards(x => x.Select().FromRandomHandSelection(2, c => c != card)
.Caption("Curse of War").Message("Destroy 1 card."))
.OnCardsSelected(x =>
{
x.Player.DestroyCard(x.Selected.First(), card.Name);
x.Player.DestroyCard(card, card.Name);
})
.Condition(p => p.Hand.Count >= 3)
.On(Phase.Village, Phase.Dungeon);
}
示例3: Modify
protected override void Modify(Card card)
{
card.PhysicalAttack = 1;
card.CreateAbility()
.Description("Buy 1 village card.")
.BuyCard()
.On(Phase.Spoils);
}
示例4: Modify
protected override void Modify(Card card)
{
card.CreateAbility()
.DestroyCard("Destroy a hero.", c => c.IsHero())
.On(Phase.Battle);
card.AddEventHandler(events => events.Subscribe<DungeonHallRefilled>(e => KeepStramstFromAdvancing(card, e)));
}
示例5: CreateDestroyOtherHeroAbility
private static IAbilityCardsSelectedSyntax CreateDestroyOtherHeroAbility(Card card)
{
return card.CreateAbility()
.Description("Destroy 1 other hero.")
.SelectCards(x => x.Select().FromHand()
.Filter(c => c != card && c.IsHero())
.Caption(card.Name).Message("Destroy 1 hero."))
.OnCardsSelected(x => x.Player.DestroyCard(x.Selected.First(), card.Name));
}
示例6: Modify
protected override void Modify(Card card)
{
base.Modify(card);
card.MagicAttack = 2;
card.CreateAbility()
.Description("Put Summon Storm on top of your deck.")
.Action(x => x.Player.DiscardToTopOfDeck(card))
.On(Phase.Village);
}
示例7: Modify
protected override void Modify(Card card)
{
base.Modify(card);
card.PotentialPhysicalAttack = () => 2;
card.MagicAttack = 2;
card.CreateAbility()
.EquipWeapon(Attr.PhysicalAttack, 2)
.On(Phase.Equip);
}
示例8: Modify
protected override void Modify(Card card)
{
card.CreateAbility()
.Description("Lose 2 gold to destroy this curse.")
.Action(x =>
{
x.Player.AddModifier(new PlusMod(card, Attr.Gold, -2));
x.Player.DestroyCard(card, card.Name);
})
.On(Phase.Village);
}
示例9: Modify
protected override void Modify(Card card)
{
base.Modify(card);
card.PotentialMagicAttack =
() => card.Player != null
? 1 + card.Player.Hand.Where(c => c.IsHero()).Select(c => c.Level).DefaultIfEmpty().Max()
: (int?) null;
card.CreateAbility()
.EquipWeapon((player, hero) => hero.AddModifier(new PlusMod(card, Attr.MagicalAttack, 1 + hero.Level)))
.On(Phase.Equip);
}
示例10: Modify
protected override void Modify(Card card)
{
card.CreateAbility()
.Description("Destroy this curse. Draw 2 fewer cards when you draw a new hand.")
.Action(x =>
{
x.Player.DestroyCard(card, card.Name);
x.Player.AddModifier(new PlusMod(card, Attr.HandSize, -2));
})
.On(Phase.Village, Phase.Dungeon);
}
示例11: Modify
protected override void Modify(Card card)
{
base.Modify(card);
card.CreateAbility()
.Description("Draw 3 cards. You cannot use any more Dungeon abilities this turn <i>(you may still equip weapons).</i>")
.Action(x =>
{
x.Player.Draw(3);
x.Player.ActiveAbilities.RemoveAll(a => a.Phase == Phase.Dungeon);
})
.On(Phase.Dungeon);
}
示例12: Modify
protected override void Modify(Card card)
{
card.CreateAbility()
.Description("Discard 2 cards to destroy this curse.")
.SelectCards(x => x.Select().FromHand()
.Filter(c => c != card)
.Caption("Curse of Neglect").Message("Discard 2 cards.").Min(2).Max(2))
.OnCardsSelected(context => context.Player.DiscardCards(context.Selected))
.Action(x => x.Player.DestroyCard(card, card.Name))
// .Condition(player => player.Hand.Count >= 3)
.On(Phase.Village, Phase.Dungeon);
}
示例13: Modify
protected override void Modify(Card card)
{
card.CreateAbility()
.Description("Discard 2 XP to destroy this curse.")
.Action(x =>
{
x.Player.DestroyCard(card, card.Name);
x.Player.Xp -= 2;
})
.Condition(player => player.Xp >= 2)
.On(Phase.Village, Phase.Dungeon);
}
示例14: Modify
protected override void Modify(Card card)
{
card.CreateAbility()
.Description("Destroy this curse. Lower your Total Attack Value by 3. " +
"You cannot equip any more weapons, use any other Dungeon abilities, or use any other Trophy effects this turn.")
.Action(x =>
{
x.Player.AddModifier(new PlusMod(card, Attr.TotalAttack, -3));
x.Player.ActiveAbilities.RemoveAll(a => a.Phase == Phase.Equip || a.Phase == Phase.Dungeon || a.Phase == Phase.Trophy);
x.Player.DestroyCard(card, card.Name);
})
.On(Phase.Dungeon);
}
示例15: Modify
protected override void Modify(Card card)
{
card.CreateAbility()
.Description("Destroy this curse. Reduce your Light to 0. "
+ "You cannot equip any more weapons, use any other Dungeon abilities, or use any other Trophy effects this turn.")
.Action(x =>
{
x.Player.AddModifier(new SetMod(card, Attr.Light, 0));
x.Player.ActiveAbilities.RemoveAll(a => a.Phase == Phase.Equip || a.Phase == Phase.Dungeon || a.Phase == Phase.Trophy);
x.Player.DestroyCard(card, card.Name);
})
.On(Phase.Dungeon);
}