Implement Recollections of Dusk

This commit is contained in:
Ilya Groshev
2026-05-16 14:35:47 +03:00
parent 15beefb5b8
commit 26c10ac429
6 changed files with 229 additions and 42 deletions
+13
View File
@@ -45,6 +45,7 @@ func (h *QuestHandler) HandleEventQuestFinish(user *store.UserState, eventQuestC
outcome := h.evaluateFinishOutcome(user, questId)
if !isRetired {
h.applyQuestVictory(user, questId, &outcome, nowMillis, false)
h.recordSideStoryLimitContentStatus(user, questId, nowMillis)
}
if isRetired && !isAnnihilated && quest.Stamina > 1 {
@@ -64,6 +65,18 @@ func (h *QuestHandler) HandleEventQuestFinish(user *store.UserState, eventQuestC
return outcome
}
func (h *QuestHandler) recordSideStoryLimitContentStatus(user *store.UserState, questId int32, nowMillis int64) {
chapterId, ok := h.SideStoryChapterByEventQuestId[questId]
if !ok {
return
}
st := user.QuestLimitContentStatus[questId]
st.LimitContentQuestStatusType = 1
st.EventQuestChapterId = chapterId
st.LatestVersion = nowMillis
user.QuestLimitContentStatus[questId] = st
}
func (h *QuestHandler) HandleEventQuestRestart(user *store.UserState, eventQuestChapterId, questId int32, nowMillis int64) {
h.HandleQuestRestart(user, questId, nowMillis)
+14 -4
View File
@@ -25,13 +25,23 @@ type FinishOutcome struct {
type QuestHandler struct {
*masterdata.QuestCatalog
Config *masterdata.GameConfig
Granter *store.PossessionGranter
Config *masterdata.GameConfig
Granter *store.PossessionGranter
SideStoryChapterByEventQuestId map[int32]int32
}
func NewQuestHandler(catalog *masterdata.QuestCatalog, config *masterdata.GameConfig) *QuestHandler {
func NewQuestHandler(catalog *masterdata.QuestCatalog, config *masterdata.GameConfig, sideStory *masterdata.SideStoryCatalog) *QuestHandler {
granter := BuildGranter(catalog)
return &QuestHandler{QuestCatalog: catalog, Config: config, Granter: granter}
var sideStoryChapters map[int32]int32
if sideStory != nil {
sideStoryChapters = sideStory.ChapterByEventQuestId
}
return &QuestHandler{
QuestCatalog: catalog,
Config: config,
Granter: granter,
SideStoryChapterByEventQuestId: sideStoryChapters,
}
}
func BuildGranter(catalog *masterdata.QuestCatalog) *store.PossessionGranter {