Compare commits

..
Author SHA1 Message Date
goose c235dab643 chore: untrack SDD validation report 2026-10-08 23:27:34 -04:00
goose f9934530e1 chore: relocate responsive validation report 2026-10-08 23:14:46 -04:00
goose c779c796ec fix: harden responsive HUD validation 2026-10-08 23:13:51 -04:00
goose f6e93159c0 chore: keep Task 5 report in SDD workspace 2026-10-08 22:35:23 -04:00
goose 23acd47495 test: add reproducible 720p visual capture 2026-10-08 22:33:52 -04:00
goose cf102e1e95 chore: relocate Task 5 validation report 2026-10-08 21:46:36 -04:00
goose 122fdac97c fix: complete Task 5 visual HUD validation 2026-10-08 21:45:46 -04:00
goose 9921e02de3 feat: integrate minimap into dark fantasy HUD rail 2026-10-08 20:47:14 -04:00
goose 27edac9a2f chore: remove unrelated report change 2026-10-08 20:31:38 -04:00
goose 80ecc836c2 test: align HUD location contract with authored rooms 2026-10-08 20:30:36 -04:00
goose e6025317e1 feat: rebuild dark fantasy game HUD 2026-10-08 20:20:26 -04:00
goose 59e922ce29 test: tighten HUD layout contracts 2026-10-08 19:46:53 -04:00
goose 885781cf9c test: define dark fantasy HUD layout 2026-10-08 19:32:32 -04:00
goose a55f0fc452 feat: add dark fantasy UI kit 2026-10-08 19:13:24 -04:00
goose ebc35e8277 docs: plan dark fantasy interface refactor 2026-10-08 19:08:42 -04:00
goose eca098b4b9 feat: complete playtest parity improvements 2026-10-08 19:06:19 -04:00
goose cce25a1908 Merge pull request 'PR-4: Revalidate parity gate for release candidate' (#55) from slice/pr4-parity-rc into main 2026-10-05 05:18:14 -04:00
goose 744ba873bc chore: relocate PR-4 report 2026-10-05 05:05:42 -04:00
goose 4091501396 chore: finalize parity re-gate release evidence 2026-10-05 05:03:32 -04:00
goose be891712c1 Merge pull request 'PR-3: Add protected tourist encounters' (#54) from slice/pr3-tourists into main 2026-10-04 12:05:48 -04:00
goose 5ef08a6e33 feat: add protected tourist encounters 2026-10-04 11:48:20 -04:00
goose e8082b3ca6 Merge pull request 'PR-2: Add safe rooms and repeatable Bobka rations' (#53) from slice/pr2-safe-rooms-bobka into main 2026-10-04 11:24:20 -04:00
goose 9bd003102c feat: add safe rooms and repeatable Bobka rations 2026-10-04 11:08:19 -04:00
goose 34eb08f02a Merge pull request 'PR-1: Add final floor victory and deep generation scale' (#52) from slice/pr1-endgame-deep-floor into main 2026-10-04 10:38:16 -04:00
goose f65e9026c1 feat: add final floor victory and deep generation scale 2026-10-04 10:32:11 -04:00
goose 6ded0f76ce Merge remote-tracking branch 'origin/main' into integrate/parity-plan 2026-10-04 10:05:55 -04:00
goose 337c404912 docs: add parity recovery release plan 2026-10-04 10:05:00 -04:00
goose cc80c3e369 Merge pull request 'G5: Finalize desktop exports and player docs' (#51) from slice/g5-exports-docs into main 2026-10-04 01:49:59 -04:00
214 changed files with 6542 additions and 1289 deletions
+5 -1
View File
@@ -26,15 +26,19 @@ The Linux script creates `build/linux/DungeonCrawlerWorld.x86_64` and smoke-laun
```bash
./tests/scripts/test_export_scripts.sh
./tests/scripts/test_parity_recovery_gate.sh
./tests/scripts/test_parity_gauntlet.sh
GODOT_BIN=/snap/bin/godot4 ./scripts/verify.sh
GODOT_BIN=/snap/bin/godot4 ./scripts/run-parity-gauntlet.sh
```
The full verifier runs unit, integration, E2E, and visual-capture checks. The visual check needs an active display or `xvfb-run`; it distinctly reports unavailable visual infrastructure rather than a false pass. Test runners first import the project headlessly so a fresh checkout receives its required Godot cache.
The full verifier runs unit, integration, E2E, and visual-capture checks, then exits nonzero when the strict release parity gate finds a blocked, unowned, invalid, or unjustified contract. `run-parity-gauntlet.sh` additionally runs save/load plus generated-floor seed suites. See the [release checklist](docs/RELEASE_CHECKLIST.md), [release evidence](docs/release/RC-2026-10-04-evidence.md), and [ASCII parity matrix](docs/parity/ASCII_TEST_MATRIX.md) before tagging. The visual check needs an active display or `xvfb-run`; it distinctly reports unavailable visual infrastructure rather than a false pass. Test runners first import the project headlessly so a fresh checkout receives its required Godot cache.
## Project notes
- [Asset registry and CC0 license provenance](assets/ASSET_REGISTRY.md)
- [ASCII parity matrix](docs/parity/ASCII_TEST_MATRIX.md)
- [Release checklist and evidence](docs/RELEASE_CHECKLIST.md)
- [Player instructions](docs/PLAYING.md)
- [Content and modding](docs/CONTENT_AND_MODDING.md)
+25
View File
@@ -13,3 +13,28 @@ All binary art below is an unmodified 32×32 PNG copied from the local **Dungeon
| `assets/dcss/stairs.png` | `dungeon/gateways/stone_stairs_up.png` | Dungeon Crawl Stone Soup Full | CC0 1.0 | none |
| `assets/dcss/player.png` | `player/base/kobold_female_new.png` | Dungeon Crawl Stone Soup Full | CC0 1.0 | none |
| `assets/dcss/goblin.png` | `monster/goblin_new.png` | Dungeon Crawl Stone Soup Full | CC0 1.0 | none |
| `assets/dcss/war_dog.png` | `monster/animals/war_dog.png` | Dungeon Crawl Stone Soup Full | CC0 1.0 | none |
| `assets/audio/dungeon_exploration.wav` | generated specifically for this project | Dungeon Crawler World project | original project asset | procedural synthesis, 2026-10-08 |
| `assets/audio/dungeon_combat.wav` | generated specifically for this project | Dungeon Crawler World project | original project asset | procedural synthesis, 2026-10-08 |
| `assets/audio/dungeon_danger.wav` | generated specifically for this project | Dungeon Crawler World project | original project asset | procedural synthesis, 2026-10-08 |
## Dark fantasy UI kit — Task 1
Reusable UI components copied from the local prototype kit documented by the portable pack identifier `DungeonCrawlerWorld_UI_Assets/README.md`. Only transparent reusable components were imported, plus the two explicitly requested captures (`portrait_roger.png`, `illustration_equipement.png`). Import presets keep UI textures uncompressed, without mipmaps, and do not scale/recolor them with editor settings for pixel-stable UI rendering.
| Imported path | Local source | Author / pack | License | Modification / intended use |
|---|---|---|---|---|
| `assets/ui/dark_fantasy/bouton_normal_180x48.png` | `DungeonCrawlerWorld_UI_Assets/composants_transparents/bouton_normal_180x48.png` | DungeonCrawlerWorld prototype UI kit | project prototype asset | none; normal button state |
| `assets/ui/dark_fantasy/bouton_survol_180x48.png` | `DungeonCrawlerWorld_UI_Assets/composants_transparents/bouton_survol_180x48.png` | DungeonCrawlerWorld prototype UI kit | project prototype asset | none; hover/focus/pressed button state |
| `assets/ui/dark_fantasy/case_inventaire_72x72.png` | `DungeonCrawlerWorld_UI_Assets/composants_transparents/case_inventaire_72x72.png` | DungeonCrawlerWorld prototype UI kit | project prototype asset | none; inventory slot frame |
| `assets/ui/dark_fantasy/header_800x54.png` | `DungeonCrawlerWorld_UI_Assets/composants_transparents/header_800x54.png` | DungeonCrawlerWorld prototype UI kit | project prototype asset | none; ornamental header bar |
| `assets/ui/dark_fantasy/jauge_focus_pleine.png` | `DungeonCrawlerWorld_UI_Assets/composants_transparents/jauge_focus_pleine.png` | DungeonCrawlerWorld prototype UI kit | project prototype asset | none; full focus gauge texture for TextureProgressBar |
| `assets/ui/dark_fantasy/jauge_vie_pleine.png` | `DungeonCrawlerWorld_UI_Assets/composants_transparents/jauge_vie_pleine.png` | DungeonCrawlerWorld prototype UI kit | project prototype asset | none; full health gauge texture for TextureProgressBar |
| `assets/ui/dark_fantasy/jauge_xp_pleine.png` | `DungeonCrawlerWorld_UI_Assets/composants_transparents/jauge_xp_pleine.png` | DungeonCrawlerWorld prototype UI kit | project prototype asset | none; full XP gauge texture for TextureProgressBar |
| `assets/ui/dark_fantasy/panel_320x200.png` | `DungeonCrawlerWorld_UI_Assets/composants_transparents/panel_320x200.png` | DungeonCrawlerWorld prototype UI kit | project prototype asset | none; fixed-size charcoal/gold panel |
| `assets/ui/dark_fantasy/panel_440x270.png` | `DungeonCrawlerWorld_UI_Assets/composants_transparents/panel_440x270.png` | DungeonCrawlerWorld prototype UI kit | project prototype asset | none; fixed-size charcoal/gold panel |
| `assets/ui/dark_fantasy/panel_64x64_nine_patch_source.png` | `DungeonCrawlerWorld_UI_Assets/composants_transparents/panel_64x64_nine_patch_source.png` | DungeonCrawlerWorld prototype UI kit | project prototype asset | none; NinePatchRect/StyleBoxTexture source, 10 px margins |
| `assets/ui/dark_fantasy/touche_clavier_vide.png` | `DungeonCrawlerWorld_UI_Assets/composants_transparents/touche_clavier_vide.png` | DungeonCrawlerWorld prototype UI kit | project prototype asset | none; keyboard shortcut keycap |
| `assets/ui/dark_fantasy/portrait_roger.png` | `DungeonCrawlerWorld_UI_Assets/captures/portrait_roger.png` | DungeonCrawlerWorld prototype UI kit | project prototype asset | none; Roger portrait TextureRect |
| `assets/ui/dark_fantasy/illustration_equipement.png` | `DungeonCrawlerWorld_UI_Assets/captures/illustration_equipement.png` | DungeonCrawlerWorld prototype UI kit | project prototype asset | none; equipment illustration TextureRect |
| `assets/ui/dark_fantasy/dark_fantasy_theme.tres` | authored in project from imported UI kit colors/textures | Dungeon Crawler World project | original project asset | Godot Theme: parchment text, gold accents, charcoal panels, ornamental textured borders, focused/hover button states, 16–22 px readable defaults |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 676 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 392 B

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cow1oh3o0fbus"
path="res://.godot/imported/bouton_normal_180x48.png-d9711fa595a0c3013705906e1b96edfc.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/ui/dark_fantasy/bouton_normal_180x48.png"
dest_files=["res://.godot/imported/bouton_normal_180x48.png-d9711fa595a0c3013705906e1b96edfc.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file not shown.

After

Width:  |  Height:  |  Size: 394 B

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dnlfu6bkuvwp8"
path="res://.godot/imported/bouton_survol_180x48.png-941a16c6df0968e7cf184cf2a49ee3c5.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/ui/dark_fantasy/bouton_survol_180x48.png"
dest_files=["res://.godot/imported/bouton_survol_180x48.png-941a16c6df0968e7cf184cf2a49ee3c5.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file not shown.

After

Width:  |  Height:  |  Size: 407 B

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bu7xvj53seokx"
path="res://.godot/imported/case_inventaire_72x72.png-b4d759bb61ed8ed9e36f821cdf01969d.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/ui/dark_fantasy/case_inventaire_72x72.png"
dest_files=["res://.godot/imported/case_inventaire_72x72.png-b4d759bb61ed8ed9e36f821cdf01969d.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
@@ -0,0 +1,118 @@
[gd_resource type="Theme" load_steps=8 format=3]
[ext_resource type="Texture2D" path="res://assets/ui/dark_fantasy/panel_64x64_nine_patch_source.png" id="1_panel64"]
[ext_resource type="Texture2D" path="res://assets/ui/dark_fantasy/bouton_normal_180x48.png" id="2_btn_normal"]
[ext_resource type="Texture2D" path="res://assets/ui/dark_fantasy/bouton_survol_180x48.png" id="3_btn_hover"]
[ext_resource type="Texture2D" path="res://assets/ui/dark_fantasy/case_inventaire_72x72.png" id="4_inventory"]
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_panel"]
texture = ExtResource("1_panel64")
texture_margin_left = 10.0
texture_margin_top = 10.0
texture_margin_right = 10.0
texture_margin_bottom = 10.0
content_margin_left = 14.0
content_margin_top = 12.0
content_margin_right = 14.0
content_margin_bottom = 12.0
modulate_color = Color(0.95, 0.88, 0.68, 1)
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_button_normal"]
texture = ExtResource("2_btn_normal")
texture_margin_left = 14.0
texture_margin_top = 12.0
texture_margin_right = 14.0
texture_margin_bottom = 12.0
content_margin_left = 18.0
content_margin_top = 8.0
content_margin_right = 18.0
content_margin_bottom = 8.0
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_button_hover"]
texture = ExtResource("3_btn_hover")
texture_margin_left = 14.0
texture_margin_top = 12.0
texture_margin_right = 14.0
texture_margin_bottom = 12.0
content_margin_left = 18.0
content_margin_top = 8.0
content_margin_right = 18.0
content_margin_bottom = 8.0
modulate_color = Color(1.0, 0.88, 0.48, 1)
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_inventory_slot"]
texture = ExtResource("4_inventory")
texture_margin_left = 8.0
texture_margin_top = 8.0
texture_margin_right = 8.0
texture_margin_bottom = 8.0
content_margin_left = 8.0
content_margin_top = 8.0
content_margin_right = 8.0
content_margin_bottom = 8.0
[resource]
default_base_scale = 1.0
default_font_size = 18
Button/colors/font_color = Color(0.82, 0.72, 0.45, 1)
Button/colors/font_disabled_color = Color(0.36, 0.32, 0.25, 1)
Button/colors/font_focus_color = Color(1, 0.87, 0.42, 1)
Button/colors/font_hover_color = Color(1, 0.86, 0.36, 1)
Button/colors/font_hover_pressed_color = Color(0.95, 0.78, 0.28, 1)
Button/colors/font_outline_color = Color(0.05, 0.04, 0.03, 1)
Button/colors/font_pressed_color = Color(0.93, 0.76, 0.24, 1)
Button/constants/h_separation = 6
Button/constants/outline_size = 2
Button/font_sizes/font_size = 18
Button/styles/disabled = SubResource("StyleBoxTexture_button_normal")
Button/styles/focus = SubResource("StyleBoxTexture_button_hover")
Button/styles/hover = SubResource("StyleBoxTexture_button_hover")
Button/styles/normal = SubResource("StyleBoxTexture_button_normal")
Button/styles/pressed = SubResource("StyleBoxTexture_button_hover")
CheckButton/colors/font_color = Color(0.82, 0.72, 0.45, 1)
CheckButton/colors/font_hover_color = Color(1, 0.86, 0.36, 1)
CheckButton/font_sizes/font_size = 18
Label/colors/font_color = Color(0.86, 0.78, 0.58, 1)
Label/colors/font_outline_color = Color(0.04, 0.03, 0.025, 1)
Label/constants/line_spacing = 3
Label/constants/outline_size = 1
Label/font_sizes/font_size = 18
LineEdit/colors/caret_color = Color(0.95, 0.78, 0.28, 1)
LineEdit/colors/font_color = Color(0.86, 0.78, 0.58, 1)
LineEdit/colors/font_placeholder_color = Color(0.58, 0.49, 0.34, 1)
LineEdit/font_sizes/font_size = 18
LineEdit/styles/focus = SubResource("StyleBoxTexture_panel")
LineEdit/styles/normal = SubResource("StyleBoxTexture_panel")
MarginContainer/constants/margin_bottom = 12
MarginContainer/constants/margin_left = 14
MarginContainer/constants/margin_right = 14
MarginContainer/constants/margin_top = 12
NinePatchRect/colors/modulate_color = Color(1, 1, 1, 1)
Panel/styles/panel = SubResource("StyleBoxTexture_panel")
PanelContainer/styles/panel = SubResource("StyleBoxTexture_panel")
ProgressBar/colors/font_color = Color(0.86, 0.78, 0.58, 1)
ProgressBar/font_sizes/font_size = 16
ProgressBar/styles/background = SubResource("StyleBoxTexture_panel")
RichTextLabel/colors/default_color = Color(0.86, 0.78, 0.58, 1)
RichTextLabel/colors/font_outline_color = Color(0.04, 0.03, 0.025, 1)
RichTextLabel/constants/line_separation = 3
RichTextLabel/constants/outline_size = 1
RichTextLabel/font_sizes/bold_font_size = 18
RichTextLabel/font_sizes/bold_italics_font_size = 18
RichTextLabel/font_sizes/italics_font_size = 18
RichTextLabel/font_sizes/mono_font_size = 16
RichTextLabel/font_sizes/normal_font_size = 18
TabContainer/colors/font_selected_color = Color(1, 0.86, 0.36, 1)
TabContainer/colors/font_unselected_color = Color(0.82, 0.72, 0.45, 1)
TabContainer/font_sizes/font_size = 18
TextureButton/styles/focus = SubResource("StyleBoxTexture_button_hover")
Tree/colors/font_color = Color(0.86, 0.78, 0.58, 1)
Tree/colors/guide_color = Color(0.45, 0.36, 0.16, 1)
Tree/colors/relationship_line_color = Color(0.45, 0.36, 0.16, 1)
Tree/font_sizes/font_size = 18
Tree/styles/focus = SubResource("StyleBoxTexture_panel")
Tree/styles/panel = SubResource("StyleBoxTexture_panel")
VBoxContainer/constants/separation = 8
Window/colors/title_color = Color(1, 0.86, 0.36, 1)
Window/font_sizes/title_font_size = 22
Window/styles/embedded_border = SubResource("StyleBoxTexture_panel")
Binary file not shown.

After

Width:  |  Height:  |  Size: 570 B

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cn1ylkt1gdri3"
path="res://.godot/imported/header_800x54.png-8168d4b03d78332ce9be36d6efc70292.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/ui/dark_fantasy/header_800x54.png"
dest_files=["res://.godot/imported/header_800x54.png-8168d4b03d78332ce9be36d6efc70292.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file not shown.

After

Width:  |  Height:  |  Size: 135 KiB

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://c7xpnu2ug8a87"
path="res://.godot/imported/illustration_equipement.png-17faa12e99d3eb7822899599360d7b06.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/ui/dark_fantasy/illustration_equipement.png"
dest_files=["res://.godot/imported/illustration_equipement.png-17faa12e99d3eb7822899599360d7b06.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file not shown.

After

Width:  |  Height:  |  Size: 260 B

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://lihl4mwt6wbt"
path="res://.godot/imported/jauge_focus_pleine.png-64bf27c84c8e05cfa86bf7d4297e8997.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/ui/dark_fantasy/jauge_focus_pleine.png"
dest_files=["res://.godot/imported/jauge_focus_pleine.png-64bf27c84c8e05cfa86bf7d4297e8997.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file not shown.

After

Width:  |  Height:  |  Size: 256 B

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://c0t0ocoverbbr"
path="res://.godot/imported/jauge_vie_pleine.png-75bd04bf86b6c769a3e43d7f6534489d.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/ui/dark_fantasy/jauge_vie_pleine.png"
dest_files=["res://.godot/imported/jauge_vie_pleine.png-75bd04bf86b6c769a3e43d7f6534489d.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file not shown.

After

Width:  |  Height:  |  Size: 259 B

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dn58tylg6os7w"
path="res://.godot/imported/jauge_xp_pleine.png-45d8a1b9a97caa1a7551aef5f69de77e.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/ui/dark_fantasy/jauge_xp_pleine.png"
dest_files=["res://.godot/imported/jauge_xp_pleine.png-45d8a1b9a97caa1a7551aef5f69de77e.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file not shown.

After

Width:  |  Height:  |  Size: 948 B

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://nbehix2ncwl3"
path="res://.godot/imported/panel_320x200.png-745adcaa92ccb293fc90dc8ce6d3dbe5.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/ui/dark_fantasy/panel_320x200.png"
dest_files=["res://.godot/imported/panel_320x200.png-745adcaa92ccb293fc90dc8ce6d3dbe5.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://do1kj76r5rihi"
path="res://.godot/imported/panel_440x270.png-d711f8145df187c64091a8248e4dcbc1.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/ui/dark_fantasy/panel_440x270.png"
dest_files=["res://.godot/imported/panel_440x270.png-d711f8145df187c64091a8248e4dcbc1.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file not shown.

After

Width:  |  Height:  |  Size: 392 B

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cf2866mb1kemu"
path="res://.godot/imported/panel_64x64_nine_patch_source.png-7ff7dcd49b8e306dc38177a411da730c.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/ui/dark_fantasy/panel_64x64_nine_patch_source.png"
dest_files=["res://.godot/imported/panel_64x64_nine_patch_source.png-7ff7dcd49b8e306dc38177a411da730c.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b3t2nmqk1h6sy"
path="res://.godot/imported/portrait_roger.png-74551b7844d393bf5ec8920cc556e9c7.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/ui/dark_fantasy/portrait_roger.png"
dest_files=["res://.godot/imported/portrait_roger.png-74551b7844d393bf5ec8920cc556e9c7.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file not shown.

After

Width:  |  Height:  |  Size: 218 B

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://c6l1uyqyf1b3h"
path="res://.godot/imported/touche_clavier_vide.png-6931d919c221b025b4da175cc93a8397.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/ui/dark_fantasy/touche_clavier_vide.png"
dest_files=["res://.godot/imported/touche_clavier_vide.png-6931d919c221b025b4da175cc93a8397.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
+9 -7
View File
@@ -1,6 +1,6 @@
# Playing Dungeon Crawler World
Dungeon Crawler World is a desktop Godot prototype. It supports Linux x86_64 and Windows x86_64 exports. The reference display is 1280×720, but the window is resizable.
Dungeon Crawler World is a desktop Godot prototype. It supports Linux x86_64 and Windows x86_64 exports. The reference display is 1920×1080, but the window is resizable.
## Install or run
@@ -38,7 +38,7 @@ The Linux script exports `build/linux/DungeonCrawlerWorld.x86_64` and smoke-laun
Choose **NEW RUN** at the main menu, choose a character, then enter the dungeon. **CONTINUE** loads the most recently updated occupied slot; **LOAD SLOT** opens a specific slot.
The main menu exposes **CONTINUE** and **LOAD SLOT**. During an active run, the game API provides the five-slot Save/Load panel; builds that do not expose that command in the current UI should be treated as prototype builds and should not be represented as offering a player-facing manual-save shortcut. Saves are versioned JSON files below Godot's `user://saves` directory, named `slot1.json` through `slot5.json`. The exact native location is platform-dependent. To find it in a running build, open the Godot editor for the same project and use its user-data path, or inspect `ProjectSettings.globalize_path("user://")` from a debug tool. Copy the whole `saves` directory to back up a run; do not edit a save while the game is writing it.
La sauvegarde est **manuelle** : pendant une partie, appuyez sur **V** (fonctionne aussi dans le jeu lancé depuis l’éditeur Godot) ou sur **Ctrl+S** dans une version autonome, puis choisissez l’un des cinq emplacements. Un message confirme l’emplacement écrit. Il n’est pas nécessaire d’avoir un menu Échap et le ciblage ou l’ouverture du panneau de sauvegarde ne consomme aucun tour. Le menu principal expose **CONTINUE** et **LOAD SLOT** pour reprendre la sauvegarde la plus récente ou choisir un emplacement. Les sauvegardes sont des fichiers JSON versionnés dans `user://saves`, nommés `slot1.json` à `slot5.json`. Leur chemin natif dépend de la plateforme. Copiez le dossier `saves` complet pour sauvegarder vos parties hors jeu; ne modifiez pas un fichier pendant son écriture.
The game recognizes its current schema and can migrate the supported parts of the supplied ASCII save shape. Unsupported legacy keys are reported rather than silently claimed as preserved.
@@ -52,7 +52,9 @@ Press **F1** in a run for the current in-game control list. It is generated from
| Move north-west / north-east / south-west / south-east | **Q / keypad 9 / Z / C** |
| Interact, open doors/chests, use stairs | **Space** or **E** |
| Wait | **.** |
| Melee / ranged / cast | **F / R / X** |
| Attaque de mêlée | Se déplacer vers la case d’un ennemi adjacent |
| Attaque à distance / lancer un sort | **F / X** |
| Sauvegarder manuellement | **V** dans le debug Godot, ou **Ctrl+S** en version autonome, puis choisir un emplacement |
| Talk / rest | **T / H** |
| Inventory / crafting | **I / B** |
| Character / quests | **P / J** |
@@ -63,13 +65,13 @@ Press **F1** in a run for the current in-game control list. It is generated from
| Options / help | **O / F1** |
| Expand journal | **L** (shares the achievements default) |
Several commands open contextual panels. Within selection panels, use arrows to select, **Enter** or **Space** to confirm, and **Esc** to close. In the inventory, use **E** to equip, **U** to use, and **D** to drop the selected item. In the shop, **Tab** changes buy/sell mode. The Options panel supports UI scaling, a high-contrast/color-blind marker mode, and remapping the Inventory control; its displayed keys control ambience and effects volume.
Plusieurs commandes ouvrent des panneaux contextuels. Dans les panneaux de sélection, utilisez les flèches pour choisir, **Entrée** ou **Espace** pour confirmer et **Échap** pour annuler. Avec une arme à distance équipée, **F** ouvre les cibles actuellement à portée et en ligne de vue; confirmer le tir consomme immédiatement un tour et les adversaires survivants se déplacent ou attaquent. **K** ouvre les ordres du familier : **Reste en arrière**, **Défends-moi** ou **Attaque à vue**. Dans l’inventaire, utilisez **E** pour équiper, **U** pour utiliser et **D** pour déposer. Dans la boutique, **Tab** change le mode achat/vente.
## Audio (optional)
## Musique et audio
The game works silently with no audio files. Playback only uses `AudioStream` resources registered in `user://audio/audio_import_manifest.tres`; it does not scan or decode arbitrary files from a directory. The manifest accepts these ambience contexts: `exploration`, `combat`, `danger`; and these SFX events: `attack_given`, `attack_received`, `menu_select`, `menu_cancel`, `item_use`, `death`.
Le jeu contient trois ambiances originales intégrées : exploration, combat et danger. L’exploration démarre automatiquement avec la partie et le contexte passe à la musique de combat lors d’un affrontement. Le panneau Options contrôle séparément les volumes Ambiance et Effets.
This is intentionally a safe, Godot-native setup boundary. A setup/modding tool must import a supported sound into Godot and register the resulting `AudioStream` in the manifest. The Options panel changes separate Ambience and SFX bus volumes; missing, invalid, or unregistered audio remains silent and never blocks gameplay.
La personnalisation reste sécurisée : le jeu ne parcourt et ne décode jamais des fichiers arbitraires. Un manifeste Godot optionnel dans `user://audio/audio_import_manifest.tres` peut remplacer individuellement les ressources intégrées avec des `AudioStream` déjà importés. Il reconnaît les contextes `exploration`, `combat`, `danger` et les effets `attack_given`, `attack_received`, `menu_select`, `menu_cancel`, `item_use`, `death`. Une entrée absente du manifeste utilisateur conserve la ressource intégrée correspondante.
## Known limitations
+34
View File
@@ -0,0 +1,34 @@
# Release checklist — Godot port candidate
Reviewed 2026-10-04 against the read-only DCWASCII reference at
`f25a69bad629c1737c22c2a1080ddd010e024912`. A checked item has executable
or recorded evidence; it is not a claim of byte-for-byte terminal-UI equivalence.
A release candidate/tag is prohibited until the strict parity gate, clean import,
Godot verification, export validation, and ASCII reference suite all pass.
## Product and content
- [x] Imported catalog source IDs, generated catalog taxonomy/cardinality, and load-time budget are covered — `test_ascii_content_parity.gd`, `test_bulk_content_loading.gd`, `test_large_catalog_menu_e2e.gd`.
- [x] Character creation, exploration, combat, inventory/equipment, loot, dialogue, quests, companions/party, progression, factions, audience/recap, achievements/titles, death modes, and graphical feedback have named test evidence in `docs/parity/ASCII_TEST_MATRIX.md`.
- [x] Floor-18 descent produces visible victory without floor 19; bounded deep profiles include a floor-15 target above 150 rooms — `test_deep_floor_profile.gd`, `test_final_floor_victory.gd`, `test_deep_floor_generation.gd`, `test_final_floor_victory_e2e.gd`.
- [x] Generated safe rooms stay outside the entrance, include beds/Bobka, and grant repeatable free rations — `test_safe_room_service.gd`, `test_safe_room_generation.gd`, `test_bobka_safe_room_e2e.gd`.
- [x] Tourists start at floor 6, cap at one, support selfie audience gain, and are ejected rather than killed with moderation — `test_tourist_service.gd`, `test_tourist_generation.gd`, `test_tourist_dialogue_e2e.gd`.
## State, deterministic generation, presentation, and distribution
- [x] Versioned five-slot save/load and actual menu save → restart → load are covered — `test_save_repository.gd`, `test_save_load_e2e.gd`.
- [x] Generated-floor connectivity, exit path, and safe population run 100 deterministic seeds — `test_floor_generator_connectivity.gd`, `test_floor_generator_exit_path.gd`, `test_floor_population_safety.gd`.
- [x] Visual capture validates initial and exit states — `scripts/run-visual-check.sh`, `scripts/check-visual-capture.py`.
- [x] Assets, controls/accessibility, optional audio, source modding, and platform caveats are documented — `assets/ASSET_REGISTRY.md`, `docs/PLAYING.md`, `docs/CONTENT_AND_MODDING.md`.
- [x] Linux export smoke and Windows output validation are scripted; the PR-4 command results are recorded in the release evidence document.
## Strict release gate
- [x] `./tests/scripts/test_parity_recovery_gate.sh` proves blocked and unowned fixture rows fail while a complete owned fixture passes.
- [x] `./tests/scripts/test_parity_gauntlet.sh` covers the full static-gate classifications.
- [x] `./scripts/run-parity-gauntlet.sh --matrix-only` requires every row to be `ported`, `replaced`, or explicitly justified `not_applicable` with evidence.
- [x] PR-4 command outcomes, ASCII revision/count, and final tag decision are recorded in `docs/release/RC-2026-10-04-evidence.md`.
- [x] Every required gate is green; create the local `v0.1.0-rc1` tag only after the evidence commit. Do not push it from this worktree.
**Disposition: eligible for a local release-candidate tag. The evidence record,
not a partial pass or unavailable verification, is the tag authority.**
+52 -46
View File
@@ -1,51 +1,57 @@
# ASCII test parity matrix
Scope: every `DCWASCII/tests/test_*.py` module as inventoried on 2026-10-02. Status is deliberately conservative: **blocked** means the behavior is not yet available in the Godot port and its named slice owns the replacement; **replaced** means the original module's applicable contract is covered by a Godot test with a stated target owner. No row is unclassified.
Scope: every `DCWASCII/tests/test_*.py` module, inventoried against the read-only
reference checkout at commit `f25a69bad629c1737c22c2a1080ddd010e024912` on
2026-10-04. **Replaced** means a graphical/deterministic Godot contract covers
the applicable player-facing behavior; it does **not** claim byte-for-byte or
terminal-UI equivalence. `not_applicable` requires an explicit justification.
| ASCII module | Status | Godot evidence / planned owner |
| ASCII module | Status | Godot evidence / target owner |
| --- | --- | --- |
| `test_achievements.py` | blocked | F3 — `test_achievements.gd` / achievement reward E2E |
| `test_audience.py` | blocked | F4 — `test_audience.gd` |
| `test_audio.py` | blocked | G3 — `test_audio_playback.gd` / audio settings E2E |
| `test_beds_stairs.py` | blocked | B5–B6 — floor transition/deadline tests |
| `test_bulk_content.py` | replaced | A1 `test_ascii_content_parity.gd`; D6 owns bulk performance/catalog UI |
| `test_combat.py` | blocked | C2 — `test_melee_combat.gd` / melee feedback E2E |
| `test_companion.py` | blocked | E4 — `test_companion.gd` |
| `test_companion_support.py` | blocked | E4 — `test_companion_support.gd` |
| `test_countdown_moderation.py` | blocked | B6 / F5 — floor deadline and moderation tests |
| `test_crafting.py` | blocked | D5 — `test_crafting.gd` / crafting E2E |
| `test_dialogue.py` | blocked | E1 — `test_dialogue.gd` / NPC dialogue E2E |
| `test_economy.py` | blocked | D4 — `test_economy.gd` / shop-rest E2E |
| `test_factions.py` | blocked | F5 — `test_factions.gd` |
| `test_floor_zero.py` | blocked | B5 — `test_floor_transition.gd` / descend E2E |
| `test_generation.py` | blocked | B2–B4 — generator/population integration tests |
| `test_guilds.py` | blocked | B3 / E1 — guild room and dialogue tests |
| `test_healing_system.py` | blocked | C1 / D4 — status and safe-rest tests |
| `test_hero_classes.py` | blocked | F2 — `test_hero_classes.gd` |
| `test_identification.py` | blocked | D3 — `test_identification.gd` |
| `test_inventory.py` | blocked | D1 — `test_inventory.gd` / pickup E2E |
| `test_item_details.py` | blocked | D3 — equipment/inventory detail tests |
| `test_kill_method_gold.py` | blocked | C2 / D4 — combat and economy tests |
| `test_limb_wounds.py` | blocked | C2 — `test_limb_wounds.gd` |
| `test_loot.py` | blocked | D2 — `test_loot_resolver.gd` / chest E2E |
| `test_magic.py` | blocked | C5 — `test_magic.gd` / spell E2E |
| `test_map_persistence.py` | blocked | B5 — floor transition persistence tests |
| `test_menu_scrolling.py` | blocked | G2 / D6 — full UI navigation and large-catalog E2E |
| `test_minimap.py` | blocked | G2 — `test_minimap.gd` |
| `test_narrative_resurrection.py` | blocked | F6 — death/resurrection tests |
| `test_party_system.py` | blocked | E5 — `test_party_system.gd` / recruit-party E2E |
| `test_playtest_fixes.py` | blocked | G6 — full parity regression gauntlet |
| `test_playtest_v2.py` | blocked | G6 — full parity regression gauntlet |
| `test_quests.py` | blocked | E3 — `test_quests.gd` / quest lifecycle E2E |
| `test_quests_v3.py` | blocked | E3 — `test_quests.gd` / quest lifecycle E2E |
| `test_race_class.py` | blocked | F2 — `test_race_class.gd` |
| `test_real_time_deadline.py` | blocked | B6 — `test_floor_deadline.gd` |
| `test_realworld_items.py` | blocked | D6 — bulk-content loading and catalog UI E2E |
| `test_recap.py` | blocked | F4 — `test_recap.gd` |
| `test_safe_rooms_bobka.py` | blocked | B3 / D4 / E1 — sanctuary, rest, and dialogue tests |
| `test_save.py` | blocked | G1 — save repository/migration/load E2E |
| `test_syndicate.py` | blocked | F5 — `test_syndicate.gd` |
| `test_titles.py` | blocked | F3 — `test_titles.gd` |
| `test_tourists.py` | blocked | E1 — NPC dialogue E2E |
| `test_achievements.py` | replaced | F3 — `test_achievements.gd`, `test_achievement_reward_e2e.gd` |
| `test_audience.py` | replaced | F4 — `test_audience.gd`, `test_audience_episode_e2e.gd` |
| `test_audio.py` | replaced | G3 — `test_audio_library.gd`, `test_audio_playback.gd`, `test_audio_settings_e2e.gd` |
| `test_beds_stairs.py` | replaced | B6/D4 — `test_floor_deadline.gd`, `test_shop_rest_e2e.gd`, `test_stair_deadline_e2e.gd` |
| `test_bulk_content.py` | replaced | A1/D6 — `test_ascii_content_parity.gd`, `test_bulk_content_loading.gd`, `test_large_catalog_menu_e2e.gd` |
| `test_combat.py` | replaced | C2 — `test_melee_combat.gd`, `test_melee_feedback_e2e.gd`, `test_combat_hud_e2e.gd` |
| `test_companion.py` | replaced | E4 — `test_companion.gd`, `test_pet_companion_e2e.gd` |
| `test_companion_support.py` | replaced | E4 — `test_companion_support.gd` |
| `test_countdown_moderation.py` | replaced | B6/F5 — `test_floor_deadline.gd`, `test_moderation_event_e2e.gd` |
| `test_crafting.py` | replaced | D5 — `test_crafting.gd`, `test_crafting_e2e.gd` |
| `test_dialogue.py` | replaced | E1 — `test_dialogue.gd`, `test_dialogue_e2e.gd` |
| `test_economy.py` | replaced | D4 — `test_economy.gd`, `test_shop_rest_e2e.gd` |
| `test_factions.py` | replaced | F5 — `test_factions.gd`, `test_moderation_event_e2e.gd` |
| `test_floor_zero.py` | replaced | B5 — `test_surface_floor_transition.gd`, `test_door_to_stairs_exit_e2e.gd`, `test_menu_multi_floor_e2e.gd` |
| `test_generation.py` | replaced | B2–B4 — `test_floor_generator_connectivity.gd`, `test_floor_generator_exit_path.gd`, `test_floor_population_safety.gd` |
| `test_guilds.py` | replaced | B3/E1 — `test_floor_generator_rooms.gd`, `test_dialogue.gd` |
| `test_healing_system.py` | replaced | C1/D4 — `test_status_effects.gd`, `test_shop_rest_e2e.gd` |
| `test_hero_classes.py` | replaced | F2 — `test_hero_classes.gd`, `test_floor_three_choice_e2e.gd` |
| `test_identification.py` | replaced | D3 — `test_identification.gd` |
| `test_inventory.py` | replaced | D1 — `test_inventory.gd`, `test_pickup_inventory_e2e.gd`, `test_equip_use_item_e2e.gd` |
| `test_item_details.py` | replaced | D3 — `test_equipment.gd`, `test_identification.gd`, `test_equip_use_item_e2e.gd` |
| `test_kill_method_gold.py` | replaced | C2/D4 — `test_melee_combat.gd`, `test_economy.gd` |
| `test_limb_wounds.py` | replaced | C2 — `test_limb_wounds.gd` |
| `test_loot.py` | replaced | D2 — `test_loot_resolver.gd`, `test_world_chest_loot_e2e.gd` |
| `test_magic.py` | replaced | C5 — `test_magic.gd`, `test_spell_casting_e2e.gd` |
| `test_map_persistence.py` | replaced | A4/B5/G1 — `test_map_renderer_fog.gd`, `test_surface_floor_transition.gd`, `test_save_repository.gd` |
| `test_menu_scrolling.py` | replaced | G2/D6 — `test_full_ui_navigation_e2e.gd`, `test_large_catalog_menu_e2e.gd` |
| `test_minimap.py` | replaced | G2 — `test_minimap.gd`, `test_black_fog_e2e.gd` |
| `test_narrative_resurrection.py` | replaced | F6 — `test_death_resurrection.gd`, `test_death_mode_e2e.gd` |
| `test_party_system.py` | replaced | E5 — `test_party_system.gd`, `test_recruit_party_e2e.gd` |
| `test_playtest_fixes.py` | replaced | G6 — `test_achievements.gd`, `test_floor_deadline.gd`, `test_world_chest_loot_e2e.gd` |
| `test_playtest_v2.py` | ported | PR-1 — `test_deep_floor_profile.gd`, `test_final_floor_victory.gd`, `test_deep_floor_generation.gd`, and real `test_final_floor_victory_e2e.gd` cover bounded deep generation, floor-18 victory, and no floor 19. |
| `test_quests.py` | replaced | E3 — `test_quests.gd`, `test_quest_lifecycle_e2e.gd` |
| `test_quests_v3.py` | replaced | E3 — `test_quests.gd`, `test_quest_lifecycle_e2e.gd` |
| `test_race_class.py` | replaced | F2 — `test_race_class.gd`, `test_floor_three_choice_e2e.gd` |
| `test_real_time_deadline.py` | replaced | B6 — `test_floor_deadline.gd`, `test_stair_deadline_e2e.gd` |
| `test_realworld_items.py` | replaced | D6 — `test_bulk_content_loading.gd`, `test_large_catalog_menu_e2e.gd` |
| `test_recap.py` | replaced | F4 — `test_recap.gd`, `test_audience_episode_e2e.gd` |
| `test_safe_rooms_bobka.py` | ported | PR-2 — `test_safe_room_service.gd`, `test_safe_room_generation.gd`, and real `test_bobka_safe_room_e2e.gd` cover non-entrance safe rooms, beds, Bobka, and repeatable free rations. |
| `test_save.py` | replaced | G1 — `test_save_repository.gd`, `test_ascii_save_migration.gd`, `test_save_load_e2e.gd` |
| `test_syndicate.py` | replaced | F5 — `test_syndicate.gd`, `test_moderation_event_e2e.gd` |
| `test_titles.py` | replaced | F3 — `test_titles.gd`, `test_achievement_reward_e2e.gd` |
| `test_tourists.py` | ported | PR-3 — `test_tourist_service.gd`, `test_tourist_generation.gd`, and real `test_tourist_dialogue_e2e.gd` cover floor-six/capped spawning, selfie audience gain, and protected ejection with moderation. |
**Classification totals:** 1 replaced, 42 blocked, 0 ported, 0 not_applicable, 0 unclassified. `test_bulk_content.py` is replaced only for A1's source-id/catalog-cardinality contract; its generated-content behavioral and performance coverage remains blocked on D6.
**Classification totals:** 40 replaced, 0 blocked, 3 ported, 0 not_applicable,
0 unclassified. Every row has named Godot proof. The release gate remains strict:
any future blocked, unowned, invalid, or unjustified `not_applicable` row fails it.
+47
View File
@@ -0,0 +1,47 @@
# v0.1.0-rc1 release evidence — PR-4
**Recorded:** 2026-10-05
This is the release decision record for the PR-4 parity re-gate. It covers the
Godot worktree based on `be89171` plus the PR-4 changes recorded with this
document. The ASCII reference was used read-only at
`f25a69bad629c1737c22c2a1080ddd010e024912`; it was not modified.
## Gate results
| Required gate | Command | Result | Evidence / count |
| --- | --- | --- | --- |
| Recovery-gate regression | `./tests/scripts/test_parity_recovery_gate.sh` | PASS | A complete owned fixture passed; blocked and unowned fixtures failed as required. |
| Static gauntlet contracts | `./tests/scripts/test_parity_gauntlet.sh` | PASS | Valid `ported`, `replaced`, and justified `not_applicable` fixtures passed; blocked, unowned, unjustified, and unknown fixtures failed. |
| Strict matrix gate | `./scripts/run-parity-gauntlet.sh --matrix-only` | PASS | 43 rows, 0 invalid. Matrix totals: 40 replaced, 3 ported, 0 blocked, 0 not applicable, 0 unclassified. |
| Clean Godot verification | `rm -rf .godot artifacts && GODOT_BIN=/snap/bin/godot4 ./scripts/verify.sh` | PASS | Godot 4.5.stable.official.876b29033; 65 unit scripts / 197 tests / 2,450 assertions, 12 integration scripts / 17 tests / 235,740 assertions, and 46 E2E scripts / 61 tests / 615 assertions: 275 tests and 238,805 assertions total. Visual initial and exit captures passed. |
| Full release gauntlet | `GODOT_BIN=/snap/bin/godot4 ./scripts/run-parity-gauntlet.sh` | PASS | Matrix: 43 rows, 0 invalid. Save repository 3 tests / 40 assertions; save/load E2E 1 / 14; connectivity seeds 1 / 3,900; exit-path seeds 1 / 5,050; population seeds 1 / 155,834. All 7 tests / 164,838 assertions passed. |
| Export-script contract | `./tests/scripts/test_export_scripts.sh` | PASS | Both Linux/X11 and Windows Desktop scripts reject missing matching templates before export. |
| Linux export and smoke | `GODOT_BIN=/snap/bin/godot4 ./scripts/build-linux.sh` | PASS | Exported `build/linux/DungeonCrawlerWorld.x86_64` and completed X11 capture-mode smoke launch. |
| Windows export validation | `GODOT_BIN=/snap/bin/godot4 ./scripts/build-windows.sh` | PASS | Exported `build/windows/DungeonCrawlerWorld.exe` and validated its distribution manifest. Windows runtime was not executed on this Linux host. |
| ASCII reference suite (read-only) | `python3 -m pytest -q tests` in `DCWASCII` | PASS | 462 passed in 186.21s. Reference HEAD remained `f25a69bad629c1737c22c2a1080ddd010e024912`; its only pre-existing status entry before and after was untracked `CLAUDE.md`. |
The Godot runners emitted existing GUT resource-UID and resource-leak warnings,
but no `SCRIPT ERROR` or `Parse Error`; their exit statuses were zero. The
visual/export scripts apply their documented error filters and passed.
## Matrix evidence audited in this re-gate
The only PR-4 matrix classification changes for recovered gaps have named proof:
- `test_playtest_v2.py` — PR-1's `test_deep_floor_profile.gd`,
`test_final_floor_victory.gd`, `test_deep_floor_generation.gd`, and
`test_final_floor_victory_e2e.gd`.
- `test_safe_rooms_bobka.py` — PR-2's `test_safe_room_service.gd`,
`test_safe_room_generation.gd`, and `test_bobka_safe_room_e2e.gd`.
- `test_tourists.py` — PR-3's `test_tourist_service.gd`,
`test_tourist_generation.gd`, and `test_tourist_dialogue_e2e.gd`.
The matrix is release-blocking: any future blocked, unowned, invalid, or
unjustified `not_applicable` row makes the strict gate fail.
## RC decision
**Eligible and approved for a local `v0.1.0-rc1` tag.** Every required gate
above is green. Per the PR-4 instruction, no branch, commit, tag, or pull
request is pushed; the local tag is created only after the evidence commit.
@@ -0,0 +1,514 @@
# Parity Recovery Before Release Candidate Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use `subagent-driven-development` (recommended) or `executing-plans` to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** Close the three honest Godot-vs-DCWASCII parity gaps found by G6—final-floor victory/deep-floor scale, safe rooms with Bobka, and tourists—then rerun the strict release-candidate gate without weakening its rules.
**Architecture:** The existing Godot domain remains authoritative at runtime. The three recovery slices extend the deterministic floor generator, `RunState`, dialogue/effect plumbing, audience/moderation, and floor transition services through explicit data-backed contracts; they do not invoke Python/ASCII during play. The current local G6 branch is treated as release-gate tooling only: it is rebased onto the recovery integration head in the final task, where its strict matrix can become green honestly.
**Tech Stack:** Godot 4.5, GDScript, GUT, Godot real-scene E2E, Bash/Python standard-library verification, Xvfb, Gitea local, Kanita.
**Spec:**
- `docs/superpowers/plans/2026-10-02-full-dcwascii-godot-port.md`
- `DCWASCII/tests/test_playtest_v2.py`
- `DCWASCII/tests/test_safe_rooms_bobka.py`
- `DCWASCII/tests/test_tourists.py`
- `DCWASCII/dcw/world/generator.py`
- `DCWASCII/dcw/game.py`
- `DCWASCII/dcw/conditions.py`
- `DCWASCII/dcw/config.py`
## Global Constraints
- Never modify `DCWASCII`; its code and tests are read-only behavioral oracles.
- Preserve the Godot game as a native GDScript executable; no Python process or Python content loader at runtime.
- Use the imported `data/ascii/` JSON identifiers/text unchanged.
- Every slice follows: focused RED proof → minimal GREEN → GUT/unit/integration → real `Game.tscn` E2E → clean-worktree import → Xvfb capture when presentation changes → independent review → Gitea PR.
- A release candidate is forbidden while any row in `docs/parity/ASCII_TEST_MATRIX.md` is `blocked`, unowned, invalid, or unjustified `not_applicable`.
- The final floor is **18**, matching `DCWASCII/dcw/config.py::FINAL_FLOOR`.
- Per-floor deadline is **15 days on floor 1 + 5 days per later floor**, with **20 turns/day**, matching the existing B6 Godot constants and ASCII config.
- Safe room kinds are exactly `refuge` and `sanctuary`; the entrance is never safe and never contains a bed or Bobka.
- Tourist content begins on floor **6**, has at most one tourist per floor, and never creates a real enemy death.
- No unrelated asset changes. New UI/content assets require an entry in `assets/ASSET_REGISTRY.md`.
- Reports, red logs, review packages and Kanita state live in ignored `.superpowers/` / `.claude/`, never in the product tree.
---
## Recovery graph and Kanita shape
The generation, population and dialogue services overlap, so the corrective implementation intentionally avoids unsafe parallel edits.
```text
PR-1 Endgame/deep floors ──► PR-2 Safe rooms/Bobka ──► PR-3 Tourists ──► PR-4 Parity re-gate / RC decision
```
| Slice | Track | True blocker | Why it must wait |
| --- | --- | --- | --- |
| PR-1 | `world/final-floor` | none | Establishes final-floor and scale contracts used by later generated floors. |
| PR-2 | `world/safe-room` | PR-1 | Both change the floor generator and floor population invariants. |
| PR-3 | `world/tourists` | PR-2 | Shares NPC population and dialogue/effect application with Bobka. |
| PR-4 | `release/parity` | PR-1, PR-2, PR-3 | Rebases/reuses G6 gate only after all three matrix rows are truly covered. |
**Kanita proposal:** create one new project named `DCW — Parity Recovery Before RC`; one list and one agent task per PR-1 through PR-4; exactly six checklist items per task: brief, RED, GREEN, integration/E2E, clean verify/capture, review/PR.
---
## Files and contracts fixed by this plan
| Area | Create/modify | Responsibility |
| --- | --- | --- |
| Final-floor rules | `scripts/domain/world/floor_generator.gd`, `scripts/domain/run/floor_transition.gd`, `scripts/domain/run/floor_deadline.gd`, `scripts/domain/run/run_state.gd` | Deep scale, final floor, victory and no floor 19. |
| Safe rooms | `scripts/domain/world/floor_generator.gd`, `scripts/domain/world/floor_populator.gd`, `scripts/domain/world/special_interactions.gd`, dialogue effect bridge | Guaranteed safe room, bed, Bobka and repeatable ration. |
| Tourist system | `scripts/domain/world/floor_populator.gd`, `scripts/domain/dialogue/dialogue_engine.gd`, `scripts/domain/combat/condition_engine.gd`, `scripts/domain/meta/audience_state.gd`, `scripts/domain/meta/moderation.gd` | Spawn, selfie, protected health/ejection and moderation. |
| Release gate | `docs/parity/ASCII_TEST_MATRIX.md`, `scripts/run-parity-gauntlet.sh`, `docs/RELEASE_CHECKLIST.md`, `tests/scripts/test_parity_gauntlet.sh` | Honest all-green parity decision. |
### Frozen recovery contracts
```gdscript
# Final-floor and generated scale
const FINAL_FLOOR := 18
func FloorGenerator.generation_profile(floor_number: int) -> Dictionary
# Returns deterministic map size, target room count and room size range.
func FloorTransition.try_descend(run: RunState) -> Array[GameEvent]
# At FINAL_FLOOR produces `game_victory`; it never creates floor 19.
# Safe rooms
func FloorState.safe_rooms() -> Array[RoomState]
func SafeRoomService.can_rest(floor: FloorState, cell: Vector2i) -> bool
func SafeRoomService.give_bobka_ration(run: RunState, npc_id: StringName) -> Array[GameEvent]
# Repeated calls are allowed; each successful call grants one consumable_ration and zero gold.
# Tourists
func TouristService.try_spawn(floor: FloorState, catalog: ContentCatalog, rng: DeterministicRng) -> Array[GameEvent]
func TouristService.selfie(run: RunState, tourist_id: StringName) -> Array[GameEvent]
func TouristService.endanger(run: RunState, tourist_id: StringName, amount: int) -> Array[GameEvent]
# At zero hidden health: `tourist_ejected`, not `actor_died`; exactly one moderation strike is emitted.
```
---
### Task PR-1: Deep-floor scale, final-floor victory and endgame
**Files:**
- Modify: `scripts/domain/world/floor_generator.gd`
- Modify: `scripts/domain/world/room_graph.gd`
- Modify: `scripts/domain/run/floor_transition.gd`
- Modify: `scripts/domain/run/floor_deadline.gd`
- Modify: `scripts/domain/run/run_state.gd`
- Modify: `scripts/game/game.gd`, `scripts/presentation/hud.gd`, `scenes/Game.tscn`
- Create: `scripts/domain/run/endgame_state.gd`
- Create: `scenes/ui/VictoryPanel.tscn`, `scripts/presentation/victory_panel.gd`
- Create: `tests/unit/test_deep_floor_profile.gd`
- Create: `tests/unit/test_final_floor_victory.gd`
- Create: `tests/integration/test_deep_floor_generation.gd`
- Create: `tests/e2e/test_final_floor_victory_e2e.gd`
- Modify: `docs/parity/ASCII_TEST_MATRIX.md`
**Consumes:** `FloorState`, `RoomGraph`, B5 `FloorTransition`, B6 `FloorDeadline`.
**Produces:** deterministic deep-floor profile, final-floor win state, `game_victory` event and a visible victory panel.
**Behavioral contract:**
```gdscript
func FloorGenerator.generation_profile(floor_number: int) -> Dictionary:
# floor 1 is strictly smaller than floor 12.
# floor 15 has target_rooms > 150.
# profile must be bounded so the generated map remains valid in Godot.
func FloorTransition.try_descend(run: RunState) -> Array[GameEvent]:
# if run.current_floor == 18 and eligible, append game_victory,
# set run.endgame_state.victory = true, and never allocate floor 19.
```
- [ ] **Step 1: Write failing deep-floor profile tests**
```gdscript
func test_floor_fifteen_targets_more_than_one_hundred_fifty_rooms() -> void:
var profile := FloorGenerator.generation_profile(15)
assert_gt(int(profile["target_room_count"]), 150)
func test_deeper_profiles_have_more_rooms_than_shallow_profiles() -> void:
assert_gt(
int(FloorGenerator.generation_profile(12)["target_room_count"]),
int(FloorGenerator.generation_profile(2)["target_room_count"])
)
```
- [ ] **Step 2: Run the focused test and retain RED proof**
Run:
```bash
./scripts/test-unit.sh
```
Expected: failure because `generation_profile` / final-floor contract does not exist or room target remains the fixed B2 count.
- [ ] **Step 3: Implement bounded deterministic scale**
Implement a floor-number profile with the ASCII intent:
```gdscript
var target_room_count := mini(500, 150 + floor_number * 20)
var map_width := mini(700, 180 + floor_number * 30)
var map_height := mini(350, 90 + floor_number * 15)
```
Do not naïvely allocate/render a 700×350 sprite node per cell. Keep `GridMapState` data scalable and make `MapRenderer` only draw the current camera/FOV viewport if existing rendering is otherwise O(map area) per frame. Add a generated-floor integration test at floors 2, 12 and 15 that checks profile scale, room count, non-overlap, entry/exit reachability and no process timeout.
- [ ] **Step 4: Write failing final-floor victory test**
```gdscript
func test_descending_from_eligible_final_floor_marks_victory_without_floor_nineteen() -> void:
var run := _run_at_final_eligible_stairs()
var events := FloorTransition.try_descend(run)
assert_true(run.endgame_state.victory)
assert_true(events.any(func(event): return event.kind == &"game_victory"))
assert_false(run.floors.has(19))
```
- [ ] **Step 5: Implement victory state and presentation**
Implement `EndgameState`; route final-floor descent to `game_victory`, recap/audience-compatible event and `VictoryPanel`. Preserve normal B6 early-stairs gate. Heal/transition semantics for non-final floors remain unchanged.
- [ ] **Step 6: Add true-scene endgame E2E**
Create a deterministic final-floor fixture, set the staircase eligibility through the public deadline seam, send real interact input, then assert:
```gdscript
assert_true(game.get_run_state().endgame_state.victory)
assert_true(victory_panel.visible)
assert_string_contains(victory_panel.get_display_text(), "vaincu")
assert_false(game.get_run_state().floors.has(19))
```
- [ ] **Step 7: Verify and commit**
Run:
```bash
./scripts/test-unit.sh
./scripts/test-integration.sh
./scripts/test-e2e.sh
DISPLAY= ./scripts/verify.sh
git diff --check
```
Commit:
```bash
git add scripts scenes tests docs/parity
git commit -m "feat: add final floor victory and deep generation scale"
```
---
### Task PR-2: Safe rooms, beds and Bobka’s repeatable free ration
**Files:**
- Modify: `scripts/domain/world/floor_generator.gd`
- Modify: `scripts/domain/world/floor_populator.gd`
- Modify: `scripts/domain/world/special_interactions.gd`
- Modify: `scripts/domain/dialogue/dialogue_engine.gd`
- Modify: `scripts/domain/combat/condition_engine.gd`
- Modify: `scripts/domain/run/run_state.gd`
- Modify: `scripts/game/game.gd`, `scripts/presentation/hud.gd`
- Create: `scripts/domain/world/safe_room_service.gd`
- Create: `tests/unit/test_safe_room_service.gd`
- Create: `tests/integration/test_safe_room_generation.gd`
- Create: `tests/e2e/test_bobka_safe_room_e2e.gd`
- Modify: `docs/parity/ASCII_TEST_MATRIX.md`
**Consumes:** PR-1 generation profile and current safe room room kinds; E1 dialogue effects; D1 inventory; D4 rest/economy.
**Produces:** explicit safe-room service, beds and Bobka data population, repeatable no-cost ration grant.
**Behavioral contract:**
```gdscript
const SAFE_ROOM_KINDS := [&"refuge", &"sanctuary"]
func SafeRoomService.is_safe_room(room: RoomState) -> bool
func SafeRoomService.validate_floor(floor: FloorState) -> PackedStringArray
# returns diagnostics; empty means entrance is not safe, entrance has no bed,
# and at least one non-entrance safe room exists.
func SafeRoomService.give_bobka_ration(run: RunState, npc_id: StringName) -> Array[GameEvent]
# one `item_granted` and one `bobka_ration_given`; zero gold mutation;
# it intentionally remains repeatable across dialogue sessions.
```
- [ ] **Step 1: Write failing 20-seed safe-room tests**
```gdscript
func test_entrance_is_never_safe_and_has_no_bed() -> void:
for seed_index in range(20):
var floor := _generate(4, "SAFE-START-%d" % seed_index)
var entrance_room := floor.room_at(floor.entrance)
assert_false(entrance_room.kind in SafeRoomService.SAFE_ROOM_KINDS)
assert_false(floor.metadata.get("bed_cells", []).has(floor.entrance))
func test_every_generated_floor_has_a_non_entrance_safe_room() -> void:
for seed_index in range(20):
assert_gt(_generate(4, "SAFE-%d" % seed_index).safe_rooms().size(), 0)
```
- [ ] **Step 2: Run RED proof**
Run the focused unit/integration suite. Expected: current Godot generation either does not guarantee a safe room for every seed, populates no Bobka, or uses bed placement without a service contract.
- [ ] **Step 3: Implement generator and population guarantees**
During `_assign_room_kinds`, reserve exactly one candidate room other than entrance/exit as `refuge` or `sanctuary` when none has been selected. Materialize one bed in each safe room, never in entrance. `FloorPopulator` adds one `npc_bobka` in each safe room only if a non-bed floor tile is free. Keep rooms/cells deterministic.
- [ ] **Step 4: Write failing Bobka effect test**
```gdscript
func test_bobka_ration_is_repeatable_and_free() -> void:
var run := _run_with_bobka()
var gold_before := run.gold
SafeRoomService.give_bobka_ration(run, &"npc_bobka_00")
SafeRoomService.give_bobka_ration(run, &"npc_bobka_00")
assert_eq(run.inventory.count_by_definition(&"consumable_ration"), 2)
assert_eq(run.gold, gold_before)
```
- [ ] **Step 5: Wire dialogue and UI**
Map `give_item` in Bobka’s imported dialogue to the inventory service, preserving content `dlg_bobka`. No one-shot guard may be added. Show a clear event/log message and inventory update after every ration.
- [ ] **Step 6: Add true-scene E2E**
Generate deterministic safe-room floor; interact with Bobka through the dialogue panel three separate times and choose “Prendre une ration.” Assert three rations, unchanged gold, bed/rest prompt and safe-room marker. Verify no starting spawn is safe.
- [ ] **Step 7: Verify and commit**
```bash
./scripts/test-unit.sh
./scripts/test-integration.sh
./scripts/test-e2e.sh
DISPLAY= ./scripts/verify.sh
git diff --check
git commit -m "feat: add safe rooms and repeatable Bobka rations"
```
---
### Task PR-3: Tourists, selfies and protected ejection
**Files:**
- Modify: `scripts/domain/world/floor_populator.gd`
- Modify: `scripts/domain/world/spawn_rules.gd`
- Modify: `scripts/domain/entities/party_state.gd` only if NPC collection helpers are shared
- Modify: `scripts/domain/dialogue/dialogue_engine.gd`
- Modify: `scripts/domain/combat/condition_engine.gd`
- Modify: `scripts/domain/meta/audience_state.gd`
- Modify: `scripts/domain/meta/moderation.gd`
- Modify: `scripts/domain/meta/achievement_manager.gd`
- Modify: `scripts/domain/run/run_state.gd`
- Modify: `scripts/game/game.gd`, dialogue panel/HUD as required
- Create: `scripts/domain/world/tourist_service.gd`
- Create: `tests/unit/test_tourist_service.gd`
- Create: `tests/integration/test_tourist_generation.gd`
- Create: `tests/e2e/test_tourist_dialogue_e2e.gd`
- Modify: `docs/parity/ASCII_TEST_MATRIX.md`
**Consumes:** PR-2 NPC safe population/dialogue effect seam; F3 achievements; F4 audience; F5 moderation.
**Produces:** data-backed tourist spawn and protected dialogue behavior with non-lethal ejection.
**Behavioral contract:**
```gdscript
const TOURIST_MIN_FLOOR := 6
const TOURIST_MAX_PER_FLOOR := 1
func TouristService.try_spawn(floor: FloorState, catalog: ContentCatalog, rng: DeterministicRng) -> Array[GameEvent]
# zero before floor 6; at most one at/after floor 6; requires npc_tourist_influencer.
func TouristService.selfie(run: RunState, tourist_id: StringName) -> Array[GameEvent]
# audience increases; tourist HP/ejection unchanged; fires tourist_met once when eligibility is met.
func TouristService.endanger(run: RunState, tourist_id: StringName, amount: int) -> Array[GameEvent]
# warning is handled by dialogue flag; only actual danger reduces hidden health.
# at <= 0: NPC removed/ejected, no actor_died/kill XP/loot/faction kill;
# exactly one moderation violation `mise_en_danger_touriste`.
```
- [ ] **Step 1: Write failing generation tests**
```gdscript
func test_no_tourists_before_floor_six() -> void:
for seed_index in range(25):
assert_eq(_tourists(_generate(5, "TOUR-EARLY-%d" % seed_index)).size(), 0)
func test_at_most_one_tourist_per_eligible_floor() -> void:
for seed_index in range(30):
assert_lte(_tourists(_generate(8, "TOUR-CAP-%d" % seed_index)).size(), 1)
func test_tourist_can_spawn_at_floor_six_across_seed_sample() -> void:
assert_true(_any_seed_spawns_tourist(6, 60))
```
- [ ] **Step 2: Run RED proof**
Run focused tests. Expected: no tourist metadata/service population exists.
- [ ] **Step 3: Implement protected tourist spawn**
Read `npc_tourist_influencer` from catalog. Generate only in eligible non-entrance, non-boss safe/open/narrative rooms; reserve a free reachable cell. Store `is_tourist`, `hidden_health`, `ejected=false` in NPC state metadata. Never create more than one per floor.
- [ ] **Step 4: Write failing positive/negative tourist dialogue tests**
```gdscript
func test_selfie_increases_audience_without_harming_tourist() -> void:
var run := _run_with_tourist()
var views_before := run.audience.views
var events := TouristService.selfie(run, _tourist_id(run))
assert_gt(run.audience.views, views_before)
assert_false(_tourist(run).metadata["ejected"])
assert_true(events.any(func(event): return event.kind == &"tourist_selfie"))
func test_exhausting_hidden_health_ejects_without_real_kill() -> void:
var run := _run_with_tourist()
while _tourist(run).metadata["hidden_health"] > 0:
TouristService.endanger(run, _tourist_id(run), 15)
assert_true(_tourist(run).metadata["ejected"])
assert_false(_tourist_is_active(run))
assert_eq(run.faction_war.kill_count(&"tourists"), 0)
assert_eq(run.moderation.strikes_for(&"mise_en_danger_touriste"), 1)
```
- [ ] **Step 5: Wire dialogue effects and achievements**
Implement `tourist_selfie` and `endanger_tourist` as explicit condition effects. Fire `tourist_met` at dialogue start once the character-level condition allows it. The first “juste pour voir” option only sets `warned_tourist_shove`; danger options affect hidden health. Do not award kill XP, normal loot, enemy-death achievements or faction kill counts.
- [ ] **Step 6: Add real-scene E2E**
Use deterministic tourist fixture in a floor-six run. Drive dialogue UI input:
1. take selfie and assert audience increases without damage/ejection;
2. close/reopen and choose warning, then real shove until ejection;
3. assert visible evacuation/moderation event, deadline penalty, no `actor_died`, no tourist remaining in active NPC view.
- [ ] **Step 7: Verify and commit**
```bash
./scripts/test-unit.sh
./scripts/test-integration.sh
./scripts/test-e2e.sh
DISPLAY= ./scripts/verify.sh
git diff --check
git commit -m "feat: add protected tourists and moderation"
```
---
### Task PR-4: Re-run strict parity gate and make the RC decision
**Files:**
- Modify: `docs/parity/ASCII_TEST_MATRIX.md`
- Modify: `scripts/run-parity-gauntlet.sh`
- Modify: `scripts/verify.sh`
- Modify: `docs/RELEASE_CHECKLIST.md`
- Modify: `README.md` only if release status changes
- Create: `tests/scripts/test_parity_recovery_gate.sh`
- Create: `docs/release/RC-<date>-evidence.md`
**Consumes:** all PR-1, PR-2 and PR-3 merged heads; local G6 gate tooling from `slice/g6-release-gauntlet` rebased/cherry-picked only after the recovery rows are covered.
**Produces:** an honest RC decision: tag only if all matrix rows pass; otherwise report exact blockers and leave tag absent.
- [ ] **Step 1: Write failing parity-recovery gate test**
```bash
# tests/scripts/test_parity_recovery_gate.sh
# A temporary matrix row with `blocked` must make run-parity-gauntlet.sh exit 1.
# A complete owned/replaced matrix must let the static gate continue.
```
- [ ] **Step 2: Run RED proof**
```bash
./tests/scripts/test_parity_recovery_gate.sh
```
Expected: runner absent, or current G6 matrix retains blocked recovery rows and exits 1.
- [ ] **Step 3: Update matrix with evidence, not claims**
Replace only these rows when their exact tests exist:
| ASCII module | Required Godot proof |
| --- | --- |
| `test_playtest_v2.py` | `test_deep_floor_profile.gd`, `test_final_floor_victory.gd`, `test_deep_floor_generation.gd`, `test_final_floor_victory_e2e.gd` |
| `test_safe_rooms_bobka.py` | `test_safe_room_service.gd`, `test_safe_room_generation.gd`, `test_bobka_safe_room_e2e.gd` |
| `test_tourists.py` | `test_tourist_service.gd`, `test_tourist_generation.gd`, `test_tourist_dialogue_e2e.gd` |
Set each row to `ported` or `replaced` only with named proof and explanation of any graphical substitution. No `blocked` remains.
- [ ] **Step 4: Run the complete Godot gauntlet in a clean worktree**
```bash
rm -rf .godot artifacts
./scripts/godot-import.sh
DISPLAY= ./scripts/verify.sh
./scripts/run-parity-gauntlet.sh
./tests/scripts/test_export_scripts.sh
./scripts/build-linux.sh
```
Verify generated-floor profile seed suites, save/load roundtrip, visual captures and Linux smoke. If any command fails, do not create a tag.
- [ ] **Step 5: Run ASCII reference read-only**
```bash
cd /home/hectelyon/Documents/Projects/ProjetsPersos/DCWASCII
python3 -m unittest discover -s tests -v
```
Record revision, command, count and exit status in `docs/release/RC-<date>-evidence.md`. Do not write to the ASCII repository.
- [ ] **Step 6: Make the release decision**
Only if all gates are green:
```bash
git tag -a v0.1.0-rc1 -m "Godot full-port release candidate"
git push origin v0.1.0-rc1
```
If a gate is red, do not tag or call it an RC. Add the precise failure and the owning next task to the evidence document.
- [ ] **Step 7: Verify and commit**
```bash
./tests/scripts/test_parity_recovery_gate.sh
./scripts/run-parity-gauntlet.sh
DISPLAY= ./scripts/verify.sh
git diff --check
git commit -m "chore: revalidate parity recovery release gate"
```
---
## Definition of Done
This recovery plan is complete only when:
1. The three former G6 rows have named Godot proof and are no longer `blocked`.
2. Final-floor descent at floor 18 produces victory without floor 19.
3. Deep generation has a bounded but demonstrably large floor-15 profile (>150 rooms), entrance/exit reachability and deterministic output.
4. Every generated non-surface floor guarantees a safe room outside the entrance, with a bed and Bobka ration flow.
5. Tourists spawn only at/after floor 6, at most one per floor, can award audience through selfie, and are ejected—not killed—with exactly one moderation strike on exhaustion.
6. The strict parity script, all Godot suites, clean-worktree import, capture checks, Linux export smoke and read-only ASCII suite pass.
7. A release candidate tag exists only after the previous six conditions pass.
## Self-review
- **Coverage:** each of the three G6 blocked modules has one vertical capability slice and named test seams; PR-4 owns the re-gate.
- **Consistency:** final floor uses `18`; deep scale mirrors ASCII bounded formulas; Bobka uses existing imported IDs; tourist details map to existing dialogue effects/data and F4/F5 services.
- **Scope discipline:** PR-1 handles endgame/scale, PR-2 safe rooms, PR-3 tourists, PR-4 release validation. No task quietly introduces the next task’s aggregate.
- **Honesty:** PR-4 explicitly permits a red release decision. A tag is conditional on evidence, never on plan completion alone.
@@ -0,0 +1,116 @@
# Playtest Parity Fixes Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** Corriger les quatre écarts constatés en playtest concernant le jalon race/classe, la lisibilité de l’interface, la représentation du combat et le niveau principal.
**Architecture:** Conserver les domaines existants et corriger les branchements qui les exposent. La création de partie reste limitée aux paramètres de run; un panneau modal dédié consomme `ClassEngine` à l’entrée de l’étage 3. Le monde affiché reste piloté par `FloorState`, mais la surface et le profil de l’étage 1 sont alignés sur `DCWASCII`.
**Tech Stack:** Godot 4, GDScript, GUT 9.5.
**Spec:** Retours de playtest du 2026-10-07 et projet de référence `../DCWASCII` (`dcw/game.py`, `dcw/world/surface.py`, `dcw/world/generator.py`).
## Global Constraints
- Préserver la modification locale préexistante de `project.godot`.
- Ne pas confondre le niveau principal avec la minimap.
- Les choix de race puis de classe sont obligatoires à l’entrée de l’étage 3 du Donjon, pas à la création ni au niveau de personnage 3.
- Une attaque de mêlée reste déclenchée uniquement en tentant d’entrer dans la case adjacente occupée.
- Les noms techniques et le code restent en anglais.
---
### Task 1: Jalon race et classe de l’étage 3
**Files:**
- Modify: `scenes/menu/CharacterCreation.tscn`
- Modify: `scripts/presentation/menu/character_creation.gd`
- Modify: `scripts/presentation/menu/main_menu.gd`
- Modify: `scripts/game/game.gd`
- Modify: `scripts/domain/progression/class_engine.gd`
- Modify: `scripts/domain/run/run_state.gd`
- Create: `scenes/ui/RaceClassChoicePanel.tscn`
- Create: `scripts/presentation/race_class_choice_panel.gd`
- Test: `tests/e2e/test_new_run_creation_e2e.gd`
- Test: `tests/e2e/test_floor_three_race_class_e2e.gd`
**Interfaces:**
- Consumes: `ClassEngine.race_definitions()`, compatibility rules, `FloorTransition.transition()`.
- Produces: a mandatory `RaceClassChoicePanel`, an initially empty race/archetype, and a persisted `RunState.base_archetype` after confirmation.
- [ ] Add a failing creation-flow test proving there are no race/class controls and the new player has empty choices.
- [ ] Remove race/class fields and arguments from the creation flow.
- [ ] Add a failing floor-transition test proving entry to floor 3 opens a mandatory race-first modal.
- [ ] Add separate race and class application methods to `ClassEngine` and implement the modal sequence.
- [ ] Verify both focused E2E tests.
### Task 2: HUD and chest layout
**Files:**
- Modify: `scenes/Game.tscn`
- Modify: `scenes/ui/LootPanel.tscn`
- Test: `tests/unit/test_hud_layout.gd`
- Test: `tests/unit/test_loot_panel_layout.gd`
**Interfaces:**
- Consumes: existing HUD node paths retained for compatibility.
- Produces: non-overlapping visible rectangles at 1280×720.
- [ ] Add failing rectangle-intersection assertions for all visible HUD labels and chest panel sections.
- [ ] Give each visible HUD datum a distinct row and sufficient wrapping space.
- [ ] Put chest title, entries and action inside a vertical layout container.
- [ ] Verify focused layout tests.
### Task 3: Combat presentation and action wording
**Files:**
- Modify: `scripts/game/game.gd`
- Modify: `scripts/domain/turn_resolver.gd`
- Test: `tests/e2e/test_enemy_ai_e2e.gd`
- Test: `tests/unit/test_turn_resolver.gd`
**Interfaces:**
- Consumes: authoritative `ActorState.cell` positions and equipped main-hand metadata when available.
- Produces: synchronized enemy sprites after every resolved turn and melee messages that name the attack method.
- [ ] Add a failing E2E assertion that an enemy view follows the enemy state after movement.
- [ ] Resynchronize enemy views during player-action presentation updates.
- [ ] Add failing assertions that melee messages identify bare hands, equipped weapon, or natural attack while retaining damage wording.
- [ ] Add attack-method metadata to result messages without changing melee range rules.
- [ ] Verify focused combat tests.
### Task 4: Surface and procedural dungeon
**Files:**
- Modify: `scripts/domain/world/surface_generator.gd`
- Modify: `scripts/domain/world/floor_generator.gd`
- Modify: `scripts/game/game.gd`
- Modify: `tests/unit/test_surface_floor_transition.gd`
- Modify: `tests/unit/test_floor_generator_rooms.gd`
- Replace: `tests/unit/test_demo_map.gd`
- Replace: `tests/e2e/test_demo_map_chest_e2e.gd`
**Interfaces:**
- Consumes: reference surface contract (42×16, empty zone, corridor, door, stairs) and regular procedural formula `180 + floor*30`, `90 + floor*15`, `150 + floor*20`.
- Produces: the true reference surface at floor 0 and a 210×105, 170-room procedural floor 1.
- [ ] Add failing surface assertions for dimensions, empty population, entrance, door and stairs.
- [ ] Port the reference surface geometry.
- [ ] Add failing floor-1 profile assertions for map size and room target.
- [ ] Remove the obsolete shallow floor-1 profile and dead duplicate POC construction.
- [ ] Replace POC route tests with surface-to-generated-dungeon behavior tests.
- [ ] Verify world unit, integration and E2E tests.
### Task 5: Regression verification
**Files:**
- Modify only tests whose old expectations explicitly encoded the removed POC or creation-time class choice.
**Interfaces:**
- Consumes: `scripts/verify.sh` and focused GUT runners.
- Produces: passing unit, integration, E2E and visual verification without modifying `project.godot`.
- [ ] Run focused suites after every red/green cycle.
- [ ] Run `git diff --check`.
- [ ] Run `./scripts/verify.sh`.
- [ ] Inspect the regenerated visual captures for the main level, HUD and chest panel.
@@ -0,0 +1,96 @@
# Dark Fantasy Interface Refactor Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** Rebuild the in-game HUD around the supplied dark-fantasy mock-up while preserving all gameplay, input, journal, minimap, overlay, and node-path contracts.
**Architecture:** Keep `Game.tscn` and `GameHud` as the integration boundary. Add reusable imported UI textures and a shared Godot theme, then reorganize the HUD into fixed left, center, and right regions inside the existing 1920×1080 reference viewport. Existing functional nodes remain at their current `HUD/*` paths; new decoration and layout containers are additive.
**Tech Stack:** Godot 4.7, GDScript, `.tscn`/`.tres` resources, GUT tests, PNG UI assets.
**Spec:** `/home/hectelyon/Downloads/DungeonCrawlerWorld_UI_Assets/README.md` and `captures/00_maquette_complete.png`
## Global Constraints
- Treat the supplied complete mock-up as visual direction, not as frozen game content.
- Recreate all live text and interactive states in Godot.
- Preserve existing gameplay and public `HUD/*` node paths used by `game.gd` and tests.
- Keep the 1920×1080 reference viewport and `canvas_items` stretching.
- Use the transparent components for reusable controls; use capture crops only for genuinely illustrative content.
- Do not change domain/gameplay logic except where presentation data must be exposed.
- Run targeted tests, the full verification suite, and visual capture inspection before completion.
---
## File Map
- `assets/ui/dark_fantasy/*`: copied production-ready transparent UI textures and illustrative portrait/equipment art.
- `assets/ui/dark_fantasy/dark_fantasy_theme.tres`: reusable typography, colors, panel, button, and scrollbar styling.
- `scenes/Game.tscn`: new desktop HUD composition and visual hierarchy while preserving functional root paths.
- `scenes/ui/Minimap.tscn`: dark-fantasy map panel and caption styling.
- `scripts/presentation/hud.gd`: live character/header/status copy and responsive layout behavior.
- `scripts/presentation/minimap.gd`: minimap sizing based on its actual drawing region.
- `tests/unit/test_hud_layout.gd`: structural, non-overlap, content, and central-play-area contracts for the new shell.
- `tests/e2e/test_visual_readability_e2e.gd`: integration contract for the redesigned layout.
- `assets/ASSET_REGISTRY.md`: provenance and use of the supplied UI kit.
### Task 1: Import the reusable art kit and define the visual system
**Interfaces:**
- Produces: `res://assets/ui/dark_fantasy/dark_fantasy_theme.tres` and stable texture paths consumed by scenes.
- [ ] Copy only transparent reusable components plus `portrait_roger.png` and `illustration_equipement.png` into `assets/ui/dark_fantasy/`.
- [ ] Add import presets suitable for pixel-stable UI rendering where needed.
- [ ] Create `dark_fantasy_theme.tres` with parchment text, gold accents, charcoal panels, ornamental borders, focused/hover button states, and readable 16–22 px defaults.
- [ ] Register source and intended use in `assets/ASSET_REGISTRY.md`.
- [ ] Run a headless Godot import and require exit code 0.
### Task 2: Lock the desired HUD shell with failing layout tests
**Interfaces:**
- Consumes: existing `GameScene`, `GameHud`, and `Game.REFERENCE_VIEWPORT`.
- Produces: test contracts for `TopBar`, `LeftRail`, `PlayAreaFrame`, `RightRail`, and `CommandBar` under `HUD/ResponsiveLayout`.
- [ ] Replace the old compact-overlay assertions with assertions for a full-frame HUD shell, distinct non-overlapping rails, and a center gameplay viewport.
- [ ] Assert that every existing live label remains enclosed by its intended panel.
- [ ] Assert dynamic header/character fields and command hints use live game values.
- [ ] Update the visual E2E region contract to target the framed center viewport.
- [ ] Run the HUD and visual-readability tests and confirm they fail for missing new regions.
### Task 3: Build the desktop dark-fantasy HUD
**Interfaces:**
- Consumes: shared theme/textures from Task 1 and test node names from Task 2.
- Preserves: all existing direct paths such as `HUD/PlayerHealthLabel`, `HUD/EventLog`, `HUD/ContextPromptLabel`, and overlay scene paths.
- Produces: `GameHud.apply_viewport_layout(viewport_size: Vector2) -> void` and the five named layout regions.
- [ ] Add the full-screen dark backdrop, top statistics bar, left character/objective/status rail, center play frame, right journal/map rail, quick-slot strip, prompt, and bottom command bar.
- [ ] Convert HP, focus, and XP presentation to styled live gauges without changing refresh semantics.
- [ ] Add character portrait/equipment illustration as non-interactive image content.
- [ ] Add live floor, player name, room/exploration, and status labels populated by `GameHud.refresh`.
- [ ] Add viewport-layout behavior that preserves the designed proportions at 1920×1080 and keeps controls readable at 1280×720.
- [ ] Run HUD unit tests until they pass.
### Task 4: Integrate the minimap and gameplay camera with the framed center
**Interfaces:**
- Consumes: `HUD/ResponsiveLayout/PlayAreaFrame` and existing `Minimap.set_state(...)`.
- Produces: minimap drawing constrained to its inner map region; camera still tracks the actor and obeys map limits.
- [ ] Restyle `Minimap.tscn` for the right rail without changing the `HUD/Minimap` root path.
- [ ] Make minimap cell sizing use the drawable map rectangle rather than the full framed control.
- [ ] Keep hidden enemies hidden and preserve expand/collapse behavior.
- [ ] Run minimap, camera-grid, and display-layout tests until they pass.
### Task 5: Validate overlays, inputs, visual output, and responsive behavior
**Interfaces:**
- Consumes: complete redesigned HUD.
- Produces: regression evidence and captured screenshots.
- [ ] Run all HUD, prompt, minimap, navigation, combat-HUD, and level-up tests.
- [ ] Run `./scripts/run-visual-check.sh` and inspect generated captures for overlap, clipping, readability, and center-map framing.
- [ ] Run the game/capture at 1280×720 and verify the layout remains usable.
- [ ] Run `./scripts/verify.sh` and require all executable and parity gates to pass.
- [ ] Run `git diff --check` and inspect final status/diff for unrelated changes.
- [ ] Commit and push the refactor to Gitea.
@@ -0,0 +1,107 @@
# Health Regeneration and Pets Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** Porter dans le jeu Godot la régénération passive automatique des PV et rendre le familier créé avec la partie réellement configurable, persistant et utile en exploration/combat, conformément aux comportements de référence de DCWASCII.
**Architecture:** La formule de régénération reste une règle de domaine pure, appelée une seule fois à la fin de chaque tour résolu et appliquée silencieusement au joueur puis au familier vivant. Le familier reste l’agrégat `CompanionState` existant, enrichi avec son identité, ses caractéristiques de régénération et une IA agressive/défensive/soutien; la création, les transitions d’étage, l’UI et la sauvegarde consomment cet agrégat sans dupliquer les règles.
**Tech Stack:** Godot 4.7, GDScript, GUT 9.5, scènes `.tscn`, sauvegardes JSON.
**Spec:** Référence fonctionnelle `../DCWASCII/README.md` sections « Familier jouable » et « Système de soins », ainsi que `../DCWASCII/dcw/entities/{player,companion}.py`, `../DCWASCII/dcw/game.py`, `../DCWASCII/dcw/ai/companion_behaviors.py`.
## Global Constraints
- Préserver tous les changements locaux déjà présents; ne pas réinitialiser ni réécrire les modifications non liées.
- Régénération ASCII: `max(1, Endurance / 3)`, bonus `regen_bonus`, amplification de 15 % par rang de compétence Régénération au-delà du rang de base 1, puis multiplicateur de difficulté (1,5 / 1 / 0,75 / 0,5).
- La régénération est silencieuse, plafonnée aux PV max, active dès le niveau 1, une fois par tour consommé, et ne ranime jamais une entité morte.
- Le familier est optionnel, autonome, persistant, suit le joueur entre les étages et sa mort ne termine pas la partie.
- Conserver les coutures publiques et les sauvegardes existantes compatibles.
---
### Task 1: Passive health regeneration rule
**Files:**
- Create: `scripts/domain/combat/health_regeneration.gd`
- Test: `tests/unit/test_health_regeneration.gd`
**Interfaces:**
- Produces: `HealthRegeneration.amount(endurance: int, regeneration_skill: int, perk_bonus: int, difficulty_id: StringName) -> int`
- Produces: `HealthRegeneration.apply(actor: ActorState, endurance: int, regeneration_skill: int, perk_bonus: int, difficulty_id: StringName) -> int`
- [ ] **Step 1: Write the failing formula and cap/death tests**
- [ ] **Step 2: Run the focused test and confirm RED because the rule does not exist**
- [ ] **Step 3: Implement the exact ASCII formula and difficulty multipliers**
- [ ] **Step 4: Run the focused test and confirm GREEN**
### Task 2: End-of-turn regeneration integration
**Files:**
- Modify: `scripts/game/game.gd`
- Modify: `scripts/domain/entities/companion_state.gd`
- Test: `tests/e2e/test_health_regeneration_e2e.gd`
**Interfaces:**
- Consumes: `HealthRegeneration.apply(...)`
- Produces: automatic, silent player/pet healing through normal `submit_player_action` gameplay turns.
- [ ] **Step 1: Add an E2E test that damages the player, consumes real movement turns and observes exact healing without a regeneration journal event**
- [ ] **Step 2: Run it and confirm RED because completed turns do not heal**
- [ ] **Step 3: Add one centralized end-of-turn hook using the character model’s effective Endurance/skill/perk values and the run difficulty**
- [ ] **Step 4: Extend the test to a living pet and confirm dead actors remain at zero**
- [ ] **Step 5: Run focused unit/E2E tests and confirm GREEN**
### Task 3: Configurable pet identity and persistence
**Files:**
- Modify: `scripts/domain/run/run_settings.gd`
- Modify: `scripts/domain/entities/companion_state.gd`
- Modify: `scripts/presentation/menu/character_creation.gd`
- Modify: `scenes/menu/CharacterCreation.tscn`
- Modify: `scripts/infrastructure/save/save_repository.gd`
- Modify: `scripts/presentation/companion_panel.gd`
- Test: `tests/unit/test_companion.gd`
- Test: `tests/unit/test_save_repository.gd`
- Test: `tests/e2e/test_new_run_creation_e2e.gd`
**Interfaces:**
- Produces: optional `RunSettings.pet_name` and `RunSettings.pet_species`, with backward-compatible defaults.
- Produces: `CompanionState.name`, `species`, Endurance/skill/perk regeneration fields serialized with the companion.
- [ ] **Step 1: Add failing tests for identity defaults/custom values and save/load round-trip**
- [ ] **Step 2: Run focused tests and confirm RED**
- [ ] **Step 3: Add name/species fields shown only when the pet checkbox is enabled and pass them through `RunSettings`**
- [ ] **Step 4: Persist the complete companion record while accepting legacy companion records**
- [ ] **Step 5: Show name, species and PV in the companion panel**
- [ ] **Step 6: Run focused tests and confirm GREEN**
### Task 4: Functional autonomous pet behavior and floor following
**Files:**
- Modify: `scripts/domain/ai/companion_behaviors.gd`
- Modify: `scripts/domain/turn_resolver.gd`
- Modify: `scripts/game/game.gd`
- Test: `tests/unit/test_companion.gd`
- Test: `tests/e2e/test_pet_companion_e2e.gd`
**Interfaces:**
- Consumes: existing stances `FOLLOW`, `DEFEND`, `SUPPORT` as backward-compatible storage identifiers.
- Produces: aggressive chase/attack for `FOLLOW`, threat interception for `DEFEND`, low-PV player healing for `SUPPORT`, nearest-target enemy attacks, and adjacent pet placement after floor changes.
- [ ] **Step 1: Add one failing behavior test for aggressive chase and one for support healing**
- [ ] **Step 2: Run focused tests and confirm RED for the missing decisions**
- [ ] **Step 3: Implement deterministic nearest-enemy pursuit and a bounded support-heal action**
- [ ] **Step 4: Resolve heal actions and make enemies pursue/attack the nearer living player or pet, with ties favoring the pet**
- [ ] **Step 5: Add an E2E floor-transition assertion that the pet is placed next to the player**
- [ ] **Step 6: Run pet unit/integration/E2E tests and confirm GREEN**
### Task 5: Verification and parity evidence
**Files:**
- Modify: `docs/parity/ASCII_TEST_MATRIX.md` only if a new explicit mapping row/note is required.
- [ ] **Step 1: Run unit tests for regeneration, companions, settings and saves**
- [ ] **Step 2: Run pet/new-run/regeneration E2E tests**
- [ ] **Step 3: Run the project verification script and inspect failures**
- [ ] **Step 4: Confirm `git diff --check` and review the final diff for unrelated changes**
@@ -0,0 +1,103 @@
# Save, Ranged Combat, and Pet Controls Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** Rendre la sauvegarde accessible sans menu Échap, déplacer l’attaque à distance sur `F` avec sélection de cible et tour ennemi immédiat, puis exposer trois comportements de familier en français avec un sprite temporaire de chien.
**Architecture:** Le menu principal reste le propriétaire du `SaveRepository`, mais le jeu actif lui demande d’ouvrir le panneau de sauvegarde par signal afin d’éviter un second dépôt et de conserver les cinq emplacements existants. Le ciblage à distance continue d’utiliser `RangedCombat` et `TargetingOverlay`; seules la touche, la validation des cibles et la résolution complète du tour sont renforcées. Les identifiants persistés des postures du familier restent compatibles, tandis que leurs libellés et règles deviennent « reste en arrière », « défends-moi » et « attaque à vue ».
**Tech Stack:** Godot 4.7, GDScript, GUT 9.5, scènes `.tscn`, sauvegardes JSON.
**Spec:** Retour de playtest utilisateur du 2026-10-08.
## Global Constraints
- Préserver tous les changements locaux déjà présents; ne pas réinitialiser ni réécrire les modifications non liées.
- L’attaque à distance se déclenche sur `F` seulement si une arme à distance est équipée; `Entrée` confirme et `Échap` annule la cible sans consommer de tour.
- Une attaque à distance valide consomme exactement un tour et fait immédiatement résoudre le déplacement ou l’attaque des adversaires survivants.
- Les trois comportements visibles du familier sont « Reste en arrière », « Défends-moi » et « Attaque à vue ».
- Le familier utilise temporairement un sprite animal de type chien compatible avec la licence CC0 existante.
- Conserver la lecture des anciennes sauvegardes et des anciennes valeurs de posture.
---
### Task 1: Sauvegarde accessible et explicite
**Files:**
- Modify: `project.godot`
- Modify: `scripts/game/input_bindings.gd`
- Modify: `scripts/game/game.gd`
- Modify: `scripts/presentation/menu/main_menu.gd`
- Modify: `scripts/presentation/save_load_panel.gd`
- Modify: `scenes/ui/SaveLoadPanel.tscn`
- Modify: `tests/unit/test_action_router.gd`
- Modify: `tests/e2e/test_save_load_e2e.gd`
- Modify: `docs/PLAYING.md`
**Interfaces:**
- Produces: input action `save` on `Ctrl+S`, routed as `PlayerAction(&"save")`.
- Produces: `Game.save_requested` connected by `MainMenu` to `show_save_slots()`.
- Produces: French save-panel feedback that states that saves are manual and confirms the slot written.
- [ ] Add a failing action-router assertion for `save` and an E2E test that `Ctrl+S` opens the save-slot panel during a run.
- [ ] Add the input binding/help label and the `Game.save_requested` signal branch.
- [ ] Connect the game signal in `MainMenu` and keep repository ownership there.
- [ ] Translate/clarify save-panel labels and update the player documentation.
- [ ] Run focused action-router and save/load tests.
### Task 2: Attaque à distance sur F et tour ennemi
**Files:**
- Modify: `project.godot`
- Modify: `scripts/game/input_bindings.gd`
- Modify: `scripts/game/game.gd`
- Modify: `scripts/presentation/targeting_overlay.gd`
- Modify: `tests/e2e/test_ranged_targeting_e2e.gd`
- Modify: `tests/e2e/test_input_action_router_e2e.gd`
- Modify: `docs/PLAYING.md`
**Interfaces:**
- Produces: `F` bound to `ranged`; the obsolete standalone `attack` input is removed because melee remains movement into an adjacent enemy.
- Produces: targeting candidates filtered by weapon range and line of sight.
- Consumes: `TurnResolver.append_enemy_response(...)` for every valid shot against a surviving enemy.
- [ ] Add failing E2E assertions proving `F` opens targeting, invalid/no-weapon input does not consume a turn, cancellation does not consume a turn, and a valid shot advances exactly one turn while the enemy approaches.
- [ ] Move `ranged` from `R` to `F` and remove the conflicting unused `attack` action from the input catalog/map.
- [ ] Filter displayed targets through `RangedCombat` validation without consuming ammunition.
- [ ] Keep confirmation/cancellation explicit in French and resolve one enemy response after a valid shot.
- [ ] Run focused ranged, input, turn-resolver, and combat tests.
### Task 3: Comportements du familier et sprite chien
**Files:**
- Modify: `scripts/domain/entities/companion_state.gd`
- Modify: `scripts/domain/ai/companion_behaviors.gd`
- Modify: `scripts/domain/turn_resolver.gd`
- Modify: `scripts/infrastructure/save/save_repository.gd`
- Modify: `scripts/presentation/companion_panel.gd`
- Modify: `scenes/Game.tscn`
- Create: `assets/dcss/war_dog.png`
- Modify: `assets/ASSET_REGISTRY.md`
- Modify: `tests/unit/test_companion.gd`
- Modify: `tests/e2e/test_pet_companion_e2e.gd`
**Interfaces:**
- Produces: persistent stances `stay_back`, `defend`, `attack_on_sight`, while mapping legacy `follow`, `defend`, `support` values.
- Produces: behavior rules where `stay_back` follows without engaging, `defend` attacks threats adjacent to the player, and `attack_on_sight` pursues the nearest living enemy.
- Produces: French UI labels/descriptions and `assets/dcss/war_dog.png` on `$World/Companion`.
- [ ] Add failing deterministic unit tests for the three named policies and an E2E panel-selection test for their French labels.
- [ ] Define the new stance identifiers and compatibility aliases/migration.
- [ ] Implement passive following, player defense, and nearest-enemy aggression.
- [ ] Replace support-only interception checks with the defend stance and update journal wording.
- [ ] Copy the local CC0 DCSS war-dog tile, wire it to the companion sprite, and register its source/license.
- [ ] Run focused companion, support-compatibility, save, and pet E2E tests.
### Task 4: Vérification
**Files:**
- Modify: `docs/parity/ASCII_TEST_MATRIX.md` only if a mapped contract needs an explicit note.
- [ ] Run all unit, integration, and E2E suites.
- [ ] Run the visual check and inspect the companion sprite and new HUD/help wording.
- [ ] Run `git diff --check` and inspect the final diff for unrelated changes.
@@ -0,0 +1,57 @@
# Temporary Starting Playtest Chests Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** Garantir temporairement trois coffres dans la salle de départ d’une nouvelle partie pour tester la mêlée, la distance et un sort offensif.
**Architecture:** Un module `TemporaryPlaytestKit` isolé place trois coffres à récompense fixe sur l’étage de surface. `Game` l’appelle uniquement lors d’une nouvelle partie configurée, jamais lors du chargement d’une sauvegarde ni dans le générateur procédural. Les récompenses utilisent le flux normal des coffres; le payload de distance ajoute des munitions et le grimoire utilise l’effet normal `learn_spell`.
**Tech Stack:** Godot 4.5, GDScript, GUT.
**Spec:** Retour de playtest du 2026-10-08.
## Global Constraints
- Code explicitement temporaire et supprimable dans un fichier autonome.
- Exactement trois coffres de playtest sur une nouvelle surface.
- Aucun changement aux tables de loot ou aux étages procéduraux.
- Les sauvegardes chargées ne recréent pas les coffres.
- Récompenses fixes : mêlée, distance avec munitions, grimoire offensif.
---
### Task 1: Fixture temporaire de coffres
**Files:**
- Create: `scripts/game/temporary_playtest_kit.gd`
- Modify: `scripts/game/game.gd`
- Create: `tests/e2e/test_temporary_playtest_chests_e2e.gd`
**Interfaces:**
- Produces: `TemporaryPlaytestKit.apply_to_new_run(floor: FloorState) -> void`.
- [ ] Écrire un test E2E rouge instanciant une nouvelle partie et exigeant trois coffres fixes accessibles.
- [ ] Créer le module isolé avec trois cellules, trois récompenses et un marqueur metadata temporaire.
- [ ] Appeler le module seulement dans le chemin de nouvelle partie configurée.
- [ ] Vérifier qu’un chargement ne recrée aucun coffre.
### Task 2: Récompenses réellement testables
**Files:**
- Modify: `scripts/game/game.gd`
- Modify: `tests/e2e/test_temporary_playtest_chests_e2e.gd`
**Interfaces:**
- Consumes: payload coffre `ammunition` et effet d’objet `learn_spell`.
- Produces: munitions ajoutées lors de la récupération; `SpellState.learn(spell_id)` lors de l’utilisation du grimoire.
- [ ] Tester l’ouverture/récupération normale de chaque coffre.
- [ ] Ajouter les munitions du payload à `ActorState.ammunition` dans `_take_all_loot`.
- [ ] Après `InventoryState.use_item`, appliquer les effets `learn_spell` acceptés à `spell_state`.
- [ ] Vérifier qu’on peut équiper l’arme à distance, cibler avec F, et sélectionner le sort avec X après lecture.
### Task 3: Vérification
- [ ] Exécuter les tests ciblés coffre/inventaire/distance/magie.
- [ ] Exécuter les suites unitaires et E2E.
- [ ] Exécuter `git diff --check` et vérifier que le code temporaire reste contenu dans son module.
@@ -0,0 +1,144 @@
# UI, Input, Loot, and 1080p Fixes Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** Corriger les panneaux à choix illisibles, rendre la sauvegarde accessible depuis le jeu embarqué dans l’éditeur, fiabiliser les flèches de déplacement, diversifier les coffres, matérialiser le butin des ennemis et migrer l’affichage de référence vers 1920×1080.
**Architecture:** Les panneaux modaux utilisent des conteneurs de mise en page plutôt que des offsets concurrents. Le routeur d’entrée conserve l’InputMap, mais expose une touche de sauvegarde sans modificateur qui n’est pas interceptée par l’éditeur et verrouille un seul déplacement par pression physique. Le résolveur de butin interdit de sélectionner deux fois le même objet pendant une résolution, tandis qu’une étape post-combat unique dans `Game` matérialise les tables de butin sur la cellule de mort pour toutes les voies létales. La résolution de référence devient un contrat 1920×1080 partagé par le projet, les tests et la capture visuelle.
**Tech Stack:** Godot 4.5, GDScript, GUT 9.5, scènes `.tscn`, JSON de contenu, scripts Bash/Python de vérification visuelle.
**Spec:** Retours de playtest et capture fournis le 2026-10-08.
## Global Constraints
- Préserver les nombreuses modifications locales déjà présentes et ne pas réinitialiser les fichiers hors périmètre.
- Les PNJ ne sont jamais des cibles de combat ou des sources de butin ennemi.
- Les corrections restent déterministes pour un seed et un contexte identiques.
- Les objets d’ennemis doivent être visibles au sol et passer par le flux de ramassage existant.
- Le viewport, la fenêtre de référence et les captures deviennent exactement 1920×1080.
- Les panneaux ne doivent plus superposer le récit, les choix et l’aide, y compris avec du texte long.
---
### Task 1: Résolution de référence 1920×1080
**Files:**
- Modify: `project.godot`
- Modify: `scripts/game/game.gd`
- Modify: `scripts/check-visual-capture.py`
- Modify: `scripts/run-visual-check.sh`
- Modify: `scripts/build-linux.sh`
- Modify: `tests/scripts/test_godot_import_runners.sh`
- Modify: `tests/unit/test_display_layout.gd`
- Modify: `tests/e2e/test_display_camera_grid_e2e.gd`
- Modify: `tests/unit/test_hud_layout.gd`
- Modify: `docs/PLAYING.md`
**Interfaces:**
- Produces: `Game.REFERENCE_VIEWPORT == Vector2i(1920, 1080)`.
- Produces: exact 1920×1080 PNG visual captures and smoke displays.
- [ ] Add failing assertions for the new project and `Game` reference dimensions.
- [ ] Change project viewport/window overrides and the public game constant.
- [ ] Update Xvfb, fake PNG and PNG validation dimensions; derive the measured dungeon crop from the new dimensions.
- [ ] Re-express the central HUD clearance area relative to `REFERENCE_VIEWPORT`.
- [ ] Run display, HUD, E2E camera and script-runner tests.
### Task 2: Panneaux de choix adaptatifs et non chevauchants
**Files:**
- Modify: `scenes/ui/EventPanel.tscn`
- Modify: `scenes/ui/DialoguePanel.tscn`
- Modify: `scenes/ui/QuestPanel.tscn`
- Modify: `scripts/presentation/event_panel.gd`
- Modify: `scripts/presentation/dialogue_panel.gd`
- Modify: `scripts/presentation/quest_panel.gd`
- Modify: affected E2E node paths
- Create: `tests/unit/test_choice_panel_layout.gd`
**Interfaces:**
- Produces: each modal as `PanelContainer > VBoxContainer Layout > Title, Body, Entries, Help`.
- Produces: distinct, contained narrative, choice and help rectangles at 1920×1080.
- [ ] Write a failing rectangle test with representative multiline narrative and choices for Event, Dialogue and Quest.
- [ ] Replace direct children and absolute offsets with one `VBoxContainer`, content margins and explicit vertical allocation.
- [ ] Update scripts and E2E paths from `$Body`/`$Entries` to `$Layout/Body`/`$Layout/Entries`.
- [ ] Verify at least 12 px logical separation and containment after two layout frames.
- [ ] Run choice-panel, dialogue, event and quest tests.
### Task 3: Sauvegarde utilisable depuis le debug embarqué et entrée fiable
**Files:**
- Modify: `project.godot`
- Modify: `scripts/game/input_bindings.gd`
- Modify: `scripts/game/action_router.gd`
- Modify: `scripts/game/game.gd`
- Modify: `scenes/Game.tscn`
- Modify: `tests/unit/test_action_router.gd`
- Modify: `tests/e2e/test_save_load_e2e.gd`
- Modify: `tests/e2e/test_input_action_router_e2e.gd`
- Modify: `docs/PLAYING.md`
**Interfaces:**
- Consumes: existing `save` player action and `Game.save_requested` signal.
- Produces: `V` as editor-safe save shortcut while retaining `Ctrl+S` for standalone/exported builds.
- Produces: one movement action per non-echo physical arrow press.
- [ ] Add a failing E2E test that opens save slots with plain `V` through real input.
- [ ] Add `V` as a second `save` binding and document why `Ctrl+S` is intercepted by the Godot editor’s own Save command in embedded play.
- [ ] Add a repeated alternating Up/Down E2E test proving every press is routed once and echo events do not create or swallow actions.
- [ ] Handle arrow physical keycodes deterministically before ambiguous action matching and ignore `InputEventKey.echo` for turn commands.
- [ ] Update the HUD/help text and run action/input/save tests.
### Task 4: Coffres sans objets répétés
**Files:**
- Modify: `scripts/domain/items/loot_resolver.gd`
- Modify: `scripts/domain/world/floor_populator.gd`
- Modify: `tests/unit/test_loot_resolver.gd`
- Modify: `tests/unit/test_floor_populator.gd`
- Modify: `tests/e2e/test_world_chest_loot_e2e.gd`
**Interfaces:**
- Produces: `LootResolver.resolve(...)` selects each `item_id` at most once per reward; explicit `min_qty/max_qty` remains the sole source of quantity.
- Produces: ordinary treasure rooms use `floor_treasure`, not arbitrary enemy or boss tables.
- [ ] Add a failing dominant-weight multi-roll test showing the same item is currently selected twice.
- [ ] Filter already-selected item IDs from subsequent weighted rolls while leaving gold/empty repeatable.
- [ ] Assert that generated treasure chests use the floor treasure table.
- [ ] Run resolver, chest, population and deterministic-generation tests.
### Task 5: Butin ennemi matérialisé et ramassable
**Files:**
- Modify: `scripts/game/game.gd`
- Modify: `scripts/domain/magic/magic_engine.gd`
- Modify: `scripts/presentation/loot_feedback.gd`
- Modify: `tests/e2e/test_melee_feedback_e2e.gd`
- Modify: `tests/e2e/test_ranged_targeting_e2e.gd`
- Modify: `tests/e2e/test_spell_casting_e2e.gd`
- Modify: `tests/unit/test_save_repository.gd`
**Interfaces:**
- Produces: one post-combat materialization step that resolves each `loot_dropped` descriptor exactly once.
- Produces: valid `ItemInstance` entries in `FloorState.ground_items[death_cell]` and immediate run gold credit.
- Produces: resolved `loot_dropped` payload containing `loot_table`, `items`, `gold`, and `empty`.
- [ ] Add a failing melee E2E assertion that a catalog-backed killed enemy leaves a ground item at its death cell.
- [ ] Resolve the enemy loot table using a stable `enemy:<floor>:<actor_id>` context before event journaling, create item instances, add them to `ground_items`, and credit gold.
- [ ] Add the missing loot descriptor to lethal spell outcomes so magic shares the same post-combat pipeline.
- [ ] Verify melee, ranged, companion and spell deaths each materialize once, and the existing interaction picks the item up.
- [ ] Verify save/load round-trips the generated drop and update feedback wording from “secured” to “dropped”.
### Task 6: Verification complète
**Files:**
- Modify: no production files unless a verified regression requires it.
- [ ] Run all unit tests.
- [ ] Run all integration tests.
- [ ] Run all E2E tests.
- [ ] Run visual capture and inspect both 1920×1080 images.
- [ ] Run matrix parity gate and `git diff --check`.
- [ ] Review the final diff for unrelated or generated temporary files.
+178 -42
View File
@@ -1,56 +1,192 @@
; Engine configuration file.
; GUT 9.5.0 is pinned under addons/gut.
; It's best edited using the editor UI and not directly,
; since the parameters that go here are not all obvious.
;
; Format:
; [section] ; section goes between []
; param=value ; assign values to parameters
config_version=5
[application]
config/name="Dungeon Crawler World"
run/main_scene="res://scenes/menu/MainMenu.tscn"
config/features=PackedStringArray("4.7")
[display]
window/size/viewport_width=1280
window/size/viewport_height=720
window/size/window_width_override=1280
window/size/window_height_override=720
window/size/resizable=true
window/size/viewport_width=1920
window/size/viewport_height=1080
window/size/window_width_override=1920
window/size/window_height_override=1080
window/stretch/mode="canvas_items"
[rendering]
renderer/rendering_method="gl_compatibility"
renderer/rendering_method.mobile="gl_compatibility"
textures/default_filters/use_nearest_mipmap_filter=false
textures/canvas_textures/default_texture_filter=0
[editor_plugins]
enabled=PackedStringArray("res://addons/gut/plugin.cfg")
[input]
interact={"deadzone":0.5,"events":[Object(InputEventKey,"physical_keycode":32),Object(InputEventKey,"physical_keycode":69)]}
move_north={"deadzone":0.5,"events":[Object(InputEventKey,"physical_keycode":87),Object(InputEventKey,"physical_keycode":4194320)]}
move_south={"deadzone":0.5,"events":[Object(InputEventKey,"physical_keycode":83),Object(InputEventKey,"physical_keycode":4194322)]}
move_west={"deadzone":0.5,"events":[Object(InputEventKey,"physical_keycode":65),Object(InputEventKey,"physical_keycode":4194319)]}
move_east={"deadzone":0.5,"events":[Object(InputEventKey,"physical_keycode":68),Object(InputEventKey,"physical_keycode":4194321)]}
move_northwest={"deadzone":0.5,"events":[Object(InputEventKey,"physical_keycode":81)]}
move_northeast={"deadzone":0.5,"events":[Object(InputEventKey,"physical_keycode":4194447)]}
move_southwest={"deadzone":0.5,"events":[Object(InputEventKey,"physical_keycode":90)]}
move_southeast={"deadzone":0.5,"events":[Object(InputEventKey,"physical_keycode":67)]}
wait={"deadzone":0.5,"events":[Object(InputEventKey,"physical_keycode":46)]}
attack={"deadzone":0.5,"events":[Object(InputEventKey,"physical_keycode":70)]}
ranged={"deadzone":0.5,"events":[Object(InputEventKey,"physical_keycode":82)]}
cast={"deadzone":0.5,"events":[Object(InputEventKey,"physical_keycode":88)]}
talk={"deadzone":0.5,"events":[Object(InputEventKey,"physical_keycode":84)]}
rest={"deadzone":0.5,"events":[Object(InputEventKey,"physical_keycode":72)]}
inventory={"deadzone":0.5,"events":[Object(InputEventKey,"physical_keycode":73)]}
crafting={"deadzone":0.5,"events":[Object(InputEventKey,"physical_keycode":66)]}
character={"deadzone":0.5,"events":[Object(InputEventKey,"physical_keycode":80)]}
quest={"deadzone":0.5,"events":[Object(InputEventKey,"physical_keycode":74)]}
companion={"deadzone":0.5,"events":[Object(InputEventKey,"physical_keycode":75)]}
party={"deadzone":0.5,"events":[Object(InputEventKey,"physical_keycode":71)]}
achievements={"deadzone":0.5,"events":[Object(InputEventKey,"physical_keycode":76)]}
audience={"deadzone":0.5,"events":[Object(InputEventKey,"physical_keycode":85)]}
recap={"deadzone":0.5,"events":[Object(InputEventKey,"physical_keycode":89)]}
factions={"deadzone":0.5,"events":[Object(InputEventKey,"physical_keycode":77)]}
moderation={"deadzone":0.5,"events":[Object(InputEventKey,"physical_keycode":78)]}
map={"deadzone":0.5,"events":[Object(InputEventKey,"physical_keycode":4194308)]}
help={"deadzone":0.5,"events":[Object(InputEventKey,"physical_keycode":4194332)]}
toggle_log={"deadzone":0.5,"events":[Object(InputEventKey,"physical_keycode":76)]}
options={"deadzone":0.5,"events":[Object(InputEventKey,"physical_keycode":79)]}
interact={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":69,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
move_north={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194320,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
move_south={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194322,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
move_west={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194319,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
move_east={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194321,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
move_northwest={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":81,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
move_northeast={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194447,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
move_southwest={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":90,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
move_southeast={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":67,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
wait={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":46,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
ranged={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":70,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
save={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":true,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":86,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
cast={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":88,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
talk={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":84,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
rest={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":72,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
inventory={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":73,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
crafting={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":66,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
character={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":80,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
quest={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":74,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
companion={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":75,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
party={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":71,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
achievements={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":76,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
audience={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":85,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
recap={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":89,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
factions={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":77,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
moderation={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":78,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
map={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194308,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
help={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194332,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
toggle_log={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":76,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
options={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":79,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
[rendering]
textures/canvas_textures/default_texture_filter=0
renderer/rendering_method="gl_compatibility"
renderer/rendering_method.mobile="gl_compatibility"
+263 -156
View File
@@ -1,10 +1,11 @@
[gd_scene load_steps=19 format=3]
[gd_scene load_steps=24 format=3]
[ext_resource type="Script" path="res://scripts/game/game.gd" id="1_game"]
[ext_resource type="Script" path="res://scripts/presentation/map_renderer.gd" id="2_map"]
[ext_resource type="Script" path="res://scripts/presentation/actor_view.gd" id="3_actor"]
[ext_resource type="Script" path="res://scripts/presentation/hud.gd" id="4_hud"]
[ext_resource type="Texture2D" path="res://assets/dcss/player.png" id="5_player"]
[ext_resource type="Texture2D" path="res://assets/dcss/war_dog.png" id="35_companion"]
[ext_resource type="Script" path="res://scripts/infrastructure/audio_library.gd" id="6_audio"]
[ext_resource type="Script" path="res://scripts/presentation/event_presenter.gd" id="7_presenter"]
[ext_resource type="PackedScene" path="res://scenes/overlays/CombatFeedback.tscn" id="8_feedback"]
@@ -23,16 +24,26 @@
[ext_resource type="PackedScene" path="res://scenes/ui/PartyPanel.tscn" id="19_party"]
[ext_resource type="PackedScene" path="res://scenes/ui/CharacterPanel.tscn" id="20_character"]
[ext_resource type="PackedScene" path="res://scenes/ui/ProgressionChoicePanel.tscn" id="21_progression_choice"]
[ext_resource type="PackedScene" path="res://scenes/ui/RaceClassChoicePanel.tscn" id="34_race_class_choice"]
[ext_resource type="PackedScene" path="res://scenes/ui/AchievementPanel.tscn" id="22_achievement"]
[ext_resource type="PackedScene" path="res://scenes/ui/AudiencePanel.tscn" id="23_audience"]
[ext_resource type="PackedScene" path="res://scenes/ui/RecapPanel.tscn" id="24_recap"]
[ext_resource type="PackedScene" path="res://scenes/ui/FactionPanel.tscn" id="25_faction"]
[ext_resource type="PackedScene" path="res://scenes/ui/ModerationPanel.tscn" id="26_moderation"]
[ext_resource type="PackedScene" path="res://scenes/ui/DeathPanel.tscn" id="27_death"]
[ext_resource type="PackedScene" path="res://scenes/ui/VictoryPanel.tscn" id="33_victory"]
[ext_resource type="PackedScene" path="res://scenes/ui/Minimap.tscn" id="28_minimap"]
[ext_resource type="PackedScene" path="res://scenes/ui/OptionsPanel.tscn" id="29_options"]
[ext_resource type="PackedScene" path="res://scenes/ui/HelpPanel.tscn" id="30_help"]
[ext_resource type="Theme" path="res://assets/ui/dark_fantasy/dark_fantasy_theme.tres" id="36_hud_theme"]
[ext_resource type="Texture2D" path="res://assets/ui/dark_fantasy/header_800x54.png" id="37_hud_header"]
[ext_resource type="Texture2D" path="res://assets/ui/dark_fantasy/portrait_roger.png" id="38_hud_portrait"]
[ext_resource type="Texture2D" path="res://assets/ui/dark_fantasy/illustration_equipement.png" id="39_hud_equipment"]
[ext_resource type="Texture2D" path="res://assets/ui/dark_fantasy/jauge_vie_pleine.png" id="40_hud_health"]
[ext_resource type="Texture2D" path="res://assets/ui/dark_fantasy/jauge_focus_pleine.png" id="41_hud_focus"]
[ext_resource type="Texture2D" path="res://assets/ui/dark_fantasy/jauge_xp_pleine.png" id="42_hud_xp"]
[sub_resource type="StyleBoxFlat" id="StyleBox_hud_panel"]
bg_color = Color(0.035, 0.055, 0.09, 0.9)
border_width_left = 2
@@ -49,6 +60,25 @@ content_margin_top = 8.0
content_margin_right = 12.0
content_margin_bottom = 8.0
[sub_resource type="StyleBoxFlat" id="StyleBox_xp_background"]
bg_color = Color(0.025, 0.055, 0.075, 1)
border_width_left = 1
border_width_top = 1
border_width_right = 1
border_width_bottom = 1
border_color = Color(0.35, 0.48, 0.62, 1)
corner_radius_top_left = 4
corner_radius_top_right = 4
corner_radius_bottom_right = 4
corner_radius_bottom_left = 4
[sub_resource type="StyleBoxFlat" id="StyleBox_xp_fill"]
bg_color = Color(0.35, 0.72, 1, 1)
corner_radius_top_left = 3
corner_radius_top_right = 3
corner_radius_bottom_right = 3
corner_radius_bottom_left = 3
[sub_resource type="StyleBoxFlat" id="StyleBox_prompt_panel"]
bg_color = Color(0.08, 0.12, 0.16, 0.94)
border_width_left = 2
@@ -61,6 +91,48 @@ corner_radius_top_right = 6
corner_radius_bottom_right = 6
corner_radius_bottom_left = 6
[sub_resource type="StyleBoxFlat" id="StyleBox_opaque_outside_artboard"]
bg_color = Color(0.012, 0.018, 0.028, 1)
border_width_left = 1
border_width_top = 1
border_width_right = 1
border_width_bottom = 1
border_color = Color(0.19, 0.15, 0.09, 1)
[sub_resource type="StyleBoxFlat" id="StyleBox_play_frame"]
bg_color = Color(0.008, 0.012, 0.018, 0.0)
border_width_left = 3
border_width_top = 3
border_width_right = 3
border_width_bottom = 3
border_color = Color(0.67, 0.48, 0.19, 0.95)
corner_radius_top_left = 10
corner_radius_top_right = 10
corner_radius_bottom_right = 10
corner_radius_bottom_left = 10
[sub_resource type="StyleBoxTexture" id="StyleBox_health_fill"]
texture = ExtResource("40_hud_health")
texture_margin_left = 4.0
texture_margin_top = 4.0
texture_margin_right = 4.0
texture_margin_bottom = 4.0
[sub_resource type="StyleBoxTexture" id="StyleBox_focus_fill"]
texture = ExtResource("41_hud_focus")
texture_margin_left = 4.0
texture_margin_top = 4.0
texture_margin_right = 4.0
texture_margin_bottom = 4.0
[sub_resource type="StyleBoxTexture" id="StyleBox_xp_fill_dark_fantasy"]
texture = ExtResource("42_hud_xp")
texture_margin_left = 4.0
texture_margin_top = 4.0
texture_margin_right = 4.0
texture_margin_bottom = 4.0
[node name="Game" type="Node2D"]
script = ExtResource("1_game")
@@ -91,8 +163,7 @@ script = ExtResource("3_actor")
[node name="Enemies" type="Node2D" parent="World"]
[node name="Companion" type="Sprite2D" parent="World"]
texture = ExtResource("5_player")
modulate = Color(0.62, 0.87, 1, 1)
texture = ExtResource("35_companion")
script = ExtResource("3_actor")
[node name="Party" type="Node2D" parent="World"]
@@ -131,6 +202,8 @@ script = ExtResource("4_hud")
[node name="ProgressionChoicePanel" parent="HUD" instance=ExtResource("21_progression_choice")]
[node name="RaceClassChoicePanel" parent="HUD" instance=ExtResource("34_race_class_choice")]
[node name="AchievementPanel" parent="HUD" instance=ExtResource("22_achievement")]
[node name="AudiencePanel" parent="HUD" instance=ExtResource("23_audience")]
@@ -143,6 +216,8 @@ script = ExtResource("4_hud")
[node name="DeathPanel" parent="HUD" instance=ExtResource("27_death")]
[node name="VictoryPanel" parent="HUD" instance=ExtResource("33_victory")]
[node name="Minimap" parent="HUD" instance=ExtResource("28_minimap")]
[node name="OptionsPanel" parent="HUD" instance=ExtResource("29_options")]
@@ -150,231 +225,263 @@ script = ExtResource("4_hud")
[node name="HelpPanel" parent="HUD" instance=ExtResource("30_help")]
[node name="AchievementToast" type="Label" parent="HUD"]
offset_left = 390.0
offset_top = 18.0
offset_right = 890.0
offset_bottom = 48.0
layout_mode = 0
theme_override_colors/font_color = Color(1, 0.82, 0.42, 1)
theme_override_font_sizes/font_size = 18
horizontal_alignment = 1
vertical_alignment = 1
[node name="TitleLabel" type="Label" parent="HUD"]
offset_left = 390.0
offset_top = 48.0
offset_right = 890.0
offset_bottom = 74.0
theme_override_colors/font_color = Color(0.75, 0.94, 0.55, 1)
layout_mode = 0
theme_override_colors/font_color = Color(0.95, 0.79, 0.36, 1)
theme_override_font_sizes/font_size = 20
horizontal_alignment = 1
vertical_alignment = 1
[node name="HeaderValuesLabel" type="Label" parent="HUD" groups=["hud_header_values"]]
layout_mode = 0
theme_override_colors/font_color = Color(0.86, 0.78, 0.58, 1)
theme_override_font_sizes/font_size = 16
horizontal_alignment = 1
vertical_alignment = 1
text = "Sans-Nom • Étage 0 • Salle inconnue • 0 cases explorées"
[node name="ResponsiveLayout" type="Control" parent="HUD"]
layout_mode = 3
z_index = -1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
theme = ExtResource("36_hud_theme")
[node name="DarkBackdrop" type="Control" parent="HUD/ResponsiveLayout"]
layout_mode = 0
mouse_filter = 2
[node name="Artboard" type="Control" parent="HUD/ResponsiveLayout"]
layout_mode = 0
mouse_filter = 2
[node name="LetterboxTop" type="Panel" parent="HUD/ResponsiveLayout"]
layout_mode = 0
mouse_filter = 2
theme_override_styles/panel = SubResource("StyleBox_opaque_outside_artboard")
[node name="LetterboxBottom" type="Panel" parent="HUD/ResponsiveLayout"]
layout_mode = 0
mouse_filter = 2
theme_override_styles/panel = SubResource("StyleBox_opaque_outside_artboard")
[node name="PillarboxLeft" type="Panel" parent="HUD/ResponsiveLayout"]
layout_mode = 0
mouse_filter = 2
theme_override_styles/panel = SubResource("StyleBox_opaque_outside_artboard")
[node name="PillarboxRight" type="Panel" parent="HUD/ResponsiveLayout"]
layout_mode = 0
mouse_filter = 2
theme_override_styles/panel = SubResource("StyleBox_opaque_outside_artboard")
[node name="TopBar" type="Panel" parent="HUD/ResponsiveLayout"]
layout_mode = 0
mouse_filter = 2
[node name="HeaderOrnament" type="TextureRect" parent="HUD/ResponsiveLayout"]
layout_mode = 0
mouse_filter = 2
texture = ExtResource("37_hud_header")
expand_mode = 1
stretch_mode = 5
[node name="LeftRail" type="Panel" parent="HUD/ResponsiveLayout"]
layout_mode = 0
mouse_filter = 2
[node name="PlayAreaFrame" type="Panel" parent="HUD/ResponsiveLayout"]
layout_mode = 0
mouse_filter = 2
show_behind_parent = true
theme_override_styles/panel = SubResource("StyleBox_play_frame")
[node name="RightRail" type="Panel" parent="HUD/ResponsiveLayout"]
layout_mode = 0
mouse_filter = 2
[node name="CommandBar" type="Panel" parent="HUD/ResponsiveLayout"]
layout_mode = 0
mouse_filter = 2
[node name="StatsPanel" type="PanelContainer" parent="HUD/ResponsiveLayout"]
layout_mode = 1
anchors_preset = 0
offset_left = 12.0
offset_top = 12.0
offset_right = 248.0
offset_bottom = 170.0
grow_horizontal = 0
grow_vertical = 0
layout_mode = 0
mouse_filter = 2
theme_override_styles/panel = SubResource("StyleBox_hud_panel")
[node name="LogPanel" type="PanelContainer" parent="HUD/ResponsiveLayout"]
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -256.0
offset_top = 12.0
offset_right = -12.0
offset_bottom = 170.0
grow_horizontal = 0
grow_vertical = 0
layout_mode = 0
mouse_filter = 2
theme_override_styles/panel = SubResource("StyleBox_hud_panel")
[node name="PromptPanel" type="PanelContainer" parent="HUD/ResponsiveLayout"]
layout_mode = 1
anchors_preset = 10
anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
offset_left = -280.0
offset_top = -90.0
offset_right = 280.0
offset_bottom = -52.0
grow_horizontal = 2
grow_vertical = 0
layout_mode = 0
mouse_filter = 2
theme_override_styles/panel = SubResource("StyleBox_prompt_panel")
[node name="HelpPanel" type="PanelContainer" parent="HUD/ResponsiveLayout"]
layout_mode = 1
anchors_preset = 12
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 12.0
offset_top = -42.0
offset_right = -12.0
offset_bottom = -12.0
grow_horizontal = 2
grow_vertical = 0
layout_mode = 0
mouse_filter = 2
theme_override_styles/panel = SubResource("StyleBox_hud_panel")
[node name="QuickSlotStrip" type="PanelContainer" parent="HUD/ResponsiveLayout"]
layout_mode = 0
mouse_filter = 2
theme_override_styles/panel = SubResource("StyleBox_hud_panel")
[node name="QuickSlotHint" type="Label" parent="HUD/ResponsiveLayout"]
layout_mode = 0
mouse_filter = 2
theme_override_colors/font_color = Color(0.86, 0.78, 0.58, 1)
theme_override_font_sizes/font_size = 16
text = "[1] Arme [2] Sort [3] Soin [4] Inventaire"
horizontal_alignment = 1
vertical_alignment = 1
[node name="PortraitIllustration" type="TextureRect" parent="HUD/ResponsiveLayout"]
layout_mode = 0
mouse_filter = 2
texture = ExtResource("38_hud_portrait")
expand_mode = 1
stretch_mode = 5
[node name="EquipmentIllustration" type="TextureRect" parent="HUD/ResponsiveLayout"]
layout_mode = 0
mouse_filter = 2
texture = ExtResource("39_hud_equipment")
expand_mode = 1
stretch_mode = 5
[node name="PlayerHealthLabel" type="Label" parent="HUD"]
layout_mode = 1
anchors_preset = 0
offset_left = 26.0
offset_top = 26.0
offset_right = 236.0
offset_bottom = 46.0
grow_horizontal = 0
grow_vertical = 0
theme_override_colors/font_color = Color(1, 1, 1, 1)
layout_mode = 0
theme_override_colors/font_color = Color(1, 0.78, 0.68, 1)
theme_override_font_sizes/font_size = 18
text = "Player HP: 12/12"
vertical_alignment = 1
[node name="HealthBar" type="ProgressBar" parent="HUD"]
layout_mode = 0
mouse_filter = 2
max_value = 12.0
value = 12.0
show_percentage = false
theme_override_styles/background = SubResource("StyleBox_xp_background")
theme_override_styles/fill = SubResource("StyleBox_health_fill")
[node name="PlayerFocusLabel" type="Label" parent="HUD"]
layout_mode = 1
anchors_preset = 0
offset_left = 26.0
offset_top = 48.0
offset_right = 236.0
offset_bottom = 68.0
grow_horizontal = 0
grow_vertical = 0
layout_mode = 0
theme_override_colors/font_color = Color(0.7, 0.8, 1, 1)
theme_override_font_sizes/font_size = 18
text = "Focus: 3/3"
vertical_alignment = 1
[node name="FocusBar" type="ProgressBar" parent="HUD"]
layout_mode = 0
mouse_filter = 2
max_value = 3.0
value = 3.0
show_percentage = false
theme_override_styles/background = SubResource("StyleBox_xp_background")
theme_override_styles/fill = SubResource("StyleBox_focus_fill")
[node name="ExperienceBar" type="ProgressBar" parent="HUD"]
layout_mode = 0
mouse_filter = 2
theme_override_styles/background = SubResource("StyleBox_xp_background")
theme_override_styles/fill = SubResource("StyleBox_xp_fill_dark_fantasy")
show_percentage = false
[node name="ExperienceLabel" type="Label" parent="HUD"]
layout_mode = 0
mouse_filter = 2
theme_override_colors/font_color = Color(0.92, 0.97, 1, 1)
theme_override_colors/font_shadow_color = Color(0, 0, 0, 0.9)
theme_override_constants/shadow_offset_x = 1
theme_override_constants/shadow_offset_y = 1
theme_override_font_sizes/font_size = 14
text = "Niveau 1 — XP 0/100"
horizontal_alignment = 1
vertical_alignment = 1
[node name="CharacterStatusLabel" type="Label" parent="HUD" groups=["hud_character_values"]]
layout_mode = 0
theme_override_colors/font_color = Color(0.75, 0.9, 0.72, 1)
theme_override_font_sizes/font_size = 15
text = "État : 12 PV • 3 Focus"
autowrap_mode = 2
vertical_alignment = 1
[node name="GoldLabel" type="Label" parent="HUD"]
layout_mode = 1
anchors_preset = 0
offset_left = 26.0
offset_top = 70.0
offset_right = 236.0
offset_bottom = 90.0
grow_horizontal = 0
grow_vertical = 0
layout_mode = 0
theme_override_colors/font_color = Color(1, 0.84, 0.35, 1)
theme_override_font_sizes/font_size = 18
text = "Or: 0"
vertical_alignment = 1
[node name="QuestTrackerLabel" type="Label" parent="HUD"]
layout_mode = 1
anchors_preset = 0
offset_left = 26.0
offset_top = 92.0
offset_right = 360.0
offset_bottom = 112.0
grow_horizontal = 0
grow_vertical = 0
layout_mode = 0
theme_override_colors/font_color = Color(0.65, 1, 0.72, 1)
theme_override_font_sizes/font_size = 14
text = "Quêtes : aucune"
autowrap_mode = 2
vertical_alignment = 1
[node name="SpellLabel" type="Label" parent="HUD"]
layout_mode = 1
anchors_preset = 0
offset_left = 26.0
offset_top = 92.0
offset_right = 360.0
offset_bottom = 112.0
grow_horizontal = 0
grow_vertical = 0
layout_mode = 0
theme_override_colors/font_color = Color(0.82, 0.7, 1, 1)
theme_override_font_sizes/font_size = 14
vertical_alignment = 1
[node name="EnemyHealthLabel" type="Label" parent="HUD"]
layout_mode = 1
anchors_preset = 0
offset_left = 26.0
offset_top = 114.0
offset_right = 236.0
offset_bottom = 134.0
grow_horizontal = 0
grow_vertical = 0
layout_mode = 0
theme_override_colors/font_color = Color(1, 0.8, 0.7, 1)
theme_override_font_sizes/font_size = 18
theme_override_font_sizes/font_size = 16
vertical_alignment = 1
[node name="CombatSummaryLabel" type="Label" parent="HUD"]
layout_mode = 1
anchors_preset = 0
offset_left = 26.0
offset_top = 114.0
offset_right = 236.0
offset_bottom = 134.0
grow_horizontal = 0
grow_vertical = 0
layout_mode = 0
theme_override_colors/font_color = Color(1, 0.9, 0.5, 1)
theme_override_font_sizes/font_size = 16
theme_override_font_sizes/font_size = 15
autowrap_mode = 2
vertical_alignment = 1
[node name="DeadlineLabel" type="Label" parent="HUD"]
layout_mode = 1
anchors_preset = 0
offset_left = 26.0
offset_top = 138.0
offset_right = 360.0
offset_bottom = 158.0
grow_horizontal = 0
grow_vertical = 0
layout_mode = 0
theme_override_colors/font_color = Color(1, 0.76, 0.4, 1)
theme_override_font_sizes/font_size = 14
autowrap_mode = 2
vertical_alignment = 1
[node name="EventLog" type="RichTextLabel" parent="HUD"]
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -244.0
offset_top = 22.0
offset_right = -24.0
offset_bottom = 158.0
grow_horizontal = 0
grow_vertical = 0
layout_mode = 0
mouse_filter = 2
bbcode_enabled = false
fit_content = false
theme_override_colors/default_color = Color(1, 1, 0.8, 1)
theme_override_font_sizes/normal_font_size = 14
[node name="ContextPromptLabel" type="Label" parent="HUD"]
layout_mode = 1
anchors_preset = 10
anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
offset_left = -266.0
offset_top = -85.0
offset_right = 266.0
offset_bottom = -57.0
grow_horizontal = 2
grow_vertical = 0
[node name="ContextPromptLabel" type="Label" parent="HUD" groups=["hud_command_hints"]]
layout_mode = 0
theme_override_colors/font_color = Color(1, 0.92, 0.63, 1)
theme_override_font_sizes/font_size = 16
horizontal_alignment = 1
vertical_alignment = 1
[node name="HelpLabel" type="Label" parent="HUD"]
layout_mode = 1
anchors_preset = 12
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 28.0
offset_top = -37.0
offset_right = -28.0
offset_bottom = -17.0
grow_horizontal = 2
grow_vertical = 0
[node name="HelpLabel" type="Label" parent="HUD" groups=["hud_command_hints"]]
layout_mode = 0
theme_override_colors/font_color = Color(0.82, 0.9, 1, 1)
theme_override_font_sizes/font_size = 14
text = "Déplacer : ZQSD / Flèches (nord-est : pavé num. 9) • Interagir : Espace ou E"
text = "Déplacer : ZQSD / Flèches (nord-est : pavé num. 9) • Interagir : Espace ou E • Distance : F • Familier : K • Sauvegarder : V / Ctrl+S • Aide : F1"
clip_text = true
horizontal_alignment = 1
vertical_alignment = 1
+17 -34
View File
@@ -35,9 +35,9 @@ anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -270.0
offset_top = -350.0
offset_top = -310.0
offset_right = 270.0
offset_bottom = 350.0
offset_bottom = 310.0
grow_horizontal = 2
grow_vertical = 2
theme_override_styles/panel = SubResource("StyleBox_panel")
@@ -68,43 +68,26 @@ custom_minimum_size = Vector2(0, 31)
layout_mode = 2
placeholder_text = "Sans-Nom"
[node name="ArchetypeLabel" type="Label" parent="Panel/Layout/Fields"]
layout_mode = 2
text = "Base archetype"
[node name="ArchetypeOption" type="OptionButton" parent="Panel/Layout/Fields"]
custom_minimum_size = Vector2(0, 31)
layout_mode = 2
item_count = 3
selected = 0
popup/item_0/text = "Vanguard"
popup/item_0/id = 0
popup/item_0/metadata = "vanguard"
popup/item_1/text = "Mystic"
popup/item_1/id = 1
popup/item_1/metadata = "mystic"
popup/item_2/text = "Scout"
popup/item_2/id = 2
popup/item_2/metadata = "scout"
[node name="RaceLabel" type="Label" parent="Panel/Layout/Fields"]
layout_mode = 2
text = "Race"
[node name="RaceOption" type="OptionButton" parent="Panel/Layout/Fields"]
custom_minimum_size = Vector2(0, 31)
layout_mode = 2
[node name="RecommendationLabel" type="Label" parent="Panel/Layout/Fields"]
layout_mode = 2
autowrap_mode = 2
theme_override_colors/font_color = Color(0.72, 0.8, 0.92, 1)
[node name="PetCheck" type="CheckBox" parent="Panel/Layout/Fields"]
custom_minimum_size = Vector2(0, 27)
layout_mode = 2
text = "Bring a pet companion"
[node name="PetDetails" type="VBoxContainer" parent="Panel/Layout/Fields"]
visible = false
layout_mode = 2
theme_override_constants/separation = 4
[node name="PetNameEdit" type="LineEdit" parent="Panel/Layout/Fields/PetDetails"]
custom_minimum_size = Vector2(0, 31)
layout_mode = 2
placeholder_text = "Pet name (Familier)"
[node name="PetSpeciesEdit" type="LineEdit" parent="Panel/Layout/Fields/PetDetails"]
custom_minimum_size = Vector2(0, 31)
layout_mode = 2
placeholder_text = "Nature / species (Animal)"
[node name="SeedLabel" type="Label" parent="Panel/Layout/Fields"]
layout_mode = 2
text = "Generation seed"
+46 -25
View File
@@ -13,6 +13,10 @@ corner_radius_top_left = 8
corner_radius_top_right = 8
corner_radius_bottom_right = 8
corner_radius_bottom_left = 8
content_margin_left = 32.0
content_margin_top = 22.0
content_margin_right = 32.0
content_margin_bottom = 22.0
[node name="DeathPanel" type="PanelContainer"]
visible = false
@@ -22,40 +26,57 @@ anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -310.0
offset_top = -190.0
offset_right = 310.0
offset_bottom = 190.0
offset_left = -340.0
offset_top = -230.0
offset_right = 340.0
offset_bottom = 230.0
grow_horizontal = 2
grow_vertical = 2
theme_override_styles/panel = SubResource("StyleBox_death_panel")
script = ExtResource("1_death")
[node name="Title" type="Label" parent="."]
layout_mode = 1
anchors_preset = 10
anchor_left = 0.5
anchor_right = 0.5
offset_left = -260.0
offset_top = 22.0
offset_right = 260.0
offset_bottom = 54.0
grow_horizontal = 2
[node name="Layout" type="VBoxContainer" parent="."]
layout_mode = 2
theme_override_constants/separation = 16
[node name="Title" type="Label" parent="Layout"]
custom_minimum_size = Vector2(0, 42)
layout_mode = 2
theme_override_colors/font_color = Color(1, 0.38, 0.34, 1)
theme_override_font_sizes/font_size = 27
text = "VOUS ÊTES MORT"
horizontal_alignment = 1
vertical_alignment = 1
[node name="Body" type="RichTextLabel" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 40.0
offset_top = 75.0
offset_right = -40.0
offset_bottom = -34.0
grow_horizontal = 2
grow_vertical = 2
[node name="Body" type="RichTextLabel" parent="Layout"]
layout_mode = 2
size_flags_vertical = 3
theme_override_colors/default_color = Color(1, 0.91, 0.9, 1)
theme_override_font_sizes/normal_font_size = 18
[node name="Hint" type="Label" parent="Layout"]
custom_minimum_size = Vector2(0, 24)
layout_mode = 2
theme_override_colors/font_color = Color(1, 0.78, 0.72, 1)
theme_override_font_sizes/font_size = 15
horizontal_alignment = 1
[node name="Actions" type="HBoxContainer" parent="Layout"]
layout_mode = 2
theme_override_constants/separation = 12
alignment = 1
[node name="LoadButton" type="Button" parent="Layout/Actions"]
custom_minimum_size = Vector2(170, 42)
layout_mode = 2
text = "CHARGER"
[node name="NewRunButton" type="Button" parent="Layout/Actions"]
custom_minimum_size = Vector2(190, 42)
layout_mode = 2
text = "NOUVELLE PARTIE"
[node name="MenuButton" type="Button" parent="Layout/Actions"]
custom_minimum_size = Vector2(150, 42)
layout_mode = 2
text = "MENU PRINCIPAL"
+35 -55
View File
@@ -13,6 +13,10 @@ corner_radius_top_left = 8
corner_radius_top_right = 8
corner_radius_bottom_right = 8
corner_radius_bottom_left = 8
content_margin_left = 36.0
content_margin_top = 28.0
content_margin_right = 36.0
content_margin_bottom = 28.0
[node name="DialoguePanel" type="PanelContainer"]
visible = false
@@ -22,70 +26,46 @@ anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -300.0
offset_top = -205.0
offset_right = 300.0
offset_bottom = 205.0
offset_left = -480.0
offset_top = -360.0
offset_right = 480.0
offset_bottom = 360.0
grow_horizontal = 2
grow_vertical = 2
theme_override_styles/panel = SubResource("StyleBox_dialogue_panel")
script = ExtResource("1_dialogue")
[node name="Title" type="Label" parent="."]
layout_mode = 1
anchors_preset = 10
anchor_left = 0.5
anchor_right = 0.5
offset_left = -270.0
offset_top = 18.0
offset_right = 270.0
offset_bottom = 46.0
grow_horizontal = 2
theme_override_colors/font_color = Color(0.55, 0.9, 1, 1)
theme_override_font_sizes/font_size = 21
horizontal_alignment = 1
[node name="Layout" type="VBoxContainer" parent="."]
layout_mode = 2
theme_override_constants/separation = 16
[node name="Body" type="RichTextLabel" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 30.0
offset_top = 58.0
offset_right = -30.0
offset_bottom = -175.0
grow_horizontal = 2
grow_vertical = 2
[node name="Title" type="Label" parent="Layout"]
custom_minimum_size = Vector2(0, 42)
layout_mode = 2
theme_override_colors/font_color = Color(0.55, 0.9, 1, 1)
theme_override_font_sizes/font_size = 24
horizontal_alignment = 1
vertical_alignment = 1
[node name="Body" type="RichTextLabel" parent="Layout"]
custom_minimum_size = Vector2(0, 300)
layout_mode = 2
size_flags_vertical = 3
theme_override_colors/default_color = Color(0.92, 0.95, 1, 1)
theme_override_font_sizes/normal_font_size = 18
theme_override_font_sizes/normal_font_size = 20
[node name="Entries" type="RichTextLabel" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 30.0
offset_top = 238.0
offset_right = -30.0
offset_bottom = -48.0
grow_horizontal = 2
grow_vertical = 2
[node name="Entries" type="RichTextLabel" parent="Layout"]
custom_minimum_size = Vector2(0, 190)
layout_mode = 2
size_flags_vertical = 3
theme_override_colors/default_color = Color(1, 0.9, 0.5, 1)
theme_override_font_sizes/normal_font_size = 17
theme_override_font_sizes/normal_font_size = 19
[node name="Help" type="Label" parent="."]
layout_mode = 1
anchors_preset = 10
anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
offset_left = -270.0
offset_top = -42.0
offset_right = 270.0
offset_bottom = -18.0
grow_horizontal = 2
[node name="Help" type="Label" parent="Layout"]
custom_minimum_size = Vector2(0, 34)
layout_mode = 2
theme_override_colors/font_color = Color(0.55, 0.9, 1, 1)
theme_override_font_sizes/font_size = 16
text = "↑/↓ Choisir Entrée Confirmer Échap Partir"
theme_override_font_sizes/font_size = 17
text = "↑/↓ Choisir Entrée Confirmer Échap Partir"
horizontal_alignment = 1
vertical_alignment = 1
+35 -55
View File
@@ -13,6 +13,10 @@ corner_radius_top_left = 8
corner_radius_top_right = 8
corner_radius_bottom_right = 8
corner_radius_bottom_left = 8
content_margin_left = 36.0
content_margin_top = 28.0
content_margin_right = 36.0
content_margin_bottom = 28.0
[node name="EventPanel" type="PanelContainer"]
visible = false
@@ -22,70 +26,46 @@ anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -300.0
offset_top = -205.0
offset_right = 300.0
offset_bottom = 205.0
offset_left = -480.0
offset_top = -360.0
offset_right = 480.0
offset_bottom = 360.0
grow_horizontal = 2
grow_vertical = 2
theme_override_styles/panel = SubResource("StyleBox_event_panel")
script = ExtResource("1_event")
[node name="Title" type="Label" parent="."]
layout_mode = 1
anchors_preset = 10
anchor_left = 0.5
anchor_right = 0.5
offset_left = -270.0
offset_top = 18.0
offset_right = 270.0
offset_bottom = 46.0
grow_horizontal = 2
theme_override_colors/font_color = Color(1, 0.84, 0.42, 1)
theme_override_font_sizes/font_size = 21
horizontal_alignment = 1
[node name="Layout" type="VBoxContainer" parent="."]
layout_mode = 2
theme_override_constants/separation = 16
[node name="Body" type="RichTextLabel" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 30.0
offset_top = 58.0
offset_right = -30.0
offset_bottom = -175.0
grow_horizontal = 2
grow_vertical = 2
[node name="Title" type="Label" parent="Layout"]
custom_minimum_size = Vector2(0, 42)
layout_mode = 2
theme_override_colors/font_color = Color(1, 0.84, 0.42, 1)
theme_override_font_sizes/font_size = 24
horizontal_alignment = 1
vertical_alignment = 1
[node name="Body" type="RichTextLabel" parent="Layout"]
custom_minimum_size = Vector2(0, 300)
layout_mode = 2
size_flags_vertical = 3
theme_override_colors/default_color = Color(0.92, 0.95, 1, 1)
theme_override_font_sizes/normal_font_size = 18
theme_override_font_sizes/normal_font_size = 20
[node name="Entries" type="RichTextLabel" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 30.0
offset_top = 238.0
offset_right = -30.0
offset_bottom = -48.0
grow_horizontal = 2
grow_vertical = 2
[node name="Entries" type="RichTextLabel" parent="Layout"]
custom_minimum_size = Vector2(0, 190)
layout_mode = 2
size_flags_vertical = 3
theme_override_colors/default_color = Color(1, 0.9, 0.5, 1)
theme_override_font_sizes/normal_font_size = 17
theme_override_font_sizes/normal_font_size = 19
[node name="Help" type="Label" parent="."]
layout_mode = 1
anchors_preset = 10
anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
offset_left = -270.0
offset_top = -42.0
offset_right = 270.0
offset_bottom = -18.0
grow_horizontal = 2
[node name="Help" type="Label" parent="Layout"]
custom_minimum_size = Vector2(0, 34)
layout_mode = 2
theme_override_colors/font_color = Color(1, 0.84, 0.42, 1)
theme_override_font_sizes/font_size = 16
text = "↑/↓ Choisir Entrée Confirmer Échap Partir"
theme_override_font_sizes/font_size = 17
text = "↑/↓ Choisir Entrée Confirmer Échap Partir"
horizontal_alignment = 1
vertical_alignment = 1
+43 -25
View File
@@ -13,6 +13,10 @@ corner_radius_top_left = 8
corner_radius_top_right = 8
corner_radius_bottom_right = 8
corner_radius_bottom_left = 8
content_margin_left = 24.0
content_margin_top = 18.0
content_margin_right = 24.0
content_margin_bottom = 18.0
[node name="InventoryPanel" type="PanelContainer"]
visible = false
@@ -23,43 +27,57 @@ anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -400.0
offset_top = -235.0
offset_top = -260.0
offset_right = 400.0
offset_bottom = 235.0
offset_bottom = 260.0
grow_horizontal = 2
grow_vertical = 2
theme_override_styles/panel = SubResource("StyleBox_inventory_panel")
script = ExtResource("1_inventory")
[node name="Title" type="Label" parent="."]
layout_mode = 1
anchors_preset = 10
anchor_left = 0.5
anchor_right = 0.5
offset_left = -350.0
offset_top = 18.0
offset_right = 350.0
offset_bottom = 46.0
grow_horizontal = 2
[node name="Layout" type="VBoxContainer" parent="."]
layout_mode = 2
theme_override_constants/separation = 12
[node name="Title" type="Label" parent="Layout"]
custom_minimum_size = Vector2(0, 34)
layout_mode = 2
theme_override_colors/font_color = Color(1, 0.9, 0.5, 1)
theme_override_font_sizes/font_size = 24
text = "INVENTORY"
text = "INVENTAIRE"
horizontal_alignment = 1
vertical_alignment = 1
[node name="Entries" type="RichTextLabel" parent="."]
layout_mode = 0
offset_left = 28.0
offset_top = 66.0
offset_right = 355.0
offset_bottom = 400.0
[node name="Columns" type="HBoxContainer" parent="Layout"]
layout_mode = 2
size_flags_vertical = 3
theme_override_constants/separation = 20
[node name="Entries" type="RichTextLabel" parent="Layout/Columns"]
custom_minimum_size = Vector2(300, 0)
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
theme_override_colors/default_color = Color(0.92, 0.95, 1, 1)
theme_override_font_sizes/normal_font_size = 18
scroll_active = true
scroll_following = false
[node name="Details" type="RichTextLabel" parent="."]
layout_mode = 0
offset_left = 380.0
offset_top = 66.0
offset_right = 770.0
offset_bottom = 420.0
[node name="Details" type="RichTextLabel" parent="Layout/Columns"]
custom_minimum_size = Vector2(400, 0)
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
theme_override_colors/default_color = Color(0.92, 0.95, 1, 1)
theme_override_font_sizes/normal_font_size = 17
scroll_active = true
scroll_following = false
[node name="Footer" type="Label" parent="Layout"]
custom_minimum_size = Vector2(0, 28)
layout_mode = 2
theme_override_colors/font_color = Color(1, 0.9, 0.5, 1)
theme_override_font_sizes/font_size = 16
text = "↑/↓ Sélectionner E Équiper U Utiliser D Jeter I Fermer"
horizontal_alignment = 1
vertical_alignment = 1
+20 -34
View File
@@ -13,6 +13,10 @@ corner_radius_top_left = 8
corner_radius_top_right = 8
corner_radius_bottom_right = 8
corner_radius_bottom_left = 8
content_margin_left = 30.0
content_margin_top = 18.0
content_margin_right = 30.0
content_margin_bottom = 18.0
[node name="LootPanel" type="PanelContainer"]
visible = false
@@ -31,49 +35,31 @@ grow_vertical = 2
theme_override_styles/panel = SubResource("StyleBox_loot_panel")
script = ExtResource("1_loot")
[node name="Title" type="Label" parent="."]
layout_mode = 1
anchors_preset = 10
anchor_left = 0.5
anchor_right = 0.5
offset_left = -180.0
offset_top = 18.0
offset_right = 180.0
offset_bottom = 46.0
grow_horizontal = 2
[node name="Layout" type="VBoxContainer" parent="."]
layout_mode = 2
theme_override_constants/separation = 14
[node name="Title" type="Label" parent="Layout"]
custom_minimum_size = Vector2(0, 34)
layout_mode = 2
theme_override_colors/font_color = Color(1, 0.9, 0.5, 1)
theme_override_font_sizes/font_size = 24
text = "COFFRE OUVERT"
horizontal_alignment = 1
vertical_alignment = 1
[node name="Entries" type="RichTextLabel" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 30.0
offset_top = 66.0
offset_right = -30.0
offset_bottom = -70.0
grow_horizontal = 2
grow_vertical = 2
[node name="Entries" type="RichTextLabel" parent="Layout"]
custom_minimum_size = Vector2(0, 148)
layout_mode = 2
size_flags_vertical = 3
theme_override_colors/default_color = Color(0.92, 0.95, 1, 1)
theme_override_font_sizes/normal_font_size = 19
[node name="TakeAll" type="Label" parent="."]
layout_mode = 1
anchors_preset = 10
anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
offset_left = -180.0
offset_top = -52.0
offset_right = 180.0
offset_bottom = -22.0
grow_horizontal = 2
grow_vertical = 0
[node name="TakeAll" type="Label" parent="Layout"]
custom_minimum_size = Vector2(0, 30)
layout_mode = 2
theme_override_colors/font_color = Color(1, 0.9, 0.5, 1)
theme_override_font_sizes/font_size = 17
text = "Entrée / Espace — Tout prendre"
horizontal_alignment = 1
vertical_alignment = 1
+36 -25
View File
@@ -3,27 +3,23 @@
[ext_resource type="Script" path="res://scripts/presentation/minimap.gd" id="1_minimap"]
[sub_resource type="StyleBoxFlat" id="StyleBox_minimap"]
bg_color = Color(0.025, 0.045, 0.085, 0.94)
border_width_left = 2
border_width_top = 2
border_width_right = 2
border_width_bottom = 2
border_color = Color(0.45, 0.75, 0.9, 0.9)
corner_radius_top_left = 6
corner_radius_top_right = 6
corner_radius_bottom_right = 6
corner_radius_bottom_left = 6
bg_color = Color(0.045, 0.035, 0.025, 0.96)
border_width_left = 3
border_width_top = 3
border_width_right = 3
border_width_bottom = 3
border_color = Color(0.67, 0.48, 0.19, 0.95)
corner_radius_top_left = 8
corner_radius_top_right = 8
corner_radius_bottom_right = 8
corner_radius_bottom_left = 8
shadow_color = Color(0, 0, 0, 0.55)
shadow_size = 5
[node name="Minimap" type="Control"]
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -188.0
offset_top = 184.0
offset_right = -20.0
offset_bottom = 352.0
grow_horizontal = 0
offset_right = 280.0
offset_bottom = 300.0
mouse_filter = 2
script = ExtResource("1_minimap")
@@ -43,13 +39,28 @@ layout_mode = 1
anchors_preset = 10
anchor_left = 0.5
anchor_right = 0.5
offset_left = -70.0
offset_top = 4.0
offset_right = 70.0
offset_bottom = 20.0
offset_left = -120.0
offset_top = 7.0
offset_right = 120.0
offset_bottom = 29.0
grow_horizontal = 2
theme_override_colors/font_color = Color(0.78, 0.94, 1, 1)
theme_override_font_sizes/font_size = 12
text = "CARTE — Tab"
theme_override_colors/font_color = Color(0.86, 0.78, 0.58, 1)
theme_override_font_sizes/font_size = 13
text = "CARTOGRAPHIE — TAB"
horizontal_alignment = 1
vertical_alignment = 1
mouse_filter = 2
[node name="MapRegion" type="Control" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 14.0
offset_top = 40.0
offset_right = -14.0
offset_bottom = -14.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
clip_contents = true
+35 -55
View File
@@ -13,6 +13,10 @@ corner_radius_top_left = 8
corner_radius_top_right = 8
corner_radius_bottom_right = 8
corner_radius_bottom_left = 8
content_margin_left = 36.0
content_margin_top = 28.0
content_margin_right = 36.0
content_margin_bottom = 28.0
[node name="QuestPanel" type="PanelContainer"]
visible = false
@@ -22,70 +26,46 @@ anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -300.0
offset_top = -205.0
offset_right = 300.0
offset_bottom = 205.0
offset_left = -480.0
offset_top = -360.0
offset_right = 480.0
offset_bottom = 360.0
grow_horizontal = 2
grow_vertical = 2
theme_override_styles/panel = SubResource("StyleBox_quest_panel")
script = ExtResource("1_quest")
[node name="Title" type="Label" parent="."]
layout_mode = 1
anchors_preset = 10
anchor_left = 0.5
anchor_right = 0.5
offset_left = -270.0
offset_top = 18.0
offset_right = 270.0
offset_bottom = 46.0
grow_horizontal = 2
theme_override_colors/font_color = Color(0.55, 1, 0.67, 1)
theme_override_font_sizes/font_size = 21
horizontal_alignment = 1
[node name="Layout" type="VBoxContainer" parent="."]
layout_mode = 2
theme_override_constants/separation = 16
[node name="Body" type="RichTextLabel" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 30.0
offset_top = 58.0
offset_right = -30.0
offset_bottom = -175.0
grow_horizontal = 2
grow_vertical = 2
[node name="Title" type="Label" parent="Layout"]
custom_minimum_size = Vector2(0, 42)
layout_mode = 2
theme_override_colors/font_color = Color(0.55, 1, 0.67, 1)
theme_override_font_sizes/font_size = 24
horizontal_alignment = 1
vertical_alignment = 1
[node name="Body" type="RichTextLabel" parent="Layout"]
custom_minimum_size = Vector2(0, 300)
layout_mode = 2
size_flags_vertical = 3
theme_override_colors/default_color = Color(0.92, 0.95, 1, 1)
theme_override_font_sizes/normal_font_size = 17
theme_override_font_sizes/normal_font_size = 19
[node name="Entries" type="RichTextLabel" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 30.0
offset_top = 220.0
offset_right = -30.0
offset_bottom = -48.0
grow_horizontal = 2
grow_vertical = 2
[node name="Entries" type="RichTextLabel" parent="Layout"]
custom_minimum_size = Vector2(0, 190)
layout_mode = 2
size_flags_vertical = 3
theme_override_colors/default_color = Color(0.7, 1, 0.75, 1)
theme_override_font_sizes/normal_font_size = 17
theme_override_font_sizes/normal_font_size = 19
[node name="Help" type="Label" parent="."]
layout_mode = 1
anchors_preset = 10
anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
offset_left = -270.0
offset_top = -42.0
offset_right = 270.0
offset_bottom = -18.0
grow_horizontal = 2
[node name="Help" type="Label" parent="Layout"]
custom_minimum_size = Vector2(0, 34)
layout_mode = 2
theme_override_colors/font_color = Color(0.55, 1, 0.67, 1)
theme_override_font_sizes/font_size = 16
text = "↑/↓ Choisir Entrée Accepter A Abandonner Échap Fermer"
theme_override_font_sizes/font_size = 17
text = "↑/↓ Choisir Entrée Accepter A Abandonner Échap Fermer"
horizontal_alignment = 1
vertical_alignment = 1
+60
View File
@@ -0,0 +1,60 @@
[gd_scene load_steps=3 format=3]
[ext_resource type="Script" path="res://scripts/presentation/race_class_choice_panel.gd" id="1_panel"]
[sub_resource type="StyleBoxFlat" id="StyleBox_panel"]
bg_color = Color(0.035, 0.055, 0.09, 0.99)
border_width_left = 3
border_width_top = 3
border_width_right = 3
border_width_bottom = 3
border_color = Color(0.96, 0.76, 0.28, 0.95)
corner_radius_top_left = 8
corner_radius_top_right = 8
corner_radius_bottom_right = 8
corner_radius_bottom_left = 8
content_margin_left = 28.0
content_margin_top = 22.0
content_margin_right = 28.0
content_margin_bottom = 22.0
[node name="RaceClassChoicePanel" type="PanelContainer"]
visible = false
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -390.0
offset_top = -300.0
offset_right = 390.0
offset_bottom = 300.0
grow_horizontal = 2
grow_vertical = 2
theme_override_styles/panel = SubResource("StyleBox_panel")
script = ExtResource("1_panel")
[node name="Layout" type="VBoxContainer" parent="."]
layout_mode = 2
theme_override_constants/separation = 12
[node name="Title" type="Label" parent="Layout"]
custom_minimum_size = Vector2(0, 34)
layout_mode = 2
theme_override_colors/font_color = Color(0.96, 0.82, 0.42, 1)
theme_override_font_sizes/font_size = 23
horizontal_alignment = 1
[node name="Intro" type="Label" parent="Layout"]
custom_minimum_size = Vector2(0, 28)
layout_mode = 2
autowrap_mode = 2
theme_override_colors/font_color = Color(0.8, 0.88, 1, 1)
horizontal_alignment = 1
[node name="Options" type="RichTextLabel" parent="Layout"]
layout_mode = 2
size_flags_vertical = 3
theme_override_colors/default_color = Color(0.92, 0.95, 1, 1)
theme_override_font_sizes/normal_font_size = 16
+2 -2
View File
@@ -52,7 +52,7 @@ layout_mode = 2
theme_override_colors/font_color = Color(0.96, 0.84, 0.44, 1)
theme_override_font_sizes/font_size = 26
horizontal_alignment = 1
text = "LOAD RUN"
text = "CHARGER UNE PARTIE"
[node name="Slots" type="VBoxContainer" parent="Panel/Layout"]
layout_mode = 2
@@ -92,4 +92,4 @@ horizontal_alignment = 1
[node name="CancelButton" type="Button" parent="Panel/Layout"]
custom_minimum_size = Vector2(0, 40)
layout_mode = 2
text = "BACK"
text = "RETOUR"
+61
View File
@@ -0,0 +1,61 @@
[gd_scene load_steps=3 format=3]
[ext_resource type="Script" path="res://scripts/presentation/victory_panel.gd" id="1_victory"]
[sub_resource type="StyleBoxFlat" id="StyleBox_victory_panel"]
bg_color = Color(0.035, 0.1, 0.08, 0.98)
border_width_left = 4
border_width_top = 4
border_width_right = 4
border_width_bottom = 4
border_color = Color(0.95, 0.78, 0.3, 0.98)
corner_radius_top_left = 8
corner_radius_top_right = 8
corner_radius_bottom_right = 8
corner_radius_bottom_left = 8
[node name="VictoryPanel" type="PanelContainer"]
visible = false
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -310.0
offset_top = -190.0
offset_right = 310.0
offset_bottom = 190.0
grow_horizontal = 2
grow_vertical = 2
theme_override_styles/panel = SubResource("StyleBox_victory_panel")
script = ExtResource("1_victory")
[node name="Title" type="Label" parent="."]
layout_mode = 1
anchors_preset = 10
anchor_left = 0.5
anchor_right = 0.5
offset_left = -260.0
offset_top = 22.0
offset_right = 260.0
offset_bottom = 54.0
grow_horizontal = 2
theme_override_colors/font_color = Color(1, 0.82, 0.35, 1)
theme_override_font_sizes/font_size = 27
text = "VICTOIRE"
horizontal_alignment = 1
[node name="Body" type="RichTextLabel" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 40.0
offset_top = 75.0
offset_right = -40.0
offset_bottom = -34.0
grow_horizontal = 2
grow_vertical = 2
theme_override_colors/default_color = Color(0.94, 1, 0.9, 1)
theme_override_font_sizes/normal_font_size = 18
+1 -1
View File
@@ -63,7 +63,7 @@ if [[ -z "${DISPLAY:-}" ]]; then
echo "build-linux: X11 smoke unavailable: DISPLAY is unset and xvfb-run is not installed." >&2
exit 2
fi
runner=(xvfb-run --auto-servernum --server-args="-screen 0 1280x720x24")
runner=(xvfb-run --auto-servernum --server-args="-screen 0 1920x1080x24")
fi
smoke_log="build/linux/smoke.log"
+44 -14
View File
@@ -13,9 +13,16 @@ import sys
import zlib
from pathlib import Path
WIDTH = 1280
HEIGHT = 720
VIEWPORT = (256, 40, 1024, 678)
REFERENCE_WIDTH = 1920
REFERENCE_HEIGHT = 1080
EXPECTED_DIMENSIONS = {
"visual-check.png": (REFERENCE_WIDTH, REFERENCE_HEIGHT),
"visual-check-exit.png": (REFERENCE_WIDTH, REFERENCE_HEIGHT),
"visual-check-compact.png": (1280, 720),
}
# Central dungeon measurement region in the reference 1920×1080 artboard.
# It excludes the anchored HUD panels and is scaled for the real 720p capture.
REFERENCE_VIEWPORT = (384, 60, 1536, 1017)
UNKNOWN = (1, 2, 5)
# Captured explored tiles are texture modulated, so classify their blue-black
# pixels by palette range rather than expecting one flat overlay color.
@@ -68,8 +75,14 @@ def read_png(path: Path) -> tuple[int, int, list[bytes]]:
if header is None or not saw_iend or offset != len(data):
fail("incomplete PNG")
width, height, depth, color_type, compression, filtering, interlace = header
if (width, height) != (WIDTH, HEIGHT):
fail(f"expected {WIDTH}x{HEIGHT} PNG, got {width}x{height}")
expected_dimensions = EXPECTED_DIMENSIONS.get(path.name)
if expected_dimensions is None:
fail(f"unsupported visual capture name: {path.name}")
if (width, height) != expected_dimensions:
fail(
f"expected {expected_dimensions[0]}x{expected_dimensions[1]} PNG, "
f"got {width}x{height}"
)
if depth != 8 or color_type not in (2, 6):
fail("visual capture must be an 8-bit RGB or RGBA PNG")
if (compression, filtering, interlace) != (0, 0, 0):
@@ -140,23 +153,40 @@ def luminance(rgb: tuple[int, int, int]) -> float:
def is_visible(pixel: tuple[int, int, int]) -> bool:
# The unmodulated grayscale floor texture includes these neutral bright texels.
return max(pixel) - min(pixel) <= 3 and max(pixel) >= 112
# Visible terrain can be either the neutral wall texture or the brown floor
# texture. The authored surface begins in a large open room, so a capture is
# not required to include a wall inside the central measurement crop.
neutral_wall = max(pixel) - min(pixel) <= 3 and max(pixel) >= 112
unmodulated_floor = pixel in {
(23, 4, 0), (23, 7, 0), (10, 10, 0), (30, 13, 0),
(4, 4, 0), (41, 23, 1), (30, 9, 0), (66, 36, 6),
}
return neutral_wall or unmodulated_floor
def is_explored(pixel: tuple[int, int, int]) -> bool:
# Tile texture remains visible under a blue-black fog overlay. This is the
# dominant fog-modulated floor texel; keeping the detector exact avoids HUD
# colors and visible terrain satisfying it.
return pixel == (19, 29, 39)
# Texture-preserving explored terrain is rendered under a blue-black fog
# overlay. GPU blend rounding and the authored floor texture produce a
# palette rather than one portable exact RGB value; accept only its dark,
# blue-shifted range so HUD chrome and visible brown terrain cannot match.
red, green, blue = pixel
return 4 <= red <= 14 and 8 <= green <= 22 and 17 <= blue <= 32 and blue >= green + 4 and green >= red + 3
def viewport_for(width: int, height: int) -> tuple[int, int, int, int]:
scale_x = width / REFERENCE_WIDTH
scale_y = height / REFERENCE_HEIGHT
return tuple(round(coordinate * (scale_x if index % 2 == 0 else scale_y)) for index, coordinate in enumerate(REFERENCE_VIEWPORT))
def measure(path: Path) -> None:
width, height = EXPECTED_DIMENSIONS[path.name]
observed = list(pixels(path))
viewport = viewport_for(width, height)
dungeon_pixels = [
observed[y * WIDTH + x]
for y in range(VIEWPORT[1], VIEWPORT[3])
for x in range(VIEWPORT[0], VIEWPORT[2])
observed[y * width + x]
for y in range(viewport[1], viewport[3])
for x in range(viewport[0], viewport[2])
]
non_black = sum(pixel != (0, 0, 0) for pixel in dungeon_pixels)
unknown_pixels = [pixel for pixel in dungeon_pixels if pixel == UNKNOWN]
+4
View File
@@ -12,6 +12,9 @@ var max_hit_points: int
# Legacy basic damage remains the unarmed/default weapon damage.
var attack_damage: int
var content_id: StringName
# Non-combat authored NPC state (including protected tourist health) persists
# alongside the actor without exposing it to normal combat resolution.
var metadata: Dictionary = {}
# Data-backed combat stats. Defaults retain the pre-C2 prototype fixtures.
var accuracy := 30
@@ -65,6 +68,7 @@ func _init(new_id: StringName, new_cell: Vector2i, new_hit_points: int, new_atta
max_hit_points = new_hit_points
attack_damage = new_attack_damage
content_id = new_content_id if not new_content_id.is_empty() else new_id
metadata = combat_data.get("metadata", {}).duplicate(true)
accuracy = int(combat_data.get("accuracy", accuracy))
defense = int(combat_data.get("defense", defense))
armor = int(combat_data.get("armor", armor))
+52 -18
View File
@@ -3,33 +3,40 @@ extends RefCounted
const CompanionStateType = preload("res://scripts/domain/entities/companion_state.gd")
const PathfindingType = preload("res://scripts/domain/ai/pathfinding.gd")
const SUPPORT_HEAL_THRESHOLD := 0.5
const SUPPORT_HEAL_RANGE := 4
const SUPPORT_HEAL_AMOUNT := 2
static func decide(companion: CompanionState, player: ActorState, enemies: Dictionary[StringName, ActorState], map: GridMapState, blocked_cells: Dictionary[Vector2i, bool] = {}) -> Dictionary:
static func decide(companion: CompanionState, player: ActorState, enemies: Dictionary[StringName, ActorState], map: GridMapState, blocked_cells: Dictionary[Vector2i, bool] = {}, detected_cells: Dictionary[Vector2i, bool] = {}) -> Dictionary:
if companion == null or not companion.is_alive():
return {"kind": &"idle"}
match companion.stance:
CompanionStateType.Stance.FOLLOW:
match CompanionStateType.normalize_stance(companion.stance):
CompanionStateType.Stance.STAY_BACK:
return _follow(companion.actor, player, map, blocked_cells)
CompanionStateType.Stance.DEFEND:
CompanionStateType.Stance.DEFEND_ME:
return _defend(companion.actor, player, enemies, map, blocked_cells)
CompanionStateType.Stance.SUPPORT:
return {"kind": &"idle"}
CompanionStateType.Stance.ATTACK_ON_SIGHT:
return _aggressive(companion.actor, player, enemies, map, blocked_cells, detected_cells)
_:
return {"kind": &"idle"}
static func _aggressive(actor: ActorState, player: ActorState, enemies: Dictionary[StringName, ActorState], map: GridMapState, blocked_cells: Dictionary[Vector2i, bool], detected_cells: Dictionary[Vector2i, bool]) -> Dictionary:
var target := _nearest_enemy(actor.cell, enemies, detected_cells)
if target == null:
return _follow(actor, player, map, blocked_cells)
if actor.cell.distance_to(target.cell) <= 1.5:
return {"kind": &"melee", "target_id": target.id}
return _move_toward(actor, target.cell, player.cell, map, blocked_cells)
static func _support(actor: ActorState, player: ActorState, map: GridMapState, blocked_cells: Dictionary[Vector2i, bool]) -> Dictionary:
if player.is_alive() and float(player.hit_points) / float(maxi(1, player.effective_max_hit_points())) < SUPPORT_HEAL_THRESHOLD and actor.cell.distance_to(player.cell) <= SUPPORT_HEAL_RANGE:
return {"kind": &"heal_player", "amount": SUPPORT_HEAL_AMOUNT}
return _follow(actor, player, map, blocked_cells)
static func _follow(actor: ActorState, player: ActorState, map: GridMapState, blocked_cells: Dictionary[Vector2i, bool]) -> Dictionary:
if actor.cell.distance_to(player.cell) <= 1.5:
return {"kind": &"idle"}
var occupied := blocked_cells.duplicate()
occupied.erase(actor.cell)
occupied[player.cell] = true
var goals: Array[Vector2i] = []
for direction: Vector2i in PathfindingType.CARDINAL_DIRECTIONS:
var cell := player.cell + direction
if map.is_walkable(cell) and not occupied.has(cell):
goals.append(cell)
var path := PathfindingType.find_path_to_any(map, actor.cell, goals, occupied)
return {"kind": &"move", "to_cell": path.front()} if not path.is_empty() else {"kind": &"idle"}
return _move_toward(actor, player.cell, player.cell, map, blocked_cells)
static func _defend(actor: ActorState, player: ActorState, enemies: Dictionary[StringName, ActorState], map: GridMapState, blocked_cells: Dictionary[Vector2i, bool]) -> Dictionary:
var targets: Array[ActorState] = []
@@ -37,6 +44,33 @@ static func _defend(actor: ActorState, player: ActorState, enemies: Dictionary[S
if enemy.is_alive() and enemy.cell.distance_to(player.cell) <= 1.5:
targets.append(enemy)
targets.sort_custom(func(first: ActorState, second: ActorState) -> bool: return String(first.id) < String(second.id))
if not targets.is_empty() and actor.cell.distance_to(targets[0].cell) <= 1.5:
return {"kind": &"melee", "target_id": targets[0].id}
if not targets.is_empty():
if actor.cell.distance_to(targets[0].cell) <= 1.5:
return {"kind": &"melee", "target_id": targets[0].id}
return _move_toward(actor, targets[0].cell, player.cell, map, blocked_cells)
return _follow(actor, player, map, blocked_cells)
static func _move_toward(actor: ActorState, destination: Vector2i, player_cell: Vector2i, map: GridMapState, blocked_cells: Dictionary[Vector2i, bool]) -> Dictionary:
var occupied := blocked_cells.duplicate()
occupied.erase(actor.cell)
occupied[player_cell] = true
occupied[destination] = true
var goals: Array[Vector2i] = []
for direction: Vector2i in PathfindingType.CARDINAL_DIRECTIONS:
var cell := destination + direction
if map.is_walkable(cell) and not occupied.has(cell):
goals.append(cell)
var path := PathfindingType.find_path_to_any(map, actor.cell, goals, occupied)
return {"kind": &"move", "to_cell": path.front()} if not path.is_empty() else {"kind": &"idle"}
static func _nearest_enemy(origin: Vector2i, enemies: Dictionary[StringName, ActorState], detected_cells: Dictionary[Vector2i, bool]) -> ActorState:
var candidates: Array[ActorState] = []
for enemy: ActorState in enemies.values():
if enemy.is_alive() and detected_cells.has(enemy.cell):
candidates.append(enemy)
candidates.sort_custom(func(first: ActorState, second: ActorState) -> bool:
var first_distance := origin.distance_squared_to(first.cell)
var second_distance := origin.distance_squared_to(second.cell)
return String(first.id) < String(second.id) if first_distance == second_distance else first_distance < second_distance
)
return candidates[0] if not candidates.is_empty() else null
+2 -1
View File
@@ -15,7 +15,8 @@ func _init(scripted_rolls: Array[float] = []) -> void:
_rolls.assign(scripted_rolls)
func resolve_attack(attacker: ActorState, defender: ActorState, grant_xp: bool = true) -> Dictionary:
var events: Array[Dictionary] = [_event(&"attack_started", attacker, defender, {"stance": String(attacker.stance)})]
var attack_method := String(attacker.metadata.get("melee_weapon_name", "mains nues" if attacker.id == &"player" else "attaque naturelle"))
var events: Array[Dictionary] = [_event(&"attack_started", attacker, defender, {"stance": String(attacker.stance), "attack_method": attack_method})]
var attack_score := attacker.accuracy - attacker.wound_severity(&"arms") * ARM_WOUND_PENALTY
var defense_score := defender.defense * 3 - defender.wound_severity(&"legs") * LEG_WOUND_PENALTY
if defender.stance == &"dodge":
+18 -1
View File
@@ -2,6 +2,8 @@ class_name ConditionEngine
extends RefCounted
const StatusEffectType = preload("res://scripts/domain/combat/status_effect.gd")
const SafeRoomServiceType = preload("res://scripts/domain/world/safe_room_service.gd")
const TouristServiceType = preload("res://scripts/domain/world/tourist_service.gd")
var diagnostics := PackedStringArray()
@@ -116,6 +118,21 @@ func apply_effect(effect: Dictionary, context: Dictionary) -> Dictionary:
if not moderation_fn.is_valid():
return {"applied": false, "type": kind, "reason": &"missing_moderation_context"}
return moderation_fn.call(StringName(effect.get("reason", "propos_interdits")))
&"tourist_selfie", &"endanger_tourist":
var tourist_run: RunState = context.get("run_state")
var tourist_id := StringName(context.get("npc_id", ""))
if tourist_run == null or tourist_id.is_empty():
return {"applied": false, "type": kind, "reason": &"missing_tourist_context"}
var tourist_events := TouristServiceType.selfie(tourist_run, tourist_id) if kind == &"tourist_selfie" else TouristServiceType.endanger(tourist_run, tourist_id, int(effect.get("amount", 0)))
return {"applied": not tourist_events.is_empty(), "type": kind, "events": tourist_events}
&"give_item":
var run: RunState = context.get("run_state")
var npc_id: StringName = StringName(context.get("npc_id", ""))
var npc_content_id: StringName = StringName(context.get("npc_content_id", ""))
if run == null or npc_id.is_empty() or npc_content_id != SafeRoomServiceType.BOBKA_CONTENT_ID or StringName(effect.get("item", "")) != SafeRoomServiceType.RATION_ITEM_ID:
return {"applied": false, "type": kind, "reason": &"unsupported_item_grant"}
var ration_events := SafeRoomServiceType.give_bobka_ration(run, npc_id)
return {"applied": not ration_events.is_empty(), "type": kind, "events": ration_events}
&"join_party":
var party: PartyState = context.get("party")
var recruit: ActorState = context.get("recruit")
@@ -124,7 +141,7 @@ func apply_effect(effect: Dictionary, context: Dictionary) -> Dictionary:
return {"applied": false, "type": kind, "reason": &"missing_party_context"}
var result := party.recruit(recruit, player.cell, map, context.get("blocked_cells", {}))
return {"applied": bool(result.get("accepted", false)), "type": kind, "result": result}
&"message", &"give_item", &"remove_item", &"learn_spell", &"learn_random_spell", &"complete_objective", &"endanger_tourist", &"augment_companion", &"tourist_selfie":
&"message", &"remove_item", &"learn_spell", &"learn_random_spell", &"complete_objective", &"augment_companion":
# Later content slices own the corresponding inventory, quest, NPC, and spell mutations.
pass
_:
@@ -0,0 +1,24 @@
class_name HealthRegeneration
extends RefCounted
const ENDURANCE_DIVISOR := 3
const SKILL_AMPLIFIER := 0.15
const DIFFICULTY_MULTIPLIERS := {
&"touriste": 1.5,
&"crawler": 1.0,
&"veteran": 0.75,
&"masochiste": 0.5,
}
static func amount(endurance: int, regeneration_skill: int = 1, perk_bonus: int = 0, difficulty_id: StringName = &"crawler") -> int:
var base := maxi(1, endurance / ENDURANCE_DIVISOR)
var skill_bonus := maxi(0, regeneration_skill - 1)
var total := float(base + maxi(0, perk_bonus)) * (1.0 + float(skill_bonus) * SKILL_AMPLIFIER)
return maxi(0, int(total * float(DIFFICULTY_MULTIPLIERS.get(difficulty_id, 1.0))))
static func apply(actor: ActorState, endurance: int, regeneration_skill: int = 1, perk_bonus: int = 0, difficulty_id: StringName = &"crawler") -> int:
if actor == null or not actor.is_alive():
return 0
var before := actor.hit_points
actor.hit_points = mini(actor.effective_max_hit_points(), actor.hit_points + amount(endurance, regeneration_skill, perk_bonus, difficulty_id))
return actor.hit_points - before
@@ -0,0 +1 @@
uid://3ccnf6g0ily8
+3
View File
@@ -37,6 +37,9 @@ func resolve(map: GridMapState, attacker: ActorState, target: ActorState) -> Dic
"events": events,
}
func validation_reason(map: GridMapState, attacker: ActorState, target: ActorState) -> StringName:
return _validation_reason(map, attacker, target)
func _validation_reason(map: GridMapState, attacker: ActorState, target: ActorState) -> StringName:
if attacker == null or target == null or attacker == target or attacker.id == target.id or not target.is_alive():
return &"invalid_target"
+40 -6
View File
@@ -4,36 +4,70 @@ extends RefCounted
# E4 deliberately owns only the companion's earned-XP ledger. F1 remains the
# sole owner of level thresholds and character progression.
class Stance:
const STAY_BACK: StringName = &"stay_back"
const DEFEND_ME: StringName = &"defend_me"
const ATTACK_ON_SIGHT: StringName = &"attack_on_sight"
# Legacy identifiers remain readable for code and saves created before the
# player-facing behavior names were introduced.
const FOLLOW: StringName = &"follow"
const DEFEND: StringName = &"defend"
const SUPPORT: StringName = &"support"
const ActorStateType = preload("res://scripts/domain/actor_state.gd")
const ExperienceType = preload("res://scripts/domain/progression/experience.gd")
const VALID_STANCES: Array[StringName] = [Stance.FOLLOW, Stance.DEFEND, Stance.SUPPORT]
const VALID_STANCES: Array[StringName] = [Stance.STAY_BACK, Stance.DEFEND_ME, Stance.ATTACK_ON_SIGHT]
var choice_id: StringName
var actor: ActorState
var stance: StringName = Stance.FOLLOW
var stance: StringName = Stance.STAY_BACK
var name := "Familier"
var species := "Animal"
var endurance := 4
var regeneration_skill := 1
var regeneration_perk_bonus := 0
func _init(new_choice_id: StringName, new_actor: ActorState) -> void:
choice_id = new_choice_id
actor = new_actor
static func from_choice(new_choice_id: StringName, cell: Vector2i, hit_points: int = 8) -> CompanionState:
static func from_choice(new_choice_id: StringName, cell: Vector2i, hit_points: int = 8, new_name: String = "Familier", new_species: String = "Animal") -> CompanionState:
var id := new_choice_id if not new_choice_id.is_empty() else &"moth"
var companion_actor := ActorStateType.new(&"companion", cell, maxi(1, hit_points), 3, id, {"accuracy": 30, "xp": 0})
return CompanionState.new(id, companion_actor)
var companion := CompanionState.new(id, companion_actor)
companion.name = new_name.strip_edges() if not new_name.strip_edges().is_empty() else "Familier"
companion.species = new_species.strip_edges() if not new_species.strip_edges().is_empty() else "Animal"
return companion
func is_alive() -> bool:
return actor != null and actor.is_alive()
func set_stance(new_stance: StringName) -> bool:
if not new_stance in VALID_STANCES:
var normalized := normalize_stance(new_stance)
if not normalized in VALID_STANCES:
return false
stance = new_stance
stance = normalized
return true
static func normalize_stance(value: StringName) -> StringName:
match value:
Stance.FOLLOW, &"aggressif": return Stance.ATTACK_ON_SIGHT
Stance.DEFEND, Stance.SUPPORT, &"defensif", &"soutien": return Stance.DEFEND_ME
return value
static func stance_label(value: StringName) -> String:
match normalize_stance(value):
Stance.STAY_BACK: return "Reste en arrière"
Stance.DEFEND_ME: return "Défends-moi"
Stance.ATTACK_ON_SIGHT: return "Attaque à vue"
return "Inconnu"
static func stance_description(value: StringName) -> String:
match normalize_stance(value):
Stance.STAY_BACK: return "Suit le joueur sans engager les ennemis."
Stance.DEFEND_ME: return "Intercepte et attaque les ennemis qui menacent le joueur."
Stance.ATTACK_ON_SIGHT: return "Poursuit et attaque l’ennemi visible le plus proche."
return ""
# This is intentionally a neutral allocation seam: it records earned XP only
# and neither reads nor changes levels, thresholds, attributes, or skills.
func share_xp(player: ActorState, amount: int) -> Dictionary:
+2 -1
View File
@@ -7,6 +7,7 @@ const TrapEngineType = preload("res://scripts/domain/world/trap_engine.gd")
const SpecialInteractionsType = preload("res://scripts/domain/world/special_interactions.gd")
const CompanionStateType = preload("res://scripts/domain/entities/companion_state.gd")
const PartyStateType = preload("res://scripts/domain/entities/party_state.gd")
const PLAYER_VISION_RADIUS := 6
var player: ActorState
# E4 keeps the selected pet run-scoped rather than making it a floor entity.
@@ -109,7 +110,7 @@ func compute_visible_cells(game_map: GridMapState, origin: Vector2i, radius: int
return visible
func update_exploration() -> void:
visible_cells = compute_visible_cells(map, player.cell, 6)
visible_cells = compute_visible_cells(map, player.cell, PLAYER_VISION_RADIUS)
for cell in visible_cells:
explored_cells[cell] = true
@@ -71,6 +71,11 @@ func recompute_player(player) -> void:
player.normalize_resources()
elif player is ActorState:
player.recompute_equipment_modifiers(attributes, skills, combat)
var main_hand := item_in_slot(&"main_hand")
if main_hand != null and main_hand.definition != null and StringName(main_hand.definition.raw.get("weapon_kind", "")) != &"ranged":
player.metadata["melee_weapon_name"] = main_hand.definition.name
else:
player.metadata.erase("melee_weapon_name")
func _accumulate_combat_modifiers(item: ItemInstance, combat: Dictionary[StringName, Variant]) -> void:
var raw := item.definition.raw
@@ -22,6 +22,13 @@ func add_item(item: ItemInstance) -> Dictionary:
items.append(item)
return _result(true, &"", item)
func count_by_definition(item_id: StringName) -> int:
var total := 0
for item: ItemInstance in items:
if item.definition.id == item_id:
total += item.quantity
return total
func item_by_id(instance_id: StringName) -> ItemInstance:
for item in items:
if item.instance_id == instance_id:
@@ -85,6 +92,8 @@ func use_item(instance_id: StringName, default_target, identification: ItemIdent
var status := StringName(effect_data.get("status", ""))
recipient.apply_status(StatusEffect.new(status, int(effect_data.get("duration", -1)), int(effect_data.get("magnitude", 0)), item.definition.id))
effects.append({"type": effect_type, "status": status})
&"learn_spell":
effects.append({"type": effect_type, "spell": StringName(effect_data.get("spell", ""))})
_:
effects.append({"type": effect_type})
var consumed := remove_item(instance_id)
+8 -2
View File
@@ -10,15 +10,21 @@ static func resolve(table: Dictionary, seed: String, context: String = "") -> Di
var items: Array[Dictionary] = []
var gold := 0
var entries: Array = table.get("entries", [])
var selected_item_ids: Dictionary[StringName, bool] = {}
var rolls := maxi(0, int(table.get("rolls", 0)))
for _roll in range(rolls):
var entry := _choose_entry(entries, rng)
var eligible_entries := entries.filter(func(value) -> bool:
return not (value is Dictionary and value.has("item") and selected_item_ids.has(StringName(value.item)))
)
var entry := _choose_entry(eligible_entries, rng)
if entry.is_empty():
continue
if bool(entry.get("gold", false)):
gold += _range_value(entry, "min_gold", "max_gold", rng)
elif entry.has("item"):
_append_item(items, StringName(entry.item), _range_value(entry, "min_qty", "max_qty", rng, 1))
var item_id := StringName(entry.item)
selected_item_ids[item_id] = true
_append_item(items, item_id, _range_value(entry, "min_qty", "max_qty", rng, 1))
return {
"items": items,
"gold": gold,
+11
View File
@@ -33,6 +33,17 @@ func resolve(map: GridMapState, caster: ActorState, target: ActorState, spell: D
var xp_event := _event(&"xp_granted", caster, target, spell, {})
xp_event.payload = xp_payload
events.append(xp_event)
events.append({
"kind": &"loot_dropped",
"actor_id": target.id,
"target_id": caster.id,
"cell": target.cell,
"payload": {
"loot_table": String(target.loot_table),
"actor_content_id": target.content_id,
"target_content_id": caster.content_id,
},
})
return {"valid": true, "reason": &"", "damage": damage, "events": events}
func valid_targets(map: GridMapState, caster: ActorState, enemies: Dictionary[StringName, ActorState], spell: Dictionary, spells: SpellState) -> Dictionary[StringName, Vector2i]:
+32 -4
View File
@@ -33,7 +33,15 @@ func race_definitions() -> Array[Dictionary]:
var definitions: Array[Dictionary] = []
for id: StringName in _races:
definitions.append(_races[id].duplicate(true))
definitions.sort_custom(func(a: Dictionary, b: Dictionary) -> bool: return String(a.id) < String(b.id))
definitions.sort_custom(func(a: Dictionary, b: Dictionary) -> bool: return String(a.get("name", a.id)) < String(b.get("name", b.id)))
return definitions
func class_definitions(race_id: StringName = &"") -> Array[Dictionary]:
var definitions: Array[Dictionary] = []
for id: StringName in _classes:
if race_id.is_empty() or is_compatible(race_id, id):
definitions.append(_classes[id].duplicate(true))
definitions.sort_custom(func(a: Dictionary, b: Dictionary) -> bool: return String(a.get("name", a.id)) < String(b.get("name", b.id)))
return definitions
func is_compatible(race_id: StringName, class_id: StringName) -> bool:
@@ -75,12 +83,32 @@ func apply_creation(player: PlayerState, race_id: StringName, class_id: StringNa
var choice := creation_choice(race_id, class_id)
if not bool(choice.get("accepted", false)):
return choice
var race := _races[race_id]
var race_result := choose_race(player, race_id)
if not bool(race_result.get("accepted", false)):
return race_result
return choose_class(player, class_id)
func choose_race(player: PlayerState, race_id: StringName) -> Dictionary:
if player == null or not player.race.is_empty():
return {"accepted": false, "reason": &"already_chosen"}
if not _races.has(race_id):
return {"accepted": false, "reason": &"unknown_race"}
player.race = race_id
_apply_bonuses(player, _races[race_id])
return {"accepted": true, "race_id": race_id}
func choose_class(player: PlayerState, class_id: StringName) -> Dictionary:
if player == null or not player.archetype.is_empty():
return {"accepted": false, "reason": &"already_chosen"}
if player.race.is_empty():
return {"accepted": false, "reason": &"race_required"}
if not _classes.has(class_id):
return {"accepted": false, "reason": &"unknown_class"}
if not is_compatible(player.race, class_id):
return {"accepted": false, "reason": &"incompatible"}
player.archetype = class_id
_apply_bonuses(player, race)
_apply_bonuses(player, _classes[class_id])
return choice
return {"accepted": true, "race_id": player.race, "class_id": class_id}
func eligible_evolutions(player: PlayerState) -> Array[Dictionary]:
var eligible: Array[Dictionary] = []
+6
View File
@@ -0,0 +1,6 @@
class_name EndgameState
extends RefCounted
# Kept independently from death lifecycle state: a victorious run remains
# inspectable and saveable without being treated as a defeated run.
var victory := false
+1
View File
@@ -0,0 +1 @@
uid://dapwuxccswlax
+23
View File
@@ -1,9 +1,11 @@
class_name FloorTransition
extends RefCounted
const FINAL_FLOOR := 18
const GridMapStateType = preload("res://scripts/domain/grid_map_state.gd")
const SurfaceGeneratorType = preload("res://scripts/domain/world/surface_generator.gd")
const FloorGeneratorType = preload("res://scripts/domain/world/floor_generator.gd")
const GameEventType = preload("res://scripts/domain/run/game_event.gd")
var catalog: ContentCatalog
@@ -17,11 +19,32 @@ func initial_floor(run: RunState) -> FloorState:
run.ensure_floor_deadline(0)
return run.current_floor_state()
# Final descent is intentionally a separate semantic operation: it must never
# request a destination floor, while normal transitions preserve B5 behavior.
func try_descend(run: RunState) -> Array[GameEvent]:
if run.current_floor != FINAL_FLOOR or not run.current_floor_deadline().can_descend() or run.endgame_state.victory:
return []
run.endgame_state.victory = true
var event := GameEventType.new(
run.next_turn(),
run.current_floor,
&"game_victory",
{"floor": FINAL_FLOOR},
"Le donjon est vaincu.",
&"player"
)
run.append_events([event])
return [event]
# Returns the cached/generated destination and the stairs cell on which the
# player arrives. Floor 0's sole stairs descends, while every procedural floor
# has an up stair at entrance and down stair at exit.
func transition(run: RunState, source: FloorState, stairs_cell: Vector2i) -> Dictionary:
var destination_number := _destination_floor_number(source, stairs_cell)
# Game handles the final-floor victory before calling transition. Keep this
# guard defensive so domain consumers can never allocate floor 19.
if destination_number > FINAL_FLOOR:
return {"floor": source, "arrival": stairs_cell}
var destination := _floor_for(run, destination_number)
var arrival := destination.entrance if destination_number > source.floor_number else destination.exit
run.current_floor = destination_number
+7 -1
View File
@@ -7,17 +7,23 @@ var seed: String
var difficulty_id: StringName
var permadeath: bool
var pet_enabled: bool
var pet_name: String
var pet_species: String
func _init(
new_seed: String = "",
new_difficulty_id: StringName = &"crawler",
new_permadeath: bool = false,
new_pet_enabled: bool = false
new_pet_enabled: bool = false,
new_pet_name: String = "Familier",
new_pet_species: String = "Animal"
) -> void:
seed = new_seed.strip_edges()
difficulty_id = new_difficulty_id
permadeath = new_permadeath
pet_enabled = new_pet_enabled
pet_name = new_pet_name.strip_edges() if not new_pet_name.strip_edges().is_empty() else "Familier"
pet_species = new_pet_species.strip_edges() if not new_pet_species.strip_edges().is_empty() else "Animal"
func is_valid() -> bool:
return not seed.is_empty() and difficulty_id in DIFFICULTY_IDS
+7 -1
View File
@@ -4,7 +4,7 @@ extends RefCounted
var seed: String
var settings: RunSettings
var player_name := "Sans-Nom"
var base_archetype: StringName = &"vanguard"
var base_archetype: StringName = &""
var current_floor := 0
var floors: Dictionary[int, FloorState] = {}
# Deadline records are intentionally independent from generated FloorState so
@@ -16,6 +16,9 @@ var log: Array[GameEvent] = []
var gold := 0
# D1 owns inventory at run scope so it persists while the player changes floors.
var inventory: InventoryState = InventoryState.new()
# Imported dialogue effects resolve item definitions through this authoritative
# runtime catalog; it is assigned by Game for new and loaded runs.
var content_catalog: ContentCatalog
# D3 keeps item identity and equipment with the run so swaps persist across floors.
var equipment: EquipmentState = EquipmentState.new()
var identification: ItemIdentification = ItemIdentification.new()
@@ -34,6 +37,9 @@ var recap_state: Dictionary = {}
# independently from panels and current FloorDeadline instances.
var faction_war_state: Dictionary = {}
var moderation_state: Dictionary = {}
# PR-1 tracks the completed endgame separately from death lifecycle state so a
# victorious run cannot create another dungeon floor.
var endgame_state: EndgameState = EndgameState.new()
# F6 owns final run lifecycle state. G1's save repository can later consume the
# explicit slot policy rather than inferring it from a transient death panel.
var is_game_over := false
+41 -15
View File
@@ -13,6 +13,15 @@ static func resolve_player_action(state: GameState, direction: Vector2i) -> Arra
return results
var player: ActorState = state.player
var destination: Vector2i = player.cell + direction
if abs(direction.x) == 1 and abs(direction.y) == 1:
# Diagonal movement cannot squeeze between blocking cardinal cells. A
# closed door must therefore gate the room instead of being bypassable at
# either corner; walls and chests obey the same geometry.
var horizontal := player.cell + Vector2i(direction.x, 0)
var vertical := player.cell + Vector2i(0, direction.y)
if not state.map.is_walkable(horizontal) or not state.map.is_walkable(vertical):
results.append(TurnResultType.new(player.id, &"blocked", player.cell, destination, &"", 0, "Your way is blocked."))
return results
var enemy: ActorState = _enemy_at(state, destination)
if enemy != null:
# A companion-owning run takes the neutral shared-XP seam. Combat must
@@ -89,7 +98,8 @@ static func append_enemy_response(state: GameState, results: Array[TurnResult])
var enemy: ActorState = state.enemies.get(enemy_id)
if enemy == null or not enemy.is_alive():
continue
var decision: Dictionary = EnemyBehaviorsType.decide(enemy, state.player, state.map, occupied)
var target := _enemy_target(state, enemy)
var decision: Dictionary = EnemyBehaviorsType.decide(enemy, target, state.map, occupied)
if decision.has("diagnostic"):
results.append(TurnResultType.new(
enemy.id,
@@ -103,25 +113,33 @@ static func append_enemy_response(state: GameState, results: Array[TurnResult])
))
match decision.get("kind", &"idle"):
&"melee":
if _support_companion_intercepts(state, enemy, results):
if target == state.player and _support_companion_intercepts(state, enemy, results):
continue
_append_combat_results(results, CombatEngineType.new().resolve_attack(enemy, state.player), enemy.cell, state.player.cell)
if not state.player.is_alive():
_append_combat_results(results, CombatEngineType.new().resolve_attack(enemy, target), enemy.cell, target.cell)
if target == state.player and not state.player.is_alive():
return
&"move":
var target: Vector2i = decision.get("to_cell", enemy.cell)
var move_target: Vector2i = decision.get("to_cell", enemy.cell)
# The behavior contract has already rejected these cells; retain the
# resolver guard as the authoritative state mutation boundary.
if state.map.is_walkable(target) and target != state.player.cell and not occupied.has(target):
if state.map.is_walkable(move_target) and move_target != target.cell and not occupied.has(move_target):
var from: Vector2i = enemy.cell
occupied.erase(from)
enemy.cell = target
occupied[target] = true
results.append(TurnResultType.new(enemy.id, &"enemy_moved", from, target, &"", 0, "%s moves." % _actor_label(enemy.id)))
enemy.cell = move_target
occupied[move_target] = true
results.append(TurnResultType.new(enemy.id, &"enemy_moved", from, move_target, &"", 0, "%s moves." % _actor_label(enemy.id)))
static func _enemy_target(state: GameState, enemy: ActorState) -> ActorState:
var companion: CompanionState = state.companion
if companion == null or not companion.is_alive():
return state.player
var player_distance := enemy.cell.distance_squared_to(state.player.cell)
var companion_distance := enemy.cell.distance_squared_to(companion.actor.cell)
return companion.actor if companion_distance <= player_distance else state.player
static func _support_companion_intercepts(state: GameState, enemy: ActorState, results: Array[TurnResult]) -> bool:
var companion: CompanionState = state.companion
if companion == null or not companion.is_alive() or companion.stance != CompanionStateType.Stance.SUPPORT:
if companion == null or not companion.is_alive() or CompanionStateType.normalize_stance(companion.stance) != CompanionStateType.Stance.DEFEND_ME:
return false
if companion.actor.cell.distance_to(state.player.cell) > 1.5:
return false
@@ -143,7 +161,8 @@ static func _append_companion_response(state: GameState, results: Array[TurnResu
return
var occupied := _occupied_enemy_cells(state)
occupied[companion.actor.cell] = true
var decision := CompanionBehaviorsType.decide(companion, state.player, state.enemies, state.map, occupied)
var detected_cells := state.compute_visible_cells(state.map, state.player.cell, state.PLAYER_VISION_RADIUS)
var decision := CompanionBehaviorsType.decide(companion, state.player, state.enemies, state.map, occupied, detected_cells)
match decision.get("kind", &"idle"):
&"move":
var target: Vector2i = decision.get("to_cell", companion.actor.cell)
@@ -156,9 +175,15 @@ static func _append_companion_response(state: GameState, results: Array[TurnResu
if enemy != null and enemy.is_alive() and companion.actor.cell.distance_to(enemy.cell) <= 1.5:
_append_combat_results(results, CombatEngineType.new().resolve_attack(companion.actor, enemy), companion.actor.cell, enemy.cell)
results.back().kind = &"companion_melee"
results.back().message = "Your companion defends you."
results.back().message = "%s attacks." % companion.name
if not enemy.is_alive():
state.enemies.erase(enemy.id)
&"heal_player":
var before := state.player.hit_points
state.player.hit_points = mini(state.player.effective_max_hit_points(), before + int(decision.get("amount", 0)))
var healed := state.player.hit_points - before
if healed > 0:
results.append(TurnResultType.new(companion.actor.id, &"companion_healed_player", companion.actor.cell, state.player.cell, state.player.id, -healed, "%s restores %d PV." % [companion.name, healed], {"healing": healed}))
static func _occupied_enemy_cells(state: GameState) -> Dictionary[Vector2i, bool]:
var occupied: Dictionary[Vector2i, bool] = {state.player.cell: true}
@@ -176,10 +201,11 @@ static func _append_combat_results(results: Array[TurnResult], outcome: Dictiona
var target_id := StringName(first.target_id)
var legacy_kind := &"melee" if actor_id == &"player" else &"enemy_melee"
var damage := int(outcome.damage)
var message := "You strike the goblin for %d." % damage if actor_id == &"player" else "%s hits you for %d." % [_actor_label(actor_id), damage]
results.append(TurnResultType.new(actor_id, legacy_kind, from_cell, to_cell, target_id, damage, message, {"domain_events": descriptors}))
var attack_method := String(first.payload.get("attack_method", "mains nues" if actor_id == &"player" else "attaque naturelle"))
var message := "You strike the goblin with %s for %d." % [attack_method, damage] if actor_id == &"player" else "%s hits you with %s for %d." % [_actor_label(actor_id), attack_method, damage]
results.append(TurnResultType.new(actor_id, legacy_kind, from_cell, to_cell, target_id, damage, message, {"domain_events": descriptors, "attack_method": attack_method}))
if not bool(outcome.hit):
results.back().message = "You miss the goblin." if actor_id == &"player" else "%s misses you." % _actor_label(actor_id)
results.back().message = "You miss the goblin with %s." % attack_method if actor_id == &"player" else "%s misses you with %s." % [_actor_label(actor_id), attack_method]
if not (results.back().payload.domain_events as Array).filter(func(event: Dictionary) -> bool: return event.kind == &"actor_died").is_empty():
var defeated := target_id if actor_id == &"player" else actor_id
results.append(TurnResultType.new(defeated, &"enemy_defeated", to_cell, to_cell, actor_id, 0, "%s is defeated." % _actor_label(defeated)))
+71 -49
View File
@@ -1,12 +1,11 @@
class_name FloorGenerator
extends RefCounted
const MAP_SIZE := Vector2i(80, 50)
const ROOM_COUNT := 8
const ROOM_MIN_SIZE := Vector2i(5, 4)
const ROOM_MAX_SIZE := Vector2i(10, 8)
const MAX_MAP_SIZE := Vector2i(700, 350)
const MAX_ROOM_COUNT := 500
const DEEP_ROOM_MIN_SIZE := Vector2i(4, 3)
const DEEP_ROOM_MAX_SIZE := Vector2i(6, 5)
const ROOM_PADDING := 2
const ROOM_PLACEMENT_ATTEMPTS := 256
const SHOP_ACTIVE_FROM_FLOOR := 3
const BOSS_FLOOR_INTERVAL := 5
const GUILD_ROOM_CHANCE := 0.35
@@ -33,10 +32,26 @@ const RoomGraphType = preload("res://scripts/domain/world/room_graph.gd")
const FloorPopulatorType = preload("res://scripts/domain/world/floor_populator.gd")
const EconomyType = preload("res://scripts/domain/items/economy.gd")
# The profile deliberately caps the ASCII-inspired growth before maps become
# impractical. It is also the sole sizing input to generation, making a seed
# and floor number reproduce exactly the same layout.
static func generation_profile(floor_number: int) -> Dictionary:
var normalized_floor := maxi(1, floor_number)
return {
"map_size": Vector2i(
mini(MAX_MAP_SIZE.x, 180 + normalized_floor * 30),
mini(MAX_MAP_SIZE.y, 90 + normalized_floor * 15)
),
"target_room_count": mini(MAX_ROOM_COUNT, 150 + normalized_floor * 20),
"room_min_size": DEEP_ROOM_MIN_SIZE,
"room_max_size": DEEP_ROOM_MAX_SIZE,
}
static func generate(seed: String, floor_number: int, catalog: ContentCatalog) -> FloorState:
var rng := DeterministicRngType.from_seed("%s-floor%d" % [seed, floor_number])
var rooms := _place_rooms(rng)
var map := GridMapStateType.new(MAP_SIZE, GridMapStateType.CellKind.WALL)
var profile := generation_profile(floor_number)
var rooms := _place_rooms(rng, profile)
var map := GridMapStateType.new(profile["map_size"], GridMapStateType.CellKind.WALL)
for room in rooms:
_carve_room(map, room)
@@ -51,6 +66,7 @@ static func generate(seed: String, floor_number: int, catalog: ContentCatalog) -
graph.add_local_loops(rooms, rng)
for edge in graph.loop_edges:
_carve_l_corridor_preserving_doors(map, _room_center(rooms[edge.from].bounds), _room_center(rooms[edge.to].bounds))
tree_door_cells = _remove_nonfunctional_doors(map, tree_door_cells)
for serialized_door in tree_door_cells:
map.set_cell(Vector2i(int(serialized_door[0]), int(serialized_door[1])), GridMapStateType.CellKind.CLOSED_DOOR)
@@ -63,6 +79,7 @@ static func generate(seed: String, floor_number: int, catalog: ContentCatalog) -
floor.entrance = _room_center(rooms[entrance_index].bounds)
floor.exit = _room_center(rooms[exit_index].bounds)
floor.map.set_cell(floor.exit, GridMapStateType.CellKind.STAIRS)
floor.metadata["generation_profile"] = profile.duplicate(true)
floor.metadata["room_graph"] = graph.to_dict()
floor.metadata["tree_door_cells"] = tree_door_cells
var colony_size := EconomyType.colony_size_for_floor(seed, floor_number)
@@ -72,6 +89,28 @@ static func generate(seed: String, floor_number: int, catalog: ContentCatalog) -
FloorPopulatorType.populate(floor, catalog, seed)
return floor
# Grid slots provide a bounded, deterministic fallback-free layout. Their
# spacing includes the existing room padding invariant, while sizes and room
# contents still consume the seeded RNG.
static func _place_rooms(rng: DeterministicRng, profile: Dictionary) -> Array[RoomState]:
var map_size: Vector2i = profile["map_size"]
var target_room_count := int(profile["target_room_count"])
var room_min_size: Vector2i = profile["room_min_size"]
var room_max_size: Vector2i = profile["room_max_size"]
var slot_size := room_max_size + Vector2i.ONE * ROOM_PADDING * 2
var columns := (map_size.x - 2) / slot_size.x
var rows := (map_size.y - 2) / slot_size.y
assert(target_room_count <= columns * rows, "Generation profile must fit its room lattice")
var rooms: Array[RoomState] = []
for room_index in range(target_room_count):
var width := room_min_size.x + rng.next_int() % (room_max_size.x - room_min_size.x + 1)
var height := room_min_size.y + rng.next_int() % (room_max_size.y - room_min_size.y + 1)
var column := room_index % columns
var row := room_index / columns
var position := Vector2i(1 + column * slot_size.x, 1 + row * slot_size.y)
rooms.append(RoomStateType.new(StringName("room_%03d" % room_index), Rect2i(position, Vector2i(width, height))))
return rooms
# Beds must be installed before population so the occupancy-aware population
# pass cannot place an NPC on a safe room's resting tile.
static func _materialize_safe_room_beds(floor: FloorState) -> void:
@@ -86,48 +125,6 @@ static func _materialize_safe_room_beds(floor: FloorState) -> void:
bed_cells.append(bed_cell)
floor.metadata["bed_cells"] = bed_cells
static func _place_rooms(rng: DeterministicRng) -> Array[RoomState]:
var rooms: Array[RoomState] = []
for room_index in range(ROOM_COUNT):
var placed := false
for _attempt in range(ROOM_PLACEMENT_ATTEMPTS):
var bounds := _random_room_bounds(rng)
if _has_required_padding(bounds, rooms):
rooms.append(RoomStateType.new(StringName("room_%02d" % room_index), bounds))
placed = true
break
if not placed:
# The fixed 80x50 B2 map always supports this minimum-size fallback.
# Never return a partial layout after exhausting random placement attempts.
return _fallback_rooms()
return rooms
static func _fallback_rooms() -> Array[RoomState]:
var rooms: Array[RoomState] = []
var positions := [
Vector2i(3, 5), Vector2i(20, 5), Vector2i(37, 5), Vector2i(54, 5),
Vector2i(3, 20), Vector2i(20, 20), Vector2i(37, 20), Vector2i(54, 20),
]
for room_index in range(ROOM_COUNT):
rooms.append(RoomStateType.new(
StringName("room_%02d" % room_index),
Rect2i(positions[room_index], ROOM_MIN_SIZE)
))
return rooms
static func _random_room_bounds(rng: DeterministicRng) -> Rect2i:
var width := ROOM_MIN_SIZE.x + rng.next_int() % (ROOM_MAX_SIZE.x - ROOM_MIN_SIZE.x + 1)
var height := ROOM_MIN_SIZE.y + rng.next_int() % (ROOM_MAX_SIZE.y - ROOM_MIN_SIZE.y + 1)
var x := 1 + rng.next_int() % (MAP_SIZE.x - width - 1)
var y := 1 + rng.next_int() % (MAP_SIZE.y - height - 1)
return Rect2i(x, y, width, height)
static func _has_required_padding(candidate: Rect2i, rooms: Array[RoomState]) -> bool:
for room in rooms:
if candidate.grow(ROOM_PADDING).intersects(room.bounds.grow(ROOM_PADDING)):
return false
return true
static func _carve_room(map: GridMapState, room: RoomState) -> void:
for y in range(room.bounds.position.y, room.bounds.end.y):
for x in range(room.bounds.position.x, room.bounds.end.x):
@@ -171,6 +168,24 @@ static func _place_tree_boundary_doors(map: GridMapState, path: Array[Vector2i],
break
return serialized_cells
static func _remove_nonfunctional_doors(map: GridMapState, serialized_doors: Array[Array]) -> Array[Array]:
var functional: Array[Array] = []
for serialized_door: Array in serialized_doors:
var cell := Vector2i(int(serialized_door[0]), int(serialized_door[1]))
var walkable_directions: Array[Vector2i] = []
for direction: Vector2i in [Vector2i.LEFT, Vector2i.RIGHT, Vector2i.UP, Vector2i.DOWN]:
if map.is_walkable(cell + direction):
walkable_directions.append(direction)
var controls_straight_passage := walkable_directions.size() == 2 and (
(walkable_directions.has(Vector2i.LEFT) and walkable_directions.has(Vector2i.RIGHT))
or (walkable_directions.has(Vector2i.UP) and walkable_directions.has(Vector2i.DOWN))
)
if controls_straight_passage:
functional.append(serialized_door)
else:
map.set_cell(cell, GridMapStateType.CellKind.FLOOR)
return functional
static func _is_adjacent_to_serialized_door(cell: Vector2i, serialized_doors: Array[Array]) -> bool:
for serialized_door in serialized_doors:
var door_cell := Vector2i(int(serialized_door[0]), int(serialized_door[1]))
@@ -201,6 +216,13 @@ static func _assign_room_kinds(rng: DeterministicRng, rooms: Array[RoomState], e
if UNIQUE_ROOM_KINDS.has(kind):
used_unique[kind] = true
# Weighted room kinds can exhaust either safe kind because both are unique.
# Reserve one deterministic non-entrance/non-exit candidate when that occurs.
var has_safe_room := candidates.any(func(room_index: int) -> bool: return rooms[room_index].kind in [&"refuge", &"sanctuary"])
if not has_safe_room and not candidates.is_empty():
var safe_index := candidates[rng.next_int() % candidates.size()]
rooms[safe_index].kind = &"refuge" if rng.next_int() % 2 == 0 else &"sanctuary"
static func _weighted_room_kind(rng: DeterministicRng, floor_number: int, used_unique: Dictionary[StringName, bool]) -> StringName:
var available: Array[StringName] = []
var total_weight := 0
+17 -4
View File
@@ -5,6 +5,7 @@ const DeterministicRngType = preload("res://scripts/domain/run/deterministic_rng
const ActorStateType = preload("res://scripts/domain/actor_state.gd")
const GridMapStateType = preload("res://scripts/domain/grid_map_state.gd")
const SpawnRulesType = preload("res://scripts/domain/world/spawn_rules.gd")
const TouristServiceType = preload("res://scripts/domain/world/tourist_service.gd")
static func populate(floor: FloorState, catalog: ContentCatalog, population_seed: String) -> void:
_clear_population(floor)
@@ -26,10 +27,13 @@ static func populate(floor: FloorState, catalog: ContentCatalog, population_seed
_spawn_chest(floor, catalog, room, rng, occupied)
&"trap":
_spawn_trap(floor, catalog, room, rng, occupied)
&"shop", &"guild", &"sanctuary", &"refuge":
&"shop", &"guild":
serial = _spawn_npc(floor, catalog, room, rng, occupied, serial)
&"sanctuary", &"refuge":
serial = _spawn_bobka(floor, catalog, room, rng, occupied, serial)
&"narrative", &"mystery", &"puzzle":
_spawn_event(floor, catalog, room, rng, occupied)
TouristServiceType.try_spawn(floor, catalog, rng)
static func _clear_population(floor: FloorState) -> void:
floor.enemies.clear()
@@ -51,11 +55,10 @@ static func _spawn_enemy(floor: FloorState, catalog: ContentCatalog, room: RoomS
return serial + 1
static func _spawn_chest(floor: FloorState, catalog: ContentCatalog, room: RoomState, rng: DeterministicRng, occupied: Dictionary[Vector2i, bool]) -> void:
var definitions := SpawnRulesType.loot_tables(catalog)
var definition := catalog.get_loot_table(&"floor_treasure")
var cell := _available_cell(floor, room, rng, occupied)
if definitions.is_empty() or cell == Vector2i(-1, -1):
if definition.is_empty() or cell == Vector2i(-1, -1):
return
var definition: Dictionary = definitions[rng.next_int() % definitions.size()]
floor.chests[cell] = {
"loot_table_id": definition["id"],
"opened": false,
@@ -71,6 +74,16 @@ static func _spawn_trap(floor: FloorState, catalog: ContentCatalog, room: RoomSt
floor.traps[cell] = {"trap_id": definition["id"]}
occupied[cell] = true
static func _spawn_bobka(floor: FloorState, catalog: ContentCatalog, room: RoomState, rng: DeterministicRng, occupied: Dictionary[Vector2i, bool], serial: int) -> int:
var definition := catalog.get_npc(&"npc_bobka")
var cell := _available_cell(floor, room, rng, occupied)
if definition.is_empty() or cell == Vector2i(-1, -1):
return serial
var actor_id := StringName("npc_bobka_%02d" % serial)
floor.npcs[actor_id] = ActorStateType.new(actor_id, cell, 1, 0, &"npc_bobka")
occupied[cell] = true
return serial + 1
static func _spawn_npc(floor: FloorState, catalog: ContentCatalog, room: RoomState, rng: DeterministicRng, occupied: Dictionary[Vector2i, bool], serial: int) -> int:
var definition := SpawnRulesType.npc_for_role(catalog, room.kind)
var cell := _available_cell(floor, room, rng, occupied)
+24
View File
@@ -33,6 +33,29 @@ func _init(new_map: GridMapState, new_seed: int = 0, new_floor_number: int = 0)
seed = new_seed
floor_number = new_floor_number
func room_at(cell: Vector2i) -> RoomState:
var room_id := map.get_room_id(cell)
for room: RoomState in rooms:
if room.id == room_id:
return room
return null
func safe_rooms() -> Array[RoomState]:
var safe_rooms: Array[RoomState] = []
for room: RoomState in rooms:
if room.kind in [&"refuge", &"sanctuary"] and not room.bounds.has_point(entrance):
safe_rooms.append(room)
return safe_rooms
func bed_cells_in(room: RoomState) -> Array[Vector2i]:
var beds: Array[Vector2i] = []
if room == null:
return beds
for cell: Vector2i in metadata.get("bed_cells", []):
if room.bounds.has_point(cell):
beds.append(cell)
return beds
func to_dict() -> Dictionary:
var serialized_rooms: Array[Dictionary] = []
for room in rooms:
@@ -152,6 +175,7 @@ static func _actor_to_dict(actor: ActorState) -> Dictionary:
"ranged_weapon": actor.ranged_weapon.duplicate(true),
"ammunition": actor.ammunition,
"wounds": actor.wounds.to_dictionary(),
"metadata": actor.metadata.duplicate(true),
}
static func _actor_from_dict(data: Dictionary) -> ActorState:
+56
View File
@@ -0,0 +1,56 @@
class_name SafeRoomService
extends RefCounted
const SAFE_ROOM_KINDS := [&"refuge", &"sanctuary"]
const BOBKA_CONTENT_ID := &"npc_bobka"
const RATION_ITEM_ID := &"consumable_ration"
const ItemDefinitionType = preload("res://scripts/domain/items/item_definition.gd")
const ItemInstanceType = preload("res://scripts/domain/items/item_instance.gd")
const GameEventType = preload("res://scripts/domain/run/game_event.gd")
static func is_safe_room(room: RoomState) -> bool:
return room != null and room.kind in SAFE_ROOM_KINDS
# Diagnostics are intentionally data-only so generated-floor callers can assert
# the same contract without instantiating a scene.
static func validate_floor(floor: FloorState) -> PackedStringArray:
var diagnostics := PackedStringArray()
if floor == null:
diagnostics.append("floor is missing")
return diagnostics
var entrance_room := floor.room_at(floor.entrance)
if is_safe_room(entrance_room):
diagnostics.append("entrance must not be a safe room")
if floor.metadata.get("bed_cells", []).has(floor.entrance):
diagnostics.append("entrance must not contain a bed")
if floor.safe_rooms().is_empty():
diagnostics.append("floor requires a non-entrance safe room")
for room: RoomState in floor.safe_rooms():
if floor.bed_cells_in(room).size() != 1:
diagnostics.append("safe room %s requires exactly one bed" % room.id)
if not floor.npcs.values().any(func(npc: ActorState) -> bool: return npc.content_id == BOBKA_CONTENT_ID and room.bounds.has_point(npc.cell)):
diagnostics.append("safe room %s requires Bobka" % room.id)
return diagnostics
static func can_rest(floor: FloorState, cell: Vector2i) -> bool:
if floor == null or not floor.metadata.get("bed_cells", []).has(cell):
return false
return is_safe_room(floor.room_at(cell))
# Bobka's imported dialogue intentionally calls this on every chosen ration;
# no dialogue/session flag is consulted, and gold is never read or modified.
static func give_bobka_ration(run: RunState, npc_id: StringName) -> Array[GameEvent]:
if run == null or npc_id.is_empty() or run.content_catalog == null:
return []
var definition := ItemDefinitionType.from_catalog(run.content_catalog, RATION_ITEM_ID)
var added := run.inventory.add_item(ItemInstanceType.new(definition))
if not bool(added.get("accepted", false)):
return []
var turn := run.next_turn()
var events: Array[GameEvent] = [
GameEventType.new(turn, run.current_floor, &"item_granted", {"item_id": RATION_ITEM_ID, "quantity": 1, "npc_id": npc_id}, "Bobka vous donne une ration de survie.", npc_id),
GameEventType.new(turn, run.current_floor, &"bobka_ration_given", {"item_id": RATION_ITEM_ID, "quantity": 1, "npc_id": npc_id}, "Ration gratuite reçue de Bobka.", npc_id),
]
run.append_events(events)
return events
@@ -0,0 +1 @@
uid://b2is0iusjmnhn
+25 -33
View File
@@ -3,44 +3,36 @@ extends RefCounted
const GridMapStateType = preload("res://scripts/domain/grid_map_state.gd")
const FloorStateType = preload("res://scripts/domain/world/floor_state.gd")
const ActorStateType = preload("res://scripts/domain/actor_state.gd")
const RoomStateType = preload("res://scripts/domain/world/room_state.gd")
# Floor zero deliberately remains an authored tutorial surface. Its geometry is
# not derived from the run seed; RunState supplies persistence by caching it.
const SURFACE_SIZE := Vector2i(42, 16)
const ENTRANCE := Vector2i(4, 7)
const DOOR := Vector2i(36, 7)
const EXIT := Vector2i(39, 7)
# The surface mirrors DCWASCII's current floor-zero contract: an empty authored
# staging area, a straight corridor, one door, and the stairs to the procedural
# dungeon. It intentionally contains no enemies, chest, deadline content, or
# seed-dependent population.
static func generate(_seed: String = "") -> FloorState:
var map := GridMapStateType.new(Vector2i(30, 20), GridMapStateType.CellKind.WALL)
_carve_room(map, Rect2i(2, 12, 6, 5))
_carve_room(map, Rect2i(2, 4, 7, 7))
_carve_room(map, Rect2i(10, 2, 10, 6))
_carve_room(map, Rect2i(21, 5, 7, 8))
_carve_vertical_corridor(map, 4, 10, 12)
_carve_horizontal_corridor(map, 8, 10, 6)
_carve_horizontal_corridor(map, 18, 21, 6)
_carve_vertical_corridor(map, 18, 4, 6)
map.set_cell(Vector2i(4, 11), GridMapStateType.CellKind.CLOSED_DOOR)
map.set_cell(Vector2i(4, 7), GridMapStateType.CellKind.CHEST)
map.set_cell(Vector2i(18, 4), GridMapStateType.CellKind.STAIRS)
var map := GridMapStateType.new(SURFACE_SIZE, GridMapStateType.CellKind.WALL)
var entrance_room := RoomStateType.new(&"surface_entrance", Rect2i(2, 2, 18, 11), &"entrance")
var landing := RoomStateType.new(&"surface_landing", Rect2i(37, 6, 4, 3), &"open")
_carve_room(map, entrance_room.bounds)
for x in range(20, DOOR.x):
map.set_cell(Vector2i(x, ENTRANCE.y), GridMapStateType.CellKind.FLOOR)
map.set_cell(DOOR, GridMapStateType.CellKind.CLOSED_DOOR)
_carve_room(map, landing.bounds)
map.set_cell(EXIT, GridMapStateType.CellKind.STAIRS)
var floor := FloorStateType.new(map, 0, 0)
floor.entrance = Vector2i(4, 12)
floor.exit = Vector2i(18, 4)
floor.enemies[&"goblin"] = ActorStateType.new(&"goblin", Vector2i(24, 8), 6, 2)
floor.chests[Vector2i(4, 7)] = {
"loot_table_id": &"floor1_reward",
"opened": false,
}
floor.rooms = [entrance_room, landing]
floor.entrance = ENTRANCE
floor.exit = EXIT
floor.metadata = {"hand_authored": true, "theme": "surface"}
return floor
static func _carve_room(map: GridMapState, room: Rect2i) -> void:
for y in range(room.position.y, room.end.y):
for x in range(room.position.x, room.end.x):
static func _carve_room(map: GridMapState, bounds: Rect2i) -> void:
for y in range(bounds.position.y, bounds.end.y):
for x in range(bounds.position.x, bounds.end.x):
map.set_cell(Vector2i(x, y), GridMapStateType.CellKind.FLOOR)
static func _carve_horizontal_corridor(map: GridMapState, from_x: int, to_x: int, y: int) -> void:
for x in range(from_x, to_x + 1):
map.set_cell(Vector2i(x, y), GridMapStateType.CellKind.FLOOR)
static func _carve_vertical_corridor(map: GridMapState, x: int, from_y: int, to_y: int) -> void:
for y in range(from_y, to_y + 1):
map.set_cell(Vector2i(x, y), GridMapStateType.CellKind.FLOOR)
+119
View File
@@ -0,0 +1,119 @@
class_name TouristService
extends RefCounted
const ActorStateType = preload("res://scripts/domain/actor_state.gd")
const AudienceStateType = preload("res://scripts/domain/meta/audience_state.gd")
const ModerationType = preload("res://scripts/domain/meta/moderation.gd")
const GameEventType = preload("res://scripts/domain/run/game_event.gd")
const GridMapStateType = preload("res://scripts/domain/grid_map_state.gd")
const TOURIST_CONTENT_ID := &"npc_tourist_influencer"
const TOURIST_MIN_FLOOR := 6
const TOURIST_MAX_PER_FLOOR := 1
const SELFIE_SPECTACLE := 10
const SPAWN_DENOMINATOR := 4
const SAFE_ROOM_KINDS := [&"sanctuary", &"refuge", &"narrative", &"mystery", &"puzzle"]
# Population owns the RNG, while this service owns the tourist contract. The
# resulting record is an ordinary NPC with private metadata, never a combatant.
static func try_spawn(floor: FloorState, catalog: ContentCatalog, rng: DeterministicRng) -> Array[GameEvent]:
if floor.floor_number < TOURIST_MIN_FLOOR or _active_tourists(floor).size() >= TOURIST_MAX_PER_FLOOR:
return []
var definition := catalog.get_npc(TOURIST_CONTENT_ID)
if definition.is_empty() or rng.next_int() % SPAWN_DENOMINATOR != 0:
return []
var candidates: Array[Vector2i] = []
var occupied := _occupied_cells(floor)
for room: RoomState in floor.rooms:
if room.kind not in SAFE_ROOM_KINDS or room.kind in [&"entrance", &"boss"]:
continue
for y in range(room.bounds.position.y, room.bounds.end.y):
for x in range(room.bounds.position.x, room.bounds.end.x):
var cell := Vector2i(x, y)
if floor.map.get_cell(cell) == GridMapStateType.CellKind.FLOOR and not occupied.has(cell):
candidates.append(cell)
if candidates.is_empty():
return []
var actor_id := StringName("npc_tourist_influencer_%02d" % floor.npcs.size())
var tourist := ActorStateType.new(actor_id, candidates[rng.next_int() % candidates.size()], 1, 0, TOURIST_CONTENT_ID)
tourist.metadata = {
"is_tourist": true,
"hidden_health": maxi(1, int(definition.get("hidden_health", 30))),
"ejected": false,
"moderation_struck": false,
}
floor.npcs[actor_id] = tourist
return []
static func selfie(run: RunState, tourist_id: StringName) -> Array[GameEvent]:
var tourist := _tourist(run, tourist_id)
if tourist == null or bool(tourist.metadata.get("ejected", false)):
return []
var audience := AudienceStateType.new(run.audience_state)
var audience_result := audience.add_spectacle(SELFIE_SPECTACLE)
return [_event(run, &"tourist_selfie", tourist, {
"audience": audience_result,
"hidden_health": int(tourist.metadata.get("hidden_health", 0)),
}, "Selfie avec le touriste : l'audience s'emballe.")]
static func meet(run: RunState, tourist_id: StringName, character_level: int) -> Array[GameEvent]:
var tourist := _tourist(run, tourist_id)
if tourist == null or character_level < 4:
return []
var met_ids: Array = run.audience_state.get("met_tourist_ids", [])
if tourist.id in met_ids:
return []
met_ids.append(tourist.id)
run.audience_state["met_tourist_ids"] = met_ids
return [_event(run, &"tourist_met", tourist, {}, "Vous rencontrez un touriste dans les profondeurs.")]
static func endanger(run: RunState, tourist_id: StringName, amount: int) -> Array[GameEvent]:
var tourist := _tourist(run, tourist_id)
if tourist == null or bool(tourist.metadata.get("ejected", false)):
return []
var remaining := maxi(0, int(tourist.metadata.get("hidden_health", 0)) - maxi(0, amount))
tourist.metadata["hidden_health"] = remaining
var events: Array[GameEvent] = [_event(run, &"tourist_endangered", tourist, {"amount": maxi(0, amount), "hidden_health": remaining}, "Le touriste est mis en danger.")]
if remaining > 0:
return events
tourist.metadata["ejected"] = true
run.current_floor_state().npcs.erase(tourist.id)
events.append(_event(run, &"tourist_ejected", tourist, {}, "Évacuation du touriste par contrat de protection."))
if not bool(tourist.metadata.get("moderation_struck", false)):
tourist.metadata["moderation_struck"] = true
var result := ModerationType.new(run.moderation_state).apply(&"mise_en_danger_touriste", run.current_floor_deadline())
events.append(_event(run, &"moderation_strike", tourist, result, "[SYSTÈME] Mise en danger d’un touriste : évacuation et sanction."))
return events
static func _tourist(run: RunState, tourist_id: StringName) -> ActorState:
var floor := run.current_floor_state()
if floor == null:
return null
var tourist: ActorState = floor.npcs.get(tourist_id)
return tourist if tourist != null and bool(tourist.metadata.get("is_tourist", false)) else null
static func _active_tourists(floor: FloorState) -> Array[ActorState]:
var tourists: Array[ActorState] = []
for npc: ActorState in floor.npcs.values():
if npc.content_id == TOURIST_CONTENT_ID and not bool(npc.metadata.get("ejected", false)):
tourists.append(npc)
return tourists
static func _occupied_cells(floor: FloorState) -> Dictionary[Vector2i, bool]:
var occupied: Dictionary[Vector2i, bool] = {floor.entrance: true, floor.exit: true}
for bed_cell: Vector2i in floor.metadata.get("bed_cells", []):
occupied[bed_cell] = true
for actor: ActorState in floor.enemies.values() + floor.npcs.values():
occupied[actor.cell] = true
for cell: Vector2i in floor.chests:
occupied[cell] = true
for cell: Vector2i in floor.traps:
occupied[cell] = true
for entry: Dictionary in floor.events:
var serialized: Array = entry.get("cell", [])
if serialized.size() == 2:
occupied[Vector2i(int(serialized[0]), int(serialized[1]))] = true
return occupied
static func _event(run: RunState, kind: StringName, tourist: ActorState, payload: Dictionary, message: String) -> GameEvent:
return GameEventType.new(run.current_turn, run.current_floor, kind, payload, message, &"player", tourist.id, tourist.cell)
@@ -0,0 +1 @@
uid://b7ctobdcyrday
+15 -3
View File
@@ -50,12 +50,24 @@ static func trigger(floor: FloorState, player: ActorState, cell: Vector2i, catal
trap["discovered"] = true
floor.traps[cell] = trap
var payload := {"trap_id": StringName(trap.get("trap_id", "")), "damage": actual_damage}
var events: Array[Dictionary] = [{"kind": &"trap_triggered", "payload": payload}]
var events: Array[Dictionary] = [_event(&"trap_triggered", player, cell, payload)]
# Content chance remains deterministic in this turn-based seam: a declared
# majority chance applies, while lower chances are safely represented as no
# status until a future RNG-owned rules slice supplies a roll stream.
var status := StringName(definition.get("status", ""))
# JSON `null` is a valid declaration for traps without a status effect.
# Convert only textual IDs; StringName(null) is not a valid constructor.
var status_value: Variant = definition.get("status")
var status := StringName(status_value) if status_value is String else &""
if not status.is_empty() and float(definition.get("status_chance", 0.0)) >= 0.5:
player.apply_status(StatusEffectType.new(status, int(definition.get("status_duration", -1)), 0, StringName(trap.get("trap_id", ""))))
events.append({"kind": &"trap_status_applied", "payload": {"trap_id": StringName(trap.get("trap_id", "")), "status": status}})
events.append(_event(&"trap_status_applied", player, cell, {"trap_id": StringName(trap.get("trap_id", "")), "status": status}))
return {"triggered": true, "damage": actual_damage, "trap_id": StringName(trap.get("trap_id", "")), "message": String(definition.get("message", "A trap triggers.")), "events": events}
static func _event(kind: StringName, player: ActorState, cell: Vector2i, payload: Dictionary) -> Dictionary:
return {
"kind": kind,
"actor_id": player.id,
"target_id": player.id,
"cell": cell,
"payload": payload,
}
+298 -61
View File
@@ -2,8 +2,10 @@ class_name Game
extends Node2D
signal game_started(settings: RunSettings, run_state: RunState)
signal death_navigation_requested(action: StringName)
signal save_requested
const REFERENCE_VIEWPORT := Vector2i(1280, 720)
const REFERENCE_VIEWPORT := Vector2i(1920, 1080)
const TILE_SIZE := Vector2i(32, 32)
const GridMapStateType = preload("res://scripts/domain/grid_map_state.gd")
const ActorStateType = preload("res://scripts/domain/actor_state.gd")
@@ -22,6 +24,8 @@ const SpellStateType = preload("res://scripts/domain/magic/spell_state.gd")
const TrapEngine = preload("res://scripts/domain/world/trap_engine.gd")
const ItemDefinitionType = preload("res://scripts/domain/items/item_definition.gd")
const ItemInstanceType = preload("res://scripts/domain/items/item_instance.gd")
const LootResolverType = preload("res://scripts/domain/items/loot_resolver.gd")
const TemporaryPlaytestKitType = preload("res://scripts/game/temporary_playtest_kit.gd")
const InventoryPanelType = preload("res://scripts/presentation/inventory_panel.gd")
const EconomyType = preload("res://scripts/domain/items/economy.gd")
const CraftingEngineType = preload("res://scripts/domain/items/crafting_engine.gd")
@@ -50,7 +54,10 @@ const SyndicateType = preload("res://scripts/domain/meta/syndicate.gd")
const FactionPanelType = preload("res://scripts/presentation/faction_panel.gd")
const ModerationPanelType = preload("res://scripts/presentation/moderation_panel.gd")
const DeathEngineType = preload("res://scripts/domain/run/death_engine.gd")
const HealthRegenerationType = preload("res://scripts/domain/combat/health_regeneration.gd")
const TouristServiceType = preload("res://scripts/domain/world/tourist_service.gd")
const DeathPanelType = preload("res://scripts/presentation/death_panel.gd")
const VictoryPanelType = preload("res://scripts/presentation/victory_panel.gd")
const OptionsPanelType = preload("res://scripts/presentation/options_panel.gd")
const HelpPanelType = preload("res://scripts/presentation/help_panel.gd")
const QuestStateType = preload("res://scripts/domain/narrative/quest_state.gd")
@@ -73,12 +80,14 @@ const QuestStateType = preload("res://scripts/domain/narrative/quest_state.gd")
@onready var party_panel: PartyPanel = $HUD/PartyPanel
@onready var character_panel: CharacterPanel = $HUD/CharacterPanel
@onready var progression_choice_panel: ProgressionChoicePanel = $HUD/ProgressionChoicePanel
@onready var race_class_choice_panel: RaceClassChoicePanel = $HUD/RaceClassChoicePanel
@onready var achievement_panel: AchievementPanel = $HUD/AchievementPanel
@onready var audience_panel: AudiencePanel = $HUD/AudiencePanel
@onready var recap_panel: RecapPanel = $HUD/RecapPanel
@onready var faction_panel: FactionPanel = $HUD/FactionPanel
@onready var moderation_panel: ModerationPanel = $HUD/ModerationPanel
@onready var death_panel: DeathPanel = $HUD/DeathPanel
@onready var victory_panel: VictoryPanel = $HUD/VictoryPanel
@onready var minimap: Minimap = $HUD/Minimap
@onready var options_panel: OptionsPanel = $HUD/OptionsPanel
@onready var help_panel: HelpPanel = $HUD/HelpPanel
@@ -99,8 +108,8 @@ var last_turn_results: Array[TurnResult] = []
var action_router: ActionRouter
var pending_run_settings: RunSettings
var pending_player_name := "Sans-Nom"
var pending_base_archetype: StringName = &"vanguard"
var pending_race: StringName = &"race_humain_standard"
var pending_base_archetype: StringName = &""
var pending_race: StringName = &""
var pending_loaded_run: Dictionary = {}
var floor_transition: FloorTransition
var spell_catalog: ContentCatalog
@@ -121,12 +130,14 @@ var moderation: Moderation
var death_engine: DeathEngine
var active_dialogue_npc: Dictionary = {}
var active_event_index := -1
var _turn_start_player_hit_points := -1
var _turn_start_companion_hit_points := -1
func configure_new_run(settings: RunSettings, player_name: String, base_archetype: StringName, race: StringName = &"race_humain_standard") -> void:
func configure_new_run(settings: RunSettings, player_name: String) -> void:
pending_run_settings = settings
pending_player_name = player_name
pending_base_archetype = base_archetype
pending_race = race
pending_base_archetype = &""
pending_race = &""
func configure_loaded_run(loaded: Dictionary) -> void:
pending_loaded_run = loaded
@@ -144,6 +155,9 @@ func _ready() -> void:
spell_targeting_overlay.target_selected.connect(_on_spell_target_selected)
spell_targeting_overlay.targeting_cancelled.connect(_cancel_spell_targeting)
progression_choice_panel.choice_confirmed.connect(_choose_level_three_perk)
race_class_choice_panel.race_confirmed.connect(_choose_floor_three_race)
race_class_choice_panel.class_confirmed.connect(_choose_floor_three_class)
death_panel.navigation_requested.connect(func(action: StringName) -> void: death_navigation_requested.emit(action))
map_renderer.set_map(game_state.map)
_sync_map_renderer_visibility()
_sync_minimap()
@@ -171,6 +185,9 @@ func _initialize_run_state() -> void:
run_state.player_name = pending_player_name
run_state.base_archetype = pending_base_archetype
spell_catalog = ContentCatalogType.load_from_directory("res://data/ascii")
run_state.content_catalog = spell_catalog
if pending_run_settings != null:
_initialize_tutorial_kit()
crafting_engine = CraftingEngineType.new(spell_catalog)
dialogue_engine = DialogueEngineType.new()
event_engine = EventEngineType.new()
@@ -187,20 +204,24 @@ func _initialize_run_state() -> void:
moderation = ModerationType.new(run_state.moderation_state)
death_engine = DeathEngineType.new()
_refresh_title()
# The existing base-archetype menu is now the mandatory class choice. Race
# defaults to the neutral human until the creation UI submits its selection.
# Preserve the no-class initial state used by dialogue gates in existing runs;
# menu creation assigns its explicit base class immediately after launch.
if pending_run_settings != null:
class_engine.apply_creation(dialogue_player, pending_race, run_state.base_archetype)
# New runs deliberately remain classless and raceless through dungeon floors
# one and two. The floor-three milestone applies both choices later.
game_state.content_catalog = spell_catalog
spell_state = SpellStateType.new([&"spell_epines_empoisonnees"])
floor_transition = FloorTransitionType.new(spell_catalog)
var initial_floor := floor_transition.initial_floor(run_state)
if pending_run_settings != null:
TemporaryPlaytestKitType.apply_to_new_run(initial_floor)
game_state.set_floor_state(initial_floor)
game_state.player.cell = initial_floor.entrance
# Direct Game-scene instantiation is the established automated-test seam.
# Production runs are always configured by MainMenu and keep the reference
# surface empty; the seam retains one deterministic actor for combat tests.
if pending_loaded_run.is_empty() and _is_automated_test_run():
game_state.enemies[&"goblin"] = ActorStateType.new(&"goblin", initial_floor.entrance + Vector2i(3, 0), 6, 2)
game_state.update_exploration()
if settings.pet_enabled:
game_state.companion = CompanionStateType.from_choice(&"moth", initial_floor.entrance + Vector2i.RIGHT)
game_state.companion = CompanionStateType.from_choice(&"moth", initial_floor.entrance + Vector2i.RIGHT, 8, settings.pet_name, settings.pet_species)
if pending_run_settings != null:
var game_started := GameEventType.new(
run_state.next_turn(),
@@ -211,8 +232,11 @@ func _initialize_run_state() -> void:
"difficulty_id": settings.difficulty_id,
"permadeath": settings.permadeath,
"pet_enabled": settings.pet_enabled,
"pet_name": settings.pet_name if settings.pet_enabled else "",
"pet_species": settings.pet_species if settings.pet_enabled else "",
"player_name": run_state.player_name,
"base_archetype": run_state.base_archetype,
"race": dialogue_player.race,
},
"%s begins a new run." % run_state.player_name,
&"player",
@@ -222,6 +246,17 @@ func _initialize_run_state() -> void:
run_state.append_events([game_started])
_observe_achievements([game_started])
func _initialize_tutorial_kit() -> void:
# Floors one and two use DCWASCII's class-neutral kit so combat is explicit
# and playable without pre-empting the floor-three class choice.
run_state.gold = 15
var knife := ItemInstanceType.new(ItemDefinitionType.from_catalog(spell_catalog, &"weapon_hunting_knife"), 1, &"tutorial-knife")
var bandage := ItemInstanceType.new(ItemDefinitionType.from_catalog(spell_catalog, &"consumable_bandage"), 1, &"tutorial-bandage")
run_state.inventory.add_item(knife)
run_state.inventory.add_item(bandage)
run_state.equipment.equip(run_state.inventory, knife.instance_id, game_state.player, run_state.identification)
_sync_player_equipment()
func _apply_loaded_run(loaded: Dictionary) -> void:
run_state = loaded.get("run_state")
game_state = loaded.get("game_state")
@@ -229,6 +264,7 @@ func _apply_loaded_run(loaded: Dictionary) -> void:
push_error("Cannot apply an incomplete loaded run.")
return
spell_catalog = ContentCatalogType.load_from_directory("res://data/ascii")
run_state.content_catalog = spell_catalog
crafting_engine = CraftingEngineType.new(spell_catalog)
dialogue_engine = DialogueEngineType.new()
event_engine = EventEngineType.new()
@@ -253,10 +289,21 @@ func _apply_loaded_run(loaded: Dictionary) -> void:
game_state.update_exploration()
_refresh_title()
func _is_automated_test_run() -> bool:
var arguments := OS.get_cmdline_args() + OS.get_cmdline_user_args()
if "--test-mode" in arguments:
return true
for argument in arguments:
if argument.begins_with("-g"):
return true
return false
func _get_capture_mode() -> String:
var arguments := OS.get_cmdline_user_args()
if "--capture-exit" in arguments:
return "exit"
if "--visual-check-compact" in arguments:
return "compact"
if "--capture" in arguments:
return "initial"
return ""
@@ -264,10 +311,17 @@ func _get_capture_mode() -> String:
func _capture_visual_check(capture_mode: String) -> void:
if capture_mode == "exit":
_prepare_exit_capture_state()
# Camera2D applies its scroll during the frame cycle. Force it before the
# deterministic capture so the world is framed around the capture state.
camera.force_update_scroll()
await get_tree().process_frame
await get_tree().process_frame
await RenderingServer.frame_post_draw
var filename := "visual-check-exit.png" if capture_mode == "exit" else "visual-check.png"
var filename := "visual-check.png"
if capture_mode == "exit":
filename = "visual-check-exit.png"
elif capture_mode == "compact":
filename = "visual-check-compact.png"
var capture_path := ProjectSettings.globalize_path("res://artifacts/" + filename)
DirAccess.make_dir_recursive_absolute(capture_path.get_base_dir())
var image := get_viewport().get_texture().get_image()
@@ -275,16 +329,47 @@ func _capture_visual_check(capture_mode: String) -> void:
get_tree().quit(0 if result == OK else 1)
func _prepare_exit_capture_state() -> void:
game_state.map.set_cell(Vector2i(4, 10), GridMapStateType.CellKind.FLOOR)
game_state.map.set_cell(Vector2i(4, 7), GridMapStateType.CellKind.FLOOR)
game_state.player.cell = Vector2i(18, 4)
# The exit capture represents a reached stair route; make the B6 gate
# eligible so the visual fixture remains valid without weakening gameplay.
run_state.current_floor_deadline().turns_remaining = FloorDeadline.STAIRS_OPEN_DAYS_BEFORE_COLLAPSE * FloorDeadline.TURNS_PER_DAY
_process_interact()
# Preserve the entrance exploration, then frame the authored surface exit.
# This exercises visible, explored, and unknown rendering without depending
# on the removed prototype-map coordinates.
game_state.map.set_cell(Vector2i(36, 7), GridMapStateType.CellKind.FLOOR)
game_state.player.cell = game_state.floor_state.exit
game_state.update_exploration()
# Keep a nearby floor tile as remembered terrain. The entrance is outside
# the exit camera crop, so it cannot prove the explored-fog render contract.
var remembered_cell := game_state.floor_state.exit + Vector2i(-2, 0)
game_state.explored_cells[remembered_cell] = true
game_state.visible_cells.erase(remembered_cell)
_sync_map_renderer_visibility()
_sync_minimap()
player_view.refresh()
_sync_camera_to_player()
func _input(event: InputEvent) -> void:
# Movement and wait commands belong to gameplay even if a previously opened
# Control retained keyboard focus. Handle them before focused UI consumes the
# arrow event; modal panels still own navigation and are handled below.
if event is InputEventKey and event.is_pressed() and not event.echo and not _has_modal_panel_open():
var physical_direction := _physical_movement_direction(event as InputEventKey)
if physical_direction != Vector2i.ZERO:
action_router.submit(PlayerActionType.new(&"move", physical_direction))
get_viewport().set_input_as_handled()
func _has_modal_panel_open() -> bool:
return options_panel.visible or help_panel.visible or faction_panel.visible or moderation_panel.visible or audience_panel.visible or recap_panel.visible or achievement_panel.visible or race_class_choice_panel.visible or progression_choice_panel.visible or character_panel.visible or party_panel.visible or companion_panel.visible or quest_panel.visible or event_panel.visible or dialogue_panel.visible or crafting_panel.visible or shop_panel.visible or inventory_panel.visible or loot_panel.visible or targeting_overlay.visible or spell_targeting_overlay.visible
func _physical_movement_direction(event: InputEventKey) -> Vector2i:
match event.physical_keycode:
KEY_UP: return Vector2i.UP
KEY_DOWN: return Vector2i.DOWN
KEY_LEFT: return Vector2i.LEFT
KEY_RIGHT: return Vector2i.RIGHT
return Vector2i.ZERO
func _unhandled_input(event: InputEvent) -> void:
if event is InputEventKey and event.echo:
get_viewport().set_input_as_handled()
return
if run_state != null and run_state.is_game_over:
get_viewport().set_input_as_handled()
return
@@ -342,6 +427,15 @@ func _unhandled_input(event: InputEvent) -> void:
return
get_viewport().set_input_as_handled()
return
if race_class_choice_panel.visible and event is InputEventKey and event.is_pressed():
if event.keycode == KEY_UP:
race_class_choice_panel.select_next(-1)
elif event.keycode == KEY_DOWN:
race_class_choice_panel.select_next(1)
elif event.keycode == KEY_ENTER or event.keycode == KEY_SPACE:
race_class_choice_panel.confirm()
get_viewport().set_input_as_handled()
return
if progression_choice_panel.visible and event is InputEventKey and event.is_pressed():
if event.keycode == KEY_UP:
progression_choice_panel.select_next(-1)
@@ -530,9 +624,11 @@ func equip_test_ranged_weapon(definition: Dictionary, ammunition: int) -> void:
game_state.player.equip_ranged_weapon(definition, ammunition)
func submit_player_action(action: PlayerAction) -> Array[GameEvent]:
if run_state.is_game_over:
if run_state.is_game_over or race_class_choice_panel.visible:
last_turn_results = []
return []
_turn_start_player_hit_points = game_state.player.hit_points
_turn_start_companion_hit_points = game_state.companion.actor.hit_points if game_state.companion != null else -1
match action.kind:
&"move":
last_turn_results = _process_action(action.direction)
@@ -592,6 +688,10 @@ func submit_player_action(action: PlayerAction) -> Array[GameEvent]:
last_turn_results = []
hud.toggle_log()
return []
&"save":
last_turn_results = []
save_requested.emit()
return []
&"ranged":
return _begin_targeting()
&"ranged_target":
@@ -604,24 +704,25 @@ func submit_player_action(action: PlayerAction) -> Array[GameEvent]:
return _record_unavailable_action(action)
func _begin_targeting() -> Array[GameEvent]:
if game_state.player.ranged_weapon.is_empty():
return _record_non_turn_event(&"invalid_ranged_target", &"", {"reason": &"no_ranged_weapon", "damage": 0}, "Aucune arme à distance n’est équipée.")
var targets: Dictionary[StringName, Vector2i] = {}
var ranged_combat := RangedCombatType.new()
for enemy_id: StringName in game_state.enemies:
var enemy: ActorState = game_state.enemies[enemy_id]
if enemy.is_alive():
if enemy.is_alive() and ranged_combat.validation_reason(game_state.map, game_state.player, enemy).is_empty():
targets[enemy_id] = enemy.cell
if game_state.player.ranged_weapon.is_empty():
return _record_ranged_event(&"invalid_ranged_target", &"", {"reason": &"no_ranged_weapon", "damage": 0}, "No ranged weapon is equipped.")
if targets.is_empty():
return _record_ranged_event(&"invalid_ranged_target", &"", {"reason": &"invalid_target", "damage": 0}, "No valid ranged target.")
return _record_non_turn_event(&"invalid_ranged_target", &"", {"reason": &"invalid_target", "damage": 0}, "Aucune cible valide à portée et en ligne de vue.")
targeting_overlay.begin(targets)
return _record_ranged_event(&"targeting_started", &"", {"target_ids": targeting_overlay.get_target_ids()}, "Choose a ranged target.")
return _record_non_turn_event(&"targeting_started", &"", {"target_ids": targeting_overlay.get_target_ids()}, "Choisissez une cible à distance.")
func _on_target_selected(target_id: StringName) -> void:
action_router.submit(PlayerActionType.new(&"ranged_target", Vector2i.ZERO, target_id))
func _cancel_targeting() -> void:
targeting_overlay.finish()
_record_ranged_event(&"targeting_cancelled", &"", {}, "Ranged targeting cancelled.")
_record_non_turn_event(&"targeting_cancelled", &"", {}, "Ciblage à distance annulé.")
func _begin_spell_targeting() -> Array[GameEvent]:
var available: Array[StringName] = []
@@ -702,6 +803,15 @@ func _process_ranged_target(target_id: StringName) -> Array[TurnResult]:
TurnResolver.append_enemy_response(game_state, results)
return _resolve_player_action(results, true)
func _record_non_turn_event(kind: StringName, target_id: StringName, payload: Dictionary, message: String) -> Array[GameEvent]:
var event := GameEventType.new(run_state.current_turn, run_state.current_floor, kind, payload, message, &"player", target_id, game_state.player.cell)
var events: Array[GameEvent] = [event]
run_state.append_events(events)
event_presenter.enqueue(events)
event_presenter.present_next()
hud.refresh(game_state, run_state.recent_events(run_state.log.size()), run_state)
return events
func _record_ranged_event(kind: StringName, target_id: StringName, payload: Dictionary, message: String) -> Array[GameEvent]:
var event := GameEventType.new(run_state.next_turn(), run_state.current_floor, kind, payload, message, &"player", target_id, game_state.player.cell)
var events: Array[GameEvent] = [event]
@@ -791,7 +901,7 @@ func _process_interact() -> Array[TurnResult]:
# behavior and are deliberately not used as item sources in this slice.
if game_state.floor_state.ground_items.has(game_state.player.cell):
return _process_ground_pickup()
if _is_down_stairs() and not run_state.current_floor_deadline().can_descend():
if _is_down_stairs() and run_state.current_floor > 0 and not run_state.current_floor_deadline().can_descend():
var deadline := run_state.current_floor_deadline()
var blocked := _deadline_result(
&"stairs_refused",
@@ -808,7 +918,10 @@ func _process_interact() -> Array[TurnResult]:
if not results.is_empty() and results[0].kind == &"chest_opened":
_show_loot_panel(results[0].payload)
if not results.is_empty() and results[0].kind == &"stairs_used":
_transition_floor(results[0].from_cell)
if run_state.current_floor == FloorTransition.FINAL_FLOOR and _is_down_stairs():
_present_victory(floor_transition.try_descend(run_state))
else:
_transition_floor(results[0].from_cell)
return results
func _event_at_player_cell() -> int:
@@ -1087,6 +1200,8 @@ func _quest_context() -> Dictionary:
return {
"player": dialogue_player,
"payload": {"gold": run_state.gold, "xp": game_state.player.xp},
"npc_id": StringName(active_dialogue_npc.get("actor_id", "")),
"npc_content_id": StringName(active_dialogue_npc.get("id", "")),
"catalog": spell_catalog,
"inventory": run_state.inventory,
"quest_manager": quest_manager,
@@ -1208,6 +1323,8 @@ func _open_dialogue(npc: Dictionary) -> void:
context["recruit"] = recruit
dialogue_panel.present(dialogue_engine, dialogue_engine.start(definition, context), context)
_record_dialogue_event(&"dialogue_started", npc, {"dialogue_id": dialogue_id}, "%s vous adresse la parole." % String(npc.get("name", "Un inconnu")))
if StringName(npc.get("id", "")) == TouristServiceType.TOURIST_CONTENT_ID:
_record_tourist_events(TouristServiceType.meet(run_state, StringName(npc.get("actor_id", "")), game_state.player.progression.level))
func _complete_dialogue_choice() -> void:
var state := dialogue_panel.current_state()
@@ -1223,6 +1340,8 @@ func _complete_dialogue_choice() -> void:
_store_quest_context(dialogue_panel._context)
_flush_quest_changes()
_record_dialogue_event(&"dialogue_choice_selected", active_dialogue_npc, {"dialogue_id": state.dialogue_id, "node_id": choice_node_id, "choice_text": String(choice.get("text", "")), "applications": outcome.get("applications", [])}, String(choice.get("text", "")))
for application: Dictionary in outcome.get("applications", []):
_record_tourist_events(application.get("events", []))
var recruit_application := _recruit_application(outcome.get("applications", []))
if not recruit_application.is_empty() and bool(recruit_application.get("applied", false)):
var recruited: ActorState = recruit_application.result.member
@@ -1236,6 +1355,17 @@ func _complete_dialogue_choice() -> void:
elif state.is_over():
_close_dialogue(false)
func _record_tourist_events(events: Array) -> void:
if events.is_empty():
return
run_state.append_events(events)
_observe_achievements(events)
_observe_audience(events)
_sync_enemy_views()
event_presenter.enqueue(events)
event_presenter.present_next()
hud.refresh(game_state, run_state.recent_events(run_state.log.size()), run_state)
func _recruit_application(applications: Array) -> Dictionary:
for application: Dictionary in applications:
if StringName(application.get("type", "")) == &"join_party":
@@ -1344,6 +1474,7 @@ func _use_selected_inventory_item(target = null) -> void:
return
var result := run_state.inventory.use_item(item.instance_id, game_state.player, run_state.identification, target)
if bool(result.accepted):
_apply_item_use_effects(result.effects)
_record_ranged_event(&"item_used", &"", {"instance_id": item.instance_id, "effects": result.effects, "revealed": result.revealed}, "Used %s." % item.definition.name)
elif result.reason == &"target_required":
_record_ranged_event(&"item_targeting_started", &"", {"instance_id": item.instance_id, "target_kind": &"ally"}, "Choose an ally target for %s." % item.definition.name)
@@ -1351,6 +1482,11 @@ func _use_selected_inventory_item(target = null) -> void:
_record_ranged_event(&"item_use_refused", &"", {"instance_id": item.instance_id, "reason": result.reason}, "Cannot use that item.")
inventory_panel.refresh()
func _apply_item_use_effects(effects: Array) -> void:
for effect: Dictionary in effects:
if StringName(effect.get("type", "")) == &"learn_spell":
spell_state.learn(StringName(effect.get("spell", "")))
# Public hook for the future party selector: it applies the currently selected
# ally-target consumable without coupling this D3 slice to a party UI.
func submit_inventory_ally_target(target) -> Array[GameEvent]:
@@ -1397,15 +1533,19 @@ func _take_all_loot() -> void:
else:
refused_items.append({"item_id": StringName(item_data.get("item_id", "")), "quantity": int(item_data.get("quantity", 1)), "reason": result.reason})
var gold := int(pending_loot.get("gold", 0))
var ammunition := maxi(0, int(pending_loot.get("ammunition", 0)))
run_state.gold += gold
game_state.player.ammunition += ammunition
loot_panel.dismiss()
var message := "Butin récupéré"
if gold > 0:
message += " : +%d or" % gold
if ammunition > 0:
message += " : +%d munitions" % ammunition
if not refused_items.is_empty():
message += " (inventaire plein pour certains objets)"
message += "."
_record_ranged_event(&"loot_taken", &"", {"items": accepted_items, "gold": gold, "refused_items": refused_items}, message)
_record_ranged_event(&"loot_taken", &"", {"items": accepted_items, "gold": gold, "ammunition": ammunition, "refused_items": refused_items}, message)
pending_loot.clear()
func _process_rest() -> Array[TurnResult]:
@@ -1456,6 +1596,12 @@ func _is_bed() -> bool:
func _deadline_result(kind: StringName, message: String) -> TurnResult:
return TurnResult.new(game_state.player.id, kind, game_state.player.cell, game_state.player.cell, &"", 0, message)
func _present_victory(events: Array[GameEvent]) -> void:
if events.is_empty():
return
victory_panel.present(run_state.player_name, run_state.current_floor, game_state.player.progression.level)
hud.refresh(game_state, run_state.recent_events(run_state.log.size()), run_state)
func _transition_floor(stairs_cell: Vector2i) -> void:
var transition := floor_transition.transition(run_state, game_state.floor_state, stairs_cell)
var destination: FloorState = transition["floor"]
@@ -1463,14 +1609,59 @@ func _transition_floor(stairs_cell: Vector2i) -> void:
game_state.set_floor_state(destination)
game_state.content_catalog = spell_catalog
game_state.player.cell = transition["arrival"]
_place_companion_near_player()
game_state.update_exploration()
map_renderer.set_map(game_state.map)
_sync_map_renderer_visibility()
_sync_minimap()
player_view.set_actor(game_state.player)
_sync_camera_to_player()
# Camera bounds are map-specific. Recompute them before positioning the
# camera whenever a floor transition swaps the active map dimensions.
_configure_camera()
_sync_enemy_views()
hud.refresh(game_state, run_state.recent_events(run_state.log.size()), run_state)
_check_floor_three_race_class_milestone()
func _place_companion_near_player() -> void:
if game_state.companion == null or not game_state.companion.is_alive():
return
var occupied: Dictionary[Vector2i, bool] = {game_state.player.cell: true}
for enemy: ActorState in game_state.enemies.values():
if enemy.is_alive():
occupied[enemy.cell] = true
for member: ActorState in game_state.party.living_members():
occupied[member.cell] = true
for direction: Vector2i in [Vector2i.LEFT, Vector2i.DOWN, Vector2i.RIGHT, Vector2i.UP]:
var candidate := game_state.player.cell + direction
if game_state.map.is_walkable(candidate) and not occupied.has(candidate):
game_state.companion.actor.cell = candidate
return
func _check_floor_three_race_class_milestone() -> void:
if run_state.current_floor != 3 or (not dialogue_player.race.is_empty() and not dialogue_player.archetype.is_empty()):
return
race_class_choice_panel.present_races(class_engine.race_definitions())
_record_ranged_event(
&"race_class_choice_required",
&"",
{"floor": run_state.current_floor},
"Niveau 3 du Donjon : choisissez votre race, puis votre classe."
)
func _choose_floor_three_race(race_id: StringName) -> void:
var result := class_engine.choose_race(dialogue_player, race_id)
if not bool(result.get("accepted", false)):
return
_record_ranged_event(&"race_chosen", race_id, {}, "Race choisie : %s." % race_id)
race_class_choice_panel.present_classes(class_engine.class_definitions(dialogue_player.race))
func _choose_floor_three_class(class_id: StringName) -> void:
var result := class_engine.choose_class(dialogue_player, class_id)
if not bool(result.get("accepted", false)):
return
run_state.base_archetype = dialogue_player.archetype
race_class_choice_panel.dismiss()
_record_ranged_event(&"class_chosen", class_id, {}, "Classe choisie : %s." % class_id)
func _process_action(direction: Vector2i) -> Array[TurnResult]:
var results := game_state.try_player_action(direction)
@@ -1501,14 +1692,18 @@ func _append_collapse_damage(results: Array[TurnResult]) -> void:
# journal: results from one resolved player action are converted and appended once,
# and every resulting GameEvent shares that action's turn number.
func _resolve_player_action(results: Array[TurnResult], sync_camera: bool) -> Array[TurnResult]:
if _results_consume_turn(results):
_apply_passive_health_regeneration(results)
_sync_map_renderer_visibility()
_sync_minimap()
player_view.refresh()
_sync_companion_view()
_sync_party_views()
_sync_enemy_views()
if sync_camera:
_sync_camera_to_player()
_dispatch_audio(results)
_resolve_enemy_loot(results)
var events := _record_events(results)
_resolve_player_death_if_needed()
_append_level_up_events(events)
@@ -1534,6 +1729,39 @@ func _resolve_player_action(results: Array[TurnResult], sync_camera: bool) -> Ar
hud.refresh(game_state, run_state.recent_events(run_state.log.size()), run_state)
return results
func _results_consume_turn(results: Array[TurnResult]) -> bool:
if results.is_empty():
return false
return not results.all(func(result: TurnResult) -> bool:
return result.kind in [&"blocked", &"nothing_to_interact", &"rest_refused", &"stairs_refused"]
)
func _apply_passive_health_regeneration(results: Array[TurnResult]) -> void:
_sync_dialogue_player_progression()
var player_took_damage := (_turn_start_player_hit_points >= 0 and game_state.player.hit_points < _turn_start_player_hit_points) or results.any(func(result: TurnResult) -> bool:
return result.damage > 0 and (result.target_id == game_state.player.id or result.kind == &"collapse_damage")
)
var perk_bonus := int(perk_engine.modifiers().get("regen_bonus", 0)) if perk_engine != null else 0
if not player_took_damage:
HealthRegenerationType.apply(
game_state.player,
dialogue_player.effective_attribute(&"end"),
dialogue_player.effective_skill(&"regeneration"),
perk_bonus,
run_state.settings.difficulty_id
)
var companion_took_damage := game_state.companion != null and ((_turn_start_companion_hit_points >= 0 and game_state.companion.actor.hit_points < _turn_start_companion_hit_points) or results.any(func(result: TurnResult) -> bool:
return result.damage > 0 and result.target_id == game_state.companion.actor.id
))
if game_state.companion != null and game_state.companion.is_alive() and not companion_took_damage:
HealthRegenerationType.apply(
game_state.companion.actor,
game_state.companion.endurance,
game_state.companion.regeneration_skill,
game_state.companion.regeneration_perk_bonus,
run_state.settings.difficulty_id
)
func _resolve_player_death_if_needed() -> void:
if game_state.player.is_alive() or run_state.is_game_over:
return
@@ -1629,6 +1857,8 @@ func _achievement_trigger_for(event: GameEvent) -> StringName:
return &"player_hit_landed" if event.actor_id == game_state.player.id and int(event.payload.get("damage", 0)) > 0 else &""
&"actor_died":
return &"enemy_killed" if event.actor_id != game_state.player.id else &""
&"tourist_met":
return &"tourist_met"
&"level_up", &"item_picked_up", &"trap_triggered", &"chest_opened", &"quest_started", &"quest_completed":
return event.kind
_:
@@ -1675,6 +1905,30 @@ func _append_level_up_events(events: Array[GameEvent]) -> void:
run_state.append_events([level_event])
_check_progression_choices_and_evolutions()
func _resolve_enemy_loot(results: Array[TurnResult]) -> void:
var resolved_enemy_ids: Dictionary[StringName, bool] = {}
for result: TurnResult in results:
var descriptors: Array = result.payload.get("domain_events", [])
for descriptor: Dictionary in descriptors:
if descriptor.kind != &"loot_dropped" or descriptor.actor_id == &"player" or resolved_enemy_ids.has(StringName(descriptor.actor_id)):
continue
resolved_enemy_ids[StringName(descriptor.actor_id)] = true
var table_id := StringName(descriptor.payload.get("loot_table", ""))
var table := spell_catalog.get_loot_table(table_id) if spell_catalog != null else {}
var reward := LootResolverType.resolve(table, run_state.seed, "enemy:%d:%s" % [run_state.current_floor, descriptor.actor_id])
reward["loot_table"] = table_id
descriptor.payload = reward
var drop_cell: Vector2i = result.to_cell
for item_data: Dictionary in reward.items:
var definition := ItemDefinitionType.from_catalog(spell_catalog, StringName(item_data.get("item_id", "")))
if not definition.is_valid():
continue
if not game_state.floor_state.ground_items.has(drop_cell):
game_state.floor_state.ground_items[drop_cell] = []
game_state.floor_state.ground_items[drop_cell].append(ItemInstanceType.new(definition, int(item_data.get("quantity", 1))))
run_state.gold += int(reward.gold)
_sync_map_renderer_visibility()
func _record_events(results: Array[TurnResult]) -> Array[GameEvent]:
var events: Array[GameEvent] = []
if results.is_empty():
@@ -1731,34 +1985,12 @@ func _get_actor_view(actor_id: StringName) -> ActorView:
return enemy_views.get(actor_id) as ActorView
func _create_initial_state() -> GameState:
var map := GridMapStateType.new(Vector2i(30, 20), GridMapStateType.CellKind.WALL)
_carve_room(map, Rect2i(2, 12, 6, 5))
_carve_room(map, Rect2i(2, 4, 7, 7))
_carve_room(map, Rect2i(10, 2, 10, 6))
_carve_room(map, Rect2i(21, 5, 7, 8))
_carve_vertical_corridor(map, 4, 10, 12)
_carve_horizontal_corridor(map, 8, 10, 6)
_carve_horizontal_corridor(map, 18, 21, 6)
_carve_vertical_corridor(map, 18, 4, 6)
map.set_cell(Vector2i(4, 11), GridMapStateType.CellKind.CLOSED_DOOR)
map.set_cell(Vector2i(4, 7), GridMapStateType.CellKind.CHEST)
map.set_cell(Vector2i(18, 4), GridMapStateType.CellKind.STAIRS)
var player := ActorStateType.new(&"player", Vector2i(4, 12), 12, 3)
var goblin := ActorStateType.new(&"goblin", Vector2i(24, 8), 6, 2)
return GameStateType.new(map, player, {&"goblin": goblin})
func _carve_room(map: GridMapState, room: Rect2i) -> void:
for y in range(room.position.y, room.end.y):
for x in range(room.position.x, room.end.x):
map.set_cell(Vector2i(x, y), GridMapStateType.CellKind.FLOOR)
func _carve_horizontal_corridor(map: GridMapState, from_x: int, to_x: int, y: int) -> void:
for x in range(from_x, to_x + 1):
map.set_cell(Vector2i(x, y), GridMapStateType.CellKind.FLOOR)
func _carve_vertical_corridor(map: GridMapState, x: int, from_y: int, to_y: int) -> void:
for y in range(from_y, to_y + 1):
map.set_cell(Vector2i(x, y), GridMapStateType.CellKind.FLOOR)
# Run initialization immediately replaces this neutral shell with the authored
# surface. Keeping the shell content-free prevents the removed prototype map
# from becoming an accidental gameplay source again.
var map := GridMapStateType.new(Vector2i.ONE, GridMapStateType.CellKind.FLOOR)
var player := ActorStateType.new(&"player", Vector2i.ZERO, 12, 3)
return GameStateType.new(map, player, {})
func _configure_camera() -> void:
var map_size := game_state.map.size * TILE_SIZE
@@ -1785,6 +2017,7 @@ func _sync_minimap() -> void:
minimap.set_state(game_state.map, game_state.player.cell, game_state.visible_cells, game_state.explored_cells, threats)
func _sync_map_renderer_visibility() -> void:
map_renderer.set_viewport_center(game_state.player.cell)
map_renderer.set_visibility(game_state.visible_cells, game_state.explored_cells)
map_renderer.set_special_markers(game_state.floor_state.traps, game_state.floor_state.shrines, game_state.floor_state.quest_boards)
map_renderer.set_ground_items(game_state.floor_state.ground_items)
@@ -1829,4 +2062,8 @@ func _sync_enemy_views() -> void:
view.texture = preload("res://assets/dcss/goblin.png")
enemies.add_child(view)
enemy_views[enemy_id] = view
enemy_views[enemy_id].set_actor(game_state.enemies[enemy_id])
var enemy: ActorState = game_state.enemies[enemy_id]
enemy_views[enemy_id].set_actor(enemy)
# Actor sprites must obey the same current-FOV contract as special map
# markers. Explored memory never reveals a live enemy.
enemy_views[enemy_id].visible = enemy.is_alive() and game_state.visible_cells.has(enemy.cell)
+5 -3
View File
@@ -4,6 +4,9 @@ extends RefCounted
# The Input Map owns physical bindings; this catalog gives every rebindable action
# its stable identifier, player command and user-facing French help name.
const ACTIONS: Array[StringName] = [
# Modifier shortcuts must be checked before their unmodified key (Ctrl+S
# before south), otherwise Godot also considers the physical S match.
&"save",
&"interact",
&"move_north",
&"move_south",
@@ -14,7 +17,6 @@ const ACTIONS: Array[StringName] = [
&"move_southwest",
&"move_southeast",
&"wait",
&"attack",
&"ranged",
&"cast",
&"talk",
@@ -47,8 +49,8 @@ const HELP_NAMES := {
&"move_southeast": "Déplacer vers le sud-est",
&"wait": "Attendre",
&"interact": "Interagir",
&"attack": "Attaquer",
&"ranged": "Attaque à distance",
&"ranged": "Attaque à distance / choisir une cible",
&"save": "Sauvegarder manuellement (V ou Ctrl+S)",
&"cast": "Lancer un sort",
&"talk": "Parler",
&"rest": "Se reposer",
+47
View File
@@ -0,0 +1,47 @@
class_name TemporaryPlaytestKit
extends RefCounted
## TEMPORARY PLAYTEST FIXTURE
##
## Remove this file and its single call in Game once normal early-game loot and
## encounter balance can exercise melee, ranged, and offensive magic naturally.
## It deliberately does not modify procedural generation or authored loot tables.
const CHESTS := {
Vector2i(3, 6): {
"label": "MÊLÉE",
"items": [{"item_id": &"weapon_rusty_sword", "quantity": 1}],
"ammunition": 0,
},
Vector2i(5, 6): {
"label": "DISTANCE",
"items": [{"item_id": &"weapon_hand_crossbow", "quantity": 1}],
"ammunition": 20,
},
Vector2i(6, 6): {
"label": "MAGIE OFFENSIVE",
"items": [{"item_id": &"misc_grimoire_ombre", "quantity": 1}],
"ammunition": 0,
},
}
static func apply_to_new_run(floor: FloorState) -> void:
if floor == null or floor.floor_number != 0:
return
floor.metadata["temporary_playtest_chests"] = true
for cell: Vector2i in CHESTS:
var reward: Dictionary = CHESTS[cell]
floor.chests[cell] = {
"loot_table_id": &"",
"opened": false,
"temporary_playtest": true,
"label": reward.label,
"reward": {
"items": reward.items.duplicate(true),
"gold": 0,
"empty": false,
"trap": &"",
"ammunition": int(reward.ammunition),
},
}
floor.map.set_cell(cell, GridMapState.CellKind.CHEST)
@@ -0,0 +1 @@
uid://b1f30fl11cbkt
@@ -12,6 +12,11 @@ const AMBIENCE_CONTEXTS := [&"exploration", &"combat", &"danger"]
const SFX_EVENTS := [&"attack_given", &"attack_received", &"menu_select", &"menu_cancel", &"item_use", &"death"]
const USER_AUDIO_DIRECTORY := "user://audio"
const USER_MANIFEST_PATH := "user://audio/audio_import_manifest.tres"
const BUNDLED_AMBIENCE_PATHS := {
&"exploration": "res://assets/audio/dungeon_exploration.wav",
&"combat": "res://assets/audio/dungeon_combat.wav",
&"danger": "res://assets/audio/dungeon_danger.wav",
}
var ambience_streams: Dictionary = {}
var sfx_streams: Dictionary = {}
@@ -46,9 +51,23 @@ static func save_user_manifest(manifest: AudioImportManifest) -> Error:
return ResourceSaver.save(manifest, USER_MANIFEST_PATH)
static func load_user_manifest() -> AudioImportManifest:
var manifest := load_bundled_manifest()
if not FileAccess.file_exists(USER_MANIFEST_PATH):
return AudioImportManifest.new()
return manifest
var resource := ResourceLoader.load(USER_MANIFEST_PATH, "AudioImportManifest", ResourceLoader.CACHE_MODE_IGNORE)
if resource is AudioImportManifest:
return resource as AudioImportManifest
return AudioImportManifest.new()
if not resource is AudioImportManifest:
return manifest
var user_manifest := resource as AudioImportManifest
for context: StringName in user_manifest.ambience_streams:
manifest.register_ambience(context, user_manifest.ambience_for(context))
for event: StringName in user_manifest.sfx_streams:
manifest.register_sfx(event, user_manifest.sfx_for(event))
return manifest
static func load_bundled_manifest() -> AudioImportManifest:
var manifest := AudioImportManifest.new()
for context: StringName in BUNDLED_AMBIENCE_PATHS:
var stream := ResourceLoader.load(String(BUNDLED_AMBIENCE_PATHS[context])) as AudioStream
if stream != null:
manifest.register_ambience(context, stream)
return manifest
+12 -5
View File
@@ -20,12 +20,16 @@ var _last_ambience_path := ""
var _last_sfx_path := ""
func _init(manifest_or_legacy_root: Variant = null) -> void:
# The former API accepted an external directory override. Intentionally ignore
# it for compatibility: external paths are not a safe playback source.
if manifest_or_legacy_root is AudioImportManifest:
_manifest = manifest_or_legacy_root as AudioImportManifest
else:
elif manifest_or_legacy_root == null:
# Production instances load bundled music and optionally overlay the safe
# Godot-native user manifest.
_manifest = AudioImportManifestType.load_user_manifest()
else:
# The former API accepted an external directory override. Keep explicit
# legacy instances isolated and silent: arbitrary files are never decoded.
_manifest = AudioImportManifestType.new()
func _ready() -> void:
_ensure_players()
@@ -40,9 +44,12 @@ func set_manifest(manifest: AudioImportManifest) -> void:
func set_ambience_context(context: String) -> void:
if not context in AMBIENCE_CONTEXTS:
return
var stream := _manifest.ambience_for(StringName(context))
if current_ambience_context == context and _ambience_player != null and _ambience_player.stream == stream and _ambience_player.playing:
return
current_ambience_context = context
_last_ambience_path = ""
_set_ambience_stream(_manifest.ambience_for(StringName(context)))
_last_ambience_path = stream.resource_path if stream != null else ""
_set_ambience_stream(stream)
func play_sfx(event: String) -> void:
_last_sfx_path = ""
+30 -6
View File
@@ -116,7 +116,7 @@ func _serialize(run: RunState, game: GameState, dialogue_player) -> Dictionary:
identified.append(String(id))
return {
"version": SCHEMA_VERSION,
"run": {"seed": run.seed, "settings": {"seed": run.settings.seed, "difficulty_id": String(run.settings.difficulty_id), "permadeath": run.settings.permadeath, "pet_enabled": run.settings.pet_enabled}, "player_name": run.player_name, "base_archetype": String(run.base_archetype), "current_floor": run.current_floor, "current_turn": run.current_turn, "gold": run.gold, "floors": floors, "floor_deadlines": deadlines, "inventory": run.inventory.to_dict(), "equipment": equipment, "identified_instance_ids": identified, "quest_records": run.quest_records, "achievement_state": run.achievement_state, "audience_state": run.audience_state, "recap_state": run.recap_state, "faction_war_state": run.faction_war_state, "moderation_state": run.moderation_state, "is_game_over": run.is_game_over, "death_outcome": String(run.death_outcome), "slot_policy": String(run.slot_policy), "log": _events_to_data(run.log), "meta": {}},
"run": {"seed": run.seed, "settings": {"seed": run.settings.seed, "difficulty_id": String(run.settings.difficulty_id), "permadeath": run.settings.permadeath, "pet_enabled": run.settings.pet_enabled, "pet_name": run.settings.pet_name, "pet_species": run.settings.pet_species}, "player_name": run.player_name, "base_archetype": String(run.base_archetype), "current_floor": run.current_floor, "current_turn": run.current_turn, "gold": run.gold, "floors": floors, "floor_deadlines": deadlines, "inventory": run.inventory.to_dict(), "equipment": equipment, "identified_instance_ids": identified, "quest_records": run.quest_records, "achievement_state": run.achievement_state, "audience_state": run.audience_state, "recap_state": run.recap_state, "faction_war_state": run.faction_war_state, "moderation_state": run.moderation_state, "endgame_state": {"victory": run.endgame_state.victory}, "is_game_over": run.is_game_over, "death_outcome": String(run.death_outcome), "slot_policy": String(run.slot_policy), "log": _events_to_data(run.log), "meta": {}},
"runtime": {"player": _actor_to_data(game.player), "companion": _companion_to_data(game.companion), "party": _actors_to_data(game.party.members), "dialogue_player": _dialogue_to_data(dialogue_player)},
"metadata": {"updated_at": Time.get_unix_time_from_system(), "source": "godot"},
}
@@ -124,7 +124,7 @@ func _serialize(run: RunState, game: GameState, dialogue_player) -> Dictionary:
func _deserialize(data: Dictionary, catalog: ContentCatalog) -> Dictionary:
var run_data: Dictionary = data.get("run", {})
var settings_data: Dictionary = run_data.get("settings", {})
var run := RunStateType.new(String(run_data.get("seed", "")), RunSettingsType.new(String(settings_data.get("seed", run_data.get("seed", ""))), StringName(settings_data.get("difficulty_id", "crawler")), bool(settings_data.get("permadeath", false)), bool(settings_data.get("pet_enabled", false))))
var run := RunStateType.new(String(run_data.get("seed", "")), RunSettingsType.new(String(settings_data.get("seed", run_data.get("seed", ""))), StringName(settings_data.get("difficulty_id", "crawler")), bool(settings_data.get("permadeath", false)), bool(settings_data.get("pet_enabled", false)), String(settings_data.get("pet_name", "Familier")), String(settings_data.get("pet_species", "Animal"))))
run.player_name = String(run_data.get("player_name", "Sans-Nom")); run.base_archetype = StringName(run_data.get("base_archetype", "vanguard")); run.current_floor = int(run_data.get("current_floor", 0)); run.current_turn = int(run_data.get("current_turn", 0)); run.gold = int(run_data.get("gold", 0))
for key in (run_data.get("floors", {}) as Dictionary):
var floor := _floor_from_data(run_data.floors[key], catalog)
@@ -141,7 +141,7 @@ func _deserialize(data: Dictionary, catalog: ContentCatalog) -> Dictionary:
if item.definition.is_valid(): run.equipment.equipped[StringName(slot)] = item
run.identification = ItemIdentificationType.new()
for id in run_data.get("identified_instance_ids", []): run.identification._identified_instance_ids[StringName(id)] = true
run.quest_records.clear(); run.quest_records.append_array((run_data.get("quest_records", []) as Array).duplicate(true)); run.achievement_state = (run_data.get("achievement_state", {}) as Dictionary).duplicate(true); run.audience_state = (run_data.get("audience_state", {}) as Dictionary).duplicate(true); run.recap_state = (run_data.get("recap_state", {}) as Dictionary).duplicate(true); run.faction_war_state = (run_data.get("faction_war_state", {}) as Dictionary).duplicate(true); run.moderation_state = (run_data.get("moderation_state", {}) as Dictionary).duplicate(true); run.is_game_over = bool(run_data.get("is_game_over", false)); run.death_outcome = StringName(run_data.get("death_outcome", "")); run.slot_policy = StringName(run_data.get("slot_policy", "active")); run.log = _events_from_data(run_data.get("log", []))
run.quest_records.clear(); run.quest_records.append_array((run_data.get("quest_records", []) as Array).duplicate(true)); run.achievement_state = (run_data.get("achievement_state", {}) as Dictionary).duplicate(true); run.audience_state = (run_data.get("audience_state", {}) as Dictionary).duplicate(true); run.recap_state = (run_data.get("recap_state", {}) as Dictionary).duplicate(true); run.faction_war_state = (run_data.get("faction_war_state", {}) as Dictionary).duplicate(true); run.moderation_state = (run_data.get("moderation_state", {}) as Dictionary).duplicate(true); run.endgame_state.victory = bool((run_data.get("endgame_state", {}) as Dictionary).get("victory", false)); run.is_game_over = bool(run_data.get("is_game_over", false)); run.death_outcome = StringName(run_data.get("death_outcome", "")); run.slot_policy = StringName(run_data.get("slot_policy", "active")); run.log = _events_from_data(run_data.get("log", []))
if not run.floors.has(run.current_floor): return _failure("Save does not contain its current floor.")
var runtime: Dictionary = data.get("runtime", {})
var player := _actor_from_data(runtime.get("player", {}))
@@ -200,12 +200,36 @@ static func _actors_from_data(data: Array) -> Array[ActorState]:
static func _companion_to_data(companion: CompanionState):
if companion == null: return null
return {"choice_id": String(companion.choice_id), "stance": String(companion.stance), "actor": _actor_to_data(companion.actor)}
return {"choice_id": String(companion.choice_id), "stance": String(companion.stance), "name": companion.name, "species": companion.species, "endurance": companion.endurance, "regeneration_skill": companion.regeneration_skill, "regeneration_perk_bonus": companion.regeneration_perk_bonus, "actor": _actor_to_data(companion.actor)}
static func _companion_from_data(data) -> CompanionState:
if not data is Dictionary or data.is_empty(): return null
var actor := _actor_from_data(data.get("actor", {})); if actor == null: return null
var companion := CompanionStateType.new(StringName(data.get("choice_id", "moth")), actor); companion.stance = StringName(data.get("stance", "follow")); return companion
var actor_data: Dictionary = data.get("actor", {})
if actor_data.is_empty() and data.has("id"):
actor_data = {
"id": String(data.get("id", "companion")),
"cell": [int(data.get("x", 0)), int(data.get("y", 0))],
"hit_points": int(data.get("hp", 1)),
"max_hit_points": int(data.get("max_hp", data.get("hp", 1))),
"attack_damage": int(data.get("attack_damage", 3)),
"xp": int(data.get("xp", 0)),
}
var actor := _actor_from_data(actor_data); if actor == null: return null
var companion := CompanionStateType.new(StringName(data.get("choice_id", data.get("id", "moth"))), actor)
companion.stance = _legacy_companion_stance(StringName(data.get("stance", data.get("behavior", "stay_back"))))
companion.name = String(data.get("name", "Familier"))
companion.species = String(data.get("species", "Animal"))
var attributes: Dictionary = data.get("attributes", {})
var skills: Dictionary = data.get("skills", {})
var perks: Dictionary = data.get("perks", {})
companion.endurance = int(data.get("endurance", attributes.get("end", 4)))
companion.regeneration_skill = int(data.get("regeneration_skill", skills.get("regeneration", 1)))
companion.regeneration_perk_bonus = int(data.get("regeneration_perk_bonus", perks.get("regen_bonus", 0)))
return companion
static func _legacy_companion_stance(value: StringName) -> StringName:
var normalized := CompanionStateType.normalize_stance(value)
return normalized if normalized in CompanionStateType.VALID_STANCES else CompanionStateType.Stance.STAY_BACK
static func _events_to_data(events: Array[GameEvent]) -> Array:
var data: Array = []
+4 -4
View File
@@ -25,13 +25,13 @@ func select_next(delta: int) -> bool:
func refresh() -> void:
if _companion == null:
return
title.text = "Companion command"
var status := "Alive" if _companion.is_alive() else "Fallen"
body.text = "%s — %s\n\n%s\n\n←/→ Change stance Esc Close" % [String(_companion.choice_id).capitalize(), status, _stance_lines()]
title.text = _companion.name
var status := "En vie" if _companion.is_alive() else "À terre"
body.text = "%s — %s\nPV %d/%d\n\nComportement :\n%s\n\n%s\n\n←/→ Changer K ou Échap Fermer" % [_companion.species, status, _companion.actor.hit_points, _companion.actor.effective_max_hit_points(), _stance_lines(), CompanionState.stance_description(_companion.stance)]
func _stance_lines() -> String:
var lines: PackedStringArray = []
for stance: StringName in CompanionState.VALID_STANCES:
var cursor := "> " if stance == _companion.stance else " "
lines.append("%s%s" % [cursor, String(stance).capitalize()])
lines.append("%s%s" % [cursor, CompanionState.stance_label(stance)])
return "\n".join(lines)
+14 -2
View File
@@ -1,12 +1,24 @@
class_name DeathPanel
extends PanelContainer
@onready var body: RichTextLabel = $Body
signal navigation_requested(action: StringName)
@onready var body: RichTextLabel = $Layout/Body
@onready var hint: Label = $Layout/Hint
@onready var load_button: Button = $Layout/Actions/LoadButton
func _ready() -> void:
load_button.pressed.connect(func() -> void: navigation_requested.emit(&"load"))
$Layout/Actions/NewRunButton.pressed.connect(func() -> void: navigation_requested.emit(&"new_run"))
$Layout/Actions/MenuButton.pressed.connect(func() -> void: navigation_requested.emit(&"menu"))
func present(outcome: StringName, player_name: String, floor: int, level: int) -> void:
visible = true
var mode := "Mort permanente : la sauvegarde de cette run est retirée." if outcome == &"permadeath" else "Classique : la sauvegarde de cette run reste disponible."
var classic := outcome != &"permadeath"
var mode := "Mort permanente : cette run est terminée." if not classic else "Classique : vous pouvez charger une sauvegarde existante."
body.text = "%s n'aura pas survécu au donjon.\n\nNiveau atteint : %d Étage : %d\n\n%s\n\nLe donjon, lui, continuera sans vous." % [player_name, level, floor, mode]
load_button.visible = classic
hint.text = "Choisissez une sauvegarde, une nouvelle partie ou le menu principal." if classic else "Commencez une nouvelle partie ou retournez au menu principal."
func dismiss() -> void:
visible = false
+3 -3
View File
@@ -1,9 +1,9 @@
class_name DialoguePanel
extends PanelContainer
@onready var title: Label = $Title
@onready var body: RichTextLabel = $Body
@onready var entries: RichTextLabel = $Entries
@onready var title: Label = $Layout/Title
@onready var body: RichTextLabel = $Layout/Body
@onready var entries: RichTextLabel = $Layout/Entries
var _engine: DialogueEngine
var _state: DialogueState
+3 -3
View File
@@ -1,9 +1,9 @@
class_name EventPanel
extends PanelContainer
@onready var title: Label = $Title
@onready var body: RichTextLabel = $Body
@onready var entries: RichTextLabel = $Entries
@onready var title: Label = $Layout/Title
@onready var body: RichTextLabel = $Layout/Body
@onready var entries: RichTextLabel = $Layout/Entries
var _engine: EventEngine
var _definition: Dictionary = {}
+3 -1
View File
@@ -20,5 +20,7 @@ func refresh() -> void:
if not events.is_empty() and events[0] is InputEventKey:
binding = OS.get_keycode_string((events[0] as InputEventKey).physical_keycode)
lines.append("%s — %s" % [binding, InputBindingsType.help_name_for(action)])
lines.append("\nF1 / ? — fermer")
lines.append("\nCiblage : flèches, Entrée pour confirmer, Échap pour annuler")
lines.append("Sauvegarde : V (éditeur) ou Ctrl+S (jeu autonome), puis choix d’un emplacement")
lines.append("F1 / Échap — fermer")
body.text = "\n".join(lines)

Some files were not shown because too many files have changed in this diff Show More