v2.12.0 : editeur pose les monstres du bestiaire (mob+age) + retrait du Behemoth
game.js : rollBestiaryMonster(b, age, ..) extrait (build d'un monstre
precis) ; monsterFromSpec gere {mob:nom, age} (bestiaire) + retrocompat
{type,tpl} et boss:true ; bestiaryBoss() = le plus fort du bestiaire ;
buildLevel MAX_DEPTH -> bestiaryBoss (plus de Behemoth statique) ; messages
'gardien du Hall' ; applyLevel filtre les specs nulles. index.html : selects
famille/monstre/age dans l'editeur. editor.js : edSetupMobPickers/edFillMobs/
edFillAges, pinceau 'Poser le monstre choisi', placement {mob,age}, rendu
emoji de famille (retrocompat type/boss). server.js validateLevel accepte
{mob,age}. Behemoth (BOSS) garde comme repli si bestiaire absent.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -72,7 +72,9 @@ function validateLevel(l) {
|
||||
if (!Array.isArray(l.monsters) || l.monsters.length > 60) return "monstres invalides (max 60)";
|
||||
for (const m of l.monsters) {
|
||||
if (!inBounds(m) || tile(l, m) === "#") return "monstre hors-sol";
|
||||
if (m.boss !== true && !(Number.isInteger(m.type) && m.type >= 0 && Number.isInteger(m.tpl) && m.tpl >= 0)) return "type de monstre invalide";
|
||||
const okMob = typeof m.mob === "string" && m.mob.length > 0 && m.mob.length <= 60 && Number.isInteger(m.age) && m.age >= 0 && m.age <= 7;
|
||||
const okLegacy = m.boss === true || (Number.isInteger(m.type) && m.type >= 0 && Number.isInteger(m.tpl) && m.tpl >= 0);
|
||||
if (!okMob && !okLegacy) return "type de monstre invalide";
|
||||
}
|
||||
if (!Array.isArray(l.items) || l.items.length > 60) return "objets invalides (max 60)";
|
||||
for (const i of l.items) {
|
||||
|
||||
Reference in New Issue
Block a user