Phase 3: Charakter-Anlage + Viadukt-Set-Piece mit Wren-Moment
- Charakter-Anlage (character_creation.tscn): Namenseingabe mit Default Tyrveil, Enter/confirm bestaetigt, cancel zurueck; Controller nutzt den Tastatur-Fallback mit bestaetigbarem Default (virtuelle Tastatur bewusst ausgelassen, nur Mobile/Web nativ); Name in GameState.player_name, erscheint in der Dialog-Box - Neues Spiel: Hauptmenue -> Charakter-Anlage -> Viadukt -> (Platzhalter- Uebergang) Reiterquadrant; Fortsetzen unveraendert - Viadukt (scenes/viaduct): vier kurze Segmente - schmaler Steg mit Sprung-Luecke und Gelaender-Stuecken, Kletter-Engstelle (Mechanik aus Phase 1b), Wren-Moment, Endplattform mit Uebergang; cineastischer Kamera-Schwenk beim Betreten (player.play_camera_pan, SPEC 2) - Wren-Moment: nicht abbrechbarer Entscheidungspunkt ueber das bestehende Dialog-System (can_abort:false sperrt cancel UND dialogue_abort); beide Optionen retten Wren (fixer Ausgang laut STORY.md), Klinge/Herz -10/+10, Beziehung +1/+3, Wahl als Story-Flag viaduct_wren_rescue (neues gespeichertes story_flags-Muster im GameState) - Permadeath: KillZone unter dem Steg - AN: Game Over ins Hauptmenue, AUS: Respawn am zuletzt erreichten Segment-Checkpoint - DialogueSystem: story_flag-Options-Tag, is_abort_allowed, Spielername aus GameState in der Box - .idea/ in .gitignore aufgenommen - Headless verifiziert (23 Checks): Namensfluss, Pan-Sperre, Respawn, Abbruch-Sperre im Wren-Moment, beide Pfade inkl. Flags, Endübergang, Game Over bei Permadeath AN Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
f0cd59c1e3
commit
3cdf5f6ac5
13 changed files with 630 additions and 10 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -15,3 +15,4 @@ desktop.ini
|
||||||
|
|
||||||
# Editor
|
# Editor
|
||||||
*.tmp
|
*.tmp
|
||||||
|
.idea/
|
||||||
|
|
|
||||||
46
data/dialogue/viaduct_wren.json
Normal file
46
data/dialogue/viaduct_wren.json
Normal file
|
|
@ -0,0 +1,46 @@
|
||||||
|
{
|
||||||
|
"id": "viaduct_wren",
|
||||||
|
"start": "stumble",
|
||||||
|
"can_abort": false,
|
||||||
|
"speakers": {
|
||||||
|
"wren": "Wren",
|
||||||
|
"player": "Tyrveil"
|
||||||
|
},
|
||||||
|
"nodes": {
|
||||||
|
"stumble": {
|
||||||
|
"speaker": "wren",
|
||||||
|
"text": "Tyrveil—! Die Platte— sie kippt, ich rutsche—! Ich krieg keinen Halt, ich kann nicht—!",
|
||||||
|
"options": [
|
||||||
|
{
|
||||||
|
"text": "Sieh mich an! Hand her. JETZT. Du fällst heute nicht — beweg dich!",
|
||||||
|
"blade_heart": -10,
|
||||||
|
"relationship": { "wren": 1 },
|
||||||
|
"story_flag": { "viaduct_wren_rescue": "blade" },
|
||||||
|
"next": "saved_blade"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"text": "Wren. Atme. Nur der nächste Schritt — ich bin genau hier, ich lasse dich nicht fallen.",
|
||||||
|
"blade_heart": 10,
|
||||||
|
"relationship": { "wren": 3 },
|
||||||
|
"story_flag": { "viaduct_wren_rescue": "heart" },
|
||||||
|
"next": "saved_heart"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"saved_blade": {
|
||||||
|
"speaker": "wren",
|
||||||
|
"text": "Ja— ja! Hab deine Hand. Ich steh. Ich steh wieder. Tut mir leid, ich wollte nicht—",
|
||||||
|
"next": "onward"
|
||||||
|
},
|
||||||
|
"saved_heart": {
|
||||||
|
"speaker": "wren",
|
||||||
|
"text": "Ein Schritt. Noch einer. ... Ich steh wieder. Du hast nicht mal gezittert. Ich schon. Danke.",
|
||||||
|
"next": "onward"
|
||||||
|
},
|
||||||
|
"onward": {
|
||||||
|
"speaker": "wren",
|
||||||
|
"text": "Geh du vor. Wenn ich deinen Rücken sehe, weiß ich, wohin ich muss.",
|
||||||
|
"next": null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
71
scenes/ui/character_creation.tscn
Normal file
71
scenes/ui/character_creation.tscn
Normal file
|
|
@ -0,0 +1,71 @@
|
||||||
|
[gd_scene load_steps=2 format=3]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://scripts/ui/character_creation.gd" id="1_creation"]
|
||||||
|
|
||||||
|
[node name="CharacterCreation" type="Control"]
|
||||||
|
layout_mode = 3
|
||||||
|
anchors_preset = 15
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
script = ExtResource("1_creation")
|
||||||
|
|
||||||
|
[node name="Background" type="ColorRect" parent="."]
|
||||||
|
layout_mode = 1
|
||||||
|
anchors_preset = 15
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
color = Color(0.07, 0.08, 0.1, 1)
|
||||||
|
|
||||||
|
[node name="CenterContainer" type="CenterContainer" parent="."]
|
||||||
|
layout_mode = 1
|
||||||
|
anchors_preset = 15
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
|
||||||
|
[node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
theme_override_constants/separation = 16
|
||||||
|
|
||||||
|
[node name="TitleLabel" type="Label" parent="CenterContainer/VBoxContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
theme_override_font_sizes/font_size = 40
|
||||||
|
text = "Wer bist du, Gezeichneter?"
|
||||||
|
horizontal_alignment = 1
|
||||||
|
|
||||||
|
[node name="HintLabel" type="Label" parent="CenterContainer/VBoxContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
theme_override_font_sizes/font_size = 16
|
||||||
|
theme_override_colors/font_color = Color(0.7, 0.7, 0.7, 1)
|
||||||
|
text = "Name eintippen (Tastatur) oder den Vorschlag bestätigen (Controller)."
|
||||||
|
horizontal_alignment = 1
|
||||||
|
|
||||||
|
[node name="TitleSpacer" type="Control" parent="CenterContainer/VBoxContainer"]
|
||||||
|
custom_minimum_size = Vector2(0, 12)
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="NameEdit" type="LineEdit" parent="CenterContainer/VBoxContainer"]
|
||||||
|
custom_minimum_size = Vector2(320, 44)
|
||||||
|
layout_mode = 2
|
||||||
|
max_length = 24
|
||||||
|
alignment = 1
|
||||||
|
|
||||||
|
[node name="Buttons" type="HBoxContainer" parent="CenterContainer/VBoxContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
theme_override_constants/separation = 12
|
||||||
|
alignment = 1
|
||||||
|
|
||||||
|
[node name="ConfirmButton" type="Button" parent="CenterContainer/VBoxContainer/Buttons"]
|
||||||
|
custom_minimum_size = Vector2(180, 44)
|
||||||
|
layout_mode = 2
|
||||||
|
text = "Bestätigen"
|
||||||
|
|
||||||
|
[node name="BackButton" type="Button" parent="CenterContainer/VBoxContainer/Buttons"]
|
||||||
|
custom_minimum_size = Vector2(180, 44)
|
||||||
|
layout_mode = 2
|
||||||
|
text = "Zurück"
|
||||||
284
scenes/viaduct/viaduct.tscn
Normal file
284
scenes/viaduct/viaduct.tscn
Normal file
|
|
@ -0,0 +1,284 @@
|
||||||
|
[gd_scene load_steps=31 format=3]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://scripts/gameplay/viaduct.gd" id="1_viaduct"]
|
||||||
|
[ext_resource type="PackedScene" path="res://scenes/player.tscn" id="2_player"]
|
||||||
|
[ext_resource type="PackedScene" path="res://scenes/ui/debug_overlay.tscn" id="3_debug"]
|
||||||
|
[ext_resource type="Script" path="res://scripts/gameplay/zone_trigger.gd" id="4_zone"]
|
||||||
|
[ext_resource type="PackedScene" path="res://scenes/ui/speech_bubble.tscn" id="5_bubble"]
|
||||||
|
|
||||||
|
[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_sky"]
|
||||||
|
sky_horizon_color = Color(0.64625, 0.65575, 0.67075, 1)
|
||||||
|
ground_horizon_color = Color(0.64625, 0.65575, 0.67075, 1)
|
||||||
|
|
||||||
|
[sub_resource type="Sky" id="Sky_sky"]
|
||||||
|
sky_material = SubResource("ProceduralSkyMaterial_sky")
|
||||||
|
|
||||||
|
[sub_resource type="Environment" id="Environment_env"]
|
||||||
|
background_mode = 2
|
||||||
|
sky = SubResource("Sky_sky")
|
||||||
|
tonemap_mode = 2
|
||||||
|
|
||||||
|
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_stone"]
|
||||||
|
albedo_color = Color(0.45, 0.44, 0.42, 1)
|
||||||
|
|
||||||
|
[sub_resource type="BoxShape3D" id="BoxShape3D_platform"]
|
||||||
|
size = Vector3(8, 1, 8)
|
||||||
|
|
||||||
|
[sub_resource type="BoxMesh" id="BoxMesh_platform"]
|
||||||
|
material = SubResource("StandardMaterial3D_stone")
|
||||||
|
size = Vector3(8, 1, 8)
|
||||||
|
|
||||||
|
[sub_resource type="BoxShape3D" id="BoxShape3D_walkway"]
|
||||||
|
size = Vector3(2, 1, 10)
|
||||||
|
|
||||||
|
[sub_resource type="BoxMesh" id="BoxMesh_walkway"]
|
||||||
|
material = SubResource("StandardMaterial3D_stone")
|
||||||
|
size = Vector3(2, 1, 10)
|
||||||
|
|
||||||
|
[sub_resource type="BoxShape3D" id="BoxShape3D_connector"]
|
||||||
|
size = Vector3(2, 1, 3)
|
||||||
|
|
||||||
|
[sub_resource type="BoxMesh" id="BoxMesh_connector"]
|
||||||
|
material = SubResource("StandardMaterial3D_stone")
|
||||||
|
size = Vector3(2, 1, 3)
|
||||||
|
|
||||||
|
[sub_resource type="BoxShape3D" id="BoxShape3D_wide"]
|
||||||
|
size = Vector3(4, 1, 10)
|
||||||
|
|
||||||
|
[sub_resource type="BoxMesh" id="BoxMesh_wide"]
|
||||||
|
material = SubResource("StandardMaterial3D_stone")
|
||||||
|
size = Vector3(4, 1, 10)
|
||||||
|
|
||||||
|
[sub_resource type="BoxShape3D" id="BoxShape3D_wall"]
|
||||||
|
size = Vector3(2, 2, 2)
|
||||||
|
|
||||||
|
[sub_resource type="BoxMesh" id="BoxMesh_wall"]
|
||||||
|
material = SubResource("StandardMaterial3D_stone")
|
||||||
|
size = Vector3(2, 2, 2)
|
||||||
|
|
||||||
|
[sub_resource type="BoxShape3D" id="BoxShape3D_rail"]
|
||||||
|
size = Vector3(0.3, 1, 4)
|
||||||
|
|
||||||
|
[sub_resource type="BoxMesh" id="BoxMesh_rail"]
|
||||||
|
material = SubResource("StandardMaterial3D_stone")
|
||||||
|
size = Vector3(0.3, 1, 4)
|
||||||
|
|
||||||
|
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_wren"]
|
||||||
|
albedo_color = Color(0.45, 0.72, 0.45, 1)
|
||||||
|
|
||||||
|
[sub_resource type="CapsuleMesh" id="CapsuleMesh_wren"]
|
||||||
|
material = SubResource("StandardMaterial3D_wren")
|
||||||
|
radius = 0.4
|
||||||
|
height = 1.8
|
||||||
|
|
||||||
|
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_wren"]
|
||||||
|
radius = 0.4
|
||||||
|
height = 1.8
|
||||||
|
|
||||||
|
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_trigger"]
|
||||||
|
transparency = 1
|
||||||
|
albedo_color = Color(0.3, 0.8, 1, 0.35)
|
||||||
|
|
||||||
|
[sub_resource type="BoxShape3D" id="BoxShape3D_trigger"]
|
||||||
|
size = Vector3(2, 2, 2)
|
||||||
|
|
||||||
|
[sub_resource type="BoxMesh" id="BoxMesh_trigger"]
|
||||||
|
material = SubResource("StandardMaterial3D_trigger")
|
||||||
|
size = Vector3(2, 2, 2)
|
||||||
|
|
||||||
|
[sub_resource type="BoxShape3D" id="BoxShape3D_killzone"]
|
||||||
|
size = Vector3(60, 6, 80)
|
||||||
|
|
||||||
|
[sub_resource type="BoxShape3D" id="BoxShape3D_checkpoint"]
|
||||||
|
size = Vector3(3, 2, 2)
|
||||||
|
|
||||||
|
[sub_resource type="BoxShape3D" id="BoxShape3D_wren_trigger"]
|
||||||
|
size = Vector3(4, 3, 3)
|
||||||
|
|
||||||
|
[node name="Viaduct" type="Node3D"]
|
||||||
|
script = ExtResource("1_viaduct")
|
||||||
|
|
||||||
|
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
|
||||||
|
environment = SubResource("Environment_env")
|
||||||
|
|
||||||
|
[node name="Sun" type="DirectionalLight3D" parent="."]
|
||||||
|
transform = Transform3D(0.866025, 0.383022, -0.321394, 0, 0.642788, 0.766044, 0.5, -0.663414, 0.55667, 0, 12, 0)
|
||||||
|
shadow_enabled = true
|
||||||
|
|
||||||
|
[node name="StartPlatform" type="StaticBody3D" parent="."]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.5, 0)
|
||||||
|
|
||||||
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="StartPlatform"]
|
||||||
|
shape = SubResource("BoxShape3D_platform")
|
||||||
|
|
||||||
|
[node name="MeshInstance3D" type="MeshInstance3D" parent="StartPlatform"]
|
||||||
|
mesh = SubResource("BoxMesh_platform")
|
||||||
|
|
||||||
|
[node name="Walk1a" type="StaticBody3D" parent="."]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.5, -9)
|
||||||
|
|
||||||
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="Walk1a"]
|
||||||
|
shape = SubResource("BoxShape3D_walkway")
|
||||||
|
|
||||||
|
[node name="MeshInstance3D" type="MeshInstance3D" parent="Walk1a"]
|
||||||
|
mesh = SubResource("BoxMesh_walkway")
|
||||||
|
|
||||||
|
[node name="Walk1b" type="StaticBody3D" parent="."]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.5, -20.5)
|
||||||
|
|
||||||
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="Walk1b"]
|
||||||
|
shape = SubResource("BoxShape3D_walkway")
|
||||||
|
|
||||||
|
[node name="MeshInstance3D" type="MeshInstance3D" parent="Walk1b"]
|
||||||
|
mesh = SubResource("BoxMesh_walkway")
|
||||||
|
|
||||||
|
[node name="RailWest" type="StaticBody3D" parent="."]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.15, 0.5, -7)
|
||||||
|
|
||||||
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="RailWest"]
|
||||||
|
shape = SubResource("BoxShape3D_rail")
|
||||||
|
|
||||||
|
[node name="MeshInstance3D" type="MeshInstance3D" parent="RailWest"]
|
||||||
|
mesh = SubResource("BoxMesh_rail")
|
||||||
|
|
||||||
|
[node name="RailEast" type="StaticBody3D" parent="."]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.15, 0.5, -11)
|
||||||
|
|
||||||
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="RailEast"]
|
||||||
|
shape = SubResource("BoxShape3D_rail")
|
||||||
|
|
||||||
|
[node name="MeshInstance3D" type="MeshInstance3D" parent="RailEast"]
|
||||||
|
mesh = SubResource("BoxMesh_rail")
|
||||||
|
|
||||||
|
[node name="ClimbWall" type="StaticBody3D" parent="."]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, -26.5)
|
||||||
|
|
||||||
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="ClimbWall"]
|
||||||
|
shape = SubResource("BoxShape3D_wall")
|
||||||
|
|
||||||
|
[node name="MeshInstance3D" type="MeshInstance3D" parent="ClimbWall"]
|
||||||
|
mesh = SubResource("BoxMesh_wall")
|
||||||
|
|
||||||
|
[node name="Walk2" type="StaticBody3D" parent="."]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.5, -32.5)
|
||||||
|
|
||||||
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="Walk2"]
|
||||||
|
shape = SubResource("BoxShape3D_walkway")
|
||||||
|
|
||||||
|
[node name="MeshInstance3D" type="MeshInstance3D" parent="Walk2"]
|
||||||
|
mesh = SubResource("BoxMesh_walkway")
|
||||||
|
|
||||||
|
[node name="WidePlatform" type="StaticBody3D" parent="."]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.5, -41.5)
|
||||||
|
|
||||||
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="WidePlatform"]
|
||||||
|
shape = SubResource("BoxShape3D_wide")
|
||||||
|
|
||||||
|
[node name="MeshInstance3D" type="MeshInstance3D" parent="WidePlatform"]
|
||||||
|
mesh = SubResource("BoxMesh_wide")
|
||||||
|
|
||||||
|
[node name="Connector" type="StaticBody3D" parent="."]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.5, -47.5)
|
||||||
|
|
||||||
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="Connector"]
|
||||||
|
shape = SubResource("BoxShape3D_connector")
|
||||||
|
|
||||||
|
[node name="MeshInstance3D" type="MeshInstance3D" parent="Connector"]
|
||||||
|
mesh = SubResource("BoxMesh_connector")
|
||||||
|
|
||||||
|
[node name="EndPlatform" type="StaticBody3D" parent="."]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.5, -52.5)
|
||||||
|
|
||||||
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="EndPlatform"]
|
||||||
|
shape = SubResource("BoxShape3D_platform")
|
||||||
|
|
||||||
|
[node name="MeshInstance3D" type="MeshInstance3D" parent="EndPlatform"]
|
||||||
|
mesh = SubResource("BoxMesh_platform")
|
||||||
|
|
||||||
|
[node name="Wren" type="StaticBody3D" parent="."]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.9, 0, -42)
|
||||||
|
|
||||||
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="Wren"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.9, 0)
|
||||||
|
shape = SubResource("CapsuleShape3D_wren")
|
||||||
|
|
||||||
|
[node name="MeshInstance3D" type="MeshInstance3D" parent="Wren"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.9, 0)
|
||||||
|
mesh = SubResource("CapsuleMesh_wren")
|
||||||
|
|
||||||
|
[node name="NameLabel" type="Label3D" parent="Wren"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.2, 0)
|
||||||
|
billboard = 1
|
||||||
|
text = "Wren"
|
||||||
|
font_size = 64
|
||||||
|
outline_size = 16
|
||||||
|
|
||||||
|
[node name="SpeechBubble" parent="Wren" instance=ExtResource("5_bubble")]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.8, 0)
|
||||||
|
|
||||||
|
[node name="Checkpoints" type="Node3D" parent="."]
|
||||||
|
|
||||||
|
[node name="Checkpoint1" type="Area3D" parent="Checkpoints"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, -5)
|
||||||
|
collision_layer = 0
|
||||||
|
collision_mask = 2
|
||||||
|
|
||||||
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="Checkpoints/Checkpoint1"]
|
||||||
|
shape = SubResource("BoxShape3D_checkpoint")
|
||||||
|
|
||||||
|
[node name="Checkpoint2" type="Area3D" parent="Checkpoints"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, -24)
|
||||||
|
collision_layer = 0
|
||||||
|
collision_mask = 2
|
||||||
|
|
||||||
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="Checkpoints/Checkpoint2"]
|
||||||
|
shape = SubResource("BoxShape3D_checkpoint")
|
||||||
|
|
||||||
|
[node name="Checkpoint3" type="Area3D" parent="Checkpoints"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, -37)
|
||||||
|
collision_layer = 0
|
||||||
|
collision_mask = 2
|
||||||
|
|
||||||
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="Checkpoints/Checkpoint3"]
|
||||||
|
shape = SubResource("BoxShape3D_checkpoint")
|
||||||
|
|
||||||
|
[node name="WrenTrigger" type="Area3D" parent="."]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.5, -40)
|
||||||
|
collision_layer = 0
|
||||||
|
collision_mask = 2
|
||||||
|
|
||||||
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="WrenTrigger"]
|
||||||
|
shape = SubResource("BoxShape3D_wren_trigger")
|
||||||
|
|
||||||
|
[node name="KillZone" type="Area3D" parent="."]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -10, -26)
|
||||||
|
collision_layer = 0
|
||||||
|
collision_mask = 2
|
||||||
|
|
||||||
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="KillZone"]
|
||||||
|
shape = SubResource("BoxShape3D_killzone")
|
||||||
|
|
||||||
|
[node name="EndTrigger" type="Area3D" parent="."]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, -53.5)
|
||||||
|
collision_layer = 0
|
||||||
|
collision_mask = 2
|
||||||
|
script = ExtResource("4_zone")
|
||||||
|
target_scene_path = "res://scenes/hub/rider_quadrant.tscn"
|
||||||
|
|
||||||
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="EndTrigger"]
|
||||||
|
shape = SubResource("BoxShape3D_trigger")
|
||||||
|
|
||||||
|
[node name="MeshInstance3D" type="MeshInstance3D" parent="EndTrigger"]
|
||||||
|
mesh = SubResource("BoxMesh_trigger")
|
||||||
|
|
||||||
|
[node name="Label3D" type="Label3D" parent="EndTrigger"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.6, 0)
|
||||||
|
billboard = 1
|
||||||
|
text = "Zum Reiterquadrant"
|
||||||
|
font_size = 40
|
||||||
|
outline_size = 12
|
||||||
|
|
||||||
|
[node name="Player" parent="." instance=ExtResource("2_player")]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.1, 2)
|
||||||
|
|
||||||
|
[node name="DebugOverlay" parent="." instance=ExtResource("3_debug")]
|
||||||
|
|
@ -16,7 +16,12 @@ extends Node
|
||||||
## Dialog ab; Tyrveil sagt dem Gegenüber dabei eine zufällig gewählte
|
## Dialog ab; Tyrveil sagt dem Gegenüber dabei eine zufällig gewählte
|
||||||
## Zeile aus dem abort_lines-Array der Dialog-Datei an (Fallback:
|
## Zeile aus dem abort_lines-Array der Dialog-Datei an (Fallback:
|
||||||
## abort_line bzw. Standard) — so klingt der Abschied pro Charakter
|
## abort_line bzw. Standard) — so klingt der Abschied pro Charakter
|
||||||
## unterschiedlich. Abgebrochene Dialoge gelten nur dann als geführt, wenn in diesem
|
## unterschiedlich. Dialoge mit "can_abort": false (z. B. der
|
||||||
|
## Wren-Moment am Viadukt) sind nicht abbrechbar: Der Spieler muss eine
|
||||||
|
## Option wählen, bevor die Szene fortschreitet. Options-Tag story_flag
|
||||||
|
## (Flag-Name -> Wert) schreibt Story-Flags in den GameState (z. B. WIE
|
||||||
|
## Wren gerettet wurde). Der Anzeigename des Spielers in der Box kommt
|
||||||
|
## aus GameState.player_name (Charakter-Anlage). Abgebrochene Dialoge gelten nur dann als geführt, wenn in diesem
|
||||||
## Durchlauf bereits Options-Effekte angewendet wurden — so bleibt der
|
## Durchlauf bereits Options-Effekte angewendet wurden — so bleibt der
|
||||||
## Erst-Durchlauf-Effekt erhalten, ohne dass Abbrechen zum Werte-Farming
|
## Erst-Durchlauf-Effekt erhalten, ohne dass Abbrechen zum Werte-Farming
|
||||||
## taugt. dialogue_started/dialogue_finished erlauben es, Spielerbewegung
|
## taugt. dialogue_started/dialogue_finished erlauben es, Spielerbewegung
|
||||||
|
|
@ -31,6 +36,7 @@ const FALLBACK_LINE_SECONDS := 2.5
|
||||||
const DEFAULT_ABORT_LINE := "Nicht jetzt. Wir reden später weiter."
|
const DEFAULT_ABORT_LINE := "Nicht jetzt. Wir reden später weiter."
|
||||||
|
|
||||||
var is_dialogue_active := false
|
var is_dialogue_active := false
|
||||||
|
var is_abort_allowed := true
|
||||||
|
|
||||||
var _speakers: Dictionary = {}
|
var _speakers: Dictionary = {}
|
||||||
var _speaker_names: Dictionary = {}
|
var _speaker_names: Dictionary = {}
|
||||||
|
|
@ -60,6 +66,7 @@ func start_dialogue(dialogue_path: String, speakers: Dictionary) -> void:
|
||||||
_abort_lines = data.get("abort_lines", [])
|
_abort_lines = data.get("abort_lines", [])
|
||||||
if _abort_lines.is_empty():
|
if _abort_lines.is_empty():
|
||||||
_abort_lines = [str(data.get("abort_line", DEFAULT_ABORT_LINE))]
|
_abort_lines = [str(data.get("abort_line", DEFAULT_ABORT_LINE))]
|
||||||
|
is_abort_allowed = bool(data.get("can_abort", true))
|
||||||
is_dialogue_active = true
|
is_dialogue_active = true
|
||||||
dialogue_started.emit(dialogue_id)
|
dialogue_started.emit(dialogue_id)
|
||||||
_run_dialogue(data)
|
_run_dialogue(data)
|
||||||
|
|
@ -68,7 +75,7 @@ func start_dialogue(dialogue_path: String, speakers: Dictionary) -> void:
|
||||||
## Merkt einen Abbruch-Wunsch (cancel) während laufender Dialog-Zeilen
|
## Merkt einen Abbruch-Wunsch (cancel) während laufender Dialog-Zeilen
|
||||||
## vor; offene Antwortauswahlen behandelt die Dialog-Box selbst.
|
## vor; offene Antwortauswahlen behandelt die Dialog-Box selbst.
|
||||||
func _unhandled_input(event: InputEvent) -> void:
|
func _unhandled_input(event: InputEvent) -> void:
|
||||||
if not is_dialogue_active:
|
if not is_dialogue_active or not is_abort_allowed:
|
||||||
return
|
return
|
||||||
if _box != null and _box.has_open_options():
|
if _box != null and _box.has_open_options():
|
||||||
return
|
return
|
||||||
|
|
@ -188,6 +195,10 @@ func _apply_option_effects(option: Dictionary) -> void:
|
||||||
for npc_id in relationship_shifts:
|
for npc_id in relationship_shifts:
|
||||||
RelationshipSystem.adjust_relationship(str(npc_id), int(relationship_shifts[npc_id]))
|
RelationshipSystem.adjust_relationship(str(npc_id), int(relationship_shifts[npc_id]))
|
||||||
_has_applied_effects = true
|
_has_applied_effects = true
|
||||||
|
var flag_changes: Dictionary = option.get("story_flag", {})
|
||||||
|
for flag_name in flag_changes:
|
||||||
|
GameState.set_story_flag(str(flag_name), flag_changes[flag_name])
|
||||||
|
_has_applied_effects = true
|
||||||
|
|
||||||
|
|
||||||
## Spielt eine zufällig gewählte Abbruch-Zeile Tyrveils, damit der
|
## Spielt eine zufällig gewählte Abbruch-Zeile Tyrveils, damit der
|
||||||
|
|
@ -229,9 +240,12 @@ func _bubble_for(speaker_id: String) -> Node:
|
||||||
return bubble
|
return bubble
|
||||||
|
|
||||||
|
|
||||||
## Liefert den Anzeigenamen eines Sprechers aus der speakers-Map der
|
## Liefert den Anzeigenamen eines Sprechers: für den Spieler den in der
|
||||||
## Dialog-Datei, sonst die großgeschriebene Sprecher-ID.
|
## Charakter-Anlage gewählten Namen, sonst den Eintrag aus der
|
||||||
|
## speakers-Map der Dialog-Datei bzw. die großgeschriebene Sprecher-ID.
|
||||||
func _display_name(speaker_id: String) -> String:
|
func _display_name(speaker_id: String) -> String:
|
||||||
|
if speaker_id == PLAYER_SPEAKER_ID:
|
||||||
|
return GameState.player_name
|
||||||
return str(_speaker_names.get(speaker_id, speaker_id.capitalize()))
|
return str(_speaker_names.get(speaker_id, speaker_id.capitalize()))
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,9 @@ const HUMANITY_MAX := 100
|
||||||
const DEFAULT_STRENGTH := 35
|
const DEFAULT_STRENGTH := 35
|
||||||
const DEFAULT_AGILITY := 35
|
const DEFAULT_AGILITY := 35
|
||||||
const DEFAULT_INTELLECT := 15
|
const DEFAULT_INTELLECT := 15
|
||||||
|
const DEFAULT_PLAYER_NAME := "Tyrveil"
|
||||||
|
|
||||||
|
var player_name := DEFAULT_PLAYER_NAME
|
||||||
var strength := DEFAULT_STRENGTH
|
var strength := DEFAULT_STRENGTH
|
||||||
var agility := DEFAULT_AGILITY
|
var agility := DEFAULT_AGILITY
|
||||||
var intellect := DEFAULT_INTELLECT
|
var intellect := DEFAULT_INTELLECT
|
||||||
|
|
@ -31,11 +33,13 @@ var blade_heart_tone := 0
|
||||||
var humanity := 0
|
var humanity := 0
|
||||||
var relationships: Dictionary = {}
|
var relationships: Dictionary = {}
|
||||||
var completed_dialogues: Dictionary = {}
|
var completed_dialogues: Dictionary = {}
|
||||||
|
var story_flags: Dictionary = {}
|
||||||
var is_permadeath_enabled := true
|
var is_permadeath_enabled := true
|
||||||
|
|
||||||
|
|
||||||
## Setzt alle Werte auf die Startwerte eines neuen Spiels zurück.
|
## Setzt alle Werte auf die Startwerte eines neuen Spiels zurück.
|
||||||
func reset() -> void:
|
func reset() -> void:
|
||||||
|
player_name = DEFAULT_PLAYER_NAME
|
||||||
strength = DEFAULT_STRENGTH
|
strength = DEFAULT_STRENGTH
|
||||||
agility = DEFAULT_AGILITY
|
agility = DEFAULT_AGILITY
|
||||||
intellect = DEFAULT_INTELLECT
|
intellect = DEFAULT_INTELLECT
|
||||||
|
|
@ -43,6 +47,7 @@ func reset() -> void:
|
||||||
humanity = 0
|
humanity = 0
|
||||||
relationships.clear()
|
relationships.clear()
|
||||||
completed_dialogues.clear()
|
completed_dialogues.clear()
|
||||||
|
story_flags.clear()
|
||||||
is_permadeath_enabled = true
|
is_permadeath_enabled = true
|
||||||
blade_heart_tone_changed.emit(blade_heart_tone)
|
blade_heart_tone_changed.emit(blade_heart_tone)
|
||||||
|
|
||||||
|
|
@ -110,9 +115,22 @@ func has_completed_dialogue(dialogue_id: String) -> bool:
|
||||||
return completed_dialogues.get(dialogue_id, false)
|
return completed_dialogues.get(dialogue_id, false)
|
||||||
|
|
||||||
|
|
||||||
|
## Setzt ein Story-Flag (z. B. wie Wren am Viadukt gerettet wurde) —
|
||||||
|
## gleiches gespeichertes Muster wie completed_dialogues, damit spätere
|
||||||
|
## Phasen darauf reagieren können.
|
||||||
|
func set_story_flag(flag_name: String, value: Variant) -> void:
|
||||||
|
story_flags[flag_name] = value
|
||||||
|
|
||||||
|
|
||||||
|
## Liest ein Story-Flag, default wenn es nicht gesetzt ist.
|
||||||
|
func get_story_flag(flag_name: String, default: Variant = null) -> Variant:
|
||||||
|
return story_flags.get(flag_name, default)
|
||||||
|
|
||||||
|
|
||||||
## Serialisiert den kompletten Zustand als Dictionary für das SaveSystem.
|
## Serialisiert den kompletten Zustand als Dictionary für das SaveSystem.
|
||||||
func to_save_dict() -> Dictionary:
|
func to_save_dict() -> Dictionary:
|
||||||
return {
|
return {
|
||||||
|
"player_name": player_name,
|
||||||
"strength": strength,
|
"strength": strength,
|
||||||
"agility": agility,
|
"agility": agility,
|
||||||
"intellect": intellect,
|
"intellect": intellect,
|
||||||
|
|
@ -120,6 +138,7 @@ func to_save_dict() -> Dictionary:
|
||||||
"humanity": humanity,
|
"humanity": humanity,
|
||||||
"relationships": relationships.duplicate(),
|
"relationships": relationships.duplicate(),
|
||||||
"completed_dialogues": completed_dialogues.duplicate(),
|
"completed_dialogues": completed_dialogues.duplicate(),
|
||||||
|
"story_flags": story_flags.duplicate(),
|
||||||
"is_permadeath_enabled": is_permadeath_enabled,
|
"is_permadeath_enabled": is_permadeath_enabled,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -129,6 +148,9 @@ func to_save_dict() -> Dictionary:
|
||||||
## normalisiert und alle Werte geklemmt; Änderungs-Signale werden nach dem
|
## normalisiert und alle Werte geklemmt; Änderungs-Signale werden nach dem
|
||||||
## Laden ausgelöst.
|
## Laden ausgelöst.
|
||||||
func apply_save_dict(data: Dictionary) -> void:
|
func apply_save_dict(data: Dictionary) -> void:
|
||||||
|
player_name = str(data.get("player_name", DEFAULT_PLAYER_NAME))
|
||||||
|
if player_name.strip_edges().is_empty():
|
||||||
|
player_name = DEFAULT_PLAYER_NAME
|
||||||
strength = clampi(int(data.get("strength", DEFAULT_STRENGTH)), STAT_MIN, STAT_MAX)
|
strength = clampi(int(data.get("strength", DEFAULT_STRENGTH)), STAT_MIN, STAT_MAX)
|
||||||
agility = clampi(int(data.get("agility", DEFAULT_AGILITY)), STAT_MIN, STAT_MAX)
|
agility = clampi(int(data.get("agility", DEFAULT_AGILITY)), STAT_MIN, STAT_MAX)
|
||||||
intellect = clampi(int(data.get("intellect", DEFAULT_INTELLECT)), STAT_MIN, STAT_MAX)
|
intellect = clampi(int(data.get("intellect", DEFAULT_INTELLECT)), STAT_MIN, STAT_MAX)
|
||||||
|
|
@ -143,6 +165,10 @@ func apply_save_dict(data: Dictionary) -> void:
|
||||||
var saved_dialogues: Dictionary = data.get("completed_dialogues", {})
|
var saved_dialogues: Dictionary = data.get("completed_dialogues", {})
|
||||||
for dialogue_id in saved_dialogues:
|
for dialogue_id in saved_dialogues:
|
||||||
completed_dialogues[String(dialogue_id)] = bool(saved_dialogues[dialogue_id])
|
completed_dialogues[String(dialogue_id)] = bool(saved_dialogues[dialogue_id])
|
||||||
|
story_flags.clear()
|
||||||
|
var saved_flags: Dictionary = data.get("story_flags", {})
|
||||||
|
for flag_name in saved_flags:
|
||||||
|
story_flags[String(flag_name)] = saved_flags[flag_name]
|
||||||
blade_heart_tone_changed.emit(blade_heart_tone)
|
blade_heart_tone_changed.emit(blade_heart_tone)
|
||||||
for npc_id in relationships:
|
for npc_id in relationships:
|
||||||
relationship_changed.emit(npc_id, relationships[npc_id])
|
relationship_changed.emit(npc_id, relationships[npc_id])
|
||||||
|
|
|
||||||
|
|
@ -46,9 +46,15 @@ const CLIMB_LANDING_INSET := 0.35
|
||||||
const CLIMB_HEADROOM := 1.7
|
const CLIMB_HEADROOM := 1.7
|
||||||
const CLIMB_DURATION := 0.4
|
const CLIMB_DURATION := 0.4
|
||||||
const CLIMB_VERTICAL_PHASE := 0.6
|
const CLIMB_VERTICAL_PHASE := 0.6
|
||||||
|
const PAN_START_YAW := 2.4
|
||||||
|
const PAN_START_PITCH := -0.55
|
||||||
|
const PAN_START_ZOOM := 14.0
|
||||||
|
const PAN_END_PITCH := -0.35
|
||||||
|
const PAN_DURATION := 3.0
|
||||||
|
|
||||||
var _state := MovementState.NORMAL
|
var _state := MovementState.NORMAL
|
||||||
var _is_dialogue_locked := false
|
var _is_dialogue_locked := false
|
||||||
|
var _is_panning := false
|
||||||
var _target_zoom := 9.0
|
var _target_zoom := 9.0
|
||||||
var _gravity: float = ProjectSettings.get_setting("physics/3d/default_gravity")
|
var _gravity: float = ProjectSettings.get_setting("physics/3d/default_gravity")
|
||||||
var _slide_direction := Vector3.ZERO
|
var _slide_direction := Vector3.ZERO
|
||||||
|
|
@ -115,15 +121,38 @@ func _physics_process(delta: float) -> void:
|
||||||
|
|
||||||
## Hält den Spieler während eines Dialogs an: Schwerkraft und Auslaufen
|
## Hält den Spieler während eines Dialogs an: Schwerkraft und Auslaufen
|
||||||
## bleiben aktiv, Eingaben für Bewegung, Sprung, Slide und Look nicht.
|
## bleiben aktiv, Eingaben für Bewegung, Sprung, Slide und Look nicht.
|
||||||
|
## Während eines Kamera-Schwenks steuert der Tween die SpringArm-Länge,
|
||||||
|
## nicht die Zoom-Glättung.
|
||||||
func _process_dialogue_lock(delta: float) -> void:
|
func _process_dialogue_lock(delta: float) -> void:
|
||||||
if not is_on_floor():
|
if not is_on_floor():
|
||||||
velocity.y -= _gravity * delta
|
velocity.y -= _gravity * delta
|
||||||
velocity.x = move_toward(velocity.x, 0.0, STOP_SPEED * delta)
|
velocity.x = move_toward(velocity.x, 0.0, STOP_SPEED * delta)
|
||||||
velocity.z = move_toward(velocity.z, 0.0, STOP_SPEED * delta)
|
velocity.z = move_toward(velocity.z, 0.0, STOP_SPEED * delta)
|
||||||
move_and_slide()
|
move_and_slide()
|
||||||
|
if not _is_panning:
|
||||||
_apply_zoom_smoothing(delta)
|
_apply_zoom_smoothing(delta)
|
||||||
|
|
||||||
|
|
||||||
|
## Spielt einen kurzen cineastischen Kamera-Schwenk für Set-Pieces
|
||||||
|
## (SPEC Abschnitt 2): Die Kamera startet weit draußen und seitlich und
|
||||||
|
## fährt weich in die Standard-Third-Person-Ansicht zurück; die Steuerung
|
||||||
|
## ist für die Dauer gesperrt.
|
||||||
|
func play_camera_pan(duration := PAN_DURATION) -> void:
|
||||||
|
_is_dialogue_locked = true
|
||||||
|
_is_panning = true
|
||||||
|
_camera_pivot.rotation.y = PAN_START_YAW
|
||||||
|
_spring_arm.rotation.x = PAN_START_PITCH
|
||||||
|
_spring_arm.spring_length = PAN_START_ZOOM
|
||||||
|
_target_zoom = 9.0
|
||||||
|
var tween := create_tween().set_parallel(true).set_trans(Tween.TRANS_SINE).set_ease(Tween.EASE_IN_OUT)
|
||||||
|
tween.tween_property(_camera_pivot, "rotation:y", 0.0, duration)
|
||||||
|
tween.tween_property(_spring_arm, "rotation:x", PAN_END_PITCH, duration)
|
||||||
|
tween.tween_property(_spring_arm, "spring_length", _target_zoom, duration)
|
||||||
|
await tween.finished
|
||||||
|
_is_panning = false
|
||||||
|
_is_dialogue_locked = false
|
||||||
|
|
||||||
|
|
||||||
## Sperrt Bewegung und Look bei Dialogbeginn; ein laufender Slide endet
|
## Sperrt Bewegung und Look bei Dialogbeginn; ein laufender Slide endet
|
||||||
## sauber, damit die Kapsel nicht geduckt stehen bleibt.
|
## sauber, damit die Kapsel nicht geduckt stehen bleibt.
|
||||||
func _on_dialogue_started(_dialogue_id: String) -> void:
|
func _on_dialogue_started(_dialogue_id: String) -> void:
|
||||||
|
|
|
||||||
67
scripts/gameplay/viaduct.gd
Normal file
67
scripts/gameplay/viaduct.gd
Normal file
|
|
@ -0,0 +1,67 @@
|
||||||
|
extends Node3D
|
||||||
|
## Ablauf-Steuerung des Viadukt-Set-Pieces (Phase 3, STORY.md Prolog).
|
||||||
|
##
|
||||||
|
## Spielt beim Betreten den cineastischen Kamera-Schwenk (SPEC Abschnitt
|
||||||
|
## 2), verwaltet die Checkpoints der Segmente und die KillZone unter dem
|
||||||
|
## Steg: Bei Permadeath AN führt ein Sturz zum Game Over (zurück ins
|
||||||
|
## Hauptmenü), bei Permadeath AUS zum Respawn am zuletzt erreichten
|
||||||
|
## Segment-Anfang. Der Wren-Moment (Segment 3) startet einmalig beim
|
||||||
|
## Betreten des Trigger-Bereichs als nicht abbrechbarer Dialog
|
||||||
|
## (viaduct_wren.json) — beide Optionen retten Wren, die Wahl landet als
|
||||||
|
## Story-Flag im GameState. Der Übergang am Ende ist ein Platzhalter
|
||||||
|
## Richtung Reiterquadrant; Ankunft und Squad-Logik folgen später.
|
||||||
|
|
||||||
|
const MAIN_MENU_SCENE := "res://scenes/ui/main_menu.tscn"
|
||||||
|
const WREN_DIALOGUE_PATH := "res://data/dialogue/viaduct_wren.json"
|
||||||
|
|
||||||
|
var _checkpoint_position := Vector3.ZERO
|
||||||
|
var _has_wren_triggered := false
|
||||||
|
|
||||||
|
@onready var _wren: Node3D = $Wren
|
||||||
|
|
||||||
|
|
||||||
|
## Merkt den Startpunkt als ersten Checkpoint, verbindet Checkpoints,
|
||||||
|
## KillZone und Wren-Trigger und spielt den Kamera-Schwenk.
|
||||||
|
func _ready() -> void:
|
||||||
|
var player := get_tree().get_first_node_in_group("player")
|
||||||
|
if player != null:
|
||||||
|
_checkpoint_position = player.global_position
|
||||||
|
player.play_camera_pan()
|
||||||
|
for checkpoint in $Checkpoints.get_children():
|
||||||
|
checkpoint.body_entered.connect(_on_checkpoint_entered.bind(checkpoint))
|
||||||
|
$KillZone.body_entered.connect(_on_kill_zone_entered)
|
||||||
|
$WrenTrigger.body_entered.connect(_on_wren_trigger_entered)
|
||||||
|
|
||||||
|
|
||||||
|
## Setzt den Respawn-Punkt auf den erreichten Segment-Anfang.
|
||||||
|
func _on_checkpoint_entered(body: Node3D, checkpoint: Area3D) -> void:
|
||||||
|
if not body.is_in_group("player"):
|
||||||
|
return
|
||||||
|
_checkpoint_position = Vector3(checkpoint.global_position.x, 0.1, checkpoint.global_position.z)
|
||||||
|
|
||||||
|
|
||||||
|
## Sturz in den Abgrund: Game Over bei Permadeath AN, sonst Respawn am
|
||||||
|
## letzten Checkpoint.
|
||||||
|
func _on_kill_zone_entered(body: Node3D) -> void:
|
||||||
|
if not body.is_in_group("player"):
|
||||||
|
return
|
||||||
|
if GameState.is_permadeath_enabled:
|
||||||
|
print("Game Over — das Viadukt fordert seinen Preis.")
|
||||||
|
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
|
||||||
|
get_tree().change_scene_to_file.call_deferred(MAIN_MENU_SCENE)
|
||||||
|
return
|
||||||
|
body.velocity = Vector3.ZERO
|
||||||
|
body.global_position = _checkpoint_position
|
||||||
|
|
||||||
|
|
||||||
|
## Startet den Wren-Moment einmalig als nicht abbrechbaren Dialog.
|
||||||
|
func _on_wren_trigger_entered(body: Node3D) -> void:
|
||||||
|
if not body.is_in_group("player"):
|
||||||
|
return
|
||||||
|
if _has_wren_triggered or DialogueSystem.is_dialogue_active:
|
||||||
|
return
|
||||||
|
_has_wren_triggered = true
|
||||||
|
DialogueSystem.start_dialogue(WREN_DIALOGUE_PATH, {
|
||||||
|
"wren": _wren,
|
||||||
|
DialogueSystem.PLAYER_SPEAKER_ID: body,
|
||||||
|
})
|
||||||
1
scripts/gameplay/viaduct.gd.uid
Normal file
1
scripts/gameplay/viaduct.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
uid://b5770kb2okfgx
|
||||||
77
scripts/ui/character_creation.gd
Normal file
77
scripts/ui/character_creation.gd
Normal file
|
|
@ -0,0 +1,77 @@
|
||||||
|
extends Control
|
||||||
|
## Charakter-Anlage (Phase 3): Eingabe von Tyrveils Anzeigenamen, wird
|
||||||
|
## nach "Neues Spiel" vor dem Viadukt-Prolog aufgerufen.
|
||||||
|
##
|
||||||
|
## Tastatur: Name direkt eintippen, Enter bestätigt. Controller:
|
||||||
|
## Fokus-Navigation (D-Pad/Stick) plus confirm bestätigt den eingegebenen
|
||||||
|
## bzw. Default-Namen, cancel führt zurück ins Hauptmenü. Auf eine
|
||||||
|
## virtuelle Controller-Tastatur wird bewusst verzichtet: Godots
|
||||||
|
## eingebaute Bildschirmtastatur existiert nur auf Mobile/Web, eine
|
||||||
|
## eigene wäre für den Vertical Slice unverhältnismäßig — der
|
||||||
|
## Tastatur-Fallback mit bestätigbarem Default-Namen deckt beide
|
||||||
|
## Eingabewege ab. Der Name landet in GameState.player_name und erscheint
|
||||||
|
## u. a. in der Dialog-Box.
|
||||||
|
|
||||||
|
const VIADUCT_SCENE := "res://scenes/viaduct/viaduct.tscn"
|
||||||
|
const MAIN_MENU_SCENE := "res://scenes/ui/main_menu.tscn"
|
||||||
|
|
||||||
|
var _is_leaving := false
|
||||||
|
|
||||||
|
@onready var _name_edit: LineEdit = $CenterContainer/VBoxContainer/NameEdit
|
||||||
|
@onready var _confirm_button: Button = $CenterContainer/VBoxContainer/Buttons/ConfirmButton
|
||||||
|
@onready var _back_button: Button = $CenterContainer/VBoxContainer/Buttons/BackButton
|
||||||
|
|
||||||
|
|
||||||
|
## Gibt die Maus frei, füllt den Default-Namen ein und setzt den Fokus in
|
||||||
|
## das Eingabefeld.
|
||||||
|
func _ready() -> void:
|
||||||
|
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
|
||||||
|
_name_edit.text = GameState.DEFAULT_PLAYER_NAME
|
||||||
|
_name_edit.caret_column = _name_edit.text.length()
|
||||||
|
_name_edit.text_submitted.connect(_on_name_submitted)
|
||||||
|
_confirm_button.pressed.connect(_on_confirm_pressed)
|
||||||
|
_back_button.pressed.connect(_on_back_pressed)
|
||||||
|
_name_edit.grab_focus.call_deferred()
|
||||||
|
|
||||||
|
|
||||||
|
## Controller-Bestätigung (Ⓐ/✕) übernimmt den Namen bzw. aktiviert den
|
||||||
|
## fokussierten Button; cancel führt zurück ins Hauptmenü. Enter läuft
|
||||||
|
## über LineEdit (text_submitted) bzw. ui_accept der Buttons.
|
||||||
|
func _unhandled_input(event: InputEvent) -> void:
|
||||||
|
if _is_leaving:
|
||||||
|
return
|
||||||
|
if event.is_action_pressed("cancel"):
|
||||||
|
_on_back_pressed()
|
||||||
|
return
|
||||||
|
if not event.is_action_pressed("confirm"):
|
||||||
|
return
|
||||||
|
if event.is_action("ui_accept"):
|
||||||
|
return
|
||||||
|
var focused := get_viewport().gui_get_focus_owner()
|
||||||
|
if focused == _back_button:
|
||||||
|
_on_back_pressed()
|
||||||
|
else:
|
||||||
|
_on_confirm_pressed()
|
||||||
|
|
||||||
|
|
||||||
|
## Enter im Eingabefeld bestätigt den Namen.
|
||||||
|
func _on_name_submitted(_text: String) -> void:
|
||||||
|
_on_confirm_pressed()
|
||||||
|
|
||||||
|
|
||||||
|
## Übernimmt den Namen (leer -> Default) und startet das Viadukt.
|
||||||
|
func _on_confirm_pressed() -> void:
|
||||||
|
if _is_leaving:
|
||||||
|
return
|
||||||
|
_is_leaving = true
|
||||||
|
var chosen := _name_edit.text.strip_edges()
|
||||||
|
GameState.player_name = chosen if not chosen.is_empty() else GameState.DEFAULT_PLAYER_NAME
|
||||||
|
get_tree().change_scene_to_file(VIADUCT_SCENE)
|
||||||
|
|
||||||
|
|
||||||
|
## Zurück ins Hauptmenü, ohne den GameState anzufassen.
|
||||||
|
func _on_back_pressed() -> void:
|
||||||
|
if _is_leaving:
|
||||||
|
return
|
||||||
|
_is_leaving = true
|
||||||
|
get_tree().change_scene_to_file(MAIN_MENU_SCENE)
|
||||||
1
scripts/ui/character_creation.gd.uid
Normal file
1
scripts/ui/character_creation.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
uid://bxcrf1rspx0he
|
||||||
|
|
@ -60,6 +60,8 @@ func _unhandled_input(event: InputEvent) -> void:
|
||||||
if not has_open_options():
|
if not has_open_options():
|
||||||
return
|
return
|
||||||
if event.is_action_pressed("cancel") or event.is_action_pressed("dialogue_abort"):
|
if event.is_action_pressed("cancel") or event.is_action_pressed("dialogue_abort"):
|
||||||
|
if not DialogueSystem.is_abort_allowed:
|
||||||
|
return
|
||||||
_clear_options()
|
_clear_options()
|
||||||
option_chosen.emit(ABORT_INDEX)
|
option_chosen.emit(ABORT_INDEX)
|
||||||
return
|
return
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,8 @@ extends Control
|
||||||
## auf den Beenden-Button. Die Aktivierung läuft explizit über die
|
## auf den Beenden-Button. Die Aktivierung läuft explizit über die
|
||||||
## Input-Map-Action confirm und hängt nicht an Godots internem ui_accept.
|
## Input-Map-Action confirm und hängt nicht an Godots internem ui_accept.
|
||||||
|
|
||||||
const GAME_SCENE := "res://scenes/hub/rider_quadrant.tscn"
|
const CREATION_SCENE := "res://scenes/ui/character_creation.tscn"
|
||||||
|
const CONTINUE_SCENE := "res://scenes/hub/rider_quadrant.tscn"
|
||||||
|
|
||||||
@onready var _start_button: Button = $CenterContainer/VBoxContainer/StartButton
|
@onready var _start_button: Button = $CenterContainer/VBoxContainer/StartButton
|
||||||
@onready var _continue_button: Button = $CenterContainer/VBoxContainer/ContinueButton
|
@onready var _continue_button: Button = $CenterContainer/VBoxContainer/ContinueButton
|
||||||
|
|
@ -56,17 +57,17 @@ func _handle_confirm(event: InputEvent) -> void:
|
||||||
|
|
||||||
|
|
||||||
## Startet ein neues Spiel mit frisch zurückgesetztem GameState und
|
## Startet ein neues Spiel mit frisch zurückgesetztem GameState und
|
||||||
## Tageszyklus.
|
## Tageszyklus: erst Charakter-Anlage, von dort geht es aufs Viadukt.
|
||||||
func _on_start_pressed() -> void:
|
func _on_start_pressed() -> void:
|
||||||
GameState.reset()
|
GameState.reset()
|
||||||
TimeSystem.reset()
|
TimeSystem.reset()
|
||||||
get_tree().change_scene_to_file(GAME_SCENE)
|
get_tree().change_scene_to_file(CREATION_SCENE)
|
||||||
|
|
||||||
|
|
||||||
## Lädt den Spielstand und wechselt bei Erfolg in die Testszene.
|
## Lädt den Spielstand und wechselt bei Erfolg in den Reiterquadranten.
|
||||||
func _on_continue_pressed() -> void:
|
func _on_continue_pressed() -> void:
|
||||||
if SaveSystem.load_game():
|
if SaveSystem.load_game():
|
||||||
get_tree().change_scene_to_file(GAME_SCENE)
|
get_tree().change_scene_to_file(CONTINUE_SCENE)
|
||||||
|
|
||||||
|
|
||||||
## Beendet das Spiel.
|
## Beendet das Spiel.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue