Пару изменений (#468)

* fix: Двери больше нельзя моментально открыть голыми руками

* add: Несколько целевой пинпоинтер для оперативников синдиката

* add: Боеголовка синдиката
This commit is contained in:
Spatison
2024-07-20 05:33:14 +03:00
committed by GitHub
parent 0dff5a3f79
commit 88a09bea71
15 changed files with 295 additions and 105 deletions

View File

@@ -251,8 +251,32 @@ public sealed class NukeopsRuleSystem : GameRuleSystem<NukeopsRuleComponent>
continue;
}
MapId? targetStationMap = null;
if (nukeops.TargetStation != null && TryComp(nukeops.TargetStation, out StationDataComponent? stationData))
{
var stationGrid = stationData.Grids.FirstOrNull();
targetStationMap = stationGrid != null
? Transform(stationGrid.Value).MapID
: null;
}
// WD EDIT
nukeops.WinConditions.Add(WinCondition.NukeExplodedOnCorrectStation);
SetWinType(uid, WinType.OpsMajor, nukeops);
var operatives = EntityQuery<NukeOperativeComponent, TransformComponent>(true);
var operativesAlive = operatives
.Any(ent => ent.Item2.MapID != targetStationMap && ent.Item1.Running);
if (operativesAlive)
SetWinType(uid, WinType.OpsMajor, nukeops);
else
{
nukeops.WinConditions.Add(WinCondition.AllNukiesDead);
SetWinType(uid, WinType.OpsMinor, nukeops);
}
// WD EDIT
correctStation = true;
}
@@ -516,7 +540,7 @@ public sealed class NukeopsRuleSystem : GameRuleSystem<NukeopsRuleComponent>
return;
// If the win condition was set to operative/crew major win, ignore.
if (component.WinType == WinType.OpsMajor || component.WinType == WinType.CrewMajor)
if (component.WinType == WinType.OpsMajor || component.WinType == WinType.CrewMajor || component.WinType == WinType.OpsMinor)
return;
var nukeQuery = AllEntityQuery<NukeComponent, TransformComponent>();
@@ -527,6 +551,7 @@ public sealed class NukeopsRuleSystem : GameRuleSystem<NukeopsRuleComponent>
if (nuke.Status != NukeStatus.ARMED)
continue;
Log.Error("hyi");
// UH OH
if (nukeTransform.MapUid != null && centcomms.Contains(nukeTransform.MapUid.Value))
{
@@ -552,39 +577,42 @@ public sealed class NukeopsRuleSystem : GameRuleSystem<NukeopsRuleComponent>
}
}
var allAlive = true;
var query = EntityQueryEnumerator<NukeopsRoleComponent, MindContainerComponent, MobStateComponent>();
while (query.MoveNext(out var nukeopsUid, out _, out var mindContainer, out var mobState))
if (!component.WinConditions.Contains(WinCondition.AllNukiesDead)) // WD EDIT
{
// mind got deleted somehow so ignore it
if (!_mind.TryGetMind(nukeopsUid, out _, out var mind, mindContainer))
continue;
// check if player got gibbed or ghosted or something - count as dead
if (mind.OwnedEntity != null &&
// if the player somehow isn't a mob anymore that also counts as dead
// have to be alive, not crit or dead
mobState.CurrentState is MobState.Alive)
var allAlive = true;
var query = EntityQueryEnumerator<NukeopsRoleComponent, MindContainerComponent, MobStateComponent>();
while (query.MoveNext(out var nukeopsUid, out _, out var mindContainer, out var mobState))
{
continue;
// mind got deleted somehow so ignore it
if (!_mind.TryGetMind(nukeopsUid, out _, out var mind, mindContainer))
continue;
// check if player got gibbed or ghosted or something - count as dead
if (mind.OwnedEntity != null &&
// if the player somehow isn't a mob anymore that also counts as dead
// have to be alive, not crit or dead
mobState.CurrentState is MobState.Alive)
{
continue;
}
allAlive = false;
break;
}
allAlive = false;
break;
}
// If all nuke ops were alive at the end of the round,
// the nuke ops win. This is to prevent people from
// running away the moment nuke ops appear.
if (allAlive)
{
SetWinType(uid, WinType.OpsMinor, component);
component.WinConditions.Add(WinCondition.AllNukiesAlive);
return;
}
// If all nuke ops were alive at the end of the round,
// the nuke ops win. This is to prevent people from
// running away the moment nuke ops appear.
if (allAlive)
{
SetWinType(uid, WinType.OpsMinor, component);
component.WinConditions.Add(WinCondition.AllNukiesAlive);
return;
component.WinConditions.Add(WinCondition.SomeNukiesAlive);
}
component.WinConditions.Add(WinCondition.SomeNukiesAlive);
var diskAtCentCom = false;
var diskQuery = AllEntityQuery<NukeDiskComponent, TransformComponent>();
@@ -619,7 +647,7 @@ public sealed class NukeopsRuleSystem : GameRuleSystem<NukeopsRuleComponent>
component.WinType = type;
if (endRound && (type == WinType.CrewMajor || type == WinType.OpsMajor))
if (endRound && (type == WinType.CrewMajor || type == WinType.OpsMajor || type == WinType.OpsMinor))
_roundEndSystem.EndRound();
}

