最低有效度为50% #356

This commit is contained in:
ZouJin 2024-04-17 15:04:17 +08:00
parent 4c8a6e1fce
commit 6b31b40512
2 changed files with 10 additions and 4 deletions

View File

@ -190,9 +190,9 @@ namespace VPet_Simulator.Windows.Interface
else
descs = "有效度".Translate();
if (Type == FoodType.Gift)
descs += ":\t" + Math.Max(0.4, 1 - Math.Pow((eattime - now).TotalHours, 2) * 0.01).ToString("p0");
descs += ":\t" + Math.Max(0.5, 1 - Math.Pow((eattime - now).TotalHours, 2) * 0.01).ToString("p0");
else
descs += ":\t" + Math.Max(0.2, 1 - Math.Pow((eattime - now).TotalHours, 2) * 0.02).ToString("p0");
descs += ":\t" + Math.Max(0.5, 1 - Math.Pow((eattime - now).TotalHours, 2) * 0.02).ToString("p0");
descs += "\t\t" + "恢复".Translate() + ":\t" + (eattime).ToString("MM/dd HH");
}
}

View File

@ -27,6 +27,7 @@ using VPet_Simulator.Windows.Interface;
using static VPet_Simulator.Core.GraphHelper;
using static VPet_Simulator.Core.GraphInfo;
using static VPet_Simulator.Windows.Interface.ExtensionFunction;
using static VPet_Simulator.Windows.Interface.Food;
using Application = System.Windows.Application;
using ContextMenu = System.Windows.Forms.ContextMenuStrip;
using Image = System.Windows.Controls.Image;
@ -619,10 +620,15 @@ namespace VPet_Simulator.Windows
{
eattimes = (eattime - now).TotalHours;
}
double eatuseps;
if (item.Type == FoodType.Gift)
eatuseps = Math.Max(0.5, 1 - Math.Pow((eattime - now).TotalHours, 2) * 0.01);
else
eatuseps = Math.Max(0.5, 1 - Math.Pow((eattime - now).TotalHours, 2) * 0.02);
//开始加点
Core.Save.EatFood(item, Math.Max(0.5, 1 - eattimes * eattimes * 0.01));
Core.Save.EatFood(item, Math.Max(0.5, eatuseps));
//吃腻了
eattimes += Math.Max(0.5, Math.Min(2, 2 - (item.Likability + item.Feeling / 2) / 5));
eattimes += Math.Max(0.5, Math.Min(4, 2 - (item.Likability + item.Feeling / 2) / 5));
GameSavesData["buytime"].SetDateTime(item.Name, now.AddHours(eattimes));
//通知
item.LoadEatTimeSource(this);