Integrate mission-owned chat administration and menu
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user