From abf5181ef8d917ebd13814fd5253de7728677bf6 Mon Sep 17 00:00:00 2001 From: Sebastian Benjamin Date: Mon, 6 Oct 2025 00:06:21 -0700 Subject: [PATCH] Make art collector use critical anim after bid --- art_collector.gd | 8 ++++--- art_collector.tscn | 52 ++++++++++++++++++++++++++++++++++++++++++++- audience_manager.gd | 13 +++++++++++- numpad.gd | 1 - 4 files changed, 68 insertions(+), 6 deletions(-) diff --git a/art_collector.gd b/art_collector.gd index f35659b..53357a3 100644 --- a/art_collector.gd +++ b/art_collector.gd @@ -4,17 +4,19 @@ func _ready() -> void: $ArtCollectorAnimations.set_frame(randi_range(0, 16)) #$ArtCollectorAnimations.animation_finished.connect(_handle_anim_finish) +func idle(): + $ArtCollectorAnimations.play("Idle") + func normal_paddle(): $ArtCollectorAnimations.play("NormalPaddle") $NormalPaddleSound.play() $PaddleSuccess.play() await $ArtCollectorAnimations.animation_finished - $ArtCollectorAnimations.play("Idle") - + $ArtCollectorAnimations.play("Shiny") func critical_paddle(): $ArtCollectorAnimations.play("CriticalPaddle") await $ArtCollectorAnimations.animation_finished - $ArtCollectorAnimations.play("Idle") + $ArtCollectorAnimations.play("Shiny") #func _handle_anim_finish diff --git a/art_collector.tscn b/art_collector.tscn index 159e9d8..cb47483 100644 --- a/art_collector.tscn +++ b/art_collector.tscn @@ -346,6 +346,56 @@ animations = [{ "loop": false, "name": &"NormalPaddle", "speed": 24.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_vp5vb") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_4o6uv") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_pabkp") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_t2a8s") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_ypxfg") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_6cx6j") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_wrdlt") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_unhb4") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_pcdte") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_h2xbm") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_6btbk") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_cbt5b") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_pabkp") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_t2a8s") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_t2a8s") +}], +"loop": true, +"name": &"Shiny", +"speed": 5.0 }] [node name="ArtCollector" type="Node2D" groups=["ArtCollectors"]] @@ -354,7 +404,7 @@ script = ExtResource("1_dsoqt") [node name="ArtCollectorAnimations" type="AnimatedSprite2D" parent="."] texture_filter = 1 sprite_frames = SubResource("SpriteFrames_5k0jt") -animation = &"Idle" +animation = &"CriticalPaddle" autoplay = "Idle" [node name="NormalPaddleSound" type="AudioStreamPlayer" parent="."] diff --git a/audience_manager.gd b/audience_manager.gd index 47b05ca..9e81a0b 100644 --- a/audience_manager.gd +++ b/audience_manager.gd @@ -7,6 +7,7 @@ class_name AudienceManager extends Node2D signal ask_accepted var bark_critical := false +var currently_animated_collector = null #ideally variable for influencing how much the audience responds to barks @export var audience_susceptibility := 0.4: @@ -30,6 +31,8 @@ func _ready() -> void: desk.numpad.ask_proposed.connect(_handle_ask_proposed) timer.timeout.connect(_handle_bid_delay_timeout) bark_buttons.auctioneer_bark.connect(_handle_auctioneer_bark) + desk.numpad.reminder_timer.timeout.connect(try_clear_currently_animated_collector) + desk.gavel.gavel_hit.connect(try_clear_currently_animated_collector) func raise_paddle(): #need to add in logic to animate paddle being raised @@ -38,6 +41,10 @@ func raise_paddle(): game_manager.current_bid = desk.numpad.proposed_ask var collectors: Array[Node] = get_tree().get_nodes_in_group("ArtCollectors") collectors.shuffle() + + try_clear_currently_animated_collector() + currently_animated_collector = collectors[0] + if bark_critical: collectors[0].critical_paddle() print("play crit paddle") @@ -47,7 +54,11 @@ func raise_paddle(): bark_critical = false ask_accepted.emit() - +func try_clear_currently_animated_collector(): + if currently_animated_collector: + currently_animated_collector.idle() + currently_animated_collector = null + func _handle_auctioneer_bark(): if timer.time_left >= think_min_time: bark_critical = true diff --git a/numpad.gd b/numpad.gd index 9262bc8..09fc2f5 100644 --- a/numpad.gd +++ b/numpad.gd @@ -16,7 +16,6 @@ var turn_manager: TurnManager func _ready() -> void: progress_bar.max_value = reminder_timer.wait_time - func _process(delta: float) -> void: progress_bar.value = reminder_timer.time_left