Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
        public override void DrawOnCardDetail(Graphics g, int offX, int offY)
        {
            SpellConfig spellConfig = spell.SpellConfig;
            CardAssistant.DrawBase(g, spell.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 - spellConfig.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, offX + 10, basel + 20 + i * 30, 180, 15);
            }
            g.FillRectangle(headerBack, offX + 10, basel + 40, 180, 20);
            for (int i = 0; i < 2; i++)
            {
                g.FillRectangle(lineBack, offX + 10, basel + 75 + i * 30, 180, 15);
            }
            g.FillRectangle(headerBack, offX + 10, basel + 135, 180, 20);

            g.FillRectangle(lineBack, offX + 10, basel + 155, 180, 45);
            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);
            SolidBrush sb = new SolidBrush(Color.FromArgb(100, 50, 0));
            g.DrawString(spellConfig.Name, fontblack, Brushes.White, offX + 10, basel + 2);
            g.DrawImage(HSIcons.GetIconsByEName("spl" + (spellConfig.Type - 200+1)), 60 + offX, basel - 40, 24, 24);
            g.DrawImage(HSIcons.GetIconsByEName("atr" + spellConfig.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, offX + 10, basel + 42);
            Adder add = new Adder(basel + 61, 15);
            g.DrawString(string.Format("伤害 {0,3:D}", spell.Damage), fontsong, sb, offX + 10, add.Next);
            PaintTool.DrawValueLine(g, spell.Damage / 5, 70 + offX, add.Now+1, 115, 10);
            g.DrawString(string.Format("治疗 {0,3:D}", spell.Cure), fontsong, sb, offX + 10, add.Next);
            PaintTool.DrawValueLine(g, spell.Cure / 5, 70 + offX, add.Now + 1, 115, 10);
            g.DrawString(string.Format("持续 {0,3:D}", (int)spell.Time), fontsong, sb, 10 + offX, add.Next);
            PaintTool.DrawValueLine(g, (int)(spell.Time * 10), 70 + offX, add.Now + 1, 115, 10);
            g.DrawString(string.Format("辅助 {0,3:D}", (int)spell.Help), fontsong, sb, 10 + offX, add.Next);
            PaintTool.DrawValueLine(g, (int)(spell.Help * 10), 70 + offX, add.Now + 1, 115, 10);
            g.DrawString(string.Format("几率 {0,3:D}", (int)spell.Rate), fontsong, sb, 10 + offX, add.Next);
            PaintTool.DrawValueLine(g, (int)spell.Rate, 70 + offX, add.Now + 1, 115, 10);
            g.DrawString("效果", fontblack, Brushes.White, offX + 10, basel + 137);
            string des = spell.Descript;
            PaintTool.DrawStringMultiLine(g, fontsong, sb, offX + 10, basel + 61 + 95, 15, 13, des);
            fontblack.Dispose();
            fontsong.Dispose();
            sb.Dispose();
        }