From e7baa34859eca74789922b0c55bf3792e46525ef Mon Sep 17 00:00:00 2001 From: Sch1nken Date: Sat, 30 Mar 2024 12:23:53 +0100 Subject: [PATCH] Fixed some bugs. Fixed regression in 4th round bee rule --- ActionBehaviour/Prefabs/ActionBehaviourMosquito.gd | 7 ++++++- Tile/Tile.gd | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ActionBehaviour/Prefabs/ActionBehaviourMosquito.gd b/ActionBehaviour/Prefabs/ActionBehaviourMosquito.gd index 2fa7a0b..c6863d3 100644 --- a/ActionBehaviour/Prefabs/ActionBehaviourMosquito.gd +++ b/ActionBehaviour/Prefabs/ActionBehaviourMosquito.gd @@ -26,6 +26,8 @@ func get_targets(source_pos: Vector4i, map: HexGrid) -> Array[InsectTile]: # TODO: Update movement selection if source_pos.w > 0: return [] + + var can_move: bool = map.can_hive_exist_without_tile(map.get_tile(source_pos)) var neighbours = map.get_neighbours(source_pos) # Filter out other mosquitos @@ -37,8 +39,11 @@ func get_targets(source_pos: Vector4i, map: HexGrid) -> Array[InsectTile]: if tile.resource.movement_behaviour is MovementBehaviourMosquito: continue - if tile.resource.movement_behaviour.get_available_spaces(source_pos, map).size() > 0: + if tile.resource.action_behaviour != null: possible_action_targets.push_back(tile) + elif tile.resource.movement_behaviour.get_available_spaces(source_pos, map).size() > 0: + if can_move: + possible_action_targets.push_back(tile) #GameEvents.insect_tiles_selected_for_action.emit(source_pos, possible_action_targets) diff --git a/Tile/Tile.gd b/Tile/Tile.gd index 17ab70d..fe27be2 100644 --- a/Tile/Tile.gd +++ b/Tile/Tile.gd @@ -134,7 +134,7 @@ func _on_turn_started(turn_num: int, map: HexGrid, _is_blacks_turn: bool) -> voi can_be_selected = GameData.bees_placed.has(is_black) #print(GameData.has_bee_been_placed) if turn_num >= 7 and not GameData.bees_placed.has(is_black): - can_be_selected = true + can_be_selected = false if can_be_selected: tween_normal()