- fix: Gulagged objective fix. (#130)
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using Content.Server._Miracle.GulagSystem;
|
||||||
using Content.Server.Antag;
|
using Content.Server.Antag;
|
||||||
using Content.Server.Chat.Managers;
|
using Content.Server.Chat.Managers;
|
||||||
using Content.Server.GameTicking;
|
using Content.Server.GameTicking;
|
||||||
@@ -31,6 +32,7 @@ public sealed class ChangelingRuleSystem : GameRuleSystem<ChangelingRuleComponen
|
|||||||
[Dependency] private readonly SharedRoleSystem _roleSystem = default!;
|
[Dependency] private readonly SharedRoleSystem _roleSystem = default!;
|
||||||
[Dependency] private readonly ObjectivesSystem _objectives = default!;
|
[Dependency] private readonly ObjectivesSystem _objectives = default!;
|
||||||
[Dependency] private readonly ChangelingNameGenerator _nameGenerator = default!;
|
[Dependency] private readonly ChangelingNameGenerator _nameGenerator = default!;
|
||||||
|
[Dependency] private readonly GulagSystem _gulag = default!;
|
||||||
|
|
||||||
private const int PlayersPerChangeling = 15;
|
private const int PlayersPerChangeling = 15;
|
||||||
private const int MaxChangelings = 4;
|
private const int MaxChangelings = 4;
|
||||||
@@ -230,6 +232,9 @@ public sealed class ChangelingRuleSystem : GameRuleSystem<ChangelingRuleComponen
|
|||||||
if (changeling.TotalChangelings >= MaxChangelings)
|
if (changeling.TotalChangelings >= MaxChangelings)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (_gulag.IsUserGulaged(ev.Player.UserId, out _))
|
||||||
|
continue;
|
||||||
|
|
||||||
if (!ev.LateJoin)
|
if (!ev.LateJoin)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using Content.Server._Miracle.Components;
|
||||||
using Content.Server.Changeling.Objectives.Components;
|
using Content.Server.Changeling.Objectives.Components;
|
||||||
using Content.Server.Forensics;
|
using Content.Server.Forensics;
|
||||||
using Content.Server.Mind;
|
using Content.Server.Mind;
|
||||||
@@ -184,6 +185,7 @@ public sealed class ChangelingConditionsSystem : EntitySystem
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
var allHumans = _mind.GetAliveHumansExcept(args.MindId);
|
var allHumans = _mind.GetAliveHumansExcept(args.MindId);
|
||||||
|
allHumans = allHumans.Where(x => !HasComp<GulagBoundComponent>(x)).ToList();
|
||||||
if (allHumans.Count == 0)
|
if (allHumans.Count == 0)
|
||||||
{
|
{
|
||||||
args.Cancelled = true;
|
args.Cancelled = true;
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using Content.Server._Miracle.GulagSystem;
|
||||||
using Content.Server.Antag;
|
using Content.Server.Antag;
|
||||||
using Content.Server.Chat.Managers;
|
using Content.Server.Chat.Managers;
|
||||||
using Content.Server.GameTicking.Rules.Components;
|
using Content.Server.GameTicking.Rules.Components;
|
||||||
@@ -50,6 +51,7 @@ public sealed class TraitorRuleSystem : GameRuleSystem<TraitorRuleComponent>
|
|||||||
[Dependency] private readonly ObjectivesSystem _objectives = default!;
|
[Dependency] private readonly ObjectivesSystem _objectives = default!;
|
||||||
//WD EDIT
|
//WD EDIT
|
||||||
[Dependency] private readonly GameTicker _gameTicker = default!;
|
[Dependency] private readonly GameTicker _gameTicker = default!;
|
||||||
|
[Dependency] private readonly GulagSystem _gulag = default!;
|
||||||
|
|
||||||
private ISawmill _sawmill = default!;
|
private ISawmill _sawmill = default!;
|
||||||
|
|
||||||
@@ -308,6 +310,9 @@ public sealed class TraitorRuleSystem : GameRuleSystem<TraitorRuleComponent>
|
|||||||
if (!GameTicker.IsGameRuleAdded(uid, gameRule))
|
if (!GameTicker.IsGameRuleAdded(uid, gameRule))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (_gulag.IsUserGulaged(ev.Player.UserId, out _)) // WD
|
||||||
|
continue;
|
||||||
|
|
||||||
if (traitor.TotalTraitors >= MaxTraitors)
|
if (traitor.TotalTraitors >= MaxTraitors)
|
||||||
continue;
|
continue;
|
||||||
if (!ev.LateJoin)
|
if (!ev.LateJoin)
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using Content.Server._Miracle.Components;
|
||||||
using Content.Server._White.Cult.GameRule;
|
using Content.Server._White.Cult.GameRule;
|
||||||
using Content.Server.Objectives.Components;
|
using Content.Server.Objectives.Components;
|
||||||
using Content.Server.Shuttles.Systems;
|
using Content.Server.Shuttles.Systems;
|
||||||
@@ -59,6 +60,7 @@ public sealed class KillPersonConditionSystem : EntitySystem
|
|||||||
|
|
||||||
// no other humans to kill
|
// no other humans to kill
|
||||||
var allHumans = _mind.GetAliveHumansExcept(args.MindId);
|
var allHumans = _mind.GetAliveHumansExcept(args.MindId);
|
||||||
|
allHumans = allHumans.Where(x => !HasComp<GulagBoundComponent>(x)).ToList(); // WD
|
||||||
if (allHumans.Count == 0)
|
if (allHumans.Count == 0)
|
||||||
{
|
{
|
||||||
args.Cancelled = true;
|
args.Cancelled = true;
|
||||||
@@ -83,6 +85,7 @@ public sealed class KillPersonConditionSystem : EntitySystem
|
|||||||
|
|
||||||
// no other humans to kill
|
// no other humans to kill
|
||||||
var allHumans = _mind.GetAliveHumansExcept(args.MindId);
|
var allHumans = _mind.GetAliveHumansExcept(args.MindId);
|
||||||
|
allHumans = allHumans.Where(x => !HasComp<GulagBoundComponent>(x)).ToList(); // WD
|
||||||
if (allHumans.Count == 0)
|
if (allHumans.Count == 0)
|
||||||
{
|
{
|
||||||
args.Cancelled = true;
|
args.Cancelled = true;
|
||||||
|
|||||||
@@ -307,6 +307,9 @@ public sealed class CultRuleSystem : GameRuleSystem<CultRuleComponent>
|
|||||||
if (entity == default)
|
if (entity == default)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (_gulag.IsUserGulaged(actor.PlayerSession.UserId, out _))
|
||||||
|
continue;
|
||||||
|
|
||||||
if (exclude?.Contains(actor.PlayerSession) is true)
|
if (exclude?.Contains(actor.PlayerSession) is true)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user