From aad5266c5aac1722bde8469164170ba41c818500 Mon Sep 17 00:00:00 2001 From: ZouJin Date: Tue, 12 Dec 2023 16:06:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E7=89=88=E6=9C=AC=E6=B8=B8=E6=88=8F?= =?UTF-8?q?=E5=82=A8=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VPet-Simulator.Core/Handle/GameSave.cs | 37 +++++++++++++------------ VPet-Simulator.Core/Handle/IGameSave.cs | 8 ++++-- VPet-Simulator.Windows/mklink.bat | 2 +- 3 files changed, 27 insertions(+), 20 deletions(-) diff --git a/VPet-Simulator.Core/Handle/GameSave.cs b/VPet-Simulator.Core/Handle/GameSave.cs index d6c647f..531e5c3 100644 --- a/VPet-Simulator.Core/Handle/GameSave.cs +++ b/VPet-Simulator.Core/Handle/GameSave.cs @@ -14,30 +14,33 @@ namespace VPet_Simulator.Core /// 宠物名字 /// [Line(name: "name")] - public virtual string Name { get; set; } + public string Name { get; set; } /// /// 金钱 /// [Line(Type = LPSConvert.ConvertType.ToFloat, Name = "money")] - public virtual double Money { get; set; } + public double Money { get; set; } /// /// 经验值 /// - [Line(type: LPSConvert.ConvertType.ToFloat, name: "exp")] public virtual double Exp { get; set; } + [Line(type: LPSConvert.ConvertType.ToFloat, name: "exp")] public double Exp { get; set; } /// /// 等级 /// - public virtual int Level => Exp < 0 ? 1 : (int)(Math.Sqrt(Exp) / 10) + 1; + public int Level => Exp < 0 ? 1 : (int)(Math.Sqrt(Exp) / 10) + 1; /// /// 升级所需经验值 /// /// - public virtual int LevelUpNeed() => (int)(Math.Pow((Level) * 10, 2)); + public int LevelUpNeed() => (int)(Math.Pow((Level) * 10, 2)); /// /// 体力 0-100 /// - public virtual double Strength { get => strength; set => strength = Math.Min(100, Math.Max(0, value)); } + public double Strength { get => strength; set => strength = Math.Min(StrengthMax, Math.Max(0, value)); } + + public double StrengthMax { get;} = 100; + [Line(Type = LPSConvert.ConvertType.ToFloat, IgnoreCase = true)] protected double strength { get; set; } /// @@ -48,8 +51,8 @@ namespace VPet_Simulator.Core /// /// 变化 体力 /// - public double ChangeStrength = 0; - public virtual void StrengthChange(double value) + public double ChangeStrength { get; set; } = 0; + public void StrengthChange(double value) { ChangeStrength += value; Strength += value; @@ -57,7 +60,7 @@ namespace VPet_Simulator.Core /// /// 饱腹度 /// - public virtual double StrengthFood + public double StrengthFood { get => strengthFood; set { @@ -77,8 +80,8 @@ namespace VPet_Simulator.Core /// 待补充的饱腹度,随着时间缓慢加给桌宠 /// //让游戏更有游戏性 [Line(Type = LPSConvert.ConvertType.ToFloat)] - public virtual double StoreStrengthFood { get; set; } - public virtual void StrengthChangeFood(double value) + public double StoreStrengthFood { get; set; } + public void StrengthChangeFood(double value) { ChangeStrengthFood += value; StrengthFood += value; @@ -86,11 +89,11 @@ namespace VPet_Simulator.Core /// /// 变化 食物 /// - public double ChangeStrengthFood = 0; + public double ChangeStrengthFood { get; set; } = 0; /// /// 口渴度 /// - public virtual double StrengthDrink + public double StrengthDrink { get => strengthDrink; set { @@ -111,11 +114,11 @@ namespace VPet_Simulator.Core /// 待补充的口渴度,随着时间缓慢加给桌宠 /// //让游戏更有游戏性 [Line(Type = LPSConvert.ConvertType.ToFloat)] - public virtual double StoreStrengthDrink { get; set; } + public double StoreStrengthDrink { get; set; } /// /// 变化 口渴度 /// - public double ChangeStrengthDrink = 0; + public double ChangeStrengthDrink { get; set; } = 0; public void StrengthChangeDrink(double value) { ChangeStrengthDrink += value; @@ -124,7 +127,7 @@ namespace VPet_Simulator.Core /// /// 心情 /// - public virtual double Feeling + public double Feeling { get => feeling; set { @@ -152,7 +155,7 @@ namespace VPet_Simulator.Core /// 变化 心情 /// public double ChangeFeeling = 0; - public virtual void FeelingChange(double value) + public void FeelingChange(double value) { ChangeFeeling += value; Feeling += value; diff --git a/VPet-Simulator.Core/Handle/IGameSave.cs b/VPet-Simulator.Core/Handle/IGameSave.cs index 64ad004..0bc1709 100644 --- a/VPet-Simulator.Core/Handle/IGameSave.cs +++ b/VPet-Simulator.Core/Handle/IGameSave.cs @@ -38,7 +38,7 @@ namespace VPet_Simulator.Core /// /// 最大体力值 /// - double StrengthMax { get; set; } + double StrengthMax { get;} /// /// 待补充的体力,随着时间缓慢加给桌宠 /// //让游戏更有游戏性 @@ -109,7 +109,7 @@ namespace VPet_Simulator.Core /// /// 好感度(隐藏)(最大值) /// - double LikabilityMax { get; set; } + double LikabilityMax { get;} /// /// 清除变化 @@ -125,6 +125,10 @@ namespace VPet_Simulator.Core /// 食物类 void EatFood(IFood food); /// + /// 宠物当前状态 + /// + ModeType Mode { get; set; } + /// /// 宠物状态模式 /// public enum ModeType diff --git a/VPet-Simulator.Windows/mklink.bat b/VPet-Simulator.Windows/mklink.bat index db1ffbd..b47d029 100644 --- a/VPet-Simulator.Windows/mklink.bat +++ b/VPet-Simulator.Windows/mklink.bat @@ -1,4 +1,4 @@ -chcp 65001 +chcp 65001 mklink /d "%~dp0\bin\x64\Debug\net462\mod" "%~dp0\mod"