mirror of
https://github.com/bryanthaboi/gen1recomp.git
synced 2026-08-25 23:11:15 +02:00
Spider Car Unleashed
CLOSES #1483, CLOSES #1610, CLOSES #1615, CLOSES #1646, CLOSES #1649, CLOSES #1651, CLOSES #1653, CLOSES #1656, CLOSES #1683, CLOSES #1685, CLOSES #1686, CLOSES #1687, CLOSES #1688, CLOSES #1689, CLOSES #1690, CLOSES #1693, CLOSES #1694, CLOSES #1695, CLOSES #1696, CLOSES #1702, CLOSES #1704, CLOSES #1705, CLOSES #1706, CLOSES #1707, CLOSES #1708, CLOSES #1710, CLOSES #1711, CLOSES #1712, CLOSES #1713, CLOSES #1716, CLOSES #1717, CLOSES #1718, CLOSES #1719, CLOSES #1720, CLOSES #1721, CLOSES #1725, CLOSES #1732, CLOSES #1745, CLOSES #1748, CLOSES #1749, CLOSES #1751, CLOSES #1754
This commit is contained in:
+25
-4
@@ -58,7 +58,10 @@ BUNDLE_VERSION = 1
|
||||
CART_SCHEMA = 1
|
||||
|
||||
BASES = ("red", "blue", "yellow", "gold", "silver", "crystal")
|
||||
SEALS = ("sealed", "open")
|
||||
SEALS = ("sealed", "sealed+", "open")
|
||||
FINISHES = ("sparkle", "holo", "sparkle+holo")
|
||||
# GameSpeed.LEVELS (src/core/GameSpeed.lua)
|
||||
SPEED_LEVELS = (1, 2, 3, 4, 10, 20, 30, 50, 75, 100, 200)
|
||||
SOURCES = ("github", "gamebanana")
|
||||
MAX_MODS = 64
|
||||
MAX_OPTIONS = 64
|
||||
@@ -67,9 +70,10 @@ LABEL_WARN_BYTES = 256 * 1024
|
||||
LABEL_MAX_BYTES = 1024 * 1024
|
||||
|
||||
CART_KEYS = ("schema", "id", "title", "version", "author", "repo", "summary",
|
||||
"shell", "label", "base", "engine", "seal", "mods", "load_order")
|
||||
"shell", "finish", "label", "base", "engine", "seal", "speeds",
|
||||
"mods", "load_order")
|
||||
MOD_KEYS = ("id", "source", "repo", "version", "sha256", "mod", "file", "md5",
|
||||
"options")
|
||||
"enabled", "options")
|
||||
|
||||
ID_RE = re.compile(r"[A-Za-z0-9_-]{1,64}")
|
||||
SEMVER_RE = re.compile(
|
||||
@@ -338,7 +342,21 @@ def check_identity(cart, findings):
|
||||
|
||||
seal = cart.get("seal", "sealed")
|
||||
if seal not in SEALS:
|
||||
findings.append(err("CK002", '"seal" must be "sealed" or "open"'))
|
||||
findings.append(err("CK002", '"seal" must be one of: '
|
||||
+ ", ".join(SEALS)))
|
||||
finish = cart.get("finish")
|
||||
if finish is not None and finish not in FINISHES:
|
||||
findings.append(err("CK002", '"finish" must be one of: '
|
||||
+ ", ".join(FINISHES)))
|
||||
speeds = cart.get("speeds")
|
||||
if speeds is not None:
|
||||
if not isinstance(speeds, list) or not speeds:
|
||||
findings.append(err("CK002",
|
||||
'"speeds" must be a non-empty array'))
|
||||
elif any(v not in SPEED_LEVELS for v in speeds):
|
||||
findings.append(err("CK002", '"speeds" entries must be game-speed '
|
||||
'levels: '
|
||||
+ ", ".join(str(v) for v in SPEED_LEVELS)))
|
||||
|
||||
for key in cart:
|
||||
if key not in CART_KEYS:
|
||||
@@ -424,6 +442,9 @@ def check_mods(cart, findings):
|
||||
check_github_pin(entry, label, findings)
|
||||
else:
|
||||
check_gamebanana_pin(entry, label, findings)
|
||||
if "enabled" in entry and not isinstance(entry["enabled"], bool):
|
||||
findings.append(err("CK004", f"{label} enabled must be true or "
|
||||
"false; omit it to ship the mod on"))
|
||||
if "options" in entry and entry["options"] is not None:
|
||||
for problem in option_problems(entry["options"], label):
|
||||
findings.append(err("CK004", problem))
|
||||
|
||||
Reference in New Issue
Block a user