コード例 #1
0
        internal override void Draw(Graphics g)
        {
            g.DrawImage(SkillBook.GetSkillImage(skillId, 24, 24), position.X, position.Y, 24, 24);

            g.DrawString(word, font, Brushes.Black, position.X + 27, position.Y + 1);
            Brush brush = new SolidBrush(color);

            g.DrawString(word, font, brush, position.X + 25, position.Y);
            brush.Dispose();
        }
コード例 #2
0
ファイル: MonsterCard.cs プロジェクト: jayrulez/TOMClassic
        public override void DrawOnCardDetail(Graphics g, int offX, int offY)
        {
            CardAssistant.DrawBase(g, monster.Id, offX + 10, offY + 10, 180, 200);

            int  basel = 210;
            Font font  = new Font("宋体", 10 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);

            g.DrawString(("★★★★★★★★★★").Substring(10 - monster.MonsterConfig.Star), font, Brushes.Yellow, offX + 30, offY + 30);
            font.Dispose();

            basel += offY;
            Brush headerBack = new SolidBrush(Color.FromArgb(190, 175, 160));
            Brush lineBack   = new SolidBrush(Color.FromArgb(215, 210, 200));

            g.FillRectangle(headerBack, offX + 10, basel, 180, 20);
            for (int i = 0; i < 1; i++)
            {
                g.FillRectangle(lineBack, 10 + offX, basel + 20 + i * 30, 180, 15);
            }
            g.FillRectangle(headerBack, 10 + offX, basel + 40, 180, 20);
            for (int i = 0; i < 4; i++)
            {
                g.FillRectangle(lineBack, 10 + offX, basel + 75 + i * 30, 180, 15);
            }
            g.FillRectangle(headerBack, 10 + offX, basel + 198, 180, 20);
            headerBack.Dispose();
            lineBack.Dispose();

            Font fontblack = new Font("黑体", 12 * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel);
            Font fontsong  = new Font("宋体", 10 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
            Font fontsong2 = new Font("宋体", 9 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);

            g.DrawString(monster.Name, fontblack, Brushes.White, offX + 10, basel + 2);
            g.DrawImage(HSIcons.GetIconsByEName("rac" + monster.MonsterConfig.Type), 60 + offX, basel - 40, 24, 24);
            g.DrawImage(HSIcons.GetIconsByEName("atr" + monster.MonsterConfig.Attr), 88 + offX, basel - 40, 24, 24);
            g.DrawString(string.Format("Lv{0:00}", card.Level), fontsong, Brushes.Indigo, 13 + offX, basel + 22);
            g.DrawImage(HSIcons.GetIconsByEName("oth10"), 56 + offX, basel + 22, 14, 14);
            g.DrawString(string.Format("({0}/{1})", card.Exp, ExpTree.GetNextRequiredCard(card.Level)), fontsong, Brushes.RoyalBlue, 70 + offX, basel + 22);
            g.DrawString("数据", fontblack, Brushes.White, 10 + offX, basel + 42);
            Adder      add = new Adder(basel + 61, 15);
            SolidBrush sb  = new SolidBrush(Color.FromArgb(100, 50, 0));

            g.DrawString(string.Format("攻击 {0,3:D}", monster.Atk), fontsong, sb, 10 + offX, add.Next);
            PaintTool.DrawValueLine(g, monster.Atk / 2, 70 + offX, add.Now + 1, 115, 10);
            g.DrawString(string.Format("生命 {0,3:D}", monster.Hp), fontsong, sb, 10 + offX, add.Next);
            PaintTool.DrawValueLine(g, monster.Hp / 10, 70 + offX, add.Now + 1, 115, 10);
            g.DrawString(string.Format("射程 {0,3:D}", monster.Range), fontsong, sb, 10 + offX, add.Next);
            PaintTool.DrawValueLine(g, monster.Range * 2, 70 + offX, add.Now + 1, 115, 10);
            g.DrawString(string.Format("移动 {0,3:D}", monster.Mov), fontsong, sb, 10 + offX, add.Next);
            PaintTool.DrawValueLine(g, monster.Mov * 2, 70 + offX, add.Now + 1, 115, 10);
            sb.Dispose();
            sb = new SolidBrush(Color.FromArgb(50, 0, 100));
            if (monster.Def != 0)
            {
                g.DrawString(string.Format("防御 {0}", GetValueStr(monster.Def)), fontsong, sb, 10 + offX, add.Next);
                PaintTool.DrawValueLine(g, monster.Def * 20, 70 + offX, add.Now + 1, 115, 10);
            }
            if (monster.Mag != 0)
            {
                g.DrawString(string.Format("魔力 {0}", GetValueStr(monster.Mag)), fontsong, sb, 10 + offX, add.Next);
                PaintTool.DrawValueLine(g, monster.Mag * 20, 70 + offX, add.Now + 1, 115, 10);
            }
            if (monster.Spd != 0)
            {
                g.DrawString(string.Format("攻速 {0}", GetValueStr(monster.Spd)), fontsong, sb, 10 + offX, add.Next);
                PaintTool.DrawValueLine(g, monster.Spd * 20, 70 + offX, add.Now + 1, 115, 10);
            }
            if (monster.Hit != 0)
            {
                g.DrawString(string.Format("命中 {0}", GetValueStr(monster.Hit)), fontsong, sb, 10 + offX, add.Next);
                PaintTool.DrawValueLine(g, monster.Hit * 20, 70 + offX, add.Now + 1, 115, 10);
            }
            if (monster.Dhit != 0)
            {
                g.DrawString(string.Format("回避 {0}", GetValueStr(monster.Dhit)), fontsong, sb, 10 + offX, add.Next);
                PaintTool.DrawValueLine(g, monster.Dhit * 20, 70 + offX, add.Now + 1, 115, 10);
            }
            if (monster.Crt != 0)
            {
                g.DrawString(string.Format("暴击 {0}", GetValueStr(monster.Crt)), fontsong, sb, 10 + offX, add.Next);
                PaintTool.DrawValueLine(g, monster.Crt * 20, 70 + offX, add.Now + 1, 115, 10);
            }
            if (monster.Luk != 0)
            {
                g.DrawString(string.Format("幸运 {0}", GetValueStr(monster.Luk)), fontsong, sb, 10 + offX, add.Next);
                PaintTool.DrawValueLine(g, monster.Luk * 20, 70 + offX, add.Now + 1, 115, 10);
            }

            g.DrawString("技能", fontblack, Brushes.White, 10 + offX, basel + 200);
            int skillindex = 0;

            foreach (var skill in MonsterBook.GetSkillList(monster.Id))
            {
                int skillId     = skill.Id;
                var skillConfig = ConfigData.GetSkillConfig(skillId);
                g.DrawImage(SkillBook.GetSkillImage(skillId), 10 + offX, basel + 221 + 45 * skillindex, 40, 40);

                Skill skillData = new Skill(skillId);
                skillData.UpgradeToLevel(card.Level);
                var des = string.Format("{0}:{1}", skillConfig.Name, skillData.Descript);
                if (skill.Value < 100)
                {
                    des = string.Format("{0}-{1}%:{2}", skillConfig.Name, skill.Value, skillData.Descript);
                }
                PaintTool.DrawStringMultiLine(g, fontsong2, sb, offX + 10 + 43, basel + 221 + 45 * skillindex, 14, 12, des);
                skillindex++;
            }

            fontsong.Dispose();
            fontsong2.Dispose();
            fontblack.Dispose();
            sb.Dispose();
        }
コード例 #3
0
ファイル: MonsterCard.cs プロジェクト: jayrulez/TOMClassic
        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);
        }
