Recommiting glbs for LFS
Deploy Promiscuity Auth API / deploy (push) Successful in 1m59s
Deploy Promiscuity Character API / deploy (push) Successful in 1m16s
Deploy Promiscuity Inventory API / deploy (push) Has been cancelled
Deploy Promiscuity Locations API / deploy (push) Has been cancelled
Deploy Promiscuity Mail API / deploy (push) Has been cancelled
Deploy Promiscuity World API / deploy (push) Has been cancelled
Deploy Promiscuity Crafting API / deploy (push) Has been cancelled
k8s smoke test / test (push) Has been cancelled
Deploy Promiscuity Auth API / deploy (push) Successful in 1m59s
Deploy Promiscuity Character API / deploy (push) Successful in 1m16s
Deploy Promiscuity Inventory API / deploy (push) Has been cancelled
Deploy Promiscuity Locations API / deploy (push) Has been cancelled
Deploy Promiscuity Mail API / deploy (push) Has been cancelled
Deploy Promiscuity World API / deploy (push) Has been cancelled
Deploy Promiscuity Crafting API / deploy (push) Has been cancelled
k8s smoke test / test (push) Has been cancelled
This commit is contained in:
@@ -6,12 +6,14 @@ extends Node3D
|
||||
|
||||
@onready var _player: RigidBody3D = get_node_or_null("Player") as RigidBody3D
|
||||
@onready var _sun: DirectionalLight3D = $DirectionalLight3D
|
||||
@onready var _quest_text: RichTextLabel = get_node_or_null("PhoneUI/Control/PhoneFrame/QuestText") as RichTextLabel
|
||||
|
||||
var _time := 0.0
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
_move_player_to_spawn()
|
||||
_setup_quest_ui()
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
@@ -21,11 +23,24 @@ func _process(delta: float) -> void:
|
||||
func _move_player_to_spawn() -> void:
|
||||
if _player == null:
|
||||
return
|
||||
_player.global_position = player_spawn_position
|
||||
var spawn_marker := _consume_spawn_marker()
|
||||
if spawn_marker != null:
|
||||
_player.call("teleport_to_spawn", spawn_marker.global_transform)
|
||||
else:
|
||||
_player.global_position = player_spawn_position
|
||||
_player.linear_velocity = Vector3.ZERO
|
||||
_player.angular_velocity = Vector3.ZERO
|
||||
|
||||
|
||||
func _consume_spawn_marker() -> Node3D:
|
||||
if TeleportState == null:
|
||||
return null
|
||||
var spawn_name: StringName = TeleportState.consume_spawn_name()
|
||||
if spawn_name == StringName():
|
||||
return null
|
||||
return find_child(String(spawn_name), true, false) as Node3D
|
||||
|
||||
|
||||
func _update_day_night(delta: float) -> void:
|
||||
if _sun == null or day_length <= 0.0:
|
||||
return
|
||||
@@ -35,3 +50,28 @@ func _update_day_night(delta: float) -> void:
|
||||
_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)
|
||||
|
||||
|
||||
func _setup_quest_ui() -> void:
|
||||
if QuestManager == null:
|
||||
return
|
||||
if not QuestManager.is_connected("quest_state_changed", Callable(self, "_refresh_quest_ui")):
|
||||
QuestManager.quest_state_changed.connect(_refresh_quest_ui)
|
||||
_refresh_quest_ui()
|
||||
|
||||
|
||||
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]
|
||||
|
||||
Reference in New Issue
Block a user