2024-03-14 22:13:33 +01:00
|
|
|
extends ActionBehaviour
|
|
|
|
|
class_name ActionBehaviourPillbug
|
2024-03-15 03:24:32 +01:00
|
|
|
|
|
|
|
|
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)
|