Improve AI garrisons, player recovery and mission administration

This commit is contained in:
2026-09-24 22:12:45 +02:00
parent 1b1a8b5173
commit 2551d171b3
115 changed files with 3622 additions and 547 deletions
+17
View File
@@ -0,0 +1,17 @@
from policy_harness import ROOT, body, run
p=ROOT/'addons/core/Scripts/Game/ERR/00_Core/ERR_PlayerMedical.c'
rule=body(p,'static float AllowedDamage(').replace('Math.Clamp','std::clamp').replace('Math.Min','std::min').replace('Math.Max','std::max').replace('0.01','0.01f').replace(', 1)',', 1.0f)').replace('std::max(0,','std::max(0.0f,')
run('''#include <algorithm>
#include <cassert>
'''+rule+'''
int main(){
assert(AllowedDamage(-40,10,100,0)==-40); // medical treatment must pass unchanged
assert(AllowedDamage(0,10,100,0)==0);
assert(AllowedDamage(5,100,100,0)==5); // ordinary damage still wounds
assert(AllowedDamage(100000,100,100,0)==99); // lethal blow stops above destruction
assert(AllowedDamage(100000,30,100,0.2f)>8.99f&&AllowedDamage(100000,30,100,0.2f)<9.01f);
assert(AllowedDamage(50,1,100,0)==0); // repeated damage cannot finish casualty
assert(AllowedDamage(50,0,100,0)==0); // never turn positive damage into free healing
}
''')
print('PASS: lethal and repeated damage clamp above configured destruction thresholds; ordinary wounds and healing retain their values')