自动工作套餐和相关超模计算

This commit is contained in:
ZouJin 2024-05-31 16:28:47 +08:00
parent 490eb62bab
commit 1db29375d0
6 changed files with 82 additions and 53 deletions

View File

@ -7,6 +7,7 @@ using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Threading;
using VPet_Simulator.Core;
using static VPet_Simulator.Windows.Interface.ScheduleTask;
namespace VPet_Simulator.Windows.Interface
{
@ -229,8 +230,11 @@ namespace VPet_Simulator.Windows.Interface
/// <summary>
/// 日程表
/// </summary>
ScheduleTask ScheduleTask { get; }
/// <summary>
/// 所有可用套餐
/// </summary>
List<PackageFull> SchedulePackage { get;}
}
}

View File

@ -311,10 +311,30 @@ public class ScheduleTask
/// </summary>
public class Package
{
/// <summary>
/// 套餐名称
/// </summary>
[Line] public string Name { get; set; }
/// <summary>
/// 协议名称 (已翻译)
/// </summary>
public string NameTrans { get; set; }
public string NameTrans
{
get
{
if (string.IsNullOrEmpty(nametrans))
{
nametrans = Name.Translate();
}
return nametrans;
}
set => nametrans = value;
}
private string nametrans;
/// <summary>
/// 描述
/// </summary>
[Line] public string Describe { get; set; }
/// <summary>
/// 抽成
/// </summary>
@ -343,26 +363,7 @@ public class ScheduleTask
public class PackageFull : Package
{
/// <summary>
/// 套餐名称
/// </summary>
[Line] public string Name { get; set; }
/// <summary>
/// 协议名称 (已翻译)
/// </summary>
public new string NameTrans
{
get
{
if (string.IsNullOrEmpty(base.NameTrans))
{
base.NameTrans = Name.Translate();
}
return base.NameTrans;
}
set => base.NameTrans = value;
}
/// <summary>
/// 持续时间
/// 持续时间 (天)
/// </summary>
[Line] public int Duration { get; set; }
/// <summary>
@ -374,40 +375,38 @@ public class ScheduleTask
/// 工作类型
/// </summary>
[Line] public Work.WorkType WorkType { get; set; }
}
/// <summary>
/// 所有可用套餐
/// </summary>
public List<PackageFull> PackageFulls { get; set; }
/// <summary>
/// 获取基本可用套餐
/// </summary>
public static List<PackageFull> GetBasePackageFulls()
{
return new List<PackageFull>
public void FixOverLoad()
{
new PackageFull
if (Duration < 1)
{
Name = "work",
Duration = 1,
LevelInNeed = 0,
WorkType = Work.WorkType.Work
},
new PackageFull
{
Name = "study",
Duration = 1,
LevelInNeed = 0,
WorkType = Work.WorkType.Study
},
new PackageFull
{
Name = "play",
Duration = 1,
LevelInNeed = 0,
WorkType = Work.WorkType.Play
Duration = 1;
}
};
if (Price > 0)
{
Price = 1;
}
if (LevelInNeed < 1)
{
LevelInNeed = 1.25;
}
if (Commissions < 0)
{
Commissions = 0.2;
}
var use = Math.Sign(Commissions - 0.25) * Math.Pow(Math.Abs(Commissions * 100 - 15), 1.5) +
Math.Sign(LevelInNeed - 1.2) * Math.Pow(Math.Abs(LevelInNeed * 100 - 15), 1.5) +
(Price * LevelInNeed * 100 - 100) / 4;
var get = Math.Sqrt(Duration);
var realvalue = use / get;
if (realvalue < 10)
{
Commissions = 0.2;
LevelInNeed = 1.25;
Price = 1;
Duration = 7;
}
}
}
}

View File

@ -258,6 +258,9 @@ namespace VPet_Simulator.Windows
mw.SelectTexts.Add(LPSConvert.DeserializeObject<SelectText>(li));
Tag.Add("selecttext");
break;
case "schedulepackage":
mw.SchedulePackage.Add(LPSConvert.DeserializeObject<ScheduleTask.PackageFull>(li));
break;
}
}
}

View File

