Merge pull request #4381 from Tastyfish/macros-macros-everywhere

Some math, mob helper, etc one-liner optimizations
This commit is contained in:
TheDZD
2016-05-09 19:07:13 -04:00
11 changed files with 156 additions and 345 deletions
+1 -181
View File
@@ -1,10 +1,3 @@
// 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/issmall(A)
if(A && istype(A, /mob/living/carbon/human))
var/mob/living/carbon/human/H = A
@@ -12,56 +5,6 @@
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/isfacehugger(A)
if(istype(A, /obj/item/clothing/mask/facehugger))
return 1
return 0
proc/isembryo(A)
if(istype(A, /obj/item/organ/internal/body_egg/alien_embryo))
return 1
return 0
/proc/isslime(A)
if(istype(A, /mob/living/carbon/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/corgi))
return 1
return 0
/proc/ispet(A)
if(istype(A, /mob/living/simple_animal))
var/mob/living/simple_animal/SA = A
@@ -69,46 +12,6 @@ proc/isembryo(A)
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/isbot(A)
if(istype(A, /mob/living/simple_animal/bot))
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
/mob/proc/isSynthetic()
return 0
@@ -119,76 +22,6 @@ proc/isembryo(A)
return 0
return 1
/proc/isAIEye(A)
if(istype(A, /mob/camera/aiEye))
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/isSilicon(A) // Bay support
if(istype(A, /mob/living/silicon))
return 1
return 0
/proc/isliving(A)
if(istype(A, /mob/living))
return 1
return 0
/proc/isswarmer(A)
if(istype(A, /mob/living/simple_animal/hostile/swarmer))
return 1
return 0
/proc/isguardian(A)
if(istype(A, /mob/living/simple_animal/hostile/guardian))
return 1
return 0
/proc/isobserver(A)
if(istype(A, /mob/dead/observer))
return 1
return 0
/proc/isSpirit(A)
if(istype(A, /mob/spirit))
return 1
return 0
proc/isovermind(A)
if(istype(A, /mob/camera/blob))
return 1
return 0
/proc/ismask(A)
if(istype(A, /mob/spirit/mask))
return 1
return 0
/proc/isAutoAnnouncer(A)
if(istype(A, /mob/living/automatedannouncer))
return 1
return 0
/proc/isorgan(A)
if(istype(A, /obj/item/organ/external))
return 1
return 0
/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)
if(L && L.implanted)
@@ -220,14 +53,6 @@ proc/isNonCrewAntag(A)
return 1
proc/isnewplayer(A)
if(istype(A, /mob/new_player))
return 1
return 0
proc/hasorgans(A)
return ishuman(A)
proc/iscuffed(A)
if(istype(A, /mob/living/carbon))
var/mob/living/carbon/C = A
@@ -255,10 +80,6 @@ proc/getsensorlevel(A)
return U.sensor_mode
return SUIT_SENSOR_OFF
/proc/is_admin(var/mob/user)
return check_rights(R_ADMIN, 0, user) != 0
/proc/check_zone(zone)
if(!zone) return "chest"
switch(zone)
@@ -537,8 +358,7 @@ var/list/intents = list(I_HELP,I_DISARM,I_GRAB,I_HARM)
return P
/proc/get_both_hands(mob/living/carbon/M)
var/list/hands = list(M.l_hand, M.r_hand)
return hands
return list(M.l_hand, M.r_hand)
//Direct dead say used both by emote and say