make game more difficult
This commit is contained in:
parent
9897839420
commit
e86327a320
4 changed files with 43 additions and 13 deletions
|
|
@ -27,6 +27,8 @@ var currently_animated_collector = null
|
||||||
var current_ask: int
|
var current_ask: int
|
||||||
var latest_bidder: ArtCollector
|
var latest_bidder: ArtCollector
|
||||||
|
|
||||||
|
var acceptable_raise = 0
|
||||||
|
|
||||||
func _ready() -> void:
|
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)
|
||||||
|
|
@ -35,7 +37,6 @@ func _ready() -> void:
|
||||||
desk.gavel.gavel_hit.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
|
|
||||||
game_manager.state = game_manager.bidding_state.BID
|
game_manager.state = game_manager.bidding_state.BID
|
||||||
print("Audience accepts the bid at $" + str(current_ask))
|
print("Audience accepts the bid at $" + str(current_ask))
|
||||||
game_manager.current_bid = desk.numpad.proposed_ask
|
game_manager.current_bid = desk.numpad.proposed_ask
|
||||||
|
|
@ -65,7 +66,9 @@ func _handle_auctioneer_bark():
|
||||||
bark_critical = true
|
bark_critical = true
|
||||||
timer.stop()
|
timer.stop()
|
||||||
timer.timeout.emit()
|
timer.timeout.emit()
|
||||||
pass
|
else:
|
||||||
|
acceptable_raise += randi_range(100, 1000)
|
||||||
|
|
||||||
|
|
||||||
func _handle_bid_delay_timeout():
|
func _handle_bid_delay_timeout():
|
||||||
if game_manager.state == game_manager.bidding_state.ASKING:
|
if game_manager.state == game_manager.bidding_state.ASKING:
|
||||||
|
|
@ -76,7 +79,15 @@ func _handle_bid_delay_timeout():
|
||||||
func _handle_ask_proposed(amount):
|
func _handle_ask_proposed(amount):
|
||||||
current_ask = amount
|
current_ask = amount
|
||||||
|
|
||||||
if randf() <= think_chance:
|
if acceptable_raise == 0:
|
||||||
|
acceptable_raise = randf_range(0.1, 0.2) * current_ask
|
||||||
|
|
||||||
|
if game_manager.current_bid == 0:
|
||||||
|
if randf() < think_chance: _start_bid_timer()
|
||||||
|
elif current_ask - game_manager.current_bid <= acceptable_raise:
|
||||||
|
_start_bid_timer()
|
||||||
|
|
||||||
|
func _start_bid_timer():
|
||||||
timer.stop()
|
timer.stop()
|
||||||
var ask_duration: float = randf_range(min_audience_think_time, max_audience_think_time)
|
var ask_duration: float = randf_range(min_audience_think_time, max_audience_think_time)
|
||||||
timer.wait_time = ask_duration
|
timer.wait_time = ask_duration
|
||||||
|
|
|
||||||
|
|
@ -191,6 +191,8 @@ progress_bar = NodePath("../ProgressBar")
|
||||||
reminder_timer = NodePath("ReminderTimer")
|
reminder_timer = NodePath("ReminderTimer")
|
||||||
error_audio_player = NodePath("ErrorSoundPlayer")
|
error_audio_player = NodePath("ErrorSoundPlayer")
|
||||||
success_audio_player = NodePath("SuccessSoundPlayer")
|
success_audio_player = NodePath("SuccessSoundPlayer")
|
||||||
|
base_timer_duration = 10.0
|
||||||
|
timer_reduction_step = 0.4
|
||||||
|
|
||||||
[node name="Sprite2D" type="Sprite2D" parent="Numpad"]
|
[node name="Sprite2D" type="Sprite2D" parent="Numpad"]
|
||||||
texture_filter = 1
|
texture_filter = 1
|
||||||
|
|
|
||||||
|
|
@ -117,10 +117,9 @@ horizontal_alignment = 1
|
||||||
vertical_alignment = 1
|
vertical_alignment = 1
|
||||||
script = ExtResource("10_ryguw")
|
script = ExtResource("10_ryguw")
|
||||||
|
|
||||||
[node name="AudienceManager" parent="." node_paths=PackedStringArray("desk", "game_manager", "bark_buttons") instance=ExtResource("6_272bh")]
|
[node name="AudienceManager" parent="." node_paths=PackedStringArray("desk", "game_manager") instance=ExtResource("6_272bh")]
|
||||||
desk = NodePath("../Desk")
|
desk = NodePath("../Desk")
|
||||||
game_manager = NodePath("../GameManager")
|
game_manager = NodePath("../GameManager")
|
||||||
bark_buttons = NodePath("")
|
|
||||||
|
|
||||||
[node name="TurnManager" parent="." node_paths=PackedStringArray("desk", "captions", "audience_manager") instance=ExtResource("7_272bh")]
|
[node name="TurnManager" parent="." node_paths=PackedStringArray("desk", "captions", "audience_manager") instance=ExtResource("7_272bh")]
|
||||||
desk = NodePath("../Desk")
|
desk = NodePath("../Desk")
|
||||||
|
|
|
||||||
26
numpad.gd
26
numpad.gd
|
|
@ -4,7 +4,6 @@ var numpad_buffer = Array()
|
||||||
var proposed_ask: int
|
var proposed_ask: int
|
||||||
signal ask_proposed(amount)
|
signal ask_proposed(amount)
|
||||||
|
|
||||||
#var turn_manager: TurnManager
|
|
||||||
var audience_manager: AudienceManager
|
var audience_manager: AudienceManager
|
||||||
var game_manager: GameManager
|
var game_manager: GameManager
|
||||||
var turn_manager: TurnManager
|
var turn_manager: TurnManager
|
||||||
|
|
@ -14,6 +13,11 @@ var turn_manager: TurnManager
|
||||||
@export var error_audio_player: AudioStreamPlayer2D
|
@export var error_audio_player: AudioStreamPlayer2D
|
||||||
@export var success_audio_player: AudioStreamPlayer2D
|
@export var success_audio_player: AudioStreamPlayer2D
|
||||||
|
|
||||||
|
@export var base_timer_duration = 7.0
|
||||||
|
var timer_duration = base_timer_duration
|
||||||
|
|
||||||
|
@export var timer_reduction_step = 0.3
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
progress_bar.max_value = reminder_timer.wait_time
|
progress_bar.max_value = reminder_timer.wait_time
|
||||||
|
|
||||||
|
|
@ -42,7 +46,9 @@ func keypad_submit():
|
||||||
success_audio_player.play()
|
success_audio_player.play()
|
||||||
ask_proposed.emit(proposed_ask)
|
ask_proposed.emit(proposed_ask)
|
||||||
print("starting the bidding at $" + str(proposed_ask))
|
print("starting the bidding at $" + str(proposed_ask))
|
||||||
reminder_timer.start(-1)
|
|
||||||
|
reset_timer()
|
||||||
|
start_timer()
|
||||||
else:
|
else:
|
||||||
error_audio_player.play()
|
error_audio_player.play()
|
||||||
game_manager.bidding_state.ASKING:
|
game_manager.bidding_state.ASKING:
|
||||||
|
|
@ -50,7 +56,8 @@ func keypad_submit():
|
||||||
success_audio_player.play()
|
success_audio_player.play()
|
||||||
ask_proposed.emit(proposed_ask)
|
ask_proposed.emit(proposed_ask)
|
||||||
print("asking for $" + str(proposed_ask))
|
print("asking for $" + str(proposed_ask))
|
||||||
reminder_timer.start(-1)
|
|
||||||
|
start_timer()
|
||||||
else:
|
else:
|
||||||
error_audio_player.play()
|
error_audio_player.play()
|
||||||
game_manager.bidding_state.BID:
|
game_manager.bidding_state.BID:
|
||||||
|
|
@ -59,7 +66,8 @@ func keypad_submit():
|
||||||
success_audio_player.play()
|
success_audio_player.play()
|
||||||
ask_proposed.emit(proposed_ask)
|
ask_proposed.emit(proposed_ask)
|
||||||
print("asking for $" + str(proposed_ask))
|
print("asking for $" + str(proposed_ask))
|
||||||
reminder_timer.start(-1)
|
|
||||||
|
start_timer()
|
||||||
else:
|
else:
|
||||||
error_audio_player.play()
|
error_audio_player.play()
|
||||||
_:
|
_:
|
||||||
|
|
@ -68,3 +76,13 @@ func keypad_submit():
|
||||||
# need to avoid starting the reminder timer before
|
# need to avoid starting the reminder timer before
|
||||||
# the auction starts
|
# the auction starts
|
||||||
numpad_buffer.clear()
|
numpad_buffer.clear()
|
||||||
|
|
||||||
|
func reset_timer():
|
||||||
|
timer_duration = base_timer_duration
|
||||||
|
|
||||||
|
func start_timer():
|
||||||
|
reminder_timer.stop()
|
||||||
|
progress_bar.max_value = timer_duration
|
||||||
|
reminder_timer.start(timer_duration)
|
||||||
|
|
||||||
|
timer_duration -= timer_reduction_step
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue