Make the base escape mission independent and add native objectives

This commit is contained in:
2026-09-19 02:03:52 +02:00
parent 7a507a7371
commit 92fd23f274
54 changed files with 5271 additions and 52 deletions
+11 -1
View File
@@ -5,7 +5,7 @@ import json,re,subprocess,sys
ROOT=Path(__file__).resolve().parents[1]
BASE='58D0FB3206B6F859'
def check():
ids={};graph={};resources={};paths={}
ids={};graph={};resources={};paths={};owners={}
for p in sorted((ROOT/'addons').glob('*/addon.gproj')):
text=p.read_text();g=re.search(r'GUID "([A-F0-9]{16})"',text)[1]
assert g not in ids,f'Duplicate addon GUID: {p}'
@@ -25,6 +25,13 @@ def check():
assert p.with_suffix('')==ROOT/'addons'/addon/path, f'Resource path mismatch: {p}'
assert p.with_suffix('').is_file(),f'Missing resource for {p}'
resources[g]=path;paths[path]=g
owners[g]=addon
def visible(g):
result={ids[g]}
for dep in graph[g]:
if dep!=BASE:result.update(visible(dep))
return result
visibility={ids[g]:visible(g) for g in ids}
vanilla=json.loads((ROOT/'docs/vanilla-resources.json').read_text())
for p in (ROOT/'addons').rglob('*'):
if not p.is_file() or p.suffix not in ['.c','.et','.conf','.ent','.layer','.layout','.emat']:continue
@@ -32,6 +39,9 @@ def check():
assert not re.search(r'\b(?:ESCT\w*|SCRTC_\w+|SCRT_\w+|EAI_\w+)\b',s),f'Original ecosystem dependency: {p}'
for g,path in re.findall(r'\{([A-F0-9]{16})\}([^"\n]+)',s):
assert resources.get(g)==path or vanilla.get(path)==g,f'Unresolved/mismatched resource in {p}: {g} {path}'
if g in owners:
addon=p.relative_to(ROOT/'addons').parts[0]
assert owners[g] in visibility[addon],f'Resource outside declared dependency graph in {p}: {g} {path}'
if p.suffix in ['.et','.conf','.ent','.layout','.emat']:
assert p.with_name(p.name+'.meta').exists(),f'Missing metadata: {p}'
print(f'PASS: {len(ids)} isolated addons, acyclic dependencies, {len(resources)} unique resources, exact vanilla references')