Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
 protected override void Modify(Card card)
 {
     card.PhysicalAttack = 1;
     card.CreateAbility()
         .Description("Buy 1 village card.")
         .BuyCard()
         .On(Phase.Spoils);
 }
Ejemplo n.º 4
0
        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)));
        }
Ejemplo n.º 5
0
 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));
 }
Ejemplo n.º 6
0
 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);
 }
Ejemplo n.º 7
0
        protected override void Modify(Card card)
        {
            base.Modify(card);
            card.PotentialPhysicalAttack = () => 2;
            card.MagicAttack = 2;

            card.CreateAbility()
                .EquipWeapon(Attr.PhysicalAttack, 2)
                .On(Phase.Equip);
        }
Ejemplo n.º 8
0
 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);
 }
Ejemplo n.º 9
0
 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);
 }
Ejemplo n.º 10
0
 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);
 }
Ejemplo n.º 11
0
 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);
 }
Ejemplo n.º 12
0
 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);
 }
Ejemplo n.º 13
0
 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);
 }
Ejemplo n.º 14
0
 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);
 }
Ejemplo n.º 15
0
 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);
 }
Ejemplo n.º 16
0
 private static void CreateSkinshifterAbility(Card card, int attack, int strength)
 {
     card.CreateAbility()
         .Description("Discard a card to add Physical Attack +{0} and Strength +{1}.".Template(attack, strength))
         .SelectCards(x => x.Select().FromHand().Filter(c => c != card).Caption(card.Name).Message("Discard a card."))
         .OnCardsSelected(x =>
         {
             x.Player.DiscardCard(x.Selected.First());
             card.AddModifier(new PlusMod(card, Attr.PhysicalAttack, attack));
             card.AddModifier(new PlusMod(card, Attr.Strength, strength));
         })
         .On(Phase.Dungeon);
 }
Ejemplo n.º 17
0
 protected override void Modify(Card card)
 {
     card.CreateAbility()
         .Description("Destroy this card to place the top card of any hero stack on top of your deck. End your turn.")
         .SelectCards(x => x.Select().FromTopOfHeroDecks().Caption(card.Name).Message("Select one hero card to add to your deck"))
         .OnCardsSelected(x =>
                              {
                                  var hero = x.Selected.First();
                                  x.Player.AddToTopOfDeck(hero);
                                  x.Player.DestroyCard(card, card.Name);
                              })
     //                .Condition(player => new TopOfDeckSource(player, CardType.Hero).GetCards().Any())
         .ContinueWith(player => player.EndTurn())
         .On(Phase.Village);
 }
Ejemplo n.º 18
0
 protected override void Modify(Card card)
 {
     base.Modify(card);
     card.CreateAbility()
         .DrawCards(1)
         .On(Phase.Village)
         .CreateAbility()
         .Description("Draw 1 card. If it is a hero it gains Physical Attack +2.")
         .Action(x =>
                     {
                         var drawn = x.Player.Draw(1).FirstOrDefault();
                         if (drawn != null && drawn.Type == CardType.Hero)
                             drawn.AddModifier(new PlusMod(card, Attr.PhysicalAttack, 2));
                     })
         .On(Phase.Dungeon);
 }
Ejemplo n.º 19
0
 public Card Create(Game game)
 {
     var card = new Card(game)
                    {
                        Type = CardType.Weapon,
                        Name = "Longspear",
                        Gold = 2,
                        Strength = 3,
                        Cost = 3,
                        Text = "<b>Physical Attack +1</b>",
                        PotentialPhysicalAttack = () => 1,
                    };
     card.SetTags("Weapon", "Polearm", "Basic");
     card.CreateAbility().EquipWeapon(Attr.PhysicalAttack, 1).On(Phase.Equip);
     return card;
 }
Ejemplo n.º 20
0
        protected override void Modify(Card card)
        {
            base.Modify(card);
            card.PotentialPhysicalAttack = () => 2;

            card.CreateAbility()
                .EquipWeapon(Attr.PhysicalAttack, 2)
                .On(Phase.Equip);

            card.AddEventHandler(
                events =>
                events.Subscribe<SelectingCards>(
                    message =>
                        {
                            if (message.TriggeringAbility != null && message.TriggeringAbility.Phase == Phase.Battle && card.IsEquipped)
                                message.Selection.Remove(card.GetEquipped().First());
                        }));
        }
