Extensive work on VFX for the guild, assets for the world, and portrait variance. Work on quests. Extra work on User Flow completion and file saving.

This commit is contained in:
2025-09-04 07:46:55 -04:00
parent 149ee993dc
commit 48e335f56a
134 changed files with 2232 additions and 288 deletions

View File

@@ -72,3 +72,54 @@ 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 test_save() -> void:
var image : Image = get_viewport().get_texture().get_image()
var save_dict = {
"savetime": Time.get_datetime_string_from_system(),
"screenshot": image.save_png_to_buffer().hex_encode()
}
#Save the guild data
save_dict["guildname"] = Guild.name
save_dict["guildlevel"] = Guild.level
#Save the player data
save_dict["playername"] = player.data.full_name()
save_dict["playerlevel"] = player.data.level
#Save the employee data
#Save the adventurer data
#Save the quest data
#Save the quest progress
var save_file = FileAccess.open("user://savefile.save", FileAccess.WRITE)
save_file.store_line(JSON.stringify(save_dict))
func get_savefile_data(filename : String) -> Dictionary:
var load_file = FileAccess.open("user://" + filename, FileAccess.READ)
var json = JSON.new()
var json_string = load_file.get_line()
var parse_result = json.parse(json_string)
if not parse_result == OK:
printerr("JSON Parse Error: ", json.get_error_message(), " in ", json_string, " at line ", json.get_error_line())
return {}
var image = Image.new()
var ss : String = json.data.screenshot
#print(ss.data)
image.load_png_from_buffer(ss.hex_decode())
var data_dict = {
"playername": json.data.playername,
"playerlevel": json.data.playerlevel,
"guildname": json.data.guildname,
"guildlevel": json.data.guildlevel,
"savetime": json.data.savetime,
"screenshot": image
}
return data_dict
func test_load(filename : String) -> void:
var load_file = FileAccess.open("user://" + filename, FileAccess.READ)
var json = JSON.new()
var json_string = load_file.get_line()
var parse_result = json.parse_string(json_string)
if not parse_result == OK:
printerr("JSON Parse Error: ", json.get_error_message(), " in ", json_string, " at line ", json.get_error_line())
return