diff --git a/Scenes/Player/player.gd b/Scenes/Player/player.gd index 0a3e006..3fd9cc0 100644 --- a/Scenes/Player/player.gd +++ b/Scenes/Player/player.gd @@ -13,6 +13,7 @@ var currentCost : float = 0 var currentStateIcon : Texture2D = null var allSpawnedMonsters : Dictionary = {} var currentSpawnedMonsters : Array = [] +var maxBludGen : float = 0 @onready var menuZone : Control = $Camera2D/CanvasLayer/PlayerUI/MenuZone @onready var playerUI : Control = $Camera2D/CanvasLayer/PlayerUI @onready var enemy : Fabio = $"../Enemy" @@ -48,6 +49,8 @@ func add_monster(monster : TemplateSpawnable): currentSpawnedMonsters.append(monster) currentBludGen += monster.BludGen + if currentBludGen > maxBludGen: + maxBludGen = currentBludGen playerUI.set_blud_gen(currentBludGen) if !allSpawnedMonsters.has(monster.monsterName): diff --git a/Scenes/ending.tscn b/Scenes/ending.tscn index 1f0b372..19b382b 100644 --- a/Scenes/ending.tscn +++ b/Scenes/ending.tscn @@ -784,6 +784,23 @@ texture = ExtResource("6_vbucy") expand_mode = 3 stretch_mode = 5 +[node name="MaxBludGen" type="HBoxContainer" parent="TotalArmyComp/Separation"] +layout_mode = 2 +size_flags_vertical = 3 +size_flags_stretch_ratio = 0.25 + +[node name="BludGenLabel" type="Label" parent="TotalArmyComp/Separation/MaxBludGen"] +layout_mode = 2 +size_flags_horizontal = 3 +theme = ExtResource("4_br77t") +text = "Max Blood Gen: " + +[node name="MaxBludGen" type="Label" parent="TotalArmyComp/Separation/MaxBludGen"] +layout_mode = 2 +size_flags_horizontal = 3 +theme = ExtResource("4_br77t") +text = "0/s" + [node name="AmtKill" type="Label" parent="."] layout_mode = 0 offset_left = 144.0 diff --git a/Scripts/ending.gd b/Scripts/ending.gd index 3c407e5..023150d 100644 --- a/Scripts/ending.gd +++ b/Scripts/ending.gd @@ -8,6 +8,7 @@ var is_win: bool = true var army: Dictionary = {} var totalBlud: float = 0 var remainingTime: String = "0" +var maxBludGen = 0 func _ready(): if is_win: @@ -34,6 +35,7 @@ func _ready(): $TotalArmyComp/Separation/ArmyTotals/Necromancers/AmtNecromancer.text = "0" if !army.has("Necromancer") else str(army["Necromancer"]) $"TotalArmyComp/Separation/ArmyTotals/Pit Fiends/AmtPitFiend".text = "0" if !army.has("Pit Fiend") else str(army["Pit Fiend"]) $TotalArmyComp/Separation/TotalBludGen/AmtBlud.text = str(floor(totalBlud)) + $TotalArmyComp/Separation/MaxBludGen/MaxBludGen.text = str(maxBludGen) + "/s" func _on_quit_pressed(): get_tree().quit() diff --git a/Scripts/level.gd b/Scripts/level.gd index 2eb1ec0..b957a12 100644 --- a/Scripts/level.gd +++ b/Scripts/level.gd @@ -28,6 +28,7 @@ func win_screen(): end.level = enemy.level end.exp = enemy.experience end.message = "The holy knight Fabio is defeated, Evil has won and your magic staff is safe." + end.maxBludGen = player.maxBludGen self.queue_free() get_tree().root.add_child(end) @@ -41,6 +42,7 @@ func lose_screen(): end.exp = enemy.experience end.is_win = false end.message = "The holy knight Fabio destroyed you army of evil and left with your magic staff..." + end.maxBludGen = player.maxBludGen self.queue_free() get_tree().root.add_child(end)