View File

@@ -114,9 +114,7 @@ namespace Content.Server.Nuke
foreach (var (nukeUid, nuke) in nukes)
{
if (!onlyCurrentStation &&
(owningStation == null &&
nuke.OriginMapGrid != (transform.MapID, transform.GridUid) ||
nuke.OriginStation != owningStation))
nuke.OriginStation != owningStation)
{
continue;
}

View File

@@ -8,7 +8,7 @@ using Content.Shared.IdentityManagement;
namespace Content.Server.Pinpointer;
public sealed class PinpointerSystem : SharedPinpointerSystem
public sealed partial class PinpointerSystem : SharedPinpointerSystem
{
[Dependency] private readonly SharedTransformSystem _transform = default!;
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
@@ -18,6 +18,8 @@ public sealed class PinpointerSystem : SharedPinpointerSystem
public override void Initialize()
{
base.Initialize();
InitializeMultiplePinpointer(); // WD EDIT
_xformQuery = GetEntityQuery<TransformComponent>();
SubscribeLocalEvent<PinpointerComponent, ActivateInWorldEvent>(OnActivate);

View File

@@ -0,0 +1,75 @@
using Content.Shared._White.Pinpointer;
using Content.Shared.Interaction;
using Content.Shared.Pinpointer;
namespace Content.Server.Pinpointer;
public sealed partial class PinpointerSystem
{
public void InitializeMultiplePinpointer()
{
SubscribeLocalEvent<MultiplePinpointerComponent, ComponentStartup>(OnMultiplePinpointerStartup);
SubscribeLocalEvent<MultiplePinpointerComponent, ActivateInWorldEvent>(OnMultiplePinpointerActivated);
SubscribeLocalEvent<MultiplePinpointerComponent, AfterAutoHandleStateEvent>(OnMultiplePinpointerHandleState);
}
private void OnMultiplePinpointerHandleState(EntityUid uid, MultiplePinpointerComponent component, ref AfterAutoHandleStateEvent args)
{
SetMultiplePinpointer(uid, component);
}
private void OnMultiplePinpointerStartup(EntityUid uid, MultiplePinpointerComponent multiple, ComponentStartup args)
{
var pinpointer = EntityManager.EnsureComponent<PinpointerComponent>(uid);
SetMultiplePinpointer(uid, multiple, pinpointer);
}
private void OnMultiplePinpointerActivated(EntityUid uid, MultiplePinpointerComponent multiple, ActivateInWorldEvent args)
{
if (args.Handled)
return;
args.Handled = CycleMultiplePinpointer(uid, multiple, args.User);
}
private bool CycleMultiplePinpointer(EntityUid uid, MultiplePinpointerComponent? multiple = null, EntityUid? user = null)
{
if (!Resolve(uid, ref multiple))
return false;
if (multiple.Modes.Length == 0)
return false;
multiple.CurrentEntry = (uint)((multiple.CurrentEntry + 1) % multiple.Modes.Length);
SetMultiplePinpointer(uid, multiple, user: user);
return true;
}
private void SetMultiplePinpointer(EntityUid uid,
MultiplePinpointerComponent? multiple = null,
PinpointerComponent? pin = null,
EntityUid? user = null)
{
if (!Resolve(uid, ref multiple, ref pin))
return;
if (multiple.Modes.Length <= multiple.CurrentEntry)
return;
var current = multiple.Modes[multiple.CurrentEntry];
SetDistance(uid, Distance.Unknown, pin);
if (current == "Off")
{
SetActive(uid, true, pin);
pin.Component = null;
}
else
{
SetActive(uid, false, pin);
pin.Component = current;
}
LocateTarget(uid, pin);
}
}

View File

@@ -134,7 +134,7 @@ public sealed class PryingSystem : EntitySystem
RaiseLocalEvent(target, ref modEv);
var time = TimeSpan.FromSeconds(!TryComp<AirlockComponent>(target, out var airlock) || !airlock.Powered ? 0 : modEv.BaseTime * modEv.PryTimeModifier * toolModifier); // WD EDIT
var time = TimeSpan.FromSeconds(modEv.BaseTime * modEv.PryTimeModifier * (toolModifier - (!TryComp<AirlockComponent>(target, out var airlock) || !airlock.Powered ? 1 : 0))); // WD EDIT
var doAfterArgs = new DoAfterArgs(EntityManager, user, time, new DoorPryDoAfterEvent(), target, target, tool)
{

View File

@@ -0,0 +1,12 @@
using Robust.Shared.GameStates;
namespace Content.Shared._White.Nuke;
/// <summary>
/// Used for tracking the nuke bomb - isn't a tag for pinpointer purposes.
/// </summary>
[RegisterComponent, NetworkedComponent]
public sealed partial class NuclearBombSyndicateComponent : Component
{
}

View File

@@ -0,0 +1,13 @@
using Robust.Shared.GameStates;
namespace Content.Shared._White.Pinpointer;
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class MultiplePinpointerComponent : Component
{
[DataField(required: true)]
public string[] Modes = Array.Empty<string>();
[ViewVariables, AutoNetworkedField]
public uint CurrentEntry = 0;
}

View File

@@ -4,6 +4,9 @@ ent-NuclearBomb = ядерная боеголовка
ent-NuclearBombUnanchored = { ent-NuclearBomb }
.suffix = незакрепленный
.desc = { ent-NuclearBomb.desc }
ent-NuclearBombSyndicate = { ent-NuclearBomb }
.suffix = синдикат
.desc = { ent-NuclearBomb.desc }
ent-NuclearBombKeg = ядерная боеголовка
.desc = Вам, вероятно, не стоит оставаться здесь, чтобы проверить, запущена ли она. Сбоку имеется кран.
.suffix = кег

View File

@@ -165,6 +165,14 @@ entities:
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- volume: 2500
temperature: 293.15
moles:
@@ -180,6 +188,14 @@ entities:
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- volume: 2500
temperature: 293.14996
moles:
@@ -195,6 +211,14 @@ entities:
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- volume: 2500
temperature: 293.15
moles:
@@ -210,6 +234,14 @@ entities:
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- volume: 2500
temperature: 293.15
moles:
@@ -225,6 +257,14 @@ entities:
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- volume: 2500
temperature: 293.15
moles:
@@ -240,6 +280,14 @@ entities:
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
chunkSize: 4
- type: DecalGrid
chunkCollection:
@@ -2650,8 +2698,6 @@ entities:
rot: 3.141592653589793 rad
pos: 5.5,-27.5
parent: 1
- type: AtmosDevice
joinedGrid: 1
- proto: GasMinerOxygen
entities:
- uid: 369
@@ -2660,8 +2706,6 @@ entities:
rot: 3.141592653589793 rad
pos: 3.5,-27.5
parent: 1
- type: AtmosDevice
joinedGrid: 1
- proto: GasMixer
entities:
- uid: 370
@@ -2675,8 +2719,6 @@ entities:
- type: GasMixer
inletTwoConcentration: 0.78
inletOneConcentration: 0.22
- type: AtmosDevice
joinedGrid: 1
- type: AtmosPipeColor
color: '#0335FCFF'
- proto: GasPassiveVent
@@ -2687,24 +2729,18 @@ entities:
rot: 3.141592653589793 rad
pos: 3.5,-26.5
parent: 1
- type: AtmosDevice
joinedGrid: 1
- uid: 372
components:
- type: Transform
rot: 3.141592653589793 rad
pos: 5.5,-26.5
parent: 1
- type: AtmosDevice
joinedGrid: 1
- uid: 373
components:
- type: Transform
rot: -1.5707963267948966 rad
pos: 6.5,-19.5
parent: 1
- type: AtmosDevice
joinedGrid: 1
- proto: GasPipeBend
entities:
- uid: 374
@@ -3268,8 +3304,6 @@ entities:
rot: 1.5707963267948966 rad
pos: 2.5,-23.5
parent: 1
- type: AtmosDevice
joinedGrid: 1
- type: AtmosPipeColor
color: '#0335FCFF'
- proto: GasPressurePump
@@ -3282,8 +3316,6 @@ entities:
rot: 1.5707963267948966 rad
pos: 4.5,-19.5
parent: 1
- type: AtmosDevice
joinedGrid: 1
- type: AtmosPipeColor
color: '#FF1212FF'
- proto: GasVentPump
@@ -3294,8 +3326,6 @@ entities:
rot: -1.5707963267948966 rad
pos: 0.5,-11.5
parent: 1
- type: AtmosDevice
joinedGrid: 1
- type: AtmosPipeColor
color: '#0335FCFF'
- uid: 450
@@ -3304,8 +3334,6 @@ entities:
rot: 3.141592653589793 rad
pos: -0.5,-21.5
parent: 1
- type: AtmosDevice
joinedGrid: 1
- type: AtmosPipeColor
color: '#0335FCFF'
- uid: 451
@@ -3314,8 +3342,6 @@ entities:
rot: -1.5707963267948966 rad
pos: 4.5,-23.5
parent: 1
- type: AtmosDevice
joinedGrid: 1
- type: AtmosPipeColor
color: '#0335FCFF'
- uid: 452
@@ -3324,8 +3350,6 @@ entities:
rot: 3.141592653589793 rad
pos: -4.5,-21.5
parent: 1
- type: AtmosDevice
joinedGrid: 1
- type: AtmosPipeColor
color: '#0335FCFF'
- uid: 453
@@ -3334,8 +3358,6 @@ entities:
rot: 1.5707963267948966 rad
pos: -4.5,-16.5
parent: 1
- type: AtmosDevice
joinedGrid: 1
- type: AtmosPipeColor
color: '#0335FCFF'
- uid: 454
@@ -3344,8 +3366,6 @@ entities:
rot: -1.5707963267948966 rad
pos: 3.5,-16.5
parent: 1
- type: AtmosDevice
joinedGrid: 1
- type: AtmosPipeColor
color: '#0335FCFF'
- uid: 455
@@ -3353,8 +3373,6 @@ entities:
- type: Transform
pos: 0.5,-3.5
parent: 1
- type: AtmosDevice
joinedGrid: 1
- type: AtmosPipeColor
color: '#0335FCFF'
- proto: GasVentScrubber
@@ -3365,8 +3383,6 @@ entities:
rot: -1.5707963267948966 rad
pos: 1.5,-12.5
parent: 1
- type: AtmosDevice
joinedGrid: 1
- type: AtmosPipeColor
color: '#FF1212FF'
- uid: 457
@@ -3375,8 +3391,6 @@ entities:
rot: -1.5707963267948966 rad
pos: 3.5,-17.5
parent: 1
- type: AtmosDevice
joinedGrid: 1
- type: AtmosPipeColor
color: '#FF1212FF'
- uid: 458
@@ -3385,8 +3399,6 @@ entities:
rot: 3.141592653589793 rad
pos: 2.5,-20.5
parent: 1
- type: AtmosDevice
joinedGrid: 1
- type: AtmosPipeColor
color: '#FF1212FF'
- uid: 459
@@ -3395,8 +3407,6 @@ entities:
rot: 1.5707963267948966 rad
pos: -4.5,-17.5
parent: 1
- type: AtmosDevice
joinedGrid: 1
- type: AtmosPipeColor
color: '#FF1212FF'
- uid: 460
@@ -3405,8 +3415,6 @@ entities:
rot: 1.5707963267948966 rad
pos: -3.5,-21.5
parent: 1
- type: AtmosDevice
joinedGrid: 1
- type: AtmosPipeColor
color: '#FF1212FF'
- uid: 461
@@ -3414,8 +3422,6 @@ entities:
- type: Transform
pos: -0.5,-3.5
parent: 1
- type: AtmosDevice
joinedGrid: 1
- type: AtmosPipeColor
color: '#FF1212FF'
- proto: GeneratorBasic15kW
@@ -3635,6 +3641,9 @@ entities:
- type: Transform
pos: 4.5,-5.5
parent: 1
- type: PointLight
color: '#D56C6CFF'
enabled: True
- type: EntityStorage
air:
volume: 200
@@ -3653,6 +3662,14 @@ entities:
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- type: ContainerContainer
containers:
entity_storage: !type:Container
@@ -3726,19 +3743,19 @@ entities:
- type: Transform
pos: 5.6633797,-17.565443
parent: 1
- proto: NuclearBombUnanchored
- proto: NuclearBombSyndicate
entities:
- uid: 509
components:
- type: Transform
pos: -2.5,-12.5
parent: 1
- proto: NukeCodePaper
- proto: NukeCodePaperStation
entities:
- uid: 510
components:
- type: Transform
pos: -2.5286522,-11.44479
pos: -2.4890966,-11.441471
parent: 1
- proto: Ointment
entities:
@@ -3766,8 +3783,8 @@ entities:
- type: Transform
pos: -1.5,-24.5
parent: 1
- type: AtmosDevice
joinedGrid: 1
- type: PolymorphableCanister
currentPrototype: OxygenCanister
- proto: OxygenTankFilled
entities:
- uid: 515
@@ -4551,8 +4568,8 @@ entities:
- type: Transform
pos: 2.5,-23.5
parent: 1
- type: AtmosDevice
joinedGrid: 1
- type: PolymorphableCanister
currentPrototype: StorageCanister
- proto: SubstationBasic
entities:
- uid: 628

View File

@@ -184,6 +184,14 @@ entities:
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
chunkSize: 4
- type: GasTileOverlay
- type: RadiationGridResistance
@@ -191,6 +199,7 @@ entities:
shakeTimes: 10
- type: SpreaderGrid
- type: GridPathfinding
- type: NukeOpsShuttle
- proto: AirCanister
entities:
- uid: 91
@@ -198,8 +207,8 @@ entities:
- type: Transform
pos: -0.5,-8.5
parent: 325
- type: AtmosDevice
joinedGrid: 325
- type: PolymorphableCanister
currentPrototype: AirCanister
- proto: AirlockExternalShuttleSyndicateLocked
entities:
- uid: 142
@@ -825,6 +834,10 @@ entities:
occludes: True
ents:
- 245
disk_slot: !type:ContainerSlot
showEnts: False
occludes: True
ent: null
- proto: CyberPen
entities:
- uid: 77
@@ -1041,8 +1054,6 @@ entities:
rot: 3.141592653589793 rad
pos: -0.5,-8.5
parent: 325
- type: AtmosDevice
joinedGrid: 325
- proto: GasVentPump
entities:
- uid: 218
@@ -1054,8 +1065,6 @@ entities:
address: Vnt-5f41a0ae
transmitFrequency: 1621
receiveFrequency: 1621
- type: AtmosDevice
joinedGrid: 325
- uid: 219
components:
- type: Transform
@@ -1066,8 +1075,6 @@ entities:
address: Vnt-129c27d2
transmitFrequency: 1621
receiveFrequency: 1621
- type: AtmosDevice
joinedGrid: 325
- uid: 220
components:
- type: Transform
@@ -1078,8 +1085,6 @@ entities:
address: Vnt-11c4609d
transmitFrequency: 1621
receiveFrequency: 1621
- type: AtmosDevice
joinedGrid: 325
- uid: 221
components:
- type: Transform
@@ -1090,8 +1095,6 @@ entities:
address: Vnt-6859729f
transmitFrequency: 1621
receiveFrequency: 1621
- type: AtmosDevice
joinedGrid: 325
- uid: 222
components:
- type: Transform
@@ -1102,8 +1105,6 @@ entities:
address: Vnt-19d24c7f
transmitFrequency: 1621
receiveFrequency: 1621
- type: AtmosDevice
joinedGrid: 325
- proto: GeneratorBasic15kW
entities:
- uid: 41
@@ -1457,6 +1458,13 @@ entities:
- type: Transform
pos: 1.561105,-2.5567772
parent: 325
- proto: OxygenTankFilled
entities:
- uid: 167
components:
- type: Transform
pos: 1.60798,-0.3062118
parent: 325
- proto: PinpointerNuclear
entities:
- uid: 162
@@ -2379,11 +2387,4 @@ entities:
occludes: True
ents:
- 346
- proto: YellowOxygenTankFilled
entities:
- uid: 167
components:
- type: Transform
pos: 1.60798,-0.3062118
parent: 325
...

View File

@@ -332,6 +332,17 @@
- id: PinpointerSyndicateNuclear
- id: DeathAcidifierImplanter
- type: entity
parent: ClothingBackpackDuffelSyndicateBundle
id: ClothingBackpackDuffelSyndicateLonelyOperative
name: operative duffelbag
components:
- type: StorageFill
contents:
- id: BoxSurvivalSyndicate
- id: WeaponPistolViper
- id: PinpointerStationNuclear
- id: DeathAcidifierImplanter
- type: entity
parent: ClothingBackpackDuffelSyndicateMedicalBundle

View File

@@ -63,6 +63,26 @@
- type: Pinpointer
component: NukeDisk
targetName: nuclear authentication disk
updateTargetName: true
- type: MultiplePinpointer
modes:
- Off
- NukeDisk
- NuclearBombSyndicate
- NukeOpsShuttle
- type: entity
parent: PinpointerSyndicateNuclear
id: PinpointerStationNuclear
suffix: Station bomb
components:
- type: MultiplePinpointer
modes:
- Off
- NukeDisk
- Nuke
- NukeOpsShuttle
- type: entity
name: universal pinpointer

View File

@@ -303,6 +303,7 @@
suffix: Station Only
components:
- type: NukeCodePaper
allNukesAvailable: false
- type: entity
name: pen

View File

@@ -94,6 +94,15 @@
- type: Physics
bodyType: Dynamic
- type: entity
parent: NuclearBombUnanchored
id: NuclearBombSyndicate
suffix: syndicate
components:
- type: NuclearBombSyndicate
- type: NukeLabel
prefix: nuke-label-syndicate
- type: entity
parent: StorageTank
id: NuclearBombKeg

View File

@@ -142,7 +142,7 @@
id: SyndicateLoneOperativeGearFull
equipment:
jumpsuit: ClothingUniformJumpsuitOperative
back: ClothingBackpackDuffelSyndicateOperative
back: ClothingBackpackDuffelSyndicateLonelyOperative
mask: ClothingMaskGasSyndicate
eyes: ClothingEyesHudSyndicate
ears: ClothingHeadsetAltSyndicate