* Add overridable hooks for sunk/reaped ball handling and turn behavior. * Implement default scoring and game-over messaging across game modes. * Add pretty game mode names for win-condition messages. * Update Free Ball, Last Ball, and Snooker modes to return win-condition messages. * Move the reset button lookup to the scene root for multiplayer setup. * Move camera controller scene to shared base UI. Move parts of it to new game_data UI node. * Add commented test state generation for end-state testing.
19 lines
454 B
GDScript
19 lines
454 B
GDScript
class_name LastBallMode extends BaseMode
|
|
|
|
|
|
@export var final_ball_name: String = ""
|
|
|
|
|
|
func on_ball_reaped(ball: Node3D) -> void:
|
|
if ball.name == final_ball_name:
|
|
ball_states[ball.name]["is_foul"] = true
|
|
|
|
func on_ball_sunk(ball: Node3D) -> void:
|
|
if ball.name == final_ball_name:
|
|
ball_states[ball.name]["is_foul"] = true
|
|
|
|
func process_win_condition() -> String:
|
|
var message: String = final_ball_name + " Win!"
|
|
push_warning(message)
|
|
return message
|