fix: add Land role detection to _detect_card_roles (fixes basics showing as Unknown)

This commit is contained in:
KoalaTrapLord committed 2026-03-27 20:28:35 -04:00
1 parent 81fe5108d2
commit 1c491bc2b0
1 file changed
+9 -1
+9 -1
View File
@@ -15,6 +15,14 @@ def _detect_card_roles(oracle_text: str, type_line: str, keywords) -> list:
kw_raw = []
kw = " ".join(str(k).lower() for k in kw_raw)
# Land check must come first — basic lands have empty oracle_text so every
# other check below would silently miss them, leaving them as Unknown role.
if "land" in tl:
roles.append("Land")
if not ot:
# Basic lands have no oracle text; no other role applies.
return roles
if ("add {" in ot or "add one mana" in ot
or ("search your library for a" in ot and "land" in ot)
or "treasure token" in ot or "add mana" in ot):
@@ -78,4 +86,4 @@ def _detect_card_roles(oracle_text: str, type_line: str, keywords) -> list:
or "take an extra" in ot
or ("double" in ot and ("damage" in ot or "counters" in ot or "tokens" in ot))):
roles.append("Combo")
return roles
return roles