示例#1
0
        private void DrawOnCardView(Graphics g, int cid, int x, int y, bool isSelected)
        {
            CardAssistant.DrawBase(g, cid, x, y, cardWidth, cardHeight);
            if (isSelected)
            {
                var brushes = new SolidBrush(Color.FromArgb(130, Color.Yellow));
                g.FillRectangle(brushes, x, y, cardWidth, cardHeight);
                brushes.Dispose();
            }

            var  cardConfigData = CardConfigManager.GetCardConfig(cid);
            Font font           = new Font("宋体", 5 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);

            g.DrawString(("★★★★★★★★★★").Substring(10 - cardConfigData.Star), font, Brushes.Yellow, x + 3, y + 3);
            font.Dispose();

            var quality = cardConfigData.Quality + 1;

            g.DrawImage(HSIcons.GetIconsByEName("gem" + quality), x + cardWidth / 2 - 8, y + cardHeight - 20, 16, 16);

            var jobId = cardConfigData.JobId;

            if (jobId > 0)
            {
                var   jobConfig = ConfigData.GetJobConfig(jobId);
                Brush brush     = new SolidBrush(Color.FromName(jobConfig.Color));
                g.FillRectangle(brush, x + cardWidth - 24, y + 4, 20, 20);
                g.DrawImage(HSIcons.GetIconsByEName("job" + jobConfig.JobIndex), x + cardWidth - 24, y + 4, 20, 20);
                brush.Dispose();
            }
        }
示例#2
0
        private Image GetPlayerImage()
        {
            ControlPlus.TipImage tipData = new ControlPlus.TipImage();
            tipData.AddTextNewLine(string.Format("Lv{0}", player.Level), "LightBlue", 20);
            tipData.AddTextNewLine("能量回复比率", "White");
            tipData.AddTextNewLine(string.Format("LP {0}", player.EnergyGenerator.RateLp.ToString().PadLeft(3, ' ')), "Gold");
            tipData.AddBar(100, player.EnergyGenerator.RateLp, Color.Yellow, Color.Gold);
            tipData.AddTextNewLine(string.Format("PP {0}", player.EnergyGenerator.RatePp.ToString().PadLeft(3, ' ')), "Red");
            tipData.AddBar(100, player.EnergyGenerator.RatePp, Color.Pink, Color.Red);
            tipData.AddTextNewLine(string.Format("MP {0}", player.EnergyGenerator.RateMp.ToString().PadLeft(3, ' ')), "Blue");
            tipData.AddBar(100, player.EnergyGenerator.RateMp, Color.Cyan, Color.Blue);

            player.TrapHolder.GenerateImage(tipData, player is HumanPlayer);

            var rival = player.Rival as Player;

            if (rival.HasHolyWord("witcheye"))
            {
                tipData.AddLine();
                tipData.AddTextNewLine("手牌", "White");
                for (int i = 0; i < 10; i++)
                {
                    var card = player.CardManager.GetDeckCardAt(i);
                    if (card.CardId > 0)
                    {
                        var cardConfig = CardConfigManager.GetCardConfig(card.CardId);
                        tipData.AddTextNewLine("-", "White");
                        tipData.AddImage(CardAssistant.GetCardImage(card.CardId, 20, 20));
                        tipData.AddText(string.Format("{0}({1}★)Lv{2}", cardConfig.Name, cardConfig.Star, card.Level), HSTypes.I2QualityColor(cardConfig.Quality));
                    }
                }
            }
            return(tipData.Image);
        }
