Commit Graph

42 Commits

Author SHA1 Message Date
DrSmugleaf
9db47249cd Fix being able to spill closed drink cans (#3100) 2021-02-07 00:31:44 +11:00
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
Pieter-Jan Briers
85fcf7290c Clean up terrible solution entity reaction copy pasta. 2021-01-23 16:49:22 +01:00
mirrorcult
7977992e5a Add kitchen knife & sliceable foods (#2891)
* sliceable food, kitchen knives

* sprite fixes, sounds

* add to vendor

* address reviews

* address reviews

* stereo -> mono

* fix wrong amount of nutriment being removed

* oops im dumb

* meta.json

* fix merge

* probably fix test

* remove all instances of [ComponentReference(typeof(IAfterInteract))]

Co-authored-by: cyclowns <cyclowns@protonmail.ch>
2021-01-07 12:48:08 +11: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
6b4a39006e Make mechanism behaviors properly update, fix eating and drinking (#2472)
* Make mechanisms properly update and fix eating and drinking

* Remove outdated component ignores

* Fix nullable error

* Fix mechanism behavior events

* Remove unnecessary code
2020-11-02 11:37:37 +01:00
DrSmugleaf
101fa9e466 Fix mechanism events not being called properly, add test (#2279)
* Add mechanism events when added/removed to/from body/parts

* Change old usages

* Add TODO

* Remove BodyExtensions and IHasBody

* Remove unnecessary extensions and fix wrong event call in mechanism behavior component

* Complete test and fix event calls
2020-10-17 12:26:39 +02:00
DrSmugleaf
dd385a0511 Change all of body system to use entities and components (#2074)
* Early commit

* Early commit 2

* merging master broke my git

* does anyone even read these

* life is fleeting

* it just works

* this time passing integration tests

* Remove hashset yaml serialization for now

* You got a license for those nullables?

* No examine, no context menu, part and mechanism parenting and visibility

* Fix wrong brain sprite state

* Removing layers was a mistake

* just tear body system a new one and see if it still breathes

* Remove redundant code

* Add that comment back

* Separate damage and body, component states, stomach rework

* Add containers for body parts

* Bring layers back pls

* Fix parts magically changing color

* Reimplement sprite layer visibility

* Fix tests

* Add leg test

* Active legs is gone

Crab rave

* Merge fixes, rename DamageState to CurrentState

* Remove IShowContextMenu and ICanExamine
2020-10-10 15:25:13 +02:00
Víctor Aguilera Puerto
4eb5891c4a Adds missing reactions to chemical stuff.
- Adds ingestion reaction for food, drinks, and pills.
- Adds injection reaction for syringes.
2020-09-26 14:48:24 +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
Exp
5120627ca2 Makes more fields VV (#2026)
* Some more VV

* Fixed build & some more gun vvs

* Added VendingMachine Inventory & Items
2020-09-08 13:30:22 +02:00
DrSmugleaf
61f64e15f2 Add extensions for spilling solutions into puddles (#1991) 2020-09-02 01:16:25 +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
8a27a5322a Replace pragma warning 649 disable/restore with default! 2020-08-24 14:10:28 +02:00
metalgearsloth
72e50cce94 AI pickup changes (#1811)
* AI pickup changes

Eating and drinking isn't spammed anymore.
AI can do InRangeUnobstructed checks for item pickups.
AI can open drink cans.

AI littering to be coded.

* #nullable enable

* github's nullable fails are actively shortening my lifespan

* Use a const instead

So it's easier to find given the performance implications.

Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
2020-08-22 12:03:24 +02:00
DrSmugleaf
b051261485 Bodysystem and damagesystem rework (#1544)
* Things and stuff with grids, unfinished w/ code debug changes.

* Updated submodule and also lost some progress cause I fucked it up xd

* First unfinished draft of the BodySystem. Doesn't compile.

* More changes to make it compile, but still just a framework. Doesn't do anything at the moment.

* Many cleanup changes.

* Revert "Merge branch 'master' of https://github.com/GlassEclipse/space-station-14 into body_system"

This reverts commit ddd4aebbc76cf2a0b7b102f72b93d55a0816c88c, reversing
changes made to 12d0dd752706bdda8879393bd8191a1199a0c978.

* Commit human.yml

* Updated a lot of things to be more classy, more progress overall, etc. etc.

* Latest update with many changes

* Minor changes

* Fixed Travis build bug

* Adds first draft of Body Scanner console, apparently I also forgot to tie Mechanisms into body parts so now a heart just sits in the Torso like a good boy :)

* Commit rest of stuff

* Latest changes

* Latest changes again

* 14 naked cowboys

* Yay!

* Latest changes (probably doesnt compile)

* Surgery!!!!!!!!!~1116y

* Cleaned some stuff up

* More cleanup

* Refactoring of code. Basic surgery path now done.

* Removed readme, has been added to HackMD

* Fixes typo (and thus test errors)

* WIP changes, committing so I can pull latest master changes

* Still working on that god awful merge

* Latest changes

* Latest changes!!

* Beginning of refactor to BoundUserInterface

* Surgery!

* Latest changes - fixes pr change requests and random fixes

* oops

* Fixes bodypart recursion

* Beginning of work on revamping the damage system.

* More latest changes

* Latest changes

* Finished merge

* Commit before removing old healthcode

* Almost done with removing speciescomponent...

* It compiles!!!

* yahoo more work

* Fixes to make it work

* Merge conflict fixes

* Deleting species visualizer was a mistake

* IDE warnings are VERBOTEN

* makes the server not kill itself on startup, some cleanup (#1)

* Namespaces, comments and exception fixes

* Fix conveyor and conveyor switch serialization

SS14 in reactive when

* Move damage, acts and body to shared

Damage cleanup
Comment cleanup

* Rename SpeciesComponent to RotationComponent and cleanup

Damage cleanup
Comment cleanup

* Fix nullable warnings

* Address old reviews

Fix off welder suicide damage type, deathmatch and suspicion

* Fix new test fail with units being able to accept items when unpowered

* Remove RotationComponent, change references to IBodyManagerComponent

* Add a bloodstream to humans

* More cleanups

* Add body conduits, connections, connectors substances and valves

* Revert "Add body conduits, connections, connectors substances and valves"

This reverts commit 9ab0b50e6b15fe98852d7b0836c0cdbf4bd76d20.

* Implement the heart mechanism behavior with the circulatory network

* Added network property to mechanism behaviors

* Changed human organ sprites and added missing ones

* Fix tests

* Add individual body part sprite rendering

* Fix error where dropped mechanisms are not initialized

* Implement client/server body damage

* Make DamageContainer take care of raising events

* Reimplement medical scanner with the new body system

* Improve the medical scanner ui

* Merge conflict fixes

* Fix crash when colliding with something

* Fix microwave suicides and eyes sprite rendering

* Fix nullable reference error

* Fix up surgery client side

* Fix missing using from merge conflict

* Add breathing

*inhale

* Merge conflict fixes

* Fix accumulatedframetime being reset to 0 instead of decreased by the threshold

https://github.com/space-wizards/space-station-14/pull/1617

* Use and add to the new AtmosHelpers

* Fix feet

* Add proper coloring to dropped body parts

* Fix Urist's lungs being too strong

* Merge conflict fixes

* Merge conflict fixes

* Merge conflict fixes

Co-authored-by: GlassEclipse <tsymall5@gmail.com>
Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
Co-authored-by: AJCM-git <60196617+AJCM-git@users.noreply.github.com>
2020-08-16 16:42:42 -07: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
c61e6d541b Moves ExamineSystem to Shared & adds next step info to construction examine (#1567) 2020-08-01 17:37:12 +02:00
DrSmugleaf
989025b222 Add drink atmos (#1434) 2020-07-23 01:42:09 +02:00
Acruid
ea94f4a182 Moved interaction interfaces from Server to Shared. 2020-07-18 22:51:56 -07:00
AJCM-git
ae41d03ec6 Re-organizing the Resources folder. Part 1. (#1234)
* First commit

* Lockers

* Lockers electric boogaloo

* Crates and Lockers

* Almost finishing the Textures folder

* Updating texture paths. Reminder to fix:
* Lockers
* Windows
* Vending Machines
* APC
* Catwalks
* Bedsheets and Cloaks
* Status effects

* dont know what happened here

* Commit before merge

* re-organizing

* Lockers broken

* Commit before merge

* Submodule

* renaming

* Fixing most issues

* forgot these ones

* Updating submodule

* typo

* Fixing some paths

* fixing some paths

* updating submodule

* (hopefully) fixing the submodule
2020-07-07 19:19:00 +02:00
chairbender
b35333d366 Click Drag Functionality + Refactor Interaction Interfaces (#1125)
Co-authored-by: Víctor Aguilera Puerto <6766154+Zumorica@users.noreply.github.com>
Co-authored-by: ComicIronic <comicironic@gmail.com>
Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
2020-07-06 23:27:03 +02:00
ike709
a4ced5f1fc Fixes being able to drink a closed drink (#1257) 2020-07-03 23:26:13 +02:00
Memory
21c41f28ed Refactor all references to AudioSystem functions now that the old ones are obsolete. (#1081)
Co-authored-by: FL-OZ <anotherscuffed@gmail.com>
2020-06-07 15:55:15 +02:00
Remie Richards
2e38c194f7 IExamine can now limit certain details behind a 'details' range check. (#1039)
* IExamine can now limit certain details behind a 'details' range check.

* Comic's Review fixes.
- colour -> color. My ancestors are saddened by this.
- Can see wire panel opened/closed at any distance again.
2020-05-31 20:29:06 +02:00
FL-OZ
a295d205b1 Drink fixes part 2 eclectic boogaloo (#1052)
* Drink fixes part 2 eclectic boogaloo

* NOT THE NNEWLINES

* oops

Co-authored-by: FL-OZ <anotherscuffed@gmail.com>
2020-05-31 19:47:46 +02:00
FL-OZ
aa26bdfcae Rework Drink/Food/FoodContainer entirely (#1009)
Co-authored-by: FL-OZ <anotherscuffed@gmail.com>
Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
2020-05-29 22:50:23 +02:00
Clyybber
1ad9a10050 Fix #274 (#927) 2020-05-23 17:23:25 +02:00
chairbender
6a4d78cfac Add interaction checks to all interactions (#923) 2020-05-23 11:27:31 +02:00
FL-OZ
1e183ca5a8 GLOBAL SLUUUUURRRRP 2020-05-22 16:23:18 -05:00
Pieter-Jan Briers
8e91215d6f Fix exception in drink food visualizer. 2020-04-25 14:40:57 +02:00
metalgearsloth
60ce5b5089 Add puddles / reagent spills (#743) 2020-04-21 20:23:12 +02:00
PrPleGoo
7d72e672fd Merge branch 'master' into DecimalReagents 2020-04-12 14:37:36 +02:00
Injazz
4174891c87 some fixes
removes unused interface from DrinkComponent
adds capability to fit inside dispensers for TransformableContainer
removes stomach component from character setup dummy
2020-04-08 17:12:00 +05:00
Injazz
d400f77129 Chemistry revamp and bartending features
-Ability to mix drinks to create cocktails with shiny icons
-New Chemistry System which can relay chemistry events to corresponding components
-moved some solution logic from Shared to Server
-fixed some weird stuff with DrinkComponent
2020-04-08 15:53:15 +05:00
PrPleGoo
4e0242d47c Replace decimal with ReagentUnit 2020-04-05 11:36:12 +02:00
PrPleGoo
f05fdfb5fc Changed all int and some float things in Reagent code to Decimals 2020-03-14 12:55:07 +01:00
ShadowCommander
cf78f8aa65 Drink fixes (#605)
* Fix max_volume in cup YAML

Fixes #563

Added parsing of max_volume from YAML. Before it would get max volume only from drink content total.

* Fix drink owner getting deleted early

_contents.SplitSolution causes _contents.SolutionChanged to call Finish early causing a crash when try to get SoundComponent from the deleted Entity.
2020-02-07 18:13:11 +01:00
moneyl
972d601664 Add solution pouring / click-transfer (#574)
* Add click-based solution transfer

For example, clicking on a beaker with a soda can to transfer the soda to the beaker. Works on plain solution containers like beakers and also on open drink containers like soda cans as long as they have the `PourIn` and `PourOut` solution  capabilities. If no `SolutionComponent` is added to a drink entity, the `DrinkComponent` will give the entity one. This PR extends that behavior slightly by also giving these default `SolutionComponent`'s the proper capabilities for pouring in/out.

* Improve fix for poured drinks not immediately disappearing

Instead of making `DrinkComponent.Use` public this 
 splits out the code important to both users and made that function public, leaving `Use` private.

* Shorten solution transfer popup

* Make code review changes

- Move pouring code from SolutionComponent to new PourableComponent. Added PourableComponent to client ignore list and added to existing container prototypes.
- Added EmptyVolume property to shared SolutionComponent for convenience.
- Removed DrinkComponent fix from pouring AttackBy code. Instead DrinkComponent subscribes to the SolutionChanged action and updates its self when necessary.
- Fixed pouring being able to add more than a containers max volume and sometimes deleting reagents.
- Added message for when a container is full.

* More code review changes

- Remove IAttackBy ComponentReference attribute in PourableComponent
- Remove _transferAmount from shared SolutionComponent. Left over var from previous commit not being used anymore.
2020-01-29 02:07:02 +01:00
Pieter-Jan Briers
0c9a95bc54 Update submodule.
Remove now-unecessary Initialize() calls on added components.
2019-12-22 21:43:34 +01:00
Acruid
1fe09c580c Entities now require a location when being spawned. 2019-12-16 21:44:24 -08:00
metalgearsloth
de148fc98f Add hunger and thirst (#363)
* Add hunger and thirst

Based on the SS13 systems.
Food (Nutriment) / Drink -> Stomach -> Hunger / Thirst

* Cleanup rebase

* Cleanup stuff that was prototyped

* Address feedback

Still need to add a statuseffects system in a separate branch

* More cleanup on nutrition

Fix Remie's feedback and also damage tick.

* Re-implement nutrition with master

* Updated to use the StatusEffectsUI update
* Removed all clientside components as they only receive the UI updates now
* Implemented PR feedback
* Had to make a slight adjustment to the chemistry SolutionComponent given it doesn't have an Owner, same with Solution

Still TODO:
* Metabolisation effects
* Change drink contents to alcohol / wine etc.
* Add items to the dispensers
* For transparent containers use RecalculateColor

Could probably genericise DrinkFoodContainer as well to be a temporary item dispenser

* Fix broken bottle parent
2019-11-11 22:20:03 +01:00