@ -1702,6 +1702,9 @@ namespace VPet_Simulator.Windows
work.FixOverLoad();//导入的工作默认1.2倍
}
}
//加载数据合理化:自动工作
foreach (var stp in SchedulePackage)
stp.FixOverLoad();
var m = new System.Windows.Controls.MenuItem()

View File

@ -9,6 +9,7 @@ using System.Threading.Tasks;
using System.Windows;
using VPet_Simulator.Core;
using VPet_Simulator.Windows.Interface;
using static VPet_Simulator.Windows.Interface.ScheduleTask;
namespace VPet_Simulator.Windows;
@ -96,4 +97,9 @@ public partial class MainWindow
/// </summary>
public ScheduleTask ScheduleTask { get; set; }
/// <summary>
/// 所有可用套餐
/// </summary>
public List<PackageFull> SchedulePackage { get; set; } = new List<PackageFull>();
}

View File

@ -0,0 +1,14 @@
SchedulePackage:|Name#基础套餐:|Commissions#20%:|LevelInNeed#125%:|Duration#7:|Price#1:|Describe#基础套餐,给你们看标准的,反正也没人用。:|WorkType#Work:|
SchedulePackage:|Name#萌新套餐:|Commissions#35%:|LevelInNeed#105%:|Duration#7:|Price#0.8:|Describe#要求低,萌新很友好,但是抽成多了,欺负新来的。:|WorkType#Work:|
SchedulePackage:|Name#大佬套餐:|Commissions#5%:|LevelInNeed#140%:|Duration#14:|Price#0.2:|Describe#哇,等级好高!是大佬!:|WorkType#Work:|
SchedulePackage:|Name#实习:|Commissions#30%:|LevelInNeed#120%:|Duration#15:|Price#0.3:|Describe#记得实习证明叫单位盖章:|WorkType#Work:|
SchedulePackage:|Name#交学费:|Commissions#15%:|LevelInNeed#120%:|Duration#14:|Price#2.2:|Describe#上学交学费,工作也交学费:|WorkType#Work:|
SchedulePackage:|Name#桌宠会员专属:|Commissions#5%:|LevelInNeed#110%:|Duration#30:|Price#5.5:|Describe#《虚拟桌宠模拟器》会员专享权益多达11项功能首次开通连续包月只要4块.:|WorkType#Work:|
SchedulePackage:|Name#入职体验:|Commissions#20%:|LevelInNeed#120%:|Duration#1:|Price#0.8:|Describe#无要求体验一天,还是老板赚钱:|WorkType#Work:|
SchedulePackage:|Name#补习班:|Commissions#20%:|LevelInNeed#125%:|Duration#7:|Price#1:|Describe#非常普通的补习班,数据也很普通,让你怀疑怎么会出现在这里。:|WorkType#Study:|
SchedulePackage:|Name#从入门到入土:|Commissions#35%:|LevelInNeed#105%:|Duration#7:|Price#0.8:|Describe#报名就送《从入门到跑路》,《从入门到放弃》。:|WorkType#Study:|
SchedulePackage:|Name#老兵夏令营:|Commissions#5%:|LevelInNeed#140%:|Duration#14:|Price#0.2:|Describe#报名就送老兵烧烤5快代金券:|WorkType#Study:|
SchedulePackage:|Name#速成班:|Commissions#30%:|LevelInNeed#120%:|Duration#15:|Price#0.3:|Describe#当你打了个喷嚏,老师已经开始讲下一本书了。:|WorkType#Study:|
SchedulePackage:|Name#暑假班:|Commissions#15%:|LevelInNeed#120%:|Duration#14:|Price#2.2:|Describe#如果暑假就是用来补课的那不如取消算了。:|WorkType#Study:|
SchedulePackage:|Name#体验课:|Commissions#20%:|LevelInNeed#120%:|Duration#1:|Price#0.8:|Describe#帅哥,美女,游泳健身了解一下。:|WorkType#Study:|
SchedulePackage:|Name#琪露诺的算术教室:|Commissions#50%:|LevelInNeed#100%:|Duration#14:|Price#0:|Describe#效率低很正常你能听懂50%已经是⑨级别了。:|WorkType#Study:|