Weighted character selection

This commit is contained in:
2024-06-14 15:33:36 -04:00
parent ee6fa21177
commit 082b1353bc
36 changed files with 2914 additions and 160 deletions

View File

@@ -26,7 +26,7 @@ func create_boss_button(boss: Dictionary) -> TextureButton:
func _on_button_hovered(button: TextureButton, boss: Dictionary):
#current_member = member
#Generates the hovered tooltips
#The backslash \ allows you to continue to the next line while concatenating the string
var tooltip_text = "" + str(boss["name"]) + "\n" + "" + str(boss["description"]) + "\n" + "Total Health: " + str(boss["totalHealth"]) + "\n" + \
"Minimum DPS Required: " + str(boss["minDPS"])
@@ -38,7 +38,18 @@ func _on_button_exited(button: TextureButton):
func _on_button_pressed(button: TextureButton, boss: Dictionary):
#var character_manager = get_node("/root/Root/UI/CharacterRoll")
#character_manager.roll_character()
$CharacterRoll.roll_character()
#Checks you have the prerquisites, deducts damage
if Global.globalDamagePerClick >= int(boss["minClickDmg"]):
if Global.globalDamagePerSec >= int(boss["minDPS"]):
if Global.globalDamage >= int(boss["totalHealth"]):
var damageCost = int(boss["totalHealth"])
var bossTier = boss["bossTier"]
Global.globalDamage -= damageCost
$CharacterRoll.roll_character(bossTier)
else:
print("Not enough Total Damage!")
else:
print("Not enough DPS!")
else:
print("Not enough Damage per Click!")