Esempio n. 1
0
        public void Effect(Forms.BasePanel panel, HsActionCallback success, HsActionCallback fail)
        {
            if (type == "item")
            {
                UserProfile.InfoBag.AddItem(infos[0], 1);
                HItemConfig itemConfig = ConfigData.GetHItemConfig(infos[0]);
                panel.AddFlowCenter(string.Format("获得{0}x1", itemConfig.Name), HSTypes.I2RareColor(itemConfig.Rare));
            }
            else if (type == "mon")
            {
                PeopleBook.Fight(infos[0], "oneline", mlevel + infos[1], new PeopleFightParm(), success, fail, null);
                return;
            }
            else if (type == "gold")
            {
                UserProfile.InfoBag.AddResource(GameResourceType.Gold, (uint)infos[0]);
                panel.AddFlowCenter(string.Format("获得黄金x{0}", infos[0]), HSTypes.I2ResourceColor(0));
            }
            else if (type == "resource")
            {
                UserProfile.InfoBag.AddResource((GameResourceType)(infos[0] - 1), 1);
                panel.AddFlowCenter(string.Format("获得{1}x{0}", 1, HSTypes.I2Resource(infos[0] - 1)), HSTypes.I2ResourceColor(infos[0] - 1));
            }
            string word = MazeItemConfig.Word;

            if (word != "")
            {
                panel.AddFlowCenter(word, "White");
            }
            success();
        }
Esempio n. 2
0
 internal void AddResource(GameResourceType type, uint value)
 {
     Resource.Add(type, (int)value);
     if (type > 0)
     {
         MainTipManager.AddTip(string.Format("|获得|{0}|{1}||x{2}", HSTypes.I2ResourceColor((int)type), HSTypes.I2Resource((int)type), value), "White");
         AchieveBook.CheckByCheckType("resource");
     }
 }
Esempio n. 3
0
        public void AddResource(int[] res)
        {
            Resource.Gold      += res[0];
            Resource.Lumber    += res[1];
            Resource.Stone     += res[2];
            Resource.Mercury   += res[3];
            Resource.Carbuncle += res[4];
            Resource.Sulfur    += res[5];
            Resource.Gem       += res[6];

            for (int i = 0; i < 7; i++)
            {
                if (res[i] > 0)
                {
                    MainTipManager.AddTip(string.Format("|获得|{0}|{1}||x{2}", HSTypes.I2ResourceColor(i), HSTypes.I2Resource(i), res[i]), "White");
                }
            }

            AchieveBook.CheckByCheckType("resource");
        }
Esempio n. 4
0
        public override Image GetPreview(CardPreviewType type, int[] parms)
        {
            const string stars = "★★★★★★★★★★";

            ControlPlus.TipImage tipData = new ControlPlus.TipImage();
            var cardQual = Config.CardConfigManager.GetCardConfig(CardId).Quality;

            tipData.AddTextNewLine(spell.SpellConfig.Name, HSTypes.I2QualityColor(cardQual), 20);
            tipData.AddText(string.Format("Lv{0}({1})", card.Level, spell.SpellConfig.Ename), "MediumAquamarine");
            tipData.AddTextNewLine(stars.Substring(10 - spell.SpellConfig.Star), "Yellow", 20);
            tipData.AddLine();
            if (spell.SpellConfig.JobId > 0)
            {
                var jobConfig = ConfigData.GetJobConfig(spell.SpellConfig.JobId);
                tipData.AddTextNewLine(string.Format("(限定职业:{0})", jobConfig.Name), "Red");
            }
            tipData.AddTextNewLine("类型/属性", "Gray");
            tipData.AddImage(HSIcons.GetIconsByEName("spl" + (spell.SpellConfig.Type - 200 + 1)));
            tipData.AddImage(HSIcons.GetIconsByEName("atr" + spell.SpellConfig.Attr));
            string des = spell.Descript;

            tipData.AddTextLines(des, "Cyan", 15, true);

            if (type == CardPreviewType.Shop)
            {
                tipData.AddLine();
                tipData.AddTextNewLine("价格", "White");
                for (int i = 0; i < 7; i++)
                {
                    if (parms[i] > 0)
                    {
                        tipData.AddText(" " + parms[i].ToString(), HSTypes.I2ResourceColor(i));
                        tipData.AddImage(HSIcons.GetIconsByEName("res" + (i + 1)));
                    }
                }
            }
            return(tipData.Image);
        }
