Default egg restocking to ten draws and add single-draw opt-in

This commit is contained in:
AttilaNet
2026-11-09 07:44:41 +08:00
parent d7ca68b5f9
commit df0259febf
7 changed files with 79 additions and 16 deletions
+2 -2
View File
@@ -2,7 +2,7 @@
import re
def battle_message(message):
def battle_message(message, *, translate_unknown=True):
text = str(message or "")
objective = "Non-elimination win/loss objective is unsupported"
units = "Protected/destroy objective units are unsupported"
@@ -33,6 +33,6 @@ def battle_message(message):
(r"Invalid numeric field: [^;;\n]+", "战斗数据包含无效数值,暂时无法模拟"),
):
text = re.sub(pattern, target, text)
if re.search(r"[a-zA-Z]{2,}", text) and not re.search(r"[\u3400-\u9fff]", text):
if translate_unknown and re.search(r"[a-zA-Z]{2,}", text) and not re.search(r"[\u3400-\u9fff]", text):
return "战斗模拟暂时无法处理当前数据,详细原因已保留在调试记录中"
return text