示例#3
0
        public void Draw(Graphics g)
        {
            Image back = PicLoader.Read("System", "CardBack2.JPG");

            g.DrawImage(back, x, y, width - 1, height - 1);
            back.Dispose();

            if (show)
            {
                //   g.FillRectangle(PaintTool.GetBrushByAttribute(CardConfigManager.GetCardConfig(product.Cid).Attr), x + 10, y + 12, 70 - 2, 90 - 2);

                virtualRegion.Draw(g);

                CardAssistant.DrawBase(g, product.Cid, x + 12, y + 14, 64, 84);

                if (coverEffect != null)
                {
                    coverEffect.Draw(g);
                }

                if ((CardProductMarkTypes)product.Mark != CardProductMarkTypes.Null)
                {
                    Image marker = PicLoader.Read("System", string.Format("Mark{0}.PNG", (int)product.Mark));
                    g.DrawImage(marker, x + 28, y + 12, 50, 51);
                    marker.Dispose();
                }

                var cardConfigData = CardConfigManager.GetCardConfig(product.Cid);
                var quality        = cardConfigData.Quality + 1;
                g.DrawImage(HSIcons.GetIconsByEName("gem" + quality), x + width / 2 - 8, y + height - 44, 16, 16);
            }
        }
示例#4
0
        private void MessageBoxEx_Paint(object sender, PaintEventArgs e)
        {
            if (img != null)
            {
                e.Graphics.DrawImage(img, 38, 32, 100, 100);

                var deck = UserProfile.InfoCard.Decks[selectPage];
                for (int i = 0; i < deck.CardIds.Length; i++)
                {
                    int x = i % 6;
                    int y = i / 6;

                    var cardId = deck.CardIds[i];
                    e.Graphics.DrawImage(CardAssistant.GetCardImage(cardId, 100, 100), x * 20 + 150, y * 20 + 35, 20, 20);
                    var cardJob = CardConfigManager.GetCardConfig(cardId).JobId;
                    if (cardJob > 0 && cardJob != UserProfile.InfoBasic.Job)
                    {
                        var brush = new SolidBrush(Color.FromArgb(150, Color.Red));
                        e.Graphics.FillRectangle(brush, x * 20 + 150, y * 20 + 35, 20, 20);
                        brush.Dispose();
                        e.Graphics.DrawRectangle(Pens.Red, x * 20 + 150, y * 20 + 35, 20, 20);
                    }
                }
            }

            Font font = new Font("宋体", 9 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);

            e.Graphics.DrawString(string.Format("地形:{0}", tile == 0 ? "默认" : ConfigDatas.ConfigData.GetTileConfig(tile).Cname), font, Brushes.White, 63, 117);
            font.Dispose();
        }
示例#5
0
        public void UpgradeToLevel(int level)
        {
            var modify = CardAssistant.GetCardModify(SpellConfig.Quality, SpellConfig.Modify);

            Level = level;

            int standardValue = (20 + SpellConfig.Star * 12) * (level * 8 + 92) / 100 * (200 + modify) / 200;

            Damage = standardValue * (SpellConfig.Damage) / 100 * 5;
            Cure   = standardValue * (SpellConfig.Cure) / 100 * 5;
            Atk    = standardValue * (SpellConfig.Atk) / 100;//和monster的攻击一样
            if (Addon > 0 || Addon < 0)
            {
                Damage = (int)(Damage * (1 + Addon));
                Cure   = (int)(Cure * (1 + Addon));
            }

            double standardValue2 = Math.Sqrt(((double)level + 3) / 4) * (100 + SpellConfig.Modify) / 100;

            Time = SpellConfig.Time * standardValue2;
            Help = SpellConfig.Help * standardValue2;

            double standardValue3 = Math.Sqrt(((double)level + 7) / 8) * (100 + SpellConfig.Modify) / 100;

            Rate = SpellConfig.Rate * standardValue3;
            if (Rate > 100)
            {
                Rate = 100;
            }
        }
示例#6
0
        private void virtualRegion_RegionEntered(int id, int x, int y, int key)
        {
            Image image = null;

            if (id == 1)
            {//1一定是heroskill
                image = HeroPowerBook.GetPreview(key);
            }
            else
            {
                if (key > 0)
                {
                    var cellType = cellTypeList[id - 2];
                    if (cellType == PictureRegionCellType.Card)
                    {
                        image = CardAssistant.GetCard(key).GetPreview(CardPreviewType.Normal, new int[] { });
                    }
                    else if (cellType == PictureRegionCellType.Item)
                    {
                        image = HItemBook.GetPreview(key);
                    }
                    else if (cellType == PictureRegionCellType.Equip)
                    {
                        Equip equip = new Equip(key);
                        image = equip.GetPreview();
                    }
                }
            }
            if (image != null)
            {
                tooltip.Show(image, this, x, y);
            }
        }
