From 8fa8371cdd4240835d5b482e6aa368058d4873e1 Mon Sep 17 00:00:00 2001 From: ZouJin Date: Tue, 26 Sep 2023 22:46:13 +0800 Subject: [PATCH] =?UTF-8?q?=E7=82=B9=E5=87=BB=E8=AF=B4=E8=AF=9D=E4=B9=9F?= =?UTF-8?q?=E5=B8=A6=E6=9C=89=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Mod/ClickText.cs | 19 +++++++- VPet-Simulator.Windows/MainWindow.xaml.cs | 47 +++++++++++++++++++ 2 files changed, 65 insertions(+), 1 deletion(-) diff --git a/VPet-Simulator.Windows.Interface/Mod/ClickText.cs b/VPet-Simulator.Windows.Interface/Mod/ClickText.cs index 3fd0e53..c0915c2 100644 --- a/VPet-Simulator.Windows.Interface/Mod/ClickText.cs +++ b/VPet-Simulator.Windows.Interface/Mod/ClickText.cs @@ -13,7 +13,7 @@ namespace VPet_Simulator.Windows.Interface /// /// 点击桌宠时触发的乱说话 /// - public class ClickText : ICheckText + public class ClickText : ICheckText, IFood { public ClickText() { @@ -84,5 +84,22 @@ namespace VPet_Simulator.Windows.Interface } return true; } + [Line(ignoreCase: true)] + public double Money { get; set; } + + [Line(ignoreCase: true)] + public int Exp { get; set; } + [Line(ignoreCase: true)] + public double Strength { get; set; } + [Line(ignoreCase: true)] + public double StrengthFood { get; set; } + [Line(ignoreCase: true)] + public double StrengthDrink { get; set; } + [Line(ignoreCase: true)] + public double Feeling { get; set; } + [Line(ignoreCase: true)] + public double Health { get; set; } + [Line(ignoreCase: true)] + public double Likability { get; set; } } } diff --git a/VPet-Simulator.Windows/MainWindow.xaml.cs b/VPet-Simulator.Windows/MainWindow.xaml.cs index 87b0000..fd896d0 100644 --- a/VPet-Simulator.Windows/MainWindow.xaml.cs +++ b/VPet-Simulator.Windows/MainWindow.xaml.cs @@ -467,6 +467,25 @@ namespace VPet_Simulator.Windows //{ // MessageBox.Show(food.RealPrice.ToString()); //} + foreach (var selet in ClickTexts) + { + selet.Exp = Math.Max(Math.Min(selet.Exp, 1000), -1000); + //food.Exp += selet.Exp; + selet.Feeling = Math.Max(Math.Min(selet.Feeling, 1000), -1000); + //food.Feeling += selet.Feeling; + selet.Health = Math.Max(Math.Min(selet.Feeling, 100), -100); + //food.Health += selet.Health; + selet.Likability = Math.Max(Math.Min(selet.Likability, 50), -50); + //food.Likability += selet.Likability; + selet.Money = Math.Max(Math.Min(selet.Money, 1000), -1000); + //food.Price -= selet.Money; + selet.Strength = Math.Max(Math.Min(selet.Strength, 1000), -1000); + //food.Strength += selet.Strength; + selet.StrengthDrink = Math.Max(Math.Min(selet.StrengthDrink, 1000), -1000); + //food.StrengthDrink += selet.StrengthDrink; + selet.StrengthFood = Math.Max(Math.Min(selet.StrengthFood, 1000), -1000); + //food.StrengthFood += selet.StrengthFood; + } } AutoSaveTimer.Elapsed += AutoSaveTimer_Elapsed; @@ -636,7 +655,35 @@ namespace VPet_Simulator.Windows lastclicktime = DateTime.Now.Ticks; var rt = GetClickText(); if (rt != null) + { + //聊天效果 + if (rt.Exp != 0) + { + if (rt.Exp > 0) + { + GameSavesData.Statistics[(gint)"stat_rt_exp_p"]++; + } + else + GameSavesData.Statistics[(gint)"stat_rt_exp_d"]++; + } + if (rt.Likability != 0) + { + if (rt.Likability > 0) + GameSavesData.Statistics[(gint)"stat_rt_like_p"]++; + else + GameSavesData.Statistics[(gint)"stat_rt_like_d"]++; + } + if (rt.Money != 0) + { + if (rt.Money > 0) + GameSavesData.Statistics[(gint)"stat_rt_money_p"]++; + else + GameSavesData.Statistics[(gint)"stat_rt_money_d"]++; + } + Main.Core.Save.EatFood(rt); + Main.Core.Save.Money += rt.Money; Main.SayRnd(rt.TranslateText); + } } }; Main.PlayVoiceVolume = Set.VoiceVolume;