feat: Implement SimRoom Overclock-实现模拟室超频 (#68)

- Added GetAcquireBuffFunction to handle buff acquisition requests in the simulation room.
- Added InfinitePopupCheck to manage infinite popup checks for users.
- Added ProceedSkipFunction to process skip requests in the simulation room.
- Updated SelectDifficulty to handle overclock options and season data.
- Enhanced SimRoomHelper to support overclock mechanics and event group logic.
- Modified GetSimRoomData to include buffs and legacy buffs in the response.
- Updated Quit functionality to reset overclock state upon quitting the simulation room.
- Added logic to handle overclock rewards and high score updates.
- Refactored user model to retain current season data and legacy buffs during resets.
- Introduced new OverclockData and OverclockHighScoreData models to manage overclock states.
This commit is contained in:
qmengz
2025-12-06 04:26:14 +08:00
committed by GitHub
parent 6d44c6eac9
commit 24f6de8704
18 changed files with 687 additions and 159 deletions

View File

@@ -1,4 +1,5 @@
using EpinelPS.Utils;
using EpinelPS.Data;
using EpinelPS.Utils;
namespace EpinelPS.LobbyServer.LobbyUser
{
@@ -7,12 +8,12 @@ namespace EpinelPS.LobbyServer.LobbyUser
{
protected override async Task HandleAsync()
{
ReqGetContentsOpenData req = await ReadData<ReqGetContentsOpenData>();
await ReadData<ReqGetContentsOpenData>();
User user = GetUser();
// this request returns a list of "special" stages that mark when something is unlocked, ex: the shop or interception
List<int> specialStages = [6003003, 6002008, 6002016, 6005003, 6003021, 6011018, 6007021, 6004018, 6005013, 6003009, 6003012, 6009017, 6016039, 6001004, 6000003, 6000001, 6002001, 6004023, 6005026, 6020050, 6006004, 6006023,6022049];
List<int> specialStages = [6003003, 6002008, 6002016, 6005003, 6003021, 6011018, 6007021, 6004018, 6005013, 6003009, 6003012, 6009017, 6016039, 6001004, 6000003, 6000001, 6002001, 6004023, 6005026, 6020050, 6006004, 6006023, 6022049];
ResGetContentsOpenData response = new();
foreach (FieldInfoNew field in user.FieldInfoNew.Values)
@@ -23,12 +24,40 @@ namespace EpinelPS.LobbyServer.LobbyUser
response.ClearStageList.Add(stage);
}
}
response.MaxGachaCount = 10;
response.MaxGachaPremiumCount = 10;
response.MaxGachaCount = user.GachaTutorialPlayCount;
response.MaxGachaPremiumCount = user.GachaTutorialPlayCount;
// todo tutorial playcount of gacha
response.TutorialGachaPlayCount = user.GachaTutorialPlayCount;
// ClearSimRoomChapterList: 已通关的章节列表,用于显示超频选项 SimRoomOC
response.ClearSimRoomChapterList.AddRange(GetClearSimRoomChapterList(user));
await WriteDataAsync(response);
}
private static List<int> GetClearSimRoomChapterList(User user)
{
var clearSimRoomChapterList = new List<int>();
try
{
var currentDifficulty = user.ResetableData.SimRoomData?.CurrentDifficulty ?? 0;
var currentChapter = user.ResetableData.SimRoomData?.CurrentChapter ?? 0;
if (currentDifficulty > 0 && currentChapter > 0)
{
var chapters = GameData.Instance.SimulationRoomChapterTable.Values.Where(c => c.DifficultyId <= currentDifficulty).ToList();
foreach (var chapter in chapters)
{
bool isAdd = chapter.DifficultyId < currentDifficulty ||
(chapter.DifficultyId == currentDifficulty && chapter.Chapter <= currentChapter);
if (isAdd) clearSimRoomChapterList.Add(chapter.Id);
}
}
}
catch (Exception e)
{
Logging.Warn($"GetClearSimRoomChapterList error: {e.Message}");
}
return clearSimRoomChapterList;
}
}
}

View File

@@ -7,11 +7,16 @@ namespace EpinelPS.LobbyServer.LobbyUser
{
protected override async Task HandleAsync()
{
ReqGetUserTitleCounterList req = await ReadData<ReqGetUserTitleCounterList>();
await ReadData<ReqGetUserTitleCounterList>();
ResGetUserTitleCounterList r = new();
ResGetUserTitleCounterList response = new();
response.UserTitleCounterList.Add(new ResGetUserTitleCounterList.Types.NetUserTitleCounter { Condition = 23, SubCondition = 1, Count = 10});
response.UserTitleCounterList.Add(new ResGetUserTitleCounterList.Types.NetUserTitleCounter { Condition = 23, SubCondition = 2, Count = 10});
response.UserTitleCounterList.Add(new ResGetUserTitleCounterList.Types.NetUserTitleCounter { Condition = 23, SubCondition = 3, Count = 10});
response.UserTitleCounterList.Add(new ResGetUserTitleCounterList.Types.NetUserTitleCounter { Condition = 23, SubCondition = 4, Count = 10});
response.UserTitleCounterList.Add(new ResGetUserTitleCounterList.Types.NetUserTitleCounter { Condition = 23, SubCondition = 5, Count = 10});
await WriteDataAsync(r);
await WriteDataAsync(response);
}
}
}