Compare commits

...
Author SHA1 Message Date
goose 0f2eeac912 fix: hide episode publication from HUD journal 2026-10-09 21:49:15 -04:00
goose 069537e737 fix: select visible targets and bound active effects 2026-10-09 17:51:04 -04:00
goose 70aa27d232 fix: show only actionable HUD status information 2026-10-09 17:09:44 -04:00
goose a2d5918b36 fix: hide movement events from HUD journal 2026-10-09 16:32:17 -04:00
goose f9ef3d72aa fix: keep character and journal headings visible 2026-10-09 15:57:58 -04:00
goose bbf89a9f36 fix: prove title timing and compact journal readability 2026-10-09 13:17:25 -04:00
goose bc67e5ed88 fix: refine character HUD and title presentation 2026-10-09 12:44:09 -04:00
goose c410f830e3 test: define final character HUD contracts 2026-10-09 12:21:45 -04:00
goose 78f4744c3f fix: align loot feedback with pickup outcomes 2026-10-09 11:25:11 -04:00
goose 8816c31301 fix: preserve refused loot details in HUD 2026-10-09 10:49:32 -04:00
goose 0d8ba84cf2 fix: distinguish dropped and collected enemy loot 2026-10-09 10:34:12 -04:00
goose 0090753675 fix: describe enemy loot rewards in HUD 2026-10-09 10:25:24 -04:00
goose 4cc2bd4272 fix: finish French HUD event presentation 2026-10-09 09:53:41 -04:00
goose dbc53aab71 fix: localize active HUD journal events 2026-10-09 09:31:21 -04:00
goose f1b58935bf fix: apply final dark fantasy HUD polish 2026-10-09 08:38:28 -04:00
goose 59d0b65eb6 test: fix HUD polish red contract syntax 2026-10-09 07:53:52 -04:00
goose ca90d790d9 test: capture final HUD polish feedback 2026-10-09 07:50:49 -04:00
goose 39fd70da88 chore: remove HUD debugging reports 2026-10-09 01:28:46 -04:00
goose 65d35b5102 fix: frame edge camera states inside play area 2026-10-09 01:20:29 -04:00
goose f8d4d932c3 fix: restore readable character hierarchy 2026-10-09 00:59:24 -04:00
goose 6e8c4aa20a test: require readable mockup hierarchy 2026-10-09 00:45:36 -04:00
goose 7c43fb2ecb fix: rebuild HUD composition around real play viewport 2026-10-09 00:39:08 -04:00
goose a42002c834 test: expose broken HUD composition 2026-10-09 00:16:07 -04:00
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
186 changed files with 6696 additions and 1337 deletions
+27
View File
@@ -13,3 +13,30 @@ 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/dungeon_ui_background.png` | `DungeonCrawlerWorld_UI_Assets/captures/c4dc05cf-9f60-4620-a0af-f067852ba23b.png` | DungeonCrawlerWorld prototype UI kit | project prototype asset | none; reusable HUD background capture, tracked under portable pack identifier rather than an absolute workstation path |
| `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 |
| `assets/ui/dark_fantasy/gold_coin.svg` | authored in project | Dungeon Crawler World project | original project asset | simple original SVG; readable round gold currency icon for HUD/GoldIcon |
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: 2.2 MiB

