Some checks failed
Godot CI / Import + smoke test (push) Failing after 13s
1. stretch/mode: viewport → canvas_items + aspect=keep 3D теперь рендерится в native window resolution (1920×1080), а 2D UI остаётся в 640×360 logical coords с nearest-фильтрацией — гибрид smooth 3D + pixel-art UI. 2. [input] map: добавлены move_forward/back/left/right на WASD + стрелки (physical_keycode для layout-независимости). Дефолтные ui_left/right/up/down в Godot 4 биндятся только на стрелки — поэтому WASD ничего не делал. 3. HUD-подсказка обновлена: «WASD ходить · мышь смотреть · ЛКМ взаимодействие». Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
90 lines
3.1 KiB
GDScript
90 lines
3.1 KiB
GDScript
extends Node3D
|
||
|
||
@onready var player: FPVController = $PlayerFPV
|
||
@onready var gift_box: Interactable = $GiftBox
|
||
@onready var system_unit: Node3D = $SystemUnit
|
||
@onready var note: Interactable = $SystemUnit/Note
|
||
@onready var flash_drive: Interactable = $Desk/FlashDrive
|
||
@onready var father: Node3D = $FatherNPC
|
||
|
||
enum State { INTRO, EXPLORE_GIFT, INSIDE_GIFT, NOTE_READ, FATHER_FAREWELL, SEEK_DRIVE, ENDING }
|
||
var state: State = State.INTRO
|
||
|
||
|
||
func _ready() -> void:
|
||
system_unit.visible = false
|
||
note.visible = false
|
||
gift_box.set_interactable(false)
|
||
flash_drive.set_interactable(false)
|
||
|
||
player.lock_input()
|
||
player.interactable_focused.connect(_on_player_focused)
|
||
player.interactable_unfocused.connect(_on_player_unfocused)
|
||
|
||
DialogManager.set_hud("Акт 1 — Подарок · WASD ходить · мышь смотреть · ЛКМ взаимодействие · ESC мышь · Q выход")
|
||
|
||
await get_tree().create_timer(0.8).timeout
|
||
await DialogManager.say("ОТЕЦ", "Ну? Чё стоишь. Распаковывай давай. Сам собирал, между прочим — полночи не спал.")
|
||
await DialogManager.think("Так… новый пека? Серьёзно? После моего динозавра?")
|
||
|
||
state = State.EXPLORE_GIFT
|
||
gift_box.set_interactable(true)
|
||
player.unlock_input()
|
||
|
||
|
||
func _on_player_focused(obj: Node) -> void:
|
||
if obj.has_method("get_prompt"):
|
||
DialogManager.set_prompt(obj.get_prompt())
|
||
|
||
|
||
func _on_player_unfocused() -> void:
|
||
DialogManager.clear_prompt()
|
||
|
||
|
||
func _on_gift_interacted(_p: Node) -> void:
|
||
if state != State.EXPLORE_GIFT:
|
||
return
|
||
state = State.INSIDE_GIFT
|
||
gift_box.set_interactable(false)
|
||
gift_box.visible = false
|
||
system_unit.visible = true
|
||
note.visible = true
|
||
note.set_interactable(true)
|
||
DialogManager.clear_prompt()
|
||
|
||
|
||
func _on_note_interacted(_p: Node) -> void:
|
||
if state != State.INSIDE_GIFT:
|
||
return
|
||
state = State.NOTE_READ
|
||
note.set_interactable(false)
|
||
player.lock_input()
|
||
DialogManager.clear_prompt()
|
||
|
||
await DialogManager.show_note("«Не сожги. Пароль от Wi-Fi на холодильнике. — Бать»")
|
||
await DialogManager.think("Бать ну ты красавчик конечно.")
|
||
|
||
state = State.FATHER_FAREWELL
|
||
await DialogManager.say("ОТЕЦ", "Флешка с Шиндой на столе. Ставь сам, не маленький. Если запорешь — сам и переставляй.")
|
||
|
||
var tween: Tween = create_tween()
|
||
tween.tween_property(father, "position:x", father.position.x - 2.5, 0.8)
|
||
await tween.finished
|
||
father.visible = false
|
||
|
||
state = State.SEEK_DRIVE
|
||
flash_drive.set_interactable(true)
|
||
player.unlock_input()
|
||
|
||
|
||
func _on_drive_interacted(_p: Node) -> void:
|
||
if state != State.SEEK_DRIVE:
|
||
return
|
||
state = State.ENDING
|
||
flash_drive.set_interactable(false)
|
||
player.lock_input()
|
||
DialogManager.clear_prompt()
|
||
|
||
await DialogManager.think("Ну ладно. Андрюхино так Андрюхино. Поехали.")
|
||
await DialogManager.say("СИСТЕМА", "Конец Акта 1. Акт 2 — Установка Шиндовс (TBD).")
|
||
get_tree().quit()
|