- Hollowcrown: The Rift Between Worlds as its own seed (npm run seed:hollowcrown), built from the campaign book: pools, 58 monsters, 57 NPCs, 28 locations, 72 encounters with rewards, and DM notes. Shared seeding logic moved to prisma/seedCampaign.js. - What players can see: only encounters their own character is in; only the pool entries their character holds (plus starting options while building); only locations their character has been to; no invite code; no gold, inventory or money log of other players' characters. Socket events carry ids only and campaign rooms are members-only. - Encounters have a location; while one is in progress its characters are there, and visits are remembered. - Campaign setting to show players a health bar only for monsters and NPCs. - Initiative is entered as the d20 roll (1-20) and the bonus is added; players can enter their own character's roll. - Number fields enforce their limits when typing, and the API enforces the same limits. - Temp HP shows on HP bars and absorbs damage before real HP. - All packages at version 1.3.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
33 lines
1.5 KiB
JavaScript
33 lines
1.5 KiB
JavaScript
// Adds the Hollowcrown: The Rift Between Worlds campaign
|
|
// (seed-data/hollowcrown.js) for the admin account. Not part of the default
|
|
// seed — run it on its own:
|
|
//
|
|
// npm run seed:hollowcrown
|
|
//
|
|
// Like every seed it only adds (see seedCampaign.js): it never touches other
|
|
// campaigns, and does nothing if the admin already has an active Hollowcrown.
|
|
const { run, fromLibrary } = require('./seedCampaign');
|
|
const { WEAPON_LIBRARY, SPELL_LIBRARY, MONSTER_LIBRARY } = require('../src/game/data/library');
|
|
const hollowcrown = require('../seed-data/hollowcrown.js');
|
|
|
|
const startingSpells = new Set(hollowcrown.startingSpells);
|
|
for (const key of startingSpells) fromLibrary(SPELL_LIBRARY, key); // fail early on a misspelt key
|
|
|
|
run({
|
|
...hollowcrown,
|
|
// The book's starting picks come from the site library; its modern relics
|
|
// and magic weapons are never starting options.
|
|
weapons: [
|
|
...hollowcrown.libraryWeapons.map((key) => fromLibrary(WEAPON_LIBRARY, key, { isStartingOption: true })),
|
|
...hollowcrown.weapons,
|
|
],
|
|
// The whole spell library goes in, so a spell is there to hand out the
|
|
// moment a character unlocks it; only the book's Session 0 list is offered
|
|
// in the builder.
|
|
spells: [
|
|
...SPELL_LIBRARY.map(({ key }) => fromLibrary(SPELL_LIBRARY, key, { isStartingOption: startingSpells.has(key) })),
|
|
...hollowcrown.spells,
|
|
],
|
|
monsters: [...hollowcrown.libraryMonsters.map((key) => fromLibrary(MONSTER_LIBRARY, key)), ...hollowcrown.monsters],
|
|
});
|