コード例 #1
0
ファイル: DropZone.cs プロジェクト: Nephilim314/GameRepo
    //controls the actions performed when player drops the cards in his slots
    public void OnDrop(PointerEventData eventData)
    {
        //Debug.Log (eventData.pointerDrag.name + " was dropped on " + gameObject.name);
        Draggable d = eventData.pointerDrag.GetComponent<Draggable>();
        if(d != null){
            if(typeOfItem == d.typeOfItem){
                GameObject g = d.gameObject;
                cardInfo = g.GetComponent<Cards> ();
                if (cardInfo.used == false) {
                    if (playerMoney.currentMoney >= cardInfo.cost) {
                        playerHealth.currentHealth += cardInfo.health;
                        playerHealth.heal += cardInfo.heal;
                        playerAttack.attackPoint += cardInfo.attack;
                        playerMoney.currentMoney -= cardInfo.cost;
                        playerMoney.earn += cardInfo.earn;
                        cardInfo.used = true;
                        d.parentToReturnTo = this.transform;
                    }
                }

                if (d.typeOfItem == Draggable.Slot.Offense){
                    flash = offensePanel.GetComponent<Image> ();
                    flash.color = defaultOffenseColor;
                } else if (d.typeOfItem == Draggable.Slot.Defense){
                    flash = defensePanel.GetComponent<Image>();
                    flash.color = defaultDefenseColor;
                }
            }
        }
    }
コード例 #2
0
ファイル: EnemyAI.cs プロジェクト: Nephilim314/GameRepo
 //draws card from his hand and places them in his slots
 void DrawCards()
 {
     while (enemyMoney.currentMoney > 10) {
         if (isStart) {
             foreach (GameObject g in enemyDeck.handEnemy) {
                 if (g.transform.GetComponent<Cards>().earn != 0) {
                     deckCard = Instantiate(g) as GameObject;
                 }
             }
         } else {
             int i = Random.Range(0, enemyDeck.handEnemy.Length - 1);
             deckCard = Instantiate (enemyDeck.handEnemy[i]) as GameObject;
         }
         isStart = false;
         Destroy(deckCard.GetComponent<Draggable>());
         cardInfo = deckCard.GetComponent<Cards> ();
         if (cardInfo.type == "Offensive") {
             deckCard.transform.SetParent (EnemyOffensePanel.transform, false);
         } else if (cardInfo.type == "Defensive"){
             deckCard.transform.SetParent (EnemyDefensePanel.transform, false);
         }
         enemyAttack.attackPoint += cardInfo.attack;
         enemyHealth.currentHealth += cardInfo.health;
         enemyHealth.heal += cardInfo.heal;
         enemyMoney.currentMoney -= cardInfo.cost;
         enemyMoney.earn += cardInfo.earn;
     }
 }
コード例 #3
0
ファイル: DamageLibrary.cs プロジェクト: kunoz/EloBuddy
 /// <summary>
 /// Calculates the Damage done with W
 /// </summary>
 /// <param name="target">The Target</param>
 /// <param name="card">Card</param>
 /// <returns>Returns the Damage done with W</returns>
 private static float WDamage(Obj_AI_Base target, Cards card)
 {
     if (Player.Instance.HasBuff("bluecardpreattack") || Cards.Blue.Equals(card))
     {
         return Player.Instance.CalculateDamageOnUnit(
             target,
             DamageType.Mixed,
             new[] {0, 40, 60, 80, 100, 120}[Program.W.Level]) + (Player.Instance.TotalMagicalDamage*0.5f)
                + (Player.Instance.TotalAttackDamage);
     }
     if (Player.Instance.HasBuff("redcardpreattack") || Cards.Red.Equals(card))
     {
         return Player.Instance.CalculateDamageOnUnit(
             target,
             DamageType.Mixed,
             new[] { 0, 30, 45, 60, 75, 90 }[Program.W.Level] + (Player.Instance.TotalMagicalDamage * 0.5f)
             + Player.Instance.TotalAttackDamage);
     }
     if (Player.Instance.HasBuff("goldcardpreattack") || Cards.Yellow.Equals(card))
     {
         return Player.Instance.CalculateDamageOnUnit(
             target,
             DamageType.Mixed,
             new[] { 0, 15, 22.5f, 30, 37.5f, 45 }[Program.W.Level] + (Player.Instance.TotalMagicalDamage * 0.5f)
             + Player.Instance.TotalAttackDamage);
     }
     return 0;
 }
コード例 #4
0
 public ColorCounter(Cards cards)
     : base(4)
 {
     foreach (Card card in cards)
     {
         this[card.Suit].Add(card);
     }
 }
コード例 #5
0
 public frmNewMember()
 {
     InitializeComponent();
     price = new Price();
     members = new Member();
     cards = new Cards();
     cardUsage = new CardUsage();
 }
コード例 #6
0
ファイル: frmEntrance.cs プロジェクト: Stocolmo79/Heroko-Rima
 public frmEntrance()
 {
     InitializeComponent();
     tTimer.Start();
     members = new Member();
     cards = new Cards();
     cardUsage = new CardUsage();
 }
コード例 #7
0
ファイル: DamageLibrary.cs プロジェクト: kunoz/EloBuddy
 /// <summary>
 /// Calculates and return damage done with predicted card
 /// </summary>
 /// <param name="target">The Target</param>
 /// <param name="card">Card</param>
 /// <returns></returns>
 public static float PredictWDamage(Obj_AI_Base target, Cards card)
 {
     if (target != null)
     {
         return WDamage(target, card);
     }
     return 0f;
 }
コード例 #8
0
 public ValueCounter(Cards cards)
     : base(15)
 {
     foreach (Card card in cards)
     {
         this[card.Value].Add(card);
     }
 }
コード例 #9
0
ファイル: Game.cs プロジェクト: Ankine/Test
 public Game()
 {
     currentCard = 0;
     playDeak = new Deak(true);
     playDeak.LastCardDrawn += new LastCardDrawnHandler(Reshuffle);
     playDeak.Shuffle();
     discardedCards = new Cards();
 }
コード例 #10
0
ファイル: Game.cs プロジェクト: ktjones/BVCS2012
 public Game()
 {
     currentCard = 0;
      playDeck = new Deck(true);
      playDeck.LastCardDrawn += Reshuffle;
      playDeck.Shuffle();
      discardedCards = new Cards();
 }
コード例 #11
0
ファイル: frmMembers.cs プロジェクト: Stocolmo79/Heroko-Rima
 public frmMembers()
 {
     members = new Member();
     cards = new Cards();
     cardUsage = new CardUsage();
     InitializeComponent();
     loadComboBox();
     lvCardUsage.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);
 }
コード例 #12
0
ファイル: CardSelector.cs プロジェクト: Drenferalis/EloBuddy
 public static void StartSelecting(Cards card)
 {
     if (Player.Instance.Spellbook.GetSpell(SpellSlot.W).Name == "PickACard" && Status == SelectStatus.Ready
         && Environment.TickCount - LastW > 170 + Game.Ping / 2)
     {
         Player.CastSpell(SpellSlot.W, Player.Instance.ServerPosition);
         LastW = Environment.TickCount;
         LastCard = card;
     }
 }
コード例 #13
0
        public ActionResult Card()
        {
            ViewBag.Message = "Your contact page.";

            Cards model = new Cards();

            model.ListofCards = cardRepository.Get();

            return View(model);
        }
コード例 #14
0
ファイル: XMLUtil.cs プロジェクト: MaxPeck/DeckManager
        public static List<Cards.SkillCard> GetSkillCardList(Cards.Enums.SkillCardColor color)
        {
            if (doc == null)
                XMLUtil.OpenXmlFile();
            else if (doc.BaseURI != filepath)
                XMLUtil.OpenXmlFile();


            List<Cards.SkillCard> cardList = new List<Cards.SkillCard>();
            XmlNodeList xmlDeck = null;
            switch (color)
            { 
                case Cards.Enums.SkillCardColor.Politics:
                    xmlDeck = GetNode("POLdeck");
                    break;
                case Cards.Enums.SkillCardColor.Leadership:
                    xmlDeck = GetNode("LEAdeck");
                    break;
                case Cards.Enums.SkillCardColor.Tactics:
                    xmlDeck = GetNode("TACdeck");
                    break;
                case Cards.Enums.SkillCardColor.Piloting:
                    xmlDeck = GetNode("PILdeck");
                    break;
                case Cards.Enums.SkillCardColor.Engineering:
                    xmlDeck = GetNode("ENGdeck");
                    break;
                case Cards.Enums.SkillCardColor.Treachery:
                    xmlDeck = GetNode("TREdeck");
                    break;
                default:
                    break;
            }

            if (xmlDeck != null)
            {
                XmlNodeList cards = xmlDeck[0].ChildNodes;
                foreach (XmlNode card in cards)
                {
                    string text = card.ChildNodes[0].InnerText;

                    Cards.SkillCard newCard = new Cards.SkillCard();
                    newCard.CardColor = color;  // todo check this matches XML card type
                    newCard.CardPower = GetCardStrength(text);
                    newCard.Heading = GetCardName(text);
                    cardList.Add(newCard);
                }
                return cardList;
            }
            else ; // throw exception

            return null;
        }
コード例 #15
0
 public static void StartSelecting(Cards card)
 {
     if (ObjectManager.Player.Spellbook.GetSpell(SpellSlot.W).Name == "PickACard" && Status == SelectStatus.Ready)
     {
         Select = card;
         if (Utils.TickCount - LastWSent > 170 + Game.Ping / 2)
         {
             ObjectManager.Player.Spellbook.CastSpell(SpellSlot.W, ObjectManager.Player);
             LastWSent = Utils.TickCount;
         }
     }
 }
コード例 #16
0
		public static PlayerName GetOutcome(Cards player1, Cards player2, Cards table)
		{
			var p1 = String.Join(" ", player1);
			var p2 = String.Join(" ", player2);
			var tb = String.Join(" ", table);

			var h1 = new Hand(p1, tb);
			var h2 = new Hand(p2, tb);

			if (h1 == h2) { return PlayerName.None; }
			return h1 > h2 ? PlayerName.player1 : PlayerName.player2;
		}
コード例 #17
0
 public static void StartSelecting(Cards card)
 {
     if (ObjectManager.Player.Spellbook.GetSpell(SpellSlot.W).Name == "PickACard" && Status == SelectStatus.Ready)
     {
         SelectedCard = card;
         if (Environment.TickCount - LastW > 170 + Game.Ping/2)
         {
             Program.W.Cast();
             LastW = Environment.TickCount;
         }
     }
 }
コード例 #18
0
ファイル: CardSelector.cs プロジェクト: Chogart/LeagueSharp-2
 public static void StartSelecting(Cards card)
 {
     if (ObjectManager.Player.Spellbook.GetSpell(SpellSlot.W).Name == "PickACard" && Status == SelectStatus.Ready)
     {
         Select = card;
         if (Environment.TickCount - LastWSent > 200)
         {
             if (ObjectManager.Player.Spellbook.CastSpell(SpellSlot.W))
                 LastWSent = Environment.TickCount;
         }
     }
 }
コード例 #19
0
ファイル: frmCashier.cs プロジェクト: Stocolmo79/Heroko-Rima
 public frmCashier()
 {
     InitializeComponent();
     startPh = 1300;
     startPv = 900;
     price = new Price();
     tPrices = price.GetPrices();
     cards = new Cards();
     members = new Member();
     cardUsage = new CardUsage();
     tCardUsage = new tCardUsage();
     InitListView(true);
 }
コード例 #20
0
 public ActionResult Card()
 {
     try
     {
         Cards model = new Cards();
         model.ListofCards = cardRepository.Get();
         return View(model);
     }
     catch (Exception ex)
     {
         logger.Error("Error while getting a cards details. Error Details are: " + ex.Message);
         return RedirectToAction("Index", "Error");
     }
 }
コード例 #21
0
 public void AddCardToThrownCards(Cards card)
 {
     if(thrownCards.Count == 0){
         thrownCards.Add(card);
         currentCard = card;
     }
     else{
         //Destroy(thrownCards[thrownCards.Count-1].gameObject);
         thrownCards[thrownCards.Count-1].cardType = CardType.pastDeck;
         thrownCards[thrownCards.Count-1].gameObject.SetActive(false);
         //thrownCards.RemoveAt((thrownCards.Count-1));
         thrownCards.Add(card);
         currentCard = card;
     }
 }
コード例 #22
0
        public ActionResult CreateCards(FormCollection form)
        {
            Cards card = new Cards();

            int number_of_Cards = Convert.ToInt32(form["txtNoofCards"]);

            string Expiry_date = form["txtExpiryDate"].ToString();

            card.Expiry = Convert.ToDateTime(Expiry_date);
            card.Amount = form["txtAmount"].ToString();

            cardRepository.Add(card, number_of_Cards);

            return RedirectToAction("Card","Home");
        }
コード例 #23
0
ファイル: CardSelector.cs プロジェクト: Chogart/LeagueSharp-2
        private static void Game_OnGameUpdate(EventArgs args)
        {
            if ((ObjectManager.Player.Spellbook.CanUseSpell(SpellSlot.W) == SpellState.Ready && ObjectManager.Player.Spellbook.GetSpell(SpellSlot.W).Name == "PickACard" && (Status != SelectStatus.Selecting || Environment.TickCount - LastWSent > 500)) 
                
                || ObjectManager.Player.IsDead) Status = SelectStatus.Ready;

            if (ObjectManager.Player.Spellbook.CanUseSpell(SpellSlot.W) == SpellState.Cooldown && ObjectManager.Player.Spellbook.GetSpell(SpellSlot.W).Name == "PickACard")
            {
                Select = Cards.None;
                Status = SelectStatus.Cooldown;
            }

            if (ObjectManager.Player.Spellbook.CanUseSpell(SpellSlot.W) == SpellState.Surpressed &&
                !ObjectManager.Player.IsDead)
                Status = SelectStatus.Selected;
        }
