Vast improvements and a working finite state machine, working on new guild member registration.
This commit is contained in:
78
active_scene.tscn
Normal file
78
active_scene.tscn
Normal file
@@ -0,0 +1,78 @@
|
||||
[gd_scene load_steps=10 format=3 uid="uid://dfa6ep4o53s08"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cci652umkym1f" path="res://test_scene.gd" id="1_8p2cu"]
|
||||
[ext_resource type="PackedScene" uid="uid://cd08dp16bixfv" path="res://guildhall.tscn" id="1_fcxuj"]
|
||||
[ext_resource type="PackedScene" uid="uid://c8ofw6na082gv" path="res://main_panel.tscn" id="2_8p2cu"]
|
||||
[ext_resource type="Script" uid="uid://ccorfvcfa84gf" path="res://guildhall.gd" id="3_hyuu1"]
|
||||
[ext_resource type="PackedScene" uid="uid://dly7in8ql1fn4" path="res://quest_log.tscn" id="4_tro8a"]
|
||||
[ext_resource type="Script" uid="uid://blo7tb5135vfm" path="res://quest_board.gd" id="5_46fpu"]
|
||||
[ext_resource type="Texture2D" uid="uid://bldpiytpdrge6" path="res://icon.svg" id="5_eenn6"]
|
||||
[ext_resource type="PackedScene" uid="uid://drrtypncppjps" path="res://quest_board_window.tscn" id="5_uh7v7"]
|
||||
[ext_resource type="Script" uid="uid://bnbljf6u2d3kh" path="res://visitor_spawner.gd" id="6_d0hfk"]
|
||||
|
||||
[node name="Active Scene" type="Node2D"]
|
||||
script = ExtResource("1_8p2cu")
|
||||
|
||||
[node name="Guildhall" parent="." instance=ExtResource("1_fcxuj")]
|
||||
position = Vector2(421, 161)
|
||||
script = ExtResource("3_hyuu1")
|
||||
|
||||
[node name="NavigationRegion2D" parent="Guildhall" index="0"]
|
||||
position = Vector2(-8, 25)
|
||||
|
||||
[node name="QuestBoard" type="StaticBody2D" parent="Guildhall/NavigationRegion2D" index="2"]
|
||||
position = Vector2(942, 31)
|
||||
input_pickable = true
|
||||
script = ExtResource("5_46fpu")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="Guildhall/NavigationRegion2D/QuestBoard"]
|
||||
scale = Vector2(1.84375, 0.4375)
|
||||
texture = ExtResource("5_eenn6")
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Guildhall/NavigationRegion2D/QuestBoard"]
|
||||
polygon = PackedVector2Array(-118, -28, 118, -28, 118, 28, -118, 29)
|
||||
|
||||
[node name="QuestBoardWindow" parent="Guildhall/NavigationRegion2D/QuestBoard" instance=ExtResource("5_uh7v7")]
|
||||
position = Vector2i(0, 36)
|
||||
|
||||
[node name="CharacterBody2D" parent="Guildhall" index="1"]
|
||||
interaction_range = 100.0
|
||||
|
||||
[node name="NavigationAgent2D" parent="Guildhall/CharacterBody2D" index="1"]
|
||||
path_desired_distance = 100.0
|
||||
target_desired_distance = 75.0
|
||||
|
||||
[node name="Queue" parent="Guildhall/Receptionist" index="3"]
|
||||
position = Vector2(-6, 186)
|
||||
direction = Vector2(0, 1)
|
||||
|
||||
[node name="StateMachine" parent="Guildhall/Receptionist" index="4"]
|
||||
starting_state = "Advance Queue"
|
||||
|
||||
[node name="VisitorSpawner" type="Node2D" parent="Guildhall"]
|
||||
position = Vector2(505, 870)
|
||||
script = ExtResource("6_d0hfk")
|
||||
total_visitors = 5
|
||||
|
||||
[node name="Timer" type="Timer" parent="Guildhall/VisitorSpawner"]
|
||||
|
||||
[node name="UI" type="CanvasLayer" parent="."]
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="UI"]
|
||||
offset_left = 1567.0
|
||||
offset_top = 23.0
|
||||
offset_right = 1903.0
|
||||
offset_bottom = 185.0
|
||||
|
||||
[node name="PanelContainer" parent="UI/VBoxContainer" instance=ExtResource("2_8p2cu")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Notices" type="Control" parent="UI/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Quest Log" parent="UI" instance=ExtResource("4_tro8a")]
|
||||
|
||||
[connection signal="input_event" from="Guildhall/NavigationRegion2D/QuestBoard" to="Guildhall/NavigationRegion2D/QuestBoard" method="_input_event"]
|
||||
[connection signal="timeout" from="Guildhall/VisitorSpawner/Timer" to="Guildhall/VisitorSpawner" method="_on_timer_timeout"]
|
||||
|
||||
[editable path="Guildhall"]
|
||||
59
adventurer.gd
Normal file
59
adventurer.gd
Normal file
@@ -0,0 +1,59 @@
|
||||
class_name Adventurer extends CharacterBody2D
|
||||
|
||||
@onready var state_machine : StateMachine = $StateMachine
|
||||
@onready var movement_speed : float = 400.0
|
||||
@onready var movement_target_position : Vector2 = global_position
|
||||
@onready var nav_agent : NavigationAgent2D = $NavigationAgent2D
|
||||
|
||||
var data : AdventurerData = null
|
||||
var interaction_target = null
|
||||
@onready var bubble : SpeechBubble = $SpeechBubble
|
||||
@export var interaction_range : float = 75
|
||||
@export var stop_range : float = 25
|
||||
|
||||
func _ready() -> void:
|
||||
state_machine.actor = self
|
||||
state_machine.start()
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
if nav_agent.is_navigation_finished():
|
||||
if interaction_target:
|
||||
try_interact(interaction_target)
|
||||
#If they have an interaction target within range
|
||||
#clear the target
|
||||
#try_interact
|
||||
return
|
||||
|
||||
var curr_pos: Vector2 = global_position
|
||||
var next_path_pos: Vector2 = nav_agent.get_next_path_position()
|
||||
|
||||
velocity = curr_pos.direction_to(next_path_pos) * movement_speed
|
||||
move_and_slide()
|
||||
|
||||
|
||||
func approach(pos : Vector2) -> void:
|
||||
var rid = get_world_2d().get_navigation_map()
|
||||
var point : Vector2 = NavigationServer2D.map_get_closest_point(rid, pos)
|
||||
set_movement_target(point)
|
||||
|
||||
func approach_and_interact(obj : Interactable) -> void:
|
||||
set_movement_target(obj.global_position)
|
||||
nav_agent.target_desired_distance = interaction_range - 5
|
||||
interaction_target = obj
|
||||
|
||||
func try_interact(obj : Interactable) -> void:
|
||||
var df = obj.global_position - global_position
|
||||
if df.length() > interaction_range:
|
||||
approach_and_interact(obj)
|
||||
else:
|
||||
interact(obj)
|
||||
interaction_target = null
|
||||
|
||||
func interact(obj : Interactable) -> void:
|
||||
obj.interact(self)
|
||||
|
||||
func set_movement_target(target : Vector2) -> void:
|
||||
nav_agent.target_position = target
|
||||
|
||||
func show_speech_bubble(bubble_type : String) -> void:
|
||||
bubble.try_show_speech(bubble_type)
|
||||
1
adventurer.gd.uid
Normal file
1
adventurer.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://cjqumk0kw2vte
|
||||
11
adventurer_data.gd
Normal file
11
adventurer_data.gd
Normal file
@@ -0,0 +1,11 @@
|
||||
class_name AdventurerData extends Node
|
||||
|
||||
var life : int = 1
|
||||
var max_life : int = 1
|
||||
var energy : int = 1
|
||||
var max_energy : int = 1
|
||||
var quest : Quest
|
||||
|
||||
func assign_quest(quest : Quest) -> void:
|
||||
self.quest = quest
|
||||
quest.initiate(self)
|
||||
1
adventurer_data.gd.uid
Normal file
1
adventurer_data.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://0jl2qbvtmsik
|
||||
BIN
busy-dots.aseprite
Normal file
BIN
busy-dots.aseprite
Normal file
Binary file not shown.
BIN
busy-dots.png
Normal file
BIN
busy-dots.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 680 B |
40
busy-dots.png.import
Normal file
40
busy-dots.png.import
Normal file
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://1mmg270gotb1"
|
||||
path="res://.godot/imported/busy-dots.png-31d70c9440af4478b802f06a1617b631.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://busy-dots.png"
|
||||
dest_files=["res://.godot/imported/busy-dots.png-31d70c9440af4478b802f06a1617b631.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
|
||||
10
end_shift_confirmation.gd
Normal file
10
end_shift_confirmation.gd
Normal file
@@ -0,0 +1,10 @@
|
||||
extends ConfirmationDialog
|
||||
|
||||
|
||||
func _on_confirmed() -> void:
|
||||
Game.end_shift()
|
||||
hide()
|
||||
|
||||
|
||||
func _on_canceled() -> void:
|
||||
hide()
|
||||
1
end_shift_confirmation.gd.uid
Normal file
1
end_shift_confirmation.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dopd01h4q2uu8
|
||||
13
end_shift_confirmation.tscn
Normal file
13
end_shift_confirmation.tscn
Normal file
@@ -0,0 +1,13 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://st16n70uj5sc"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dopd01h4q2uu8" path="res://end_shift_confirmation.gd" id="1_u27s3"]
|
||||
|
||||
[node name="End Shift Confirmation" type="ConfirmationDialog"]
|
||||
oversampling_override = 1.0
|
||||
size = Vector2i(319, 100)
|
||||
ok_button_text = "Yes"
|
||||
dialog_text = "Are you sure you want to end the shift?"
|
||||
script = ExtResource("1_u27s3")
|
||||
|
||||
[connection signal="canceled" from="." to="." method="_on_canceled"]
|
||||
[connection signal="confirmed" from="." to="." method="_on_confirmed"]
|
||||
22
endpoint.gd
Normal file
22
endpoint.gd
Normal file
@@ -0,0 +1,22 @@
|
||||
class_name Endpoint extends Control
|
||||
|
||||
@export var percent : float = 0
|
||||
var filled: bool
|
||||
var fill: bool :
|
||||
get:
|
||||
return filled
|
||||
set(value):
|
||||
if value != filled:
|
||||
set_fill(value)
|
||||
|
||||
|
||||
func set_fill(value : bool) -> void:
|
||||
filled = value
|
||||
if value:
|
||||
$Dot.visible = true
|
||||
$Fill.modulate = Color.SEA_GREEN
|
||||
else:
|
||||
$Dot.visible = false
|
||||
$Fill.modulate = Color.BLACK
|
||||
|
||||
|
||||
1
endpoint.gd.uid
Normal file
1
endpoint.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://cf0pt0ty4uaas
|
||||
39
fsm/interact_with_employee.gd
Normal file
39
fsm/interact_with_employee.gd
Normal file
@@ -0,0 +1,39 @@
|
||||
extends StateNode
|
||||
|
||||
@export var employee_name : String = ""
|
||||
@export var speech_bubble : String = ""
|
||||
@export var wait_duration : float = 1
|
||||
@export var interaction_args : Array[String] = []
|
||||
var wait_remaining : float = 0
|
||||
|
||||
var employee : GuildEmployee
|
||||
var actor
|
||||
|
||||
func exit() -> void:
|
||||
actor.show_speech_bubble("")
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
if wait_remaining > 0:
|
||||
wait_remaining -= delta
|
||||
if wait_remaining <= 0:
|
||||
wait_remaining = 0
|
||||
employee.interact(self, interaction_args[0])
|
||||
complete_state()
|
||||
|
||||
func execute(subject, ...args : Array) -> void:
|
||||
wait_remaining = wait_duration
|
||||
actor = subject
|
||||
|
||||
if len(args) > 0 and args[0] != "":
|
||||
subject.show_speech_bubble(speech_bubble)
|
||||
|
||||
#TODO: Possibly an error later with preexisting and extended lists
|
||||
for arg in args.slice(1):
|
||||
interaction_args.append(arg)
|
||||
var emp = Guild.hall.employees.get(employee_name)
|
||||
|
||||
if emp == null:
|
||||
printerr("Employee %s not found!" % employee_name)
|
||||
complete_state()
|
||||
else:
|
||||
employee = emp
|
||||
1
fsm/interact_with_employee.gd.uid
Normal file
1
fsm/interact_with_employee.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bewrajxqdutsu
|
||||
27
fsm/machines/newbie.gd
Normal file
27
fsm/machines/newbie.gd
Normal file
@@ -0,0 +1,27 @@
|
||||
extends StateMachine
|
||||
|
||||
|
||||
func advance_state() -> void:
|
||||
var last_state = curr_state
|
||||
var args : Array = [actor]
|
||||
exit_state(curr_state)
|
||||
match(last_state.name):
|
||||
"Wait":
|
||||
if last_state.next_state != "":
|
||||
if !states.has(last_state.next_state):
|
||||
printerr("Tried to switch to missing state %s" % last_state.next_state)
|
||||
pass
|
||||
enter_state(states[last_state.next_state])
|
||||
args.append_array(last_state.next_state_args)
|
||||
else:
|
||||
pass
|
||||
"Queue":
|
||||
enter_state(states["Wait"])
|
||||
args.append_array(["busy", "Register"])
|
||||
"Register":
|
||||
enter_state(states["Register"])
|
||||
"Leave":
|
||||
enter_state(states["Leave"])
|
||||
|
||||
if curr_state != null:
|
||||
curr_state.execute.callv(args)
|
||||
1
fsm/machines/newbie.gd.uid
Normal file
1
fsm/machines/newbie.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dthatmb3if73u
|
||||
23
fsm/machines/receptionist.gd
Normal file
23
fsm/machines/receptionist.gd
Normal file
@@ -0,0 +1,23 @@
|
||||
extends StateMachine
|
||||
|
||||
|
||||
func advance_state() -> void:
|
||||
var last_state = curr_state
|
||||
var args : Array = [actor]
|
||||
exit_state(curr_state)
|
||||
match(last_state.name):
|
||||
"Wait":
|
||||
if last_state.next_state != "":
|
||||
if !states.has(last_state.next_state):
|
||||
printerr("Tried to switch to missing state %s" % last_state.next_state)
|
||||
pass
|
||||
enter_state(states[last_state.next_state])
|
||||
args.append_array(last_state.next_state_args)
|
||||
else:
|
||||
pass
|
||||
"Advance Queue":
|
||||
enter_state(states["Wait"])
|
||||
args.append_array(["", "Advance Queue"])
|
||||
|
||||
if curr_state != null:
|
||||
curr_state.execute.callv(args)
|
||||
1
fsm/machines/receptionist.gd.uid
Normal file
1
fsm/machines/receptionist.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://cggu0yihq0unt
|
||||
43
fsm/machines/state_machine.gd
Normal file
43
fsm/machines/state_machine.gd
Normal file
@@ -0,0 +1,43 @@
|
||||
class_name StateMachine extends Node
|
||||
|
||||
@export var starting_state : String = ""
|
||||
var states : Dictionary[String, StateNode] = {}
|
||||
var curr_state : StateNode = null
|
||||
var actor = null
|
||||
func _ready() -> void:
|
||||
for child in get_children():
|
||||
if child is StateNode:
|
||||
states[child.name] = child
|
||||
child.state_machine = self
|
||||
child.completed.connect(_on_state_completed)
|
||||
|
||||
|
||||
func start() -> void:
|
||||
if starting_state != "":
|
||||
var state : StateNode = states.get(starting_state)
|
||||
if state == null:
|
||||
printerr("Starting state not found! Expected %s" % [starting_state])
|
||||
else:
|
||||
enter_state(state)
|
||||
curr_state.execute(actor)
|
||||
|
||||
func exit_state(state : StateNode) -> void:
|
||||
curr_state.exit()
|
||||
curr_state = null
|
||||
pass
|
||||
|
||||
func enter_state(state : StateNode) -> void:
|
||||
curr_state = state
|
||||
curr_state.enter()
|
||||
pass
|
||||
|
||||
|
||||
func advance_state() -> void:
|
||||
pass
|
||||
|
||||
|
||||
func _on_state_completed(state : StateNode) -> void:
|
||||
if state == curr_state:
|
||||
advance_state()
|
||||
else:
|
||||
printerr("Wrong state completed! %s when expecting %s" % [state.name, curr_state])
|
||||
1
fsm/machines/state_machine.gd.uid
Normal file
1
fsm/machines/state_machine.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://u81fhi8157bg
|
||||
22
fsm/machines/test.gd
Normal file
22
fsm/machines/test.gd
Normal file
@@ -0,0 +1,22 @@
|
||||
extends StateMachine
|
||||
|
||||
func advance_state() -> void:
|
||||
var last_state = curr_state
|
||||
var args : Array = [actor]
|
||||
exit_state(curr_state)
|
||||
match(last_state.name):
|
||||
"Wait":
|
||||
if last_state.next_state != "":
|
||||
if !states.has(last_state.next_state):
|
||||
printerr("Tried to switch to missing state %s" % last_state.next_state)
|
||||
pass
|
||||
enter_state(states[last_state.next_state])
|
||||
args.append_array(last_state.next_state_args)
|
||||
else:
|
||||
pass
|
||||
"Test":
|
||||
enter_state(states["Wait"])
|
||||
args.append_array(["busy", "Test"])
|
||||
|
||||
if curr_state != null:
|
||||
curr_state.execute.callv(args)
|
||||
1
fsm/machines/test.gd.uid
Normal file
1
fsm/machines/test.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://djd8pv5xbgud3
|
||||
6
fsm/nodes/advance_queue.gd
Normal file
6
fsm/nodes/advance_queue.gd
Normal file
@@ -0,0 +1,6 @@
|
||||
extends StateNode
|
||||
|
||||
func execute(subject, ...args : Array) -> void:
|
||||
if !subject.busy:
|
||||
subject.queue.try_advance()
|
||||
complete_state()
|
||||
1
fsm/nodes/advance_queue.gd.uid
Normal file
1
fsm/nodes/advance_queue.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://csicx3fpxv7xt
|
||||
1
fsm/nodes/leave.gd
Normal file
1
fsm/nodes/leave.gd
Normal file
@@ -0,0 +1 @@
|
||||
extends StateNode
|
||||
1
fsm/nodes/leave.gd.uid
Normal file
1
fsm/nodes/leave.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://b0ewnwcibhu21
|
||||
51
fsm/nodes/queue.gd
Normal file
51
fsm/nodes/queue.gd
Normal file
@@ -0,0 +1,51 @@
|
||||
extends StateNode
|
||||
|
||||
@export var employee : String = ""
|
||||
|
||||
var target
|
||||
var actor
|
||||
var in_queue
|
||||
var queued_at : GuildQueue
|
||||
var next_state : String
|
||||
var next_state_args : Array = []
|
||||
|
||||
|
||||
func execute(subject, ...args : Array) -> void:
|
||||
actor = subject
|
||||
#find the receptionist queue
|
||||
var queue = Guild.hall.employees[employee].queue
|
||||
#join the queue
|
||||
join_queue(queue)
|
||||
reposition_queue(queue.length-1)
|
||||
|
||||
subject.nav_agent.navigation_finished.connect(_on_navigation_finished)
|
||||
|
||||
func _on_navigation_finished() -> void:
|
||||
actor.nav_agent.navigation_finished.disconnect(_on_navigation_finished)
|
||||
if !in_queue:
|
||||
complete_state()
|
||||
|
||||
func join_queue(queue : GuildQueue) -> void:
|
||||
queue.add_member(actor)
|
||||
in_queue = true
|
||||
queued_at = queue
|
||||
queue.advanced.connect(_on_queue_advanced)
|
||||
|
||||
func leave_queue() -> void:
|
||||
in_queue = false
|
||||
queued_at.advanced.disconnect(_on_queue_advanced)
|
||||
queued_at = null
|
||||
|
||||
func reposition_queue(idx : int) -> void:
|
||||
var queue = queued_at
|
||||
#if zero approach the receptionist with the intent to use her service at navigation complete.
|
||||
actor.approach(queue.global_position + idx * queue.direction * 75)
|
||||
|
||||
func _on_queue_advanced() -> void:
|
||||
#find our place within the queue
|
||||
var idx : int = queued_at.members.find(actor)
|
||||
#We aren't in the queue, time to advance
|
||||
if idx < 0:
|
||||
leave_queue()
|
||||
else:
|
||||
reposition_queue(idx)
|
||||
1
fsm/nodes/queue.gd.uid
Normal file
1
fsm/nodes/queue.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://y85swbbk8kbd
|
||||
17
fsm/nodes/state_node.gd
Normal file
17
fsm/nodes/state_node.gd
Normal file
@@ -0,0 +1,17 @@
|
||||
class_name StateNode extends Node
|
||||
|
||||
var state_machine : StateMachine = null
|
||||
signal completed(state : StateNode)
|
||||
|
||||
|
||||
func enter() -> void:
|
||||
pass
|
||||
|
||||
func exit() -> void:
|
||||
pass
|
||||
|
||||
func execute(subject, ...args : Array) -> void:
|
||||
pass
|
||||
|
||||
func complete_state() -> void:
|
||||
completed.emit(self)
|
||||
1
fsm/nodes/state_node.gd.uid
Normal file
1
fsm/nodes/state_node.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://c27ctn874rdns
|
||||
13
fsm/nodes/test.gd
Normal file
13
fsm/nodes/test.gd
Normal file
@@ -0,0 +1,13 @@
|
||||
extends StateNode
|
||||
|
||||
|
||||
@export var message : String = ""
|
||||
var target
|
||||
func execute(subject, ...args : Array) -> void:
|
||||
subject.approach(Game.player.global_position)
|
||||
subject.nav_agent.navigation_finished.connect(_on_navigation_finished)
|
||||
target = subject
|
||||
|
||||
func _on_navigation_finished() -> void:
|
||||
target.nav_agent.navigation_finished.disconnect(_on_navigation_finished)
|
||||
complete_state()
|
||||
1
fsm/nodes/test.gd.uid
Normal file
1
fsm/nodes/test.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://e8we6nmaob1k
|
||||
34
fsm/nodes/wait.gd
Normal file
34
fsm/nodes/wait.gd
Normal file
@@ -0,0 +1,34 @@
|
||||
extends StateNode
|
||||
|
||||
|
||||
@export var wait_duration : float = 1
|
||||
var wait_remaining : float = 0
|
||||
var next_state : String
|
||||
var next_state_args : Array = []
|
||||
var actor
|
||||
func exit() -> void:
|
||||
actor.show_speech_bubble("")
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
if wait_remaining > 0:
|
||||
wait_remaining -= delta
|
||||
if wait_remaining <= 0:
|
||||
wait_remaining = 0
|
||||
complete_state()
|
||||
|
||||
func execute(subject, ...args : Array) -> void:
|
||||
wait_remaining = wait_duration
|
||||
actor = subject
|
||||
|
||||
if len(args) > 0 and args[0] != "":
|
||||
subject.show_speech_bubble(args[0])
|
||||
|
||||
if len(args) > 1 and args[1] != "":
|
||||
next_state = args[1]
|
||||
else:
|
||||
next_state = ""
|
||||
|
||||
if len(args) > 2 and args[2] != "":
|
||||
next_state_args = args[2]
|
||||
else:
|
||||
next_state_args = []
|
||||
1
fsm/nodes/wait.gd.uid
Normal file
1
fsm/nodes/wait.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dl3b5aywu1hf6
|
||||
30
game_manager.gd
Normal file
30
game_manager.gd
Normal file
@@ -0,0 +1,30 @@
|
||||
extends Node
|
||||
|
||||
var player : Player = null
|
||||
var panel : GamePanel = null
|
||||
var quest_log : QuestLog = null
|
||||
var active : bool = true
|
||||
var end_shift_confirmation : ConfirmationDialog
|
||||
var end_shift_confirm_template = preload("res://end_shift_confirmation.tscn")
|
||||
func _ready() -> void:
|
||||
end_shift_confirmation = end_shift_confirm_template.instantiate()
|
||||
add_child(end_shift_confirmation)
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
if active and Input.is_action_just_pressed("switch modes"):
|
||||
confirm_end_shift()
|
||||
|
||||
|
||||
func add_quest_progress_bar(quest : Quest) -> void:
|
||||
panel.add_quest_progress_bar(quest)
|
||||
|
||||
func confirm_end_shift() -> void:
|
||||
end_shift_confirmation.popup_centered()
|
||||
|
||||
func setup_visitor_ui(spawner: VisitorSpawner)-> void:
|
||||
if panel:
|
||||
panel.connect_visitor_spawner(spawner)
|
||||
|
||||
func end_shift() -> void:
|
||||
active = false
|
||||
panel.switch_panel(active)
|
||||
1
game_manager.gd.uid
Normal file
1
game_manager.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://cr421faioc8cf
|
||||
35
guild.gd
Normal file
35
guild.gd
Normal file
@@ -0,0 +1,35 @@
|
||||
extends Node
|
||||
|
||||
|
||||
const visitors = {
|
||||
"test": {
|
||||
"data":preload("res://test_adventurer.tscn"),
|
||||
"sprite":preload("res://test_adventurer_sprite.tscn")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
var members : Array[AdventurerData] = []
|
||||
var quests : Dictionary[Quest,bool] = {}
|
||||
var hall : Guildhall = null
|
||||
var visitor_spawner : VisitorSpawner = null
|
||||
|
||||
func register_guild_member(member : AdventurerData) -> void:
|
||||
members.append(member)
|
||||
|
||||
func add_quest(quest : Quest) -> void:
|
||||
quests[quest] = false
|
||||
Game.quest_log.add_entry(quest)
|
||||
|
||||
func assign_quest(member : AdventurerData, quest : Quest) -> void:
|
||||
member.assign_quest(quest)
|
||||
quests[quest] = true #Mark it as active
|
||||
Game.add_quest_progress_bar(quest)
|
||||
|
||||
func spawn_visitor(pos : Vector2) -> void:
|
||||
var visitor : AdventurerData = visitors["test"].data.instantiate()
|
||||
var sprite : Adventurer = visitors["test"].sprite.instantiate()
|
||||
sprite.data = visitor
|
||||
hall.add_sprite(sprite)
|
||||
sprite.global_position = pos
|
||||
1
guild.gd.uid
Normal file
1
guild.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://c7ymru8doa4a8
|
||||
10
guild_employee.gd
Normal file
10
guild_employee.gd
Normal file
@@ -0,0 +1,10 @@
|
||||
class_name GuildEmployee extends Adventurer
|
||||
|
||||
@export var speech :String
|
||||
@onready var queue : GuildQueue = $Queue
|
||||
var busy : bool
|
||||
|
||||
|
||||
func interact(interactor, type : String = "") -> void:
|
||||
if type == "register":
|
||||
Guild.register_guild_member(interactor)
|
||||
1
guild_employee.gd.uid
Normal file
1
guild_employee.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://b2unuudq5qfl
|
||||
23
guild_queue.gd
Normal file
23
guild_queue.gd
Normal file
@@ -0,0 +1,23 @@
|
||||
class_name GuildQueue extends Node2D
|
||||
|
||||
var length : int :
|
||||
get:
|
||||
return len(members)
|
||||
@export var direction : Vector2 = Vector2.ZERO
|
||||
var members : Array[Adventurer] = []
|
||||
signal advanced()
|
||||
|
||||
func add_member(member : Adventurer) -> void:
|
||||
members.append(member)
|
||||
#TODO: Instead retrieve the array length with a getter
|
||||
|
||||
func try_advance() -> Adventurer:
|
||||
if length > 0:
|
||||
return advance()
|
||||
else:
|
||||
return null
|
||||
|
||||
func advance() -> Adventurer:
|
||||
var member = members.pop_front()
|
||||
advanced.emit()
|
||||
return member
|
||||
1
guild_queue.gd.uid
Normal file
1
guild_queue.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://b0q2233msdtgo
|
||||
15
guildhall.gd
Normal file
15
guildhall.gd
Normal file
@@ -0,0 +1,15 @@
|
||||
class_name Guildhall extends Node2D
|
||||
|
||||
var employees : Dictionary[String, GuildEmployee] = {}
|
||||
|
||||
func _ready() -> void:
|
||||
Guild.hall = self
|
||||
for child in get_children():
|
||||
if child is GuildEmployee:
|
||||
register_employee(child)
|
||||
|
||||
|
||||
func register_employee(employee: GuildEmployee) -> void:
|
||||
employees[employee.name] = employee
|
||||
func add_sprite(sprite : Adventurer) -> void:
|
||||
add_child(sprite)
|
||||
1
guildhall.gd.uid
Normal file
1
guildhall.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://ccorfvcfa84gf
|
||||
182
guildhall.tscn
182
guildhall.tscn
@@ -1,17 +1,189 @@
|
||||
[gd_scene load_steps=2 format=4 uid="uid://cd08dp16bixfv"]
|
||||
[gd_scene load_steps=18 format=4 uid="uid://cd08dp16bixfv"]
|
||||
|
||||
[ext_resource type="TileSet" uid="uid://6im0g3eg6sr4" path="res://test_tiles.tres" id="1_qel1r"]
|
||||
[ext_resource type="Script" uid="uid://dolqtw1ye4ras" path="res://player.gd" id="2_5n4iw"]
|
||||
[ext_resource type="Texture2D" uid="uid://bldpiytpdrge6" path="res://icon.svg" id="2_w7eqs"]
|
||||
[ext_resource type="Texture2D" uid="uid://cbamfadh7wwr7" path="res://speech-blip.png" id="4_2wofw"]
|
||||
[ext_resource type="Script" uid="uid://b2unuudq5qfl" path="res://guild_employee.gd" id="4_g7jyq"]
|
||||
[ext_resource type="Script" uid="uid://b0q2233msdtgo" path="res://guild_queue.gd" id="5_13vc8"]
|
||||
[ext_resource type="Script" uid="uid://cggu0yihq0unt" path="res://fsm/machines/receptionist.gd" id="6_13vc8"]
|
||||
[ext_resource type="Script" uid="uid://csicx3fpxv7xt" path="res://fsm/nodes/advance_queue.gd" id="7_hph4e"]
|
||||
[ext_resource type="Script" uid="uid://dl3b5aywu1hf6" path="res://fsm/nodes/wait.gd" id="8_bog1h"]
|
||||
[ext_resource type="Script" uid="uid://w57riwplc00t" path="res://speech_bubble.gd" id="10_50x1e"]
|
||||
[ext_resource type="Texture2D" uid="uid://chnk20ey5qxfh" path="res://speech-emojis.png" id="11_50x1e"]
|
||||
|
||||
[sub_resource type="NavigationPolygon" id="NavigationPolygon_w7eqs"]
|
||||
vertices = PackedVector2Array(814, 70.03906, 1070, 68.96094, 778, 138, 778, 54, 814, 10, 10, 10, 246, 54, 10, 630, 246, 138, 458, 630, 1070, 28, 1078, 28, 1078, 630, 566, 630, 566, 886, 458, 886)
|
||||
polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2), PackedInt32Array(0, 2, 3), PackedInt32Array(4, 0, 3), PackedInt32Array(5, 4, 3), PackedInt32Array(5, 3, 6), PackedInt32Array(7, 5, 6), PackedInt32Array(7, 6, 8), PackedInt32Array(9, 7, 8), PackedInt32Array(9, 8, 2), PackedInt32Array(1, 10, 11), PackedInt32Array(1, 11, 12), PackedInt32Array(2, 1, 12), PackedInt32Array(2, 12, 13), PackedInt32Array(9, 2, 13), PackedInt32Array(9, 13, 14), PackedInt32Array(9, 14, 15)])
|
||||
sample_partition_type = 1
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_5n4iw"]
|
||||
radius = 35.0
|
||||
|
||||
[sub_resource type="Animation" id="Animation_bog1h"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Sprite2D3:frame")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [0]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("Sprite2D3:position")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_13vc8"]
|
||||
resource_name = "busy"
|
||||
length = 0.7000034
|
||||
loop_mode = 1
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Sprite2D3:frame")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7),
|
||||
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1),
|
||||
"update": 1,
|
||||
"values": [0, 1, 8, 9, 16, 17, 24, 25]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("Sprite2D3:position")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_lsinl"]
|
||||
resource_name = "talk"
|
||||
length = 0.40000334
|
||||
loop_mode = 1
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Sprite2D3:position")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0, -3)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("Sprite2D3:frame")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4),
|
||||
"transitions": PackedFloat32Array(1, 1, 1, 1, 1),
|
||||
"update": 1,
|
||||
"values": [2, 3, 10, 3, 2]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_uo85v"]
|
||||
_data = {
|
||||
&"RESET": SubResource("Animation_bog1h"),
|
||||
&"busy": SubResource("Animation_13vc8"),
|
||||
&"talk": SubResource("Animation_lsinl")
|
||||
}
|
||||
|
||||
[node name="Guildhall" type="Node2D"]
|
||||
|
||||
[node name="TileMapLayer" type="TileMapLayer" parent="."]
|
||||
tile_map_data = PackedByteArray("AAABAAEAAAAOAAEAAAACAAEAAAAOAAEAAAADAAEAAAAOAAEAAAAEAAEAAAAOAAEAAAAFAAIAAAAOAAEAAAAGAAIAAAAOAAEAAAAHAAIAAAAOAAEAAAAIAAIAAAAOAAEAAAAJAAIAAAAOAAEAAAAKAAIAAAAOAAEAAAAHAAEAAAAOAAEAAAAGAAEAAAAOAAEAAAAFAAEAAAAOAAEAAAACAAIAAAAOAAEAAAADAAIAAAAOAAEAAAAEAAIAAAAOAAEAAAABAAIAAAAOAAEAAAABAAMAAAAOAAEAAAABAAQAAAAOAAEAAAACAAQAAAAOAAEAAAADAAQAAAAOAAEAAAAEAAQAAAAOAAEAAAAFAAQAAAAOAAEAAAAGAAQAAAAOAAEAAAAHAAQAAAAOAAEAAAAIAAQAAAAOAAEAAAAJAAQAAAAOAAEAAAAJAAMAAAAOAAEAAAAKAAMAAAAOAAEAAAAKAAEAAAAOAAEAAAAJAAEAAAAOAAEAAAAIAAEAAAAOAAEAAAADAAMAAAAOAAEAAAACAAMAAAAOAAEAAAAEAAMAAAAOAAEAAAAFAAMAAAAOAAEAAAAGAAMAAAAOAAEAAAAHAAMAAAAOAAEAAAAIAAMAAAAOAAEAAAAKAAQAAAAOAAEAAAALAAQAAAAOAAEAAAALAAMAAAAOAAEAAAALAAIAAAAOAAEAAAALAAEAAAAOAAEAAAAKAAAAAAAOAAEAAAAJAAAAAAAOAAEAAAAIAAAAAAAOAAEAAAAHAAAAAAAOAAEAAAAGAAAAAAAOAAEAAAAFAAAAAAAOAAEAAAAEAAAAAAAOAAEAAAADAAAAAAAOAAEAAAACAAAAAAAOAAEAAAABAAAAAAAOAAEAAAAAAAAAAAAOAAEAAAAAAAEAAAAOAAEAAAAAAAIAAAAOAAEAAAAAAAMAAAAOAAEAAAAAAAQAAAAOAAEAAAAAAAUAAAAOAAEAAAAAAAYAAAAOAAEAAAAAAAcAAAAOAAEAAAAAAAgAAAAOAAEAAAAAAAkAAAAOAAEAAAABAAkAAAAOAAEAAAACAAkAAAAOAAEAAAADAAkAAAAOAAEAAAAEAAkAAAAOAAEAAAAFAAkAAAAOAAEAAAAGAAkAAAAOAAEAAAAHAAkAAAAOAAEAAAAIAAkAAAAOAAEAAAAJAAkAAAAOAAEAAAAKAAkAAAAOAAEAAAALAAkAAAAOAAEAAAAMAAkAAAAOAAEAAAANAAkAAAAOAAEAAAAOAAkAAAAOAAEAAAAPAAkAAAAOAAEAAAAQAAkAAAAOAAEAAAAQAAgAAAAOAAEAAAAQAAcAAAAOAAEAAAAQAAYAAAAOAAEAAAAQAAUAAAAOAAEAAAAQAAQAAAAOAAEAAAAQAAMAAAAOAAEAAAAQAAIAAAAOAAEAAAAQAAEAAAAOAAEAAAAQAAAAAAAOAAEAAAAPAAAAAAAOAAEAAAAOAAAAAAAOAAEAAAANAAAAAAAOAAEAAAAMAAAAAAAOAAEAAAALAAAAAAAOAAEAAAAPAAEAAAAOAAEAAAAOAAEAAAAOAAEAAAANAAEAAAAOAAEAAAAMAAEAAAAOAAEAAAAMAAIAAAAOAAEAAAANAAIAAAAOAAEAAAAOAAIAAAAOAAEAAAAPAAIAAAAOAAEAAAAMAAMAAAAOAAEAAAAMAAQAAAAOAAEAAAANAAQAAAAOAAEAAAAOAAQAAAAOAAEAAAAPAAQAAAAOAAEAAAAOAAUAAAAOAAEAAAANAAUAAAAOAAEAAAAMAAUAAAAOAAEAAAALAAUAAAAOAAEAAAAKAAYAAAAOAAEAAAAJAAYAAAAOAAEAAAAIAAcAAAAOAAEAAAAJAAcAAAAOAAEAAAAKAAcAAAAOAAEAAAALAAcAAAAOAAEAAAAMAAcAAAAOAAEAAAANAAYAAAAOAAEAAAAOAAYAAAAOAAEAAAAPAAYAAAAOAAEAAAAPAAcAAAAOAAEAAAAOAAgAAAAOAAEAAAAPAAgAAAAOAAEAAAAPAAUAAAAOAAEAAAAOAAMAAAAOAAEAAAAOAAcAAAAOAAEAAAAPAAMAAAAOAAEAAAAMAAYAAAAOAAEAAAALAAgAAAAOAAEAAAAMAAgAAAAOAAEAAAANAAcAAAAOAAEAAAANAAgAAAAOAAEAAAANAAMAAAAOAAEAAAAKAAUAAAAOAAEAAAAIAAgAAAAOAAEAAAAJAAgAAAAOAAEAAAALAAYAAAAOAAEAAAAKAAgAAAAOAAEAAAAHAAgAAAAOAAEAAAAGAAgAAAAOAAEAAAACAAgAAAAOAAEAAAABAAgAAAAOAAEAAAABAAcAAAAOAAEAAAABAAYAAAAOAAEAAAABAAUAAAAOAAEAAAACAAUAAAAOAAEAAAACAAYAAAAOAAEAAAADAAYAAAAOAAEAAAAEAAYAAAAOAAEAAAAFAAYAAAAOAAEAAAAGAAYAAAAOAAEAAAAHAAYAAAAOAAEAAAAIAAYAAAAOAAEAAAAFAAUAAAAOAAEAAAAGAAUAAAAOAAEAAAAHAAUAAAAOAAEAAAAIAAUAAAAOAAEAAAAJAAUAAAAOAAEAAAAEAAUAAAAOAAEAAAADAAUAAAAOAAEAAAADAAcAAAAOAAEAAAACAAcAAAAOAAEAAAAEAAcAAAAOAAEAAAAFAAcAAAAOAAEAAAAGAAcAAAAOAAEAAAAHAAcAAAAOAAEAAAAFAAgAAAAOAAEAAAAEAAgAAAAOAAEAAAADAAgAAAAOAAEAAAARAP//AAABAAQAAAARAAoAAAABAAUAAAD//woAAAAAAAUAAAD/////AAAAAAQAAAAAAP//AAACAAQAAAABAP//AAACAAQAAAACAP//AAACAAQAAAADAP//AAACAAQAAAAEAP//AAACAAQAAAAFAP//AAACAAQAAAAGAP//AAACAAQAAAAHAP//AAACAAQAAAAIAP//AAACAAQAAAAJAP//AAACAAQAAAAKAP//AAACAAQAAAALAP//AAACAAQAAAAMAP//AAACAAQAAAANAP//AAACAAQAAAAOAP//AAACAAQAAAAPAP//AAACAAQAAAAQAP//AAACAAQAAAARAAAAAAACAAUAAAARAAEAAAACAAUAAAARAAIAAAACAAUAAAARAAMAAAACAAUAAAARAAQAAAACAAUAAAARAAUAAAACAAUAAAARAAYAAAACAAUAAAARAAcAAAACAAUAAAARAAgAAAACAAUAAAARAAkAAAACAAUAAAAQAAoAAAACAAQAAAAPAAoAAAACAAQAAAAOAAoAAAACAAQAAAANAAoAAAACAAQAAAAMAAoAAAACAAQAAAALAAoAAAACAAQAAAAKAAoAAAACAAQAAAAJAAoAAAAGAAUAAAAIAAoAAAAFAAAAAAAHAAoAAAAFAAAAAAAGAAoAAAAFAAQAAAAFAAoAAAACAAQAAAAEAAoAAAACAAQAAAADAAoAAAACAAQAAAACAAoAAAACAAQAAAABAAoAAAACAAQAAAAAAAoAAAACAAQAAAD//wkAAAACAAUAAAD//wAAAAACAAUAAAD//wEAAAACAAUAAAD//wIAAAACAAUAAAD//wMAAAACAAUAAAD//wQAAAACAAUAAAD//wUAAAACAAUAAAD//wYAAAACAAUAAAD//wcAAAACAAUAAAD//wgAAAACAAUAAAAHAAsAAAAFAAAAAAAIAAsAAAAFAAAAAAAHAAwAAAAFAAAAAAAIAAwAAAAFAAAAAAAHAA0AAAAFAAAAAAAIAA0AAAAFAAAAAAA=")
|
||||
tile_set = ExtResource("1_qel1r")
|
||||
[node name="NavigationRegion2D" type="NavigationRegion2D" parent="."]
|
||||
navigation_polygon = SubResource("NavigationPolygon_w7eqs")
|
||||
|
||||
[node name="TileMapLayer2" type="TileMapLayer" parent="."]
|
||||
[node name="TileMapLayer" type="TileMapLayer" parent="NavigationRegion2D"]
|
||||
tile_map_data = PackedByteArray("AAABAAEAAAAOAAEAAAACAAEAAAAOAAEAAAADAAEAAAAOAAEAAAAEAAEAAAAOAAEAAAAFAAIAAAAOAAEAAAAGAAIAAAAOAAEAAAAHAAIAAAAOAAEAAAAIAAIAAAAOAAEAAAAJAAIAAAAOAAEAAAAKAAIAAAAOAAEAAAAHAAEAAAAOAAEAAAAGAAEAAAAOAAEAAAAFAAEAAAAOAAEAAAACAAIAAAAOAAEAAAADAAIAAAAOAAEAAAAEAAIAAAAOAAEAAAABAAIAAAAOAAEAAAABAAMAAAAOAAEAAAABAAQAAAAOAAEAAAACAAQAAAAOAAEAAAADAAQAAAAOAAEAAAAEAAQAAAAOAAEAAAAFAAQAAAAOAAEAAAAGAAQAAAAOAAEAAAAHAAQAAAAOAAEAAAAIAAQAAAAOAAEAAAAJAAQAAAAOAAEAAAAJAAMAAAAOAAEAAAAKAAMAAAAOAAEAAAAKAAEAAAAOAAEAAAAJAAEAAAAOAAEAAAAIAAEAAAAOAAEAAAADAAMAAAAOAAEAAAACAAMAAAAOAAEAAAAEAAMAAAAOAAEAAAAFAAMAAAAOAAEAAAAGAAMAAAAOAAEAAAAHAAMAAAAOAAEAAAAIAAMAAAAOAAEAAAAKAAQAAAAOAAEAAAALAAQAAAAOAAEAAAALAAMAAAAOAAEAAAALAAIAAAAOAAEAAAALAAEAAAAOAAEAAAAKAAAAAAAOAAEAAAAJAAAAAAAOAAEAAAAIAAAAAAAOAAEAAAAHAAAAAAAOAAEAAAAGAAAAAAAOAAEAAAAFAAAAAAAOAAEAAAAEAAAAAAAOAAEAAAADAAAAAAAOAAEAAAACAAAAAAAOAAEAAAABAAAAAAAOAAEAAAAAAAEAAAAOAAEAAAAAAAIAAAAOAAEAAAAAAAMAAAAOAAEAAAAAAAQAAAAOAAEAAAAAAAUAAAAOAAEAAAAAAAYAAAAOAAEAAAAAAAcAAAAOAAEAAAAAAAgAAAAOAAEAAAAAAAkAAAAOAAEAAAABAAkAAAAOAAEAAAACAAkAAAAOAAEAAAADAAkAAAAOAAEAAAAEAAkAAAAOAAEAAAAFAAkAAAAOAAEAAAAGAAkAAAAOAAEAAAAHAAkAAAAOAAEAAAAIAAkAAAAOAAEAAAAJAAkAAAAOAAEAAAAKAAkAAAAOAAEAAAALAAkAAAAOAAEAAAAMAAkAAAAOAAEAAAANAAkAAAAOAAEAAAAOAAkAAAAOAAEAAAAPAAkAAAAOAAEAAAAQAAkAAAAOAAEAAAAQAAgAAAAOAAEAAAAQAAcAAAAOAAEAAAAQAAYAAAAOAAEAAAAQAAUAAAAOAAEAAAAQAAQAAAAOAAEAAAAQAAMAAAAOAAEAAAAQAAIAAAAOAAEAAAAQAAEAAAAOAAEAAAAQAAAAAAAOAAEAAAAPAAAAAAAOAAEAAAAOAAAAAAAOAAEAAAANAAAAAAAOAAEAAAAMAAAAAAAOAAEAAAALAAAAAAAOAAEAAAAPAAEAAAAOAAEAAAAOAAEAAAAOAAEAAAANAAEAAAAOAAEAAAAMAAEAAAAOAAEAAAAMAAIAAAAOAAEAAAANAAIAAAAOAAEAAAAOAAIAAAAOAAEAAAAPAAIAAAAOAAEAAAAMAAMAAAAOAAEAAAAMAAQAAAAOAAEAAAANAAQAAAAOAAEAAAAOAAQAAAAOAAEAAAAPAAQAAAAOAAEAAAAOAAUAAAAOAAEAAAANAAUAAAAOAAEAAAAMAAUAAAAOAAEAAAALAAUAAAAOAAEAAAAKAAYAAAAOAAEAAAAJAAYAAAAOAAEAAAAIAAcAAAAOAAEAAAAJAAcAAAAOAAEAAAAKAAcAAAAOAAEAAAALAAcAAAAOAAEAAAAMAAcAAAAOAAEAAAANAAYAAAAOAAEAAAAOAAYAAAAOAAEAAAAPAAYAAAAOAAEAAAAPAAcAAAAOAAEAAAAOAAgAAAAOAAEAAAAPAAgAAAAOAAEAAAAPAAUAAAAOAAEAAAAOAAMAAAAOAAEAAAAOAAcAAAAOAAEAAAAPAAMAAAAOAAEAAAAMAAYAAAAOAAEAAAALAAgAAAAOAAEAAAAMAAgAAAAOAAEAAAANAAcAAAAOAAEAAAANAAgAAAAOAAEAAAANAAMAAAAOAAEAAAAKAAUAAAAOAAEAAAAIAAgAAAAOAAEAAAAJAAgAAAAOAAEAAAALAAYAAAAOAAEAAAAKAAgAAAAOAAEAAAAHAAgAAAAOAAEAAAAGAAgAAAAOAAEAAAACAAgAAAAOAAEAAAABAAgAAAAOAAEAAAABAAcAAAAOAAEAAAABAAYAAAAOAAEAAAABAAUAAAAOAAEAAAACAAUAAAAOAAEAAAACAAYAAAAOAAEAAAADAAYAAAAOAAEAAAAEAAYAAAAOAAEAAAAFAAYAAAAOAAEAAAAGAAYAAAAOAAEAAAAHAAYAAAAOAAEAAAAIAAYAAAAOAAEAAAAFAAUAAAAOAAEAAAAGAAUAAAAOAAEAAAAHAAUAAAAOAAEAAAAIAAUAAAAOAAEAAAAJAAUAAAAOAAEAAAAEAAUAAAAOAAEAAAADAAUAAAAOAAEAAAADAAcAAAAOAAEAAAACAAcAAAAOAAEAAAAEAAcAAAAOAAEAAAAFAAcAAAAOAAEAAAAGAAcAAAAOAAEAAAAHAAcAAAAOAAEAAAAFAAgAAAAOAAEAAAAEAAgAAAAOAAEAAAADAAgAAAAOAAEAAAARAP//AAABAAQAAAARAAoAAAABAAUAAAD//woAAAAAAAUAAAD/////AAAAAAQAAAAAAP//AAACAAQAAAABAP//AAACAAQAAAACAP//AAACAAQAAAADAP//AAACAAQAAAAEAP//AAACAAQAAAAFAP//AAACAAQAAAAGAP//AAACAAQAAAAHAP//AAACAAQAAAAIAP//AAACAAQAAAAJAP//AAACAAQAAAAKAP//AAACAAQAAAALAP//AAACAAQAAAAMAP//AAACAAQAAAANAP//AAACAAQAAAAOAP//AAACAAQAAAAPAP//AAACAAQAAAAQAP//AAACAAQAAAARAAAAAAACAAUAAAARAAEAAAACAAUAAAARAAIAAAACAAUAAAARAAMAAAACAAUAAAARAAQAAAACAAUAAAARAAUAAAACAAUAAAARAAYAAAACAAUAAAARAAcAAAACAAUAAAARAAgAAAACAAUAAAARAAkAAAACAAUAAAAQAAoAAAACAAQAAAAPAAoAAAACAAQAAAAOAAoAAAACAAQAAAANAAoAAAACAAQAAAAMAAoAAAACAAQAAAALAAoAAAACAAQAAAAKAAoAAAACAAQAAAAJAAoAAAAGAAUAAAAIAAoAAAAFAAAAAAAHAAoAAAAFAAAAAAAGAAoAAAAFAAQAAAAFAAoAAAACAAQAAAAEAAoAAAACAAQAAAADAAoAAAACAAQAAAACAAoAAAACAAQAAAABAAoAAAACAAQAAAAAAAoAAAACAAQAAAD//wkAAAACAAUAAAD//wAAAAACAAUAAAD//wEAAAACAAUAAAD//wIAAAACAAUAAAD//wMAAAACAAUAAAD//wQAAAACAAUAAAD//wUAAAACAAUAAAD//wYAAAACAAUAAAD//wcAAAACAAUAAAD//wgAAAACAAUAAAAHAAsAAAAFAAAAAAAIAAsAAAAFAAAAAAAHAAwAAAAFAAAAAAAIAAwAAAAFAAAAAAAHAA0AAAAFAAAAAAAIAA0AAAAFAAAAAAAAAAAAAAAOAAEAAAA=")
|
||||
tile_set = ExtResource("1_qel1r")
|
||||
collision_visibility_mode = 1
|
||||
navigation_visibility_mode = 1
|
||||
|
||||
[node name="TileMapLayer2" type="TileMapLayer" parent="NavigationRegion2D"]
|
||||
tile_map_data = PackedByteArray("AAAEAAEAAAASAAwAAAAFAAEAAAATAAwAAAAGAAEAAAATAAwAAAAHAAEAAAATAAwAAAAIAAEAAAATAAwAAAAJAAEAAAATAAwAAAAKAAEAAAATAAwAAAALAAEAAAAUAAwAAAANAAAAAAAKABEAAAAOAAAAAAAKABEAAAAPAAAAAAAKABEAAAAQAAAAAAAKABEAAAA=")
|
||||
tile_set = ExtResource("1_qel1r")
|
||||
|
||||
[node name="CharacterBody2D" type="CharacterBody2D" parent="."]
|
||||
position = Vector2(241, 364)
|
||||
script = ExtResource("2_5n4iw")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="CharacterBody2D"]
|
||||
scale = Vector2(0.5, 0.5)
|
||||
texture = ExtResource("2_w7eqs")
|
||||
|
||||
[node name="NavigationAgent2D" type="NavigationAgent2D" parent="CharacterBody2D"]
|
||||
path_desired_distance = 30.0
|
||||
avoidance_enabled = true
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="CharacterBody2D"]
|
||||
shape = SubResource("CircleShape2D_5n4iw")
|
||||
|
||||
[node name="Receptionist" type="CharacterBody2D" parent="."]
|
||||
modulate = Color(1.7602391, 1.7602391, 1.7602391, 1)
|
||||
position = Vector2(518, 32)
|
||||
script = ExtResource("4_g7jyq")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="Receptionist"]
|
||||
modulate = Color(0, 1, 0, 1)
|
||||
scale = Vector2(0.5, 0.5)
|
||||
texture = ExtResource("2_w7eqs")
|
||||
|
||||
[node name="NavigationAgent2D" type="NavigationAgent2D" parent="Receptionist"]
|
||||
path_desired_distance = 30.0
|
||||
avoidance_enabled = true
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Receptionist"]
|
||||
shape = SubResource("CircleShape2D_5n4iw")
|
||||
|
||||
[node name="Queue" type="Node2D" parent="Receptionist"]
|
||||
position = Vector2(-6, 133)
|
||||
script = ExtResource("5_13vc8")
|
||||
|
||||
[node name="StateMachine" type="Node" parent="Receptionist"]
|
||||
script = ExtResource("6_13vc8")
|
||||
|
||||
[node name="Wait" type="Node" parent="Receptionist/StateMachine"]
|
||||
script = ExtResource("8_bog1h")
|
||||
wait_duration = 3.0
|
||||
|
||||
[node name="Advance Queue" type="Node" parent="Receptionist/StateMachine"]
|
||||
script = ExtResource("7_hph4e")
|
||||
|
||||
[node name="SpeechBubble" type="Sprite2D" parent="Receptionist"]
|
||||
position = Vector2(39, -42)
|
||||
texture = ExtResource("4_2wofw")
|
||||
script = ExtResource("10_50x1e")
|
||||
|
||||
[node name="Sprite2D3" type="Sprite2D" parent="Receptionist/SpeechBubble"]
|
||||
texture = ExtResource("11_50x1e")
|
||||
hframes = 8
|
||||
vframes = 8
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="Receptionist/SpeechBubble"]
|
||||
libraries = {
|
||||
&"": SubResource("AnimationLibrary_uo85v")
|
||||
}
|
||||
|
||||
5
hero_icon.gd
Normal file
5
hero_icon.gd
Normal file
@@ -0,0 +1,5 @@
|
||||
class_name HeroIcon extends Sprite2D
|
||||
|
||||
|
||||
func move(pos : Vector2) -> void:
|
||||
pass
|
||||
1
hero_icon.gd.uid
Normal file
1
hero_icon.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://cxqkvnv4rwots
|
||||
@@ -1,12 +0,0 @@
|
||||
extends Control
|
||||
|
||||
|
||||
signal value_changed(value : float)
|
||||
var min_value
|
||||
var max_value
|
||||
var step
|
||||
var page
|
||||
var value
|
||||
var exp_edit
|
||||
var rounded
|
||||
var allow_greater
|
||||
@@ -1,165 +0,0 @@
|
||||
[gd_scene load_steps=15 format=3 uid="uid://cm8jwfg6rnnor"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://vt3yvxm2ho7o" path="res://progress-fill.png" id="2_61u8r"]
|
||||
[ext_resource type="Texture2D" uid="uid://b88n81qde4p3n" path="res://progress-bar.png" id="3_7p536"]
|
||||
[ext_resource type="Texture2D" uid="uid://c6ptvokr5npl7" path="res://progress-marks.png" id="4_6vk2f"]
|
||||
[ext_resource type="Texture2D" uid="uid://bcrg5ea4niu0e" path="res://progress-dot-fill.png" id="5_dxgqf"]
|
||||
[ext_resource type="Texture2D" uid="uid://qxx2gxnsd3yg" path="res://hero.png" id="5_jas03"]
|
||||
[ext_resource type="Texture2D" uid="uid://dotwwulusn1b1" path="res://speechbubble.png" id="6_61u8r"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_8wucn"]
|
||||
atlas = ExtResource("4_6vk2f")
|
||||
region = Rect2(0, 32, 32, 32)
|
||||
filter_clip = true
|
||||
|
||||
[sub_resource type="CompressedTexture2D" id="CompressedTexture2D_mf4ya"]
|
||||
load_path = "res://.godot/imported/progress-dot-fill.png-a1e94128dc6c2f11bfa15c335ef05892.ctex"
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_eu8pt"]
|
||||
resource_local_to_scene = true
|
||||
atlas = SubResource("CompressedTexture2D_mf4ya")
|
||||
region = Rect2(0, 32, 32, 32)
|
||||
filter_clip = true
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_pg7md"]
|
||||
atlas = ExtResource("4_6vk2f")
|
||||
region = Rect2(32, 32, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_nyilg"]
|
||||
atlas = ExtResource("4_6vk2f")
|
||||
region = Rect2(32, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_g6crn"]
|
||||
atlas = ExtResource("5_dxgqf")
|
||||
region = Rect2(0, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_bnohr"]
|
||||
resource_local_to_scene = true
|
||||
atlas = SubResource("CompressedTexture2D_mf4ya")
|
||||
region = Rect2(32, 0, 32, 32)
|
||||
filter_clip = true
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_mmi8n"]
|
||||
atlas = ExtResource("4_6vk2f")
|
||||
region = Rect2(32, 0, 32, 32)
|
||||
filter_clip = true
|
||||
|
||||
[node name="HeroProgressBar" type="TextureProgressBar"]
|
||||
offset_right = 213.0
|
||||
offset_bottom = 14.0
|
||||
nine_patch_stretch = true
|
||||
stretch_margin_left = 1
|
||||
stretch_margin_top = 2
|
||||
stretch_margin_right = 1
|
||||
stretch_margin_bottom = 2
|
||||
texture_under = ExtResource("2_61u8r")
|
||||
texture_over = ExtResource("3_7p536")
|
||||
texture_progress = ExtResource("2_61u8r")
|
||||
tint_under = Color(0, 0, 0, 1)
|
||||
tint_progress = Color(1, 1, 0, 1)
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = -21.0
|
||||
offset_top = -9.0
|
||||
offset_right = 11.0
|
||||
offset_bottom = 23.0
|
||||
texture = SubResource("AtlasTexture_8wucn")
|
||||
|
||||
[node name="TextureRect4" type="TextureRect" parent="."]
|
||||
self_modulate = Color(0, 0, 0, 1)
|
||||
layout_mode = 0
|
||||
offset_left = -21.0
|
||||
offset_top = -9.0
|
||||
offset_right = 11.0
|
||||
offset_bottom = 23.0
|
||||
texture = SubResource("AtlasTexture_eu8pt")
|
||||
|
||||
[node name="TextureRect8" type="TextureRect" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = -21.0
|
||||
offset_top = -9.0
|
||||
offset_right = 11.0
|
||||
offset_bottom = 23.0
|
||||
texture = SubResource("AtlasTexture_pg7md")
|
||||
|
||||
[node name="TextureRect6" type="TextureRect" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 96.0
|
||||
offset_top = -9.0
|
||||
offset_right = 128.0
|
||||
offset_bottom = 23.0
|
||||
texture = SubResource("AtlasTexture_nyilg")
|
||||
|
||||
[node name="TextureRect7" type="TextureRect" parent="."]
|
||||
modulate = Color(0, 0, 0, 1)
|
||||
layout_mode = 0
|
||||
offset_left = 96.0
|
||||
offset_top = -9.0
|
||||
offset_right = 128.0
|
||||
offset_bottom = 23.0
|
||||
texture = SubResource("AtlasTexture_g6crn")
|
||||
|
||||
[node name="TextureRect5" type="TextureRect" parent="."]
|
||||
self_modulate = Color(0, 0, 0, 1)
|
||||
layout_mode = 0
|
||||
offset_left = 213.0
|
||||
offset_top = -9.0
|
||||
offset_right = 245.0
|
||||
offset_bottom = 23.0
|
||||
texture = SubResource("AtlasTexture_bnohr")
|
||||
|
||||
[node name="TextureRect3" type="TextureRect" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 213.0
|
||||
offset_top = -9.0
|
||||
offset_right = 245.0
|
||||
offset_bottom = 23.0
|
||||
texture = SubResource("AtlasTexture_mmi8n")
|
||||
|
||||
[node name="Icon" type="Sprite2D" parent="."]
|
||||
position = Vector2(-5, -12)
|
||||
texture = ExtResource("5_jas03")
|
||||
|
||||
[node name="NinePatchRect" type="NinePatchRect" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = -5.0
|
||||
offset_top = -44.0
|
||||
offset_right = 69.0
|
||||
offset_bottom = -24.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
texture = ExtResource("6_61u8r")
|
||||
patch_margin_left = 13
|
||||
patch_margin_top = 5
|
||||
patch_margin_right = 6
|
||||
patch_margin_bottom = 10
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="NinePatchRect"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 2
|
||||
anchor_top = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = 5.0
|
||||
offset_top = -22.0
|
||||
offset_right = 81.0
|
||||
offset_bottom = -2.0
|
||||
grow_vertical = 0
|
||||
theme_override_constants/margin_left = 0
|
||||
theme_override_constants/margin_top = 0
|
||||
theme_override_constants/margin_right = 0
|
||||
theme_override_constants/margin_bottom = 0
|
||||
|
||||
[node name="Label" type="Label" parent="NinePatchRect/MarginContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/line_spacing = -4
|
||||
theme_override_font_sizes/font_size = 8
|
||||
text = "I killed a dragon!"
|
||||
autowrap_mode = 2
|
||||
|
||||
[node name="Container" type="Container" parent="."]
|
||||
layout_mode = 0
|
||||
offset_top = -32.0
|
||||
offset_right = 75.0
|
||||
offset_bottom = 40.0
|
||||
1
interactable.gd
Normal file
1
interactable.gd
Normal file
@@ -0,0 +1 @@
|
||||
class_name Interactable extends StaticBody2D
|
||||
1
interactable.gd.uid
Normal file
1
interactable.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dek37dgkvktjb
|
||||
@@ -1,12 +1,42 @@
|
||||
extends PanelContainer
|
||||
class_name GamePanel extends PanelContainer
|
||||
|
||||
|
||||
const quest_progress_bar_template = preload("res://quest_progress_bar.tscn")
|
||||
|
||||
signal time_changed(time : float)
|
||||
|
||||
@onready var timer : Timer = $Timer
|
||||
|
||||
func _ready() -> void:
|
||||
$Pass
|
||||
Game.panel = self
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
time_changed.emit(timer.time_left)
|
||||
|
||||
func add_quest_progress_bar(quest : Quest) -> void:
|
||||
var qpb : QuestProgressBar = quest_progress_bar_template.instantiate()
|
||||
qpb.setup(quest)
|
||||
%QuestProgressList/VBoxContainer.add_child(qpb)
|
||||
#TODO: Change the hero portrait to match
|
||||
if quest.steps > 1:
|
||||
for i in range(quest.steps-1):
|
||||
qpb.add_waypoint(float(i) / quest.steps, quest.step_messages[i])
|
||||
|
||||
|
||||
func switch_panel(active : bool) -> void:
|
||||
%Active.visible = active
|
||||
%Passive.visible = !active
|
||||
|
||||
|
||||
func _on_end_shift_pressed() -> void:
|
||||
Game.confirm_end_shift()
|
||||
|
||||
func _on_visitor_spawned(remaining : int, total : int) -> void:
|
||||
update_visitor_count(total - remaining, total)
|
||||
|
||||
func connect_visitor_spawner(spawner : VisitorSpawner) -> void:
|
||||
spawner.visitor_spawned.connect(_on_visitor_spawned)
|
||||
update_visitor_count(spawner.total_visitors - spawner.visitors_remaining, spawner.total_visitors)
|
||||
|
||||
func update_visitor_count(current : int, total : int) -> void:
|
||||
%Passive/VisitorsLabel.text = "Visitors: %d/%d" % [current, total]
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
[ext_resource type="Script" uid="uid://dhw85vqlvw33s" path="res://main_panel.gd" id="1_pdekv"]
|
||||
[ext_resource type="Script" uid="uid://4jrp67ckp7vt" path="res://timer_label.gd" id="2_5rs2c"]
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer"]
|
||||
[node name="MainPanel" type="PanelContainer"]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_right = -573.0
|
||||
offset_bottom = -257.0
|
||||
offset_right = -870.0
|
||||
offset_bottom = -526.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_pdekv")
|
||||
@@ -25,40 +25,67 @@ theme_override_constants/margin_right = 20
|
||||
theme_override_constants/margin_bottom = 20
|
||||
|
||||
[node name="Passive" type="VBoxContainer" parent="MarginContainer"]
|
||||
visible = false
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="MarginContainer/Passive"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 50
|
||||
theme_override_font_sizes/font_size = 28
|
||||
text = "Time til Next Shift"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="TimerLabel" type="Label" parent="MarginContainer/Passive"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 100
|
||||
theme_override_font_sizes/font_size = 28
|
||||
text = "000:00:00.00"
|
||||
script = ExtResource("2_5rs2c")
|
||||
|
||||
[node name="VisitorsLabel" type="Label" parent="MarginContainer/Passive"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 28
|
||||
text = "000:00:00.00"
|
||||
script = ExtResource("2_5rs2c")
|
||||
|
||||
[node name="QuestProgressList" type="ScrollContainer" parent="MarginContainer/Passive"]
|
||||
unique_name_in_owner = true
|
||||
clip_contents = false
|
||||
custom_minimum_size = Vector2(260, 100)
|
||||
layout_mode = 2
|
||||
horizontal_scroll_mode = 0
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/Passive/QuestProgressList"]
|
||||
custom_minimum_size = Vector2(300, 100)
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Active" type="VBoxContainer" parent="MarginContainer"]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="MarginContainer/Active"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 50
|
||||
theme_override_font_sizes/font_size = 28
|
||||
text = "Time til Next Shift"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="TimerLabel" type="Label" parent="MarginContainer/Active"]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 100
|
||||
theme_override_font_sizes/font_size = 28
|
||||
text = "00:00:00.00"
|
||||
horizontal_alignment = 1
|
||||
script = ExtResource("2_5rs2c")
|
||||
|
||||
[node name="Label3" type="Label" parent="MarginContainer/Active"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 100
|
||||
theme_override_font_sizes/font_size = 28
|
||||
text = "00:00:00.00"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="Button" type="Button" parent="MarginContainer/Active"]
|
||||
layout_mode = 2
|
||||
text = "END SHIFT"
|
||||
|
||||
[connection signal="time_changed" from="." to="MarginContainer/Passive/TimerLabel" method="_on_time_changed"]
|
||||
[connection signal="time_changed" from="." to="MarginContainer/Active/TimerLabel" method="_on_time_changed"]
|
||||
[connection signal="pressed" from="MarginContainer/Active/Button" to="." method="_on_end_shift_pressed"]
|
||||
|
||||
BIN
notice-icon.png
Normal file
BIN
notice-icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 802 B |
40
notice-icon.png.import
Normal file
40
notice-icon.png.import
Normal file
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://b7yco5065s41n"
|
||||
path="res://.godot/imported/notice-icon.png-e62659f692815b5b1a43780c11b957b5.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://notice-icon.png"
|
||||
dest_files=["res://.godot/imported/notice-icon.png-e62659f692815b5b1a43780c11b957b5.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
|
||||
25
notice_panel.tscn
Normal file
25
notice_panel.tscn
Normal file
@@ -0,0 +1,25 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://b3lle4eammcwp"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://b7yco5065s41n" path="res://notice-icon.png" id="1_1reoo"]
|
||||
|
||||
[node name="NoticePanel" type="PanelContainer"]
|
||||
offset_right = 321.0
|
||||
offset_bottom = 32.0
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="HBoxContainer"]
|
||||
custom_minimum_size = Vector2(32, 32)
|
||||
layout_mode = 2
|
||||
texture = ExtResource("1_1reoo")
|
||||
expand_mode = 1
|
||||
stretch_mode = 4
|
||||
|
||||
[node name="Label" type="Label" parent="HBoxContainer"]
|
||||
custom_minimum_size = Vector2(300, 24)
|
||||
layout_mode = 2
|
||||
text = "Rania has joined the guild!"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
autowrap_mode = 2
|
||||
66
player.gd
Normal file
66
player.gd
Normal file
@@ -0,0 +1,66 @@
|
||||
class_name Player extends CharacterBody2D
|
||||
|
||||
@onready var movement_speed : float = 400.0
|
||||
@onready var movement_target_position : Vector2 = global_position
|
||||
@onready var nav_agent : NavigationAgent2D = $NavigationAgent2D
|
||||
|
||||
var interaction_target = null
|
||||
@export var interaction_range : float = 75
|
||||
@export var stop_range : float = 25
|
||||
func _ready() -> void:
|
||||
Game.player = self
|
||||
setup.call_deferred()
|
||||
|
||||
|
||||
func setup():
|
||||
await get_tree().physics_frame
|
||||
set_movement_target(movement_target_position)
|
||||
|
||||
|
||||
func set_movement_target(target : Vector2) -> void:
|
||||
nav_agent.target_position = target
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
|
||||
if nav_agent.is_navigation_finished():
|
||||
if interaction_target:
|
||||
try_interact(interaction_target)
|
||||
#If they have an interaction target within range
|
||||
#clear the target
|
||||
#try_interact
|
||||
return
|
||||
|
||||
var curr_pos: Vector2 = global_position
|
||||
var next_path_pos: Vector2 = nav_agent.get_next_path_position()
|
||||
|
||||
velocity = curr_pos.direction_to(next_path_pos) * movement_speed
|
||||
|
||||
move_and_slide()
|
||||
|
||||
func _unhandled_input(event: InputEvent) -> void:
|
||||
var evt : InputEventMouseButton = event as InputEventMouseButton
|
||||
if evt and evt.pressed:
|
||||
approach(evt.global_position)
|
||||
nav_agent.target_desired_distance = stop_range
|
||||
interaction_target = null
|
||||
|
||||
func approach(pos : Vector2) -> void:
|
||||
var rid = get_world_2d().get_navigation_map()
|
||||
var point : Vector2 = NavigationServer2D.map_get_closest_point(rid, pos)
|
||||
set_movement_target(point)
|
||||
|
||||
func approach_and_interact(obj : Interactable) -> void:
|
||||
set_movement_target(obj.global_position)
|
||||
nav_agent.target_desired_distance = interaction_range - 5
|
||||
interaction_target = obj
|
||||
|
||||
func try_interact(obj : Interactable) -> void:
|
||||
var df = obj.global_position - global_position
|
||||
if df.length() > interaction_range:
|
||||
approach_and_interact(obj)
|
||||
else:
|
||||
interact(obj)
|
||||
interaction_target = null
|
||||
|
||||
func interact(obj : Interactable) -> void:
|
||||
obj.interact(self)
|
||||
1
player.gd.uid
Normal file
1
player.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dolqtw1ye4ras
|
||||
@@ -14,10 +14,30 @@ config/name="pomchronicles"
|
||||
config/features=PackedStringArray("4.5", "Forward Plus")
|
||||
config/icon="res://icon.svg"
|
||||
|
||||
[autoload]
|
||||
|
||||
Guild="*res://guild.gd"
|
||||
Game="*res://game_manager.gd"
|
||||
|
||||
[display]
|
||||
|
||||
window/size/viewport_width=1920
|
||||
window/size/viewport_height=1080
|
||||
window/size/resizable=false
|
||||
window/stretch/mode="canvas_items"
|
||||
|
||||
[dotnet]
|
||||
|
||||
project/assembly_name="pomchronicles"
|
||||
|
||||
[input]
|
||||
|
||||
"switch modes"={
|
||||
"deadzone": 0.2,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194332,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
|
||||
[rendering]
|
||||
|
||||
textures/canvas_textures/default_texture_filter=0
|
||||
|
||||
26
quest.gd
Normal file
26
quest.gd
Normal file
@@ -0,0 +1,26 @@
|
||||
class_name Quest extends Object
|
||||
|
||||
|
||||
|
||||
|
||||
var name : String = "A Basic Quest"
|
||||
var desc : String = "The default quest, with no special anything."
|
||||
var difficulty : int = 1
|
||||
var steps : int = 1
|
||||
var step_outcomes : Array = [
|
||||
{"pass":"I succeeded!", "fail":"I failed!"}
|
||||
]
|
||||
|
||||
|
||||
|
||||
var progress : float = 0
|
||||
var current_step : int = 0
|
||||
var taken : bool = false
|
||||
|
||||
var questor : AdventurerData = null
|
||||
var entry : QuestLogEntry = null
|
||||
|
||||
func initiate(member : AdventurerData) -> void:
|
||||
questor = member
|
||||
taken = true
|
||||
entry.update()
|
||||
1
quest.gd.uid
Normal file
1
quest.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bowt76gfx40pv
|
||||
17
quest_board.gd
Normal file
17
quest_board.gd
Normal file
@@ -0,0 +1,17 @@
|
||||
extends Interactable
|
||||
|
||||
@onready var polygon : CollisionPolygon2D = $CollisionPolygon2D
|
||||
@onready var window : QuestBoardWindow = $QuestBoardWindow
|
||||
|
||||
func _input(event : InputEvent) -> void:
|
||||
var evt : InputEventMouseButton = event as InputEventMouseButton
|
||||
if evt and evt.button_index == MOUSE_BUTTON_LEFT and evt.pressed:
|
||||
if Geometry2D.is_point_in_polygon(evt.position - polygon.global_position, polygon.polygon):
|
||||
Game.player.try_interact(self)
|
||||
get_viewport().set_input_as_handled()
|
||||
|
||||
|
||||
func interact(interactor, type : String = "") -> void:
|
||||
if interactor is Player:
|
||||
window.populate(Guild.quests.keys())
|
||||
window.popup_centered()
|
||||
1
quest_board.gd.uid
Normal file
1
quest_board.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://blo7tb5135vfm
|
||||
19
quest_board_entry.gd
Normal file
19
quest_board_entry.gd
Normal file
@@ -0,0 +1,19 @@
|
||||
class_name QuestBoardEntry extends TextureButton
|
||||
|
||||
var quest : Quest = null
|
||||
@onready var icon : TextureRect = %Icon
|
||||
@onready var name_label : Label = %NameLabel
|
||||
@onready var status_label : Label = %StatusLabel
|
||||
|
||||
func setup(quest : Quest) -> void:
|
||||
self.quest = quest
|
||||
name_label.text = quest.name
|
||||
status_label.text = "Available" if !quest.taken else "Unavailable"
|
||||
|
||||
func update() -> void:
|
||||
status_label.text = "Available" if !quest.taken else "Unavailable"
|
||||
|
||||
|
||||
func _on_pressed() -> void:
|
||||
if pressed:
|
||||
Guild.assign_quest(player.member, quest)
|
||||
1
quest_board_entry.gd.uid
Normal file
1
quest_board_entry.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://hsks1qah12sh
|
||||
37
quest_board_entry.tscn
Normal file
37
quest_board_entry.tscn
Normal file
@@ -0,0 +1,37 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://bdbnxj1au1iir"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://hsks1qah12sh" path="res://quest_board_entry.gd" id="1_qfdrh"]
|
||||
[ext_resource type="Texture2D" uid="uid://bldpiytpdrge6" path="res://icon.svg" id="2_ovx2i"]
|
||||
|
||||
[node name="QuestBoardEntry" type="TextureButton"]
|
||||
custom_minimum_size = Vector2(200, 50)
|
||||
offset_right = 200.0
|
||||
offset_bottom = 50.0
|
||||
script = ExtResource("1_qfdrh")
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="."]
|
||||
layout_mode = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
|
||||
[node name="Icon" type="TextureRect" parent="HBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(50, 50)
|
||||
layout_mode = 2
|
||||
texture = ExtResource("2_ovx2i")
|
||||
expand_mode = 1
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="HBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="NameLabel" type="Label" parent="HBoxContainer/VBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "Quest Name"
|
||||
|
||||
[node name="StatusLabel" type="Label" parent="HBoxContainer/VBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "Quest Status"
|
||||
|
||||
[connection signal="pressed" from="." to="." method="_on_pressed"]
|
||||
24
quest_board_window.gd
Normal file
24
quest_board_window.gd
Normal file
@@ -0,0 +1,24 @@
|
||||
class_name QuestBoardWindow extends Window
|
||||
|
||||
const entry_template = preload("res://quest_log_entry.tscn")
|
||||
|
||||
@onready var entry_list : VBoxContainer = %Entries
|
||||
var entries : Array[QuestLogEntry] = []
|
||||
|
||||
func populate(quests : Array[Quest]) -> void:
|
||||
for entry in entries:
|
||||
entry.queue_free()
|
||||
entries.clear()
|
||||
for quest in quests:
|
||||
if !quest.taken:
|
||||
add_entry(quest)
|
||||
|
||||
func add_entry(quest : Quest) -> void:
|
||||
var qle : QuestLogEntry = entry_template.instantiate()
|
||||
entries.append(qle)
|
||||
entry_list.add_child(qle)
|
||||
qle.setup(quest)
|
||||
|
||||
|
||||
func _on_close_requested() -> void:
|
||||
hide()
|
||||
1
quest_board_window.gd.uid
Normal file
1
quest_board_window.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://de4lnikqqk7b4
|
||||
31
quest_board_window.tscn
Normal file
31
quest_board_window.tscn
Normal file
@@ -0,0 +1,31 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://drrtypncppjps"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://de4lnikqqk7b4" path="res://quest_board_window.gd" id="1_0tsne"]
|
||||
|
||||
[node name="QuestBoardWindow" type="Window"]
|
||||
oversampling_override = 1.0
|
||||
title = "Quest Board"
|
||||
size = Vector2i(231, 282)
|
||||
popup_window = true
|
||||
script = ExtResource("1_0tsne")
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="."]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme_override_constants/margin_left = 5
|
||||
theme_override_constants/margin_top = 5
|
||||
theme_override_constants/margin_right = 5
|
||||
theme_override_constants/margin_bottom = 5
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="MarginContainer"]
|
||||
custom_minimum_size = Vector2(205, 215)
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Entries" type="VBoxContainer" parent="MarginContainer/ScrollContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
|
||||
[connection signal="close_requested" from="." to="." method="_on_close_requested"]
|
||||
16
quest_log.gd
Normal file
16
quest_log.gd
Normal file
@@ -0,0 +1,16 @@
|
||||
class_name QuestLog extends Control
|
||||
|
||||
const entry_template = preload("res://quest_log_entry.tscn")
|
||||
|
||||
@onready var entry_list : VBoxContainer = %Entries
|
||||
var entries : Array[QuestLogEntry] = []
|
||||
|
||||
func _ready() -> void:
|
||||
Game.quest_log = self
|
||||
|
||||
func add_entry(quest : Quest) -> void:
|
||||
var qle : QuestLogEntry = entry_template.instantiate()
|
||||
quest.entry = qle
|
||||
entries.append(qle)
|
||||
entry_list.add_child(qle)
|
||||
qle.setup(quest)
|
||||
1
quest_log.gd.uid
Normal file
1
quest_log.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://opy1kwcgsh70
|
||||
28
quest_log.tscn
Normal file
28
quest_log.tscn
Normal file
@@ -0,0 +1,28 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://dly7in8ql1fn4"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://opy1kwcgsh70" path="res://quest_log.gd" id="1_fbxfu"]
|
||||
|
||||
[node name="Quest Log" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
script = ExtResource("1_fbxfu")
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="."]
|
||||
layout_mode = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="PanelContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/margin_left = 5
|
||||
theme_override_constants/margin_top = 5
|
||||
theme_override_constants/margin_right = 5
|
||||
theme_override_constants/margin_bottom = 5
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="PanelContainer/MarginContainer"]
|
||||
custom_minimum_size = Vector2(205, 215)
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Entries" type="VBoxContainer" parent="PanelContainer/MarginContainer/ScrollContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
14
quest_log_entry.gd
Normal file
14
quest_log_entry.gd
Normal file
@@ -0,0 +1,14 @@
|
||||
class_name QuestLogEntry extends Panel
|
||||
|
||||
var quest : Quest = null
|
||||
@onready var icon : TextureRect = %Icon
|
||||
@onready var name_label : Label = %NameLabel
|
||||
@onready var status_label : Label = %StatusLabel
|
||||
|
||||
func setup(quest : Quest) -> void:
|
||||
self.quest = quest
|
||||
name_label.text = quest.name
|
||||
status_label.text = "Available" if !quest.taken else "Unavailable"
|
||||
|
||||
func update() -> void:
|
||||
status_label.text = "Available" if !quest.taken else "Unavailable"
|
||||
1
quest_log_entry.gd.uid
Normal file
1
quest_log_entry.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dfn0507e4nccu
|
||||
33
quest_log_entry.tscn
Normal file
33
quest_log_entry.tscn
Normal file
@@ -0,0 +1,33 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://da0es74lcp66y"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dfn0507e4nccu" path="res://quest_log_entry.gd" id="1_0aavb"]
|
||||
[ext_resource type="Texture2D" uid="uid://bldpiytpdrge6" path="res://icon.svg" id="1_guj74"]
|
||||
|
||||
[node name="Quest Log Entry" type="Panel"]
|
||||
custom_minimum_size = Vector2(200, 50)
|
||||
script = ExtResource("1_0aavb")
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="."]
|
||||
layout_mode = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
|
||||
[node name="Icon" type="TextureRect" parent="HBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(50, 50)
|
||||
layout_mode = 2
|
||||
texture = ExtResource("1_guj74")
|
||||
expand_mode = 1
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="HBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="NameLabel" type="Label" parent="HBoxContainer/VBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "Quest Name"
|
||||
|
||||
[node name="StatusLabel" type="Label" parent="HBoxContainer/VBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "Quest Status"
|
||||
62
quest_progress_bar.gd
Normal file
62
quest_progress_bar.gd
Normal file
@@ -0,0 +1,62 @@
|
||||
class_name QuestProgressBar extends Control
|
||||
|
||||
const waypoint_template = preload("res://waypoint.tscn")
|
||||
var length : float
|
||||
var waypoints : Array = []
|
||||
@onready var hero_offset : Vector2 = %Hero.position
|
||||
@onready var hero : HeroIcon = %Hero
|
||||
@onready var startpoint : Endpoint = %Start
|
||||
@onready var endpoint : Endpoint = %End
|
||||
@onready var bar : TextureProgressBar = $ProgressBar
|
||||
var quest : Quest = null
|
||||
#signal value_changed(value : float)
|
||||
#var min_value
|
||||
#var max_value
|
||||
#var step
|
||||
#var page
|
||||
#var value
|
||||
#var exp_edit
|
||||
#var rounded
|
||||
#var allow_greater
|
||||
func _ready() -> void:
|
||||
length = size.x
|
||||
if quest:
|
||||
#Generate the waypoints
|
||||
generate_waypoints()
|
||||
#TODO: Change the hero's portrait
|
||||
bar.value = quest.progress
|
||||
hero.position = hero_offset + Vector2(length * bar.value / bar.max_value, 0)
|
||||
|
||||
func generate_waypoints():
|
||||
if len(waypoints) > 0:
|
||||
for wp in waypoints:
|
||||
wp.queue_free()
|
||||
waypoints = []
|
||||
|
||||
for i in range(1,quest.steps):
|
||||
var pct : float = i / float(quest.steps)
|
||||
add_waypoint( pct, quest.step_outcomes[i])
|
||||
|
||||
func add_waypoint(pct : float, msgs : Dictionary):
|
||||
var wp = waypoint_template.instantiate()
|
||||
waypoints.append(wp)
|
||||
wp.percent = pct
|
||||
%Waypoints.add_child(wp)
|
||||
wp.global_position = global_position + Vector2(pct * length - 16, -9)
|
||||
if bar.value / bar.max_value >= pct:
|
||||
wp.fill = true
|
||||
|
||||
func update_waypoints(value : float) -> void:
|
||||
startpoint.fill = (bar.value / bar.max_value >= startpoint.percent)
|
||||
for wp : Waypoint in waypoints:
|
||||
wp.fill = (bar.value / bar.max_value >= wp.percent)
|
||||
endpoint.fill = (bar.value / bar.max_value >= endpoint.percent)
|
||||
|
||||
func setup(quest : Quest) -> void:
|
||||
self.quest = quest
|
||||
|
||||
|
||||
|
||||
func _on_value_changed(value : float) -> void:
|
||||
hero.position = hero_offset + Vector2(length * bar.value / bar.max_value, 0)
|
||||
update_waypoints(value)
|
||||
194
quest_progress_bar.tscn
Normal file
194
quest_progress_bar.tscn
Normal file
@@ -0,0 +1,194 @@
|
||||
[gd_scene load_steps=16 format=3 uid="uid://cm8jwfg6rnnor"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://vt3yvxm2ho7o" path="res://progress-fill.png" id="1_67v7s"]
|
||||
[ext_resource type="Texture2D" uid="uid://b88n81qde4p3n" path="res://progress-bar.png" id="2_7mk3y"]
|
||||
[ext_resource type="Script" uid="uid://cgi3tu0ussfk0" path="res://quest_progress_bar.gd" id="3_ngyoy"]
|
||||
[ext_resource type="Script" uid="uid://cf0pt0ty4uaas" path="res://endpoint.gd" id="4_urnrp"]
|
||||
[ext_resource type="Texture2D" uid="uid://c6ptvokr5npl7" path="res://progress-marks.png" id="5_0mjs1"]
|
||||
[ext_resource type="Texture2D" uid="uid://qxx2gxnsd3yg" path="res://hero.png" id="6_c61hf"]
|
||||
[ext_resource type="Script" uid="uid://cxqkvnv4rwots" path="res://hero_icon.gd" id="7_ej80i"]
|
||||
[ext_resource type="Texture2D" uid="uid://dotwwulusn1b1" path="res://speechbubble.png" id="8_0hkgs"]
|
||||
[ext_resource type="Script" uid="uid://c23pbcmig5v3s" path="res://update_bubble.gd" id="9_1vrqv"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_8wucn"]
|
||||
atlas = ExtResource("5_0mjs1")
|
||||
region = Rect2(0, 32, 32, 32)
|
||||
filter_clip = true
|
||||
|
||||
[sub_resource type="CompressedTexture2D" id="CompressedTexture2D_mf4ya"]
|
||||
load_path = "res://.godot/imported/progress-dot-fill.png-a1e94128dc6c2f11bfa15c335ef05892.ctex"
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_eu8pt"]
|
||||
resource_local_to_scene = true
|
||||
atlas = SubResource("CompressedTexture2D_mf4ya")
|
||||
region = Rect2(0, 32, 32, 32)
|
||||
filter_clip = true
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_pg7md"]
|
||||
atlas = ExtResource("5_0mjs1")
|
||||
region = Rect2(32, 32, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_bnohr"]
|
||||
resource_local_to_scene = true
|
||||
atlas = SubResource("CompressedTexture2D_mf4ya")
|
||||
region = Rect2(32, 0, 32, 32)
|
||||
filter_clip = true
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_mmi8n"]
|
||||
atlas = ExtResource("5_0mjs1")
|
||||
region = Rect2(32, 0, 32, 32)
|
||||
filter_clip = true
|
||||
|
||||
[node name="QuestProgressBar" type="Control"]
|
||||
custom_minimum_size = Vector2(250, 70)
|
||||
layout_mode = 3
|
||||
anchors_preset = 5
|
||||
anchor_left = 0.5
|
||||
anchor_right = 0.5
|
||||
offset_left = -125.0
|
||||
offset_right = 125.0
|
||||
offset_bottom = 70.0
|
||||
grow_horizontal = 2
|
||||
script = ExtResource("3_ngyoy")
|
||||
|
||||
[node name="ProgressBar" type="TextureProgressBar" parent="."]
|
||||
custom_minimum_size = Vector2(213, 14)
|
||||
layout_mode = 0
|
||||
offset_left = 18.0
|
||||
offset_top = 37.0
|
||||
offset_right = 231.0
|
||||
offset_bottom = 51.0
|
||||
max_value = 1.0
|
||||
step = 0.010000000009313226
|
||||
nine_patch_stretch = true
|
||||
stretch_margin_left = 1
|
||||
stretch_margin_top = 2
|
||||
stretch_margin_right = 1
|
||||
stretch_margin_bottom = 2
|
||||
texture_under = ExtResource("1_67v7s")
|
||||
texture_over = ExtResource("2_7mk3y")
|
||||
texture_progress = ExtResource("1_67v7s")
|
||||
tint_under = Color(0, 0, 0, 1)
|
||||
tint_progress = Color(0.1804, 0.5451, 0.3412, 1)
|
||||
|
||||
[node name="Start" type="Control" parent="ProgressBar"]
|
||||
unique_name_in_owner = true
|
||||
anchors_preset = 0
|
||||
offset_left = -16.0
|
||||
offset_top = -9.0
|
||||
offset_right = 24.0
|
||||
offset_bottom = 31.0
|
||||
script = ExtResource("4_urnrp")
|
||||
|
||||
[node name="Over" type="TextureRect" parent="ProgressBar/Start"]
|
||||
layout_mode = 0
|
||||
offset_right = 32.0
|
||||
offset_bottom = 32.0
|
||||
texture = SubResource("AtlasTexture_8wucn")
|
||||
|
||||
[node name="Fill" type="TextureRect" parent="ProgressBar/Start"]
|
||||
modulate = Color(0, 0, 0, 1)
|
||||
layout_mode = 0
|
||||
offset_right = 32.0
|
||||
offset_bottom = 32.0
|
||||
texture = SubResource("AtlasTexture_eu8pt")
|
||||
|
||||
[node name="Dot" type="TextureRect" parent="ProgressBar/Start"]
|
||||
visible = false
|
||||
layout_mode = 0
|
||||
offset_right = 32.0
|
||||
offset_bottom = 32.0
|
||||
texture = SubResource("AtlasTexture_pg7md")
|
||||
|
||||
[node name="End" type="Control" parent="ProgressBar"]
|
||||
unique_name_in_owner = true
|
||||
anchors_preset = 0
|
||||
offset_left = 197.0
|
||||
offset_top = -9.0
|
||||
offset_right = 237.0
|
||||
offset_bottom = 31.0
|
||||
script = ExtResource("4_urnrp")
|
||||
percent = 1.0
|
||||
|
||||
[node name="Fill" type="TextureRect" parent="ProgressBar/End"]
|
||||
modulate = Color(0, 0, 0, 1)
|
||||
layout_mode = 0
|
||||
offset_right = 32.0
|
||||
offset_bottom = 32.0
|
||||
texture = SubResource("AtlasTexture_bnohr")
|
||||
|
||||
[node name="Over" type="TextureRect" parent="ProgressBar/End"]
|
||||
layout_mode = 0
|
||||
offset_right = 32.0
|
||||
offset_bottom = 32.0
|
||||
texture = SubResource("AtlasTexture_mmi8n")
|
||||
|
||||
[node name="Dot" type="TextureRect" parent="ProgressBar/End"]
|
||||
visible = false
|
||||
layout_mode = 0
|
||||
offset_right = 32.0
|
||||
offset_bottom = 32.0
|
||||
texture = SubResource("AtlasTexture_pg7md")
|
||||
|
||||
[node name="Waypoints" type="Control" parent="ProgressBar"]
|
||||
unique_name_in_owner = true
|
||||
anchors_preset = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
|
||||
[node name="Hero" type="Sprite2D" parent="ProgressBar"]
|
||||
unique_name_in_owner = true
|
||||
position = Vector2(-1, -12)
|
||||
texture = ExtResource("6_c61hf")
|
||||
script = ExtResource("7_ej80i")
|
||||
|
||||
[node name="UpdateBubble" type="NinePatchRect" parent="ProgressBar/Hero"]
|
||||
clip_contents = true
|
||||
anchors_preset = 3
|
||||
anchor_left = 1.0
|
||||
anchor_top = 1.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -61.0
|
||||
offset_top = -90.0
|
||||
offset_right = -42.0
|
||||
offset_bottom = -75.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
pivot_offset = Vector2(0, 15)
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
texture = ExtResource("8_0hkgs")
|
||||
patch_margin_left = 13
|
||||
patch_margin_top = 5
|
||||
patch_margin_right = 6
|
||||
patch_margin_bottom = 10
|
||||
axis_stretch_horizontal = 1
|
||||
axis_stretch_vertical = 1
|
||||
script = ExtResource("9_1vrqv")
|
||||
|
||||
[node name="Label" type="Label" parent="ProgressBar/Hero/UpdateBubble"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 0
|
||||
offset_left = 5.0
|
||||
offset_top = 1.0
|
||||
offset_right = 95.0
|
||||
offset_bottom = 37.0
|
||||
theme_override_colors/font_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/line_spacing = -4
|
||||
theme_override_font_sizes/font_size = 8
|
||||
text = "testing one 1 2 3"
|
||||
vertical_alignment = 1
|
||||
autowrap_mode = 2
|
||||
|
||||
[node name="Timer" type="Timer" parent="ProgressBar/Hero/UpdateBubble"]
|
||||
unique_name_in_owner = true
|
||||
|
||||
[node name="Container" type="Container" parent="ProgressBar"]
|
||||
layout_mode = 0
|
||||
offset_top = -32.0
|
||||
offset_right = 75.0
|
||||
offset_bottom = 40.0
|
||||
|
||||
[connection signal="value_changed" from="ProgressBar" to="ProgressBar" method="_on_value_changed"]
|
||||
[connection signal="timeout" from="ProgressBar/Hero/UpdateBubble/Timer" to="ProgressBar/Hero/UpdateBubble" method="_on_timer_timeout"]
|
||||
BIN
speech-blip.png
Normal file
BIN
speech-blip.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 305 B |
40
speech-blip.png.import
Normal file
40
speech-blip.png.import
Normal file
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cbamfadh7wwr7"
|
||||
path="res://.godot/imported/speech-blip.png-c50e3b0aba379b71502b51f1275b953c.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://speech-blip.png"
|
||||
dest_files=["res://.godot/imported/speech-blip.png-c50e3b0aba379b71502b51f1275b953c.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
|
||||
BIN
speech-emojis.png
Normal file
BIN
speech-emojis.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
40
speech-emojis.png.import
Normal file
40
speech-emojis.png.import
Normal file
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://chnk20ey5qxfh"
|
||||
path="res://.godot/imported/speech-emojis.png-ec187bee7f14b4adf4276f856bb01d86.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://speech-emojis.png"
|
||||
dest_files=["res://.godot/imported/speech-emojis.png-ec187bee7f14b4adf4276f856bb01d86.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
|
||||
BIN
speech-stuff.aseprite
Normal file
BIN
speech-stuff.aseprite
Normal file
Binary file not shown.
BIN
speech-talk.png
Normal file
BIN
speech-talk.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 480 B |
40
speech-talk.png.import
Normal file
40
speech-talk.png.import
Normal file
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bi8rmjyseoyyx"
|
||||
path="res://.godot/imported/speech-talk.png-f54453937e9d82c29c903e5c8634c45b.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://speech-talk.png"
|
||||
dest_files=["res://.godot/imported/speech-talk.png-f54453937e9d82c29c903e5c8634c45b.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
|
||||
14
speech_bubble.gd
Normal file
14
speech_bubble.gd
Normal file
@@ -0,0 +1,14 @@
|
||||
class_name SpeechBubble extends Sprite2D
|
||||
|
||||
@onready var anim_player : AnimationPlayer = $AnimationPlayer
|
||||
|
||||
func try_show_speech(type : String = ""):
|
||||
if type != "":
|
||||
if anim_player.has_animation(type):
|
||||
visible = true
|
||||
anim_player.play(type)
|
||||
else:
|
||||
printerr("Tried to show speech bubble %s but speech bubble does not have that type!" % type)
|
||||
visible = false
|
||||
else:
|
||||
visible = false
|
||||
1
speech_bubble.gd.uid
Normal file
1
speech_bubble.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://w57riwplc00t
|
||||
6
test_adventurer.tscn
Normal file
6
test_adventurer.tscn
Normal file
@@ -0,0 +1,6 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://djirqtsrttqwe"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://0jl2qbvtmsik" path="res://adventurer_data.gd" id="1_jdutx"]
|
||||
|
||||
[node name="Test Guildmember" type="Node"]
|
||||
script = ExtResource("1_jdutx")
|
||||
114
test_adventurer_sprite.tscn
Normal file
114
test_adventurer_sprite.tscn
Normal file
@@ -0,0 +1,114 @@
|
||||
[gd_scene load_steps=16 format=3 uid="uid://dew8gxu55ex6q"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cjqumk0kw2vte" path="res://adventurer.gd" id="1_wif60"]
|
||||
[ext_resource type="Texture2D" uid="uid://bldpiytpdrge6" path="res://icon.svg" id="2_rwbq5"]
|
||||
[ext_resource type="Texture2D" uid="uid://cbamfadh7wwr7" path="res://speech-blip.png" id="3_71qlo"]
|
||||
[ext_resource type="Texture2D" uid="uid://1mmg270gotb1" path="res://busy-dots.png" id="4_ay0uu"]
|
||||
[ext_resource type="Script" uid="uid://w57riwplc00t" path="res://speech_bubble.gd" id="4_rwbq5"]
|
||||
[ext_resource type="Script" uid="uid://djd8pv5xbgud3" path="res://fsm/machines/test.gd" id="5_snss2"]
|
||||
[ext_resource type="Script" uid="uid://dl3b5aywu1hf6" path="res://fsm/nodes/wait.gd" id="6_1cj4e"]
|
||||
[ext_resource type="Script" uid="uid://e8we6nmaob1k" path="res://fsm/nodes/test.gd" id="7_ux5kh"]
|
||||
[ext_resource type="Script" uid="uid://bewrajxqdutsu" path="res://fsm/interact_with_employee.gd" id="9_snss2"]
|
||||
[ext_resource type="Script" uid="uid://y85swbbk8kbd" path="res://fsm/nodes/queue.gd" id="10_1cj4e"]
|
||||
[ext_resource type="Script" uid="uid://b0ewnwcibhu21" path="res://fsm/nodes/leave.gd" id="11_ux5kh"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_5n4iw"]
|
||||
radius = 35.0
|
||||
|
||||
[sub_resource type="Animation" id="Animation_bog1h"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Sprite2D3:frame")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [0]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_13vc8"]
|
||||
resource_name = "busy"
|
||||
length = 0.7000034
|
||||
loop_mode = 1
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Sprite2D3:frame")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7),
|
||||
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1),
|
||||
"update": 1,
|
||||
"values": [0, 1, 2, 3, 4, 5, 6, 0]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_uo85v"]
|
||||
_data = {
|
||||
&"RESET": SubResource("Animation_bog1h"),
|
||||
&"busy": SubResource("Animation_13vc8")
|
||||
}
|
||||
|
||||
[node name="AdventurerSprite" type="CharacterBody2D"]
|
||||
script = ExtResource("1_wif60")
|
||||
interaction_range = null
|
||||
stop_range = null
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
modulate = Color(0, 1, 0, 1)
|
||||
scale = Vector2(0.5, 0.5)
|
||||
texture = ExtResource("2_rwbq5")
|
||||
|
||||
[node name="NavigationAgent2D" type="NavigationAgent2D" parent="."]
|
||||
path_desired_distance = 30.0
|
||||
avoidance_enabled = true
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource("CircleShape2D_5n4iw")
|
||||
|
||||
[node name="SpeechBubble" type="Sprite2D" parent="."]
|
||||
visible = false
|
||||
position = Vector2(39, -42)
|
||||
texture = ExtResource("3_71qlo")
|
||||
script = ExtResource("4_rwbq5")
|
||||
|
||||
[node name="Sprite2D3" type="Sprite2D" parent="SpeechBubble"]
|
||||
position = Vector2(0, -4)
|
||||
texture = ExtResource("4_ay0uu")
|
||||
hframes = 2
|
||||
vframes = 4
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="SpeechBubble"]
|
||||
libraries = {
|
||||
&"": SubResource("AnimationLibrary_uo85v")
|
||||
}
|
||||
|
||||
[node name="StateMachine" type="Node" parent="."]
|
||||
script = ExtResource("5_snss2")
|
||||
starting_state = "Queue"
|
||||
|
||||
[node name="Wait" type="Node" parent="StateMachine"]
|
||||
script = ExtResource("6_1cj4e")
|
||||
wait_duration = 3.0
|
||||
|
||||
[node name="Test" type="Node" parent="StateMachine"]
|
||||
script = ExtResource("7_ux5kh")
|
||||
message = "TEST COMPLETE!"
|
||||
|
||||
[node name="Interact With Employee" type="Node" parent="StateMachine"]
|
||||
script = ExtResource("9_snss2")
|
||||
employee_name = "Receptionist"
|
||||
speech_bubble = "Talk"
|
||||
wait_duration = null
|
||||
interaction_args = Array[String](["register"])
|
||||
|
||||
[node name="Queue" type="Node" parent="StateMachine"]
|
||||
script = ExtResource("10_1cj4e")
|
||||
employee = "Receptionist"
|
||||
|
||||
[node name="Node" type="Node" parent="StateMachine"]
|
||||
script = ExtResource("11_ux5kh")
|
||||
8
test_scene.gd
Normal file
8
test_scene.gd
Normal file
@@ -0,0 +1,8 @@
|
||||
extends Node2D
|
||||
|
||||
var test_adv = preload("res://test_adventurer.tscn")
|
||||
func _ready() -> void:
|
||||
var adv : AdventurerData = test_adv.instantiate() as AdventurerData
|
||||
Guild.register_guild_member(adv)
|
||||
var quest : Quest = Quest.new()
|
||||
Guild.add_quest(quest)
|
||||
1
test_scene.gd.uid
Normal file
1
test_scene.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://cci652umkym1f
|
||||
@@ -1,7 +1,25 @@
|
||||
[gd_resource type="TileSet" load_steps=3 format=3 uid="uid://6im0g3eg6sr4"]
|
||||
[gd_resource type="TileSet" load_steps=6 format=3 uid="uid://6im0g3eg6sr4"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://n5nal4ikpapx" path="res://spritesheet_tiles.png" id="1_jr0lo"]
|
||||
|
||||
[sub_resource type="NavigationPolygon" id="NavigationPolygon_0280p"]
|
||||
vertices = PackedVector2Array(32, 32, -32, 32, -32, -32, 32, -32)
|
||||
polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3)])
|
||||
outlines = Array[PackedVector2Array]([PackedVector2Array(-32, -32, 32, -32, 32, 32, -32, 32)])
|
||||
agent_radius = 0.0
|
||||
|
||||
[sub_resource type="NavigationPolygon" id="NavigationPolygon_jr0lo"]
|
||||
vertices = PackedVector2Array(32, 32, -32, 32, -32, -32, 32, -32)
|
||||
polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3)])
|
||||
outlines = Array[PackedVector2Array]([PackedVector2Array(-32, -32, 32, -32, 32, 32, -32, 32)])
|
||||
agent_radius = 0.0
|
||||
|
||||
[sub_resource type="NavigationPolygon" id="NavigationPolygon_lhljm"]
|
||||
vertices = PackedVector2Array(32, 32, -32, 32, -32, -32, 32, -32)
|
||||
polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3)])
|
||||
outlines = Array[PackedVector2Array]([PackedVector2Array(-32, -32, 32, -32, 32, 32, -32, 32)])
|
||||
agent_radius = 0.0
|
||||
|
||||
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_lhljm"]
|
||||
texture = ExtResource("1_jr0lo")
|
||||
separation = Vector2i(10, 10)
|
||||
@@ -11,7 +29,9 @@ texture_region_size = Vector2i(64, 64)
|
||||
2:0/0 = 0
|
||||
3:0/0 = 0
|
||||
4:0/0 = 0
|
||||
4:0/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_lhljm")
|
||||
5:0/0 = 0
|
||||
5:0/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_lhljm")
|
||||
6:0/0 = 0
|
||||
7:0/0 = 0
|
||||
8:0/0 = 0
|
||||
@@ -39,11 +59,17 @@ texture_region_size = Vector2i(64, 64)
|
||||
21:1/0 = 0
|
||||
20:1/0 = 0
|
||||
19:1/0 = 0
|
||||
19:1/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_jr0lo")
|
||||
18:1/0 = 0
|
||||
18:1/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_jr0lo")
|
||||
17:1/0 = 0
|
||||
17:1/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_jr0lo")
|
||||
16:1/0 = 0
|
||||
16:1/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_jr0lo")
|
||||
15:1/0 = 0
|
||||
15:1/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_jr0lo")
|
||||
14:1/0 = 0
|
||||
14:1/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_0280p")
|
||||
0:1/0 = 0
|
||||
0:2/0 = 0
|
||||
1:2/0 = 0
|
||||
@@ -60,9 +86,13 @@ texture_region_size = Vector2i(64, 64)
|
||||
12:3/0 = 0
|
||||
13:3/0 = 0
|
||||
14:3/0 = 0
|
||||
14:3/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_jr0lo")
|
||||
15:3/0 = 0
|
||||
15:3/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_jr0lo")
|
||||
16:3/0 = 0
|
||||
16:3/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_jr0lo")
|
||||
17:3/0 = 0
|
||||
17:3/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_jr0lo")
|
||||
18:4/0 = 0
|
||||
19:4/0 = 0
|
||||
20:4/0 = 0
|
||||
@@ -72,10 +102,12 @@ texture_region_size = Vector2i(64, 64)
|
||||
24:4/0 = 0
|
||||
25:4/0 = 0
|
||||
18:3/0 = 0
|
||||
18:3/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_jr0lo")
|
||||
6:3/0 = 0
|
||||
5:3/0 = 0
|
||||
4:3/0 = 0
|
||||
19:3/0 = 0
|
||||
19:3/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_jr0lo")
|
||||
20:3/0 = 0
|
||||
21:3/0 = 0
|
||||
22:3/0 = 0
|
||||
@@ -84,10 +116,15 @@ texture_region_size = Vector2i(64, 64)
|
||||
23:3/0 = 0
|
||||
20:2/0 = 0
|
||||
19:2/0 = 0
|
||||
19:2/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_jr0lo")
|
||||
18:2/0 = 0
|
||||
18:2/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_jr0lo")
|
||||
17:2/0 = 0
|
||||
17:2/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_jr0lo")
|
||||
16:2/0 = 0
|
||||
16:2/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_jr0lo")
|
||||
15:2/0 = 0
|
||||
15:2/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_jr0lo")
|
||||
13:1/0 = 0
|
||||
12:1/0 = 0
|
||||
11:1/0 = 0
|
||||
@@ -107,6 +144,7 @@ texture_region_size = Vector2i(64, 64)
|
||||
12:2/0 = 0
|
||||
13:2/0 = 0
|
||||
14:2/0 = 0
|
||||
14:2/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_jr0lo")
|
||||
7:2/0 = 0
|
||||
23:2/0 = 0
|
||||
22:2/0 = 0
|
||||
@@ -581,4 +619,5 @@ texture_region_size = Vector2i(64, 64)
|
||||
[resource]
|
||||
tile_size = Vector2i(64, 64)
|
||||
physics_layer_0/collision_layer = 1
|
||||
navigation_layer_0/layers = 1
|
||||
sources/0 = SubResource("TileSetAtlasSource_lhljm")
|
||||
|
||||
27
update_bubble.gd
Normal file
27
update_bubble.gd
Normal file
@@ -0,0 +1,27 @@
|
||||
extends NinePatchRect
|
||||
|
||||
@onready var label : Label = %Label
|
||||
@onready var timer : Timer = %Timer
|
||||
|
||||
func _ready() -> void:
|
||||
show_message("TESTING, 1 2 3\nTESTING!!!!")
|
||||
|
||||
|
||||
func show_message(msg : String, show_time : float = 1.0) -> void:
|
||||
label.text = msg
|
||||
appear.call(show_time)
|
||||
|
||||
func appear(show_time : float):
|
||||
var size : Vector2 = label.get_size()
|
||||
size += get_minimum_size() / 2
|
||||
print(size)
|
||||
var tween = create_tween()
|
||||
tween.tween_property(self, "size", size, .25)
|
||||
#tween.parallel().tween_property(self, "pivot_offset", Vector2(0, size.y), .5)
|
||||
tween.parallel().tween_property(self, "position", Vector2(position.x, position.y-size.y/2), 0.25)
|
||||
timer.start(show_time + .25)
|
||||
|
||||
func _on_timer_timeout() -> void:
|
||||
var tween = create_tween()
|
||||
tween.tween_property(self, "modulate", Color(1,1,1,0), .5)
|
||||
tween.tween_callback(queue_free)
|
||||
1
update_bubble.gd.uid
Normal file
1
update_bubble.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://c23pbcmig5v3s
|
||||
31
visitor_spawner.gd
Normal file
31
visitor_spawner.gd
Normal file
@@ -0,0 +1,31 @@
|
||||
class_name VisitorSpawner extends Node2D
|
||||
|
||||
@onready var timer : Timer = $Timer
|
||||
@export var total_visitors : int = 0
|
||||
@export var min_time : float = 5
|
||||
@export var max_time : float = 10
|
||||
var visitors_remaining : int
|
||||
signal visitor_spawned(current : int, total : int)
|
||||
|
||||
func _ready() -> void:
|
||||
Guild.visitor_spawner = self
|
||||
visitors_remaining = total_visitors
|
||||
if visitors_remaining > 0:
|
||||
timer.start(randf_range(min_time, max_time))
|
||||
setup_ui.call_deferred()
|
||||
|
||||
func setup_ui():
|
||||
Game.setup_visitor_ui(self)
|
||||
|
||||
|
||||
func spawn_visitor() -> void:
|
||||
Guild.spawn_visitor(global_position)
|
||||
visitors_remaining-=1
|
||||
visitor_spawned.emit(visitors_remaining, total_visitors)
|
||||
|
||||
|
||||
func _on_timer_timeout() -> void:
|
||||
if visitors_remaining > 0:
|
||||
spawn_visitor()
|
||||
else:
|
||||
timer.stop()
|
||||
1
visitor_spawner.gd.uid
Normal file
1
visitor_spawner.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bnbljf6u2d3kh
|
||||
22
waypoint.gd
Normal file
22
waypoint.gd
Normal file
@@ -0,0 +1,22 @@
|
||||
class_name Waypoint extends Control
|
||||
|
||||
var percent : float = 0
|
||||
var filled: bool
|
||||
var fill: bool :
|
||||
get:
|
||||
return filled
|
||||
set(value):
|
||||
if value != filled:
|
||||
set_fill(value)
|
||||
|
||||
|
||||
func set_fill(value : bool) -> void:
|
||||
filled = value
|
||||
if value:
|
||||
$Dot.visible = true
|
||||
$Fill.modulate = Color.SEA_GREEN
|
||||
else:
|
||||
$Dot.visible = false
|
||||
$Fill.modulate = Color.BLACK
|
||||
|
||||
|
||||
1
waypoint.gd.uid
Normal file
1
waypoint.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dnytdxwuk6b7x
|
||||
46
waypoint.tscn
Normal file
46
waypoint.tscn
Normal file
@@ -0,0 +1,46 @@
|
||||
[gd_scene load_steps=7 format=3 uid="uid://wnkqgapgh7br"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dnytdxwuk6b7x" path="res://waypoint.gd" id="1_m8nlk"]
|
||||
[ext_resource type="Texture2D" uid="uid://c6ptvokr5npl7" path="res://progress-marks.png" id="2_u6u05"]
|
||||
[ext_resource type="Texture2D" uid="uid://bcrg5ea4niu0e" path="res://progress-dot-fill.png" id="3_ddqum"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_nyilg"]
|
||||
atlas = ExtResource("2_u6u05")
|
||||
region = Rect2(32, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_g6crn"]
|
||||
atlas = ExtResource("3_ddqum")
|
||||
region = Rect2(0, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_m8nlk"]
|
||||
atlas = ExtResource("2_u6u05")
|
||||
region = Rect2(32, 32, 32, 32)
|
||||
|
||||
[node name="Waypoint" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
offset_left = 96.0
|
||||
offset_top = -9.0
|
||||
offset_right = 128.0
|
||||
offset_bottom = 23.0
|
||||
script = ExtResource("1_m8nlk")
|
||||
|
||||
[node name="Over" type="TextureRect" parent="."]
|
||||
layout_mode = 0
|
||||
offset_right = 32.0
|
||||
offset_bottom = 32.0
|
||||
texture = SubResource("AtlasTexture_nyilg")
|
||||
|
||||
[node name="Fill" type="TextureRect" parent="."]
|
||||
modulate = Color(0, 0, 0, 1)
|
||||
layout_mode = 0
|
||||
offset_right = 32.0
|
||||
offset_bottom = 32.0
|
||||
texture = SubResource("AtlasTexture_g6crn")
|
||||
|
||||
[node name="Dot" type="TextureRect" parent="."]
|
||||
visible = false
|
||||
layout_mode = 0
|
||||
offset_right = 32.0
|
||||
offset_bottom = 32.0
|
||||
texture = SubResource("AtlasTexture_m8nlk")
|
||||
Reference in New Issue
Block a user