Fixed move penalty
This commit is contained in:
parent
e7baa34859
commit
b42b1ae39f
3 changed files with 37 additions and 9 deletions
|
|
@ -315,6 +315,9 @@ func _on_insect_tile_move_started(tile: InsectTile) -> void:
|
|||
do_move(tile)
|
||||
|
||||
func do_action(tile: InsectTile) -> void:
|
||||
for child in placement_visualizer.get_children():
|
||||
child.queue_free()
|
||||
|
||||
# get possible targets, pass the resource action callable with binds of source and target tile
|
||||
var targets = tile.get_action_behaviour().get_targets(tile.coordinates, self)
|
||||
|
||||
|
|
@ -331,13 +334,13 @@ func do_action(tile: InsectTile) -> void:
|
|||
pass
|
||||
|
||||
func do_move_as(source: InsectTile, copy: InsectTile) -> void:
|
||||
for child in placement_visualizer.get_children():
|
||||
child.queue_free()
|
||||
|
||||
if not can_hive_exist_without_tile(source):
|
||||
print("Cant to do move as. Cant exist without hive")
|
||||
return
|
||||
|
||||
for child in placement_visualizer.get_children():
|
||||
child.queue_free()
|
||||
|
||||
var spaces = copy.get_movement_behaviour().get_available_spaces(source.coordinates, self)
|
||||
|
||||
if spaces.is_empty():
|
||||
|
|
@ -390,6 +393,9 @@ func do_move_as(source: InsectTile, copy: InsectTile) -> void:
|
|||
placements[space] = outline
|
||||
|
||||
func create_move_tiles(tile: InsectTile, coords: Array[Vector4i]) -> void:
|
||||
for child in placement_visualizer.get_children():
|
||||
child.queue_free()
|
||||
|
||||
for space in coords:
|
||||
var layer: int = 0
|
||||
var temp_tile: InsectTile = null
|
||||
|
|
@ -516,6 +522,8 @@ func move_insect_tile(tile_coords: Vector4i, target: Vector4i) -> void:
|
|||
|
||||
tile.coordinates = target
|
||||
|
||||
#tile.move_round_penalty = 2
|
||||
|
||||
used_cells[tile.coordinates] = tile
|
||||
|
||||
if tile.coordinates.w > 0:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue