[MIRROR] Replaced body zone magic strings with defines (#6004)

* Replaced body zone magic strings with defines

* merge conflicts
This commit is contained in:
CitadelStationBot
2018-03-19 21:18:57 -05:00
committed by Poojawa
parent 9338d18a28
commit 3d26cd4a6f
148 changed files with 687 additions and 672 deletions

View File

@@ -482,7 +482,7 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
/obj/item/proc/eyestab(mob/living/carbon/M, mob/living/carbon/user)
var/is_human_victim = 0
var/obj/item/bodypart/affecting = M.get_bodypart("head")
var/obj/item/bodypart/affecting = M.get_bodypart(BODY_ZONE_HEAD)
if(ishuman(M))
if(!affecting) //no head!
return

View File

@@ -2,7 +2,7 @@
name = "body egg"
desc = "All slimy and yuck."
icon_state = "innards"
zone = "chest"
zone = BODY_ZONE_CHEST
slot = "parasite_egg"
/obj/item/organ/body_egg/on_find(mob/living/finder)

View File

@@ -129,7 +129,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
reagents.add_reagent_list(list_reagents)
if(starts_lit)
light()
AddComponent(/datum/component/knockoff,90,list("mouth"),list(slot_wear_mask))//90% to knock off when wearing a mask
AddComponent(/datum/component/knockoff,90,list(BODY_ZONE_PRECISE_MOUTH),list(slot_wear_mask))//90% to knock off when wearing a mask
/obj/item/clothing/mask/cigarette/Destroy()
STOP_PROCESSING(SSobj, src)
@@ -546,7 +546,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
if(prot || prob(75))
user.visible_message("After a few attempts, [user] manages to light [src].", "<span class='notice'>After a few attempts, you manage to light [src].</span>")
else
var/hitzone = user.held_index_to_dir(user.active_hand_index) == "r" ? "r_hand" : "l_hand"
var/hitzone = user.held_index_to_dir(user.active_hand_index) == "r" ? BODY_ZONE_PRECISE_R_HAND : BODY_ZONE_PRECISE_L_HAND
user.apply_damage(5, BURN, hitzone)
user.visible_message("<span class='warning'>After a few attempts, [user] manages to light [src] - however, [user.p_they()] burn their finger in the process.</span>", "<span class='warning'>You burn yourself while lighting the lighter!</span>")
GET_COMPONENT_FROM(mood, /datum/component/mood, user)
@@ -800,7 +800,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
vapetime = 0
if(prob(5))//small chance for the vape to break and deal damage if it's emagged
playsound(get_turf(src), 'sound/effects/pop_expl.ogg', 50, 0)
M.apply_damage(20, BURN, "head")
M.apply_damage(20, BURN, BODY_ZONE_HEAD)
M.Knockdown(300, 1, 0)
var/datum/effect_system/spark_spread/sp = new /datum/effect_system/spark_spread
sp.set_up(5, 1, src)

View File

@@ -69,7 +69,7 @@
if(do_after(user, src.cleanspeed, target = target))
to_chat(user, "<span class='notice'>You scrub \the [target.name] out.</span>")
qdel(target)
else if(ishuman(target) && user.zone_selected == "mouth")
else if(ishuman(target) && user.zone_selected == BODY_ZONE_PRECISE_MOUTH)
var/mob/living/carbon/human/H = user
user.visible_message("<span class='warning'>\the [user] washes \the [target]'s mouth out with [src.name]!</span>", "<span class='notice'>You wash \the [target]'s mouth out with [src.name]!</span>") //washes mouth out with soap sounds better than 'the soap' here
H.lip_style = null //removes lipstick

View File

@@ -78,7 +78,7 @@
//you can wipe off lipstick with paper!
/obj/item/paper/attack(mob/M, mob/user)
if(user.zone_selected == "mouth")
if(user.zone_selected == BODY_ZONE_PRECISE_MOUTH)
if(!ismob(M))
return
@@ -109,12 +109,12 @@
/obj/item/razor/suicide_act(mob/living/carbon/user)
user.visible_message("<span class='suicide'>[user] begins shaving [user.p_them()]self without the razor guard! It looks like [user.p_theyre()] trying to commit suicide!</span>")
shave(user, "mouth")
shave(user, "head")//doesnt need to be "head" specifically, but whatever
shave(user, BODY_ZONE_PRECISE_MOUTH)
shave(user, BODY_ZONE_HEAD)//doesnt need to be BODY_ZONE_HEAD specifically, but whatever
return BRUTELOSS
/obj/item/razor/proc/shave(mob/living/carbon/human/H, location = "mouth")
if(location == "mouth")
/obj/item/razor/proc/shave(mob/living/carbon/human/H, location = BODY_ZONE_PRECISE_MOUTH)
if(location == BODY_ZONE_PRECISE_MOUTH)
H.facial_hair_style = "Shaved"
else
H.hair_style = "Skinhead"
@@ -127,10 +127,10 @@
if(ishuman(M))
var/mob/living/carbon/human/H = M
var/location = user.zone_selected
if((location in list("eyes", "mouth", "head")) && !H.get_bodypart("head"))
if((location in list(BODY_ZONE_PRECISE_EYES, BODY_ZONE_PRECISE_MOUTH, BODY_ZONE_HEAD)) && !H.get_bodypart(BODY_ZONE_HEAD))
to_chat(user, "<span class='warning'>[H] doesn't have a head!</span>")
return
if(location == "mouth")
if(location == BODY_ZONE_PRECISE_MOUTH)
if(!(FACEHAIR in H.dna.species.species_traits))
to_chat(user, "<span class='warning'>There is no facial hair to shave!</span>")
return
@@ -158,7 +158,7 @@
"<span class='notice'>You shave [H]'s facial hair clean off.</span>")
shave(H, location)
else if(location == "head")
else if(location == BODY_ZONE_HEAD)
if(!(HAIR in H.dna.species.species_traits))
to_chat(user, "<span class='warning'>There is no hair to shave!</span>")
return

