Blud_Mage/Scripts/ending.gd

40 lines
1.5 KiB
GDScript3
Raw Normal View History

2023-10-11 04:21:07 -04:00
extends Control
var killcount: int = 0
var level: int = 1
var exp: int = 0
var message: String = ""
var is_win: bool = true
2023-10-11 09:52:48 -04:00
var army: Dictionary = {}
var totalBlud: float = 0
2023-10-11 10:37:23 -04:00
var remainingTime: String = "0"
2023-10-11 04:21:07 -04:00
func _ready():
if is_win:
2023-10-11 09:52:48 -04:00
$WinningEnemy.hide()
$DeadEnemy.show()
$DeadEnemy.play("default")
2023-10-11 10:37:23 -04:00
$Time.show()
$Time/HBoxContainer/TimeLabel.text = remainingTime + " Seconds Remained"
2023-10-11 09:52:48 -04:00
if !is_win:
2023-10-11 10:37:23 -04:00
$Time.hide()
2023-10-11 09:52:48 -04:00
$WinningEnemy.show()
$DeadEnemy.hide()
$WinningEnemy.play("default")
2023-10-11 04:21:07 -04:00
$Message.text = message
$AmtKill.text = str(killcount)
$AmtLvl.text = str(level)
$AmtExp.text = str(exp)
2023-10-11 09:52:48 -04:00
$TotalArmyComp/Separation/ArmyTotals/Bats/Control/AnimatedSprite2D.play("default")
$TotalArmyComp/Separation/ArmyTotals/Wolves/Control/AnimatedSprite2D.play("default")
$TotalArmyComp/Separation/ArmyTotals/Necromancers/Control/AnimatedSprite2D.play("default")
$"TotalArmyComp/Separation/ArmyTotals/Pit Fiends/Control/AnimatedSprite2D".play("default")
$TotalArmyComp/Separation/ArmyTotals/Bats/AmtBat.text = "0" if !army.has("Bat") else str(army["Bat"])
$TotalArmyComp/Separation/ArmyTotals/Wolves/AmtWolves.text = "0" if !army.has("Wolf") else str(army["Wolf"])
$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"])
2023-10-11 10:37:23 -04:00
$TotalArmyComp/Separation/TotalBludGen/AmtBlud.text = str(floor(totalBlud))
2023-10-11 09:52:48 -04:00
2023-10-11 04:21:07 -04:00
func _on_quit_pressed():
get_tree().quit()