Merge branch 'master' into ConsFix

This commit is contained in:
BIGZi0348
2024-12-25 15:29:39 +03:00
5 changed files with 38 additions and 23 deletions

View File

@@ -33,6 +33,8 @@ public sealed class AuthPanelSystem : EntitySystem
public static int MaxCount = 2;
public static int RandomAcceptRate = 8;
private TimeSpan? _delay;
public override void Initialize()
@@ -61,7 +63,7 @@ public sealed class AuthPanelSystem : EntitySystem
{
if (args.Action is AuthPanelAction.ERTRecruit)
{
if (_random.Next(10) < 2)
if (_random.Next(10) < RandomAcceptRate)
{
_gameTicker.AddGameRule(ERTRecruitmentRuleComponent.EventName);
}
@@ -71,6 +73,7 @@ public sealed class AuthPanelSystem : EntitySystem
if (station != null)
_ert.DeclineERT(station.Value);
_adminLogger.Add(LogType.EventStarted, LogImpact.High, $"ERT Declined - due to random");
}
foreach (var entities in Counter.Values)

View File

@@ -7,6 +7,8 @@ using Content.Server.GameTicking.Rules.Components;
using Content.Server.StationEvents.Events;
using Content.Server._White.GhostRecruitment;
using Content.Server.GameTicking.Components;
using Content.Shared.Administration.Logs;
using Content.Shared.Database;
using Content.Shared._White;
using Content.Shared._White.GhostRecruitment;
using JetBrains.Annotations;
@@ -29,6 +31,7 @@ public sealed class ERTRecruitmentRule : StationEventSystem<ERTRecruitmentRuleCo
[Dependency] private readonly IConfigurationManager _cfgManager = default!;
[Dependency] private readonly GameTicker _ticker = default!;
[Dependency] private readonly IEntityManager _entities = default!;
[Dependency] private readonly ISharedAdminLogManager _adminLogger = default!;
private ISawmill _logger = default!;
@@ -76,14 +79,14 @@ public sealed class ERTRecruitmentRule : StationEventSystem<ERTRecruitmentRuleCo
if (component.TargetStation == null || component.IsBlocked || IsDisabled)
{
ForceEndSelf(uid, gameRule);
_logger.Debug("oopsie doopsie we make a poopie poopie on starting event!");
_adminLogger.Add(LogType.EventStarted, LogImpact.High, $"ERT Declined - Event disabled");
return;
}
if (_recruitment.GetEventSpawners(ERTRecruitmentRuleComponent.EventName).Count() < component.MinPlayer)
{
_logger.Debug("Not enough spawners!");
DeclineERT(component.TargetStation.Value);
_adminLogger.Add(LogType.EventStarted, LogImpact.High, $"ERT Declined - Not enough spawners");
return;
}
@@ -91,6 +94,7 @@ public sealed class ERTRecruitmentRule : StationEventSystem<ERTRecruitmentRuleCo
{
_logger.Debug("Not enough time passed!");
DeclineERT(component.TargetStation.Value);
_adminLogger.Add(LogType.EventStarted, LogImpact.High, $"ERT Declined - Not enough time passed");
return;
}
@@ -109,15 +113,25 @@ public sealed class ERTRecruitmentRule : StationEventSystem<ERTRecruitmentRuleCo
protected override void Ended(EntityUid uid, ERTRecruitmentRuleComponent component, GameRuleComponent gameRule, GameRuleEndedEvent args)
{
base.Ended(uid, component, gameRule, args);
var ertsys = _entities.System<ERTRecruitmentRule>();
var check1 = component.IsBlocked;
var check1 = component.IsBlocked || ertsys.IsDisabled;
var check2 = _recruitment.GetAllRecruited(ERTRecruitmentRuleComponent.EventName).Count() < component.MinPlayer;
if (check1 || check2)
if (check1)
{
if (component.TargetStation != null)
DeclineERT(component.TargetStation.Value);
_adminLogger.Add(LogType.EventStarted, LogImpact.High, $"ERT Declined - Event disabled");
_recruitment.Cleanup(ERTRecruitmentRuleComponent.EventName);
return;
}
if (check2)
{
if (component.TargetStation != null)
DeclineERT(component.TargetStation.Value);
_adminLogger.Add(LogType.EventStarted, LogImpact.High, $"ERT Declined - Not enough ghosts willing to play ERT");
_recruitment.Cleanup(ERTRecruitmentRuleComponent.EventName);
return;
}
@@ -127,7 +141,6 @@ public sealed class ERTRecruitmentRule : StationEventSystem<ERTRecruitmentRuleCo
AcceptERT(component.TargetStation.Value);
_recruitment.EndRecruitment(ERTRecruitmentRuleComponent.EventName);
var ertsys = _entities.System<ERTRecruitmentRule>();
ertsys.IsDisabled = true;
}

View File

@@ -63,8 +63,7 @@ public sealed class GhostRecruitmentSystem : EntitySystem
var count = 0;
//var maxCount = Math.Max(3, _playerManager.PlayerCount / 8);
var maxCount = 1;
var maxCount = Math.Max(3, _playerManager.PlayerCount / 8);
var query = EntityQueryEnumerator<GhostRecruitedComponent>();
while (query.MoveNext(out var uid, out var ghostRecruitedComponent))

View File

@@ -260,7 +260,7 @@
startingItem: MagazinePistolRubber
insertSound: /Audio/Weapons/Guns/MagIn/pistol_magin.ogg
ejectSound: /Audio/Weapons/Guns/MagOut/pistol_magout.ogg
priority: 2
priority: 4
whitelist:
tags:
- MagazinePistol

View File

@@ -5,7 +5,7 @@
components:
- type: StationEvent
weight: 0
duration: 20
duration: 30
- type: ERTRecruitmentRule
minPlayer: 4
earliestStart: 30