View File

@@ -417,7 +417,7 @@
var/mob/living/carbon/H = M
if(user.zone_selected != "chest")
if(user.zone_selected != BODY_ZONE_CHEST)
to_chat(user, "<span class='warning'>You need to target your patient's chest with [src]!</span>")
return
@@ -507,7 +507,7 @@
H.visible_message("<span class='warning'>[H] thrashes wildly, clutching at their chest!</span>",
"<span class='userdanger'>You feel a horrible agony in your chest!</span>")
H.set_heartattack(TRUE)
H.apply_damage(50, BURN, "chest")
H.apply_damage(50, BURN, BODY_ZONE_CHEST)
add_logs(user, H, "overloaded the heart of", defib)
H.Knockdown(100)
H.Jitter(100)
@@ -626,7 +626,7 @@
icon_state = "defibpaddles0"
item_state = "defibpaddles0"
req_defib = FALSE
/obj/item/twohanded/shockpaddles/cyborg/attack(mob/M, mob/user)
if(iscyborg(user))
var/mob/living/silicon/robot/R = user

View File

@@ -47,7 +47,7 @@
/obj/item/device/flashlight/attack(mob/living/carbon/M, mob/living/carbon/human/user)
add_fingerprint(user)
if(istype(M) && on && user.zone_selected in list("eyes", "mouth"))
if(istype(M) && on && user.zone_selected in list(BODY_ZONE_PRECISE_EYES, BODY_ZONE_PRECISE_MOUTH))
if((user.has_trait(TRAIT_CLUMSY) || user.has_trait(TRAIT_DUMB)) && prob(50)) //too dumb to use flashlight properly
return ..() //just hit them in the head
@@ -56,7 +56,7 @@
to_chat(user, "<span class='warning'>You don't have the dexterity to do this!</span>")
return
if(!M.get_bodypart("head"))
if(!M.get_bodypart(BODY_ZONE_HEAD))
to_chat(user, "<span class='warning'>[M] doesn't have a head!</span>")
return
@@ -65,7 +65,7 @@
return
switch(user.zone_selected)
if("eyes")
if(BODY_ZONE_PRECISE_EYES)
if((M.head && M.head.flags_cover & HEADCOVERSEYES) || (M.wear_mask && M.wear_mask.flags_cover & MASKCOVERSEYES) || (M.glasses && M.glasses.flags_cover & GLASSESCOVERSEYES))
to_chat(user, "<span class='notice'>You're going to need to remove that [(M.head && M.head.flags_cover & HEADCOVERSEYES) ? "helmet" : (M.wear_mask && M.wear_mask.flags_cover & MASKCOVERSEYES) ? "mask": "glasses"] first.</span>")
return
@@ -90,7 +90,7 @@
else //they're okay!
to_chat(user, "<span class='notice'>[M]'s pupils narrow.</span>")
if("mouth")
if(BODY_ZONE_PRECISE_MOUTH)
if((M.head && M.head.flags_cover & HEADCOVERSMOUTH) || (M.wear_mask && M.wear_mask.flags_cover & MASKCOVERSMOUTH))
to_chat(user, "<span class='notice'>You're going to need to remove that [(M.head && M.head.flags_cover & HEADCOVERSMOUTH) ? "helmet" : "mask"] first.</span>")
@@ -100,7 +100,7 @@
var/list/mouth_organs = new
for(var/obj/item/organ/O in M.internal_organs)
if(O.zone == "mouth")
if(O.zone == BODY_ZONE_PRECISE_MOUTH)
mouth_organs.Add(O)
var/organ_list = ""
var/organ_count = LAZYLEN(mouth_organs)
@@ -372,7 +372,7 @@
return TRUE
/obj/item/device/flashlight/emp/attack(mob/living/M, mob/living/user)
if(on && user.zone_selected in list("eyes", "mouth")) // call original attack when examining organs
if(on && user.zone_selected in list(BODY_ZONE_PRECISE_EYES, BODY_ZONE_PRECISE_MOUTH)) // call original attack when examining organs
..()
return

