-
Couldn't load subscription status.
- Fork 4.7k
[Re-open] Botany Rework Part 2: GrowthComponents #39311
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
base: master
Are you sure you want to change the base?
Conversation
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.
Partial review.
| [DataField] | ||
| public float SwabDelay = 2f; |
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.
timespan pls.
| private void OnPlantGrow(EntityUid uid, AtmosphericGrowthComponent component, OnPlantGrowEvent args) | ||
| { |
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.
Use Entity<T> typing
| private void OnSwab(EntityUid uid, BasicGrowthComponent component, BotanySwabDoAfterEvent args) | ||
| { |
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.
Same here.
| private void OnPlantGrow(EntityUid uid, BasicGrowthComponent component, OnPlantGrowEvent args) | ||
| { |
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.
And here.
| private void OnPlantGrow(EntityUid uid, ToxinsComponent component, OnPlantGrowEvent args) | ||
| { |
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.
Here too.
| private void OnPlantGrow(EntityUid uid, UnviableGrowthComponent component, OnPlantGrowEvent args) | ||
| { |
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.
Here.
| private void OnPlantGrow(EntityUid uid, WeedPestGrowthComponent component, OnPlantGrowEvent args) | ||
| { |
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.
And here.
| private void OnTrayUpdate(EntityUid uid, PlantHolderComponent component, OnPlantGrowEvent args) | ||
| { |
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.
Here as well.
| if (!TryComp<PlantTraitsComponent>(entity, out var traits)) | ||
| return; | ||
|
|
||
| traits.Potency = Math.Max(traits.Potency + args.Effect.Amount, 1); |
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.
Should probably be tied to an API method rather than having the data in here.
After thinking about it and referring to the author's original design (space-wizards/docs#284), I think that fixing it now will only make the situation worse in the future or require a much larger refractor than planned in this PR. When plants become independent entities, all this will no longer be necessary, the components will simply be located in their |
|
If this PR is merged, I will finish refactoring the rest of it in other PR. |
Leave some remarks in the file then explaining your reasoning as to why it exists, as well as a TODO that properly explains what needs to change before the file can be deleted. |
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.
One small step towards usable botany code. Still needs another approval, and I'd also give this a full 2 weeks of testing due to size.
|
By the way, regarding testing, the growth was a little broken, but it should be back to normal now. Everything else seems to be working as before. 😅 |
About the PR
Attempting to resurrect and finalize (to the best of my ability) #31461, by design document Botany Rewrite proposal
Thank you for your contribution @drakewill-CRL
Technical details
«
This includes making components and systems for the logic around water, nutrients, toxins, pests, gases consumed or exuded, tolerance for light/pressure/ heat, and auto-harvesting.
In the future, plants will be able to have different needs for growth, (EX: a cactus may not check for water, or space-plants may be dependent on special chemicals being present) and different effects can happen on a growth tick without hard-coding more checks into PlantHolderSystem. This also opens up possibilities to mutate these needs off of, or onto, other plants. In particular, a future-state plan for mutations requires plants to be able to consume plasma gas to start acquiring stronger mutations, and that will be its own growth component to trigger that change.
In the process of coding this, the following stats were removed: LightTolerance/Ideal Light (Unused and possibly unmeasureable).
»
Requirements
Breaking changes
Changelog
Shouldn't affect gameplay in any way!