[FieldIndex(Index = 28)] public uint MoveBoostRound; //快速移动时长 public void AddExp(int ex) { if (Level >= ExpTree.MaxLevel) { return; } Exp += ex; MainTipManager.AddTip(string.Format("|获得|Cyan|{0}||点经验值", ex), "White"); AchieveBook.CheckByCheckType("exp"); if (Exp >= ExpTree.GetNextRequired(Level)) { int oldLevel = Level; while (CheckNewLevel()) //循环升级 { OnLevel(Level); } MainItem.SystemMenuManager.ResetIconState(); MainForm.Instance.RefreshView(); MainItem.PanelManager.ShowLevelInfo(oldLevel, UserProfile.InfoBasic.Level); } }
private bool CheckNewLevel() { int expNeed = ExpTree.GetNextRequired(Level); if (Exp >= expNeed) { Exp -= expNeed; Level++; return(true); } return(false); }
private void RoleForm_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(UserProfile.Profile.Name, font, Brushes.White, Width / 2 - 40, 8); font.Dispose(); if (!show) { return; } e.Graphics.FillRectangle(Brushes.LightSlateGray, 25 - 1, 55 - 1, 52, 52); Image head = PicLoader.Read("Player", string.Format("{0}.png", UserProfile.InfoBasic.Head)); e.Graphics.DrawImage(head, 25, 55, 50, 50); head.Dispose(); font = new Font("宋体", 11 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel); Font font2 = new Font("宋体", 10 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel); Brush brush = new SolidBrush(Color.FromArgb(220, Color.Black)); e.Graphics.FillRectangle(brush, 12, 300, 305, 105); brush.Dispose(); string namestr = string.Format("Lv {0}", UserProfile.InfoBasic.Level); e.Graphics.DrawString(namestr, font, Brushes.White, 20, 305); string expstr = string.Format("{0}/{1}", UserProfile.InfoBasic.Exp, ExpTree.GetNextRequired(UserProfile.InfoBasic.Level)); e.Graphics.DrawString(expstr, font2, Brushes.White, 130, 300); e.Graphics.FillRectangle(Brushes.DimGray, 80, 314, 180, 4); e.Graphics.FillRectangle(Brushes.DodgerBlue, 80, 314, Math.Min(UserProfile.InfoBasic.Exp * 179 / ExpTree.GetNextRequired(UserProfile.InfoBasic.Level) + 1, 180), 4); font.Dispose(); font2.Dispose(); }
public void AddExp(int ex) { if (Level >= ExpTree.MaxLevel) { return; } Exp += ex; MainTipManager.AddTip(string.Format("|获得|Cyan|{0}||点经验值", ex), "White"); if (Exp >= ExpTree.GetNextRequired(Level)) { int oldLevel = Level; while (CheckNewLevel()) //循环升级 { OnLevel(Level); } SystemMenuManager.ResetIconState(); MainForm.Instance.RefreshView(); } TalePlayer.C2SSender.UpdateLevelExp(0, Level, Exp); }
private void EquipmentForm_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, Width / 2 - 40, 8); font.Dispose(); Image back = PicLoader.Read("System", "HeroBackNew1.JPG"); e.Graphics.DrawImage(back, 20, 36, 512, 340); back.Dispose(); if (!show) return; if (vRegion != null) { vRegion.Draw(e.Graphics); } JobConfig jobConfig = ConfigDatas.ConfigData.GetJobConfig(UserProfile.InfoBasic.Job); Image body = PicLoader.Read("Hero", string.Format("{0}.JPG", jobConfig.JobIndex)); e.Graphics.DrawImage(body, 25, 47, 111, 111); body.Dispose(); e.Graphics.FillRectangle(Brushes.LightSlateGray, 92, 113, 42, 42); Image head = PicLoader.Read("Player", string.Format("{0}.PNG", UserProfile.InfoBasic.Face)); e.Graphics.DrawImage(head, 93, 114, 40, 40); head.Dispose(); font = new Font("宋体", 11*1.33f, FontStyle.Regular, GraphicsUnit.Pixel); Font font2 = new Font("宋体", 10*1.33f, FontStyle.Regular, GraphicsUnit.Pixel); Font font3 = new Font("宋体", 9*1.33f, FontStyle.Regular, GraphicsUnit.Pixel); string namestr = string.Format("{0}(Lv{1}{2})", UserProfile.ProfileName, UserProfile.InfoBasic.Level, ConfigData.GetJobConfig(UserProfile.InfoBasic.Job).Name); e.Graphics.DrawString(namestr, font, Brushes.White, GetX(e.Graphics, namestr, font, 182, 130), 61); Brush brush = new SolidBrush(Color.FromArgb(180, Color.DimGray)); for (int i = 0; i < 4; i++) { e.Graphics.FillRectangle(brush, 147 + 53 * i, 136, 45, 15); e.Graphics.FillRectangle(brush, 147 + 53 * i, 199, 45, 15); } brush.Dispose(); string expstr = string.Format("{0}/{1}", UserProfile.InfoBasic.Exp, ExpTree.GetNextRequired(UserProfile.InfoBasic.Level)); e.Graphics.DrawString(expstr, font2, Brushes.White, GetX(e.Graphics, expstr, font2, 38, 68), 161); e.Graphics.FillRectangle(Brushes.DimGray, 31, 178, 80, 2); e.Graphics.FillRectangle(Brushes.DodgerBlue, 31, 178, Math.Min(UserProfile.InfoBasic.Exp * 79 / ExpTree.GetNextRequired(UserProfile.InfoBasic.Level) + 1, 80), 2); DrawAttr(e.Graphics, font, heroData.Atk + vEquip.Atk, 147, 136); DrawAttr(e.Graphics, font, heroData.Hp + vEquip.Hp, 147 + 53, 136); DrawAttr(e.Graphics, font, heroData.Spd + vEquip.Spd, 147 + 53*2, 136); DrawAttr(e.Graphics, font, heroData.Range + vEquip.Range, 147 + 53 * 3, 136); DrawAttr(e.Graphics, font, vEquip.LpRate + jobInfo.Lp, 147, 199); DrawAttr(e.Graphics, font, vEquip.PpRate + jobInfo.Pp, 147 + 53, 199); DrawAttr(e.Graphics, font, vEquip.MpRate + jobInfo.Mp, 147 + 53 * 2, 199); font.Dispose(); font2.Dispose(); font3.Dispose(); e.Graphics.DrawImage(tempImage, 361, 222); }
public void Paint(Graphics g) { g.DrawImage(backPicture, 0, 50, width, height - 35); g.DrawImage(mainTop, 0, 0, width, 50); g.DrawImage(mainTopRes, (width - 688) / 2, 4, 688, 37);//688是图片尺寸 g.DrawImage(mainTopTitle, width - 145, 3, 115, 32); g.DrawImage(mainBottom, 0, height - 35, width, 35); if (UserProfile.Profile == null || UserProfile.InfoBasic.MapId == 0) { return; } Font font = new Font("微软雅黑", 12 * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel); Font font2 = new Font("宋体", 9 * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel); Image head = PicLoader.Read("Player", string.Format("{0}.PNG", UserProfile.InfoBasic.Face)); g.DrawImage(head, 0, 0, 50, 50); head.Dispose(); g.DrawString(UserProfile.InfoBasic.Level.ToString(), font2, Brushes.Black, 3, 3); g.DrawString(UserProfile.InfoBasic.Level.ToString(), font2, Brushes.White, 2, 2); // g.DrawString(UserProfile.ProfileName, font, Brushes.White, 50, 10); LinearGradientBrush b1 = new LinearGradientBrush(new Rectangle(55, 5, 100, 5), Color.LightCoral, Color.Red, LinearGradientMode.Horizontal); g.FillRectangle(b1, 55, 5, Math.Min(UserProfile.InfoBasic.HealthPoint, 100), 5); g.DrawRectangle(Pens.DarkGray, 55, 5, 100, 5); b1.Dispose(); b1 = new LinearGradientBrush(new Rectangle(55, 12, 100, 5), Color.LightBlue, Color.Blue, LinearGradientMode.Horizontal); g.FillRectangle(b1, 55, 12, Math.Min(UserProfile.InfoBasic.MentalPoint, 100), 5); g.DrawRectangle(Pens.DarkGray, 55, 12, 100, 5); b1.Dispose(); b1 = new LinearGradientBrush(new Rectangle(55, 19, 100, 5), Color.LightGreen, Color.Green, LinearGradientMode.Horizontal); g.FillRectangle(b1, 55, 19, Math.Min(UserProfile.InfoBasic.FoodPoint, 100), 5); g.DrawRectangle(Pens.DarkGray, 55, 19, 100, 5); b1.Dispose(); if (TimeMinutes >= 960 && TimeMinutes < 1080) { Brush yellow = new SolidBrush(Color.FromArgb(50, 255, 200, 0)); g.FillRectangle(yellow, 0, 50, width, height); yellow.Dispose(); } else if (TimeMinutes < 360 || TimeMinutes >= 1080) //18点到6点 { Brush blue = new SolidBrush(Color.FromArgb(120, 0, 0, 150)); g.FillRectangle(blue, 0, 50, width, height); blue.Dispose(); } int len = (int)g.MeasureString(sceneName, font).Width; g.DrawString(sceneName, font, Brushes.White, new PointF(width - 85 - len / 2, 8)); int xOff = (width - 688) / 2 + 103; g.DrawString(UserProfile.InfoBag.Resource.Lumber.ToString(), font, Brushes.White, new PointF(xOff, 13)); g.DrawString(UserProfile.InfoBag.Resource.Stone.ToString(), font, Brushes.White, new PointF(xOff + 82, 13)); g.DrawString(UserProfile.InfoBag.Resource.Mercury.ToString(), font, Brushes.White, new PointF(xOff + 82 * 2, 13)); g.DrawString(UserProfile.InfoBag.Resource.Carbuncle.ToString(), font, Brushes.White, new PointF(xOff + 82 * 3, 13)); g.DrawString(UserProfile.InfoBag.Resource.Sulfur.ToString(), font, Brushes.White, new PointF(xOff + 82 * 4, 13)); g.DrawString(UserProfile.InfoBag.Resource.Gem.ToString(), font, Brushes.White, new PointF(xOff + 82 * 5, 13)); g.DrawString(UserProfile.InfoBag.Resource.Gold.ToString(), font, Brushes.White, new PointF(xOff + 82 * 6, 13)); xOff = (width - 688) / 2 + 30; g.FillRectangle(Brushes.DimGray, xOff, 41, 630, 8); b1 = new LinearGradientBrush(new Rectangle(xOff, 41, 630, 8), Color.White, Color.Gray, LinearGradientMode.Vertical); g.FillRectangle(b1, xOff, 41, Math.Min(UserProfile.InfoBasic.Exp * 630 / ExpTree.GetNextRequired(UserProfile.InfoBasic.Level), 630), 8); g.DrawRectangle(new Pen(Brushes.Black, 2), xOff, 41, 630, 8); b1.Dispose(); font.Dispose(); font2.Dispose(); g.DrawImage(miniMap, width - 160, 43, 150, 150); g.DrawImage(miniBack, width - 190, 38, 185, 160); vRegion.Draw(g); DrawCellAndToken(g); }