Fixed Terramorpha, was order of operations, terra count being wiped right after being set
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"permissions": {
|
||||
"allow": [
|
||||
"Bash(find:*)"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -737,6 +737,7 @@ func _handle_board_click(mouse_pos: Vector2) -> void:
|
||||
_set_mode(Mode.NONE); return
|
||||
# Validate adjacency to previous target for Di/Tri.
|
||||
if _terra_targets.size() > 0:
|
||||
print("_terra_targets: ", _terra_targets.size())
|
||||
var last : Vector2i = _terra_targets.back()
|
||||
if abs(coord.x - last.x) + abs(coord.y - last.y) != 1:
|
||||
return # must be adjacent
|
||||
@@ -746,6 +747,8 @@ func _handle_board_click(mouse_pos: Vector2) -> void:
|
||||
_terra_targets.append(coord)
|
||||
print("Added Target")
|
||||
if _terra_targets.size() >= _terra_count:
|
||||
print("Entering here")
|
||||
print("_terra_count: ", _terra_count)
|
||||
# All tiles selected — send play.
|
||||
var targets := _terra_targets.map(func(v: Vector2i) -> Dictionary:
|
||||
return { "x": v.x, "y": v.y })
|
||||
@@ -1110,8 +1113,9 @@ func _on_hand_card_clicked(iid: String, _panel: PanelContainer) -> void:
|
||||
return
|
||||
_sel_card_id = iid
|
||||
_terra_targets = []
|
||||
_terra_count = _terra_count_for_card(card)
|
||||
print("_terra Array clean. _terra_count: ", _terra_count)
|
||||
_set_mode(Mode.TERRAMORPHA_SELECT)
|
||||
_terra_count = _terra_count_for_card(card)
|
||||
_clear_highlights()
|
||||
_highlight_tiles(_valid_play_tiles(card), HI_GREEN)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user