Skip to content

Commit

Permalink
ReinforcementV2 (#494)
Browse files Browse the repository at this point in the history
* ReinforcementV2

* Update centcomm.yml
- remove official guy from round start

* Update centcomm.yml
- added summoning officials guys console
---------

Co-authored-by: Kirillcas <[email protected]>
  • Loading branch information
Rxup and Kirillcas authored Feb 28, 2024
1 parent eb9790c commit 9f2a584
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using Content.Shared.Backmen.Reinforcement.Components;

namespace Content.Server.Backmen.Reinforcement.Components;

[RegisterComponent]
public sealed partial class ReinforcementMindComponent : Component
{
[ViewVariables(VVAccess.ReadOnly)]
public Entity<ReinforcementConsoleComponent> Linked;
}
14 changes: 14 additions & 0 deletions Content.Server/Backmen/Reinforcement/ReinforcementSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using Content.Server.Mind;
using Content.Server.Players.PlayTimeTracking;
using Content.Server.Popups;
using Content.Server.Roles;
using Content.Server.Station.Systems;
using Content.Shared.Access.Systems;
using Content.Shared.Backmen.Cryostorage;
Expand Down Expand Up @@ -77,6 +78,7 @@ public override void Initialize()
SubscribeLocalEvent<ReinforcementSpawnPlayer>(OnSpawnPlayer);
SubscribeLocalEvent<ReinforcementConsoleComponent,ActivatableUIOpenAttemptEvent>(OnTryOpenUi);
SubscribeLocalEvent<ReinforcementMemberComponent, MovedToStorageEvent>(OnMoveToSSD);
SubscribeLocalEvent<ReinforcementMindComponent, GetBriefingEvent>(OnGetBrief);

Subs.BuiEvents<ReinforcementConsoleComponent>(ReinforcementConsoleKey.Key, subs =>
{
Expand All @@ -87,6 +89,17 @@ public override void Initialize()
});
}

private void OnGetBrief(Entity<ReinforcementMindComponent> ent, ref GetBriefingEvent args)
{
args.Append("Вы вызваны как подкрепление, брифинг: ");
if (TerminatingOrDeleted(ent.Comp.Linked))
{
args.Append("- нет связи с сервером -");
return;
}
args.Append(ent.Comp.Linked.Comp.Brief);
}

private void OnMoveToSSD(Entity<ReinforcementMemberComponent> ent, ref MovedToStorageEvent args)
{
if (TerminatingOrDeleted(ent.Comp.Linked))
Expand Down Expand Up @@ -145,6 +158,7 @@ private void OnSpawnPlayer(ReinforcementSpawnPlayer args)
var jobPrototype = _prototype.Index<JobPrototype>(args.Proto.Job);
var job = new JobComponent { Prototype = args.Proto.Job };
_roles.MindAddRole(newMind, job, silent: false);
EnsureComp<ReinforcementMindComponent>(newMind).Linked = ent.Comp.Linked;
var jobName = _jobs.MindTryGetJobName(newMind);

_playTimeTrackings.PlayerRolesChanged(args.Player);
Expand Down
8 changes: 8 additions & 0 deletions Resources/Maps/centcomm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19584,6 +19584,14 @@ entities:
rot: 3.141592653589793 rad
pos: -1.5,-2.5
parent: 1668
- proto: ComputerReinforcementCentCom
entities:
- uid: 4398
components:
- type: Transform
rot: 1.5707963267948966 rad
pos: -3.5,-0.5
parent: 1668
- proto: ComputerSalvageExpedition
entities:
- uid: 2299
Expand Down
6 changes: 2 additions & 4 deletions Resources/Prototypes/Maps/centcomm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@
- type: StationJobs
overflowJobs: []
availableJobs:
BKCCOfficial: [ 1, 1]
BKCCOperator: [ 1, 1]
BKCCSecGavna: [ 1, 1]
BKCCCargo: [ 1, 2]
BKCCSecOfficer: [ 2, 3]
BKCCSecOfficer: [ 2, 2]
BKCCAssistant: [ 2, 4]
BKCCAdmiral: [ 0, 0]

Expand All @@ -40,11 +39,10 @@
- type: StationJobs
overflowJobs: []
availableJobs:
BKCCOfficial: [ 1, 1]
BKCCOperator: [ 1, 1]
BKCCSecGavna: [ 1, 1]
BKCCCargo: [ 1, 2]
BKCCSecOfficer: [ 2, 3]
BKCCSecOfficer: [ 2, 2]
BKCCAssistant: [ 2, 4]
BKCCAdmiral: [ 0, 0]

Expand Down

0 comments on commit 9f2a584

Please sign in to comment.