Gate radio intel behind configurable site discovery; record Workshop 0.0.119
continuous-integration/drone/push Build is passing

This commit is contained in:
2026-10-21 16:36:22 +02:00
parent ac285b5c97
commit 253dde90cd
43 changed files with 5131 additions and 28 deletions
@@ -12,10 +12,11 @@ for typ in ('InventoryStorageManagerComponent','SCR_InventoryStorageManagerCompo
s=s.replace('Array<ERR_LocationComponent>','Array<ERR_LocationComponent*>').replace('bool mineRecovered;', 'bool mineRecovered=false;')
for ns in ('Replication','ERR_Actors','SCR_FactionManager','InventoryStorageManagerComponent','SCR_InventoryStorageManagerComponent','SCR_EntityHelper','ERR_DocumentComponent','ERR_LocationKind','Math'):
s=s.replace(ns+'.',ns+'::')
for obj in ('m_Mode','player','folder','location','document','chosen','scrInventory'):
for obj in ('m_Mode','player','folder','target','location','document','chosen','scrInventory'):
s=re.sub(r'\b'+obj+r'\.',obj+'->',s)
for method in ('Players','Evidence','Settings','MineIntel','GetGame','GetPlayerManager'):
s=s.replace(method+'().',method+'()->')
s=s.replace('bool redirectRadio;', 'bool redirectRadio=false;')
s=re.sub(r'FindComponent\((\w+)\)',r'FindComponent("\1")',s)
run(r'''
#include <cassert>
@@ -38,14 +39,14 @@ namespace ERR_LocationKind{enum{PRISON,RADIO,EXTRACTION,DEPOT};}
namespace Math{int RandomInt(int,int){return 99;}}
struct ERR_LocationComponent{string id;int kind=ERR_LocationKind::RADIO,knowledge=0,calls=0;bool allow=true;int Kind(){return kind;}int Knowledge(){return knowledge;}string Id(){return id;}bool Discover(int,int){calls++;if(!allow)return false;knowledge++;return true;}};
struct Roster{IEntity CurrentActor(IEntity e){return e&&e->canonical?e:nullptr;}};
struct Evidence{IEntity sealed=nullptr,retired=nullptr;string target;string Target(IEntity e){return e==sealed?target:"";}void Retire(IEntity e){retired=e;}};
struct Evidence{void Retarget(IEntity,string){}IEntity sealed=nullptr,retired=nullptr;string target;string Target(IEntity e){return e==sealed?target:"";}void Retire(IEntity e){retired=e;}};
struct Settings{int Runtime(string){return 15;}};
struct MineIntel{bool newlyRecovered=false;int calls=0;Array<IEntity> recovered;Array<IEntity>*spent=nullptr;IEntity lastPlayer=nullptr;bool Recover(IEntity player,IEntity folder){assert(spent&&!spent->Contains(folder));calls++;lastPlayer=player;recovered.Insert(folder);return newlyRecovered;}};
struct Mode{bool worldPreparing=false;bool WorldPreparing(){return worldPreparing;}Roster roster;struct Evidence evidence;struct Settings settings;struct MineIntel mine;Faction*faction=nullptr;bool haveMine=true;Array<ERR_LocationComponent*>locations;int exhausted=0;
struct Mode{void ERR_RadioIntelWaiting(){}bool worldPreparing=false;bool WorldPreparing(){return worldPreparing;}Roster roster;struct Evidence evidence;struct Settings settings;struct MineIntel mine;Faction*faction=nullptr;bool haveMine=true;Array<ERR_LocationComponent*>locations;int exhausted=0;
Roster*Players(){return &roster;}Faction*PlayerFaction(){return faction;}struct Evidence*Evidence(){return &evidence;}struct Settings*Settings(){return &settings;}struct MineIntel*MineIntel(){return haveMine?&mine:nullptr;}void Locations(Array<ERR_LocationComponent*>&out){out=locations;}void ERR_IntelExhausted(bool){exhausted++;}};
struct PlayerManager{int GetPlayerIdFromControlledEntity(IEntity){return 1;}};struct Game{PlayerManager manager;PlayerManager*GetPlayerManager(){return &manager;}}game;Game*GetGame(){return &game;}
template<class...T>void PrintFormat(T...){}
struct Discovery{bool m_Stopped=false;float m_CleanupNow=0;Mode*m_Mode=nullptr;Array<IEntity>m_Spent,cleanup;void QueueCleanup(IEntity item,float){cleanup.Insert(item);}void Folders(InventoryStorageManagerComponent*i,Array<IEntity>&out){out=i->folders;}bool MarkSpent(IEntity e){if(!m_Spent.Contains(e))m_Spent.Insert(e);return true;}
struct Discovery{bool RadioIntelAllowed(){return true;}bool m_Stopped=false;float m_CleanupNow=0;Mode*m_Mode=nullptr;Array<IEntity>m_Spent,cleanup;void QueueCleanup(IEntity item,float){cleanup.Insert(item);}void Folders(InventoryStorageManagerComponent*i,Array<IEntity>&out){out=i->folders;}bool MarkSpent(IEntity e){if(!m_Spent.Contains(e))m_Spent.Insert(e);return true;}
'''+s+r'''
};
struct Fixture{Faction friendly,foreign;Mode mode;Discovery discovery;Entity player,second,folder;SCR_InventoryStorageManagerComponent firstInv,secondInv;ERR_DocumentComponent objective;ERR_LocationComponent radio,other;