generated from krampus/template-godot4
reverses turn order sort
This commit is contained in:
parent
688ffcbf47
commit
15c9fd812e
@ -169,18 +169,6 @@ func cancel_placement() -> void:
|
|||||||
|
|
||||||
|
|
||||||
func start_day() -> void:
|
func start_day() -> void:
|
||||||
if (
|
|
||||||
current_board_state.day > 0
|
|
||||||
and current_board_state.state != BoardState.State.PLACING_SPAWNS
|
|
||||||
and current_board_state.state != BoardState.State.DESTROYING_BUILDINGS
|
|
||||||
):
|
|
||||||
current_board_state.players.sort_custom(
|
|
||||||
func(p1: Player, p2: Player) -> bool: return p1.money > p2.money
|
|
||||||
)
|
|
||||||
current_board_state.current_player = current_board_state.players[0]
|
|
||||||
|
|
||||||
await all_players_ready_for_day_start
|
|
||||||
|
|
||||||
if current_board_state.state == BoardState.State.DESTROYING_BUILDINGS:
|
if current_board_state.state == BoardState.State.DESTROYING_BUILDINGS:
|
||||||
if current_board_state.buildings_to_destroy > 0:
|
if current_board_state.buildings_to_destroy > 0:
|
||||||
if current_board_state.current_player.id == Globals.game.this_player.id:
|
if current_board_state.current_player.id == Globals.game.this_player.id:
|
||||||
@ -196,6 +184,15 @@ func start_day() -> void:
|
|||||||
)
|
)
|
||||||
return
|
return
|
||||||
current_board_state.state = BoardState.State.DRAFT
|
current_board_state.state = BoardState.State.DRAFT
|
||||||
|
|
||||||
|
if current_board_state.day > 0:
|
||||||
|
current_board_state.players.sort_custom(
|
||||||
|
func(p1: Player, p2: Player) -> bool: return p1.money < p2.money
|
||||||
|
)
|
||||||
|
current_board_state.current_player = current_board_state.players[0]
|
||||||
|
|
||||||
|
await all_players_ready_for_day_start
|
||||||
|
|
||||||
current_board_state.day += 1
|
current_board_state.day += 1
|
||||||
current_board_state.turn = 1
|
current_board_state.turn = 1
|
||||||
current_board_state.state = BoardState.State.DRAFT
|
current_board_state.state = BoardState.State.DRAFT
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user