Capture current mission, AI, map and administration development
Include the current addon, terrain integrations, tools, regression tests and recorded development evidence.
This commit is contained in:
@@ -39,22 +39,22 @@ struct Hunters{bool Contains(SCR_AIGroup*){return false;}};
|
||||
struct ERR_HQ{Hunters hunters;Hunters* Hunters(){return &hunters;}static void Event(string,string){}};
|
||||
struct ERR_GameMode{ERR_HQ hq;ERR_HQ* Command(){return &hq;}};
|
||||
namespace ERR_EnemyEquipmentRules {bool Eligible(ERR_GameMode*,SCR_AIGroup*,IEntity* a){return a&&a->owned;}}
|
||||
namespace ERR_EnemyMedicalCatalog {const string EPI="epi",MORPHINE="morphine";bool Medic(string p){return p.Contains("medic");}bool Specialist(string p){return p.Contains("_sf");}}
|
||||
namespace ERR_EnemyMedicalCatalog {const string EPI="epi",COMBAT_EPI="combat-epi",MORPHINE="morphine";bool Medic(string p){return p.Contains("medic");}bool Specialist(string p){return p.Contains("_sf");}}
|
||||
namespace Math{int RandomInt(int,int){return 0;}}
|
||||
'''.replace('Hunters hunters;Hunters* Hunters()', 'struct Hunters hunters;struct Hunters* Hunters()')+s+r'''
|
||||
int main(){ERR_GameMode mode;SCR_AIGroup group;IEntity actor;InventoryStorageManagerComponent inventory;actor.inventory=&inventory;actor.prefab.path="_sf_medic";
|
||||
IEntity backpack;backpack.prefab.path="backpack";BaseInventoryStorageComponent bag;backpack.bag=&bag;inventory.items.push_back(&backpack);
|
||||
IEntity authored;authored.prefab.path="morphine";inventory.items.push_back(&authored);
|
||||
ERR_EnemyMedicine grant;inventory.fullBag=true;for(int i=0;i<20;i++)grant.Check(&mode,&group,&actor);
|
||||
assert(grant.m_Done&&grant.m_Issued==11&&inventory.accepted==11&&inventory.attempts==22); // six epi plus five missing morphine; refused bag falls back once
|
||||
assert(grant.m_Done&&grant.m_Issued==13&&inventory.accepted==13&&inventory.attempts==26); // six combat epi, two standard epi plus five missing morphine; refused bag falls back once
|
||||
int attempts=inventory.attempts;inventory.items.clear();for(int i=0;i<5;i++)grant.Check(&mode,&group,&actor);assert(inventory.attempts==attempts); // no refill after loot
|
||||
InventoryStorageManagerComponent blocked;actor.inventory=&blocked;blocked.async=true;ERR_EnemyMedicine pending;for(int i=0;i<35;i++)pending.Check(&mode,&group,&actor);assert(pending.m_Done&&blocked.accepted==1); // pending operation quarantined, never duplicated
|
||||
InventoryStorageManagerComponent unavailable;actor.inventory=&unavailable;unavailable.full=true;ERR_EnemyMedicine noSpace;noSpace.Check(&mode,&group,&actor);assert(noSpace.m_Done&&unavailable.accepted==0);
|
||||
InventoryStorageManagerComponent specialStock;actor.inventory=&specialStock;actor.prefab.path="soldier_sf";
|
||||
ERR_EnemyMedicine special;for(int i=0;i<8;i++)special.Check(&mode,&group,&actor);
|
||||
assert(special.m_Done&&specialStock.accepted==4);int epi=0,morphine=0;
|
||||
for(auto* item:specialStock.items){epi+=item->prefab.path=="epi";morphine+=item->prefab.path=="morphine";}
|
||||
assert(epi==2&&morphine==2); // Every special-forces soldier has two finite injectors.
|
||||
assert(special.m_Done&&specialStock.accepted==5);int epi=0,combatEpi=0,morphine=0;
|
||||
for(auto* item:specialStock.items){epi+=item->prefab.path=="epi";combatEpi+=item->prefab.path=="combat-epi";morphine+=item->prefab.path=="morphine";}
|
||||
assert(epi==1&&combatEpi==2&&morphine==2); // Both types coexist; two strong injectors per specialist.
|
||||
actor.owned=false;ERR_EnemyMedicine captured;captured.Check(&mode,&group,&actor);assert(!captured.m_Started);captured.Stop();actor.owned=true;captured.Check(&mode,&group,&actor);assert(!captured.m_Started);
|
||||
}
|
||||
''')
|
||||
|
||||
Reference in New Issue
Block a user