From 4cd70b241c9e60c9c07c5eaa8fc29fb925fc18ba Mon Sep 17 00:00:00 2001 From: Arendian <137322659+Arendian@users.noreply.github.com> Date: Tue, 1 Aug 2023 21:38:22 +0200 Subject: [PATCH 01/53] Disposable turret explodes when empty (#18175) * turret go boom * fix ammo * universal function name * Also explodes when destroyed * comment added * Triggerwhenemptycomponent added * comment adjusted * Updated uplink description * Moved to own event file * file namespace * rerun tests --------- Co-authored-by: Slava0135 --- .../Weapons/Ranged/Systems/GunSystem.cs | 1 - .../Components/TriggerWhenEmptyComponent.cs | 9 +++++++++ .../Explosion/EntitySystems/TriggerSystem.cs | 8 +++++++- .../Ranged/Events/OnEmptyGunShotEvent.cs | 7 +++++++ .../Systems/SharedGunSystem.Ballistic.cs | 18 ++++++++++-------- .../Weapons/Ranged/Systems/SharedGunSystem.cs | 5 ++++- .../Locale/en-US/store/uplink-catalog.ftl | 2 +- .../Entities/Objects/Weapons/Guns/turrets.yml | 17 +++++++++-------- 8 files changed, 47 insertions(+), 20 deletions(-) create mode 100644 Content.Server/Explosion/Components/TriggerWhenEmptyComponent.cs create mode 100644 Content.Shared/Weapons/Ranged/Events/OnEmptyGunShotEvent.cs diff --git a/Content.Client/Weapons/Ranged/Systems/GunSystem.cs b/Content.Client/Weapons/Ranged/Systems/GunSystem.cs index d06f8b1658560f..2459d1d29ed96a 100644 --- a/Content.Client/Weapons/Ranged/Systems/GunSystem.cs +++ b/Content.Client/Weapons/Ranged/Systems/GunSystem.cs @@ -2,7 +2,6 @@ using Content.Client.Items; using Content.Client.Weapons.Ranged.Components; using Content.Shared.Camera; -using Content.Shared.Input; using Content.Shared.Spawners.Components; using Content.Shared.Weapons.Ranged; using Content.Shared.Weapons.Ranged.Components; diff --git a/Content.Server/Explosion/Components/TriggerWhenEmptyComponent.cs b/Content.Server/Explosion/Components/TriggerWhenEmptyComponent.cs new file mode 100644 index 00000000000000..71edd42646c326 --- /dev/null +++ b/Content.Server/Explosion/Components/TriggerWhenEmptyComponent.cs @@ -0,0 +1,9 @@ +namespace Content.Server.Explosion.Components; + +/// +/// Triggers a gun when attempting to shoot while it's empty +/// +[RegisterComponent] +public sealed class TriggerWhenEmptyComponent : Component +{ +} diff --git a/Content.Server/Explosion/EntitySystems/TriggerSystem.cs b/Content.Server/Explosion/EntitySystems/TriggerSystem.cs index eb2d3b6a0de5c4..ee47c016e57345 100644 --- a/Content.Server/Explosion/EntitySystems/TriggerSystem.cs +++ b/Content.Server/Explosion/EntitySystems/TriggerSystem.cs @@ -22,7 +22,7 @@ using Robust.Shared.Physics.Systems; using Content.Shared.Mobs; using Content.Shared.Mobs.Components; -using Robust.Shared.Player; +using Content.Shared.Weapons.Ranged.Events; namespace Content.Server.Explosion.EntitySystems { @@ -77,6 +77,7 @@ public override void Initialize() SubscribeLocalEvent(OnImplantTrigger); SubscribeLocalEvent(OnStepTriggered); SubscribeLocalEvent(OnSlipTriggered); + SubscribeLocalEvent(OnEmptyTriggered); SubscribeLocalEvent(OnSpawnTrigger); SubscribeLocalEvent(HandleDeleteTrigger); @@ -186,6 +187,11 @@ private void OnSlipTriggered(EntityUid uid, TriggerOnSlipComponent component, re Trigger(uid, args.Slipped); } + private void OnEmptyTriggered(EntityUid uid, TriggerWhenEmptyComponent component, ref OnEmptyGunShotEvent args) + { + Trigger(uid, args.EmptyGun); + } + public bool Trigger(EntityUid trigger, EntityUid? user = null) { var triggerEvent = new TriggerEvent(trigger, user); diff --git a/Content.Shared/Weapons/Ranged/Events/OnEmptyGunShotEvent.cs b/Content.Shared/Weapons/Ranged/Events/OnEmptyGunShotEvent.cs new file mode 100644 index 00000000000000..efae42952b4510 --- /dev/null +++ b/Content.Shared/Weapons/Ranged/Events/OnEmptyGunShotEvent.cs @@ -0,0 +1,7 @@ +namespace Content.Shared.Weapons.Ranged.Events; + +/// +/// Raised directed on the gun when trying to fire it while it's out of ammo +/// +[ByRefEvent] +public record struct OnEmptyGunShotEvent(EntityUid EmptyGun); diff --git a/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.Ballistic.cs b/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.Ballistic.cs index 29913cd73d076a..296c260a288c81 100644 --- a/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.Ballistic.cs +++ b/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.Ballistic.cs @@ -130,15 +130,14 @@ void SimulateInsertAmmo(EntityUid ammo, EntityUid ammoProvider, EntityCoordinate private void OnBallisticVerb(EntityUid uid, BallisticAmmoProviderComponent component, GetVerbsEvent args) { - if (!args.CanAccess || !args.CanInteract || args.Hands == null) + if (!args.CanAccess || !args.CanInteract || args.Hands == null || !component.Cycleable) return; - if (component.Cycleable == true) - args.Verbs.Add(new Verb() - { - Text = Loc.GetString("gun-ballistic-cycle"), - Disabled = GetBallisticShots(component) == 0, - Act = () => ManualCycle(uid, component, Transform(uid).MapPosition, args.User), - }); + args.Verbs.Add(new Verb() + { + Text = Loc.GetString("gun-ballistic-cycle"), + Disabled = GetBallisticShots(component) == 0, + Act = () => ManualCycle(uid, component, Transform(uid).MapPosition, args.User), + }); } private void OnBallisticExamine(EntityUid uid, BallisticAmmoProviderComponent component, ExaminedEvent args) @@ -151,6 +150,9 @@ private void OnBallisticExamine(EntityUid uid, BallisticAmmoProviderComponent co private void ManualCycle(EntityUid uid, BallisticAmmoProviderComponent component, MapCoordinates coordinates, EntityUid? user = null, GunComponent? gunComp = null) { + if (!component.Cycleable) + return; + // Reset shotting for cycling if (Resolve(uid, ref gunComp, false) && gunComp is { FireRate: > 0f } && diff --git a/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs b/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs index 68b64d43dc6f8b..8866fcf55ad5d3 100644 --- a/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs +++ b/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs @@ -7,7 +7,6 @@ using Content.Shared.Examine; using Content.Shared.Gravity; using Content.Shared.Hands.Components; -using Content.Shared.Interaction.Events; using Content.Shared.Popups; using Content.Shared.Projectiles; using Content.Shared.Tag; @@ -304,6 +303,10 @@ private void AttemptShoot(EntityUid user, EntityUid gunUid, GunComponent gun) if (ev.Ammo.Count <= 0) { + // triggers effects on the gun if it's empty + var emptyGunShotEvent = new OnEmptyGunShotEvent(); + RaiseLocalEvent(gunUid, ref emptyGunShotEvent); + // Play empty gun sounds if relevant // If they're firing an existing clip then don't play anything. if (shots > 0) diff --git a/Resources/Locale/en-US/store/uplink-catalog.ftl b/Resources/Locale/en-US/store/uplink-catalog.ftl index 1fc1462b704afc..1812097dda5eae 100644 --- a/Resources/Locale/en-US/store/uplink-catalog.ftl +++ b/Resources/Locale/en-US/store/uplink-catalog.ftl @@ -212,7 +212,7 @@ uplink-proximity-mine-name = Proximity Mine uplink-proximity-mine-desc = A mine disguised as a wet floor sign. uplink-disposable-turret-name = Disposable Ballistic Turret -uplink-disposable-turret-desc = Looks and functions like a normal electrical toolbox. Upon hitting the toolbox it will transform into a ballistic turret, theoretically shooting at anyone except members of the syndicate. +uplink-disposable-turret-desc = Looks and functions like a normal electrical toolbox. Upon hitting the toolbox it will transform into a ballistic turret, theoretically shooting at anyone except members of the syndicate. Can be turned back into a toolbox using a screwdriver and repaired using a wrench. # Armor uplink-chameleon-name = Chameleon Kit diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/turrets.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/turrets.yml index c620fb69562cf1..9bdee06750c6e3 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/turrets.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/turrets.yml @@ -143,14 +143,7 @@ behaviors: - !type:DoActsBehavior acts: [ "Destruction" ] - - !type:PlaySoundBehavior - sound: - path: /Audio/Effects/metalbreak.ogg - - !type:SpawnEntitiesBehavior - spawn: - WeaponTurretSyndicateBroken: - min: 1 - max: 1 + - !type:TriggerBehavior - type: Gun fireRate: 2 selectedMode: FullAuto @@ -168,6 +161,14 @@ - type: Repairable qualityNeeded: "Anchoring" doAfterDelay: 3 + - type: TriggerWhenEmpty + - type: ExplodeOnTrigger + - type: Explosive + explosionType: Default + maxIntensity: 10 + intensitySlope: 1.5 + totalIntensity: 30 + canCreateVacuum: false - type: entity parent: BaseWeaponTurret From 8a5307a83dce88c6a4f8ca55431c1181eb8c30b6 Mon Sep 17 00:00:00 2001 From: PJBot Date: Tue, 1 Aug 2023 15:39:26 -0400 Subject: [PATCH 02/53] Automatic changelog update --- Resources/Changelog/Changelog.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Resources/Changelog/Changelog.yml b/Resources/Changelog/Changelog.yml index 31a7a9d25da3f4..eb9de52f0c0a97 100644 --- a/Resources/Changelog/Changelog.yml +++ b/Resources/Changelog/Changelog.yml @@ -1,9 +1,4 @@ Entries: -- author: PJB3005 - changes: - - {message: You can't see grilles in the power monitoring console anymore, type: Tweak} - id: 3901 - time: '2023-05-30T22:34:45.0000000+00:00' - author: 612git changes: - {message: Fixed Poppy potency scaling, type: Fix} @@ -2979,3 +2974,8 @@ Entries: respectively', type: Remove} id: 4400 time: '2023-08-01T17:27:22.0000000+00:00' +- author: Dygon + changes: + - {message: Disposable turrets now explode once they run out of ammo, type: Tweak} + id: 4401 + time: '2023-08-01T19:38:22.0000000+00:00' From 1b4d4f8c3540480ca7813e4b7d146fbb19e3474a Mon Sep 17 00:00:00 2001 From: MisterMecky Date: Wed, 2 Aug 2023 03:57:22 +0800 Subject: [PATCH 03/53] Add chemical scanning goggles (#18373) * add chemical scanning goggles * add prototype and textures * .ftl stuff * add lathe, recipe, research stuff * missing description * emo review * remove static method + newlines --------- Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> --- .../EntitySystems/SolutionContainerSystem.cs | 67 ++++++++++++++++++ .../Components/SolutionScannerComponent.cs | 7 ++ .../Chemistry/SolutionScannerSystem.cs | 24 +++++++ .../Inventory/InventorySystem.Relay.cs | 2 + .../components/solution-scanner-component.ftl | 5 ++ .../Entities/Clothing/Eyes/glasses.yml | 12 ++++ .../Entities/Clothing/Eyes/specific.yml | 1 + .../Entities/Structures/Machines/lathe.yml | 1 + .../Prototypes/Recipes/Lathes/chemistry.yml | 10 +++ Resources/Prototypes/Research/biochemical.yml | 1 + .../Glasses/science.rsi/equipped-EYES.png | Bin 0 -> 374 bytes .../Eyes/Glasses/science.rsi/icon.png | Bin 0 -> 361 bytes .../Eyes/Glasses/science.rsi/inhand-left.png | Bin 0 -> 317 bytes .../Eyes/Glasses/science.rsi/inhand-right.png | Bin 0 -> 322 bytes .../Eyes/Glasses/science.rsi/meta.json | 26 +++++++ 15 files changed, 156 insertions(+) create mode 100644 Content.Shared/Chemistry/Components/SolutionScannerComponent.cs create mode 100644 Content.Shared/Chemistry/SolutionScannerSystem.cs create mode 100644 Resources/Locale/en-US/chemistry/components/solution-scanner-component.ftl create mode 100644 Resources/Textures/Clothing/Eyes/Glasses/science.rsi/equipped-EYES.png create mode 100644 Resources/Textures/Clothing/Eyes/Glasses/science.rsi/icon.png create mode 100644 Resources/Textures/Clothing/Eyes/Glasses/science.rsi/inhand-left.png create mode 100644 Resources/Textures/Clothing/Eyes/Glasses/science.rsi/inhand-right.png create mode 100644 Resources/Textures/Clothing/Eyes/Glasses/science.rsi/meta.json diff --git a/Content.Server/Chemistry/EntitySystems/SolutionContainerSystem.cs b/Content.Server/Chemistry/EntitySystems/SolutionContainerSystem.cs index fa33309f589b6a..61da862be9b572 100644 --- a/Content.Server/Chemistry/EntitySystems/SolutionContainerSystem.cs +++ b/Content.Server/Chemistry/EntitySystems/SolutionContainerSystem.cs @@ -2,12 +2,14 @@ using System.Linq; using System.Text; using Content.Server.Chemistry.Components.SolutionManager; +using Content.Server.Examine; using Content.Shared.Chemistry; using Content.Shared.Chemistry.Components; using Content.Shared.Chemistry.Reaction; using Content.Shared.Chemistry.Reagent; using Content.Shared.Examine; using Content.Shared.FixedPoint; +using Content.Shared.Verbs; using JetBrains.Annotations; using Robust.Shared.Audio; using Robust.Shared.Prototypes; @@ -41,6 +43,7 @@ public sealed partial class SolutionContainerSystem : EntitySystem [Dependency] private readonly IPrototypeManager _prototypeManager = default!; + [Dependency] private readonly ExamineSystem _examine = default!; public override void Initialize() { @@ -48,6 +51,7 @@ public override void Initialize() SubscribeLocalEvent(InitSolution); SubscribeLocalEvent(OnExamineSolution); + SubscribeLocalEvent>(OnSolutionExaminableVerb); } private void InitSolution(EntityUid uid, SolutionContainerManagerComponent component, ComponentInit args) @@ -60,6 +64,69 @@ private void InitSolution(EntityUid uid, SolutionContainerManagerComponent compo } } + private void OnSolutionExaminableVerb(EntityUid uid, ExaminableSolutionComponent component, GetVerbsEvent args) + { + if (!args.CanInteract || !args.CanAccess) + return; + + var scanEvent = new SolutionScanEvent(); + RaiseLocalEvent(args.User, scanEvent); + if (!scanEvent.CanScan) + { + return; + } + + SolutionContainerManagerComponent? solutionsManager = null; + if (!Resolve(args.Target, ref solutionsManager) + || !solutionsManager.Solutions.TryGetValue(component.Solution, out var solutionHolder)) + { + return; + } + + var verb = new ExamineVerb() + { + Act = () => + { + var markup = GetSolutionExamine(solutionHolder); + _examine.SendExamineTooltip(args.User, uid, markup, false, false); + }, + Text = Loc.GetString("scannable-solution-verb-text"), + Message = Loc.GetString("scannable-solution-verb-message"), + Category = VerbCategory.Examine, + Icon = new SpriteSpecifier.Texture(new("/Textures/Interface/VerbIcons/drink.svg.192dpi.png")), + }; + + args.Verbs.Add(verb); + } + + private FormattedMessage GetSolutionExamine(Solution solution) + { + var msg = new FormattedMessage(); + + if (solution.Contents.Count == 0) //TODO: better way to see if empty? + { + msg.AddMarkup(Loc.GetString("scannable-solution-empty-container")); + return msg; + } + + msg.AddMarkup(Loc.GetString("scannable-solution-main-text")); + + foreach (var reagent in solution) + { + if (!_prototypeManager.TryIndex(reagent.ReagentId, out var proto)) + { + continue; + } + msg.PushNewline(); + msg.AddMarkup(Loc.GetString("scannable-solution-chemical" + , ("type", proto.LocalizedName) + , ("color", proto.SubstanceColor.ToHexNoAlpha()) + , ("amount", reagent.Quantity))); + } + + return msg; + } + private void OnExamineSolution(EntityUid uid, ExaminableSolutionComponent examinableComponent, ExaminedEvent args) { diff --git a/Content.Shared/Chemistry/Components/SolutionScannerComponent.cs b/Content.Shared/Chemistry/Components/SolutionScannerComponent.cs new file mode 100644 index 00000000000000..12f9ebdc6d0ac6 --- /dev/null +++ b/Content.Shared/Chemistry/Components/SolutionScannerComponent.cs @@ -0,0 +1,7 @@ +namespace Content.Shared.Chemistry.Components; + +[RegisterComponent] +public sealed class SolutionScannerComponent : Component +{ +} + diff --git a/Content.Shared/Chemistry/SolutionScannerSystem.cs b/Content.Shared/Chemistry/SolutionScannerSystem.cs new file mode 100644 index 00000000000000..0e6d784777a57c --- /dev/null +++ b/Content.Shared/Chemistry/SolutionScannerSystem.cs @@ -0,0 +1,24 @@ +using Content.Shared.Chemistry.Components; +using Content.Shared.Inventory; + +namespace Content.Shared.Chemistry; + +public sealed class SolutionScannerSystem : EntitySystem +{ + public override void Initialize() + { + SubscribeLocalEvent(OnSolutionScanAttempt); + SubscribeLocalEvent>((e, c, ev) => OnSolutionScanAttempt(e, c, ev.Args)); + } + + private void OnSolutionScanAttempt(EntityUid eid, SolutionScannerComponent component, SolutionScanEvent args) + { + args.CanScan = true; + } +} + +public sealed class SolutionScanEvent : EntityEventArgs, IInventoryRelayEvent +{ + public bool CanScan; + public SlotFlags TargetSlots { get; } = SlotFlags.EYES; +} diff --git a/Content.Shared/Inventory/InventorySystem.Relay.cs b/Content.Shared/Inventory/InventorySystem.Relay.cs index 3a792589713bf6..179d234ce53d48 100644 --- a/Content.Shared/Inventory/InventorySystem.Relay.cs +++ b/Content.Shared/Inventory/InventorySystem.Relay.cs @@ -1,3 +1,4 @@ +using Content.Shared.Chemistry; using Content.Shared.Damage; using Content.Shared.Electrocution; using Content.Shared.Explosion; @@ -31,6 +32,7 @@ public void InitializeRelay() SubscribeLocalEvent(RelayInventoryEvent); SubscribeLocalEvent(RelayInventoryEvent); SubscribeLocalEvent(RelayInventoryEvent); + SubscribeLocalEvent(RelayInventoryEvent); SubscribeLocalEvent>(OnGetStrippingVerbs); } diff --git a/Resources/Locale/en-US/chemistry/components/solution-scanner-component.ftl b/Resources/Locale/en-US/chemistry/components/solution-scanner-component.ftl new file mode 100644 index 00000000000000..8dbbaf3edd7750 --- /dev/null +++ b/Resources/Locale/en-US/chemistry/components/solution-scanner-component.ftl @@ -0,0 +1,5 @@ +scannable-solution-verb-text = Solution +scannable-solution-verb-message = Examine the chemical composition. +scannable-solution-main-text = It contains the following chemicals: +scannable-solution-empty-container = It contains no chemicals. +scannable-solution-chemical = - {$amount}u [color={$color}]{$type}[/color] diff --git a/Resources/Prototypes/Entities/Clothing/Eyes/glasses.yml b/Resources/Prototypes/Entities/Clothing/Eyes/glasses.yml index 93a3ec443d4e79..ba7823c1fb3fd3 100644 --- a/Resources/Prototypes/Entities/Clothing/Eyes/glasses.yml +++ b/Resources/Prototypes/Entities/Clothing/Eyes/glasses.yml @@ -159,3 +159,15 @@ coefficients: Heat: 0.95 - type: GroupExamine + +- type: entity + parent: ClothingEyesBase + id: ClothingEyesGlassesChemical + name: chemical analysis goggles + description: Goggles that can scan the chemical composition of a solution. + components: + - type: Sprite + sprite: Clothing/Eyes/Glasses/science.rsi + - type: Clothing + sprite: Clothing/Eyes/Glasses/science.rsi + - type: SolutionScanner diff --git a/Resources/Prototypes/Entities/Clothing/Eyes/specific.yml b/Resources/Prototypes/Entities/Clothing/Eyes/specific.yml index a213ca21cd8075..c04f3482870123 100644 --- a/Resources/Prototypes/Entities/Clothing/Eyes/specific.yml +++ b/Resources/Prototypes/Entities/Clothing/Eyes/specific.yml @@ -18,3 +18,4 @@ interfaces: - key: enum.ChameleonUiKey.Key type: ChameleonBoundUserInterface + diff --git a/Resources/Prototypes/Entities/Structures/Machines/lathe.yml b/Resources/Prototypes/Entities/Structures/Machines/lathe.yml index 86057f2e01f009..7967cd4815dba1 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/lathe.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/lathe.yml @@ -227,6 +227,7 @@ - ClothingBackpackDuffelHolding - WelderExperimental - JawsOfLife + - ClothingEyesGlassesChemical - type: entity id: CircuitImprinter diff --git a/Resources/Prototypes/Recipes/Lathes/chemistry.yml b/Resources/Prototypes/Recipes/Lathes/chemistry.yml index e2285e9be8a15a..3d654b96f3ac7b 100644 --- a/Resources/Prototypes/Recipes/Lathes/chemistry.yml +++ b/Resources/Prototypes/Recipes/Lathes/chemistry.yml @@ -81,3 +81,13 @@ materials: Plastic: 100 Steel: 250 + +- type: latheRecipe + id: ClothingEyesGlassesChemical + result: ClothingEyesGlassesChemical + completetime: 2 + materials: + Steel: 100 + Plastic: 100 + Glass: 100 + Silver: 100 diff --git a/Resources/Prototypes/Research/biochemical.yml b/Resources/Prototypes/Research/biochemical.yml index b0b1d1ddeaf949..00389d073d65d5 100644 --- a/Resources/Prototypes/Research/biochemical.yml +++ b/Resources/Prototypes/Research/biochemical.yml @@ -14,6 +14,7 @@ - Dropper - HotplateMachineCircuitboard - ChemicalPayload + - ClothingEyesGlassesChemical - type: technology id: SurgicalTools diff --git a/Resources/Textures/Clothing/Eyes/Glasses/science.rsi/equipped-EYES.png b/Resources/Textures/Clothing/Eyes/Glasses/science.rsi/equipped-EYES.png new file mode 100644 index 0000000000000000000000000000000000000000..dd921481b7adbf7706086bdc30f10a6abf31bc1a GIT binary patch literal 374 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=oCO|{#S9F5M?jcysy3fA0|TRm zr;B4q#hkadHs&63kZ5}-t|{y4#|0u;mDJ9y0yJWN`58!%LElO}7fV zgd{H)2q-UlU#-*inKQCZclWRR0?!#biW!cmvTJlL(mh>N^7?1^beRR~vbW`w|NR^q zYq;fV(akzj-uA~Iv)>Ai5BfiqJ1p28<}fRqV}x2@$?!;qp^&cuUD)B3{38XIa@pss&l30jkJOJiBN0$; zw(!*I%xS6OzgId-on-tae&X| literal 0 HcmV?d00001 diff --git a/Resources/Textures/Clothing/Eyes/Glasses/science.rsi/icon.png b/Resources/Textures/Clothing/Eyes/Glasses/science.rsi/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..af3788654b9a862f3a3087890ee3095f42f013e0 GIT binary patch literal 361 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz&H|6fVg?4jBOuH;Rhv(mfq_xl z)5S5QV$Rzs8?z2O@U)4($g`=?RW(e>f4MIFgY^%^Nyk6D)6_3mzhG_S1gEx?Pr^T# z4sy<1zkIQ{RMUBP%_%IN%{g_^|DR9(ApED8qk#c}To})!8!!G|{bHBis?13$0oT92 z@MjRXSfevtKss`o<%LZ;zC11h4QHnYUD&4kX4&rOzYXhxyw-(9G+vYPd%k#geRaL* z>#OMkN?9ybtE$g#e<@}(`&ODGt42upd0s~zCY?*HHn;EGc%q;ZzIstn+nS#iH=aoB z_gVK%fklu-VUeJMgvy>7pL=#%o}amYn&O_1{mWZ8ye_liTgV#3a^SA$w{#j|Z`>OG`f~dtyE+#p1qLAE=l#HXlLtTT6*6qVf{)TMGV#mLz6d1Ktn zdb{*Aqq&=xifp|mx3_%i5^txapYPxO9{boLOM*@J^rug|i_X=_w9otedRN>wb%=vN z1LhE&XX zduwm*VFQVlhsA6G3sWtat;?>kM7bBQNYZqWF6ho@5{-J`z4XY5{zOYY9me;Ug;?Hk zOjBnB>IZ@yV#!|?J!)pFFP&D+BeiEmMbF1|d-AvQ1$*7|-|Mr?@*J0<%r8MF4!h%# zYQgqjy)W%9{0Dz)E!y*eIbnI3;V^z^0`xzWCtOS(Q?PwLtCG=G-cV~cs~m?7=~ zk$djlQ#}@VH>Tsyvz6XGn{VwtVzH{du3<}kXJJTvobQGs3=DIwTkqy?H@a}~mOn^` Mr>mdKI;Vst0O`1gkpKVy literal 0 HcmV?d00001 diff --git a/Resources/Textures/Clothing/Eyes/Glasses/science.rsi/meta.json b/Resources/Textures/Clothing/Eyes/Glasses/science.rsi/meta.json new file mode 100644 index 00000000000000..541bdfbedca9c8 --- /dev/null +++ b/Resources/Textures/Clothing/Eyes/Glasses/science.rsi/meta.json @@ -0,0 +1,26 @@ +{ + "version": 1, + "license": "CC-BY-SA-3.0", + "copyright": "Taken from tgstation at commit https://github.com/tgstation/tgstation/commit/5a73e8f825ff279e82949b9329783a9e3070e2da", + "size": { + "x": 32, + "y": 32 + }, + "states": [ + { + "name": "icon" + }, + { + "name": "equipped-EYES", + "directions": 4 + }, + { + "name": "inhand-left", + "directions": 4 + }, + { + "name": "inhand-right", + "directions": 4 + } + ] +} From 4214a363366fe04411e20e214d4343dcc62ed047 Mon Sep 17 00:00:00 2001 From: PJBot Date: Tue, 1 Aug 2023 15:58:27 -0400 Subject: [PATCH 04/53] Automatic changelog update --- Resources/Changelog/Changelog.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Resources/Changelog/Changelog.yml b/Resources/Changelog/Changelog.yml index eb9de52f0c0a97..2efb6d1bb01645 100644 --- a/Resources/Changelog/Changelog.yml +++ b/Resources/Changelog/Changelog.yml @@ -1,9 +1,4 @@ Entries: -- author: 612git - changes: - - {message: Fixed Poppy potency scaling, type: Fix} - id: 3902 - time: '2023-05-30T23:07:15.0000000+00:00' - author: HerCoyote23 changes: - {message: Fix northstar gloves sending radio messages., type: Fix} @@ -2979,3 +2974,9 @@ Entries: - {message: Disposable turrets now explode once they run out of ammo, type: Tweak} id: 4401 time: '2023-08-01T19:38:22.0000000+00:00' +- author: MisterMecky + changes: + - {message: Adds chemical analysis goggles that can scan the chemical composition + of a solution, type: Add} + id: 4402 + time: '2023-08-01T19:57:23.0000000+00:00' From 963efeb796633a1c6d510dc9143c23fd5021d890 Mon Sep 17 00:00:00 2001 From: Emisse <99158783+Emisse@users.noreply.github.com> Date: Tue, 1 Aug 2023 15:04:44 -0600 Subject: [PATCH 05/53] nerf hristov (#18542) * silly * Update antimateriel.yml --- .../Weapons/Guns/Ammunition/Projectiles/antimateriel.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/antimateriel.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/antimateriel.yml index 6bf22a45ec27f4..a86de79aa0dd2a 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/antimateriel.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/antimateriel.yml @@ -7,8 +7,8 @@ - type: Projectile damage: types: - Piercing: 60 + Piercing: 45 Structural: 30 ignoreResistances: true - type: StaminaDamageOnCollide - damage: 100 \ No newline at end of file + damage: 75 From 524afc6eaf6c738e9abaf8fab1a6672507866d8c Mon Sep 17 00:00:00 2001 From: crazybrain23 <44417085+crazybrain23@users.noreply.github.com> Date: Tue, 1 Aug 2023 22:05:14 +0100 Subject: [PATCH 06/53] IP ban by default (#18545) --- Content.Client/Administration/UI/BanPanel/BanPanel.xaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Content.Client/Administration/UI/BanPanel/BanPanel.xaml b/Content.Client/Administration/UI/BanPanel/BanPanel.xaml index 64eb7d206cf83f..b8f91e050ea1f4 100644 --- a/Content.Client/Administration/UI/BanPanel/BanPanel.xaml +++ b/Content.Client/Administration/UI/BanPanel/BanPanel.xaml @@ -12,7 +12,7 @@ - + From 682d023ff612d748eedbfc5db9018352de42487e Mon Sep 17 00:00:00 2001 From: PJBot Date: Tue, 1 Aug 2023 17:06:18 -0400 Subject: [PATCH 07/53] Automatic changelog update --- Resources/Changelog/Changelog.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Resources/Changelog/Changelog.yml b/Resources/Changelog/Changelog.yml index 2efb6d1bb01645..8e4ea54a15f6fb 100644 --- a/Resources/Changelog/Changelog.yml +++ b/Resources/Changelog/Changelog.yml @@ -1,14 +1,4 @@ Entries: -- author: HerCoyote23 - changes: - - {message: Fix northstar gloves sending radio messages., type: Fix} - id: 3903 - time: '2023-05-31T01:11:36.0000000+00:00' -- author: metalgearsloth - changes: - - {message: Mining shuttle will spawn roundstart., type: Add} - id: 3904 - time: '2023-05-31T01:13:03.0000000+00:00' - author: metalgearsloth changes: - {message: 'All ore veins are guaranteed on expeditions, tripled the vein count, @@ -2980,3 +2970,13 @@ Entries: of a solution, type: Add} id: 4402 time: '2023-08-01T19:57:23.0000000+00:00' +- author: Emisse + changes: + - {message: Hristov no longer insta stuns and does slightly less damage., type: Tweak} + id: 4403 + time: '2023-08-01T21:04:44.0000000+00:00' +- author: crazybrain + changes: + - {message: Admin banning panel has IP bans enabled by default., type: Fix} + id: 4404 + time: '2023-08-01T21:05:14.0000000+00:00' From 54197faf9307337533a589c63e36b38fb22afba8 Mon Sep 17 00:00:00 2001 From: keronshb <54602815+keronshb@users.noreply.github.com> Date: Tue, 1 Aug 2023 17:10:36 -0400 Subject: [PATCH 08/53] Restores Captain's gloves and carapace (#18480) --- Resources/Prototypes/Roles/Jobs/Command/captain.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Resources/Prototypes/Roles/Jobs/Command/captain.yml b/Resources/Prototypes/Roles/Jobs/Command/captain.yml index a8cfc426fa5353..a139d534839ce0 100644 --- a/Resources/Prototypes/Roles/Jobs/Command/captain.yml +++ b/Resources/Prototypes/Roles/Jobs/Command/captain.yml @@ -34,6 +34,8 @@ shoes: ClothingShoesColorBlack head: ClothingHeadHatCaptain eyes: ClothingEyesGlassesSunglasses + gloves: ClothingHandsGlovesCaptain + outerClothing: ClothingOuterArmorCaptainCarapace id: CaptainPDA ears: ClothingHeadsetAltCommand innerclothingskirt: ClothingUniformJumpskirtCaptain From b7382646b6b95e0aadce98499b40a96167776ee3 Mon Sep 17 00:00:00 2001 From: PJBot Date: Tue, 1 Aug 2023 17:11:40 -0400 Subject: [PATCH 09/53] Automatic changelog update --- Resources/Changelog/Changelog.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Resources/Changelog/Changelog.yml b/Resources/Changelog/Changelog.yml index 8e4ea54a15f6fb..6a804773625eb8 100644 --- a/Resources/Changelog/Changelog.yml +++ b/Resources/Changelog/Changelog.yml @@ -1,10 +1,4 @@ Entries: -- author: metalgearsloth - changes: - - {message: 'All ore veins are guaranteed on expeditions, tripled the vein count, - but made it so veins only drop 1 ore each.', type: Tweak} - id: 3905 - time: '2023-05-31T03:40:37.0000000+00:00' - author: Flareguy changes: - {message: 'Shivs have been rebalanced. The regular glass shiv now does 5.5 damage, @@ -2980,3 +2974,8 @@ Entries: - {message: Admin banning panel has IP bans enabled by default., type: Fix} id: 4404 time: '2023-08-01T21:05:14.0000000+00:00' +- author: keronshb + changes: + - {message: Captains will now start with their gloves and carapace again, type: Tweak} + id: 4405 + time: '2023-08-01T21:10:36.0000000+00:00' From 27231420bc3b9ab3cf14b0a04dc273a84354698a Mon Sep 17 00:00:00 2001 From: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> Date: Tue, 1 Aug 2023 17:11:50 -0400 Subject: [PATCH 10/53] Allow gamemodes to specify custom map pools (#18429) * Allow game presets to require certain maps * make preset maps ignore the game map pool * make it use a map pool prototype * Typo --------- Co-authored-by: Kevin Zheng --- .../GameTicking/GameTicker.GamePreset.cs | 39 +++++++++++++++++- .../GameTicking/GameTicker.Lobby.cs | 7 ++-- .../GameTicking/GameTicker.RoundFlow.cs | 18 +++++++-- Content.Server/GameTicking/GameTicker.cs | 4 +- .../Presets/GamePresetPrototype.cs | 9 +++++ Content.Server/Maps/GameMapManager.cs | 40 ++++++++++++------- Content.Server/Voting/Managers/VoteManager.cs | 13 +++--- .../Locale/en-US/game-ticking/game-ticker.ftl | 1 + 8 files changed, 102 insertions(+), 29 deletions(-) diff --git a/Content.Server/GameTicking/GameTicker.GamePreset.cs b/Content.Server/GameTicking/GameTicker.GamePreset.cs index 97e91f04c1aa53..9ccddd110d5209 100644 --- a/Content.Server/GameTicking/GameTicker.GamePreset.cs +++ b/Content.Server/GameTicking/GameTicker.GamePreset.cs @@ -3,6 +3,7 @@ using System.Threading.Tasks; using Content.Server.GameTicking.Presets; using Content.Server.Ghost.Components; +using Content.Server.Maps; using Content.Shared.CCVar; using Content.Shared.Damage; using Content.Shared.Damage.Prototypes; @@ -17,8 +18,16 @@ public sealed partial class GameTicker { public const float PresetFailedCooldownIncrease = 30f; + /// + /// The selected preset that will be used at the start of the next round. + /// public GamePresetPrototype? Preset { get; private set; } + /// + /// The preset that's currently active. + /// + public GamePresetPrototype? CurrentPreset { get; private set; } + private bool StartPreset(IPlayerSession[] origReadyPlayers, bool force) { var startAttempt = new RoundStartAttemptEvent(origReadyPlayers, force); @@ -27,7 +36,7 @@ private bool StartPreset(IPlayerSession[] origReadyPlayers, bool force) if (!startAttempt.Cancelled) return true; - var presetTitle = Preset != null ? Loc.GetString(Preset.ModeTitle) : string.Empty; + var presetTitle = CurrentPreset != null ? Loc.GetString(CurrentPreset.ModeTitle) : string.Empty; void FailedPresetRestart() { @@ -93,6 +102,7 @@ public void SetGamePreset(GamePresetPrototype preset, bool force = false) Preset = preset; UpdateInfoText(); + ValidateMap(); if (force) { @@ -131,12 +141,39 @@ public bool TryFindGamePreset(string preset, [NotNullWhen(true)] out GamePresetP return prototype != null; } + public bool IsMapEligible(GameMapPrototype map) + { + if (Preset == null) + return true; + + if (Preset.MapPool == null || !_prototypeManager.TryIndex(Preset.MapPool, out var pool)) + return true; + + return pool.Maps.Contains(map.ID); + } + + private void ValidateMap() + { + if (Preset == null || _gameMapManager.GetSelectedMap() is not { } map) + return; + + if (Preset.MapPool == null || + !_prototypeManager.TryIndex(Preset.MapPool, out var pool)) + return; + + if (pool.Maps.Contains(map.ID)) + return; + + _gameMapManager.SelectMapRandom(); + } + [PublicAPI] private bool AddGamePresetRules() { if (DummyTicker || Preset == null) return false; + CurrentPreset = Preset; foreach (var rule in Preset.Rules) { AddGameRule(rule); diff --git a/Content.Server/GameTicking/GameTicker.Lobby.cs b/Content.Server/GameTicking/GameTicker.Lobby.cs index 1050c7c56856ef..b7b6a29a5a7b31 100644 --- a/Content.Server/GameTicking/GameTicker.Lobby.cs +++ b/Content.Server/GameTicking/GameTicker.Lobby.cs @@ -44,7 +44,8 @@ public void UpdateInfoText() private string GetInfoText() { - if (Preset == null) + var preset = CurrentPreset ?? Preset; + if (preset == null) { return string.Empty; } @@ -72,8 +73,8 @@ private string GetInfoText() stationNames.Append(Loc.GetString("game-ticker-no-map-selected")); } - var gmTitle = Loc.GetString(Preset.ModeTitle); - var desc = Loc.GetString(Preset.Description); + var gmTitle = Loc.GetString(preset.ModeTitle); + var desc = Loc.GetString(preset.Description); return Loc.GetString(RunLevel == GameRunLevel.PreRoundLobby ? "game-ticker-get-info-preround-text" : "game-ticker-get-info-text", ("roundId", RoundId), ("playerCount", playerCount), ("readyCount", readyCount), ("mapName", stationNames.ToString()),("gmTitle", gmTitle),("desc", desc)); } diff --git a/Content.Server/GameTicking/GameTicker.RoundFlow.cs b/Content.Server/GameTicking/GameTicker.RoundFlow.cs index 4883d8e3c0c87c..6808ca4d4a130f 100644 --- a/Content.Server/GameTicking/GameTicker.RoundFlow.cs +++ b/Content.Server/GameTicking/GameTicker.RoundFlow.cs @@ -114,6 +114,17 @@ private void LoadMaps() throw new Exception("invalid config; couldn't select a valid station map!"); } + if (CurrentPreset?.MapPool != null && + _prototypeManager.TryIndex(CurrentPreset.MapPool, out var pool) && + pool.Maps.Contains(mainStationMap.ID)) + { + var msg = Loc.GetString("game-ticker-start-round-invalid-map", + ("map", mainStationMap.MapName), + ("mode", Loc.GetString(CurrentPreset.ModeTitle))); + Log.Debug(msg); + SendServerMessage(msg); + } + // Let game rules dictate what maps we should load. RaiseLocalEvent(new LoadingMapsEvent(maps)); @@ -292,7 +303,7 @@ public void ShowRoundEndScoreboard(string text = "") _adminLogger.Add(LogType.EmergencyShuttle, LogImpact.High, $"Round ended, showing summary"); //Tell every client the round has ended. - var gamemodeTitle = Preset != null ? Loc.GetString(Preset.ModeTitle) : string.Empty; + var gamemodeTitle = CurrentPreset != null ? Loc.GetString(CurrentPreset.ModeTitle) : string.Empty; // Let things add text here. var textEv = new RoundEndTextAppendEvent(); @@ -306,7 +317,7 @@ public void ShowRoundEndScoreboard(string text = "") //Generate a list of basic player info to display in the end round summary. var listOfPlayerInfo = new List(); // Grab the great big book of all the Minds, we'll need them for this. - var allMinds = Get().AllMinds; + var allMinds = _mindTracker.AllMinds; foreach (var mind in allMinds) { // TODO don't list redundant observer roles? @@ -447,6 +458,7 @@ private void ResettingCleanup() // Clear up any game rules. ClearGameRules(); + CurrentPreset = null; _allPreviousGameRules.Clear(); @@ -514,7 +526,7 @@ public TimeSpan RoundDuration() private void AnnounceRound() { - if (Preset == null) return; + if (CurrentPreset == null) return; var options = _prototypeManager.EnumeratePrototypes().ToList(); diff --git a/Content.Server/GameTicking/GameTicker.cs b/Content.Server/GameTicking/GameTicker.cs index 9554e0098911ce..c50243fdf32cdb 100644 --- a/Content.Server/GameTicking/GameTicker.cs +++ b/Content.Server/GameTicking/GameTicker.cs @@ -39,6 +39,7 @@ public sealed partial class GameTicker : SharedGameTicker [Dependency] private readonly SharedTransformSystem _transform = default!; [Dependency] private readonly GhostSystem _ghost = default!; [Dependency] private readonly MindSystem _mind = default!; + [Dependency] private readonly MindTrackerSystem _mindTracker = default!; [Dependency] private readonly MobStateSystem _mobState = default!; [ViewVariables] private bool _initialized; @@ -92,7 +93,8 @@ public override void Shutdown() private void SendServerMessage(string message) { - _chatManager.ChatMessageToAll(ChatChannel.Server, message, "", default, false, true); + var wrappedMessage = Loc.GetString("chat-manager-server-wrap-message", ("message", message)); + _chatManager.ChatMessageToAll(ChatChannel.Server, message, wrappedMessage, default, false, true); } public override void Update(float frameTime) diff --git a/Content.Server/GameTicking/Presets/GamePresetPrototype.cs b/Content.Server/GameTicking/Presets/GamePresetPrototype.cs index ff6a3d17ba4f89..e3edb894c02e5a 100644 --- a/Content.Server/GameTicking/Presets/GamePresetPrototype.cs +++ b/Content.Server/GameTicking/Presets/GamePresetPrototype.cs @@ -1,5 +1,7 @@ +using Content.Server.Maps; using Robust.Shared.Prototypes; +using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List; namespace Content.Server.GameTicking.Presets @@ -33,5 +35,12 @@ public sealed class GamePresetPrototype : IPrototype [DataField("rules", customTypeSerializer: typeof(PrototypeIdListSerializer))] public IReadOnlyList Rules { get; } = Array.Empty(); + + /// + /// If specified, the gamemode will only be run with these maps. + /// If none are elligible, the global fallback will be used. + /// + [DataField("supportedMaps", customTypeSerializer: typeof(PrototypeIdSerializer))] + public readonly string? MapPool; } } diff --git a/Content.Server/Maps/GameMapManager.cs b/Content.Server/Maps/GameMapManager.cs index a29c009cefc796..2fb531e5d0b57e 100644 --- a/Content.Server/Maps/GameMapManager.cs +++ b/Content.Server/Maps/GameMapManager.cs @@ -1,6 +1,7 @@ using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Linq; +using Content.Server.GameTicking; using Content.Shared.CCVar; using Robust.Server.Player; using Robust.Shared.Configuration; @@ -11,24 +12,29 @@ namespace Content.Server.Maps; public sealed class GameMapManager : IGameMapManager { + [Dependency] private readonly IEntityManager _entityManager = default!; [Dependency] private readonly IPrototypeManager _prototypeManager = default!; [Dependency] private readonly IConfigurationManager _configurationManager = default!; [Dependency] private readonly IPlayerManager _playerManager = default!; [Dependency] private readonly IRobustRandom _random = default!; - + [ViewVariables(VVAccess.ReadOnly)] private readonly Queue _previousMaps = new(); [ViewVariables(VVAccess.ReadOnly)] - private GameMapPrototype? _configSelectedMap = default; + private GameMapPrototype? _configSelectedMap; [ViewVariables(VVAccess.ReadOnly)] - private GameMapPrototype? _selectedMap = default; // Don't change this value during a round! + private GameMapPrototype? _selectedMap; // Don't change this value during a round! [ViewVariables(VVAccess.ReadOnly)] private bool _mapRotationEnabled; [ViewVariables(VVAccess.ReadOnly)] private int _mapQueueDepth = 1; + private ISawmill _log = default!; + public void Initialize() { + _log = Logger.GetSawmill("mapsel"); + _configurationManager.OnValueChanged(CCVars.GameMap, value => { if (TryLookupMap(value, out GameMapPrototype? map)) @@ -43,7 +49,7 @@ public void Initialize() } else { - Logger.ErrorS("mapsel", $"Unknown map prototype {value} was selected!"); + _log.Error($"Unknown map prototype {value} was selected!"); } } }, true); @@ -76,21 +82,25 @@ public IEnumerable CurrentlyEligibleMaps() public IEnumerable AllVotableMaps() { + var poolPrototype = _entityManager.System().Preset?.MapPool ?? + _configurationManager.GetCVar(CCVars.GameMapPool); + if (_prototypeManager.TryIndex(_configurationManager.GetCVar(CCVars.GameMapPool), out var pool)) { foreach (var map in pool.Maps) { if (!_prototypeManager.TryIndex(map, out var mapProto)) { - Logger.Error("Couldn't index map " + map + " in pool " + pool.ID); + _log.Error($"Couldn't index map {map} in pool {poolPrototype}"); continue; } yield return mapProto; } - } else + } + else { - throw new Exception("Could not index map pool prototype " + _configurationManager.GetCVar(CCVars.GameMapPool) + "!"); + throw new Exception($"Could not index map pool prototype {poolPrototype}!"); } } @@ -144,12 +154,12 @@ public void SelectMapByConfigRules() { if (_mapRotationEnabled) { - Logger.InfoS("mapsel", "selecting the next map from the rotation queue"); + _log.Info("selecting the next map from the rotation queue"); SelectMapFromRotationQueue(true); } else { - Logger.InfoS("mapsel", "selecting a random map"); + _log.Info("selecting a random map"); SelectMapRandom(); } } @@ -163,7 +173,8 @@ private bool IsMapEligible(GameMapPrototype map) { return map.MaxPlayers >= _playerManager.PlayerCount && map.MinPlayers <= _playerManager.PlayerCount && - map.Conditions.All(x => x.Check(map)); + map.Conditions.All(x => x.Check(map)) && + _entityManager.System().IsMapEligible(map); } private bool TryLookupMap(string gameMap, [NotNullWhen(true)] out GameMapPrototype? map) @@ -185,23 +196,22 @@ private int GetMapRotationQueuePriority(string gameMapProtoName) private GameMapPrototype GetFirstInRotationQueue() { - Logger.InfoS("mapsel", $"map queue: {string.Join(", ", _previousMaps)}"); + _log.Info($"map queue: {string.Join(", ", _previousMaps)}"); var eligible = CurrentlyEligibleMaps() .Select(x => (proto: x, weight: GetMapRotationQueuePriority(x.ID))) .OrderByDescending(x => x.weight) .ToArray(); - Logger.InfoS("mapsel", $"eligible queue: {string.Join(", ", eligible.Select(x => (x.proto.ID, x.weight)))}"); + _log.Info($"eligible queue: {string.Join(", ", eligible.Select(x => (x.proto.ID, x.weight)))}"); // YML "should" be configured with at least one fallback map Debug.Assert(eligible.Length != 0, $"couldn't select a map with {nameof(GetFirstInRotationQueue)}()! No eligible maps and no fallback maps!"); var weight = eligible[0].weight; return eligible.Where(x => x.Item2 == weight) - .OrderBy(x => x.proto.ID) - .First() - .proto; + .MinBy(x => x.proto.ID) + .proto; } private void EnqueueMap(string mapProtoName) diff --git a/Content.Server/Voting/Managers/VoteManager.cs b/Content.Server/Voting/Managers/VoteManager.cs index 94933a0f1623b4..98ad8d8341f452 100644 --- a/Content.Server/Voting/Managers/VoteManager.cs +++ b/Content.Server/Voting/Managers/VoteManager.cs @@ -5,7 +5,6 @@ using Content.Server.Administration; using Content.Server.Administration.Logs; using Content.Server.Administration.Managers; -using Content.Server.Afk; using Content.Server.Chat.Managers; using Content.Server.GameTicking; using Content.Server.Maps; @@ -58,13 +57,15 @@ public void Initialize() _playerManager.PlayerStatusChanged += PlayerManagerOnPlayerStatusChanged; _adminMgr.OnPermsChanged += AdminPermsChanged; - _cfg.OnValueChanged(CCVars.VoteEnabled, value => { + _cfg.OnValueChanged(CCVars.VoteEnabled, _ => + { DirtyCanCallVoteAll(); }); foreach (var kvp in _voteTypesToEnableCVars) { - _cfg.OnValueChanged(kvp.Value, value => { + _cfg.OnValueChanged(kvp.Value, _ => + { DirtyCanCallVoteAll(); }); } @@ -294,7 +295,7 @@ private void SendUpdateCanCallVote(IPlayerSession player) var votesUnavailable = new List<(StandardVoteType, TimeSpan)>(); foreach (var v in _standardVoteTypeValues) { - if (CanCallVote(player, v, out var _isAdmin, out var typeTimeSpan)) + if (CanCallVote(player, v, out _, out var typeTimeSpan)) continue; votesUnavailable.Add((v, typeTimeSpan)); } @@ -324,7 +325,7 @@ private bool CanCallVote( if (!_cfg.GetCVar(CCVars.VoteEnabled)) return false; // Specific standard vote types can be disabled with cvars. - if ((voteType != null) && _voteTypesToEnableCVars.TryGetValue(voteType.Value, out var cvar) && !_cfg.GetCVar(cvar)) + if (voteType != null && _voteTypesToEnableCVars.TryGetValue(voteType.Value, out var cvar) && !_cfg.GetCVar(cvar)) return false; // Cannot start vote if vote is already active (as non-admin). @@ -345,7 +346,7 @@ private bool CanCallVote( if (voteType == StandardVoteType.Preset) { var presets = GetGamePresets(); - if (presets.Count() == 1 && presets.Select(x => x.Key).Single() == EntitySystem.Get().Preset?.ID) + if (presets.Count == 1 && presets.Select(x => x.Key).Single() == _entityManager.System().Preset?.ID) return false; } diff --git a/Resources/Locale/en-US/game-ticking/game-ticker.ftl b/Resources/Locale/en-US/game-ticking/game-ticker.ftl index 5dbeb5088daea5..004b6aaae07bba 100644 --- a/Resources/Locale/en-US/game-ticking/game-ticker.ftl +++ b/Resources/Locale/en-US/game-ticking/game-ticker.ftl @@ -2,6 +2,7 @@ game-ticker-restart-round = Restarting round... game-ticker-start-round = The round is starting now... game-ticker-start-round-cannot-start-game-mode-fallback = Failed to start {$failedGameMode} mode! Defaulting to {$fallbackMode}... game-ticker-start-round-cannot-start-game-mode-restart = Failed to start {$failedGameMode} mode! Restarting round... +game-ticker-start-round-invalid-map = Selected map {$map} is inelligible for gamemode {$mode}. Gamemode may not function as intended... game-ticker-unknown-role = Unknown game-ticker-delay-start = Round start has been delayed for {$seconds} seconds. game-ticker-pause-start = Round start has been paused. From 9d4c1a254a52cb8b9acad3ced6293c235da0e9c0 Mon Sep 17 00:00:00 2001 From: PJBot Date: Tue, 1 Aug 2023 17:12:56 -0400 Subject: [PATCH 11/53] Automatic changelog update --- Resources/Changelog/Changelog.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Resources/Changelog/Changelog.yml b/Resources/Changelog/Changelog.yml index 6a804773625eb8..a5eea511230026 100644 --- a/Resources/Changelog/Changelog.yml +++ b/Resources/Changelog/Changelog.yml @@ -1,12 +1,4 @@ Entries: -- author: Flareguy - changes: - - {message: 'Shivs have been rebalanced. The regular glass shiv now does 5.5 damage, - but the damage gain from the better tiers of glass is much lower.', type: Tweak} - - {message: Glass shards now weigh a more appropriate size, type: Tweak} - - {message: Plasma glass shards are no longer orange, type: Fix} - id: 3906 - time: '2023-05-31T03:42:14.0000000+00:00' - author: lzk228 changes: - {message: Added brown bandana to cargodrobe, type: Add} @@ -2979,3 +2971,9 @@ Entries: - {message: Captains will now start with their gloves and carapace again, type: Tweak} id: 4405 time: '2023-08-01T21:10:36.0000000+00:00' +- author: EmoGarbage404 + changes: + - {message: 'Fixed messages related to the round not being sent (round starting, + round restarting, etc.)', type: Fix} + id: 4406 + time: '2023-08-01T21:11:50.0000000+00:00' From e083b33aae967a2b86705fe0b92c1d56d5807bf4 Mon Sep 17 00:00:00 2001 From: PrPleGoo Date: Tue, 1 Aug 2023 23:17:03 +0200 Subject: [PATCH 12/53] security HUD now shows a job icon on entities with a body (#18054) --- .../Access/UI/AgentIDCardWindow.xaml | 2 +- Content.Client/Overlays/EquipmentHudSystem.cs | 117 ++++++++++++++++++ .../Overlays/ShowSecurityIconsSystem.cs | 73 +++++++++++ .../StatusIcon/StatusIconOverlay.cs | 22 ++-- Content.Client/StatusIcon/StatusIconSystem.cs | 2 +- .../Events/RefreshEquipmentHudEvent.cs | 13 ++ .../Inventory/InventorySystem.Relay.cs | 7 +- .../Overlays/ShowSecurityIconsComponent.cs | 10 ++ .../StatusIcon/StatusIconPrototype.cs | 16 ++- .../Prototypes/Entities/Clothing/Eyes/hud.yml | 4 + Resources/Prototypes/StatusEffects/job.yml | 3 +- 11 files changed, 256 insertions(+), 13 deletions(-) create mode 100644 Content.Client/Overlays/EquipmentHudSystem.cs create mode 100644 Content.Client/Overlays/ShowSecurityIconsSystem.cs create mode 100644 Content.Shared/Inventory/Events/RefreshEquipmentHudEvent.cs create mode 100644 Content.Shared/Overlays/ShowSecurityIconsComponent.cs diff --git a/Content.Client/Access/UI/AgentIDCardWindow.xaml b/Content.Client/Access/UI/AgentIDCardWindow.xaml index 4947cd7f10286f..89de793714d615 100644 --- a/Content.Client/Access/UI/AgentIDCardWindow.xaml +++ b/Content.Client/Access/UI/AgentIDCardWindow.xaml @@ -6,7 +6,7 @@