Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfixes #87

Merged
merged 4 commits into from
Mar 2, 2024
Merged
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
29 changes: 21 additions & 8 deletions Content.Server/GameTicking/Rules/TS/MasterRORuleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using Content.Shared.Mobs.Components;
using Content.Shared.GameTicking;
using Content.Shared.Mind;
using Content.Shared.Mind.Components;
using Content.Shared.Mobs.Systems;
using Robust.Server.GameObjects;
using Robust.Server.Maps;
Expand Down Expand Up @@ -42,6 +43,9 @@ public sealed class MasterRORuleSystem : GameRuleSystem<MasterRORuleComponent>
[Dependency] private readonly MobStateSystem _mobStateSystem = default!;
[Dependency] private readonly RoundEndSystem _roundEndSystem = default!;

private const float _tickDelay = 2;
private float _currentDelay = _tickDelay;

public override void Initialize()
{
base.Initialize();
Expand Down Expand Up @@ -233,6 +237,12 @@ protected override void ActiveTick(EntityUid uid, MasterRORuleComponent componen
{
base.ActiveTick(uid, component, gameRule, frameTime);

_currentDelay -= frameTime;
if (_currentDelay > 0)
return;
else
_currentDelay = _tickDelay;

// fastest implementation without some functionality
// @todo refactor this

Expand Down Expand Up @@ -263,7 +273,6 @@ protected override void ActiveTick(EntityUid uid, MasterRORuleComponent componen
}

bool isAllAntagDead = true;
bool isSomeAntagDead = false;
bool isSomeAntagOnMainMap = false;
var query = EntityQueryEnumerator<MissionAntagComponent, TransformComponent>();
while (query.MoveNext(out var eq_uid, out var eq_component, out var eq_xform))
Expand All @@ -283,10 +292,6 @@ protected override void ActiveTick(EntityUid uid, MasterRORuleComponent componen

isAllAntagDead = false;
}
else
{
isSomeAntagDead = true;
}
}


Expand All @@ -296,9 +301,12 @@ protected override void ActiveTick(EntityUid uid, MasterRORuleComponent componen
while (queryMarine.MoveNext(out var eq_uid, out _))
{
++marinesCount;
if (_mobStateSystem.IsAlive(eq_uid) && TryComp<MindComponent>(eq_uid, out var mind) && mind.Session != null)
if (TryComp<MindContainerComponent>(eq_uid, out var mind))
{
++aliveMarinesCount;
if (_mobStateSystem.IsAlive(eq_uid) && mind.HasMind)
{
++aliveMarinesCount;
}
}
}
bool zeroMarines = aliveMarinesCount == 0;
Expand All @@ -314,6 +322,9 @@ protected override void ActiveTick(EntityUid uid, MasterRORuleComponent componen
//component.WinConditions.Add(WinMissionCondition.AllObjectivesComplete);
component.WinType = WinMissionType.GarrisonMajorWin;
_roundEndSystem.EndRound();
_logManager.GetSawmill("RORule").Info(
"Round end by isAllAntagDead = {0}, isSomeAntagOnMainMap = {1}, marinesCount = {2}, aliveMarinesCount = {3}, marinePercentage = {4}",
isAllAntagDead, isSomeAntagOnMainMap, marinesCount, aliveMarinesCount, marinePercentage);
}

if (marinePercentage < 0.1f)
Expand All @@ -326,8 +337,10 @@ protected override void ActiveTick(EntityUid uid, MasterRORuleComponent componen
else
component.WinType = WinMissionType.GarrisonMinorLose;
}

_roundEndSystem.EndRound();
_logManager.GetSawmill("RORule").Info(
"Round end by isAllAntagDead = {0}, isSomeAntagOnMainMap = {1}, marinesCount = {2}, aliveMarinesCount = {3}, marinePercentage = {4}",
isAllAntagDead, isSomeAntagOnMainMap, marinesCount, aliveMarinesCount, marinePercentage);
}
}

Expand Down
78 changes: 40 additions & 38 deletions Resources/Maps/deterrent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3370,24 +3370,6 @@ entities:
parent: 8978
- proto: AirlockEngineeringGlassLocked
entities:
- uid: 839
components:
- type: Transform
rot: 1.5707963267948966 rad
pos: -3.5,-4.5
parent: 832
- uid: 840
components:
- type: Transform
rot: 1.5707963267948966 rad
pos: 4.5,-4.5
parent: 832
- uid: 841
components:
- type: Transform
rot: 1.5707963267948966 rad
pos: -0.5,6.5
parent: 832
- uid: 2582
components:
- type: Transform
Expand Down Expand Up @@ -3455,11 +3437,6 @@ entities:
- type: Transform
pos: 21.5,48.5
parent: 2
- uid: 8729
components:
- type: Transform
pos: -1.5,9.5
parent: 832
- uid: 8991
components:
- type: Transform
Expand Down Expand Up @@ -4127,13 +4104,45 @@ entities:
- type: Transform
pos: 21.5,18.5
parent: 2
- uid: 8729
components:
- type: Transform
pos: 0.5,-3.5
parent: 832
- proto: AirlockMarineMedicGlassLocked
entities:
- uid: 1094
components:
- type: Transform
pos: 21.5,33.5
parent: 2
- proto: AirlockMarinePilotGlass
entities:
- uid: 839
components:
- type: Transform
pos: 4.5,-4.5
parent: 832
- uid: 840
components:
- type: Transform
pos: -3.5,-4.5
parent: 832
- uid: 841
components:
- type: Transform
pos: -0.5,6.5
parent: 832
- uid: 847
components:
- type: Transform
pos: -1.5,9.5
parent: 832
- uid: 849
components:
- type: Transform
pos: -1.5,3.5
parent: 832
- proto: AirlockMarinePilotGlassLocked
entities:
- uid: 355
Expand All @@ -4156,7 +4165,7 @@ entities:
pos: -11.5,22.5
parent: 2
- type: Door
secondsUntilStateChange: -22531.07
secondsUntilStateChange: -22626.158
state: Opening
- uid: 1400
components:
Expand Down Expand Up @@ -4324,20 +4333,6 @@ entities:
rot: 3.141592653589793 rad
pos: 21.5,-12.5
parent: 2
- proto: AirlockSecurityGlassLocked
entities:
- uid: 847
components:
- type: Transform
rot: 1.5707963267948966 rad
pos: -1.5,3.5
parent: 832
- uid: 849
components:
- type: Transform
rot: 1.5707963267948966 rad
pos: 0.5,-3.5
parent: 832
- proto: AirlockShuttleAssembly
entities:
- uid: 9000
Expand Down Expand Up @@ -44671,6 +44666,13 @@ entities:
- type: Transform
pos: 2.477779,20.570663
parent: 2
- proto: PinpointerStation
entities:
- uid: 9577
components:
- type: Transform
pos: -1.5141056,11.628246
parent: 832
- proto: PlasmaCanister
entities:
- uid: 3278
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
- type: vendingMachineInventory
id: MarineDrobeInventory
startingInventory:
PinpointerAntag: 5
ClothingBackpackMarine: 5
ClothingUniformJumpsuitOperative: 5
ClothingShoesBootsCombat: 5
Expand Down
5 changes: 5 additions & 0 deletions Resources/Prototypes/TS/Entities/Mobs/NPCs/xeno.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
suffix: Combat
description: They mostly come at night. Mostly.
components:
- type: Butcherable
butcheringType: Knife
spawned:
- id: FoodMeatXeno
amount: 5
- type: IntrinsicRadioReceiver
- type: IntrinsicRadioTransmitter
channels:
Expand Down
15 changes: 15 additions & 0 deletions Resources/Prototypes/TS/Entities/Objects/Devices/pinpointer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
- type: entity
parent: PinpointerBase
name: unknown magnite pinpointer
description: A handheld tracking device that leads to the direction of any nearby unknown magnite anomaly.
id: PinpointerAntag
suffix: Antag
components:
- type: Sprite
layers:
- state: pinpointer-station
- type: Icon
state: pinpointer-station
- type: Pinpointer
component: MissionAntag
targetName: Unknown magnite signature
Loading