V1.11.0: gear that applies itself, equipping that matters, a character panel
- Weapons and items can carry effects: bonuses and penalties to AC, speed, initiative, max HP, passive Perception, ability scores, saving throws and skills, plus a note. They apply on their own while equipped and stop when the thing comes off. Armor is an item with an AC effect. The DM sets them with "Effects" on a row in the weapon or item pool. - The sheet's "armor bonus" is now "Extra AC", the DM's own adjustment on top of gear, and only the DM can set it. - Only what is equipped counts: a weapon has to be equipped to be used in an encounter. A character can have two things equipped at once, one of them a weapon (campaign settings). Equipping at the limit is refused with a message, and can be changed at any time, mid-encounter included. - A built-in item library: armor, shields, worn gear and supplies, with their effects set. The weapon library gains paired weapons (a pair of daggers is one weapon). - A floating character button on every page opens a panel with a character's numbers and everything they hold, with equip ticks. Players get their own characters, the DM everyone's, and each character card in an encounter has an Inventory button. It replaces the quick stats drawer. - A player's own characters stand out: marked and highlighted in encounters, with a button that jumps to their card; highlighted on the party screen; and listed once, not twice, on the campaign page. - All packages at version 1.11.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// Writes the full lists (every library spell, weapon and monster, and every
|
||||
// Writes the full lists (every library spell, weapon, item and monster, and every
|
||||
// option the character builder offers) into the docs, straight from the data
|
||||
// files the app itself uses, so the docs cannot drift from the app.
|
||||
//
|
||||
@@ -10,7 +10,7 @@
|
||||
// is written by hand.
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const { WEAPON_LIBRARY, SPELL_LIBRARY, MONSTER_LIBRARY } = require('../src/game/data/library');
|
||||
const { WEAPON_LIBRARY, ITEM_LIBRARY, SPELL_LIBRARY, MONSTER_LIBRARY } = require('../src/game/data/library');
|
||||
const options = require('../src/game/data/characterOptions');
|
||||
const { SPECIES } = require('../src/game/data/species');
|
||||
const { CLASSES } = require('../src/game/data/classes');
|
||||
@@ -49,8 +49,31 @@ function weaponLibrary() {
|
||||
ATTACK_WITH[w.attackAbility],
|
||||
w.properties.join(', '),
|
||||
w.rangeNormal ? `${w.rangeNormal}/${w.rangeLong} ft` : null,
|
||||
[effectList(w.effects), w.effectNote].filter(Boolean).join('. ') || null,
|
||||
]);
|
||||
return `### ${category} (${weapons.length})\n\n${table(['Weapon', 'Base damage', 'Type', 'Attacks with', 'Properties', 'Range'], rows)}`;
|
||||
return `### ${category} (${weapons.length})\n\n${table(['Weapon', 'Base damage', 'Type', 'Attacks with', 'Properties', 'Range', 'While equipped'], rows)}`;
|
||||
})
|
||||
.join('\n\n');
|
||||
}
|
||||
|
||||
// "+6 AC, −10 Speed": what a library entry does while equipped.
|
||||
const STAT_NAMES = { AC: 'AC', SPEED: 'Speed', INITIATIVE: 'Initiative', MAX_HP: 'Max HP', PASSIVE_PERCEPTION: 'Passive Perception', SAVES: 'all saves', SKILLS: 'all skill checks' };
|
||||
const title = (key) => key.toLowerCase().split('_').map((w, i) => (i > 0 && w === 'of' ? w : w[0].toUpperCase() + w.slice(1))).join(' ');
|
||||
function statName(stat) {
|
||||
if (STAT_NAMES[stat]) return STAT_NAMES[stat];
|
||||
if (stat.startsWith('SAVE_')) return `${stat.slice(5)} saves`;
|
||||
if (stat.startsWith('SKILL_')) return title(stat.slice(6));
|
||||
return stat;
|
||||
}
|
||||
const effectList = (effects = []) => effects.map((e) => `${signed(e.amount).replace('-', '−')} ${statName(e.stat)}`).join(', ');
|
||||
|
||||
function itemLibrary() {
|
||||
const categories = [...new Set(ITEM_LIBRARY.map((i) => i.category))];
|
||||
return categories
|
||||
.map((category) => {
|
||||
const items = ITEM_LIBRARY.filter((i) => i.category === category);
|
||||
const rows = items.map((i) => [i.name, effectList(i.effects), i.effectNote, i.damageDice, i.description]);
|
||||
return `### ${category} (${items.length})\n\n${table(['Item', 'While equipped', 'Note', 'Dice', 'Description'], rows)}`;
|
||||
})
|
||||
.join('\n\n');
|
||||
}
|
||||
@@ -94,6 +117,7 @@ function builderLists() {
|
||||
const SECTIONS = {
|
||||
'SPELLS.md': { 'spell-library': spellLibrary },
|
||||
'WEAPONS.md': { 'weapon-library': weaponLibrary },
|
||||
'ITEMS.md': { 'item-library': itemLibrary },
|
||||
'MONSTERS.md': { 'monster-library': monsterLibrary },
|
||||
'CHARACTERS.md': { 'builder-lists': builderLists },
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user