示例#7
0
 private void virtualRegion_RegionEntered(int info, int mx, int my, int key)
 {
     if (info == 1 && product.Id > 0)
     {
         Image image = CardAssistant.GetCard(product.Cid).GetPreview(CardPreviewType.Shop, product.Price.ToArray());
         tooltip.Show(image, parent, mx, my, product.Id);
     }
 }
示例#8
0
            public Image ShowTip()
            {
                var      card = CardAssistant.GetCard(CardId);
                DeckCard dc   = new DeckCard(CardId, (byte)Level, 0);

                card.SetData(dc);
                return(card.GetPreview(CardPreviewType.Normal, new int[0]));
            }
示例#9
0
            public virtual void Draw(Graphics g)
            {
                var img = CardAssistant.GetCardImage(CardId, ItemWidth, ItemWidth);

                g.DrawImage(img, X, 2, ItemWidth, ItemWidth);
                Pen p = new Pen(IsLeft ? Brushes.Red : Brushes.Blue, 1);

                g.DrawRectangle(p, X, 2, ItemWidth, ItemWidth);
                p.Dispose();
            }
示例#10
0
        public void SetInfo(DeckCard dcard)
        {
            cid      = dcard.BaseId;
            level    = dcard.Level;
            lastCell = -1;
            skills   = new List <MonsterSkill>();
            string effectName = "";

            if (cid > 0)
            {
                card = CardAssistant.GetCard(cid);
                virtualRegion.SetRegionKey(3, CardConfigManager.GetCardConfig(cid).Quality + 1);
                var jobId = CardConfigManager.GetCardConfig(cid).JobId;
                if (jobId > 0)
                {
                    jobId = ConfigData.GetJobConfig(jobId).JobIndex;
                }
                virtualRegion.SetRegionKey(4, jobId);
                card.SetData(dcard);
                if (card.GetCardType() == CardTypes.Monster)
                {
                    MonsterCard monsterCard = card as MonsterCard;
                    if (monsterCard != null)
                    {
                        CheckMonster(monsterCard, ref effectName);
                    }
                }
            }

            string nowEffectName = "";

            if (coverEffect != null)
            {
                nowEffectName = coverEffect.Name;
            }

            if (effectName != nowEffectName)
            {
                if (effectName == "")
                {
                    coverEffect = null;
                }
                else
                {
                    coverEffect = new CoverEffect(EffectBook.GetEffect(effectName), new Point(X + 20, Y + 20), new Size(160, 180));
                }
            }

            tooltip.Hide(parent);

            if (Invalidate != null)
            {
                Invalidate();
            }
        }
示例#11
0
 private void virtualRegion_RegionEntered(int info, int mx, int my, int key)
 {
     if (info == 1 && card1 != -1)
     {
         Image image = CardAssistant.GetCard(card1).GetPreview(CardPreviewType.Normal, new int[] { });
         tooltip.Show(image, parent, mx, my, card1);
     }
     else if (info == 2 && card2 != -1)
     {
         Image image = CardAssistant.GetCard(card2).GetPreview(CardPreviewType.Normal, new int[] { });
         tooltip.Show(image, parent, mx, my, card2);
     }
 }
