mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-12 23:14:36 +01:00
rewrite into SeasonOverride
This commit is contained in:
@@ -29,7 +29,6 @@
|
||||
"QuestDebugTools": false,
|
||||
"EarthStatusOverride": 0,
|
||||
"EarthIDOverride": 0,
|
||||
"DynamicSeasons": true,
|
||||
"EarthMonsterOverride": 0,
|
||||
"SaveDumps": {
|
||||
"Enabled": true,
|
||||
@@ -58,7 +57,8 @@
|
||||
"DisableHunterNavi": false,
|
||||
"EnableHiganjimaEvent": false,
|
||||
"EnableNierEvent": false,
|
||||
"DisableRoad": false
|
||||
"DisableRoad": false,
|
||||
"SeasonOverride": false
|
||||
},
|
||||
"Discord": {
|
||||
"Enabled": false,
|
||||
|
||||
@@ -110,7 +110,6 @@ type DevModeOptions struct {
|
||||
QuestDebugTools bool // Enable various quest debug logs
|
||||
EarthStatusOverride int32
|
||||
EarthIDOverride int32
|
||||
DynamicSeasons bool // Enables dynamic seasons
|
||||
EarthMonsterOverride int32
|
||||
SaveDumps SaveDumpOptions
|
||||
}
|
||||
@@ -144,6 +143,7 @@ type GameplayOptions struct {
|
||||
EnableHiganjimaEvent bool // Enables the Higanjima event in the Rasta Bar
|
||||
EnableNierEvent bool // Enables the Nier event in the Rasta Bar
|
||||
DisableRoad bool // Disables the Hunting Road
|
||||
SeasonOverride bool // Overrides the Quest Season with the current Mezeporta Season
|
||||
}
|
||||
|
||||
// Discord holds the discord integration config.
|
||||
|
||||
@@ -45,7 +45,7 @@ func handleMsgSysGetFile(s *Session, p mhfpacket.MHFPacket) {
|
||||
)
|
||||
}
|
||||
|
||||
if s.server.erupeConfig.DevModeOptions.DynamicSeasons && s.server.erupeConfig.DevMode {
|
||||
if s.server.erupeConfig.GameplayOptions.SeasonOverride {
|
||||
pkt.Filename = seasonConversion(s, pkt.Filename)
|
||||
}
|
||||
|
||||
@@ -69,11 +69,7 @@ func seasonConversion(s *Session, questFile string) string {
|
||||
timeSet = "n"
|
||||
}
|
||||
|
||||
// Determine the current season based on a modulus of the current time
|
||||
sid := int64(((s.server.ID & 0xFF00) - 4096) / 256)
|
||||
season := ((TimeAdjusted().Unix() / 86400) + sid) % 3
|
||||
|
||||
filename := fmt.Sprintf("%s%s%d", questFile[:5], timeSet, season)
|
||||
filename := fmt.Sprintf("%s%s%d", questFile[:5], timeSet, s.server.Season())
|
||||
|
||||
// Return original file if file doesn't exist
|
||||
if _, err := os.Stat(filename); err == nil {
|
||||
|
||||
@@ -405,3 +405,8 @@ func (s *Server) NextSemaphoreID() uint32 {
|
||||
}
|
||||
return s.semaphoreIndex
|
||||
}
|
||||
|
||||
func (s *Server) Season() uint8 {
|
||||
sid := int64(((s.ID & 0xFF00) - 4096) / 256)
|
||||
return uint8(((TimeAdjusted().Unix() / 86400) + sid) % 3)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user