Files
TheTree_mock/scripts/ui/infirmary_room_art.gd
Takeshi b84bade045 Save The Tree implementation and acceptance work in progress
Preserve production code, regression fixtures, audio assets and provenance, test infrastructure, and the original-completion plan and progress ledger. Final game and Windows acceptance remain pending; excluded local artifacts and native experiments are not part of this snapshot.
2026-10-11 15:58:00 +09:00

55 lines
3.0 KiB
GDScript

extends RefCounted
## Medical ward furnishings at the established 16px scale. Cosmetic levels
## describe the existing FacilityInstance.level; no treatment or upgrade rule.
const Layout := preload("res://scripts/ui/room_presentation.gd")
const INK := Color("34413b")
const WOOD := Color("8e6348")
const WOOD_LIGHT := Color("c39665")
const LINEN := Color("eee5c9")
static func draw_room(canvas: CanvasItem, rect: Rect2, p: float, back: bool, level: int, dungeon: Texture2D) -> void:
var tier := clampi(level, 1, 3)
var frame := Color("8fa5a2") if back else WOOD_LIGHT
var cover := Color("729e96") if back else Color("86b3a8")
var wall := Color("acb9a5") if back else Color("d4c7a5")
# Medicine occupies only the upper 13px. All established patient anchors
# remain available, including the rotated 2x4 footprint and narrow zooms.
canvas.draw_rect(Rect2(rect.position+Vector2(1,2)*p, Vector2(rect.size.x-2*p,12*p)),wall)
var cabinet_width := maxf(6, minf(20, floorf((rect.size.x/p-6)/3)))
for side: int in 2:
var x := rect.position.x+2*p if side==0 else rect.end.x-(cabinet_width+2)*p
canvas.draw_rect(Rect2(x,rect.position.y+2*p,cabinet_width*p,11*p),INK)
canvas.draw_rect(Rect2(x+p,rect.position.y+3*p,(cabinet_width-2)*p,9*p),frame)
canvas.draw_rect(Rect2(x+2*p,rect.position.y+4*p,(cabinet_width-4)*p,5*p),Color("577e77"))
canvas.draw_rect(Rect2(x+p,rect.position.y+9*p,(cabinet_width-2)*p,p),LINEN)
if dungeon != null:
# Existing Tiny Dungeon CC0 blue/green bottles, exact packed indices.
var index := 113+side
canvas.draw_texture_rect_region(dungeon,Rect2(x+(cabinet_width-8)*p/2,rect.position.y+3*p,8*p,8*p),Rect2((index%12)*16,(index/12)*16,16,16))
if tier >= 2:
canvas.draw_rect(Rect2(x+2*p,rect.position.y+10*p,(cabinet_width-4)*p,p),WOOD)
canvas.draw_rect(Rect2(x+cabinet_width*p/2,rect.position.y+10*p,p,p),LINEN)
if tier >= 3:
canvas.draw_rect(Rect2(x,rect.position.y+2*p,cabinet_width*p,p),Color("d6ad52"))
canvas.draw_rect(Rect2(x+2*p,rect.position.y+5*p,p,3*p),Color("c3d1c5"))
var mid := rect.get_center().x
canvas.draw_rect(Rect2(mid-3*p,rect.position.y+3*p,6*p,9*p),INK)
canvas.draw_rect(Rect2(mid-2*p,rect.position.y+4*p,4*p,7*p),LINEN)
canvas.draw_rect(Rect2(mid,rect.position.y+6*p,p,4*p),Color("52836c"))
canvas.draw_rect(Rect2(mid-p,rect.position.y+5*p,3*p,2*p),cover)
if tier >= 3:
canvas.draw_rect(Rect2(mid-3*p,rect.position.y+3*p,6*p,p),Color("d6ad52"))
for anchor: Vector2 in Layout.slots(rect,p,&"infirmary"):
var at := anchor+Vector2(-7,-9)*p
canvas.draw_rect(Rect2(at+Vector2(0,2)*p,Vector2(13,7)*p),INK)
canvas.draw_rect(Rect2(at+Vector2(1,2)*p,Vector2(11,4)*p),LINEN)
canvas.draw_rect(Rect2(at+Vector2(5,2)*p,Vector2(7,5)*p),cover)
canvas.draw_rect(Rect2(at,Vector2(1,10)*p),frame)
canvas.draw_rect(Rect2(at+Vector2(12,5)*p,Vector2(1,5)*p),frame)
canvas.draw_rect(Rect2(at+Vector2(2,2)*p,Vector2(3,2)*p),Color("fff0d6"))
if tier >= 2:
canvas.draw_rect(Rect2(at+Vector2(5,4)*p,Vector2(7,1)*p),LINEN)
if tier >= 3:
canvas.draw_rect(Rect2(at+Vector2(6,6)*p,Vector2(6,1)*p),Color("c3d1c5"))