+6
View File
@@ -0,0 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64">
<circle cx="32" cy="32" r="29" fill="#3f2608"/>
<circle cx="32" cy="32" r="25" fill="#d59620" stroke="#ffe58a" stroke-width="4"/>
<circle cx="32" cy="32" r="17" fill="#f6bd3a" stroke="#9d5e0e" stroke-width="3"/>
<path d="M32 18v28M24 25h13a6 6 0 010 12H27" fill="none" stroke="#6d3d08" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 451 B

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
@@ -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":4194441,"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":67,"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"
+452 -179
View File
@@ -1,10 +1,11 @@
[gd_scene load_steps=20 format=3]
[gd_scene load_steps=26 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,6 +24,7 @@
[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"]
@@ -34,24 +36,46 @@
[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"]
[sub_resource type="StyleBoxFlat" id="StyleBox_hud_panel"]
bg_color = Color(0.035, 0.055, 0.09, 0.9)
border_width_left = 2
border_width_top = 2
border_width_right = 2
border_width_bottom = 2
border_color = Color(0.25, 0.48, 0.62, 0.9)
corner_radius_top_left = 6
corner_radius_top_right = 6
corner_radius_bottom_right = 6
corner_radius_bottom_left = 6
content_margin_left = 12.0
content_margin_top = 8.0
content_margin_right = 12.0
content_margin_bottom = 8.0
[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/portrait_roger.png" id="38_hud_portrait"]
[ext_resource type="Texture2D" path="res://assets/ui/dark_fantasy/panel_64x64_nine_patch_source.png" id="37_hud_panel"]
[ext_resource type="Texture2D" path="res://assets/ui/dark_fantasy/dungeon_ui_background.png" id="38_hud_background"]
[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"]
[ext_resource type="Texture2D" path="res://assets/ui/dark_fantasy/gold_coin.svg" id="43_hud_gold_coin"]
[sub_resource type="StyleBoxTexture" id="StyleBox_hud_panel"]
texture = ExtResource("37_hud_panel")
texture_margin_left = 10.0
texture_margin_top = 10.0
texture_margin_right = 10.0
texture_margin_bottom = 10.0
modulate_color = Color(0.32, 0.29, 0.23, 0.88)
[sub_resource type="StyleBoxFlat" id="StyleBox_xp_background"]
bg_color = Color(0.025, 0.02, 0.014, 1)
border_width_left = 1
border_width_top = 1
border_width_right = 1
border_width_bottom = 1
border_color = Color(0.55, 0.40, 0.16, 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.78, 0.58, 0.2, 1)
corner_radius_top_left = 3
corner_radius_top_right = 3
corner_radius_bottom_right = 3
corner_radius_bottom_left = 3
[sub_resource type="StyleBoxEmpty" id="StyleBox_legacy_transparent"]
[sub_resource type="StyleBoxFlat" id="StyleBox_prompt_panel"]
bg_color = Color(0.08, 0.12, 0.16, 0.94)
bg_color = Color(0.10, 0.075, 0.042, 0.98)
border_width_left = 2
border_width_top = 2
border_width_right = 2
@@ -62,6 +86,60 @@ 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="StyleBoxTexture" id="StyleBox_play_area_mask"]
texture = ExtResource("38_hud_background")
modulate_color = Color(0.55, 0.55, 0.55, 1)
[sub_resource type="StyleBoxTexture" id="StyleBox_section"]
texture = ExtResource("37_hud_panel")
texture_margin_left = 10.0
texture_margin_top = 10.0
texture_margin_right = 10.0
texture_margin_bottom = 10.0
modulate_color = Color(0.27, 0.24, 0.19, 0.9)
[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")
@@ -92,8 +170,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"]
@@ -132,6 +209,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")]
@@ -153,231 +232,425 @@ 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
visible = false
[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 = 22
horizontal_alignment = 1
vertical_alignment = 1
text = "Étage 0"
[node name="TitleNotificationLabel" type="Label" parent="HUD"]
layout_mode = 0
visible = false
theme_override_colors/font_color = Color(1, 0.88, 0.52, 1)
theme_override_colors/font_outline_color = Color(0.06, 0.035, 0.015, 1)
theme_override_constants/outline_size = 3
theme_override_font_sizes/font_size = 20
horizontal_alignment = 1
vertical_alignment = 1
[node name="TitleNotificationTimer" type="Timer" parent="HUD"]
wait_time = 5.0
one_shot = true
[node name="AchievementToastTimer" type="Timer" parent="HUD"]
wait_time = 5.0
one_shot = true
[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 = ""
visible = false
[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="PlayAreaMaskTop" type="Panel" parent="HUD/ResponsiveLayout"]
layout_mode = 0
mouse_filter = 2
theme_override_styles/panel = SubResource("StyleBox_play_area_mask")
[node name="PlayAreaMaskLeft" type="Panel" parent="HUD/ResponsiveLayout"]
layout_mode = 0
mouse_filter = 2
theme_override_styles/panel = SubResource("StyleBox_play_area_mask")
[node name="PlayAreaMaskRight" type="Panel" parent="HUD/ResponsiveLayout"]
layout_mode = 0
mouse_filter = 2
theme_override_styles/panel = SubResource("StyleBox_play_area_mask")
[node name="PlayAreaMaskBottom" type="Panel" parent="HUD/ResponsiveLayout"]
layout_mode = 0
mouse_filter = 2
theme_override_styles/panel = SubResource("StyleBox_play_area_mask")
[node name="TopBar" type="Panel" parent="HUD/ResponsiveLayout"]
layout_mode = 0
mouse_filter = 2
theme_override_styles/panel = SubResource("StyleBox_hud_panel")
[node name="LeftRail" type="Panel" parent="HUD/ResponsiveLayout"]
layout_mode = 0
mouse_filter = 2
theme_override_styles/panel = SubResource("StyleBox_hud_panel")
[node name="CharacterSection" type="Panel" parent="HUD/ResponsiveLayout"]
layout_mode = 0
mouse_filter = 2
theme_override_styles/panel = SubResource("StyleBox_section")
[node name="ObjectivesSection" type="Panel" parent="HUD/ResponsiveLayout"]
layout_mode = 0
mouse_filter = 2
theme_override_styles/panel = SubResource("StyleBox_section")
[node name="StatusSection" type="Panel" parent="HUD/ResponsiveLayout"]
layout_mode = 0
mouse_filter = 2
theme_override_styles/panel = SubResource("StyleBox_section")
[node name="CharacterSectionTitle" type="Label" parent="HUD/ResponsiveLayout"]
layout_mode = 0
mouse_filter = 2
theme_override_colors/font_color = Color(0.96, 0.84, 0.48, 1)
theme_override_colors/font_outline_color = Color(0.06, 0.035, 0.015, 1)
theme_override_colors/font_shadow_color = Color(0, 0, 0, 0.85)
theme_override_constants/outline_size = 3
theme_override_constants/shadow_offset_x = 1
theme_override_constants/shadow_offset_y = 2
theme_override_font_sizes/font_size = 22
text = "PERSONNAGE"
vertical_alignment = 1
[node name="ObjectivesSectionTitle" type="Label" parent="HUD/ResponsiveLayout"]
layout_mode = 0
mouse_filter = 2
theme_override_colors/font_color = Color(0.96, 0.9, 0.7, 1)
theme_override_colors/font_outline_color = Color(0.06, 0.035, 0.015, 1)
theme_override_colors/font_shadow_color = Color(0, 0, 0, 0.85)
theme_override_constants/outline_size = 2
theme_override_constants/shadow_offset_x = 1
theme_override_constants/shadow_offset_y = 2
theme_override_font_sizes/font_size = 16
text = "OBJECTIFS"
vertical_alignment = 1
[node name="StatusSectionTitle" type="Label" parent="HUD/ResponsiveLayout"]
layout_mode = 0
mouse_filter = 2
theme_override_colors/font_color = Color(0.96, 0.9, 0.7, 1)
theme_override_colors/font_outline_color = Color(0.06, 0.035, 0.015, 1)
theme_override_colors/font_shadow_color = Color(0, 0, 0, 0.85)
theme_override_constants/outline_size = 2
theme_override_constants/shadow_offset_x = 1
theme_override_constants/shadow_offset_y = 2
theme_override_font_sizes/font_size = 16
text = "ÉTAT"
vertical_alignment = 1
[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
theme_override_styles/panel = SubResource("StyleBox_hud_panel")
[node name="JournalSection" type="Panel" parent="HUD/ResponsiveLayout"]
layout_mode = 0
mouse_filter = 2
theme_override_styles/panel = SubResource("StyleBox_section")
[node name="MapSection" type="Panel" parent="HUD/ResponsiveLayout"]
layout_mode = 0
mouse_filter = 2
theme_override_styles/panel = SubResource("StyleBox_section")
[node name="JournalSectionTitle" type="Label" parent="HUD/ResponsiveLayout"]
layout_mode = 0
mouse_filter = 2
theme_override_colors/font_color = Color(0.96, 0.84, 0.48, 1)
theme_override_colors/font_outline_color = Color(0.06, 0.035, 0.015, 1)
theme_override_colors/font_shadow_color = Color(0, 0, 0, 0.85)
theme_override_constants/outline_size = 3
theme_override_constants/shadow_offset_x = 1
theme_override_constants/shadow_offset_y = 2
theme_override_font_sizes/font_size = 22
text = "JOURNAL"
vertical_alignment = 1
[node name="MapSectionTitle" type="Label" parent="HUD/ResponsiveLayout"]
layout_mode = 0
mouse_filter = 2
theme_override_colors/font_color = Color(0.96, 0.9, 0.7, 1)
theme_override_colors/font_outline_color = Color(0.06, 0.035, 0.015, 1)
theme_override_colors/font_shadow_color = Color(0, 0, 0, 0.85)
theme_override_constants/outline_size = 2
theme_override_constants/shadow_offset_x = 1
theme_override_constants/shadow_offset_y = 2
theme_override_font_sizes/font_size = 16
text = "CARTE"
vertical_alignment = 1
[node name="CommandBar" type="Panel" parent="HUD/ResponsiveLayout"]
layout_mode = 0
mouse_filter = 2
theme_override_styles/panel = SubResource("StyleBox_hud_panel")
[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
theme_override_styles/panel = SubResource("StyleBox_hud_panel")
layout_mode = 0
mouse_filter = 2
show_behind_parent = true
theme_override_styles/panel = SubResource("StyleBox_legacy_transparent")
[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
theme_override_styles/panel = SubResource("StyleBox_hud_panel")
layout_mode = 0
mouse_filter = 2
show_behind_parent = true
theme_override_styles/panel = SubResource("StyleBox_legacy_transparent")
[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
theme_override_styles/panel = SubResource("StyleBox_prompt_panel")
layout_mode = 0
mouse_filter = 2
[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
theme_override_styles/panel = SubResource("StyleBox_hud_panel")
layout_mode = 0
mouse_filter = 2
[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)
[node name="QuickSlotStrip" type="PanelContainer" parent="HUD/ResponsiveLayout"]
layout_mode = 0
mouse_filter = 2
[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 • I Sac"
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="CharacterNameLabel" type="Label" parent="HUD/ResponsiveLayout" groups=["hud_character_values"]]
layout_mode = 0
mouse_filter = 2
theme_override_colors/font_color = Color(0.96, 0.84, 0.48, 1)
theme_override_font_sizes/font_size = 21
text = ""
visible = false
vertical_alignment = 1
[node name="CharacterLevelLabel" type="Label" parent="HUD/ResponsiveLayout" groups=["hud_character_values"]]
layout_mode = 0
mouse_filter = 2
theme_override_colors/font_color = Color(0.8, 0.76, 0.62, 1)
theme_override_font_sizes/font_size = 16
text = "Niveau 1"
vertical_alignment = 1
[node name="PlayerHealthLabel" type="Label" parent="HUD" groups=["hud_character_values"]]
layout_mode = 0
theme_override_colors/font_color = Color(1, 0.78, 0.68, 1)
theme_override_font_sizes/font_size = 18
text = "PV du joueur : 12/12"
vertical_alignment = 1
[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
[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" groups=["hud_character_values"]]
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 = ""
visible = false
autowrap_mode = 2
vertical_alignment = 1
[node name="GoldIcon" type="TextureRect" parent="HUD"]
layout_mode = 0
mouse_filter = 2
texture = ExtResource("43_hud_gold_coin")
expand_mode = 1
stretch_mode = 5
[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"
text = "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
text = ""
visible = false
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
text = ""
visible = false
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
text = ""
visible = false
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
text = ""
visible = false
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="ActionHintLabel" type="Label" parent="HUD/ResponsiveLayout/PromptPanel" groups=["hud_command_hints"]]
layout_mode = 0
mouse_filter = 2
theme_override_colors/font_color = Color(1, 0.92, 0.63, 1)
theme_override_font_sizes/font_size = 16
text = "F : Distance • X : Magie • K : Familier"
horizontal_alignment = 1
vertical_alignment = 0
[node name="ContextPromptLabel" 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 = 13
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 • Interagir Espace • Inventaire I • Sauvegarde V • Aide F1"
clip_text = false
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"
+27 -28
View File
@@ -1,18 +1,15 @@
[gd_scene load_steps=3 format=3]
[gd_scene load_steps=4 format=3]
[ext_resource type="Script" path="res://scripts/presentation/character_panel.gd" id="1_character"]
[ext_resource type="Texture2D" path="res://assets/ui/dark_fantasy/panel_64x64_nine_patch_source.png" id="2_panel"]
[sub_resource type="StyleBoxFlat" id="StyleBox_character_panel"]
bg_color = Color(0.035, 0.055, 0.09, 0.97)
border_width_left = 3
border_width_top = 3
border_width_right = 3
border_width_bottom = 3
border_color = Color(0.66, 0.82, 0.42, 0.95)
corner_radius_top_left = 8
corner_radius_top_right = 8
corner_radius_bottom_right = 8
corner_radius_bottom_left = 8
[sub_resource type="StyleBoxTexture" id="StyleBox_character_panel"]
texture = ExtResource("2_panel")
texture_margin_left = 10.0
texture_margin_top = 10.0
texture_margin_right = 10.0
texture_margin_bottom = 10.0
modulate_color = Color(0.22, 0.2, 0.16, 0.98)
[node name="CharacterPanel" type="PanelContainer"]
visible = false
@@ -22,10 +19,10 @@ anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -220.0
offset_top = -170.0
offset_right = 220.0
offset_bottom = 170.0
offset_left = -360.0
offset_top = -320.0
offset_right = 360.0
offset_bottom = 320.0
grow_horizontal = 2
grow_vertical = 2
theme_override_styles/panel = SubResource("StyleBox_character_panel")
@@ -36,13 +33,15 @@ layout_mode = 1
anchors_preset = 10
anchor_left = 0.5
anchor_right = 0.5
offset_left = -185.0
offset_top = 18.0
offset_right = 185.0
offset_bottom = 46.0
offset_left = -310.0
offset_top = 22.0
offset_right = 310.0
offset_bottom = 54.0
grow_horizontal = 2
theme_override_colors/font_color = Color(0.75, 0.94, 0.55, 1)
theme_override_font_sizes/font_size = 21
theme_override_colors/font_color = Color(1, 0.88, 0.52, 1)
theme_override_colors/font_outline_color = Color(0.08, 0.045, 0.015, 1)
theme_override_constants/outline_size = 3
theme_override_font_sizes/font_size = 24
horizontal_alignment = 1
[node name="Body" type="RichTextLabel" parent="."]
@@ -50,11 +49,11 @@ layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 30.0
offset_top = 62.0
offset_right = -30.0
offset_bottom = -24.0
offset_left = 42.0
offset_top = 76.0
offset_right = -42.0
offset_bottom = -30.0
grow_horizontal = 2
grow_vertical = 2
theme_override_colors/default_color = Color(0.92, 0.95, 1, 1)
theme_override_font_sizes/normal_font_size = 17
theme_override_colors/default_color = Color(0.95, 0.93, 0.8, 1)
theme_override_font_sizes/normal_font_size = 18
+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 = "CARTE — 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"
+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),
}
# The unmasked PlayAreaFrame in the reference 1920×1080 artboard.
# This is scaled for the real 720p capture.
PLAY_AREA_REFERENCE = (498, 125, 1422, 955)
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 7 <= green <= 22 and 16 <= 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(PLAY_AREA_REFERENCE))
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]
+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":
@@ -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
@@ -92,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] = []
+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
+1 -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
+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)))
+19 -9
View File
@@ -3,8 +3,6 @@ extends RefCounted
const MAX_MAP_SIZE := Vector2i(700, 350)
const MAX_ROOM_COUNT := 500
const SHALLOW_ROOM_MIN_SIZE := Vector2i(5, 4)
const SHALLOW_ROOM_MAX_SIZE := Vector2i(10, 8)
const DEEP_ROOM_MIN_SIZE := Vector2i(4, 3)
const DEEP_ROOM_MAX_SIZE := Vector2i(6, 5)
const ROOM_PADDING := 2
@@ -38,13 +36,6 @@ const EconomyType = preload("res://scripts/domain/items/economy.gd")
# 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:
if floor_number <= 1:
return {
"map_size": Vector2i(80, 50),
"target_room_count": 8,
"room_min_size": SHALLOW_ROOM_MIN_SIZE,
"room_max_size": SHALLOW_ROOM_MAX_SIZE,
}
var normalized_floor := maxi(1, floor_number)
return {
"map_size": Vector2i(
@@ -75,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)
@@ -176,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]))
+2 -3
View File
@@ -55,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,
+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)
+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,
}
+326 -77
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,6 +54,7 @@ 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")
@@ -75,6 +80,7 @@ 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
@@ -86,7 +92,9 @@ const QuestStateType = preload("res://scripts/domain/narrative/quest_state.gd")
@onready var options_panel: OptionsPanel = $HUD/OptionsPanel
@onready var help_panel: HelpPanel = $HUD/HelpPanel
@onready var achievement_toast: Label = $HUD/AchievementToast
@onready var title_label: Label = $HUD/TitleLabel
@onready var achievement_toast_timer: Timer = $HUD/AchievementToastTimer
@onready var title_notification_label: Label = $HUD/TitleNotificationLabel
@onready var title_notification_timer: Timer = $HUD/TitleNotificationTimer
@onready var companion_view: ActorView = $World/Companion
@onready var party_views: Node2D = $World/Party
const FACTION_WAR_MIN_FLOOR := 9
@@ -102,8 +110,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
@@ -124,12 +132,15 @@ 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
var _title_notifications_enabled := false
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
@@ -147,6 +158,12 @@ 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))
title_notification_timer.timeout.connect(_hide_title_notification)
achievement_toast_timer.timeout.connect(_hide_achievement_toast)
_title_notifications_enabled = true
map_renderer.set_map(game_state.map)
_sync_map_renderer_visibility()
_sync_minimap()
@@ -175,6 +192,8 @@ func _initialize_run_state() -> void:
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()
@@ -191,20 +210,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(),
@@ -215,8 +238,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",
@@ -226,6 +252,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")
@@ -258,10 +295,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 ""
@@ -269,27 +317,72 @@ func _get_capture_mode() -> String:
func _capture_visual_check(capture_mode: String) -> void:
if capture_mode == "exit":
_prepare_exit_capture_state()
_refresh_capture_hud()
# 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()
var result := image.save_png(capture_path)
get_tree().quit(0 if result == OK else 1)
func _refresh_capture_hud() -> void:
# Capture startup appends game_started after the normal first HUD refresh.
# Refresh only on the capture path so production rendering remains untouched.
hud.refresh(game_state, run_state.recent_events(run_state.log.size()), run_state)
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()
_configure_camera()
_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
@@ -347,6 +440,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)
@@ -535,9 +637,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)
@@ -597,6 +701,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":
@@ -609,24 +717,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] = []
@@ -707,6 +816,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]
@@ -796,7 +914,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",
@@ -904,7 +1022,7 @@ func _toggle_character_panel() -> Array[GameEvent]:
_close_character_panel(false)
return _record_ranged_event(&"character_panel_closed", &"", {}, "Character panel closed.")
_sync_dialogue_player_progression()
character_panel.present(dialogue_player, game_state.player.progression)
character_panel.present(dialogue_player, game_state.player.progression, run_state.player_name, _current_title())
return _record_ranged_event(&"character_panel_opened", &"", {"level": game_state.player.progression.level}, "Character panel opened.")
func _spend_character_attribute(key: StringName) -> void:
@@ -1168,9 +1286,9 @@ func _record_narrative_event(kind: StringName, event_id: StringName, payload: Di
func _process_ground_pickup() -> Array[TurnResult]:
var pickup := run_state.inventory.pick_up_ground_item(game_state.floor_state, game_state.player.cell)
var item: ItemInstance = pickup.item
var item: ItemInstance = pickup.get("item", null)
var result: TurnResult
if bool(pickup.accepted):
if bool(pickup.get("accepted", false)) and item != null:
result = TurnResult.new(
game_state.player.id,
&"item_picked_up",
@@ -1179,9 +1297,14 @@ func _process_ground_pickup() -> Array[TurnResult]:
&"",
0,
"Picked up %s x%d." % [item.definition.name, item.quantity],
{"item_id": item.definition.id, "instance_id": item.instance_id, "quantity": item.quantity, "stack_merged_into": pickup.stack_merged_into}
{"item_id": item.definition.id, "instance_id": item.instance_id, "quantity": item.quantity, "stack_merged_into": pickup.get("stack_merged_into", &"")}
)
else:
var reason := StringName(pickup.get("reason", &"no_ground_item"))
var payload := {"reason": reason}
if item != null:
payload.merge({"item_id": item.definition.id, "instance_id": item.instance_id, "quantity": item.quantity}, true)
var message := "Rien à ramasser." if reason == &"no_ground_item" else "Inventaire plein." if reason == &"capacity" else "Ramassage impossible."
result = TurnResult.new(
game_state.player.id,
&"pickup_refused",
@@ -1189,8 +1312,8 @@ func _process_ground_pickup() -> Array[TurnResult]:
game_state.player.cell,
&"",
0,
"Inventory is full.",
{"reason": pickup.reason}
message,
payload
)
_resolve_player_action([result], false)
return [result]
@@ -1369,6 +1492,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)
@@ -1376,6 +1500,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]:
@@ -1422,15 +1551,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]:
@@ -1494,14 +1627,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)
@@ -1532,14 +1710,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)
@@ -1565,6 +1747,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
@@ -1609,6 +1824,8 @@ func _observe_achievements(events: Array[GameEvent]) -> void:
var achievement_id := StringName(definition.get("id", ""))
var message := "Succès débloqué : %s" % String(definition.get("name", achievement_id))
achievement_toast.text = message
achievement_toast.visible = true
achievement_toast_timer.start()
run_state.log.insert(insertion_index, GameEventType.new(
event.turn,
event.floor,
@@ -1678,13 +1895,31 @@ func _current_title() -> Dictionary:
return title_engine.refresh(_title_context()) if title_engine != null else {}
func _refresh_title() -> void:
var title := _current_title()
if title.is_empty():
run_state.current_title_id = &""
title_label.text = ""
if run_state == null:
return
run_state.current_title_id = StringName(title.get("id", ""))
title_label.text = "Titre : %s" % String(title.get("name", title.get("id", "")))
var title := _current_title()
var previous_title_id := run_state.current_title_id
var current_title_id := StringName(title.get("id", ""))
run_state.current_title_id = current_title_id
if title.is_empty():
# A title loss is not an announcement; it must also clear a still-visible
# notification from the prior title.
_hide_title_notification()
return
# Boot and load establish the state silently. Only a real later transition
# deserves the temporary overlay; the permanent top bar belongs to GameHud.
if _title_notifications_enabled and current_title_id != previous_title_id:
title_notification_label.text = String(title.get("name", current_title_id))
title_notification_label.visible = true
title_notification_timer.start()
func _hide_title_notification() -> void:
title_notification_label.visible = false
title_notification_label.text = ""
func _hide_achievement_toast() -> void:
achievement_toast.visible = false
achievement_toast.text = ""
func _append_level_up_events(events: Array[GameEvent]) -> void:
var levels_gained := 0
@@ -1708,6 +1943,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():
@@ -1764,41 +2023,27 @@ 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
camera.limit_left = $World.position.x
camera.limit_top = $World.position.y
camera.limit_right = $World.position.x + map_size.x
camera.limit_bottom = $World.position.y + map_size.y
# Camera2D clamps against its full engine viewport, while opaque HUD masks
# expose only PlayAreaFrame. Extend each map edge by the difference between
# those half-extents so actors at a map edge remain inside the framed area
# instead of being pinned against its border.
var frame := hud.get_node_or_null("ResponsiveLayout/PlayAreaFrame") as Control
var viewport_half := get_viewport().get_visible_rect().size / camera.zoom * 0.5
var frame_half := frame.get_global_rect().size / camera.zoom * 0.5 if frame != null else viewport_half
var limit_padding := viewport_half - frame_half
camera.limit_left = floori($World.position.x - limit_padding.x)
camera.limit_top = floori($World.position.y - limit_padding.y)
camera.limit_right = ceili($World.position.x + map_size.x + limit_padding.x)
camera.limit_bottom = ceili($World.position.y + map_size.y + limit_padding.y)
_sync_camera_to_player()
func _sync_camera_to_player() -> void:
@@ -1863,4 +2108,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 = ""
+29 -5
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, "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": {}},
"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)
@@ -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 = []
+34 -10
View File
@@ -3,16 +3,26 @@ extends PanelContainer
const SkillTreeType = preload("res://scripts/domain/progression/skill_tree.gd")
const ATTRIBUTE_LABELS := {
&"str_": "Force", &"agi": "Agilité", &"end": "Endurance", &"per": "Perception",
&"int_": "Intelligence", &"wil": "Volonté", &"cha": "Charisme", &"luc": "Chance",
}
const FEATURED_SKILLS := {&"melee": "Corps à corps", &"ranged": "Distance", &"dodge": "Esquive"}
@onready var title: Label = $Title
@onready var body: RichTextLabel = $Body
var _player: PlayerState
var _experience: Experience
var _skill_tree: SkillTree
var _player_name := "Sans-Nom"
var _title_definition: Dictionary = {}
func present(player: PlayerState, experience: Experience) -> void:
func present(player: PlayerState, experience: Experience, player_name: String = "Sans-Nom", title_definition: Dictionary = {}) -> void:
_player = player
_experience = experience
_player_name = player_name
_title_definition = title_definition.duplicate(true)
_skill_tree = SkillTreeType.new(experience, player.attributes, player.skills)
visible = true
refresh()
@@ -22,6 +32,7 @@ func dismiss() -> void:
_player = null
_experience = null
_skill_tree = null
_title_definition.clear()
func spend_attribute(key: StringName) -> Dictionary:
if _skill_tree == null:
@@ -42,13 +53,26 @@ func spend_skill(key: StringName) -> Dictionary:
func refresh() -> void:
if _player == null or _experience == null:
return
title.text = "Character"
body.text = "Level %d — XP %d/%d\nAttribute points: %d\nSkill points: %d\n\n[A] Strength: %d\n[S] Melee: %d\n\nA / S Allocate Esc Close" % [
_experience.level,
_experience.total_xp,
_experience.next_level_xp(),
_experience.attribute_points,
_experience.skill_points,
_player.attributes.get_attribute(&"str_"),
_player.effective_skill(&"melee"),
var title_name := String(_title_definition.get("name", "Sans titre"))
var flavor := String(_title_definition.get("flavor", "Aucune légende n’est encore écrite."))
title.text = "FICHE DE PERSONNAGE"
var lines := [
"Nom : %s" % _player_name,
"Titre : %s" % title_name,
flavor,
"",
"Niveau %d — XP %d/%d" % [_experience.level, _experience.total_xp, _experience.next_level_xp()],
"Points d’attribut : %d" % _experience.attribute_points,
"Points de compétence : %d" % _experience.skill_points,
"",
"Caractéristiques :",
]
for key: StringName in ATTRIBUTE_LABELS:
lines.append("%s : %d" % [ATTRIBUTE_LABELS[key], _player.attributes.get_attribute(key)])
lines.append("")
lines.append("Compétences principales :")
for key: StringName in FEATURED_SKILLS:
lines.append("%s : %d" % [FEATURED_SKILLS[key], _player.effective_skill(key)])
lines.append("")
lines.append("A / S Allouer (Force / Corps à corps) Échap Fermer")
body.text = "\n".join(lines)
+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 = {}
+1 -1
View File
@@ -57,7 +57,7 @@ func map_event(event: GameEvent) -> PresentationEvent:
return PresentationEventType.new(event, &"door", event.message, DoorChestFeedback.DOOR_COLOR)
&"chest_opened":
return PresentationEventType.new(event, &"chest", event.message, DoorChestFeedback.CHEST_COLOR)
&"loot_dropped", &"loot_taken", &"item_picked_up":
&"loot_dropped", &"loot_taken", &"item_picked_up", &"pickup_refused":
return PresentationEventType.new(event, &"loot", event.message, LootFeedback.LOOT_COLOR)
&"trap_triggered", &"trap_discovered", &"trap_disarmed", &"trap_disarm_failed", &"trap_status_applied":
return PresentationEventType.new(event, &"trap", event.message, LootFeedback.TRAP_COLOR)
+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)
+566 -29
View File
@@ -11,49 +11,591 @@ const TRAP_PROMPT := "Espace — Désamorcer le piège"
const SHRINE_PROMPT := "Espace — Prier au sanctuaire"
const QUEST_BOARD_PROMPT := "Espace — Lire le tableau des quêtes"
const REFERENCE_VIEWPORT := Vector2(1920.0, 1080.0)
const MIN_LAYOUT_SCALE := 0.66
const MIN_FONT_SCALE := 0.66
const STATUS_EFFECT_NAMES := {
&"poison": "Empoisonnement",
&"bleeding": "Saignement",
&"burning": "Brûlure",
&"sepsis": "Septicémie",
&"stunned": "Étourdi",
&"feared": "Effrayé",
&"confused": "Confus",
&"wounded": "Blessé",
&"fatigued": "Fatigué",
&"strengthened": "Renforcé",
&"regenerating": "Régénération",
}
@onready var player_health_label: Label = $PlayerHealthLabel
@onready var player_focus_label: Label = $PlayerFocusLabel
@onready var health_bar: ProgressBar = $HealthBar
@onready var focus_bar: ProgressBar = $FocusBar
@onready var experience_bar: ProgressBar = $ExperienceBar
@onready var experience_label: Label = $ExperienceLabel
@onready var spell_label: Label = $SpellLabel
@onready var deadline_label: Label = $DeadlineLabel
@onready var gold_icon: TextureRect = $GoldIcon
@onready var gold_label: Label = $GoldLabel
@onready var quest_tracker_label: Label = $QuestTrackerLabel
@onready var enemy_health_label: Label = $EnemyHealthLabel
@onready var combat_summary_label: Label = $CombatSummaryLabel
@onready var character_status_label: Label = $CharacterStatusLabel
@onready var character_name_label: Label = $ResponsiveLayout/CharacterNameLabel
@onready var character_level_label: Label = $ResponsiveLayout/CharacterLevelLabel
@onready var header_values_label: Label = $HeaderValuesLabel
@onready var title_label: Label = $TitleLabel
@onready var event_log: RichTextLabel = $EventLog
@onready var log_panel: PanelContainer = $ResponsiveLayout/LogPanel
@onready var context_prompt_label: Label = $ContextPromptLabel
@onready var action_hint_label: Label = $ResponsiveLayout/PromptPanel/ActionHintLabel
@onready var responsive_layout: Control = $ResponsiveLayout
const HIDDEN_JOURNAL_KINDS: Array[StringName] = [&"moved", &"enemy_moved", &"companion_moved", &"party_moved", &"episode_published"]
var combat_summary := ""
var log_expanded := false
var _state: GameState
var _run_state: RunState
var _viewport_size := REFERENCE_VIEWPORT
func _ready() -> void:
get_viewport().size_changed.connect(_on_viewport_size_changed)
apply_viewport_layout(get_viewport().get_visible_rect().size)
func _on_viewport_size_changed() -> void:
apply_viewport_layout(get_viewport().get_visible_rect().size)
## Lays the shell out from a 1920×1080 artboard while retaining readable controls
## down to 1280×720. It is public so embedded game views can request a relayout.
func apply_viewport_layout(viewport_size: Vector2) -> void:
if viewport_size.x <= 0.0 or viewport_size.y <= 0.0:
return
_viewport_size = viewport_size
var scale := maxf(MIN_LAYOUT_SCALE, minf(viewport_size.x / REFERENCE_VIEWPORT.x, viewport_size.y / REFERENCE_VIEWPORT.y))
# Do not let the minimum readable layout escape a viewport smaller than 1280×720.
if viewport_size.x < 1280.0 or viewport_size.y < 720.0:
scale = minf(viewport_size.x / REFERENCE_VIEWPORT.x, viewport_size.y / REFERENCE_VIEWPORT.y)
var artboard_size := REFERENCE_VIEWPORT * scale
var origin := (viewport_size - artboard_size) * 0.5
# The shell is one centered 1920×1080 artboard. Camera2D intentionally keeps
# its engine viewport: these opaque masks, not a coupled camera viewport, are
# the visual boundary of the playable world.
_set_rect($ResponsiveLayout/DarkBackdrop, Vector2.ZERO, viewport_size)
_set_rect($ResponsiveLayout/Artboard, origin, artboard_size)
_set_rect($ResponsiveLayout/LetterboxTop, Vector2.ZERO, Vector2(viewport_size.x, origin.y))
_set_rect($ResponsiveLayout/LetterboxBottom, Vector2(0.0, origin.y + artboard_size.y), Vector2(viewport_size.x, origin.y))
_set_rect($ResponsiveLayout/PillarboxLeft, Vector2(0.0, origin.y), Vector2(origin.x, artboard_size.y))
_set_rect($ResponsiveLayout/PillarboxRight, Vector2(origin.x + artboard_size.x, origin.y), Vector2(origin.x, artboard_size.y))
# Reference composition: 16px artboard margins, 24%% rails, and a 48%% central
# frame whose centre is the viewport centre. The slightly taller centre keeps
# the camera focal point stable between top and command bars.
_set_rect($ResponsiveLayout/TopBar, origin + Vector2(16, 12) * scale, Vector2(1888, 76) * scale)
_set_rect($ResponsiveLayout/LeftRail, origin + Vector2(16, 98) * scale, Vector2(460, 842) * scale)
_set_rect($ResponsiveLayout/PlayAreaFrame, origin + Vector2(498, 125) * scale, Vector2(924, 830) * scale)
_set_rect($ResponsiveLayout/RightRail, origin + Vector2(1444, 98) * scale, Vector2(460, 842) * scale)
_set_rect($ResponsiveLayout/CommandBar, origin + Vector2(16, 956) * scale, Vector2(1888, 108) * scale)
# These four panels are deliberately before all chrome in the scene tree.
# Together they cover exactly the artboard outside PlayAreaFrame, hiding the
# full engine viewport while leaving the framed centre unmasked.
_set_rect($ResponsiveLayout/PlayAreaMaskTop, origin, Vector2(1920, 125) * scale)
_set_rect($ResponsiveLayout/PlayAreaMaskLeft, origin + Vector2(0, 125) * scale, Vector2(498, 830) * scale)
_set_rect($ResponsiveLayout/PlayAreaMaskRight, origin + Vector2(1422, 125) * scale, Vector2(498, 830) * scale)
_set_rect($ResponsiveLayout/PlayAreaMaskBottom, origin + Vector2(0, 955) * scale, Vector2(1920, 125) * scale)
# Named rail sections establish the visible content hierarchy. The legacy
# panel paths remain as transparent compatibility hosts for existing callers.
_set_rect($ResponsiveLayout/CharacterSection, origin + Vector2(28, 110) * scale, Vector2(436, 300) * scale)
_set_rect($ResponsiveLayout/ObjectivesSection, origin + Vector2(28, 422) * scale, Vector2(436, 156) * scale)
_set_rect($ResponsiveLayout/StatusSection, origin + Vector2(28, 602) * scale, Vector2(436, 326) * scale)
_set_rect($ResponsiveLayout/JournalSection, origin + Vector2(1456, 110) * scale, Vector2(436, 404) * scale)
_set_rect($ResponsiveLayout/MapSection, origin + Vector2(1456, 526) * scale, Vector2(436, 402) * scale)
_set_rect($ResponsiveLayout/StatsPanel, origin + Vector2(28, 110) * scale, Vector2(436, 300) * scale)
_set_rect($ResponsiveLayout/LogPanel, origin + Vector2(1456, 110) * scale, Vector2(436, 404) * scale)
_set_rect($ResponsiveLayout/PromptPanel, origin + Vector2(490, 968) * scale, Vector2(610, 84) * scale)
_set_rect($ResponsiveLayout/HelpPanel, origin + Vector2(1120, 968) * scale, Vector2(772, 84) * scale)
_set_rect($ResponsiveLayout/QuickSlotStrip, origin + Vector2(28, 968) * scale, Vector2(442, 84) * scale)
# Every title has a deliberate 18px inset: it stays clear of the nine-patch border.
_set_rect($ResponsiveLayout/CharacterSectionTitle, origin + Vector2(44, 128) * scale, Vector2(400, 28) * scale)
_set_rect($ResponsiveLayout/ObjectivesSectionTitle, origin + Vector2(44, 440) * scale, Vector2(400, 24) * scale)
_set_rect($ResponsiveLayout/StatusSectionTitle, origin + Vector2(44, 620) * scale, Vector2(400, 24) * scale)
_set_rect($ResponsiveLayout/JournalSectionTitle, origin + Vector2(1472, 128) * scale, Vector2(400, 28) * scale)
_set_rect($ResponsiveLayout/MapSectionTitle, origin + Vector2(1472, 544) * scale, Vector2(400, 24) * scale)
_set_rect($ResponsiveLayout/QuickSlotHint, origin + Vector2(38, 980) * scale, Vector2(420, 60) * scale)
_set_rect($AchievementToast, origin + Vector2(1450, 48) * scale, Vector2(420, 25) * scale)
_set_rect($TitleLabel, origin + Vector2(675, 24) * scale, Vector2(570, 34) * scale)
_set_rect($TitleNotificationLabel, origin + Vector2(650, 52) * scale, Vector2(620, 26) * scale)
_set_rect($HeaderValuesLabel, origin + Vector2(480, 51) * scale, Vector2(960, 26) * scale)
# Identity leads the character card. The portrait stays at the mockup's 140px
# width and the source aspect ratio (127:140); vital gauges form a clear column.
_set_rect($ResponsiveLayout/PortraitIllustration, origin + Vector2(44, 160) * scale, Vector2(140, 154.33) * scale)
# Character identity is the section title. The legacy name label remains hidden.
_set_rect($ResponsiveLayout/CharacterNameLabel, origin + Vector2(202, 154) * scale, Vector2(226, 30) * scale)
_set_rect($ResponsiveLayout/CharacterLevelLabel, origin + Vector2(202, 164) * scale, Vector2(226, 22) * scale)
_set_rect($PlayerHealthLabel, origin + Vector2(202, 194) * scale, Vector2(226, 22) * scale)
_set_rect($HealthBar, origin + Vector2(202, 218) * scale, Vector2(226, 18) * scale)
_set_rect($PlayerFocusLabel, origin + Vector2(202, 242) * scale, Vector2(226, 22) * scale)
_set_rect($FocusBar, origin + Vector2(202, 266) * scale, Vector2(226, 18) * scale)
_set_rect($ExperienceBar, origin + Vector2(44, 306) * scale, Vector2(384, 22) * scale)
_set_rect($ExperienceLabel, origin + Vector2(48, 306) * scale, Vector2(376, 22) * scale)
_set_rect($GoldIcon, origin + Vector2(44, 366) * scale, Vector2(24, 24) * scale)
_set_rect($GoldLabel, origin + Vector2(76, 366) * scale, Vector2(120, 24) * scale)
_set_rect($QuestTrackerLabel, origin + Vector2(52, 482) * scale, Vector2(376, 92) * scale)
_layout_status_slots(origin, scale)
_set_rect($EventLog, origin + Vector2(1476, 164) * scale, Vector2(396, 330) * scale)
_set_rect($ContextPromptLabel, origin + Vector2(506, 1008) * scale, Vector2(578, 30) * scale)
_set_rect($HelpLabel, origin + Vector2(1132, 980) * scale, Vector2(742, 58) * scale)
var minimap := get_node_or_null("Minimap") as Control
if minimap != null:
minimap.call("_layout_in_hud")
_apply_text_scale(scale)
if log_expanded:
_layout_expanded_log(origin, scale)
func _set_rect(control: Control, position: Vector2, control_size: Vector2) -> void:
control.position = position
control.size = control_size
func _layout_status_slots(origin: Vector2, scale: float) -> void:
# StatusSection ends at y=928. At reference, slots follow the authored
# 664/780/824px composition. At compact scale labels retain enough physical
# height to wrap all effects, so the bounded stack is bottom-aligned instead.
var x := origin.x + 44.0 * scale
var width := 386.0 * scale
var character_y := origin.y + 664.0 * scale
var character_height := 100.0 * scale
var target_height := 24.0 * scale
var deadline_height := 60.0 * scale
var gap := 18.0 * scale
if scale < 1.0:
# These are physical compact-layout heights (not artboard-scaled): the
# multi-effect row needs its full wrapped minimum while all rows remain
# inside StatusSection at 1280×720 with a visible 12px gap.
character_height = 97.0
target_height = 23.0
deadline_height = 28.0
gap = 12.0
# Keep the StatusSection title clear while remaining above its lower edge.
character_y = maxf(origin.y + 662.0 * scale, origin.y + 928.0 * scale - character_height - target_height - deadline_height - 2.0 * gap)
var target_y := character_y + character_height + gap
var deadline_y := target_y + target_height + gap
_set_rect($CharacterStatusLabel, Vector2(x, character_y), Vector2(width, character_height))
_set_rect($EnemyHealthLabel, Vector2(x, target_y), Vector2(width, target_height))
_set_rect($DeadlineLabel, Vector2(x, deadline_y), Vector2(width, deadline_height))
# Dormant labels share a hidden lower slot. _refresh_status_section clears
# and hides them before showing actionable information.
var dormant_y := origin.y + 896.0 * scale
_set_rect($SpellLabel, Vector2(x, dormant_y), Vector2(width, 20.0 * scale))
_set_rect($CombatSummaryLabel, Vector2(x, dormant_y), Vector2(width, 20.0 * scale))
func _apply_text_scale(layout_scale: float) -> void:
var font_scale := clampf(layout_scale, MIN_FONT_SCALE, 1.0)
for control: Control in [
$AchievementToast,
$TitleLabel,
$TitleNotificationLabel,
$HeaderValuesLabel,
$ResponsiveLayout/QuickSlotHint,
$PlayerHealthLabel,
$PlayerFocusLabel,
$ExperienceLabel,
$CharacterStatusLabel,
$ResponsiveLayout/CharacterNameLabel,
$ResponsiveLayout/CharacterLevelLabel,
$GoldLabel,
$QuestTrackerLabel,
$SpellLabel,
$EnemyHealthLabel,
$CombatSummaryLabel,
$DeadlineLabel,
action_hint_label,
$ContextPromptLabel,
$HelpLabel,
]:
var base_size: int = control.get_meta(&"base_font_size", 0)
if base_size == 0:
base_size = control.get_theme_font_size(&"font_size")
control.set_meta(&"base_font_size", base_size)
control.add_theme_font_size_override(&"font_size", roundi(base_size * font_scale))
# RichTextLabel does not use Label's font_size theme key. Keep the journal
# independently readable at 720p without changing the rest of the HUD scale.
var event_log_base_size: int = event_log.get_meta(&"base_normal_font_size", 0)
if event_log_base_size == 0:
event_log_base_size = event_log.get_theme_font_size(&"normal_font_size")
event_log.set_meta(&"base_normal_font_size", event_log_base_size)
event_log.add_theme_font_size_override(&"normal_font_size", max(12, roundi(event_log_base_size * font_scale)))
func _layout_expanded_log(origin: Vector2, scale: float) -> void:
# Explicit expansion may temporarily consume the MapSection, never the world.
_set_rect(log_panel, origin + Vector2(1456, 110) * scale, Vector2(436, 818) * scale)
_set_rect(event_log, origin + Vector2(1476, 154) * scale, Vector2(396, 750) * scale)
func toggle_log() -> void:
log_expanded = not log_expanded
log_panel.offset_bottom = 480.0 if log_expanded else 170.0
event_log.offset_bottom = 468.0 if log_expanded else 158.0
var _state: GameState
var _run_state: RunState
apply_viewport_layout(_viewport_size)
func refresh(state: GameState, events: Array[GameEvent] = [], run_state: RunState = null) -> void:
_state = state
if run_state != null:
_run_state = run_state
player_health_label.text = "Player HP: %d/%d" % [state.player.hit_points, state.player.max_hit_points]
player_focus_label.text = "Focus: %d/%d" % [state.player.focus, state.player.max_focus]
if state.enemies.has(&"goblin"):
var goblin: ActorState = state.enemies[&"goblin"]
enemy_health_label.text = "Goblin HP: %d/%d" % [goblin.hit_points, goblin.max_hit_points]
combat_summary = "Target: Goblin HP: %d/%d" % [goblin.hit_points, goblin.max_hit_points]
else:
enemy_health_label.text = "No active target"
combat_summary = "No active target"
combat_summary_label.text = combat_summary
deadline_label.text = _deadline_status()
gold_label.text = "Or: %d" % (_run_state.gold if _run_state != null else 0)
player_health_label.text = "PV : %d/%d" % [state.player.hit_points, state.player.max_hit_points]
player_focus_label.text = "Focus : %d/%d" % [state.player.focus, state.player.max_focus]
_refresh_live_gauge(health_bar, state.player.hit_points, state.player.max_hit_points)
_refresh_live_gauge(focus_bar, state.player.focus, state.player.max_focus)
_refresh_experience(state.player.progression)
_refresh_header_values()
title_label.text = "Étage %d" % state.floor_state.floor_number
var player_name := _run_state.player_name if _run_state != null else "Sans-Nom"
$ResponsiveLayout/CharacterSectionTitle.text = player_name
character_name_label.text = ""
character_name_label.visible = false
character_level_label.text = "Niveau %d" % state.player.progression.level
_refresh_status_section(state)
gold_label.text = str(_run_state.gold if _run_state != null else 0)
quest_tracker_label.text = _quest_tracker()
action_hint_label.text = "F : Distance • X : Magie • K : Familier"
context_prompt_label.text = get_context_prompt()
# The supplied RunState journal events are the only source for journal text.
event_log.clear()
for event in events:
event_log.append_text(event.message + "\n")
if _should_show_in_journal(event):
event_log.append_text(_localized_event_message(event) + "\n")
func _refresh_status_section(state: GameState) -> void:
for label: Label in [character_status_label, spell_label, enemy_health_label, combat_summary_label, deadline_label]:
label.text = ""
label.visible = false
combat_summary = ""
var effects: Array[String] = []
for effect: StatusEffect in state.player.status_effects:
var name := String(STATUS_EFFECT_NAMES.get(effect.key, String(effect.key).capitalize()))
if state.player.status_effects.size() <= 3:
effects.append("%s (%d tours)" % [name, effect.duration])
else:
effects.append("%s %d" % [name, effect.duration])
if not effects.is_empty():
# Compact separators preserve every effect and duration in the fixed slot.
var prefix := "Effets : " if effects.size() <= 3 else "Effets (%d) : " % effects.size()
character_status_label.text = prefix + (", ".join(effects) if effects.size() <= 3 else " • ".join(effects))
character_status_label.visible = true
var target := _active_target(state)
if target != null:
combat_summary = "%s — PV : %d/%d" % [_target_name(target), target.hit_points, target.max_hit_points]
enemy_health_label.text = combat_summary
enemy_health_label.visible = true
var deadline_status := _deadline_status()
if not deadline_status.is_empty():
deadline_label.text = deadline_status
deadline_label.visible = true
func _active_target(state: GameState) -> ActorState:
var candidates: Array[ActorState] = []
for enemy: ActorState in state.enemies.values():
if enemy.is_alive() and bool(state.visible_cells.get(enemy.cell, false)):
candidates.append(enemy)
if candidates.is_empty():
return null
candidates.sort_custom(func(left: ActorState, right: ActorState) -> bool:
var left_distance := state.player.cell.distance_squared_to(left.cell)
var right_distance := state.player.cell.distance_squared_to(right.cell)
if left_distance != right_distance:
return left_distance < right_distance
return String(left.id) < String(right.id)
)
return candidates[0]
func _target_name(target: ActorState) -> String:
if target.id == &"goblin" or target.content_id == &"goblin":
return "Gobelin"
if _run_state != null and _run_state.content_catalog != null:
var definition := _run_state.content_catalog.get_enemy(target.content_id)
if not definition.is_empty():
return String(definition.get("name", "Ennemi"))
# Never expose an actor/content identifier as player-facing HUD text.
return "Ennemi"
func _should_show_in_journal(event: GameEvent) -> bool:
return event.kind not in HIDDEN_JOURNAL_KINDS
## Converts only the structured events the HUD owns into French. Domain messages
## remain untouched and provide the presentation fallback for every other kind.
func _localized_event_message(event: GameEvent) -> String:
var actor := _localized_actor(event.actor_id)
var target := _localized_actor(event.target_id)
var damage := int(event.payload.get("damage", 0))
var attack_method := String(event.payload.get("attack_method", "attaque"))
match event.kind:
&"game_started":
return "%s commence une nouvelle aventure." % String(event.payload.get("player_name", "Sans-Nom"))
&"moved":
var destination: Variant = event.payload.get("to_cell", event.cell)
return "Vous vous déplacez vers %s." % destination
&"enemy_moved":
return "%s se déplace." % _sentence_case(actor)
&"blocked":
return "Votre chemin est bloqué."
&"melee":
return "Vous frappez %s avec %s et lui infligez %d dégâts." % [target, attack_method, damage]
&"enemy_melee":
return "%s vous frappe avec %s et vous inflige %d dégâts." % [_sentence_case(actor), attack_method, damage]
&"enemy_defeated":
return "%s est vaincu." % _sentence_case(actor)
&"attack_started":
return "Vous attaquez %s avec %s." % [target, attack_method] if event.actor_id == &"player" else "%s attaque %s avec %s." % [_sentence_case(actor), target, attack_method]
&"attack_hit":
return "Vous touchez %s." % target if event.actor_id == &"player" else "%s touche %s." % [_sentence_case(actor), target]
&"damage_dealt":
var damage_target := _with_preposition("à", target)
return "Vous infligez %d dégâts %s." % [damage, damage_target] if event.actor_id == &"player" else "%s inflige %d dégâts %s." % [_sentence_case(actor), damage, damage_target]
&"actor_died":
return "Vous succombez." if event.actor_id == &"player" else "%s succombe." % _sentence_case(actor)
&"xp_granted":
return "Vous gagnez %d points d’expérience." % int(event.payload.get("xp", 0))
&"loot_dropped":
return _localized_loot_dropped(event.payload)
&"loot_taken":
return _localized_loot_taken(event.payload)
&"item_picked_up":
var picked_item := _localized_item_quantity(event.payload)
return "Ramassé : %s." % picked_item if not picked_item.is_empty() else "Ramassage impossible."
&"pickup_refused":
return _localized_pickup_refused(event.payload)
&"companion_intercepted":
return "Votre familier intercepte l’attaque %s." % _with_preposition("de", actor)
&"companion_died":
return "Votre familier tombe, mais votre aventure continue."
&"companion_moved":
return "Votre familier vous suit."
&"episode_published":
return "Épisode %d publié." % int(event.payload.get("number", 0))
&"ranged":
return "Vous tirez sur %s avec %s et infligez %d dégâts." % [target, _localized_weapon(event.payload), damage]
&"cast":
return "Vous lancez %s sur %s et infligez %d dégâts." % [_localized_spell(event.payload), target, damage]
&"ranged_attack_started":
return "Vous préparez un tir avec %s sur %s." % [_localized_weapon(event.payload), target]
&"projectile_fired":
return "Vous tirez avec %s sur %s." % [_localized_weapon(event.payload), target]
&"ranged_attack_hit":
return "Votre tir atteint %s." % target
&"invalid_ranged_target":
return "Tir impossible : %s." % _localized_failure_reason(event.payload.get("reason", ""))
&"spell_targeting_started":
return "Choisissez la cible de votre sort."
&"spell_targeting_cancelled":
return "Ciblage du sort annulé."
&"invalid_spell_target":
return "Sort impossible : %s." % _localized_failure_reason(event.payload.get("reason", ""))
&"spell_cast_started":
return "Vous lancez %s sur %s." % [_localized_spell(event.payload), target]
&"spell_damage_dealt":
return "%s inflige %d dégâts %s." % [_sentence_case(_localized_spell(event.payload)), damage, _with_preposition("à", target)]
&"spell_effect_applied":
return "%s applique l’état %s %s." % [_sentence_case(_localized_spell(event.payload)), _localized_status(event.payload.get("status", "")), _with_preposition("à", target)]
_:
return event.message
func _localized_loot_dropped(payload: Dictionary) -> String:
# Enemy items remain on the ground, while gold is credited to RunState at
# death. Keep both destinations explicit instead of presenting all rewards as
# ground loot.
var dropped_items := _localized_items(payload.get("items", []))
var gold := int(payload.get("gold", 0))
if not dropped_items.is_empty() and gold > 0:
return "Butin — au sol : %s ; or récupéré : %d." % [", ".join(dropped_items), gold]
if not dropped_items.is_empty():
return "Butin au sol : %s." % ", ".join(dropped_items)
if gold > 0:
return "Or récupéré : %d." % gold
return "Aucun butin."
func _localized_items(items: Array) -> PackedStringArray:
var parts := PackedStringArray()
for item_data: Variant in items:
if item_data is Dictionary:
var item := _localized_item_quantity(item_data)
if not item.is_empty():
parts.append(item)
return parts
func _localized_loot_taken(payload: Dictionary) -> String:
var rewards := _localized_reward_parts(payload)
var refused := _localized_refused_items(payload.get("refused_items", []))
if rewards.is_empty() and refused.is_empty():
return "Aucun butin ramassé."
var message := "Butin récupéré"
if not rewards.is_empty():
message += " : %s" % ", ".join(rewards)
if not refused.is_empty():
message += "%s%s" % [" ; " if not rewards.is_empty() else " : ", ", ".join(refused)]
return message + "."
func _localized_pickup_refused(payload: Dictionary) -> String:
var reason := StringName(payload.get("reason", ""))
if reason == &"no_ground_item":
return "Rien à ramasser."
var item := _localized_item_quantity(payload)
if reason == &"capacity" or reason == &"inventory_full":
return "Inventaire plein : %s non ramassé." % item if not item.is_empty() else "Inventaire plein."
return "Ramassage impossible."
func _localized_reward_parts(payload: Dictionary) -> PackedStringArray:
var parts := _localized_items(payload.get("items", []))
var gold := int(payload.get("gold", 0))
if gold > 0:
parts.append("%d or" % gold)
var ammunition := int(payload.get("ammunition", 0))
if ammunition > 0:
parts.append("%d munitions récupérées" % ammunition)
return parts
func _localized_refused_items(items: Array) -> PackedStringArray:
var parts := PackedStringArray()
for item_data: Variant in items:
if item_data is Dictionary:
var item := _localized_item_quantity(item_data)
if not item.is_empty():
parts.append("%s non ramassé (inventaire plein)" % item)
return parts
func _localized_item_quantity(item_data: Dictionary) -> String:
var item_id := StringName(item_data.get("item_id", ""))
if item_id.is_empty():
return ""
var quantity := int(item_data.get("quantity", 1))
if quantity <= 0:
return ""
return "%s x%d" % [_localized_item_name(item_id), quantity]
func _localized_item_name(item_id: StringName) -> String:
if _run_state != null and _run_state.content_catalog != null:
var item := _run_state.content_catalog.get_item(item_id)
if not item.is_empty():
return String(item.get("name", item_id))
return String(item_id).replace("_", " ")
func _localized_weapon(payload: Dictionary) -> String:
var weapon_id := StringName(payload.get("weapon_id", ""))
if _run_state != null and _run_state.content_catalog != null and not weapon_id.is_empty():
var weapon := _run_state.content_catalog.get_item(weapon_id)
if not weapon.is_empty():
return String(weapon.get("name", weapon_id))
return "votre arme à distance"
func _localized_spell(payload: Dictionary) -> String:
var spell_name := String(payload.get("spell_name", ""))
if not spell_name.is_empty():
return spell_name
var spell_id := StringName(payload.get("spell_id", ""))
if _run_state != null and _run_state.content_catalog != null and not spell_id.is_empty():
var spell := _run_state.content_catalog.get_spell(spell_id)
if not spell.is_empty():
return String(spell.get("name", spell_id))
return "votre sort"
func _localized_failure_reason(reason: Variant) -> String:
match StringName(reason):
&"cooldown": return "le sort est en recharge"
&"insufficient_focus": return "Focus insuffisant"
&"out_of_range": return "la cible est hors de portée"
&"line_of_sight_blocked": return "la ligne de vue est bloquée"
&"no_ammunition": return "vous n’avez plus de munitions"
&"no_ranged_weapon": return "aucune arme à distance n’est équipée"
&"invalid_target": return "cible invalide"
&"no_valid_spell_target": return "aucune cible valide pour ce sort"
_: return "action impossible"
func _localized_status(status: Variant) -> String:
match StringName(status):
&"poison": return "empoisonnement"
&"burning": return "brûlure"
&"bleeding": return "saignement"
&"feared": return "peur"
&"stunned": return "étourdissement"
&"wounded": return "blessure"
_: return "effet"
func _sentence_case(text: String) -> String:
return text.left(1).to_upper() + text.substr(1)
func _with_preposition(preposition: String, actor: String) -> String:
if actor.begins_with("le "):
return "%s %s" % ["au" if preposition == "à" else "du", actor.trim_prefix("le ")]
if actor.begins_with("les "):
return "%s %s" % ["aux" if preposition == "à" else "des", actor.trim_prefix("les ")]
return "%s %s" % [preposition, actor]
func _localized_actor(actor_id: StringName) -> String:
match actor_id:
&"player":
return "vous"
&"companion":
return "votre familier"
&"goblin":
return "le gobelin"
&"":
return "l’adversaire"
var content_id := actor_id
if _state != null and _state.enemies.has(actor_id):
var enemy: ActorState = _state.enemies[actor_id]
content_id = enemy.content_id
else:
content_id = _content_id_from_generated_actor(actor_id)
if _run_state != null and _run_state.content_catalog != null:
var enemy_definition := _run_state.content_catalog.get_enemy(content_id)
if not enemy_definition.is_empty():
return _with_definite_article(String(enemy_definition.get("name", "adversaire")))
return "l’adversaire"
func _content_id_from_generated_actor(actor_id: StringName) -> StringName:
var id := String(actor_id)
var suffix_start := id.rfind("_")
if suffix_start >= 0 and id.substr(suffix_start + 1).is_valid_int():
return StringName(id.left(suffix_start))
return actor_id
func _with_definite_article(name: String) -> String:
var normalized := name.strip_edges()
if normalized.is_empty():
return "l’adversaire"
var lower := normalized.to_lower()
if lower.begins_with("le ") or lower.begins_with("la ") or lower.begins_with("les ") or lower.begins_with("l’") or lower.begins_with("l'"):
return normalized
return "l’%s" % normalized if lower.begins_with("a") or lower.begins_with("e") or lower.begins_with("i") or lower.begins_with("o") or lower.begins_with("u") or lower.begins_with("h") else "le %s" % lower
func _refresh_live_gauge(gauge: ProgressBar, current: int, maximum: int) -> void:
gauge.min_value = 0
gauge.max_value = max(1, maximum)
gauge.value = clampi(current, 0, maximum)
func _refresh_header_values() -> void:
# Kept solely as a stable node path for older UI integrations. The floor is
# now the single permanent top-bar value and is refreshed above.
header_values_label.text = ""
header_values_label.visible = false
func _refresh_experience(experience: Experience) -> void:
var current_level_start := experience.xp_for_level(experience.level)
var next_level_total := experience.next_level_xp()
var level_progress := experience.total_xp - current_level_start
var level_required := next_level_total - current_level_start
experience_bar.min_value = 0
experience_bar.max_value = level_required
experience_bar.value = level_progress
experience_label.text = "Niveau %d — XP %d/%d" % [experience.level, level_progress, level_required]
func get_context_prompt() -> String:
if _state == null:
@@ -72,7 +614,7 @@ func get_context_prompt() -> String:
&"stairs":
if _state.floor_state.floor_number > 0 and _state.player.cell == _state.floor_state.entrance:
return STAIRS_UP_PROMPT
if _run_state != null:
if _run_state != null and _state.floor_state.floor_number > 0:
var deadline := _run_state.current_floor_deadline()
if not deadline.can_descend():
return "Escaliers verrouillés — encore %d jour(s) avant l’ouverture" % deadline.days_until_stairs_open()
@@ -86,25 +628,20 @@ func get_context_prompt() -> String:
func _quest_tracker() -> String:
if _run_state == null or not "quest_manager" in _run_state or _run_state.quest_manager == null:
return "Quêtes : aucune"
return "◆ Objectif : aucune quête active"
var active: Array[QuestState] = _run_state.quest_manager.active_states()
if active.is_empty():
return "Quêtes : aucune active"
return "◆ Objectif : aucune quête active"
var state := active[0]
var definition := _run_state.quest_manager.catalog.get_quest(state.quest_id)
for objective: Dictionary in definition.get("objectives", []):
var objective_id := StringName(objective.get("id", ""))
if state.objectives.get(objective_id, 0) < int(objective.get("count", 1)):
return "%s — %s (%d/%d)" % [String(definition.get("title", state.quest_id)), String(objective.get("description", objective_id)), state.objectives.get(objective_id, 0), int(objective.get("count", 1))]
return "%s — terminée" % String(definition.get("title", state.quest_id))
return "◆ %s — %s (%d/%d)" % [String(definition.get("title", state.quest_id)), String(objective.get("description", objective_id)), state.objectives.get(objective_id, 0), int(objective.get("count", 1))]
return "◆ %s — terminée" % String(definition.get("title", state.quest_id))
func _deadline_status() -> String:
if _run_state == null:
if _run_state == null or _run_state.current_floor <= 0:
return ""
var deadline := _run_state.current_floor_deadline()
var status := "Étage %d — %d jour(s) avant l’effondrement" % [_run_state.current_floor, deadline.remaining_days()]
if deadline.collapsing:
return status + " — EFFONDREMENT"
if deadline.can_descend():
return status + " — escaliers ouverts"
return status + " — escaliers dans %d jour(s)" % deadline.days_until_stairs_open()
return "Effondrement du niveau dans %d jours" % deadline.remaining_days()
+3 -3
View File
@@ -1,8 +1,8 @@
class_name InventoryPanel
extends PanelContainer
@onready var entries: RichTextLabel = $Entries
@onready var details: RichTextLabel = $Details
@onready var entries: RichTextLabel = $Layout/Columns/Entries
@onready var details: RichTextLabel = $Layout/Columns/Details
var selected_index := 0
var _inventory: InventoryState
@@ -53,7 +53,7 @@ func refresh() -> void:
var stats := _identification.display_stats(item) if _identification != null else ""
var description := String(item.definition.raw.get("description", "")) if _identification == null or _identification.is_identified(item) else "Its properties are not yet known."
var comparison := _equipment.comparison_for(item, _identification) if _equipment != null else ""
details.text = "%s\n%s\n%s\n\n%s\n\n%s\n↑/↓ Select E Equip U Use D Drop I Close" % [name, stats, description, comparison, equipment_summary]
details.text = "%s\n%s\n%s\n\n%s\n\n%s" % [name, stats, description, comparison, equipment_summary]
func _equipment_summary() -> String:
if _equipment == null or _identification == null:
+16 -3
View File
@@ -21,15 +21,17 @@ func get_last_feedback_state() -> Dictionary:
func begin(event: GameEvent, presentation_kind: StringName) -> void:
var color := _color_for(presentation_kind)
var feedback_label := label_for_event(event, presentation_kind)
_last_feedback_state = {
"kind": presentation_kind,
"duration_ms": EFFECT_DURATION_MS,
"color": color,
"label": feedback_label,
}
if _test_mode:
return
var label := Label.new()
label.text = _label_for(event, presentation_kind)
label.text = feedback_label
label.modulate = color
label.position = Vector2(390, 80)
label.z_index = 20
@@ -47,9 +49,20 @@ func _color_for(presentation_kind: StringName) -> Color:
&"quest": return QUEST_COLOR
_: return LOOT_COLOR
func _label_for(event: GameEvent, presentation_kind: StringName) -> String:
func label_for_event(event: GameEvent, presentation_kind: StringName) -> String:
if presentation_kind == &"loot":
match event.kind:
&"loot_dropped": return "✦ BUTIN AU SOL"
&"item_picked_up": return "✦ OBJET RAMASSÉ"
&"loot_taken": return "✦ BUTIN RÉCUPÉRÉ"
&"pickup_refused":
var reason := StringName(event.payload.get("reason", ""))
if reason == &"no_ground_item":
return "! RIEN À RAMASSER"
if reason == &"capacity" or reason == &"inventory_full":
return "! INVENTAIRE PLEIN"
return "! RAMASSAGE IMPOSSIBLE"
match presentation_kind:
&"loot": return "✦ LOOT SECURED"
&"trap": return "! TRAP"
&"quest": return "✦ QUEST UPDATED"
_: return event.message
+1 -1
View File
@@ -1,7 +1,7 @@
class_name LootPanel
extends PanelContainer
@onready var entries: RichTextLabel = $Entries
@onready var entries: RichTextLabel = $Layout/Entries
func present(reward: Dictionary, catalog: ContentCatalog) -> void:
entries.text = _reward_text(reward, catalog)
+10 -28
View File
@@ -1,49 +1,37 @@
class_name CharacterCreation
extends Control
signal run_requested(settings: RunSettings, player_name: String, base_archetype: StringName, race: StringName)
signal run_requested(settings: RunSettings, player_name: String)
signal cancelled
const RunSettingsType = preload("res://scripts/domain/run/run_settings.gd")
const ClassEngineType = preload("res://scripts/domain/progression/class_engine.gd")
const DIFFICULTY_IDS: Array[StringName] = [&"touriste", &"crawler", &"veteran", &"masochiste"]
const ARCHETYPE_IDS: Array[StringName] = [&"vanguard", &"mystic", &"scout"]
@onready var name_edit: LineEdit = $Panel/Layout/Fields/NameEdit
@onready var archetype_option: OptionButton = $Panel/Layout/Fields/ArchetypeOption
@onready var race_option: OptionButton = $Panel/Layout/Fields/RaceOption
@onready var recommendation_label: Label = $Panel/Layout/Fields/RecommendationLabel
@onready var pet_check: CheckBox = $Panel/Layout/Fields/PetCheck
@onready var pet_details: VBoxContainer = $Panel/Layout/Fields/PetDetails
@onready var pet_name_edit: LineEdit = $Panel/Layout/Fields/PetDetails/PetNameEdit
@onready var pet_species_edit: LineEdit = $Panel/Layout/Fields/PetDetails/PetSpeciesEdit
@onready var seed_edit: LineEdit = $Panel/Layout/Fields/SeedEdit
@onready var difficulty_option: OptionButton = $Panel/Layout/Fields/DifficultyOption
@onready var permadeath_option: OptionButton = $Panel/Layout/Fields/PermadeathOption
@onready var validation_label: Label = $Panel/Layout/ValidationLabel
func _ready() -> void:
_populate_races()
race_option.item_selected.connect(_refresh_recommendation)
pet_check.toggled.connect(func(enabled: bool) -> void: pet_details.visible = enabled)
pet_details.visible = pet_check.button_pressed
$Panel/Layout/Actions/StartRunButton.pressed.connect(_on_start_run_pressed)
$Panel/Layout/Actions/CancelButton.pressed.connect(func() -> void: cancelled.emit())
func _populate_races() -> void:
var engine := ClassEngineType.load_default()
for race in engine.race_definitions():
race_option.add_item(String(race.get("name", race.get("id", ""))))
race_option.set_item_metadata(race_option.item_count - 1, StringName(race.get("id", "")))
_refresh_recommendation(race_option.selected)
func _refresh_recommendation(_selected: int) -> void:
var race_id := StringName(race_option.get_item_metadata(race_option.selected))
var recommendations := ClassEngineType.load_default().recommendations_for(race_id)
recommendation_label.text = "Recommended: %s" % (", ".join(PackedStringArray(recommendations.map(func(id: StringName) -> String: return String(id).capitalize()))) if not recommendations.is_empty() else "Recommended: any base class")
func _on_start_run_pressed() -> void:
var selected_difficulty := DIFFICULTY_IDS[difficulty_option.selected]
var settings := RunSettingsType.new(
seed_edit.text,
selected_difficulty,
permadeath_option.get_selected_id() == 1,
pet_check.button_pressed
pet_check.button_pressed,
pet_name_edit.text,
pet_species_edit.text
)
if not settings.is_valid():
validation_label.text = settings.validation_error()
@@ -52,10 +40,4 @@ func _on_start_run_pressed() -> void:
var player_name := name_edit.text.strip_edges()
if player_name.is_empty():
player_name = "Sans-Nom"
var selected_archetype := ARCHETYPE_IDS[archetype_option.selected]
var selected_race := StringName(race_option.get_item_metadata(race_option.selected))
var choice := ClassEngineType.load_default().creation_choice(selected_race, selected_archetype)
if not bool(choice.get("accepted", false)):
validation_label.text = "Choose a compatible race and base archetype."
return
run_requested.emit(settings, player_name, selected_archetype, selected_race)
run_requested.emit(settings, player_name)
+23 -7
View File
@@ -29,11 +29,11 @@ func _ready() -> void:
save_load_panel.cancelled.connect(_show_main_menu)
_show_main_menu()
if _get_capture_mode():
_start_new_run(RunSettings.new("visual-check", &"crawler", false, false), "Visual Check", &"vanguard", &"race_humain_standard")
_start_new_run(RunSettings.new("visual-check", &"crawler", false, false), "Visual Check")
func _get_capture_mode() -> bool:
var arguments := OS.get_cmdline_user_args()
return "--capture" in arguments or "--capture-exit" in arguments
return "--capture" in arguments or "--capture-exit" in arguments or "--visual-check-compact" in arguments
func _show_character_creation() -> void:
menu.visible = false
@@ -94,14 +94,14 @@ func _show_load_slots() -> void:
func show_save_slots() -> void:
_save_load_mode = "save"
save_load_panel.present(_save_load_mode, _save_repository.list_slots())
save_load_panel.present(_save_load_mode, _save_repository.list_slots(), "La sauvegarde est manuelle. Choisissez un emplacement.")
func _on_save_load_slot_requested(slot: int) -> void:
var result := save_to_slot(slot) if _save_load_mode == "save" else load_slot(slot)
if bool(result.get("ok", false)):
_show_main_menu() if _save_load_mode == "load" else save_load_panel.set_status("Saved to slot %d." % slot)
_show_main_menu() if _save_load_mode == "load" else save_load_panel.set_status("Partie sauvegardée dans l’emplacement %d." % slot)
else:
save_load_panel.set_status(String(result.get("error", "Save operation failed.")))
save_load_panel.set_status(String(result.get("error", "Échec de la sauvegarde.")))
func save_to_slot(slot: int) -> Dictionary:
var game := get_node_or_null("Game") as Game
@@ -122,17 +122,33 @@ func load_slot(slot: int) -> Dictionary:
game.name = "Game"
game.configure_loaded_run(loaded)
add_child(game)
_connect_game_navigation(game)
menu.visible = false
character_creation.visible = false
return loaded
func _start_new_run(settings: RunSettings, player_name: String, base_archetype: StringName, race: StringName = &"race_humain_standard") -> void:
func _start_new_run(settings: RunSettings, player_name: String) -> void:
var game := GameScene.instantiate() as Game
game.name = "Game"
game.configure_new_run(settings, player_name, base_archetype, race)
game.configure_new_run(settings, player_name)
add_child(game)
_connect_game_navigation(game)
menu.visible = false
character_creation.visible = false
game.game_started.connect(func(started_settings: RunSettings, run_state: RunState) -> void:
game_started.emit(started_settings, run_state)
)
func _connect_game_navigation(game: Game) -> void:
game.death_navigation_requested.connect(_on_death_navigation_requested.bind(game))
game.save_requested.connect(show_save_slots)
func _on_death_navigation_requested(action: StringName, game: Game) -> void:
if not is_instance_valid(game):
return
game.queue_free()
_show_main_menu()
if action == &"load":
_show_load_slots()
elif action == &"new_run":
_show_character_creation()
+63 -14
View File
@@ -2,12 +2,17 @@ class_name Minimap
extends Control
const CROP_RADIUS := 6
const CELL_SIZE := 12.0
const UNKNOWN_COLOR := Color(0.025, 0.04, 0.09, 0.94)
const EXPLORED_COLOR := Color(0.18, 0.32, 0.48, 0.96)
const VISIBLE_COLOR := Color(0.72, 0.84, 0.9, 1.0)
const PLAYER_COLOR := Color(1.0, 0.92, 0.32, 1.0)
const THREAT_COLOR := Color(0.95, 0.42, 0.18, 1.0)
const UNKNOWN_COLOR := Color(0.035, 0.03, 0.025, 0.96)
const EXPLORED_COLOR := Color(0.24, 0.29, 0.25, 0.98)
const VISIBLE_COLOR := Color(0.72, 0.66, 0.51, 1.0)
const PLAYER_COLOR := Color(0.96, 0.78, 0.3, 1.0)
const THREAT_COLOR := Color(0.84, 0.22, 0.14, 1.0)
const COMPACT_SIZE := Vector2(396.0, 340.0)
const EXPANDED_SIZE := Vector2(520.0, 560.0)
const COMPACT_RAIL_INSET := 14.0
const EXPANDED_FRAME_INSET := 28.0
@onready var map_region: Control = $MapRegion
var expanded := false
var _crop_radius := CROP_RADIUS
@@ -17,6 +22,17 @@ var _visible_cells: Dictionary[Vector2i, bool] = {}
var _explored_cells: Dictionary[Vector2i, bool] = {}
var _threat_cells: Dictionary[Vector2i, bool] = {}
func _ready() -> void:
resized.connect(queue_redraw)
map_region.resized.connect(queue_redraw)
get_viewport().size_changed.connect(_on_viewport_size_changed)
call_deferred("_layout_in_hud")
func _on_viewport_size_changed() -> void:
# GameHud updates the rail rectangles from the same signal; defer until those
# rectangles have received their new responsive dimensions.
call_deferred("_layout_in_hud")
func set_state(map: GridMapState, player_cell: Vector2i, visible_cells: Dictionary[Vector2i, bool], explored_cells: Dictionary[Vector2i, bool], threat_cells: Dictionary[Vector2i, bool]) -> void:
_map = map
_player_cell = player_cell
@@ -49,28 +65,61 @@ func get_cell_visibility_state(cell: Vector2i) -> StringName:
func get_threat_marker_cells() -> Dictionary[Vector2i, bool]:
var threats: Dictionary[Vector2i, bool] = {}
var displayed := get_displayed_cells()
for cell in _threat_cells:
if _visible_cells.has(cell) and get_displayed_cells().has(cell):
if _visible_cells.has(cell) and displayed.has(cell):
threats[cell] = true
return threats
## Returns the local rectangle exclusively available to map cells and markers.
func get_drawable_map_rect() -> Rect2:
if not is_instance_valid(map_region):
return Rect2()
var region_size := map_region.size
var square_side := minf(region_size.x, region_size.y)
return Rect2(map_region.position + (region_size - Vector2.ONE * square_side) * 0.5, Vector2.ONE * square_side)
func toggle_expanded() -> void:
expanded = not expanded
_crop_radius = CROP_RADIUS * 2 if expanded else CROP_RADIUS
set_anchors_and_offsets_preset(Control.PRESET_CENTER_TOP if expanded else Control.PRESET_TOP_RIGHT)
size = Vector2(312, 312) if expanded else Vector2(168, 168)
position = Vector2(484, 72) if expanded else Vector2(-188, 184)
_layout_in_hud()
queue_redraw()
func _layout_in_hud() -> void:
if not is_inside_tree():
return
var layout := get_node_or_null("../ResponsiveLayout") as Control
if layout == null:
return
var host := layout.get_node_or_null("PlayAreaFrame" if expanded else "MapSection") as Control
if host == null:
return
var requested_size := EXPANDED_SIZE if expanded else COMPACT_SIZE
var inset := EXPANDED_FRAME_INSET if expanded else COMPACT_RAIL_INSET
var available_size := host.size - Vector2.ONE * inset * 2.0
if not expanded:
# The section heading occupies its own clear line above the map.
available_size.y -= 28.0
var panel_size := Vector2(minf(requested_size.x, available_size.x), minf(requested_size.y, available_size.y))
size = panel_size
if expanded:
position = host.position + (host.size - panel_size) * 0.5
else:
position = host.position + Vector2((host.size.x - panel_size.x) * 0.5, 42.0)
func _draw() -> void:
if _map == null:
return
var drawable_rect := get_drawable_map_rect()
if drawable_rect.size.x <= 0.0 or drawable_rect.size.y <= 0.0:
return
var displayed := get_displayed_cells()
var threat_cells := get_threat_marker_cells()
var cells_across := _crop_radius * 2 + 1
var draw_cell_size := size.x / float(cells_across)
var draw_cell_size := drawable_rect.size.x / float(cells_across)
for cell in displayed:
var local := cell - _player_cell + Vector2i(cells_across / 2, cells_across / 2)
var rect := Rect2(Vector2(local) * draw_cell_size, Vector2.ONE * (draw_cell_size - 1.0))
var local := cell - _player_cell + Vector2i(_crop_radius, _crop_radius)
var rect := Rect2(drawable_rect.position + Vector2(local) * draw_cell_size, Vector2.ONE * (draw_cell_size - 1.0))
var color := UNKNOWN_COLOR
if get_cell_visibility_state(cell) == &"visible":
color = VISIBLE_COLOR
@@ -79,5 +128,5 @@ func _draw() -> void:
draw_rect(rect, color)
if cell == _player_cell:
draw_circle(rect.get_center(), draw_cell_size * 0.28, PLAYER_COLOR)
elif get_threat_marker_cells().has(cell):
elif threat_cells.has(cell):
draw_circle(rect.get_center(), draw_cell_size * 0.25, THREAT_COLOR)
+3 -3
View File
@@ -1,9 +1,9 @@
class_name QuestPanel
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 _manager: QuestManager
var _quest_ids: Array[StringName] = []
@@ -0,0 +1,63 @@
class_name RaceClassChoicePanel
extends PanelContainer
signal race_confirmed(race_id: StringName)
signal class_confirmed(class_id: StringName)
@onready var title: Label = $Layout/Title
@onready var intro: Label = $Layout/Intro
@onready var options: RichTextLabel = $Layout/Options
var _stage: StringName = &"race"
var _choices: Array[Dictionary] = []
var _selected_index := 0
func present_races(choices: Array[Dictionary]) -> void:
_stage = &"race"
_present(choices)
func present_classes(choices: Array[Dictionary]) -> void:
_stage = &"class"
_present(choices)
func dismiss() -> void:
visible = false
_choices.clear()
_selected_index = 0
func select_next(delta: int) -> void:
if _choices.is_empty():
return
_selected_index = posmod(_selected_index + delta, _choices.size())
refresh()
func confirm() -> void:
if _choices.is_empty():
return
var choice_id := StringName(_choices[_selected_index].get("id", ""))
if _stage == &"race":
race_confirmed.emit(choice_id)
else:
class_confirmed.emit(choice_id)
func stage() -> StringName:
return _stage
func _present(choices: Array[Dictionary]) -> void:
_choices = choices.duplicate(true)
_selected_index = 0
visible = true
refresh()
func refresh() -> void:
title.text = "NIVEAU 3 — CHOIX DE %s" % ("RACE" if _stage == &"race" else "CLASSE")
intro.text = "Choisissez votre race, puis votre classe. Ce choix est permanent."
var lines := PackedStringArray()
for index in _choices.size():
var choice := _choices[index]
var marker := ">" if index == _selected_index else " "
lines.append("%s %s" % [marker, String(choice.get("name", choice.get("id", "")))])
var description := String(choice.get("description", ""))
if not description.is_empty():
lines.append(" %s" % description)
options.text = "\n".join(lines) + "\n\nHaut/Bas : sélectionner Entrée : confirmer"
@@ -0,0 +1 @@
uid://chvjdg03j75dt
+3 -3
View File
@@ -18,7 +18,7 @@ func _ready() -> void:
func present(mode: String, slot_metas: Array[Dictionary], message: String = "") -> void:
_mode = mode
visible = true
title_label.text = "SAVE RUN" if mode == "save" else "LOAD RUN"
title_label.text = "SAUVEGARDER LA PARTIE" if mode == "save" else "CHARGER UNE PARTIE"
status_label.text = message
for index in range(slots.get_child_count()):
var button := slots.get_child(index) as Button
@@ -39,5 +39,5 @@ func _request_slot(slot: int) -> void:
func _label_for(meta: Dictionary) -> String:
var slot := int(meta.get("slot", 0))
if not bool(meta.get("exists", false)):
return "SLOT %d — EMPTY" % slot
return "SLOT %d — %s — FLOOR %d" % [slot, String(meta.get("character_name", "?")), int(meta.get("floor", 0))]
return "EMPLACEMENT %d — VIDE" % slot
return "EMPLACEMENT %d — %s — ÉTAGE %d" % [slot, String(meta.get("character_name", "?")), int(meta.get("floor", 0))]

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