Sound FX, major work on set schedule, and some new concepts for items and portraits
This commit is contained in:
@@ -5,11 +5,11 @@ var panel : GamePanel = null
|
||||
var player_profile : Window = null
|
||||
var quest_log : QuestLog = null
|
||||
var top_menu : TopMenu = null
|
||||
var open : bool = true
|
||||
var open : bool = false
|
||||
var end_shift_confirmation : ConfirmationDialog
|
||||
var end_shift_confirm_template = preload("res://templates/end_shift_confirmation.tscn")
|
||||
var player_profile_template = preload("res://templates/player_profile_window.tscn")
|
||||
|
||||
var last_screenshot : Image
|
||||
func _ready() -> void:
|
||||
DisplayServer.register_additional_output(self)
|
||||
end_shift_confirmation = end_shift_confirm_template.instantiate()
|
||||
@@ -44,6 +44,7 @@ func toggle_player_profile():
|
||||
|
||||
|
||||
func end_shift() -> void:
|
||||
take_screenshot()
|
||||
open = false
|
||||
if player_profile != null:
|
||||
toggle_player_profile()
|
||||
@@ -73,11 +74,15 @@ func notice(msg : String, time : float = 1) -> void:
|
||||
func calculate_kill_exp(killer : QuestSprite, killed : QuestSprite) -> int:
|
||||
return clamp(1, (killed.level - killer.level) * 5, 100)
|
||||
|
||||
func take_screenshot() -> void:
|
||||
last_screenshot = get_viewport().get_texture().get_image()
|
||||
|
||||
func test_save() -> void:
|
||||
var image : Image = get_viewport().get_texture().get_image()
|
||||
if open:
|
||||
take_screenshot()
|
||||
var save_dict = {
|
||||
"savetime": Time.get_datetime_string_from_system(),
|
||||
"screenshot": image.save_png_to_buffer().hex_encode()
|
||||
"screenshot": last_screenshot
|
||||
}
|
||||
#Save the guild data
|
||||
save_dict["guildname"] = Guild.name
|
||||
@@ -122,4 +127,9 @@ func test_load(filename : String) -> void:
|
||||
if not parse_result == OK:
|
||||
printerr("JSON Parse Error: ", json.get_error_message(), " in ", json_string, " at line ", json.get_error_line())
|
||||
return
|
||||
|
||||
|
||||
func switch_scenes(scene_name : String) -> void:
|
||||
get_tree().change_scene_to_file("res://scenes/" + scene_name + ".tscn")
|
||||
|
||||
func switch_dialogue(timeline_name : String, label : String) -> void:
|
||||
Dialogic.start("res://dialogic/timelines/" + timeline_name + ".dtl", label)
|
||||
|
||||
6
scripts/game_start.gd
Normal file
6
scripts/game_start.gd
Normal file
@@ -0,0 +1,6 @@
|
||||
extends Control
|
||||
|
||||
@onready var timeline : DialogicTimeline = preload("res://dialogic/timelines/game_start.dtl")
|
||||
|
||||
func _ready() -> void:
|
||||
Dialogic.start(timeline)
|
||||
1
scripts/game_start.gd.uid
Normal file
1
scripts/game_start.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://cpufy3rp4f0gw
|
||||
49
scripts/guild_card_scene.gd
Normal file
49
scripts/guild_card_scene.gd
Normal file
@@ -0,0 +1,49 @@
|
||||
extends Control
|
||||
|
||||
@onready var firstEdit : TextEdit = %FirstNameEdit
|
||||
@onready var lastEdit : TextEdit = %LastNameEdit
|
||||
@onready var signButton : Button = %SignButton
|
||||
@onready var portraitButton : TextureButton = %PortraitButton
|
||||
@onready var signature : TextureRect = %Signature
|
||||
@onready var write_sound : AudioStreamPlayer = $AudioStreamPlayer
|
||||
var first_set : bool = false
|
||||
var last_set : bool = false
|
||||
var portrait_set : bool = false
|
||||
|
||||
func validate_signature() -> void:
|
||||
signButton.disabled = !(first_set and last_set and portrait_set)
|
||||
|
||||
func _on_portrait_button_pressed() -> void:
|
||||
#Open the Portrait Screesn
|
||||
portrait_set = true
|
||||
validate_signature()
|
||||
|
||||
|
||||
func _on_first_name_edit_text_changed() -> void:
|
||||
if firstEdit.text != "":
|
||||
first_set = true
|
||||
else:
|
||||
last_set = true
|
||||
validate_signature()
|
||||
|
||||
|
||||
func _on_last_name_edit_text_changed() -> void:
|
||||
if lastEdit.text != "":
|
||||
last_set = true
|
||||
else:
|
||||
last_set = false
|
||||
validate_signature()
|
||||
|
||||
func update_signature_threshold(value : float) -> void:
|
||||
signature.set_instance_shader_parameter("threshold", value)
|
||||
|
||||
func _on_sign_button_pressed() -> void:
|
||||
signButton.visible = false
|
||||
var tween = create_tween()
|
||||
write_sound.play()
|
||||
tween.tween_method(update_signature_threshold, -0.1, 1.1, .5)
|
||||
|
||||
#Sign the card.
|
||||
#Dialogic.paused = false
|
||||
#Dialogic.Jump.jump_to_label("")
|
||||
pass # Replace with function body.
|
||||
1
scripts/guild_card_scene.gd.uid
Normal file
1
scripts/guild_card_scene.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dkrxdaq8d6q55
|
||||
20
scripts/guild_facade.gd
Normal file
20
scripts/guild_facade.gd
Normal file
@@ -0,0 +1,20 @@
|
||||
extends Area2D
|
||||
|
||||
var overlapping : bool
|
||||
var shift_tween : Tween
|
||||
func _on_body_entered(body: Node2D) -> void:
|
||||
if overlapping:
|
||||
return
|
||||
if body == Game.player:
|
||||
overlapping = true
|
||||
shift_tween = create_tween()
|
||||
shift_tween.tween_property(self, "modulate:a", .5, .25)
|
||||
|
||||
|
||||
func _on_body_exited(body: Node2D) -> void:
|
||||
if !overlapping:
|
||||
return
|
||||
if body == Game.player:
|
||||
overlapping = false
|
||||
shift_tween = create_tween()
|
||||
shift_tween.tween_property(self, "modulate:a", 1.0, .25)
|
||||
1
scripts/guild_facade.gd.uid
Normal file
1
scripts/guild_facade.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dyn5wwocvkqds
|
||||
41
scripts/hold_to_continue.gd
Normal file
41
scripts/hold_to_continue.gd
Normal file
@@ -0,0 +1,41 @@
|
||||
extends MarginContainer
|
||||
|
||||
@export var key : Key = KEY_SPACE
|
||||
@export var time : float = 3
|
||||
@export var advance_type : AdvanceType
|
||||
@export var scene : String
|
||||
@export var label : String
|
||||
@onready var progress_bar : ProgressBar = $ProgressBar
|
||||
|
||||
enum AdvanceType{
|
||||
SCENE,
|
||||
DIALOGUE
|
||||
}
|
||||
var progress : float = 0
|
||||
var button_held : bool
|
||||
var key_held : bool
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
key_held = Input.is_key_pressed(key)
|
||||
if key_held or button_held:
|
||||
progress = min(time, progress + delta)
|
||||
if progress == time:
|
||||
advance()
|
||||
return
|
||||
else:
|
||||
progress = max(0, progress - 2 * delta)
|
||||
progress_bar.value = 100 * progress / time
|
||||
|
||||
func advance():
|
||||
match(advance_type):
|
||||
AdvanceType.SCENE:
|
||||
Game.switch_scenes(scene)
|
||||
AdvanceType.DIALOGUE:
|
||||
Game.switch_dialogue(scene, label)
|
||||
|
||||
func _on_button_button_down() -> void:
|
||||
button_held = true
|
||||
|
||||
|
||||
func _on_button_button_up() -> void:
|
||||
button_held = false
|
||||
1
scripts/hold_to_continue.gd.uid
Normal file
1
scripts/hold_to_continue.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bowfi8npivsxo
|
||||
@@ -1,10 +1,12 @@
|
||||
class_name Player extends Person
|
||||
|
||||
const marker_template = preload("res://templates/move_marker.tscn")
|
||||
@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
|
||||
var marker = null
|
||||
@export var interaction_range : float = 75
|
||||
@export var stop_range : float = 25
|
||||
var data : Adventurer
|
||||
@@ -28,6 +30,8 @@ func set_movement_target(target : Vector2) -> void:
|
||||
func _physics_process(delta: float) -> void:
|
||||
|
||||
if nav_agent.is_navigation_finished():
|
||||
if marker != null:
|
||||
marker.visible = false
|
||||
if interaction_target:
|
||||
try_interact(interaction_target)
|
||||
#If they have an interaction target within range
|
||||
@@ -50,8 +54,13 @@ func _unhandled_input(event: InputEvent) -> void:
|
||||
interaction_target = null
|
||||
|
||||
func approach(pos : Vector2) -> void:
|
||||
if marker == null or !is_instance_valid(marker):
|
||||
marker = marker_template.instantiate()
|
||||
Guild.hall.add_child(marker)
|
||||
var rid = get_world_2d().get_navigation_map()
|
||||
var point : Vector2 = NavigationServer2D.map_get_closest_point(rid, pos)
|
||||
marker.global_position = point
|
||||
marker.visible = true
|
||||
set_movement_target(point)
|
||||
|
||||
func approach_and_interact(obj : Interactable) -> void:
|
||||
|
||||
34
scripts/set_shifts.gd
Normal file
34
scripts/set_shifts.gd
Normal file
@@ -0,0 +1,34 @@
|
||||
extends Control
|
||||
|
||||
@onready var shift_cycle_template = preload("res://templates/shift_cycle.tscn")
|
||||
@onready var cycle_list : ReorderableVBox = %CycleList
|
||||
@onready var delete_bin : PanelContainer = %DeleteBin
|
||||
var delete_tween : Tween
|
||||
|
||||
func _ready() -> void:
|
||||
delete_tween = delete_bin.create_tween()
|
||||
delete_tween.tween_property(delete_bin, "self_modulate", Color.WHITE, .3)
|
||||
delete_tween.tween_property(delete_bin, "self_modulate", Color.DIM_GRAY, .3)
|
||||
delete_tween.set_loops(-1)
|
||||
delete_tween.pause()
|
||||
delete_bin.self_modulate = Color.DIM_GRAY
|
||||
|
||||
func _on_drag_stopped(cycle : ShiftCycle):
|
||||
cycle.drop()
|
||||
if(delete_bin.get_global_rect().has_point(get_global_mouse_position())
|
||||
and len(cycle_list.get_children()) > 1):
|
||||
delete_tween.pause()
|
||||
delete_bin.self_modulate = Color.DIM_GRAY
|
||||
cycle.queue_free()
|
||||
|
||||
func _on_drag_started(cycle : ShiftCycle):
|
||||
cycle.lift()
|
||||
pass
|
||||
|
||||
func _on_add_shift_button_pressed() -> void:
|
||||
var cycle = shift_cycle_template.instantiate()
|
||||
cycle_list.add_child(cycle)
|
||||
|
||||
|
||||
func _on_accept_button_pressed() -> void:
|
||||
pass # Replace with function body.
|
||||
1
scripts/set_shifts.gd.uid
Normal file
1
scripts/set_shifts.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://h61yq7g8mfj3
|
||||
84
scripts/shift_cycle.gd
Normal file
84
scripts/shift_cycle.gd
Normal file
@@ -0,0 +1,84 @@
|
||||
class_name ShiftCycle extends Control
|
||||
|
||||
@onready var sounds : Dictionary = {
|
||||
"delete":preload("res://sounds/Various Sounds 06.wav"),
|
||||
"lift":preload("res://sounds/Turning Books Pages 52.wav"),
|
||||
"drop":preload("res://sounds/Paper_Scraping_1.wav")
|
||||
}
|
||||
@onready var panel : PanelContainer = %PanelContainer
|
||||
@onready var working_edit : TextEdit = %WorkingEdit
|
||||
@onready var open_edit : TextEdit = %OpenEdit
|
||||
@onready var shadow : Panel = %Shadow
|
||||
@onready var audio_player : AudioStreamPlayer = $AudioStreamPlayer
|
||||
|
||||
var last_working_text : String = ""
|
||||
var last_open_text : String = ""
|
||||
|
||||
|
||||
var work_shift : int = 25
|
||||
var open_shift : int = 5
|
||||
var regex : RegEx
|
||||
var tween : Tween
|
||||
var dragging : bool = false
|
||||
|
||||
func _init() -> void:
|
||||
regex = RegEx.new()
|
||||
regex.compile("^\\d{1,3}\\z")
|
||||
|
||||
|
||||
func _input(event: InputEvent) -> void:
|
||||
if !dragging:
|
||||
return
|
||||
if event is not InputEventMouseMotion:
|
||||
return
|
||||
|
||||
func lift() -> void:
|
||||
if tween and tween.is_running():
|
||||
tween.stop()
|
||||
tween = create_tween()
|
||||
tween.tween_property(shadow, "position:y", 10.0, .25 * (10 - shadow.position.y) / 10.0)
|
||||
tween.parallel().tween_property(shadow, "self_modulate:a", 1.0, .25 * (1.0 - shadow.self_modulate.a))
|
||||
tween.parallel().tween_property(panel, "position:y", -10.0, .25 * (panel.position.y + 10.0) / 10.0)
|
||||
audio_player.stream = sounds.lift
|
||||
audio_player.play()
|
||||
|
||||
func drop() -> void:
|
||||
if tween and tween.is_running():
|
||||
tween.stop()
|
||||
tween = create_tween()
|
||||
tween.tween_property(shadow, "position:y", 0.0, .25 * shadow.position.y / 10.0)
|
||||
tween.parallel().tween_property(shadow, "self_modulate:a", 0.0, .25 * shadow.self_modulate.a)
|
||||
tween.parallel().tween_property(panel, "position:y", 0.0, .25 * panel.position.y / -10.0)
|
||||
audio_player.stream = sounds.drop
|
||||
audio_player.play()
|
||||
|
||||
func _on_working_edit_text_changed() -> void:
|
||||
if !regex.search(working_edit.text) and working_edit.text != "":
|
||||
working_edit.text = last_working_text
|
||||
working_edit.set_caret_column(len(last_working_text))
|
||||
else:
|
||||
last_working_text = working_edit.text
|
||||
|
||||
|
||||
func _on_working_edit_text_set() -> void:
|
||||
if !regex.search(working_edit.text) and working_edit.text != "":
|
||||
working_edit.text = last_working_text
|
||||
working_edit.set_caret_column(len(last_working_text))
|
||||
else:
|
||||
last_working_text = working_edit.text
|
||||
|
||||
|
||||
func _on_open_edit_text_changed() -> void:
|
||||
if !regex.search(open_edit.text) and open_edit.text != "":
|
||||
open_edit.text = last_open_text
|
||||
open_edit.set_caret_column(len(last_open_text))
|
||||
else:
|
||||
last_open_text = open_edit.text
|
||||
|
||||
|
||||
func _on_open_edit_text_set() -> void:
|
||||
if !regex.search(open_edit.text) and open_edit.text != "":
|
||||
open_edit.text = last_open_text
|
||||
open_edit.set_caret_column(len(last_open_text))
|
||||
else:
|
||||
last_open_text = open_edit.text
|
||||
1
scripts/shift_cycle.gd.uid
Normal file
1
scripts/shift_cycle.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://cuds3hklcm5m5
|
||||
@@ -5,7 +5,7 @@ func _ready() -> void:
|
||||
%ContinueButton.disabled = !FileAccess.file_exists("user://savefile.save")
|
||||
|
||||
func _on_start_button_pressed() -> void:
|
||||
get_tree().change_scene_to_file("res://scenes/active_scene.tscn")
|
||||
get_tree().change_scene_to_file("res://scenes/game_start.tscn")
|
||||
|
||||
|
||||
func _on_continue_button_pressed() -> void:
|
||||
|
||||
Reference in New Issue
Block a user