From d993f7cff5e6175d33fe31039c9085316cfc41b3 Mon Sep 17 00:00:00 2001 From: BIGZi0348 Date: Fri, 13 Dec 2024 20:47:05 +0300 Subject: [PATCH 1/4] =?UTF-8?q?=D0=A0=D0=B0=D0=B7=D1=80=D0=B5=D1=88=D0=B0?= =?UTF-8?q?=D1=8E=20=D0=BA=D1=83=D1=88=D0=B0=D1=82=D1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Clothing/Components/MaskComponent.cs | 14 ++++++++++++++ .../Clothing/EntitySystems/MaskSystem.cs | 8 +++++--- .../Prototypes/Entities/Clothing/Head/bandanas.yml | 4 ++++ .../Entities/Clothing/Masks/bandanas.yml | 1 + 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/Content.Shared/Clothing/Components/MaskComponent.cs b/Content.Shared/Clothing/Components/MaskComponent.cs index 5430417a8c..8948eaba77 100644 --- a/Content.Shared/Clothing/Components/MaskComponent.cs +++ b/Content.Shared/Clothing/Components/MaskComponent.cs @@ -22,4 +22,18 @@ public sealed partial class MaskComponent : Component [DataField, AutoNetworkedField] public string EquippedPrefix = "toggled"; + + /// + /// WD Ahead of wizden. + /// When will function normally, otherwise will not react to events + /// + [DataField("enabled"), AutoNetworkedField] + public bool IsEnabled = true; + + /// + /// WD Ahead of wizden. + /// When will disable when folded + /// + [DataField, AutoNetworkedField] + public bool DisableOnFolded; } diff --git a/Content.Shared/Clothing/EntitySystems/MaskSystem.cs b/Content.Shared/Clothing/EntitySystems/MaskSystem.cs index 2a4383279a..d3e5458eaf 100644 --- a/Content.Shared/Clothing/EntitySystems/MaskSystem.cs +++ b/Content.Shared/Clothing/EntitySystems/MaskSystem.cs @@ -35,7 +35,7 @@ public sealed class MaskSystem : EntitySystem private void OnToggleMask(Entity ent, ref ToggleMaskEvent args) { var (uid, mask) = ent; - if (mask.ToggleActionEntity == null || !_timing.IsFirstTimePredicted) + if (mask.ToggleActionEntity == null || !_timing.IsFirstTimePredicted || !mask.IsEnabled) // WD Ahead of wizden return; if (!_inventorySystem.TryGetSlotEntity(args.Performer, "mask", out var existing) || !uid.Equals(existing)) @@ -53,7 +53,7 @@ public sealed class MaskSystem : EntitySystem // set to untoggled when unequipped, so it isn't left in a 'pulled down' state private void OnGotUnequipped(EntityUid uid, MaskComponent mask, GotUnequippedEvent args) { - if (!mask.IsToggled) + if (!mask.IsToggled || !mask.IsEnabled) // WD Ahead of wizden return; mask.IsToggled = false; @@ -66,7 +66,7 @@ public sealed class MaskSystem : EntitySystem private void ToggleMaskComponents(EntityUid uid, MaskComponent mask, EntityUid wearer, string? equippedPrefix = null, bool isEquip = false) { Dirty(uid, mask); - if (mask.ToggleActionEntity is {} action) + if (mask.ToggleActionEntity is { } action) _actionSystem.SetToggled(action, mask.IsToggled); var maskEv = new ItemMaskToggledEvent(wearer, equippedPrefix, mask.IsToggled, isEquip); @@ -78,6 +78,8 @@ public sealed class MaskSystem : EntitySystem private void OnFolded(Entity ent, ref FoldedEvent args) { + if (ent.Comp.DisableOnFolded) // WD Ahead of wizden + ent.Comp.IsEnabled = !args.IsFolded; ent.Comp.IsToggled = args.IsFolded; ToggleMaskComponents(ent.Owner, ent.Comp, ent.Owner); diff --git a/Resources/Prototypes/Entities/Clothing/Head/bandanas.yml b/Resources/Prototypes/Entities/Clothing/Head/bandanas.yml index 51a56f1f1d..007cba3f22 100644 --- a/Resources/Prototypes/Entities/Clothing/Head/bandanas.yml +++ b/Resources/Prototypes/Entities/Clothing/Head/bandanas.yml @@ -7,6 +7,8 @@ folded: true - type: Mask isToggled: true + enabled: false + disableOnFolded: true - type: IngestionBlocker enabled: false - type: IdentityBlocker @@ -20,6 +22,8 @@ - state: icon_mask map: [ "unfoldedLayer" ] visible: false + - type: HideLayerClothing # needed since head bandana inherits from mask bandana + slots: [] - type: Tag tags: - Bandana diff --git a/Resources/Prototypes/Entities/Clothing/Masks/bandanas.yml b/Resources/Prototypes/Entities/Clothing/Masks/bandanas.yml index f5ad2fb6c8..a3a0348e73 100644 --- a/Resources/Prototypes/Entities/Clothing/Masks/bandanas.yml +++ b/Resources/Prototypes/Entities/Clothing/Masks/bandanas.yml @@ -12,6 +12,7 @@ unfoldedSlots: - MASK - type: Mask + disableOnFolded: true - type: IngestionBlocker - type: IdentityBlocker coverage: MOUTH From 0daaae7e41690eb34f94e8efffbc81da90e022ce Mon Sep 17 00:00:00 2001 From: RavmorganButOnCocaine Date: Fri, 13 Dec 2024 18:19:08 +0000 Subject: [PATCH 2/4] Automatic changelog update --- Resources/Changelog/ChangelogWhite.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Resources/Changelog/ChangelogWhite.yml b/Resources/Changelog/ChangelogWhite.yml index d4c5d40af2..9f1c2044aa 100644 --- a/Resources/Changelog/ChangelogWhite.yml +++ b/Resources/Changelog/ChangelogWhite.yml @@ -1,11 +1,4 @@ Entries: -- author: RavMorgan - changes: - - message: "\u0414\u043E\u0431\u0430\u0432\u043B\u0435\u043D \u043F\u0430\u0438\ - \ \u043D\u0430 \u043D\u0435\u0439\u0440\u043E\u0441\u0435\u0442\u044F\u0445!" - type: Add - id: 127 - time: '2023-04-08T06:06:22.0000000+00:00' - author: HitPanda changes: - message: "\u0421\u043A\u0430\u0444\u0430\u043D\u0434\u0440\u0443 \u0433\u043B\u0430\ @@ -8911,3 +8904,13 @@ id: 626 time: '2024-12-12T20:31:26.0000000+00:00' url: https://api.github.com/repos/frosty-dev/ss14-core/pulls/817 +- author: BIG_Zi_348 + changes: + - message: "\u0418\u0441\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u043E \u043D\u0435\ + \u043A\u043E\u0440\u0440\u0435\u043A\u0442\u043D\u043E\u0435 \u043F\u043E\u0432\ + \u0435\u0434\u0435\u043D\u0438\u0435 \u0431\u0430\u043D\u0434\u0430\u043D\u044B\ + ." + type: Fix + id: 627 + time: '2024-12-13T18:18:04.0000000+00:00' + url: https://api.github.com/repos/frosty-dev/ss14-core/pulls/818 From 21559e346843ec151b808a8675bd54d9d013333e Mon Sep 17 00:00:00 2001 From: BIGZi0348 Date: Fri, 13 Dec 2024 21:40:41 +0300 Subject: [PATCH 3/4] =?UTF-8?q?=D0=94=D0=B5=D0=BC=D0=BE=D0=BA=D1=80=D0=B0?= =?UTF-8?q?=D1=82=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../_Honk/RoundEndVote/RoundEndVoteSystem.cs | 58 +++++++++++++++++++ Resources/Prototypes/Maps/DryDock.yml | 2 +- Resources/Prototypes/Maps/WhiteMoose.yml | 2 +- Resources/Prototypes/Maps/WonderBox.yml | 2 +- Resources/Prototypes/Maps/meta.yml | 6 +- Resources/Prototypes/game_presets.yml | 4 +- 6 files changed, 66 insertions(+), 8 deletions(-) create mode 100644 Content.Server/_Honk/RoundEndVote/RoundEndVoteSystem.cs diff --git a/Content.Server/_Honk/RoundEndVote/RoundEndVoteSystem.cs b/Content.Server/_Honk/RoundEndVote/RoundEndVoteSystem.cs new file mode 100644 index 0000000000..91262846ba --- /dev/null +++ b/Content.Server/_Honk/RoundEndVote/RoundEndVoteSystem.cs @@ -0,0 +1,58 @@ +using Content.Server.GameTicking; +using Content.Server.RoundEnd; +using Content.Server.Voting.Managers; +using Content.Shared.Voting; +using Robust.Server.Player; +using Robust.Shared.Timing; + +namespace Content.Server._Honk.RoundEndVote; + +public sealed class RoundEndVoteSystem : EntitySystem +{ + [Dependency] private readonly IVoteManager _voteManager = default!; + [Dependency] private readonly GameTicker _gameTicker = default!; + [Dependency] private readonly IPlayerManager _playerManager = default!; + + public override void Initialize() + { + SubscribeLocalEvent(OnRoundEndSystemChange); + } + + private void OnRoundEndSystemChange(RoundEndSystemChangedEvent ev) + { + if (_gameTicker.RunLevel != GameRunLevel.PreRoundLobby) + return; + + if (_playerManager.PlayerCount == 0) + { + _gameTicker.DelayStart(TimeSpan.FromSeconds(60)); + Timer.Spawn(60 * 1000, () => + { + if (_playerManager.PlayerCount >= 15) + { + _voteManager.CreateStandardVote(null, StandardVoteType.Preset); + } + else if (_playerManager.PlayerCount >= 5) + { + _gameTicker.SetGamePreset("Extended"); + } + }); + } + + if (_playerManager.PlayerCount >= 15) + { + _voteManager.CreateStandardVote(null, StandardVoteType.Preset); + } + else if (_playerManager.PlayerCount >= 5) + { + _gameTicker.SetGamePreset("Extended"); + } + else + { + _gameTicker.SetGamePreset("Greenshift"); + } + + _voteManager.CreateStandardVote(null, StandardVoteType.Map); + } + +} diff --git a/Resources/Prototypes/Maps/DryDock.yml b/Resources/Prototypes/Maps/DryDock.yml index f978389d47..01d7160f48 100644 --- a/Resources/Prototypes/Maps/DryDock.yml +++ b/Resources/Prototypes/Maps/DryDock.yml @@ -2,7 +2,7 @@ id: DryDock mapName: 'DryDock Station' mapPath: /Maps/White/DryDock.yml - minPlayers: 10 + minPlayers: 0 stations: DryDockStation: stationProto: StandardNanotrasenStation diff --git a/Resources/Prototypes/Maps/WhiteMoose.yml b/Resources/Prototypes/Maps/WhiteMoose.yml index e375956b9e..525046a5f1 100644 --- a/Resources/Prototypes/Maps/WhiteMoose.yml +++ b/Resources/Prototypes/Maps/WhiteMoose.yml @@ -2,7 +2,7 @@ id: WhiteMoose mapName: 'WhiteMoose Station' mapPath: /Maps/White/WhiteMoose.yml - minPlayers: 10 + minPlayers: 0 stations: WhiteMooseStation: stationProto: StandardNanotrasenStation diff --git a/Resources/Prototypes/Maps/WonderBox.yml b/Resources/Prototypes/Maps/WonderBox.yml index 7d1035821e..911f0a74ff 100644 --- a/Resources/Prototypes/Maps/WonderBox.yml +++ b/Resources/Prototypes/Maps/WonderBox.yml @@ -2,7 +2,7 @@ id: WonderBox mapName: 'WonderBox Station' mapPath: /Maps/White/WonderBox.yml - minPlayers: 20 + minPlayers: 0 stations: WonderBoxStation: stationProto: StandardNanotrasenStation diff --git a/Resources/Prototypes/Maps/meta.yml b/Resources/Prototypes/Maps/meta.yml index 319c243612..859571344c 100644 --- a/Resources/Prototypes/Maps/meta.yml +++ b/Resources/Prototypes/Maps/meta.yml @@ -2,7 +2,7 @@ id: Meta mapName: 'Meta Station' mapPath: /Maps/meta.yml - minPlayers: 50 + minPlayers: 0 stations: Meta: stationProto: StandardNanotrasenStation @@ -43,9 +43,9 @@ Paramedic: [ 1, 1 ] #science ResearchDirector: [ 1, 1 ] - SeniorResearcher: [ 1, 1 ] + SeniorResearcher: [ 1, 1 ] Scientist: [ 4, 6 ] - ResearchAssistant: [ 3, 6 ] + ResearchAssistant: [ 3, 6 ] Borg: [ 2, 2 ] #security HeadOfSecurity: [ 1, 1 ] diff --git a/Resources/Prototypes/game_presets.yml b/Resources/Prototypes/game_presets.yml index 31b9f2f0ab..a28adb6ee0 100644 --- a/Resources/Prototypes/game_presets.yml +++ b/Resources/Prototypes/game_presets.yml @@ -33,7 +33,7 @@ - extended - shittersafari name: extended-title - showInVote: false #2boring2vote + showInVote: true # WD EDIT description: extended-description rules: - BasicStationEventScheduler @@ -46,7 +46,7 @@ - greenshift - shittersafarideluxeedition name: greenshift-title - showInVote: false #4boring4vote + showInVote: true # WD EDIT description: greenshift-description rules: - BasicRoundstartVariation From 95f1f7978108e4963029b5f9184701d1fb77709b Mon Sep 17 00:00:00 2001 From: RavmorganButOnCocaine Date: Fri, 13 Dec 2024 18:44:48 +0000 Subject: [PATCH 4/4] Automatic changelog update --- Resources/Changelog/ChangelogWhite.yml | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/Resources/Changelog/ChangelogWhite.yml b/Resources/Changelog/ChangelogWhite.yml index 9f1c2044aa..9f398c4fc1 100644 --- a/Resources/Changelog/ChangelogWhite.yml +++ b/Resources/Changelog/ChangelogWhite.yml @@ -1,19 +1,4 @@ Entries: -- author: HitPanda - changes: - - message: "\u0421\u043A\u0430\u0444\u0430\u043D\u0434\u0440\u0443 \u0433\u043B\u0430\ - \u0432\u044B \u0441\u043B\u0443\u0436\u0431\u044B \u0431\u0435\u0437\u043E\u043F\ - \u0430\u0441\u043D\u043E\u0441\u0442\u0438 \u0432\u0435\u0440\u043D\u0443\u043B\ - \u0438 \u043F\u0440\u0435\u0436\u043D\u044E\u044E \u0432\u0435\u0440\u0441\u0438\ - \u044E, \u0435\u0433\u043E \u0442\u0435\u043A\u0443\u0449\u0430\u044F \u0432\ - \u0435\u0440\u0441\u0438\u044F \u0437\u0430\u043C\u0435\u043D\u0438\u043B\u0430\ - \ \u0441\u043A\u0430\u0444\u0430\u043D\u0434\u0440 \u0432\u0430\u0440\u0434\u0435\ - \u043D\u0430, \u043A\u0430\u043A \u0438 \u0434\u043E\u043B\u0436\u043D\u043E\ - \ \u0431\u044B\u043B\u043E \u0431\u044B\u0442\u044C \u0438\u0437\u043D\u0430\ - \u0447\u0430\u043B\u044C\u043D\u043E." - type: Fix - id: 128 - time: '2023-04-08T12:18:55.0000000+00:00' - author: HitPanda changes: - message: "\u041F\u0435\u0440\u0435\u0432\u043E\u0434 \u0442\u0438\u043F\u043E\u0432\ @@ -8914,3 +8899,14 @@ id: 627 time: '2024-12-13T18:18:04.0000000+00:00' url: https://api.github.com/repos/frosty-dev/ss14-core/pulls/818 +- author: BIG_Zi_348 + changes: + - message: "\u0414\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u043E \u0430\u0432\u0442\ + \u043E\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u043E\u0435 \u0433\u043E\ + \u043B\u043E\u0441\u043E\u0432\u0430\u043D\u0438\u0435 \u0437\u0430 \u0432\u044B\ + \u0431\u043E\u0440 \u0440\u0435\u0436\u0438\u043C\u0430 \u0438 \u043A\u0430\u0440\ + \u0442\u044B." + type: Add + id: 628 + time: '2024-12-13T18:43:45.0000000+00:00' + url: https://api.github.com/repos/frosty-dev/ss14-core/pulls/819