fix debug_print, other odds and ends

This commit is contained in:
tonydero 2024-10-21 13:09:51 -06:00
parent f3189d2dd9
commit 70a879529a
5 changed files with 15 additions and 19 deletions

View File

@ -96,6 +96,7 @@ func _get_targets_in_range(enemies) -> Array:
func _apply_status() -> void: func _apply_status() -> void:
# TODO: Try passing damage and status type to target for mods, e.g. burning or stunned, and use with singleton stats to add thread to target for damage or do other things depending on the case # TODO: Try passing damage and status type to target for mods, e.g. burning or stunned, and use with singleton stats to add thread to target for damage or do other things depending on the case
# unnecessary... can just use await get_tree().create_timer(time).timeout
pass pass

View File

@ -47,6 +47,6 @@ class Ability:
DOTE DOTE
} }
func debug_print(value) -> void: func debug_print(value : String) -> void:
if OS.is_debug_build(): if OS.is_debug_build():
debug_print(value) print(value)

View File

@ -18,10 +18,9 @@ func _ready() -> void:
func _on_enemy_died(enemyDifficulty, enemyTier, _enemyFaction) -> void: func _on_enemy_died(enemyDifficulty, enemyTier, _enemyFaction) -> void:
var kill_exp = pow(pow(enemyTier + 1, 3), enemyDifficulty) var kill_exp = pow(pow(enemyTier + 1, 3), enemyDifficulty)
area_exp += kill_exp area_exp += kill_exp
# if Globals.debug: # Globals.debug_print("T: " + str(enemyTier) + " D: " + str(enemyDifficulty))
# print("T: ", enemyTier, " D: ", enemyDifficulty) # Globals.debug_print("K: " + str(kill_exp))
# print("K: ", kill_exp) # Globals.debug_print("A: " + str(area_exp))
# print("A: ",area_exp)
# TODO: maybe show earned exp on bar, separate from current # TODO: maybe show earned exp on bar, separate from current
# use xp to next level and current level, subtract, figure out percentage per point exp, add to display? # use xp to next level and current level, subtract, figure out percentage per point exp, add to display?

View File

@ -73,10 +73,10 @@ func _on_spawn_timer_timeout() -> void:
func _on_area_continue_pressed() -> void: func _on_area_continue_pressed() -> void:
$SpawnTimer.stop() $SpawnTimer.stop()
Globals.debug_print("spawn timer stopped") # Globals.debug_print("spawn timer stopped")
while get_child_count() > 1: while get_child_count() > 1:
await get_tree().create_timer(1.0).timeout await get_tree().create_timer(1.0).timeout
Globals.debug_print("waiting for children to go to 1 or less") # Globals.debug_print("waiting for children to go to 1 or less")
Globals.debug_print(get_child_count()) # Globals.debug_print(get_child_count())
self.queue_free() self.queue_free()
Globals.debug_print("area queued tor free") # Globals.debug_print("area queued tor free")

View File

@ -1,4 +1,3 @@
# TODO: convert to just combat UI, instancing appropriate zone/area
# BUG: elements not adjusting properly when moving to second monitor # BUG: elements not adjusting properly when moving to second monitor
extends Control extends Control
@ -35,7 +34,6 @@ func _create_area() -> void:
move_child(worldArea, 0) move_child(worldArea, 0)
func _on_button_test_pressed() -> void: func _on_button_test_pressed() -> void:
%DebugMenu/ButtonTest.text = "pass"
pass pass
@ -49,23 +47,21 @@ func _continue_show() -> void:
func _go_next_area() -> void: func _go_next_area() -> void:
var prevAreaQuest = currentAreaQuest var prevAreaQuest = currentAreaQuest
# FIXME: breaks at some point?
SignalBus.area_continue_pressed.emit() SignalBus.area_continue_pressed.emit()
Globals.debug_print("gna signal emitted") # Globals.debug_print("gna signal emitted")
%QuestsContainer.remove_child(prevAreaQuest) %QuestsContainer.remove_child(prevAreaQuest)
Globals.debug_print("gna quest removed") # Globals.debug_print("gna quest removed")
prevAreaQuest.queue_free() prevAreaQuest.queue_free()
Globals.debug_print("gna quest queued to free") # Globals.debug_print("gna quest queued to free")
_create_area() _create_area()
Globals.debug_print("gna new area created") # Globals.debug_print("gna new area created")
func _on_quest_generated(quest) -> void: func _on_quest_generated(quest) -> void:
currentAreaQuest = quest currentAreaQuest = quest
%QuestsContainer.add_child(currentAreaQuest) %QuestsContainer.add_child(currentAreaQuest)
# TODO: move all quest stuff to quest class?
func _on_quest_completed() -> void: func _on_quest_completed() -> void:
if %UITop/AutoCheck.button_pressed: if %UITop/AutoCheck.button_pressed:
_go_next_area() _go_next_area()