超模工作计算支持负数

This commit is contained in:
ZouJin 2023-09-12 13:15:22 +08:00
parent baa63371d3
commit 07936570f5

View File

@ -23,15 +23,15 @@ namespace VPet_Simulator.Windows.Interface
var spend = ((work.StrengthFood >= 0 ? 1 : -1) * Math.Pow(work.StrengthFood * 2 + 1, 2) / 6 +
(work.StrengthDrink >= 0 ? 1 : -1) * Math.Pow(work.StrengthDrink * 2 + 1, 2) / 9 +
(work.Feeling >= 0 ? 1 : -1) * Math.Pow((work.Type == Work.WorkType.Play ? -1 : 1) * work.Feeling * 2 + 1, 2) / 12) *
(Math.Pow(work.LevelLimit / 2 + 1, 0.5) / 4 + 1) - 0.5;
if (spend <= 0)
return true;
(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;
if (rel < 0)
return true;
return rel > 2; // 推荐rel为1.0-1.4之间 超过2.0就是超模
}
}