1
0
Fork 0
mirror of https://github.com/ldericher/fftcgtool synced 2025-01-15 15:02:59 +00:00

Fixes for crystal cards

This commit is contained in:
Jörn-Michael Miehe 2022-07-18 14:13:18 +00:00
parent 72f7da75f8
commit 2d1526faca

View file

@ -42,6 +42,10 @@ def _load_name(language: Language, data: dict[str, Any]) -> str:
return data[f"Name{language.key_suffix}"] return data[f"Name{language.key_suffix}"]
def _load_type(language: Language, data: dict[str, Any]) -> str:
return data[f"Type{language.key_suffix}"]
def _load_text(language: Language, data: dict) -> str: def _load_text(language: Language, data: dict) -> str:
# load text # load text
text = str(data[f"Text{language.key_suffix}"]) text = str(data[f"Text{language.key_suffix}"])
@ -50,7 +54,7 @@ def _load_text(language: Language, data: dict) -> str:
# place elemental cost symbols # place elemental cost symbols
text = re.sub(rf"《([{''.join(_ELEMENTS_JAP)}])》", _sub_elements, text, flags=re.UNICODE) text = re.sub(rf"《([{''.join(_ELEMENTS_JAP)}])》", _sub_elements, text, flags=re.UNICODE)
# place crystal symbols # place crystal symbols
text = text.replace("《C》", "") text = text.replace("《C》", "")
# place dull symbols # place dull symbols
text = text.replace("《ダル》", "[⤵]") text = text.replace("《ダル》", "[⤵]")
# relocate misplaced line break markers # relocate misplaced line break markers
@ -101,7 +105,7 @@ class Card:
elements = ["Crystal"] elements = ["Crystal"]
content = { content = {
language: CardContent( language: CardContent(
name="", name=_load_type(language, data),
text="", text="",
face="", face="",
) )