From 8fd2d6b075b0dae79f1951c6a213d828a04f9797 Mon Sep 17 00:00:00 2001 From: SimpleStation14 <130339894+SimpleStation14@users.noreply.github.com> Date: Mon, 6 May 2024 11:45:07 -0700 Subject: [PATCH 01/10] Mirror: Improvised shell crafting recipe (#165) ## Mirror of PR #25545: [Improvised shell crafting recipe](https://github.com/space-wizards/space-station-14/pull/25545) from space-wizards [space-wizards](https://github.com/space-wizards)/[space-station-14](https://github.com/space-wizards/space-station-14) ###### `6260e4b35b829485149206636861bb7402488724` PR opened by FungiFellow at 2024-02-25 06:30:06 UTC PR merged by web-flow at 2024-03-12 23:52:32 UTC --- PR changed 4 files with 98 additions and 7 deletions. The PR had the following labels: - No C# ---

Original Body

> > > > ## About the PR > > I added a Recipe for crafting Improvised Shotgun Shells, Recipe is as follows: 1 Steel, 1 Plastic, 4 Glass Shards, and 6 Matches > ## Why / Balance > > It was added because prior there was no way to obtain ammo for your Improvised Shotgun. There was already a Shell implemented I just added the recipe to craft it. > ## Technical details > > > ## Media > > > - [X] I have added screenshots/videos to this PR showcasing its changes ingame, **or** this PR does not require an ingame showcase > ![image](https://github.com/space-wizards/space-station-14/assets/151778459/cbf68907-e710-44ee-836a-1d97e8d30372) > ## Breaking changes > > > **Changelog** > > > > :cl: > - add: Added Improvised Shotgun Shell Recipe
Co-authored-by: FungiFellow <151778459+FungiFellow@users.noreply.github.com> --- .../Guns/Ammunition/Cartridges/shotgun.yml | 11 +-- .../Guns/Ammunition/Projectiles/shotgun.yml | 5 +- .../improvised/improvised_shotgun_shell.yml | 76 +++++++++++++++++++ .../Recipes/Crafting/improvised.yml | 13 ++++ 4 files changed, 98 insertions(+), 7 deletions(-) create mode 100644 Resources/Prototypes/Recipes/Crafting/Graphs/improvised/improvised_shotgun_shell.yml diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Cartridges/shotgun.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Cartridges/shotgun.yml index b7b98ba699..e26c4e9540 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Cartridges/shotgun.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Cartridges/shotgun.yml @@ -130,22 +130,23 @@ maxTransferAmount: 7 - type: SpentAmmoVisuals state: "practice" - -#Not yet craftable due to balance concerns. Should take a good bit of setup to create like the /tg/station recipe. -#Either the improvised shotgun or its recipe (as of July 2023) will also probably have to be nerfed if you decide to make this craftable. + - type: entity id: ShellShotgunImprovised name: improvised shotgun shell - description: A homemade shotgun shell that shoots painful metal shrapnel. The spread is so wide that it couldn't hit the broad side of a barn. + description: A homemade shotgun shell that shoots painful glass shrapnel. The spread is so wide that it couldn't hit the broad side of a barn. parent: BaseShellShotgun components: - type: Sprite layers: - state: improvised map: [ "enum.AmmoVisualLayers.Base" ] + - type: Construction + graph: ImprovisedShotgunShellGraph + node: shell - type: CartridgeAmmo count: 10 - spread: 45 #deadly if you can get up close... otherwise, good luck doing any kind of real damage + spread: 45 proto: PelletShotgunImprovised - type: SpentAmmoVisuals state: "improvised" diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/shotgun.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/shotgun.yml index e62fb9115e..757b8934d4 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/shotgun.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/shotgun.yml @@ -81,12 +81,13 @@ components: - type: Sprite sprite: Objects/Weapons/Guns/Projectiles/projectiles2.rsi - state: buckshot + state: shard - type: Projectile damage: types: Piercing: 3 - Slash: 3 #remember, it's metal shrapnel! + Slash: 3 + - type: entity id: PelletShotgunTranquilizer diff --git a/Resources/Prototypes/Recipes/Crafting/Graphs/improvised/improvised_shotgun_shell.yml b/Resources/Prototypes/Recipes/Crafting/Graphs/improvised/improvised_shotgun_shell.yml new file mode 100644 index 0000000000..9f666dd61c --- /dev/null +++ b/Resources/Prototypes/Recipes/Crafting/Graphs/improvised/improvised_shotgun_shell.yml @@ -0,0 +1,76 @@ +- type: constructionGraph + id: ImprovisedShotgunShellGraph + start: start + graph: + - node: start + edges: + - to: shell + steps: + - material: Steel + amount: 1 + doAfter: 0.5 + - material: Plastic + amount: 1 + doAfter: 0.5 + - tag: GlassShard + name: glass shard + icon: + sprite: Objects/Materials/Shards/shard.rsi + state: shard1 + doAfter: 0.5 + - tag: GlassShard + name: glass shard + icon: + sprite: Objects/Materials/Shards/shard.rsi + state: shard2 + doAfter: 0.5 + - tag: GlassShard + name: glass shard + icon: + sprite: Objects/Materials/Shards/shard.rsi + state: shard1 + doAfter: 0.5 + - tag: GlassShard + name: glass shard + icon: + sprite: Objects/Materials/Shards/shard.rsi + state: shard3 + doAfter: 0.5 + - tag: Matchstick + name: match stick + icon: + sprite: Objects/Tools/matches.rsi + state: match_unlit + doAfter: 0.5 + - tag: Matchstick + name: match stick + icon: + sprite: Objects/Tools/matches.rsi + state: match_unlit + doAfter: 0.5 + - tag: Matchstick + name: match stick + icon: + sprite: Objects/Tools/matches.rsi + state: match_unlit + doAfter: 0.5 + - tag: Matchstick + name: match stick + icon: + sprite: Objects/Tools/matches.rsi + state: match_unlit + doAfter: 0.5 + - tag: Matchstick + name: match stick + icon: + sprite: Objects/Tools/matches.rsi + state: match_unlit + doAfter: 0.5 + - tag: Matchstick + name: match stick + icon: + sprite: Objects/Tools/matches.rsi + state: match_unlit + doAfter: 0.5 + - node: shell + entity: ShellShotgunImprovised diff --git a/Resources/Prototypes/Recipes/Crafting/improvised.yml b/Resources/Prototypes/Recipes/Crafting/improvised.yml index 12fbe97e28..23b9eb2c92 100644 --- a/Resources/Prototypes/Recipes/Crafting/improvised.yml +++ b/Resources/Prototypes/Recipes/Crafting/improvised.yml @@ -163,6 +163,19 @@ sprite: Objects/Weapons/Guns/Shotguns/improvised_shotgun.rsi state: icon +- type: construction + name: improvised shotgun shell + id: ShellShotgunImprovised + graph: ImprovisedShotgunShellGraph + startNode: start + targetNode: shell + category: construction-category-weapons + objectType: Item + description: A homemade shotgun shell that shoots painful glass shrapnel. The spread is so wide that it couldn't hit the broad side of a Barn + icon: + sprite: Objects/Weapons/Guns/Ammunition/Casings/shotgun_shell.rsi + state: improvised + - type: construction name: rifle stock id: riflestock From 2f7c6080b1c75130522bd3b0d303d8454ce04f6f Mon Sep 17 00:00:00 2001 From: SimpleStation14 <130339894+SimpleStation14@users.noreply.github.com> Date: Mon, 6 May 2024 11:46:12 -0700 Subject: [PATCH 02/10] Mirror: allow biomass reclaimer to reclaim plants (#150) ## Mirror of PR #23731: [allow biomass reclaimer to reclaim plants](https://github.com/space-wizards/space-station-14/pull/23731) from space-wizards [space-wizards](https://github.com/space-wizards)/[space-station-14](https://github.com/space-wizards/space-station-14) ###### `ec4e0990e16f70e6e4a2c1461680240f78cccaf3` PR opened by Ilya246 at 2024-01-08 09:45:55 UTC PR merged by web-flow at 2024-03-11 21:59:21 UTC --- PR changed 2 files with 45 additions and 11 deletions. The PR had the following labels: - Status: Needs Review ---

Original Body

> > > > ## About the PR > title: allows biomass reclaimer to reclaim plants at 0.5 biomass per plant > also makes insertion doafter time scale with mass of inserted entity > also fixes click insertion (as opposed to drag insertion) not working > > ## Why / Balance > provides a fallback way to obtain biomass if cargo is not doing their job > since cloning is not real, makes it actually feasible to obtain biomass for the biofabricator > if cloning were real, seems like it would still be balanced with the amounts it gives > > ## Technical details > also cleans up BiomassReclaimerComponent's `DataField` tags > > ## Media > > tested, works > trust > > - [ ] I have added screenshots/videos to this PR showcasing its changes ingame, **or** this PR does not require an ingame showcase > > **Changelog** > > > :cl: > - tweak: The biomass reclaimer may now reclaim plants, and inserting smaller entities into it is now faster.
Co-authored-by: Ilya246 <57039557+Ilya246@users.noreply.github.com> --- .../BiomassReclaimerComponent.cs | 19 ++++++++-- .../BiomassReclaimerSystem.cs | 37 +++++++++++++++---- 2 files changed, 45 insertions(+), 11 deletions(-) diff --git a/Content.Server/Medical/BiomassReclaimer/BiomassReclaimerComponent.cs b/Content.Server/Medical/BiomassReclaimer/BiomassReclaimerComponent.cs index 25378bb3ed..61d36f98b9 100644 --- a/Content.Server/Medical/BiomassReclaimer/BiomassReclaimerComponent.cs +++ b/Content.Server/Medical/BiomassReclaimer/BiomassReclaimerComponent.cs @@ -15,7 +15,7 @@ public sealed partial class BiomassReclaimerComponent : Component /// /// The interval for . /// - [ViewVariables(VVAccess.ReadWrite), DataField("randomMessInterval")] + [ViewVariables(VVAccess.ReadWrite), DataField] public TimeSpan RandomMessInterval = TimeSpan.FromSeconds(5); /// @@ -28,9 +28,10 @@ public sealed partial class BiomassReclaimerComponent : Component /// /// Amount of biomass that the mob being processed will yield. /// This is calculated from the YieldPerUnitMass. + /// Also stores non-integer leftovers. /// [ViewVariables] - public int CurrentExpectedYield = default; + public float CurrentExpectedYield = 0f; /// /// The reagent that will be spilled while processing a mob. @@ -49,6 +50,18 @@ public sealed partial class BiomassReclaimerComponent : Component [DataField, ViewVariables(VVAccess.ReadWrite)] public float YieldPerUnitMass = 0.4f; + /// + /// How many seconds to take to insert an entity per unit of its mass. + /// + [DataField, ViewVariables(VVAccess.ReadWrite)] + public float BaseInsertionDelay = 0.1f; + + /// + /// How much to multiply biomass yield from botany produce. + /// + [DataField, ViewVariables(VVAccess.ReadWrite)] + public float ProduceYieldMultiplier = 0.25f; + /// /// The time it takes to process a mob, per mass. /// @@ -58,7 +71,7 @@ public sealed partial class BiomassReclaimerComponent : Component /// /// Will this refuse to gib a living mob? /// - [ViewVariables(VVAccess.ReadWrite), DataField("safetyEnabled")] + [ViewVariables(VVAccess.ReadWrite), DataField] public bool SafetyEnabled = true; } } diff --git a/Content.Server/Medical/BiomassReclaimer/BiomassReclaimerSystem.cs b/Content.Server/Medical/BiomassReclaimer/BiomassReclaimerSystem.cs index b126c74a10..d07858aec5 100644 --- a/Content.Server/Medical/BiomassReclaimer/BiomassReclaimerSystem.cs +++ b/Content.Server/Medical/BiomassReclaimer/BiomassReclaimerSystem.cs @@ -1,5 +1,6 @@ using System.Numerics; using Content.Server.Body.Components; +using Content.Server.Botany.Components; using Content.Server.Fluids.EntitySystems; using Content.Server.Materials; using Content.Server.Power.Components; @@ -17,6 +18,7 @@ using Content.Shared.Jittering; using Content.Shared.Medical; using Content.Shared.Mind; +using Content.Shared.Materials; using Content.Shared.Mobs.Components; using Content.Shared.Mobs.Systems; using Content.Shared.Nutrition.Components; @@ -26,6 +28,7 @@ using Robust.Shared.Audio.Systems; using Robust.Shared.Configuration; using Robust.Shared.Physics.Components; +using Robust.Shared.Prototypes; using Robust.Shared.Random; namespace Content.Server.Medical.BiomassReclaimer @@ -47,6 +50,9 @@ public sealed class BiomassReclaimerSystem : EntitySystem [Dependency] private readonly MaterialStorageSystem _material = default!; [Dependency] private readonly SharedMindSystem _minds = default!; + [ValidatePrototypeId] + public const string BiomassPrototype = "Biomass"; + public override void Update(float frameTime) { base.Update(frameTime); @@ -79,7 +85,9 @@ public override void Update(float frameTime) continue; } - _material.SpawnMultipleFromMaterial(reclaimer.CurrentExpectedYield, "Biomass", Transform(uid).Coordinates); + var actualYield = (int) (reclaimer.CurrentExpectedYield); // can only have integer biomass + reclaimer.CurrentExpectedYield = reclaimer.CurrentExpectedYield - actualYield; // store non-integer leftovers + _material.SpawnMultipleFromMaterial(actualYield, BiomassPrototype, Transform(uid).Coordinates); reclaimer.BloodReagent = null; reclaimer.SpawnedEntities.Clear(); @@ -148,10 +156,14 @@ private void OnAfterInteractUsing(Entity reclaimer, r if (!args.CanReach || args.Target == null) return; - if (!HasComp(args.Used) || !CanGib(reclaimer, args.Used)) + if (!CanGib(reclaimer, args.Used)) + return; + + if (!TryComp(args.Used, out var physics)) return; - _doAfterSystem.TryStartDoAfter(new DoAfterArgs(EntityManager, args.User, 7f, new ReclaimerDoAfterEvent(), reclaimer, target: args.Target, used: args.Used) + var delay = reclaimer.Comp.BaseInsertionDelay * physics.FixturesMass; + _doAfterSystem.TryStartDoAfter(new DoAfterArgs(EntityManager, args.User, delay, new ReclaimerDoAfterEvent(), reclaimer, target: args.Target, used: args.Used) { BreakOnTargetMove = true, BreakOnUserMove = true, @@ -174,11 +186,14 @@ private void OnClimbedOn(Entity reclaimer, ref Climbe private void OnDoAfter(Entity reclaimer, ref ReclaimerDoAfterEvent args) { - if (args.Handled || args.Cancelled || args.Args.Target == null || HasComp(args.Args.Target.Value)) + if (args.Handled || args.Cancelled) + return; + + if (args.Args.Used == null || args.Args.Target == null || !HasComp(args.Args.Target.Value)) return; _adminLogger.Add(LogType.Action, LogImpact.Extreme, $"{ToPrettyString(args.Args.User):player} used a biomass reclaimer to gib {ToPrettyString(args.Args.Target.Value):target} in {ToPrettyString(reclaimer):reclaimer}"); - StartProcessing(args.Args.Target.Value, reclaimer); + StartProcessing(args.Args.Used.Value, reclaimer); args.Handled = true; } @@ -200,8 +215,13 @@ private void StartProcessing(EntityUid toProcess, Entity(toProcess)) + expectedYield *= component.ProduceYieldMultiplier; + component.CurrentExpectedYield += expectedYield; + component.ProcessingTimer = physics.FixturesMass * component.ProcessingTimePerUnitMass; + QueueDel(toProcess); } @@ -210,7 +230,8 @@ private bool CanGib(Entity reclaimer, EntityUid dragg if (HasComp(reclaimer)) return false; - if (!HasComp(dragged)) + bool isPlant = HasComp(dragged); + if (!isPlant && !HasComp(dragged)) return false; if (!Transform(reclaimer).Anchored) @@ -219,7 +240,7 @@ private bool CanGib(Entity reclaimer, EntityUid dragg if (TryComp(reclaimer, out var power) && !power.Powered) return false; - if (reclaimer.Comp.SafetyEnabled && !_mobState.IsDead(dragged)) + if (!isPlant && reclaimer.Comp.SafetyEnabled && !_mobState.IsDead(dragged)) return false; // Reject souled bodies in easy mode. From ab569372d84c00790eafbe34113e7dfaff2bc8c5 Mon Sep 17 00:00:00 2001 From: SimpleStation14 <130339894+SimpleStation14@users.noreply.github.com> Date: Mon, 6 May 2024 12:01:24 -0700 Subject: [PATCH 03/10] Mirror: zombie wideswing and misc fix (#179) ## Mirror of PR #26064: [zombie wideswing and misc fix](https://github.com/space-wizards/space-station-14/pull/26064) from space-wizards [space-wizards](https://github.com/space-wizards)/[space-station-14](https://github.com/space-wizards/space-station-14) ###### `3981173a1546dd1d4a21b1c85451ea7eaf69c6f8` PR opened by Dutch-VanDerLinde at 2024-03-13 00:13:44 UTC --- PR changed 3 files with 10 additions and 1 deletions. The PR had the following labels: - Status: Needs Review ---

Original Body

> > > > ## About the PR > zombies wideswing, also makes the bite sound into the carp biting sound on zombified (human zombies will bite you, but it sounds like punching?) > > ## Why / Balance > hard to hit moving target as a zombie > > ## Technical details > made AltDisarm an AutoNetworkedField in MeleeWeaponComponent > > ## Media > > https://github.com/space-wizards/space-station-14/assets/45323883/8e1a2d17-a0a0-4320-92f2-d40efe88c7b7 > > > > - [X] I have added screenshots/videos to this PR showcasing its changes ingame, **or** this PR does not require an ingame showcase > > > :cl: > - tweak: Zombies can now wideswing, similar to how a space carp would.
Co-authored-by: SimpleStation14 --- Content.Server/Zombies/ZombieSystem.Transform.cs | 3 +++ Content.Shared/Weapons/Melee/MeleeWeaponComponent.cs | 2 +- Content.Shared/Zombies/ZombieComponent.cs | 6 ++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Content.Server/Zombies/ZombieSystem.Transform.cs b/Content.Server/Zombies/ZombieSystem.Transform.cs index 1b4f2f1c5b..daadd4b518 100644 --- a/Content.Server/Zombies/ZombieSystem.Transform.cs +++ b/Content.Server/Zombies/ZombieSystem.Transform.cs @@ -141,7 +141,10 @@ public void ZombifyEntity(EntityUid target, MobStateComponent? mobState = null) var melee = EnsureComp(target); melee.Animation = zombiecomp.AttackAnimation; melee.WideAnimation = zombiecomp.AttackAnimation; + melee.AltDisarm = false; melee.Range = 1.2f; + melee.Angle = 0.0f; + melee.HitSound = zombiecomp.BiteSound; if (mobState.CurrentState == MobState.Alive) { diff --git a/Content.Shared/Weapons/Melee/MeleeWeaponComponent.cs b/Content.Shared/Weapons/Melee/MeleeWeaponComponent.cs index e5b35f6c0b..85d2e4675f 100644 --- a/Content.Shared/Weapons/Melee/MeleeWeaponComponent.cs +++ b/Content.Shared/Weapons/Melee/MeleeWeaponComponent.cs @@ -18,7 +18,7 @@ public sealed partial class MeleeWeaponComponent : Component /// /// Does this entity do a disarm on alt attack. /// - [DataField, ViewVariables(VVAccess.ReadWrite)] + [DataField, ViewVariables(VVAccess.ReadWrite), AutoNetworkedField] public bool AltDisarm = true; /// diff --git a/Content.Shared/Zombies/ZombieComponent.cs b/Content.Shared/Zombies/ZombieComponent.cs index 023bf751ff..85e1599e48 100644 --- a/Content.Shared/Zombies/ZombieComponent.cs +++ b/Content.Shared/Zombies/ZombieComponent.cs @@ -140,6 +140,12 @@ public sealed partial class ZombieComponent : Component, IAntagStatusIconCompone [DataField("greetSoundNotification")] public SoundSpecifier GreetSoundNotification = new SoundPathSpecifier("/Audio/Ambience/Antag/zombie_start.ogg"); + /// + /// Hit sound on zombie bite. + /// + [DataField] + public SoundSpecifier BiteSound = new SoundPathSpecifier("/Audio/Effects/bite.ogg"); + /// /// The blood reagent of the humanoid to restore in case of cloning /// From 14f012be759cabc45f620d675f1c2f37ecd6df86 Mon Sep 17 00:00:00 2001 From: SimpleStation14 <130339894+SimpleStation14@users.noreply.github.com> Date: Mon, 6 May 2024 12:03:40 -0700 Subject: [PATCH 04/10] Mirror: Fixed bug with appearance of ammo battery magazine guns (#182) ## Mirror of PR #26009: [Fixed bug with appearance of ammo battery magazine guns](https://github.com/space-wizards/space-station-14/pull/26009) from space-wizards [space-wizards](https://github.com/space-wizards)/[space-station-14](https://github.com/space-wizards/space-station-14) ###### `63232389ca9a499fb614960ccf9eae9b3d186037` PR opened by 778b at 2024-03-11 18:34:37 UTC --- PR changed 1 files with 9 additions and 0 deletions. The PR had the following labels: ---

Original Body

> > > > ## About the PR > > Fix bug with guns which used MagazineAmmoProviderComponent with Battery magazines like svalinn laser pistol. > > ## Why / Balance > > Bugfix, no balance here > > ## Technical details > > Just added subscribe for AmmoCounterControlEvent which using AmmoCounterComponent because battery magazines must redefine control in this event to display ammo, now its work well. > Also checked some other guns which using MagazineAmmoProviderComponent and they work like always, without new bugs > > > ## Media > > Before: > ![Content Client_XpYbOTUw9U](https://github.com/space-wizards/space-station-14/assets/33431126/39f365f3-51fa-4888-9eb0-568d6519aaec) > > After: > https://github.com/space-wizards/space-station-14/assets/33431126/d4aa3c99-7e89-44d7-9030-1fa2a3db13ab > > > > - [x] I have added screenshots/videos to this PR showcasing its changes ingame, **or** this PR does not require an ingame showcase > > ## Breaking changes > > > **Changelog** > > > :cl: 778b > > - fix: Guns which use battery as magazines now display ammo. Like Svalinn pistol. > >
Co-authored-by: SimpleStation14 --- .../Weapons/Ranged/Systems/GunSystem.Magazine.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Content.Client/Weapons/Ranged/Systems/GunSystem.Magazine.cs b/Content.Client/Weapons/Ranged/Systems/GunSystem.Magazine.cs index eaab8401bc..0df95e4c02 100644 --- a/Content.Client/Weapons/Ranged/Systems/GunSystem.Magazine.cs +++ b/Content.Client/Weapons/Ranged/Systems/GunSystem.Magazine.cs @@ -8,6 +8,7 @@ protected override void InitializeMagazine() { base.InitializeMagazine(); SubscribeLocalEvent(OnMagazineAmmoUpdate); + SubscribeLocalEvent(OnMagazineControl); } private void OnMagazineAmmoUpdate(EntityUid uid, MagazineAmmoProviderComponent component, UpdateAmmoCounterEvent args) @@ -26,4 +27,12 @@ private void OnMagazineAmmoUpdate(EntityUid uid, MagazineAmmoProviderComponent c RaiseLocalEvent(ent.Value, args, false); } + + private void OnMagazineControl(EntityUid uid, MagazineAmmoProviderComponent component, AmmoCounterControlEvent args) + { + var ent = GetMagazineEntity(uid); + if (ent == null) + return; + RaiseLocalEvent(ent.Value, args, false); + } } From b8489bebfbb749319a239afae09aa9c9da9e45e2 Mon Sep 17 00:00:00 2001 From: SimpleStation14 <130339894+SimpleStation14@users.noreply.github.com> Date: Mon, 6 May 2024 12:04:34 -0700 Subject: [PATCH 05/10] Mirror: Cycle injector transfer amount on alt. use (#178) ## Mirror of PR #25566: [Cycle injector transfer amount on alt. use](https://github.com/space-wizards/space-station-14/pull/25566) from space-wizards [space-wizards](https://github.com/space-wizards)/[space-station-14](https://github.com/space-wizards/space-station-14) ###### `ad6ac73f6f41d1cbd3fe80a43c8bf4b83e03f392` PR opened by veprolet at 2024-02-25 19:37:49 UTC --- PR changed 3 files with 26 additions and 3 deletions. The PR had the following labels: - Status: Needs Review ---

Original Body

> ## About the PR > When the user tries to use alternative interaction on an injector capable of changing transfer volume, this will cycle between the maximal and minimal transfer amount (defaulting to maximum if the value was in-between the extremes). > > The interaction is only available with in-hand usage or empty-handed usage. This is deliberate (but not necessarily correct). > The interaction is only implemented for injectors and not arbitrary containers capable of solution transfers. This is to limit the scope of this PR. > > ## Why / Balance > Changing the transfer amount was only possible using the context menu. This was difficult and slow, but this tedium didn't seem to be a valuable part of the gameplay experience. > > Instead of cycling over all the possible transfer amounts, the choice has been made to only cycle between the two extremes. This is for two reasons: > - Scalability: If this is merged, we'll probably want the same behavior for the other solution containers like jugs. It would be very tedious (probably more tedious than using the context menu) to cycle to the correct transfer amount with more available transfer amount steps. It would also be IMO unintuitive to have a different behavior between the two types of solution containers. > - Simplicity: It is easier to reason about the next state this way. Otherwise, one would have to figure out how many times to perform the interaction to cycle to the desired amount, which involves knowing the total number of steps for each injector/container, order of the current step and modular arithmetic (or just cycling until you are at the correct one, which is slow, error-prone and frustrating whenever you overshoot). > > This decision has obviously some tradeoffs, but I feel like those are manageable. If you need to transfer the in-between amounts, you can usually switch to the minimal amount (I assume the property of in-between amounts being a multiple of the minimum will be upheld in the future) and click a few times. This is generally as tedious or less tedious than cycling the amounts. There are some instances where you can't do that. One example would be manual mixing of the advanced brute medications. This is a niche use-case and can be still solved using the context menu verb system and is supposed to be a bit more difficult anyway. > > This also makes the alternative interaction a bit less predictable, as it no longer always uses the first context menu verb. I think the interaction is similar enough and inconsequential enough to justify this. > > It makes the syringe marginally more powerful, but as this doesn't introduce any previously unavailable actions, I believe this to be perfectly acceptable and heavily outweighed by the convenience. > > ## Technical details > ~~This introduces a new concept of "special alternative" interactions. Those interactions have their own events and handlers.~~ > > Please scrutinize the code hard ~~, because it touches some quite fundamental parts of the game, and~~ I'm not too knowledgeable about C# or the conventions of this repo. I tried to follow guidelines where possible while not impacting the existing code too much, but maybe this leads to too much weirdness in some places. > > ## Media > ![optimized](https://github.com/space-wizards/space-station-14/assets/68151557/c445b535-e4c6-49ff-b712-d540dd7fe57b) > > - [X] I acknowledge that I have no idea how to showcase or record this feature well, **or** I'm trying my best. > > ## Breaking changes > N/A > > **Changelog** > :cl: > - tweak: Injectors like the syringe can now toggle their transfer amount using alternative interactions. >
Co-authored-by: SimpleStation14 --- .../Chemistry/Components/InjectorComponent.cs | 3 +-- .../EntitySystems/SharedInjectorSystem.cs | 26 +++++++++++++++++-- .../solution-transfer-component.ftl | 1 + 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/Content.Shared/Chemistry/Components/InjectorComponent.cs b/Content.Shared/Chemistry/Components/InjectorComponent.cs index e29047b6de..188028c8f8 100644 --- a/Content.Shared/Chemistry/Components/InjectorComponent.cs +++ b/Content.Shared/Chemistry/Components/InjectorComponent.cs @@ -53,8 +53,7 @@ public sealed partial class InjectorComponent : Component /// The maximum amount of solution that can be transferred at once from this solution. ///
[DataField("maxTransferAmount")] - [ViewVariables(VVAccess.ReadWrite)] - public FixedPoint2 MaximumTransferAmount = FixedPoint2.New(50); + public FixedPoint2 MaximumTransferAmount = FixedPoint2.New(15); /// /// Amount to inject or draw on each usage. If the injector is inject only, it will diff --git a/Content.Shared/Chemistry/EntitySystems/SharedInjectorSystem.cs b/Content.Shared/Chemistry/EntitySystems/SharedInjectorSystem.cs index dad8eb4091..7e41cb39bd 100644 --- a/Content.Shared/Chemistry/EntitySystems/SharedInjectorSystem.cs +++ b/Content.Shared/Chemistry/EntitySystems/SharedInjectorSystem.cs @@ -39,12 +39,34 @@ private void AddSetTransferVerbs(Entity entity, ref GetVerbsE if (!HasComp(args.User)) return; + var user = args.User; var (_, component) = entity; - // Add specific transfer verbs according to the container's size + var min = component.MinimumTransferAmount; + var max = component.MaximumTransferAmount; + var cur = component.TransferAmount; + var toggleAmount = cur == max ? min : max; + var priority = 0; - var user = args.User; + AlternativeVerb toggleVerb = new() + { + Text = Loc.GetString("comp-solution-transfer-verb-toggle", ("amount", toggleAmount)), + Category = VerbCategory.SetTransferAmount, + Act = () => + { + component.TransferAmount = toggleAmount; + Popup.PopupClient(Loc.GetString("comp-solution-transfer-set-amount", ("amount", toggleAmount)), user, user); + Dirty(entity); + }, + + Priority = priority + }; + args.Verbs.Add(toggleVerb); + + priority -= 1; + + // Add specific transfer verbs according to the container's size foreach (var amount in TransferAmounts) { if (amount < component.MinimumTransferAmount || amount > component.MaximumTransferAmount) diff --git a/Resources/Locale/en-US/chemistry/components/solution-transfer-component.ftl b/Resources/Locale/en-US/chemistry/components/solution-transfer-component.ftl index 14cec95129..74e38f00ab 100644 --- a/Resources/Locale/en-US/chemistry/components/solution-transfer-component.ftl +++ b/Resources/Locale/en-US/chemistry/components/solution-transfer-component.ftl @@ -11,6 +11,7 @@ comp-solution-transfer-is-full = {THE($target)} is full! ## Displayed in change transfer amount verb's name comp-solution-transfer-verb-custom-amount = Custom comp-solution-transfer-verb-amount = {$amount}u +comp-solution-transfer-verb-toggle = Toggle to {$amount}u ## Displayed after you successfully change a solution's amount using the BUI comp-solution-transfer-set-amount = Transfer amount set to {$amount}u. From 40d05b8d118ce2dba0cd8fe2454a737bb98da886 Mon Sep 17 00:00:00 2001 From: SimpleStation14 <130339894+SimpleStation14@users.noreply.github.com> Date: Mon, 6 May 2024 12:05:45 -0700 Subject: [PATCH 06/10] Mirror: Enable multiple Solution Editor windows (#157) ## Mirror of PR #26005: [Enable multiple Solution Editor windows](https://github.com/space-wizards/space-station-14/pull/26005) from space-wizards [space-wizards](https://github.com/space-wizards)/[space-station-14](https://github.com/space-wizards/space-station-14) ###### `0da09db99ac556e0efdce40268e60eb5a06a0694` PR opened by SlamBamActionman at 2024-03-11 17:16:10 UTC PR merged by web-flow at 2024-03-12 12:10:10 UTC --- PR changed 2 files with 26 additions and 11 deletions. The PR had the following labels: - Status: Needs Review ---

Original Body

> > > > ## About the PR > > > Makes it so that you can have multiple debug Solution Editor/Add Reagent windows open at once. > > ## Why / Balance > > > Admin request. Useful if you want to multitask editing multiple solution containers and their contents. > > ## Technical details > > > Previously the open Solution Editor window was being tracked by a Dictionary which mapped the window entity to a session ID. That Dictionary instead uses a list of window entities mapped to the session ID, allowing for multiple windows. > > ## Media > > > ![image](https://github.com/space-wizards/space-station-14/assets/83650252/d93b722f-d2a5-4523-8b39-fcdc0edc7175) > > - [x] I have added screenshots/videos to this PR showcasing its changes ingame, **or** this PR does not require an ingame showcase > > ## Breaking changes > > > **Changelog** > > > no cl no fun
Co-authored-by: SlamBamActionman <83650252+SlamBamActionman@users.noreply.github.com> --- .../Administration/Systems/AdminVerbSystem.cs | 35 +++++++++++++------ .../Administration/UI/EditSolutionsEui.cs | 2 +- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/Content.Server/Administration/Systems/AdminVerbSystem.cs b/Content.Server/Administration/Systems/AdminVerbSystem.cs index e678abb0c4..c4754af934 100644 --- a/Content.Server/Administration/Systems/AdminVerbSystem.cs +++ b/Content.Server/Administration/Systems/AdminVerbSystem.cs @@ -67,7 +67,7 @@ public sealed partial class AdminVerbSystem : EntitySystem [Dependency] private readonly StationSystem _stations = default!; [Dependency] private readonly StationSpawningSystem _spawning = default!; - private readonly Dictionary _openSolutionUis = new(); + private readonly Dictionary> _openSolutionUis = new(); public override void Initialize() { @@ -486,10 +486,13 @@ private void AddDebugVerbs(GetVerbsEvent args) #region SolutionsEui private void OnSolutionChanged(Entity entity, ref SolutionContainerChangedEvent args) { - foreach (var eui in _openSolutionUis.Values) + foreach (var list in _openSolutionUis.Values) { - if (eui.Target == entity.Owner) - eui.StateDirty(); + foreach (var eui in list) + { + if (eui.Target == entity.Owner) + eui.StateDirty(); + } } } @@ -498,21 +501,33 @@ public void OpenEditSolutionsEui(ICommonSession session, EntityUid uid) if (session.AttachedEntity == null) return; - if (_openSolutionUis.ContainsKey(session)) - _openSolutionUis[session].Close(); - - var eui = _openSolutionUis[session] = new EditSolutionsEui(uid); + var eui = new EditSolutionsEui(uid); _euiManager.OpenEui(eui, session); eui.StateDirty(); + + if (!_openSolutionUis.ContainsKey(session)) { + _openSolutionUis[session] = new List(); + } + + _openSolutionUis[session].Add(eui); } - public void OnEditSolutionsEuiClosed(ICommonSession session) + public void OnEditSolutionsEuiClosed(ICommonSession session, EditSolutionsEui eui) { - _openSolutionUis.Remove(session, out var eui); + _openSolutionUis[session].Remove(eui); + if (_openSolutionUis[session].Count == 0) + _openSolutionUis.Remove(session); } private void Reset(RoundRestartCleanupEvent ev) { + foreach (var euis in _openSolutionUis.Values) + { + foreach (var eui in euis.ToList()) + { + eui.Close(); + } + } _openSolutionUis.Clear(); } #endregion diff --git a/Content.Server/Administration/UI/EditSolutionsEui.cs b/Content.Server/Administration/UI/EditSolutionsEui.cs index 2a78a27bc0..b4904d969e 100644 --- a/Content.Server/Administration/UI/EditSolutionsEui.cs +++ b/Content.Server/Administration/UI/EditSolutionsEui.cs @@ -36,7 +36,7 @@ public override void Opened() public override void Closed() { base.Closed(); - _entityManager.System().OnEditSolutionsEuiClosed(Player); + _entityManager.System().OnEditSolutionsEuiClosed(Player, this); } public override EuiStateBase GetNewState() From d032a0f6e9b6e115c21a4a9d322f859339503bdf Mon Sep 17 00:00:00 2001 From: SimpleStation14 <130339894+SimpleStation14@users.noreply.github.com> Date: Mon, 6 May 2024 12:06:11 -0700 Subject: [PATCH 07/10] Mirror: new haircut alternative (brought back old one) (#162) ## Mirror of PR #25935: [new haircut alternative (brought back old one)](https://github.com/space-wizards/space-station-14/pull/25935) from space-wizards [space-wizards](https://github.com/space-wizards)/[space-station-14](https://github.com/space-wizards/space-station-14) ###### `76db710a1c5fe4c86674a27c282b4f84cb35446b` PR opened by UnicornOnLSD at 2024-03-08 21:34:23 UTC PR merged by web-flow at 2024-03-12 18:47:29 UTC --- PR changed 4 files with 12 additions and 0 deletions. The PR had the following labels: - No C# - Changes: Sprites ---

Original Body

> > > > ## About the PR > > added back the 'old' sprite of crew cut haircut as a secondary choice to the current crew cut. > ## Why / Balance > > Both my personnal liking, and, I mean, more customisation is better, no ? > ## Technical details > > nah > ## Media > > > - [ ] I have added screenshots/videos to this PR showcasing its changes ingame, **or** this PR does not require an ingame showcase > > ## Breaking changes > > > **Changelog** > > > > :cl: > - add: brought back the classic crew cut as an alternative to the current one ! >
Co-authored-by: UnicornOnLSD <149102472+UnicornOnLSD@users.noreply.github.com> --- Resources/Locale/en-US/accessories/human-hair.ftl | 1 + .../Mobs/Customization/Markings/human_hair.yml | 7 +++++++ .../Customization/human_hair.rsi/crewcut2.png | Bin 0 -> 218 bytes .../Mobs/Customization/human_hair.rsi/meta.json | 4 ++++ 4 files changed, 12 insertions(+) create mode 100644 Resources/Textures/Mobs/Customization/human_hair.rsi/crewcut2.png diff --git a/Resources/Locale/en-US/accessories/human-hair.ftl b/Resources/Locale/en-US/accessories/human-hair.ftl index 9bd8c01fb0..a39e09d5d5 100644 --- a/Resources/Locale/en-US/accessories/human-hair.ftl +++ b/Resources/Locale/en-US/accessories/human-hair.ftl @@ -55,6 +55,7 @@ marking-HumanHairCornrowbun = Cornrow Bun marking-HumanHairCornrowbraid = Cornrow Braid marking-HumanHairCornrowtail = Cornrow Tail marking-HumanHairCrewcut = Crewcut +marking-HumanHairCrewcut2 = Crewcut 2 marking-HumanHairCurls = Curls marking-HumanHairC = Cut Hair marking-HumanHairDandypompadour = Dandy Pompadour diff --git a/Resources/Prototypes/Entities/Mobs/Customization/Markings/human_hair.yml b/Resources/Prototypes/Entities/Mobs/Customization/Markings/human_hair.yml index af4114ce48..c3f3bd13a3 100644 --- a/Resources/Prototypes/Entities/Mobs/Customization/Markings/human_hair.yml +++ b/Resources/Prototypes/Entities/Mobs/Customization/Markings/human_hair.yml @@ -397,6 +397,13 @@ sprites: - sprite: Mobs/Customization/human_hair.rsi state: crewcut +- type: marking + id: HumanHairCrewcut2 + bodyPart: Hair + markingCategory: Hair + sprites: + - sprite: Mobs/Customization/human_hair.rsi + state: crewcut2 - type: marking id: HumanHairCurls bodyPart: Hair diff --git a/Resources/Textures/Mobs/Customization/human_hair.rsi/crewcut2.png b/Resources/Textures/Mobs/Customization/human_hair.rsi/crewcut2.png new file mode 100644 index 0000000000000000000000000000000000000000..2209a9ce8376a58827364fd7bfb3f62c76979ec4 GIT binary patch literal 218 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0J3?w7mbKU|ei2$DvS0H@}22Pzi1!O|VIp Date: Mon, 6 May 2024 12:07:27 -0700 Subject: [PATCH 08/10] Mirror: Some more whitelists for belts (#188) ## Mirror of PR #26085: [Some more whitelists for belts](https://github.com/space-wizards/space-station-14/pull/26085) from space-wizards [space-wizards](https://github.com/space-wizards)/[space-station-14](https://github.com/space-wizards/space-station-14) ###### `2b5a75ba6619b9fdd6c4f7e17a18d2af85167505` PR opened by lzk228 at 2024-03-13 17:54:03 UTC --- PR changed 4 files with 13 additions and 0 deletions. The PR had the following labels: - No C# ---

Original Body

> > > > ## About the PR > > - Allow surgery tools in medbelt (Fixes #26010) > - Allow hand labeler in utility and botanical belt > - Allow lantern in utility belt > > ## Why / Balance > > > ## Technical details > > > ## Media > > > - [ ] I have added screenshots/videos to this PR showcasing its changes ingame, **or** this PR does not require an ingame showcase > > ## Breaking changes > > > **Changelog** > > > :cl: > - tweak: Surgery tools can be placed in medical belt. > - tweak: Lantern can be placed in utility belt. > - tweak: Hand labeler can be placed in utility and botanical belt > >
Co-authored-by: SimpleStation14 --- Resources/Prototypes/Entities/Clothing/Belt/belts.yml | 4 ++++ .../Prototypes/Entities/Objects/Specific/Medical/surgery.yml | 3 +++ Resources/Prototypes/Entities/Objects/Tools/lantern.yml | 3 +++ Resources/Prototypes/tags.yml | 3 +++ 4 files changed, 13 insertions(+) diff --git a/Resources/Prototypes/Entities/Clothing/Belt/belts.yml b/Resources/Prototypes/Entities/Clothing/Belt/belts.yml index b84033a787..d3ccd335c1 100644 --- a/Resources/Prototypes/Entities/Clothing/Belt/belts.yml +++ b/Resources/Prototypes/Entities/Clothing/Belt/belts.yml @@ -41,6 +41,7 @@ - Geiger - TrayScanner - GasAnalyzer + - HandLabeler - type: ItemMapper mapLayers: drill: @@ -265,10 +266,12 @@ - PillCanister - Radio - DiscreteHealthAnalyzer + - SurgeryTool components: - Hypospray - Injector - Pill + - HandLabeler - type: ItemMapper mapLayers: bottle: @@ -341,6 +344,7 @@ components: - Seed - Smokable + - HandLabeler - type: ItemMapper mapLayers: hatchet: diff --git a/Resources/Prototypes/Entities/Objects/Specific/Medical/surgery.yml b/Resources/Prototypes/Entities/Objects/Specific/Medical/surgery.yml index 6dc78455ea..aa0cf46187 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Medical/surgery.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Medical/surgery.yml @@ -8,6 +8,9 @@ - type: Sprite - type: StaticPrice price: 20 + - type: Tag + tags: + - SurgeryTool # Cautery diff --git a/Resources/Prototypes/Entities/Objects/Tools/lantern.yml b/Resources/Prototypes/Entities/Objects/Tools/lantern.yml index 71b27ed31e..89101e34ff 100644 --- a/Resources/Prototypes/Entities/Objects/Tools/lantern.yml +++ b/Resources/Prototypes/Entities/Objects/Tools/lantern.yml @@ -61,6 +61,9 @@ quickEquip: false slots: - Belt + - type: Tag + tags: + - Flashlight - type: entity parent: Lantern diff --git a/Resources/Prototypes/tags.yml b/Resources/Prototypes/tags.yml index 2b11b7991b..d8259b32e1 100644 --- a/Resources/Prototypes/tags.yml +++ b/Resources/Prototypes/tags.yml @@ -1142,6 +1142,9 @@ - type: Tag id: SuitEVA +- type: Tag + id: SurgeryTool + - type: Tag id: SurveillanceCameraMonitorCircuitboard From d34c52fbd440a87cf037768ca04126553e143d34 Mon Sep 17 00:00:00 2001 From: SimpleStation14 <130339894+SimpleStation14@users.noreply.github.com> Date: Mon, 6 May 2024 12:07:44 -0700 Subject: [PATCH 09/10] Mirror: Drink from closed container fix (#195) ## Mirror of PR #26103: [Drink from closed container fix](https://github.com/space-wizards/space-station-14/pull/26103) from space-wizards [space-wizards](https://github.com/space-wizards)/[space-station-14](https://github.com/space-wizards/space-station-14) ###### `2f2cd4aab70703717541e5db3f46ae4831b4129d` PR opened by maylokana at 2024-03-14 03:59:47 UTC --- PR changed 1 files with 3 additions and 0 deletions. The PR had the following labels: ---

Original Body

> > > > ## About the PR > > All drink containers now check if the container is closed once the do-after is done, and will stop you from trying to drink from it if it is closed > > ## Why / Balance > > Bug fix. I think > > ## Technical details > > In `DrinkSystem.cs`, added an `_openable.IsClosed()` method to `OnDoAfter()`, which returns if true > > ## Media > > > https://github.com/space-wizards/space-station-14/assets/88361930/cf983879-5073-407a-98fc-2004692a8d08 > > > - [X] I have added screenshots/videos to this PR showcasing its changes ingame, **or** this PR does not require an ingame showcase > > ## Breaking changes > > N/A > > **Changelog** > > > :cl: > - fix: Entities can no longer drink from closed containers
Co-authored-by: SimpleStation14 --- Content.Server/Nutrition/EntitySystems/DrinkSystem.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Content.Server/Nutrition/EntitySystems/DrinkSystem.cs b/Content.Server/Nutrition/EntitySystems/DrinkSystem.cs index 925e50b949..6327cf6ae2 100644 --- a/Content.Server/Nutrition/EntitySystems/DrinkSystem.cs +++ b/Content.Server/Nutrition/EntitySystems/DrinkSystem.cs @@ -311,6 +311,9 @@ private void OnDoAfter(Entity entity, ref ConsumeDoAfterEvent ar if (args.Used is null || !_solutionContainer.TryGetSolution(args.Used.Value, args.Solution, out var soln, out var solution)) return; + if (_openable.IsClosed(args.Used.Value, args.Target.Value)) + return; + // TODO this should really be checked every tick. if (_food.IsMouthBlocked(args.Target.Value)) return; From 467b21a60436b69f13f077c2e2253f44124cb6e4 Mon Sep 17 00:00:00 2001 From: SimpleStation14 <130339894+SimpleStation14@users.noreply.github.com> Date: Mon, 6 May 2024 12:10:00 -0700 Subject: [PATCH 10/10] Mirror: Fix Butcherable handling, ItemSlots for clown shoes (#180) ## Mirror of PR #25661: [Fix Butcherable handling, ItemSlots for clown shoes](https://github.com/space-wizards/space-station-14/pull/25661) from space-wizards [space-wizards](https://github.com/space-wizards)/[space-station-14](https://github.com/space-wizards/space-station-14) ###### `674b42b3a0ab9fa607887c1401f38ca1f8bb3911` PR opened by Krunklehorn at 2024-02-28 02:04:52 UTC --- PR changed 9 files with 75 additions and 30 deletions. The PR had the following labels: - Status: Needs Review ---

Original Body

> ## About the PR > > - Fixes improper popups with edible+butcherable items, and sharp+utensil items > - Clown shoes have item slots > - Intended for non-harmful items other than their job specific gun > - Currently supports plastic knives, cap gun & fake cap gun > > Minor stuff... > - Spoons are metal > - Plastic knives are actually plastic knives > - Plastic utensils are now zero damage weapons > - Raw rat meat is sliceable > > > ## Why / Balance > > Funny suggestion, but also a legitimate way for a Clown to sneak their job specific gun into a holding cell/perma. > > > ## Media > > - [X] I have added screenshots/videos to this PR showcasing its changes ingame, **or** this PR does not require an ingame showcase > > > **Changelog** > > :cl: Krunk > - add: Clown & Jester shoes can now hold plastic knives and cap guns! All clowning, all the time! >
Co-authored-by: SimpleStation14 --- .../Kitchen/EntitySystems/SharpSystem.cs | 27 +++++++++++-------- .../Nutrition/EntitySystems/UtensilSystem.cs | 6 ++++- Resources/Locale/en-US/clothing/boots.ftl | 2 +- .../Clothing/Shoes/base_clothingshoes.yml | 2 +- .../Entities/Clothing/Shoes/specific.yml | 22 +++++++++++++-- .../Entities/Objects/Consumable/Food/meat.yml | 3 +++ .../Prototypes/Entities/Objects/Fun/toys.yml | 17 ++++++------ .../Entities/Objects/Misc/utensils.yml | 23 +++++++++++----- Resources/Prototypes/tags.yml | 3 +++ 9 files changed, 75 insertions(+), 30 deletions(-) diff --git a/Content.Server/Kitchen/EntitySystems/SharpSystem.cs b/Content.Server/Kitchen/EntitySystems/SharpSystem.cs index 814a64a4e3..dfd3bc613c 100644 --- a/Content.Server/Kitchen/EntitySystems/SharpSystem.cs +++ b/Content.Server/Kitchen/EntitySystems/SharpSystem.cs @@ -5,6 +5,7 @@ using Content.Shared.Database; using Content.Shared.Interaction; using Content.Shared.Nutrition.Components; +using Content.Server.Nutrition.EntitySystems; using Content.Shared.Popups; using Content.Shared.Storage; using Content.Shared.Verbs; @@ -34,7 +35,7 @@ public override void Initialize() { base.Initialize(); - SubscribeLocalEvent(OnAfterInteract); + SubscribeLocalEvent(OnAfterInteract, before: new[] { typeof(UtensilSystem) }); SubscribeLocalEvent(OnDoAfter); SubscribeLocalEvent>(OnGetInteractionVerbs); @@ -42,31 +43,34 @@ public override void Initialize() private void OnAfterInteract(EntityUid uid, SharpComponent component, AfterInteractEvent args) { + if (args.Handled) + return; + if (args.Target is null || !args.CanReach) return; - TryStartButcherDoafter(uid, args.Target.Value, args.User); + args.Handled = TryStartButcherDoAfter(uid, args.Target.Value, args.User); } - private void TryStartButcherDoafter(EntityUid knife, EntityUid target, EntityUid user) + private bool TryStartButcherDoAfter(EntityUid knife, EntityUid target, EntityUid user) { if (!TryComp(target, out var butcher)) - return; + return false; if (!TryComp(knife, out var sharp)) - return; + return false; + + if (TryComp(target, out var mobState) && !_mobStateSystem.IsDead(target, mobState)) + return false; if (butcher.Type != ButcheringType.Knife) { _popupSystem.PopupEntity(Loc.GetString("butcherable-different-tool", ("target", target)), knife, user); - return; + return true; } - if (TryComp(target, out var mobState) && !_mobStateSystem.IsDead(target, mobState)) - return; - if (!sharp.Butchering.Add(target)) - return; + return true; var doAfter = new DoAfterArgs(EntityManager, user, sharp.ButcherDelayModifier * butcher.ButcherDelay, new SharpDoAfterEvent(), knife, target: target, used: knife) @@ -77,6 +81,7 @@ private void TryStartButcherDoafter(EntityUid knife, EntityUid target, EntityUid NeedHand = true }; _doAfterSystem.TryStartDoAfter(doAfter); + return true; } private void OnDoAfter(EntityUid uid, SharpComponent component, DoAfterEvent args) @@ -161,7 +166,7 @@ private void OnGetInteractionVerbs(EntityUid uid, ButcherableComponent component Act = () => { if (!disabled) - TryStartButcherDoafter(args.Using!.Value, args.Target, args.User); + TryStartButcherDoAfter(args.Using!.Value, args.Target, args.User); }, Message = message, Disabled = disabled, diff --git a/Content.Server/Nutrition/EntitySystems/UtensilSystem.cs b/Content.Server/Nutrition/EntitySystems/UtensilSystem.cs index f9feed955f..0edd0711b6 100644 --- a/Content.Server/Nutrition/EntitySystems/UtensilSystem.cs +++ b/Content.Server/Nutrition/EntitySystems/UtensilSystem.cs @@ -1,3 +1,4 @@ +using Content.Shared.Containers.ItemSlots; using Content.Server.Nutrition.Components; using Content.Shared.Nutrition.Components; using Content.Shared.Nutrition.EntitySystems; @@ -25,7 +26,7 @@ public override void Initialize() { base.Initialize(); - SubscribeLocalEvent(OnAfterInteract); + SubscribeLocalEvent(OnAfterInteract, after: new[] { typeof(ItemSlotsSystem) }); } /// @@ -33,6 +34,9 @@ public override void Initialize() /// private void OnAfterInteract(EntityUid uid, UtensilComponent component, AfterInteractEvent ev) { + if (ev.Handled) + return; + if (ev.Target == null || !ev.CanReach) return; diff --git a/Resources/Locale/en-US/clothing/boots.ftl b/Resources/Locale/en-US/clothing/boots.ftl index 05322d612a..c86bec8455 100644 --- a/Resources/Locale/en-US/clothing/boots.ftl +++ b/Resources/Locale/en-US/clothing/boots.ftl @@ -1 +1 @@ -clothing-military-boots-sidearm = Sidearm +clothing-boots-sidearm = Sidearm diff --git a/Resources/Prototypes/Entities/Clothing/Shoes/base_clothingshoes.yml b/Resources/Prototypes/Entities/Clothing/Shoes/base_clothingshoes.yml index 8d7dde5928..1119d5cda7 100644 --- a/Resources/Prototypes/Entities/Clothing/Shoes/base_clothingshoes.yml +++ b/Resources/Prototypes/Entities/Clothing/Shoes/base_clothingshoes.yml @@ -45,7 +45,7 @@ - type: ItemSlots slots: item: - name: clothing-military-boots-sidearm + name: clothing-boots-sidearm whitelist: tags: - Knife diff --git a/Resources/Prototypes/Entities/Clothing/Shoes/specific.yml b/Resources/Prototypes/Entities/Clothing/Shoes/specific.yml index 4a49c804cd..4b9cbeef42 100644 --- a/Resources/Prototypes/Entities/Clothing/Shoes/specific.yml +++ b/Resources/Prototypes/Entities/Clothing/Shoes/specific.yml @@ -9,8 +9,26 @@ - type: Clothing sprite: Clothing/Shoes/Specific/chef.rsi +# stuff common to all clown & jester shoes - type: entity - parent: ClothingShoesBaseButcherable + abstract: true + parent: [ClothingShoesBaseButcherable, ClothingSlotBase] + id: ClothingShoesClownBase + components: + - type: ItemSlots + slots: + item: + name: clothing-boots-sidearm + whitelist: + tags: + - Knife + - ToySidearm + blacklist: + components: + - Sharp + +- type: entity + parent: ClothingShoesClownBase id: ClothingShoesClown name: clown shoes description: "The prankster's standard-issue clowning shoes. Damn they're huge!" @@ -49,7 +67,7 @@ acceleration: 5 - type: entity - parent: ClothingShoesBaseButcherable + parent: ClothingShoesClownBase id: ClothingShoesBling name: bling clown shoes description: Made of refined bananium and shined with the pulp of a fresh banana peel. These make a flashy statement. diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/meat.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/meat.yml index f8565a793e..85de407988 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/meat.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/meat.yml @@ -400,6 +400,9 @@ Quantity: 3 - ReagentId: Fat Quantity: 3 + - type: SliceableFood + count: 3 + slice: FoodMeatCutlet - type: entity name: raw lizard meat diff --git a/Resources/Prototypes/Entities/Objects/Fun/toys.yml b/Resources/Prototypes/Entities/Objects/Fun/toys.yml index ccb67b5ae1..e19cb23112 100644 --- a/Resources/Prototypes/Entities/Objects/Fun/toys.yml +++ b/Resources/Prototypes/Entities/Objects/Fun/toys.yml @@ -882,6 +882,7 @@ - type: Tag tags: - Sidearm + - ToySidearm - type: Gun selectedMode: SemiAuto availableModes: @@ -914,14 +915,14 @@ suffix: Fake description: Looks almost like the real thing! Ages 8 and up. components: - - type: RevolverAmmoProvider - whitelist: - tags: - - CartridgeCap - - SpeedLoaderCap - - CartridgeMagnum - - SpeedLoaderMagnum - proto: CartridgeMagnumAP + - type: RevolverAmmoProvider + whitelist: + tags: + - CartridgeCap + - SpeedLoaderCap + - CartridgeMagnum + - SpeedLoaderMagnum + proto: CartridgeMagnumAP - type: entity parent: BaseItem diff --git a/Resources/Prototypes/Entities/Objects/Misc/utensils.yml b/Resources/Prototypes/Entities/Objects/Misc/utensils.yml index 4ac05e1e4b..4250669581 100644 --- a/Resources/Prototypes/Entities/Objects/Misc/utensils.yml +++ b/Resources/Prototypes/Entities/Objects/Misc/utensils.yml @@ -7,9 +7,6 @@ sprite: Objects/Misc/utensils.rsi - type: Item # TODO add inhand sprites for all utensils sprite: Objects/Misc/utensils.rsi - - type: Tag - tags: - - Metal - type: SpaceGarbage - type: entity @@ -23,8 +20,14 @@ price: 0 - type: Tag tags: - - Plastic - - Trash + - Plastic + - Trash + - type: MeleeWeapon + wideAnimationRotation: 180 + attackRate: 1.5 + damage: + types: + Blunt: 0 - type: entity parent: UtensilBase @@ -66,6 +69,9 @@ name: spoon description: There is no spoon. components: + - type: Tag + tags: + - Metal - type: Sprite state: spoon - type: Item @@ -99,7 +105,7 @@ speedModifier: 0.1 # you can try - type: entity - parent: UtensilBase + parent: UtensilBasePlastic id: KnifePlastic name: plastic knife description: That's not a knife. This is a knife. @@ -109,3 +115,8 @@ - type: Utensil types: - Knife + - type: Tag + tags: + - Plastic + - Trash + - Knife diff --git a/Resources/Prototypes/tags.yml b/Resources/Prototypes/tags.yml index d8259b32e1..6d0120aed0 100644 --- a/Resources/Prototypes/tags.yml +++ b/Resources/Prototypes/tags.yml @@ -1184,6 +1184,9 @@ - type: Tag id: Torch +- type: Tag + id: ToySidearm + - type: Tag id: Trash