Esempio n. 5
0
        public static Image GetPreview(int id)
        {
            TournamentConfig tournamentConfig = ConfigData.GetTournamentConfig(id);

            int[]         awardData    = tournamentConfig.Awards;
            RLIdValueList resourceData = tournamentConfig.Resource;

            int wid = 175;
            int heg = awardData.Length * 16;

            wid += 5; heg += 5;
            heg += 16 * 4 + 50;
            Bitmap   bmp = new Bitmap(wid, heg);
            Graphics g   = Graphics.FromImage(bmp);

            g.FillRectangle(Brushes.Black, 0, 0, wid, heg);
            g.FillRectangle(new SolidBrush(Color.FromArgb(30, 30, 30)), 0, 0, wid, 18);
            Pen pen = new Pen(Brushes.Gray, 2);

            g.DrawRectangle(pen, 1, 1, wid - 3, heg - 3);
            pen.Dispose();

            int  y         = 3;
            Font fontsong  = new Font("宋体", 9 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
            Font fontsongB = new Font("宋体", 9 * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel);

            g.DrawString("赛事名", fontsongB, Brushes.LightGray, 3, y);
            g.DrawString(tournamentConfig.Name, fontsong, Brushes.White, 53, y);
            y += 16;
            g.DrawString("比赛时间", fontsongB, Brushes.LightGray, 3, y);

            //     g.DrawString(string.Format("{0}-{1}", HSTime.GetByDate(begin_date).ToShortString(), HSTime.GetByDate(end_date).ToShortString()), fontsong, Brushes.LightGreen, 66, y);
            y += 16;
            g.DrawString("比赛地图", fontsongB, Brushes.LightGray, 3, y);
            Image mapback = BattleMapBook.GetMapImage(tournamentConfig.Map, TileConfig.Indexer.DefaultTile);

            g.DrawImage(mapback, new Rectangle(70, y, 100, 50), new Rectangle(0, 25, 100, 50), GraphicsUnit.Pixel);
            mapback.Dispose();
            y += 50;
            g.DrawString("等级限制", fontsongB, Brushes.LightGray, 3, y);
            g.DrawString(string.Format("{0}-{1}", tournamentConfig.MinLevel, tournamentConfig.MaxLevel), fontsong, Brushes.LightPink, 66, y);
            y += 16;
            g.DrawString("比赛奖励", fontsongB, Brushes.LightGray, 3, y);
            y += 16;
            for (int i = 0; i < awardData.Length; i++)
            {
                g.DrawString(string.Format("第{0}名 {1}积分", i + 1, awardData[i].ToString().PadLeft(2, ' ')), fontsong, Brushes.White, 33, y);
                if (i < resourceData.Count)
                {
                    if (resourceData[i].Id == 99)
                    {
                        g.DrawString(resourceData[i].Value.ToString().PadLeft(2, ' '), fontsong, Brushes.Cyan, 123, y);
                        g.DrawImage(HSIcons.GetIconsByEName("res8"), 143, y, 16, 16);
                    }
                    else
                    {
                        Brush brush = new SolidBrush(Color.FromName(HSTypes.I2ResourceColor(resourceData[i].Id)));
                        g.DrawString(resourceData[i].Value.ToString().PadLeft(2, ' '), fontsong, brush, 123, y);
                        g.DrawImage(HSIcons.GetIconsByEName("res" + (resourceData[i].Id + 1)), 143, y, 14, 14);
                        brush.Dispose();
                    }
                }
                y += 16;
            }
            fontsong.Dispose();
            fontsongB.Dispose();
            g.Dispose();
            return(bmp);
        }
Esempio n. 6
0
        public override Image GetPreview(CardPreviewType type, int[] parms)
        {
            const string stars = "★★★★★★★★★★";

            ControlPlus.TipImage tipData = new ControlPlus.TipImage();
            var cardQual = Config.CardConfigManager.GetCardConfig(CardId).Quality;

            tipData.AddTextNewLine(monster.Name, HSTypes.I2QualityColor(cardQual), 20);
            tipData.AddText(string.Format("Lv{0}({1})", card.Level, monster.MonsterConfig.Ename), "MediumAquamarine");
            tipData.AddTextNewLine(stars.Substring(10 - monster.MonsterConfig.Star), "Yellow", 20);
            tipData.AddLine();
            if (monster.MonsterConfig.JobId > 0)
            {
                var jobConfig = ConfigData.GetJobConfig(monster.MonsterConfig.JobId);
                tipData.AddTextNewLine(string.Format("(限定职业:{0})", jobConfig.Name), "Red");
            }
            tipData.AddTextNewLine("种族/属性", "Gray");
            tipData.AddImage(HSIcons.GetIconsByEName("rac" + monster.MonsterConfig.Type));
            tipData.AddImage(HSIcons.GetIconsByEName("atr" + monster.MonsterConfig.Attr));
            tipData.AddTextNewLine(string.Format("攻击 {0,3:D}  生命 {1,3:D}", monster.Atk, monster.Hp), "White");
            tipData.AddTextNewLine(string.Format("移动 {0,3:D}  射程 {1,3:D}", monster.Mov, monster.Range), "White");
            if (monster.Def > 0)
            {
                tipData.AddTextNewLine(string.Format("防御 +{0}", monster.Def), "Lime");
            }
            if (monster.Mag > 0)
            {
                tipData.AddTextNewLine(string.Format("魔力 +{0}", monster.Mag), "Lime");
            }
            if (monster.Spd > 0)
            {
                tipData.AddTextNewLine(string.Format("攻速 +{0}", monster.Spd), "Lime");
            }
            if (monster.Hit > 0)
            {
                tipData.AddTextNewLine(string.Format("命中 +{0}", monster.Hit), "Lime");
            }
            if (monster.Dhit > 0)
            {
                tipData.AddTextNewLine(string.Format("回避 +{0}", monster.Dhit), "Lime");
            }
            if (monster.Crt > 0)
            {
                tipData.AddTextNewLine(string.Format("暴击 +{0}", monster.Crt), "Lime");
            }
            if (monster.Luk > 0)
            {
                tipData.AddTextNewLine(string.Format("幸运 +{0}", monster.Luk), "Lime");
            }

            var skillList = MonsterBook.GetSkillList(monster.MonsterConfig.Id);

            if (skillList.Count > 0)
            {
                tipData.AddLine();
                foreach (var skill in skillList)
                {
                    int skillId = skill.Id;
                    tipData.AddTextNewLine("", "Red");
                    tipData.AddImage(SkillBook.GetSkillImage(skillId));

                    var    skillConfig = ConfigData.GetSkillConfig(skillId);
                    string des         = skillConfig.GetDescript(card.Level);
                    if (skillConfig.DescriptBuffId > 0)
                    {
                        des += ConfigData.GetBuffConfig(skillConfig.DescriptBuffId).GetDescript(card.Level);
                    }
                    tipData.AddTextLines(des, "Cyan", 15, false);
                }
            }

            if (type == CardPreviewType.Shop)
            {
                tipData.AddLine();
                tipData.AddTextNewLine("价格", "White");
                for (int i = 0; i < 7; i++)
                {
                    if (parms[i] > 0)
                    {
                        tipData.AddText(" " + parms[i].ToString(), HSTypes.I2ResourceColor(i));
                        tipData.AddImage(HSIcons.GetIconsByEName("res" + (i + 1)));
                    }
                }
            }

            return(tipData.Image);
        }
Esempio n. 7
0
        internal void AddResource(GameResourceType type, uint value)
        {
            Resource.Add(type, value);

            MainTipManager.AddTip(string.Format("|获得|{0}|{1}||x{2}", HSTypes.I2ResourceColor((int)type), HSTypes.I2Resource((int)type), value), "White");
        }
Esempio n. 8
0
        public override Image GetPreview(CardPreviewType type, int[] parms)
        {
            const string stars = "★★★★★★★★★★";

            ControlPlus.TipImage tipData = new ControlPlus.TipImage();
            var cardQual = Config.CardConfigManager.GetCardConfig(CardId).Quality;

            tipData.AddTextNewLine(weapon.WeaponConfig.Name, HSTypes.I2QualityColor(cardQual), 20);
            tipData.AddText(string.Format("Lv{0}({1})", card.Level, weapon.WeaponConfig.Ename), "MediumAquamarine");
            tipData.AddTextNewLine(stars.Substring(10 - weapon.WeaponConfig.Star), "Yellow", 20);
            tipData.AddLine();
            if (weapon.WeaponConfig.JobId > 0)
            {
                var jobConfig = ConfigData.GetJobConfig(weapon.WeaponConfig.JobId);
                tipData.AddTextNewLine(string.Format("(限定职业:{0})", jobConfig.Name), "Red");
            }
            tipData.AddTextNewLine("类型/属性", "Gray");
            tipData.AddImage(HSIcons.GetIconsByEName("wep" + (weapon.WeaponConfig.Type - 100 + 1)));
            tipData.AddImage(HSIcons.GetIconsByEName("atr" + weapon.WeaponConfig.Attr));
            if (weapon.Atk > 0)
            {
                tipData.AddTextNewLine(string.Format("攻击 +{0}", weapon.Atk), "White");
            }
            if (weapon.PArmor > 0)
            {
                tipData.AddTextNewLine(string.Format("物甲 +{0}", weapon.PArmor), "White");
            }
            if (weapon.MArmor > 0)
            {
                tipData.AddTextNewLine(string.Format("魔甲 +{0}", weapon.PArmor), "White");
            }
            if (weapon.Range > 0)
            {
                tipData.AddTextNewLine(string.Format("射程 ={0}", weapon.Range), "White");
            }
            if (weapon.Mov > 0)
            {
                tipData.AddTextNewLine(string.Format("移动 ={0}", weapon.Mov), "White");
            }

            if (weapon.Def > 0)
            {
                tipData.AddTextNewLine(string.Format("防御 +{0}", weapon.Def), "Lime");
            }
            if (weapon.Mag > 0)
            {
                tipData.AddTextNewLine(string.Format("魔力 +{0}", weapon.Mag), "Lime");
            }
            if (weapon.Spd > 0)
            {
                tipData.AddTextNewLine(string.Format("攻速 +{0}", weapon.Spd), "Lime");
            }
            if (weapon.Hit > 0)
            {
                tipData.AddTextNewLine(string.Format("命中 +{0}", weapon.Hit), "Lime");
            }
            if (weapon.Dhit > 0)
            {
                tipData.AddTextNewLine(string.Format("回避 +{0}", weapon.Dhit), "Lime");
            }
            if (weapon.Crt > 0)
            {
                tipData.AddTextNewLine(string.Format("暴击 +{0}", weapon.Crt), "Lime");
            }
            if (weapon.Luk > 0)
            {
                tipData.AddTextNewLine(string.Format("幸运 +{0}", weapon.Luk), "Lime");
            }
            tipData.AddTextNewLine(string.Format("耐久 {0}", weapon.Dura), "Lime");
            if (weapon.WeaponConfig.SkillId > 0)
            {
                tipData.AddLine();
                tipData.AddTextNewLine("", "Red");
                var skillId = weapon.WeaponConfig.SkillId;
                tipData.AddImage(SkillBook.GetSkillImage(skillId));

                var    skillConfig = ConfigData.GetSkillConfig(skillId);
                string des         = skillConfig.GetDescript(card.Level);
                if (skillConfig.DescriptBuffId > 0)
                {
                    des += ConfigData.GetBuffConfig(skillConfig.DescriptBuffId).GetDescript(card.Level);
                }
                tipData.AddTextLines(des, "Cyan", 15, false);
            }
            if (type == CardPreviewType.Shop)
            {
                tipData.AddLine();
                tipData.AddTextNewLine("价格", "White");
                for (int i = 0; i < 7; i++)
                {
                    if (parms[i] > 0)
                    {
                        tipData.AddText(" " + parms[i].ToString(), HSTypes.I2ResourceColor(i));
                        tipData.AddImage(HSIcons.GetIconsByEName("res" + (i + 1)));
                    }
                }
            }

            return(tipData.Image);
        }