From 106754fd778cbbfbfe9c5797016d28217730869f Mon Sep 17 00:00:00 2001 From: "IETM_FIXE\\ietm6" Date: Sat, 17 Oct 2026 17:07:10 +0200 Subject: [PATCH] =?UTF-8?q?Mentor=20d'=C3=A9criture=20:=20champs=20d'histo?= =?UTF-8?q?ire=20pour=20sc=C3=A8nes,=20arcs=20et=20PNJ?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Scène : « Utilité » (ce que l'histoire perd si on la coupe) et « Tactique et moral des adversaires » (comment ils se battent, quand ils fuient ou se rendent), dans l'éditeur, la vue et le PDF (réservés au MJ). - Arc : « Histoire cachée » (la vérité que les joueurs reconstituent) et « Accroches » (une par ligne), nouvelle section de l'éditeur ; dans le PDF, histoire cachée en encadré secret et accroches, version MJ uniquement. - PNJ : bloc « Rôle dans l'histoire », indépendant du système de jeu : rôle (opposant, allié, ressource, figurant), motivation, ce qu'il sait, signe distinctif. Dans le PDF, le signe distinctif se voit aussi en version joueurs ; rôle, motivation et savoir restent réservés au MJ. - Huit fiches du coach pour ces champs, rédigées pour LoreMind. - Relecture d'éditeur : WRITE-016 (opposant ou allié sans motivation, lien vers la fiche du PNJ), WRITE-017 (arc avec une seule accroche) ; un combat dont la tactique est écrite n'est plus signalé « sans but » (WRITE-008). - Migration V27 (colonnes scènes/arcs, fiche PNJ en JSON) ; champs conservés à l'export/import de campagne. Vérifié : core clean verify (1277 tests, dont règles, rendu MJ/joueurs, aller-retour export/import), web build + 844 vitest, lint sans erreur, migration V27 appliquée sur une base existante et fiche PNJ enregistrée puis signalée par la relecture dans le navigateur. À redéployer : core + web (migration V27). --- .../campaigncontext/NpcService.java | 25 +++- .../campaigncontext/SceneService.java | 2 + .../campaigncontext/WritingReviewService.java | 43 +++++- .../domain/campaigncontext/bestiary/Npc.java | 3 + .../campaigncontext/bestiary/NpcStory.java | 49 ++++++ .../domain/campaigncontext/structure/Arc.java | 2 + .../campaigncontext/structure/Scene.java | 2 + .../converter/NpcStoryJsonConverter.java | 43 ++++++ .../persistence/entity/ArcJpaEntity.java | 6 + .../persistence/entity/NpcJpaEntity.java | 5 + .../persistence/entity/SceneJpaEntity.java | 8 + .../postgres/PostgresArcRepository.java | 4 + .../postgres/PostgresNpcRepository.java | 2 + .../postgres/PostgresSceneRepository.java | 4 + .../transfer/CampaignContentInserter.java | 5 + .../transfer/ExportService.java | 6 +- .../transfer/dto/ContentExport.java | 14 +- .../transfer/pdf/PdfExportService.java | 31 +++- .../web/controller/NpcController.java | 3 +- .../web/dto/campaigncontext/ArcDTO.java | 2 + .../web/dto/campaigncontext/NpcDTO.java | 1 + .../web/dto/campaigncontext/SceneDTO.java | 2 + .../infrastructure/web/mapper/ArcMapper.java | 4 + .../infrastructure/web/mapper/NpcMapper.java | 2 + .../web/mapper/SceneMapper.java | 4 + .../db/migration/V27__story_fields.sql | 9 ++ .../WritingReviewServiceTest.java | 53 +++++++ .../bestiary/NpcStoryTest.java | 29 ++++ .../ContentExportImportRoundTripTest.java | 15 ++ .../pdf/PdfExportStoryFieldsTest.java | 78 ++++++++++ .../arc/arc-edit/arc-edit.component.html | 29 ++++ .../arc/arc-edit/arc-edit.component.ts | 14 +- .../arc/arc-view/arc-view.component.html | 12 ++ .../npc/npc-edit/npc-edit.component.html | 42 ++++++ .../npc/npc-edit/npc-edit.component.scss | 20 +++ .../npc/npc-edit/npc-edit.component.ts | 11 +- .../npc/npc-view/npc-view.component.html | 20 +++ .../npc/npc-view/npc-view.component.scss | 36 +++++ .../scene-edit/scene-edit.component.html | 26 ++++ .../scene/scene-edit/scene-edit.component.ts | 13 +- .../scene-view/scene-view.component.html | 12 ++ .../campaigns/writing-remark-action.helper.ts | 5 +- web/src/app/services/campaign.model.ts | 16 ++ web/src/app/services/npc.model.ts | 19 +++ .../writing-review-content.spec.ts | 18 ++- web/src/assets/i18n/en.json | 141 +++++++++++++++++- web/src/assets/i18n/fr.json | 141 +++++++++++++++++- web/src/assets/i18n/fragments/arcs.en.json | 12 +- web/src/assets/i18n/fragments/arcs.fr.json | 12 +- .../i18n/fragments/chars-npcs-enemies.en.json | 21 ++- .../i18n/fragments/chars-npcs-enemies.fr.json | 21 ++- web/src/assets/i18n/fragments/scenes.en.json | 10 +- web/src/assets/i18n/fragments/scenes.fr.json | 10 +- .../i18n/fragments/writing-coach.en.json | 88 +++++++++++ .../i18n/fragments/writing-coach.fr.json | 88 +++++++++++ .../i18n/fragments/writing-review.en.json | 10 ++ .../i18n/fragments/writing-review.fr.json | 10 ++ 57 files changed, 1262 insertions(+), 51 deletions(-) create mode 100644 core/src/main/java/com/loremind/domain/campaigncontext/bestiary/NpcStory.java create mode 100644 core/src/main/java/com/loremind/infrastructure/persistence/converter/NpcStoryJsonConverter.java create mode 100644 core/src/main/resources/db/migration/V27__story_fields.sql create mode 100644 core/src/test/java/com/loremind/domain/campaigncontext/bestiary/NpcStoryTest.java create mode 100644 core/src/test/java/com/loremind/infrastructure/transfer/pdf/PdfExportStoryFieldsTest.java diff --git a/core/src/main/java/com/loremind/application/campaigncontext/NpcService.java b/core/src/main/java/com/loremind/application/campaigncontext/NpcService.java index 5246049..93e07b3 100644 --- a/core/src/main/java/com/loremind/application/campaigncontext/NpcService.java +++ b/core/src/main/java/com/loremind/application/campaigncontext/NpcService.java @@ -1,6 +1,7 @@ package com.loremind.application.campaigncontext; import com.loremind.domain.campaigncontext.bestiary.Npc; +import com.loremind.domain.campaigncontext.bestiary.NpcStory; import com.loremind.domain.shared.ReorderSupport; import com.loremind.domain.campaigncontext.ports.NpcRepository; import org.springframework.stereotype.Service; @@ -29,8 +30,17 @@ public class NpcService { String campaignId, List relatedPageIds, String folder, - Integer order - ) {} + Integer order, + /** Rôle dans l'histoire ; null = inchangé (mise à jour) / non renseigné (création). */ + NpcStory story + ) { + public NpcData(String name, String portraitImageId, String headerImageId, Map values, + Map> imageValues, Map> keyValueValues, + String campaignId, List relatedPageIds, String folder, Integer order) { + this(name, portraitImageId, headerImageId, values, imageValues, keyValueValues, campaignId, + relatedPageIds, folder, order, null); + } + } public Npc createNpc(NpcData data) { int order = data.order() != null @@ -47,6 +57,7 @@ public class NpcService { .relatedPageIds(data.relatedPageIds() != null ? new ArrayList<>(data.relatedPageIds()) : new ArrayList<>()) .folder(normalizeFolder(data.folder())) .order(order) + .story(cleanStory(data.story())) .build(); return npcRepository.save(npc); } @@ -70,12 +81,22 @@ public class NpcService { existing.setKeyValueValues(data.keyValueValues() != null ? new HashMap<>(data.keyValueValues()) : new HashMap<>()); existing.setRelatedPageIds(data.relatedPageIds() != null ? new ArrayList<>(data.relatedPageIds()) : new ArrayList<>()); existing.setFolder(normalizeFolder(data.folder())); + if (data.story() != null) { + existing.setStory(cleanStory(data.story())); + } if (data.order() != null) { existing.setOrder(data.order()); } return npcRepository.save(existing); } + /** Fiche nettoyée, ou null si elle est vide (rien à stocker). */ + private static NpcStory cleanStory(NpcStory story) { + if (story == null) return null; + NpcStory clean = story.normalized(); + return clean.hasContent() ? clean : null; + } + public void deleteNpc(String id) { npcRepository.deleteById(id); } diff --git a/core/src/main/java/com/loremind/application/campaigncontext/SceneService.java b/core/src/main/java/com/loremind/application/campaigncontext/SceneService.java index b780f7d..7f87af4 100644 --- a/core/src/main/java/com/loremind/application/campaigncontext/SceneService.java +++ b/core/src/main/java/com/loremind/application/campaigncontext/SceneService.java @@ -125,6 +125,8 @@ public class SceneService { case "playerNarration" -> scene.setPlayerNarration(value); case "choicesConsequences" -> scene.setChoicesConsequences(value); case "combatDifficulty" -> scene.setCombatDifficulty(value); + case "tactics" -> scene.setTactics(value); + case "purpose" -> scene.setPurpose(value); case "enemies" -> scene.setEnemies(value); case "gmSecretNotes" -> scene.setGmSecretNotes(value); default -> { /* clé inconnue → ignorée (garde-fou anti-écrasement) */ } diff --git a/core/src/main/java/com/loremind/application/campaigncontext/WritingReviewService.java b/core/src/main/java/com/loremind/application/campaigncontext/WritingReviewService.java index d5f8ffa..2c81a8c 100644 --- a/core/src/main/java/com/loremind/application/campaigncontext/WritingReviewService.java +++ b/core/src/main/java/com/loremind/application/campaigncontext/WritingReviewService.java @@ -4,6 +4,9 @@ import com.loremind.domain.campaigncontext.Campaign; import com.loremind.domain.campaigncontext.ports.ArcRepository; import com.loremind.domain.campaigncontext.ports.CampaignRepository; import com.loremind.domain.campaigncontext.ports.ChapterRepository; +import com.loremind.domain.campaigncontext.bestiary.Npc; +import com.loremind.domain.campaigncontext.bestiary.NpcStory; +import com.loremind.domain.campaigncontext.ports.NpcRepository; import com.loremind.domain.campaigncontext.ports.QuestRepository; import com.loremind.domain.campaigncontext.ports.SceneRepository; import com.loremind.domain.campaigncontext.quest.Quest; @@ -91,17 +94,20 @@ public class WritingReviewService { private final ChapterRepository chapterRepository; private final SceneRepository sceneRepository; private final QuestRepository questRepository; + private final NpcRepository npcRepository; public WritingReviewService(CampaignRepository campaignRepository, ArcRepository arcRepository, ChapterRepository chapterRepository, SceneRepository sceneRepository, - QuestRepository questRepository) { + QuestRepository questRepository, + NpcRepository npcRepository) { this.campaignRepository = campaignRepository; this.arcRepository = arcRepository; this.chapterRepository = chapterRepository; this.sceneRepository = sceneRepository; this.questRepository = questRepository; + this.npcRepository = npcRepository; } /** Relit toute la campagne et renvoie les remarques dans l'ordre de l'arbre. */ @@ -122,6 +128,11 @@ public class WritingReviewService { chapters.sort(Comparator.comparingInt(Chapter::getOrder)); boolean visibleArc = arc.getType() != ArcType.SYSTEM; + // WRITE-017 — une seule accroche : les personnages n'ont qu'une raison de s'en mêler. + if (visibleArc && countLines(arc.getHooks()) == 1) { + treeRemarks.add(arcRemark(arc, "WRITE-017-SINGLE-HOOK", WritingRemarkCategory.AGENCY, Map.of())); + } + // WRITE-005 (arc) : seulement sur un arc qui a déjà du contenu. if (visibleArc && isBlank(arc.getStakes()) && (!chapters.isEmpty() || arcsWithQuests.contains(arc.getId()))) { @@ -164,6 +175,7 @@ public class WritingReviewService { List remarks = new ArrayList<>(campaignRemarks); remarks.addAll(treeRemarks); + remarks.addAll(reviewNpcs(campaignId)); return new WritingReviewReport(campaignId, remarks); } @@ -437,7 +449,8 @@ public class WritingReviewService { /** WRITE-008 — combat sans but : ni choix décrits, ni notes sur les motivations des ennemis. */ private void checkCombatPurpose(Arc arc, Chapter chapter, Scene scene, List out) { - if (isCombat(scene) && isBlank(scene.getChoicesConsequences()) && isBlank(scene.getGmSecretNotes())) { + if (isCombat(scene) && isBlank(scene.getChoicesConsequences()) && isBlank(scene.getGmSecretNotes()) + && isBlank(scene.getTactics())) { out.add(sceneRemark(arc, chapter, scene, "WRITE-008-COMBAT-NO-PURPOSE", WritingRemarkCategory.STAKES, Map.of())); } @@ -455,8 +468,34 @@ public class WritingReviewService { } } + // --- PNJ ---------------------------------------------------------------------------------- + + /** + * WRITE-016 — opposant ou allié sans motivation : un PNJ qui pèse sur l'intrigue doit + * vouloir quelque chose, sinon le MJ ne sait pas comment le faire réagir. Les figurants + * et les PNJ sans rôle précisé ne sont pas jugés (pas de bruit sur les seconds rôles). + */ + private List reviewNpcs(String campaignId) { + List out = new ArrayList<>(); + for (Npc npc : npcRepository.findByCampaignId(campaignId)) { + NpcStory story = npc.getStory(); + if (story != null && story.drivesThePlot() && story.normalized().motivation() == null) { + out.add(new WritingRemark(ReadinessEntityType.NPC, npc.getId(), labelOr(npc.getName(), "PNJ"), + "WRITE-016-NPC-NO-MOTIVATION", WritingRemarkCategory.STAKES, + Map.of("role", story.normalized().role()), null, null)); + } + } + return out; + } + // --- Helpers ---------------------------------------------------------------------------- + /** Nombre de lignes non vides (une accroche par ligne, puces « - » comprises). */ + private static int countLines(String text) { + if (isBlank(text)) return 0; + return (int) text.lines().filter(l -> !l.isBlank()).count(); + } + private static boolean isCombat(Scene scene) { return typeOf(scene) == SceneType.ENCOUNTER || !isBlank(scene.getCombatDifficulty()) diff --git a/core/src/main/java/com/loremind/domain/campaigncontext/bestiary/Npc.java b/core/src/main/java/com/loremind/domain/campaigncontext/bestiary/Npc.java index 2f18097..5f03d9d 100644 --- a/core/src/main/java/com/loremind/domain/campaigncontext/bestiary/Npc.java +++ b/core/src/main/java/com/loremind/domain/campaigncontext/bestiary/Npc.java @@ -60,6 +60,9 @@ public class Npc { /** Ordre d'affichage dans la liste des PNJ de la campagne. */ private int order; + /** Rôle dans l'histoire (rôle, motivation, ce qu'il sait, signe distinctif). Null = non renseigné. */ + private NpcStory story; + private LocalDateTime createdAt; private LocalDateTime updatedAt; diff --git a/core/src/main/java/com/loremind/domain/campaigncontext/bestiary/NpcStory.java b/core/src/main/java/com/loremind/domain/campaigncontext/bestiary/NpcStory.java new file mode 100644 index 0000000..a82db89 --- /dev/null +++ b/core/src/main/java/com/loremind/domain/campaigncontext/bestiary/NpcStory.java @@ -0,0 +1,49 @@ +package com.loremind.domain.campaigncontext.bestiary; + +import java.util.Locale; +import java.util.Set; + +/** + * Fiche « rôle dans l'histoire » d'un PNJ, indépendante du système de jeu (le gabarit du + * système porte les caractéristiques) : ce qui rend le PNJ jouable et utile au récit. + * + * @param role place dans l'histoire : {@code OPPONENT} (s'oppose aux PJ), {@code ALLY} + * (les aide), {@code RESOURCE} (détient une information ou un service), + * {@code EXTRA} (figurant) ; null = non précisé + * @param motivation ce qu'il veut, et ce qu'il est prêt à faire pour l'obtenir + * @param knowledge ce qu'il sait (et peut révéler) — réservé au MJ + * @param mannerism signe distinctif à jouer (geste, phrasé, tic) + */ +public record NpcStory(String role, String motivation, String knowledge, String mannerism) { + + public static final Set ROLES = Set.of("OPPONENT", "ALLY", "RESOURCE", "EXTRA"); + private static final int SHORT_MAX = 300; + private static final int LONG_MAX = 10_000; + + /** Copie nettoyée : rôle inconnu → null, textes rognés (blancs → null) et bornés. */ + public NpcStory normalized() { + String r = role == null ? null : role.trim().toUpperCase(Locale.ROOT); + // Set.of(...).contains(null) lève une NullPointerException : rôle absent testé à part. + return new NpcStory(r != null && ROLES.contains(r) ? r : null, + clean(motivation, LONG_MAX), clean(knowledge, LONG_MAX), clean(mannerism, SHORT_MAX)); + } + + /** Vrai si au moins un élément est renseigné. */ + public boolean hasContent() { + NpcStory n = normalized(); + return n.role() != null || n.motivation() != null || n.knowledge() != null || n.mannerism() != null; + } + + /** Un PNJ qui pèse sur l'intrigue (opposant ou allié) : sa motivation est attendue. */ + public boolean drivesThePlot() { + String r = normalized().role(); + return "OPPONENT".equals(r) || "ALLY".equals(r); + } + + private static String clean(String s, int max) { + if (s == null) return null; + String t = s.trim(); + if (t.isEmpty()) return null; + return t.length() > max ? t.substring(0, max) : t; + } +} diff --git a/core/src/main/java/com/loremind/domain/campaigncontext/structure/Arc.java b/core/src/main/java/com/loremind/domain/campaigncontext/structure/Arc.java index 9f88bba..b7f2c92 100644 --- a/core/src/main/java/com/loremind/domain/campaigncontext/structure/Arc.java +++ b/core/src/main/java/com/loremind/domain/campaigncontext/structure/Arc.java @@ -38,6 +38,8 @@ public class Arc { private String gmNotes; // Notes privées du MJ (non exportées vers FoundryVTT) private String rewards; // Récompenses et progression private String resolution; // Dénouement prévu + private String hiddenTruth; // Histoire cachée : ce qui s'est vraiment passé (réservé au MJ) + private String hooks; // Accroches : pourquoi les personnages s'en mêlent (une par ligne) /** * IDs des pages du Lore associées à cet arc (weak cross-context references). diff --git a/core/src/main/java/com/loremind/domain/campaigncontext/structure/Scene.java b/core/src/main/java/com/loremind/domain/campaigncontext/structure/Scene.java index 487779e..8228bd3 100644 --- a/core/src/main/java/com/loremind/domain/campaigncontext/structure/Scene.java +++ b/core/src/main/java/com/loremind/domain/campaigncontext/structure/Scene.java @@ -48,6 +48,8 @@ public class Scene { // === Combat ou rencontre === private String combatDifficulty; // Difficulté estimée + private String tactics; // Tactique et moral des adversaires (quand fuient-ils, se rendent-ils ?) + private String purpose; // Utilité : ce que l'histoire perd si on coupe la scène private String enemies; // Liste des ennemis et créatures (texte libre) /** diff --git a/core/src/main/java/com/loremind/infrastructure/persistence/converter/NpcStoryJsonConverter.java b/core/src/main/java/com/loremind/infrastructure/persistence/converter/NpcStoryJsonConverter.java new file mode 100644 index 0000000..f7d97f5 --- /dev/null +++ b/core/src/main/java/com/loremind/infrastructure/persistence/converter/NpcStoryJsonConverter.java @@ -0,0 +1,43 @@ +package com.loremind.infrastructure.persistence.converter; + +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.loremind.domain.campaigncontext.bestiary.NpcStory; +import jakarta.persistence.AttributeConverter; +import jakarta.persistence.Converter; + +/** + * Convertit la fiche {@link NpcStory} (rôle dans l'histoire d'un PNJ) en JSON stocké dans une colonne TEXT, + * et inversement. Fiche vide → NULL en base. Champs inconnus ignorés (fiche écrite par + * une version plus récente). + */ +@Converter +public class NpcStoryJsonConverter implements AttributeConverter { + + private static final ObjectMapper MAPPER = new ObjectMapper() + .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + + @Override + public String convertToDatabaseColumn(NpcStory attribute) { + if (attribute == null || !attribute.hasContent()) { + return null; + } + try { + return MAPPER.writeValueAsString(attribute); + } catch (Exception e) { + throw new IllegalStateException("Erreur sérialisation NpcStory → JSON", e); + } + } + + @Override + public NpcStory convertToEntityAttribute(String dbData) { + if (dbData == null || dbData.isBlank()) { + return null; + } + try { + return MAPPER.readValue(dbData, NpcStory.class); + } catch (Exception e) { + throw new IllegalStateException("Erreur désérialisation JSON → NpcStory", e); + } + } +} diff --git a/core/src/main/java/com/loremind/infrastructure/persistence/entity/ArcJpaEntity.java b/core/src/main/java/com/loremind/infrastructure/persistence/entity/ArcJpaEntity.java index 4fe61ce..a099cd8 100644 --- a/core/src/main/java/com/loremind/infrastructure/persistence/entity/ArcJpaEntity.java +++ b/core/src/main/java/com/loremind/infrastructure/persistence/entity/ArcJpaEntity.java @@ -72,6 +72,12 @@ public class ArcJpaEntity { @Column(columnDefinition = "TEXT") private String resolution; + @Column(name = "hidden_truth", columnDefinition = "TEXT") + private String hiddenTruth; + + @Column(name = "hooks", columnDefinition = "TEXT") + private String hooks; + /** * IDs des pages du Lore liées à cet arc, stockés en JSON dans une colonne TEXT. * Pas de FK cross-context : respect des Bounded Contexts. diff --git a/core/src/main/java/com/loremind/infrastructure/persistence/entity/NpcJpaEntity.java b/core/src/main/java/com/loremind/infrastructure/persistence/entity/NpcJpaEntity.java index 6a7a688..ffd710e 100644 --- a/core/src/main/java/com/loremind/infrastructure/persistence/entity/NpcJpaEntity.java +++ b/core/src/main/java/com/loremind/infrastructure/persistence/entity/NpcJpaEntity.java @@ -67,6 +67,11 @@ public class NpcJpaEntity { @Column(name = "\"order\"", nullable = false) private int order; + /** Fiche « rôle dans l'histoire » (JSON). NULL = non renseignée. */ + @Column(name = "story", columnDefinition = "TEXT") + @Convert(converter = com.loremind.infrastructure.persistence.converter.NpcStoryJsonConverter.class) + private com.loremind.domain.campaigncontext.bestiary.NpcStory story; + @Column(name = "created_at", nullable = false, updatable = false) private LocalDateTime createdAt; diff --git a/core/src/main/java/com/loremind/infrastructure/persistence/entity/SceneJpaEntity.java b/core/src/main/java/com/loremind/infrastructure/persistence/entity/SceneJpaEntity.java index eebc556..87060d6 100644 --- a/core/src/main/java/com/loremind/infrastructure/persistence/entity/SceneJpaEntity.java +++ b/core/src/main/java/com/loremind/infrastructure/persistence/entity/SceneJpaEntity.java @@ -78,6 +78,14 @@ public class SceneJpaEntity { @Column(name = "choices_consequences", columnDefinition = "TEXT") private String choicesConsequences; + // Tactique et moral des adversaires + @Column(name = "tactics", columnDefinition = "TEXT") + private String tactics; + + // Utilité de la scène dans l'histoire + @Column(name = "purpose", columnDefinition = "TEXT") + private String purpose; + // Combat @Column(name = "combat_difficulty", columnDefinition = "TEXT") private String combatDifficulty; diff --git a/core/src/main/java/com/loremind/infrastructure/persistence/postgres/PostgresArcRepository.java b/core/src/main/java/com/loremind/infrastructure/persistence/postgres/PostgresArcRepository.java index 66a1a75..546af32 100644 --- a/core/src/main/java/com/loremind/infrastructure/persistence/postgres/PostgresArcRepository.java +++ b/core/src/main/java/com/loremind/infrastructure/persistence/postgres/PostgresArcRepository.java @@ -77,6 +77,8 @@ public class PostgresArcRepository implements ArcRepository { .gmNotes(jpaEntity.getGmNotes()) .rewards(jpaEntity.getRewards()) .resolution(jpaEntity.getResolution()) + .hiddenTruth(jpaEntity.getHiddenTruth()) + .hooks(jpaEntity.getHooks()) // Defensive copy : jamais de null en domaine pour simplifier les appelants. .relatedPageIds(jpaEntity.getRelatedPageIds() != null ? new ArrayList<>(jpaEntity.getRelatedPageIds()) @@ -104,6 +106,8 @@ public class PostgresArcRepository implements ArcRepository { .gmNotes(arc.getGmNotes()) .rewards(arc.getRewards()) .resolution(arc.getResolution()) + .hiddenTruth(arc.getHiddenTruth()) + .hooks(arc.getHooks()) .relatedPageIds(arc.getRelatedPageIds() != null ? new ArrayList<>(arc.getRelatedPageIds()) : new ArrayList<>()) diff --git a/core/src/main/java/com/loremind/infrastructure/persistence/postgres/PostgresNpcRepository.java b/core/src/main/java/com/loremind/infrastructure/persistence/postgres/PostgresNpcRepository.java index 8999704..55953b5 100644 --- a/core/src/main/java/com/loremind/infrastructure/persistence/postgres/PostgresNpcRepository.java +++ b/core/src/main/java/com/loremind/infrastructure/persistence/postgres/PostgresNpcRepository.java @@ -68,6 +68,7 @@ public class PostgresNpcRepository implements NpcRepository { .campaignId(e.getCampaignId().toString()) .relatedPageIds(e.getRelatedPageIds() != null ? new ArrayList<>(e.getRelatedPageIds()) : new ArrayList<>()) .folder(e.getFolder()) + .story(e.getStory()) .order(e.getOrder()) .createdAt(e.getCreatedAt()) .updatedAt(e.getUpdatedAt()) @@ -87,6 +88,7 @@ public class PostgresNpcRepository implements NpcRepository { .campaignId(Long.parseLong(n.getCampaignId())) .relatedPageIds(n.getRelatedPageIds() != null ? new ArrayList<>(n.getRelatedPageIds()) : new ArrayList<>()) .folder(n.getFolder()) + .story(n.getStory()) .order(n.getOrder()) .createdAt(n.getCreatedAt()) .updatedAt(n.getUpdatedAt()) diff --git a/core/src/main/java/com/loremind/infrastructure/persistence/postgres/PostgresSceneRepository.java b/core/src/main/java/com/loremind/infrastructure/persistence/postgres/PostgresSceneRepository.java index 9addfee..d942451 100644 --- a/core/src/main/java/com/loremind/infrastructure/persistence/postgres/PostgresSceneRepository.java +++ b/core/src/main/java/com/loremind/infrastructure/persistence/postgres/PostgresSceneRepository.java @@ -80,6 +80,8 @@ public class PostgresSceneRepository implements SceneRepository { .gmSecretNotes(jpaEntity.getGmSecretNotes()) .choicesConsequences(jpaEntity.getChoicesConsequences()) .combatDifficulty(jpaEntity.getCombatDifficulty()) + .tactics(jpaEntity.getTactics()) + .purpose(jpaEntity.getPurpose()) .enemies(jpaEntity.getEnemies()) .enemyIds(jpaEntity.getEnemyIds() != null ? new ArrayList<>(jpaEntity.getEnemyIds()) @@ -123,6 +125,8 @@ public class PostgresSceneRepository implements SceneRepository { .gmSecretNotes(scene.getGmSecretNotes()) .choicesConsequences(scene.getChoicesConsequences()) .combatDifficulty(scene.getCombatDifficulty()) + .tactics(scene.getTactics()) + .purpose(scene.getPurpose()) .enemies(scene.getEnemies()) .enemyIds(scene.getEnemyIds() != null ? new ArrayList<>(scene.getEnemyIds()) diff --git a/core/src/main/java/com/loremind/infrastructure/transfer/CampaignContentInserter.java b/core/src/main/java/com/loremind/infrastructure/transfer/CampaignContentInserter.java index b966e39..e17620a 100644 --- a/core/src/main/java/com/loremind/infrastructure/transfer/CampaignContentInserter.java +++ b/core/src/main/java/com/loremind/infrastructure/transfer/CampaignContentInserter.java @@ -129,6 +129,8 @@ class CampaignContentInserter { e.setGmNotes(d.gmNotes()); e.setRewards(d.rewards()); e.setResolution(d.resolution()); + e.setHiddenTruth(d.hiddenTruth()); + e.setHooks(d.hooks()); e.setRelatedPageIds(d.relatedPageIds()); // remappe en 2e passe e.setIllustrationImageIds(IdRemapper.remapStringList(maps.imageMap, d.illustrationImageIds())); maps.arcMap.put(d.id(), arcRepo.save(e).getId()); @@ -267,6 +269,7 @@ class CampaignContentInserter { e.setRelatedPageIds(d.relatedPageIds()); // remappe en 2e passe e.setFolder(d.folder()); e.setOrder(d.order()); + e.setStory(d.story()); maps.npcMap.put(d.id(), npcRepo.save(e).getId()); } result.count("npcs", maps.npcMap.size()); @@ -317,6 +320,8 @@ class CampaignContentInserter { e.setBattlemaps(resolveBattlemaps(d, maps)); e.setGraphX(d.graphX()); e.setGraphY(d.graphY()); + e.setTactics(d.tactics()); + e.setPurpose(d.purpose()); e.setBranches(d.branches()); // remappe en 2e passe // Rooms : l'id (UUID) et les branches restent tels quels ; seules leurs refs // d'images (galerie + plan) sont remappees vers les images importees. diff --git a/core/src/main/java/com/loremind/infrastructure/transfer/ExportService.java b/core/src/main/java/com/loremind/infrastructure/transfer/ExportService.java index 109c869..574019e 100644 --- a/core/src/main/java/com/loremind/infrastructure/transfer/ExportService.java +++ b/core/src/main/java/com/loremind/infrastructure/transfer/ExportService.java @@ -614,7 +614,7 @@ public class ExportService { e.getType() != null ? e.getType().name() : null, e.getIcon(), e.getThemes(), e.getStakes(), e.getGmNotes(), e.getRewards(), e.getResolution(), e.getRelatedPageIds(), - e.getIllustrationImageIds()); + e.getIllustrationImageIds(), e.getHiddenTruth(), e.getHooks()); } private ContentExport.ChapterDto toChapterDto(ChapterJpaEntity e) { @@ -643,7 +643,7 @@ public class ExportService { e.getEnemies(), e.getEnemyIds(), e.getRelatedPageIds(), e.getIllustrationImageIds(), null, null, // legacy battlemap : plus émis e.getBattlemaps(), e.getBranches(), e.getRooms(), e.getType(), - e.getGraphX(), e.getGraphY()); + e.getGraphX(), e.getGraphY(), e.getTactics(), e.getPurpose()); } private ContentExport.CharacterDto toCharacterDto(CharacterJpaEntity e) { @@ -655,7 +655,7 @@ public class ExportService { private ContentExport.NpcDto toNpcDto(NpcJpaEntity e) { return new ContentExport.NpcDto(e.getId(), e.getName(), e.getPortraitImageId(), e.getHeaderImageId(), e.getValues(), e.getImageValues(), e.getKeyValueValues(), - e.getCampaignId(), e.getRelatedPageIds(), e.getFolder(), e.getOrder()); + e.getCampaignId(), e.getRelatedPageIds(), e.getFolder(), e.getOrder(), e.getStory()); } private ContentExport.EnemyDto toEnemyDto(EnemyJpaEntity e) { diff --git a/core/src/main/java/com/loremind/infrastructure/transfer/dto/ContentExport.java b/core/src/main/java/com/loremind/infrastructure/transfer/dto/ContentExport.java index a6b6311..860c75b 100644 --- a/core/src/main/java/com/loremind/infrastructure/transfer/dto/ContentExport.java +++ b/core/src/main/java/com/loremind/infrastructure/transfer/dto/ContentExport.java @@ -147,7 +147,10 @@ public record ContentExport( String rewards, String resolution, List relatedPageIds, - List illustrationImageIds + List illustrationImageIds, + /** Histoire cachée et accroches ; absentes des bundles antérieurs (null). */ + String hiddenTruth, + String hooks ) {} public record ChapterDto( @@ -197,7 +200,10 @@ public record ContentExport( List rooms, SceneType type, Double graphX, - Double graphY + Double graphY, + /** Tactique des adversaires et utilité ; absentes des bundles antérieurs (null). */ + String tactics, + String purpose ) {} public record CharacterDto( @@ -224,7 +230,9 @@ public record ContentExport( Long campaignId, List relatedPageIds, String folder, - int order + int order, + /** Rôle dans l'histoire ; absent des bundles antérieurs (null). */ + com.loremind.domain.campaigncontext.bestiary.NpcStory story ) {} public record EnemyDto( diff --git a/core/src/main/java/com/loremind/infrastructure/transfer/pdf/PdfExportService.java b/core/src/main/java/com/loremind/infrastructure/transfer/pdf/PdfExportService.java index 8fa2844..92a4a74 100644 --- a/core/src/main/java/com/loremind/infrastructure/transfer/pdf/PdfExportService.java +++ b/core/src/main/java/com/loremind/infrastructure/transfer/pdf/PdfExportService.java @@ -1,6 +1,7 @@ package com.loremind.infrastructure.transfer.pdf; import com.loremind.domain.campaigncontext.CampaignPublication; +import com.loremind.domain.campaigncontext.bestiary.NpcStory; import com.loremind.domain.campaigncontext.quest.NodeType; import com.loremind.domain.campaigncontext.quest.Prerequisite; import com.loremind.domain.campaigncontext.quest.QuestNodeRef; @@ -538,6 +539,8 @@ public class PdfExportService { private void arcFields(Ctx ctx, ArcJpaEntity arc) { illustrations(ctx, arc.getIllustrationImageIds()); ctx.gmBlock(LABEL_DESCRIPTION, arc.getDescription()); + ctx.gmBox(CSS_SECRET, "Histoire cachée", arc.getHiddenTruth()); + ctx.gmBlock("Accroches", arc.getHooks()); ctx.gmBlock(LABEL_THEMES, arc.getThemes()); ctx.gmBlock(LABEL_ENJEUX, arc.getStakes()); ctx.gmBlock(LABEL_RECOMPENSES, arc.getRewards()); @@ -628,6 +631,7 @@ public class PdfExportService { .append(esc(sc.getName())).append(DIV_CLOSE); sceneMeta(b, sc); ctx.gmBlock("Résumé", sc.getDescription()); + ctx.gmBlock("Utilité", sc.getPurpose()); block(b, "Ambiance", sc.getAtmosphere(), "ambiance"); box(b, "readaloud", "À lire aux joueurs", sc.getPlayerNarration()); ctx.gmBox(CSS_SECRET, "Notes secrètes MJ", sc.getGmSecretNotes()); @@ -635,7 +639,7 @@ public class PdfExportService { if (ctx.gm) blockHtml(b, "Sorties", sceneBranchItems(sc.getBranches(), st)); // Combat : difficulte + ennemis de la rencontre (fiches du bestiaire en renvoi // « p. N » + texte libre) dans le meme encadre rouge. - combatBox(ctx, "Combat", sc.getCombatDifficulty(), sc.getEnemyIds(), sc.getEnemies(), st); + combatBox(ctx, "Combat", sc.getCombatDifficulty(), sc.getEnemyIds(), sc.getEnemies(), sc.getTactics(), st); illustrations(ctx, sc.getIllustrationImageIds()); if (ctx.maps != null) { mapLinks(ctx, sc); @@ -706,7 +710,7 @@ public class PdfExportService { if (r.getFloor() != null) b.append(" · Étage ").append(r.getFloor()); b.append(SPAN_CLOSE).append(esc(r.getName())).append(DIV_CLOSE); ctx.gmBlock(LABEL_DESCRIPTION, r.getDescription()); - combatBox(ctx, "Ennemis", null, r.getEnemyIds(), r.getEnemies(), st); + combatBox(ctx, "Ennemis", null, r.getEnemyIds(), r.getEnemies(), null, st); ctx.gmBlock("Butin", r.getLoot()); ctx.gmBlock("Pièges", r.getTraps()); ctx.gmBox(CSS_SECRET, LABEL_NOTES_MJ, r.getGmNotes()); @@ -776,7 +780,7 @@ public class PdfExportService { * leur fiche (« Bandit (p. 24) »), puis texte libre. Rien si tout est vide. */ private static void combatBox(Ctx ctx, String label, String difficulty, List enemyIds, - String freeText, Structure st) { + String freeText, String tactics, Structure st) { if (!ctx.gm) return; List enemies = new ArrayList<>(); if (enemyIds != null) { @@ -785,7 +789,7 @@ public class PdfExportService { if (name != null) enemies.add(xref("enemy-" + id, name) + " " + pageRef("enemy-" + id)); } } - if (!notBlank(difficulty) && enemies.isEmpty() && !notBlank(freeText)) return; + if (!notBlank(difficulty) && enemies.isEmpty() && !notBlank(freeText) && !notBlank(tactics)) return; StringBuilder b = ctx.body; b.append("
").append(esc(label)).append(DIV_CLOSE); prose(b, difficulty); @@ -795,6 +799,7 @@ public class PdfExportService { b.append(""); } prose(b, freeText); + block(b, "Tactique et moral", tactics); b.append(DIV_CLOSE); } @@ -907,13 +912,14 @@ public class PdfExportService { /** Une fiche persona generique pour la mise en page (PNJ ou ennemi). */ record PersonaRow(Long id, int order, String name, String folder, String level, String portraitId, Map values, Map> keyValueValues, - Map> imageValues, Map foundryStats) {} + Map> imageValues, Map foundryStats, + NpcStory story) {} private List npcEntries(CampaignJpaEntity c) { List out = new ArrayList<>(); for (NpcJpaEntity n : npcRepo.findByCampaignIdOrderByOrderAsc(c.getId())) { out.add(new PersonaRow(n.getId(), n.getOrder(), n.getName(), n.getFolder(), null, n.getPortraitImageId(), - n.getValues(), n.getKeyValueValues(), n.getImageValues(), null)); + n.getValues(), n.getKeyValueValues(), n.getImageValues(), null, n.getStory())); } return out; } @@ -922,7 +928,7 @@ public class PdfExportService { List out = new ArrayList<>(); for (EnemyJpaEntity e : enemyRepo.findByCampaignIdOrderByOrderAsc(c.getId())) { out.add(new PersonaRow(e.getId(), e.getOrder(), e.getName(), e.getFolder(), e.getLevel(), e.getPortraitImageId(), - e.getValues(), e.getKeyValueValues(), e.getImageValues(), e.getFoundryStats())); + e.getValues(), e.getKeyValueValues(), e.getImageValues(), e.getFoundryStats(), null)); } return out; } @@ -1003,7 +1009,14 @@ public class PdfExportService { b.append(""); b.append("
").append(esc(r.name())); if (notBlank(r.level())) b.append(" Niv. ").append(esc(r.level())).append(SPAN_CLOSE); + String role = r.story() != null ? ROLE_LABELS.get(r.story().role()) : null; + if (ctx.gm && role != null) b.append(" ").append(role).append(SPAN_CLOSE); b.append(DIV_CLOSE); + if (r.story() != null) { + block(b, "Signe distinctif", r.story().mannerism()); + ctx.gmBlock("Motivation", r.story().motivation()); + ctx.gmBlock("Ce qu'il sait", r.story().knowledge()); + } renderFields(ctx, template, r.values(), r.keyValueValues(), r.imageValues(), null); @@ -1023,6 +1036,10 @@ public class PdfExportService { b.append("
"); } + /** Libelles des roles d'un PNJ dans l'histoire (fiche « role dans l'histoire »). */ + private static final Map ROLE_LABELS = Map.of( + "OPPONENT", "Opposant", "ALLY", "Allié", "RESOURCE", "Ressource", "EXTRA", "Figurant"); + /** Valeurs de stats considerees comme "vides"/bruit (masquees dans le livret). */ private static final Set STAT_NOISE_VALUES = Set.of("0", "0.0", "false", "none", "null", "", "-", "—"); /** Premier segment de chemin a elaguer du libelle (purement structurel). */ diff --git a/core/src/main/java/com/loremind/infrastructure/web/controller/NpcController.java b/core/src/main/java/com/loremind/infrastructure/web/controller/NpcController.java index e7077fb..0204e45 100644 --- a/core/src/main/java/com/loremind/infrastructure/web/controller/NpcController.java +++ b/core/src/main/java/com/loremind/infrastructure/web/controller/NpcController.java @@ -83,7 +83,8 @@ public class NpcController { dto.getCampaignId(), dto.getRelatedPageIds(), dto.getFolder(), - order + order, + dto.getStory() ); } } diff --git a/core/src/main/java/com/loremind/infrastructure/web/dto/campaigncontext/ArcDTO.java b/core/src/main/java/com/loremind/infrastructure/web/dto/campaigncontext/ArcDTO.java index 5f00be4..22b1c28 100644 --- a/core/src/main/java/com/loremind/infrastructure/web/dto/campaigncontext/ArcDTO.java +++ b/core/src/main/java/com/loremind/infrastructure/web/dto/campaigncontext/ArcDTO.java @@ -29,6 +29,8 @@ public class ArcDTO { private String gmNotes; private String rewards; private String resolution; + private String hiddenTruth; + private String hooks; /** IDs des pages du Lore liées à cet arc (weak cross-context references). */ private List relatedPageIds = new ArrayList<>(); diff --git a/core/src/main/java/com/loremind/infrastructure/web/dto/campaigncontext/NpcDTO.java b/core/src/main/java/com/loremind/infrastructure/web/dto/campaigncontext/NpcDTO.java index 439a99a..51ffae3 100644 --- a/core/src/main/java/com/loremind/infrastructure/web/dto/campaigncontext/NpcDTO.java +++ b/core/src/main/java/com/loremind/infrastructure/web/dto/campaigncontext/NpcDTO.java @@ -24,5 +24,6 @@ public class NpcDTO { /** IDs de Pages de Lore référencées par ce PNJ (référence faible cross-context). */ private List relatedPageIds = new ArrayList<>(); private String folder; + private com.loremind.domain.campaigncontext.bestiary.NpcStory story; private int order; } diff --git a/core/src/main/java/com/loremind/infrastructure/web/dto/campaigncontext/SceneDTO.java b/core/src/main/java/com/loremind/infrastructure/web/dto/campaigncontext/SceneDTO.java index 7b59f55..b611d3f 100644 --- a/core/src/main/java/com/loremind/infrastructure/web/dto/campaigncontext/SceneDTO.java +++ b/core/src/main/java/com/loremind/infrastructure/web/dto/campaigncontext/SceneDTO.java @@ -31,6 +31,8 @@ public class SceneDTO { private String gmSecretNotes; private String choicesConsequences; private String combatDifficulty; + private String tactics; + private String purpose; private String enemies; /** IDs des fiches du bestiaire engagées dans la rencontre (weak refs). */ diff --git a/core/src/main/java/com/loremind/infrastructure/web/mapper/ArcMapper.java b/core/src/main/java/com/loremind/infrastructure/web/mapper/ArcMapper.java index 9748fed..52c2d99 100644 --- a/core/src/main/java/com/loremind/infrastructure/web/mapper/ArcMapper.java +++ b/core/src/main/java/com/loremind/infrastructure/web/mapper/ArcMapper.java @@ -32,6 +32,8 @@ public class ArcMapper { dto.setGmNotes(arc.getGmNotes()); dto.setRewards(arc.getRewards()); dto.setResolution(arc.getResolution()); + dto.setHiddenTruth(arc.getHiddenTruth()); + dto.setHooks(arc.getHooks()); dto.setRelatedPageIds(copyList(arc.getRelatedPageIds())); dto.setIllustrationImageIds(copyList(arc.getIllustrationImageIds())); return dto; @@ -55,6 +57,8 @@ public class ArcMapper { .gmNotes(dto.getGmNotes()) .rewards(dto.getRewards()) .resolution(dto.getResolution()) + .hiddenTruth(dto.getHiddenTruth()) + .hooks(dto.getHooks()) .relatedPageIds(copyList(dto.getRelatedPageIds())) .illustrationImageIds(copyList(dto.getIllustrationImageIds())) .build(); diff --git a/core/src/main/java/com/loremind/infrastructure/web/mapper/NpcMapper.java b/core/src/main/java/com/loremind/infrastructure/web/mapper/NpcMapper.java index f93f561..833f96d 100644 --- a/core/src/main/java/com/loremind/infrastructure/web/mapper/NpcMapper.java +++ b/core/src/main/java/com/loremind/infrastructure/web/mapper/NpcMapper.java @@ -23,6 +23,7 @@ public class NpcMapper { dto.setCampaignId(n.getCampaignId()); dto.setRelatedPageIds(n.getRelatedPageIds() != null ? new ArrayList<>(n.getRelatedPageIds()) : new ArrayList<>()); dto.setFolder(n.getFolder()); + dto.setStory(n.getStory()); dto.setOrder(n.getOrder()); return dto; } @@ -40,6 +41,7 @@ public class NpcMapper { .campaignId(dto.getCampaignId()) .relatedPageIds(dto.getRelatedPageIds() != null ? new ArrayList<>(dto.getRelatedPageIds()) : new ArrayList<>()) .folder(dto.getFolder()) + .story(dto.getStory()) .order(dto.getOrder()) .build(); } diff --git a/core/src/main/java/com/loremind/infrastructure/web/mapper/SceneMapper.java b/core/src/main/java/com/loremind/infrastructure/web/mapper/SceneMapper.java index c688585..6fefb1f 100644 --- a/core/src/main/java/com/loremind/infrastructure/web/mapper/SceneMapper.java +++ b/core/src/main/java/com/loremind/infrastructure/web/mapper/SceneMapper.java @@ -43,6 +43,8 @@ public class SceneMapper { dto.setGmSecretNotes(scene.getGmSecretNotes()); dto.setChoicesConsequences(scene.getChoicesConsequences()); dto.setCombatDifficulty(scene.getCombatDifficulty()); + dto.setTactics(scene.getTactics()); + dto.setPurpose(scene.getPurpose()); dto.setEnemies(scene.getEnemies()); dto.setEnemyIds(scene.getEnemyIds() != null ? new ArrayList<>(scene.getEnemyIds()) @@ -81,6 +83,8 @@ public class SceneMapper { .gmSecretNotes(dto.getGmSecretNotes()) .choicesConsequences(dto.getChoicesConsequences()) .combatDifficulty(dto.getCombatDifficulty()) + .tactics(dto.getTactics()) + .purpose(dto.getPurpose()) .enemies(dto.getEnemies()) .enemyIds(dto.getEnemyIds() != null ? new ArrayList<>(dto.getEnemyIds()) diff --git a/core/src/main/resources/db/migration/V27__story_fields.sql b/core/src/main/resources/db/migration/V27__story_fields.sql new file mode 100644 index 0000000..ff1a05e --- /dev/null +++ b/core/src/main/resources/db/migration/V27__story_fields.sql @@ -0,0 +1,9 @@ +-- Champs d'écriture (mentor) : +-- scène : tactique et moral des adversaires, utilité (ce qu'on perd si on la coupe) ; +-- arc : histoire cachée, accroches ; +-- PNJ : fiche « rôle dans l'histoire » (rôle, motivation, ce qu'il sait, signe distinctif) en JSON. +ALTER TABLE scenes ADD COLUMN tactics TEXT; +ALTER TABLE scenes ADD COLUMN purpose TEXT; +ALTER TABLE arcs ADD COLUMN hidden_truth TEXT; +ALTER TABLE arcs ADD COLUMN hooks TEXT; +ALTER TABLE npcs ADD COLUMN story TEXT; diff --git a/core/src/test/java/com/loremind/application/campaigncontext/WritingReviewServiceTest.java b/core/src/test/java/com/loremind/application/campaigncontext/WritingReviewServiceTest.java index ae7d7f2..ffb3359 100644 --- a/core/src/test/java/com/loremind/application/campaigncontext/WritingReviewServiceTest.java +++ b/core/src/test/java/com/loremind/application/campaigncontext/WritingReviewServiceTest.java @@ -4,6 +4,9 @@ import com.loremind.domain.campaigncontext.Campaign; import com.loremind.domain.campaigncontext.ports.ArcRepository; import com.loremind.domain.campaigncontext.ports.CampaignRepository; import com.loremind.domain.campaigncontext.ports.ChapterRepository; +import com.loremind.domain.campaigncontext.bestiary.Npc; +import com.loremind.domain.campaigncontext.bestiary.NpcStory; +import com.loremind.domain.campaigncontext.ports.NpcRepository; import com.loremind.domain.campaigncontext.ports.QuestRepository; import com.loremind.domain.campaigncontext.ports.SceneRepository; import com.loremind.domain.campaigncontext.quest.Quest; @@ -47,6 +50,7 @@ class WritingReviewServiceTest { @Mock private ChapterRepository chapterRepository; @Mock private SceneRepository sceneRepository; @Mock private QuestRepository questRepository; + @Mock private NpcRepository npcRepository; @InjectMocks private WritingReviewService service; @@ -459,4 +463,53 @@ class WritingReviewServiceTest { assertEquals("3", r.params().get("count")); assertFalse(ruleIds().contains("WRITE-003-SINGLE-CLUE")); } + + // --- WRITE-008 : la tactique des adversaires donne un but au combat --- + + @Test + void combatPurpose_notRaised_whenTacticsAreWritten() { + tree(List.of(scene("fight", 0).type(SceneType.ENCOUNTER).choicesConsequences(null) + .tactics("Ils fuient dès que leur chef tombe").build())); + assertFalse(ruleIds().contains("WRITE-008-COMBAT-NO-PURPOSE")); + } + + // --- WRITE-016 : opposant ou allié sans motivation --- + + @Test + void npcWithoutMotivation_onlyForPlotDrivingRoles() { + when(npcRepository.findByCampaignId(CAMP)).thenReturn(List.of( + Npc.builder().id("n1").name("Ysolde").story(new NpcStory("OPPONENT", " ", null, null)).build(), + Npc.builder().id("n2").name("Borin").story(new NpcStory("ALLY", "Protéger sa fille", null, null)).build(), + Npc.builder().id("n3").name("Le passant").story(new NpcStory("EXTRA", null, null, null)).build(), + Npc.builder().id("n4").name("Sans fiche").build())); + + List remarks = service.review(CAMP).remarks().stream() + .filter(r -> r.ruleId().equals("WRITE-016-NPC-NO-MOTIVATION")).toList(); + assertEquals(1, remarks.size()); + assertEquals("n1", remarks.get(0).entityId()); + assertEquals(ReadinessEntityType.NPC, remarks.get(0).entityType()); + assertEquals("OPPONENT", remarks.get(0).params().get("role")); + } + + // --- WRITE-017 : une seule accroche --- + + @Test + void singleHook_whenTheArcHasExactlyOne() { + Arc arc = arc("arc", ArcType.HUB); + arc.setHooks("- Le prêtre a disparu"); + tree(arc, chapter("chap", "arc"), List.of(scene("s1", 0).build())); + assertEquals(ReadinessEntityType.ARC, remark("WRITE-017-SINGLE-HOOK").entityType()); + } + + @Test + void singleHook_notRaised_withSeveralHooks_orNone() { + Arc several = arc("arc", ArcType.HUB); + several.setHooks("- Le prêtre a disparu\n\n- Une récompense est offerte"); + tree(several, chapter("chap", "arc"), List.of(scene("s1", 0).build())); + assertFalse(ruleIds().contains("WRITE-017-SINGLE-HOOK")); + + Arc none = arc("arc", ArcType.HUB); + tree(none, chapter("chap", "arc"), List.of(scene("s1", 0).build())); + assertFalse(ruleIds().contains("WRITE-017-SINGLE-HOOK"), "accroches non renseignées : pas de remarque"); + } } diff --git a/core/src/test/java/com/loremind/domain/campaigncontext/bestiary/NpcStoryTest.java b/core/src/test/java/com/loremind/domain/campaigncontext/bestiary/NpcStoryTest.java new file mode 100644 index 0000000..ae2aab8 --- /dev/null +++ b/core/src/test/java/com/loremind/domain/campaigncontext/bestiary/NpcStoryTest.java @@ -0,0 +1,29 @@ +package com.loremind.domain.campaigncontext.bestiary; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.*; + +/** Fiche « rôle dans l'histoire » d'un PNJ : nettoyage et rôle moteur de l'intrigue. */ +class NpcStoryTest { + + @Test + void normalized_cleansRoleAndTexts() { + NpcStory s = new NpcStory(" ally ", " Venger son frère ", " ", "x".repeat(400)).normalized(); + assertEquals("ALLY", s.role()); + assertEquals("Venger son frère", s.motivation()); + assertNull(s.knowledge()); + assertEquals(300, s.mannerism().length()); + assertNull(new NpcStory("BOSS", null, null, null).normalized().role(), "rôle inconnu écarté"); + } + + @Test + void contentAndPlotRole() { + assertFalse(new NpcStory(" ", "", null, null).hasContent()); + assertTrue(new NpcStory(null, null, null, "Se gratte la barbe").hasContent()); + assertTrue(new NpcStory("OPPONENT", null, null, null).drivesThePlot()); + assertTrue(new NpcStory("ally", null, null, null).drivesThePlot()); + assertFalse(new NpcStory("EXTRA", null, null, null).drivesThePlot()); + assertFalse(new NpcStory(null, "x", null, null).drivesThePlot()); + } +} diff --git a/core/src/test/java/com/loremind/infrastructure/transfer/ContentExportImportRoundTripTest.java b/core/src/test/java/com/loremind/infrastructure/transfer/ContentExportImportRoundTripTest.java index 8f52cc6..3e56be1 100644 --- a/core/src/test/java/com/loremind/infrastructure/transfer/ContentExportImportRoundTripTest.java +++ b/core/src/test/java/com/loremind/infrastructure/transfer/ContentExportImportRoundTripTest.java @@ -165,6 +165,7 @@ class ContentExportImportRoundTripTest { ArcJpaEntity arc = arcRepo.save(ArcJpaEntity.builder() .name("RT Arc").campaignId(campaign.getId()).order(0).type(ArcType.HUB) + .hiddenTruth("RT vérité").hooks("- RT accroche 1\n- RT accroche 2") .relatedPageIds(new ArrayList<>(List.of(String.valueOf(page.getId())))) .illustrationImageIds(new ArrayList<>(List.of(imageRef))).build()); @@ -189,6 +190,7 @@ class ContentExportImportRoundTripTest { sceneRepo.save(SceneJpaEntity.builder() .name("RT Scene").chapterId(chapterB.getId()).order(0) + .tactics("RT fuient à la moitié").purpose("RT révèle le traître") .enemyIds(new ArrayList<>(List.of(String.valueOf(enemy.getId())))) .relatedPageIds(new ArrayList<>(List.of(String.valueOf(page.getId())))) .illustrationImageIds(new ArrayList<>(List.of(imageRef))) @@ -198,6 +200,7 @@ class ContentExportImportRoundTripTest { npcRepo.save(NpcJpaEntity.builder() .name("RT Npc").campaignId(campaign.getId()).portraitImageId(imageRef).folder("Ville").order(0) + .story(new com.loremind.domain.campaigncontext.bestiary.NpcStory("ALLY", "RT venger son frère", null, "RT tic")) .relatedPageIds(new ArrayList<>(List.of(String.valueOf(page.getId())))).build()); ItemCatalogJpaEntity catalog = ItemCatalogJpaEntity.builder() @@ -353,6 +356,18 @@ class ContentExportImportRoundTripTest { assertEquals((int) playthroughsBefore, result.created().get("playthroughs")); } + @Test + void import_keepsStoryFields_ofArcsScenesAndNpcs() { + assertEquals("RT vérité", importedArc.getHiddenTruth()); + assertTrue(importedArc.getHooks().contains("RT accroche 2")); + assertEquals(2, rtScenes.size()); + assertTrue(rtScenes.stream().allMatch(s -> "RT fuient à la moitié".equals(s.getTactics()) + && "RT révèle le traître".equals(s.getPurpose()))); + List npcs = npcRepo.findAll().stream().filter(n -> "RT Npc".equals(n.getName())).toList(); + assertEquals(2, npcs.size()); + assertTrue(npcs.stream().allMatch(n -> n.getStory() != null && "RT venger son frère".equals(n.getStory().motivation()))); + } + @Test void import_remapsPrepEntities_arcPointsToImportedPage() { assertTrue(importedArc.getRelatedPageIds().contains(String.valueOf(importedPageId))); diff --git a/core/src/test/java/com/loremind/infrastructure/transfer/pdf/PdfExportStoryFieldsTest.java b/core/src/test/java/com/loremind/infrastructure/transfer/pdf/PdfExportStoryFieldsTest.java new file mode 100644 index 0000000..6da78be --- /dev/null +++ b/core/src/test/java/com/loremind/infrastructure/transfer/pdf/PdfExportStoryFieldsTest.java @@ -0,0 +1,78 @@ +package com.loremind.infrastructure.transfer.pdf; + +import com.loremind.domain.campaigncontext.bestiary.NpcStory; +import com.loremind.domain.campaigncontext.structure.SceneType; +import com.loremind.infrastructure.persistence.entity.*; +import com.loremind.infrastructure.persistence.jpa.*; +import com.loremind.infrastructure.transfer.pdf.PdfExportOptions.LoreScope; +import com.loremind.infrastructure.transfer.pdf.PdfExportOptions.PageFormat; +import com.loremind.infrastructure.transfer.pdf.PdfExportOptions.Section; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.transaction.annotation.Transactional; + +import java.util.EnumSet; +import java.util.List; + +import static org.junit.jupiter.api.Assertions.*; + +/** + * Champs d'écriture dans le livret : histoire cachée et accroches de l'arc, utilité et + * tactique des scènes, rôle dans l'histoire des PNJ — secrets réservés à la version MJ, + * signe distinctif visible de tous. + */ +@SpringBootTest +@Transactional +class PdfExportStoryFieldsTest { + + @Autowired private PdfExportService service; + @Autowired private CampaignJpaRepository campaignRepo; + @Autowired private ArcJpaRepository arcRepo; + @Autowired private ChapterJpaRepository chapterRepo; + @Autowired private SceneJpaRepository sceneRepo; + @Autowired private NpcJpaRepository npcRepo; + + private String campaignId; + + @BeforeEach + void seed() { + CampaignJpaEntity camp = campaignRepo.save(CampaignJpaEntity.builder().name("Récit").arcsCount(1).build()); + campaignId = String.valueOf(camp.getId()); + ArcJpaEntity arc = arcRepo.save(ArcJpaEntity.builder().name("Acte I").campaignId(camp.getId()).order(0) + .hiddenTruth("Le régent a empoisonné le roi.").hooks("- Un ami disparaît\n- Une prime est offerte").build()); + ChapterJpaEntity ch = chapterRepo.save(ChapterJpaEntity.builder().name("Chap").arcId(arc.getId()).order(0).build()); + chapterRepo.save(ChapterJpaEntity.builder().name("Chap 2").arcId(arc.getId()).order(1).build()); + sceneRepo.save(SceneJpaEntity.builder().name("L'embuscade").chapterId(ch.getId()).order(0) + .type(SceneType.ENCOUNTER).combatDifficulty("Moyenne") + .purpose("Montrer que le régent a des hommes partout.") + .tactics("Ils fuient dès que leur sergent tombe.").build()); + npcRepo.save(NpcJpaEntity.builder().campaignId(camp.getId()).name("Ysolde").order(0) + .story(new NpcStory("OPPONENT", "Garder le trône.", "Où est caché le prince.", "Tapote sa bague.")) + .build()); + } + + @Test + void gmEdition_showsEveryStoryField() { + String x = service.xhtml(campaignId, PdfExportOptions.defaults()); + for (String s : List.of("Histoire cachée", "Le régent a empoisonné le roi.", ">Accroches<", "Une prime est offerte", + ">Utilité<", "Montrer que le régent a des hommes partout.", + "Tactique et moral", "Ils fuient dès que leur sergent tombe.", + ">Opposant<", "Garder le trône.", "Où est caché le prince.", "Tapote sa bague.")) { + assertTrue(x.contains(s), "absent de la version MJ : " + s); + } + } + + @Test + void playerEdition_keepsOnlyTheMannerism() { + String x = service.xhtml(campaignId, new PdfExportOptions(false, PageFormat.A4, false, + EnumSet.allOf(Section.class), LoreScope.ALL)); + assertTrue(x.contains("Tapote sa bague."), "le signe distinctif se voit"); + for (String s : List.of("Le régent a empoisonné le roi.", "Une prime est offerte", + "Montrer que le régent a des hommes partout.", "Ils fuient dès que leur sergent tombe.", + ">Opposant<", "Garder le trône.", "Où est caché le prince.")) { + assertFalse(x.contains(s), "secret présent dans la version joueurs : " + s); + } + } +} diff --git a/web/src/app/campaigns/arc/arc-edit/arc-edit.component.html b/web/src/app/campaigns/arc/arc-edit/arc-edit.component.html index 5ea57c0..5f2661b 100644 --- a/web/src/app/campaigns/arc/arc-edit/arc-edit.component.html +++ b/web/src/app/campaigns/arc/arc-edit/arc-edit.component.html @@ -95,6 +95,35 @@ + + +
+
+ + +
+ +
+
+
+ + +
+ + {{ 'arcEdit.hooksHint' | translate }} +
+
+
diff --git a/web/src/app/campaigns/arc/arc-edit/arc-edit.component.ts b/web/src/app/campaigns/arc/arc-edit/arc-edit.component.ts index ee32d10..52495e5 100644 --- a/web/src/app/campaigns/arc/arc-edit/arc-edit.component.ts +++ b/web/src/app/campaigns/arc/arc-edit/arc-edit.component.ts @@ -97,6 +97,10 @@ export class ArcEditComponent implements OnInit { return !!(v.themes || v.stakes); } get gmNotesFilled(): boolean { return !!this.form.value.gmNotes; } + get truthHooksFilled(): boolean { + const v = this.form.value; + return !!(v.hiddenTruth || v.hooks); + } get rewardsResolutionFilled(): boolean { const v = this.form.value; return !!(v.rewards || v.resolution); @@ -126,7 +130,9 @@ export class ArcEditComponent implements OnInit { stakes: [''], gmNotes: [''], rewards: [''], - resolution: [''] + resolution: [''], + hiddenTruth: [''], + hooks: [''] }); } @@ -179,7 +185,9 @@ export class ArcEditComponent implements OnInit { stakes: arc.stakes ?? '', gmNotes: arc.gmNotes ?? '', rewards: arc.rewards ?? '', - resolution: arc.resolution ?? '' + resolution: arc.resolution ?? '', + hiddenTruth: arc.hiddenTruth ?? '', + hooks: arc.hooks ?? '' }); this.layoutService.show(buildCampaignSidebarConfig(campaign, allCampaigns, treeData, this.campaignId, this.translate)); @@ -199,6 +207,8 @@ export class ArcEditComponent implements OnInit { gmNotes: this.form.value.gmNotes, rewards: this.form.value.rewards, resolution: this.form.value.resolution, + hiddenTruth: this.form.value.hiddenTruth, + hooks: this.form.value.hooks, relatedPageIds: this.relatedPageIds, illustrationImageIds: this.illustrationImageIds, icon: this.selectedIcon diff --git a/web/src/app/campaigns/arc/arc-view/arc-view.component.html b/web/src/app/campaigns/arc/arc-view/arc-view.component.html index 3451c67..7789959 100644 --- a/web/src/app/campaigns/arc/arc-view/arc-view.component.html +++ b/web/src/app/campaigns/arc/arc-view/arc-view.component.html @@ -84,6 +84,18 @@ }
+ @if (arc.hooks?.trim()) { +
+

🪝 {{ 'arcView.hooksTitle' | translate }}

+

{{ arc.hooks }}

+
+ } + @if (arc.hiddenTruth?.trim()) { +
+

🗝️ {{ 'arcView.hiddenTruthTitle' | translate }}

+

{{ arc.hiddenTruth }}

+
+ }

🎁 {{ 'arcView.rewardsTitle' | translate }}

@if (arc.rewards?.trim()) { diff --git a/web/src/app/campaigns/npc/npc-edit/npc-edit.component.html b/web/src/app/campaigns/npc/npc-edit/npc-edit.component.html index 3c44127..5c74e30 100644 --- a/web/src/app/campaigns/npc/npc-edit/npc-edit.component.html +++ b/web/src/app/campaigns/npc/npc-edit/npc-edit.component.html @@ -87,6 +87,48 @@
+ +
+ {{ 'npcEdit.storyTitle' | translate }} +

{{ 'npcEdit.storyHint' | translate }}

+
+
+ + +
+ +
+
+
+ + +
+ +
+
+
+ + +
+ +
+
+
+ + +
+ +
+
+ @if (loreId) {
diff --git a/web/src/app/campaigns/npc/npc-edit/npc-edit.component.scss b/web/src/app/campaigns/npc/npc-edit/npc-edit.component.scss index 0a69ca5..037a580 100644 --- a/web/src/app/campaigns/npc/npc-edit/npc-edit.component.scss +++ b/web/src/app/campaigns/npc/npc-edit/npc-edit.component.scss @@ -155,3 +155,23 @@ background: rgba(248, 113, 113, 0.08); } } + +// Rôle dans l'histoire : bloc encadré, indépendant des champs du système de jeu. +.story-block { + border: 1px solid #1f2937; + border-radius: 10px; + padding: 0.9rem 1rem 1rem; + margin: 1rem 0; + display: flex; + flex-direction: column; + gap: 0.9rem; + + legend { + padding: 0 0.4rem; + color: #e5e7eb; + font-weight: 600; + font-size: 0.95rem; + } + + .hint { margin: 0; } +} diff --git a/web/src/app/campaigns/npc/npc-edit/npc-edit.component.ts b/web/src/app/campaigns/npc/npc-edit/npc-edit.component.ts index 3232890..b9c3bb6 100644 --- a/web/src/app/campaigns/npc/npc-edit/npc-edit.component.ts +++ b/web/src/app/campaigns/npc/npc-edit/npc-edit.component.ts @@ -5,6 +5,7 @@ import { FormsModule } from '@angular/forms'; import { LucideAngularModule, Save, ArrowLeft, Drama, Trash2, Sparkles } from 'lucide-angular'; import { TranslatePipe, TranslateService } from '@ngx-translate/core'; import { NpcService } from '../../../services/npc.service'; +import { NPC_ROLES, NpcStory } from '../../../services/npc.model'; import { CampaignService } from '../../../services/campaign.service'; import { GameSystemService } from '../../../services/game-system.service'; import { PageService } from '../../../services/page.service'; @@ -16,6 +17,7 @@ import { DynamicFieldsFormComponent } from '../../../shared/dynamic-fields-form/ import { SingleImagePickerComponent } from '../../../shared/single-image-picker/single-image-picker.component'; import { LoreLinkPickerComponent } from '../../../shared/lore-link-picker/lore-link-picker.component'; import { ConfirmDialogService } from '../../../shared/confirm-dialog/confirm-dialog.service'; +import { WritingCoachTriggerComponent } from '../../../shared/writing-coach/writing-coach-trigger.component'; /** * Editeur plein ecran d'une fiche de PNJ. @@ -25,7 +27,7 @@ import { ConfirmDialogService } from '../../../shared/confirm-dialog/confirm-dia */ @Component({ selector: 'app-npc-edit', - imports: [FormsModule, LucideAngularModule, TranslatePipe, AiChatDrawerComponent, DynamicFieldsFormComponent, SingleImagePickerComponent, LoreLinkPickerComponent], + imports: [FormsModule, LucideAngularModule, TranslatePipe, AiChatDrawerComponent, DynamicFieldsFormComponent, SingleImagePickerComponent, LoreLinkPickerComponent, WritingCoachTriggerComponent], templateUrl: './npc-edit.component.html', styleUrls: ['./npc-edit.component.scss'] }) @@ -68,6 +70,9 @@ export class NpcEditComponent implements OnInit { lorePages: Page[] = []; /** IDs des pages de lore référencées par ce PNJ. */ relatedPageIds: string[] = []; + /** Rôle dans l'histoire (fiche indépendante du système de jeu). */ + story: NpcStory = { role: null }; + readonly roles = NPC_ROLES; constructor( private route: ActivatedRoute, @@ -103,6 +108,7 @@ export class NpcEditComponent implements OnInit { this.imageValues = n.imageValues ?? {}; this.keyValueValues = n.keyValueValues ?? {}; this.relatedPageIds = [...(n.relatedPageIds ?? [])]; + this.story = { ...(n.story ?? {}), role: n.story?.role ?? null }; this.order = n.order ?? 0; }, error: () => this.back() @@ -157,7 +163,8 @@ export class NpcEditComponent implements OnInit { imageValues: this.imageValues, keyValueValues: this.keyValueValues, campaignId: this.campaignId, - relatedPageIds: this.relatedPageIds + relatedPageIds: this.relatedPageIds, + story: { ...this.story, role: this.story.role || null } }; const isCreation = !this.npcId; const req = this.npcId diff --git a/web/src/app/campaigns/npc/npc-view/npc-view.component.html b/web/src/app/campaigns/npc/npc-view/npc-view.component.html index 2ac7a06..8baa242 100644 --- a/web/src/app/campaigns/npc/npc-view/npc-view.component.html +++ b/web/src/app/campaigns/npc/npc-view/npc-view.component.html @@ -19,6 +19,26 @@ + @if (npc?.story; as story) { +
+

+ {{ 'npcView.storyTitle' | translate }} + @if (story.role) { + {{ ('npcEdit.role.' + story.role) | translate }} + } +

+ @if (story.mannerism) { +

{{ 'npcEdit.mannerismLabel' | translate }} : {{ story.mannerism }}

+ } + @if (story.motivation) { +

{{ 'npcEdit.motivationLabel' | translate }} : {{ story.motivation }}

+ } + @if (story.knowledge) { +

{{ 'npcEdit.knowledgeLabel' | translate }} : {{ story.knowledge }}

+ } +
+ } + @if (loreId && (npc?.relatedPageIds?.length ?? 0) > 0) {
+ +
+
+ + +
+ +
+
@@ -348,6 +362,18 @@ rows="4">
+
+
+ + +
+ +
diff --git a/web/src/app/campaigns/scene/scene-edit/scene-edit.component.ts b/web/src/app/campaigns/scene/scene-edit/scene-edit.component.ts index 03c5cc6..e52690a 100644 --- a/web/src/app/campaigns/scene/scene-edit/scene-edit.component.ts +++ b/web/src/app/campaigns/scene/scene-edit/scene-edit.component.ts @@ -154,7 +154,7 @@ export class SceneEditComponent implements OnInit { get branchesFilled(): boolean { return this.branches.length > 0; } get combatFilled(): boolean { const v = this.form.value; - return !!(v.combatDifficulty || v.enemies) || this.enemyIds.length > 0; + return !!(v.combatDifficulty || v.enemies || v.tactics) || this.enemyIds.length > 0; } get loreFilled(): boolean { return this.relatedPageIds.length > 0; } get dungeonFilled(): boolean { return this.rooms.length > 0; } @@ -191,7 +191,10 @@ export class SceneEditComponent implements OnInit { choicesConsequences: [''], // Combat combatDifficulty: [''], - enemies: [''] + enemies: [''], + tactics: [''], + // Utilité dans l'histoire + purpose: [''] }); } @@ -281,7 +284,9 @@ export class SceneEditComponent implements OnInit { gmSecretNotes: scene.gmSecretNotes ?? '', choicesConsequences: scene.choicesConsequences ?? '', combatDifficulty: scene.combatDifficulty ?? '', - enemies: scene.enemies ?? '' + enemies: scene.enemies ?? '', + tactics: scene.tactics ?? '', + purpose: scene.purpose ?? '' }); this.layoutService.show(buildCampaignSidebarConfig(campaign, allCampaigns, treeData, this.campaignId, this.translate)); @@ -304,6 +309,8 @@ export class SceneEditComponent implements OnInit { choicesConsequences: this.form.value.choicesConsequences, combatDifficulty: this.form.value.combatDifficulty, enemies: this.form.value.enemies, + tactics: this.form.value.tactics, + purpose: this.form.value.purpose, enemyIds: this.enemyIds, relatedPageIds: this.relatedPageIds, illustrationImageIds: this.illustrationImageIds, diff --git a/web/src/app/campaigns/scene/scene-view/scene-view.component.html b/web/src/app/campaigns/scene/scene-view/scene-view.component.html index 7cdd6c5..42a69d4 100644 --- a/web/src/app/campaigns/scene/scene-view/scene-view.component.html +++ b/web/src/app/campaigns/scene/scene-view/scene-view.component.html @@ -73,6 +73,12 @@

{{ scene.choicesConsequences }}

} + @if (scene.purpose?.trim()) { +
+

🎯 {{ 'sceneView.purposeSectionTitle' | translate }}

+

{{ scene.purpose }}

+
+ } @if (scene.combatDifficulty?.trim() || scene.enemies?.trim() || linkedEnemies.length > 0) { @if (scene.combatDifficulty?.trim()) { @@ -100,6 +106,12 @@ } } + @if (scene.tactics?.trim()) { +
+

🛡️ {{ 'sceneView.tacticsSectionTitle' | translate }}

+

{{ scene.tactics }}

+
+ } @if (scene.gmSecretNotes?.trim()) {
diff --git a/web/src/app/campaigns/writing-remark-action.helper.ts b/web/src/app/campaigns/writing-remark-action.helper.ts index 86ef855..3e8164e 100644 --- a/web/src/app/campaigns/writing-remark-action.helper.ts +++ b/web/src/app/campaigns/writing-remark-action.helper.ts @@ -21,6 +21,8 @@ export function remarkAction(remark: WritingRemark, campaignId: string): GapActi return { link: [...base, 'arcs', remark.arcId ?? '', 'chapters', remark.entityId, 'edit'], queryParams }; case 'ARC': return { link: [...base, 'arcs', remark.entityId, 'edit'], queryParams }; + case 'NPC': + return { link: [...base, 'npcs', remark.entityId, 'edit'] }; default: return { link: base }; } @@ -38,5 +40,6 @@ const FOCUS_BY_RULE: Record = { 'WRITE-011-ISOLATED-SCENE': 'branches', 'WRITE-012-CHOKEPOINT': 'choices', 'WRITE-013-LINEAR-DUNGEON': 'rooms', - 'WRITE-015-SAME-SOURCE-CLUES': 'branches' + 'WRITE-015-SAME-SOURCE-CLUES': 'branches', + 'WRITE-017-SINGLE-HOOK': 'hooks' }; diff --git a/web/src/app/services/campaign.model.ts b/web/src/app/services/campaign.model.ts index 8b99543..dac45ff 100644 --- a/web/src/app/services/campaign.model.ts +++ b/web/src/app/services/campaign.model.ts @@ -67,6 +67,10 @@ export interface Arc { gmNotes?: string; rewards?: string; resolution?: string; + /** Histoire cachée (réservée au MJ). */ + hiddenTruth?: string; + /** Accroches : une par ligne. */ + hooks?: string; /** IDs des pages du Lore liées à cet arc (weak cross-context refs). */ relatedPageIds?: string[]; @@ -89,6 +93,10 @@ export interface ArcCreate { gmNotes?: string; rewards?: string; resolution?: string; + /** Histoire cachée (réservée au MJ). */ + hiddenTruth?: string; + /** Accroches : une par ligne. */ + hooks?: string; relatedPageIds?: string[]; illustrationImageIds?: string[]; @@ -297,6 +305,10 @@ export interface Scene { gmSecretNotes?: string; choicesConsequences?: string; combatDifficulty?: string; + /** Tactique et moral des adversaires. */ + tactics?: string; + /** Utilité : ce que l'histoire perd si on coupe la scène. */ + purpose?: string; enemies?: string; /** IDs des fiches du bestiaire engagées dans la rencontre (weak refs). */ @@ -340,6 +352,10 @@ export interface SceneCreate { gmSecretNotes?: string; choicesConsequences?: string; combatDifficulty?: string; + /** Tactique et moral des adversaires. */ + tactics?: string; + /** Utilité : ce que l'histoire perd si on coupe la scène. */ + purpose?: string; enemies?: string; /** IDs des fiches du bestiaire engagées dans la rencontre (weak refs). */ diff --git a/web/src/app/services/npc.model.ts b/web/src/app/services/npc.model.ts index a508db3..447084c 100644 --- a/web/src/app/services/npc.model.ts +++ b/web/src/app/services/npc.model.ts @@ -16,6 +16,24 @@ export interface Npc { /** Dossier de classement (ex. « Bard's Gate »). Vide/absent = non classé. */ folder?: string | null; order?: number; + /** Rôle dans l'histoire (indépendant du système de jeu). */ + story?: NpcStory | null; +} + +/** Place d'un PNJ dans l'histoire. */ +export type NpcRole = 'OPPONENT' | 'ALLY' | 'RESOURCE' | 'EXTRA'; + +export const NPC_ROLES: NpcRole[] = ['OPPONENT', 'ALLY', 'RESOURCE', 'EXTRA']; + +/** Fiche « rôle dans l'histoire » d'un PNJ (miroir du record Java NpcStory). */ +export interface NpcStory { + role?: NpcRole | null; + /** Ce qu'il veut, et ce qu'il est prêt à faire. */ + motivation?: string | null; + /** Ce qu'il sait (réservé au MJ). */ + knowledge?: string | null; + /** Signe distinctif à jouer (geste, phrasé, tic). */ + mannerism?: string | null; } export interface NpcCreate { @@ -28,4 +46,5 @@ export interface NpcCreate { campaignId: string; relatedPageIds?: string[]; folder?: string | null; + story?: NpcStory | null; } diff --git a/web/src/app/shared/writing-review/writing-review-content.spec.ts b/web/src/app/shared/writing-review/writing-review-content.spec.ts index fa72d65..2799ce3 100644 --- a/web/src/app/shared/writing-review/writing-review-content.spec.ts +++ b/web/src/app/shared/writing-review/writing-review-content.spec.ts @@ -25,7 +25,7 @@ describe('writing review content', () => { const rules = emittedRules(); it('finds the rules emitted by the core', () => { - expect(rules).toHaveLength(15); + expect(rules).toHaveLength(17); }); for (const lang of ['fr', 'en'] as const) { @@ -72,3 +72,19 @@ describe('remarkAction', () => { expect(remarkAction(r, 'camp').link).toEqual(['/campaigns', 'camp']); }); }); + +describe('remarkAction for NPCs and hooks', () => { + const base: WritingRemark = { + entityType: 'NPC', entityId: 'n1', ruleId: 'WRITE-016-NPC-NO-MOTIVATION', + category: 'STAKES', params: { role: 'OPPONENT' }, arcId: null, chapterId: null + }; + + it('opens the NPC editor', () => { + expect(remarkAction(base, 'camp')).toEqual({ link: ['/campaigns', 'camp', 'npcs', 'n1', 'edit'] }); + }); + + it('opens the arc editor on the hooks section', () => { + expect(remarkAction({ ...base, entityType: 'ARC', entityId: 'a1', ruleId: 'WRITE-017-SINGLE-HOOK' }, 'camp')) + .toEqual({ link: ['/campaigns', 'camp', 'arcs', 'a1', 'edit'], queryParams: { focus: 'hooks' } }); + }); +}); diff --git a/web/src/assets/i18n/en.json b/web/src/assets/i18n/en.json index c9a1fb3..7317902 100644 --- a/web/src/assets/i18n/en.json +++ b/web/src/assets/i18n/en.json @@ -517,7 +517,13 @@ "optionalHint": "Only the title is required. Expand and fill in only the sections you need — everything else is optional.", "themesStakesSectionTitle": "Themes and stakes", "gmNotesSectionTitle": "GM notes", - "rewardsResolutionSectionTitle": "Rewards and resolution" + "rewardsResolutionSectionTitle": "Rewards and resolution", + "truthHooksSectionTitle": "Hidden truth and hooks", + "hiddenTruthLabel": "Hidden truth (GM only)", + "hiddenTruthPlaceholder": "What really happened, which the players will uncover bit by bit", + "hooksLabel": "Hooks", + "hooksPlaceholder": "- A friend of the characters goes missing\n- A reward is offered for…", + "hooksHint": "One hook per line. Aim for at least two, of different kinds." }, "arcView": { "subtitleHub": "Hub arc (non-linear quests)", @@ -549,7 +555,9 @@ "deleteConfirmMessage": "Delete the arc \"{{name}}\"?", "questsTitle": "Quests in this arc", "questsEmpty": "No quests yet. Add one to populate this hub.", - "createQuest": "New quest" + "createQuest": "New quest", + "hooksTitle": "Hooks", + "hiddenTruthTitle": "Hidden truth" }, "campaigns": { "heroTitle": "Your Campaigns", @@ -1062,7 +1070,11 @@ "branchTargetBroken": "Destination not found (deleted scene): pick a new destination or remove this branch.", "battlemapAdd": "Add a map", "battlemapLabelPlaceholder": "Label (e.g.: Day, Night, Floor 1…)", - "battlemapRemoveMap": "Remove this map" + "battlemapRemoveMap": "Remove this map", + "purposeLabel": "Purpose of the scene", + "purposePlaceholder": "If it were cut, what would the story lose? (information, a choice, an emotion…)", + "tacticsLabel": "Enemy tactics and morale", + "tacticsPlaceholder": "How they fight, and when they flee, surrender or negotiate" }, "sceneView": { "subtitle": "Scene", @@ -1092,7 +1104,9 @@ "deleteTitle": "Delete scene", "deleteMessage": "Delete the scene \"{{name}}\"?", "deleteIrreversible": "This action is irreversible.", - "deleteError": "Error while deleting the scene" + "deleteError": "Error while deleting the scene", + "purposeSectionTitle": "Purpose", + "tacticsSectionTitle": "Tactics and morale" }, "characterEdit": { "backToCampaign": "Back to campaign", @@ -1139,7 +1153,23 @@ "chatSuggestion3": "Imagine 3 signature lines that characterize them", "deleteTitle": "Delete this sheet?", "deleteMessage": "Delete the sheet for \"{{name}}\"?", - "irreversible": "This action is irreversible." + "irreversible": "This action is irreversible.", + "storyTitle": "Role in the story", + "storyHint": "Independent of the game system: what makes this NPC playable and useful to the story.", + "roleLabel": "Role", + "roleNone": "Not set", + "role": { + "OPPONENT": "Opponent", + "ALLY": "Ally", + "RESOURCE": "Resource (informant, service)", + "EXTRA": "Extra" + }, + "motivationLabel": "Motivation", + "motivationPlaceholder": "What they want, and what they're willing to do to get it", + "knowledgeLabel": "What they know (GM only)", + "knowledgePlaceholder": "The information they can reveal, and on what condition", + "mannerismLabel": "Distinctive trait", + "mannerismPlaceholder": "A gesture, a way of speaking, a tic to play at the table" }, "npcList": { "create": "New NPC", @@ -1154,7 +1184,8 @@ "npcView": { "aiAssistant": "AI Assistant", "relatedPages": "Linked Lore pages", - "deletedPage": "(deleted page)" + "deletedPage": "(deleted page)", + "storyTitle": "Role in the story" }, "enemyEdit": { "backToEnemies": "Back to enemies", @@ -1992,6 +2023,28 @@ ], "example": "Three smugglers aren't trying to kill anyone: they want to sink the boat holding the evidence. If they succeed, the fight is lost, even with every PC still standing.", "pitfall": "The \"bag of hit points\" fight: with no goal other than taking the enemy down, it quickly becomes repetitive. Give each side a purpose." + }, + "purpose": { + "title": "Purpose of the scene", + "purpose": "Every scene should bring something to the story. Knowing what you'd lose by cutting it helps decide what to keep, what to shorten, and what to improvise.", + "questions": [ + "What do the players learn here that they won't learn anywhere else?", + "What decision do they make, or what emotion do they feel?", + "If time runs short, can it be summed up in two sentences?" + ], + "example": "Without the inn, the players never meet Maëlis: they lose their only ally and the first lead to the tower.", + "pitfall": "A scene that only exists to look nice or fill a session: players feel it, and the pacing collapses." + }, + "tactics": { + "title": "Enemy tactics and morale", + "purpose": "Enemies who want to survive make a fight come alive: they use the terrain, protect their leader and know when to run. The GM then knows how to play them without improvising at random.", + "questions": [ + "How does the terrain favour them?", + "What makes them flee, surrender or negotiate?", + "Who do they protect, and what do they do if their leader falls?" + ], + "example": "The smugglers shoot from the boats and cut the moorings if approached. If the sergeant falls, they drop their weapons and offer to talk.", + "pitfall": "Enemies who all fight to the death: the fight becomes plain hit point subtraction, with no choices for the players." } }, "chapter": { @@ -2082,6 +2135,28 @@ ], "example": "The guild is publicly exposed; or the PCs buy it out themselves; or the villages are lost and the next arc opens with the exodus.", "pitfall": "A single ending written in advance: the players' choices no longer matter. Prepare outcomes, not a script." + }, + "hiddenTruth": { + "title": "Hidden truth", + "purpose": "The truth the players will piece together. Everything else follows from it: every clue, every revelation is a trace it left behind.", + "questions": [ + "What really happened, and who is responsible?", + "What traces did it leave, and where?", + "Can the players fully understand it by the end?" + ], + "example": "The regent poisoned the old king to rule in the prince's place. The court physician knows and keeps quiet out of fear.", + "pitfall": "A truth too complicated to discover in play. If a player can't sum it up in one sentence at the end, simplify it." + }, + "hooks": { + "title": "Hooks", + "purpose": "The reasons that push the characters to get involved. Several hooks of different kinds let players choose their motivation instead of having it imposed.", + "questions": [ + "Which one plays on interest (reward, contract)?", + "Which one affects a character personally?", + "Which one falls on them without them looking for it?" + ], + "example": "- The council offers a reward to find the prince.\n- A character's sister worked at the palace and has vanished.\n- The regent's guards come to arrest the characters for no reason.", + "pitfall": "A single hook, presented as an obligation: if it doesn't speak to the table, the adventure starts reluctantly." } }, "publication": { @@ -2140,6 +2215,50 @@ "example": "Writing: Camille Martin\nMaps: Léo Dubois\nEditing: Alex\nPlaytesters: the Thursday table (Inès, Yanis, Paul, Mira)", "pitfall": "Forgetting the playtesters, or the credits required by an artwork's or a game system's licence." } + }, + "npc": { + "role": { + "title": "Role in the story", + "purpose": "Knowing what place an NPC holds tells you how much preparation they deserve: an opponent or an ally weighs on the plot, an extra only needs one detail.", + "questions": [ + "Does this NPC help the characters, oppose them, or hold something they need?", + "Do they act on their own, or are they the prize others fight over?" + ], + "example": "Borin the blacksmith is a resource: he knows who ordered the crypt keys, but will only tell someone who helps him.", + "pitfall": "Allies who do everything in the players' place. An ally has limits: what they can't or won't do." + }, + "motivation": { + "title": "Motivation", + "purpose": "What the NPC wants decides everything they do. With a clear motivation, the GM knows how they react to anything the players do.", + "questions": [ + "What do they want, right now?", + "What are they afraid to lose?", + "How far are they willing to go?" + ], + "example": "Ysolde wants the throne for herself, but fears scandal above all: she'd rather bribe than kill.", + "pitfall": "A villain who is evil \"just because\": players can neither understand, manipulate nor convince them." + }, + "knowledge": { + "title": "What they know", + "purpose": "Listing what the NPC can reveal avoids improvising contradictory answers and ties the NPC to the adventure's clues.", + "questions": [ + "What useful information do they hold?", + "On what condition will they share it (trust, money, threat)?", + "What do they wrongly believe they know?" + ], + "example": "He saw the notary leave the room at midnight. He'll say so in exchange for safe passage out of town.", + "pitfall": "An NPC who knows everything and tells the first person who asks: the investigation is solved in one conversation." + }, + "mannerism": { + "title": "Distinctive trait", + "purpose": "One detail to play at the table makes an NPC memorable in seconds, and helps players recognise who is speaking.", + "questions": [ + "What gesture or habit gives them away?", + "How do they speak: fast, slowly, with a pet word?" + ], + "example": "Taps her ring every time she lies, and ends her sentences with \"don't you agree?\".", + "pitfall": "A long physical description nobody remembers: one strong detail beats a full portrait." + } } } }, @@ -2233,6 +2352,16 @@ "observation": "The {{count}} paths leading to \"{{entity}}\" all start from \"{{kind}}\" scenes.", "why": "If all the information goes through one kind of scene (only interrogations, only searches), a table that dislikes it or fails at it will miss every clue at once.", "question": "Could a clue come from another kind of scene: a place to search, a document, an event?" + }, + "WRITE-016-NPC-NO-MOTIVATION": { + "observation": "\"{{entity}}\" weighs on the plot, but their motivation isn't written.", + "why": "An opponent or ally who wants nothing specific is hard to play: the GM doesn't know how they react when the players upset their plans.", + "question": "What does this NPC want, and what are they afraid to lose?" + }, + "WRITE-017-SINGLE-HOOK": { + "observation": "\"{{entity}}\" has only one hook.", + "why": "If that single reason doesn't speak to the players, the adventure starts reluctantly. Several hooks of different kinds let them choose why to get involved.", + "question": "What other reason, personal or self-interested, could push the characters to act?" } } }, diff --git a/web/src/assets/i18n/fr.json b/web/src/assets/i18n/fr.json index e3f0379..ad88975 100644 --- a/web/src/assets/i18n/fr.json +++ b/web/src/assets/i18n/fr.json @@ -517,7 +517,13 @@ "optionalHint": "Seul le titre est requis. Déplie et remplis uniquement les sections utiles — tout le reste est optionnel.", "themesStakesSectionTitle": "Thèmes et enjeux", "gmNotesSectionTitle": "Notes du MJ", - "rewardsResolutionSectionTitle": "Récompenses et dénouement" + "rewardsResolutionSectionTitle": "Récompenses et dénouement", + "truthHooksSectionTitle": "Histoire cachée et accroches", + "hiddenTruthLabel": "Histoire cachée (réservée au MJ)", + "hiddenTruthPlaceholder": "Ce qui s'est vraiment passé, que les joueurs découvriront peu à peu", + "hooksLabel": "Accroches", + "hooksPlaceholder": "- Un ami des personnages disparaît\n- Une récompense est offerte pour…", + "hooksHint": "Une accroche par ligne. Visez-en au moins deux, de nature différente." }, "arcView": { "subtitleHub": "Arc en hub (quêtes non linéaires)", @@ -549,7 +555,9 @@ "deleteConfirmMessage": "Supprimer l'arc \"{{name}}\" ?", "questsTitle": "Quêtes de cet arc", "questsEmpty": "Aucune quête pour l'instant. Ajoutez-en une pour peupler ce hub.", - "createQuest": "Nouvelle quête" + "createQuest": "Nouvelle quête", + "hooksTitle": "Accroches", + "hiddenTruthTitle": "Histoire cachée" }, "campaigns": { "heroTitle": "Vos Campagnes", @@ -1062,7 +1070,11 @@ "branchTargetBroken": "Destination introuvable (scène supprimée) : choisissez une nouvelle destination ou retirez cette branche.", "battlemapAdd": "Ajouter une carte", "battlemapLabelPlaceholder": "Libellé (ex : Jour, Nuit, Étage 1…)", - "battlemapRemoveMap": "Retirer cette carte" + "battlemapRemoveMap": "Retirer cette carte", + "purposeLabel": "Utilité de la scène", + "purposePlaceholder": "Si on la coupe, qu'est-ce que l'histoire perd ? (une info, un choix, une émotion…)", + "tacticsLabel": "Tactique et moral des adversaires", + "tacticsPlaceholder": "Comment ils se battent, et quand ils fuient, se rendent ou négocient" }, "sceneView": { "subtitle": "Scène", @@ -1092,7 +1104,9 @@ "deleteTitle": "Supprimer la scène", "deleteMessage": "Supprimer la scène \"{{name}}\" ?", "deleteIrreversible": "Cette action est irréversible.", - "deleteError": "Erreur lors de la suppression de la scène" + "deleteError": "Erreur lors de la suppression de la scène", + "purposeSectionTitle": "Utilité", + "tacticsSectionTitle": "Tactique et moral" }, "characterEdit": { "backToCampaign": "Retour à la campagne", @@ -1139,7 +1153,23 @@ "chatSuggestion3": "Imagine 3 répliques signatures qui le caractérisent", "deleteTitle": "Supprimer la fiche ?", "deleteMessage": "Supprimer la fiche de \"{{name}}\" ?", - "irreversible": "Cette action est irréversible." + "irreversible": "Cette action est irréversible.", + "storyTitle": "Rôle dans l'histoire", + "storyHint": "Indépendant du système de jeu : ce qui rend ce PNJ jouable et utile au récit.", + "roleLabel": "Rôle", + "roleNone": "Non précisé", + "role": { + "OPPONENT": "Opposant", + "ALLY": "Allié", + "RESOURCE": "Ressource (informateur, service)", + "EXTRA": "Figurant" + }, + "motivationLabel": "Motivation", + "motivationPlaceholder": "Ce qu'il veut, et ce qu'il est prêt à faire pour l'obtenir", + "knowledgeLabel": "Ce qu'il sait (réservé au MJ)", + "knowledgePlaceholder": "Les informations qu'il peut révéler, et à quelle condition", + "mannerismLabel": "Signe distinctif", + "mannerismPlaceholder": "Un geste, une façon de parler, un tic à jouer à la table" }, "npcList": { "create": "Nouveau PNJ", @@ -1154,7 +1184,8 @@ "npcView": { "aiAssistant": "Assistant IA", "relatedPages": "Pages de Lore liées", - "deletedPage": "(page supprimée)" + "deletedPage": "(page supprimée)", + "storyTitle": "Rôle dans l'histoire" }, "enemyEdit": { "backToEnemies": "Retour aux ennemis", @@ -1992,6 +2023,28 @@ ], "example": "Trois contrebandiers ne cherchent pas à tuer : ils veulent couler la barque qui contient les preuves. S'ils y parviennent, le combat est perdu, même si tous les PJ sont debout.", "pitfall": "Le combat « sac de points de vie » : sans autre objectif que d'abattre l'adversaire, il devient vite répétitif. Donne un but à chaque camp." + }, + "purpose": { + "title": "Utilité de la scène", + "purpose": "Chaque scène doit apporter quelque chose à l'histoire. Savoir ce qu'on perdrait en la coupant aide à décider ce qu'on garde, ce qu'on raccourcit, et ce qu'on improvise.", + "questions": [ + "Qu'apprennent les joueurs ici qu'ils n'apprendront nulle part ailleurs ?", + "Quelle décision prennent-ils, ou quelle émotion vivent-ils ?", + "Si le temps manque en séance, peut-on la résumer en deux phrases ?" + ], + "example": "Sans l'auberge, les joueurs ne rencontrent jamais Maëlis : ils perdent leur seule alliée et la première piste vers la tour.", + "pitfall": "Une scène qui n'existe que pour « faire joli » ou pour remplir une séance : les joueurs le sentent, et le rythme s'effondre." + }, + "tactics": { + "title": "Tactique et moral des adversaires", + "purpose": "Des adversaires qui veulent survivre rendent un combat vivant : ils utilisent le terrain, protègent leur chef et savent quand fuir. Le MJ sait alors comment les jouer sans improviser au hasard.", + "questions": [ + "Comment le terrain les avantage-t-il ?", + "Qu'est-ce qui les fait fuir, se rendre ou négocier ?", + "Qui protègent-ils, et que font-ils si leur chef tombe ?" + ], + "example": "Les contrebandiers tirent depuis les barques et coupent les amarres si on les approche. Si le sergent tombe, ils jettent leurs armes et proposent de parler.", + "pitfall": "Des ennemis qui se battent tous jusqu'à la mort : le combat devient une simple soustraction de points de vie, sans choix pour les joueurs." } }, "chapter": { @@ -2082,6 +2135,28 @@ ], "example": "La guilde est démasquée publiquement ; ou bien elle est rachetée par les PJ eux-mêmes ; ou bien les villages sont perdus et l'arc suivant commence par l'exode.", "pitfall": "Une seule fin écrite d'avance : les choix des joueurs ne comptent plus. Prépare des issues, pas un scénario." + }, + "hiddenTruth": { + "title": "Histoire cachée", + "purpose": "La vérité que les joueurs vont reconstituer. Tout le reste en découle : chaque indice, chaque révélation est une trace qu'elle a laissée.", + "questions": [ + "Qu'est-ce qui s'est vraiment passé, et qui en est responsable ?", + "Quelles traces cela a-t-il laissées, et où ?", + "Les joueurs peuvent-ils la comprendre entièrement à la fin ?" + ], + "example": "Le régent a empoisonné le vieux roi pour gouverner à la place du prince. Le médecin de la cour le sait et se tait par peur.", + "pitfall": "Une vérité trop compliquée pour être découverte en jeu. Si un joueur ne peut pas la résumer en une phrase à la fin, simplifiez-la." + }, + "hooks": { + "title": "Accroches", + "purpose": "Les raisons qui poussent les personnages à se lancer. Plusieurs accroches de nature différente laissent les joueurs choisir leur motivation au lieu de la subir.", + "questions": [ + "Laquelle joue sur l'intérêt (récompense, contrat) ?", + "Laquelle touche un personnage personnellement ?", + "Laquelle tombe sur eux sans qu'ils la cherchent ?" + ], + "example": "- Le conseil offre une récompense pour retrouver le prince.\n- La sœur d'un personnage travaillait au palais et a disparu.\n- Des gardes du régent viennent arrêter les personnages sans raison.", + "pitfall": "Une seule accroche, présentée comme une obligation : si elle ne parle pas à la table, l'aventure démarre à contrecœur." } }, "publication": { @@ -2140,6 +2215,50 @@ "example": "Écriture : Camille Martin\nCartes : Léo Dubois\nRelecture : Alex\nTesteurs : la table du jeudi (Inès, Yanis, Paul, Mira)", "pitfall": "Oublier les testeurs, ou les crédits exigés par la licence d'une illustration ou d'un système de jeu." } + }, + "npc": { + "role": { + "title": "Rôle dans l'histoire", + "purpose": "Savoir quelle place tient un PNJ dit combien de préparation il mérite : un opposant ou un allié pèse sur l'intrigue, un figurant n'a besoin que d'un détail.", + "questions": [ + "Ce PNJ aide-t-il les personnages, s'y oppose-t-il, ou détient-il quelque chose dont ils ont besoin ?", + "Agit-il de lui-même, ou est-il l'enjeu que d'autres se disputent ?" + ], + "example": "Borin le forgeron est une ressource : il sait qui a commandé les clés de la crypte, mais ne le dira qu'à quelqu'un qui l'aide.", + "pitfall": "Des alliés qui font tout à la place des joueurs. Un allié a des limites : ce qu'il ne peut pas ou ne veut pas faire." + }, + "motivation": { + "title": "Motivation", + "purpose": "Ce que le PNJ veut décide de tout ce qu'il fait. Avec une motivation claire, le MJ sait comment il réagit à n'importe quelle action des joueurs.", + "questions": [ + "Que veut-il, maintenant ?", + "Que craint-il de perdre ?", + "Jusqu'où est-il prêt à aller ?" + ], + "example": "Ysolde veut le trône pour elle-même, mais elle craint plus que tout le scandale : elle préfère acheter que tuer.", + "pitfall": "Un méchant méchant « parce que » : les joueurs ne peuvent ni le comprendre, ni le manipuler, ni le convaincre." + }, + "knowledge": { + "title": "Ce qu'il sait", + "purpose": "La liste de ce que le PNJ peut révéler évite d'improviser des réponses contradictoires et relie le PNJ aux indices de l'aventure.", + "questions": [ + "Quelles informations utiles détient-il ?", + "À quelle condition les donnera-t-il (confiance, argent, menace) ?", + "Que croit-il savoir à tort ?" + ], + "example": "Il a vu le notaire sortir de la chambre à minuit. Il le dira contre la promesse d'un passage sûr hors de la ville.", + "pitfall": "Un PNJ qui sait tout et le dit au premier venu : l'enquête se résout en une conversation." + }, + "mannerism": { + "title": "Signe distinctif", + "purpose": "Un détail à jouer à la table rend un PNJ mémorable en quelques secondes, et aide les joueurs à reconnaître qui parle.", + "questions": [ + "Quel geste, quelle manie le trahit ?", + "Comment parle-t-il : vite, lentement, avec un mot fétiche ?" + ], + "example": "Tapote sa bague chaque fois qu'elle ment, et termine ses phrases par « n'est-ce pas ? ».", + "pitfall": "Une longue description physique que personne ne retient : un seul détail fort vaut mieux qu'un portrait complet." + } } } }, @@ -2233,6 +2352,16 @@ "observation": "Les {{count}} chemins qui mènent à « {{entity}} » partent tous de scènes « {{kind}} ».", "why": "Si toute l'information passe par le même genre de scène (que des interrogatoires, que des fouilles), une table qui n'aime pas ce genre ou y échoue manquera tous les indices à la fois.", "question": "Un indice pourrait-il venir d'un autre genre de scène : un lieu à fouiller, un document, un événement ?" + }, + "WRITE-016-NPC-NO-MOTIVATION": { + "observation": "« {{entity}} » pèse sur l'intrigue, mais sa motivation n'est pas écrite.", + "why": "Un opposant ou un allié qui ne veut rien de précis est difficile à jouer : le MJ ne sait pas comment il réagit quand les joueurs bousculent ses plans.", + "question": "Que veut ce PNJ, et que craint-il de perdre ?" + }, + "WRITE-017-SINGLE-HOOK": { + "observation": "« {{entity}} » n'a qu'une seule accroche.", + "why": "Si cette unique raison ne parle pas aux joueurs, l'aventure démarre à contrecœur. Plusieurs accroches de nature différente leur laissent choisir pourquoi s'en mêler.", + "question": "Quelle autre raison, personnelle ou intéressée, pourrait pousser les personnages à agir ?" } } }, diff --git a/web/src/assets/i18n/fragments/arcs.en.json b/web/src/assets/i18n/fragments/arcs.en.json index b6db065..64d16aa 100644 --- a/web/src/assets/i18n/fragments/arcs.en.json +++ b/web/src/assets/i18n/fragments/arcs.en.json @@ -55,7 +55,13 @@ "chatSuggestion3": "Suggest a two-act resolution", "deleteTitle": "Delete arc", "deleteMessage": "Delete the arc \"{{name}}\"?", - "irreversible": "This action is irreversible." + "irreversible": "This action is irreversible.", + "truthHooksSectionTitle": "Hidden truth and hooks", + "hiddenTruthLabel": "Hidden truth (GM only)", + "hiddenTruthPlaceholder": "What really happened, which the players will uncover bit by bit", + "hooksLabel": "Hooks", + "hooksPlaceholder": "- A friend of the characters goes missing\n- A reward is offered for…", + "hooksHint": "One hook per line. Aim for at least two, of different kinds." }, "arcView": { "subtitleHub": "Hub arc (non-linear quests)", @@ -87,6 +93,8 @@ "deleteCascade": "This action will also delete: {{parts}}.", "irreversible": "This action is irreversible.", "deleteConfirmTitle": "Delete arc", - "deleteConfirmMessage": "Delete the arc \"{{name}}\"?" + "deleteConfirmMessage": "Delete the arc \"{{name}}\"?", + "hooksTitle": "Hooks", + "hiddenTruthTitle": "Hidden truth" } } diff --git a/web/src/assets/i18n/fragments/arcs.fr.json b/web/src/assets/i18n/fragments/arcs.fr.json index dbdcf7b..9cb867d 100644 --- a/web/src/assets/i18n/fragments/arcs.fr.json +++ b/web/src/assets/i18n/fragments/arcs.fr.json @@ -55,7 +55,13 @@ "chatSuggestion3": "Suggère un dénouement en deux actes", "deleteTitle": "Supprimer l'arc", "deleteMessage": "Supprimer l'arc \"{{name}}\" ?", - "irreversible": "Cette action est irréversible." + "irreversible": "Cette action est irréversible.", + "truthHooksSectionTitle": "Histoire cachée et accroches", + "hiddenTruthLabel": "Histoire cachée (réservée au MJ)", + "hiddenTruthPlaceholder": "Ce qui s'est vraiment passé, que les joueurs découvriront peu à peu", + "hooksLabel": "Accroches", + "hooksPlaceholder": "- Un ami des personnages disparaît\n- Une récompense est offerte pour…", + "hooksHint": "Une accroche par ligne. Visez-en au moins deux, de nature différente." }, "arcView": { "subtitleHub": "Arc en hub (quêtes non linéaires)", @@ -87,6 +93,8 @@ "deleteCascade": "Cette action supprimera aussi : {{parts}}.", "irreversible": "Cette action est irréversible.", "deleteConfirmTitle": "Supprimer l'arc", - "deleteConfirmMessage": "Supprimer l'arc \"{{name}}\" ?" + "deleteConfirmMessage": "Supprimer l'arc \"{{name}}\" ?", + "hooksTitle": "Accroches", + "hiddenTruthTitle": "Histoire cachée" } } diff --git a/web/src/assets/i18n/fragments/chars-npcs-enemies.en.json b/web/src/assets/i18n/fragments/chars-npcs-enemies.en.json index 2d144a9..2e2bcb8 100644 --- a/web/src/assets/i18n/fragments/chars-npcs-enemies.en.json +++ b/web/src/assets/i18n/fragments/chars-npcs-enemies.en.json @@ -44,7 +44,23 @@ "chatSuggestion3": "Imagine 3 signature lines that characterize them", "deleteTitle": "Delete this sheet?", "deleteMessage": "Delete the sheet for \"{{name}}\"?", - "irreversible": "This action is irreversible." + "irreversible": "This action is irreversible.", + "storyTitle": "Role in the story", + "storyHint": "Independent of the game system: what makes this NPC playable and useful to the story.", + "roleLabel": "Role", + "roleNone": "Not set", + "role": { + "OPPONENT": "Opponent", + "ALLY": "Ally", + "RESOURCE": "Resource (informant, service)", + "EXTRA": "Extra" + }, + "motivationLabel": "Motivation", + "motivationPlaceholder": "What they want, and what they're willing to do to get it", + "knowledgeLabel": "What they know (GM only)", + "knowledgePlaceholder": "The information they can reveal, and on what condition", + "mannerismLabel": "Distinctive trait", + "mannerismPlaceholder": "A gesture, a way of speaking, a tic to play at the table" }, "npcList": { "create": "New NPC", @@ -59,7 +75,8 @@ "npcView": { "aiAssistant": "AI Assistant", "relatedPages": "Linked Lore pages", - "deletedPage": "(deleted page)" + "deletedPage": "(deleted page)", + "storyTitle": "Role in the story" }, "enemyEdit": { "backToEnemies": "Back to enemies", diff --git a/web/src/assets/i18n/fragments/chars-npcs-enemies.fr.json b/web/src/assets/i18n/fragments/chars-npcs-enemies.fr.json index 10079bd..5db58a5 100644 --- a/web/src/assets/i18n/fragments/chars-npcs-enemies.fr.json +++ b/web/src/assets/i18n/fragments/chars-npcs-enemies.fr.json @@ -44,7 +44,23 @@ "chatSuggestion3": "Imagine 3 répliques signatures qui le caractérisent", "deleteTitle": "Supprimer la fiche ?", "deleteMessage": "Supprimer la fiche de \"{{name}}\" ?", - "irreversible": "Cette action est irréversible." + "irreversible": "Cette action est irréversible.", + "storyTitle": "Rôle dans l'histoire", + "storyHint": "Indépendant du système de jeu : ce qui rend ce PNJ jouable et utile au récit.", + "roleLabel": "Rôle", + "roleNone": "Non précisé", + "role": { + "OPPONENT": "Opposant", + "ALLY": "Allié", + "RESOURCE": "Ressource (informateur, service)", + "EXTRA": "Figurant" + }, + "motivationLabel": "Motivation", + "motivationPlaceholder": "Ce qu'il veut, et ce qu'il est prêt à faire pour l'obtenir", + "knowledgeLabel": "Ce qu'il sait (réservé au MJ)", + "knowledgePlaceholder": "Les informations qu'il peut révéler, et à quelle condition", + "mannerismLabel": "Signe distinctif", + "mannerismPlaceholder": "Un geste, une façon de parler, un tic à jouer à la table" }, "npcList": { "create": "Nouveau PNJ", @@ -59,7 +75,8 @@ "npcView": { "aiAssistant": "Assistant IA", "relatedPages": "Pages de Lore liées", - "deletedPage": "(page supprimée)" + "deletedPage": "(page supprimée)", + "storyTitle": "Rôle dans l'histoire" }, "enemyEdit": { "backToEnemies": "Retour aux ennemis", diff --git a/web/src/assets/i18n/fragments/scenes.en.json b/web/src/assets/i18n/fragments/scenes.en.json index d0df0e4..6e0ffd9 100644 --- a/web/src/assets/i18n/fragments/scenes.en.json +++ b/web/src/assets/i18n/fragments/scenes.en.json @@ -91,7 +91,11 @@ "deleteMessage": "Delete the scene \"{{name}}\"?", "deleteIrreversible": "This action is irreversible.", "saveError": "Error while saving", - "deleteError": "Error while deleting" + "deleteError": "Error while deleting", + "purposeLabel": "Purpose of the scene", + "purposePlaceholder": "If it were cut, what would the story lose? (information, a choice, an emotion…)", + "tacticsLabel": "Enemy tactics and morale", + "tacticsPlaceholder": "How they fight, and when they flee, surrender or negotiate" }, "sceneView": { "subtitle": "Scene", @@ -121,7 +125,9 @@ "deleteTitle": "Delete scene", "deleteMessage": "Delete the scene \"{{name}}\"?", "deleteIrreversible": "This action is irreversible.", - "deleteError": "Error while deleting the scene" + "deleteError": "Error while deleting the scene", + "purposeSectionTitle": "Purpose", + "tacticsSectionTitle": "Tactics and morale" }, "sceneType": { "GENERIC": "Generic scene", diff --git a/web/src/assets/i18n/fragments/scenes.fr.json b/web/src/assets/i18n/fragments/scenes.fr.json index a5bab6e..71c8ffa 100644 --- a/web/src/assets/i18n/fragments/scenes.fr.json +++ b/web/src/assets/i18n/fragments/scenes.fr.json @@ -91,7 +91,11 @@ "deleteMessage": "Supprimer la scène \"{{name}}\" ?", "deleteIrreversible": "Cette action est irréversible.", "saveError": "Erreur lors de la sauvegarde", - "deleteError": "Erreur lors de la suppression" + "deleteError": "Erreur lors de la suppression", + "purposeLabel": "Utilité de la scène", + "purposePlaceholder": "Si on la coupe, qu'est-ce que l'histoire perd ? (une info, un choix, une émotion…)", + "tacticsLabel": "Tactique et moral des adversaires", + "tacticsPlaceholder": "Comment ils se battent, et quand ils fuient, se rendent ou négocient" }, "sceneView": { "subtitle": "Scène", @@ -121,7 +125,9 @@ "deleteTitle": "Supprimer la scène", "deleteMessage": "Supprimer la scène \"{{name}}\" ?", "deleteIrreversible": "Cette action est irréversible.", - "deleteError": "Erreur lors de la suppression de la scène" + "deleteError": "Erreur lors de la suppression de la scène", + "purposeSectionTitle": "Utilité", + "tacticsSectionTitle": "Tactique et moral" }, "sceneType": { "GENERIC": "Scène générique", diff --git a/web/src/assets/i18n/fragments/writing-coach.en.json b/web/src/assets/i18n/fragments/writing-coach.en.json index ee97b78..7fb8bb0 100644 --- a/web/src/assets/i18n/fragments/writing-coach.en.json +++ b/web/src/assets/i18n/fragments/writing-coach.en.json @@ -107,6 +107,28 @@ ], "example": "Three smugglers aren't trying to kill anyone: they want to sink the boat holding the evidence. If they succeed, the fight is lost, even with every PC still standing.", "pitfall": "The \"bag of hit points\" fight: with no goal other than taking the enemy down, it quickly becomes repetitive. Give each side a purpose." + }, + "purpose": { + "title": "Purpose of the scene", + "purpose": "Every scene should bring something to the story. Knowing what you'd lose by cutting it helps decide what to keep, what to shorten, and what to improvise.", + "questions": [ + "What do the players learn here that they won't learn anywhere else?", + "What decision do they make, or what emotion do they feel?", + "If time runs short, can it be summed up in two sentences?" + ], + "example": "Without the inn, the players never meet Maëlis: they lose their only ally and the first lead to the tower.", + "pitfall": "A scene that only exists to look nice or fill a session: players feel it, and the pacing collapses." + }, + "tactics": { + "title": "Enemy tactics and morale", + "purpose": "Enemies who want to survive make a fight come alive: they use the terrain, protect their leader and know when to run. The GM then knows how to play them without improvising at random.", + "questions": [ + "How does the terrain favour them?", + "What makes them flee, surrender or negotiate?", + "Who do they protect, and what do they do if their leader falls?" + ], + "example": "The smugglers shoot from the boats and cut the moorings if approached. If the sergeant falls, they drop their weapons and offer to talk.", + "pitfall": "Enemies who all fight to the death: the fight becomes plain hit point subtraction, with no choices for the players." } }, "chapter": { @@ -197,6 +219,28 @@ ], "example": "The guild is publicly exposed; or the PCs buy it out themselves; or the villages are lost and the next arc opens with the exodus.", "pitfall": "A single ending written in advance: the players' choices no longer matter. Prepare outcomes, not a script." + }, + "hiddenTruth": { + "title": "Hidden truth", + "purpose": "The truth the players will piece together. Everything else follows from it: every clue, every revelation is a trace it left behind.", + "questions": [ + "What really happened, and who is responsible?", + "What traces did it leave, and where?", + "Can the players fully understand it by the end?" + ], + "example": "The regent poisoned the old king to rule in the prince's place. The court physician knows and keeps quiet out of fear.", + "pitfall": "A truth too complicated to discover in play. If a player can't sum it up in one sentence at the end, simplify it." + }, + "hooks": { + "title": "Hooks", + "purpose": "The reasons that push the characters to get involved. Several hooks of different kinds let players choose their motivation instead of having it imposed.", + "questions": [ + "Which one plays on interest (reward, contract)?", + "Which one affects a character personally?", + "Which one falls on them without them looking for it?" + ], + "example": "- The council offers a reward to find the prince.\n- A character's sister worked at the palace and has vanished.\n- The regent's guards come to arrest the characters for no reason.", + "pitfall": "A single hook, presented as an obligation: if it doesn't speak to the table, the adventure starts reluctantly." } }, "publication": { @@ -255,6 +299,50 @@ "example": "Writing: Camille Martin\nMaps: Léo Dubois\nEditing: Alex\nPlaytesters: the Thursday table (Inès, Yanis, Paul, Mira)", "pitfall": "Forgetting the playtesters, or the credits required by an artwork's or a game system's licence." } + }, + "npc": { + "role": { + "title": "Role in the story", + "purpose": "Knowing what place an NPC holds tells you how much preparation they deserve: an opponent or an ally weighs on the plot, an extra only needs one detail.", + "questions": [ + "Does this NPC help the characters, oppose them, or hold something they need?", + "Do they act on their own, or are they the prize others fight over?" + ], + "example": "Borin the blacksmith is a resource: he knows who ordered the crypt keys, but will only tell someone who helps him.", + "pitfall": "Allies who do everything in the players' place. An ally has limits: what they can't or won't do." + }, + "motivation": { + "title": "Motivation", + "purpose": "What the NPC wants decides everything they do. With a clear motivation, the GM knows how they react to anything the players do.", + "questions": [ + "What do they want, right now?", + "What are they afraid to lose?", + "How far are they willing to go?" + ], + "example": "Ysolde wants the throne for herself, but fears scandal above all: she'd rather bribe than kill.", + "pitfall": "A villain who is evil \"just because\": players can neither understand, manipulate nor convince them." + }, + "knowledge": { + "title": "What they know", + "purpose": "Listing what the NPC can reveal avoids improvising contradictory answers and ties the NPC to the adventure's clues.", + "questions": [ + "What useful information do they hold?", + "On what condition will they share it (trust, money, threat)?", + "What do they wrongly believe they know?" + ], + "example": "He saw the notary leave the room at midnight. He'll say so in exchange for safe passage out of town.", + "pitfall": "An NPC who knows everything and tells the first person who asks: the investigation is solved in one conversation." + }, + "mannerism": { + "title": "Distinctive trait", + "purpose": "One detail to play at the table makes an NPC memorable in seconds, and helps players recognise who is speaking.", + "questions": [ + "What gesture or habit gives them away?", + "How do they speak: fast, slowly, with a pet word?" + ], + "example": "Taps her ring every time she lies, and ends her sentences with \"don't you agree?\".", + "pitfall": "A long physical description nobody remembers: one strong detail beats a full portrait." + } } } } diff --git a/web/src/assets/i18n/fragments/writing-coach.fr.json b/web/src/assets/i18n/fragments/writing-coach.fr.json index 645a498..7ffd75a 100644 --- a/web/src/assets/i18n/fragments/writing-coach.fr.json +++ b/web/src/assets/i18n/fragments/writing-coach.fr.json @@ -107,6 +107,28 @@ ], "example": "Trois contrebandiers ne cherchent pas à tuer : ils veulent couler la barque qui contient les preuves. S'ils y parviennent, le combat est perdu, même si tous les PJ sont debout.", "pitfall": "Le combat « sac de points de vie » : sans autre objectif que d'abattre l'adversaire, il devient vite répétitif. Donne un but à chaque camp." + }, + "purpose": { + "title": "Utilité de la scène", + "purpose": "Chaque scène doit apporter quelque chose à l'histoire. Savoir ce qu'on perdrait en la coupant aide à décider ce qu'on garde, ce qu'on raccourcit, et ce qu'on improvise.", + "questions": [ + "Qu'apprennent les joueurs ici qu'ils n'apprendront nulle part ailleurs ?", + "Quelle décision prennent-ils, ou quelle émotion vivent-ils ?", + "Si le temps manque en séance, peut-on la résumer en deux phrases ?" + ], + "example": "Sans l'auberge, les joueurs ne rencontrent jamais Maëlis : ils perdent leur seule alliée et la première piste vers la tour.", + "pitfall": "Une scène qui n'existe que pour « faire joli » ou pour remplir une séance : les joueurs le sentent, et le rythme s'effondre." + }, + "tactics": { + "title": "Tactique et moral des adversaires", + "purpose": "Des adversaires qui veulent survivre rendent un combat vivant : ils utilisent le terrain, protègent leur chef et savent quand fuir. Le MJ sait alors comment les jouer sans improviser au hasard.", + "questions": [ + "Comment le terrain les avantage-t-il ?", + "Qu'est-ce qui les fait fuir, se rendre ou négocier ?", + "Qui protègent-ils, et que font-ils si leur chef tombe ?" + ], + "example": "Les contrebandiers tirent depuis les barques et coupent les amarres si on les approche. Si le sergent tombe, ils jettent leurs armes et proposent de parler.", + "pitfall": "Des ennemis qui se battent tous jusqu'à la mort : le combat devient une simple soustraction de points de vie, sans choix pour les joueurs." } }, "chapter": { @@ -197,6 +219,28 @@ ], "example": "La guilde est démasquée publiquement ; ou bien elle est rachetée par les PJ eux-mêmes ; ou bien les villages sont perdus et l'arc suivant commence par l'exode.", "pitfall": "Une seule fin écrite d'avance : les choix des joueurs ne comptent plus. Prépare des issues, pas un scénario." + }, + "hiddenTruth": { + "title": "Histoire cachée", + "purpose": "La vérité que les joueurs vont reconstituer. Tout le reste en découle : chaque indice, chaque révélation est une trace qu'elle a laissée.", + "questions": [ + "Qu'est-ce qui s'est vraiment passé, et qui en est responsable ?", + "Quelles traces cela a-t-il laissées, et où ?", + "Les joueurs peuvent-ils la comprendre entièrement à la fin ?" + ], + "example": "Le régent a empoisonné le vieux roi pour gouverner à la place du prince. Le médecin de la cour le sait et se tait par peur.", + "pitfall": "Une vérité trop compliquée pour être découverte en jeu. Si un joueur ne peut pas la résumer en une phrase à la fin, simplifiez-la." + }, + "hooks": { + "title": "Accroches", + "purpose": "Les raisons qui poussent les personnages à se lancer. Plusieurs accroches de nature différente laissent les joueurs choisir leur motivation au lieu de la subir.", + "questions": [ + "Laquelle joue sur l'intérêt (récompense, contrat) ?", + "Laquelle touche un personnage personnellement ?", + "Laquelle tombe sur eux sans qu'ils la cherchent ?" + ], + "example": "- Le conseil offre une récompense pour retrouver le prince.\n- La sœur d'un personnage travaillait au palais et a disparu.\n- Des gardes du régent viennent arrêter les personnages sans raison.", + "pitfall": "Une seule accroche, présentée comme une obligation : si elle ne parle pas à la table, l'aventure démarre à contrecœur." } }, "publication": { @@ -255,6 +299,50 @@ "example": "Écriture : Camille Martin\nCartes : Léo Dubois\nRelecture : Alex\nTesteurs : la table du jeudi (Inès, Yanis, Paul, Mira)", "pitfall": "Oublier les testeurs, ou les crédits exigés par la licence d'une illustration ou d'un système de jeu." } + }, + "npc": { + "role": { + "title": "Rôle dans l'histoire", + "purpose": "Savoir quelle place tient un PNJ dit combien de préparation il mérite : un opposant ou un allié pèse sur l'intrigue, un figurant n'a besoin que d'un détail.", + "questions": [ + "Ce PNJ aide-t-il les personnages, s'y oppose-t-il, ou détient-il quelque chose dont ils ont besoin ?", + "Agit-il de lui-même, ou est-il l'enjeu que d'autres se disputent ?" + ], + "example": "Borin le forgeron est une ressource : il sait qui a commandé les clés de la crypte, mais ne le dira qu'à quelqu'un qui l'aide.", + "pitfall": "Des alliés qui font tout à la place des joueurs. Un allié a des limites : ce qu'il ne peut pas ou ne veut pas faire." + }, + "motivation": { + "title": "Motivation", + "purpose": "Ce que le PNJ veut décide de tout ce qu'il fait. Avec une motivation claire, le MJ sait comment il réagit à n'importe quelle action des joueurs.", + "questions": [ + "Que veut-il, maintenant ?", + "Que craint-il de perdre ?", + "Jusqu'où est-il prêt à aller ?" + ], + "example": "Ysolde veut le trône pour elle-même, mais elle craint plus que tout le scandale : elle préfère acheter que tuer.", + "pitfall": "Un méchant méchant « parce que » : les joueurs ne peuvent ni le comprendre, ni le manipuler, ni le convaincre." + }, + "knowledge": { + "title": "Ce qu'il sait", + "purpose": "La liste de ce que le PNJ peut révéler évite d'improviser des réponses contradictoires et relie le PNJ aux indices de l'aventure.", + "questions": [ + "Quelles informations utiles détient-il ?", + "À quelle condition les donnera-t-il (confiance, argent, menace) ?", + "Que croit-il savoir à tort ?" + ], + "example": "Il a vu le notaire sortir de la chambre à minuit. Il le dira contre la promesse d'un passage sûr hors de la ville.", + "pitfall": "Un PNJ qui sait tout et le dit au premier venu : l'enquête se résout en une conversation." + }, + "mannerism": { + "title": "Signe distinctif", + "purpose": "Un détail à jouer à la table rend un PNJ mémorable en quelques secondes, et aide les joueurs à reconnaître qui parle.", + "questions": [ + "Quel geste, quelle manie le trahit ?", + "Comment parle-t-il : vite, lentement, avec un mot fétiche ?" + ], + "example": "Tapote sa bague chaque fois qu'elle ment, et termine ses phrases par « n'est-ce pas ? ».", + "pitfall": "Une longue description physique que personne ne retient : un seul détail fort vaut mieux qu'un portrait complet." + } } } } diff --git a/web/src/assets/i18n/fragments/writing-review.en.json b/web/src/assets/i18n/fragments/writing-review.en.json index 7d66648..23615ca 100644 --- a/web/src/assets/i18n/fragments/writing-review.en.json +++ b/web/src/assets/i18n/fragments/writing-review.en.json @@ -89,6 +89,16 @@ "observation": "The {{count}} paths leading to \"{{entity}}\" all start from \"{{kind}}\" scenes.", "why": "If all the information goes through one kind of scene (only interrogations, only searches), a table that dislikes it or fails at it will miss every clue at once.", "question": "Could a clue come from another kind of scene: a place to search, a document, an event?" + }, + "WRITE-016-NPC-NO-MOTIVATION": { + "observation": "\"{{entity}}\" weighs on the plot, but their motivation isn't written.", + "why": "An opponent or ally who wants nothing specific is hard to play: the GM doesn't know how they react when the players upset their plans.", + "question": "What does this NPC want, and what are they afraid to lose?" + }, + "WRITE-017-SINGLE-HOOK": { + "observation": "\"{{entity}}\" has only one hook.", + "why": "If that single reason doesn't speak to the players, the adventure starts reluctantly. Several hooks of different kinds let them choose why to get involved.", + "question": "What other reason, personal or self-interested, could push the characters to act?" } } } diff --git a/web/src/assets/i18n/fragments/writing-review.fr.json b/web/src/assets/i18n/fragments/writing-review.fr.json index 90fa478..2f01774 100644 --- a/web/src/assets/i18n/fragments/writing-review.fr.json +++ b/web/src/assets/i18n/fragments/writing-review.fr.json @@ -89,6 +89,16 @@ "observation": "Les {{count}} chemins qui mènent à « {{entity}} » partent tous de scènes « {{kind}} ».", "why": "Si toute l'information passe par le même genre de scène (que des interrogatoires, que des fouilles), une table qui n'aime pas ce genre ou y échoue manquera tous les indices à la fois.", "question": "Un indice pourrait-il venir d'un autre genre de scène : un lieu à fouiller, un document, un événement ?" + }, + "WRITE-016-NPC-NO-MOTIVATION": { + "observation": "« {{entity}} » pèse sur l'intrigue, mais sa motivation n'est pas écrite.", + "why": "Un opposant ou un allié qui ne veut rien de précis est difficile à jouer : le MJ ne sait pas comment il réagit quand les joueurs bousculent ses plans.", + "question": "Que veut ce PNJ, et que craint-il de perdre ?" + }, + "WRITE-017-SINGLE-HOOK": { + "observation": "« {{entity}} » n'a qu'une seule accroche.", + "why": "Si cette unique raison ne parle pas aux joueurs, l'aventure démarre à contrecœur. Plusieurs accroches de nature différente leur laissent choisir pourquoi s'en mêler.", + "question": "Quelle autre raison, personnelle ou intéressée, pourrait pousser les personnages à agir ?" } } }