More events (#6894)
* Implements bureaucratic error and random sentience. * Adds the Vent Critters event. * bug moment * forgot ignores. * undo something i included in the PR by mistake. * address review
This commit is contained in:
@@ -123,6 +123,8 @@ namespace Content.Client.Entry
|
|||||||
"CursedEntityStorage",
|
"CursedEntityStorage",
|
||||||
"Radio",
|
"Radio",
|
||||||
"GasArtifact",
|
"GasArtifact",
|
||||||
|
"SentienceTarget",
|
||||||
|
"VentCritterSpawnLocation",
|
||||||
"RadiateArtifact",
|
"RadiateArtifact",
|
||||||
"TemperatureArtifact",
|
"TemperatureArtifact",
|
||||||
"DisposalHolder",
|
"DisposalHolder",
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ namespace Content.Server.Chat.Managers
|
|||||||
_logs.Add(LogType.Chat, LogImpact.Low, $"Server announcement: {message}");
|
_logs.Add(LogType.Chat, LogImpact.Low, $"Server announcement: {message}");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DispatchStationAnnouncement(string message, string sender = "CentComm", bool playDefaultSound = true)
|
public void DispatchStationAnnouncement(string message, string sender = "Central Command", bool playDefaultSound = true)
|
||||||
{
|
{
|
||||||
var messageWrap = Loc.GetString("chat-manager-sender-announcement-wrap-message", ("sender", sender));
|
var messageWrap = Loc.GetString("chat-manager-sender-announcement-wrap-message", ("sender", sender));
|
||||||
NetMessageToAll(ChatChannel.Radio, message, messageWrap);
|
NetMessageToAll(ChatChannel.Radio, message, messageWrap);
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
namespace Content.Server.StationEvents.Components;
|
||||||
|
|
||||||
|
[RegisterComponent]
|
||||||
|
public sealed class SentienceTargetComponent : Component
|
||||||
|
{
|
||||||
|
[DataField("flavorKind", required: true)]
|
||||||
|
public string FlavorKind = default!;
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
namespace Content.Server.StationEvents.Components;
|
||||||
|
|
||||||
|
[RegisterComponent]
|
||||||
|
public sealed class VentCritterSpawnLocationComponent : Component
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
63
Content.Server/StationEvents/Events/BureaucraticError.cs
Normal file
63
Content.Server/StationEvents/Events/BureaucraticError.cs
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
using System.Linq;
|
||||||
|
using Content.Server.Station;
|
||||||
|
using Content.Shared.Roles;
|
||||||
|
using JetBrains.Annotations;
|
||||||
|
using Robust.Shared.Prototypes;
|
||||||
|
using Robust.Shared.Random;
|
||||||
|
|
||||||
|
namespace Content.Server.StationEvents.Events;
|
||||||
|
|
||||||
|
[UsedImplicitly]
|
||||||
|
public sealed class BureaucraticError : StationEvent
|
||||||
|
{
|
||||||
|
[Dependency] private readonly IRobustRandom _random = default!;
|
||||||
|
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||||
|
public override string? StartAnnouncement =>
|
||||||
|
Loc.GetString("station-event-bureaucratic-error-announcement");
|
||||||
|
public override string Name => "BureaucraticError";
|
||||||
|
|
||||||
|
public override string? StartAudio => "/Audio/Announcements/announce.ogg";
|
||||||
|
|
||||||
|
public override int MinimumPlayers => 25;
|
||||||
|
|
||||||
|
public override float Weight => WeightLow;
|
||||||
|
|
||||||
|
public override int? MaxOccurrences => 2;
|
||||||
|
|
||||||
|
protected override float EndAfter => 1f;
|
||||||
|
|
||||||
|
public override void Startup()
|
||||||
|
{
|
||||||
|
base.Startup();
|
||||||
|
var chosenStation = _random.Pick(EntitySystem.Get<StationSystem>().StationInfo.Values.ToList());
|
||||||
|
var jobList = chosenStation.JobList.Keys.Where(x => !_prototypeManager.Index<JobPrototype>(x).IsHead).ToList();
|
||||||
|
|
||||||
|
// Low chance to completely change up the late-join landscape by closing all positions except infinite slots.
|
||||||
|
// Lower chance than the /tg/ equivalent of this event.
|
||||||
|
if (_random.Prob(0.25f))
|
||||||
|
{
|
||||||
|
var chosenJob = _random.PickAndTake(jobList);
|
||||||
|
chosenStation.AdjustJobAmount(chosenJob, -1); // INFINITE chaos.
|
||||||
|
foreach (var job in jobList)
|
||||||
|
{
|
||||||
|
if (chosenStation.JobList[job] == -1)
|
||||||
|
continue;
|
||||||
|
chosenStation.AdjustJobAmount(job, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Changing every role is maybe a bit too chaotic so instead change 20-30% of them.
|
||||||
|
for (var i = 0; i < _random.Next((int)(jobList.Count * 0.20), (int)(jobList.Count * 0.30)); i++)
|
||||||
|
{
|
||||||
|
var chosenJob = _random.PickAndTake(jobList);
|
||||||
|
if (chosenStation.JobList[chosenJob] == -1)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
var adj = Math.Max(chosenStation.JobList[chosenJob] + _random.Next(-3, 6), 0);
|
||||||
|
chosenStation.AdjustJobAmount(chosenJob, adj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -10,8 +10,8 @@ namespace Content.Server.StationEvents.Events;
|
|||||||
|
|
||||||
public sealed class KudzuGrowth : StationEvent
|
public sealed class KudzuGrowth : StationEvent
|
||||||
{
|
{
|
||||||
[Dependency] private IRobustRandom _robustRandom = default!;
|
[Dependency] private readonly IRobustRandom _robustRandom = default!;
|
||||||
[Dependency] private IEntityManager _entityManager = default!;
|
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||||
|
|
||||||
public override string Name => "KudzuGrowth";
|
public override string Name => "KudzuGrowth";
|
||||||
|
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ namespace Content.Server.StationEvents.Events
|
|||||||
{
|
{
|
||||||
// Based on Goonstation style radiation storm with some TG elements (announcer, etc.)
|
// Based on Goonstation style radiation storm with some TG elements (announcer, etc.)
|
||||||
|
|
||||||
[Dependency] private IEntityManager _entityManager = default!;
|
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||||
[Dependency] private IRobustRandom _robustRandom = default!;
|
[Dependency] private readonly IRobustRandom _robustRandom = default!;
|
||||||
|
|
||||||
public override string Name => "RadiationStorm";
|
public override string Name => "RadiationStorm";
|
||||||
public override string StartAnnouncement => Loc.GetString("station-event-radiation-storm-start-announcement");
|
public override string StartAnnouncement => Loc.GetString("station-event-radiation-storm-start-announcement");
|
||||||
|
|||||||
55
Content.Server/StationEvents/Events/RandomSentience.cs
Normal file
55
Content.Server/StationEvents/Events/RandomSentience.cs
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
using System.Linq;
|
||||||
|
using Content.Server.Chat.Managers;
|
||||||
|
using Content.Server.Mind.Commands;
|
||||||
|
using Content.Server.StationEvents.Components;
|
||||||
|
using Robust.Shared.Random;
|
||||||
|
|
||||||
|
namespace Content.Server.StationEvents.Events;
|
||||||
|
|
||||||
|
public sealed class RandomSentience : StationEvent
|
||||||
|
{
|
||||||
|
[Dependency] private readonly IRobustRandom _random = default!;
|
||||||
|
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||||
|
[Dependency] private readonly IChatManager _chatManager = default!;
|
||||||
|
|
||||||
|
public override string Name => "RandomSentience";
|
||||||
|
|
||||||
|
public override float Weight => WeightNormal;
|
||||||
|
|
||||||
|
protected override float EndAfter => 1.0f;
|
||||||
|
|
||||||
|
public override void Startup()
|
||||||
|
{
|
||||||
|
base.Startup();
|
||||||
|
|
||||||
|
var targetList = _entityManager.EntityQuery<SentienceTargetComponent>().ToList();
|
||||||
|
_random.Shuffle(targetList);
|
||||||
|
|
||||||
|
var toMakeSentient = _random.Next(2, 5);
|
||||||
|
var groups = new HashSet<string>();
|
||||||
|
|
||||||
|
foreach (var target in targetList)
|
||||||
|
{
|
||||||
|
if (toMakeSentient-- == 0)
|
||||||
|
break;
|
||||||
|
|
||||||
|
MakeSentientCommand.MakeSentient(target.Owner, _entityManager);
|
||||||
|
_entityManager.RemoveComponent<SentienceTargetComponent>(target.Owner);
|
||||||
|
groups.Add(target.FlavorKind);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (groups.Count == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var groupList = groups.ToList();
|
||||||
|
var kind1 = groupList.Count > 0 ? groupList[0] : "???";
|
||||||
|
var kind2 = groupList.Count > 1 ? groupList[1] : "???";
|
||||||
|
var kind3 = groupList.Count > 2 ? groupList[2] : "???";
|
||||||
|
_chatManager.DispatchStationAnnouncement(
|
||||||
|
Loc.GetString("station-event-random-sentience-announcement",
|
||||||
|
("kind1", kind1), ("kind2", kind2), ("kind3", kind3), ("amount", groupList.Count),
|
||||||
|
("data", Loc.GetString($"random-sentience-event-data-{_random.Next(1, 6)}")),
|
||||||
|
("strength", Loc.GetString($"random-sentience-event-strength-{_random.Next(1, 8)}")))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
52
Content.Server/StationEvents/Events/VentCritters.cs
Normal file
52
Content.Server/StationEvents/Events/VentCritters.cs
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
using System.Linq;
|
||||||
|
using Content.Server.StationEvents.Components;
|
||||||
|
using Robust.Shared.Random;
|
||||||
|
|
||||||
|
namespace Content.Server.StationEvents.Events;
|
||||||
|
|
||||||
|
public sealed class VentCritters : StationEvent
|
||||||
|
{
|
||||||
|
[Dependency] private readonly IRobustRandom _random = default!;
|
||||||
|
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||||
|
|
||||||
|
public static List<string> SpawnedPrototypeChoices = new List<string>()
|
||||||
|
{"MobGiantSpiderAngry", "MobMouse", "MobMouse1", "MobMouse2"};
|
||||||
|
|
||||||
|
public override string Name => "VentCritters";
|
||||||
|
|
||||||
|
public override string? StartAnnouncement =>
|
||||||
|
Loc.GetString("station-event-vent-spiders-start-announcement", ("data", Loc.GetString(Loc.GetString($"random-sentience-event-data-{_random.Next(1, 6)}"))));
|
||||||
|
|
||||||
|
public override string? StartAudio => "/Audio/Announcements/bloblarm.ogg";
|
||||||
|
|
||||||
|
public override int EarliestStart => 15;
|
||||||
|
|
||||||
|
public override int MinimumPlayers => 15;
|
||||||
|
|
||||||
|
public override float Weight => WeightLow;
|
||||||
|
|
||||||
|
public override int? MaxOccurrences => 2;
|
||||||
|
|
||||||
|
protected override float StartAfter => 30f;
|
||||||
|
|
||||||
|
protected override float EndAfter => 60;
|
||||||
|
|
||||||
|
public override void Startup()
|
||||||
|
{
|
||||||
|
base.Startup();
|
||||||
|
var spawnChoice = _random.Pick(SpawnedPrototypeChoices);
|
||||||
|
var spawnLocations = _entityManager.EntityQuery<VentCritterSpawnLocationComponent>().ToList();
|
||||||
|
_random.Shuffle(spawnLocations);
|
||||||
|
|
||||||
|
var spawnAmount = _random.Next(4, 12); // A small colony of critters.
|
||||||
|
foreach (var location in spawnLocations)
|
||||||
|
{
|
||||||
|
if (spawnAmount-- == 0)
|
||||||
|
break;
|
||||||
|
|
||||||
|
var coords = _entityManager.GetComponent<TransformComponent>(location.Owner);
|
||||||
|
|
||||||
|
_entityManager.SpawnEntity(spawnChoice, coords.Coordinates);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
station-event-bureaucratic-error-announcement = A recent bureaucratic error in the Organic Resources Department may result in personnel shortages in some departments and redundant staffing in others.
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
## Phrases used for where central command got this information.
|
||||||
|
random-sentience-event-data-1 = scans from our long-range sensors
|
||||||
|
random-sentience-event-data-2 = our sophisticated probabilistic models
|
||||||
|
random-sentience-event-data-3 = our omnipotence
|
||||||
|
random-sentience-event-data-4 = the communications traffic on your station
|
||||||
|
random-sentience-event-data-5 = energy emissions we detected
|
||||||
|
random-sentience-event-data-6 = [REDACTED]
|
||||||
|
|
||||||
|
## Phrases used to describe the level of intelligence, though it doesn't actually affect anything.
|
||||||
|
random-sentience-event-strength-1 = human
|
||||||
|
random-sentience-event-strength-2 = primate
|
||||||
|
random-sentience-event-strength-3 = moderate
|
||||||
|
random-sentience-event-strength-4 = security
|
||||||
|
random-sentience-event-strength-5 = command
|
||||||
|
random-sentience-event-strength-6 = clown
|
||||||
|
random-sentience-event-strength-7 = low
|
||||||
|
random-sentience-event-strength-8 = AI
|
||||||
|
|
||||||
|
station-event-random-sentience-announcement = Based on { $data }, we believe that some of the station's { $amount ->
|
||||||
|
[1] { $kind1 }
|
||||||
|
[2] { $kind1 } and { $kind2 }
|
||||||
|
[3] { $kind1 }, { $kind2 }, and { $kind3 }
|
||||||
|
*[other] { $kind1 }, { $kind2 }, { $kind3 }, etc.
|
||||||
|
} beings have developed { $strength } level intelligence, and the ability to communicate.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
station-event-vent-spiders-start-announcement = Based on { $data }, we believe a small colony of unknown organisms have taken residence inside the station's ventilation and have taken action to drive them out.
|
||||||
@@ -42,6 +42,8 @@
|
|||||||
successChance: 0.2
|
successChance: 0.2
|
||||||
interactSuccessString: petting-success-soft-floofy
|
interactSuccessString: petting-success-soft-floofy
|
||||||
interactFailureString: petting-failure-bat
|
interactFailureString: petting-failure-bat
|
||||||
|
- type: SentienceTarget
|
||||||
|
flavorKind: organic
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
name: bee
|
name: bee
|
||||||
@@ -546,13 +548,8 @@
|
|||||||
components:
|
components:
|
||||||
- type: NameIdentifier
|
- type: NameIdentifier
|
||||||
group: Monkey
|
group: Monkey
|
||||||
- type: GhostTakeoverAvailable
|
- type: SentienceTarget
|
||||||
makeSentient: true
|
flavorKind: primate
|
||||||
name: monkey
|
|
||||||
description: Ook ook!
|
|
||||||
rules: |
|
|
||||||
Being a monkey does NOT give you a free pass to kill, RDM or self-antag.
|
|
||||||
|
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
drawdepth: Mobs
|
drawdepth: Mobs
|
||||||
layers:
|
layers:
|
||||||
@@ -938,6 +935,19 @@
|
|||||||
interactSuccessString: petting-success-tarantula
|
interactSuccessString: petting-success-tarantula
|
||||||
interactFailureString: petting-failure-generic
|
interactFailureString: petting-failure-generic
|
||||||
|
|
||||||
|
- type: entity
|
||||||
|
name: tarantula
|
||||||
|
parent: MobGiantSpider
|
||||||
|
id: MobGiantSpiderAngry
|
||||||
|
components:
|
||||||
|
- type: AiFactionTag
|
||||||
|
factions:
|
||||||
|
- Xeno
|
||||||
|
- type: UtilityAI
|
||||||
|
behaviorSets:
|
||||||
|
- Idle
|
||||||
|
- UnarmedAttackHostiles
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
name: possum
|
name: possum
|
||||||
parent: SimpleMobBase
|
parent: SimpleMobBase
|
||||||
|
|||||||
@@ -45,6 +45,8 @@
|
|||||||
- type: Grammar
|
- type: Grammar
|
||||||
attributes:
|
attributes:
|
||||||
gender: epicene
|
gender: epicene
|
||||||
|
- type: SentienceTarget
|
||||||
|
flavorKind: corgi
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
name: corrupted corgi
|
name: corrupted corgi
|
||||||
|
|||||||
@@ -55,7 +55,8 @@
|
|||||||
- type: ApcPowerReceiver
|
- type: ApcPowerReceiver
|
||||||
powerLoad: 200
|
powerLoad: 200
|
||||||
priority: Low
|
priority: Low
|
||||||
|
- type: SentienceTarget
|
||||||
|
flavorKind: mechanical
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
parent: VendingMachine
|
parent: VendingMachine
|
||||||
|
|||||||
@@ -50,6 +50,7 @@
|
|||||||
- type: Construction
|
- type: Construction
|
||||||
graph: GasUnary
|
graph: GasUnary
|
||||||
node: ventpump
|
node: ventpump
|
||||||
|
- type: VentCritterSpawnLocation
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
parent: GasUnaryBase
|
parent: GasUnaryBase
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
- type: job
|
- type: job
|
||||||
id: Quartermaster
|
id: Quartermaster
|
||||||
name: "quartermaster"
|
name: "quartermaster"
|
||||||
|
head: true
|
||||||
startingGear: QuartermasterGear
|
startingGear: QuartermasterGear
|
||||||
departments:
|
departments:
|
||||||
- Cargo
|
- Cargo
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
- type: job
|
- type: job
|
||||||
id: HeadOfPersonnel
|
id: HeadOfPersonnel
|
||||||
name: "head of personnel"
|
name: "head of personnel"
|
||||||
|
head: true
|
||||||
startingGear: HoPGear
|
startingGear: HoPGear
|
||||||
departments:
|
departments:
|
||||||
- Command
|
- Command
|
||||||
|
|||||||
Reference in New Issue
Block a user