Jumpsuit butchering and gauze crafting (#6787)

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
mirrorcult
2022-02-28 20:38:39 -07:00
committed by GitHub
parent 76e6cacce6
commit 903dabf0db
14 changed files with 159 additions and 31 deletions

View File

@@ -6,6 +6,7 @@ using Content.Shared.Interaction;
using Content.Shared.MobState.Components;
using Content.Shared.Nutrition.Components;
using Content.Shared.Popups;
using Content.Shared.Verbs;
using Robust.Shared.Player;
namespace Content.Server.Kitchen.EntitySystems;
@@ -22,35 +23,45 @@ public sealed class SharpSystem : EntitySystem
SubscribeLocalEvent<SharpComponent, AfterInteractEvent>(OnAfterInteract);
SubscribeLocalEvent<SharpButcherDoafterComplete>(OnDoafterComplete);
SubscribeLocalEvent<SharpButcherDoafterCancelled>(OnDoafterCancelled);
SubscribeLocalEvent<SharedButcherableComponent, GetVerbsEvent<InteractionVerb>>(OnGetInteractionVerbs);
}
private void OnAfterInteract(EntityUid uid, SharpComponent component, AfterInteractEvent args)
{
if (!args.CanReach)
if (args.Target is null || !args.CanReach)
return;
if (args.Target is null || !TryComp<SharedButcherableComponent>(args.Target, out var butcher))
TryStartButcherDoafter(uid, args.Target.Value, args.User);
}
private void TryStartButcherDoafter(EntityUid knife, EntityUid target, EntityUid user)
{
if (!TryComp<SharedButcherableComponent>(target, out var butcher))
return;
if (!TryComp<SharpComponent>(knife, out var sharp))
return;
if (butcher.Type != ButcheringType.Knife)
return;
if (TryComp<MobStateComponent>(args.Target, out var mobState) && !mobState.IsDead())
if (TryComp<MobStateComponent>(target, out var mobState) && !mobState.IsDead())
return;
if (!component.Butchering.Add(args.Target.Value))
if (!sharp.Butchering.Add(target))
return;
var doAfter =
new DoAfterEventArgs(args.User, component.ButcherDelayModifier * butcher.ButcherDelay, default, args.Target)
new DoAfterEventArgs(user, sharp.ButcherDelayModifier * butcher.ButcherDelay, default, target)
{
BreakOnTargetMove = true,
BreakOnUserMove = true,
BreakOnDamage = true,
BreakOnStun = true,
NeedHand = true,
BroadcastFinishedEvent = new SharpButcherDoafterComplete { User = args.User, Entity = args.Target.Value, Sharp = uid },
BroadcastCancelledEvent = new SharpButcherDoafterCancelled { Entity = args.Target.Value, Sharp = uid }
BroadcastFinishedEvent = new SharpButcherDoafterComplete { User = user, Entity = target, Sharp = knife },
BroadcastCancelledEvent = new SharpButcherDoafterCancelled { Entity = target, Sharp = knife }
};
_doAfterSystem.DoAfter(doAfter);
@@ -92,6 +103,42 @@ public sealed class SharpSystem : EntitySystem
sharp.Butchering.Remove(ev.Entity);
}
private void OnGetInteractionVerbs(EntityUid uid, SharedButcherableComponent component, GetVerbsEvent<InteractionVerb> args)
{
if (component.Type != ButcheringType.Knife)
return;
bool disabled = false;
string? message = null;
if (TryComp<MobStateComponent>(uid, out var state) && !state.IsDead())
{
disabled = true;
message = Loc.GetString("butcherable-mob-isnt-dead");
}
if (args.Using is null || !TryComp<SharpComponent>(args.Using, out var sharp))
{
disabled = true;
message = Loc.GetString("butcherable-need-knife");
}
InteractionVerb verb = new()
{
Act = () =>
{
if (!disabled)
TryStartButcherDoafter(args.Using!.Value, args.Target, args.User);
},
Message = message,
Disabled = disabled,
IconTexture = "/Textures/Interface/VerbIcons/cutlery.svg.192dpi.png",
Text = Loc.GetString("butcherable-verb-name"),
};
args.Verbs.Add(verb);
}
}
public sealed class SharpButcherDoafterComplete : EntityEventArgs

