diff options
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() |