コード例 #4
0
        private Image GetMonsterImage()
        {
            ControlPlus.TipImage tipData = new ControlPlus.TipImage();
            var cardQual = Config.CardConfigManager.GetCardConfig(liveMonster.CardId).Quality;
            var name     = string.Format("{0}(Lv{1})", liveMonster.Avatar.Name, liveMonster.Level);

            tipData.AddTextNewLine(name, HSTypes.I2QualityColor(cardQual), 20);
            tipData.AddImage(HSIcons.GetIconsByEName("atr" + liveMonster.Avatar.MonsterConfig.Attr), 16, 16);
            tipData.AddImage(HSIcons.GetIconsByEName("rac" + liveMonster.Avatar.MonsterConfig.Type), 16, 16);
            tipData.AddLine();

            tipData.AddTextNewLine(string.Format("生命 {0}/{1}", liveMonster.Life, liveMonster.RealMaxHp), "Lime");
            if (liveMonster.HpBar.PArmor > 0)
            {
                AddText(tipData, "物甲", liveMonster.HpBar.PArmor, liveMonster.HpBar.PArmor, "LightGray", true);
            }
            if (liveMonster.HpBar.MArmor > 0)
            {
                AddText(tipData, "魔甲", liveMonster.HpBar.MArmor, liveMonster.HpBar.MArmor, "DodgerBlue", true);
            }
            AddText(tipData, "攻击", (int)liveMonster.Atk.Source, liveMonster.RealAtk, liveMonster.CanAttack ? "White" : "DarkGray", true);
            AddText(tipData, "移动", liveMonster.ReadMov, liveMonster.ReadMov, "White", false);
            AddText(tipData, "射程", liveMonster.RealRange, liveMonster.RealRange, "White", true);
            bool isLeft = false;

            if (liveMonster.RealDef != 0)
            {
                AddText(tipData, "防御", (int)liveMonster.Def.Source, liveMonster.RealDef, "White", isLeft);
                isLeft = !isLeft;
            }
            if (liveMonster.RealMag > 0)
            {
                AddText(tipData, "魔力", (int)liveMonster.Mag.Source, liveMonster.RealMag, "White", isLeft);
                isLeft = !isLeft;
            }
            if (liveMonster.RealSpd != 0)
            {
                AddText(tipData, "攻速", (int)liveMonster.Spd.Source, liveMonster.RealSpd, "White", isLeft);
                isLeft = !isLeft;
            }
            if (liveMonster.RealHit != 0)
            {
                AddText(tipData, "命中", (int)liveMonster.Hit.Source, liveMonster.RealHit, "White", isLeft);
                isLeft = !isLeft;
            }
            if (liveMonster.RealDHit != 0)
            {
                AddText(tipData, "回避", (int)liveMonster.Dhit.Source, liveMonster.RealDHit, "White", isLeft);
                isLeft = !isLeft;
            }
            if (liveMonster.RealCrt != 0)
            {
                AddText(tipData, "暴击", (int)liveMonster.Crt.Source, liveMonster.RealCrt, "White", isLeft);
                isLeft = !isLeft;
            }
            if (liveMonster.RealLuk != 0)
            {
                AddText(tipData, "幸运", (int)liveMonster.Luk.Source, liveMonster.RealLuk, "White", isLeft);
                isLeft = !isLeft;
            }

            foreach (var memBaseSkill in liveMonster.SkillManager.Skills)
            {
                tipData.AddImageNewLine(SkillBook.GetSkillImage(memBaseSkill.SkillId));

                if (liveMonster.SkillManager.InForget && memBaseSkill.Type != SkillSourceTypes.Weapon)
                {
                    tipData.AddText(string.Format("{0} X", memBaseSkill.SkillInfo.Name), "Red");
                    continue;
                }
                string tp = string.Format("{0}:{1}{2}", memBaseSkill.SkillInfo.Name, memBaseSkill.SkillInfo.Descript, memBaseSkill.Percent == 100 ? "" : string.Format("({0}%)", memBaseSkill.Percent));
                if (tp.Length > 20)
                {
                    tipData.AddText(tp.Substring(0, 19), "White");
                    tipData.AddTextNewLine(tp.Substring(19), "White");
                }
                else
                {
                    tipData.AddText(tp, "White");
                }
            }
            if (liveMonster.Weapon != null)
            {
                tipData.AddImageNewLine(liveMonster.Weapon.GetImage(16, 16));
                //todo weapon效果没有
                tipData.AddText(liveMonster.Weapon.Des, "White");
            }

            if (!liveMonster.IsGhost)//鬼不显示buff
            {
                liveMonster.BuffManager.DrawBuffToolTip(tipData);
            }

            return(tipData.Image);
        }