View File

@@ -259,6 +259,7 @@ namespace Content.Server.Nutrition.EntitySystems
{
TryFeed(uid, ev.User, component);
},
IconTexture = "/Textures/Interface/VerbIcons/cutlery.svg.192dpi.png",
Text = Loc.GetString("food-system-verb-eat"),
Priority = -1
};

View File

@@ -1 +1,4 @@
butcherable-knife-butchered-success = You butcher { THE($target) } with { THE($knife) }.
butcherable-need-knife = Need something sharp.
butcherable-mob-isnt-dead = Needs to be dead.
butcherable-verb-name = Butcher

View File

@@ -10,3 +10,7 @@
- neck
- type: Sprite
state: icon
- type: Butcherable
butcheringType: Knife
spawned: MaterialCloth1
pieces: 2

View File

@@ -8,8 +8,7 @@
- FEET
- type: Sprite
state: icon
- type: Extractable
juiceSolution:
reagents:
- ReagentId: Fiber
Quantity: 5
- type: Butcherable
butcheringType: Knife
spawned: MaterialCloth1
pieces: 1

View File

@@ -20,11 +20,10 @@
Slots: [innerclothing]
EquipSound:
path: /Audio/Items/jumpsuit_equip.ogg
- type: Extractable
juiceSolution:
reagents:
- ReagentId: Fiber
Quantity: 10
- type: Butcherable
butcheringType: Knife
spawned: MaterialCloth1
pieces: 3
- type: entity
abstract: true
@@ -38,8 +37,7 @@
femaleMask: UniformTop
EquipSound:
path: /Audio/Items/jumpsuit_equip.ogg
- type: Extractable
juiceSolution:
reagents:
- ReagentId: Fiber
Quantity: 5
- type: Butcherable
butcheringType: Knife
spawned: MaterialCloth1
pieces: 3

View File

@@ -57,6 +57,11 @@
state: cloth
- type: Stack
count: 1
- type: Extractable
juiceSolution:
reagents:
- ReagentId: Fiber
Quantity: 3
- type: entity
parent: MaterialBase

View File

@@ -71,6 +71,9 @@
- Gauze
- type: Sprite
state: gauze
- type: Construction
graph: Gauze
node: gauze
- type: Healing
damageContainer: Biological
damage:
@@ -85,6 +88,13 @@
- type: Stack
stackType: Gauze
- type: entity
id: Gauze1
parent: Gauze
components:
- type: Stack
count: 1
- type: entity
name: aloe cream
description: A topical cream for burns.

View File

@@ -0,0 +1,13 @@
- type: constructionGraph
id: Gauze
start: start
graph:
- node: start
edges:
- to: gauze
steps:
- material: Cloth
amount: 2
doAfter: 10
- node: gauze
entity: Gauze1

View File

@@ -34,3 +34,16 @@
icon:
sprite: Objects/Weapons/Guns/Cannons/pneumatic_cannon.rsi
state: pneumaticCannon
- type: construction
name: gauze
id: gauze
graph: Gauze
startNode: start
targetNode: gauze
category: Tools
objectType: Item
description: When you've really got nothing left.
icon:
sprite: Objects/Specific/Medical/medical.rsi
state: gauze

View File

@@ -1,11 +1,3 @@
- type: latheRecipe
id: Gauze
icon: Objects/Specific/Medical/medical.rsi/gauze.png
result: Gauze
completetime: 500
materials:
Plastic: 100
- type: latheRecipe
id: Scalpel
icon: Objects/Specific/Medical/Surgery/scalpel.rsi/scalpel.png

View File

