Files
EscapistsReintroduced/tests/test_site_discovery_policy.py
T
jakub cab998fb64 Combine Workshop addon and fix prison startup
Merge owned systems into one addon while preserving resource identities. Gate player admission on the replicated prison scene, restore the original framed door, and hold enemy AI until escape. Correct scenario branding and author metadata, include publishing assets, and retain regression and native verification evidence.
2026-09-20 16:42:52 +02:00

26 lines
1.3 KiB
Python

"""Execute production discovery bounds; native LOS/identity remain runtime checks."""
from policy_harness import ROOT, body, run
source = ROOT / 'addons/core/Scripts/Game/ERR/00_Core/ERR_SiteDiscoveryRules.c'
methods = '\n'.join(body(source, sig) for sig in (
'static float RadioRadiusLimit(', 'static bool ValidRadius(', 'static bool InRange('
)).replace('ERR_LocationKind.', 'ERR_LocationKind::')
run('''#include <cassert>
enum class ERR_LocationKind { PRISON, RADIO, EXTRACTION, OUTPOST, DEPOT };
''' + methods.replace('int kind,', 'ERR_LocationKind kind,') + '''
int main() {
using K=ERR_LocationKind;
assert(ValidRadius(K::RADIO,0) && ValidRadius(K::RADIO,8));
assert(!ValidRadius(K::RADIO,8.01f) && !ValidRadius(K::RADIO,-1));
assert(ValidRadius(K::DEPOT,60) && ValidRadius(K::OUTPOST,60));
assert(!ValidRadius(K::DEPOT,60.01f));
assert(ValidRadius(K::PRISON,0) && ValidRadius(K::EXTRACTION,0));
assert(!ValidRadius(K::PRISON,1) && !ValidRadius(K::EXTRACTION,1));
assert(!ValidRadius(static_cast<K>(42),0));
assert(InRange(8,8,8) && InRange(8,0,0));
assert(!InRange(0,0,0) && !InRange(8,8.01f,0));
assert(!InRange(8,0,8.01f) && !InRange(8,-1,0) && !InRange(8,0,-1));
}
''')
print('PASS: authored radio/optional-site bounds and physical horizontal/vertical boundaries')