mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 05:00:55 +01:00
Makes is_type helpers inline
This commit is contained in:
@@ -0,0 +1,71 @@
|
||||
// simple is_type and similar inline helpers
|
||||
|
||||
// MOB HELPERS
|
||||
|
||||
#define ishuman(A) (istype(A, /mob/living/carbon/human))
|
||||
|
||||
#define ismonkey(A) (istype(A, /mob/living/carbon/monkey))
|
||||
|
||||
#define isbrain(A) (istype(A, /mob/living/carbon/brain))
|
||||
|
||||
#define isalien(A) (istype(A, /mob/living/carbon/alien))
|
||||
|
||||
#define isalienadult(A) (istype(A, /mob/living/carbon/alien/humanoid))
|
||||
|
||||
#define islarva(A) (istype(A, /mob/living/carbon/alien/larva))
|
||||
|
||||
#define isslime(A) (istype(A, /mob/living/simple_animal/slime))
|
||||
|
||||
#define isrobot(A) (istype(A, /mob/living/silicon/robot))
|
||||
|
||||
#define isanimal(A) (istype(A, /mob/living/simple_animal))
|
||||
|
||||
#define iscorgi(A) (istype(A, /mob/living/simple_animal/pet/dog/corgi))
|
||||
|
||||
#define iscrab(A) (istype(A, /mob/living/simple_animal/crab))
|
||||
|
||||
#define iscat(A) (istype(A, /mob/living/simple_animal/pet/cat))
|
||||
|
||||
#define ismouse(A) (istype(A, /mob/living/simple_animal/mouse))
|
||||
|
||||
#define isbear(A) (istype(A, /mob/living/simple_animal/hostile/bear))
|
||||
|
||||
#define iscarp(A) (istype(A, /mob/living/simple_animal/hostile/carp))
|
||||
|
||||
#define isclown(A) (istype(A, /mob/living/simple_animal/hostile/retaliate/clown))
|
||||
|
||||
#define isAI(A) (istype(A, /mob/living/silicon/ai))
|
||||
|
||||
#define ispAI(A) (istype(A, /mob/living/silicon/pai))
|
||||
|
||||
#define iscarbon(A) (istype(A, /mob/living/carbon))
|
||||
|
||||
#define issilicon(A) (istype(A, /mob/living/silicon))
|
||||
|
||||
#define isliving(A) (istype(A, /mob/living))
|
||||
|
||||
#define isobserver(A) (istype(A, /mob/dead/observer))
|
||||
|
||||
#define isnewplayer(A) (istype(A, /mob/new_player))
|
||||
|
||||
#define isovermind(A) (istype(A, /mob/camera/blob))
|
||||
|
||||
#define isdrone(A) (istype(A, /mob/living/simple_animal/drone))
|
||||
|
||||
#define isswarmer(A) (istype(A, /mob/living/simple_animal/hostile/swarmer))
|
||||
|
||||
#define islimb(A) (istype(A, /obj/item/organ/limb))
|
||||
|
||||
// ASSEMBLY HELPERS
|
||||
|
||||
#define isassembly(O) (istype(O, /obj/item/device/assembly))
|
||||
|
||||
#define isigniter(O) (istype(O, /obj/item/device/assembly/igniter))
|
||||
|
||||
#define isinfared(O) (istype(O, /obj/item/device/assembly/infra))
|
||||
|
||||
#define isprox(O) (istype(O, /obj/item/device/assembly/prox_sensor))
|
||||
|
||||
#define issignaler(O) (istype(O, /obj/item/device/assembly/signaler))
|
||||
|
||||
#define istimer(O) (istype(O, /obj/item/device/assembly/timer))
|
||||
@@ -1,32 +1,4 @@
|
||||
/proc/isassembly(O)
|
||||
if(istype(O, /obj/item/device/assembly))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/isigniter(O)
|
||||
if(istype(O, /obj/item/device/assembly/igniter))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/isinfared(O)
|
||||
if(istype(O, /obj/item/device/assembly/infra))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/isprox(O)
|
||||
if(istype(O, /obj/item/device/assembly/prox_sensor))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/issignaler(O)
|
||||
if(istype(O, /obj/item/device/assembly/signaler))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/istimer(O)
|
||||
if(istype(O, /obj/item/device/assembly/timer))
|
||||
return 1
|
||||
return 0
|
||||
// See _DEFINES/is_helpers.dm for type helpers
|
||||
|
||||
/*
|
||||
Name: IsSpecialAssembly
|
||||
|
||||
@@ -1,139 +1,5 @@
|
||||
|
||||
// fun if you want to typecast humans/monkeys/etc without writing long path-filled lines.
|
||||
/proc/ishuman(A)
|
||||
if(istype(A, /mob/living/carbon/human))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/ismonkey(A)
|
||||
if(A && istype(A, /mob/living/carbon/monkey))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/isbrain(A)
|
||||
if(A && istype(A, /mob/living/carbon/brain))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/isalien(A)
|
||||
if(istype(A, /mob/living/carbon/alien))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/isalienadult(A)
|
||||
if(istype(A, /mob/living/carbon/alien/humanoid))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/islarva(A)
|
||||
if(istype(A, /mob/living/carbon/alien/larva))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/isslime(A)
|
||||
if(istype(A, /mob/living/simple_animal/slime))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/isrobot(A)
|
||||
if(istype(A, /mob/living/silicon/robot))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/isanimal(A)
|
||||
if(istype(A, /mob/living/simple_animal))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/iscorgi(A)
|
||||
if(istype(A, /mob/living/simple_animal/pet/dog/corgi))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/iscrab(A)
|
||||
if(istype(A, /mob/living/simple_animal/crab))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/iscat(A)
|
||||
if(istype(A, /mob/living/simple_animal/pet/cat))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/ismouse(A)
|
||||
if(istype(A, /mob/living/simple_animal/mouse))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/isbear(A)
|
||||
if(istype(A, /mob/living/simple_animal/hostile/bear))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/iscarp(A)
|
||||
if(istype(A, /mob/living/simple_animal/hostile/carp))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/isclown(A)
|
||||
if(istype(A, /mob/living/simple_animal/hostile/retaliate/clown))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/isAI(A)
|
||||
if(istype(A, /mob/living/silicon/ai))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/ispAI(A)
|
||||
if(istype(A, /mob/living/silicon/pai))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/iscarbon(A)
|
||||
if(istype(A, /mob/living/carbon))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/issilicon(A)
|
||||
if(istype(A, /mob/living/silicon))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/isliving(A)
|
||||
if(istype(A, /mob/living))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/isobserver(A)
|
||||
if(istype(A, /mob/dead/observer))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/isnewplayer(A)
|
||||
if(istype(A, /mob/new_player))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/isovermind(A)
|
||||
if(istype(A, /mob/camera/blob))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/isdrone(A)
|
||||
if(istype(A, /mob/living/simple_animal/drone))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/isswarmer(A)
|
||||
if(istype(A, /mob/living/simple_animal/hostile/swarmer))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/islimb(A)
|
||||
if(istype(A, /obj/item/organ/limb))
|
||||
return 1
|
||||
return 0
|
||||
// see _DEFINES/is_helpers.dm for mob type checks
|
||||
|
||||
/proc/isloyal(A) //Checks to see if the person contains a loyalty implant, then checks that the implant is actually inside of them
|
||||
for(var/obj/item/weapon/implant/loyalty/L in A)
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include "code\__DEFINES\flags.dm"
|
||||
#include "code\__DEFINES\genetics.dm"
|
||||
#include "code\__DEFINES\hud.dm"
|
||||
#include "code\__DEFINES\is_helpers.dm"
|
||||
#include "code\__DEFINES\machines.dm"
|
||||
#include "code\__DEFINES\math.dm"
|
||||
#include "code\__DEFINES\misc.dm"
|
||||
|
||||
Reference in New Issue
Block a user