v2.7.0 : templates de drop (table BDD, proba admin, application au drop)

- db.js : table templates + seed des 19 templates du CSV (mappes vers les
  mods + nouveau champ tour), templatesAll/setTemplate/resetCategory.
- server.js : /api/reference/templates.
- mp.js : config templateChance (0-100, bornee) ; applyGearTemplates applique
  jusqu'a 3 templates (6 si 2 mains), distincts, proba par emplacement,
  fusionne les mods (dont tour) et compose le nom ; applique au spawnItem.
  Solo vanilla.
- gear.js : GEAR_MOD_LABELS += tour (affichage 'TOUR +X mn').
- admin.html : champ Proba de template / emplacement.
- test/mp.js : test des templates (nb selon mains, distincts, proba 0).

Note : effet gameplay de tour (DLA) non cable, en attente de la regle.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
perco
2026-06-14 00:17:53 +02:00
co-authored by Claude Opus 4.8
parent b55a6f8ac9
commit 00a4669928
8 changed files with 116 additions and 8 deletions
+2 -1
View File
@@ -275,8 +275,9 @@ function handleAPI(req, res, url) {
monsters: () => db.monsters(),
potions: () => db.treasuresAll("potions"),
scrolls: () => db.treasuresAll("scrolls"),
templates: () => db.templatesAll(),
};
const refMatch = url.pathname.match(/^\/api\/reference\/(gear|monsters|potions|scrolls)$/);
const refMatch = url.pathname.match(/^\/api\/reference\/(gear|monsters|potions|scrolls|templates)$/);
if (req.method === "GET" && refMatch) {
return sendJSON(res, 200, REFERENCE[refMatch[1]]());
}