Add ranged combat area effects and admin-authored mobs

This commit is contained in:
dingo
2026-09-09 05:26:31 -04:00
parent 7a4c6c9e9b
commit 0b4eaa153c
29 changed files with 2220 additions and 181 deletions
+4 -2
View File
@@ -1,4 +1,5 @@
import './portal.css';
import { showMobSpawner } from './mob-spawner';
import { permanentTitles, progressionSummary } from './progression';
import { statsBreakdown, equipmentDetails } from './character-stats';
import { showCatalog, hasCatalogDraft } from './content-editor';
@@ -14,10 +15,11 @@ let busy = false;
let draft: Draft;
const commandMenu=registerMenu($('command-dialog'),()=>$<HTMLDialogElement>('command-dialog').close());
const characterMenu=registerMenu($('character-dialog'),()=>$<HTMLDialogElement>('character-dialog').close());
const labels: Record<string, string> = { 'create-world': 'New world', 'close-admissions': 'Close arrivals', 'open-admissions': 'Open arrivals', 'awaken-boss': 'Awaken Harbinger', 'end-world': 'End world permanently', rename: 'Rename character', heal: 'Restore health', unstuck: 'Return to sanctuary', retire: 'Retire character permanently', 'revoke-sessions': 'Revoke account sessions' };
const labels: Record<string, string> = { 'spawn-mobs':'Spawn mobs', 'create-world': 'New world', 'close-admissions': 'Close arrivals', 'open-admissions': 'Open arrivals', 'awaken-boss': 'Awaken Harbinger', 'end-world': 'End world permanently', rename: 'Rename character', heal: 'Restore health', unstuck: 'Return to sanctuary', retire: 'Retire character permanently', 'revoke-sessions': 'Revoke account sessions' };
Object.assign(labels, { 'grant-item':'Add item', 'remove-item':'Remove item', 'grant-title':'Add / restore title', 'revoke-title':'Remove title' });
function notify(message: string) { $('control-message').textContent = message; $('control-message').hidden = false; }
function openCommand(op: string, worldId = '', target = '', value = '') {
if(op==='spawn-mobs'){void showMobSpawner(worldId,()=>{notify('Mob spawn queued. Check the audit for its result.');void refresh()});return;}
draft = { id: crypto.randomUUID(), worldId, op, target, value };
$<HTMLFormElement>('command-form').reset();
const create = op === 'create-world', rename = op === 'rename';
@@ -74,7 +76,7 @@ function render() {
const row = body.insertRow(); const link = el('a', w.id, 'record-link'); link.href = gameURL(w.id); const worldName = el('div'); worldName.append(link, el('small', `Catalog ${w.catalogVersion ?? 0}`, 'muted block')); cell(row, worldName);
const status = el('div', '', 'badge-group'); status.append(badge(w.phase)); if (!w.available) status.append(badge('offline')); else if (w.closed) status.append(badge('closed'));
cell(row, status); cell(row, `${w.living} / ${w.capacity}`); cell(row, String(w.dead)); cell(row, date(w.bossAt));
const options = [w.closed ? 'open-admissions' : 'close-admissions']; if (w.phase === 'gathering') options.push('awaken-boss'); options.push('end-world');
const options = [w.closed ? 'open-admissions' : 'close-admissions']; if (w.phase === 'gathering') options.push('awaken-boss'); options.push('spawn-mobs','end-world');
cell(row, actions(w.id, options, '', '', !w.available || ['won','lost'].includes(w.phase))); count++;
}
parent.append(node); $('table-note').textContent = 'Availability reflects the world-owner lease. Living counts include offline characters.';