Ejemplo n.º 21
0
        protected override void Modify(Card card)
        {
            base.Modify(card);

            card.PotentialPhysicalAttack = () => 5;

            card.CreateAbility()
                .EquipWeapon((player, hero) =>
                                 {
                                     hero.AddModifier(new SetMod(card, Attr.PhysicalAttack, 0));
                                     hero.AddModifier(new SetMod(card, Attr.MagicalAttack, 0));
                                 }).On(Phase.Equip);

            card.AddEventHandler(events => events.Subscribe<AttackRankSelected>(e =>
                                                              {
                                                                  if (e.AttackedRank.Number >= 2 && card.IsEquipped)
                                                                      card.GetEquipped().First().AddModifier(new PlusMod(card, Attr.PhysicalAttack, 5));
                                                              }));
        }
Ejemplo n.º 22
0
        protected override void Modify(Card card)
        {
            card.CreateAbility()
                .Description("If this is the first ability you use this turn, destroy this card. You cannot use any more abilities this turn.")
                .Action(x =>
                {
                    x.Player.DestroyCard(card, card.Name);
                    x.Player.ActiveAbilities.RemoveAll(a => a.Card.Owner == CardOwner.Player);
                })
                .On(Phase.Village, Phase.Dungeon);

            // Add event handler that removes this card's abilities when player uses another card's ability (except equipping)
            card.AddEventHandler(events => events.Subscribe<CardAbilityUsed>(e =>
            {
                var usedCard = e.Ability.Card;
                if (e.Ability.Phase != Phase.Equip && usedCard.Owner == CardOwner.Player && usedCard != card)
                    usedCard.Player.ActiveAbilities.RemoveAll(x => x.Card == card);
            }));
        }
Ejemplo n.º 23
0
 private static IAbilityDefinedSyntax CreateLevelUpHeroAbility(Card card, Func<Card, bool> validCardFilter, string abilityDescription)
 {
     return card.CreateAbility()
         .Description(abilityDescription)
         .SelectCards(x => x.Select().HeroToLevel(validCardFilter))
         .OnCardsSelected(x => { })
         .SelectCards(x =>
             {
                 var hero = x.Select().SelectionContext.Selected.First();
                 return x.Select().SelectHeroUpgrade(hero);
             })
         .OnCardsSelected(x =>
             {
                 var hero = x.Selections[0].First();
                 var upgrade = x.Selected.First();
                 x.Source.Draw(new[] {upgrade});
                 x.Player.Xp -= (hero.Xp ?? 0);
                 x.Player.DestroyCard(hero, "Upgrading to {0}".Template(upgrade.Name));
                 var leveledUp = card.GetData<List<Card>>() ?? new List<Card>();
                 leveledUp.Add(upgrade);
                 card.SetData(leveledUp);
             });
 }
Ejemplo n.º 24
0
        public Card Create(Game game)
        {
            var card = new Card(game)
                           {
                               Type = CardType.Hero,
                               Name = "Regular",
                               Gold = 0,
                               Strength = 3,
                               Cost = 0,
                               Text = "<b>Physical Attack +1</b>"
                                      + "<br/><br/>"
                                      + "<b>Dungeon:</b> If equipped with a polearm, draw a card.",
                               PhysicalAttack = 1,
                               Xp = 2,
                               Owner = CardOwner.Village
                           };
            card.SetTags("Level 0", "Basic");
            card.CreateAbility()
                .DrawCards(1)
                .Condition(player => card.IsEquipped && card.GetEquipped().First().HasTag("Polearm"))
                .On(Phase.Dungeon);

            return card;
        }
Ejemplo n.º 25
0
 protected override void Modify(Card card)
 {
     base.Modify(card);
     card.CreateAbility().DrawCards(1).On(Phase.Dungeon);
 }