diff --git a/Content.Server/IoC/ServerContentIoC.cs b/Content.Server/IoC/ServerContentIoC.cs index 59e49ac5c7..a494c25ad4 100644 --- a/Content.Server/IoC/ServerContentIoC.cs +++ b/Content.Server/IoC/ServerContentIoC.cs @@ -68,7 +68,12 @@ namespace Content.Server.IoC IoCManager.Register(); IoCManager.Register(); IoCManager.Register(); + +#if FULL_RELEASE IoCManager.Register(); +#else + IoCManager.Register(); +#endif // WD-EDIT IoCManager.Register(); diff --git a/Content.Server/Medical/DefibrillatorSystem.cs b/Content.Server/Medical/DefibrillatorSystem.cs index 64861fdc51..7bdf8fc645 100644 --- a/Content.Server/Medical/DefibrillatorSystem.cs +++ b/Content.Server/Medical/DefibrillatorSystem.cs @@ -7,8 +7,12 @@ using Content.Server.Ghost; using Content.Server.Popups; using Content.Server.PowerCell; using Content.Server.Traits.Assorted; +using Content.Shared._White.Item.DelayedKnockdown; using Content.Shared.Damage; +using Content.Shared.Damage.Components; +using Content.Shared.Damage.Events; using Content.Shared.DoAfter; +using Content.Shared.Emag.Systems; using Content.Shared.Interaction; using Content.Shared.Interaction.Components; using Content.Shared.Interaction.Events; @@ -20,6 +24,8 @@ using Content.Shared.Mobs.Systems; using Content.Shared.PowerCell; using Content.Shared.Timing; using Content.Shared.Toggleable; +using Content.Shared.Weapons.Melee; +using Robust.Shared.Audio; using Robust.Shared.Audio.Systems; using Robust.Shared.Player; using Robust.Shared.Timing; @@ -54,8 +60,25 @@ public sealed class DefibrillatorSystem : EntitySystem SubscribeLocalEvent(OnPowerCellSlotEmpty); SubscribeLocalEvent(OnAfterInteract); SubscribeLocalEvent(OnDoAfter); + + SubscribeLocalEvent(OnStaminaHitAttempt); // WD } + // WD START + private void OnStaminaHitAttempt(Entity ent, ref StaminaDamageOnHitAttemptEvent args) + { + var (uid, comp) = ent; + if (comp.Enabled && _powerCell.TryUseActivatableCharge(uid)) + { + if (!_powerCell.HasActivatableCharge(uid)) + TryDisable(uid, comp); + return; + } + + args.Cancelled = true; + } + // WD END + private void OnUseInHand(EntityUid uid, DefibrillatorComponent component, UseInHandEvent args) { if (args.Handled || !TryComp(uid, out UseDelayComponent? useDelay) || _useDelay.IsDelayed((uid, useDelay))) @@ -159,8 +182,8 @@ public sealed class DefibrillatorSystem : EntitySystem if (!_powerCell.HasActivatableCharge(uid, user: user)) return false; - if (_mobState.IsAlive(target, mobState)) - return false; + // if (_mobState.IsAlive(target, mobState)) + // return false; return true; } @@ -177,6 +200,7 @@ public sealed class DefibrillatorSystem : EntitySystem return _doAfter.TryStartDoAfter(new DoAfterArgs(EntityManager, user, component.DoAfterDuration, new DefibrillatorZapDoAfterEvent(), uid, target, uid) { + BreakOnMove = user == target, // WD EDIT BlockDuplicate = true, BreakOnHandChange = true, NeedHand = true @@ -206,7 +230,13 @@ public sealed class DefibrillatorSystem : EntitySystem ICommonSession? session = null; var dead = true; - if (_rotting.IsRotten(target)) + // WD EDIT START + var alive = false; + if (_mobState.IsAlive(target)) + { + alive = true; + } + else if (_rotting.IsRotten(target)) // WD EDIT END { _chatManager.TrySendInGameICMessage(uid, Loc.GetString("defibrillator-rotten"), InGameICChatType.Speak, true); @@ -246,7 +276,7 @@ public sealed class DefibrillatorSystem : EntitySystem } } - var sound = dead || session == null + var sound = !alive && (dead || session == null) // WD EDIT ? component.FailureSound : component.SuccessSound; _audio.PlayPvs(sound, uid); diff --git a/Content.Server/Players/PlayTimeTracking/PlayTimeTrackingManager.cs b/Content.Server/Players/PlayTimeTracking/PlayTimeTrackingManager.cs index 4d2b01f763..574ad33d34 100644 --- a/Content.Server/Players/PlayTimeTracking/PlayTimeTrackingManager.cs +++ b/Content.Server/Players/PlayTimeTracking/PlayTimeTrackingManager.cs @@ -54,7 +54,7 @@ public delegate void CalcPlayTimeTrackersCallback(ICommonSession player, HashSet /// Operations like refreshing and sending play time info to clients are deferred until the next frame (note: not tick). /// /// -public sealed class PlayTimeTrackingManager : ISharedPlaytimeManager +public sealed class PlayTimeTrackingManager : IPlayTimeTrackingManager, ISharedPlaytimeManager { [Dependency] private readonly IServerDbManager _db = default!; [Dependency] private readonly IServerNetManager _net = default!; diff --git a/Content.Shared/Medical/DefibrillatorComponent.cs b/Content.Shared/Medical/DefibrillatorComponent.cs index 2da5285285..ac7e9193ed 100644 --- a/Content.Shared/Medical/DefibrillatorComponent.cs +++ b/Content.Shared/Medical/DefibrillatorComponent.cs @@ -1,5 +1,6 @@ using Content.Shared.Damage; using Content.Shared.DoAfter; +using Content.Shared.Whitelist; using Robust.Shared.Audio; using Robust.Shared.GameStates; using Robust.Shared.Serialization; @@ -86,6 +87,10 @@ public sealed partial class DefibrillatorComponent : Component [ViewVariables(VVAccess.ReadWrite), DataField("readySound")] public SoundSpecifier? ReadySound = new SoundPathSpecifier("/Audio/Items/Defib/defib_ready.ogg"); + + // WD EDIT + [DataField] + public EntityWhitelist? EmaggedAttackWhitelist; } [Serializable, NetSerializable] diff --git a/Content.Shared/Weapons/Melee/MeleeWeaponComponent.cs b/Content.Shared/Weapons/Melee/MeleeWeaponComponent.cs index 217d9879c6..e5a8f5f58c 100644 --- a/Content.Shared/Weapons/Melee/MeleeWeaponComponent.cs +++ b/Content.Shared/Weapons/Melee/MeleeWeaponComponent.cs @@ -27,6 +27,7 @@ public sealed partial class MeleeWeaponComponent : Component /// [ViewVariables(VVAccess.ReadWrite)] [DataField] + [AutoNetworkedField] // WD EDIT public bool Hidden; /// @@ -75,10 +76,10 @@ public sealed partial class MeleeWeaponComponent : Component [ViewVariables(VVAccess.ReadWrite), DataField, AutoNetworkedField] public bool CanMiss; - [DataField] + [DataField, AutoNetworkedField] public EntityWhitelist? AttackWhitelist; - [DataField] + [DataField, AutoNetworkedField] public EntityWhitelist? AttackBlacklist; [DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoNetworkedField] diff --git a/Content.Shared/_White/Item/DefibEmagSystem.cs b/Content.Shared/_White/Item/DefibEmagSystem.cs new file mode 100644 index 0000000000..716bfbe872 --- /dev/null +++ b/Content.Shared/_White/Item/DefibEmagSystem.cs @@ -0,0 +1,50 @@ +using Content.Shared._White.Item.DelayedKnockdown; +using Content.Shared.Damage; +using Content.Shared.Damage.Components; +using Content.Shared.Emag.Systems; +using Content.Shared.Medical; +using Content.Shared.Weapons.Melee; +using Robust.Shared.Audio; + +namespace Content.Shared._White.Item; + +public sealed class DefibEmagSystem : EntitySystem +{ + public override void Initialize() + { + base.Initialize(); + + SubscribeLocalEvent(OnEmag); + } + + private void OnEmag(Entity ent, ref GotEmaggedEvent args) + { + var (uid, comp) = ent; + comp.ZapDamage = 55; + comp.ZapDelay = TimeSpan.FromSeconds(1); + comp.WritheDuration = TimeSpan.FromSeconds(6); + var meleeWeapon = new MeleeWeaponComponent + { + Hidden = true, + AttackRate = 0.2f, + CanHeavyAttack = false, + AttackWhitelist = comp.EmaggedAttackWhitelist, + EquipCooldown = 1f, + Damage = new DamageSpecifier() + }; + var delayedKnockdown = new DelayedKnockdownOnHitComponent + { + Delay = TimeSpan.Zero, + KnockdownTime = TimeSpan.FromSeconds(1.5) + }; + var staminaDamage = new StaminaDamageOnHitComponent + { + Damage = 60f, + Sound = new SoundCollectionSpecifier("sparks") + }; + AddComp(uid, meleeWeapon, true); + AddComp(uid, delayedKnockdown, true); + AddComp(uid, staminaDamage, true); + args.Handled = true; + } +} diff --git a/Content.Shared/_White/Item/DelayedKnockdown/DelayedKnockdownOnHitSystem.cs b/Content.Shared/_White/Item/DelayedKnockdown/DelayedKnockdownOnHitSystem.cs index bee3baa40e..aeab3a49f4 100644 --- a/Content.Shared/_White/Item/DelayedKnockdown/DelayedKnockdownOnHitSystem.cs +++ b/Content.Shared/_White/Item/DelayedKnockdown/DelayedKnockdownOnHitSystem.cs @@ -26,6 +26,8 @@ public sealed class DelayedKnockdownOnHitSystem : EntitySystem { var jitterTime = ent.Comp.JitterTime; var stutterTime = ent.Comp.StutterTime; + var delay = ent.Comp.Delay; + var knockdownTime = ent.Comp.KnockdownTime; foreach (var (uid, _) in args.HitList) { if (!TryComp(uid, out StatusEffectsComponent? statusEffects)) @@ -38,12 +40,17 @@ public sealed class DelayedKnockdownOnHitSystem : EntitySystem _jitter.DoJitter(uid, jitterTime, true, status: statusEffects); if (stutterTime > TimeSpan.Zero) _stutter.DoStutter(uid, stutterTime, true, statusEffects); + if (delay <= TimeSpan.Zero) + { + _stun.TryKnockdown(uid, knockdownTime, true, statusEffects); + continue; + } if (HasComp(uid)) continue; var delayedKnockdown = EnsureComp(uid); - delayedKnockdown.KnockdownTime = TimeSpan.FromSeconds(Math.Max(ent.Comp.KnockdownTime.TotalSeconds, + delayedKnockdown.KnockdownTime = TimeSpan.FromSeconds(Math.Max(knockdownTime.TotalSeconds, delayedKnockdown.KnockdownTime.TotalSeconds)); - var knockdownMoment = _timing.CurTime + ent.Comp.Delay; + var knockdownMoment = _timing.CurTime + delay; if (knockdownMoment < delayedKnockdown.KnockdownMoment) delayedKnockdown.KnockdownMoment = knockdownMoment; } diff --git a/Resources/Changelog/ChangelogWhite.yml b/Resources/Changelog/ChangelogWhite.yml index 6ad84b17ec..02e84d5eb5 100644 --- a/Resources/Changelog/ChangelogWhite.yml +++ b/Resources/Changelog/ChangelogWhite.yml @@ -7811,3 +7811,29 @@ id: 465 time: '2024-08-04T13:54:10.0000000+00:00' url: https://api.github.com/repos/frosty-dev/ss14-core/pulls/562 +- author: Aviu + changes: + - message: "\u0414\u0435\u0444\u0438\u0431\u0430\u043C\u0438 \u043C\u043E\u0436\u043D\ + \u043E \u0442\u0435\u043F\u0435\u0440\u044C \u0431\u0438\u0442\u044C \u0436\u0438\ + \u0432\u044B\u0445." + type: Add + - message: "\u0414\u0435\u0444\u0438\u0431\u044B \u0442\u0435\u043F\u0435\u0440\u044C\ + \ \u043C\u043E\u0436\u043D\u043E \u0435\u043C\u0430\u0433\u043D\u0443\u0442\u044C\ + , \u044D\u0442\u043E \u0434\u0430\u0441\u0442 \u0438\u043C \u0432\u043E\u0437\ + \u043C\u043E\u0436\u043D\u043E\u0441\u0442\u044C \u0431\u0438\u0442\u044C \u0432\ + \ \u0431\u043E\u0435\u0432\u043E\u043C \u0440\u0435\u0436\u0438\u043C\u0435\ + \ \u0440\u0430\u0437 \u0432 5 \u0441\u0435\u043A\u0443\u043D\u0434, \u043D\u0430\ + \u043D\u043E\u0441\u044F 60 \u0441\u0442\u0430\u043C\u0438\u043D\u044B \u0438\ + \ \u0440\u043E\u043D\u044F\u044F \u043D\u0430 \u043F\u043E\u043B \u043D\u0430\ + \ 1.5 \u0441\u0435\u043A\u0443\u043D\u0434\u044B. \u0422\u0430\u043A\u0436\u0435\ + \ \u0443\u0440\u043E\u043D \u043F\u0440\u0438 \u0443\u0434\u0430\u0440\u0435\ + \ \u0435\u043C\u0430\u0433\u043D\u0443\u0442\u044B\u043C \u0434\u0435\u0444\u0438\ + \u0431\u043E\u043C \u0443\u0432\u0435\u043B\u0438\u0447\u0438\u0432\u0430\u0435\ + \u0442\u0441\u044F \u0434\u043E 55, \u0432\u0440\u0435\u043C\u044F \u0441\u0442\ + \u0430\u043D\u0430 \u0443\u0432\u0435\u043B\u0438\u0447\u0438\u0432\u0430\u0435\ + \u0442\u0441\u044F \u0434\u043E 6, \u0430 \u043A\u0434 \u0443\u043C\u0435\u043D\ + \u044C\u0448\u0430\u0435\u0442\u0441\u044F \u0434\u043E 1." + type: Add + id: 466 + time: '2024-08-05T13:39:31.0000000+00:00' + url: https://api.github.com/repos/frosty-dev/ss14-core/pulls/567 diff --git a/Resources/Prototypes/Entities/Objects/Specific/Medical/defib.yml b/Resources/Prototypes/Entities/Objects/Specific/Medical/defib.yml index 4a61074a8d..5fb99e3cc9 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Medical/defib.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Medical/defib.yml @@ -35,6 +35,9 @@ zapHeal: types: Asphyxiation: -40 + emaggedAttackWhitelist: + components: + - Stamina - type: DoAfter - type: UseDelay - type: StaticPrice diff --git a/Resources/Prototypes/Loadouts/Jobs/Cargo/common.yml b/Resources/Prototypes/Loadouts/Jobs/Cargo/common.yml index b9a0aa97fe..932b5ee9a2 100644 --- a/Resources/Prototypes/Loadouts/Jobs/Cargo/common.yml +++ b/Resources/Prototypes/Loadouts/Jobs/Cargo/common.yml @@ -6,7 +6,7 @@ requirement: !type:RoleTimeRequirement role: JobSalvageSpecialist - time: 9999999999 # 15 hours 54000 + time: 54000 # 15 hours # Head diff --git a/Resources/Prototypes/Loadouts/Jobs/Civilian/clown.yml b/Resources/Prototypes/Loadouts/Jobs/Civilian/clown.yml index e94fed5b3c..1f89080c39 100644 --- a/Resources/Prototypes/Loadouts/Jobs/Civilian/clown.yml +++ b/Resources/Prototypes/Loadouts/Jobs/Civilian/clown.yml @@ -6,7 +6,7 @@ requirement: !type:RoleTimeRequirement role: JobClown - time: 9999999999 # 30 hours as clown required to ascend 108000 + time: 108000 # 30 hours as clown required to ascend - type: loadoutEffectGroup # WD id: MedalClownTimer @@ -15,7 +15,7 @@ requirement: !type:RoleTimeRequirement role: JobClown - time: 9999999999 # 10 hours 36000 + time: 36000 # 10 hours # Head - type: itemLoadout diff --git a/Resources/Prototypes/Loadouts/Jobs/Civilian/janitor.yml b/Resources/Prototypes/Loadouts/Jobs/Civilian/janitor.yml index f995a72b70..368d858a16 100644 --- a/Resources/Prototypes/Loadouts/Jobs/Civilian/janitor.yml +++ b/Resources/Prototypes/Loadouts/Jobs/Civilian/janitor.yml @@ -6,7 +6,7 @@ requirement: !type:RoleTimeRequirement role: JobJanitor - time: 9999999999 # 10 hours 36000 + time: 36000 # 10 hours # Head - type: itemLoadout diff --git a/Resources/Prototypes/Loadouts/Jobs/Civilian/passenger.yml b/Resources/Prototypes/Loadouts/Jobs/Civilian/passenger.yml index 8df0b89256..857dd7bf17 100644 --- a/Resources/Prototypes/Loadouts/Jobs/Civilian/passenger.yml +++ b/Resources/Prototypes/Loadouts/Jobs/Civilian/passenger.yml @@ -6,7 +6,7 @@ requirement: !type:RoleTimeRequirement role: JobPassenger - time: 9999999999 #10 hrs, silly reward for people who play passenger a lot 36000 + time: 36000 #10 hrs, silly reward for people who play passenger a lot # Face - type: itemLoadout diff --git a/Resources/Prototypes/Loadouts/Jobs/Command/head_of_personnel.yml b/Resources/Prototypes/Loadouts/Jobs/Command/head_of_personnel.yml index a940661750..506c8ce58e 100644 --- a/Resources/Prototypes/Loadouts/Jobs/Command/head_of_personnel.yml +++ b/Resources/Prototypes/Loadouts/Jobs/Command/head_of_personnel.yml @@ -6,7 +6,7 @@ requirement: !type:RoleTimeRequirement role: JobHeadOfPersonnel - time: 9999999999 #15 hrs, special reward for HoP mains 54000 + time: 54000 #15 hrs, special reward for HoP mains # Jumpsuit - type: itemLoadout diff --git a/Resources/Prototypes/Loadouts/Jobs/Engineering/station_engineer.yml b/Resources/Prototypes/Loadouts/Jobs/Engineering/station_engineer.yml index 08edb8e587..32fc991bea 100644 --- a/Resources/Prototypes/Loadouts/Jobs/Engineering/station_engineer.yml +++ b/Resources/Prototypes/Loadouts/Jobs/Engineering/station_engineer.yml @@ -6,17 +6,17 @@ requirement: !type:RoleTimeRequirement role: JobAtmosphericTechnician - time: 9999999999 #6 hrs 21600 + time: 21600 #6 hrs - !type:JobRequirementLoadoutEffect requirement: !type:RoleTimeRequirement role: JobStationEngineer - time: 9999999999 #6 hrs 21600 + time: 21600 #6 hrs - !type:JobRequirementLoadoutEffect requirement: !type:DepartmentTimeRequirement department: Engineering - time: 9999999999 # 60 hrs 216000 + time: 216000 # 60 hrs # Head - type: itemLoadout diff --git a/Resources/Prototypes/Loadouts/Jobs/Medical/medical_doctor.yml b/Resources/Prototypes/Loadouts/Jobs/Medical/medical_doctor.yml index c83c422cfb..6756d37cd9 100644 --- a/Resources/Prototypes/Loadouts/Jobs/Medical/medical_doctor.yml +++ b/Resources/Prototypes/Loadouts/Jobs/Medical/medical_doctor.yml @@ -6,17 +6,17 @@ requirement: !type:RoleTimeRequirement role: JobChemist - time: 9999999999 #6 hrs 21600 + time: 21600 #6 hrs - !type:JobRequirementLoadoutEffect requirement: !type:RoleTimeRequirement role: JobMedicalDoctor - time: 9999999999 #6 hrs 21600 + time: 21600 #6 hrs - !type:JobRequirementLoadoutEffect requirement: !type:DepartmentTimeRequirement department: Medical - time: 9999999999 # 60 hrs 216000 + time: 216000 # 60 hrs # Head - type: itemLoadout diff --git a/Resources/Prototypes/Loadouts/Jobs/Science/scientist.yml b/Resources/Prototypes/Loadouts/Jobs/Science/scientist.yml index d8a95edd29..4e56a46d46 100644 --- a/Resources/Prototypes/Loadouts/Jobs/Science/scientist.yml +++ b/Resources/Prototypes/Loadouts/Jobs/Science/scientist.yml @@ -6,7 +6,7 @@ requirement: !type:DepartmentTimeRequirement department: Science - time: 9999999999 #60 hrs 216000 + time: 216000 #60 hrs # Head diff --git a/Resources/Prototypes/Loadouts/Jobs/Security/security_officer.yml b/Resources/Prototypes/Loadouts/Jobs/Security/security_officer.yml index e534eee5ef..57a1f7c1ab 100644 --- a/Resources/Prototypes/Loadouts/Jobs/Security/security_officer.yml +++ b/Resources/Prototypes/Loadouts/Jobs/Security/security_officer.yml @@ -6,12 +6,12 @@ requirement: !type:RoleTimeRequirement role: JobWarden - time: 9999999999 #6 hrs 21600 + time: 21600 #6 hrs - !type:JobRequirementLoadoutEffect requirement: !type:DepartmentTimeRequirement department: Security - time: 9999999999 # 60 hrs 216000 + time: 216000 # 60 hrs # Head - type: itemLoadout diff --git a/Resources/Prototypes/Loadouts/Jobs/common.yml b/Resources/Prototypes/Loadouts/Jobs/common.yml index 0bbaaa78bb..b51c76a769 100644 --- a/Resources/Prototypes/Loadouts/Jobs/common.yml +++ b/Resources/Prototypes/Loadouts/Jobs/common.yml @@ -7,7 +7,7 @@ requirement: !type:RoleTimeRequirement role: JobPassenger - time: 9999999999 # 50 hours 180000 + time: 180000 # 50 hours # Eyes diff --git a/Resources/Prototypes/Loadouts/Miscellaneous/glasses.yml b/Resources/Prototypes/Loadouts/Miscellaneous/glasses.yml index 9632006cec..7366152074 100644 --- a/Resources/Prototypes/Loadouts/Miscellaneous/glasses.yml +++ b/Resources/Prototypes/Loadouts/Miscellaneous/glasses.yml @@ -6,7 +6,7 @@ requirement: !type:RoleTimeRequirement role: JobLibrarian - time: 9999999999 # 1 hour of being the biggest nerd on the station 3600 + time: 3600 # 1 hour of being the biggest nerd on the station - type: loadoutEffectGroup id: JensenTimer @@ -15,7 +15,7 @@ requirement: !type:DepartmentTimeRequirement department: Cargo - time: 9999999999 #5 hours of being a space trucker 18000 + time: 18000 #5 hours of being a space trucker # Basic options # Glasses diff --git a/Resources/migration.yml b/Resources/migration.yml index 1281d949fc..84be52a2e6 100644 --- a/Resources/migration.yml +++ b/Resources/migration.yml @@ -269,3 +269,6 @@ ComfyChairCargo: BrownComfyChair ComfyChairService: GreenComfyChair BoxTrashbag: TrashBag + +# 2024-08-05 WD +OmntnsHammer: JudgeHammer