Files
EscapistsReintroduced/tests/test_initial_guard_policy.py
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

30 lines
1.4 KiB
Python

"""Execute initial readiness policy; native population timing needs engine tests."""
from policy_harness import ROOT, body, run
p = ROOT/'addons/core/Scripts/Game/ERR/00_Core/ERR_InitialGuardRules.c'
s = '\n'.join(body(p, signature) for signature in ('static float TimeoutMilliseconds(', 'static ERR_PrepareResult State(')).replace('ERR_PrepareResult.', 'ERR_PrepareResult::')
run('''#include <cassert>
#include <initializer_list>
enum class ERR_PrepareResult { FAILED=-1,PENDING,READY };
''' + s + '''
int main() {
using R=ERR_PrepareResult;
assert(TimeoutMilliseconds()==90000);
for(int requested: {1,6,12}) {
for(int physical=0;physical<=requested;physical++) {
for(int alive=0;alive<=physical;alive++) {
assert(State(requested,physical,alive,false,false)==R::PENDING);
assert(State(requested,physical,alive,true,false)==((alive==requested)?R::READY:R::PENDING));
assert(State(requested,physical,alive,true,true)==R::FAILED);
assert(State(requested,physical,alive,false,true)==R::FAILED);
}
}
assert(State(requested,requested+1,requested,true,false)==R::FAILED);
}
assert(State(0,0,0,true,false)==R::FAILED);
assert(State(6,2,3,false,false)==R::FAILED);
assert(State(6,-1,0,false,false)==R::FAILED);
assert(State(6,1,-1,false,false)==R::FAILED);
}
''')
print('PASS: requested guard population requires complete physical conscious membership before deadline')