mirror of
https://github.com/Walter-Sparrow/lunar-tear.git
synced 2026-07-02 05:43:41 +03:00
Implement Recollections of Dusk
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user