Adds false alarm and updates events code (#2577)
* oops accedentaly ports how ss13 deals with event randomness. Also renames FakeEvent to FalseAlarm! * thing * greytide but it's implemented badly * fixes&changies, also greytide! * rng actualy exists now * resync * Naming Schemes * Startup not init * areas are dead * very cool vsudio * this does not exist, wtf * Cleanup * Nullables, fixables, and timings Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
This commit is contained in:
@@ -14,7 +14,9 @@ namespace Content.Server.Commands.StationEvents
|
||||
{
|
||||
public string Command => "events";
|
||||
public string Description => "Provides admin control to station events";
|
||||
public string Help => $"events <list/pause/resume/stop/run <eventName/random>>\n{ListHelp}\n{PauseHelp}\n{ResumeHelp}\n{RunHelp}";
|
||||
public string Help => $"events <running/list/pause/resume/stop/run <eventName/random>>\n{RunningHelp}\n{ListHelp}\n{PauseHelp}\n{ResumeHelp}\n{RunHelp}";
|
||||
|
||||
private const string RunningHelp = "running: return the current running event";
|
||||
|
||||
private const string ListHelp = "list: return all event names that can be run";
|
||||
|
||||
@@ -38,6 +40,9 @@ namespace Content.Server.Commands.StationEvents
|
||||
case "list":
|
||||
List(shell, player);
|
||||
break;
|
||||
case "running":
|
||||
Running(shell, player);
|
||||
break;
|
||||
// Didn't use a "toggle" so it's explicit
|
||||
case "pause":
|
||||
Pause(shell, player);
|
||||
@@ -74,6 +79,19 @@ namespace Content.Server.Commands.StationEvents
|
||||
shell.SendText(player, resultText);
|
||||
}
|
||||
|
||||
private void Running(IConsoleShell shell, IPlayerSession? player)
|
||||
{
|
||||
var eventName = EntitySystem.Get<StationEventSystem>().CurrentEvent?.Name;
|
||||
if (!string.IsNullOrEmpty(eventName))
|
||||
{
|
||||
shell.SendText(player, eventName);
|
||||
}
|
||||
else
|
||||
{
|
||||
shell.SendText(player, Loc.GetString("No station event running"));
|
||||
}
|
||||
}
|
||||
|
||||
private void List(IConsoleShell shell, IPlayerSession? player)
|
||||
{
|
||||
var resultText = "Random\n" + EntitySystem.Get<StationEventSystem>().GetEventNames();
|
||||
|
||||
Reference in New Issue
Block a user