View File

@@ -89,7 +89,7 @@
//human/alien mobs
if(iscarbon(target))
var/mob/living/carbon/C = target
if(user.zone_selected == "eyes")
if(user.zone_selected == BODY_ZONE_PRECISE_EYES)
add_logs(user, C, "shone in the eyes", src)
var/severity = 1

View File

@@ -109,7 +109,7 @@
jill.emote("scream")
playsound(src, 'sound/effects/snap.ogg', 75, TRUE, frequency = 0.5)
playsound(src, 'sound/effects/splat.ogg', 50, TRUE, frequency = 0.5)
jill.apply_damage(9999, BRUTE, "head")
jill.apply_damage(9999, BRUTE, BODY_ZONE_HEAD)
jill.death() //just in case, for some reason, they're still alive
flash_color(jill, flash_color = "#FF0000", flash_time = 100)

View File

@@ -266,12 +266,12 @@
if(isliving(AM))
var/mob/living/L = AM
var/snap = 0
var/def_zone = "chest"
var/def_zone = BODY_ZONE_CHEST
if(iscarbon(L))
var/mob/living/carbon/C = L
snap = 1
if(!C.lying)
def_zone = pick("l_leg", "r_leg")
def_zone = pick(BODY_ZONE_L_LEG, BODY_ZONE_R_LEG)
if(!C.legcuffed && C.get_num_legs() >= 2) //beartrap can't cuff your leg if there's already a beartrap or legcuffs, or you don't have two legs.
C.legcuffed = src
forceMove(C)

View File

@@ -48,7 +48,7 @@
icon_state = "fork"
forkload = null
else if(user.zone_selected == "eyes")
else if(user.zone_selected == BODY_ZONE_PRECISE_EYES)
if(user.has_trait(TRAIT_CLUMSY) && prob(50))
M = user
return eyestab(M,user)
@@ -78,7 +78,7 @@
AddComponent(/datum/component/butchering, 80 - force, 100, force - 10) //bonus chance increases depending on force
/obj/item/kitchen/knife/attack(mob/living/carbon/M, mob/living/carbon/user)
if(user.zone_selected == "eyes")
if(user.zone_selected == BODY_ZONE_PRECISE_EYES)
if(user.has_trait(TRAIT_CLUMSY) && prob(50))
M = user
return eyestab(M,user)

View File

