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
+23
View File
@@ -0,0 +1,23 @@
"""Execute spectator key-edge and retained firearm eligibility policies."""
from policy_harness import ROOT,body,run
core=ROOT/'addons/core/Scripts/Game/ERR/00_Core'
cycle=body(core/'ERR_Observer.c','static int Cycle(')
firearm=body(core/'ERR_UnconsciousWeapon.c','static bool Firearm(').replace('EWeaponType.','EWeaponType::')
run('''#include <cassert>
#include <initializer_list>
namespace EWeaponType {enum{WT_NONE,WT_RIFLE,WT_GRENADELAUNCHER,WT_SNIPERRIFLE,WT_ROCKETLAUNCHER,WT_MACHINEGUN,WT_HANDGUN,WT_FRAGGRENADE,WT_SMOKEGRENADE,WT_AUTOCANNON,WT_COUNT};}
'''+cycle+firearm+'''
int main(){
assert(Cycle(true,true,false,false,false)==-1);
assert(Cycle(true,false,true,false,false)==1);
assert(Cycle(true,true,false,true,false)==0); // held arrow does not repeat
assert(Cycle(true,false,true,false,true)==0);
assert(Cycle(true,true,true,false,false)==0); // opposing arrows cancel
assert(Cycle(false,true,false,false,false)==0); // menus/chat consume input
assert(Cycle(false,false,true,false,false)==0);
assert(Cycle(true,false,true,true,false)==1); // direct direction change
for(int kind=0;kind<EWeaponType::WT_COUNT;kind++) assert(Firearm(kind)==(kind>=1&&kind<=6));
assert(!Firearm(-1)&&!Firearm(100)); // no grenade/gadget/turret retention
}
''')
print('PASS: arrow press/release, held keys, opposing keys, disabled/menu input and firearm-only retention')