Fix tile highlights for channeling spirit
This commit is contained in:
@@ -2524,7 +2524,7 @@ func _valid_play_tiles(card: Dictionary) -> Array:
|
|||||||
if dist < min_r or dist > max_r: continue
|
if dist < min_r or dist > max_r: continue
|
||||||
var tile : Dictionary = Game.get_tile(tx, ty)
|
var tile : Dictionary = Game.get_tile(tx, ty)
|
||||||
if tile.get("occupantId"): continue
|
if tile.get("occupantId"): continue
|
||||||
if card_affinity != "" and tile.get("resolvedAffinity", "Void") != card_affinity: continue
|
if card_affinity != "" and not _tile_matches_channel_affinity(tile, card_affinity): continue
|
||||||
results.append(Vector2i(tx, ty))
|
results.append(Vector2i(tx, ty))
|
||||||
|
|
||||||
"Terramorpha":
|
"Terramorpha":
|
||||||
@@ -2539,6 +2539,21 @@ func _valid_play_tiles(card: Dictionary) -> Array:
|
|||||||
return results
|
return results
|
||||||
|
|
||||||
|
|
||||||
|
func _tile_matches_channel_affinity(tile: Dictionary, card_affinity: String) -> bool:
|
||||||
|
var resolved_affinity : String = str(tile.get("resolvedAffinity", "Void"))
|
||||||
|
if resolved_affinity == "PerfectAether" and card_affinity in ["Lake", "Hill", "Forest", "Field"]:
|
||||||
|
return true
|
||||||
|
if resolved_affinity == "UnstableAether":
|
||||||
|
return false
|
||||||
|
|
||||||
|
if card_affinity in ["Void", "Aether", "Lake", "Hill", "Forest", "Field"]:
|
||||||
|
var base1 : String = str(tile.get("base1", "Void"))
|
||||||
|
var base2 : String = str(tile.get("base2", "Void"))
|
||||||
|
return base1 == card_affinity or base2 == card_affinity
|
||||||
|
|
||||||
|
return resolved_affinity == card_affinity
|
||||||
|
|
||||||
|
|
||||||
func _terra_count_for_card(card: Dictionary) -> int:
|
func _terra_count_for_card(card: Dictionary) -> int:
|
||||||
match card.get("terramorphaMode", ""):
|
match card.get("terramorphaMode", ""):
|
||||||
"Mono": return 1
|
"Mono": return 1
|
||||||
|
|||||||
Reference in New Issue
Block a user