* Centralize ball state generation in `BaseMode` * Track turn count, player, and ball state consistently * Prevent 8-ball, 9-ball, and colored snooker balls from being marked valid when reaped/sunk * Update mode initialization and ball-state assignment * Normalize Free Ball mode node name to `freeball`
31 lines
622 B
GDScript
31 lines
622 B
GDScript
class_name FreeBall extends BaseMode
|
|
|
|
|
|
func _init() -> void:
|
|
pass
|
|
|
|
func reap_ball(ball: Node3D) -> void:
|
|
super(ball)
|
|
|
|
func process_ball(ball: Node3D) -> void:
|
|
super(ball)
|
|
|
|
func handle_switch_user() -> void:
|
|
push_warning("Balls reaped: ", balls_reaped.size() )
|
|
push_warning("Balls sunk: ", balls_sunk.size() )
|
|
|
|
if not balls_reaped.is_empty():
|
|
# TODO: Handle points, etc
|
|
balls_reaped.clear()
|
|
|
|
if balls_sunk.is_empty():
|
|
Globals.game_state.switch_active_player()
|
|
turn_count += 1
|
|
return
|
|
|
|
# TODO: Handle points, etc
|
|
# Globals.multiplayer_data.current_turn_player_id
|
|
|
|
balls_sunk.clear()
|
|
turn_count += 1
|