42 lines
1.1 KiB
GDScript
42 lines
1.1 KiB
GDScript
extends Node2D
|
|
|
|
@export var desk: Desk
|
|
@export var timer: Timer
|
|
@export var game_manager: GameManager
|
|
|
|
signal ask_accepted
|
|
|
|
#ideally variable for influencing how much the audience responds to barks
|
|
@export var audience_susceptibility := 0.4:
|
|
set(value):
|
|
audience_susceptibility = clamp(value, 0, 1)
|
|
|
|
#meant to make the audience more inclined to bid as day progresses
|
|
@export var audience_time_pressure := 1.4
|
|
|
|
@export var bid_threshold := 3.0
|
|
@export var think_chance := 0.5
|
|
@export var think_min_time := 1.0
|
|
@export var think_max_time := 5.0
|
|
|
|
func _ready() -> void:
|
|
desk.numpad.ask_proposed.connect(_handle_ask_proposed)
|
|
timer.timeout.connect(_handle_bid_delay_timeout)
|
|
|
|
func raise_paddle():
|
|
#need to add in logic to animate paddle being raised
|
|
pass
|
|
|
|
func _handle_bid_delay_timeout():
|
|
if randf_range(1.2, 5.3) >= bid_threshold:
|
|
raise_paddle()
|
|
game_manager.current_bid = desk.numpad.proposed_ask
|
|
ask_accepted.emit()
|
|
timer.stop()
|
|
|
|
func _handle_ask_proposed():
|
|
if randf() <= think_chance:
|
|
timer.stop()
|
|
var ask_duration: float = randf_range(1.0, 5.0)
|
|
timer.wait_time = ask_duration
|
|
timer.start()
|