コード例 #24
0
ファイル: Cards.cs プロジェクト: AnkurPatel00/RummyTest1
    public void InstantiateOnDashBoardCardHolder(Cards tempCard)
    {
        DashboardPositionData dashboardPositionData = tempCard.dashBoardCardHolder.GetPosition(gameObject);

        if(!dashboardPositionData.sameObject){

            GameObject tempPositionObject = Instantiate (GameManager.Ins.cardsPositionPointsObject,dashboardPositionData.position,Quaternion.identity) as GameObject;
            transform.position = tempPositionObject.transform.position;
            transform.parent = tempPositionObject.transform;
            tempPositionObject.transform.parent = tempCard.dashBoardCardHolder.transform;
            tempCard.dashBoardCardHolder.cardsPositionPoints.Add(tempPositionObject.GetComponent<CardsPositionPoints>());

            if (dashboardPositionData.index < tempCard.dashBoardCardHolder.cardsPositionPoints.Count && !dashboardPositionData.isLast) {

                CardsPositionPoints temppositionpoint = tempCard.dashBoardCardHolder.cardsPositionPoints [dashboardPositionData.index];
                tempCard.dashBoardCardHolder.cardsPositionPoints [dashboardPositionData.index] = tempCard.dashBoardCardHolder.cardsPositionPoints [tempCard.dashBoardCardHolder.cardsPositionPoints.Count - 1];

                for (int i = (dashboardPositionData.index+1); i < tempCard.dashBoardCardHolder.cardsPositionPoints.Count; i++) {

                    CardsPositionPoints temppositionpoint2 = tempCard.dashBoardCardHolder.cardsPositionPoints [i];
                    tempCard.dashBoardCardHolder.cardsPositionPoints [i] = temppositionpoint;
                    temppositionpoint = temppositionpoint2;
                }
            }
            else if(dashboardPositionData.isLast){
                print("added to last postiion");
                transform.position = dashboardPositionData.position;
            }

            if(cardType == CardType.dashboard){
                dashBoardCardHolder.DestroyCardsPositionPoints (cardsPositionPoints);
            }
            else{
                packInitiator.DestroyCardPosition (cardsPositionPoints);
            }
            cardType = CardType.dashboard;
            cardsPositionPoints = tempPositionObject.GetComponent<CardsPositionPoints>() as CardsPositionPoints;
            this.dashBoardCardHolder = tempCard.dashBoardCardHolder;
            dashBoardCardHolder.id = dashBoardCardHolder.id+1;
            tempPositionObject.GetComponent<CardsPositionPoints> ().id = dashBoardCardHolder.id;
            tempPositionObject.GetComponent<CardsPositionPoints> ().cards = this;
        }
        else{
            //transform.position = dashboardPositionData.position;
            transform.position = cardsPositionPoints.transform.position;
        }
    }
コード例 #25
0
ファイル: DrawCommand.cs プロジェクト: klincheR/NadekoBot
        public override Func<CommandEventArgs, Task> DoFunc() => async (e) =>
          {
              if (cards == null)
              {
                  await e.Send("Shuffling cards...");
                  cards = new Cards();
              }

              try
              {
                  int num = 1;
                  var isParsed = int.TryParse(e.GetArg("count"), out num);
                  if (!isParsed || num < 2)
                  {
                      var c = cards.DrawACard();
                      await e.Channel.SendFile(c.Name +".jpg",(Properties.Resources.ResourceManager.GetObject(c.Name) as Image).ToStream());
                      return;
                  }
                  if (num > 5)
                      num = 5;

                  List<Image> images = new List<Image>();
                  List<Cards.Card> cardObjects = new List<Cards.Card>();
                  for (int i = 0; i < num; i++)
                  {
                      if (cards.CardPool.Count == 0 && i != 0)
                      {
                          await e.Send("No more cards in a deck.");
                          break;
                      }
                      var currentCard = cards.DrawACard();
                      cardObjects.Add(currentCard);
                      images.Add(Properties.Resources.ResourceManager.GetObject(currentCard.Name) as Image);
                  }
                  Bitmap bitmap = images.Merge();
                  await e.Channel.SendFile(images.Count + " cards.jpg", bitmap.ToStream());
                  if (cardObjects.Count == 5)
                  {
                      await e.Send(Cards.GetHandValue(cardObjects));
                  }
              }
              catch (Exception ex)
              {
                  Console.WriteLine("Error drawing (a) card(s) " + ex.ToString());
              }
          };
