mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-16 05:02:18 +00:00
Puts is helpers into their own file
This commit is contained in:
53
code/__defines/is_helpers.dm
Normal file
53
code/__defines/is_helpers.dm
Normal file
@@ -0,0 +1,53 @@
|
||||
|
||||
#define isdatum(D) istype(D, /datum)
|
||||
#define isweakref(A) istype(A, /weakref)
|
||||
|
||||
#define islist(D) istype(D, /list)
|
||||
|
||||
//---------------
|
||||
#define isatom(D) istype(D, /atom)
|
||||
|
||||
//---------------
|
||||
//#define isobj(D) istype(D, /obj) //Built in
|
||||
|
||||
#define isitem(D) istype(D, /obj/item)
|
||||
|
||||
#define isairlock(A) istype(A, /obj/machinery/door/airlock)
|
||||
|
||||
#define isorgan(A) istype(A, /obj/item/organ/external)
|
||||
|
||||
//---------------
|
||||
//#define isarea(D) istype(D, /area) //Built in
|
||||
|
||||
//---------------
|
||||
//#define ismob(D) istype(D, /mob) //Built in
|
||||
#define isliving(A) istype(A, /mob/living)
|
||||
|
||||
#define isobserver(A) istype(A, /mob/observer/dead)
|
||||
#define isEye(A) istype(A, /mob/observer/eye)
|
||||
|
||||
#define isnewplayer(A) istype(A, /mob/new_player)
|
||||
|
||||
#define isanimal(A) istype(A, /mob/living/simple_mob)
|
||||
#define ismouse(A) istype(A, /mob/living/simple_mob/animal/passive/mouse)
|
||||
#define iscorgi(A) istype(A, /mob/living/simple_mob/animal/passive/dog/corgi)
|
||||
#define isslime(A) istype(A, /mob/living/simple_mob/slime)
|
||||
#define isxeno(A) istype(A, /mob/living/simple_mob/animal/space/alien)
|
||||
|
||||
#define iscarbon(A) istype(A, /mob/living/carbon)
|
||||
#define isalien(A) istype(A, /mob/living/carbon/alien)
|
||||
#define isbrain(A) istype(A, /mob/living/carbon/brain)
|
||||
#define ishuman(A) istype(A, /mob/living/carbon/human)
|
||||
|
||||
#define issilicon(A) istype(A, /mob/living/silicon)
|
||||
#define isAI(A) istype(A, /mob/living/silicon/ai)
|
||||
#define isrobot(A) istype(A, /mob/living/silicon/robot)
|
||||
#define ispAI(A) istype(A, /mob/living/silicon/pai)
|
||||
|
||||
#define isbot(A) istype(A, /mob/living/bot)
|
||||
|
||||
#define isvoice(A) istype(A, /mob/living/voice)
|
||||
|
||||
//---------------
|
||||
//#define isturf(D) istype(D, /turf) //Built in
|
||||
#define isopenspace(A) istype(A, /turf/simulated/open)
|
||||
@@ -1,57 +1,7 @@
|
||||
#define Clamp(x, y, z) (x <= y ? y : (x >= z ? z : x))
|
||||
|
||||
#define CLAMP01(x) (Clamp(x, 0, 1))
|
||||
|
||||
#define span(class, text) ("<span class='[class]'>[text]</span>")
|
||||
|
||||
#define get_turf(A) get_step(A,0)
|
||||
|
||||
#define isAI(A) istype(A, /mob/living/silicon/ai)
|
||||
|
||||
#define isalien(A) istype(A, /mob/living/carbon/alien)
|
||||
|
||||
#define isanimal(A) istype(A, /mob/living/simple_mob)
|
||||
|
||||
#define isairlock(A) istype(A, /obj/machinery/door/airlock)
|
||||
|
||||
#define isbrain(A) istype(A, /mob/living/carbon/brain)
|
||||
|
||||
#define iscarbon(A) istype(A, /mob/living/carbon)
|
||||
|
||||
#define iscorgi(A) istype(A, /mob/living/simple_mob/animal/passive/dog/corgi)
|
||||
|
||||
#define isEye(A) istype(A, /mob/observer/eye)
|
||||
|
||||
#define ishuman(A) istype(A, /mob/living/carbon/human)
|
||||
|
||||
#define isliving(A) istype(A, /mob/living)
|
||||
|
||||
#define ismouse(A) istype(A, /mob/living/simple_mob/animal/passive/mouse)
|
||||
|
||||
#define isnewplayer(A) istype(A, /mob/new_player)
|
||||
|
||||
#define isobserver(A) istype(A, /mob/observer/dead)
|
||||
|
||||
#define isorgan(A) istype(A, /obj/item/organ/external)
|
||||
|
||||
#define ispAI(A) istype(A, /mob/living/silicon/pai)
|
||||
|
||||
#define isrobot(A) istype(A, /mob/living/silicon/robot)
|
||||
|
||||
#define issilicon(A) istype(A, /mob/living/silicon)
|
||||
|
||||
#define isvoice(A) istype(A, /mob/living/voice)
|
||||
|
||||
#define isslime(A) istype(A, /mob/living/simple_mob/slime)
|
||||
|
||||
#define isbot(A) istype(A, /mob/living/bot)
|
||||
|
||||
#define isxeno(A) istype(A, /mob/living/simple_mob/animal/space/alien)
|
||||
|
||||
#define isopenspace(A) istype(A, /turf/simulated/open)
|
||||
|
||||
#define isweakref(A) istype(A, /weakref)
|
||||
|
||||
#define RANDOM_BLOOD_TYPE pick(4;"O-", 36;"O+", 3;"A-", 28;"A+", 1;"B-", 20;"B+", 1;"AB-", 5;"AB+")
|
||||
|
||||
#define to_chat(target, message) target << message
|
||||
|
||||
@@ -61,9 +61,8 @@
|
||||
|
||||
/datum/proc/vv_get_header()
|
||||
. = list()
|
||||
if("name" in vars)
|
||||
if(("name" in vars) && !isatom(src))
|
||||
. += "<b>[vars["name"]]</b><br>"
|
||||
. += "[type]"
|
||||
|
||||
/datum/proc/on_reagent_change(changetype)
|
||||
return
|
||||
|
||||
@@ -545,8 +545,11 @@
|
||||
|
||||
/atom/vv_get_header()
|
||||
. = ..()
|
||||
var/custom_edit_name
|
||||
if(!isliving(src))
|
||||
custom_edit_name = "<a href='?_src_=vars;datumedit=\ref[src];varnameedit=name'><b>[src]</b></a>"
|
||||
. += {"
|
||||
<a href='?_src_=vars;datumedit=\ref[src];varnameedit=name'><b>[src]</b></a>
|
||||
[custom_edit_name]
|
||||
<br><font size='1'>
|
||||
<a href='?_src_=vars;rotatedatum=\ref[src];rotatedir=left'><<</a>
|
||||
<a href='?_src_=vars;datumedit=\ref[src];varnameedit=dir'>[dir2text(dir)]</a>
|
||||
|
||||
@@ -747,8 +747,8 @@ GLOBAL_DATUM_INIT(sdql2_vv_statobj, /obj/effect/statclick/SDQL2_VV_all, new(null
|
||||
new_args[++new_args.len] = SDQL_expression(source, arg)
|
||||
if(object == GLOB) // Global proc.
|
||||
procname = "/proc/[procname]"
|
||||
return call(procname)(arglist(new_args))
|
||||
return call(object, procname)(arglist(new_args))
|
||||
return superuser? (call(procname)(new_args)) : (WrapAdminProcCall(GLOBAL_PROC, procname, new_args))
|
||||
return superuser? (call(object, procname)(new_args)) : (WrapAdminProcCall(object, procname, new_args))
|
||||
|
||||
/datum/SDQL2_query/proc/SDQL_function_async(datum/object, procname, list/arguments, source)
|
||||
set waitfor = FALSE
|
||||
|
||||
@@ -24,8 +24,6 @@
|
||||
if (!islist)
|
||||
type = D.type
|
||||
|
||||
|
||||
|
||||
if(istype(D, /atom))
|
||||
var/atom/AT = D
|
||||
if(AT.icon && AT.icon_state)
|
||||
@@ -40,7 +38,7 @@
|
||||
var/sprite_text
|
||||
if(sprite)
|
||||
sprite_text = "<img src='vv[hash].png'></td><td>"
|
||||
var/list/header = D.vv_get_header()
|
||||
var/list/header = islist(D)? "<b>/list</b>" : D.vv_get_header()
|
||||
|
||||
var/marked
|
||||
if(holder && holder.marked_datum && holder.marked_datum == D)
|
||||
|
||||
@@ -295,7 +295,7 @@ var/world_topic_spam_protect_time = world.timeofday
|
||||
info["hasbeenrev"] = M.mind ? M.mind.has_been_rev : "No mind"
|
||||
info["stat"] = M.stat
|
||||
info["type"] = M.type
|
||||
if(isliving(M))
|
||||
if(istype(M, /mob/living))
|
||||
var/mob/living/L = M
|
||||
info["damage"] = list2params(list(
|
||||
oxy = L.getOxyLoss(),
|
||||
@@ -664,7 +664,7 @@ proc/establish_old_db_connection()
|
||||
|
||||
// Things to do when a new z-level was just made.
|
||||
/world/proc/max_z_changed()
|
||||
if(!islist(GLOB.players_by_zlevel))
|
||||
if(!istype(GLOB.players_by_zlevel, /list))
|
||||
GLOB.players_by_zlevel = new /list(world.maxz, 0)
|
||||
while(GLOB.players_by_zlevel.len < world.maxz)
|
||||
GLOB.players_by_zlevel.len++
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#include "code\__defines\holomap.dm"
|
||||
#include "code\__defines\integrated_circuits.dm"
|
||||
#include "code\__defines\inventory_sizes.dm"
|
||||
#include "code\__defines\is_helpers.dm"
|
||||
#include "code\__defines\items_clothing.dm"
|
||||
#include "code\__defines\lighting.dm"
|
||||
#include "code\__defines\machinery.dm"
|
||||
|
||||
Reference in New Issue
Block a user