diff options
author | altaf-creator <dev@altafcreator.com> | 2024-04-15 10:04:22 +0700 |
---|---|---|
committer | altaf-creator <dev@altafcreator.com> | 2024-04-15 10:04:22 +0700 |
commit | a2b2d15604d4e8f5b4d7717e8cfc536d8df677d2 (patch) | |
tree | a4ecf885b6d8be5f9062f505a7c38ab189b7fbd8 /Scripts/NumberNode.gd | |
parent | 074227281d6b90a70bd39eb05222d45cc5474cf3 (diff) |
fix bugs, incorrect sounds on modifier, fix game finishes when ai is still calculating modifier
Diffstat (limited to 'Scripts/NumberNode.gd')
-rw-r--r-- | Scripts/NumberNode.gd | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/Scripts/NumberNode.gd b/Scripts/NumberNode.gd index b15f535..10a12e7 100644 --- a/Scripts/NumberNode.gd +++ b/Scripts/NumberNode.gd @@ -48,16 +48,21 @@ func _physics_process(_delta): func join_from(node : NumberNode): var prev_value = node.value + self.stored_prev_value = prev_value node.value += self.value + if self.modifier_operation != Operations.NONE: + stored_node = node + self.stored_prev_value = node.value $"ModifierTimer".start() GlobalVariables.gameloop.get_node("BetweenPlayerAndAI").wait_time = 2 - stored_node = node - stored_prev_value = prev_value + if GlobalVariables.gameloop.current_turns + 1 >= GlobalVariables.gameloop.turns: + GlobalVariables.gameloop.get_node("AudioDelay").wait_time = 2 else: GlobalVariables.gameloop.get_node("BetweenPlayerAndAI").wait_time = 1 + GlobalVariables.gameloop.get_node("AudioDelay").wait_time = 1 node.target_pos = self.position node.update_visuals() @@ -111,7 +116,6 @@ func softlock_check(): func _on_modifier_timer_timeout(): var node = stored_node - var prev_value = stored_prev_value var modifier_label = node.get_node_or_null("Control/ModifierLabel") @@ -130,10 +134,13 @@ func _on_modifier_timer_timeout(): node.get_node("Control/AnimationPlayer").play("mod") node.update_visuals() - - if node.value >= prev_value: + + if node.value >= self.stored_prev_value: + print(str(node.value) + " >= " + str(self.stored_prev_value)) node.get_node("Score").playing = true else: node.get_node("Ouch").playing = true + + self.stored_prev_value = node.value queue_free() |