public int GetRecordLimit(MemPlayerRecordTypes rd) { switch (rd) { case MemPlayerRecordTypes.HeroExpPoint: return(ExpTree.GetNextRequiredCard(UserProfile.InfoBasic.Level)); } return(0); }
public int Compare(DeckCard cx, DeckCard cy) { int expx = (ExpTree.GetNextRequiredCard(cx.Level) - cx.Exp) * 100 / ExpTree.GetNextRequiredCard(cx.Level); int expy = (ExpTree.GetNextRequiredCard(cy.Level) - cy.Exp) * 100 / ExpTree.GetNextRequiredCard(cy.Level); if (expx != expy) { return(expx.CompareTo(expy)); } return(cx.BaseId.CompareTo(cy.BaseId)); }
public void CardLevelUp(int cardId) { var card = GetDeckCardById(cardId); if (card.BaseId > 0) { int expNeed = ExpTree.GetNextRequiredCard(card.Level); if (card.Exp < expNeed) { return; } card.Exp = (ushort)(card.Exp - expNeed); card.Level++; } }
public bool CanLevelUp(int cardId) { var card = GetDeckCardById(cardId); if (card.BaseId > 0) { int expNeed = ExpTree.GetNextRequiredCard(card.Level); if (card.Exp < expNeed) { return(false); } return(true); } return(false); }
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(); } }
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(); }
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(); }
public override void OnKillMonster(int id, int dieLevel, int dieStar, Point position) { base.OnKillMonster(id, dieLevel, dieStar, position); int expGet = (int)Math.Sqrt(dieLevel * dieStar) / 2 + 1; //杀死怪物经验 int rexp = UserProfile.InfoRecord.GetRecordById((int)MemPlayerRecordTypes.HeroExpPoint) + expGet; UserProfile.InfoRecord.SetRecordById((int)MemPlayerRecordTypes.HeroExpPoint, Math.Min(ExpTree.GetNextRequiredCard(Level), rexp)); // BattleManager.Instance.FlowWordQueue.Add(new FlowExpInfo(expGet, position, 20, 50), true); }
private void panelIcons_Paint(object sender, PaintEventArgs e) { e.Graphics.DrawImage(backImage, 0, 0, panelBack.Width, panelBack.Height); Font font = new Font("宋体", 11 * 1.33f, FontStyle.Bold, GraphicsUnit.Pixel); DrawShadeText(e.Graphics, string.Format("经验值 {0}/{1}", UserProfile.InfoRecord.GetRecordById((int)MemPlayerRecordTypes.HeroExpPoint), ExpTree.GetNextRequiredCard(UserProfile.InfoBasic.Level)), font, Brushes.White, 20, 30); font.Dispose(); }