Make art collector use critical anim after bid

This commit is contained in:
Sebastian Benjamin 2025-10-06 00:06:21 -07:00
parent 6298e2ad25
commit abf5181ef8
4 changed files with 68 additions and 6 deletions

View file

@ -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

View file

@ -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="."]

View file

@ -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,6 +54,10 @@ 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:

View file

@ -17,7 +17,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