diff --git a/Semesterprojekt/src/main/java/thb/jeanluc/adventure/game/Game.java b/Semesterprojekt/src/main/java/thb/jeanluc/adventure/game/Game.java index 3ef935b..e6e4e42 100644 --- a/Semesterprojekt/src/main/java/thb/jeanluc/adventure/game/Game.java +++ b/Semesterprojekt/src/main/java/thb/jeanluc/adventure/game/Game.java @@ -7,7 +7,6 @@ import thb.jeanluc.adventure.command.CommandRegistry; import thb.jeanluc.adventure.command.ParsedCommand; import thb.jeanluc.adventure.io.text.Hud; import thb.jeanluc.adventure.io.text.MapView; -import thb.jeanluc.adventure.map.MapLayout; import thb.jeanluc.adventure.model.Ending; import java.util.Optional; @@ -35,7 +34,11 @@ public class Game { /** Optional onboarding guide; null in normal/loaded play. */ private TutorialGuide tutorialGuide; - /** Wires the interactive tutorial (New Game only). */ + /** + * Wires the interactive tutorial (New Game only). + * + * @param tutorialGuide the guide to run alongside the loop + */ public void setTutorialGuide(TutorialGuide tutorialGuide) { this.tutorialGuide = tutorialGuide; } @@ -96,9 +99,15 @@ public class Game { } } + /** + * Ticks the per-turn engines and republishes the whole view state — HUD, + * map, quest panel, and room music — to the IO channel. + */ private void publishHud() { - QuestEngine.tick(ctx); + // EscortEngine first: it sets flags (e.g. twins_reunited) that + // QuestEngine's stage-completion conditions read in the same turn. EscortEngine.tick(ctx); + QuestEngine.tick(ctx); ctx.getIo().setHud(new Hud( ctx.getPlayer().getCurrentRoom().getName(), ctx.getPlayer().getGold(), diff --git a/Semesterprojekt/src/main/resources/world/combinations.yaml b/Semesterprojekt/src/main/resources/world/combinations.yaml index 67ac8ee..4b6f244 100644 --- a/Semesterprojekt/src/main/resources/world/combinations.yaml +++ b/Semesterprojekt/src/main/resources/world/combinations.yaml @@ -13,8 +13,12 @@ - a: valve_wheel b: valve produce: fuse + requires: + - { notFlag: cellar_drained } effects: - { setFlag: cellar_drained } + failText: | + The cellar is already drained; the valve turns freely on nothing. response: | You fit the wheel and crank it hard. The valve groans, the black water drops away — and a ceramic fuse, washed loose, settles at your feet.