v2.11.1 : nom monstre 'Nom [Age]' + gestion du feminin

bestiary.js regenere avec champ gender (m/f, liste curatee de ~31
feminins) + export AGE_NAMES_F. db.js : gender en colonne (BESTIARY_TXT_KEYS)
+ migration ALTER TABLE ... ADD COLUMN gender AVANT le seed, puis UPDATE
du genre des lignes existantes. game.js buildBestiaryMonster(.., ageNamesF, ..)
: nom = 'Nom [Age]' avec age accorde au genre. mp.js + makeMonster passent
AGE_NAMES_F. treasures.js : age affiche au feminin. admin : champ Genre.
Tests : format + feminin (Plante [Doyenne]).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
perco
2026-06-15 21:05:00 +02:00
co-authored by Claude Opus 4.8
parent 116ac7d063
commit 867569c3c9
8 changed files with 38 additions and 13 deletions
+5 -1
View File
@@ -262,10 +262,14 @@ function makeWorld(over = {}) {
pvMin: 5000, pvMax: 5000, attMin: 7, attMax: 7, esqMin: 3, esqMax: 3, degMin: 4, degMax: 4, regMin: 1, regMax: 1,
armPhysMin: 2, armPhysMax: 2, armMagMin: 0, armMagMax: 0, vueMin: 4, vueMax: 4, mmMin: 0, mmMax: 0, rmMin: 0, rmMax: 0,
fly: 0, ranged: 0, magic: 1, seesHidden: 0, speed: "Normale", nbAtt: 1, capacities: "", blason: "" }];
const bm = g.buildBestiaryMonster(one, [1, 1, 1, 1, 1, 1, 1, 1], best.AGE_NAMES, 10, 0, 0);
const bm = g.buildBestiaryMonster(one, [1, 1, 1, 1, 1, 1, 1, 1], best.AGE_NAMES, best.AGE_NAMES_F, 10, 0, 0);
assert.strictEqual(bm.pv, 5000, "PV tiré dans la plage du bestiaire");
assert.strictEqual(bm.att, 7, "ATT tirée dans la plage");
assert.strictEqual(bm.attMag, 7, "monstre magique : attMag = att");
assert.strictEqual(bm.name, "Cobaye [Nouveau]", "nom au format Nom [Âge]");
// féminin : « Plante [Doyenne] »
const fem = g.buildBestiaryMonster([{ ...one[0], name: "Plante", gender: "f", minAge: 5, maxAge: 5 }], [1, 1, 1, 1, 1, 1, 1, 1], best.AGE_NAMES, best.AGE_NAMES_F, 10, 0, 0);
assert.strictEqual(fem.name, "Plante [Doyenne]", "âge au féminin : " + fem.name);
// édition admin du bestiaire reflétée en base
const name = db.bestiaryAll()[0].name;
mp.adminSetTuning(w, { bestiary: { [name]: { pvMin: 4242, pvMax: 4242 } } });