示例#12
0
        public void RefreshData(DbCardProduct pro)
        {
            show    = pro.Id != 0;
            product = pro;
            if (product.Id != 0)
            {
                virtualRegion.SetRegionKey(1, product.Cid);
            }

            string effectName = "";
            var    card       = CardAssistant.GetCard(product.Cid);

            if (card.GetCardType() == CardTypes.Monster)
            {
                MonsterConfig monsterConfig = ConfigData.GetMonsterConfig(product.Cid);
                foreach (var skill in MonsterBook.GetSkillList(monsterConfig.Id))
                {
                    int         skillId     = skill.Id;
                    SkillConfig skillConfig = ConfigData.GetSkillConfig(skillId);
                    if (skillConfig.Cover != null)
                    {
                        effectName = skillConfig.Cover;
                    }
                }
                if (monsterConfig.Cover != "")
                {
                    effectName = monsterConfig.Cover;
                }
            }

            string nowEffectName = "";

            if (coverEffect != null)
            {
                nowEffectName = coverEffect.Name;
            }

            if (effectName != nowEffectName)
            {
                if (effectName == "")
                {
                    coverEffect = null;
                }
                else
                {
                    coverEffect = new CoverEffect(EffectBook.GetEffect(effectName), new Point(x + 12, y + 14), new Size(64, 84));
                }
            }

            parent.Invalidate(new Rectangle(x + 12, y + 14, 64, 84));
        }
示例#13
0
        private void Region_RegionEntered(int id, int x, int y, int key)
        {
            if (cards.Count <= id - 1)
            {
                return;
            }

            var      card = CardAssistant.GetCard(cards[id - 1].ACard.CardId);
            DeckCard dc   = new DeckCard(card.CardId, (byte)cards[id - 1].ACard.Level, 0);

            card.SetData(dc);
            var img = card.GetPreview(CardPreviewType.Normal, new int[0]);

            tooltip.Show(img, this, x, y);
        }
示例#14
0
        private void CardList_Paint(object sender, PaintEventArgs e)
        {
            if (!show)
            {
                return;
            }

            int heg = Height;
            int wid = (Width - margin * 9) / 10;

            for (int i = 0; i < maxCards; i++)
            {
                e.Graphics.DrawImage(CardAssistant.GetCardImage(cards[i].CardId, 60, 60), (wid + margin) * i, 0, wid, heg);
            }
        }
