* testing, further improvements. Tired. * FLAK * Automatic changelog generation for PR #9971 [ci skip] * Update preferences.dm * Automatic changelog generation for PR #9736 [ci skip] * this cannot go wrong * oop * Changes required to enable for maintenance protocols All combat mechs that are special get their internals_access increased so the pilots of the deathsquad / nuke team can fix up their mechs without having to steal a robotics ID. Also removes engineering from being able to access mech internals, seems weird to have if only robotics is allowed to handle mechs, probably remnant of engineering robotics? * Automatic changelog generation for PR #10115 [ci skip] * Port boops and handshakes * Update code/modules/mob/living/carbon/carbon_defense.dm Co-Authored-By: deathride58 <deathride58@users.noreply.github.com> * Update code/modules/mob/living/carbon/carbon_defense.dm Co-Authored-By: deathride58 <deathride58@users.noreply.github.com> * AAAAA * Add a nose boop sound * Add a boop sound effect * Make the boop louder. * Fixes pubby wall meds being var-edited snowflakes. * Commit suggestions Co-Authored-By: deathride58 <deathride58@users.noreply.github.com> * Commit suggestions Co-Authored-By: deathride58 <deathride58@users.noreply.github.com> * Commit suggestions Co-Authored-By: deathride58 <deathride58@users.noreply.github.com> * Commit suggestions Co-Authored-By: deathride58 <deathride58@users.noreply.github.com> * Commit suggestions Co-Authored-By: deathride58 <deathride58@users.noreply.github.com> * Commit suggestions Co-Authored-By: deathride58 <deathride58@users.noreply.github.com> * Fixes AI being unable to talk through the holopad. * Travis had a stroke. * ports "Standardize obj/updateicon() and update_icons() to update_icon()" * Update supply.dm * Update code/modules/vending/cola.dm Co-Authored-By: Ghom <42542238+Ghommie@users.noreply.github.com> * Brings carbon action intent hotkeys down to living. * Update drink_reagents.dm * Automatic changelog generation for PR #10180 [ci skip] * Automatic changelog generation for PR #10181 [ci skip] * Porting a few martial art code updates. * Adds gas miners to all maps. * Compress secK9 * whoops * Hopefully this won't screw up travis. * Two slimepeople fixes. * Automatic changelog generation for PR #10072 [ci skip] * Automatic changelog generation for PR #10225 [ci skip] * Update drink_reagents.dm * Automatic changelog generation for PR #10203 [ci skip] * Automatic changelog generation for PR #10157 [ci skip] * Automatic changelog generation for PR #10155 [ci skip] * Automatic changelog generation for PR #10111 [ci skip] * Automatic changelog generation for PR #10216 [ci skip] * Automatic changelog generation for PR #10172 [ci skip] * Automatic changelog generation for PR #10026 [ci skip] * Automatic changelog generation for PR #10076 [ci skip] * Update drinks.dm * Automatic changelog generation for PR #10153 [ci skip] * ?? * Update snacks.dm * oops * probably fixes only neutral traits existing * Automatic changelog generation for PR #10227 [ci skip] * argk * Chef buffs chef buffs tastier food. "The strong flavor of" was always in game but someone put it behind an else if statement that would never proc. Now if there's more than 45% (or 30% if you are a lizzard, hissss) of a reagent in a beaker, you will taste a strong flavor! Hurrah! * Automatic changelog generation for PR #10228 [ci skip] * fixes the sprites * Actually hold on So that not everything in the game now tastes like STRONG FLAVOUR. That'd be annoying. * Magic number man bad, also all heads can spam CC now * im baby dumb and removed "a hint of" by accident. Okay whoops haha there we go now both strong and weak should work. * oh hey macros. slightly less ugly ™ * modular man bad. now mörge this so chefs can make delicious dish, hemk. * Update carbon.dm * lolman acctually knows how the stuff work * AAAAAAAAAAAAAAAAAAAA * Update flashbang.dm * thank you based ghomtainer (when) Co-Authored-By: Ghom <42542238+Ghommie@users.noreply.github.com> * thank you based ghomtainer (when) 2x how did i not notice this * Automatic changelog generation for PR #10204 [ci skip] * Converts the main timsorts file from relative pathing to absolute pathing. * Ports "Added TRAIT_DISK_VERIFIER, refactors how fake disk checks work slightly" * wew * Automatic changelog generation for PR #10090 [ci skip] * Add the sprite for the landmark * Make it include my files * Automatic changelog generation for PR #10067 [ci skip] * Automatic changelog generation for PR #10160 [ci skip] * drop * Automatic changelog generation for PR #10079 [ci skip] * Automatic changelog generation for PR #10207 [ci skip] * Automatic changelog generation for PR #10214 [ci skip] * Update mob.dm * Update mob.dm * Redo my changes on Box Hopefully this will fix the conflict with the fire alarms. * h * Automatic changelog generation for PR #10193 [ci skip] * I'm a god. How can you defeat a god? What a grand and intoxicating innocence, how can you be so naive? * Automatic changelog generation for PR #10054 [ci skip] * Automatic changelog generation for PR #10126 [ci skip] * Automatic changelog generation for PR #10142 [ci skip] * Automatic changelog generation for PR #10051 [ci skip] * Automatic changelog generation for PR #9925 [ci skip] * Automatic changelog generation for PR #9563 [ci skip] * Atomises out the magicnumber change * Automatic changelog generation for PR #10231 [ci skip] * Automatic changelog generation for PR #10235 [ci skip] * Automatic changelog generation for PR #10200 [ci skip] * Fix the nose boop. * Remove extra indentations * Update inhand_holder.dm * hhh * ghom help * ff * ff * Automatic changelog generation for PR #10058 [ci skip] * Automatic changelog generation for PR #10059 [ci skip] * Automatic changelog generation for PR #9596 [ci skip] * Automatic changelog generation for PR #9940 [ci skip] * Automatic changelog generation for PR #10232 [ci skip] * Automatic changelog generation for PR #10141 [ci skip] * Begone crap. * I gotta go fast. * QoL Update Move the Engines to a subfolder to be cleaner when there will be 20 submaps on different maps and change the Tesla Submap to incorporate a few changes I did for the Singulo submap. * Magic number baaad * Make things even more organized * Better safe than sorry. * Automatic changelog generation for PR #10164 [ci skip] * Automatic changelog generation for PR #10120 [ci skip] * Automatic changelog generation for PR #10257 [ci skip] * typo * Unnecessary OOC note. * Is merging someone else's PR you personally fixed considerable as self-merging? * I'm playing dirty because we have too many PRs to merge anyway. * Automatic changelog generation for PR #10096 [ci skip] * Automatic changelog generation for PR #9950 [ci skip] * Automatic changelog generation for PR #10190 [ci skip] * Automatic changelog generation for PR #9830 [ci skip] * Suggestions * Fix indentation * lowered to 10 after i struggled to open tickets panel * FUUUUUUUUUUUCK * Nerfs fun * FUUUUUUUUUCK v2 * Automatic changelog generation for PR #10263 [ci skip] * QoL Update - Rename the cameras and place two more - Unanchor the shields generators and emitters because they were bugged and will save more time - Put more rad closets on the Singulo - Put more insuls on the Tesla since they protect - Moved the Engineer clothing locker to Boxstation instead of having it in the Engine - Added a button to the shutters on the north side of PA - Added a marker to show where to place the console - Rewire the power wire to be more in a straight line. * Forgot a " * Forgot a button on the Tesla * Update supply.dm * readds sprites * Fills white first aid kits to the brim. Ergo how I was fooled into believing it was a tweak and not a nerf. * Connect the fuel pipe to somewhere * no more 40% time dilation * Update __donator.dm * Update modular_citadel/code/modules/client/loadout/__donator.dm Co-Authored-By: Ghom <42542238+Ghommie@users.noreply.github.com> * Update modular_citadel/code/modules/client/loadout/__donator.dm Co-Authored-By: Ghom <42542238+Ghommie@users.noreply.github.com> * Update modular_citadel/code/modules/client/loadout/__donator.dm Co-Authored-By: Ghom <42542238+Ghommie@users.noreply.github.com> * Update custom_items.dm * Automatic changelog generation for PR #10254 [ci skip] * Fix areas and tiles getting ripped off * Also give Tesla's emitters R-floors * Automatic changelog generation for PR #10093 [ci skip] * Automatic changelog generation for PR #10210 [ci skip] * Automatic changelog generation for PR #10246 [ci skip] * Update custom_items.dm * Automatic changelog generation for PR #10218 [ci skip] * Automatic changelog generation for PR #10274 [ci skip] * Add the option to restrict the Engine that spawn * Revert "Add the option to restrict the Engine that spawn" This reverts commite3e1f91635. * Revert "Revert "Add the option to restrict the Engine that spawn"" This reverts commitd851beea16. * Add config options * Move the config up to avoid conflict * Automatic changelog generation for PR #10245 [ci skip] Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com> Co-authored-by: kevinz000 <2003111+kevinz000@users.noreply.github.com> Co-authored-by: CitadelStationBot <citadelstationcommunity@gmail.com> Co-authored-by: Lin <linzolle@gmail.com> Co-authored-by: kappa-sama <44128284+kappa-sama@users.noreply.github.com> Co-authored-by: DeltaFire15 <46569814+DeltaFire15@users.noreply.github.com> Co-authored-by: Useroth <37159550+Useroth@users.noreply.github.com> Co-authored-by: BlackMajor <henrydyer6@hotmail.com> Co-authored-by: deathride58 <deathride58@users.noreply.github.com> Co-authored-by: Putnam3145 <putnam3145@gmail.com> Co-authored-by: Trilbyspaceclone <30435998+Trilbyspaceclone@users.noreply.github.com> Co-authored-by: GrayRachnid <Gray_icy@hotmail.com> Co-authored-by: B1gb3ast <Yeremyrus@live.nl> Co-authored-by: Seris02 <49109742+Seris02@users.noreply.github.com> Co-authored-by: lolman360 <22850904+lolman360@users.noreply.github.com> Co-authored-by: nik707 <38332985+nik707@users.noreply.github.com> Co-authored-by: LetterJay <9606363+LetterJay@users.noreply.github.com>
Datum Component System (DCS)
Concept
Loosely adapted from /vg/. This is an entity component system for adding behaviours to datums when inheritance doesn't quite cut it. By using signals and events instead of direct inheritance, you can inject behaviours without hacky overloads. It requires a different method of thinking, but is not hard to use correctly. If a behaviour can have application across more than one thing. Make it generic, make it a component. Atom/mob/obj event? Give it a signal, and forward it's arguments with a SendSignal() call. Now every component that want's to can also know about this happening.
In the code
Slippery things
At the time of this writing, every object that is slippery overrides atom/Crossed does some checks, then slips the mob. Instead of all those Crossed overrides they could add a slippery component to all these objects. And have the checks in one proc that is run by the Crossed event
Powercells
A lot of objects have powercells. The get_cell() proc was added to give generic access to the cell var if it had one. This is just a specific use case of GetComponent()
Radios
The radio object as it is should not exist, given that more things use the concept of radios rather than the object itself. The actual function of the radio can exist in a component which all the things that use it (Request consoles, actual radios, the SM shard) can add to themselves.
Standos
Stands have a lot of procs which mimic mob procs. Rather than inserting hooks for all these procs in overrides, the same can be accomplished with signals
API
Defines
COMPONENT_INCOMPATIBLEReturn this from/datum/component/Initializeordatum/component/OnTransferto have the component be deleted if it's applied to an incorrect type.parentmust not be modified if this is to be returned. This will be noted in the runtime logs
Vars
/datum/var/list/datum_components(private)- Lazy associated list of type -> component/list of components.
/datum/var/list/comp_lookup(private)- Lazy associated list of signal -> registree/list of registrees
/datum/var/list/signal_procs(private)- Associated lazy list of signals ->
/datum/callbacks that will be run when the parent datum receives that signal
- Associated lazy list of signals ->
/datum/var/signal_enabled(protected, boolean)- If the datum is signal enabled. If not, it will not react to signals
FALSEby default, set toTRUEwhen a signal is registered
/datum/component/var/dupe_mode(protected, enum)- How duplicate component types are handled when added to the datum.
COMPONENT_DUPE_HIGHLANDER(default): Old component will be deleted, new component will first have/datum/component/proc/InheritComponent(datum/component/old, FALSE)on itCOMPONENT_DUPE_ALLOWED: The components will be treated as separate,GetComponent()will return the first addedCOMPONENT_DUPE_UNIQUE: New component will be deleted, old component will first have/datum/component/proc/InheritComponent(datum/component/new, TRUE)on itCOMPONENT_DUPE_UNIQUE_PASSARGS: New component will never exist and instead its initialization arguments will be passed on to the old component.
- How duplicate component types are handled when added to the datum.
/datum/component/var/dupe_type(protected, type)- Definition of a duplicate component type
nullmeans exact match ontype(default)- Any other type means that and all subtypes
- Definition of a duplicate component type
/datum/component/var/datum/parent(protected, read-only)- The datum this component belongs to
- Never
nullin child procs
report_signal_origin(protected, boolean)- If
TRUE, will invoke the callback when signalled with the signal type as the first argument. FALSEby default.
- If
Procs
/datum/proc/GetComponent(component_type(type)) -> datum/component?(public, final)- Returns a reference to a component of component_type if it exists in the datum, null otherwise
/datum/proc/GetComponents(component_type(type)) -> list(public, final)- Returns a list of references to all components of component_type that exist in the datum
/datum/proc/GetExactComponent(component_type(type)) -> datum/component?(public, final)- Returns a reference to a component whose type MATCHES component_type if that component exists in the datum, null otherwise
GET_COMPONENT(varname, component_type)ORGET_COMPONENT_FROM(varname, component_type, src)- Shorthand for
var/component_type/varname = src.GetComponent(component_type)
- Shorthand for
SEND_SIGNAL(target, sigtype, ...)(public, final)- Use to send signals to target datum
- Extra arguments are to be specified in the signal definition
- Returns a bitflag with signal specific information assembled from all activated components
- Arguments are packaged in a list and handed off to _SendSignal()
/datum/proc/AddComponent(component_type(type), ...) -> datum/component(public, final)- Creates an instance of
component_typein the datum and passes...to itsInitialize()call - Sends the
COMSIG_COMPONENT_ADDEDsignal to the datum - All components a datum owns are deleted with the datum
- Returns the component that was created. Or the old component in a dupe situation where
COMPONENT_DUPE_UNIQUEwas set - If this tries to add an component to an incompatible type, the component will be deleted and the result will be
null. This is very unperformant, try not to do it - Properly handles duplicate situations based on the
dupe_modevar
- Creates an instance of
/datum/proc/LoadComponent(component_type(type), ...) -> datum/component(public, final)- Equivalent to calling
GetComponent(component_type)where, if the result would benull, returnsAddComponent(component_type, ...)instead
- Equivalent to calling
/datum/proc/ComponentActivated(datum/component/C)(abstract, async)- Called on a component's
parentafter a signal received causes it to activate.srcis the parameter - Will only be called if a component's callback returns
TRUE
- Called on a component's
/datum/proc/TakeComponent(datum/component/C)(public, final)- Properly transfers ownership of a component from one datum to another
- Signals
COMSIG_COMPONENT_REMOVINGon the parent - Called on the datum you want to own the component with another datum's component
/datum/proc/_SendSignal(signal, list/arguments)(private, final)- Handles most of the actual signaling procedure
- Will runtime if used on datums with an empty component list
/datum/proc/RegisterSignal(datum/target, signal(string/list of strings), proc_ref(type), override(boolean))(protected, final)- If signal is a list it will be as if RegisterSignal was called for each of the entries with the same following arguments
- Makes the datum listen for the specified
signalon it'sparentdatum. - When that signal is received
proc_refwill be called on the component, along with associated arguments - Example proc ref:
.proc/OnEvent - If a previous registration is overwritten by the call, a runtime occurs. Setting
overrideto TRUE prevents this - These callbacks run asyncronously
- Returning
TRUEfrom these callbacks will trigger aTRUEreturn from theSendSignal()that initiated it
/datum/component/New(datum/parent, ...)(private, final)- Runs internal setup for the component
- Extra arguments are passed to
Initialize()
/datum/component/Initialize(...)(abstract, no-sleep)- Called by
New()with the same argments excludingparent - Component does not exist in
parent'sdatum_componentslist yet, althoughparentis set and may be used - Signals will not be received while this function is running
- Component may be deleted after this function completes without being attached
- Do not call
qdel(src)from this function
- Called by
/datum/component/Destroy(force(bool), silent(bool))(virtual, no-sleep)- Sends the
COMSIG_COMPONENT_REMOVINGsignal to the parent datum if theparentisn't being qdeleted - Properly removes the component from
parentand cleans up references - Setting
forcemakes it not check for and remove the component from the parent - Setting
silentdeletes the component without sending aCOMSIG_COMPONENT_REMOVINGsignal
- Sends the
/datum/component/proc/InheritComponent(datum/component/C, i_am_original(boolean))(abstract, no-sleep)- Called on a component when a component of the same type was added to the same parent
- See
/datum/component/var/dupe_mode C's type will always be the same of the called component
/datum/component/proc/AfterComponentActivated()(abstract, async)- Called on a component that was activated after it's
parent'sComponentActivated()is called
- Called on a component that was activated after it's
/datum/component/proc/OnTransfer(datum/new_parent)(abstract, no-sleep)- Called before
new_parentis assigned toparentinTakeComponent() - Allows the component to react to ownership transfers
- Called before
/datum/component/proc/_RemoveFromParent()(private, final)- Clears
parentand removes the component from it's component list
- Clears
/datum/component/proc/_JoinParent(private, final)- Tries to add the component to it's
parentsdatum_componentslist
- Tries to add the component to it's
/datum/component/proc/RegisterWithParent(abstract, no-sleep)- Used to register the signals that should be on the
parentobject - Use this if you plan on the component transfering between parents
- Used to register the signals that should be on the
/datum/component/proc/UnregisterFromParent(abstract, no-sleep)- Counterpart to
RegisterWithParent() - Used to unregister the signals that should only be on the
parentobject
- Counterpart to