way too many changes to list, oops. big rewrite.
This commit is contained in:
@ -1,6 +1,10 @@
|
||||
class_name Card extends Item
|
||||
|
||||
enum Faction {GENERIC = 0}
|
||||
enum Faction {
|
||||
GENERIC = 0,
|
||||
ENGINEER = 1,
|
||||
MAGE = 2,
|
||||
}
|
||||
|
||||
@export var rarity: Data.Rarity
|
||||
@export var faction: Faction
|
||||
|
1
Scripts/Resources/card.gd.uid
Normal file
1
Scripts/Resources/card.gd.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://d40isem6w5d8
|
@ -1,6 +1,7 @@
|
||||
class_name CardText extends Resource
|
||||
|
||||
@export var target_type: Data.TargetType
|
||||
@export var energy_type: Data.EnergyType
|
||||
@export var attributes: Array[StatAttribute]
|
||||
@export_multiline var text: String
|
||||
|
||||
|
1
Scripts/Resources/card_text.gd.uid
Normal file
1
Scripts/Resources/card_text.gd.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://dg7gxxqfqxcmc
|
@ -10,3 +10,24 @@ class_name Enemy extends Resource
|
||||
@export var penalty: int = 10
|
||||
@export var movement_speed: float = 0.5
|
||||
@export var spawn_cooldown: float = 1.0
|
||||
|
||||
@export_group("Spawner Card")
|
||||
@export_subgroup("Common")
|
||||
@export var common_group: int = 1
|
||||
@export var common_cost: int = 1
|
||||
|
||||
@export_subgroup("Uncommon")
|
||||
@export var uncommon_group: int = 1
|
||||
@export var uncommon_cost: int = 1
|
||||
|
||||
@export_subgroup("Rare")
|
||||
@export var rare_group: int = 1
|
||||
@export var rare_cost: int = 1
|
||||
|
||||
@export_subgroup("Epic")
|
||||
@export var epic_group: int = 1
|
||||
@export var epic_cost: int = 1
|
||||
|
||||
@export_subgroup("Legendary")
|
||||
@export var legendary_group: int = 1
|
||||
@export var legendary_cost: int = 1
|
||||
|
1
Scripts/Resources/enemy.gd.uid
Normal file
1
Scripts/Resources/enemy.gd.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://cbwxa2a4hfcy4
|
@ -4,3 +4,5 @@ class_name HeroClass extends Resource
|
||||
@export var texture: Texture
|
||||
@export var hand_texture: Texture
|
||||
@export var deck: Array[Card]
|
||||
@export var faction: Card.Faction
|
||||
@export var podium: PackedScene
|
||||
|
1
Scripts/Resources/hero_class.gd.uid
Normal file
1
Scripts/Resources/hero_class.gd.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://dcwtg2gev3uia
|
1
Scripts/Resources/item.gd.uid
Normal file
1
Scripts/Resources/item.gd.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://uomjb4sj4enc
|
1
Scripts/Resources/player_audio_settings.gd.uid
Normal file
1
Scripts/Resources/player_audio_settings.gd.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://ctwk3deywlswg
|
@ -9,7 +9,7 @@ const SAVE_PATH: String = "user://graphics_settings.tres"
|
||||
|
||||
|
||||
func apply_graphical_settings(viewport: Viewport) -> void:
|
||||
DisplayServer.window_set_vsync_mode(vsync_mode)
|
||||
#DisplayServer.window_set_vsync_mode(vsync_mode)
|
||||
match aa_mode:
|
||||
0:
|
||||
viewport.use_taa = false
|
||||
|
1
Scripts/Resources/player_graphics_settings.gd.uid
Normal file
1
Scripts/Resources/player_graphics_settings.gd.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://bte0pj6bwedb0
|
1
Scripts/Resources/player_keymap.gd.uid
Normal file
1
Scripts/Resources/player_keymap.gd.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://vkthiwr3vq4g
|
1
Scripts/Resources/player_preferences.gd.uid
Normal file
1
Scripts/Resources/player_preferences.gd.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://c78bl6r5qlday
|
1
Scripts/Resources/player_profile.gd.uid
Normal file
1
Scripts/Resources/player_profile.gd.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://b1s4nrql8i1sm
|
86
Scripts/Resources/save_data.gd
Normal file
86
Scripts/Resources/save_data.gd
Normal file
@ -0,0 +1,86 @@
|
||||
class_name SaveData extends RefCounted
|
||||
|
||||
const SAVE_PATH: String = "user://save1.txt"
|
||||
|
||||
#Game History
|
||||
var twenty_game_history: Array[bool] = []
|
||||
var wins: int = 0
|
||||
var losses: int = 0
|
||||
|
||||
#Engineer
|
||||
var engineer_cards_bought: int = 0
|
||||
|
||||
|
||||
#Unlocking the mage
|
||||
var mage_card_seen_in_shop: bool = false
|
||||
var mage_cards_bought: int = 0
|
||||
var mage_unlocked: bool = 0
|
||||
|
||||
|
||||
func add_game_outcome(outcome: bool) -> void:
|
||||
if outcome:
|
||||
wins += 1
|
||||
else:
|
||||
losses += 1
|
||||
twenty_game_history.push_back(outcome)
|
||||
if twenty_game_history.size() > 20:
|
||||
twenty_game_history.pop_front()
|
||||
|
||||
|
||||
func unlock_all_content() -> void:
|
||||
mage_unlocked = true
|
||||
|
||||
|
||||
func lock_all_content() -> void:
|
||||
mage_unlocked = false
|
||||
|
||||
|
||||
func bought_engineer_card() -> void:
|
||||
engineer_cards_bought += 1
|
||||
|
||||
|
||||
func saw_mage_card_in_shop() -> void:
|
||||
mage_card_seen_in_shop = true
|
||||
save_to_disc()
|
||||
|
||||
|
||||
func bought_mage_card() -> void:
|
||||
mage_cards_bought += 1
|
||||
if mage_cards_bought >= 10:
|
||||
mage_unlocked = true
|
||||
save_to_disc()
|
||||
|
||||
|
||||
func save_to_disc() -> void:
|
||||
var save_file: FileAccess = FileAccess.open(SAVE_PATH, FileAccess.WRITE)
|
||||
var dict: Dictionary = {
|
||||
"wins" = wins,
|
||||
"losses" = losses,
|
||||
"twenty_game_history" = twenty_game_history,
|
||||
"engineer_cards_bought" = engineer_cards_bought,
|
||||
"mage_card_seen_in_shop" = mage_card_seen_in_shop,
|
||||
"mage_cards_bought" = mage_cards_bought,
|
||||
"mage_unlocked" = mage_unlocked,
|
||||
}
|
||||
var json_string: String = JSON.stringify(dict)
|
||||
save_file.store_line(json_string)
|
||||
|
||||
|
||||
static func load_profile_from_disk() -> SaveData:
|
||||
if FileAccess.file_exists(SAVE_PATH):
|
||||
var save_file: FileAccess = FileAccess.open(SAVE_PATH, FileAccess.READ)
|
||||
var json_string: String = save_file.get_line()
|
||||
var json: JSON = JSON.new()
|
||||
var parse_result: Error = json.parse(json_string)
|
||||
if parse_result == OK:
|
||||
var dict: Dictionary = json.data
|
||||
var stats: SaveData = SaveData.new()
|
||||
stats.wins = dict["wins"]
|
||||
stats.losses = dict["losses"]
|
||||
stats.twenty_game_history.append_array(dict["twenty_game_history"])
|
||||
stats.engineer_cards_bought = dict["engineer_cards_bought"]
|
||||
stats.mage_card_seen_in_shop = dict["mage_card_seen_in_shop"]
|
||||
stats.mage_cards_bought = dict["mage_cards_bought"]
|
||||
stats.mage_unlocked = dict["mage_unlocked"]
|
||||
return stats
|
||||
return SaveData.new()
|
1
Scripts/Resources/save_data.gd.uid
Normal file
1
Scripts/Resources/save_data.gd.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://6tvi4ox481cp
|
@ -1,25 +0,0 @@
|
||||
class_name SaveStats extends Resource
|
||||
|
||||
const SAVE_PATH: String = "user://save_stats.tres"
|
||||
|
||||
@export var wins: int
|
||||
@export var losses: int
|
||||
@export var twenty_game_history: Array[bool]
|
||||
|
||||
|
||||
func add_game_outcome(outcome: bool) -> void:
|
||||
if outcome:
|
||||
wins += 1
|
||||
else:
|
||||
losses += 1
|
||||
twenty_game_history.push_back(outcome)
|
||||
if twenty_game_history.size() > 20:
|
||||
twenty_game_history.pop_front()
|
||||
|
||||
|
||||
func save_profile_to_disk() -> void:
|
||||
ResourceSaver.save(self, SAVE_PATH)
|
||||
static func load_profile_from_disk() -> SaveStats:
|
||||
if ResourceLoader.exists(SAVE_PATH):
|
||||
return ResourceLoader.load(SAVE_PATH)
|
||||
return SaveStats.new()
|
1
Scripts/Resources/stat_attribute.gd.uid
Normal file
1
Scripts/Resources/stat_attribute.gd.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://yjb0uv6og430
|
1
Scripts/Resources/status_stats.gd.uid
Normal file
1
Scripts/Resources/status_stats.gd.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://bq6jp8bwub6je
|
Reference in New Issue
Block a user