示例#15
0
        private void MessageBoxEx_Paint(object sender, PaintEventArgs e)
        {
            if (sel >= 0)
            {
                DeckCard card = new DeckCard(UserProfile.InfoCard.GetDeckCardById(activeCids[sel]));
                e.Graphics.DrawImage(CardAssistant.GetCardImage(card.BaseId, 100, 100), 38, 62, 100, 100);

                Font         font  = new Font("Arial", 7 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
                const string stars = "★★★★★★★★★★";
                int          star  = CardConfigManager.GetCardConfig(card.BaseId).Star;
                e.Graphics.DrawString(stars.Substring(10 - star), font, Brushes.Yellow, 38, 62);

                e.Graphics.DrawString(string.Format("{0:00}", card.Level), font, Brushes.Gold, 38, 150);
                e.Graphics.FillRectangle(Brushes.Wheat, 53, 153, card.Exp * 80 / ExpTree.GetNextRequiredCard(card.Level), 5);
                e.Graphics.DrawRectangle(Pens.WhiteSmoke, 53, 153, 80, 5);
                font.Dispose();
            }
        }
示例#16
0
 private void OnVRegionEntered(int id, int x, int y, int key)
 {
     if (id > 0 && id < 10)
     {
         var pickCardId = cardOpenArray[id - 1];
         if (pickCardId > 0)
         {
             Image image = CardAssistant.GetCard(pickCardId).GetPreview(CardPreviewType.Normal, new int[] { });
             tooltip.Show(image, this, x, y);
         }
         else
         {
             tooltip.Hide(this);
         }
     }
     else
     {
         tooltip.Hide(this);
     }
 }
示例#17
0
        public void UpgradeToLevel(int level)
        {
            var modify = CardAssistant.GetCardModify(MonsterConfig.Quality, MonsterConfig.Modify);

            Level = level;

            int standardValue = (20 + MonsterConfig.Star * 12) * (level * 8 + 92) / 100 * (200 + modify) / 200;

            Atk = standardValue * (100 + MonsterConfig.AtkP) / 100;     //200
            Hp  = standardValue * (100 + MonsterConfig.VitP) / 100 * 5; //200
            if (Range != 10)
            {
                Atk = (int)(Atk * CardAssistant.GetCardFactorOnRange(Range));
                Hp  = (int)(Hp * CardAssistant.GetCardFactorOnRange(Range));
            }
            if (Mov != 10)
            {
                Atk = (int)(Atk * CardAssistant.GetCardFactorOnMove(Mov));
                Hp  = (int)(Hp * CardAssistant.GetCardFactorOnMove(Mov));
            }
        }
示例#18
0
        public void UpgradeToLevel(int level)
        {
            var modify = CardAssistant.GetCardModify(WeaponConfig.Quality, WeaponConfig.Modify);

            int standardValue = (20 + WeaponConfig.Star * 12) * (level * 8 + 92) / 100 * (200 + modify) / 200;

            standardValue = (int)((float)standardValue * 4 / WeaponConfig.Dura * (1 + (WeaponConfig.Dura - 4) * 0.1));//耐久低的武器总值削减
            Atk           = standardValue * (WeaponConfig.AtkP) / 100;
            PArmor        = standardValue * (WeaponConfig.PArmor) / 100 * 5;
            MArmor        = standardValue * (WeaponConfig.MArmor) / 100 * 5;

            if (Range > 10)
            {
                Atk = (int)(Atk * CardAssistant.GetCardFactorOnRange(Range));
            }

            if (Mov > 10)
            {
                Atk = (int)(Atk * CardAssistant.GetCardFactorOnMove(Mov));
            }
        }
示例#19
0
        private void CardsArray_MouseMove(object sender, MouseEventArgs e)
        {
            if (!Enabled)
            {
                return;
            }

            savedMousePos = e.Location;
            ResizeElements();

            int newIndex = -1;

            for (int i = 0; i < 10; i++)
            {
                var targetCard = cards[i];
                targetCard.MouseOn = false;
                if (savedMousePos.X > targetCard.Location.X && savedMousePos.X < targetCard.Location.X + targetCard.Size.Width)
                {
                    newIndex           = i + 1;
                    targetCard.MouseOn = true;
                }
            }

            if (newIndex != mouseIndex)
            {
                mouseIndex = newIndex;
                tooltip.Hide(this);
                if (mouseIndex != -1 && cards[mouseIndex - 1].ACard.CardId != 0)
                {
                    var targetCard = cards[mouseIndex - 1];
                    var card       = CardAssistant.GetCard(targetCard.ACard.CardId);
                    card.SetData(targetCard.ACard);
                    var image = card.GetPreview(CardPreviewType.Normal, new int[0]);
                    tooltip.Show(image, this, targetCard.Location.X, targetCard.Location.Y - image.Height - 5);
                }

                Invalidate();
            }
        }
示例#20
0
        private void CardBagForm_Paint(object sender, PaintEventArgs e)
        {
            BorderPainter.Draw(e.Graphics, "", Width, Height);

            for (int i = 0; i < cardCount; i++)
            {
                var pickCardId = cardOpenArray[i];
                int tx         = cardPos[i * 2];
                int ty         = cardPos[i * 2 + 1];
                if (pickCardId > 0)
                {
                    CardAssistant.DrawBase(e.Graphics, pickCardId, tx, ty, 120, 150);

                    var  cardConfigData = CardConfigManager.GetCardConfig(pickCardId);
                    Font fontStar       = new Font("宋体", 10 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
                    e.Graphics.DrawString(("★★★★★★★★★★").Substring(10 - cardConfigData.Star), fontStar, Brushes.Yellow, tx + 5, ty + 10);
                    fontStar.Dispose();
                    var quality = cardConfigData.Quality + 1;
                    e.Graphics.DrawImage(HSIcons.GetIconsByEName("gem" + quality), tx + 50, ty + 125, 20, 20);
                }
                else
                {
                    var imgBack = PicLoader.Read("System", "CardBack.JPG");
                    e.Graphics.DrawImage(imgBack, tx, ty, 120, 150);
                }

                if (coverEffect[i] != null)
                {
                    coverEffect[i].Draw(e.Graphics);
                }
            }

            vRegion.Draw(e.Graphics);

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

            e.Graphics.DrawString("卡 包", font, Brushes.White, Width / 2 - 40, 8);
            font.Dispose();
        }
示例#21
0
        private void buttonOk_Click(object sender, EventArgs e)
        {
            var deck = UserProfile.InfoCard.Decks[selectPage];

            if (deck.Count < GameConstants.DeckCardCount)
            {
                MessageBoxEx2.Show("卡组内卡片数不足");
                return;
            }

            foreach (var cardId in deck.CardIds)
            {
                var card = CardAssistant.GetCard(cardId);
                if (card.JobId > 0 && card.JobId != UserProfile.InfoBasic.Job)
                {
                    MessageBoxEx2.Show("部分卡牌职业不匹配");
                    return;
                }
            }

            comfirm = true;
            UserProfile.InfoCard.DeckId = selectPage;
            Close();
        }
示例#22
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 < 3; i++)
            {
                g.FillRectangle(lineBack, offX + 10, basel + 75 + i * 30, 180, 15);
            }
            g.FillRectangle(headerBack, offX + 10, basel + 150, 180, 20);

            g.FillRectangle(lineBack, offX + 10, basel + 170, 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(string.Format("加成 {0,3:D}", spell.Atk), fontsong, sb, offX + 10, add.Next);
            PaintTool.DrawValueLine(g, spell.Atk / 2, 70 + offX, add.Now + 1, 115, 10);
            g.DrawString("效果", fontblack, Brushes.White, offX + 10, basel + 152);
            string des = spell.Descript;

            PaintTool.DrawStringMultiLine(g, fontsong, sb, offX + 10, basel + 61 + 110, 15, 13, des);
            fontblack.Dispose();
            fontsong.Dispose();
            sb.Dispose();
        }
示例#23
0
 public void SetSlotCard(ActiveCard tcard)
 {
     ACard = tcard;
     Card  = CardAssistant.GetCard(tcard.CardId);
     Card.SetData(ACard);
 }
示例#24
0
        private void Draw(Graphics g, CardMouseState mouse)
        {
            if (Card is SpecialCard)
            {
                //   Image img2 = Card.GetCardImage(120, 120);
                //   g.DrawImage(img2, new Rectangle(Location.X, 10, 120, 120), 0, 0, img2.Width, img2.Height, GraphicsUnit.Pixel);
                return;
            }

            int        x       = Location.X;
            int        y       = Location.Y;
            Color      bgColor = IsSelected ? Color.LightGreen : BgColor;
            SolidBrush sb      = new SolidBrush(bgColor);

            g.FillRectangle(sb, new Rectangle(x, y, Size.Width, Size.Height));
            sb.Dispose();
            if (mouse != CardMouseState.MouseOn)
            {
                y += 10;
            }
            CardAssistant.DrawBase(g, Card.CardId, x, y, Size.Width, 120);

            if (mouse == CardMouseState.Disable)
            {
                var sbrush = new SolidBrush(Color.FromArgb(150, Color.Black));
                g.FillRectangle(sbrush, x, y, Size.Width, 120);
                sbrush.Dispose();
            }
            if (ACard.Combo && CardConfigManager.GetCardConfig(ACard.CardId).Remark.Contains("连击"))
            {
                Image img = PicLoader.Read("System", "CardEff1.PNG");
                g.DrawImage(img, x + 2, y + 2, Size.Width - 4, 120 - 4);
                img.Dispose();
            }

            Font font = new Font("Arial", 7 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);

            for (int i = 0; i < Card.Star; i++)
            {
                g.DrawString("★", font, Brushes.Black, x + Size.Width - 16, y + 2 + i * 10);
                g.DrawString("★", font, Brushes.Yellow, x + Size.Width - 15, y + 1 + i * 10);
            }
            font.Dispose();

            var cardData = CardConfigManager.GetCardConfig(Card.CardId);

            if (Card.GetCardType() == CardTypes.Monster)
            {
                g.DrawImage(HSIcons.GetIconsByEName("rac" + cardData.TypeSub), x + Size.Width / 2 - 18, y + 90, 16, 16);
            }
            else if (Card.GetCardType() == CardTypes.Weapon)
            {
                g.DrawImage(HSIcons.GetIconsByEName("wep" + (cardData.TypeSub - 100 + 1)), x + Size.Width / 2 - 18, y + 90, 16, 16);
            }
            else if (Card.GetCardType() == CardTypes.Spell)
            {
                g.DrawImage(HSIcons.GetIconsByEName("spl" + (cardData.TypeSub - 200 + 1)), x + Size.Width / 2 - 18, y + 90, 16, 16);
            }
            g.DrawImage(HSIcons.GetIconsByEName("atr" + cardData.Attr), x + Size.Width / 2 + 2, y + 90, 16, 16);

            font = new Font("宋体", 9 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
            var cardName  = string.Format("{0}Lv{1}", Card.Name, ACard.Level);
            var cardQual  = Config.CardConfigManager.GetCardConfig(Card.CardId).Quality;
            var cardColor = Color.FromName(HSTypes.I2QualityColor(cardQual));
            var brush     = new SolidBrush(cardColor);

            g.DrawString(cardName, font, Brushes.Black, x + 1, mouse != CardMouseState.MouseOn ? y + 107 : y + 112);
            g.DrawString(cardName, font, brush, x, mouse != CardMouseState.MouseOn ? y + 106 :y + 111);
            font.Dispose();
            brush.Dispose();

            int index = 0;

            foreach (var manaType in ACard.CostList)
            {
                var imgIcon = HSIcons.GetIconsByEName("mix" + (int)manaType);
                g.DrawImage(imgIcon, x + index * 10, y + 1, 16, 16);
                index++;
            }
            if (index == 0)//无消耗
            {
                font = new Font("宋体", 9 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
                g.DrawString("无消耗", font, Brushes.White, x + index * 10 + 2, y + 1 + 2);
                font.Dispose();
            }
        }
示例#25
0
        private void DrawOnDeckView(Graphics g, DeckCard card, int x, int y, bool isSelected, string attr)
        {
            CardAssistant.DrawBase(g, card.BaseId, x, y, cardWidth, cardHeight);
            if (isSelected)
            {
                var brushes = new SolidBrush(Color.FromArgb(130, Color.Yellow));
                g.FillRectangle(brushes, x, y, cardWidth, cardHeight);
                brushes.Dispose();
            }

            if (card.BaseId <= 0)
            {
                return;
            }

            var  cardConfigData = CardConfigManager.GetCardConfig(card.BaseId);
            Font font           = new Font("宋体", 5 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);

            g.DrawString(("★★★★★★★★★★").Substring(10 - cardConfigData.Star), font, Brushes.Yellow, x + 3, y + 3);
            font.Dispose();

            var quality = cardConfigData.Quality + 1;

            g.DrawImage(HSIcons.GetIconsByEName("gem" + quality), x + cardWidth / 2 - 8, y + cardHeight - 20, 16, 16);

            var jobId = cardConfigData.JobId;

            if (jobId > 0)
            {
                var   jobConfig = ConfigData.GetJobConfig(jobId);
                Brush brush     = new SolidBrush(Color.FromName(jobConfig.Color));
                g.FillRectangle(brush, x + cardWidth - 24, y + 4, 20, 20);
                g.DrawImage(HSIcons.GetIconsByEName("job" + jobConfig.JobIndex), x + cardWidth - 24, y + 4, 20, 20);
                brush.Dispose();
            }

            if (attr.Contains("D"))
            {
                Image mark = PicLoader.Read("System", "MarkSelect.PNG");
                g.DrawImage(mark, x + cardWidth - 21, y + cardHeight - 25, 21, 25);
                if (attr.Contains("DD"))//2张出战
                {
                    g.DrawImage(mark, x + cardWidth - 21, y + cardHeight - 25 - 15, 21, 25);
                }
                mark.Dispose();
            }
            if (attr.Contains("N"))
            {
                Image mark = PicLoader.Read("System", "MarkNew.PNG");
                g.DrawImage(mark, x, y, 30, 30);
                mark.Dispose();
            }

            g.FillEllipse(Brushes.Black, x + 3, y + 4 + cardHeight - 26, 16, 16);
            Font   fontsong = new Font("宋体", 9 * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel);
            string text     = string.Format("{0:00}", card.Level);

            g.DrawString(text, fontsong, Brushes.Yellow, x + 4, y + 4 + cardHeight - 23);
            if (card.Exp >= ConfigData.GetLevelExpConfig(card.Level).CardExp)//可以升级
            {
                g.DrawString(text, fontsong, Brushes.Lime, x + 4, y + 4 + cardHeight - 23);
                Image mark = PicLoader.Read("System", "ArrowU.PNG");
                g.DrawImage(mark, x + 2, y + 4 + cardHeight - 43, 18, 16);
                mark.Dispose();
            }
            fontsong.Dispose();
        }
示例#26
0
        public void Draw(Graphics eg)
        {
            eg.DrawRectangle(Pens.White, X, Y, Width, Height);

            Font fontsong = new Font("宋体", 11 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel);
            Font fontBold = new Font("宋体", 11 * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel);

            for (int i = 0; i < dcards.Length; i++)
            {
                int yoff = i * cellHeight;
                if (dcards[i].BaseId <= 0)
                {//如果没有卡
                    eg.DrawRectangle(Pens.DimGray, X, Y + yoff, Width, cellHeight);
                    continue;
                }

                if (tar == i)
                {
                    eg.FillRectangle(Brushes.DarkBlue, X, Y + yoff, Width, cellHeight);
                }
                var cardConfigData = CardConfigManager.GetCardConfig(dcards[i].BaseId);
                var cardImg        = CardAssistant.GetCardImage(dcards[i].BaseId, 30, 30);
                eg.DrawImage(cardImg, new Rectangle(X, Y + yoff, 30, cellHeight), 0, 6, 30, cellHeight, GraphicsUnit.Pixel);
                if (cardConfigData.JobId > 0)
                {
                    var   jobConfig = ConfigData.GetJobConfig(cardConfigData.JobId);
                    Brush brush     = new SolidBrush(Color.FromName(jobConfig.Color));
                    eg.FillRectangle(brush, X + Width - cellHeight, Y + yoff, cellHeight, cellHeight);
                    eg.DrawImage(HSIcons.GetIconsByEName("job" + jobConfig.JobIndex), X + Width - cellHeight, Y + yoff, cellHeight, cellHeight);
                    brush.Dispose();
                }
                eg.DrawString(cardConfigData.Star.ToString(), fontBold, Brushes.Gold, X - 1, Y + yoff);
                Color color      = Color.FromName(HSTypes.I2QualityColor(cardConfigData.Quality));
                Brush colorBrush = new SolidBrush(color);
                var   cardName   = cardConfigData.Name;
                if (cardName.Length > 4)
                {
                    cardName = cardName.Substring(0, 4);
                }
                eg.DrawString(string.Format("{0}({1})", cardName, dcards[i].Level), fontsong, colorBrush, X + 30, Y + yoff);
                colorBrush.Dispose();
            }

            if (monsterCount > 0)
            {
                Pen p = new Pen(Color.Yellow, 2);
                eg.DrawRectangle(p, X, Y, Width - 1, monsterCount * cellHeight - 1);
                p.Dispose();
            }
            if (weaponCount > 0)
            {
                Pen p = new Pen(Color.Red, 2);
                eg.DrawRectangle(p, X, Y + monsterCount * cellHeight, Width - 1, weaponCount * cellHeight - 1);
                p.Dispose();
            }
            if (spellCount > 0)
            {
                Pen p = new Pen(Color.Blue, 2);
                eg.DrawRectangle(p, X, Y + (monsterCount + weaponCount) * cellHeight, Width - 1, spellCount * cellHeight - 1);
                p.Dispose();
            }
            fontsong.Dispose();
            fontBold.Dispose();
        }
示例#27
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();
        }