From 879f3faef8aca35ab8cb9ca7aa3b0598901ea84e Mon Sep 17 00:00:00 2001 From: NanakoAC Date: Tue, 22 Nov 2016 18:25:28 +0000 Subject: [PATCH] Istype (#20) Fixes a couple of is errors with missing functions. Added isDrone as macro restored the various is non macro functions. i don't know how or if they could be macro-ized --- code/_macros.dm | 3 +- code/modules/mob/dead/observer/observer.dm | 2 +- code/modules/mob/death.dm | 2 +- code/modules/mob/mob_helpers.dm | 38 ++++++++++++++++++++++ 4 files changed, 42 insertions(+), 3 deletions(-) diff --git a/code/_macros.dm b/code/_macros.dm index aac6910e9f2..0bd37605e4d 100644 --- a/code/_macros.dm +++ b/code/_macros.dm @@ -2,6 +2,7 @@ #define CLAMP01(x) (Clamp(x, 0, 1)) #define isAI(A) istype(A, /mob/living/silicon/ai) +#define isDrone(A) istype(A, /mob/living/silicon/robot/drone) #define isalien(A) istype(A, /mob/living/carbon/alien) @@ -37,4 +38,4 @@ #define issilicon(A) istype(A, /mob/living/silicon) -#define isslime(A) istype(A, /mob/living/carbon/slime) +#define isslime(A) istype(A, /mob/living/carbon/slime) \ No newline at end of file diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 3056e208b25..4d202eb440b 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -182,7 +182,7 @@ Works together with spawning an observer, noted above. //It is also set in the mob/death proc if (isanimal(src)) set_death_time(ANIMAL, world.time) - else if (ispAI(src) || isdrone(src)) + else if (ispAI(src) || isDrone(src)) set_death_time(MINISYNTH, world.time) else set_death_time(CREW, world.time)//Crew is the fallback diff --git a/code/modules/mob/death.dm b/code/modules/mob/death.dm index cc12816bb02..a48dd5ec78c 100644 --- a/code/modules/mob/death.dm +++ b/code/modules/mob/death.dm @@ -82,7 +82,7 @@ timeofdeath = world.time if (isanimal(src)) set_death_time(ANIMAL, world.time) - else if (ispAI(src) || isdrone(src)) + else if (ispAI(src) || isDrone(src)) set_death_time(MINISYNTH, world.time) else if (isliving(src)) set_death_time(CREW, world.time)//Crew is the fallback diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index d0d60e88546..a382b877d1e 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -30,6 +30,44 @@ /mob/living/carbon/human/isMonkey() return istype(species, /datum/species/monkey) + +/proc/ishuman_species(A) + if(istype(A, /mob/living/carbon/human) && (A:get_species() == "Human")) + return 1 + return 0 + +/proc/isunathi(A) + if(istype(A, /mob/living/carbon/human) && (A:get_species() == "Unathi")) + return 1 + return 0 + +/proc/istajara(A) + if(istype(A, /mob/living/carbon/human) && (A:get_species() == "Tajara")) + return 1 + return 0 + +/proc/isskrell(A) + if(istype(A, /mob/living/carbon/human) && (A:get_species() == "Skrell")) + return 1 + return 0 + +/proc/isvaurca(A) + if(istype(A, /mob/living/carbon/human) && (A:get_species() == "Vaurca")) + return 1 + return 0 + +/proc/isipc(A) + if(istype(A, /mob/living/carbon/human) && (A:get_species() == "Machine")) + return 1 + return 0 + +/proc/isvox(A) + if(istype(A, /mob/living/carbon/human) && (A:get_species() == "Vox")) + return 1 + return 0 + + + /mob/proc/is_diona() //returns which type of diona we are, or zero if (istype(src, /mob/living/carbon/human))