forked from DeltaV-Station/Delta-v
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/Simple-Station/Einstein-E…
…ngines into EE-Andromeda
- Loading branch information
Showing
272 changed files
with
15,979 additions
and
22,072 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
using Content.Shared.Materials; | ||
|
||
namespace Content.Client.Materials; | ||
|
||
public sealed class MaterialSiloSystem : SharedMaterialSiloSystem; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
using System.Linq; | ||
using Content.Server.Lathe; | ||
using Content.Server.Station.Components; | ||
using Content.Shared.DeviceLinking; | ||
using Content.Shared.Lathe; | ||
using Content.Shared.Materials; | ||
using Robust.Shared.Timing; | ||
|
||
namespace Content.Server.Materials; | ||
|
||
public sealed class MaterialSiloSystem : SharedMaterialSiloSystem | ||
{ | ||
[Dependency] private readonly LatheSystem _lathe = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<BecomesStationComponent, MapInitEvent>(OnMapInit); | ||
SubscribeLocalEvent<MaterialSiloComponent, MaterialAmountChangedEvent>(OnMaterialAmountChanged); | ||
} | ||
|
||
private void OnMaterialAmountChanged(Entity<MaterialSiloComponent> ent, ref MaterialAmountChangedEvent args) | ||
{ | ||
// Spawning a timer because SetUiState in UpdateUserInterfaceState is being networked before | ||
// silo's MaterialStorageComponent state gets handled. | ||
// That causes lathe ui recipe list to not update properly. | ||
Timer.Spawn(20, | ||
() => | ||
{ | ||
if (!TryComp(ent, out DeviceLinkSourceComponent? source)) | ||
return; | ||
|
||
foreach (var utilizerSet in source.Outputs.Where(x => x.Key == SourcePort).Select(x => x.Value)) | ||
{ | ||
foreach (var utilizer in utilizerSet) | ||
{ | ||
if (TryComp(utilizer, out LatheComponent? lathe)) | ||
_lathe.UpdateUserInterfaceState(utilizer, lathe); | ||
} | ||
} | ||
}); | ||
} | ||
|
||
private void OnMapInit(Entity<BecomesStationComponent> ent, ref MapInitEvent args) | ||
{ | ||
Entity<DeviceLinkSourceComponent>? silo = null; | ||
var siloQuery = AllEntityQuery<MaterialSiloComponent, MaterialStorageComponent, TransformComponent, DeviceLinkSourceComponent>(); | ||
while (siloQuery.MoveNext(out var siloEnt, out _, out _, out var siloXform, out var source)) | ||
{ | ||
if (siloXform.GridUid != ent) | ||
continue; | ||
|
||
silo = (siloEnt, source); | ||
break; | ||
} | ||
|
||
if (silo == null) | ||
return; | ||
|
||
var utilizerQuery = AllEntityQuery<MaterialSiloUtilizerComponent, MaterialStorageComponent, TransformComponent, DeviceLinkSinkComponent>(); | ||
while (utilizerQuery.MoveNext(out var utilizer, out _, out var storage, out var utilizerXform, out var sink)) | ||
{ | ||
if (utilizerXform.GridUid != ent) | ||
continue; | ||
|
||
DeviceLink.LinkDefaults(null, silo.Value, utilizer, silo.Value.Comp, sink); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
Content.Server/WhiteDream/BloodCult/Items/BaseAura/BaseAuraSystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using Content.Server.Chat.Systems; | ||
using Content.Shared.WhiteDream.BloodCult.Items.BaseAura; | ||
using Content.Shared.WhiteDream.BloodCult.Spells; | ||
|
||
namespace Content.Server.WhiteDream.BloodCult.Items.BaseAura; | ||
|
||
public abstract class BaseAuraSystem<T> : EntitySystem where T : BaseAuraComponent | ||
{ | ||
[Dependency] private readonly ChatSystem _chat = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
SubscribeLocalEvent<T, SpeakOnAuraUseEvent>(OnAuraUse); | ||
} | ||
|
||
private void OnAuraUse(EntityUid uid, T component, SpeakOnAuraUseEvent args) | ||
{ | ||
// TODO: The charge of the aura spell should be spent here | ||
if (component.Speech != null) | ||
_chat.TrySendInGameICMessage(args.User, component.Speech, component.ChatType, false); | ||
} | ||
} |
44 changes: 7 additions & 37 deletions
44
Content.Server/WhiteDream/BloodCult/Items/ShadowShacklesAura/ShadowShacklesAuraSystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,25 @@ | ||
using System.Linq; | ||
using Content.Server.Chat.Systems; | ||
using Content.Server.Cuffs; | ||
using Content.Server.Stunnable; | ||
using Content.Server.WhiteDream.BloodCult.Items.BaseAura; | ||
using Content.Shared.Speech.Muting; | ||
using Content.Shared.StatusEffect; | ||
using Content.Shared.Stunnable; | ||
using Content.Shared.Weapons.Melee.Events; | ||
using Content.Shared.WhiteDream.BloodCult.BloodCultist; | ||
using Robust.Server.GameObjects; | ||
|
||
using Content.Shared.WhiteDream.BloodCult.Items.ShadowShacklesAura; | ||
using Robust.Shared.Containers; | ||
|
||
namespace Content.Server.WhiteDream.BloodCult.Items.ShadowShacklesAura; | ||
|
||
public sealed class ShadowShacklesAuraSystem : EntitySystem | ||
public sealed class ShadowShacklesAuraSystem : BaseAuraSystem<ShadowShacklesAuraComponent> | ||
{ | ||
[Dependency] private readonly StatusEffectsSystem _statusEffects = default!; | ||
[Dependency] private readonly StunSystem _stun = default!; | ||
[Dependency] private readonly ChatSystem _chat = default!; | ||
[Dependency] private readonly TransformSystem _transform = default!; | ||
[Dependency] private readonly CuffableSystem _cuffable = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<ShadowShacklesAuraComponent, MeleeHitEvent>(OnMeleeHit); | ||
SubscribeLocalEvent<ShadowShacklesAuraComponent, EntRemovedFromContainerMessage>(OnShackles); | ||
} | ||
|
||
private void OnMeleeHit(EntityUid uid, ShadowShacklesAuraComponent component, MeleeHitEvent args) | ||
private void OnShackles(EntityUid uid, ShadowShacklesAuraComponent component, EntRemovedFromContainerMessage args) | ||
{ | ||
if (!args.HitEntities.Any()) | ||
return; | ||
|
||
var target = args.HitEntities.First(); | ||
if (uid == target | ||
|| HasComp<StunnedComponent>(target) | ||
|| HasComp<BloodCultistComponent>(target)) | ||
return; | ||
|
||
if (component.Speech != null) | ||
_chat.TrySendInGameICMessage(args.User, component.Speech, component.ChatType, false); | ||
|
||
var shuckles = Spawn(component.ShacklesProto, _transform.GetMapCoordinates(args.User)); | ||
if (!_cuffable.TryAddNewCuffs(target, args.User, shuckles)) | ||
{ | ||
QueueDel(shuckles); | ||
return; | ||
} | ||
|
||
_stun.TryKnockdown(target, component.KnockdownDuration, true); | ||
_statusEffects.TryAddStatusEffect<MutedComponent>(target, "Muted", component.MuteDuration, true); | ||
QueueDel(uid); | ||
_statusEffects.TryAddStatusEffect<MutedComponent>(component.Target, "Muted", component.MuteDuration, true); | ||
} | ||
} |
3 changes: 1 addition & 2 deletions
3
Content.Server/WhiteDream/BloodCult/Items/StunAura/StunAuraComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.