Commit Graph

36 Commits

Author SHA1 Message Date
DrSmugleaf
00826aaad6 Replace usages of customTypeSerializer PrototypeIdListSerializer with something that doesn't take 20 separate words to type out (#37959)
* Replace usages of customTypeSerializer PrototypeIdListSerializer with something that doesn't take 20 separate words to type out

* Missed one

* Missed another

* Fix data field ids
2025-07-10 05:06:51 +02:00
Tayrtahn
948ecc8279 Fix solutions flickering when transferring contents (#34838)
* Use Solution clones when applying SolutionComponent states

* Revert "Use Solution clones when applying SolutionComponent states"

This reverts commit 013fd111cf92b22562e00f98a7aaa49bc4b4ed62.

* Make Solution implement ICloneable and rename Clone method.

* Copy CanReact value when cloning a Solution

* Convert to IRobustCloneable
2025-06-28 02:13:24 +02:00
blueDev2
c8f2ddc729 Add ReagentWhitelist to Injector component and system (#28262)
* Add reagent whitelist to Injector component and system

* Apply suggested Changes

* Remove LINQ function for performance

* Update Content.Server/Chemistry/EntitySystems/InjectorSystem.cs

Co-authored-by: Ed <96445749+TheShuEd@users.noreply.github.com>

---------

Co-authored-by: Ed <96445749+TheShuEd@users.noreply.github.com>
2024-09-12 13:29:11 +03:00
metalgearsloth
a89d4c750b Power stuff (#31314)
* Power stuff

- Add shared IsPowered
- Add shared ResolveApc
- Move PowerChangedEvent to shared for now
- Add SlimPoweredLight that actually functions how you'd expect a PoweredLight to function it id didn't have a bunch of bloat on it.

* big update

* boing
2024-08-25 22:18:42 +10:00
SlamBamActionman
49dd17dcab Fix reagents with ReagentData being duplicated (#30983)
Initial commit
2024-08-16 12:47:53 +02:00
SlamBamActionman
07174d0aaf Better DNA forensics & ReagentData (#26699)
* Added the ability for blood to track DNA using ReagentData; Forensic Scanner now accounts for solution DNA, non-DNA holders have "Unknown DNA"

* Removes touch DNA for puddles, adds DNA to vomit

* DNA now leaves traces in containers and those marked without don't show DNA on scan (except for puddles), gibbed parts have DNA

* Fix stupid metamorphic glass bug grrr

* Removed SpillableComponent since DnaSubstanceTraceComponent is used instead

* Removes data field from maps, adds DNA tracking for some missed items

* Give default value, fix missing values.

* Fixes recipe bug

* Review changes

* Make the Data list into a nullable type

* Revert map changes

* Move gibbed unknown DNA to forensicssystem
2024-08-09 09:27:27 +10:00
Verm
089c9cb967 You can bless more containers with a bible (#26526)
* Made more things blessable

* Removed junk

* Remove whatever that was

* Make bowls blessable

* New mixablesolution component, converted everything to work with it

* Fix minor mishaps

* Fix extra spaces in bottle yml

* Fix last extra space, fix bottle havign the wrong solution name

* Remvoe unneeded event(I think), fix alcohol bottles not being mixable

* I missed cans
2024-04-20 16:16:55 +10:00
Pieter-Jan Briers
33611b7094 Solution precision fixes (#25199)
* Add test for two chemistry issues

1. rounding issue with reaction processing when making chloral hydrate
2. reliable assert trip due to the ValidateSolution() heat capacity issue.

* Fix FixedPoint2 arithmetic

Fix internal floating point arithmetic in places where it could be avoided.

Fix incorrect rounding mode used in other places (it should always floor, like regular int arithmetic).

I had to add an explicit epsilon value for float -> FixedPoint2 because something like 1.05 is actually like 1.04999 and that'd cause it to be rounded down to 1.04.

This fixes reaction reagent processing in cases where the reagent inputs can't cleanly divide. Previously, when making 30u chloral hydrate by adding the chlorine in 10u increments you'd end up with 0.04 chlorine left over. This was caused by division in the reaction code rounding up in some cases. Changing division here to always round down fixes it.

* Attempt to fix heat capacity precision assert issues.

Fixes #22126

First, we just increase the tolerance of the assert. It was way too low.

Second, actually put a cap on float drift from one-off _heatCapacity changes.

* Fix float -> FixedPoint2 epsilon for negative number, fix tests.

* Fix DamageableTest

* Oh yeah I need to call CleanReturnAsync
2024-02-16 16:54:27 -07:00
Skye
fbe72c848a ChemMaster buffer preserves list ordering (#23352)
ChemMaster now maintains list order on reagent removal
2024-01-02 10:51:21 -05:00
TemporalOroboros
d23c8d5c19 Revert 'Revert 'Solution Entities'' (#23168) 2023-12-29 08:47:43 -04:00
Emisse
938d6d9945 Revert "Solution Entities" (#23160)
Revert "Solution Entities (#21916)"

This reverts commit d75e743dd7.
2023-12-28 20:45:42 -07:00
TemporalOroboros
d75e743dd7 Solution Entities (#21916)
* Creates Content.Shared.Chemistry.Solutions
Copies Solution class to new namespace
Obsoletes old Solution class

* Switches over to the Solutions.Solution Solution

* Creates Content.Shared.Chemistry.Containers
Copies relevant components/systems to the new namespace
Obsoletes old versions

* Switches over to the Containers.XYZ namespace

* Creates SolutionSystem and obsoletes old SolutionContainerSystem methods

* Start using SolutionSystem for Solution manipulation

* EnumerateSolutions

* Move TryGetMixableSolution

* Move EnsureSolution to Server

* Create Solution Entities

* Stop using obsolete solution system methods

* Fix prototype component tests

* Add using ..Audio.Systems; back

* Wrap solution container slots in ContainerSlots

* Actually add the slot to the solution container map

* Dirty SolutionContainerComponent when ensuring solutions

* Revert namespace changes

* Remerge SolutionSystem and SolutionContainerSystem

* SolutionContainerManagerComponent refactor

* Avoid wrapping necessary code in DebugTools.Assert as it is removed when compiling for release

* Readd examine reagent sorting

* Fix errors

* Poke tests

* Fix solution names not being applied

* Fix WoolyComponent including statement

* Fix merge skew

* Fix compile errors

* Make reactions use solntities

* Reindent solution class namespace

* Field attribute changes

* AutoGenerateComponentState for SolutionContainerComponent

* SolutionContainerComponent -> ContainedSolutionComponent

* ref ReactionAttemptEvent

* Denetwork preinit solutions

* Misc 1

* Nullable TryGetSolution out vars

* Cache associated solutions

* Fix merge skew

* Use explicit regions in SharedSolutionContainerSystem.Capabilities

* Add debug assert

* Use explicit regions in SharedSolutionContainerSystem.Relay + ref SolutionContainerChangedEvent

* ContainedSolutionComponent.Name -> ContainedSolutionComponent.ContainerName

* SolutionComponent doc comments

* Implicit DataField names and property purge

* ReagentEffect DataField names

* Local variables for readability

* Sort using statements + Entity<T> event handlers

* Fix compile erros

* Fix compile errors

---------

Co-authored-by: ElectroJr <leonsfriedrich@gmail.com>
2023-12-28 17:58:14 -08:00
Leon Friedrich
c9e2a91f13 Fix ghost FOV bug (#21614) 2023-11-13 05:36:00 +11:00
Psychpsyo
6a18bdc023 Soapy Water & Edible Soap (#20364)
* soap reagent and soapy water

* make soapy water recognizable

* Fix tile cleaning bug

CleanDecalsReaction was able to take more than the reactVolume it was given.

* make soapy water an evaporating reagent

* Tile reactions when mopping

* Fix indescribably soap flavor

* Adjust soap flavours

Soap and soapy water now taste clean and syndie soap tastes like punishment.

* Better soap numbers & DeleteOnSolutionEmpty

* Changed TrashOnEmpty to TrashOnSolutionEmpty

* Last TrashOnSolutionEmpty change

* Fix merged code not compiling

* Requested changes.
2023-10-31 13:39:12 -07:00
Leon Friedrich
e4ca6f4fb9 Allow solutions to store extra reagent data (#19323) 2023-09-05 07:55:10 +10:00
DrSmugleaf
a88e747a0b Refactor serialization copying to use source generators (#19412) 2023-08-22 18:14:33 -07:00
Leon Friedrich
385b587cfc Validate prototype ids in c# fields (#18224) 2023-07-30 03:34:51 +10:00
Leon Friedrich
0c4002bbd3 Make Reactions conserve thermal energy (#16190) 2023-05-13 13:10:32 +10:00
EnDecc
0f90548600 Advanced Mop is now More Advanced + SolutionPurge Component (#15532)
Co-authored-by: Arimah <arimah42@gmail.com>
2023-04-23 20:17:21 +10:00
metalgearsloth
317a4013eb Puddles & spreader refactor (#15191) 2023-04-10 15:37:03 +10:00
Leon Friedrich
c3e6ac2563 Fix ScaleSolution() (#13630) 2023-01-22 01:35:12 +11:00
Visne
c6d3e4f3bd Fix warnings and code cleanup/fixes (#13570) 2023-01-19 13:56:45 +11:00
Leon Friedrich
466384b081 Solution rejig (#12428) 2023-01-12 14:41:40 +11:00
DrSmugleaf
7fbc2608e8 Remove redundant read-only VV from datafields (#12626) 2022-11-16 20:22:11 +01:00
metalgearsloth
600c0e3255 Fix a few warnings (#11576) 2022-10-04 14:24:19 +11:00
wrexbe
bc68ac96dd Cleanup the namespaces (#8132) 2022-05-13 17:59:03 +10:00
Leon Friedrich
66b0820ed6 Fix smoke fork bomb (#7401) 2022-04-04 11:02:33 -05:00
Vera Aguilera Puerto
46ac70a734 Fix and refactor SolutionContainerSystem.RemoveEachReagent (#7245) 2022-03-24 00:05:10 +11:00
mirrorcult
ec4d4688c7 Seal/abstract/virtual everything (#6739) 2022-02-16 18:23:23 +11:00
Pieter-Jan Briers
992576509a Fix bad analysis with nullables in Rider. 2021-12-30 16:28:52 +01:00
TemporalOroboros
201952e618 Adds temperature to solutions (#5834) 2021-12-24 02:22:34 -07:00
Leon Friedrich
9cbcbae82d fix split solution (#5497) 2021-11-24 22:16:06 -07:00
mirrorcult
e40c9bc427 Reactive 3.0 (#5443)
* probably scrapping this

* reimpl old behavior

* misc fixes and initial yaml

* works basically first try
2021-11-22 10:17:35 +01:00
Vera Aguilera Puerto
1a177f7479 DrinkSystem uses EntityUid instead of IEntity 2021-11-09 11:28:27 +01:00
mirrorcult
3ab4a30a0f Generalize ReagentUnit into FixedPoint2 and use it for damage calculations (#5151)
* Damage units

* sum ext method
2021-11-03 16:48:03 -07:00
Ygg01
c209e3f29b Solution refactor (#4407)
* Rename SolutionContainerCaps -> Capability

* Move IExamine event to Chemistry System.

* ECS the ISolutionChange into SolutionChangeEvent

* Unify SolutionContainer into a single shared component

* Replace ISolutionInteraction with SolutionContainerComponent

* Move all methods from SolutionContainer to ChemistrySystem

* Refactor EntitySystem calls to Dependencies

* Refactor SolutionContainer to SolutionManager

* Fix yamls

* Fix test fails

* Fix post merge issues

* Fix various issues with SolutionManager

* More fixes

* Fix more components

* Fix events not being directed

* Fixes for Hypospray

* Separate removal and iteration on Metabolism

* Fix creampie problems

* Address some of sloth's issues

* Refactors for Systems

* Refactored solution location

* Fix tests

* Address more sloth issues

* Fix dependency

* Fix merge conflicts

* Add xmldocs for Capabilities components

* Remove HasSolution/TryGetDefaultSolution and Add/Remove Drainable/Refillable

* Replace Grindable/Juiceable with Extractable

* Refactor field names

* Fix Drainable

* Fix some issues with spillable and injector

* Fix issues with Grinder

* Fix Beaker having duplicate solutions

* Fix foaming

* Address some MGS issues

* Fix Uid issues

* Fix errors in solution Tranfer

* Fixed some extra values constant values

* Cola is drinkable now
2021-09-06 23:49:44 +10:00