-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LogSystem/SharpSystem replaced by SliceableSystem/ButcherableSystem, etc. #34851
base: master
Are you sure you want to change the base?
LogSystem/SharpSystem replaced by SliceableSystem/ButcherableSystem, etc. #34851
Conversation
…d a SharpComponent.cs changed to use ToolQuality Slicing...
…tems # Conflicts: # Content.Server/Botany/Systems/LogSystem.cs
I'll deal with the Sliceable arbitrage test fail and write tests for the Sliceable and Butcherable systems |
so the new test fail is complaining that the large pizza box order comes with 15 pizzas, each with their own plastic knife, which can count towards the new knife bounty since it's only checking for a knife tag what do I do about that make the knife bounty way cheaper? |
I just increased the amount of knives until the test stopped complaining. Good to review at this point. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly good, minor style nitpicks. Keep in mind that EntitySystems in Shared also need their Client/Server parts, even if they don't have a body yet. So you should rename the ButherableSystem
to SharedButcherableSystem
, and then make a dummy EntitySystem in both Client and Server that will extend it. Same for SliceableSystem
.
|
||
public sealed class ButcherableSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly INetManager _net = default!; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the System
part from all these, it shouldn't be used for dependencies. Sort it alphabetically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this style convention be added to the conventions doc page?
https://docs.spacestation14.com/en/general-development/codebase-info/conventions.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At some point in the near future yes, many parts of the the conventions are pending rewrite.
They only need the Client/Server parts if the Shared system is abstract, requiring the dummy implementation on both Client and System. Similarly, they don't need the Shared prefix since they only exist in Shared. Good catches on some of the other reviews, thanks for them. |
Yup, I was told that all EntitySystems in Shared should be abstract a long time ago and didn't really question it, but after checking with other maintainers, you're right on those. |
About the PR
I wanted to work towards this issue #28141 when I realized how deep I had to go to fix this, so I haven't actually touched SliceableFoods yet.
LogComponent
andLogSystem
in Content.Server replaced by more genericSliceableComponent
andSliceableSystem
in Content.SharedSharpComponent
replaced byToolComponent
and the "Slicing"ToolQualityPrototype
and all instances of it replaced as suchSharpSystem
in Content.Server replaced byButcherableSystem
in Content.SharedLogComponent
andLogSystem
's entire purpose was just "if sharp object used, spawn these items". Sliceable does the same but in shared. I wanted to merge Sliceablefoods into it, but considering the current amount of changed files, I chose not to do that yet.SharpComponent
had a TODO saying to just make it a tool type. I deleted the SharpComponent and replaced every instance of it by adding theToolComponent
with the "Slicing" quality. When code checked for the presence of theSharpComponent
, I checked for theToolComponent
and the "Slicing"ToolQualityPrototype
instead.SharpSystem
, despite the name being quite generic, was used solely for the do-after and verbs related to butchering. I moved this all to theButcherableSystem
in Content.Shared instead, along with any changes required to make it not use theSharpComponent
.Why / Balance
LogComponent isn't generic enough, and SliceableFood should be merged into the new Sliceable stuff after this PR to address #28141
SharpComponent had a TODO comment saying it didn't need to be a component, could just be a tool quality. So I did that.
Technical details
SharpComponent
deleted, replaced byToolComponent
with the "Slicing"ToolQualityPrototype
. This is most of the yml changes.SharpComponent
replaced by a check forToolComponent
and using theSharedToolSystem
to check if theToolComponent
has the "Slicing"ToolQualityPrototype
.SharpSystem
in Content.Server replaced byButcherableSystem
in Content.Shared. This makes the butcher verb predicted. Spawning and deletion of entities are only run on the server.SharpSystem
AfterInteractEvent subscription changed toButcherableSystem
InteractUsingEvent subscription. Previously, the knife checked if it interacted on a butcherable target. Now, the butcherable target checks if it was interacted with by a slicing tool.LogComponent
andLogSystem
in Content.Server replaced bySliceableComponent
andSliceableSystem
in Content.Shared. Spawning and deletion of entities are only run on the server.UseTool()
from theSharedToolSystem
.Media
ButcherableSystem function + verb prediction and ToolQuality description:
2025-02-03.00-48-08.mp4
SliceableSystem function + Botany planter function:
2025-02-03.00-51-20.mp4
Requirements
Breaking changes
LogComponent and LogSystem have been removed and replaced by SliceableComponent and SliceableSystem.
SharpComponent has been removed and replaced by the usage of ToolComponent with a "Slicing" quality.
SharpSystem has been removed and replaced by the ButcherableSystem.
Changelog
🆑