コード例 #26
0
 public void Add(Cards card, int NumofCards)
 {
     try
     {
         CardData cd = new CardData();
         cd.Amount = card.Amount;
         cd.Expiry = card.Expiry;
         for (int i = 0; i < NumofCards; i++)
         {
             client.AddCards(cd);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #27
0
ファイル: DrawCommand.cs プロジェクト: alpha-zero/NadekoBot
        public override Func<CommandEventArgs, Task> DoFunc() => async (e) =>
          {
              if (cards == null)
              {
                  await e.Send("Shuffling cards...");
                  cards = new Cards();
              }

              try
              {
                  int num = 1;
                  var isParsed = int.TryParse(e.GetArg("count"), out num);
                  if (!isParsed || num < 2)
                  {
                      await e.Channel.SendFile(cards.DrawACard().Path);
                      return;
                  }
                  if (num > 5)
                      num = 5;

                  List<Image> images = new List<Image>();
                  List<Cards.Card> cardObjects = new List<Cards.Card>();
                  for (int i = 0; i < num; i++)
                  {
                      if (cards.CardPool.Count == 0 && i != 0)
                      {
                          await e.Send("No more cards in a deck.");
                          break;
                      }
                      var currentCard = cards.DrawACard();
                      cardObjects.Add(currentCard);
                      images.Add(Image.FromFile(currentCard.Path));
                  }
                  Bitmap bitmap = ImageHandler.MergeImages(images);
                  await e.Channel.SendFile(images.Count + " cards.jpg", ImageHandler.ImageToStream(bitmap, ImageFormat.Jpeg));
                  if (cardObjects.Count == 5)
                  {
                      await e.Send(Cards.GetHandValue(cardObjects));
                  }
              }
              catch (Exception ex)
              {
                  Console.WriteLine("Error drawing (a) card(s) " + ex.ToString());
              }
          };
コード例 #28
0
ファイル: DrawCommand.cs プロジェクト: klincheR/NadekoBot
        public override void Init(CommandGroupBuilder cgb)
        {
            cgb.CreateCommand("$draw")
                .Description("Draws a card from the deck.If you supply number [x], she draws up to 5 cards from the deck.\n**Usage**: $draw [x]")
                .Parameter("count", ParameterType.Optional)
                .Do(DoFunc());

            cgb.CreateCommand("$shuffle")
                .Alias("$reshuffle")
                .Description("Reshuffles all cards back into the deck.")
                .Do(async e => {
                    if (cards == null) {
                        cards = new Cards();
                    }
                    cards.Restart();
                    await e.Send("Deck reshuffled.");
                });
        }
コード例 #29
0
ファイル: Trash.cs プロジェクト: micahpaul/dominion_net_multi
		internal void AddRange(Cards.CardCollection cards)
		{
			_Cards.InsertRange(0, cards);
			this.Sort();

			if (_AsynchronousChanging)
			{
				if (_AsynchronousPileChangedEventArgs == null)
					_AsynchronousPileChangedEventArgs = new PileChangedEventArgs(null, PileChangedEventArgs.Operation.Added, cards);
				else
					_AsynchronousPileChangedEventArgs.AddedCards.AddRange(cards);
			}
			else if (PileChanged != null)
			{
				PileChangedEventArgs pcea = new PileChangedEventArgs(null, PileChangedEventArgs.Operation.Added, cards);
				PileChanged(this, pcea);
			}
		}
コード例 #30
0
        public static void Obj_AI_Base_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (!sender.IsMe)
            {
                return;
            }

            if (args.SData.Name == "PickACard")
            {
                Status = SelectStatus.Selecting;
            }

            if (args.SData.Name == "goldcardlock" || args.SData.Name == "bluecardlock" ||
                args.SData.Name == "redcardlock")
            {
                Status = SelectStatus.Selected;
                SelectedCard = Cards.None;
            }
        }
コード例 #31
0
 public Card Draw()
 {
     return(Cards.Pop());
 }
コード例 #32
0
 public ChangeEntityTask(string cardId)
 {
     _card = Cards.FromId(cardId);
     _type = EntityType.SOURCE;
 }
コード例 #33
0
ファイル: App.xaml.cs プロジェクト: fog-bank/mojp
 public static bool TryGetCard(string name, out Card card) => Cards.TryGetValue(name, out card);
コード例 #34
0
 public virtual void Add(Card card)
 {
     Cards.Add(card);
 }
コード例 #35
0
 public void AddCard(Card card)
 {
     Cards.Add(card);
 }
コード例 #36
0
        public void Load()
        {
            if (!IsFileLoadingComplete.Signaled)
            {
                throw new InvalidOperationException();
            }

            foreach (var set in deserializeAllSets())
            {
                preProcessSet(set);

                for (int i = set.ActualCards.Count - 1; i >= 0; i--)
                {
                    var card = set.ActualCards[i];
                    card.Set = set;

                    if (!string.IsNullOrEmpty(card.FaceName))
                    {
                        card.NameEn = card.FaceName;
                    }

                    card.Id = string.Intern(CardId.Generate(card));

                    card.Formatter = _formatter;

                    preProcessCard(card);
                    preProcessCardOrToken(card);

                    if (set.ActualCards[i].Remove)
                    {
                        set.ActualCards.RemoveAt(i);
                    }
                }

                var tokenLegalityByFormat = set.ActualCards.Aggregate(
                    new HashSet <string>(Legality.Formats, Str.Comparer),
                    (formats, card) =>
                {
                    formats.IntersectWith(card.LegalityByFormat.Keys);
                    return(formats);
                }).ToDictionary(_ => _, _ => Legality.Legal, Str.Comparer);

                for (int i = 0; i < set.Tokens.Count; i++)
                {
                    var token = set.Tokens[i];
                    token.IsToken = true;
                    token.Set     = set;

                    if (!string.IsNullOrEmpty(token.FaceName))
                    {
                        token.NameEn = token.FaceName;
                    }

                    token.Id = string.Intern(CardId.Generate(token));
                    token.LegalityByFormat = tokenLegalityByFormat;
                    token.Formatter        = _formatter;
                    preProcessToken(token);
                    preProcessCardOrToken(token);
                }

                var cards = new List <Card>(set.ActualCards.Count + set.Tokens.Count);
                cards.AddRange(set.ActualCards);
                cards.AddRange(set.Tokens);
                set.Cards = cards;

                // after preProcessCard, to have NameNormalized field set non empty
                set.ActualCardsByName = set.ActualCards.GroupBy(_ => _.NameNormalized)
                                        .ToDictionary(
                    gr => gr.Key,
                    gr => gr.ToList(),
                    Str.Comparer);

                set.TokensByName = set.Tokens.GroupBy(_ => _.NameNormalized)
                                   .ToDictionary(
                    gr => gr.Key,
                    gr => gr.ToList(),
                    Str.Comparer);

                var duplicateCards = set.ActualCards.GroupBy(_ => _.MtgjsonId)
                                     .Where(gr => gr.Skip(1).Any())
                                     .ToDictionary(gr => gr.Key, gr => gr.ToList());

                if (duplicateCards.Count > 0)
                {
                    _log.Warn($"{duplicateCards.Count} duplicate card ids {set.Code}");
                    _log.Warn(string.Join("\\n", duplicateCards.Keys));
                }

                set.ActualCardsById = set.ActualCards.GroupBy(_ => _.MtgjsonId)
                                      .ToDictionary(gr => gr.Key, gr => gr.First());

                var duplicateTokens = set.Tokens.GroupBy(_ => _.MtgjsonId)
                                      .Where(gr => gr.Skip(1).Any())
                                      .ToDictionary(gr => gr.Key, gr => gr.ToList());

                if (duplicateTokens.Count > 0)
                {
                    _log.Warn($"{duplicateTokens.Count} duplicate token ids {set.Code}");
                    _log.Warn(string.Join(Environment.NewLine, duplicateTokens.Keys));
                }

                set.TokensById = set.Tokens.GroupBy(_ => _.MtgjsonId)
                                 .ToDictionary(gr => gr.Key, gr => gr.First());

                foreach (var card in set.Cards)
                {
                    CardsById[card.Id] = card;
                }

                ImageNameCalculator.CalculateCardImageNames(set, Patch);

                lock (SetsByCode)
                    SetsByCode.Add(set.Code, set);

                lock (Cards)
                    foreach (var card in set.Cards)
                    {
                        Cards.Add(card);
                    }

                SetAdded?.Invoke();
            }

            CardsByName  = toNamesakesMap(Cards.Where(c => !c.IsToken));
            TokensByName = toNamesakesMap(Cards.Where(c => c.IsToken));

            CardIdsByName  = CardsByName.ToDictionary(_ => _.Key, _ => _.Value.ToHashSet(c => c.Id), Str.Comparer);
            TokenIdsByName = TokensByName.ToDictionary(_ => _.Key, _ => _.Value.ToHashSet(c => c.Id), Str.Comparer);

            CardPrintingsByName  = CardsByName.ToDictionary(_ => _.Key, toPrintings, Str.Comparer);
            TokenPrintingsByName = TokensByName.ToDictionary(_ => _.Key, toPrintings, Str.Comparer);

            for (int i = 0; i < Cards.Count; i++)
            {
                var card = Cards[i];
                card.IndexInFile = i;
                card.Namesakes   = MapByName(card.IsToken)[card.NameNormalized];
                card.NamesakeIds = MapIdByName(card.IsToken)[card.NameNormalized];
                card.Printings   = MapPrintingsByName(card.IsToken)[card.NameNormalized];
            }

            patchLegality();

            IsLoadingComplete.Signal();

            // release RAM
            _defaultSetsContent = null;
            Patch          = null;
            Cards.Capacity = Cards.Count;

            foreach (var namesakeList in CardsByName.Values)
            {
                namesakeList.Capacity = namesakeList.Count;
            }

            foreach (var namesakeList in TokensByName.Values)
            {
                namesakeList.Capacity = namesakeList.Count;
            }

            IReadOnlyList <string> toPrintings(KeyValuePair <string, List <Card> > _) =>
            _.Value.Select(c => c.Set).Distinct().OrderBy(s => s.ReleaseDate).Select(s => s.Code).ToList();

            Dictionary <string, List <Card> > toNamesakesMap(IEnumerable <Card> cards) =>
            cards.GroupBy(_ => _.NameNormalized)
            .ToDictionary(
                gr => gr.Key,
                // card_by_name_sorting
                gr => gr.OrderByDescending(_ => _.ReleaseDate).ToList(),
                Str.Comparer);
        }
コード例 #37
0
        public void NerubianEgg_FP1_007()
        {
            var game = new Game(new GameConfig
            {
                StartPlayer          = 1,
                Player1HeroClass     = CardClass.MAGE,
                Player2HeroClass     = CardClass.MAGE,
                FillDecks            = true,
                FillDecksPredictably = true
            });

            game.StartGame();
            game.Player1.BaseMana = 10;
            game.Player2.BaseMana = 10;
            SabberStoneCore.Model.Entities.IPlayable testCard = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Nerubian Egg"));
            game.Process(PlayCardTask.Minion(game.CurrentPlayer, testCard));
            game.Process(EndTurnTask.Any(game.CurrentPlayer));
            SabberStoneCore.Model.Entities.IPlayable spell = Generic.DrawCard(game.CurrentPlayer, Cards.FromName("Fireball"));
            game.Process(PlayCardTask.SpellTarget(game.CurrentPlayer, spell, testCard));
            Assert.Equal(1, game.CurrentOpponent.BoardZone.Count);
            Assert.Equal("FP1_007t", game.CurrentOpponent.BoardZone[0].Card.Id);
        }
コード例 #38
0
 public Card(Cards suit, Cards face)
 {
     this.Face = face;
     this.Suit = suit;
 }
コード例 #39
0
 public ReplaceHeroTask(string cardIdHero, string cardIdWeapon, string cardIdPower)
 {
     HeroCard   = Cards.FromId(cardIdHero);
     WeaponCard = Cards.FromId(cardIdWeapon);
     PowerCard  = Cards.FromId(cardIdPower);
 }
コード例 #40
0
        protected override void Initialize()
        {
            Name         = "Road to Rivendell Nightmare";
            Abbreviation = "RtRN";
            SetType      = Models.SetType.Nightmare_Expansion;
            Cycle        = "NIGHTMARE";
            Number       = 2054;

            Cards.Add(new Card()
            {
                Title          = "Road to Rivendell Nightmare",
                Id             = "1770122B-7F4B-424A-A714-A23DB128E355",
                CardType       = Models.CardType.Nightmare_Setup,
                HasSecondImage = true,
                Text           =
                    @"You are playing in Nightmare mode.

Forced: When an enemy with the ambush keyword engages a player during the quest phase, it contributes its Threat to the total Threat in the staging area until the end of the phase.",
                OppositeText =
                    @"Begin with the standard quest deck and encounter deck for the Road to Rivendell scenario.

Remove the following cards, in the specified quantities, from the standard encounter and quest deck:

1x Orc Outpost (quest stage 2)
2x Ruined Road
2x Barren Hills
1x Goblin Taskmaster
4x Black Uruks
3x Mountain Warg
3x Bitter Wind
2x Warg Lair
5x Goblin Spearman
2x Goblin Archer
2x Plundered Armoury

Add the new quest card in this Nightmare Deck to the normal quest deck, in stage order. Then, shuffle the encounter cards in this Nightmare Deck into the remainder of the standard Road to Rivendell encounter deck.

Finally, flip this setup card over and place it next to the quest deck. Its effect remains active throughout the game, which is now ready to begin.",
                EncounterSet = "Road to Rivendell Nightmare",
                Quantity     = 1,
                Number       = 1,
                Artist       = Artist.Oleg_Saakyan
            });
            Cards.Add(new Card()
            {
                Title          = "Ambush in the Night",
                Id             = "2EC4C17D-CB7C-4B1A-94AB-A755644577C5",
                HasSecondImage = true,
                CardType       = CardType.Quest,
                StageNumber    = 2,
                QuestPoints    = 12,
                Text           =
                    @"When Revealed: Search the encounter deck, discard pile and victory display for Goblin Gate and add it to the staging area, if able. Shuffle the encounter discard pile into the encounter deck. Discard cards from the top of the encounter deck until X enemies have been discarded, where X is the number of players in the game. Reveal all enemies discarded by this effect.",
                OppositeText =
                    @"When Revealed: The first player loses control of Arwen Undómiel and attaches her to Goblin Gate (she is now guarded by Goblin Gate). While she is guarded, the first player cannot gain control of Arwen Undómiel.

Goblin Gate gets +1 quest point for each enemy engaged with a player.

Progress cannot be placed on this stage unless the players control Arwen Undómiel.",
                EncounterSet = "Road to Rivendell Nightmare",
                Quantity     = 1,
                Number       = 2,
                Artist       = Artist.Oleg_Saakyan
            });
            Cards.Add(new Card()
            {
                Title          = "Uruk Elf-stalker",
                Id             = "4A8E8DDA-F44E-4DD5-AACE-3D4F7C4D22EA",
                CardType       = CardType.Enemy,
                EngagementCost = 5,
                Threat         = 3,
                Attack         = 5,
                Defense        = 3,
                HitPoints      = 5,
                Traits         = new List <string> {
                    "Uruk.", "Orc."
                },
                Keywords = new List <string> {
                    "Ambush."
                },
                Text         = "Forced: When Uruk Elf-stalker attacks and destroys a character, deal 1 damage to Arwen Undómiel.",
                Shadow       = "Shadow: Attacking enemy gets +2 Attack.",
                EncounterSet = "Road to Rivendell Nightmare",
                Quantity     = 3,
                Number       = 3,
                Artist       = Artist.Anthony_Devine
            });
            Cards.Add(new Card()
            {
                Title          = "Goblin Trapper",
                Id             = "93C87E29-E9DF-4596-A65D-D776CCC8F4B0",
                CardType       = CardType.Enemy,
                EngagementCost = 30,
                Threat         = 3,
                Attack         = 3,
                Defense        = 2,
                HitPoints      = 3,
                Traits         = new List <string> {
                    "Goblin.", "Orc."
                },
                Keywords = new List <string> {
                    "Ambush."
                },
                Text         = "Forced: After Goblin Trapper engages a player, that player must exhaust a character he controls.",
                Shadow       = "Shadow: Add Goblin Trapper to the staging area.",
                EncounterSet = "Road to Rivendell Nightmare",
                Quantity     = 3,
                Number       = 4,
                Artist       = Artist.Guillaume_Ducos
            });
            Cards.Add(new Card()
            {
                Title          = "Raiding Party",
                Id             = "EC66FDED-E287-4FE7-B536-B8A2CA51F767",
                CardType       = CardType.Enemy,
                EngagementCost = 34,
                Threat         = 2,
                Attack         = 5,
                Defense        = 1,
                HitPoints      = 7,
                Traits         = new List <string> {
                    "Mountain.", "Orc."
                },
                Keywords = new List <string> {
                    "Ambush."
                },
                Text         = "Forced: After Raiding Party engages a player, each player discards the top card of the encounter deck, starting with the first player. Each player who discards an enemy with the ambush keyword must make an engagement check against that enemy.",
                EncounterSet = "Road to Rivendell Nightmare",
                Quantity     = 2,
                Number       = 5,
                Artist       = Artist.Mark_Behm
            });
            Cards.Add(new Card()
            {
                Title          = "Vicious Trackers",
                Id             = "45F25FBC-4722-4C8E-9F06-F1D7E4AB27FA",
                CardType       = CardType.Enemy,
                EngagementCost = 16,
                Threat         = 1,
                Attack         = 3,
                Defense        = 2,
                HitPoints      = 5,
                Traits         = new List <string> {
                    "Goblin.", "Orc."
                },
                Keywords = new List <string> {
                    "Surge."
                },
                Text         = "While Vicious Tracker is engaged with a player, that player is considered to have +20 threat for purposes of engagement checks only.",
                EncounterSet = "Road to Rivendell Nightmare",
                Quantity     = 2,
                Number       = 6,
                Artist       = Artist.Lukasz_Jaskolski
            });
            Cards.Add(new Card()
            {
                Title       = "Treacherous Bluffs",
                Id          = "E9C28758-7EB8-4958-B324-2024D90B7DC6",
                CardType    = CardType.Location,
                Threat      = 1,
                QuestPoints = 7,
                Traits      = new List <string> {
                    "Hills."
                },
                Text         = "Forced: When an engaged enemy with the ambush keyword engages a player, Treacherous Bluffs gets +2 Threat until the end of the phase.",
                Shadow       = "Shadow: Excess damage dealt by this attack must be assigned to Arwen Undómiel.",
                EncounterSet = "Road to Rivendell Nightmare",
                Quantity     = 3,
                Number       = 7,
                Artist       = Artist.Adam_Lane
            });
            Cards.Add(new Card()
            {
                Title       = "Concealed Woods",
                Id          = "E9DBE592-324F-4B1D-8FC3-F1B0A685AF02",
                CardType    = CardType.Location,
                Threat      = 4,
                QuestPoints = 4,
                Traits      = new List <string> {
                    "Forest."
                },
                Text         = "While Concealed Woods is the active location, the first enemy with the ambush keyword revealed from the encounter deck each round gains surge.",
                Shadow       = "Shadow: Attacking enemy gets +2 Attack if engaged with the first player.",
                EncounterSet = "Road to Rivendell Nightmare",
                Quantity     = 3,
                Number       = 8,
                Artist       = Artist.Jake_Bullock
            });
            Cards.Add(new Card()
            {
                Title        = "Tumultuous Assault",
                Id           = "64653BB9-7682-4EAD-9892-29E305968F89",
                CardType     = CardType.Treachery,
                Text         = "When Revealed: Return each engaged enemy with the ambush keyword to the staging area. Each player makes engagement checks against each enemy in the staging area, as if it were the encounter phase. If there are no enemies with the ambush keyword in play, Tumultuous Assault gains surge.",
                EncounterSet = "Road to Rivendell Nightmare",
                Quantity     = 2,
                Number       = 9,
                Artist       = Artist.Mark_Behm
            });
        }
コード例 #41
0
 private Deck(Cards newCards)
 {
     cards = newCards;
 }
コード例 #42
0
 public virtual void Remove(Card card)
 {
     Cards.Remove(card);
 }
コード例 #43
0
 public virtual bool Contains(Card card)
 {
     return(Cards.Contains(card));
 }
コード例 #44
0
        static KazakusPower()
        {
            PotionCards = new Card[5][];

            Card[] kazakusPotionSpells =
            {
                Cards.FromId("CFM_621t2"),
                Cards.FromId("CFM_621t3"),
                Cards.FromId("CFM_621t4"),
                Cards.FromId("CFM_621t5"),
                Cards.FromId("CFM_621t6"),
                Cards.FromId("CFM_621t8"),
                Cards.FromId("CFM_621t9"),
                Cards.FromId("CFM_621t10"),
                //Cards.FromId("CFM_621t11"),
                //Cards.FromId("CFM_621t12"),
                //Cards.FromId("CFM_621t13"),
                Cards.FromId("CFM_621t16"),
                Cards.FromId("CFM_621t17"),
                Cards.FromId("CFM_621t18"),
                Cards.FromId("CFM_621t19"),
                Cards.FromId("CFM_621t20"),
                Cards.FromId("CFM_621t21"),
                Cards.FromId("CFM_621t22"),
                Cards.FromId("CFM_621t23"),
                Cards.FromId("CFM_621t24"),
                Cards.FromId("CFM_621t25"),
                Cards.FromId("CFM_621t26"),
                Cards.FromId("CFM_621t27"),
                Cards.FromId("CFM_621t28"),
                Cards.FromId("CFM_621t29"),
                Cards.FromId("CFM_621t30"),
                Cards.FromId("CFM_621t31"),
                Cards.FromId("CFM_621t32"),
                Cards.FromId("CFM_621t33"),
                Cards.FromId("CFM_621t37"),
                Cards.FromId("CFM_621t38"),
                Cards.FromId("CFM_621t39")
            };

            // Cards for selecting cost.
            // CFM_621t11, CFM_621t12, CFM_621513
            PotionCards[0] = Cards.FromName("Kazakus").Entourage.Select(Cards.FromId).ToArray();
            PotionCards[1] = kazakusPotionSpells.Where(c => c.Cost == 1).ToArray();
            PotionCards[2] = kazakusPotionSpells.Where(c => c.Cost == 5).ToArray();
            PotionCards[3] = kazakusPotionSpells.Where(c => c.Cost == 10).ToArray();
            // Placeholder cards
            PotionCards[4] = new[] { Cards.FromId("CFM_621t"), Cards.FromId("CFM_621t14"), Cards.FromId("CFM_621t15") };
        }
コード例 #45
0
 public void Add(Card card)
 {
     Cards.Push(card);
 }
コード例 #46
0
        protected override void Initialize()
        {
            Name         = setName;
            Abbreviation = "TiTN";
            SetType      = Models.SetType.Nightmare_Expansion;
            Cycle        = "NIGHTMARE";
            Number       = 2070;

            Cards.Add(new Card()
            {
                Title          = setName,
                HasSecondImage = true,
                CardType       = CardType.Nightmare_Setup,
                Text           = "You are playing Nightmare mode.\r\nSetup: Raise each player's starting threat by 5.\r\nProgress cannot be placed on Crossing at Tharbad while Bellach is in play.",
                FlavorText     = "The houses looked large and strange to them. Sam stared up at the inn with its three storeys and many windows, and felt his heart sink.\r\n-The Fellowship of the Ring",
                OppositeText   =
                    @"Begin with the standard quest deck and encounter deck for Trouble in Tharbad scenario.

Remove the following cards, in the specified quantities, from the standard encounter deck:

1x ~Orc ~Hunter
2x ~Orc Skirmisher
2x Tharbad ~Hideout
2x Hidden Alleyway
1x Decrepit Rooftops
2x ~Orc Hunting Party

Then, shuffle the encounter cards in this Nightmare Deck into the remainder of the standard Trouble in Tharbad encounter deck.

Finally, flip this setup card over and place it next to the quest deck. Its effects remain active throughout the game, which is now ready to begin.",
                EncounterSet = setName,
                Quantity     = 1,
                Number       = 1,
                Artist       = Artist.Alvaro_Calvo_Escudero
            });
            Cards.Add(Card.Enemy("Bellach's Hunter", "", setName, 50, 3, 6, 4, 6)
                      .WithTraits("Orc.", "Spy.")
                      .WithText("While a player controls 5 or more allies, Bellach's Hunter gets -20 engagement cost.\r\nForced: When Bellach's Hunter engages a player, that player must either remove all time counters from the current quest or deal 5 damage to a hero he controls.")
                      .WithInfo(2, 2, Artist.Mariusz_Gandzel));
            Cards.Add(Card.Enemy("Orc Seeker", "", setName, 20, 2, 4, 3, 4)
                      .WithTraits("Orc.")
                      .WithText("When Revealed: Either reduce each player's threat elimination level by 2, or Orc Seeker engages the first player and makes an immediate attack.")
                      .WithShadow("Shadow: Reduce each player's threat elimination level by 2 (5 instead if undefended).")
                      .WithInfo(3, 3, Artist.Nicholas_Gregory));
            Cards.Add(Card.Enemy("Blood Hound", "", setName, 0, 2, 2, 2, 3)
                      .WithTraits("Creature.")
                      .WithText("Forced: When Blood Hound engages you, raise your threat by 5.")
                      .WithShadow("Shadow: Either raise your threat by 10, or attacking enemy makes an additional attack against you after this one.")
                      .WithInfo(4, 3, Artist.Alvaro_Calvo_Escudero));
            Cards.Add(Card.Location("City of Spies", "", setName, 2, 5)
                      .WithTraits("City.", "Ruins.")
                      .WithText("While City of Spies is in the staging area, it gains: \"Forced: When you commit a character to the quest, raise your threat by 1. This effect does not stack with other copies of City of Spies.\"")
                      .WithInfo(5, 3, Artist.Davis_Engel));
            Cards.Add(Card.Location("Dark Pathway", "", setName, 5, 4)
                      .WithTraits("City.")
                      .WithText("While Dark Pathway is the active location, the first treachery card without the printed surge keyword revealed during the quest phase gains surge.")
                      .WithShadow("Shadow: Either remove 1 time counter from the current quest or treat this attack as undefended.")
                      .WithInfo(6, 3, Artist.Yoann_Boissonnet));
            Cards.Add(Card.Treachery("Waylaid by Agents", "", setName)
                      .WithText("When Revealed: Each player must choose: either remove 1 time counter from the quest or discard an ally he controls from play. Then, if any player's threat is 20 or less, Waylaid by Agents gains doomed 3.")
                      .WithShadow("Shadow: Attacking enemy gets +1 Attack (+3 Attack instead if your threat is 20 or less).")
                      .WithInfo(7, 2, Artist.Taylor_Ingvarsson));
            Cards.Add(Card.Treachery("Tharbad Patrol", "", setName)
                      .WithKeywords("Surge.")
                      .WithText("When Revealed: Attach Tharbad Patrol to a non-unique location in the staging area without a copy of Tharbad Patrol attached. (Counts as a Condition attachment with the text: \"Forced: After the players travel to attached location, each player must discard the top 2 cards from the encounter deck and engage each enemy he discarded in this way.\")")
                      .WithInfo(8, 3, Artist.Mariusz_Gandzel));
        }
コード例 #47
0
        protected override void Initialize()
        {
            Name         = "The Stone of Erech";
            Abbreviation = "TSoE";
            Number       = 3003;
            SetType      = Models.SetType.GenCon_Expansion;
            Cycle        = "GenCon";

            Cards.Add(new Card()
            {
                ImageType    = Models.ImageType.Png,
                Title        = "Banks of Morthond",
                Id           = "14f7c98c-b425-4fac-850a-729d8fcdaa0c",
                CardType     = CardType.Location,
                EncounterSet = "The Stone of Erech",
                Traits       = new List <string>()
                {
                    "Blackroot Vale.", " Riverland."
                },
                Text        = "While Banks of Morthond is the active location, each location in the staging area gets -1 Threat.",
                Shadow      = "Shadow: If this attack destroys a character, add 1 progress to the current Night objective.",
                Quantity    = 2,
                Threat      = 2,
                QuestPoints = 7,
                Number      = 17,
                Artist      = Artist.Alyn_Spiller
            });
            Cards.Add(new Card()
            {
                ImageType    = Models.ImageType.Png,
                Title        = "Blackroot Graves",
                Id           = "fc54b033-56cc-4ca9-8e0f-7f1c7b82bd6a",
                CardType     = CardType.Location,
                EncounterSet = "The Stone of Erech",
                Traits       = new List <string>()
                {
                    "Blackroot Vale."
                },
                Text        = "Forced: When Blackroot Graves is explored, return the topmost Undead enemy in the encounter discard pile to play, engaged with the first player.",
                Shadow      = "Shadow: If defending character has 0 Willpower, deal 2 damage to that character.",
                Quantity    = 3,
                Threat      = 4,
                QuestPoints = 1,
                Number      = 19,
                Artist      = Artist.Jose_Vega
            });
            Cards.Add(new Card()
            {
                ImageType    = Models.ImageType.Png,
                Title        = "Derufin",
                Id           = "f93a8fda-7383-41c9-b86d-c5ba1fec760d",
                CardType     = CardType.Objective_Ally,
                EncounterSet = "The Stone of Erech",
                Traits       = new List <string>()
                {
                    "Gondor."
                },
                Text =
                    @"Forced: After the players travel to The Stone of Erech, the first player gains control of Derufin.

Dusk. Derufin gets -1 Willpower

Midnight. Derufin gets -2 Willpower

If Derufin leaves play, the players lose the game.",
                Quantity  = 1,
                IsUnique  = true,
                Attack    = 1,
                Defense   = 1,
                Willpower = 3,
                HitPoints = 2,
                Number    = 4,
                Artist    = Artist.David_A_Nash
            });
            Cards.Add(new Card()
            {
                ImageType    = Models.ImageType.Png,
                Title        = "Driven by Fear",
                Id           = "cdf8dee9-b2ac-4e5f-bf4c-0b9c15cac142",
                CardType     = CardType.Treachery,
                EncounterSet = "The Stone of Erech",
                Text         = "When Revealed: The first player attached Driven by Fear to a hero he controls. Counts as a Condition attachment with the text: \"Attached character's Willpower is reduced to 0. Treat attacked character's text box as if it was blank (except for Traits.)\"",
                Quantity     = 2,
                Number       = 25,
                Artist       = Artist.Melanie_Maier
            });
            Cards.Add(new Card()
            {
                ImageType    = Models.ImageType.Png,
                Title        = "Dusk",
                Id           = "d3c68791-c3f9-4e8d-9515-2496f9ca1895",
                CardType     = CardType.Objective,
                EncounterSet = "The Stone of Erech",
                Traits       = new List <string>()
                {
                    "Night."
                },
                Text =
                    @"Forced: At the end of the round, place 1 progress on Dusk.

If there are 4 or more progress on Dusk, add it to the victory display and put Midnight into play.",
                Quantity = 1,
                Number   = 9,
                Artist   = Artist.Titus_Lunter
            });
            Cards.Add(new Card()
            {
                ImageType    = Models.ImageType.Png,
                Title        = "Eventide",
                Id           = "36a22f2b-56d9-4148-a962-f7fbdf60f3a1",
                CardType     = CardType.Objective,
                EncounterSet = "The Stone of Erech",
                Traits       = new List <string>()
                {
                    "Night."
                },
                Text =
                    @"Forced: At the end of the round, place 1 progress on Eventide.

If there are 4 or more progress on Eventide, add it to the victory display and put Dusk into play.",
                Quantity = 1,
                Number   = 8,
                Artist   = Artist.Titus_Lunter
            });
            Cards.Add(new Card()
            {
                ImageType    = Models.ImageType.Png,
                Title        = "Groping Horror",
                Id           = "728f17db-d741-4f1b-92da-8aac3d78432d",
                CardType     = CardType.Treachery,
                EncounterSet = "The Stone of Erech",
                Text         =
                    @"When Revealed: The first player must choose: skip the next travel phase, or each player must pass his hand to the player on his left (discard your hand instead if you are the only player in the game).

Midnight. Groping Horror gains surge.",
                Quantity = 2,
                Number   = 24,
                Artist   = Artist.Rafal_Hrynkiewicz
            });
            Cards.Add(new Card()
            {
                ImageType    = Models.ImageType.Png,
                Title        = "Haunted Valley",
                Id           = "7a3411df-76a0-432b-a64a-d499b0b1ae50",
                CardType     = CardType.Location,
                EncounterSet = "The Stone of Erech",
                Traits       = new List <string>()
                {
                    "Blackroot Vale."
                },
                Text =
                    @"While this location is in the staging area, all ready heroes lose all Lore, Leadership, Spirit and Tactics icons.

Planning Action: Exhuast a hero. Any player may trigger this action.",
                Quantity    = 2,
                Threat      = 2,
                QuestPoints = 3,
                Number      = 21,
                Artist      = Artist.Anthony_Feliciano
            });
            Cards.Add(new Card()
            {
                ImageType    = Models.ImageType.Png,
                Title        = "Midnight",
                Id           = "0c15f99d-9066-4e7c-b364-104a0083d997",
                CardType     = CardType.Objective,
                EncounterSet = "The Stone of Erech",
                Traits       = new List <string>()
                {
                    "Night."
                },
                Text     = "Forced: At the end of the round, place 1 progress on Midnight. Then, raise each player's threat by the number of progress on Midnight.",
                Quantity = 1,
                Number   = 10,
                Artist   = Artist.Titus_Lunter
            });
            Cards.Add(new Card()
            {
                ImageType    = Models.ImageType.Png,
                Title        = "Midnight Throng",
                Id           = "c29c98de-5660-498c-a5cc-a1800985d221",
                CardType     = CardType.Treachery,
                EncounterSet = "The Stone of Erech",
                Text         =
                    @"When Revealed: Starting with the first player, each player must search the encounter deck and discard pile for an Undead enemy, reveal it, and add it to the staging area. Shuffle the encounter deck.

Midnight. THe effect cannot be canceled.",
                Shadow   = "Attacking enemy gets +1 Attack (Dusk. +2 Attack instead. Midnight. +3 Attack instead).",
                Quantity = 2,
                Number   = 22,
                Artist   = Artist.Ignacio_Bazan_Lazcano
            });
            Cards.Add(new Card()
            {
                ImageType    = Models.ImageType.Png,
                Title        = "Murmurs of Dread",
                Id           = "f985bda2-5029-4c34-91f7-721f830cbd9c",
                CardType     = CardType.Treachery,
                EncounterSet = "The Stone of Erech",
                Text         = "When Revealed: All characters get -1 Willpower until the end of the round.",
                Shadow       =
                    @"Dusk/Midnight. Attack enemy makes an additional attack after this one.
                
Midnight. This effect cannot be canceled.",
                Quantity = 2,
                Number   = 23,
                Artist   = Artist.David_Gaillet
            });
            Cards.Add(new Card()
            {
                ImageType    = Models.ImageType.Png,
                Title        = "Regretful Shade",
                Id           = "f079c496-20bf-4ce4-a5ca-d644172d83fe",
                CardType     = CardType.Enemy,
                EncounterSet = "The Stone of Erech",
                Traits       = new List <string>()
                {
                    "Undead.", " Oathbreaker."
                },
                Quantity       = 3,
                EngagementCost = 23,
                Attack         = 2,
                Defense        = 1,
                HitPoints      = 3,
                Keywords       = new List <string>()
                {
                    "Spectral.", " Surge."
                },
                Shadow = "Deal Attacking enemy 1 additional shadow card (Dusk. 2 additional cards instead. Midnight. 3 additional cards instead).",
                Threat = 1,
                Number = 16,
                Artist = Artist.Aurelien_Hubert
            });
            Cards.Add(new Card()
            {
                ImageType    = Models.ImageType.Png,
                Title        = "Relic from the Dark Years",
                Id           = "7b0eb4e5-962c-4041-baea-3a09a83fb996",
                CardType     = CardType.Objective,
                EncounterSet = "The Stone of Erech",
                Traits       = new List <string>()
                {
                    "Item.", " Artifact."
                },
                Text     = "Midnight. Action: Claim this objective and attach it to a hero you control. Counts as an Artifact attachment with the text: \"When attached hero attacks and Oathbreaker, that enemy loses the Spectral keyword until the end of the phase.\"",
                Quantity = 1,
                Number   = 11,
                Artist   = Artist.Logan_Feliciano
            });
            Cards.Add(new Card()
            {
                ImageType    = Models.ImageType.Png,
                Title        = "Restless Dead",
                Id           = "65f48337-cec0-41a1-84ff-490c4f563ce4",
                CardType     = CardType.Enemy,
                EncounterSet = "The Stone of Erech",
                Traits       = new List <string>()
                {
                    "Undead.", " Oathbreaker."
                },
                Quantity       = 4,
                EngagementCost = 12,
                Attack         = 3,
                Defense        = 0,
                HitPoints      = 2,
                Keywords       = new List <string>()
                {
                    "Spectral."
                },
                Text   = "When Revealed: Return the topmost Undead enemy in the encounter discard pile to the staging area.",
                Threat = 2,
                Number = 13,
                Artist = Artist.Rafal_Hrynkiewicz
            });
            Cards.Add(new Card()
            {
                ImageType    = Models.ImageType.Png,
                Title        = "Shadow Host Captain",
                Id           = "a7d52939-2989-44d2-b81b-571db0ee8c16",
                CardType     = CardType.Enemy,
                EncounterSet = "The Stone of Erech",
                Traits       = new List <string>()
                {
                    "Undead.", " Oathbreaker."
                },
                Quantity       = 2,
                EngagementCost = 42,
                Attack         = 4,
                Defense        = 1,
                HitPoints      = 6,
                Keywords       = new List <string>()
                {
                    "Spectral."
                },
                Text =
                    @"Dusk. Shadow Host Captain gets +1 Attack and +1 Defense.

Midnight. Shadow Host Captain gets +2 Attack and +2 Defense.",
                Threat = 3,
                Number = 15,
                Artist = Artist.Alexandre_Dainche
            });
            Cards.Add(new Card()
            {
                ImageType    = Models.ImageType.Png,
                Title        = "Shadow-man",
                Id           = "8ece887c-6ca7-467d-80d4-3f28afa13433",
                CardType     = CardType.Enemy,
                EncounterSet = "The Stone of Erech",
                Traits       = new List <string>()
                {
                    "Undead.", " Oathbreaker."
                },
                Quantity       = 2,
                EngagementCost = 27,
                Attack         = 4,
                Defense        = 1,
                HitPoints      = 5,
                Keywords       = new List <string>()
                {
                    "Spectral."
                },
                Text   = "When Revealed: Players cannot play events until the end of the round.",
                Shadow = "Shadow: Attacking enemy gets +1 Attack (Dusk. +2 Attack instead. Midnight. +3 Attack instead).",
                Threat = 2,
                Number = 12,
                Artist = Artist.Emile_Denis
            });
            Cards.Add(new Card()
            {
                ImageType    = Models.ImageType.Png,
                Title        = "Shadow of Dwimorberg",
                Id           = "02cae27a-3b0c-4396-aea3-8fc2bdd4ffe8",
                CardType     = CardType.Location,
                EncounterSet = "The Stone of Erech",
                Traits       = new List <string>()
                {
                    "Blackroot Vale.", " Mountain."
                },
                Text =
                    @"Dusk. Shadow of Dwimorberg gets +2 Threat.


Midnight. Shadow of Dwimorberg gets +4 Threat.",
                Quantity    = 2,
                Threat      = 1,
                QuestPoints = 4,
                Number      = 20,
                Artist      = Artist.Logan_Feliciano
            });
            Cards.Add(new Card()
            {
                ImageType    = Models.ImageType.Png,
                Title        = "Tarlang's Neck",
                Id           = "88df7c56-ee11-48f0-b6a0-0486e0a8ce92",
                CardType     = CardType.Location,
                EncounterSet = "The Stone of Erech",
                Traits       = new List <string>()
                {
                    "Blackroot Vale.", " Road."
                },
                Text          = "While Tarlang's Next is the active location, it gains, \"Forced: At the beginning of the encounter phase, the players must either immediately end the encounter phase, or the first player must engaged all enemies in the staging area.\"",
                Quantity      = 1,
                IsUnique      = true,
                Threat        = 3,
                QuestPoints   = 6,
                VictoryPoints = 1,
                Number        = 7,
                Artist        = Artist.Anthony_Feliciano
            });
            Cards.Add(new Card()
            {
                ImageType      = Models.ImageType.Png,
                Title          = "Terror of the Dead",
                StageNumber    = 2,
                Id             = "ecc8fd11-b2b9-4adc-91eb-6fcc1212e7ce",
                CardType       = CardType.Quest,
                ScenarioNumber = 3,
                EncounterSet   = "The Stone of Erech",
                Text           = "When Revealed: Add The Stone of Erech to the staging area and attach Derufin to it.",
                OppositeText   = "Forced: At the beginning of each round, the players must choose: each player skips the next planning phase, or heroes do not collect resources during the resource phase this round.",
                Quantity       = 1,
                QuestPoints    = 8,
                Number         = 2,
                Artist         = Artist.David_A_Nash
            });
            Cards.Add(new Card()
            {
                ImageType    = Models.ImageType.Png,
                Title        = "The Dead Ride Behind",
                Id           = "5e7c36de-a2bb-44e3-951b-80123788d571",
                CardType     = CardType.Treachery,
                EncounterSet = "The Stone of Erech",
                Text         = "When Revealed: Deal 1 damage to each character with less than 2 Willpower. (Dusk. less than 3 Willpower insread. Midnight. less than 4 Willpower instead).",
                Quantity     = 2,
                Number       = 26,
                Artist       = Artist.Jose_Vega
            });
            Cards.Add(new Card()
            {
                ImageType      = Models.ImageType.Png,
                Title          = "The Disappearance",
                StageNumber    = 1,
                Id             = "e4af5d7f-9af5-41bb-b22a-cce8b91ac791",
                CardType       = CardType.Quest,
                ScenarioNumber = 3,
                EncounterSet   = "The Stone of Erech",
                Quantity       = 1,
                QuestPoints    = 6,
                Text           = "Setup: Make Tarlang's Next the active location. Set Derufin, The Lord of the Dead, The Stone of Erech, and the 3 Night objectives aside, out of play. Shuffle the encounter deck. Place Eventide into play, next to the current quest.",
                OppositeText   =
                    @"When Revealed: Reveal 1 encounter card per player, adding them to the staging area.

Players cannot defeat this stage while Tarlang's Next is in play.",
                Number = 1,
                Artist = Artist.Magali_Villeneuve
            });
            Cards.Add(new Card()
            {
                ImageType    = Models.ImageType.Png,
                Title        = "The Gloaming",
                Id           = "d33ef89b-13c9-49b2-a921-a527f27a415a",
                CardType     = CardType.Treachery,
                EncounterSet = "The Stone of Erech",
                Quantity     = 2,
                Keywords     = new List <string>()
                {
                    "Surge."
                },
                Text   = "When Revealed: Add 1 progress to the current Night objective.",
                Number = 27,
                Artist = Artist.Jose_Vega
            });
            Cards.Add(new Card()
            {
                ImageType    = Models.ImageType.Png,
                Title        = "The Lord of the Dead",
                Id           = "7b9dd852-ed19-4a00-b09e-f6c2cee549fa",
                CardType     = CardType.Enemy,
                EncounterSet = "The Stone of Erech",
                Traits       = new List <string>()
                {
                    "Undead.", " Oathbreaker."
                },
                Quantity       = 2,
                EngagementCost = 30,
                IsUnique       = true,
                Attack         = 6,
                Defense        = 3,
                HitPoints      = 9,
                Keywords       = new List <string>()
                {
                    "Spectral."
                },
                Text   = "Cannot have attachments.\r\nWhile you are engaged with The Lord of the Dead, treat all printed text boxes on characters you control as if they were blank (except Traits.)",
                Threat = 5,
                Number = 5,
                Artist = Artist.Jim_Pavelec
            });
            Cards.Add(new Card()
            {
                ImageType      = Models.ImageType.Png,
                Title          = "The Shadow Host",
                StageNumber    = 3,
                Id             = "efd4cef9-ce8b-4985-8825-853ba98baa2b",
                CardType       = CardType.Quest,
                ScenarioNumber = 3,
                EncounterSet   = "The Stone of Erech",
                Text           =
                    @"When Revealed: Starting with the first player, each player searches the encounter deck and discard pile for 1 Oathbreaker enemy, reveals it, and adds it to the staging area. Add the Lord of the Dead to the staging area.

Shuffle the encounter deck.",
                OppositeText =
                    @"Midnight. Battle (Characters use their Attack instead of Willpower when questing.)

Players cannot place progress on this stage unless they control Derufin.

If the players defeat this stage, they have escaped the Blackroot Vale with Derufin and won the game.",
                Quantity    = 1,
                QuestPoints = 14,
                Number      = 3,
                Artist      = Artist.Magali_Villeneuve
            });
            Cards.Add(new Card()
            {
                ImageType        = Models.ImageType.Png,
                Title            = "The Stone of Erech",
                SlugIncludesType = true,
                Id           = "822ca699-4763-4b8c-baff-d8d828c002a9",
                CardType     = CardType.Location,
                EncounterSet = "The Stone of Erech",
                Traits       = new List <string>()
                {
                    "Blackroot Vale."
                },
                Quantity = 1,
                IsUnique = true,
                Text     =
                    @"Immune to player card effects. X is twice the number of players in the game.

While The Stone of Erech is that active location, characters with less than 2 Willpower cannot ready.

Travel: Exhaust each character with less than 2 Willpower.",
                Threat           = 0,
                IsVariableThreat = true,
                QuestPoints      = 6,
                VictoryPoints    = 5,
                Number           = 6,
                Artist           = Artist.Titus_Lunter
            });
            Cards.Add(new Card()
            {
                ImageType    = Models.ImageType.Png,
                Title        = "Vale of Shadows",
                Id           = "c57661b7-62f9-4906-b2eb-73af91fd8252",
                CardType     = CardType.Location,
                EncounterSet = "The Stone of Erech",
                Traits       = new List <string>()
                {
                    "Blackroot Vale."
                },
                Text =
                    @"When Revealed: Make Vale of Shadows the active location. If another location is currently active, return it to the staging area.

Dusk. Vale of Shadows gets +2 quest points.

Midnight. Vale of Shadows gets +4 quest points.",
                Quantity    = 2,
                Threat      = 1,
                QuestPoints = 3,
                Number      = 18,
                Artist      = Artist.Stacey_Diana_Clark
            });
            Cards.Add(new Card()
            {
                ImageType    = Models.ImageType.Png,
                Title        = "Whisperer",
                Id           = "43bb02ff-9fcc-47e8-822c-ffcd620c9fc4",
                CardType     = CardType.Enemy,
                EncounterSet = "The Stone of Erech",
                Traits       = new List <string>()
                {
                    "Undead.", " Oathbreaker."
                },
                Quantity       = 3,
                EngagementCost = 35,
                Attack         = 2,
                Defense        = 2,
                HitPoints      = 4,
                Keywords       = new List <string>()
                {
                    "Spectral."
                },
                Text =
                    @"Dusk. Whisperer gets +1 Threat.

Midnight. Whisperer gets +2 Threat and gains Doomed 2.",
                Threat = 2,
                Number = 14,
                Artist = Artist.Sara_Betsy
            });
        }
コード例 #48
0
ファイル: MainForm.cs プロジェクト: amaraladil/DurakGame
        /// <summary>
        /// This Click method happens for the player's CardBox
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void CardboxTest_Click(object sender, EventArgs e)
        {
            int cardClickedValue   = 0;
            int lastCardDealtValue = 0;

            lblMessage.Text = "";

            //Sets the player to become the defender and the AI being the Attacker
            if (cardsDealt.Count == 0)
            {
                players[0].isAttack = false; players[1].isAttack = true; btnClearCards.Text = TAKE_BUTTON;
            }

            //Clicked card is set up to check values
            CardBox.CardBox item = (CardBox.CardBox)sender;

            DurakLog("\tPlayer Clicked on " + item.ToString());

            //Checks if playing cards has less than 6 cards
            if (cardsDealt.Count <= MAX_NUMBER_OF_PLAYING_CARDS)
            {
                //Checks if the there is any cards on the playing field
                if (cardsDealt.Count > 0)
                {
                    //Sets the cards values
                    cardClickedValue   = (int)item.Rank;
                    lastCardDealtValue = (int)cardsDealt.Last <Card>().rank;

                    //Checks if the clicked object is a trump card
                    if (item.Suit == trumpCard.Suit)
                    {
                        cardClickedValue += 10;
                    }
                    //Checks if the last card on the field, being a trump card
                    if (cardsDealt.Last <Card>().suit == trumpCard.Suit)
                    {
                        lastCardDealtValue += 10;
                    }

                    //Checks if the clicked card value is equal or greater than the last card dealt
                    if (cardClickedValue >= lastCardDealtValue)
                    {
                        DurakLog("\t\t(" + item.ToString() + ") beats last playing card (" + cardsDealt.Last <Card>().ToString() + ")");
                        Card clickedCard = new Card(item.Suit, item.Rank);
                        cardsDealt.Add(clickedCard);

                        players[0].PlayHand.Remove(clickedCard);

                        //Checks if there is enough space for AI to play
                        if (cardsDealt.Count < MAX_NUMBER_OF_PLAYING_CARDS)
                        {
                            //Lets the AI play next
                            if (players[1].PlayHand.Count > 0)
                            {
                                playAiPlayer();
                            }

                            //If AI makes the playing cards full, then it discards the cards.
                            if (cardsDealt.Count == MAX_NUMBER_OF_PLAYING_CARDS)
                            {
                                DurakLog("\tAI Player made the cards full, discarded the cards in playing field");

                                cardsDealt = new Cards();
                                addMoreCardsToPlayerHands();

                                //Makes the player defend and AI attacks
                                if (cardsDealt.Count == 0)
                                {
                                    players[0].isAttack = false; players[1].isAttack = true; btnClearCards.Text = TAKE_BUTTON;
                                }

                                showWhoseAttackDefend();
                            }
                        }
                        else //AI has to discard, since the player played the last card to reach the maximum cards in play
                        {
                            cardsDealt = new Cards();

                            AiStartsNewPlayingCards();
                        }


                        setNewCardField();
                    }
                    else//Shows a message that it is not able to be played
                    {
                        lblMessage.Text = item.ToString() + " cannot beat " + cardsDealt.Last <Card>().ToString();
                        DurakLog("\t\t(" + item.ToString() + ") cannot beat last playing card (" + cardsDealt.Last <Card>().ToString() + ")");
                    }
                }
                else //Sets the first card for the playing field from the Player themself
                {
                    Card setCard = new Card(item.Suit, item.Rank);
                    cardsDealt.Add(setCard);

                    players[0].PlayHand.Remove(setCard);
                    DurakLog("\t\t(" + item.ToString() + ") starts the playing cards");

                    //checks if AI player has enough cards
                    if (players[1].PlayHand.Count > 0)
                    {
                        playAiPlayer();
                    }

                    setNewCardField();
                }

                //If AI Player wins or Player Wins
                if (players[1].PlayHand.Count == 0 || players[0].PlayHand.Count == 0)
                {
                    setWinner();
                }
            }
            else
            {
                DurakLog("\t\t\tPlaying field is full");
                lblWarning.Text = "Cannot have anymore cards";
            }
        }
コード例 #49
0
ファイル: Hand.cs プロジェクト: LeetheM/FCDiceBot
 public int CardsCount()
 {
     return(Cards.Count());
 }
コード例 #50
0
ファイル: RevisarDialog.cs プロジェクト: rodrigo0108/Bot2
        public async Task StartAsync()
        {
            var reply = context.MakeMessage();

            reply.AttachmentLayout = AttachmentLayoutTypes.Carousel;

            var accion = "Revisar";

            context.PrivateConversationData.SetValue <string>("Accion", accion);

            string confirmacionRespuesta1       = "Tengo esta respuesta para usted:";
            string confirmacionRespuesta2       = "Tengo estas respuestas para usted:";
            string preguntaNoRegistrada1        = "Lo siento, su pregunta no esta registrada, tal vez no escribió la pregunta correctamente";
            string preguntaNoRegistrada2        = "Lo siento, su pregunta no esta registrada";
            string opcionSecundarioDeRespuesta1 = "Pero esta respuesta le podría interesar:";
            string opcionSecundarioDeRespuesta2 = "Pero estas respuestas le podrían interesar:";
            string preguntaConsulta             = "si tiene otra consulta por favor hágamelo saber";

            Constantes c = Constantes.Instance;

            // Se detectó la primera parte de la pregunta
            foreach (var entityP1 in result.Entities.Where(Entity => Entity.Type == "Pregunta::Palabra1"))
            {
                var palabra1 = entityP1.Entity.ToLower().Replace(" ", "");
                context.PrivateConversationData.SetValue <string>("Palabra1", palabra1);
                // -------------------------------------------------------------------
                // La primera parte de la pregunta es firma
                if (palabra1 == "ortografía" || palabra1 == "ortografia" || palabra1 == "gramática" || palabra1 == "gramatica")
                {
                    foreach (var service in result.Entities.Where(Entity => Entity.Type == "Servicio"))
                    {
                        var serv = service.Entity.ToLower().Replace(" ", "");
                        if (serv == "word" || serv == "excel" || serv == "powerpoint" || serv == "outlook" || serv == "office")
                        {
                            reply.Attachments = RespuestasWord.GetRevisarOrtografiaOffice();
                            await context.PostAsync(confirmacionRespuesta1);

                            await context.PostAsync(reply);

                            await context.PostAsync(preguntaConsulta);

                            return;
                        }
                        else if (serv == "onenote")
                        {
                            // Aca va one note
                            reply.Attachments = RespuestasWord.GetRevisarOrtografiaOffice();
                            await context.PostAsync(confirmacionRespuesta1);

                            await context.PostAsync(reply);

                            await context.PostAsync(preguntaConsulta);

                            return;
                        }
                        else
                        {
                            // Aca va one note y office
                            reply.Attachments = RespuestasWord.GetRevisarOrtografiaOffice();
                            await context.PostAsync($"Lo siento '{serv}' no se encuentra registrado como servicio, tal vez no escribió correctamente.");

                            await context.PostAsync(opcionSecundarioDeRespuesta2);

                            await context.PostAsync(reply);

                            await context.PostAsync(preguntaConsulta);

                            return;
                        }
                    }
                    // Aca va one note y office
                    reply.Attachments = RespuestasWord.GetRevisarOrtografiaOffice();
                    await context.PostAsync(confirmacionRespuesta2);

                    await context.PostAsync(reply);

                    await context.PostAsync(preguntaConsulta);

                    return;
                }
                else
                {
                    await context.PostAsync(preguntaNoRegistrada2);

                    await context.PostAsync($"O tal vez no escribió correctamente la palabra '{palabra1}'?");

                    return;
                }
            }
            // No se detectó la primera parte de la pregunta
            await context.PostAsync(preguntaNoRegistrada2);

            reply.Attachments = Cards.GetConsultaV2();
            await context.PostAsync(reply);

            await context.PostAsync("O tal vez no escribió la pregunta correctamente");

            return;
        }
コード例 #51
0
ファイル: MainForm.cs プロジェクト: amaraladil/DurakGame
        /// <summary>
        /// Lets the AI try to play the next card
        /// </summary>
        private void playAiPlayer()
        {
            int currentCardValue, lastCardDealtValue;

            bool isMoved = false;

            //Sets to the highest value possible, as trump increases the card value and Ace is max
            Card chosenCard = new Card(trumpCard.Suit, Rank.Ace);

            foreach (Card card in players[1].PlayHand)
            {
                currentCardValue   = card.value;
                lastCardDealtValue = cardsDealt.Last <Card>().value;

                //The system should try to look for a non-trump card to be used, else it tries to look for another
                if (card.suit == trumpCard.Suit)
                {
                    currentCardValue += 10;
                }

                //Checks if the last card on playing field is a Trump
                if (cardsDealt.Last <Card>().suit == trumpCard.Suit)
                {
                    lastCardDealtValue += 10;
                }

                //If the card is over the last playing card, then it adds them into the playing cards
                if (currentCardValue >= lastCardDealtValue)
                {
                    //This will allow the if statement later, know if a card has been chosen to be used for play
                    isMoved = true;
                    //Checks if the chosen card is a trump card or not
                    int chosenCardValue = (chosenCard.suit == trumpCard.Suit) ? chosenCard.value + 10 : chosenCard.value;
                    //Checks if it is the least possible card that the AI can choose to play
                    if (currentCardValue < chosenCardValue)
                    {
                        chosenCard = card;
                    }
                }
            }

            //If any card has been chosen to move, then AI would add card to playing field
            if (isMoved)
            {
                DurakLog("\t\tAI Chose to Play (" + chosenCard.ToString() + ") against (" + cardsDealt.Last <Card>().ToString() + ")");
                cardsDealt.Add(chosenCard);
                players[1].PlayHand.Remove(chosenCard);
            }
            else //If AI cannot defeat playing card, then they either take or discard
            {
                //Checks if AI is attacker or not
                if (players[1].isAttack == true)  //AI is attack
                {
                    DurakLog("\t\tAI could not attack last playing field, discards all cards");

                    cardsDealt = new Cards();

                    AiStartsNewPlayingCards();
                }
                else //AI is defend
                {
                    DurakLog("\t\tAI could not defend last playing field, takes all cards");
                    AiGetsAllPlayingCards();

                    if (cardsDealt.Count == 0)
                    {
                        players[0].isAttack = false; players[1].isAttack = true; btnClearCards.Text = "Take Cards";
                    }

                    showWhoseAttackDefend();

                    addMoreCardsToPlayerHands();
                }
            }
        }
コード例 #52
0
 public Player(HeroClass hero, string name, int playerId, int teamId = 0) : base(Cards.FromId("Player"),
                                                                                 new Dictionary <GameTag, int> {
     { GameTag.MAXHANDSIZE, 10 },
     { GameTag.MAXRESOURCES, 10 },
     { GameTag.PLAYER_ID, playerId },
     { GameTag.TEAM_ID, (teamId != 0? teamId : playerId) },
     { GameTag.STARTHANDSIZE, 4 }
 })
 {
     HeroClass    = hero;
     FriendlyName = name;
 }
コード例 #53
0
        /// <summary>
        /// Discards the top card.
        /// </summary>
        public void Discard()
        {
            Card card = Cards.FirstOrDefault();

            Discard(card);
        }
コード例 #54
0
        protected override void Initialize()
        {
            Name                = "Fog on the Barrow-downs";
            Abbreviation        = "FotBD";
            Number              = 3005;
            SetType             = Models.SetType.Fellowship_Deck;
            Cycle               = "GenCon";
            DisablePublicImages = true;

            Cards.Add(new Card()
            {
                Title          = "Fog on the Barrow-downs Scenario Rules",
                Id             = "BE094FA5-B976-4888-AB7A-D3E257E390C9",
                ImageType      = Models.ImageType.Jpg,
                HasSecondImage = true,
                CardType       = CardType.GenCon_Setup,
                Text           =
                    @"New Staging Rules

When playing Fog on the Barrow-downs, players reveal encounter cards individually in player order during the Staging step of the Quest phase. If an encounter card has an effect that uses the word 'you' then the encounter card is referring to the player who revealed the card. If the revealed card has the Surge keyword, the player who revealed it reveals an additional card. Encounter cards with the Doomed X keyword still affect each player.

Peril Keyword

When a player reveals an encounter card with the the Peril keyword, he must resolve that staging of that card on his own without conferring with ther other players. The other players cannot take any actions or trigger any responses during the resolution of that card's staging.",
                OppositeText =
                    @"Creating a Staging Area

When a player is instructed to create his own staging area, he sets aside an area in front of himself to serve as his own separate staging area. Players continue to resolve each phase of the game in turn order, starting with the first player, but the resolution of each phase occurs as if only the player or players that share any given staging area are present in the game.

Players cannot affect players or cards that do not share a common staging area. The players as a group still cannot have more than 1 copy of a unique card in play.

During the encounter phase, players only reveal 1 card per player that shares their staging area. Encounter card effects are limited to players and cards at that stage. Effects that reference 'each player' only affect each player at that staging area.",
                Number   = 0,
                Quantity = 1,
                Artist   = Artist.Unknown
            });
            Cards.Add(new Card()
            {
                Title          = "Fog on the Barrow-downs Campaign Rules",
                Id             = "E953D925-0DA7-4AA4-AE85-A98A8C1815DA",
                ImageType      = Models.ImageType.Jpg,
                HasSecondImage = true,
                CardType       = CardType.GenCon_Setup,
                Text           =
                    @"Stage 3B - Lost in the Fog

Stage 3B (and its staging area) must remain in play until it is defeated. If there are no players at stage 3B, skip each phase at that stage.

Combining Staging Areas

When a player is instructed to combine staging areas with another staging area, each enemy and location card in that player's staging area is added to the other staging area. Enemies engaged with a player remain engaged with him.

Immune to Play Card Effects

Cards with the text 'Immune to player card effects' ignore the effects of all player cards. Additionally, cards that are immune to player card effects cannot be chosen as targets of player card effects.",
                OppositeText =
                    @"Campaign Mode

Fog on the Barrow-downs can be played as part of The Lord of the Rings campaign. It should be played before A Knife in the ~Dark, found in The Black Riders Saga Expansion. To play Fog on the Barrow-downs in campaign mode, follow the setup instructions found on page 2 of The Black Riders rules insert.

Campaign Mode Components

Fog on the Barrow-downs expansion includes 2 cards that can only be used when playing the scenario in campaign mode: one double-sided campaign card and one boon card. The description for each of these card types can be found on page 4 of The Black Riders rules insert.

The Lord of the ~Rings: The Black Riders Saga Expansion is required to play Fog on the Barrow-downs in campaign mode.",
                Number   = 0,
                Quantity = 1,
                Artist   = Artist.Unknown
            });
            Cards.Add(new Card()
            {
                ImageType  = Models.ImageType.Png,
                Title      = "Aragorn",
                Id         = "AAF34EE7-24B9-4962-AE9F-079772089407",
                CardType   = CardType.Hero,
                Sphere     = Sphere.Leadership,
                ThreatCost = 12,
                IsUnique   = true,
                Attack     = 3,
                Defense    = 2,
                Willpower  = 2,
                HitPoints  = 5,
                Traits     = new List <string>()
                {
                    "Dúnedain.", "Noble.", "Ranger."
                },
                NormalizedTraits = new List <string> {
                    "Dunedain."
                },
                Text       = "Response: After Aragorn commits to a quest, spend 1 resource from his resource pool to ready him.",
                FlavorText = "\"I am Aragorn son of Arathorn; and if by life or death I can save you, I will.\" -The Fellowship of the Ring",
                Keywords   = new List <string>()
                {
                    "Sentinel."
                },
                Quantity = 1,
                Year     = 2014,
                Artist   = Artist.Sebastian_Giacobino,
                Number   = 1
            });
            Cards.Add(new Card()
            {
                Title              = "The House of Tom Bombadil",
                Id                 = "BACA2A71-4CE6-4003-B8D1-8279869DF137",
                CardType           = CardType.Quest,
                HasSecondImage     = true,
                ScenarioNumber     = 5,
                StageNumber        = 1,
                QuestPoints        = 1,
                FlavorText         = "After rescuing the hobbits from Old Man Willow, Tom Bombadil has invited Frodo and his friends to stay the night in his house. There they are greeted warmly by his wife, Goldberry, the River-daughter.",
                Text               = "Setup: Set each copy of Great ~Barrow, Standing Stones, and Hollow Circle aside, out of play. Shuffle the encounter deck.",
                OppositeFlavorText = "\"Let us shit out the night!\" she said. \"For you are still afraid, perhaps, of mist and tree-shadows and deep water, and untame things. Fear nothing! For tonight you are under the roof of Tom Bombadil.\"\r\n-The Fellowship of the Ring",
                OppositeText       = "Skip the quest phase.\r\nForced: At the end of the round, place 1 progress on this stage.",
                EncounterSet       = "Fog on the Barrow-downs",
                Quantity           = 1,
                Number             = 1,
                Artist             = Artist.Emrah_Elmasli
            });
            Cards.Add(new Card()
            {
                Title          = "Across the Downs",
                Id             = "E15090E3-CF35-4BF5-9B89-38D09CA8A9E0",
                HasSecondImage = true,
                CardType       = Models.CardType.Quest,
                ScenarioNumber = 5,
                StageNumber    = 2,
                Text           = "When Revealed: Add Hollow Circle to the staging area. Each player reveals 1 encounter card.",
                OppositeText   = "Forced: At the end of the refresh phase, raise each player's threat by 1.\r\nThe players cannot defeat this stage unless Hollow Circle is in the victory display.",
                QuestPoints    = 14,
                EncounterSet   = "Fog on the Barrow-downs",
                Quantity       = 1,
                Number         = 2,
                Artist         = Artist.Emrah_Elmasli
            });
            Cards.Add(new Card()
            {
                Title          = "Lost in the Fog",
                Id             = "56D70012-B295-468A-9064-4E1C22BF9C9D",
                HasSecondImage = true,
                CardType       = Models.CardType.Quest,
                ScenarioNumber = 5,
                StageNumber    = 3,
                Text           = "When Revealed: The first player adds Standing Stones to the staging area. Each other player reveals 1 encounter card. Shuffle the encounter discard pile and each copy of Great Barrows into the encounter deck.",
                OppositeText   =
                    @"Progress cannot be placed here while Great Barrow is in play.

Forced: After a player is eliminated (at any stage), raise the threat of each player at this stage by 10.

The players cannot defeat this stage unless each player in the game is at this stage and Standing Stones is in the victory display. If the players defeat this stage, they win the game.",
                QuestPoints  = 16,
                EncounterSet = "Fog on the Barrow-downs",
                Quantity     = 1,
                Number       = 3,
                Artist       = Artist.Florian_Devos
            });
            Cards.Add(new Card()
            {
                Title          = "Trapped Inside a Barrow",
                Id             = "E84070BC-F6B6-4ED3-8CAC-158CE4268696",
                HasSecondImage = true,
                CardType       = Models.CardType.Quest,
                ScenarioNumber = 5,
                StageNumber    = 4,
                Text           = "When Revealed: End your quest phase (do not resolve the quest). Discard cards from the encounter deck until a Wight enemy is discarded. Add the discarded Wight enemy to the staging area. Discard all but X allies you control where X is the number of enemies engaged with you.",
                OppositeText   =
                    @"Forced: When a location is revealed at this stage, cancel its effects and discard it. Then, raise your threat by that card's Threat (including modifiers).

Forced: After this stage is defeated, advance to stage 3B at the beginning of the travel phase (combining staging areas with stage 3B) and place 1 progress on a Great Barrow at that stage.",
                QuestPoints  = 9,
                EncounterSet = "Fog on the Barrow-downs",
                Quantity     = 4,
                Number       = 4,
                Artist       = Artist.Mark_Bulahao
            });
            Cards.Add(new Card()
            {
                Title       = "Hollow Circle",
                IsUnique    = true,
                Id          = "5FC12A2C-1F79-4EEB-BC43-8432797DCCBC",
                CardType    = Models.CardType.Location,
                Threat      = 3,
                QuestPoints = 3,
                Traits      = new List <string> {
                    "Ruins.", "Downs."
                },
                Text          = "Immune to player card effects.\r\nTravel: Each player searches the encounter deck and discard pile for a Wight enemy and puts it into play engaged with him. Shuffle the encounter deck.",
                FlavorText    = "It was shapeless and yet significant: like a landmark, or a guarding finger, or more like a warning.\r\n-The Fellowship of the Ring",
                VictoryPoints = 3,
                EncounterSet  = "Fog on the Barrow-downs",
                Quantity      = 1,
                Number        = 5,
                Artist        = Artist.Jose_Vega
            });
            Cards.Add(new Card()
            {
                Title       = "Standing Stones",
                Id          = "80AA9A99-4DB0-403E-B013-557406F9C4AC",
                CardType    = Models.CardType.Location,
                Threat      = 4,
                QuestPoints = 4,
                Traits      = new List <string> {
                    "Ruins.", "Downs."
                },
                Text          = "Immune to player card effects.\r\nTravel: The first player searches the encounter deck, discard pile and victory display the a Great Barrow and adds it to the staging area. Shuffle the encounter deck.",
                FlavorText    = "He had passed between them almost before he was aware: and even as he did so darkness seemed to fall round him. -The Fellowship of the Ring",
                VictoryPoints = 3,
                EncounterSet  = "Fog on the Barrow-downs",
                Quantity      = 1,
                Number        = 6,
                Artist        = Artist.Jose_Vega
            });
            Cards.Add(new Card()
            {
                Title       = "Great Barrow",
                Id          = "20749647-0C3C-4BB8-ABD5-C9466452FC60",
                CardType    = Models.CardType.Location,
                Threat      = 1,
                QuestPoints = 1,
                Traits      = new List <string> {
                    "Ruins.", "Downs."
                },
                Keywords = new List <string> {
                    "Peril."
                },
                Text             = "Immune to player card effects. The player cannot travel hereo.\r\nForced: After Great Barrow enters the staging area, remove each character you control from the quest and create your own staging area. Then advance to a separate stage 4A by yourself.",
                VictoryPoints    = 5,
                EncounterSet     = "Fog on the Barrow-downs",
                Quantity         = 5,
                EasyModeQuantity = 3,
                Number           = 7,
                Artist           = Artist.Anthony_Devine
            });
            Cards.Add(new Card()
            {
                Title            = "Ancient Barrow",
                Id               = "DCECC2B9-7AAE-4E77-8268-07DD49FCFFF9",
                CardType         = Models.CardType.Location,
                Threat           = 0,
                IsVariableThreat = true,
                QuestPoints      = 4,
                Traits           = new List <string> {
                    "Ruins.", "Downs."
                },
                Text             = "X is 1 plus the number of facedown cards under this location.\r\nForced: After Ancient Barrow enters play, each player places an ally he controls facedown under this location. When Ancient Barrow leaves play as an explored location, return each ally under this location to its owner's hand.",
                EncounterSet     = "Fog on the Barrow-downs",
                Quantity         = 3,
                EasyModeQuantity = 2,
                Number           = 8,
                Artist           = Artist.Ferdinand_Dumago_Ladera
            });
            Cards.Add(new Card()
            {
                Title            = "Stone Ring",
                Id               = "3861F516-CB2D-407C-854D-3590572D69FC",
                CardType         = Models.CardType.Location,
                Threat           = 3,
                QuestPoints      = 3,
                Text             = "While Stone Ring is in the staging area, each Wight enemy engaged with a player gets +1 Attack and +1 Defense and applies the first sentence of its game text to each player at this stage as if it were engaged with him.",
                FlavorText       = "Stone rings grinned out of the ground like broken teeth in the moonlight. -The Fellowship of the Ring",
                EncounterSet     = "Fog on the Barrow-downs",
                Quantity         = 4,
                EasyModeQuantity = 3,
                Number           = 9,
                Artist           = Artist.Ferdinand_Dumago_Ladera
            });
            Cards.Add(new Card()
            {
                Title       = "North Downs",
                Id          = "A98F4E8A-B2DC-48BA-B0A1-FA7AA53A5597",
                CardType    = Models.CardType.Location,
                Threat      = 2,
                QuestPoints = 5,
                Traits      = new List <string> {
                    "Downs."
                },
                Text         = "While North Downs is in the staging area, characters use their Willpower instead of their Defense when defending against Wight enemies.",
                Shadow       = "Shadow: Attacking enemy gets +2 Attack. If this attack destroys a character, raise each player's threat by 2.",
                EncounterSet = "Fog on the Barrow-downs",
                Quantity     = 4,
                Number       = 10,
                Artist       = Artist.Emrah_Elmasli
            });
            Cards.Add(new Card()
            {
                Title          = "Barrow-wight",
                Id             = "74D9131D-BED7-4E9A-B649-05D4344ED339",
                CardType       = Models.CardType.Enemy,
                EngagementCost = 30,
                Threat         = 3,
                Attack         = 5,
                Defense        = 1,
                HitPoints      = 6,
                Traits         = new List <string> {
                    "Wight."
                },
                Text             = "While Barrow-wight is engaged with a player, that player's threat cannot be reduced.\r\nForced: After Barrow-wight attacks and destroys a character, that character's controller raises his threat by 2.",
                EncounterSet     = "Fog on the Barrow-downs",
                Quantity         = 4,
                EasyModeQuantity = 3,
                Number           = 11,
                Artist           = Artist.Anthony_Devine
            });
            Cards.Add(new Card()
            {
                Title          = "Cold-wight",
                Id             = "BE22869A-14ED-45ED-90E1-AA0D3A19A1FF",
                CardType       = Models.CardType.Enemy,
                EngagementCost = 35,
                Threat         = 2,
                Attack         = 4,
                Defense        = 1,
                HitPoints      = 5,
                Traits         = new List <string> {
                    "Wight."
                },
                Text         = "While Cold-wight is engaged with a player, that player cannot draw cards from card effects.\r\nForced: After Cold-wight attacks and destroys a character, that character's controller discards a random card from his hand.",
                EncounterSet = "Fog on the Barrow-downs",
                Quantity     = 3,
                Number       = 12,
                Artist       = Artist.Anthony_Devine
            });
            Cards.Add(new Card()
            {
                Title          = "Dark-wight",
                Id             = "6F3E5C9B-22B7-409A-B20C-578B49E419C7",
                CardType       = Models.CardType.Enemy,
                EngagementCost = 40,
                Threat         = 2,
                Attack         = 3,
                Defense        = 1,
                HitPoints      = 7,
                Traits         = new List <string> {
                    "Wight."
                },
                Text         = "While Dark-wight is engaged with a player, that player's heros cannot gain resources from card effects.\r\nForced: After Dark-wight attacks and destroys a character, that character's controller discards all resources from each hero he controls.",
                EncounterSet = "Fog on the Barrow-downs",
                Quantity     = 3,
                Number       = 13,
                Artist       = Artist.Anthony_Devine
            });
            Cards.Add(new Card()
            {
                Title            = "I'm Waiting for You!",
                Id               = "044CBEF3-2DFF-4153-9D8E-170826EB1B50",
                CardType         = Models.CardType.Treachery,
                Text             = "When Revealed: Each Wight enemy engaged with a player makes an immediate attack. If no attacks were made this way, I'm Waiting for You! gains surge.",
                Shadow           = "Shadow: Attacking enemy gets +1 Attack (+3 Attack instead if the defending character is an ally).",
                EncounterSet     = "Fog on the Barrow-downs",
                Quantity         = 2,
                EasyModeQuantity = 0,
                Number           = 14,
                Artist           = Artist.Anthony_Devine
            });
            Cards.Add(new Card()
            {
                Title    = "Long Groping Arm",
                Id       = "5CC082D1-028A-40B6-BA2B-551E8AC3AB34",
                CardType = Models.CardType.Treachery,
                Keywords = new List <string> {
                    "Peril."
                },
                Text         = "When Revealed: Until the end of the phase, each Wight enemy engaged with you contributes its Threat to the total Threat in the staging area. If no enemies are engaged with you, search the encounter deck and discard pile for a Wight enemy and put it into play engaged with you. Shuffle the encounter deck.",
                EncounterSet = "Fog on the Barrow-downs",
                Quantity     = 3,
                Number       = 15,
                Artist       = Artist.Mariusz_Gandzel
            });
            Cards.Add(new Card()
            {
                Title        = "Chill Fog",
                Id           = "38E841B2-29E8-496C-93A9-13C96031FC2E",
                CardType     = Models.CardType.Treachery,
                Text         = "When Revealed: Discard all resources in play. Each player raises his threat by 1 for each resource he discarded this way. If no resources were discarded this way, Chill Fog gains surge.",
                Shadow       = "Shadow: Raise your threat by 1 for each damage dealt by this attack.",
                EncounterSet = "Fog on the Barrow-downs",
                Quantity     = 2,
                Number       = 16,
                Artist       = Artist.Anthony_Feliciano
            });
            Cards.Add(new Card()
            {
                Title    = "Frozen by Fear",
                Id       = "35971087-EE5B-4075-AE12-4B730AA873EB",
                CardType = Models.CardType.Treachery,
                Keywords = new List <string> {
                    "Surge.", "Doomed 1."
                },
                Text             = "When Revealed: Until the end of the round, players cannot trigger Action or Response effects.",
                Shadow           = "Shadow: Until the end of the round, attacking enemy cannot take damage.",
                EncounterSet     = "Fog on the Barrow-downs",
                Quantity         = 3,
                EasyModeQuantity = 2,
                Number           = 17,
                Artist           = Artist.Rafal_Hrynkiewicz
            });
            Cards.Add(new Card()
            {
                Title    = "Dreadful Song",
                Id       = "A625C893-4B7B-4765-9E2B-FE403DD5548B",
                CardType = Models.CardType.Treachery,
                Traits   = new List <string> {
                    "Enchantment."
                },
                Keywords = new List <string> {
                    "Peril."
                },
                Text             = "When Revealed: Attach to a questing hero you control. Counts as a Condition attachment with the text: \"Limit 1 per hero. Attached hero's Willpower is 0. Forced: At the end of the round, raise your threat by 1 for each Wight enemy engaged with you.\"",
                EncounterSet     = "Fog on the Barrow-downs",
                Quantity         = 2,
                EasyModeQuantity = 1,
                Number           = 18,
                Artist           = Artist.Florian_Devos
            });
            Cards.Add(new Card()
            {
                Title     = "Tom Bombadil",
                IsUnique  = true,
                Id        = "A611EE75-F6C3-4BC6-97E2-B897F6A36DAC",
                CardType  = Models.CardType.Objective_Ally,
                Willpower = 3,
                Attack    = 3,
                Defense   = 3,
                HitPoints = 6,
                Traits    = new List <string> {
                    "Legend."
                },
                Text         = "When Revealed: Choose a player. That player gains control of Tom Bombadil, ready and committed to the quest. At the end of the round, discard Tom Bombadil. Then shuffle the encounter discard pile into the encounter deck. This effect cannot be canceled.",
                FlavorText   = "\"Tom Bom, Jolly Tom, Tom Bombadillo!\" -Tom Bombadil, The Fellowship of the Ring",
                EncounterSet = "Fog on the Barrow-downs",
                Quantity     = 1,
                Number       = 19,
                Artist       = Artist.Romana_Kendelic
            });
            Cards.Add(new Card()
            {
                Title            = "Fog on the Barrow-downs",
                OppositeTitle    = "The Lord of the Rings Part 1.2",
                SlugIncludesType = true,
                HasSecondImage   = true,
                Id       = "ACC07870-CD7F-4B88-A8A5-6C1FBFF6A55D",
                CardType = CardType.Campaign,
                Text     =
                    @"You are playing Campaign Mode.

Setup: While any player is at stage 4B, the first player cannot lose control of the first player token.",
                FlavorText         = "Even in the Shire the rumour of the Barrow-wights of the Barrow-downs beyond the Forest had been heard. But it was not a tale than any hobbit liked to listen to, even by a comfortable fireside far away. -The Fellowship of the Ring",
                OppositeText       = "Resolution: The players have earned the Ho! Tom Bombadil! boon card.",
                OppositeFlavorText = "At last they set off. They led their ponies down the hill; and then mounting they trotted quickly along the valley. They looked back and saw the top of the old mound on the hill, and from it the sunlight on the gold went up like a yellow flame. Then they turned a shoulder of the Downs and it was hidden from view.\r\n-The Fellowship of the Ring",
                EncounterSet       = "Fog on the Barrow-downs",
                Number             = 20,
                Quantity           = 1,
                Artist             = Artist.Emrah_Elmasli
            });
            Cards.Add(new Card()
            {
                Title        = "Ho! Tom Bombadil!",
                Id           = "82249D64-2D0A-484D-BB52-AA4F32D98A3E",
                CardType     = CardType.Event,
                CardSubtype  = CardSubtype.Boon,
                ResourceCost = 0,
                Traits       = new List <string> {
                    "Song."
                },
                Text          = "Setup: The first player adds this card to his hand.\r\nResponse: Add this card to the victory display and remove it from the campaign pool to cancel the \"when revealed\" effects of an encounter card just revealed from the encounter deck.",
                FlavorText    = "By fire, sun and moon, harken now and hear us!\r\nCome, Tom Bombadil, for our need is near us!\r\n-Frodo, The Fellowship of the Ring",
                VictoryPoints = 1,
                Number        = 21,
                Quantity      = 1,
                Artist        = Artist.Romana_Kendelic
            });
        }
コード例 #55
0
        private void Game_OnUpdate(EventArgs args)
        {
            if (!ObjectManager.Player.IsDead)
            {
                if (Orbwalking.CanMove(100))
                {
                    switch (MenuProvider.Orbwalker.ActiveMode)
                    {
                    case Orbwalking.OrbwalkingMode.Combo:
                    {
                        if (MenuProvider.Champion.Combo.UseQ)
                        {
                            if (Q.isReadyPerfectly())
                            {
                                if (ObjectManager.Player.Mana - Q.ManaCost > W.ManaCost)
                                {
                                    if (!MenuProvider.Champion.Combo.getBoolValue("Cast Q On Immobile Target Only"))
                                    {
                                        var Target = TargetSelector.GetTarget(Q.Range, Q.DamageType);
                                        if (Target != null)
                                        {
                                            Q.Cast(Target, false, true);
                                        }
                                    }
                                    else
                                    {
                                        var Target = HeroManager.Enemies.Where(x => x.IsValidTarget(Q.Range) && Q.GetPrediction(x).Hitchance >= HitChance.Immobile).OrderByDescending(x => TargetSelector.GetPriority(x)).FirstOrDefault();
                                        if (Target != null)
                                        {
                                            Q.Cast(Target, false, true);
                                        }
                                    }
                                }
                            }
                        }

                        if (MenuProvider.Champion.Combo.UseW)
                        {
                            if (W.isReadyPerfectly())
                            {
                                var Target = TargetSelector.GetTarget(W.Range, W.DamageType);

                                if (Target != null)
                                {
                                    if (MenuProvider.Champion.Combo.getBoolValue("Use Blue Card if Mana is Low") ? ObjectManager.Player.Mana - W.ManaCost < Q.ManaCost + W.ManaCost : false)
                                    {
                                        PickACard(Cards.Blue);
                                    }
                                    else
                                    {
                                        PickACard(Cards.Gold);
                                    }
                                }
                            }
                        }
                        break;
                    }

                    case Orbwalking.OrbwalkingMode.Mixed:
                    {
                        if (MenuProvider.Champion.Harass.UseQ)
                        {
                            if (ObjectManager.Player.isManaPercentOkay(MenuProvider.Champion.Harass.IfMana))
                            {
                                if (Q.isReadyPerfectly())
                                {
                                    var Target = TargetSelector.GetTarget(Q.Range, Q.DamageType);

                                    if (Target != null)
                                    {
                                        Q.Cast(Target, false, true);
                                    }
                                }
                            }
                        }

                        if (MenuProvider.Champion.Harass.UseW)
                        {
                            if (ObjectManager.Player.isManaPercentOkay(MenuProvider.Champion.Harass.IfMana))
                            {
                                if (W.isReadyPerfectly())
                                {
                                    var Target = TargetSelector.GetTarget(W.Range, W.DamageType);

                                    if (Target != null)
                                    {
                                        PickACard(Cards.Blue);
                                    }
                                }
                            }
                        }
                        break;
                    }

                    case Orbwalking.OrbwalkingMode.LaneClear:
                    {
                        //Laneclear
                        if (MenuProvider.Champion.Laneclear.UseQ)
                        {
                            if (ObjectManager.Player.isManaPercentOkay(MenuProvider.Champion.Laneclear.IfMana))
                            {
                                if (Q.isReadyPerfectly())
                                {
                                    var Farm = Q.GetLineFarmLocation(MinionManager.GetMinions(Q.Range));

                                    if (Farm.MinionsHit >= 5)
                                    {
                                        Q.Cast(Farm.Position);
                                    }
                                }
                            }
                        }

                        if (MenuProvider.Champion.Laneclear.UseW)
                        {
                            if (W.isReadyPerfectly())
                            {
                                var minioncount = MinionManager.GetMinions(float.MaxValue).Where(x => Orbwalking.InAutoAttackRange(x)).Count();

                                if (ObjectManager.Player.isManaPercentOkay(MenuProvider.Champion.Laneclear.IfMana))
                                {
                                    if (minioncount >= 4)
                                    {
                                        PickACard(Cards.Red);
                                    }
                                    else
                                    if (minioncount >= 1)
                                    {
                                        PickACard(Cards.Blue);
                                    }
                                }
                                else
                                {
                                    if (minioncount >= 1)
                                    {
                                        PickACard(Cards.Blue);
                                    }
                                }
                            }
                        }

                        //Jungleclear
                        if (MenuProvider.Champion.Jungleclear.UseQ)
                        {
                            if (ObjectManager.Player.isManaPercentOkay(MenuProvider.Champion.Jungleclear.IfMana))
                            {
                                if (Q.isReadyPerfectly())
                                {
                                    var Target = MinionManager.GetMinions(600, MinionTypes.All, MinionTeam.Neutral, MinionOrderTypes.MaxHealth).FirstOrDefault();
                                    if (Target != null)
                                    {
                                        Q.Cast(Target);
                                    }
                                }
                            }
                        }

                        if (MenuProvider.Champion.Jungleclear.UseW)
                        {
                            if (W.isReadyPerfectly())
                            {
                                var MinionCount = MinionManager.GetMinions(600, MinionTypes.All, MinionTeam.Neutral, MinionOrderTypes.MaxHealth).Count();

                                if (ObjectManager.Player.isManaPercentOkay(MenuProvider.Champion.Jungleclear.IfMana))
                                {
                                    if (MinionCount >= 3)
                                    {
                                        PickACard(Cards.Red);
                                    }
                                    else
                                    if (MinionCount >= 1)
                                    {
                                        PickACard(Cards.Blue);
                                    }
                                }
                                else
                                if (MinionCount >= 1)
                                {
                                    PickACard(Cards.Blue);
                                }
                            }
                        }
                        break;
                    }
                    }
                }

                if (MenuProvider.Champion.Misc.UseKillsteal)
                {
                    foreach (var Target in HeroManager.Enemies.Where(x => x.IsValidTarget()))
                    {
                        if (Target.isKillableAndValidTarget(Q.GetDamage(Target), TargetSelector.DamageType.Physical, Q.Range))
                        {
                            Q.Cast(Target, false, true);
                        }
                    }
                }

                if (MenuProvider.ChampionMenuInstance.Item("Pick A Card.Blue", true).GetValue <KeyBind>().Active)
                {
                    PickACard(Cards.Blue);
                }

                if (MenuProvider.ChampionMenuInstance.Item("Pick A Card.Red", true).GetValue <KeyBind>().Active)
                {
                    PickACard(Cards.Red);
                }

                if (MenuProvider.ChampionMenuInstance.Item("Pick A Card.Gold", true).GetValue <KeyBind>().Active)
                {
                    PickACard(Cards.Gold);
                }
            }
            else
            {
                CardiNeed = Cards.None;
            }

            if (Picking)
            {
                if (CardiNeed != Cards.None)
                {
                    if (W.Instance.Name.ToLowerInvariant() == CardiNeed.ToString().ToLowerInvariant() + "cardlock")
                    {
                        CardiNeed = Cards.None;
                        Utility.DelayAction.Add(100, () => W.Cast());
                    }
                }
            }
        }
コード例 #56
0
ファイル: TwistedFate.cs プロジェクト: waldow90/PortAIO
        private void Game_OnUpdate(EventArgs args)
        {
            if (!ObjectManager.Player.IsDead)
            {
                if (Orbwalking.CanMove(100))
                {
                    switch (MenuProvider.Orbwalker.ActiveMode)
                    {
                    case Orbwalking.OrbwalkingMode.Combo:
                    {
                        if (MenuProvider.Champion.Combo.UseQ)
                        {
                            if (_q.IsReadyPerfectly())
                            {
                                if (ObjectManager.Player.Mana - _q.ManaCost > _w.ManaCost)
                                {
                                    if (!MenuProvider.Champion.Combo.GetBoolValue("Cast Q On Immobile Target Only"))
                                    {
                                        var target = TargetSelector.GetTarget(_q.Range, _q.DamageType);
                                        if (target != null)
                                        {
                                            _q.Cast(target, false, true);
                                        }
                                    }
                                    else
                                    {
                                        var target =
                                            HeroManager.Enemies.Where(
                                                x =>
                                                x.IsValidTarget(_q.Range) &&
                                                _q.GetPrediction(x).Hitchance >= HitChance.Immobile)
                                            .OrderByDescending(TargetSelector.GetPriority)
                                            .FirstOrDefault();
                                        if (target != null)
                                        {
                                            _q.Cast(target, false, true);
                                        }
                                    }
                                }
                            }
                        }

                        if (MenuProvider.Champion.Combo.UseW)
                        {
                            if (_w.IsReadyPerfectly())
                            {
                                var target = TargetSelector.GetTarget(_w.Range, _w.DamageType);

                                if (target != null)
                                {
                                    if (MenuProvider.Champion.Combo.GetBoolValue("Use Blue Card if Mana is Low") &&
                                        ObjectManager.Player.Mana - _w.ManaCost < _q.ManaCost + _w.ManaCost)
                                    {
                                        PickACard(Cards.Blue);
                                    }
                                    else
                                    {
                                        PickACard(Cards.Gold);
                                    }
                                }
                            }
                        }
                        break;
                    }

                    case Orbwalking.OrbwalkingMode.Mixed:
                    {
                        if (MenuProvider.Champion.Harass.UseQ)
                        {
                            if (ObjectManager.Player.IsManaPercentOkay(MenuProvider.Champion.Harass.IfMana))
                            {
                                if (_q.IsReadyPerfectly())
                                {
                                    var target = TargetSelector.GetTarget(_q.Range, _q.DamageType);

                                    if (target != null)
                                    {
                                        _q.Cast(target, false, true);
                                    }
                                }
                            }
                        }

                        if (MenuProvider.Champion.Harass.UseW)
                        {
                            if (ObjectManager.Player.IsManaPercentOkay(MenuProvider.Champion.Harass.IfMana))
                            {
                                if (_w.IsReadyPerfectly())
                                {
                                    var target = TargetSelector.GetTarget(_w.Range, _w.DamageType);

                                    if (target != null)
                                    {
                                        PickACard(Cards.Blue);
                                    }
                                }
                            }
                        }
                        if (MenuProvider.Champion.Harass.UseRedCardToMinion)
                        {
                            if (ObjectManager.Player.IsManaPercentOkay(MenuProvider.Champion.Harass.IfMana))
                            {
                                if (_w.IsReadyPerfectly())
                                {
                                    var target        = TargetSelector.GetTarget(_w.Range, _w.DamageType);
                                    var redcardradius = 100;
                                    var minion        =
                                        MinionManager.GetMinions(ObjectManager.Player.Position,
                                                                 ObjectManager.Player.AttackRange).FirstOrDefault();
                                    if (minion != null && target != null && target.Distance(minion.Position) < redcardradius)
                                    {
                                        PickACard(Cards.Red);
                                        MenuProvider.Orbwalker.ForceTarget(minion);
                                    }
                                }
                            }
                        }
                        break;
                    }

                    case Orbwalking.OrbwalkingMode.LaneClear:
                    {
                        //Laneclear
                        if (MenuProvider.Champion.Laneclear.UseQ)
                        {
                            if (ObjectManager.Player.IsManaPercentOkay(MenuProvider.Champion.Laneclear.IfMana))
                            {
                                if (_q.IsReadyPerfectly())
                                {
                                    var farm = _q.GetLineFarmLocation(MinionManager.GetMinions(_q.Range));

                                    if (farm.MinionsHit >= 5)
                                    {
                                        _q.Cast(farm.Position);
                                    }
                                }
                            }
                        }

                        if (MenuProvider.Champion.Laneclear.UseW)
                        {
                            if (_w.IsReadyPerfectly())
                            {
                                var minioncount =
                                    MinionManager
                                    .GetMinions(float.MaxValue)
                                    .Count(Orbwalking.InAutoAttackRange);

                                if (ObjectManager.Player.IsManaPercentOkay(MenuProvider.Champion.Laneclear.IfMana))
                                {
                                    if (minioncount >= 4)
                                    {
                                        PickACard(Cards.Red);
                                    }
                                    else if (minioncount >= 1)
                                    {
                                        PickACard(Cards.Blue);
                                    }
                                }
                                else
                                {
                                    if (minioncount >= 1)
                                    {
                                        PickACard(Cards.Blue);
                                    }
                                }
                            }
                        }

                        //Jungleclear
                        if (MenuProvider.Champion.Jungleclear.UseQ)
                        {
                            if (ObjectManager.Player.IsManaPercentOkay(MenuProvider.Champion.Jungleclear.IfMana))
                            {
                                if (_q.IsReadyPerfectly())
                                {
                                    var target =
                                        MinionManager.GetMinions(600, MinionTypes.All, MinionTeam.Neutral,
                                                                 MinionOrderTypes.MaxHealth).FirstOrDefault();
                                    if (target != null)
                                    {
                                        _q.Cast(target);
                                    }
                                }
                            }
                        }

                        if (MenuProvider.Champion.Jungleclear.UseW)
                        {
                            if (_w.IsReadyPerfectly())
                            {
                                var minionCount =
                                    MinionManager.GetMinions(600, MinionTypes.All, MinionTeam.Neutral,
                                                             MinionOrderTypes.MaxHealth).Count;

                                if (ObjectManager.Player.IsManaPercentOkay(MenuProvider.Champion.Jungleclear.IfMana))
                                {
                                    if (minionCount >= 3)
                                    {
                                        PickACard(Cards.Red);
                                    }
                                    else if (minionCount >= 1)
                                    {
                                        PickACard(Cards.Blue);
                                    }
                                }
                                else if (minionCount >= 1)
                                {
                                    PickACard(Cards.Blue);
                                }
                            }
                        }
                        break;
                    }
                    }
                }

                if (MenuProvider.Champion.Misc.UseKillsteal)
                {
                    foreach (var target in HeroManager.Enemies.Where(x => x.IsValidTarget()))
                    {
                        if (target.IsKillableAndValidTarget(_q.GetDamage(target), TargetSelector.DamageType.Physical,
                                                            _q.Range))
                        {
                            _q.Cast(target, false, true);
                        }
                    }
                }

                if (MenuProvider.Champion.Misc.UseImmobileRedCard)
                {
                    if (_w.IsReadyPerfectly())
                    {
                        foreach (var target in HeroManager.Enemies.Where(x => x.IsValidTarget(ObjectManager.Player.AttackRange)))
                        {
                            foreach (var buff in target.Buffs.Where(x => BuffTypes.Contains(x.Type)))
                            {
                                var ttime    = ObjectManager.Player.Distance(target) / _w.Speed + _w.Delay;
                                var duration = buff.EndTime - Game.Time;
                                if (duration > ttime)
                                {
                                    PickACard(Cards.Red);
                                    MenuProvider.Orbwalker.ForceTarget(target);
                                }
                            }
                        }
                    }
                }

                if (MenuProvider.ChampionMenuInstance.Item("Pick A Card.Blue", true).GetValue <KeyBind>().Active)
                {
                    PickACard(Cards.Blue);
                }

                if (MenuProvider.ChampionMenuInstance.Item("Pick A Card.Red", true).GetValue <KeyBind>().Active)
                {
                    PickACard(Cards.Red);
                }

                if (MenuProvider.ChampionMenuInstance.Item("Pick A Card.Gold", true).GetValue <KeyBind>().Active)
                {
                    PickACard(Cards.Gold);
                }
            }
            else
            {
                _cardiNeed = Cards.None;
            }

            if (_w.IsReadyPerfectly() && _w.Instance.Name != "PickACard")
            {
                if (_cardiNeed != Cards.None)
                {
                    if (_w.Instance.Name.ToLowerInvariant().Contains(_cardiNeed.ToString().ToLowerInvariant() + "cardlock"))
                    {
                        _cardiNeed = Cards.None;
                        _w.Cast();
                    }
                }
            }
        }
コード例 #57
0
ファイル: Player.cs プロジェクト: litsungyi/Hanabi
 private void AddCard(Card card)
 {
     Cards.Add(card);
 }
コード例 #58
0
        public void SecretOrderOfPlay()
        {
            var game = new Game(new GameConfig
            {
                StartPlayer      = 1,
                Player1HeroClass = CardClass.MAGE,
                Player1Deck      = new List <Card>()
                {
                    Cards.FromName("Vaporize"),
                    Cards.FromName("Ice Barrier"),
                    Cards.FromName("Stonetusk Boar"),
                    Cards.FromName("Stonetusk Boar")
                },
                Player2HeroClass = CardClass.HUNTER,
                Player2Deck      = new List <Card>()
                {
                    Cards.FromName("Stonetusk Boar"),
                    Cards.FromName("Freezing Trap"),
                    Cards.FromName("Explosive Trap"),
                    Cards.FromName("Freezing Trap"),
                    Cards.FromName("Explosive Trap"),
                    Cards.FromName("Misdirection"),
                    Cards.FromName("Explosive Trap"),
                    Cards.FromName("Misdirection")
                },
                Shuffle              = false,
                FillDecks            = true,
                FillDecksPredictably = true
            });

            game.StartGame();
            game.Player1.BaseMana = 10;
            game.Player2.BaseMana = 10;
            game.Process(PlayCardTask.Spell(game.CurrentPlayer, "Vaporize"));
            game.Process(PlayCardTask.Spell(game.CurrentPlayer, "Ice Barrier"));
            game.Process(EndTurnTask.Any(game.CurrentPlayer));
            game.Process(PlayCardTask.Minion(game.CurrentPlayer, "Stonetusk Boar"));
            game.Process(MinionAttackTask.Any(game.CurrentPlayer, game.CurrentPlayer.BoardZone[0], game.CurrentOpponent.Hero));
            Assert.Equal(0, game.CurrentPlayer.BoardZone.Count);
            Assert.Equal(8, game.CurrentOpponent.Hero.Armor);
            game.Process(PlayCardTask.Spell(game.CurrentPlayer, "Freezing Trap"));
            game.Process(PlayCardTask.Spell(game.CurrentPlayer, "Explosive Trap"));
            game.Process(EndTurnTask.Any(game.CurrentPlayer));
            game.Process(PlayCardTask.Minion(game.CurrentPlayer, "Stonetusk Boar"));
            game.Process(MinionAttackTask.Any(game.CurrentPlayer, game.CurrentPlayer.BoardZone[0], game.CurrentOpponent.Hero));
            Assert.Equal(0, game.CurrentPlayer.BoardZone.Count);
            Assert.Equal(0, game.CurrentOpponent.SecretZone.Count);
            Assert.Equal(6, game.CurrentPlayer.Hero.Armor);
            game.Process(EndTurnTask.Any(game.CurrentPlayer));
            game.Process(PlayCardTask.Spell(game.CurrentPlayer, "Explosive Trap"));
            game.Process(PlayCardTask.Spell(game.CurrentPlayer, "Freezing Trap"));
            game.Process(EndTurnTask.Any(game.CurrentPlayer));
            game.Process(PlayCardTask.Minion(game.CurrentPlayer, "Stonetusk Boar"));
            game.Process(MinionAttackTask.Any(game.CurrentPlayer, game.CurrentPlayer.BoardZone[0], game.CurrentOpponent.Hero));
            Assert.Equal(0, game.CurrentPlayer.BoardZone.Count);
            Assert.Equal(1, game.CurrentOpponent.SecretZone.Count);
            Assert.Equal(4, game.CurrentPlayer.Hero.Armor);
            game.Process(EndTurnTask.Any(game.CurrentPlayer));
            game.Process(PlayCardTask.Spell(game.CurrentPlayer, "Misdirection"));
            game.Process(EndTurnTask.Any(game.CurrentPlayer));
            game.Process(PlayCardTask.Minion(game.CurrentPlayer, "Stonetusk Boar"));
            game.Process(MinionAttackTask.Any(game.CurrentPlayer, game.CurrentPlayer.BoardZone[0], game.CurrentOpponent.Hero));
            Assert.Equal(0, game.CurrentPlayer.BoardZone.Count);
            Assert.Equal(1, game.CurrentOpponent.SecretZone.Count);
            game.Process(PlayCardTask.Minion(game.CurrentPlayer, "Stonetusk Boar"));
            game.Process(MinionAttackTask.Any(game.CurrentPlayer, game.CurrentPlayer.BoardZone[0], game.CurrentOpponent.Hero));
            Assert.Equal(3, game.CurrentPlayer.Hero.Armor);
            game.Process(EndTurnTask.Any(game.CurrentPlayer));
            game.Process(PlayCardTask.Spell(game.CurrentPlayer, "Explosive Trap"));
            game.Process(PlayCardTask.Spell(game.CurrentPlayer, "Misdirection"));
            game.Process(EndTurnTask.Any(game.CurrentPlayer));
            game.Process(MinionAttackTask.Any(game.CurrentPlayer, game.CurrentPlayer.BoardZone[0], game.CurrentOpponent.Hero));
            Assert.Equal(0, game.CurrentPlayer.BoardZone.Count);
            Assert.Equal(1, game.CurrentOpponent.SecretZone.Count);
            Assert.Equal(1, game.CurrentPlayer.Hero.Armor);
        }
コード例 #59
0
 public virtual void Insert(int index, Card card)
 {
     Cards.Insert(index, card);
 }
        public bool CanSnap(Cards stack)
        {
            var topCard = stack.FirstOrDefault();

            return(s_QueenOfSpades.Equals(topCard));
        }