mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
Documents 61 files (#9306)
* Document the world (#46495) * Document drone verbs.dm * Document the outfit datum with autodoc (#45415) * Uncurse take_damage and document obj_defense.dm (#45146) The original take_damage proc defined vars for no good reason had some duplicate code and wasn't very readable. If you are wondering why it calls obj_break every time it takes damage while below integrity_failure, that's the way it used to be. Most (if not all) stuff that takes advantage of this functionality already accounts for this. * Convert some code docs into the auto doc format (#45101) * Commit Message * Fixes * e * Documents browserOutput.dm (#51439) * Add autodoc to the callback datum (#45463) * Autodoc the vending machine (#45468) * Autodoc the vending machine * Update code/modules/vending/_vending.dm Co-Authored-By: Tad Hardesty <tad@platymuus.com> * autodoc organ helpers (#45464) * timer proc autodocs (#46530) * bunch of define autodocs * ballistic guns autodoc (#45578) * ballistic guns autodoc * fixes * client vars autodoc (#46446) About The Pull Request Autodocs client vars * Autodoc for XB and Research * shuttle docking autodoc (#48677) * Add autodocs for reagents (#49478) * Fix Co-authored-by: oranges <email@oranges.net.nz> Co-authored-by: Jonathan (JJRcop) Rubenstein <jrubcop@gmail.com> Co-authored-by: nemvar <47324920+nemvar@users.noreply.github.com> Co-authored-by: alexkar598 <> Co-authored-by: Tad Hardesty <tad@platymuus.com> Co-authored-by: spookydonut <github@spooksoftware.com> Co-authored-by: actioninja <actioninja@gmail.com>
This commit is contained in:
@@ -1,43 +1,72 @@
|
||||
/**
|
||||
* The base type for nearly all physical objects in SS13
|
||||
|
||||
* Lots and lots of functionality lives here, although in general we are striving to move
|
||||
* as much as possible to the components/elements system
|
||||
*/
|
||||
/atom
|
||||
layer = TURF_LAYER
|
||||
plane = GAME_PLANE
|
||||
var/level = 2
|
||||
var/article // If non-null, overrides a/an/some in all cases
|
||||
|
||||
///If non-null, overrides a/an/some in all cases
|
||||
var/article
|
||||
|
||||
///First atom flags var
|
||||
var/flags_1 = NONE
|
||||
///Intearaction flags
|
||||
var/interaction_flags_atom = NONE
|
||||
|
||||
///Reagents holder
|
||||
var/datum/reagents/reagents = null
|
||||
|
||||
//This atom's HUD (med/sec, etc) images. Associative list.
|
||||
///This atom's HUD (med/sec, etc) images. Associative list.
|
||||
var/list/image/hud_list = null
|
||||
//HUD images that this atom can provide.
|
||||
///HUD images that this atom can provide.
|
||||
var/list/hud_possible
|
||||
|
||||
//Value used to increment ex_act() if reactionary_explosions is on
|
||||
///Value used to increment ex_act() if reactionary_explosions is on
|
||||
var/explosion_block = 0
|
||||
|
||||
var/list/atom_colours //used to store the different colors on an atom
|
||||
//its inherent color, the colored paint applied on it, special color effect etc...
|
||||
/**
|
||||
* used to store the different colors on an atom
|
||||
*
|
||||
* its inherent color, the colored paint applied on it, special color effect etc...
|
||||
*/
|
||||
var/list/atom_colours
|
||||
|
||||
var/list/priority_overlays //overlays that should remain on top and not normally removed when using cut_overlay functions, like c4.
|
||||
var/list/remove_overlays // a very temporary list of overlays to remove
|
||||
var/list/add_overlays // a very temporary list of overlays to add
|
||||
|
||||
var/list/managed_vis_overlays //vis overlays managed by SSvis_overlays to automaticaly turn them like other overlays
|
||||
///overlays that should remain on top and not normally removed when using cut_overlay functions, like c4.
|
||||
var/list/priority_overlays
|
||||
/// a very temporary list of overlays to remove
|
||||
var/list/remove_overlays
|
||||
/// a very temporary list of overlays to add
|
||||
var/list/add_overlays
|
||||
|
||||
///vis overlays managed by SSvis_overlays to automaticaly turn them like other overlays
|
||||
var/list/managed_vis_overlays
|
||||
|
||||
///Proximity monitor associated with this atom
|
||||
var/datum/proximity_monitor/proximity_monitor
|
||||
///Cooldown tick timer for buckle messages
|
||||
var/buckle_message_cooldown = 0
|
||||
///Last fingerprints to touch this atom
|
||||
var/fingerprintslast
|
||||
|
||||
var/list/filter_data //For handling persistent filters
|
||||
|
||||
///Economy cost of item
|
||||
var/custom_price
|
||||
///Economy cost of item in premium vendor
|
||||
var/custom_premium_price
|
||||
///Whether spessmen with an ID with an age below AGE_MINOR (21 by default) can buy this item
|
||||
var/age_restricted = FALSE
|
||||
//List of datums orbiting this atom
|
||||
var/datum/component/orbiter/orbiters
|
||||
|
||||
var/rad_flags = NONE // Will move to flags_1 when i can be arsed to
|
||||
/// Will move to flags_1 when i can be arsed to (2019, has not done so)
|
||||
var/rad_flags = NONE
|
||||
/// Radiation insulation types
|
||||
var/rad_insulation = RAD_NO_INSULATION
|
||||
|
||||
var/chat_color_name // Last name used to calculate a color for the chatmessage overlays
|
||||
@@ -47,6 +76,16 @@
|
||||
var/chat_color_darkened // A luminescence-shifted value of the last color calculated for chatmessage overlays
|
||||
|
||||
|
||||
/**
|
||||
* Called when an atom is created in byond (built in engine proc)
|
||||
*
|
||||
* Not a lot happens here in SS13 code, as we offload most of the work to the
|
||||
* [Intialization](atom.html#proc/Initialize) proc, mostly we run the preloader
|
||||
* if the preloader is being used and then call InitAtom of which the ultimate
|
||||
* result is that the Intialize proc is called.
|
||||
*
|
||||
* We also generate a tag here if the DF_USE_TAG flag is set on the atom
|
||||
*/
|
||||
/atom/New(loc, ...)
|
||||
//atom creation method that preloads variables at creation
|
||||
if(GLOB.use_preloader && (src.type == GLOB._preloader.target_path))//in case the instanciated atom is creating other atoms in New()
|
||||
@@ -63,17 +102,40 @@
|
||||
return
|
||||
SSdemo.mark_new(src)
|
||||
|
||||
//Called after New if the map is being loaded. mapload = TRUE
|
||||
//Called from base of New if the map is not being loaded. mapload = FALSE
|
||||
//This base must be called or derivatives must set initialized to TRUE
|
||||
//must not sleep
|
||||
//Other parameters are passed from New (excluding loc), this does not happen if mapload is TRUE
|
||||
//Must return an Initialize hint. Defined in __DEFINES/subsystems.dm
|
||||
|
||||
//Note: the following functions don't call the base for optimization and must copypasta:
|
||||
// /turf/Initialize
|
||||
// /turf/open/space/Initialize
|
||||
|
||||
/**
|
||||
* The primary method that objects are setup in SS13 with
|
||||
*
|
||||
* we don't use New as we have better control over when this is called and we can choose
|
||||
* to delay calls or hook other logic in and so forth
|
||||
*
|
||||
* During roundstart map parsing, atoms are queued for intialization in the base atom/New(),
|
||||
* After the map has loaded, then Initalize is called on all atoms one by one. NB: this
|
||||
* is also true for loading map templates as well, so they don't Initalize until all objects
|
||||
* in the map file are parsed and present in the world
|
||||
*
|
||||
* If you're creating an object at any point after SSInit has run then this proc will be
|
||||
* immediately be called from New.
|
||||
*
|
||||
* mapload: This parameter is true if the atom being loaded is either being intialized during
|
||||
* the Atom subsystem intialization, or if the atom is being loaded from the map template.
|
||||
* If the item is being created at runtime any time after the Atom subsystem is intialized then
|
||||
* it's false.
|
||||
*
|
||||
* You must always call the parent of this proc, otherwise failures will occur as the item
|
||||
* will not be seen as initalized (this can lead to all sorts of strange behaviour, like
|
||||
* the item being completely unclickable)
|
||||
*
|
||||
* You must not sleep in this proc, or any subprocs
|
||||
*
|
||||
* Any parameters from new are passed through (excluding loc), naturally if you're loading from a map
|
||||
* there are no other arguments
|
||||
*
|
||||
* Must return an [initialization hint](code/__DEFINES/subsystems.html) or a runtime will occur.
|
||||
*
|
||||
* Note: the following functions don't call the base for optimization and must copypasta handling:
|
||||
* * /turf/Initialize
|
||||
* * /turf/open/space/Initialize
|
||||
*/
|
||||
/atom/proc/Initialize(mapload, ...)
|
||||
SHOULD_CALL_PARENT(TRUE)
|
||||
if(flags_1 & INITIALIZED_1)
|
||||
@@ -98,14 +160,35 @@
|
||||
|
||||
return INITIALIZE_HINT_NORMAL
|
||||
|
||||
//called if Initialize returns INITIALIZE_HINT_LATELOAD
|
||||
/**
|
||||
* Late Intialization, for code that should run after all atoms have run Intialization
|
||||
*
|
||||
* To have your LateIntialize proc be called, your atoms [Initalization](atom.html#proc/Initialize)
|
||||
* proc must return the hint
|
||||
* [INITIALIZE_HINT_LATELOAD](code/__DEFINES/subsystems.html#define/INITIALIZE_HINT_LATELOAD)
|
||||
* otherwise you will never be called.
|
||||
*
|
||||
* useful for doing things like finding other machines on GLOB.machines because you can guarantee
|
||||
* that all atoms will actually exist in the "WORLD" at this time and that all their Intialization
|
||||
* code has been run
|
||||
*/
|
||||
/atom/proc/LateInitialize()
|
||||
return
|
||||
|
||||
// Put your AddComponent() calls here
|
||||
/// Put your AddComponent() calls here
|
||||
/atom/proc/ComponentInitialize()
|
||||
return
|
||||
|
||||
/**
|
||||
* Top level of the destroy chain for most atoms
|
||||
*
|
||||
* Cleans up the following:
|
||||
* * Removes alternate apperances from huds that see them
|
||||
* * qdels the reagent holder from atoms if it exists
|
||||
* * clears the orbiters list
|
||||
* * clears overlays and priority overlays
|
||||
* * clears the light object
|
||||
*/
|
||||
/atom/Destroy()
|
||||
if(alternate_appearances)
|
||||
for(var/K in alternate_appearances)
|
||||
@@ -127,6 +210,7 @@
|
||||
/atom/proc/handle_ricochet(obj/item/projectile/P)
|
||||
return
|
||||
|
||||
///Can the mover object pass this atom, while heading for the target turf
|
||||
/atom/proc/CanPass(atom/movable/mover, turf/target)
|
||||
SHOULD_CALL_PARENT(TRUE)
|
||||
SHOULD_BE_PURE(TRUE)
|
||||
@@ -143,6 +227,16 @@
|
||||
SHOULD_BE_PURE(TRUE)
|
||||
return !density
|
||||
|
||||
/**
|
||||
* Is this atom currently located on centcom
|
||||
*
|
||||
* Specifically, is it on the z level and within the centcom areas
|
||||
*
|
||||
* You can also be in a shuttleshuttle during endgame transit
|
||||
*
|
||||
* Used in gamemode to identify mobs who have escaped and for some other areas of the code
|
||||
* who don't want atoms where they shouldn't be
|
||||
*/
|
||||
/atom/proc/onCentCom()
|
||||
var/turf/T = get_turf(src)
|
||||
if(!T)
|
||||
@@ -173,6 +267,13 @@
|
||||
if(T in shuttle_area)
|
||||
return TRUE
|
||||
|
||||
/**
|
||||
* Is the atom in any of the centcom syndicate areas
|
||||
*
|
||||
* Either in the syndie base on centcom, or any of their shuttles
|
||||
*
|
||||
* Also used in gamemode code for win conditions
|
||||
*/
|
||||
/atom/proc/onSyndieBase()
|
||||
var/turf/T = get_turf(src)
|
||||
if(!T)
|
||||
@@ -186,6 +287,7 @@
|
||||
|
||||
return FALSE
|
||||
|
||||
///This atom has been hit by a hulkified mob in hulk mode (user)
|
||||
/atom/proc/attack_hulk(mob/living/carbon/human/user, does_attack_animation = 0)
|
||||
SEND_SIGNAL(src, COMSIG_ATOM_HULK_ATTACK, user)
|
||||
if(does_attack_animation)
|
||||
@@ -193,6 +295,18 @@
|
||||
log_combat(user, src, "punched", "hulk powers")
|
||||
user.do_attack_animation(src, ATTACK_EFFECT_SMASH)
|
||||
|
||||
/**
|
||||
* Ensure a list of atoms/reagents exists inside this atom
|
||||
*
|
||||
* Goes throught he list of passed in parts, if they're reagents, adds them to our reagent holder
|
||||
* creating the reagent holder if it exists.
|
||||
*
|
||||
* If the part is a moveable atom and the previous location of the item was a mob/living,
|
||||
* it calls the inventory handler transferItemToLoc for that mob/living and transfers the part
|
||||
* to this atom
|
||||
*
|
||||
* Otherwise it simply forceMoves the atom into this atom
|
||||
*/
|
||||
/atom/proc/CheckParts(list/parts_list)
|
||||
for(var/A in parts_list)
|
||||
if(istype(A, /datum/reagent))
|
||||
@@ -208,65 +322,91 @@
|
||||
else
|
||||
M.forceMove(src)
|
||||
|
||||
//common name
|
||||
///Hook for multiz???
|
||||
/atom/proc/update_multiz(prune_on_fail = FALSE)
|
||||
return FALSE
|
||||
|
||||
///Take air from the passed in gas mixture datum
|
||||
/atom/proc/assume_air(datum/gas_mixture/giver)
|
||||
qdel(giver)
|
||||
return null
|
||||
|
||||
///Remove air from this atom
|
||||
/atom/proc/remove_air(amount)
|
||||
return null
|
||||
|
||||
///Return the current air environment in this atom
|
||||
/atom/proc/return_air()
|
||||
if(loc)
|
||||
return loc.return_air()
|
||||
else
|
||||
return null
|
||||
|
||||
///Return the air if we can analyze it
|
||||
///Check if this atoms eye is still alive (probably)
|
||||
/atom/proc/check_eye(mob/user)
|
||||
return
|
||||
|
||||
/atom/proc/Bumped(atom/movable/AM)
|
||||
set waitfor = FALSE
|
||||
|
||||
// Convenience procs to see if a container is open for chemistry handling
|
||||
/// Convenience proc to see if a container is open for chemistry handling
|
||||
/atom/proc/is_open_container()
|
||||
return is_refillable() && is_drainable()
|
||||
|
||||
/// Is this atom injectable into other atoms
|
||||
/atom/proc/is_injectable(mob/user, allowmobs = TRUE)
|
||||
return reagents && (reagents.flags & (INJECTABLE | REFILLABLE))
|
||||
|
||||
/// Can we draw from this atom with an injectable atom
|
||||
/atom/proc/is_drawable(mob/user, allowmobs = TRUE)
|
||||
return reagents && (reagents.flags & (DRAWABLE | DRAINABLE))
|
||||
|
||||
/// Can this atoms reagents be refilled
|
||||
/atom/proc/is_refillable()
|
||||
return reagents && (reagents.flags & REFILLABLE)
|
||||
|
||||
/// Is this atom drainable of reagents
|
||||
/atom/proc/is_drainable()
|
||||
return reagents && (reagents.flags & DRAINABLE)
|
||||
|
||||
|
||||
/// Are you allowed to drop this atom
|
||||
/atom/proc/AllowDrop()
|
||||
return FALSE
|
||||
|
||||
/atom/proc/CheckExit()
|
||||
return 1
|
||||
|
||||
///Is this atom within 1 tile of another atom
|
||||
/atom/proc/HasProximity(atom/movable/AM as mob|obj)
|
||||
return
|
||||
|
||||
/**
|
||||
* React to an EMP of the given severity
|
||||
*
|
||||
* Default behaviour is to send the COMSIG_ATOM_EMP_ACT signal
|
||||
*
|
||||
* If the signal does not return protection, and there are attached wires then we call
|
||||
* emp_pulse() on the wires
|
||||
*
|
||||
* We then return the protection value
|
||||
*/
|
||||
/atom/proc/emp_act(severity)
|
||||
var/protection = SEND_SIGNAL(src, COMSIG_ATOM_EMP_ACT, severity)
|
||||
if(!(protection & EMP_PROTECT_WIRES) && istype(wires))
|
||||
wires.emp_pulse()
|
||||
return protection // Pass the protection value collected here upwards
|
||||
|
||||
/**
|
||||
* React to a hit by a projectile object
|
||||
*
|
||||
* Default behaviour is to send the COMSIG_ATOM_BULLET_ACT and then call on_hit() on the projectile
|
||||
*/
|
||||
/atom/proc/bullet_act(obj/item/projectile/P, def_zone)
|
||||
SEND_SIGNAL(src, COMSIG_ATOM_BULLET_ACT, P, def_zone)
|
||||
. = P.on_hit(src, 0, def_zone)
|
||||
|
||||
///Return true if we're inside the passed in atom
|
||||
/atom/proc/in_contents_of(container)//can take class or object instance as argument
|
||||
if(ispath(container))
|
||||
if(istype(src.loc, container))
|
||||
@@ -275,6 +415,12 @@
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/**
|
||||
* Get the name of this object for examine
|
||||
*
|
||||
* You can override what is returned from this proc by registering to listen for the
|
||||
* COMSIG_ATOM_GET_EXAMINE_NAME signal
|
||||
*/
|
||||
/atom/proc/get_examine_name(mob/user)
|
||||
. = "\a [src]"
|
||||
var/list/override = list(gender == PLURAL ? "some" : "a", " ", "[name]")
|
||||
@@ -284,9 +430,18 @@
|
||||
if(SEND_SIGNAL(src, COMSIG_ATOM_GET_EXAMINE_NAME, user, override) & COMPONENT_EXNAME_CHANGED)
|
||||
. = override.Join("")
|
||||
|
||||
///Generate the full examine string of this atom (including icon for goonchat)
|
||||
/atom/proc/get_examine_string(mob/user, thats = FALSE)
|
||||
return "[icon2html(src, user)] [thats? "That's ":""][get_examine_name(user)]"
|
||||
|
||||
/**
|
||||
* Called when a mob examines (shift click or verb) this atom
|
||||
*
|
||||
* Default behaviour is to get the name and icon of the object and it's reagents where
|
||||
* the TRANSPARENT flag is set on the reagents holder
|
||||
*
|
||||
* Produces a signal COMSIG_PARENT_EXAMINE
|
||||
*/
|
||||
/atom/proc/examine(mob/user)
|
||||
. = list("[get_examine_string(user, TRUE)].")
|
||||
|
||||
@@ -315,23 +470,41 @@
|
||||
|
||||
SEND_SIGNAL(src, COMSIG_PARENT_EXAMINE, user, .)
|
||||
|
||||
/**
|
||||
* An atom we are buckled or is contained within us has tried to move
|
||||
*
|
||||
* Default behaviour is to send a warning that the user can't move while buckled as long
|
||||
* as the buckle_message_cooldown has expired (50 ticks)
|
||||
*/
|
||||
/atom/proc/relaymove(mob/user)
|
||||
if(buckle_message_cooldown <= world.time)
|
||||
buckle_message_cooldown = world.time + 50
|
||||
to_chat(user, "<span class='warning'>You can't move while buckled to [src]!</span>")
|
||||
return
|
||||
|
||||
/// Return true if this atoms contents should not have ex_act called on ex_act
|
||||
/atom/proc/prevent_content_explosion()
|
||||
return FALSE
|
||||
|
||||
/// Handle what happens when your contents are exploded by a bomb
|
||||
/atom/proc/contents_explosion(severity, target)
|
||||
return //For handling the effects of explosions on contents that would not normally be effected
|
||||
|
||||
/**
|
||||
* React to being hit by an explosion
|
||||
*
|
||||
* Default behaviour is to call contents_explosion() and send the COMSIG_ATOM_EX_ACT signal
|
||||
*/
|
||||
/atom/proc/ex_act(severity, target)
|
||||
set waitfor = FALSE
|
||||
contents_explosion(severity, target)
|
||||
SEND_SIGNAL(src, COMSIG_ATOM_EX_ACT, severity, target)
|
||||
|
||||
/**
|
||||
* React to a hit by a blob objecd
|
||||
*
|
||||
* default behaviour is to send the COMSIG_ATOM_BLOB_ACT signal
|
||||
*/
|
||||
/atom/proc/blob_act(obj/structure/blob/B)
|
||||
SEND_SIGNAL(src, COMSIG_ATOM_BLOB_ACT, B)
|
||||
return
|
||||
@@ -340,23 +513,40 @@
|
||||
SEND_SIGNAL(src, COMSIG_ATOM_FIRE_ACT, exposed_temperature, exposed_volume)
|
||||
return
|
||||
|
||||
/**
|
||||
* React to being hit by a thrown object
|
||||
*
|
||||
* Default behaviour is to call hitby_react() on ourselves after 2 seconds if we are dense
|
||||
* and under normal gravity.
|
||||
*
|
||||
* Im not sure why this the case, maybe to prevent lots of hitby's if the thrown object is
|
||||
* deleted shortly after hitting something (during explosions or other massive events that
|
||||
* throw lots of items around - singularity being a notable example)
|
||||
*/
|
||||
/atom/proc/hitby(atom/movable/AM, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum)
|
||||
if(density && !has_gravity(AM)) //thrown stuff bounces off dense stuff in no grav, unless the thrown stuff ends up inside what it hit(embedding, bola, etc...).
|
||||
addtimer(CALLBACK(src, .proc/hitby_react, AM), 2)
|
||||
|
||||
/**
|
||||
* We have have actually hit the passed in atom
|
||||
*
|
||||
* Default behaviour is to move back from the item that hit us
|
||||
*/
|
||||
/atom/proc/hitby_react(atom/movable/AM)
|
||||
if(AM && isturf(AM.loc))
|
||||
step(AM, turn(AM.dir, 180))
|
||||
|
||||
///Handle the atom being slipped over
|
||||
/atom/proc/handle_slip(mob/living/carbon/C, knockdown_amount, obj/O, lube, paralyze, force_drop)
|
||||
return
|
||||
|
||||
//returns the mob's dna info as a list, to be inserted in an object's blood_DNA list
|
||||
///returns the mob's dna info as a list, to be inserted in an object's blood_DNA list
|
||||
/mob/living/proc/get_blood_dna_list()
|
||||
if(get_blood_id() != /datum/reagent/blood)
|
||||
return
|
||||
return list("ANIMAL DNA" = "Y-")
|
||||
|
||||
///Get the mobs dna list
|
||||
/mob/living/carbon/get_blood_dna_list()
|
||||
if(get_blood_id() != /datum/reagent/blood)
|
||||
return
|
||||
@@ -373,7 +563,7 @@
|
||||
/mob/living/silicon/get_blood_dna_list()
|
||||
return list("MOTOR OIL" = "SAE 5W-30") //just a little flavor text.
|
||||
|
||||
//to add a mob's dna info into an object's blood_DNA list.
|
||||
///to add a mob's dna info into an object's blood_dna list.
|
||||
/atom/proc/transfer_mob_blood_dna(mob/living/L)
|
||||
// Returns 0 if we have that blood already
|
||||
var/new_blood_dna = L.get_blood_dna_list()
|
||||
@@ -385,58 +575,120 @@
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
//to add blood from a mob onto something, and transfer their dna info
|
||||
///to add blood from a mob onto something, and transfer their dna info
|
||||
/atom/proc/add_mob_blood(mob/living/M)
|
||||
var/list/blood_dna = M.get_blood_dna_list()
|
||||
if(!blood_dna)
|
||||
return FALSE
|
||||
return add_blood_DNA(blood_dna)
|
||||
|
||||
///wash cream off this object
|
||||
///
|
||||
///(for the love of space jesus please make this a component)
|
||||
/atom/proc/wash_cream()
|
||||
return TRUE
|
||||
|
||||
///Is this atom in space
|
||||
/atom/proc/isinspace()
|
||||
if(isspaceturf(get_turf(src)))
|
||||
return TRUE
|
||||
else
|
||||
return FALSE
|
||||
|
||||
///Called when gravity returns after floating I think
|
||||
/atom/proc/handle_fall()
|
||||
return
|
||||
|
||||
///Respond to the singularity eating this atom
|
||||
/atom/proc/singularity_act()
|
||||
return
|
||||
|
||||
/**
|
||||
* Respond to the singularity pulling on us
|
||||
*
|
||||
* Default behaviour is to send COMSIG_ATOM_SING_PULL and return
|
||||
*/
|
||||
/atom/proc/singularity_pull(obj/singularity/S, current_size)
|
||||
SEND_SIGNAL(src, COMSIG_ATOM_SING_PULL, S, current_size)
|
||||
|
||||
|
||||
/**
|
||||
* Respond to acid being used on our atom
|
||||
*
|
||||
* Default behaviour is to send COMSIG_ATOM_ACID_ACT and return
|
||||
*/
|
||||
/atom/proc/acid_act(acidpwr, acid_volume)
|
||||
SEND_SIGNAL(src, COMSIG_ATOM_ACID_ACT, acidpwr, acid_volume)
|
||||
|
||||
/**
|
||||
* Respond to an emag being used on our atom
|
||||
*
|
||||
* Default behaviour is to send COMSIG_ATOM_EMAG_ACT and return
|
||||
*/
|
||||
/atom/proc/emag_act()
|
||||
SEND_SIGNAL(src, COMSIG_ATOM_EMAG_ACT)
|
||||
|
||||
/**
|
||||
* Respond to a radioactive wave hitting this atom
|
||||
*
|
||||
* Default behaviour is to send COMSIG_ATOM_RAD_ACT and return
|
||||
*/
|
||||
/atom/proc/rad_act(strength)
|
||||
SEND_SIGNAL(src, COMSIG_ATOM_RAD_ACT, strength)
|
||||
|
||||
/**
|
||||
* Respond to narsie eating our atom
|
||||
*
|
||||
* Default behaviour is to send COMSIG_ATOM_NARSIE_ACT and return
|
||||
*/
|
||||
/atom/proc/narsie_act()
|
||||
SEND_SIGNAL(src, COMSIG_ATOM_NARSIE_ACT)
|
||||
|
||||
/**
|
||||
* Respond to ratvar eating our atom
|
||||
*
|
||||
* Default behaviour is to send COMSIG_ATOM_RATVAR_ACT and return
|
||||
*/
|
||||
/atom/proc/ratvar_act()
|
||||
SEND_SIGNAL(src, COMSIG_ATOM_RATVAR_ACT)
|
||||
|
||||
///Return the values you get when an RCD eats you?
|
||||
/atom/proc/rcd_vals(mob/user, obj/item/construction/rcd/the_rcd)
|
||||
return FALSE
|
||||
|
||||
|
||||
/**
|
||||
* Respond to an RCD acting on our item
|
||||
*
|
||||
* Default behaviour is to send COMSIG_ATOM_RCD_ACT and return FALSE
|
||||
*/
|
||||
/atom/proc/rcd_act(mob/user, obj/item/construction/rcd/the_rcd, passed_mode)
|
||||
SEND_SIGNAL(src, COMSIG_ATOM_RCD_ACT, user, the_rcd, passed_mode)
|
||||
return FALSE
|
||||
|
||||
/**
|
||||
* Implement the behaviour for when a user click drags a storage object to your atom
|
||||
*
|
||||
* This behaviour is usually to mass transfer, but this is no longer a used proc as it just
|
||||
* calls the underyling /datum/component/storage dump act if a component exists
|
||||
*
|
||||
* TODO these should be purely component items that intercept the atom clicks higher in the
|
||||
* call chain
|
||||
*/
|
||||
/atom/proc/storage_contents_dump_act(obj/item/storage/src_object, mob/user)
|
||||
if(GetComponent(/datum/component/storage))
|
||||
return component_storage_contents_dump_act(src_object, user)
|
||||
return FALSE
|
||||
|
||||
/**
|
||||
* Implement the behaviour for when a user click drags another storage item to you
|
||||
*
|
||||
* In this case we get as many of the tiems from the target items compoent storage and then
|
||||
* put everything into ourselves (or our storage component)
|
||||
*
|
||||
* TODO these should be purely component items that intercept the atom clicks higher in the
|
||||
* call chain
|
||||
*/
|
||||
/atom/proc/component_storage_contents_dump_act(datum/component/storage/src_object, mob/user)
|
||||
var/list/things = src_object.contents()
|
||||
var/datum/progressbar/progress = new(user, things.len, src)
|
||||
@@ -457,38 +709,64 @@
|
||||
user.active_storage.show_to(user)
|
||||
return TRUE
|
||||
|
||||
///Get the best place to dump the items contained in the source storage item?
|
||||
/atom/proc/get_dumping_location(obj/item/storage/source,mob/user)
|
||||
return null
|
||||
|
||||
//This proc is called on the location of an atom when the atom is Destroy()'d
|
||||
/**
|
||||
* This proc is called when an atom in our contents has it's Destroy() called
|
||||
*
|
||||
* Default behaviour is to simply send COMSIG_ATOM_CONTENTS_DEL
|
||||
*/
|
||||
/atom/proc/handle_atom_del(atom/A)
|
||||
SEND_SIGNAL(src, COMSIG_ATOM_CONTENTS_DEL, A)
|
||||
|
||||
//called when the turf the atom resides on is ChangeTurfed
|
||||
/**
|
||||
* called when the turf the atom resides on is ChangeTurfed
|
||||
*
|
||||
* Default behaviour is to loop through atom contents and call their HandleTurfChange() proc
|
||||
*/
|
||||
/atom/proc/HandleTurfChange(turf/T)
|
||||
for(var/a in src)
|
||||
var/atom/A = a
|
||||
A.HandleTurfChange(T)
|
||||
|
||||
//the vision impairment to give to the mob whose perspective is set to that atom (e.g. an unfocused camera giving you an impaired vision when looking through it)
|
||||
/**
|
||||
* the vision impairment to give to the mob whose perspective is set to that atom
|
||||
*
|
||||
* (e.g. an unfocused camera giving you an impaired vision when looking through it)
|
||||
*/
|
||||
/atom/proc/get_remote_view_fullscreens(mob/user)
|
||||
return
|
||||
|
||||
//the sight changes to give to the mob whose perspective is set to that atom (e.g. A mob with nightvision loses its nightvision while looking through a normal camera)
|
||||
/**
|
||||
* the sight changes to give to the mob whose perspective is set to that atom
|
||||
*
|
||||
* (e.g. A mob with nightvision loses its nightvision while looking through a normal camera)
|
||||
*/
|
||||
/atom/proc/update_remote_sight(mob/living/user)
|
||||
return
|
||||
|
||||
|
||||
//Hook for running code when a dir change occurs
|
||||
/**
|
||||
* Hook for running code when a dir change occurs
|
||||
*
|
||||
* Not recommended to use, listen for the COMSIG_ATOM_DIR_CHANGE signal instead (sent by this proc)
|
||||
*/
|
||||
/atom/proc/setDir(newdir)
|
||||
SHOULD_CALL_PARENT(TRUE)
|
||||
SEND_SIGNAL(src, COMSIG_ATOM_DIR_CHANGE, dir, newdir)
|
||||
dir = newdir
|
||||
|
||||
///Handle melee attack by a mech
|
||||
/atom/proc/mech_melee_attack(obj/mecha/M)
|
||||
return
|
||||
|
||||
//If a mob logouts/logins in side of an object you can use this proc
|
||||
/**
|
||||
* Called when the atom log's in or out
|
||||
*
|
||||
* Default behaviour is to call on_log on the location this atom is in
|
||||
*/
|
||||
/atom/proc/on_log(login)
|
||||
if(loc)
|
||||
loc.on_log(login)
|
||||
@@ -502,9 +780,7 @@
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
Adds an instance of colour_type to the atom's atom_colours list
|
||||
*/
|
||||
///Adds an instance of colour_type to the atom's atom_colours list
|
||||
/atom/proc/add_atom_colour(coloration, colour_priority)
|
||||
if(!atom_colours || !atom_colours.len)
|
||||
atom_colours = list()
|
||||
@@ -517,9 +793,7 @@
|
||||
update_atom_colour()
|
||||
|
||||
|
||||
/*
|
||||
Removes an instance of colour_type from the atom's atom_colours list
|
||||
*/
|
||||
///Removes an instance of colour_type from the atom's atom_colours list
|
||||
/atom/proc/remove_atom_colour(colour_priority, coloration)
|
||||
if(!atom_colours)
|
||||
atom_colours = list()
|
||||
@@ -532,10 +806,7 @@
|
||||
update_atom_colour()
|
||||
|
||||
|
||||
/*
|
||||
Resets the atom's color to null, and then sets it to the highest priority
|
||||
colour available
|
||||
*/
|
||||
///Resets the atom's color to null, and then sets it to the highest priority colour available
|
||||
/atom/proc/update_atom_colour()
|
||||
if(!atom_colours)
|
||||
atom_colours = list()
|
||||
@@ -551,6 +822,17 @@
|
||||
color = C
|
||||
return
|
||||
|
||||
/**
|
||||
* call back when a var is edited on this atom
|
||||
*
|
||||
* Can be used to implement special handling of vars
|
||||
*
|
||||
* At the atom level, if you edit a var named "color" it will add the atom colour with
|
||||
* admin level priority to the atom colours list
|
||||
*
|
||||
* Also, if GLOB.Debug2 is FALSE, it sets the ADMIN_SPAWNED_1 flag on flags_1, which signifies
|
||||
* the object has been admin edited
|
||||
*/
|
||||
/atom/vv_edit_var(var_name, var_value)
|
||||
if(!GLOB.Debug2)
|
||||
flags_1 |= ADMIN_SPAWNED_1
|
||||
@@ -559,6 +841,11 @@
|
||||
if("color")
|
||||
add_atom_colour(color, ADMIN_COLOUR_PRIORITY)
|
||||
|
||||
/**
|
||||
* Return the markup to for the dropdown list for the VV panel for this atom
|
||||
*
|
||||
* Override in subtypes to add custom VV handling in the VV panel
|
||||
*/
|
||||
/atom/vv_get_dropdown()
|
||||
. = ..()
|
||||
. += "---"
|
||||
@@ -570,29 +857,53 @@
|
||||
.["Trigger EM pulse"] = "?_src_=vars;[HrefToken()];emp=[REF(src)]"
|
||||
.["Trigger explosion"] = "?_src_=vars;[HrefToken()];explode=[REF(src)]"
|
||||
|
||||
///Where atoms should drop if taken from this atom
|
||||
/atom/proc/drop_location()
|
||||
var/atom/L = loc
|
||||
if(!L)
|
||||
return null
|
||||
return L.AllowDrop() ? L : L.drop_location()
|
||||
|
||||
/**
|
||||
* An atom has entered this atom's contents
|
||||
*
|
||||
* Default behaviour is to send the COMSIG_ATOM_ENTERED
|
||||
*/
|
||||
/atom/Entered(atom/movable/AM, atom/oldLoc)
|
||||
SEND_SIGNAL(src, COMSIG_ATOM_ENTERED, AM, oldLoc)
|
||||
|
||||
/**
|
||||
* An atom is attempting to exit this atom's contents
|
||||
*
|
||||
* Default behaviour is to send the COMSIG_ATOM_EXIT
|
||||
*
|
||||
* Return value should be set to FALSE if the moving atom is unable to leave,
|
||||
* otherwise leave value the result of the parent call
|
||||
*/
|
||||
/atom/Exit(atom/movable/AM, atom/newLoc)
|
||||
. = ..()
|
||||
if(SEND_SIGNAL(src, COMSIG_ATOM_EXIT, AM, newLoc) & COMPONENT_ATOM_BLOCK_EXIT)
|
||||
return FALSE
|
||||
|
||||
/**
|
||||
* An atom has exited this atom's contents
|
||||
*
|
||||
* Default behaviour is to send the COMSIG_ATOM_EXITED
|
||||
*/
|
||||
/atom/Exited(atom/movable/AM, atom/newLoc)
|
||||
SEND_SIGNAL(src, COMSIG_ATOM_EXITED, AM, newLoc)
|
||||
|
||||
///Return atom temperature
|
||||
/atom/proc/return_temperature()
|
||||
return
|
||||
|
||||
// Tool behavior procedure. Redirects to tool-specific procs by default.
|
||||
// You can override it to catch all tool interactions, for use in complex deconstruction procs.
|
||||
// Just don't forget to return ..() in the end.
|
||||
/**
|
||||
*Tool behavior procedure. Redirects to tool-specific procs by default.
|
||||
*
|
||||
* You can override it to catch all tool interactions, for use in complex deconstruction procs.
|
||||
*
|
||||
* Must return parent proc ..() in the end if overridden
|
||||
*/
|
||||
/atom/proc/tool_act(mob/living/user, obj/item/I, tool_type)
|
||||
switch(tool_type)
|
||||
if(TOOL_CROWBAR)
|
||||
@@ -610,13 +921,18 @@
|
||||
if(TOOL_ANALYZER)
|
||||
return analyzer_act(user, I)
|
||||
|
||||
// Tool-specific behavior procs. To be overridden in subtypes.
|
||||
//! Tool-specific behavior procs. To be overridden in subtypes.
|
||||
///
|
||||
|
||||
///Crowbar act
|
||||
/atom/proc/crowbar_act(mob/living/user, obj/item/I)
|
||||
return
|
||||
|
||||
///Multitool act
|
||||
/atom/proc/multitool_act(mob/living/user, obj/item/I)
|
||||
return
|
||||
|
||||
///Check if the multitool has an item in it's data buffer
|
||||
/atom/proc/multitool_check_buffer(user, obj/item/I, silent = FALSE)
|
||||
if(!istype(I, /obj/item/multitool))
|
||||
if(user && !silent)
|
||||
@@ -624,29 +940,35 @@
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
|
||||
///Screwdriver act
|
||||
/atom/proc/screwdriver_act(mob/living/user, obj/item/I)
|
||||
SEND_SIGNAL(src, COMSIG_ATOM_SCREWDRIVER_ACT, user, I)
|
||||
|
||||
///Wrench act
|
||||
/atom/proc/wrench_act(mob/living/user, obj/item/I)
|
||||
return
|
||||
|
||||
///Wirecutter act
|
||||
/atom/proc/wirecutter_act(mob/living/user, obj/item/I)
|
||||
return
|
||||
|
||||
///Welder act
|
||||
/atom/proc/welder_act(mob/living/user, obj/item/I)
|
||||
return
|
||||
|
||||
///Analyzer act
|
||||
/atom/proc/analyzer_act(mob/living/user, obj/item/I)
|
||||
return
|
||||
|
||||
///Generate a tag for this atom
|
||||
/atom/proc/GenerateTag()
|
||||
return
|
||||
|
||||
///Connect this atom to a shuttle
|
||||
/atom/proc/connect_to_shuttle(obj/docking_port/mobile/port, obj/docking_port/stationary/dock, idnum, override=FALSE)
|
||||
return
|
||||
|
||||
// Generic logging helper
|
||||
/// Generic logging helper
|
||||
/atom/proc/log_message(message, message_type, color=null, log_globally=TRUE)
|
||||
if(!log_globally)
|
||||
return
|
||||
@@ -693,13 +1015,13 @@
|
||||
stack_trace("Invalid individual logging type: [message_type]. Defaulting to [LOG_GAME] (LOG_GAME).")
|
||||
log_game(log_text)
|
||||
|
||||
// Helper for logging chat messages or other logs with arbitrary inputs (e.g. announcements)
|
||||
/// Helper for logging chat messages or other logs with arbitrary inputs (e.g. announcements)
|
||||
/atom/proc/log_talk(message, message_type, tag=null, log_globally=TRUE, forced_by=null)
|
||||
var/prefix = tag ? "([tag]) " : ""
|
||||
var/suffix = forced_by ? " FORCED by [forced_by]" : ""
|
||||
log_message("[prefix]\"[message]\"[suffix]", message_type, log_globally=log_globally)
|
||||
|
||||
// Helper for logging of messages with only one sender and receiver
|
||||
/// Helper for logging of messages with only one sender and receiver
|
||||
/proc/log_directed_talk(atom/source, atom/target, message, message_type, tag)
|
||||
if(!tag)
|
||||
stack_trace("Unspecified tag for private message")
|
||||
@@ -709,15 +1031,15 @@
|
||||
if(source != target)
|
||||
target.log_talk(message, message_type, tag="[tag] from [key_name(source)]", log_globally=FALSE)
|
||||
|
||||
/*
|
||||
Proc for attack log creation, because really why not
|
||||
1 argument is the actor performing the action
|
||||
2 argument is the target of the action
|
||||
3 is a verb describing the action (e.g. punched, throwed, kicked, etc.)
|
||||
4 is a tool with which the action was made (usually an item)
|
||||
5 is any additional text, which will be appended to the rest of the log line
|
||||
*/
|
||||
|
||||
/**
|
||||
* Log a combat message in the attack log
|
||||
*
|
||||
* 1 argument is the actor performing the action
|
||||
* 2 argument is the target of the action
|
||||
* 3 is a verb describing the action (e.g. punched, throwed, kicked, etc.)
|
||||
* 4 is a tool with which the action was made (usually an item)
|
||||
* 5 is any additional text, which will be appended to the rest of the log line
|
||||
*/
|
||||
/proc/log_combat(atom/user, atom/target, what_done, atom/object=null, addition=null)
|
||||
var/ssource = key_name(user)
|
||||
var/starget = key_name(target)
|
||||
@@ -741,7 +1063,6 @@ Proc for attack log creation, because really why not
|
||||
var/reverse_message = "has been [what_done] by [ssource][postfix]"
|
||||
target.log_message(reverse_message, LOG_ATTACK, color="orange", log_globally=FALSE)
|
||||
|
||||
// Filter stuff
|
||||
/atom/movable/proc/add_filter(name,priority,list/params)
|
||||
if(!filter_data)
|
||||
filter_data = list()
|
||||
|
||||
Reference in New Issue
Block a user