@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
viewBox="0 0 120 120"
version="1.1"
id="svg834"
sodipodi:docname="cutlery.svg"
inkscape:version="1.1.2 (b8e25be833, 2022-02-05)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs838" />
<sodipodi:namedview
id="namedview836"
pagecolor="#505050"
bordercolor="#eeeeee"
borderopacity="1"
inkscape:pageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="6.7333333"
inkscape:cx="59.925743"
inkscape:cy="54.950495"
inkscape:window-width="1920"
inkscape:window-height="1017"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="svg834" />
<path
d="M56.027 49.673c0 4.945-4.505 10.24-10.346 10.24v51.202c0 11.848-16.14 11.848-16.14 0V59.898c-5.69 0-10.64-4.38-10.64-10.944V3.02c0-3.997 5.78-4.15 5.78.155v33.957h4.838V2.868c0-3.675 5.563-3.912 5.563.154v34.11h5V2.908c0-3.838 5.4-3.993 5.4.153v34.07h4.917V2.91c0-3.8 5.64-3.954 5.64.153V49.66zm43.08-35.96v97.36c0 11.587-16.183 11.416-16.183 0v-36.86h-8.617V13.72c0-18.2 24.8-18.2 24.8 0z"
id="path832"
inkscape:label="path832"
style="fill:#ffffff" />
<path
style="fill:#ffffff;stroke-width:0.148515"
d="m 35.75965,119.70455 c -2.816823,-0.7142 -4.93192,-2.8611 -5.854156,-5.94217 -0.251527,-0.84033 -0.269347,-2.40353 -0.312789,-27.438123 l -0.04606,-26.547029 -0.701538,-0.0022 C 28.459261,59.773828 27.720376,59.673066 27.20314,59.55113 23.518439,58.682481 20.695383,56.039726 19.432975,52.277226 L 19.084163,51.237622 19.044453,26.747772 19.004743,2.2579216 19.32235,1.6018334 c 0.745173,-1.53932121 2.837945,-1.99195874 4.21213,-0.91102495 0.21159,0.16643723 0.533217,0.58033045 0.714725,0.91976275 l 0.330015,0.6171496 0.0401,17.4876242 0.0401,17.487623 h 2.447526 2.447527 l 8.29e-4,-17.264851 c 5.82e-4,-12.1383146 0.04952,-17.4402544 0.164823,-17.8555627 0.216503,-0.7798476 1.08944,-1.6378724 1.884012,-1.85182857 1.466822,-0.39497415 2.955727,0.51034788 3.303187,2.00848917 0.0769,0.331548 0.13664,7.9896921 0.138655,17.7731591 l 0.0035,17.190594 h 2.521795 2.521798 L 40.133152,19.641087 40.173242,2.0792059 40.57956,1.388025 c 1.012231,-1.72189627 3.373154,-1.72189627 4.385385,0 l 0.406317,0.6911809 0.04009,17.5618811 0.04008,17.561881 h 2.521797 2.521796 V 19.725107 2.2472449 l 0.315022,-0.6507487 c 0.371597,-0.76761904 1.138527,-1.32052051 2.026293,-1.46081285 1.258043,-0.19880667 2.646541,0.7171588 2.996289,1.97659375 0.105699,0.3806183 0.156055,8.1850259 0.156616,24.2731729 8.91e-4,26.662325 0.0669,25.024253 -1.102512,27.376926 -1.140993,2.295496 -2.72925,3.906274 -4.91151,4.981147 -1.364895,0.672279 -2.648013,1.033705 -3.669817,1.033705 h -0.711372 l -0.0026,26.25 c -0.0028,28.082522 0.02371,27.025192 -0.72593,28.997522 -0.738679,1.9435 -2.753958,3.83278 -4.775067,4.47652 -1.238718,0.39454 -3.211307,0.48713 -4.330834,0.20328 z"
id="path994" />
</svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 855 B

View File

@@ -0,0 +1,2 @@
sample:
filter: true