add error catch

MSE failed to start up if you had an unhandled replacement, like "Totem Armor"
This commit is contained in:
cajun
2024-01-15 17:59:50 -06:00
parent 3f28998afd
commit 8fb6d6e78a

View File

@@ -847,12 +847,13 @@ auto_correct :=
replace: { _1 + _2 + to_lower(_3)})
auto_errata :=
replace@(match:"converted mana cost", replace:"mana value")
+replace@(match:"(?i)(Totem armor|Totembeistand|Armadura tótem|totémique|Armatura totem|Armadura de totem|族霊鎧|替身甲)", replace:{errata_map[_1]})
+replace@(match:"(?i)(Totem armor|Totembeistand|Armadura tótem|totémique|Armatura totem|Armadura de totem|族霊鎧|替身甲)", replace:{errata_map[_1] or else _1})
+replace@(match:"hen shuffle your library", replace:"hen shuffle")
+replace@(match:"this (?:ability )?(?:only )?(?:any ?time you could cast|as) a", in_context: "(Activate|Play) <match>n? (instant|sorcery)", replace:"only as a")
errata_map := [
"Totem armor": "Umbra armor",
"Totem Armor": "Umbra armor",
"totem armor": "umbra armor",
"Totembeistand": "Schattenbeistand",
"totembeistand": "schattenbeistand",