Skip to content
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

Adds fractional condensers #16654

Merged
merged 12 commits into from Nov 14, 2023
Merged

Conversation

TDHooligan
Copy link
Contributor

@TDHooligan TDHooligan commented Oct 26, 2023

[CHEMISTRY] [FEATURE] [WIKI]

About the PR

Adds a new kind of condenser - The fractional condenser.
image
Sprites by Flaborized

Instead of evenly distributing reaction outputs between connected beakers, the fractional condenser has a unique connection for each beaker, up to 4 total.
Yellow -> Red -> Green -> Blue

When a reaction occurs, the reaction results are distributed down the appropriate condenser tube:

Acetone + Phenol
Yellow -> Red

Backflow is done per-tube, so if Red is leading to a full beaker, all products going down red will backflow into the condenser.

TECHNICAL:
This adds a new line drawing method, due to a bug in filter transforms. It functionally looks the same as before but avoids an issue (discord) that causes clipping. The downside is that it doesn't work with 'source caps' due to how it scales sprites to make properly sized end-caps.

It also adds an explicit ordering to additional chemicals being added by reactions.

Why's this needed?

In the short term: People don't like the acetone/phenol split at the minute.

Long term: I think this is a good step towards incentivising larger setups. We can create reactions where expensive reagent could actually be recovered and re-used. etc.

Changelog

(u)TDHooligan + Flaborized
(*)Chemistry now has a fractional condenser. Split acetone reactions etc.

@keywordlabeler keywordlabeler bot added A-Chemistry Deals with the chemistry system in some way C-Feature A new feature or enhancements to existing features labels Oct 26, 2023
@boring-cyborg boring-cyborg bot added the C-Sprites Automatically applied on any .dmi or icons folder change label Oct 26, 2023
@github-actions github-actions bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 26, 2023
@@ -94,6 +94,20 @@ Returns:
I.filters += filter(type="layer", render_source = (islist(render_source_cap) ? pick(render_source_cap) : render_source_cap), transform=M2)
I.transform = UNLINT(matrix().Turn(-angle).Translate((dist),0).Turn(angle))
result.lineImage = I
else if(mode == LINEMODE_STRETCH_NO_CLIP)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could this be turned into a switch statement instead? a suggestion

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could be. im not really fussed though as the end result wont be something like a nice, compact C# switch, it's still going to be huge

@M-Earthfire
Copy link
Contributor

M-Earthfire commented Oct 27, 2023

Personally, i think this should not be avaible in chemistry at round start. This is a very clear upgrade over the condenser in most applications.

Chemical reactions spitting out byproducts or secondary outputs is a very intentional complication in the chemistry system and solving this via an item that is avaible at roundstart sounds like a bad idea. Especially if we want to add recipes later that create more high quality byproducts in the future.

Besides that, i like the idea of it.

@TDHooligan
Copy link
Contributor Author

TDHooligan commented Oct 27, 2023

Personally, i think this should not be avaible in chemistry at round start. This is a very clear upgrade over the condenser in most applications.

counterpoint:
as far as i have heard, nobody likes the acetone/phenol reaction as is.

everyone will use the one you start with for this. where it incentivises acetone/phenol to become part of a condenser chain.

code/WorkInProgress/actuallyKeelinsStuff.dm Show resolved Hide resolved
code/modules/chemistry/Chemistry-Tools.dm Outdated Show resolved Hide resolved
code/modules/chemistry/Chemistry-Tools.dm Outdated Show resolved Hide resolved
code/modules/chemistry/Chemistry-Tools.dm Outdated Show resolved Hide resolved
@keywordlabeler keywordlabeler bot added the E-Add-To-Wiki A PR that will require changes to the wiki label Oct 28, 2023
@@ -710,6 +710,7 @@ proc/ui_describe_reagents(atom/A)
desc = "A set of glass tubes useful for seperating reactants from products. Can be hooked up to many types of containers."
icon = 'icons/obj/chemical.dmi'
icon_state = "condenser"
var/fluid_prefix = "condenser"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doc comment this pls

disposing()
src.remove_container()
. = ..()

fractional
max_amount_of_containers = 4
var/container_order[4]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doc comment pls

UnregisterSignal(container, COMSIG_MOVABLE_MOVED)
container_order[i] = FALSE

add_container(var/obj/container)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs to either check for or handle two outputs being connected to the same target, currently just runtimes

@github-actions github-actions bot added the S-Merge-Conflict Applied and removed when a PR has or no longer has a merge conflict label Nov 7, 2023
@github-actions github-actions bot removed the S-Merge-Conflict Applied and removed when a PR has or no longer has a merge conflict label Nov 8, 2023
@Tarmunora Tarmunora removed their request for review November 8, 2023 19:32
@TobleroneSwordfish TobleroneSwordfish merged commit 0577ce1 into goonstation:master Nov 14, 2023
21 checks passed
github-actions bot pushed a commit that referenced this pull request Nov 14, 2023
@TDHooligan TDHooligan deleted the condenser2 branch March 23, 2024 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Chemistry Deals with the chemistry system in some way C-Feature A new feature or enhancements to existing features C-Sprites Automatically applied on any .dmi or icons folder change E-Add-To-Wiki A PR that will require changes to the wiki size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants