Fixed more movement bugs, disabled expansions for now. Added turnendbehaviour (for bee, should add trigger by turn end signal)

This commit is contained in:
Sch1nken 2024-03-15 03:24:32 +01:00
parent 5722ffab48
commit 26fec25a6e
14 changed files with 154 additions and 37 deletions

View file

@ -4,6 +4,9 @@ class_name ActionBehaviour
func do_action() -> void:
pass
func select_targets(source_pos: Vector4i, map: HexGrid) -> void:
pass
# NOTE: When selecting a tile, check if there is an action behaviour
# If yes: In addition to showing moveable spaces (0 for the mosquito by default)
# also show action options (usually clicking other nearby tiles)

View file

@ -1,2 +1,16 @@
extends ActionBehaviour
class_name ActionBehaviourMosquito
# GameEvents.insect_tiles_selected_for_action
func select_targets(source_pos: Vector4i, map: HexGrid): # -> Array[InsectTile]:
var neighbours = map.get_neighbours(source_pos)
# Filter out other mosquitos
var possible_action_targets: Array[InsectTile] = []
for neighbour in neighbours:
var tile = map.get_tile(neighbour)
if tile != null:
# TODO: Find better way to see what tile we have...
if not tile.resource.movement_behaviour is MovementBehaviourMosquito:
possible_action_targets.push_back(tile)
GameEvents.insect_tiles_selected_for_action.emit(source_pos, possible_action_targets)

View file

@ -1,2 +1,12 @@
extends ActionBehaviour
class_name ActionBehaviourPillbug
func select_targets(source_pos: Vector4i, map: HexGrid): # -> Array[InsectTile]:
var neighbours = map.get_neighbours(source_pos)
var possible_action_targets: Array[InsectTile] = []
for neighbour in neighbours:
var tile = map.get_tile(neighbour)
if tile != null:
possible_action_targets.push_back(tile)
GameEvents.insect_tiles_selected_for_action.emit(source_pos, possible_action_targets)