@@ -116,7 +116,7 @@
user.Knockdown(60 * force)
if(ishuman(user))
var/mob/living/carbon/human/H = user
H.apply_damage(2*force, BRUTE, "head")
H.apply_damage(2*force, BRUTE, BODY_ZONE_HEAD)
else
user.take_bodypart_damage(2*force)
return

View File

@@ -70,7 +70,7 @@
switch(mode)
if(0)
if(M.health >= 0)
if(user.zone_selected == "head")
if(user.zone_selected == BODY_ZONE_HEAD)
user.visible_message("<span class='notice'>[user] playfully boops [M] on the head!</span>", \
"<span class='notice'>You playfully boop [M] on the head!</span>")
user.do_attack_animation(M, ATTACK_EFFECT_BOOP)
@@ -95,7 +95,7 @@
if(M.lying)
user.visible_message("<span class='notice'>[user] shakes [M] trying to get [M.p_them()] up!</span>", \
"<span class='notice'>You shake [M] trying to get [M.p_them()] up!</span>")
else if(user.zone_selected == "head")
else if(user.zone_selected == BODY_ZONE_HEAD)
user.visible_message("<span class='warning'>[user] bops [M] on the head!</span>", \
"<span class='warning'>You bop [M] on the head!</span>")
user.do_attack_animation(M, ATTACK_EFFECT_PUNCH)

View File

