public void Draw(Graphics g) { SolidBrush sb = new SolidBrush(Color.FromArgb(20, 20, 20)); g.FillRectangle(sb, x + 2, y + 2, width - 4, height - 4); sb.Dispose(); g.DrawRectangle(Pens.Teal, x + 2, y + 2, width - 4, height - 4); if (show) { var equipConfig = ConfigData.GetEquipConfig(equipId); virtualRegion.Draw(g); var cost = GameResourceBook.OutStoneMerge(equipConfig.Quality + 1, equipConfig.Level); Font ft = new Font("宋体", 9 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel); Brush b = new SolidBrush(Color.FromName(HSTypes.I2QualityColor(equipConfig.Quality))); g.DrawString(equipConfig.Name, ft, b, x + 90, y + 10); b.Dispose(); g.DrawString(string.Format("{0}", cost), ft, Brushes.White, x + 90 + 20, y + 32); ft.Dispose(); g.DrawImage(HSIcons.GetIconsByEName("res3"), x + 90, y + 32 - 3, 18, 18); } }
protected override void OnClick(MenuItemData target) { if (target.Type == "decompose") { var equipConfig = ConfigDatas.ConfigData.GetEquipConfig(UserProfile.InfoEquip.Equipoff[EquipIndex].BaseId); MainTipManager.AddTip(string.Format("|分解装备-|{0}|{1}", HSTypes.I2QualityColor(equipConfig.Quality), equipConfig.Name), "White"); UserProfile.Profile.InfoBag.AddResource(GameResourceType.Stone, GameResourceBook.InStoneEquipDecompose(equipConfig.Quality, equipConfig.Level)); UserProfile.InfoEquip.Equipoff[EquipIndex] = new DbEquip(); } else { return; } Form.MenuRefresh(EquipIndex); }
public void AddEquip(int id, int minuteLast) { EquipConfig equipConfig = ConfigData.GetEquipConfig(id); MainTipManager.AddTip(string.Format("|获得装备-|{0}|{1}", HSTypes.I2QualityColor(equipConfig.Quality), equipConfig.Name), "White"); for (int i = 0; i < GameConstants.EquipOffCount; i++) { if (Equipoff[i].BaseId == 0) { Equipoff[i].BaseId = id; Equipoff[i].Dura = equipConfig.Durable; Equipoff[i].ExpireTime = minuteLast <= 0 ? 0 : TimeTool.GetNowUnixTime() + minuteLast * 60; return; } } }
private void PopBuyProduct_Load(object sender, EventArgs e) { count = 1; textBoxTotal.Text = (count * itemprice).ToString(); var isEquip = ConfigIdManager.IsEquip(itemid); if (!isEquip) { fontcolor = HSTypes.I2RareColor(ConfigDatas.ConfigData.GetHItemConfig(itemid).Rare); } else { fontcolor = HSTypes.I2QualityColor(ConfigDatas.ConfigData.GetEquipConfig(itemid).Quality); buttonAdd.Enabled = false; buttonMinus.Enabled = false; textBoxCount.ReadOnly = true; } }
public void RemoveCardPiece(int id, bool returnResource) { DbDeckCard dc; if (Cards.TryGetValue(id, out dc)) { if (dc.Exp == 0) { return; } if (returnResource) { var cardData = CardConfigManager.GetCardConfig(dc.BaseId); MainTipManager.AddTip(string.Format("|分解卡片-|{0}|{1}", HSTypes.I2QualityColor(cardData.Quality), cardData.Name), "White"); int qual = CardConfigManager.GetCardConfig(dc.BaseId).Quality + 1; UserProfile.Profile.InfoBag.AddResource(GameResourceType.Gem, GameResourceBook.OutGemCardDecompose(qual)); } dc.Exp--; } }
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); }
public void Draw(Graphics g) { Image back = PicLoader.Read("System", "ShopItemBack.JPG"); g.DrawImage(back, x, y, width - 1, height - 1); back.Dispose(); if (show) { GameShopConfig gameShopConfig = ConfigData.GetGameShopConfig(productId); string name; string fontcolor; var isEquip = ConfigIdManager.IsEquip(gameShopConfig.ItemId); if (!isEquip) { HItemConfig itemConfig = ConfigData.GetHItemConfig(gameShopConfig.ItemId); name = itemConfig.Name; fontcolor = HSTypes.I2RareColor(itemConfig.Rare); } else { EquipConfig equipConfig = ConfigData.GetEquipConfig(gameShopConfig.ItemId); name = equipConfig.Name; fontcolor = HSTypes.I2QualityColor(equipConfig.Quality); } Font fontsong = new Font("宋体", 9 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel); Brush brush = new SolidBrush(Color.FromName(fontcolor)); g.DrawString(name, fontsong, brush, x + 76, y + 9); brush.Dispose(); var itmConfig = ConfigData.GetHItemConfig(gameShopConfig.ItemId); var price = GameResourceBook.OutGoldSellItem(itmConfig.Rare, itmConfig.ValueFactor); g.DrawString(string.Format("{0,3:D}", Math.Max(1, price / GameConstants.DiamondToGold)), fontsong, Brushes.PaleTurquoise, x + 80, y + 37); fontsong.Dispose(); g.DrawImage(HSIcons.GetIconsByEName("res8"), x + 110, y + 35, 16, 16); virtualRegion.Draw(g); } }
private void selectPanel_DrawCell(Graphics g, int info, int xOff, int yOff) { EquipConfig equipConfig = ConfigData.GetEquipConfig(info); g.DrawImage(EquipBook.GetEquipImage(info), 5 + xOff, 5 + yOff, 40, 40); Font font = new Font("微软雅黑", 11.25F * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel); SolidBrush sb = new SolidBrush(Color.FromName(HSTypes.I2QualityColor(equipConfig.Quality))); g.DrawString(equipConfig.Name, font, sb, 50 + xOff, 5 + yOff); sb.Dispose(); font.Dispose(); font = new Font("宋体", 10F * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel); g.DrawString("Lv" + equipConfig.Level, font, Brushes.DimGray, 50 + xOff + 10, 5 + yOff + 24); font.Dispose(); if (UserProfile.InfoEquip.EquipComposeAvail.Contains(info)) { var img = PicLoader.Read("System", "Learn.PNG"); g.DrawImage(img, xOff + 10, 3 + yOff, img.Width, img.Height); img.Dispose(); } }
/// <summary> /// 添加卡牌,外层都会检查cid的合法性,所以里面不用在判断了 /// </summary> /// <param name="cid">卡牌id</param> public DbDeckCard AddCard(int cid) { DbDeckCard card = new DbDeckCard(cid, 1, 0); var cardData = CardConfigManager.GetCardConfig(cid); if (GetCardCount(cid) >= 1) //每张卡其实只能有一份 { var myCard = GetDeckCardById(cid); myCard.AddExp(1); //多余的卡转化为经验值 return(myCard); //每种卡牌只能拥有1张 } Cards.Add(card.BaseId, card); Newcards.Add(card.BaseId); if (Newcards.Count > 10) { Newcards.RemoveAt(0); } AchieveBook.CheckByCheckType("card"); MainTipManager.AddTip(string.Format("|获得卡片-|{0}|{1}", HSTypes.I2QualityColor(cardData.Quality), cardData.Name), "White"); return(card); }
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); }
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); }
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(); } }
public override void Draw(Graphics g) { if (nid > 0) { Image img = null; HsActionCallback action = null; if (type == PictureRegionCellType.Npc) { img = SceneBook.GetSceneNpcImage(nid); } else if (type == PictureRegionCellType.Item) { img = DataType.Items.HItemBook.GetHItemImage(nid); action = () => { var itemConfig = ConfigData.GetHItemConfig(nid); var pen = new Pen(Color.FromName(HSTypes.I2RareColor(itemConfig.Rare)), 2); g.DrawRectangle(pen, X, Y, Width, Height); pen.Dispose(); }; } else if (type == PictureRegionCellType.Equip) { img = DataType.Equips.EquipBook.GetEquipImage(nid); action = () => { var equipConfig = ConfigData.GetEquipConfig(nid); var pen = new Pen(Color.FromName(HSTypes.I2QualityColor(equipConfig.Quality)), 2); g.DrawRectangle(pen, X, Y, Width, Height); pen.Dispose(); }; } else if (type == PictureRegionCellType.Card) { img = DataType.Cards.CardAssistant.GetCardImage(nid, 60, 60); action = () => { var cardData = CardConfigManager.GetCardConfig(nid); string cardBorder = DataType.Cards.CardAssistant.GetCardBorder(cardData); g.DrawImage(PicLoader.Read("Border", cardBorder), X, Y, Width, Height); }; } else if (type == PictureRegionCellType.SkillAttr) { img = DataType.HeroSkills.HeroSkillAttrBook.GetHeroSkillAttrImage(nid); } else if (type == PictureRegionCellType.Achieve) { img = DataType.Achieves.AchieveBook.GetAchieveImage(nid); } else if (type == PictureRegionCellType.People) { img = DataType.Peoples.PeopleBook.GetPersonImage(nid); } else if (type == PictureRegionCellType.HeroSkill) { img = DataType.HeroSkills.HeroPowerBook.GetImage(nid); } else if (type == PictureRegionCellType.CardQual) { img = HSIcons.GetIconsByEName("gem" + nid); } else if (type == PictureRegionCellType.Job) { img = HSIcons.GetIconsByEName("job" + nid); action = () => { var jobConfig = ConfigData.GetJobConfig(nid + JobConfig.Indexer.NewBie); Pen pen = new Pen(Color.FromName(jobConfig.Color)); g.DrawRectangle(pen, X, Y, Width, Height); pen.Dispose(); }; } else if (type == PictureRegionCellType.Bless) { img = DataType.Blesses.BlessBook.GetBlessImage(nid); } else if (type == PictureRegionCellType.SceneQuest) { img = SceneBook.GetSceneQuestImage(nid); } if (img != null) { if (Scale == 1) { g.DrawImage(img, X, Y, Width, Height); } else { int realWidth = (int)(Width * Scale); int realHeight = (int)(Height * Scale); g.DrawImage(img, X + (Width - realWidth) / 2, Y + (Height - realHeight) / 2, realWidth, realHeight); } } if (action != null) { action(); } } foreach (IRegionDecorator decorator in decorators) { decorator.Draw(g, X, Y, Width, Height); } }
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); }
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); }
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); }
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(); }