Skip to content

Commit

Permalink
revert capitan
Browse files Browse the repository at this point in the history
  • Loading branch information
lAstronautl committed Jul 28, 2024
1 parent 59c685e commit 3815404
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 43 deletions.
3 changes: 1 addition & 2 deletions Content.Server/Station/Components/StationJobsComponent.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Linq;
using Content.Server.GameTicking.Rules;
using Content.Server.Station.Systems;
using Content.Shared.Roles;
using JetBrains.Annotations;
Expand All @@ -13,7 +12,7 @@ namespace Content.Server.Station.Components;
/// <summary>
/// Stores information about a station's job selection.
/// </summary>
[RegisterComponent, Access(typeof(StationJobsSystem), typeof(AllCaptainsRuleSystem)), PublicAPI]
[RegisterComponent, Access(typeof(StationJobsSystem)), PublicAPI]
public sealed partial class StationJobsComponent : Component
{
/// <summary>
Expand Down
12 changes: 0 additions & 12 deletions Content.Server/Station/Systems/StationJobsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using Content.Shared.CCVar;
using Content.Shared.FixedPoint;
using Content.Shared.GameTicking;
using Content.Server.GameTicking.Rules;
using Content.Shared.Preferences;
using Content.Shared.Roles;
using JetBrains.Annotations;
Expand All @@ -28,7 +27,6 @@ public sealed partial class StationJobsSystem : EntitySystem
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly GameTicker _gameTicker = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!;
[Dependency] private readonly AllCaptainsRuleSystem _allCaptainsRule = default!;

/// <inheritdoc/>
public override void Initialize()
Expand All @@ -38,8 +36,6 @@ public override void Initialize()
SubscribeLocalEvent<StationJobsComponent, StationRenamedEvent>(OnStationRenamed);
SubscribeLocalEvent<StationJobsComponent, ComponentShutdown>(OnStationDeletion);
SubscribeLocalEvent<PlayerJoinedLobbyEvent>(OnPlayerJoinedLobby);
SubscribeLocalEvent<GameRuleStartedEvent>(OnGameRuleStarted);
SubscribeLocalEvent<GameRuleEndedEvent>(OnGameRuleEnded);
Subs.CVar(_configurationManager, CCVars.GameDisallowLateJoins, _ => UpdateJobsAvailable(), true);
}

Expand Down Expand Up @@ -154,9 +150,6 @@ public bool TryAdjustJobSlot(EntityUid station,

var jobList = stationJobs.JobList;

if (_allCaptainsRule != null && _allCaptainsRule.RuleStarted)
jobList = _allCaptainsRule.GetJobs(station).JobList;

// This should:
// - Return true when zero slots are added/removed.
// - Return true when you add.
Expand Down Expand Up @@ -253,11 +246,6 @@ public bool TrySetJobSlot(EntityUid station,

var jobList = stationJobs.JobList;

// If all captains mode, override job list with the allcaptains job list -- prevents modifying the "real" job list
// in case mode changes later.
if (_allCaptainsRule != null && _allCaptainsRule.RuleStarted)
jobList = _allCaptainsRule.GetJobs(station).JobList;

switch (jobList.ContainsKey(jobPrototypeId))
{
case false:
Expand Down
8 changes: 0 additions & 8 deletions Resources/Prototypes/GameRules/roundstart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@
- id: Thief
prob: 0.5

- type: gameRule
id: AllCaptains
config:
!type:GenericGameRuleConfiguration
id: AllCaptains

- type: entity
id: DeathMatch31
parent: BaseGameRule
Expand Down Expand Up @@ -256,8 +250,6 @@
- type: InitialInfectedRole
prototype: InitialInfected



# event schedulers
- type: entity
id: BasicStationEventScheduler
Expand Down
22 changes: 1 addition & 21 deletions Resources/Prototypes/game_presets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@
- sandbox
name: sandbox-title
description: sandbox-description
showInVote: true
maxPlayers: 2
showInVote: false
rules:
- Sandbox

Expand Down Expand Up @@ -163,22 +162,3 @@
- GameRuleMeteorScheduler
- BasicRoundstartVariation

- type: gamePreset
id: OopsAllCaptains
alias:
- captains
- captain
- onlycaptains
- OnlyCaptains
- oopsonlycaptains
- oopsallcaptains
- allcaptains
- AllCaptains
name: "Oops! All Captains."
description: "Look at you. You're the captain now."
showInVote: true
rules:
- AllCaptains
- Traitor
- BasicStationEventScheduler

0 comments on commit 3815404

Please sign in to comment.