コード例 #5
0
        private void MonsterSkillViewForm_Paint(object sender, PaintEventArgs e)
        {
            BorderPainter.Draw(e.Graphics, "", Width, Height);

            Font font = new Font("黑体", 12 * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel);

            e.Graphics.DrawString(" 全技能 ", font, Brushes.White, 320, 8);
            font.Dispose();

            cardDetail.Draw(e.Graphics);
            e.Graphics.FillRectangle(Brushes.DarkGray, 67, 37, cardWidth * xCount - 4, 44);
            Image img = PicLoader.Read("System", "SearchBack.JPG");

            e.Graphics.DrawImage(img, 70, 40, cardWidth * xCount - 10, 38);
            img.Dispose();

            font = new Font("宋体", 9 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
            e.Graphics.DrawString("分类", font, Brushes.White, 86, 51);
            font.Dispose();

            font = new Font("宋体", 10 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
            Font fontblack = new Font("黑体", 12 * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel);

            e.Graphics.FillRectangle(new SolidBrush(Color.FromArgb(245, 244, 242)), 65, cardHeight * yCount + 35 + cardHeight, cardWidth * xCount, 93);
            e.Graphics.FillRectangle(new SolidBrush(Color.FromArgb(190, 175, 160)), 65, cardHeight * yCount + 35 + cardHeight, cardWidth * xCount, 20);
            e.Graphics.FillRectangle(new SolidBrush(Color.FromArgb(190, 175, 160)), 65, cardHeight * yCount + 75 + cardHeight, cardWidth * xCount, 20);
            e.Graphics.DrawString("技能说明", fontblack, Brushes.White, 65, cardHeight * yCount + 37 + cardHeight);
            if (!string.IsNullOrEmpty(skillDesStr))
            {
                e.Graphics.DrawString(skillDesStr, font, Brushes.SaddleBrown, 65 + 5, cardHeight * yCount + 37 + cardHeight + 21);
            }
            e.Graphics.DrawString("所有生物", fontblack, Brushes.White, 65, cardHeight * yCount + 77 + cardHeight);
            fontblack.Dispose();
            font.Dispose();

            if (show)
            {
                int pages     = totalCount / cardCount + 1;
                int cardLimit = (page < pages - 1) ? cardCount : (totalCount % cardCount);
                int former    = cardCount * page + 1;
                if (isDirty)
                {
                    tempImage.Dispose();
                    tempImage = new Bitmap(cardWidth * xCount, cardHeight * yCount);
                    Graphics g = Graphics.FromImage(tempImage);
                    for (int i = former - 1; i < former + cardLimit - 1; i++)
                    {
                        var cardImg = SkillBook.GetSkillImage(skills[i]);
                        if (cardImg == null)
                        {
                            continue;
                        }
                        g.DrawImage(cardImg, (i % xCount) * cardWidth, ((i / xCount) % yCount) * cardHeight, cardWidth, cardHeight);
                    }
                    g.Dispose();
                    isDirty = false;
                }
                e.Graphics.DrawImage(tempImage, 65, 35 + cardHeight);

                if (sel != -1 && sel < totalCount)
                {
                    SolidBrush yellowbrush = new SolidBrush(Color.FromArgb(80, Color.Lime));
                    int        x           = (sel % xCount) * cardWidth + 65;
                    int        y           = ((sel / xCount) % yCount) * cardHeight + 35 + cardHeight;
                    e.Graphics.FillRectangle(yellowbrush, x, y, cardWidth, cardHeight);
                    yellowbrush.Dispose();

                    Pen yellowpen = new Pen(Brushes.Lime, 3);
                    e.Graphics.DrawRectangle(yellowpen, x, y, cardWidth, cardHeight);
                    yellowpen.Dispose();
                }
                if (tar != -1 && tar < totalCount)
                {
                    int        x           = (tar % xCount) * cardWidth + 65;
                    int        y           = ((tar / xCount) % yCount) * cardHeight + 35 + cardHeight;
                    SolidBrush yellowbrush = new SolidBrush(Color.FromArgb(80, Color.Yellow));
                    e.Graphics.FillRectangle(yellowbrush, x, y, cardWidth, cardHeight);
                    yellowbrush.Dispose();

                    Pen yellowpen = new Pen(Brushes.Yellow, 3);
                    e.Graphics.DrawRectangle(yellowpen, x, y, cardWidth, cardHeight);
                    yellowpen.Dispose();
                }
            }
        }
コード例 #6
0
ファイル: WeaponCard.cs プロジェクト: jayrulez/TOMClassic
        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);
        }
