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) { HeroSkillAttrConfig heroSkillAttrConfig = ConfigData.GetHeroSkillAttrConfig(sid); virtualRegion.Draw(g); g.DrawRectangle(Pens.White, x + 3, y + 3, 76, 75); Font ft = new Font("宋体", 9 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel); g.DrawString(heroSkillAttrConfig.Name, ft, Brushes.Gold, x + 90, y + 10); int slevel = UserProfile.InfoSkill.GetSkillAttrLevel(sid); g.DrawString(string.Format("等级{0}级", slevel), ft, Brushes.White, x + 90, y + 32); ft.Dispose(); if (slevel == 0) { Image marker = PicLoader.Read("System", "Mark1.PNG"); g.DrawImage(marker, x + 30, y + 2, 50, 51); marker.Dispose(); } } }
private static string GetDes(int id, int level) { HeroSkillAttrConfig heroSkillAttrConfig = ConfigData.GetHeroSkillAttrConfig(id); string tp = heroSkillAttrConfig.Des; tp = tp.Replace("{atk}", (heroSkillAttrConfig.Atk * level).ToString()); tp = tp.Replace("{def}", (heroSkillAttrConfig.Def * level).ToString()); tp = tp.Replace("{magic}", (heroSkillAttrConfig.Magic * level).ToString()); tp = tp.Replace("{hit}", (heroSkillAttrConfig.Hit * level).ToString()); tp = tp.Replace("{dhit}", (heroSkillAttrConfig.Dhit * level).ToString()); tp = tp.Replace("{spd}", (heroSkillAttrConfig.Spd * level).ToString()); tp = tp.Replace("{hp}", (heroSkillAttrConfig.Hp * level).ToString()); return(tp); }
public static Image GetPreview(int id, int level) { HeroSkillAttrConfig heroSkillAttrConfig = ConfigData.GetHeroSkillAttrConfig(id); ControlPlus.TipImage tipData = new ControlPlus.TipImage(); tipData.AddTextNewLine(heroSkillAttrConfig.Name, "White", 20); tipData.AddTextNewLine(string.Format("当前等级: {0}级", level), "White"); tipData.AddTextNewLine(GetDes(id, level), "Lime"); tipData.AddLine(20); tipData.AddTextNewLine(string.Format("下一等级: {0}级", level + 1), "White"); tipData.AddTextNewLine(GetDes(id, level + 1), "Lime"); tipData.AddTextNewLine(string.Format("需要等级: {0}", level + 1), (User.UserProfile.InfoBasic.Level >= (level + 1)) ? "Gray" : "Red"); tipData.AddTextNewLine(string.Format("需要阅历: {0}", GetCost(id, level + 1)), (User.UserProfile.InfoBasic.AttrPoint >= GetCost(id, level + 1)) ? "Gray" : "Red"); return(tipData.Image); }
public static int GetCost(int id, int level) { HeroSkillAttrConfig heroSkillAttrConfig = ConfigData.GetHeroSkillAttrConfig(id); return(level * level * (10 + heroSkillAttrConfig.HeroLevel / 5) / 10 + heroSkillAttrConfig.HeroLevel * level + 50 + heroSkillAttrConfig.HeroLevel * 10); }