Compare commits
15
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0a8cf20de9 | ||
|
|
2850c26657 | ||
|
|
42e49b5cd8 | ||
|
|
30580b5290 | ||
|
|
a77dc47756 | ||
|
|
d39d719c7d | ||
|
|
bf1ac4406c | ||
|
|
2670392e2d | ||
|
|
f4ff1308b8 | ||
|
|
6dc4d53ba0 | ||
|
|
ba6edd455a | ||
|
|
a66c39e9f8 | ||
|
|
6f809c3684 | ||
|
|
2d27e4254e | ||
|
|
b3287ccf6f |
@@ -15,6 +15,7 @@
|
||||
## Controls
|
||||
- Move: WASD
|
||||
- Jump: Space
|
||||
- Sprint: Shift
|
||||
- Interact (enter/exit car): E
|
||||
- Flashlight: F
|
||||
- Phone: Tab
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 519 KiB |
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bstshxshmlfiq"
|
||||
path="res://.godot/imported/card.webp-99b23fadea1c063dd14bdfc3719125c0.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/images/card.webp"
|
||||
dest_files=["res://.godot/imported/card.webp-99b23fadea1c063dd14bdfc3719125c0.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
|
||||
File diff suppressed because it is too large
Load Diff
@@ -26,6 +26,8 @@ MenuSfx="*res://scenes/UI/menu_sfx.tscn"
|
||||
AuthState="*res://scenes/UI/auth_state.gd"
|
||||
CharacterService="*res://scenes/UI/character_service.gd"
|
||||
SelectedCharacter="*res://scenes/UI/selected_character.gd"
|
||||
DialogSystem="*res://scenes/UI/dialog_system.gd"
|
||||
QuestManager="*res://scenes/Quests/quest_manager.gd"
|
||||
|
||||
[dotnet]
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
extends Node2D
|
||||
|
||||
@export var card_name: String
|
||||
@export var card_text: String
|
||||
@export var card_cost: int
|
||||
|
||||
@onready var card_name_node := $CardName
|
||||
@onready var card_text_node := $CardText
|
||||
@onready var card_cost_node := $CardCost
|
||||
|
||||
func _ready():
|
||||
card_name_node.text = card_name
|
||||
card_text_node.text = card_text
|
||||
card_cost_node.text = str(card_cost)
|
||||
@@ -0,0 +1 @@
|
||||
uid://chk06witxlje
|
||||
@@ -0,0 +1,39 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://cqumma8ibtbsx"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://chk06witxlje" path="res://scenes/CardGame/card.gd" id="1_qu2n3"]
|
||||
[ext_resource type="Texture2D" uid="uid://bstshxshmlfiq" path="res://assets/images/card.webp" id="2_xgndj"]
|
||||
|
||||
[node name="Card" type="Node2D"]
|
||||
script = ExtResource("1_qu2n3")
|
||||
|
||||
[node name="CardBackbround" type="Sprite2D" parent="."]
|
||||
scale = Vector2(0.25, 0.25)
|
||||
texture = ExtResource("2_xgndj")
|
||||
|
||||
[node name="CardName" type="Label" parent="."]
|
||||
offset_left = -44.0
|
||||
offset_top = 22.0
|
||||
offset_right = 47.0
|
||||
offset_bottom = 45.0
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="CardText" type="RichTextLabel" parent="."]
|
||||
offset_left = -75.0
|
||||
offset_top = 64.0
|
||||
offset_right = 75.0
|
||||
offset_bottom = 115.0
|
||||
text = "Test Text"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="CardCost" type="Label" parent="."]
|
||||
offset_left = -80.0
|
||||
offset_top = -125.0
|
||||
offset_right = -45.0
|
||||
offset_bottom = -89.0
|
||||
text = "2"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="CardImage" type="Sprite2D" parent="."]
|
||||
@@ -0,0 +1,22 @@
|
||||
extends Node2D
|
||||
|
||||
var card_scene = preload("uid://cqumma8ibtbsx")
|
||||
|
||||
func _ready():
|
||||
var size = get_viewport().get_visible_rect().size
|
||||
|
||||
var card1 = card_scene.instantiate()
|
||||
card1.card_text = "Test Card 1"
|
||||
card1.card_name = "Card 1"
|
||||
card1.card_cost = 1
|
||||
card1.position = Vector2(size.x / 2 - 100, size.y / 2)
|
||||
add_child(card1)
|
||||
|
||||
var card2 = card_scene.instantiate()
|
||||
card2.card_text = "Test Card 2"
|
||||
card2.card_name = "Card 2"
|
||||
card2.card_cost = 2
|
||||
card2.position = Vector2(size.x / 2 + 100, size.y / 2)
|
||||
add_child(card2)
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
uid://btx5q72aali0g
|
||||
@@ -0,0 +1,6 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://q4abhlwqdvay"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://btx5q72aali0g" path="res://scenes/CardGame/cards.gd" id="1_l08q2"]
|
||||
|
||||
[node name="Node2D" type="Node2D"]
|
||||
script = ExtResource("1_l08q2")
|
||||
@@ -1,6 +1,7 @@
|
||||
[gd_scene load_steps=14 format=3]
|
||||
|
||||
[ext_resource type="Script" path="res://scenes/Characters/repo_bot.gd" id="1_repo_bot"]
|
||||
[gd_scene load_steps=14 format=3]
|
||||
|
||||
[ext_resource type="Script" path="res://scenes/Characters/repo_bot.gd" id="1_repo_bot"]
|
||||
[ext_resource type="Script" path="res://scenes/Interaction/dialog_trigger_area.gd" id="2_dialog"]
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_body"]
|
||||
albedo_color = Color(0.78, 0.8, 0.82, 1)
|
||||
@@ -50,9 +51,12 @@ material = SubResource("StandardMaterial3D_body")
|
||||
size = Vector3(0.26, 0.3, 0.12)
|
||||
material = SubResource("StandardMaterial3D_accent")
|
||||
|
||||
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_body"]
|
||||
radius = 0.3
|
||||
height = 1.1
|
||||
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_body"]
|
||||
radius = 0.3
|
||||
height = 1.1
|
||||
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_interact"]
|
||||
radius = 1.7
|
||||
|
||||
[node name="RepoBot" type="Node3D"]
|
||||
script = ExtResource("1_repo_bot")
|
||||
@@ -111,6 +115,17 @@ mesh = SubResource("CylinderMesh_limb")
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.12, 0.15, 0)
|
||||
mesh = SubResource("CylinderMesh_limb")
|
||||
|
||||
[node name="Backpack" type="MeshInstance3D" parent="Body"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.6, 0.22)
|
||||
mesh = SubResource("BoxMesh_pack")
|
||||
[node name="Backpack" type="MeshInstance3D" parent="Body"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.6, 0.22)
|
||||
mesh = SubResource("BoxMesh_pack")
|
||||
|
||||
[node name="InteractArea" type="Area3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.8, 0)
|
||||
script = ExtResource("2_dialog")
|
||||
collision_layer = 2
|
||||
collision_mask = 1
|
||||
prompt_text = "Press E to talk"
|
||||
dialog_text = "Repo Bot: Welcome to Promiscuity.\n\nPress E again to close this dialog."
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="InteractArea"]
|
||||
shape = SubResource("SphereShape3D_interact")
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
extends Area3D
|
||||
|
||||
@export var target_group: StringName = &"player"
|
||||
@export var prompt_text := "Press E to talk"
|
||||
@export_multiline var dialog_text := ""
|
||||
@export var auto_popup := false
|
||||
@export_enum("Every Entry", "Once") var auto_popup_mode := 0
|
||||
@export var auto_popup_close_on_exit := false
|
||||
|
||||
var _has_triggered := false
|
||||
|
||||
func _ready() -> void:
|
||||
collision_layer = 2
|
||||
collision_mask = 1
|
||||
body_entered.connect(_on_body_entered)
|
||||
body_exited.connect(_on_body_exited)
|
||||
|
||||
|
||||
func _exit_tree() -> void:
|
||||
if not auto_popup and DialogSystem:
|
||||
DialogSystem.unregister_interactable(self)
|
||||
|
||||
|
||||
func _on_body_entered(body: Node) -> void:
|
||||
if not (target_group == StringName() or body.is_in_group(target_group)):
|
||||
return
|
||||
if auto_popup:
|
||||
if DialogSystem and DialogSystem.has_method("is_dialog_open") and DialogSystem.is_dialog_open():
|
||||
if not (DialogSystem.has_method("is_dialog_open_from") and DialogSystem.is_dialog_open_from(self)):
|
||||
return
|
||||
if auto_popup_mode == 1 and _has_triggered:
|
||||
return
|
||||
_has_triggered = true
|
||||
if DialogSystem and auto_popup_close_on_exit and DialogSystem.has_method("show_text_from"):
|
||||
DialogSystem.show_text_from(self, dialog_text)
|
||||
return
|
||||
if DialogSystem and DialogSystem.has_method("show_text"):
|
||||
DialogSystem.show_text(dialog_text)
|
||||
return
|
||||
if DialogSystem:
|
||||
DialogSystem.register_interactable(self)
|
||||
|
||||
|
||||
func _on_body_exited(body: Node) -> void:
|
||||
if not (target_group == StringName() or body.is_in_group(target_group)):
|
||||
return
|
||||
if auto_popup:
|
||||
if auto_popup_close_on_exit and DialogSystem:
|
||||
if DialogSystem.has_method("close_if_source"):
|
||||
DialogSystem.close_if_source(self)
|
||||
elif DialogSystem.has_method("close_if_text"):
|
||||
DialogSystem.close_if_text(dialog_text)
|
||||
return
|
||||
return
|
||||
if target_group == StringName() or body.is_in_group(target_group):
|
||||
DialogSystem.unregister_interactable(self)
|
||||
|
||||
|
||||
func get_dialog_prompt() -> String:
|
||||
return prompt_text
|
||||
|
||||
|
||||
func get_dialog_text() -> String:
|
||||
return dialog_text
|
||||
@@ -0,0 +1 @@
|
||||
uid://bk53njt7i3kmv
|
||||
@@ -0,0 +1,39 @@
|
||||
extends Area3D
|
||||
|
||||
@export_file("*.tscn") var target_scene_path := "res://scenes/Levels/transportation_level.tscn"
|
||||
@export var target_group: StringName = &"player"
|
||||
@export var one_shot := true
|
||||
|
||||
var _is_transitioning := false
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
body_entered.connect(_on_body_entered)
|
||||
|
||||
|
||||
func _on_body_entered(body: Node) -> void:
|
||||
if _is_transitioning:
|
||||
return
|
||||
if target_group != StringName() and not body.is_in_group(target_group):
|
||||
return
|
||||
if target_scene_path.strip_edges() == "":
|
||||
push_warning("Teleporter target scene is empty.")
|
||||
return
|
||||
if not ResourceLoader.exists(target_scene_path):
|
||||
push_warning("Teleporter target scene does not exist: %s" % target_scene_path)
|
||||
return
|
||||
|
||||
_is_transitioning = true
|
||||
if one_shot:
|
||||
set_deferred("monitoring", false)
|
||||
call_deferred("_deferred_change_scene")
|
||||
|
||||
|
||||
func _deferred_change_scene() -> void:
|
||||
var err := get_tree().change_scene_to_file(target_scene_path)
|
||||
if err == OK:
|
||||
return
|
||||
push_warning("Failed to change scene to '%s' (%s)." % [target_scene_path, err])
|
||||
_is_transitioning = false
|
||||
if one_shot:
|
||||
set_deferred("monitoring", true)
|
||||
@@ -0,0 +1 @@
|
||||
uid://dyvldjfan2beq
|
||||
@@ -0,0 +1,32 @@
|
||||
[gd_scene load_steps=4 format=3]
|
||||
|
||||
[ext_resource type="Script" path="res://scenes/Interaction/scene_teleporter.gd" id="1_tele"]
|
||||
|
||||
[sub_resource type="CylinderShape3D" id="CylinderShape3D_tele"]
|
||||
height = 3.0
|
||||
radius = 1.5
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_tele"]
|
||||
transparency = 1
|
||||
shading_mode = 0
|
||||
albedo_color = Color(0.15, 0.95, 1, 0.25)
|
||||
emission_enabled = true
|
||||
emission = Color(0.1, 0.9, 1, 1)
|
||||
emission_energy_multiplier = 1.5
|
||||
|
||||
[sub_resource type="CylinderMesh" id="CylinderMesh_tele"]
|
||||
material = SubResource("StandardMaterial3D_tele")
|
||||
top_radius = 1.6
|
||||
bottom_radius = 1.6
|
||||
height = 3.0
|
||||
|
||||
[node name="SceneTeleporter" type="Area3D"]
|
||||
collision_layer = 2
|
||||
collision_mask = 1
|
||||
script = ExtResource("1_tele")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||
shape = SubResource("CylinderShape3D_tele")
|
||||
|
||||
[node name="Visual" type="MeshInstance3D" parent="."]
|
||||
mesh = SubResource("CylinderMesh_tele")
|
||||
@@ -2,11 +2,49 @@ extends Node3D
|
||||
|
||||
@export var day_length := 120.0 # seconds for full rotation
|
||||
@export var start_light_angle := -90.0
|
||||
@export var show_spawn_dialog := true
|
||||
@export_multiline var spawn_dialog_text := "Welcome to Promiscuity.\n\nPress E to close this message."
|
||||
@export var spawn_dialog_auto_close_seconds := 4.0
|
||||
var end_light_angle = start_light_angle + 360.0
|
||||
var start_radians = start_light_angle * PI / 180
|
||||
var time := 0.0
|
||||
|
||||
@onready var sun := $DirectionalLight3D
|
||||
@onready var _player: Node = $Player
|
||||
@onready var _quest_text: RichTextLabel = $PhoneUI/Control/PhoneFrame/QuestText
|
||||
|
||||
const FIRST_QUEST_ID := "first_drive"
|
||||
const QUEST_PROMPT_META_PREFIX := "quest_intro_prompt_shown_"
|
||||
const SPAWN_DIALOG_META_KEY := "level_spawn_dialog_shown"
|
||||
const FIRST_QUEST := {
|
||||
"id": FIRST_QUEST_ID,
|
||||
"title": "RepoBot's First Task",
|
||||
"description": "Get familiar with movement and vehicles.",
|
||||
"steps": [
|
||||
{
|
||||
"id": "enter_vehicle",
|
||||
"text": "Get in the car (E).",
|
||||
"complete_event": "entered_vehicle",
|
||||
},
|
||||
{
|
||||
"id": "reach_checkpoint",
|
||||
"text": "Drive the car into the checkpoint marker.",
|
||||
"complete_event": "reach_checkpoint",
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
func _ready() -> void:
|
||||
_setup_quests()
|
||||
if _should_show_spawn_dialog() and DialogSystem and DialogSystem.has_method("show_text"):
|
||||
await get_tree().process_frame
|
||||
DialogSystem.show_text(spawn_dialog_text)
|
||||
_mark_spawn_dialog_shown()
|
||||
if spawn_dialog_auto_close_seconds > 0.0:
|
||||
await get_tree().create_timer(spawn_dialog_auto_close_seconds).timeout
|
||||
if DialogSystem and DialogSystem.has_method("close_if_text"):
|
||||
DialogSystem.close_if_text(spawn_dialog_text)
|
||||
_show_quest_intro_dialog()
|
||||
|
||||
func _process(delta):
|
||||
time = fmod((time + delta), day_length)
|
||||
@@ -20,3 +58,75 @@ func _process(delta):
|
||||
var curSin = -sin((t * TAU) + start_radians)
|
||||
var energy = clamp((curSin * 1.0) + 0.2, 0.0, 1.2)
|
||||
sun.light_energy = energy
|
||||
|
||||
|
||||
func _setup_quests() -> void:
|
||||
if QuestManager == null:
|
||||
return
|
||||
if not QuestManager.has_quest(FIRST_QUEST_ID):
|
||||
QuestManager.register_quest(FIRST_QUEST)
|
||||
if not QuestManager.is_active_quest(FIRST_QUEST_ID) and not QuestManager.is_quest_completed(FIRST_QUEST_ID):
|
||||
QuestManager.start_quest(FIRST_QUEST_ID)
|
||||
if not QuestManager.is_connected("quest_state_changed", Callable(self, "_refresh_quest_ui")):
|
||||
QuestManager.quest_state_changed.connect(_refresh_quest_ui)
|
||||
if _player and _player.has_signal("vehicle_entered"):
|
||||
if not _player.is_connected("vehicle_entered", Callable(self, "_on_player_vehicle_entered")):
|
||||
_player.vehicle_entered.connect(_on_player_vehicle_entered)
|
||||
_refresh_quest_ui()
|
||||
|
||||
|
||||
func _on_player_vehicle_entered(_vehicle: Node) -> void:
|
||||
if QuestManager:
|
||||
QuestManager.emit_event(&"entered_vehicle")
|
||||
|
||||
|
||||
func _refresh_quest_ui() -> void:
|
||||
if _quest_text == null or QuestManager == null:
|
||||
return
|
||||
var state: Dictionary = QuestManager.get_active_quest_state()
|
||||
if not bool(state.get("active", false)):
|
||||
_quest_text.text = "No active quest."
|
||||
return
|
||||
var title := String(state.get("title", "Quest"))
|
||||
if bool(state.get("completed", false)):
|
||||
_quest_text.text = "[b]%s[/b]\nComplete." % title
|
||||
return
|
||||
var step_index: int = int(state.get("current_step_index", 0))
|
||||
var total_steps: int = int(state.get("total_steps", 0))
|
||||
var step_text := String(state.get("current_step_text", ""))
|
||||
_quest_text.text = "[b]%s[/b]\nStep %d/%d\n%s" % [title, step_index + 1, total_steps, step_text]
|
||||
|
||||
|
||||
func _show_quest_intro_dialog() -> void:
|
||||
if QuestManager == null:
|
||||
return
|
||||
var state: Dictionary = QuestManager.get_active_quest_state()
|
||||
if not bool(state.get("active", false)) or bool(state.get("completed", false)):
|
||||
return
|
||||
var quest_id := String(state.get("quest_id", "")).strip_edges()
|
||||
var step_id := String(state.get("current_step_id", "")).strip_edges()
|
||||
var step_text := String(state.get("current_step_text", ""))
|
||||
if quest_id.is_empty() or step_id.is_empty() or step_text.is_empty():
|
||||
return
|
||||
var prompt_key := "%s%s_%s" % [QUEST_PROMPT_META_PREFIX, quest_id, step_id]
|
||||
if QuestManager.has_meta(prompt_key) and bool(QuestManager.get_meta(prompt_key)):
|
||||
return
|
||||
if DialogSystem and DialogSystem.has_method("show_text"):
|
||||
DialogSystem.show_text("RepoBot: New task assigned.\n\n%s" % step_text)
|
||||
QuestManager.set_meta(prompt_key, true)
|
||||
|
||||
|
||||
func _should_show_spawn_dialog() -> bool:
|
||||
if not show_spawn_dialog:
|
||||
return false
|
||||
if QuestManager == null:
|
||||
return true
|
||||
if not QuestManager.has_meta(SPAWN_DIALOG_META_KEY):
|
||||
return true
|
||||
return not bool(QuestManager.get_meta(SPAWN_DIALOG_META_KEY))
|
||||
|
||||
|
||||
func _mark_spawn_dialog_shown() -> void:
|
||||
if QuestManager == null:
|
||||
return
|
||||
QuestManager.set_meta(SPAWN_DIALOG_META_KEY, true)
|
||||
|
||||
+344
-24
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=18 format=3 uid="uid://dchj6g2i8ebph"]
|
||||
[gd_scene load_steps=82 format=3 uid="uid://dchj6g2i8ebph"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://brgmxhhhtakja" path="res://scenes/Levels/level.gd" id="1_a4mo8"]
|
||||
[ext_resource type="PackedScene" uid="uid://bb6hj6l23043x" path="res://assets/models/human.blend" id="1_eg4yq"]
|
||||
@@ -6,8 +6,11 @@
|
||||
[ext_resource type="PackedScene" uid="uid://c5of6aaxop1hl" path="res://scenes/block.tscn" id="2_tc7dm"]
|
||||
[ext_resource type="Script" uid="uid://b7fopt7sx74g8" path="res://scenes/Levels/menu.gd" id="3_tc7dm"]
|
||||
[ext_resource type="PackedScene" path="res://scenes/Characters/repo_bot.tscn" id="4_repo"]
|
||||
[ext_resource type="PackedScene" uid="uid://bnqaqbgynoyys" path="res://assets/models/TestCharAnimated.glb" id="5_fi66n"]
|
||||
[ext_resource type="PackedScene" path="res://scenes/Vehicles/car.tscn" id="5_car"]
|
||||
[ext_resource type="PackedScene" uid="uid://bnqaqbgynoyys" path="res://assets/models/TestCharAnimated.glb" id="5_fi66n"]
|
||||
[ext_resource type="Script" uid="uid://bk53njt7i3kmv" path="res://scenes/Interaction/dialog_trigger_area.gd" id="6_dialog"]
|
||||
[ext_resource type="Script" uid="uid://cshtdpjp4xy2f" path="res://scenes/Quests/quest_trigger_area.gd" id="7_qtrigger"]
|
||||
[ext_resource type="PackedScene" path="res://scenes/Interaction/scene_teleporter.tscn" id="8_teleporter"]
|
||||
|
||||
[sub_resource type="PhysicsMaterial" id="PhysicsMaterial_2q6dc"]
|
||||
bounce = 0.5
|
||||
@@ -21,6 +24,252 @@ bounce = 0.5
|
||||
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_mx8sn"]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_he7fi"]
|
||||
animation = &"Idle"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_42npc"]
|
||||
animation = &"Idle"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_neck2"]
|
||||
animation = &"Idle"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_bg4jh"]
|
||||
animation = &"Idle"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_43ksg"]
|
||||
animation = &"Jump"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_5qdlo"]
|
||||
animation = &"Jump"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_hwpvo"]
|
||||
animation = &"Jump"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_loupo"]
|
||||
animation = &"Jump"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_1meta"]
|
||||
animation = &"LStrafe"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_i35yb"]
|
||||
animation = &"LStrafeWalk"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_18iqp"]
|
||||
animation = &"LTurn"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_px5jg"]
|
||||
animation = &"LTurn90"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_f2oql"]
|
||||
animation = &"RStrafe"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_8hdhy"]
|
||||
animation = &"RStrafe"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_8ydj0"]
|
||||
animation = &"RStrafeWalk"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_ol8dr"]
|
||||
animation = &"RTurn"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_eorea"]
|
||||
animation = &"RTurn90"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_mwo3k"]
|
||||
animation = &"Run"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_2jvac"]
|
||||
animation = &"Run"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_m443h"]
|
||||
animation = &"Run"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_j43p6"]
|
||||
animation = &"Run"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_7qd4n"]
|
||||
animation = &"Walk"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_5wdrc"]
|
||||
animation = &"Walk"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_k13o0"]
|
||||
animation = &"Walk"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_ccri0"]
|
||||
animation = &"Walk"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_aqwus"]
|
||||
animation = &"Walk"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_pqisa"]
|
||||
animation = &"Walk"
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_5qdlo"]
|
||||
advance_mode = 2
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_hwpvo"]
|
||||
advance_mode = 2
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_2jvac"]
|
||||
advance_mode = 2
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_m443h"]
|
||||
advance_mode = 2
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_ccri0"]
|
||||
advance_mode = 2
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_aqwus"]
|
||||
advance_mode = 2
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_tknc3"]
|
||||
advance_mode = 2
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_ygago"]
|
||||
advance_mode = 2
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_koxac"]
|
||||
advance_mode = 2
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_0pp6t"]
|
||||
advance_mode = 2
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_3xa5y"]
|
||||
advance_mode = 2
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_8m234"]
|
||||
advance_mode = 2
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_jnqa2"]
|
||||
advance_mode = 2
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_vwq6c"]
|
||||
advance_mode = 2
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_e2sp2"]
|
||||
advance_mode = 2
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_r45s2"]
|
||||
advance_mode = 2
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_p7els"]
|
||||
advance_mode = 2
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_elh2a"]
|
||||
advance_mode = 2
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_bwsrl"]
|
||||
advance_mode = 2
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_dykvg"]
|
||||
advance_mode = 2
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_8m8y3"]
|
||||
advance_mode = 2
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_64kfc"]
|
||||
advance_mode = 2
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_xdbgi"]
|
||||
advance_mode = 2
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_60p50"]
|
||||
advance_mode = 2
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_jmoxn"]
|
||||
advance_mode = 2
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_cvjxp"]
|
||||
advance_mode = 2
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachine" id="AnimationNodeStateMachine_bwsrl"]
|
||||
states/End/position = Vector2(664, 130)
|
||||
states/Idle/node = SubResource("AnimationNodeAnimation_bg4jh")
|
||||
states/Idle/position = Vector2(318, 57)
|
||||
"states/Idle 2/node" = SubResource("AnimationNodeAnimation_he7fi")
|
||||
"states/Idle 2/position" = Vector2(397, 105)
|
||||
"states/Idle 3/node" = SubResource("AnimationNodeAnimation_42npc")
|
||||
"states/Idle 3/position" = Vector2(312, 279)
|
||||
"states/Idle 4/node" = SubResource("AnimationNodeAnimation_neck2")
|
||||
"states/Idle 4/position" = Vector2(437, 356)
|
||||
states/Jump/node = SubResource("AnimationNodeAnimation_loupo")
|
||||
states/Jump/position = Vector2(282, 356)
|
||||
"states/Jump 2/node" = SubResource("AnimationNodeAnimation_43ksg")
|
||||
"states/Jump 2/position" = Vector2(421, 287)
|
||||
"states/Jump 3/node" = SubResource("AnimationNodeAnimation_5qdlo")
|
||||
"states/Jump 3/position" = Vector2(397, 410)
|
||||
"states/Jump 4/node" = SubResource("AnimationNodeAnimation_hwpvo")
|
||||
"states/Jump 4/position" = Vector2(397, 469)
|
||||
states/LStrafe/node = SubResource("AnimationNodeAnimation_1meta")
|
||||
states/LStrafe/position = Vector2(1401, 100)
|
||||
states/LStrafeWalk/node = SubResource("AnimationNodeAnimation_i35yb")
|
||||
states/LStrafeWalk/position = Vector2(1346, 175)
|
||||
states/LTurn/node = SubResource("AnimationNodeAnimation_18iqp")
|
||||
states/LTurn/position = Vector2(1516, 83)
|
||||
states/LTurn90/node = SubResource("AnimationNodeAnimation_px5jg")
|
||||
states/LTurn90/position = Vector2(1550, 208)
|
||||
states/RStrafe/node = SubResource("AnimationNodeAnimation_8hdhy")
|
||||
states/RStrafe/position = Vector2(856, 161)
|
||||
"states/RStrafe 2/node" = SubResource("AnimationNodeAnimation_f2oql")
|
||||
"states/RStrafe 2/position" = Vector2(956, 208)
|
||||
states/RStrafeWalk/node = SubResource("AnimationNodeAnimation_8ydj0")
|
||||
states/RStrafeWalk/position = Vector2(1181, 155)
|
||||
states/RTurn/node = SubResource("AnimationNodeAnimation_ol8dr")
|
||||
states/RTurn/position = Vector2(1065, 162)
|
||||
states/RTurn90/node = SubResource("AnimationNodeAnimation_eorea")
|
||||
states/RTurn90/position = Vector2(1218, 92)
|
||||
states/Run/node = SubResource("AnimationNodeAnimation_j43p6")
|
||||
states/Run/position = Vector2(293, 225)
|
||||
"states/Run 2/node" = SubResource("AnimationNodeAnimation_mwo3k")
|
||||
"states/Run 2/position" = Vector2(421, 161)
|
||||
"states/Run 3/node" = SubResource("AnimationNodeAnimation_2jvac")
|
||||
"states/Run 3/position" = Vector2(287, 469)
|
||||
"states/Run 4/node" = SubResource("AnimationNodeAnimation_m443h")
|
||||
"states/Run 4/position" = Vector2(538, 469)
|
||||
states/Start/position = Vector2(82, 162)
|
||||
states/Walk/node = SubResource("AnimationNodeAnimation_pqisa")
|
||||
states/Walk/position = Vector2(414, 57)
|
||||
"states/Walk 2/node" = SubResource("AnimationNodeAnimation_7qd4n")
|
||||
"states/Walk 2/position" = Vector2(303, 111)
|
||||
"states/Walk 3/node" = SubResource("AnimationNodeAnimation_5wdrc")
|
||||
"states/Walk 3/position" = Vector2(312, 175)
|
||||
"states/Walk 4/node" = SubResource("AnimationNodeAnimation_k13o0")
|
||||
"states/Walk 4/position" = Vector2(421, 219)
|
||||
"states/Walk 5/node" = SubResource("AnimationNodeAnimation_ccri0")
|
||||
"states/Walk 5/position" = Vector2(303, 410)
|
||||
"states/Walk 6/node" = SubResource("AnimationNodeAnimation_aqwus")
|
||||
"states/Walk 6/position" = Vector2(516, 402)
|
||||
transitions = ["Idle", "Walk", SubResource("AnimationNodeStateMachineTransition_5qdlo"), "Walk 2", "Idle 2", SubResource("AnimationNodeStateMachineTransition_hwpvo"), "Walk 3", "Run 2", SubResource("AnimationNodeStateMachineTransition_2jvac"), "Run", "Walk 4", SubResource("AnimationNodeStateMachineTransition_m443h"), "Start", "Idle", SubResource("AnimationNodeStateMachineTransition_ccri0"), "Start", "Walk 2", SubResource("AnimationNodeStateMachineTransition_aqwus"), "Start", "Walk 3", SubResource("AnimationNodeStateMachineTransition_tknc3"), "Start", "Run", SubResource("AnimationNodeStateMachineTransition_ygago"), "Idle 3", "Jump 2", SubResource("AnimationNodeStateMachineTransition_koxac"), "Jump", "Idle 4", SubResource("AnimationNodeStateMachineTransition_0pp6t"), "Start", "Jump", SubResource("AnimationNodeStateMachineTransition_3xa5y"), "Start", "Idle 3", SubResource("AnimationNodeStateMachineTransition_8m234"), "Walk", "End", SubResource("AnimationNodeStateMachineTransition_jnqa2"), "Idle 2", "End", SubResource("AnimationNodeStateMachineTransition_vwq6c"), "Run 2", "End", SubResource("AnimationNodeStateMachineTransition_e2sp2"), "Walk 4", "End", SubResource("AnimationNodeStateMachineTransition_r45s2"), "Jump 2", "End", SubResource("AnimationNodeStateMachineTransition_p7els"), "Idle 4", "End", SubResource("AnimationNodeStateMachineTransition_elh2a"), "Start", "Walk 5", SubResource("AnimationNodeStateMachineTransition_bwsrl"), "Walk 5", "Jump 3", SubResource("AnimationNodeStateMachineTransition_dykvg"), "Jump 3", "Walk 6", SubResource("AnimationNodeStateMachineTransition_8m8y3"), "Walk 6", "End", SubResource("AnimationNodeStateMachineTransition_64kfc"), "Start", "Run 3", SubResource("AnimationNodeStateMachineTransition_xdbgi"), "Run 3", "Jump 4", SubResource("AnimationNodeStateMachineTransition_60p50"), "Jump 4", "Run 4", SubResource("AnimationNodeStateMachineTransition_jmoxn"), "Run 4", "End", SubResource("AnimationNodeStateMachineTransition_cvjxp")]
|
||||
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_dialog_zone"]
|
||||
radius = 2.5
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_dialog_zone"]
|
||||
transparency = 1
|
||||
cull_mode = 2
|
||||
shading_mode = 0
|
||||
albedo_color = Color(0.2, 0.8, 0.35, 0.18)
|
||||
|
||||
[sub_resource type="SphereMesh" id="SphereMesh_dialog_zone"]
|
||||
material = SubResource("StandardMaterial3D_dialog_zone")
|
||||
radius = 2.5
|
||||
height = 5.0
|
||||
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_checkpoint"]
|
||||
radius = 3.0
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_checkpoint"]
|
||||
transparency = 1
|
||||
cull_mode = 2
|
||||
shading_mode = 0
|
||||
albedo_color = Color(1, 0.804, 0.204, 0.2)
|
||||
|
||||
[sub_resource type="SphereMesh" id="SphereMesh_checkpoint"]
|
||||
material = SubResource("StandardMaterial3D_checkpoint")
|
||||
radius = 3.0
|
||||
height = 6.0
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_2q6dc"]
|
||||
size = Vector3(1080, 2, 1080)
|
||||
|
||||
@@ -62,6 +311,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
|
||||
mesh = SubResource("SphereMesh_w7c3h")
|
||||
|
||||
[node name="Player" type="RigidBody3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.6563287, 0, 0)
|
||||
physics_material_override = SubResource("PhysicsMaterial_w8frs")
|
||||
script = ExtResource("1_muv8p")
|
||||
camera_path = NodePath("Camera3D")
|
||||
@@ -71,27 +321,25 @@ phone_path = NodePath("../PhoneUI")
|
||||
transform = Transform3D(-0.9998549, 0, 0.01703362, 0, 1, 0, -0.01703362, 0, -0.9998549, 0, 0, 0)
|
||||
|
||||
[node name="Skeleton3D" parent="Player/TestCharAnimated/Armature" index="0"]
|
||||
bones/0/position = Vector3(0.0026170756, -0.0012418391, -0.98996276)
|
||||
bones/0/rotation = Quaternion(-0.7278173, -0.05346041, 0.012412205, 0.6835714)
|
||||
bones/1/position = Vector3(8.593209e-06, 0.09923458, -0.012273359)
|
||||
bones/1/rotation = Quaternion(-0.031655744, 0.011362745, 0.022744056, 0.9991754)
|
||||
bones/1/rotation = Quaternion(-0.03163086, 0.011397719, 0.022761386, 0.9991754)
|
||||
bones/2/position = Vector3(-2.2989244e-10, 0.117319785, 2.9730852e-08)
|
||||
bones/2/rotation = Quaternion(0.010291794, 0.001169461, 0.013815534, 0.9998509)
|
||||
bones/2/rotation = Quaternion(0.0102874795, 0.0011603195, 0.013812066, 0.99985105)
|
||||
bones/3/position = Vector3(-2.3358266e-09, 0.13458829, -1.382244e-08)
|
||||
bones/3/rotation = Quaternion(0.067557335, 0.0021622085, 0.013776206, 0.99761796)
|
||||
bones/3/rotation = Quaternion(0.06755522, 0.0021543663, 0.013774819, 0.99761814)
|
||||
bones/4/position = Vector3(2.508626e-07, 0.15027755, 0.008779066)
|
||||
bones/4/rotation = Quaternion(0.051882792, -0.00090027065, 0.0039363643, 0.998645)
|
||||
bones/4/rotation = Quaternion(0.051899955, -0.00089839776, 0.0039267424, 0.9986442)
|
||||
bones/5/position = Vector3(2.152588e-08, 0.103218146, 0.03142428)
|
||||
bones/5/rotation = Quaternion(-0.06595954, 0.011917545, -0.0014885183, 0.99775004)
|
||||
bones/5/rotation = Quaternion(-0.06595736, 0.011938445, -0.0014933152, 0.9977499)
|
||||
bones/6/position = Vector3(1.5477327e-06, 0.18474667, 0.06636399)
|
||||
bones/7/position = Vector3(0.061058242, 0.09106279, 0.0075706206)
|
||||
bones/7/rotation = Quaternion(-0.5982132, -0.43452233, 0.50765175, -0.4422909)
|
||||
bones/7/rotation = Quaternion(-0.598225, -0.43451372, 0.5076822, -0.44224826)
|
||||
bones/8/position = Vector3(1.1842036e-08, 0.12922287, 5.2578955e-08)
|
||||
bones/8/rotation = Quaternion(0.5434686, 0.18407291, 0.20301422, 0.7934383)
|
||||
bones/8/rotation = Quaternion(0.543452, 0.18399428, 0.20302251, 0.79346573)
|
||||
bones/9/position = Vector3(1.5054144e-07, 0.2740467, 2.2048344e-08)
|
||||
bones/9/rotation = Quaternion(-5.192343e-09, -1.1239315e-06, 0.01273731, 0.99991894)
|
||||
bones/9/rotation = Quaternion(-5.2907154e-09, -1.1239725e-06, 0.012734968, 0.999919)
|
||||
bones/10/position = Vector3(1.9432857e-08, 0.27614468, 9.6609995e-08)
|
||||
bones/10/rotation = Quaternion(0.048323337, -0.28487536, 0.026756868, 0.9569718)
|
||||
bones/10/rotation = Quaternion(0.04830448, -0.2848921, 0.026799988, 0.9569665)
|
||||
bones/11/position = Vector3(-0.030029751, 0.037888147, 0.021671427)
|
||||
bones/11/rotation = Quaternion(0.2098604, -0.059559863, 0.20750383, 0.9536002)
|
||||
bones/12/position = Vector3(-3.3527822e-08, 0.0474497, -1.48403245e-08)
|
||||
@@ -128,13 +376,13 @@ bones/29/position = Vector3(1.195453e-08, 0.02594832, 1.5542597e-08)
|
||||
bones/29/rotation = Quaternion(0.14350323, 3.322942e-05, -0.014478063, 0.98954403)
|
||||
bones/30/position = Vector3(-2.4944999e-08, 0.029238665, 6.2325825e-08)
|
||||
bones/31/position = Vector3(-0.06105696, 0.09106397, 0.007570758)
|
||||
bones/31/rotation = Quaternion(0.60009927, -0.4346891, 0.52418536, 0.4197095)
|
||||
bones/31/rotation = Quaternion(0.60012215, -0.43466684, 0.5242142, 0.41966385)
|
||||
bones/32/position = Vector3(2.116817e-08, 0.12922288, 7.016769e-08)
|
||||
bones/32/rotation = Quaternion(0.46432823, -0.26300937, -0.23269261, 0.813068)
|
||||
bones/32/rotation = Quaternion(0.46436408, -0.26298717, -0.23268588, 0.8130566)
|
||||
bones/33/position = Vector3(-2.350565e-08, 0.27404687, 1.5161348e-08)
|
||||
bones/33/rotation = Quaternion(7.667138e-08, -5.0620065e-06, -0.058376648, 0.99829465)
|
||||
bones/33/rotation = Quaternion(7.69042e-08, -5.0622584e-06, -0.058380682, 0.9982944)
|
||||
bones/34/position = Vector3(1.3629875e-07, 0.27614468, -9.158248e-09)
|
||||
bones/34/rotation = Quaternion(0.059040155, 0.17509013, -0.005968382, 0.9827626)
|
||||
bones/34/rotation = Quaternion(0.059025347, 0.17513894, -0.005969527, 0.9827547)
|
||||
bones/35/position = Vector3(0.030029776, 0.03788806, 0.021671649)
|
||||
bones/35/rotation = Quaternion(0.21378386, 0.065372065, -0.22564878, 0.94821185)
|
||||
bones/36/position = Vector3(-2.7939748e-09, 0.04744962, -1.7240383e-08)
|
||||
@@ -171,23 +419,27 @@ bones/53/position = Vector3(1.4340932e-08, 0.025948457, 3.3946527e-08)
|
||||
bones/53/rotation = Quaternion(0.14377311, 5.8452275e-07, 0.011701506, 0.98954153)
|
||||
bones/54/position = Vector3(4.750415e-09, 0.029238641, -1.2388978e-09)
|
||||
bones/55/position = Vector3(0.09123873, -0.06657194, -0.0005540352)
|
||||
bones/55/rotation = Quaternion(0.13601132, 0.07838244, 0.9844897, -0.07834015)
|
||||
bones/55/rotation = Quaternion(0.136, 0.07837879, 0.98449296, -0.07832257)
|
||||
bones/56/position = Vector3(-1.3288446e-09, 0.40599436, 1.0443015e-08)
|
||||
bones/56/rotation = Quaternion(-0.13252214, -0.014519276, 0.03215593, 0.99055195)
|
||||
bones/56/rotation = Quaternion(-0.1325433, -0.014470397, 0.03215335, 0.9905499)
|
||||
bones/57/position = Vector3(5.707578e-09, 0.42099008, -1.5425995e-08)
|
||||
bones/57/rotation = Quaternion(0.5344839, -0.021701135, -0.027458949, 0.8444537)
|
||||
bones/57/rotation = Quaternion(0.5344709, -0.021695312, -0.027452054, 0.8444624)
|
||||
bones/58/position = Vector3(-6.5650525e-09, 0.15721555, -2.6694579e-08)
|
||||
bones/58/rotation = Quaternion(0.2693438, -0.032380052, -0.014592491, 0.96238893)
|
||||
bones/59/position = Vector3(2.4854705e-08, 0.09999996, -3.1755625e-09)
|
||||
bones/60/position = Vector3(-0.091250315, -0.066556, -0.0005535231)
|
||||
bones/60/rotation = Quaternion(-0.09026457, -0.016758345, 0.9954146, -0.026857648)
|
||||
bones/60/rotation = Quaternion(-0.09026675, -0.016730117, 0.9954149, -0.026855767)
|
||||
bones/61/position = Vector3(1.3129254e-08, 0.40599442, 3.8557886e-09)
|
||||
bones/61/rotation = Quaternion(-0.07401098, 0.084030755, -0.024547135, 0.99340767)
|
||||
bones/61/rotation = Quaternion(-0.07409451, 0.08402694, -0.024555309, 0.9934016)
|
||||
bones/62/position = Vector3(-7.3885964e-10, 0.42099023, -5.226429e-09)
|
||||
bones/62/rotation = Quaternion(0.56540585, 0.011310213, -0.008501466, 0.8246915)
|
||||
bones/62/rotation = Quaternion(0.5654398, 0.01134551, -0.008516049, 0.8246677)
|
||||
bones/63/position = Vector3(7.93632e-09, 0.1572156, -2.6982683e-10)
|
||||
bones/63/rotation = Quaternion(0.28907102, 0.031904068, 0.014082117, 0.9566723)
|
||||
bones/63/rotation = Quaternion(0.2890854, 0.031904142, 0.014081784, 0.9566679)
|
||||
bones/64/position = Vector3(7.567915e-10, 0.099999994, -3.2595668e-09)
|
||||
|
||||
[node name="AnimationPlayer" parent="Player/TestCharAnimated" index="1"]
|
||||
root_motion_track = NodePath("Armature/Skeleton3D:mixamorig_Hips")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="Player"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
|
||||
shape = SubResource("SphereShape3D_mx8sn")
|
||||
@@ -199,8 +451,54 @@ fov = 49.0
|
||||
|
||||
[node name="SpotLight3D" type="SpotLight3D" parent="Player"]
|
||||
|
||||
[node name="AnimationTree" type="AnimationTree" parent="Player"]
|
||||
root_node = NodePath("../TestCharAnimated")
|
||||
root_motion_track = NodePath("Armature/Skeleton3D:mixamorig_Hips")
|
||||
tree_root = SubResource("AnimationNodeStateMachine_bwsrl")
|
||||
anim_player = NodePath("../TestCharAnimated/AnimationPlayer")
|
||||
|
||||
[node name="Car" parent="." instance=ExtResource("5_car")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -6, 0, -3)
|
||||
|
||||
[node name="DialogZone" type="Area3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.5, 0, -2.5)
|
||||
script = ExtResource("6_dialog")
|
||||
prompt_text = "Press E to inspect area"
|
||||
dialog_text = "Dialog trigger area"
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="DialogZone"]
|
||||
shape = SubResource("SphereShape3D_dialog_zone")
|
||||
|
||||
[node name="Visual" type="MeshInstance3D" parent="DialogZone"]
|
||||
mesh = SubResource("SphereMesh_dialog_zone")
|
||||
|
||||
[node name="AutoDialogZone" type="Area3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -4, 0, -6.5)
|
||||
script = ExtResource("6_dialog")
|
||||
dialog_text = "Auto dialog trigger"
|
||||
auto_popup = true
|
||||
auto_popup_close_on_exit = true
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="AutoDialogZone"]
|
||||
shape = SubResource("SphereShape3D_dialog_zone")
|
||||
|
||||
[node name="Visual" type="MeshInstance3D" parent="AutoDialogZone"]
|
||||
transform = Transform3D(0.8, 0, 0, 0, 0.8, 0, 0, 0, 0.8, 0, 0, 0)
|
||||
mesh = SubResource("SphereMesh_dialog_zone")
|
||||
|
||||
[node name="QuestCheckpoint" type="Area3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 9, 0, -10)
|
||||
script = ExtResource("7_qtrigger")
|
||||
event_name = &"reach_checkpoint"
|
||||
target_group = &"vehicle"
|
||||
quest_id_filter = "first_drive"
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="QuestCheckpoint"]
|
||||
shape = SubResource("SphereShape3D_checkpoint")
|
||||
|
||||
[node name="Visual" type="MeshInstance3D" parent="QuestCheckpoint"]
|
||||
mesh = SubResource("SphereMesh_checkpoint")
|
||||
|
||||
[node name="Ground" type="StaticBody3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1, 0)
|
||||
|
||||
@@ -291,9 +589,31 @@ grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
color = Color(0.08, 0.08, 0.1, 1)
|
||||
|
||||
[node name="QuestTitle" type="Label" parent="PhoneUI/Control/PhoneFrame"]
|
||||
layout_mode = 0
|
||||
offset_left = 18.0
|
||||
offset_top = 18.0
|
||||
offset_right = 150.0
|
||||
offset_bottom = 41.0
|
||||
text = "Quest Log"
|
||||
|
||||
[node name="QuestText" type="RichTextLabel" parent="PhoneUI/Control/PhoneFrame"]
|
||||
layout_mode = 0
|
||||
offset_left = 18.0
|
||||
offset_top = 52.0
|
||||
offset_right = 344.0
|
||||
offset_bottom = 613.0
|
||||
bbcode_enabled = true
|
||||
text = "No active quest."
|
||||
scroll_active = false
|
||||
|
||||
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
|
||||
environment = SubResource("Environment_a4mo8")
|
||||
|
||||
[node name="LevelExitTeleporter" parent="." instance=ExtResource("8_teleporter")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 5.5, 0.5, 0)
|
||||
target_scene_path = "res://scenes/Levels/transportation_level.tscn"
|
||||
|
||||
[connection signal="pressed" from="Menu/Control/VBoxContainer/ContinueButton" to="Menu" method="_on_continue_button_pressed"]
|
||||
[connection signal="pressed" from="Menu/Control/VBoxContainer/MainMenuButton" to="Menu" method="_on_main_menu_button_pressed"]
|
||||
[connection signal="pressed" from="Menu/Control/VBoxContainer/QuitButton" to="Menu" method="_on_quit_button_pressed"]
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
extends Node3D
|
||||
|
||||
@export var tile_size := 4.0
|
||||
@export var block_height := 1.0
|
||||
|
||||
@onready var _block: MeshInstance3D = $TerrainBlock
|
||||
@onready var _camera: Camera3D = $Camera3D
|
||||
|
||||
func _ready() -> void:
|
||||
var coord := SelectedCharacter.get_coord()
|
||||
var block_pos := Vector3(coord.x * tile_size, block_height * 0.5, coord.y * tile_size)
|
||||
_block.position = block_pos
|
||||
_block.scale = Vector3(tile_size, block_height, tile_size)
|
||||
if _camera:
|
||||
_camera.look_at(block_pos, Vector3.UP)
|
||||
@@ -1 +0,0 @@
|
||||
uid://1fico5npv6dy
|
||||
@@ -1,23 +0,0 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://b7p7k1i4t0m2l"]
|
||||
|
||||
[ext_resource type="Script" path="res://scenes/Levels/location_level.gd" id="1_6y4q1"]
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_yu2x4"]
|
||||
albedo_color = Color(0.2, 0.6, 0.2, 1)
|
||||
|
||||
[sub_resource type="BoxMesh" id="BoxMesh_t2a5k"]
|
||||
material = SubResource("StandardMaterial3D_yu2x4")
|
||||
|
||||
[node name="LocationLevel" type="Node3D"]
|
||||
script = ExtResource("1_6y4q1")
|
||||
|
||||
[node name="TerrainBlock" type="MeshInstance3D" parent="."]
|
||||
mesh = SubResource("BoxMesh_t2a5k")
|
||||
|
||||
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 0.819152, 0.573576, 0, -0.573576, 0.819152, 0, 6, 0)
|
||||
shadow_enabled = true
|
||||
|
||||
[node name="Camera3D" type="Camera3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 0.92388, 0.382683, 0, -0.382683, 0.92388, 0, 6, 10)
|
||||
current = true
|
||||
@@ -0,0 +1,37 @@
|
||||
extends Node3D
|
||||
|
||||
@export var player_spawn_position := Vector3(0.0, 0.0, 0.0)
|
||||
@export var day_length := 120.0
|
||||
@export var start_light_angle := -90.0
|
||||
|
||||
@onready var _player: RigidBody3D = get_node_or_null("Player") as RigidBody3D
|
||||
@onready var _sun: DirectionalLight3D = $DirectionalLight3D
|
||||
|
||||
var _time := 0.0
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
_move_player_to_spawn()
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
_update_day_night(delta)
|
||||
|
||||
|
||||
func _move_player_to_spawn() -> void:
|
||||
if _player == null:
|
||||
return
|
||||
_player.global_position = player_spawn_position
|
||||
_player.linear_velocity = Vector3.ZERO
|
||||
_player.angular_velocity = Vector3.ZERO
|
||||
|
||||
|
||||
func _update_day_night(delta: float) -> void:
|
||||
if _sun == null or day_length <= 0.0:
|
||||
return
|
||||
_time = fmod(_time + delta, day_length)
|
||||
var t: float = _time / day_length
|
||||
var angle: float = lerp(start_light_angle, start_light_angle + 360.0, t)
|
||||
_sun.rotation_degrees.x = angle
|
||||
var energy_curve: float = -sin((t * TAU) + (start_light_angle * PI / 180.0))
|
||||
_sun.light_energy = clamp((energy_curve * 1.0) + 0.2, 0.0, 1.2)
|
||||
@@ -0,0 +1 @@
|
||||
uid://c2vm651r4nepy
|
||||
@@ -0,0 +1,62 @@
|
||||
[gd_scene load_steps=9 format=3 uid="uid://b7p7k1i4t0m2l"]
|
||||
|
||||
[ext_resource type="Script" path="res://scenes/Levels/transportation_level.gd" id="1_6y4q1"]
|
||||
[ext_resource type="Script" path="res://scenes/player.gd" id="2_player"]
|
||||
[ext_resource type="PackedScene" path="res://assets/models/TestCharAnimated.glb" id="3_model"]
|
||||
[ext_resource type="PackedScene" path="res://scenes/Interaction/scene_teleporter.tscn" id="4_teleporter"]
|
||||
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_player"]
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_ground"]
|
||||
size = Vector3(1080, 2, 1080)
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_ground"]
|
||||
albedo_color = Color(0.194, 0.575, 0.194, 1)
|
||||
|
||||
[sub_resource type="BoxMesh" id="BoxMesh_ground"]
|
||||
material = SubResource("StandardMaterial3D_ground")
|
||||
size = Vector3(1080, 2, 1080)
|
||||
|
||||
[node name="TransportationLevel" type="Node3D"]
|
||||
script = ExtResource("1_6y4q1")
|
||||
|
||||
[node name="Ground" type="StaticBody3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1, 0)
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="Ground"]
|
||||
shape = SubResource("BoxShape3D_ground")
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="Ground"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00053596497, 0.0075991154, -0.0019865036)
|
||||
mesh = SubResource("BoxMesh_ground")
|
||||
|
||||
[node name="Player" type="RigidBody3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, 0)
|
||||
script = ExtResource("2_player")
|
||||
camera_path = NodePath("Camera3D")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="Player"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
|
||||
shape = SubResource("SphereShape3D_player")
|
||||
|
||||
[node name="TestCharAnimated" parent="Player" instance=ExtResource("3_model")]
|
||||
transform = Transform3D(-0.9998549, 0, 0.01703362, 0, 1, 0, -0.01703362, 0, -0.9998549, 0, 0, 0)
|
||||
|
||||
[node name="Camera3D" type="Camera3D" parent="Player"]
|
||||
transform = Transform3D(0.9989785, -4.651856e-10, -0.045188628, 0.006969331, 0.9880354, 0.15407, 0.044647958, -0.15422754, 0.9870261, 0.22036135, 1.8988357, 0.64972365)
|
||||
current = true
|
||||
fov = 49.0
|
||||
|
||||
[node name="SpotLight3D" type="SpotLight3D" parent="Player"]
|
||||
transform = Transform3D(1, 0, 0, 0, 0.906308, -0.422618, 0, 0.422618, 0.906308, 0, 1.7, -0.35)
|
||||
visible = false
|
||||
spot_range = 30.0
|
||||
spot_angle = 25.0
|
||||
|
||||
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 0.819152, 0.573576, 0, -0.573576, 0.819152, 0, 6, 0)
|
||||
shadow_enabled = true
|
||||
|
||||
[node name="ReturnTeleporter" parent="." instance=ExtResource("4_teleporter")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -5.5, 0.5, 0)
|
||||
target_scene_path = "res://scenes/Levels/level.tscn"
|
||||
@@ -0,0 +1,158 @@
|
||||
extends Node
|
||||
|
||||
signal quest_registered(quest_id: StringName)
|
||||
signal quest_started(quest_id: StringName)
|
||||
signal quest_step_advanced(quest_id: StringName, step_index: int, step_text: String)
|
||||
signal quest_completed(quest_id: StringName)
|
||||
signal quest_state_changed
|
||||
|
||||
var _quests: Dictionary = {}
|
||||
var _active_quest_id: StringName = &""
|
||||
var _active_step_index: int = -1
|
||||
var _completed_quests: Dictionary = {}
|
||||
|
||||
|
||||
func register_quest(definition: Dictionary) -> bool:
|
||||
var raw_id := String(definition.get("id", "")).strip_edges()
|
||||
if raw_id.is_empty():
|
||||
push_warning("Quest definition is missing an id.")
|
||||
return false
|
||||
var quest_id: StringName = StringName(raw_id)
|
||||
if _quests.has(quest_id):
|
||||
return true
|
||||
|
||||
var raw_steps: Variant = definition.get("steps", [])
|
||||
if typeof(raw_steps) != TYPE_ARRAY:
|
||||
push_warning("Quest '%s' has invalid steps." % raw_id)
|
||||
return false
|
||||
var normalized_steps: Array[Dictionary] = []
|
||||
var idx := 0
|
||||
for raw_step in raw_steps:
|
||||
if typeof(raw_step) != TYPE_DICTIONARY:
|
||||
continue
|
||||
var step_dict: Dictionary = raw_step
|
||||
var step := step_dict.duplicate(true)
|
||||
step["id"] = String(step.get("id", "step_%d" % idx)).strip_edges()
|
||||
step["text"] = String(step.get("text", "")).strip_edges()
|
||||
step["complete_event"] = StringName(String(step.get("complete_event", "")).strip_edges())
|
||||
normalized_steps.append(step)
|
||||
idx += 1
|
||||
|
||||
if normalized_steps.is_empty():
|
||||
push_warning("Quest '%s' has no usable steps." % raw_id)
|
||||
return false
|
||||
|
||||
var quest := definition.duplicate(true)
|
||||
quest["id"] = raw_id
|
||||
quest["title"] = String(definition.get("title", raw_id))
|
||||
quest["description"] = String(definition.get("description", ""))
|
||||
quest["steps"] = normalized_steps
|
||||
_quests[quest_id] = quest
|
||||
quest_registered.emit(quest_id)
|
||||
quest_state_changed.emit()
|
||||
return true
|
||||
|
||||
|
||||
func has_quest(quest_id: String) -> bool:
|
||||
return _quests.has(StringName(quest_id))
|
||||
|
||||
|
||||
func start_quest(quest_id: String) -> bool:
|
||||
var id := StringName(quest_id)
|
||||
if not _quests.has(id):
|
||||
push_warning("Cannot start missing quest '%s'." % quest_id)
|
||||
return false
|
||||
_active_quest_id = id
|
||||
_active_step_index = 0
|
||||
quest_started.emit(_active_quest_id)
|
||||
var step := _get_active_step()
|
||||
if not step.is_empty():
|
||||
quest_step_advanced.emit(_active_quest_id, _active_step_index, String(step.get("text", "")))
|
||||
quest_state_changed.emit()
|
||||
return true
|
||||
|
||||
|
||||
func emit_event(event_name: StringName, payload: Dictionary = {}) -> void:
|
||||
if event_name == StringName():
|
||||
return
|
||||
if _active_quest_id == StringName():
|
||||
return
|
||||
if is_quest_completed(String(_active_quest_id)):
|
||||
return
|
||||
|
||||
var active_step := _get_active_step()
|
||||
if active_step.is_empty():
|
||||
return
|
||||
var expected: StringName = active_step.get("complete_event", StringName())
|
||||
if expected != event_name:
|
||||
return
|
||||
_advance_active_step(payload)
|
||||
|
||||
|
||||
func is_quest_completed(quest_id: String) -> bool:
|
||||
return bool(_completed_quests.get(StringName(quest_id), false))
|
||||
|
||||
|
||||
func is_active_quest(quest_id: String) -> bool:
|
||||
return _active_quest_id == StringName(quest_id)
|
||||
|
||||
|
||||
func get_active_quest_id() -> StringName:
|
||||
return _active_quest_id
|
||||
|
||||
|
||||
func get_active_quest_state() -> Dictionary:
|
||||
if _active_quest_id == StringName() or not _quests.has(_active_quest_id):
|
||||
return {
|
||||
"active": false,
|
||||
}
|
||||
|
||||
var quest: Dictionary = _quests[_active_quest_id]
|
||||
var steps: Array = quest.get("steps", [])
|
||||
var completed: bool = is_quest_completed(String(_active_quest_id))
|
||||
var step_text := ""
|
||||
var step_id := ""
|
||||
if not completed and _active_step_index >= 0 and _active_step_index < steps.size():
|
||||
var step: Dictionary = steps[_active_step_index]
|
||||
step_text = String(step.get("text", ""))
|
||||
step_id = String(step.get("id", ""))
|
||||
|
||||
return {
|
||||
"active": true,
|
||||
"quest_id": String(_active_quest_id),
|
||||
"title": String(quest.get("title", "")),
|
||||
"description": String(quest.get("description", "")),
|
||||
"current_step_index": _active_step_index,
|
||||
"total_steps": steps.size(),
|
||||
"current_step_id": step_id,
|
||||
"current_step_text": step_text,
|
||||
"completed": completed,
|
||||
}
|
||||
|
||||
|
||||
func _get_active_step() -> Dictionary:
|
||||
if _active_quest_id == StringName():
|
||||
return {}
|
||||
if not _quests.has(_active_quest_id):
|
||||
return {}
|
||||
var quest: Dictionary = _quests[_active_quest_id]
|
||||
var steps: Array = quest.get("steps", [])
|
||||
if _active_step_index < 0 or _active_step_index >= steps.size():
|
||||
return {}
|
||||
return steps[_active_step_index]
|
||||
|
||||
|
||||
func _advance_active_step(_payload: Dictionary) -> void:
|
||||
if _active_quest_id == StringName():
|
||||
return
|
||||
var quest: Dictionary = _quests.get(_active_quest_id, {})
|
||||
var steps: Array = quest.get("steps", [])
|
||||
_active_step_index += 1
|
||||
if _active_step_index >= steps.size():
|
||||
_completed_quests[_active_quest_id] = true
|
||||
quest_completed.emit(_active_quest_id)
|
||||
quest_state_changed.emit()
|
||||
return
|
||||
var step: Dictionary = steps[_active_step_index]
|
||||
quest_step_advanced.emit(_active_quest_id, _active_step_index, String(step.get("text", "")))
|
||||
quest_state_changed.emit()
|
||||
@@ -0,0 +1 @@
|
||||
uid://b80hb20j8plpj
|
||||
@@ -0,0 +1,37 @@
|
||||
extends Area3D
|
||||
|
||||
@export var event_name: StringName = &""
|
||||
@export var target_group: StringName = &"player"
|
||||
@export var quest_id_filter: String = ""
|
||||
@export var one_shot: bool = true
|
||||
|
||||
var _triggered := false
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
body_entered.connect(_on_body_entered)
|
||||
|
||||
|
||||
func reset_trigger() -> void:
|
||||
_triggered = false
|
||||
set_deferred("monitoring", true)
|
||||
|
||||
|
||||
func _on_body_entered(body: Node) -> void:
|
||||
if one_shot and _triggered:
|
||||
return
|
||||
if target_group != StringName() and not body.is_in_group(target_group):
|
||||
return
|
||||
if event_name == StringName():
|
||||
return
|
||||
if quest_id_filter.strip_edges() != "":
|
||||
if QuestManager == null or QuestManager.get_active_quest_id() != StringName(quest_id_filter):
|
||||
return
|
||||
if QuestManager:
|
||||
QuestManager.emit_event(event_name, {
|
||||
"body": body,
|
||||
"source": self,
|
||||
})
|
||||
if one_shot:
|
||||
_triggered = true
|
||||
set_deferred("monitoring", false)
|
||||
@@ -0,0 +1 @@
|
||||
uid://cshtdpjp4xy2f
|
||||
@@ -110,7 +110,7 @@ func _on_select_button_pressed() -> void:
|
||||
|
||||
var character: Dictionary = _characters[index]
|
||||
SelectedCharacter.set_character(character)
|
||||
get_tree().change_scene_to_file("res://scenes/Levels/location_level.tscn")
|
||||
get_tree().change_scene_to_file("res://scenes/Levels/transportation_level.tscn")
|
||||
|
||||
func _on_refresh_button_pressed() -> void:
|
||||
_load_characters()
|
||||
|
||||
@@ -0,0 +1,170 @@
|
||||
extends CanvasLayer
|
||||
|
||||
var _interactables: Array[Node] = []
|
||||
var _active_interactable: Node = null
|
||||
var _dialog_visible := false
|
||||
var _dialog_source: Node = null
|
||||
|
||||
var _prompt_label: Label
|
||||
var _dialog_panel: PanelContainer
|
||||
var _dialog_label: RichTextLabel
|
||||
|
||||
func _ready() -> void:
|
||||
layer = 50
|
||||
process_mode = Node.PROCESS_MODE_ALWAYS
|
||||
_setup_ui()
|
||||
_set_dialog_visible(false)
|
||||
_update_prompt_visibility()
|
||||
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
if Input.is_action_just_pressed("interact"):
|
||||
if _dialog_visible:
|
||||
_set_dialog_visible(false)
|
||||
return
|
||||
if _active_interactable != null:
|
||||
_open_dialog_for(_active_interactable)
|
||||
|
||||
|
||||
func register_interactable(interactable: Node) -> void:
|
||||
if interactable == null:
|
||||
return
|
||||
if _interactables.has(interactable):
|
||||
return
|
||||
_interactables.append(interactable)
|
||||
_refresh_active_interactable()
|
||||
|
||||
|
||||
func unregister_interactable(interactable: Node) -> void:
|
||||
if interactable == null:
|
||||
return
|
||||
_interactables.erase(interactable)
|
||||
_refresh_active_interactable()
|
||||
|
||||
|
||||
func _refresh_active_interactable() -> void:
|
||||
while _interactables.size() > 0 and not is_instance_valid(_interactables[_interactables.size() - 1]):
|
||||
_interactables.pop_back()
|
||||
_active_interactable = _interactables[_interactables.size() - 1] if _interactables.size() > 0 else null
|
||||
_update_prompt_visibility()
|
||||
|
||||
|
||||
func _open_dialog_for(interactable: Node) -> void:
|
||||
if _dialog_label:
|
||||
_dialog_label.text = _get_dialog_text(interactable)
|
||||
_dialog_source = interactable
|
||||
_set_dialog_visible(true)
|
||||
|
||||
|
||||
func show_text(text: String) -> void:
|
||||
if _dialog_label:
|
||||
_dialog_label.text = text
|
||||
_dialog_source = null
|
||||
_set_dialog_visible(true)
|
||||
|
||||
|
||||
func show_text_from(source: Node, text: String) -> void:
|
||||
if _dialog_label:
|
||||
_dialog_label.text = text
|
||||
_dialog_source = source
|
||||
_set_dialog_visible(true)
|
||||
|
||||
|
||||
func close_if_text(expected_text: String) -> void:
|
||||
if not _dialog_visible:
|
||||
return
|
||||
if _dialog_label == null:
|
||||
return
|
||||
if _dialog_label.text != expected_text:
|
||||
return
|
||||
_set_dialog_visible(false)
|
||||
|
||||
|
||||
func is_dialog_open() -> bool:
|
||||
return _dialog_visible
|
||||
|
||||
|
||||
func is_dialog_open_from(source: Node) -> bool:
|
||||
return _dialog_visible and _dialog_source == source
|
||||
|
||||
|
||||
func close_if_source(source: Node) -> void:
|
||||
if not _dialog_visible:
|
||||
return
|
||||
if _dialog_source != source:
|
||||
return
|
||||
_set_dialog_visible(false)
|
||||
|
||||
|
||||
func _set_dialog_visible(dialog_open: bool) -> void:
|
||||
_dialog_visible = dialog_open
|
||||
if not _dialog_visible:
|
||||
_dialog_source = null
|
||||
if _dialog_panel:
|
||||
_dialog_panel.visible = _dialog_visible
|
||||
_update_prompt_visibility()
|
||||
|
||||
|
||||
func _update_prompt_visibility() -> void:
|
||||
if _prompt_label == null:
|
||||
return
|
||||
var has_active := _active_interactable != null
|
||||
_prompt_label.visible = has_active and not _dialog_visible
|
||||
if _prompt_label.visible:
|
||||
_prompt_label.text = _get_prompt_text(_active_interactable)
|
||||
|
||||
|
||||
func _get_prompt_text(interactable: Node) -> String:
|
||||
if interactable == null:
|
||||
return ""
|
||||
if interactable.has_method("get_dialog_prompt"):
|
||||
return String(interactable.call("get_dialog_prompt"))
|
||||
return "Press E to interact"
|
||||
|
||||
|
||||
func _get_dialog_text(interactable: Node) -> String:
|
||||
if interactable == null:
|
||||
return ""
|
||||
if interactable.has_method("get_dialog_text"):
|
||||
return String(interactable.call("get_dialog_text"))
|
||||
return "..."
|
||||
|
||||
|
||||
func _setup_ui() -> void:
|
||||
var root := Control.new()
|
||||
root.name = "DialogRoot"
|
||||
root.set_anchors_preset(Control.PRESET_FULL_RECT)
|
||||
root.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
add_child(root)
|
||||
|
||||
_prompt_label = Label.new()
|
||||
_prompt_label.name = "PromptLabel"
|
||||
_prompt_label.set_anchors_preset(Control.PRESET_CENTER_BOTTOM)
|
||||
_prompt_label.offset_left = -140.0
|
||||
_prompt_label.offset_top = -64.0
|
||||
_prompt_label.offset_right = 140.0
|
||||
_prompt_label.offset_bottom = -36.0
|
||||
_prompt_label.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||
_prompt_label.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
_prompt_label.text = "Press E to interact"
|
||||
root.add_child(_prompt_label)
|
||||
|
||||
_dialog_panel = PanelContainer.new()
|
||||
_dialog_panel.name = "DialogPanel"
|
||||
_dialog_panel.visible = false
|
||||
_dialog_panel.set_anchors_preset(Control.PRESET_CENTER_BOTTOM)
|
||||
_dialog_panel.offset_left = -300.0
|
||||
_dialog_panel.offset_top = -220.0
|
||||
_dialog_panel.offset_right = 300.0
|
||||
_dialog_panel.offset_bottom = -80.0
|
||||
_dialog_panel.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
root.add_child(_dialog_panel)
|
||||
|
||||
_dialog_label = RichTextLabel.new()
|
||||
_dialog_label.name = "DialogText"
|
||||
_dialog_label.custom_minimum_size = Vector2(560.0, 120.0)
|
||||
_dialog_label.fit_content = true
|
||||
_dialog_label.scroll_active = false
|
||||
_dialog_label.bbcode_enabled = true
|
||||
_dialog_label.text = ""
|
||||
_dialog_panel.add_child(_dialog_label)
|
||||
@@ -0,0 +1 @@
|
||||
uid://be24usagr8kml
|
||||
@@ -2,16 +2,22 @@ extends Control
|
||||
|
||||
const AUTH_LOGIN_URL := "https://pauth.ranaze.com/api/Auth/login"
|
||||
|
||||
@onready var _username_input: LineEdit = %UsernameInput
|
||||
@onready var _password_input: LineEdit = %PasswordInput
|
||||
@onready var _login_request: HTTPRequest = %LoginRequest
|
||||
@onready var _error_label: Label = %ErrorLabel
|
||||
|
||||
func _on_log_in_button_pressed() -> void:
|
||||
var username := _username_input.text.strip_edges()
|
||||
var password := _password_input.text
|
||||
if username.is_empty() or password.is_empty():
|
||||
_show_error("Username and password required.")
|
||||
@onready var _username_input: LineEdit = %UsernameInput
|
||||
@onready var _password_input: LineEdit = %PasswordInput
|
||||
@onready var _login_request: HTTPRequest = %LoginRequest
|
||||
@onready var _error_label: Label = %ErrorLabel
|
||||
|
||||
func _ready() -> void:
|
||||
if not _username_input.is_connected("text_submitted", Callable(self, "_on_input_text_submitted")):
|
||||
_username_input.text_submitted.connect(_on_input_text_submitted)
|
||||
if not _password_input.is_connected("text_submitted", Callable(self, "_on_input_text_submitted")):
|
||||
_password_input.text_submitted.connect(_on_input_text_submitted)
|
||||
|
||||
func _on_log_in_button_pressed() -> void:
|
||||
var username := _username_input.text.strip_edges()
|
||||
var password := _password_input.text
|
||||
if username.is_empty() or password.is_empty():
|
||||
_show_error("Username and password required.")
|
||||
return
|
||||
|
||||
var payload := {
|
||||
@@ -44,5 +50,8 @@ func _on_login_request_completed(result: int, response_code: int, _headers: Pack
|
||||
func _on_back_button_pressed() -> void:
|
||||
get_tree().change_scene_to_file("res://scenes/UI/start_screen.tscn")
|
||||
|
||||
func _show_error(message: String) -> void:
|
||||
_error_label.text = message
|
||||
func _show_error(message: String) -> void:
|
||||
_error_label.text = message
|
||||
|
||||
func _on_input_text_submitted(_new_text: String) -> void:
|
||||
_on_log_in_button_pressed()
|
||||
|
||||
@@ -64,3 +64,6 @@ func _update_login_button() -> void:
|
||||
_login_button.text = "LOG OUT"
|
||||
else:
|
||||
_login_button.text = "LOG IN"
|
||||
|
||||
func _on_secret_button_pressed():
|
||||
get_tree().change_scene_to_file("uid://q4abhlwqdvay")
|
||||
|
||||
@@ -90,6 +90,14 @@ size_flags_vertical = 4
|
||||
theme = ExtResource("1_tx5wa")
|
||||
text = "QUIT"
|
||||
|
||||
[node name="SecretButton" type="Button" parent="."]
|
||||
show_behind_parent = true
|
||||
layout_mode = 0
|
||||
offset_left = 840.0
|
||||
offset_top = 142.0
|
||||
offset_right = 856.0
|
||||
offset_bottom = 159.0
|
||||
|
||||
[node name="LogoutRequest" type="HTTPRequest" parent="."]
|
||||
unique_name_in_owner = true
|
||||
|
||||
@@ -97,4 +105,5 @@ unique_name_in_owner = true
|
||||
[connection signal="pressed" from="MarginContainer/CenterContainer/ContentVBox/VBoxContainer/StartButton" to="." method="_on_start_button_pressed"]
|
||||
[connection signal="pressed" from="MarginContainer/CenterContainer/ContentVBox/VBoxContainer/SettingsButton" to="." method="_on_settings_button_pressed"]
|
||||
[connection signal="pressed" from="MarginContainer/CenterContainer/ContentVBox/VBoxContainer/QuitButton" to="." method="_on_quit_button_pressed"]
|
||||
[connection signal="pressed" from="SecretButton" to="." method="_on_secret_button_pressed"]
|
||||
[connection signal="request_completed" from="LogoutRequest" to="." method="_on_logout_request_completed"]
|
||||
|
||||
@@ -22,6 +22,7 @@ var _nearby_driver: Node = null
|
||||
var _driver: Node = null
|
||||
|
||||
func _ready() -> void:
|
||||
add_to_group("vehicle")
|
||||
if interact_area:
|
||||
interact_area.collision_layer = 2
|
||||
interact_area.collision_mask = 1
|
||||
|
||||
+139
-120
@@ -1,25 +1,27 @@
|
||||
extends RigidBody3D
|
||||
# Initially I used a CharacterBody3D, however, I wanted the player to bounce off
|
||||
# other objects in the environment and that would have required manual handling
|
||||
# of collisions. So that's why we're using a RigidBody3D instead.
|
||||
|
||||
const MOVE_SPEED := 8.0
|
||||
const ACCELLERATION := 30.0
|
||||
const DECELLERATION := 40.0
|
||||
const JUMP_SPEED := 4.0
|
||||
const MAX_NUMBER_OF_JUMPS := 2
|
||||
|
||||
const MIN_FOV := 10
|
||||
const MAX_FOV := 180
|
||||
const ZOOM_FACTOR := 1.1 # Zoom out when >1, in when < 1
|
||||
var mouse_sensitivity := 0.005
|
||||
var rotation_x := 0.0
|
||||
var rotation_y := 0.0
|
||||
var cameraMoveMode := false
|
||||
var current_number_of_jumps := 0
|
||||
var _pending_mouse_delta := Vector2.ZERO
|
||||
var _last_move_forward := Vector3(0, 0, 1)
|
||||
var _last_move_right := Vector3(1, 0, 0)
|
||||
extends RigidBody3D
|
||||
# Initially I used a CharacterBody3D, however, I wanted the player to bounce off
|
||||
# other objects in the environment and that would have required manual handling
|
||||
# of collisions. So that's why we're using a RigidBody3D instead.
|
||||
signal vehicle_entered(vehicle: Node)
|
||||
signal vehicle_exited(vehicle: Node)
|
||||
|
||||
const MOVE_SPEED := 8.0
|
||||
const SPRINT_MOVE_SPEED :=13
|
||||
const ACCELLERATION := 30.0
|
||||
const DECELLERATION := 40.0
|
||||
const JUMP_SPEED := 4.0
|
||||
const MAX_NUMBER_OF_JUMPS := 2
|
||||
const MIN_FOV := 10
|
||||
const MAX_FOV := 180
|
||||
const ZOOM_FACTOR := 1.1 # Zoom out when >1, in when < 1
|
||||
var mouse_sensitivity := 0.005
|
||||
var rotation_x := 0.0
|
||||
var rotation_y := 0.0
|
||||
var cameraMoveMode := false
|
||||
var current_number_of_jumps := 0
|
||||
var _pending_mouse_delta := Vector2.ZERO
|
||||
var _last_move_forward := Vector3(0, 0, 1)
|
||||
var _last_move_right := Vector3(1, 0, 0)
|
||||
var _camera_offset_local := Vector3.ZERO
|
||||
var _camera_yaw := 0.0
|
||||
var _camera_pitch := 0.0
|
||||
@@ -31,46 +33,52 @@ var _light_was_on := false
|
||||
var _jump_triggered := false
|
||||
@onready var _flashlight: SpotLight3D = $SpotLight3D
|
||||
@onready var _anim_player: AnimationPlayer = find_child("AnimationPlayer", true, false) as AnimationPlayer
|
||||
@onready var _anim_tree: AnimationTree = find_child("AnimationTree", true, false) as AnimationTree
|
||||
@onready var _model_root: Node3D = find_child("TestCharAnimated", true, false) as Node3D
|
||||
|
||||
@export var camera_follow_speed := 10.0
|
||||
@export var anim_idle_name := "Idle"
|
||||
@export var anim_walk_name := "Walk"
|
||||
@export var anim_jump_name := "Jump"
|
||||
@export var anim_run_name := "Run"
|
||||
@export var anim_walk_speed_threshold := 0.25
|
||||
@export var anim_sprint_speed_threshold := 10.0
|
||||
|
||||
var jump_sound = preload("res://assets/audio/jump.ogg")
|
||||
var audio_player = AudioStreamPlayer.new()
|
||||
|
||||
@export var camera_path: NodePath
|
||||
@onready var cam: Camera3D = get_node(camera_path) if camera_path != NodePath("") else null
|
||||
@export var phone_path: NodePath
|
||||
@onready var phone: CanvasLayer = get_node(phone_path) if phone_path != NodePath("") else null
|
||||
var phone_visible := false
|
||||
|
||||
|
||||
@export var camera_path: NodePath
|
||||
@onready var cam: Camera3D = get_node(camera_path) if camera_path != NodePath("") else null
|
||||
@export var phone_path: NodePath
|
||||
@onready var phone: CanvasLayer = get_node(phone_path) if phone_path != NodePath("") else null
|
||||
var phone_visible := false
|
||||
|
||||
func _ready() -> void:
|
||||
axis_lock_angular_x = true
|
||||
axis_lock_angular_z = true
|
||||
angular_damp = 6.0
|
||||
contact_monitor = true
|
||||
max_contacts_reported = 4
|
||||
add_child(audio_player)
|
||||
audio_player.stream = jump_sound
|
||||
audio_player.volume_db = -20
|
||||
add_to_group("player")
|
||||
if _anim_tree:
|
||||
_anim_tree.active = false
|
||||
axis_lock_angular_x = true
|
||||
axis_lock_angular_z = true
|
||||
angular_damp = 6.0
|
||||
contact_monitor = true
|
||||
max_contacts_reported = 4
|
||||
add_child(audio_player)
|
||||
audio_player.stream = jump_sound
|
||||
audio_player.volume_db = -20
|
||||
if cam:
|
||||
_camera_offset_local = cam.transform.origin
|
||||
_camera_pitch = cam.rotation.x
|
||||
_camera_yaw = global_transform.basis.get_euler().y
|
||||
cam.set_as_top_level(true)
|
||||
cam.global_position = global_position + (Basis(Vector3.UP, _camera_yaw) * _camera_offset_local)
|
||||
cam.global_rotation = Vector3(_camera_pitch, _camera_yaw, 0.0)
|
||||
var move_basis := cam.global_transform.basis if cam else global_transform.basis
|
||||
var forward := move_basis.z
|
||||
var right := move_basis.x
|
||||
forward.y = 0.0
|
||||
right.y = 0.0
|
||||
if forward.length() > 0.0001:
|
||||
_last_move_forward = forward.normalized()
|
||||
_camera_offset_local = cam.transform.origin
|
||||
_camera_pitch = cam.rotation.x
|
||||
_camera_yaw = global_transform.basis.get_euler().y
|
||||
cam.set_as_top_level(true)
|
||||
cam.global_position = global_position + (Basis(Vector3.UP, _camera_yaw) * _camera_offset_local)
|
||||
cam.global_rotation = Vector3(_camera_pitch, _camera_yaw, 0.0)
|
||||
var move_basis := cam.global_transform.basis if cam else global_transform.basis
|
||||
var forward := move_basis.z
|
||||
var right := move_basis.x
|
||||
forward.y = 0.0
|
||||
right.y = 0.0
|
||||
if forward.length() > 0.0001:
|
||||
_last_move_forward = forward.normalized()
|
||||
if right.length() > 0.0001:
|
||||
_last_move_right = right.normalized()
|
||||
_vehicle_collision_layer = collision_layer
|
||||
@@ -81,56 +89,56 @@ func _integrate_forces(state):
|
||||
linear_velocity = Vector3.ZERO
|
||||
return
|
||||
if cameraMoveMode and _pending_mouse_delta != Vector2.ZERO:
|
||||
rotation_x -= _pending_mouse_delta.y * mouse_sensitivity
|
||||
rotation_y -= _pending_mouse_delta.x * mouse_sensitivity
|
||||
rotation_x = clamp(rotation_x, deg_to_rad(-90), deg_to_rad(90)) # Prevent flipping
|
||||
_camera_pitch = rotation_x
|
||||
rotation.y = rotation_y
|
||||
_pending_mouse_delta = Vector2.ZERO
|
||||
|
||||
# Input as 2D vector
|
||||
var input2v := Input.get_vector("ui_left", "ui_right", "ui_up", "ui_down")
|
||||
|
||||
if Input.is_action_just_pressed("player_phone"):
|
||||
phone_visible = !phone_visible
|
||||
if phone:
|
||||
phone.visible = phone_visible
|
||||
|
||||
# Camera based movement
|
||||
var forward := Vector3.FORWARD * -1.0
|
||||
var right := Vector3.RIGHT
|
||||
if cam:
|
||||
forward = cam.global_transform.basis.z
|
||||
right = cam.global_transform.basis.x
|
||||
# Project onto ground plane so looking up/down doesn't kill movement.
|
||||
forward.y = 0.0
|
||||
right.y = 0.0
|
||||
if forward.length() > 0.0001:
|
||||
forward = forward.normalized()
|
||||
_last_move_forward = forward
|
||||
else:
|
||||
forward = _last_move_forward
|
||||
if right.length() > 0.0001:
|
||||
right = right.normalized()
|
||||
_last_move_right = right
|
||||
else:
|
||||
right = _last_move_right
|
||||
|
||||
var dir := (right * input2v.x + forward * input2v.y).normalized()
|
||||
var target_v := dir * MOVE_SPEED
|
||||
|
||||
var ax := ACCELLERATION if dir != Vector3.ZERO else DECELLERATION
|
||||
linear_velocity.x = move_toward(linear_velocity.x, target_v.x, ax * state.step)
|
||||
linear_velocity.z = move_toward(linear_velocity.z, target_v.z, ax * state.step)
|
||||
|
||||
# Jump Logic
|
||||
var on_floor = false
|
||||
for i in state.get_contact_count():
|
||||
var normal = state.get_contact_local_normal(i)
|
||||
if normal.y > 0.5:
|
||||
on_floor = true
|
||||
break
|
||||
|
||||
rotation_x -= _pending_mouse_delta.y * mouse_sensitivity
|
||||
rotation_y -= _pending_mouse_delta.x * mouse_sensitivity
|
||||
rotation_x = clamp(rotation_x, deg_to_rad(-90), deg_to_rad(90)) # Prevent flipping
|
||||
_camera_pitch = rotation_x
|
||||
rotation.y = rotation_y
|
||||
_pending_mouse_delta = Vector2.ZERO
|
||||
|
||||
# Input as 2D vector
|
||||
var input2v := Input.get_vector("ui_left", "ui_right", "ui_up", "ui_down")
|
||||
|
||||
# Camera based movement
|
||||
var forward := Vector3.FORWARD * -1.0
|
||||
var right := Vector3.RIGHT
|
||||
if cam:
|
||||
forward = cam.global_transform.basis.z
|
||||
right = cam.global_transform.basis.x
|
||||
# Project onto ground plane so looking up/down doesn't kill movement.
|
||||
forward.y = 0.0
|
||||
right.y = 0.0
|
||||
if forward.length() > 0.0001:
|
||||
forward = forward.normalized()
|
||||
_last_move_forward = forward
|
||||
else:
|
||||
forward = _last_move_forward
|
||||
if right.length() > 0.0001:
|
||||
right = right.normalized()
|
||||
_last_move_right = right
|
||||
else:
|
||||
right = _last_move_right
|
||||
|
||||
var dir := (right * input2v.x + forward * input2v.y).normalized()
|
||||
|
||||
var target_v := dir * MOVE_SPEED
|
||||
|
||||
# Sprinting
|
||||
if Input.is_key_pressed(KEY_SHIFT):
|
||||
target_v = dir * SPRINT_MOVE_SPEED
|
||||
|
||||
var ax := ACCELLERATION if dir != Vector3.ZERO else DECELLERATION
|
||||
linear_velocity.x = move_toward(linear_velocity.x, target_v.x, ax * state.step)
|
||||
linear_velocity.z = move_toward(linear_velocity.z, target_v.z, ax * state.step)
|
||||
|
||||
# Jump Logic
|
||||
var on_floor = false
|
||||
for i in state.get_contact_count():
|
||||
var normal = state.get_contact_local_normal(i)
|
||||
if normal.y > 0.5:
|
||||
on_floor = true
|
||||
break
|
||||
|
||||
if Input.is_action_just_pressed("ui_accept") and (on_floor or current_number_of_jumps == 1):
|
||||
current_number_of_jumps = (current_number_of_jumps + 1) % 2
|
||||
linear_velocity.y = JUMP_SPEED
|
||||
@@ -147,31 +155,37 @@ func _integrate_forces(state):
|
||||
|
||||
_update_animation(on_floor, state.linear_velocity)
|
||||
_jump_triggered = false
|
||||
|
||||
|
||||
func _input(event):
|
||||
if event.is_action_pressed("player_phone"):
|
||||
phone_visible = !phone_visible
|
||||
if phone:
|
||||
phone.visible = phone_visible
|
||||
return
|
||||
|
||||
if _in_vehicle:
|
||||
return
|
||||
if event is InputEventMouseButton:
|
||||
if event.button_index == MOUSE_BUTTON_MIDDLE:
|
||||
if event.pressed:
|
||||
cameraMoveMode = true
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
|
||||
else:
|
||||
cameraMoveMode = false
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
|
||||
|
||||
if event is InputEventMouseMotion and cameraMoveMode:
|
||||
_pending_mouse_delta += event.relative
|
||||
|
||||
if event is InputEventMouseButton and event.pressed:
|
||||
if event.button_index == MOUSE_BUTTON_WHEEL_UP:
|
||||
zoom_camera(1.0 / ZOOM_FACTOR) # Zoom in
|
||||
elif event.button_index == MOUSE_BUTTON_WHEEL_DOWN:
|
||||
zoom_camera(ZOOM_FACTOR) # Zoom out
|
||||
|
||||
if event.button_index == MOUSE_BUTTON_MIDDLE:
|
||||
if event.pressed:
|
||||
cameraMoveMode = true
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
|
||||
else:
|
||||
cameraMoveMode = false
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
|
||||
|
||||
if event is InputEventMouseMotion and cameraMoveMode:
|
||||
_pending_mouse_delta += event.relative
|
||||
|
||||
if event is InputEventMouseButton and event.pressed:
|
||||
if event.button_index == MOUSE_BUTTON_WHEEL_UP:
|
||||
zoom_camera(1.0 / ZOOM_FACTOR) # Zoom in
|
||||
elif event.button_index == MOUSE_BUTTON_WHEEL_DOWN:
|
||||
zoom_camera(ZOOM_FACTOR) # Zoom out
|
||||
|
||||
if event.is_action_pressed("player_light"):
|
||||
_flashlight.visible = !_flashlight.visible
|
||||
|
||||
|
||||
func zoom_camera(factor):
|
||||
var new_fov = cam.fov * factor
|
||||
cam.fov = clamp(new_fov, MIN_FOV, MAX_FOV)
|
||||
@@ -188,6 +202,10 @@ func _update_animation(on_floor: bool, velocity: Vector3) -> void:
|
||||
if _anim_player.current_animation != anim_jump_name:
|
||||
_anim_player.play(anim_jump_name)
|
||||
return
|
||||
if on_floor and horizontal_speed > anim_sprint_speed_threshold and _anim_player.has_animation(anim_run_name):
|
||||
if _anim_player.current_animation != anim_run_name:
|
||||
_anim_player.play(anim_run_name)
|
||||
return
|
||||
if horizontal_speed > anim_walk_speed_threshold and _anim_player.has_animation(anim_walk_name):
|
||||
if _anim_player.current_animation != anim_walk_name:
|
||||
_anim_player.play(anim_walk_name)
|
||||
@@ -214,6 +232,7 @@ func enter_vehicle(_vehicle: Node, seat: Node3D, vehicle_camera: Camera3D) -> vo
|
||||
cam.current = false
|
||||
if vehicle_camera:
|
||||
vehicle_camera.current = true
|
||||
vehicle_entered.emit(_vehicle)
|
||||
|
||||
func exit_vehicle(exit_point: Node3D, vehicle_camera: Camera3D) -> void:
|
||||
_in_vehicle = false
|
||||
@@ -233,4 +252,4 @@ func exit_vehicle(exit_point: Node3D, vehicle_camera: Camera3D) -> void:
|
||||
vehicle_camera.current = false
|
||||
if cam:
|
||||
cam.current = true
|
||||
|
||||
vehicle_exited.emit(null)
|
||||
|
||||
Reference in New Issue
Block a user