Module/Plugin expansion for mobs/buffs/pets/conversations#611
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Extends the module/plugin system so modules can ship their own embedded data files and scripts for buffs, pets, quests, mobs, and conversations (previously limited to items, mutators, and templates). Also refactors the gametime period-parsing logic and adds calendar-aware period anchoring.
Changes
• Added RegisterFS plugin integration to the buffs, pets, quests, mobs, and conversations packages, merging embedded module data files into in-memory state at load time with disk content winning on ID collisions.
• Added script-registration helpers ( RegisterBuffScript , RegisterMobScript , plus pet/buff/mob GetScript lookups) so modules can supply embedded JS scripts that are checked before the disk path.
• Wired the new RegisterFS calls into main.go against the plugin registry.
• Refactored gametime.AddPeriod into a dedicated parsePeriod helper and a unified switch, collapsing duplicated unit branches.
• Promoted period-anchoring logic to a calendar-aware GameDate.LastPeriod method, added a StartOf backward-snapping helper, and consolidated SetToNight / SetToDay into a shared implementation.
• Added month and year start-of-period handling and an anchorPeriods table for noon/midnight/sunrise/sunset units.
• Added plugin tests for buffs, pets, quests, mobs, and conversations, plus new gametime test coverage.
• Updated module authoring documentation ( modules/AGENTS.md , package AGENTS.md files, and the admin module docs page).