feat: add C6 special interactions

This commit is contained in:
goose
2026-10-03 12:54:52 -04:00
parent 68d35bf94b
commit 7e93cf0b5b
16 changed files with 439 additions and 1 deletions
+9
View File
@@ -7,6 +7,9 @@ const STAIRS_PROMPT := "Espace — Descendre l’escalier"
const STAIRS_UP_PROMPT := "Espace — Monter l’escalier"
const BED_PROMPT := "H — Se reposer (coûte 1 jour)"
const EXIT_REACHED_PROMPT := "Sortie atteinte — prochain étage bientôt disponible"
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"
@onready var player_health_label: Label = $PlayerHealthLabel
@onready var player_focus_label: Label = $PlayerFocusLabel
@@ -45,6 +48,12 @@ func get_context_prompt() -> String:
if _state == null:
return ""
match _state.get_context_target():
&"trap":
return TRAP_PROMPT
&"shrine":
return SHRINE_PROMPT
&"quest_board":
return QUEST_BOARD_PROMPT
&"chest":
return CHEST_PROMPT
&"closed_door":
+23
View File
@@ -21,6 +21,9 @@ const TEXTURES := {
var map: GridMapState
var _visible_cells: Dictionary[Vector2i, bool] = {}
var _explored_cells: Dictionary[Vector2i, bool] = {}
var _traps: Dictionary[Vector2i, Dictionary] = {}
var _shrines: Dictionary[Vector2i, Dictionary] = {}
var _quest_boards: Dictionary[Vector2i, Dictionary] = {}
func get_cell_rect(cell: Vector2i) -> Rect2:
return Rect2(Vector2(cell * TILE_SIZE), Vector2(TILE_SIZE))
@@ -34,6 +37,12 @@ func set_visibility(visible_cells: Dictionary[Vector2i, bool], explored_cells: D
_explored_cells = explored_cells.duplicate()
queue_redraw()
func set_special_markers(traps: Dictionary[Vector2i, Dictionary], shrines: Dictionary[Vector2i, Dictionary], quest_boards: Dictionary[Vector2i, Dictionary]) -> void:
_traps = traps.duplicate(true)
_shrines = shrines.duplicate(true)
_quest_boards = quest_boards.duplicate(true)
queue_redraw()
func get_cell_visibility_state(cell: Vector2i) -> StringName:
if _visible_cells.has(cell):
return &"visible"
@@ -65,3 +74,17 @@ func _draw() -> void:
draw_rect(tile_rect, EXPLORED_OVERLAY_COLOR)
else:
draw_texture_rect(TEXTURES[map.get_cell(cell)], tile_rect, false, color)
_draw_special_marker(cell, tile_rect)
func _draw_special_marker(cell: Vector2i, tile_rect: Rect2) -> void:
# Never expose special content through black fog or dim explored memory.
if not _visible_cells.has(cell):
return
if _traps.has(cell):
var trap: Dictionary = _traps[cell]
if bool(trap.get("discovered", false)) and not bool(trap.get("disarmed", false)):
draw_circle(tile_rect.get_center(), 5.0, Color(1.0, 0.35, 0.2, 0.95))
if _shrines.has(cell):
draw_circle(tile_rect.get_center(), 5.0, Color(0.45, 0.85, 1.0, 0.95))
if _quest_boards.has(cell):
draw_rect(Rect2(tile_rect.position + Vector2(10, 7), Vector2(12, 18)), Color(0.95, 0.78, 0.32, 0.95))