Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
namespace Content.Server.GameTicking.Rules.Components;

[RegisterComponent]
public sealed partial class CburnRuleComponent : Component;
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,19 @@ public sealed partial class ZombieRuleComponent : Component
public TimeSpan EndCheckDelay = TimeSpan.FromSeconds(30);

/// <summary>
/// After this amount of the crew become zombies, the shuttle will be automatically called.
/// After this amount of the crew become zombies, the shuttle will be automatically called, and a CBURN squad will spawn as reinforcement.
/// </summary>
[DataField]
public float ZombieShuttleCallPercentage = 0.7f;

/// <summary>
/// The CBURN squad game rule that is spawned when `ZombieShuttleCallPercentage` is reached.
/// </summary>
[DataField]
public EntProtoId CburnGameRule = "CBURNSquad";

/// <summary>
/// Tracks wether a CBURN squad has been called.
/// </summary>
public bool CburnCalled = false;
}
27 changes: 27 additions & 0 deletions Content.Server/GameTicking/Rules/ZombieRuleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,17 @@ public sealed class ZombieRuleSystem : GameRuleSystem<ZombieRuleComponent>
[Dependency] private readonly StationSystem _station = default!;
[Dependency] private readonly ZombieSystem _zombie = default!;

[Dependency] private readonly GameTicker _gameTicker = default!;

public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<InitialInfectedRoleComponent, GetBriefingEvent>(OnGetBriefing);
SubscribeLocalEvent<ZombieRoleComponent, GetBriefingEvent>(OnGetBriefing);
SubscribeLocalEvent<IncurableZombieComponent, ZombifySelfActionEvent>(OnZombifySelf);
// These two events are more for the CBURN rule, but it is after all only a subsidary of this rule...
SubscribeLocalEvent<CburnRuleComponent, AfterAntagEntitySelectedEvent>(OnAfterAntagEntSelected);
}

private void OnGetBriefing(Entity<InitialInfectedRoleComponent> role, ref GetBriefingEvent args)
Expand Down Expand Up @@ -118,6 +122,15 @@ private void CheckRoundEnd(ZombieRuleComponent zombieRuleComponent)
if (healthy.Count == 1) // Only one human left. spooky
_popup.PopupEntity(Loc.GetString("zombie-alone"), healthy[0], healthy[0]);

// This is separate from the shuttle call because if you recall the shuttle you shouldn't get two CBURNs.
// This might just be wrong and they could be merged though.
if (GetInfectedFraction(false) > zombieRuleComponent.ZombieShuttleCallPercentage && !zombieRuleComponent.CburnCalled)
{
_gameTicker.StartGameRule(zombieRuleComponent.CburnGameRule);
// we don't want two CBURN squads!
zombieRuleComponent.CburnCalled = true;
}

if (GetInfectedFraction(false) > zombieRuleComponent.ZombieShuttleCallPercentage && !_roundEnd.IsRoundEndRequested())
{
foreach (var station in _station.GetStations())
Expand Down Expand Up @@ -213,4 +226,18 @@ private List<EntityUid> GetHealthyHumans(bool includeOffStation = true)
}
return healthy;
}
#region CBURN-related
/// <summary>
/// This sends the join message for CBURN agents.
/// </summary>
/// <remarks>
/// This should maybe be in a CBURN system, but CBURNs are pretty much just a subordinate of this game mode...
/// </remarks
private void OnAfterAntagEntSelected(Entity<CburnRuleComponent> ent, ref AfterAntagEntitySelectedEvent args)
{
_antag.SendBriefing(args.Session,
Loc.GetString("cburn-welcome"),
Color.Orange, null);
}
#endregion
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ zombie-infection-underway = Your blood begins to thicken

zombie-alone = You feel entirely alone.

zombie-shuttle-call = We have detected that the undead have overtaken the station. Dispatching an emergency shuttle to collect remaining personnel.
zombie-shuttle-call = We have detected that the undead have overtaken the station. Dispatching an emergency shuttle to collect remaining personnel and a CBURN squad to guarantee safe passage.

