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
|
_set_mode(Mode.NONE); return
|
||||||
# Validate adjacency to previous target for Di/Tri.
|
# Validate adjacency to previous target for Di/Tri.
|
||||||
if _terra_targets.size() > 0:
|
if _terra_targets.size() > 0:
|
||||||
|
print("_terra_targets: ", _terra_targets.size())
|
||||||
var last : Vector2i = _terra_targets.back()
|
var last : Vector2i = _terra_targets.back()
|
||||||
if abs(coord.x - last.x) + abs(coord.y - last.y) != 1:
|
if abs(coord.x - last.x) + abs(coord.y - last.y) != 1:
|
||||||
return # must be adjacent
|
return # must be adjacent
|
||||||
@@ -746,6 +747,8 @@ func _handle_board_click(mouse_pos: Vector2) -> void:
|
|||||||
_terra_targets.append(coord)
|
_terra_targets.append(coord)
|
||||||
print("Added Target")
|
print("Added Target")
|
||||||
if _terra_targets.size() >= _terra_count:
|
if _terra_targets.size() >= _terra_count:
|
||||||
|
print("Entering here")
|
||||||
|
print("_terra_count: ", _terra_count)
|
||||||
# All tiles selected — send play.
|
# All tiles selected — send play.
|
||||||
var targets := _terra_targets.map(func(v: Vector2i) -> Dictionary:
|
var targets := _terra_targets.map(func(v: Vector2i) -> Dictionary:
|
||||||
return { "x": v.x, "y": v.y })
|
return { "x": v.x, "y": v.y })
|
||||||
@@ -1110,8 +1113,9 @@ func _on_hand_card_clicked(iid: String, _panel: PanelContainer) -> void:
|
|||||||
return
|
return
|
||||||
_sel_card_id = iid
|
_sel_card_id = iid
|
||||||
_terra_targets = []
|
_terra_targets = []
|
||||||
_terra_count = _terra_count_for_card(card)
|
print("_terra Array clean. _terra_count: ", _terra_count)
|
||||||
_set_mode(Mode.TERRAMORPHA_SELECT)
|
_set_mode(Mode.TERRAMORPHA_SELECT)
|
||||||
|
_terra_count = _terra_count_for_card(card)
|
||||||
_clear_highlights()
|
_clear_highlights()
|
||||||
_highlight_tiles(_valid_play_tiles(card), HI_GREEN)
|
_highlight_tiles(_valid_play_tiles(card), HI_GREEN)
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user