@@ -215,7 +215,7 @@ GLOBAL_LIST_INIT(bibleitemstates, list("bible", "koran", "scrapbook", "bible",
uses -= 1
to_chat(H, "<span class='userdanger'>You try to open the book AND IT BITES YOU!</span>")
playsound(src.loc, 'sound/effects/snap.ogg', 50, 1)
H.apply_damage(5, BRUTE, pick("l_arm", "r_arm"))
H.apply_damage(5, BRUTE, pick(BODY_ZONE_L_ARM, BODY_ZONE_R_ARM))
to_chat(H, "<span class='notice'>Your name appears on the inside cover, in blood.</span>")
var/ownername = H.real_name
desc += "<span class='warning'>The name [ownername] is written in blood inside the cover.</span>"

View File

@@ -37,7 +37,7 @@
update_icon()
/obj/item/storage/box/suicide_act(mob/living/carbon/user)
var/obj/item/bodypart/head/myhead = user.get_bodypart("head")
var/obj/item/bodypart/head/myhead = user.get_bodypart(BODY_ZONE_HEAD)
if(myhead)
user.visible_message("<span class='suicide'>[user] puts [user.p_their()] head into \the [src], and begins closing it! It looks like [user.p_theyre()] trying to commit suicide!</span>")
myhead.dismember()

View File

@@ -73,7 +73,7 @@
/obj/item/screwdriver/attack(mob/living/carbon/M, mob/living/carbon/user)
if(!istype(M))
return ..()
if(user.zone_selected != "eyes" && user.zone_selected != "head")
if(user.zone_selected != BODY_ZONE_PRECISE_EYES && user.zone_selected != BODY_ZONE_HEAD)
return ..()
if(user.has_trait(TRAIT_CLUMSY) && prob(50))
M = user

View File

@@ -99,7 +99,7 @@
playsound(loc, 'sound/items/jaws_cut.ogg', 50, 1, -1)
if(iscarbon(user))
var/mob/living/carbon/C = user
var/obj/item/bodypart/BP = C.get_bodypart("head")
var/obj/item/bodypart/BP = C.get_bodypart(BODY_ZONE_HEAD)
if(BP)
BP.drop_limb()
playsound(loc,pick('sound/misc/desceration-01.ogg','sound/misc/desceration-02.ogg','sound/misc/desceration-01.ogg') ,50, 1, -1)

View File

@@ -294,7 +294,7 @@
if(wielded)
user.visible_message("<span class='suicide'>[user] begins spinning way too fast! It looks like [user.p_theyre()] trying to commit suicide!</span>")
var/obj/item/bodypart/head/myhead = user.get_bodypart("head")//stole from chainsaw code
var/obj/item/bodypart/head/myhead = user.get_bodypart(BODY_ZONE_HEAD)//stole from chainsaw code
var/obj/item/organ/brain/B = user.getorganslot(ORGAN_SLOT_BRAIN)
B.vital = FALSE//this cant possibly be a good idea
var/randdir
@@ -578,7 +578,7 @@
if(on)
user.visible_message("<span class='suicide'>[user] begins to tear [user.p_their()] head off with [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
playsound(src, 'sound/weapons/chainsawhit.ogg', 100, 1)
var/obj/item/bodypart/head/myhead = user.get_bodypart("head")
var/obj/item/bodypart/head/myhead = user.get_bodypart(BODY_ZONE_HEAD)
if(myhead)
myhead.dismember()
else
@@ -705,14 +705,14 @@
"<span class='warning'>\"As you pick up [src] your arms ignite, reminding you of all your past sins.\"</span>")
if(ishuman(U))
var/mob/living/carbon/human/H = U
H.apply_damage(rand(force/2, force), BURN, pick("l_arm", "r_arm"))
H.apply_damage(rand(force/2, force), BURN, pick(BODY_ZONE_L_ARM, BODY_ZONE_R_ARM))
else
U.adjustFireLoss(rand(force/2,force))
/obj/item/twohanded/pitchfork/demonic/attack(mob/target, mob/living/carbon/human/user)
if(user.mind && user.owns_soul() && !is_devil(user))
to_chat(user, "<span class ='warning'>[src] burns in your hands.</span>")
user.apply_damage(rand(force/2, force), BURN, pick("l_arm", "r_arm"))
user.apply_damage(rand(force/2, force), BURN, pick(BODY_ZONE_L_ARM, BODY_ZONE_R_ARM))
..()
/obj/item/twohanded/pitchfork/demonic/ascended/afterattack(atom/target, mob/user, proximity)

View File

@@ -19,7 +19,7 @@
return (BRUTELOSS|FIRELOSS|TOXLOSS|OXYLOSS)
/obj/item/banhammer/attack(mob/M, mob/user)
if(user.zone_selected == "head")
if(user.zone_selected == BODY_ZONE_HEAD)
M.visible_message("<span class='danger'>[user] are stroking the head of [M] with a bangammer</span>", "<span class='userdanger'>[user] are stroking the head with a bangammer</span>", "you hear a bangammer stroking a head");
else
M.visible_message("<span class='danger'>[M] has been banned FOR NO REISIN by [user]</span>", "<span class='userdanger'>You have been banned FOR NO REISIN by [user]</span>", "you hear a banhammer banning someone")
@@ -605,7 +605,7 @@
if(ishuman(M))
var/mob/living/carbon/human/L = M
L.endTailWag()
if(user.a_intent != INTENT_HARM && ((user.zone_selected == "mouth") || (user.zone_selected == "eyes") || (user.zone_selected == "head")))
if(user.a_intent != INTENT_HARM && ((user.zone_selected == BODY_ZONE_PRECISE_MOUTH) || (user.zone_selected == BODY_ZONE_PRECISE_EYES) || (user.zone_selected == BODY_ZONE_HEAD)))
user.do_attack_animation(M)
playsound(M, 'sound/weapons/slap.ogg', 50, 1, -1)
user.visible_message("<span class='danger'>[user] slaps [M]!</span>",

View File

@@ -217,7 +217,7 @@
H.dna.update_ui_block(DNA_FACIAL_HAIR_COLOR_BLOCK)
H.update_hair()
if("eyes")
if(BODY_ZONE_PRECISE_EYES)
var/new_eye_color = input(H, "Choose your eye color", "Eye Color","#"+H.eye_color) as color|null
if(!Adjacent(user))
return

View File

@@ -466,7 +466,7 @@
return
var/selected_area = parse_zone(user.zone_selected)
var/washing_face = 0
if(selected_area in list("head", "mouth", "eyes"))
if(selected_area in list(BODY_ZONE_HEAD, BODY_ZONE_PRECISE_MOUTH, BODY_ZONE_PRECISE_EYES))
washing_face = 1
user.visible_message("<span class='notice'>[user] starts washing their [washing_face ? "face" : "hands"]...</span>", \
"<span class='notice'>You start washing your [washing_face ? "face" : "hands"]...</span>")