Prepared Movement behaviour. Fixed multi-tile placement bug
This commit is contained in:
parent
62eef907d3
commit
397082f966
17 changed files with 395 additions and 75 deletions
|
|
@ -1,8 +1,18 @@
|
|||
extends ActionBehaviour
|
||||
class_name ActionBehaviourMosquito
|
||||
|
||||
func do_action(source_tile: InsectTile, action_tile: InsectTile, map: HexGrid) -> void:
|
||||
pass
|
||||
|
||||
# GameEvents.insect_tiles_selected_for_action
|
||||
func select_targets(source_pos: Vector4i, map: HexGrid): # -> Array[InsectTile]:
|
||||
func get_targets(source_pos: Vector4i, map: HexGrid) -> Array[InsectTile]:
|
||||
# if on the hive, i.e. layer > 0, we always move like a beetle
|
||||
# so we can't use our action unless we're on layer 0
|
||||
# TODO: Update movement selection
|
||||
if source_pos.w > 0:
|
||||
map.debug_label(Vector3(source_pos.x, source_pos.y, source_pos.z), "TODO: Implement Beetle Movement")
|
||||
return []
|
||||
|
||||
var neighbours = map.get_neighbours(source_pos)
|
||||
# Filter out other mosquitos
|
||||
var possible_action_targets: Array[InsectTile] = []
|
||||
|
|
@ -10,8 +20,9 @@ func select_targets(source_pos: Vector4i, map: HexGrid): # -> Array[InsectTile]:
|
|||
var tile = map.get_tile(neighbour)
|
||||
if tile != null:
|
||||
# TODO: Find better way to see what tile we have...
|
||||
pass
|
||||
#if not tile.resource.movement_behaviour is MovementBehaviourMosquito:
|
||||
# possible_action_targets.push_back(tile)
|
||||
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)
|
||||
#GameEvents.insect_tiles_selected_for_action.emit(source_pos, possible_action_targets)
|
||||
|
||||
return possible_action_targets
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue