diff --git a/Content.Server/Kitchen/EntitySystems/SharpSystem.cs b/Content.Server/Kitchen/EntitySystems/SharpSystem.cs index 814a64a4e3b..dfd3bc613cb 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 f9feed955fc..0edd0711b67 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 05322d612a5..c86bec84559 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 8d7dde5928e..1119d5cda74 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 4a49c804cdb..4b9cbeef424 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 f8565a793e6..85de407988b 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 ccb67b5ae1d..e19cb23112b 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 4ac05e1e4b1..4250669581f 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 d8259b32e18..6d0120aed0e 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