From 5661e7dc64bfd749c46572769d2f4a07c102a2f4 Mon Sep 17 00:00:00 2001 From: ZouJin Date: Sat, 26 Aug 2023 07:23:30 +1000 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E8=B6=85=E6=A8=A1=E6=A3=80?= =?UTF-8?q?=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VPet-Simulator.Core/Display/ToolBar.xaml.cs | 8 ++++- .../ExtensionFunction.cs | 30 +++++++++++++++++++ .../VPet-Simulator.Windows.Interface.csproj | 1 + .../mod/0000_core/pet/vup.lps | 12 ++++---- 4 files changed, 44 insertions(+), 7 deletions(-) create mode 100644 VPet-Simulator.Windows.Interface/ExtensionFunction.cs diff --git a/VPet-Simulator.Core/Display/ToolBar.xaml.cs b/VPet-Simulator.Core/Display/ToolBar.xaml.cs index 737d36f..b1ec944 100644 --- a/VPet-Simulator.Core/Display/ToolBar.xaml.cs +++ b/VPet-Simulator.Core/Display/ToolBar.xaml.cs @@ -152,13 +152,19 @@ namespace VPet_Simulator.Core Work wwork; Work wstudy; Work wplay; + public Func WorkCheck; public void StartWork(Work work) { if (!m.Core.Controller.EnableFunction || m.Core.Save.Mode != GameSave.ModeType.Ill) if (!m.Core.Controller.EnableFunction || m.Core.Save.Level >= work.LevelLimit) if (m.State == Main.WorkingState.Work && m.StateID == m.Core.Graph.GraphConfig.Works.IndexOf(work)) m.WorkTimer.Stop(); - else m.WorkTimer.Start(work); + else + { + if (WorkCheck != null && !WorkCheck.Invoke(work)) + return; + m.WorkTimer.Start(work); + } else MessageBoxX.Show(LocalizeCore.Translate("您的桌宠等级不足{0}/{2}\n无法进行{1}", m.Core.Save.Level.ToString() , work.NameTrans, work.LevelLimit), LocalizeCore.Translate("{0}取消", work.NameTrans)); diff --git a/VPet-Simulator.Windows.Interface/ExtensionFunction.cs b/VPet-Simulator.Windows.Interface/ExtensionFunction.cs new file mode 100644 index 0000000..d030991 --- /dev/null +++ b/VPet-Simulator.Windows.Interface/ExtensionFunction.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using static VPet_Simulator.Core.GraphHelper; + +namespace VPet_Simulator.Windows.Interface +{ + public static class ExtensionFunction + { + /// + /// 判断这个工作是否超模 + /// + /// 工作 + /// 是否超模 + public static bool IsOverLoad(Work work) + {//判断这个工作是否超模 + var spend = (Math.Pow(work.StrengthFood * 2 + 1, 2) / 6 + Math.Pow(work.StrengthDrink * 2 + 1, 2) / 9 + + Math.Pow(work.Feeling * 2 + 1, 2) / 12) * (Math.Pow(work.LevelLimit / 2 + 1, 0.5) / 4 + 1) - 0.5; + var get = (work.MoneyBase + work.MoneyLevel * 10) * (work.MoneyLevel + 1) * (1 + work.FinishBonus / 2); + if(work.Type != Work.WorkType.Work) + { + get /= 12;//经验值换算 + } + var rel = get / spend; + return rel > 2; // 推荐rel为1.0-1.4之间 超过2.0就是超模 + } + } +} diff --git a/VPet-Simulator.Windows.Interface/VPet-Simulator.Windows.Interface.csproj b/VPet-Simulator.Windows.Interface/VPet-Simulator.Windows.Interface.csproj index 2385fbb..ad78ce7 100644 --- a/VPet-Simulator.Windows.Interface/VPet-Simulator.Windows.Interface.csproj +++ b/VPet-Simulator.Windows.Interface/VPet-Simulator.Windows.Interface.csproj @@ -115,6 +115,7 @@ + diff --git a/VPet-Simulator.Windows/mod/0000_core/pet/vup.lps b/VPet-Simulator.Windows/mod/0000_core/pet/vup.lps index e85a642..581e2f9 100644 --- a/VPet-Simulator.Windows/mod/0000_core/pet/vup.lps +++ b/VPet-Simulator.Windows/mod/0000_core/pet/vup.lps @@ -3,12 +3,12 @@ touchhead:|px#159:|py#16:|sw#189:|sh#178:| touchraised:|happy_px#0:|happy_py#50:|happy_sw#500:|happy_sh#200:|nomal_px#0:|nomal_py#50:|nomal_sw#500:|nomal_sh#200:|poorcondition_px#0:|poorcondition_py#50:|poorcondition_sw#500:|poorcondition_sh#200:|ill_px#0:|ill_py#200:|ill_sw#500:|ill_sh#300:| raisepoint:|happy_x#290:|happy_y#128:|nomal_x#290:|nomal_y#128:|poorcondition_x#290:|poorcondition_y#128:|ill_x#225:|ill_y#115:| work:|Type#Work:|Name#文案:|MoneyBase#8:|MoneyLevel#0.5:|Graph#workone:|StrengthFood#3.5:|StrengthDrink#2.5:|Feeling#1.5:|Time#60:|FinishBonus#0.1:|BorderBrush#000000:|Background#413d39:|ButtonBackground#322e2b:|ButtonForeground#FFFFFF:|Foreground#ccbdad:|Left#113:|Top#315:|Width#280:| -work:|Type#Work:|Name#清屏:|MoneyBase#16:|MoneyLevel#1:|Graph#workclean:|StrengthFood#7.5:|StrengthDrink#4.5:|Feeling#2.5:|Time#180:|FinishBonus#0.25:|LevelLimit#10:|BorderBrush#000000:|Background#413d39:|ButtonBackground#322e2b:|ButtonForeground#FFFFFF:|Foreground#ccbdad:|Left#113:|Top#315:|Width#280:| -work:|Type#Work:|Name#直播:|MoneyBase#30:|MoneyLevel#1.5:|Graph#worktwo:|StrengthFood#4.5:|StrengthDrink#7.5:|Feeling#2.5:|Time#180:|FinishBonus#0.25:|LevelLimit#20:|BorderBrush#000000:|Background#413d39:|ButtonBackground#322e2b:|ButtonForeground#FFFFFF:|Foreground#ccbdad:|Left#113:|Top#315:|Width#280:| -work:|Type#Study:|Name#学习:|MoneyBase#16:|MoneyLevel#2:|Graph#study:|StrengthFood#1.5:|StrengthDrink#2:|Feeling#3:|Time#45:|FinishBonus#0.2:|BorderBrush#000000:|Background#413d39:|ButtonBackground#322e2b:|ButtonForeground#FFFFFF:|Foreground#ccbdad:|Left#113:|Top#315:|Width#280:| -work:|Type#Study:|Name#研究:|MoneyBase#30:|MoneyLevel#3:|Graph#studytwo:|StrengthFood#2.5:|StrengthDrink#3.5:|Feeling#4.5:|Time#75:|FinishBonus#0.4:|BorderBrush#000000:|Background#413d39:|ButtonBackground#322e2b:|LevelLimit#15:|ButtonForeground#FFFFFF:|Foreground#ccbdad:|Left#113:|Top#315:|Width#280:| -work:|Type#Play:|Name#玩游戏:|MoneyBase#10:|MoneyLevel#2:|Graph#playone:|StrengthFood#1.5:|StrengthDrink#1.5:|Feeling#4:|Time#30:|FinishBonus#0.2:|BorderBrush#000000:|Background#413d39:|ButtonBackground#322e2b:|ButtonForeground#FFFFFF:|Foreground#ccbdad:|Left#113:|Top#315:|Width#280:| -///work:|Type#Play:|Name#删错误:|MoneyBase#10:|MoneyLevel#2:|Graph#removeobject:|StrengthFood#1:|StrengthDrink#0.5:|Feeling#4:|Time#60:|FinishBonus#0.25:|BorderBrush#000000:|Background#413d39:|ButtonBackground#322e2b:|ButtonForeground#FFFFFF:|Foreground#ccbdad:|Left#113:|Top#315:|Width#280:|LevelLimit#6:| ///先注释掉,等动画补齐后再继续整 +work:|Type#Work:|Name#清屏:|MoneyBase#16:|MoneyLevel#1:|Graph#workclean:|StrengthFood#5:|StrengthDrink#4:|Feeling#2.5:|Time#90:|FinishBonus#0.2:|LevelLimit#10:|BorderBrush#000000:|Background#413d39:|ButtonBackground#322e2b:|ButtonForeground#FFFFFF:|Foreground#ccbdad:|Left#113:|Top#315:|Width#280:| +work:|Type#Work:|Name#直播:|MoneyBase#30:|MoneyLevel#1.5:|Graph#worktwo:|StrengthFood#4.5:|StrengthDrink#8.5:|Feeling#3:|Time#180:|FinishBonus#0.25:|LevelLimit#20:|BorderBrush#000000:|Background#413d39:|ButtonBackground#322e2b:|ButtonForeground#FFFFFF:|Foreground#ccbdad:|Left#113:|Top#315:|Width#280:| +work:|Type#Study:|Name#学习:|MoneyBase#30:|MoneyLevel#2:|Graph#study:|StrengthFood#1.5:|StrengthDrink#2:|Feeling#3:|Time#45:|FinishBonus#0.2:|BorderBrush#000000:|Background#413d39:|ButtonBackground#322e2b:|ButtonForeground#FFFFFF:|Foreground#ccbdad:|Left#113:|Top#315:|Width#280:| +work:|Type#Study:|Name#研究:|MoneyBase#60:|MoneyLevel#3:|Graph#studytwo:|StrengthFood#1.5:|StrengthDrink#3.5:|Feeling#4:|Time#75:|FinishBonus#0.4:|BorderBrush#000000:|Background#413d39:|ButtonBackground#322e2b:|LevelLimit#15:|ButtonForeground#FFFFFF:|Foreground#ccbdad:|Left#113:|Top#315:|Width#280:| +work:|Type#Play:|Name#玩游戏:|MoneyBase#10:|MoneyLevel#2:|Graph#playone:|StrengthFood#1:|StrengthDrink#0.5:|Feeling#4:|Time#30:|FinishBonus#0.2:|BorderBrush#000000:|Background#413d39:|ButtonBackground#322e2b:|ButtonForeground#FFFFFF:|Foreground#ccbdad:|Left#113:|Top#315:|Width#280:| +work:|Type#Play:|Name#删错误:|MoneyBase#10:|MoneyLevel#2:|Graph#removeobject:|StrengthFood#0.5:|StrengthDrink#0.5:|Feeling#4:|Time#60:|FinishBonus#0.25:|BorderBrush#000000:|Background#413d39:|ButtonBackground#322e2b:|ButtonForeground#FFFFFF:|Foreground#ccbdad:|Left#113:|Top#315:|Width#280:|LevelLimit#6:| move:|graph#climb.left:|LocateType#Left:|LocateLength#145:|TriggerLeft#100:|TriggerTop#200:|TriggerType#65:|CheckType#64:|CheckTop#100:|SpeedY#-10:|Distance#7:|ModeType#14:| move:|graph#climb.left:|LocateType#Left:|LocateLength#145:|TriggerLeft#100:|TriggerBottom#200:|TriggerType#129:|CheckType#128:|CheckBottom#100:|SpeedY#10:|Distance#7:|ModeType#14:| move:|graph#climb.right:|LocateType#Right:|LocateLength#185:|TriggerRight#100:|TriggerTop#200:|TriggerType#66:|CheckType#64:|CheckTop#100:|SpeedY#-10:|Distance#7:|ModeType#14:|