zombie-round-end-initial-count = {$initialCount ->
[one] There was one initial infected:
Expand All @@ -33,3 +33,7 @@ zombie-round-end-survivor-count = {$count ->
*[other] There were only {$count} survivors left:
}
zombie-round-end-user-was-survivor = - [color=White]{$name}[/color] ([color=gray]{$username}[/color]) survived the outbreak.

# todo: do a nukie-like station name (e.g. station Dev is currently enduring[...])
cburn-welcome = You are a CentComm Quarantine Officer, a member of one of Nanotransen's elite CBURN squads. A highly contagious pathogen has appeared on station <insert station name>, and an evacuation shuttle has been called. The infected must not make it to Central Command. Glory to Nanotransen.
cburn-briefing = The infected must not make it to Central Command. Glory to Nanotransen.
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ ghost-role-information-ert-medical-name = ERT Medical
ghost-role-information-ert-medical-description = Assist with medical efforts to resolve the station's issues.

ghost-role-information-cburn-agent-name = CBURN Agent
ghost-role-information-cburn-agent-description = A highly trained CentComm agent, capable of dealing with various threats.
ghost-role-information-cburn-agent-description = A highly trained CentComm agent, capable of dealing with various (mainly undead) threats.

ghost-role-information-centcom-official-name = CentComm Official
ghost-role-information-centcom-official-description = Perform CentComm related duties such as inspect the station, jotting down performance reviews for heads of staff, and managing the fax machine.
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
- type: entity
categories: [ Spawner ]
# todo: branch this out of the Antag system (this is not an antagonist!!!!)
parent: MarkerBase
id: SpawnPointCBURN
name: ghost role spawn point
suffix: CBURN
components:
- type: SpawnPoint
- type: Sprite
sprite: Markers/jobs.rsi
layers:
- state: green
- sprite: Structures/Wallmounts/signs.rsi
state: bio
23 changes: 23 additions & 0 deletions Resources/Prototypes/Entities/Markers/Spawners/ghost_roles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -360,3 +360,26 @@
- state: green
- sprite: Clothing/Head/Hats/wizardhat.rsi
state: icon

- type: entity
categories: [ Spawner ]
# todo: branch this out of the Antag system (this is not an antagonist!!!!)
parent: BaseAntagSpawner
id: SpawnPointGhostCBURN
name: ghost role spawn point
suffix: CBURN
components:
- type: GhostRole
name: ghost-role-information-cburn-agent-name
description: ghost-role-information-cburn-agent-description
rules: ghost-role-component-default-rules
# TODO: Mind Role for CBURN agents
mindRoles:
- MindRoleCBURN
job: CBURN
- type: Sprite
sprite: Markers/jobs.rsi
layers:
- state: green
- sprite: Structures/Wallmounts/signs.rsi
state: bio
30 changes: 30 additions & 0 deletions Resources/Prototypes/GameRules/events.yml
Original file line number Diff line number Diff line change
Expand Up @@ -827,3 +827,33 @@
min: 1
max: 1
pickPlayer: false

# this event is only called by the zombies game rule
- type: entity
parent: BaseGameRule
id: CBURNSquad
components:
- type: CburnRule # this component is more or less only for the snazzy welcome message
- type: AntagLoadProfileRule
- type: RuleGrids
- type: LoadMapRule
gridPath: /Maps/Shuttles/cburn_small.yml
- type: AntagSelection
definitions:
- spawnerPrototype: SpawnPointGhostCBURN
min: 1
max: 8
# there should be one CBURN member per 12 crew members (we don't want one CBURN vs 40 zeds nor do we want 10 CBURN vs 10 zeds)
playerRatio: 12
pickPlayer: false
startingGear: CBURNGear
roleLoadout:
- RoleSurvivalEVA
components:
- type: RandomMetadata
nameSegments:
- NamesMilitaryFirst
- NamesMilitaryLast
nameFormat: name-format-ert
mindRoles:
- MindRoleCBURN
12 changes: 12 additions & 0 deletions Resources/Prototypes/Roles/MindRoles/mind_roles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -355,3 +355,15 @@
- type: ChangelingRole
- type: RoleBriefing
briefing: changeling-briefing

# CBURN
- type: entity
parent: BaseMindRole
id: MindRoleCBURN
name: CBURN Agent
components:
- type: MindRole
roleType: Neutral
jobPrototype: CBURN
- type: RoleBriefing
briefing: cburn-briefing
2 changes: 1 addition & 1 deletion Resources/shuttle_attributions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
- files: ["Shuttles/AdminSpawn/ERT-Small-Base.yml"]
authors: TsjipTsjip, LuckyShotPictures, IProduceWidgets

- files: ["Shuttles/AdminSpawn/ERT-Small-CBURN.yml"]
- files: ["Shuttles/cburn_small_.yml"]
authors: TsjipTsjip, LuckyShotPictures, IProduceWidgets

- files: ["Shuttles/AdminSpawn/ERT-Small-Deathsquad.yml"]
Expand Down