Commit Graph

15 Commits

Author SHA1 Message Date
Pieter-Jan Briers
c40ac26ced A big hecking chemistry-related refactor. (#3055)
* A big hecking chemistry-related refactor.

Changed SolutionContainerCaps. It now describes "stock" behavior for interacting with solutions that is pre-implemented by SolutionContainerComponent. As such things like syringes do not check it anymore (on themselves) to see "can we remove reagent from ourselves". That's assumed by it... being a syringe.

SolutionContainerCaps now has different flags more accurately describing possible reagent interaction behaviors.

ISolutionInteractionsComponent is the interface that describes the common behaviors like "what happens when injected with a syringe". This is implemented by SolutionContainerComponent but could be implemented by other classes. One notable example that drove me to making this interface was the /vg/station circuit imprinter which splits reagent poured in into its two reservoir beakers. Having this interface allows us to do this "proxying" behavior hack-free. (the hacks in /vg/ code were somewhat dirty...).

PourableComponent has been replaced SolutionTransferComponent. It now describes both give-and-take behavior for the common reagent containers. This is in line with /vg/'s /obj/item/weapon/reagent_containers architecture. "Taking" in this context is ONLY from reagent tanks like fuel tanks.

Oh, should I mention that fuel tanks and such have a proper component now? They do.

Because of this behavioral change, reagent tanks DO NOT have Pourable anymore. Removing from reagent tanks is now in the hands of the item used on them. Welders and fire extinguishers now have code for removing from them. This sounds bad at first but remember that all have quite unique behavior related to this: Welders cause explosions if lit and can ONLY be fueled at fuel tanks. Extinguishers can be filled at any tank, etc... The code for this is also simpler due to ISolutionInteractionsComponent now so...

IAfterInteract now works like IInteractUsing with the Priority levels and "return true to block further handlers" behavior. This was necessary to make extinguishers prioritize taking from tanks over spraying.

Explicitly coded interactions like welders refueling also means they refuse instantly to full now, which they didn't before. And it plays the sound. Etc...

Probably more stuff I'm forgetting.

* Review improvements.
2021-02-04 00:05:31 +11:00
py01
7bf80fd4b8 SolutionContainer refactors (#2954)
* removes unused method

* Code uncluttering (Also removed the netcode, color code, and visuals, need to rewrite)

* SolutionContainerVisualState

* Removes caching of SolutionContainer Color

* ChemicalsAdded() and ChemicalsRemoved() for updating appearance and handling reaction checks

* SolutionContainerComponentState

* Netcode

* ChemMasterComponent no longer creates a SolutionContainerComponent with new(), uses a Solution instead

* Enable nullable in SolutionContainer implementations

* Some review fixes

* uses IReadOnlyLists in ChemMaster

* Comments

* review fixes 3

* ReagentUnit documentation

* Review fixes

* spelling fix

* spelling 2

* typo

Co-authored-by: py01 <pyronetics01@gmail.com>
2021-01-10 19:41:55 +11:00
DrSmugleaf
fcd52fa90c Add ActionBlockerExtensions 2020-12-20 04:26:21 +01:00
DmitriyRubetskoy
9c26e0c5ba Async Interface IAfterInteract() (#2735)
* Async Interface

* Update Content.Server/GameObjects/Components/Fluids/MopComponent.cs

Co-authored-by: Paul Ritter <ritter.paul1@googlemail.com>

* Changed the glassbeaker

* Update Content.Shared/Interfaces/GameObjects/Components/Interaction/IAfterInteract.cs

Co-authored-by: Paul Ritter <ritter.paul1@googlemail.com>

* Update Content.Shared/Interfaces/GameObjects/Components/Interaction/IAfterInteract.cs

Co-authored-by: Paul Ritter <ritter.paul1@googlemail.com>

* Interaction system fix

* Removed I from the interface

* Changed all implementations of the interface I could find

* all public void implementation fixed

* All built, no errors should remain

* Update Resources/Prototypes/Entities/Objects/Specific/chemistry.yml

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>

* Update Content.Server/GameObjects/Components/Portal/TeleporterComponent.cs

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>

* Update Content.Server/GameObjects/Components/ActionBlocking/HandcuffComponent.cs

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>

* Commit based off Sloth's commentary

* Removed the Rag file from the PR

* Reverted sloth's commentary changes on the publcity of the function

* Injector component properly implemented interface

* Update Content.Server/GameObjects/Components/Fluids/MopComponent.cs

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>

* Update Content.Server/GameObjects/Components/Fluids/SprayComponent.cs

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>

Co-authored-by: BlueberryShortcake <rubetskoy234@mail.ru>
Co-authored-by: Paul Ritter <ritter.paul1@googlemail.com>
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
2020-12-17 18:45:04 +11:00
DrSmugleaf
1b1d050ee7 Update components to use EnsureWarn (#2676)
Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
2020-12-04 13:26:54 +01:00
Víctor Aguilera Puerto
484eb0bba4 Botany (#2357)
* plants and seeds go brrrr

* update plants

* P L A N T

* brrrr

* Hydroponics actually work! How about that?

* Reuse resource path in visualizer

* They lied to us.

* Several stuffs

* more werk

* Add a bunch of plants

* Logs go brr.

* Brrr moment.

* Remove unused method

* Important comment.

* Seed inventory, yo!

* tomato moment

* Balance consumption

* Makes hydroponics pourable

* Adds plant metabolism effect for sugar, the same as glucose.

* Eggplant moment

* Apple moment

* Corn moment

* Chanterelle mushroom moment

* prototype tweaks

* Seed extractor moment

* typo

* IPlantMetabolizable doc improvement

* I should trust my gut instinct more often.

* egg-plant.....

* localization

* Make WaterLevel and NutritionLevel setters private

* Less code repetition! Wooo!
2020-10-26 23:19:46 +01:00
Víctor Aguilera Puerto
4c34a12c67 Adds IThrowCollide, Creaming people with cream pies and tactical stun baton throws (#2122) 2020-09-22 15:34:30 +02:00
Víctor Aguilera Puerto
69059eac80 Adds new different reaction types. (#2114)
* Adds new different reaction types.
- Adds touch, injection and ingestion reactions for entities.
- Adds tile reactions.
- Removes GasSprayerComponent in favor of SprayComponent.
- Gives fire extinguishers a safety.
- Gives spray puffs a sprite.
- Improved spray and fire extinguisher in general.
- Fire extinguisher now ACTUALLY puts out fires. Amazing, eh?
- Fire extinguisher sprays three 'clouds' at once.
- Spraying flammable chemicals at fire makes them worse. Whoops!
- Gives spray and fire extinguisher their classic sounds.
- Most chemicals now don't make puddles. Too bad!
- Space lube now makes a very slippery puddle. Honk.
- Spraying water (or using a fire extinguisher) on existing puddles makes them bigger.

* Fix solution tests

* food base now has solution container with noexamine caps
2020-09-21 17:51:07 +02:00
nuke
753a627c75 Add text coloring for inspected solution containers, code cleanup (#2010)
* Initial commit

* remove helper

* fixes

* small fix
2020-09-10 00:32:31 +02:00
DrSmugleaf
48b61f6bcc Replace every usage of GridCoordinates with EntityCoordinates (#2021)
* Update RobustToolbox

* Transition direct type usages

* More updates

* Fix invalid use of to map

* Update RobustToolbox

* Fix dropping items

* Rename name usages of "GridCoordinates" to "EntityCoordinates"

* Revert "Update RobustToolbox"

This reverts commit 9f334a17c5908ded0043a63158bb671e4aa3f346.

* Revert "Update RobustToolbox"

This reverts commit 3a9c8cfa3606fa501aa84407796d2ad920853a09.

# Conflicts:
#	RobustToolbox

* Fix cursed IMapGrid method usage.

* GridTileLookupTest now uses EntityCoordinates

Co-authored-by: Víctor Aguilera Puerto <6766154+Zumorica@users.noreply.github.com>
Co-authored-by: Víctor Aguilera Puerto <zddm@outlook.es>
2020-09-06 16:11:53 +02:00
DrSmugleaf
8f9ed2f562 Replace usages of ISharedNotifyManager and IServerNotifyManager with extension methods (#1965)
* Replace usages of ISharedNotifyManager and IServerNotifyManager with extension methods

* Remove redundant code
2020-09-01 12:34:53 +02:00
DrSmugleaf
a4f527351e Add test for adding each component individually to an entity (#1870)
* Add test for adding each component individually to entities

* Put one-to-one test before all-at-once test
2020-08-24 13:39:00 +02:00
DrSmugleaf
b9196d0a10 Add a test that puts all components on an entity and checks for no exceptions (#1815)
* Add test that puts all components on an entity and checks for no exceptions

Also fix all the exceptions that happened because of this

* Add comments to the test

* Fix nullable errors

* Fix more nullable errors

* More nullable error fixes

* Unignore basic actor component

* Fix more nullable errors

* NULLABLE ERROR

* Add string interpolation

* Merge if checks

* Remove redundant pragma warning disable 649

* Address reviews

* Remove null wrappers around TryGetComponent

* Merge conflict fixes

* APC battery component error fix

* Fix power test

* Fix atmos mapgrid usages
2020-08-22 22:29:20 +02:00
DrSmugleaf
4a8ed41e3a Fix namespaces and optimize imports (#1651)
* Fix namespaces and optimize imports

* Cleanup fixes

* Merge conflict fixes

* Merge conflict fixes

* Merge conflict fixes
2020-08-13 14:40:27 +02:00
Exp
b4f08811eb Adds Spray Bottles (#1522)
* Spray Bottle

* -"Proper" wall detection
-Removed some using
-Fixed sound

* Just don't add it

* -Removed spill sound
-Added sound parameter to SpillHelper.SpillAt

* Now spawns Vapor instead of Puddles instantly

* -Review
-Nullable

* Reworkkkk

* AABB shittery

Co-authored-by: Víctor Aguilera Puerto <6766154+Zumorica@users.noreply.github.com>
2020-08-08 14:33:36 +02:00