Repository navigation
Monster compendium - #28
Merged
Merged
Conversation
Contributor
📦 Version Preview
|
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.
Monster compendium & NPC skills
High-level summary of
monster_compendiumvsmain: a full SRD Monster Manual–style Actor compendium, NPC skill support aligned with the generalized modifier system, compendium UX and loader work for monsters, and automated token sizing from creature size.New content & user-facing features
Monsters (SRD) compendium
thirdera_monsterspack (type: "Actor",packs/monsters/) with a dedicated sidebar banner (assets/banners/monsters-banner.webp).skillandfeatitems (same shapes as world/compendium items) so totals can reflect ranks, misc bonuses, armor/load, and feat GMS keys; authoring conventions are documented indocs-site/compendium-guide.md(Monster / NPC compendium section).flags.thirdera.srdHubTraitsand paired HTML markers inspecialAbilitiesfor hub-derived traits (see tests undertest/unit/data/srd-hub-monster-flags.test.mjs).module/logic/dragon-natural-attacks.mjs, kept in sync withscripts/refresh-dragon-natural-attacks.mjs/ the import tooling).NPC sheet & skills
system.npcClassSkillon skill items, modifier-only rows, and rolls consistent with PCs (module/logic/npc-skill-prep.mjs,module/sheets/actor-sheet.mjs,templates/actor/npc-sheet.hbs).createEmbeddedDocumentsusing stable identity rules (module/logic/npc-embedded-skill-identity.mjs).SkillPickerDialogextensions to support NPC authoring flows (module/applications/skill-picker-dialog.mjs).Compendium & token quality of life
module/utils/fuzzy.mjsfromthirdera.mjs).system.details.sizewhen still at Foundry’s default 1×1; updates on size change preserve manually adjusted dimensions; linked scene tokens follow on size change (GM client). Logic:module/logic/token-dimensions-from-size.mjs; Foundry wiring:module/logic/token-dimensions-from-size-hooks.mjs(registerTokenDimensionHooks).Tooling & docs
Makefiletesttarget runsnode --check module/logic/compendium-loader.mjsbeforenpm testto catch syntax issues in the large loader module early.docs-site/compendium-guide.md,docs-site/development.md, and relateddocs-site/pages where monster packs and NPC behavior are described.Notes for contributors & system extenders
Compendium loader & pack wiring
module/logic/compendium-loader.mjs: expandedFILE_MAPPINGSforthirdera.thirdera_monsters; on import, NPC documents runresolveMonsterPackNpcKeysso authoring keyscreatureTypeKey/subtypeKeysbecome storeddetails.creatureTypeUuid/details.subtypeUuidsafter lookup in the creature type and subtype packs (module/logic/monster-pack-keys.mjs).getStableKey(system.key, etc.); new monster JSON must define a uniquesystem.key.FILE_MAPPINGSand, for generated content, the repo scripts (e.g.scripts/build-monster-pack-json.py,scripts/apply-monster-skills-feats.mjs,scripts/import_srd_missing_monsters.py) as described in the compendium guide.Data model touchpoints
module/data/actor-npc.mjs,module/documents/actor.mjs,module/documents/item.mjs,module/data/item-skill.mjs: NPC skill prep hooks, defaults fornpcClassSkill, and embed dedupe behavior.lang/en.jsonandstyles/thirdera.css: strings and layout for NPC skills and related UI.Tests (Vitest)
New or expanded unit/data tests include:
test/unit/logic/monster-pack-keys.test.mjstest/unit/logic/npc-skill-prep.test.mjstest/unit/logic/npc-embedded-skill-identity.test.mjstest/unit/logic/token-dimensions-from-size.test.mjstest/unit/logic/token-dimensions-from-size-hooks.test.mjstest/unit/logic/dragon-natural-attacks.test.mjstest/unit/data/monster-embedded-skills-uniqueness.test.mjstest/unit/data/srd-hub-monster-flags.test.mjsSee
test/README.mdfor the coverage map.make testandmake test-coverageshould pass before merge.Hook registration pattern
registerTokenDimensionHooks()is the referenceregister*Hooks+ injecteddepspattern for Foundry hooks; registered fromthirdera.mjson init.Upgrade / migration
readypath; existing world actors are not batch-migrated for token dimensions (seedocs-site/development.md— token footprint vs size).