示例#1
0
        static Question GetQuestionInfoWeapon()
        {
            string[] eids = { "atf", "skill", "star", "attr" };
            string[] cids = { "初始攻/防", "技能", "星级", "属性" };
            int      type = MathTool.GetRandom(eids.Length);

            int      weaponId = WeaponBook.GetRandWeaponId();
            Question question = new Question();

            question.info = string.Format("|以下哪一个武器的{0}是|Yellow|{1}||?", cids[type], WeaponBook.GetAttrByString(weaponId, eids[type]));
            question.ans  = new string[4];
            question.ans[MathTool.GetRandom(4)] = ConfigData.GetWeaponConfig(weaponId).Name;
            int idx = 0;
            SimpleSet <string> set = new SimpleSet <string>();

            set.Add(WeaponBook.GetAttrByString(weaponId, eids[type]));
            while (idx < 4)
            {
                if (question.ans[idx] != null)
                {
                    idx++;
                    continue;
                }

                int guessId = WeaponBook.GetRandWeaponId();
                if (!set.Has(ConfigData.GetWeaponConfig(guessId).Name) && WeaponBook.GetAttrByString(guessId, eids[type]) != WeaponBook.GetAttrByString(weaponId, eids[type]))
                {
                    question.ans[idx] = ConfigData.GetWeaponConfig(guessId).Name;
                    set.Add(ConfigData.GetWeaponConfig(guessId).Name);
                    idx++;
                }
            }
            question.result = ConfigData.GetWeaponConfig(weaponId).Name;
            return(question);
        }
示例#2
0
        public static Image GetCardImage(int cid, int width, int height)
        {
            switch (ConfigIdManager.GetCardType(cid))
            {
            case CardTypes.Monster: return(MonsterBook.GetMonsterImage(cid, width, height));

            case CardTypes.Weapon: return(WeaponBook.GetWeaponImage(cid, width, height));

            case CardTypes.Spell: return(SpellBook.GetSpellImage(cid, width, height));
            }
            return(SpecialCards.NullCard.GetCardImage(width, height));
        }
示例#3
0
 private void MonsterSkillViewForm_Click(object sender, EventArgs e)
 {
     if (tar != -1)
     {
         sel = tar;
         Skill skill = new Skill(skills[tar]);
         skillDesStr = string.Format("{0}:{1}", skill.SkillConfig.Name, skill.Descript);
         Invalidate(new Rectangle(65, cardHeight * yCount + 37 + cardHeight + 21, 500, 20));
         nlClickLabel1.ClearLabel();
         foreach (int mid in MonsterBook.GetSkillMids(skill.Id))
         {
             nlClickLabel1.AddLabel(ConfigData.GetMonsterConfig(mid).Name, mid);
         }
         foreach (int wid in WeaponBook.GetSkillWids(skill.Id))
         {
             nlClickLabel1.AddLabel(ConfigData.GetWeaponConfig(wid).Name, wid);
         }
         nlClickLabel1.Invalidate();
     }
 }
示例#4
0
        static Question GetQuestionWeaponInfo()
        {
            string[] eids = { "atf", "skill", "star", "attr" };
            string[] cids = { "初始攻/防", "技能", "星级", "属性" };
            int      type = MathTool.GetRandom(eids.Length);

            int      weaponId = WeaponBook.GetRandWeaponId();
            Question question = new Question();

            question.info = string.Format("|武器|Green|{0}||的{1}是?", ConfigData.GetWeaponConfig(weaponId).Name, cids[type]);
            question.ans  = new string[4];
            string weaponStr = WeaponBook.GetAttrByString(weaponId, eids[type]);

            question.ans[MathTool.GetRandom(4)] = weaponStr;
            int idx = 0;
            SimpleSet <string> set = new SimpleSet <string>();

            set.Add(weaponStr);
            while (idx < 4)
            {
                if (question.ans[idx] != null)
                {
                    idx++;
                    continue;
                }

                int    guessId  = WeaponBook.GetRandWeaponId();
                string guessStr = WeaponBook.GetAttrByString(guessId, eids[type]);
                if (!set.Has(guessStr))
                {
                    question.ans[idx] = guessStr;
                    set.Add(guessStr);
                    idx++;
                }
            }
            question.result = weaponStr;
            return(question);
        }
示例#5
0
 public Image GetImage(int width, int height)
 {
     return(WeaponBook.GetWeaponImage(avatar.Id, width, height));
 }