From 692e3ad450a81c252dcd3e8d1e1a7d6db4c96ee9 Mon Sep 17 00:00:00 2001 From: ZouJin Date: Thu, 28 Mar 2024 21:25:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E5=B9=B4=E5=BA=A6=E6=8A=A5?= =?UTF-8?q?=E5=91=8A=E6=95=B0=E6=8D=AE=E6=BA=A2=E5=87=BA=E9=99=90=E5=88=B6?= =?UTF-8?q?=20&=20=E4=BF=AE=E5=A4=8D=E5=B9=B4=E5=BA=A6=E6=8A=A5=E5=91=8A?= =?UTF-8?q?=E7=BB=8F=E9=AA=8C=E6=98=BE=E7=A4=BA=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../GameSave_VPet.cs | 18 ++++++++++++++++++ .../WinDesign/winCharacterPanel.xaml.cs | 4 ++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/VPet-Simulator.Windows.Interface/GameSave_VPet.cs b/VPet-Simulator.Windows.Interface/GameSave_VPet.cs index df64074..e4e602a 100644 --- a/VPet-Simulator.Windows.Interface/GameSave_VPet.cs +++ b/VPet-Simulator.Windows.Interface/GameSave_VPet.cs @@ -64,6 +64,24 @@ public class GameSave_VPet : IGameSave } } /// + /// 玩家总共获得的经验值数量 + /// + public double TotalExpGained() + { + double totalExp = 0; + // 首先,添加LevelMax的经验值 + for (int i = 1; i <= LevelMax; i++) + { + for (int j = 100 * i + 1; j <= 1000 + 100 * i; j++) + totalExp += 200 * j - 100; + } + // 然后,添加当前等级的经验值 + totalExp += (Level - 100 * LevelMax) * (200 * (Level - 1) - 100); + // 最后,添加剩余的经验值 + totalExp += Exp; + return totalExp; + } + /// /// 升级所需经验值 /// public int LevelUpNeed() => 200 * Level - 100; diff --git a/VPet-Simulator.Windows/WinDesign/winCharacterPanel.xaml.cs b/VPet-Simulator.Windows/WinDesign/winCharacterPanel.xaml.cs index 9e3b2e7..561b99a 100644 --- a/VPet-Simulator.Windows/WinDesign/winCharacterPanel.xaml.cs +++ b/VPet-Simulator.Windows/WinDesign/winCharacterPanel.xaml.cs @@ -43,7 +43,7 @@ namespace VPet_Simulator.Windows DataGridStatic.ItemsSource = StatList; mw.GameSavesData.Statistics.StatisticChanged += Statistics_StatisticChanged; - if (mw.GameSavesData.HashCheck && mw.GameSavesData.GameSave.Exp < int.MaxValue && mw.GameSavesData.GameSave.Money < int.MaxValue) + if (mw.GameSavesData.HashCheck) { cb_NoCheat.IsEnabled = true; if (mw.IsSteamUser) @@ -639,7 +639,7 @@ namespace VPet_Simulator.Windows r_i_timelength.Source = new BitmapImage(new Uri($"pack://application:,,,/Res/img/r_timelength_{timelength_i}.png")); r_r_level.Text = mw.GameSavesData.GameSave.Level.ToString(); - r_r_exp.Text = mw.GameSavesData.GameSave.Exp.ToString("f0"); + r_r_exp.Text = mw.GameSavesData.GameSave.TotalExpGained().ToString("f0"); r_r_studytime.Text = (mw.GameSavesData.Statistics[(gint)"stat_study_time"] / 60).ToString(); r_r_studytext.Text = studytext; r_i_exp.Source = new BitmapImage(new Uri($"pack://application:,,,/Res/img/r_level_{study_i}.png"));