Added player weapon generation from seed

This commit is contained in:
2025-12-14 17:10:29 +03:00
parent abb680ed53
commit ccf5d4c93b
8 changed files with 50 additions and 20 deletions
+4 -9
View File
@@ -11,8 +11,7 @@ const GAME_STAGE_INDEX = "current_stage_index"
const GAME_SECTOR_INDEX = "current_sector_index"
const CATEGORY_PLAYER = "player"
const PLAYER_FIRST_WEAPON = "first_weapon_id"
const PLAYER_SECOND_WEAPON = "second_weapon_id"
const PLAYER_WEAPONS = "weapon_ids"
const PLAYER_HULL = "hull"
@@ -66,8 +65,7 @@ func _set_game_values() -> void:
func _set_player_values() -> void:
_save_file.set_value(CATEGORY_PLAYER, PLAYER_FIRST_WEAPON, player_data.first_weapon_id)
_save_file.set_value(CATEGORY_PLAYER, PLAYER_SECOND_WEAPON, player_data.second_weapon_id)
_save_file.set_value(CATEGORY_PLAYER, PLAYER_WEAPONS, player_data.weapon_ids)
_save_file.set_value(CATEGORY_PLAYER, PLAYER_HULL, player_data.hull)
@@ -87,11 +85,8 @@ func _get_game_values() -> void:
func _get_player_values() -> void:
player_data.first_weapon_id = _save_file.get_value(
CATEGORY_PLAYER, PLAYER_FIRST_WEAPON, player_data.first_weapon_id
)
player_data.second_weapon_id = _save_file.get_value(
CATEGORY_PLAYER, PLAYER_SECOND_WEAPON, player_data.second_weapon_id
player_data.weapon_ids = _save_file.get_value(
CATEGORY_PLAYER, PLAYER_WEAPONS, player_data.weapon_ids
)
player_data.hull = _save_file.get_value(
CATEGORY_PLAYER, PLAYER_HULL, player_data.hull