Integrate mission-owned chat administration and menu

This commit is contained in:
2026-09-19 23:49:54 +02:00
parent 27989b85a3
commit 5e742691ad
154 changed files with 19498 additions and 134 deletions
@@ -0,0 +1,38 @@
// AI document settings and rerolls belong to Intel, independently of Chat.
class ERR_IntelAdminProvider : ERR_AdminProvider
{
override string Id() { return "intel"; }
override void Capabilities(array<string> values) { values.Insert("supports=intel"); }
override string Setting(string section, string option)
{
if (section == "intel" && (option == "carrying" || option == "chance")) return "aiIntelChancePercent";
return "";
}
override bool Execute(ERR_GameMode mode, string arguments, array<string> replies)
{
if (arguments == "intel show")
{
replies.Insert("aiIntelChancePercent=" + mode.Settings().Get("aiIntelChancePercent").ToString());
replies.Insert("intelRevealChancePercent=" + mode.Settings().Get("intelRevealChancePercent").ToString());
return true;
}
if (arguments == "intel reroll" || arguments == "intel reroll show")
{
ERR_IntelService intel = mode.Intel();
if (!intel) { replies.Insert("Intel service unavailable."); return true; }
if (arguments == "intel reroll" && !intel.BeginReroll())
replies.Insert("Intel reroll could not start. It requires an active round and no running reroll.");
replies.Insert(intel.RerollStatus());
return true;
}
return false;
}
override bool Help(string topic, array<string> replies)
{
if (topic != "intel") return false;
replies.Insert("/esc intel show | intel carrying show|set N (0-100; alias: intel chance)");
replies.Insert("Carrying changes affect newly registered AI. /esc intel reroll applies to eligible living AI; intel reroll show reports progress.");
replies.Insert("/esc intel reveal show|set N|help (0-100); newly recovered documents change, known locations and spent documents remain unchanged.");
return true;
}
}
@@ -159,6 +159,7 @@ modded class ERR_GameMode
super.EOnInit(owner);
if (SCR_Global.IsEditMode() || !Replication.IsServer()) return;
m_Intel = new ERR_IntelService(this);
Admin().Register(new ERR_IntelAdminProvider());
OnGroup().Insert(m_Intel.RegisterGroup);
OnTick().Insert(m_Intel.Tick);
OnStop().Insert(m_Intel.Stop);