push
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
// Stuff that is relatively "core" and is used in other defines/helpers
|
||||
|
||||
//Returns the hex value of a decimal number
|
||||
//len == length of returned string
|
||||
// #define num2hex(X, len) num2text(X, len, 16) -- NOT YET
|
||||
|
||||
//Returns an integer given a hex input, supports negative values "-ff"
|
||||
//skips preceding invalid characters
|
||||
// #define hex2num(X) text2num(X, 16) -- NO
|
||||
|
||||
/// Stringifies whatever you put into it.
|
||||
#define STRINGIFY(argument) #argument
|
||||
|
||||
/// subtypesof(), typesof() without the parent path
|
||||
#define subtypesof(typepath) ( typesof(typepath) - typepath )
|
||||
|
||||
/// Until a condition is true, sleep
|
||||
#define UNTIL(X) while(!(X)) stoplag()
|
||||
|
||||
/// Sleep if we haven't been deleted
|
||||
/// Otherwise, return
|
||||
#define SLEEP_NOT_DEL(time) \
|
||||
if(QDELETED(src)) { \
|
||||
return; \
|
||||
} \
|
||||
sleep(time);
|
||||
|
||||
/// Takes a datum as input, returns its ref string
|
||||
#define text_ref(datum) ref(datum)
|
||||
|
||||
// Refs contain a type id within their string that can be used to identify byond types.
|
||||
// Custom types that we define don't get a unique id, but this is useful for identifying
|
||||
// types that don't normally have a way to run istype() on them.
|
||||
#define TYPEID(thing) copytext(REF(thing), 4, 6)
|
||||
|
||||
/// A null statement to guard against EmptyBlock lint without necessitating the use of pass()
|
||||
/// Used to avoid proc-call overhead. But use sparingly. Probably pointless in most places.
|
||||
#define EMPTY_BLOCK_GUARD ;
|
||||
@@ -7,8 +7,21 @@
|
||||
|
||||
#define isatom(A) (isloc(A))
|
||||
|
||||
#define isdatum(thing) (istype(thing, /datum))
|
||||
|
||||
#define isweakref(D) (istype(D, /datum/weakref))
|
||||
|
||||
#define isimage(thing) (istype(thing, /image))
|
||||
|
||||
GLOBAL_VAR_INIT(magic_appearance_detecting_image, new /image) // appearances are awful to detect safely, but this seems to be the best way ~ninjanomnom
|
||||
#define isappearance(thing) (!isimage(thing) && !ispath(thing) && istype(GLOB.magic_appearance_detecting_image, thing))
|
||||
|
||||
// The filters list has the same ref type id as a filter, but isnt one and also isnt a list, so we have to check if the thing has Cut() instead
|
||||
GLOBAL_VAR_INIT(refid_filter, TYPEID(filter(type="angular_blur")))
|
||||
#define isfilter(thing) (!hascall(thing, "Cut") && TYPEID(thing) == GLOB.refid_filter)
|
||||
|
||||
#define isgenerator(A) (istype(A, /generator))
|
||||
|
||||
//Turfs
|
||||
//#define isturf(A) (istype(A, /turf)) This is actually a byond built-in. Added here for completeness sake.
|
||||
|
||||
|
||||
@@ -211,10 +211,6 @@ GLOBAL_LIST_EMPTY(bloody_footprints_cache)
|
||||
#define POLLTYPE_IRV "IRV"
|
||||
|
||||
|
||||
|
||||
//subtypesof(), typesof() without the parent path
|
||||
#define subtypesof(typepath) ( typesof(typepath) - typepath )
|
||||
|
||||
//Gets the turf this atom inhabits
|
||||
#define get_turf(A) (get_step(A, 0))
|
||||
|
||||
@@ -550,8 +546,6 @@ GLOBAL_LIST_INIT(pda_reskins, list(
|
||||
#define NIGHTSHIFT_AREA_DEPARTMENT_HALLS 3 //interior hallways, etc
|
||||
#define NIGHTSHIFT_AREA_NONE 4 //default/highest.
|
||||
|
||||
#define UNTIL(X) while(!(X)) stoplag()
|
||||
|
||||
|
||||
//Scavenging element defines for special loot "events".
|
||||
#define SCAVENGING_FOUND_NOTHING "found_nothing"
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#define VV_PROCCALL_RETVAL "Return Value of Proccall"
|
||||
|
||||
#define VV_MSG_MARKED "<br><font size='1' color='red'><b>Marked Object</b></font>"
|
||||
#define VV_MSG_TAGGED(num) "<br><font size='1' color='red'><b>Tagged Datum #[num]</b></font>"
|
||||
#define VV_MSG_EDITED "<br><font size='1' color='red'><b>Var Edited</b></font>"
|
||||
#define VV_MSG_DELETED "<br><font size='1' color='red'><b>Deleted</b></font>"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user