Make art collector use critical anim after bid
This commit is contained in:
parent
6298e2ad25
commit
abf5181ef8
4 changed files with 68 additions and 6 deletions
|
|
@ -4,17 +4,19 @@ func _ready() -> void:
|
||||||
$ArtCollectorAnimations.set_frame(randi_range(0, 16))
|
$ArtCollectorAnimations.set_frame(randi_range(0, 16))
|
||||||
#$ArtCollectorAnimations.animation_finished.connect(_handle_anim_finish)
|
#$ArtCollectorAnimations.animation_finished.connect(_handle_anim_finish)
|
||||||
|
|
||||||
|
func idle():
|
||||||
|
$ArtCollectorAnimations.play("Idle")
|
||||||
|
|
||||||
func normal_paddle():
|
func normal_paddle():
|
||||||
$ArtCollectorAnimations.play("NormalPaddle")
|
$ArtCollectorAnimations.play("NormalPaddle")
|
||||||
$NormalPaddleSound.play()
|
$NormalPaddleSound.play()
|
||||||
$PaddleSuccess.play()
|
$PaddleSuccess.play()
|
||||||
await $ArtCollectorAnimations.animation_finished
|
await $ArtCollectorAnimations.animation_finished
|
||||||
$ArtCollectorAnimations.play("Idle")
|
$ArtCollectorAnimations.play("Shiny")
|
||||||
|
|
||||||
|
|
||||||
func critical_paddle():
|
func critical_paddle():
|
||||||
$ArtCollectorAnimations.play("CriticalPaddle")
|
$ArtCollectorAnimations.play("CriticalPaddle")
|
||||||
await $ArtCollectorAnimations.animation_finished
|
await $ArtCollectorAnimations.animation_finished
|
||||||
$ArtCollectorAnimations.play("Idle")
|
$ArtCollectorAnimations.play("Shiny")
|
||||||
|
|
||||||
#func _handle_anim_finish
|
#func _handle_anim_finish
|
||||||
|
|
|
||||||
|
|
@ -346,6 +346,56 @@ animations = [{
|
||||||
"loop": false,
|
"loop": false,
|
||||||
"name": &"NormalPaddle",
|
"name": &"NormalPaddle",
|
||||||
"speed": 24.0
|
"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"]]
|
[node name="ArtCollector" type="Node2D" groups=["ArtCollectors"]]
|
||||||
|
|
@ -354,7 +404,7 @@ script = ExtResource("1_dsoqt")
|
||||||
[node name="ArtCollectorAnimations" type="AnimatedSprite2D" parent="."]
|
[node name="ArtCollectorAnimations" type="AnimatedSprite2D" parent="."]
|
||||||
texture_filter = 1
|
texture_filter = 1
|
||||||
sprite_frames = SubResource("SpriteFrames_5k0jt")
|
sprite_frames = SubResource("SpriteFrames_5k0jt")
|
||||||
animation = &"Idle"
|
animation = &"CriticalPaddle"
|
||||||
autoplay = "Idle"
|
autoplay = "Idle"
|
||||||
|
|
||||||
[node name="NormalPaddleSound" type="AudioStreamPlayer" parent="."]
|
[node name="NormalPaddleSound" type="AudioStreamPlayer" parent="."]
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ class_name AudienceManager extends Node2D
|
||||||
|
|
||||||
signal ask_accepted
|
signal ask_accepted
|
||||||
var bark_critical := false
|
var bark_critical := false
|
||||||
|
var currently_animated_collector = null
|
||||||
|
|
||||||
#ideally variable for influencing how much the audience responds to barks
|
#ideally variable for influencing how much the audience responds to barks
|
||||||
@export var audience_susceptibility := 0.4:
|
@export var audience_susceptibility := 0.4:
|
||||||
|
|
@ -30,6 +31,8 @@ func _ready() -> void:
|
||||||
desk.numpad.ask_proposed.connect(_handle_ask_proposed)
|
desk.numpad.ask_proposed.connect(_handle_ask_proposed)
|
||||||
timer.timeout.connect(_handle_bid_delay_timeout)
|
timer.timeout.connect(_handle_bid_delay_timeout)
|
||||||
bark_buttons.auctioneer_bark.connect(_handle_auctioneer_bark)
|
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():
|
func raise_paddle():
|
||||||
#need to add in logic to animate paddle being raised
|
#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
|
game_manager.current_bid = desk.numpad.proposed_ask
|
||||||
var collectors: Array[Node] = get_tree().get_nodes_in_group("ArtCollectors")
|
var collectors: Array[Node] = get_tree().get_nodes_in_group("ArtCollectors")
|
||||||
collectors.shuffle()
|
collectors.shuffle()
|
||||||
|
|
||||||
|
try_clear_currently_animated_collector()
|
||||||
|
currently_animated_collector = collectors[0]
|
||||||
|
|
||||||
if bark_critical:
|
if bark_critical:
|
||||||
collectors[0].critical_paddle()
|
collectors[0].critical_paddle()
|
||||||
print("play crit paddle")
|
print("play crit paddle")
|
||||||
|
|
@ -47,7 +54,11 @@ func raise_paddle():
|
||||||
bark_critical = false
|
bark_critical = false
|
||||||
ask_accepted.emit()
|
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():
|
func _handle_auctioneer_bark():
|
||||||
if timer.time_left >= think_min_time:
|
if timer.time_left >= think_min_time:
|
||||||
bark_critical = true
|
bark_critical = true
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@ var turn_manager: TurnManager
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
progress_bar.max_value = reminder_timer.wait_time
|
progress_bar.max_value = reminder_timer.wait_time
|
||||||
|
|
||||||
|
|
||||||
func _process(delta: float) -> void:
|
func _process(delta: float) -> void:
|
||||||
progress_bar.value = reminder_timer.time_left
|
progress_bar.value = reminder_timer.time_left
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue