moved human helpers out of human.dm to new file human_helpers.dm, added two new mon helpers to check for mutations and mutantraces

Signed-off-by: Cael_Aislinn <cael_aislinn@yahoo.com.au>
This commit is contained in:
Cael_Aislinn
2013-09-01 13:37:07 +10:00
parent 4c1bedab22
commit 286ff34588
5 changed files with 130 additions and 123 deletions
+8 -1
View File
@@ -532,4 +532,11 @@
if(istype(wear_mask, /obj/item/clothing/mask/muzzle))
return
..(message)
..(message)
/mob/living/carbon/proc/is_mutantrace(var/mrace)
if(mrace)
if(src.dna && src.dna.mutantrace == mrace)
return 1
else
return src.dna && src.dna.mutantrace ? 1 : 0
+1 -121
View File
@@ -326,15 +326,6 @@
return
/mob/living/carbon/human/restrained()
if (handcuffed)
return 1
if (istype(wear_suit, /obj/item/clothing/suit/straight_jacket))
return 1
return 0
/mob/living/carbon/human/var/co2overloadtime = null
/mob/living/carbon/human/var/temperature_resistance = T0C+75
@@ -394,72 +385,6 @@
if(istype(MB))
MB.RunOver(src)
//gets assignment from ID or ID inside PDA or PDA itself
//Useful when player do something with computers
/mob/living/carbon/human/proc/get_assignment(var/if_no_id = "No id", var/if_no_job = "No job")
var/obj/item/weapon/card/id/id = get_idcard()
if(id)
. = id.assignment
else
var/obj/item/device/pda/pda = wear_id
if(istype(pda))
. = pda.ownjob
else
return if_no_id
if(!.)
return if_no_job
//gets name from ID or ID inside PDA or PDA itself
//Useful when player do something with computers
/mob/living/carbon/human/proc/get_authentification_name(var/if_no_id = "Unknown")
var/obj/item/weapon/card/id/id = get_idcard()
if(id)
return id.registered_name
var/obj/item/device/pda/pda = wear_id
if(istype(pda))
return pda.owner
return if_no_id
//repurposed proc. Now it combines get_id_name() and get_face_name() to determine a mob's name variable. Made into a seperate proc as it'll be useful elsewhere
/mob/living/carbon/human/proc/get_visible_name()
var/face_name = get_face_name("")
var/id_name = get_id_name("")
if(face_name)
if(id_name && (id_name != face_name))
return "[face_name] (as [id_name])"
return face_name
if(id_name)
return id_name
return "Unknown"
//Returns "Unknown" if facially disfigured and real_name if not. Useful for setting name when polyacided or when updating a human's name variable
/mob/living/carbon/human/proc/get_face_name(if_no_face="Unknown")
if( wear_mask && (wear_mask.flags_inv&HIDEFACE) ) //Wearing a mask which hides our face, use id-name if possible
return if_no_face
if( head && (head.flags_inv&HIDEFACE) )
return if_no_face //Likewise for hats
var/datum/limb/O = get_organ("head")
if( (status_flags&DISFIGURED) || (O.brutestate+O.burnstate)>2 || cloneloss>50 || !real_name ) //disfigured. use id-name if possible
return if_no_face
return real_name
//gets name from ID or PDA itself, ID inside PDA doesn't matter
//Useful when player is being seen by other mobs
/mob/living/carbon/human/proc/get_id_name(var/if_no_id = "Unknown")
var/obj/item/weapon/storage/wallet/wallet = wear_id
var/obj/item/device/pda/pda = wear_id
var/obj/item/weapon/card/id/id = wear_id
if(istype(wallet)) id = wallet.front_id
if(istype(id)) . = id.registered_name
else if(istype(pda)) . = pda.owner
if(!.) . = if_no_id //to prevent null-names making the mob unclickable
return
//gets ID card object from special clothes slot or null.
/mob/living/carbon/human/proc/get_idcard()
if(wear_id)
return wear_id.GetID()
//Added a safety check in case you want to shock a human mob directly through electrocute_act.
/mob/living/carbon/human/electrocute_act(var/shock_damage, var/obj/source, var/siemens_coeff = 1.0, var/safety = 0)
if(!safety)
@@ -548,51 +473,6 @@
if(!modified)
usr << "\red Unable to locate a data core entry for this person."
///eyecheck()
///Returns a number between -1 to 2
/mob/living/carbon/human/eyecheck()
var/number = 0
if(istype(src.head, /obj/item/clothing/head)) //are they wearing something on their head
var/obj/item/clothing/head/HFP = src.head //if yes gets the flash protection value from that item
number += HFP.flash_protect
if(istype(src.glasses, /obj/item/clothing/glasses)) //glasses
var/obj/item/clothing/glasses/GFP = src.glasses
number += GFP.flash_protect
if(istype(src.wear_mask, /obj/item/clothing/mask)) //mask
var/obj/item/clothing/mask/MFP = src.wear_mask
number += MFP.flash_protect
return number
///tintcheck()
///Checks eye covering items for visually impairing tinting, such as welding masks
///Checked in life.dm. 0 & 1 = no impairment, 2 = welding mask overlay, 3 = You can see jack, but you can't see shit.
/mob/living/carbon/human/tintcheck()
var/tinted = 0
if(istype(src.head, /obj/item/clothing/head))
var/obj/item/clothing/head/HT = src.head
tinted += HT.tint
if(istype(src.glasses, /obj/item/clothing/glasses))
var/obj/item/clothing/glasses/GT = src.glasses
tinted += GT.tint
if(istype(src.wear_mask, /obj/item/clothing/mask))
var/obj/item/clothing/mask/MT = src.wear_mask
tinted += MT.tint
return tinted
/mob/living/carbon/human/IsAdvancedToolUser()
return 1//Humans can use guns and such
/mob/living/carbon/human/abiotic(var/full_body = 0)
if(full_body && ((src.l_hand && !( src.l_hand.abstract )) || (src.r_hand && !( src.r_hand.abstract )) || (src.back || src.wear_mask || src.head || src.shoes || src.w_uniform || src.wear_suit || src.glasses || src.ears || src.gloves)))
return 1
if( (src.l_hand && !src.l_hand.abstract) || (src.r_hand && !src.r_hand.abstract) )
return 1
return 0
/mob/living/carbon/human/proc/play_xylophone()
if(!src.xylophone)
visible_message("<span class='notice'>[src] begins playing \his ribcage like a xylophone. It's quite spooky.</span>","<span class='notice'>You begin to play a spooky refrain on your ribcage.</span>","You hear a spooky xylophone melody.")
@@ -600,4 +480,4 @@
playsound(loc, song, 50, 1, -1)
xylophone = 1
spawn(1200)
xylophone = 0
xylophone = 0
@@ -0,0 +1,116 @@
/mob/living/carbon/human/restrained()
if (handcuffed)
return 1
if (istype(wear_suit, /obj/item/clothing/suit/straight_jacket))
return 1
return 0
//gets assignment from ID or ID inside PDA or PDA itself
//Useful when player do something with computers
/mob/living/carbon/human/proc/get_assignment(var/if_no_id = "No id", var/if_no_job = "No job")
var/obj/item/weapon/card/id/id = get_idcard()
if(id)
. = id.assignment
else
var/obj/item/device/pda/pda = wear_id
if(istype(pda))
. = pda.ownjob
else
return if_no_id
if(!.)
return if_no_job
//gets name from ID or ID inside PDA or PDA itself
//Useful when player do something with computers
/mob/living/carbon/human/proc/get_authentification_name(var/if_no_id = "Unknown")
var/obj/item/weapon/card/id/id = get_idcard()
if(id)
return id.registered_name
var/obj/item/device/pda/pda = wear_id
if(istype(pda))
return pda.owner
return if_no_id
//repurposed proc. Now it combines get_id_name() and get_face_name() to determine a mob's name variable. Made into a seperate proc as it'll be useful elsewhere
/mob/living/carbon/human/proc/get_visible_name()
var/face_name = get_face_name("")
var/id_name = get_id_name("")
if(face_name)
if(id_name && (id_name != face_name))
return "[face_name] (as [id_name])"
return face_name
if(id_name)
return id_name
return "Unknown"
//Returns "Unknown" if facially disfigured and real_name if not. Useful for setting name when polyacided or when updating a human's name variable
/mob/living/carbon/human/proc/get_face_name(if_no_face="Unknown")
if( wear_mask && (wear_mask.flags_inv&HIDEFACE) ) //Wearing a mask which hides our face, use id-name if possible
return if_no_face
if( head && (head.flags_inv&HIDEFACE) )
return if_no_face //Likewise for hats
var/datum/limb/O = get_organ("head")
if( (status_flags&DISFIGURED) || (O.brutestate+O.burnstate)>2 || cloneloss>50 || !real_name ) //disfigured. use id-name if possible
return if_no_face
return real_name
//gets name from ID or PDA itself, ID inside PDA doesn't matter
//Useful when player is being seen by other mobs
/mob/living/carbon/human/proc/get_id_name(var/if_no_id = "Unknown")
var/obj/item/weapon/storage/wallet/wallet = wear_id
var/obj/item/device/pda/pda = wear_id
var/obj/item/weapon/card/id/id = wear_id
if(istype(wallet)) id = wallet.front_id
if(istype(id)) . = id.registered_name
else if(istype(pda)) . = pda.owner
if(!.) . = if_no_id //to prevent null-names making the mob unclickable
return
//gets ID card object from special clothes slot or null.
/mob/living/carbon/human/proc/get_idcard()
if(wear_id)
return wear_id.GetID()
///eyecheck()
///Returns a number between -1 to 2
/mob/living/carbon/human/eyecheck()
var/number = 0
if(istype(src.head, /obj/item/clothing/head)) //are they wearing something on their head
var/obj/item/clothing/head/HFP = src.head //if yes gets the flash protection value from that item
number += HFP.flash_protect
if(istype(src.glasses, /obj/item/clothing/glasses)) //glasses
var/obj/item/clothing/glasses/GFP = src.glasses
number += GFP.flash_protect
if(istype(src.wear_mask, /obj/item/clothing/mask)) //mask
var/obj/item/clothing/mask/MFP = src.wear_mask
number += MFP.flash_protect
return number
///tintcheck()
///Checks eye covering items for visually impairing tinting, such as welding masks
///Checked in life.dm. 0 & 1 = no impairment, 2 = welding mask overlay, 3 = You can see jack, but you can't see shit.
/mob/living/carbon/human/tintcheck()
var/tinted = 0
if(istype(src.head, /obj/item/clothing/head))
var/obj/item/clothing/head/HT = src.head
tinted += HT.tint
if(istype(src.glasses, /obj/item/clothing/glasses))
var/obj/item/clothing/glasses/GT = src.glasses
tinted += GT.tint
if(istype(src.wear_mask, /obj/item/clothing/mask))
var/obj/item/clothing/mask/MT = src.wear_mask
tinted += MT.tint
return tinted
/mob/living/carbon/human/abiotic(var/full_body = 0)
if(full_body && ((src.l_hand && !( src.l_hand.abstract )) || (src.r_hand && !( src.r_hand.abstract )) || (src.back || src.wear_mask || src.head || src.shoes || src.w_uniform || src.wear_suit || src.glasses || src.ears || src.gloves)))
return 1
if( (src.l_hand && !src.l_hand.abstract) || (src.r_hand && !src.r_hand.abstract) )
return 1
return 0
/mob/living/carbon/human/IsAdvancedToolUser()
return 1//Humans can use guns and such
+4 -1
View File
@@ -441,4 +441,7 @@ proc/is_special_character(mob/M) // returns 1 for special characters and 2 for h
if(M.viruses && (locate(/datum/disease/jungle_fever) in M.viruses))
return 2
return 1
return 0
return 0
/mob/proc/has_mutation(var/mutation)
return mutation in src.mutations ? 1 : 0
+1
View File
@@ -872,6 +872,7 @@
#include "code\modules\mob\living\carbon\human\human_damage.dm"
#include "code\modules\mob\living\carbon\human\human_defense.dm"
#include "code\modules\mob\living\carbon\human\human_defines.dm"
#include "code\modules\mob\living\carbon\human\human_helpers.dm"
#include "code\modules\mob\living\carbon\human\human_movement.dm"
#include "code\modules\mob\living\carbon\human\inventory.dm"
#include "code\modules\mob\living\carbon\human\life.dm"