Add some method descriptions from neer's "Common Variables and Functions"

This commit is contained in:
Tad Hardesty
2020-11-29 23:13:04 -08:00
parent eb895036cf
commit f6053f55c9
4 changed files with 17 additions and 6 deletions
+7 -2
View File
@@ -185,10 +185,15 @@ GLOBAL_LIST_EMPTY(bloody_footprints_cache)
//subtypesof(), typesof() without the parent path
#define subtypesof(typepath) ( typesof(typepath) - typepath )
//Gets the turf this atom inhabits
/// Get the turf that `A` resides in, regardless of any containers.
///
/// Use in favor of `A.loc` or `src.loc` so that things work correctly when
/// stored inside an inventory, locker, or other container.
#define get_turf(A) (get_step(A, 0))
//Same as above except gets the area instead
/// Get the ultimate area of `A`, similarly to [get_turf].
///
/// Use instead of `A.loc.loc`.
#define get_area(A) (isarea(A) ? A : get_step(A, 0)?.loc)
//Ghost orbit types:
+1 -1
View File
@@ -229,7 +229,7 @@
return null
//Pick a random element from the list and remove it from the list.
/// Pick a random element from the list and remove it from the list.
/proc/pick_n_take(list/L)
RETURN_TYPE(L[_].type)
if(L.len)
+4 -1
View File
@@ -250,7 +250,10 @@ GLOBAL_LIST_EMPTY(species_list)
return ..()
///Timed action involving one mob user. Target is optional.
/// Timed action involving one mob user. Target is optional.
///
/// Checks that `user` does not move, change hands, get stunned, etc. for the
/// given `delay`. Returns `TRUE` on success or `FALSE` on failure.
/proc/do_after(mob/user, delay, atom/target, timed_action_flags = NONE, progress = TRUE, datum/callback/extra_checks)
if(!user)
return FALSE
+5 -2
View File
@@ -454,6 +454,7 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb
/obj/item/proc/talk_into(mob/M, input, channel, spans, datum/language/language, list/message_mods)
return ITALICS | REDUCE_RANGE
/// Called when a mob drops an item.
/obj/item/proc/dropped(mob/user, silent = FALSE)
SHOULD_CALL_PARENT(TRUE)
for(var/X in actions)
@@ -478,8 +479,10 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb
return
/**
*called after an item is placed in an equipment slot
* Called after an item is placed in an equipment slot.
*
* Note that hands count as slots.
*
* Arguments:
* * user is mob that equipped it
* * slot uses the slot_X defines found in setup.dm for items that can be placed in multiple slots