[MIRROR] Replaced body zone magic strings with defines (#6004)
* Replaced body zone magic strings with defines * merge conflicts
This commit is contained in:
committed by
Poojawa
parent
9338d18a28
commit
3d26cd4a6f
@@ -10,7 +10,7 @@
|
||||
var/mob/living/carbon/owner = null
|
||||
var/mob/living/carbon/original_owner = null
|
||||
var/status = BODYPART_ORGANIC
|
||||
var/body_zone //"chest", "l_arm", etc , used for def_zone
|
||||
var/body_zone //BODY_ZONE_CHEST, BODY_ZONE_L_ARM, etc , used for def_zone
|
||||
var/aux_zone // used for hands
|
||||
var/aux_layer
|
||||
var/body_part = null //bitflag used to check which clothes cover this bodypart
|
||||
@@ -316,7 +316,7 @@
|
||||
|
||||
var/icon_gender = (body_gender == FEMALE) ? "f" : "m" //gender of the icon, if applicable
|
||||
|
||||
if((body_zone != "head" && body_zone != "chest"))
|
||||
if((body_zone != BODY_ZONE_HEAD && body_zone != BODY_ZONE_CHEST))
|
||||
should_draw_gender = FALSE
|
||||
|
||||
if(status == BODYPART_ORGANIC)
|
||||
@@ -359,11 +359,11 @@
|
||||
qdel(src)
|
||||
|
||||
/obj/item/bodypart/chest
|
||||
name = "chest"
|
||||
name = BODY_ZONE_CHEST
|
||||
desc = "It's impolite to stare at a person's chest."
|
||||
icon_state = "default_human_chest"
|
||||
max_damage = 200
|
||||
body_zone = "chest"
|
||||
body_zone = BODY_ZONE_CHEST
|
||||
body_part = CHEST
|
||||
px_x = 0
|
||||
px_y = 0
|
||||
@@ -413,9 +413,9 @@
|
||||
icon_state = "default_human_l_arm"
|
||||
attack_verb = list("slapped", "punched")
|
||||
max_damage = 50
|
||||
body_zone ="l_arm"
|
||||
body_zone =BODY_ZONE_L_ARM
|
||||
body_part = ARM_LEFT
|
||||
aux_zone = "l_hand"
|
||||
aux_zone = BODY_ZONE_PRECISE_L_HAND
|
||||
aux_layer = HANDS_PART_LAYER
|
||||
held_index = 1
|
||||
px_x = -6
|
||||
@@ -449,9 +449,9 @@
|
||||
icon_state = "default_human_r_arm"
|
||||
attack_verb = list("slapped", "punched")
|
||||
max_damage = 50
|
||||
body_zone = "r_arm"
|
||||
body_zone = BODY_ZONE_R_ARM
|
||||
body_part = ARM_RIGHT
|
||||
aux_zone = "r_hand"
|
||||
aux_zone = BODY_ZONE_PRECISE_R_HAND
|
||||
aux_layer = HANDS_PART_LAYER
|
||||
held_index = 2
|
||||
px_x = 6
|
||||
@@ -485,7 +485,7 @@
|
||||
icon_state = "default_human_l_leg"
|
||||
attack_verb = list("kicked", "stomped")
|
||||
max_damage = 50
|
||||
body_zone = "l_leg"
|
||||
body_zone = BODY_ZONE_L_LEG
|
||||
body_part = LEG_LEFT
|
||||
px_x = -2
|
||||
px_y = 12
|
||||
@@ -523,7 +523,7 @@
|
||||
icon_state = "default_human_r_leg"
|
||||
attack_verb = list("kicked", "stomped")
|
||||
max_damage = 50
|
||||
body_zone = "r_leg"
|
||||
body_zone = BODY_ZONE_R_LEG
|
||||
body_part = LEG_RIGHT
|
||||
px_x = 2
|
||||
px_y = 12
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
if(C.has_trait(TRAIT_NODISMEMBER))
|
||||
return FALSE
|
||||
|
||||
var/obj/item/bodypart/affecting = C.get_bodypart("chest")
|
||||
var/obj/item/bodypart/affecting = C.get_bodypart(BODY_ZONE_CHEST)
|
||||
affecting.receive_damage(CLAMP(brute_dam/2, 15, 50), CLAMP(burn_dam/2, 0, 50)) //Damage the chest based on limb's existing damage
|
||||
C.visible_message("<span class='danger'><B>[C]'s [src.name] has been violently dismembered!</B></span>")
|
||||
C.emote("scream")
|
||||
@@ -61,7 +61,7 @@
|
||||
for(var/X in C.internal_organs)
|
||||
var/obj/item/organ/O = X
|
||||
var/org_zone = check_zone(O.zone)
|
||||
if(org_zone != "chest")
|
||||
if(org_zone != BODY_ZONE_CHEST)
|
||||
continue
|
||||
O.Remove(C)
|
||||
O.forceMove(T)
|
||||
@@ -347,7 +347,7 @@
|
||||
return 0
|
||||
|
||||
/mob/living/carbon/regenerate_limbs(noheal, list/excluded_limbs)
|
||||
var/list/limb_list = list("head", "chest", "r_arm", "l_arm", "r_leg", "l_leg")
|
||||
var/list/limb_list = list(BODY_ZONE_HEAD, BODY_ZONE_CHEST, BODY_ZONE_R_ARM, BODY_ZONE_L_ARM, BODY_ZONE_R_LEG, BODY_ZONE_L_LEG)
|
||||
if(excluded_limbs)
|
||||
limb_list -= excluded_limbs
|
||||
for(var/Z in limb_list)
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
/obj/item/bodypart/head
|
||||
name = "head"
|
||||
name = BODY_ZONE_HEAD
|
||||
desc = "Didn't make sense not to live for fun, your brain gets smart but your head gets dumb."
|
||||
icon = 'icons/mob/human_parts.dmi'
|
||||
icon_state = "default_human_head"
|
||||
max_damage = 200
|
||||
body_zone = "head"
|
||||
body_zone = BODY_ZONE_HEAD
|
||||
body_part = HEAD
|
||||
w_class = WEIGHT_CLASS_BULKY //Quite a hefty load
|
||||
slowdown = 1 //Balancing measure
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/mob/living/carbon/get_bodypart(zone)
|
||||
if(!zone)
|
||||
zone = "chest"
|
||||
zone = BODY_ZONE_CHEST
|
||||
for(var/X in bodyparts)
|
||||
var/obj/item/bodypart/L = X
|
||||
if(L.body_zone == zone)
|
||||
@@ -97,14 +97,14 @@
|
||||
return list()
|
||||
|
||||
/mob/living/carbon/get_missing_limbs()
|
||||
var/list/full = list("head", "chest", "r_arm", "l_arm", "r_leg", "l_leg")
|
||||
var/list/full = list(BODY_ZONE_HEAD, BODY_ZONE_CHEST, BODY_ZONE_R_ARM, BODY_ZONE_L_ARM, BODY_ZONE_R_LEG, BODY_ZONE_L_LEG)
|
||||
for(var/zone in full)
|
||||
if(get_bodypart(zone))
|
||||
full -= zone
|
||||
return full
|
||||
|
||||
/mob/living/carbon/alien/larva/get_missing_limbs()
|
||||
var/list/full = list("head", "chest")
|
||||
var/list/full = list(BODY_ZONE_HEAD, BODY_ZONE_CHEST)
|
||||
for(var/zone in full)
|
||||
if(get_bodypart(zone))
|
||||
full -= zone
|
||||
@@ -137,17 +137,17 @@
|
||||
/mob/living/carbon/proc/newBodyPart(zone, robotic, fixed_icon)
|
||||
var/obj/item/bodypart/L
|
||||
switch(zone)
|
||||
if("l_arm")
|
||||
if(BODY_ZONE_L_ARM)
|
||||
L = new /obj/item/bodypart/l_arm()
|
||||
if("r_arm")
|
||||
if(BODY_ZONE_R_ARM)
|
||||
L = new /obj/item/bodypart/r_arm()
|
||||
if("head")
|
||||
if(BODY_ZONE_HEAD)
|
||||
L = new /obj/item/bodypart/head()
|
||||
if("l_leg")
|
||||
if(BODY_ZONE_L_LEG)
|
||||
L = new /obj/item/bodypart/l_leg()
|
||||
if("r_leg")
|
||||
if(BODY_ZONE_R_LEG)
|
||||
L = new /obj/item/bodypart/r_leg()
|
||||
if("chest")
|
||||
if(BODY_ZONE_CHEST)
|
||||
L = new /obj/item/bodypart/chest()
|
||||
if(L)
|
||||
L.update_limb(fixed_icon, src)
|
||||
@@ -158,17 +158,17 @@
|
||||
/mob/living/carbon/monkey/newBodyPart(zone, robotic, fixed_icon)
|
||||
var/obj/item/bodypart/L
|
||||
switch(zone)
|
||||
if("l_arm")
|
||||
if(BODY_ZONE_L_ARM)
|
||||
L = new /obj/item/bodypart/l_arm/monkey()
|
||||
if("r_arm")
|
||||
if(BODY_ZONE_R_ARM)
|
||||
L = new /obj/item/bodypart/r_arm/monkey()
|
||||
if("head")
|
||||
if(BODY_ZONE_HEAD)
|
||||
L = new /obj/item/bodypart/head/monkey()
|
||||
if("l_leg")
|
||||
if(BODY_ZONE_L_LEG)
|
||||
L = new /obj/item/bodypart/l_leg/monkey()
|
||||
if("r_leg")
|
||||
if(BODY_ZONE_R_LEG)
|
||||
L = new /obj/item/bodypart/r_leg/monkey()
|
||||
if("chest")
|
||||
if(BODY_ZONE_CHEST)
|
||||
L = new /obj/item/bodypart/chest/monkey()
|
||||
if(L)
|
||||
L.update_limb(fixed_icon, src)
|
||||
@@ -179,9 +179,9 @@
|
||||
/mob/living/carbon/alien/larva/newBodyPart(zone, robotic, fixed_icon)
|
||||
var/obj/item/bodypart/L
|
||||
switch(zone)
|
||||
if("head")
|
||||
if(BODY_ZONE_HEAD)
|
||||
L = new /obj/item/bodypart/head/larva()
|
||||
if("chest")
|
||||
if(BODY_ZONE_CHEST)
|
||||
L = new /obj/item/bodypart/chest/larva()
|
||||
if(L)
|
||||
L.update_limb(fixed_icon, src)
|
||||
@@ -192,17 +192,17 @@
|
||||
/mob/living/carbon/alien/humanoid/newBodyPart(zone, robotic, fixed_icon)
|
||||
var/obj/item/bodypart/L
|
||||
switch(zone)
|
||||
if("l_arm")
|
||||
if(BODY_ZONE_L_ARM)
|
||||
L = new /obj/item/bodypart/l_arm/alien()
|
||||
if("r_arm")
|
||||
if(BODY_ZONE_R_ARM)
|
||||
L = new /obj/item/bodypart/r_arm/alien()
|
||||
if("head")
|
||||
if(BODY_ZONE_HEAD)
|
||||
L = new /obj/item/bodypart/head/alien()
|
||||
if("l_leg")
|
||||
if(BODY_ZONE_L_LEG)
|
||||
L = new /obj/item/bodypart/l_leg/alien()
|
||||
if("r_leg")
|
||||
if(BODY_ZONE_R_LEG)
|
||||
L = new /obj/item/bodypart/r_leg/alien()
|
||||
if("chest")
|
||||
if(BODY_ZONE_CHEST)
|
||||
L = new /obj/item/bodypart/chest/alien()
|
||||
if(L)
|
||||
L.update_limb(fixed_icon, src)
|
||||
|
||||
Reference in New Issue
Block a user