From f213ea1cb6837d7eb7dcc8e0143ac479fe739001 Mon Sep 17 00:00:00 2001 From: Dvir Date: Tue, 26 Mar 2024 23:54:26 +0200 Subject: [PATCH 1/2] Fixing --- .../OnTrigger/GibOnTriggerComponent.cs | 7 +++++ .../Explosion/EntitySystems/TriggerSystem.cs | 14 ++++++++++ .../Bed/Sleep/AutoWakeUpComponent.cs | 13 ++++++++++ .../Bed/Sleep/SharedSleepingSystem.cs | 11 ++++++++ .../Buckle/Components/BuckleComponent.cs | 7 +++++ .../Buckle/SharedBuckleSystem.Buckle.cs | 3 +++ .../_NF/Entities/Mobs/NPCs/syndicatemob.yml | 11 ++++---- .../_NF/Entities/Objects/Misc/implanters.yml | 9 +++++++ .../Objects/Misc/subdermal_implants.yml | 26 +++++++++++++++++++ 9 files changed, 95 insertions(+), 6 deletions(-) create mode 100644 Content.Shared/Bed/Sleep/AutoWakeUpComponent.cs diff --git a/Content.Server/Explosion/Components/OnTrigger/GibOnTriggerComponent.cs b/Content.Server/Explosion/Components/OnTrigger/GibOnTriggerComponent.cs index da584676593..61615d65b9a 100644 --- a/Content.Server/Explosion/Components/OnTrigger/GibOnTriggerComponent.cs +++ b/Content.Server/Explosion/Components/OnTrigger/GibOnTriggerComponent.cs @@ -13,4 +13,11 @@ public sealed partial class GibOnTriggerComponent : Component [ViewVariables(VVAccess.ReadWrite)] [DataField("deleteItems")] public bool DeleteItems = false; + + /// + /// Frontier - Should gibbing also delete the owners organs? + /// + [ViewVariables(VVAccess.ReadWrite)] + [DataField("deleteOrgans")] + public bool DeleteOrgans = false; } diff --git a/Content.Server/Explosion/EntitySystems/TriggerSystem.cs b/Content.Server/Explosion/EntitySystems/TriggerSystem.cs index 0647fec0690..d05a186a315 100644 --- a/Content.Server/Explosion/EntitySystems/TriggerSystem.cs +++ b/Content.Server/Explosion/EntitySystems/TriggerSystem.cs @@ -33,6 +33,7 @@ using Robust.Shared.Random; using Robust.Shared.Player; using Content.Shared.Coordinates; +using Content.Shared.Body.Components; // Frontier - Gib organs namespace Content.Server.Explosion.EntitySystems { @@ -175,6 +176,19 @@ private void HandleGibTrigger(EntityUid uid, GibOnTriggerComponent component, Tr Del(item); } } + + if (component.DeleteOrgans) // Frontier - Gib organs + { + if (TryComp(xform.ParentUid, out var body)) + { + var organs = _body.GetBodyOrganComponents(xform.ParentUid, body); + foreach (var (_, organ) in organs) + { + Del(organ.Owner); + } + } + } // Frontier + _body.GibBody(xform.ParentUid, true); args.Handled = true; } diff --git a/Content.Shared/Bed/Sleep/AutoWakeUpComponent.cs b/Content.Shared/Bed/Sleep/AutoWakeUpComponent.cs new file mode 100644 index 00000000000..f2fa75ca4a2 --- /dev/null +++ b/Content.Shared/Bed/Sleep/AutoWakeUpComponent.cs @@ -0,0 +1,13 @@ +using Content.Shared.FixedPoint; +using Robust.Shared.GameStates; +using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom; + +namespace Content.Shared.Bed.Sleep; + +/// +/// Frontier - Added to AI to allow auto waking up after 5 secs. +/// +[NetworkedComponent, RegisterComponent] +public sealed partial class AutoWakeUpComponent : Component +{ +} diff --git a/Content.Shared/Bed/Sleep/SharedSleepingSystem.cs b/Content.Shared/Bed/Sleep/SharedSleepingSystem.cs index 4e4bc2c574b..1a5443b160c 100644 --- a/Content.Shared/Bed/Sleep/SharedSleepingSystem.cs +++ b/Content.Shared/Bed/Sleep/SharedSleepingSystem.cs @@ -7,6 +7,7 @@ using Robust.Shared.Network; using Robust.Shared.Prototypes; using Robust.Shared.Timing; +using System.Threading.Tasks; // Frontier namespace Content.Server.Bed.Sleep { @@ -38,6 +39,16 @@ private void OnMapInit(EntityUid uid, SleepingComponent component, MapInitEvent // TODO remove hardcoded time. _actionsSystem.SetCooldown(component.WakeAction, _gameTiming.CurTime, _gameTiming.CurTime + TimeSpan.FromSeconds(15)); + + if (TryComp(uid, out var autoWakeUp)) // Frontier + { + Task.Run(async () => + { + await Task.Delay(TimeSpan.FromSeconds(5)); + ev = new SleepStateChangedEvent(false); + RaiseLocalEvent(uid, ev); + }); + } // Frontier } private void OnShutdown(EntityUid uid, SleepingComponent component, ComponentShutdown args) diff --git a/Content.Shared/Buckle/Components/BuckleComponent.cs b/Content.Shared/Buckle/Components/BuckleComponent.cs index cf28b56d51f..80d3be7db14 100644 --- a/Content.Shared/Buckle/Components/BuckleComponent.cs +++ b/Content.Shared/Buckle/Components/BuckleComponent.cs @@ -75,6 +75,13 @@ public sealed partial class BuckleComponent : Component /// Used for client rendering /// [ViewVariables] public int? OriginalDrawDepth; + + /// + /// Frontier - True if the entity is blocked from buckling. + /// + [DataField] + [ViewVariables(VVAccess.ReadWrite)] + public bool Disable; } [ByRefEvent] diff --git a/Content.Shared/Buckle/SharedBuckleSystem.Buckle.cs b/Content.Shared/Buckle/SharedBuckleSystem.Buckle.cs index cfaea47d304..ab5289f35a6 100644 --- a/Content.Shared/Buckle/SharedBuckleSystem.Buckle.cs +++ b/Content.Shared/Buckle/SharedBuckleSystem.Buckle.cs @@ -323,6 +323,9 @@ private bool CanBuckle( if (attemptEvent.Cancelled) return false; + if (buckleComp.Disable) // Frontier + return false; // Frontier + return true; } diff --git a/Resources/Prototypes/_NF/Entities/Mobs/NPCs/syndicatemob.yml b/Resources/Prototypes/_NF/Entities/Mobs/NPCs/syndicatemob.yml index bc8cfdb9102..8a7e4a2e544 100644 --- a/Resources/Prototypes/_NF/Entities/Mobs/NPCs/syndicatemob.yml +++ b/Resources/Prototypes/_NF/Entities/Mobs/NPCs/syndicatemob.yml @@ -22,6 +22,9 @@ minimumWait: 120 # 1 * 2 maximumWait: 240 # 2 * 60 NextAdvertisementTime: 0 + - type: Buckle + disable: true + - type: AutoWakeUp # Humans - type: entity @@ -164,7 +167,7 @@ - SyndicateNavalGrenadierGear - type: AutoImplant implants: - - DeathAcidifierImplant + - DeathAcidifierImplantNF - type: RechargeBasicEntityAmmo rechargeCooldown: 5 rechargeSound: @@ -236,16 +239,12 @@ - type: Loadout prototypes: - SyndicateNavalCommanderGear - - type: MobThresholds - thresholds: - 0: Alive - 140: Dead # No crit state to ensure that mob explodes ASAP - type: Stamina critThreshold: 500 # Extra hard to incapacitate and loot - type: AutoImplant implants: - DeathRattleImplant - - DeathAcidifierImplant + - DeathAcidifierImplantNF - type: RechargeBasicEntityAmmo rechargeCooldown: 0.5 rechargeSound: diff --git a/Resources/Prototypes/_NF/Entities/Objects/Misc/implanters.yml b/Resources/Prototypes/_NF/Entities/Objects/Misc/implanters.yml index 9872e713e1d..cd2cc650e20 100644 --- a/Resources/Prototypes/_NF/Entities/Objects/Misc/implanters.yml +++ b/Resources/Prototypes/_NF/Entities/Objects/Misc/implanters.yml @@ -7,3 +7,12 @@ components: - type: Implanter implant: MedicalTrackingImplant + +- type: entity + id: DeathAcidifierImplanterNF + name: death acidifier implanter + suffix: All + parent: BaseImplantOnlyImplanterSyndi + components: + - type: Implanter + implant: DeathAcidifierImplantSF diff --git a/Resources/Prototypes/_NF/Entities/Objects/Misc/subdermal_implants.yml b/Resources/Prototypes/_NF/Entities/Objects/Misc/subdermal_implants.yml index 7f7b7237e29..57f96e3992e 100644 --- a/Resources/Prototypes/_NF/Entities/Objects/Misc/subdermal_implants.yml +++ b/Resources/Prototypes/_NF/Entities/Objects/Misc/subdermal_implants.yml @@ -25,3 +25,29 @@ - Dead - type: Rattle radioChannel: "Medical" + +- type: entity + parent: BaseSubdermalImplant + id: DeathAcidifierImplantNF + name: death-acidifier implant + description: This implant melts the user and their equipment upon death. + noSpawn: true + components: + - type: SubdermalImplant + permanent: true +# implantAction: ActionActivateDeathAcidifier + - type: TriggerOnMobstateChange + mobState: + - Dead + - Critical +# - type: TriggerImplantAction + - type: GibOnTrigger + deleteItems: true + deleteOrgans: true + - type: SpawnOnTrigger + proto: Acidifier + - type: Tag + tags: + - SubdermalImplant + - HideContextMenu + - DeathAcidifier From ebd4a348debaaeef82c663f85f0e94ccf6b1b784 Mon Sep 17 00:00:00 2001 From: Dvir <39403717+dvir001@users.noreply.github.com> Date: Wed, 27 Mar 2024 00:07:48 +0200 Subject: [PATCH 2/2] Update implanters.yml --- Resources/Prototypes/_NF/Entities/Objects/Misc/implanters.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Resources/Prototypes/_NF/Entities/Objects/Misc/implanters.yml b/Resources/Prototypes/_NF/Entities/Objects/Misc/implanters.yml index cd2cc650e20..d119d2ac358 100644 --- a/Resources/Prototypes/_NF/Entities/Objects/Misc/implanters.yml +++ b/Resources/Prototypes/_NF/Entities/Objects/Misc/implanters.yml @@ -15,4 +15,4 @@ parent: BaseImplantOnlyImplanterSyndi components: - type: Implanter - implant: DeathAcidifierImplantSF + implant: DeathAcidifierImplantNF