Beispiel #1
0
        public void UpdateSeed()
        {
            //UpdateHeroEnemy
            if (Seed.HeroEnemy != null)
            {
                Seed.HeroEnemy.CurrentHealth = (int)EnemyHeroHp.Value;
                Seed.HeroEnemy.CurrentArmor  = (int)EnemyHeroArmor.Value;
                Seed.HeroEnemy.CurrentAtk    = (int)EnemyHeroAtk.Value;
            }
            //UpdateHeroFriend
            if (Seed.HeroFriend != null)
            {
                Seed.HeroFriend.CurrentHealth = (int)FriendHeroHp.Value;
                Seed.HeroFriend.CurrentArmor  = (int)FriendHeroArmor.Value;
                Seed.HeroFriend.CurrentAtk    = (int)FriendHeroAtk.Value;
            }
            //UpdateWeaponEnemy
            if (WeaponEnemyId.BackColor != Color.Red)
            {
                string className = WeaponEnemyId.Text;
                Card   tmp       = Card.Create(className, true, GenerateId());

                if (tmp != null)
                {
                    Seed.WeaponEnemy = tmp;
                    Seed.WeaponEnemy.CurrentDurability = (int)WeaponEnnemyDurability.Value;
                    Seed.WeaponEnemy.CurrentAtk        = (int)WeaponEnnemyAtk.Value;
                }
                else
                {
                    Seed.WeaponEnemy = null;
                }
            }
            //UpdateWeaponFriend
            if (WeaponFriendId.BackColor != Color.Red)
            {
                string className = WeaponFriendId.Text;
                Card   tmp       = Card.Create(className, true, GenerateId());

                if (tmp != null)
                {
                    Seed.WeaponFriend = tmp;
                    Seed.WeaponFriend.CurrentDurability = (int)WeaponFriendDurability.Value;
                    Seed.WeaponFriend.CurrentAtk        = (int)WeaponFriendAtk.Value;
                }
                else
                {
                    Seed.WeaponFriend = null;
                }
            }
            //UpdateHand
            foreach (object o in HandComboBox.Items)
            {
                ComboBoxItem item = o as ComboBoxItem;
                Seed.Hand.Add(item.Value);
            }
            //UpdateMinionsFriend
            foreach (object o in FriendMinionComboBox.Items)
            {
                ComboBoxItem item = o as ComboBoxItem;
                Seed.MinionFriend.Add(item.Value);
            }
            //UpdateMinionsEnemy
            foreach (object o in MinionEnemyComboBox.Items)
            {
                ComboBoxItem item = o as ComboBoxItem;
                Seed.MinionEnemy.Add(item.Value);
            }
            //UpdateSecrets
            foreach (object o in SecretComboBox.Items)
            {
                ComboBoxItem item = o as ComboBoxItem;
                Seed.Secret.Add(item.Value);
            }
            Seed.ManaAvailable = (int)Mana.Value;

            Card   AbilityFriend = null;
            string hero          = "";

            switch (cmbBoxLocalHero.Text)
            {
            case "Druid":
                AbilityFriend = Card.Create("CS2_017", true, GenerateId());
                break;

            case "Hunter":
                AbilityFriend = Card.Create("DS1h_292", true, GenerateId());
                break;

            case "Mage":
                AbilityFriend = Card.Create("CS2_034", true, GenerateId());
                break;

            case "Paladin":
                AbilityFriend = Card.Create("CS2_101", true, GenerateId());
                break;

            case "Priest":
                AbilityFriend = Card.Create("CS1h_001", true, GenerateId());
                break;

            case "Rogue":
                AbilityFriend = Card.Create("CS2_083b", true, GenerateId());
                break;

            case "Shaman":
                AbilityFriend = Card.Create("CS2_049", true, GenerateId());
                break;

            case "Warlock":
                AbilityFriend = Card.Create("CS2_056", true, GenerateId());
                break;

            case "Warrior":
                AbilityFriend = Card.Create("CS2_102", true, GenerateId());
                break;

            default:
                break;
            }
            Seed.Ability = AbilityFriend;
        }
Beispiel #2
0
 public void UpdateUI()
 {
     //UpdateHeroEnemy
     if (Seed.HeroEnemy != null)
     {
         EnemyHeroHp.Value    = Seed.HeroEnemy.CurrentHealth;
         EnemyHeroArmor.Value = Seed.HeroEnemy.CurrentArmor;
         EnemyHeroAtk.Value   = Seed.HeroEnemy.CurrentAtk;
     }
     //UpdateHeroFriend
     if (Seed.HeroFriend != null)
     {
         FriendHeroHp.Value    = Seed.HeroFriend.CurrentHealth;
         FriendHeroArmor.Value = Seed.HeroFriend.CurrentArmor;
         FriendHeroAtk.Value   = Seed.HeroFriend.CurrentAtk;
     }
     //UpdateWeaponEnemy
     if (Seed.WeaponEnemy != null)
     {
         WeaponEnemyId.Text           = Seed.WeaponEnemy.template.Id;
         WeaponEnnemyDurability.Value = Seed.WeaponEnemy.CurrentDurability;
         WeaponEnnemyAtk.Value        = Seed.WeaponEnemy.CurrentAtk;
     }
     //UpdateWeaponFriend
     if (Seed.WeaponFriend != null)
     {
         WeaponFriendId.Text          = Seed.WeaponFriend.template.Id;
         WeaponFriendDurability.Value = Seed.WeaponFriend.CurrentDurability;
         WeaponFriendAtk.Value        = Seed.WeaponFriend.CurrentAtk;
     }
     //UpdateHand
     foreach (Card c in Seed.Hand)
     {
         ComboBoxItem item = new ComboBoxItem();
         item.Label = "[" + c.template.Id + "]" + c.template.Name;
         item.Value = c;
         HandComboBox.Items.Add(item);
     }
     //UpdateMinionsFriend
     foreach (Card c in Seed.MinionFriend)
     {
         ComboBoxItem item = new ComboBoxItem();
         item.Label = "[" + c.template.Id + "]" + c.template.Name + " - " + c.Index.ToString();
         item.Value = c;
         FriendMinionComboBox.Items.Add(item);
     }
     //UpdateMinionsEnemy
     foreach (Card c in Seed.MinionEnemy)
     {
         ComboBoxItem item = new ComboBoxItem();
         item.Label = "[" + c.template.Id + "]" + c.template.Name + " - " + c.Index.ToString();
         item.Value = c;
         MinionEnemyComboBox.Items.Add(item);
     }
     //UpdateSecrets
     foreach (Card c in Seed.Secret)
     {
         ComboBoxItem item = new ComboBoxItem();
         item.Label = "[" + c.template.Id + "]" + c.template.Name;
         item.Value = c;
         SecretComboBox.Items.Add(item);
     }
     //UpdateMana
     Mana.Value = Seed.ManaAvailable;
 }