コード例 #7
0
        public Image GetPreview()
        {
            EquipConfig equipConfig = ConfigData.GetEquipConfig(TemplateId);

            ControlPlus.TipImage tipData = new ControlPlus.TipImage();
            tipData.AddTextNewLine(equipConfig.Name, HSTypes.I2QualityColor(equipConfig.Quality), 20);
            tipData.AddTextNewLine(string.Format("       装备部位:{0}", HSTypes.I2EPosition(equipConfig.Position)), "White");
            tipData.AddTextNewLine(string.Format("       装备等级:{0}", equipConfig.Level), "White");
            tipData.AddTextNewLine("", "White");
            if (Atk > 0)
            {
                EquipAddonConfig eAddon = ConfigData.GetEquipAddonConfig((int)(EquipAttrs.AtkRate + 1));
                tipData.AddTextNewLine(string.Format(eAddon.Format, equipConfig.AtkR), HSTypes.I2EaddonColor(eAddon.Rare));
            }
            if (Hp > 0)
            {
                EquipAddonConfig eAddon = ConfigData.GetEquipAddonConfig((int)(EquipAttrs.HpRate + 1));
                tipData.AddTextNewLine(string.Format(eAddon.Format, equipConfig.VitR), HSTypes.I2EaddonColor(eAddon.Rare));
            }
            if (Spd > 0)
            {
                EquipAddonConfig eAddon = ConfigData.GetEquipAddonConfig((int)(EquipAttrs.Spd + 1));
                tipData.AddTextNewLine(string.Format(eAddon.Format, equipConfig.Spd), HSTypes.I2EaddonColor(eAddon.Rare));
            }
            if (Range > 0)
            {
                EquipAddonConfig eAddon = ConfigData.GetEquipAddonConfig((int)(EquipAttrs.Range + 1));
                tipData.AddTextNewLine(string.Format(eAddon.Format, equipConfig.Range), HSTypes.I2EaddonColor(eAddon.Rare));
            }

            if (equipConfig.EnergyRate[0] != 0 || equipConfig.EnergyRate[1] != 0 || equipConfig.EnergyRate[2] != 0)
            {
                tipData.AddLine();
                tipData.AddTextNewLine("能量回复比率修正", "White");
                tipData.AddTextNewLine(string.Format("LP {0}", equipConfig.EnergyRate[0].ToString().PadLeft(3, ' ')), "Gold");
                tipData.AddBarTwo(100, equipConfig.EnergyRate[0], Color.Yellow, Color.Gold);
                tipData.AddTextNewLine(string.Format("PP {0}", equipConfig.EnergyRate[1].ToString().PadLeft(3, ' ')), "Red");
                tipData.AddBarTwo(100, equipConfig.EnergyRate[1], Color.Pink, Color.Red);
                tipData.AddTextNewLine(string.Format("MP {0}", equipConfig.EnergyRate[2].ToString().PadLeft(3, ' ')), "Blue");
                tipData.AddBarTwo(100, equipConfig.EnergyRate[2], Color.Cyan, Color.Blue);
            }

            if (equipConfig.HeroSkillId > 0)
            {
                tipData.AddLine();
                tipData.AddImageNewLine(HeroPowerBook.GetImage(equipConfig.HeroSkillId));
                var    skillConfig = ConfigData.GetHeroPowerConfig(equipConfig.HeroSkillId);
                string tp          = string.Format("{0}:{1}", skillConfig.Name, skillConfig.Des);
                if (tp.Length > 12)
                {
                    tipData.AddText(tp.Substring(0, 11), "White");
                    tipData.AddTextNewLine(tp.Substring(11), "White");
                }
                else
                {
                    tipData.AddText(tp, "White");
                }
            }
            if (equipConfig.CommonSkillId > 0)
            {
                tipData.AddLine();
                tipData.AddImageNewLine(SkillBook.GetSkillImage(equipConfig.CommonSkillId));
                var    skillConfig = ConfigData.GetSkillConfig(equipConfig.CommonSkillId);
                string tp          = string.Format("{0}(被动)({2}%):{1}", skillConfig.Name, skillConfig.GetDescript(level), equipConfig.CommonSkillRate);
                if (tp.Length > 12)
                {
                    tipData.AddText(tp.Substring(0, 11), "White");
                    tipData.AddTextNewLine(tp.Substring(11), "White");
                }
                else
                {
                    tipData.AddText(tp, "White");
                }
            }
            tipData.AddLine();
            if (Dura > 0)//实例化了
            {
                tipData.AddTextNewLine(string.Format("耐久:{0}/{1}", Dura, equipConfig.Durable), "White");
            }
            else
            {
                tipData.AddTextNewLine(string.Format("最大耐久:{0}", equipConfig.Durable), "White");
            }
            if (ExpireTime > 0)//存在过期
            {
                var expireTime = TimeTool.UnixTimeToDateTime(ExpireTime);
                if (DateTime.Now >= expireTime.AddSeconds(-60))
                {
                    tipData.AddTextNewLine("即将过期", "Red");
                }
                else
                {
                    var timeDiffer = expireTime - DateTime.Now;
                    tipData.AddTextNewLine(string.Format("过期:{0}天{1}时{2}分", timeDiffer.Days, timeDiffer.Hours, timeDiffer.Minutes), "White");
                }
            }
            tipData.AddLine();
            tipData.AddTextNewLine(string.Format("出售价格:{0}", equipConfig.Value), "Yellow");
            tipData.AddImage(HSIcons.GetIconsByEName("res1"));
            tipData.AddImageXY(EquipBook.GetEquipImage(TemplateId), 8, 8, 48, 48, 7, 24, 32, 32);
            return(tipData.Image);
        }