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:
+14
@@ -280,6 +280,20 @@ function makeWorld(over = {}) {
|
||||
assert.strictEqual(db.gearRow("arme", "Gourdin").att, 2, "reset gear → vanilla (gourdin)");
|
||||
}
|
||||
|
||||
// Templates de drop : nombre selon les mains, distincts, bonus fusionnés, proba 0
|
||||
{
|
||||
const one = mp.applyGearTemplates({ kind: "gear", slot: "arme", name: "Épée Courte", twoHanded: false, mods: { deg: 2 } }, 100);
|
||||
assert.strictEqual(one.templates.length, 3, "1 main : 3 templates max");
|
||||
assert.strictEqual(one.mods.deg >= 2, true, "mod de base conservé");
|
||||
assert(one.name.startsWith("Épée Courte "), "suffixes de template ajoutés au nom");
|
||||
const two = mp.applyGearTemplates({ kind: "gear", slot: "arme", name: "Épée Longue", twoHanded: true, mods: {} }, 100);
|
||||
assert.strictEqual(two.templates.length, 6, "2 mains : 6 templates max");
|
||||
assert.strictEqual(new Set(two.templates).size, 6, "templates tous distincts");
|
||||
const none = mp.applyGearTemplates({ kind: "gear", slot: "arme", name: "Gourdin", twoHanded: false, mods: { att: 2 } }, 0);
|
||||
assert(!none.templates, "proba 0 : aucun template");
|
||||
assert.strictEqual(none.name, "Gourdin", "nom inchangé sans template");
|
||||
}
|
||||
|
||||
// Tuning admin : puissance des potions/parchemins et bonus d'équipement
|
||||
{
|
||||
const w = makeWorld({ monsterTarget: 0, itemTarget: 0 });
|
||||
|
||||
Reference in New Issue
Block a user