Commit Graph

8 Commits

Author SHA1 Message Date
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
fc5fa67a56 Refactor Resolve and IEntity in SolutionContainerSystem (#5083)
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2021-11-02 12:03:23 +11:00
Ygg01
b2aca94586 Refactor Solution from Shared -> Server (#5078)
* Move entity solution entity systems to shared

* Move SolutionComponents to Server

* Fix namespaces

* Remove Networked Component.

* Fixes

* Add components to ignore list
2021-10-29 23:40:15 +11:00
Leon Friedrich
c19b32d2ee fix stomach bug (#4571) 2021-09-08 00:19:19 -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
Leon Friedrich
dbc90f202a Bug fixes for metabolisable reagents (#4385)
* HealthChangeMetabolism now scales with ticktime and metabolism rate

Both Food and Drink metabolisms scale with ticktime, Now HealthChangeMetabolism also does so.

Additionally, 'healthChange' now correctly scales with the metabolism rate, so it's description is now correct.

* LiverBehaviour now uses correct frameTime

Previously, the liver only metabolised reagants once every second, but incorrectly passes the current frameTime to the metabilism function, not 1 second.

* Stomach now only transfers non-empty solutions.

Makes debugging bloodstream bugs easier if the stomach is not constantly adding empty solution to it.

* Fixed StomachBehaviour using wrong SolutionContainerComponent

Stomach was using the first SolutionContainerComponent in the owner of the body, instead of the container in the owner of the mechanism (stomach). As a result, it used to use the BloodStreamComponent.Solution as a "Stomach".

* Update StomachBehavior.cs

Somach now checks if it still contains a reagant, before transferring it.

* Added argument to IMetabolizable.Metabolize()

Added availableReagent argument to IMetabolizable.Metabolize(), This ensures that this function does not over-metabolize a reagant, which can happen if tickTime*metabolismRate is larger than the available reagant

* Revert "Stomach now only transfers non-empty solutions."

This reverts commit 2a51e2d87e6e17ab76b48e5316ce501ec05ac061.

* Renamed _updateInterval to _updateIntervalSeconds

Also modified doc comment specifying units

* Fix spelling of healthChangeAmount

Changed from healthChangeAmmount to healthChangeAmount

* Fixed comment

comment used to mention _updateInterval, which has been renamed  _updateIntervalSeconds

* Fixed typo in comment

* fixed typos: reagant -> reagent

Most typos were just in comments.

* Make metabolizable classes inherit from DefaultMetabolizable

Also involved changing around IMetabolizable

* Renamed variables

metabolismAmount -> amountMetabolized

* Updated Comments in DefaultMetabolizable

Makes it clearer why DefaultMetabolizable works as it does, and that other classes depend on it.
2021-07-30 21:11:02 -07:00
Visne
b7dc3c81ae Remove redundant #nullable enable (#4275) 2021-07-16 17:37:09 -07:00
DrSmugleaf
ff1a2d97ea Re-organize all projects (#4166) 2021-06-09 22:19:39 +02:00