From 3d26cd4a6f4b6df5c720adbb33fde0ca8d589d05 Mon Sep 17 00:00:00 2001 From: CitadelStationBot Date: Mon, 19 Mar 2018 21:18:57 -0500 Subject: [PATCH] [MIRROR] Replaced body zone magic strings with defines (#6004) * Replaced body zone magic strings with defines * merge conflicts --- code/__DEFINES/combat.dm | 15 + code/__HELPERS/type2type.dm | 32 +- code/__HELPERS/unsorted.dm | 16 +- code/_onclick/hud/screen_objects.dm | 26 +- code/_onclick/other_mobs.dm | 2 +- code/datums/components/caltrop.dm | 2 +- code/datums/datumvars.dm | 4 +- code/datums/diseases/_MobProcs.dm | 6 +- .../diseases/advance/symptoms/itching.dm | 2 +- code/datums/martial/psychotic_brawl.dm | 4 +- code/datums/martial/sleeping_carp.dm | 8 +- code/datums/mutations/sight.dm | 2 +- code/datums/mutations/telekinesis.dm | 2 +- code/datums/status_effects/buffs.dm | 4 +- code/datums/status_effects/debuffs.dm | 8 +- code/datums/traits/negative.dm | 10 +- code/game/machinery/cloning.dm | 2 +- code/game/machinery/doors/airlock.dm | 4 +- code/game/machinery/iv_drip.dm | 2 +- .../mecha/equipment/tools/mining_tools.dm | 4 +- code/game/objects/items.dm | 2 +- code/game/objects/items/body_egg.dm | 2 +- code/game/objects/items/cigs_lighters.dm | 6 +- code/game/objects/items/clown_items.dm | 2 +- code/game/objects/items/cosmetics.dm | 16 +- code/game/objects/items/defib.dm | 6 +- code/game/objects/items/devices/flashlight.dm | 12 +- .../objects/items/devices/laserpointer.dm | 2 +- .../items/devices/reverse_bear_trap.dm | 2 +- code/game/objects/items/handcuffs.dm | 4 +- code/game/objects/items/kitchen.dm | 4 +- code/game/objects/items/melee/misc.dm | 2 +- code/game/objects/items/robot/robot_items.dm | 4 +- code/game/objects/items/storage/book.dm | 2 +- code/game/objects/items/storage/boxes.dm | 2 +- code/game/objects/items/tools/screwdriver.dm | 2 +- code/game/objects/items/tools/wirecutters.dm | 2 +- code/game/objects/items/twohanded.dm | 8 +- code/game/objects/items/weaponry.dm | 4 +- code/game/objects/structures/mirror.dm | 2 +- code/game/objects/structures/watercloset.dm | 2 +- .../abductor/equipment/abduction_surgery.dm | 2 +- .../antagonists/changeling/powers/headcrab.dm | 2 +- .../changeling/powers/mutations.dm | 6 +- .../antagonists/changeling/powers/revive.dm | 70 ++--- .../clockcult/clock_items/clockwork_armor.dm | 12 +- .../clockcult/clock_items/clockwork_slab.dm | 4 +- .../clockcult/clock_items/soul_vessel.dm | 2 +- .../clock_structures/traps/brass_skewer.dm | 4 +- code/modules/antagonists/cult/blood_magic.dm | 4 +- code/modules/antagonists/cult/cult_items.dm | 6 +- code/modules/antagonists/cult/ritual.dm | 2 +- code/modules/antagonists/cult/runes.dm | 2 +- .../antagonists/wizard/equipment/artefact.dm | 12 +- code/modules/assembly/mousetrap.dm | 282 +++++++++--------- .../machinery/pipes/heat_exchange/he_pipes.dm | 2 +- code/modules/client/preferences.dm | 4 +- code/modules/clothing/head/_head.dm | 2 +- code/modules/clothing/neck/_neck.dm | 2 +- code/modules/clothing/shoes/_shoes.dm | 4 +- code/modules/clothing/suits/armor.dm | 2 +- code/modules/food_and_drinks/drinks/drinks.dm | 2 +- .../food_and_drinks/drinks/drinks/bottle.dm | 6 +- .../kitchen_machinery/deep_fryer.dm | 2 +- code/modules/hydroponics/hydroitemdefines.dm | 2 +- code/modules/mob/living/brain/brain_item.dm | 6 +- .../modules/mob/living/carbon/alien/organs.dm | 12 +- .../carbon/alien/special/alien_embryo.dm | 2 +- .../living/carbon/alien/special/facehugger.dm | 4 +- code/modules/mob/living/carbon/carbon.dm | 2 +- .../mob/living/carbon/carbon_defense.dm | 6 +- code/modules/mob/living/carbon/death.dm | 2 +- code/modules/mob/living/carbon/examine.dm | 4 +- .../mob/living/carbon/human/examine.dm | 10 +- .../mob/living/carbon/human/human_defense.dm | 54 ++-- .../mob/living/carbon/human/human_helpers.dm | 2 +- .../mob/living/carbon/human/species.dm | 28 +- .../carbon/human/species_types/dullahan.dm | 6 +- .../carbon/human/species_types/jellypeople.dm | 4 +- .../mob/living/carbon/human/update_icons.dm | 4 +- .../living/carbon/monkey/monkey_defense.dm | 22 +- .../mob/living/carbon/monkey/update_icons.dm | 2 +- .../modules/mob/living/carbon/update_icons.dm | 4 +- code/modules/mob/living/living.dm | 4 +- code/modules/mob/living/living_defense.dm | 2 +- .../mob/living/simple_animal/bot/mulebot.dm | 12 +- .../mob/living/simple_animal/friendly/dog.dm | 6 +- .../hostile/megafauna/bubblegum.dm | 2 +- .../hostile/megafauna/hierophant.dm | 2 +- .../mob/living/simple_animal/parrot.dm | 2 +- code/modules/mob/mob_helpers.dm | 44 +-- code/modules/mob/mob_movement.dm | 22 +- code/modules/mob/transform_procs.dm | 8 +- code/modules/paperwork/paper_cutter.dm | 2 +- code/modules/power/supermatter/supermatter.dm | 2 +- code/modules/projectiles/gun.dm | 8 +- code/modules/projectiles/guns/ballistic.dm | 2 +- .../projectiles/guns/ballistic/revolver.dm | 6 +- .../projectiles/guns/misc/beam_rifle.dm | 2 +- code/modules/projectiles/projectile.dm | 2 +- code/modules/research/experimentor.dm | 6 +- .../advanced/bioware/nerve_grounding.dm | 2 +- .../advanced/bioware/nerve_splicing.dm | 2 +- .../advanced/bioware/vein_threading.dm | 2 +- code/modules/surgery/advanced/brainwashing.dm | 2 +- code/modules/surgery/advanced/lobotomy.dm | 2 +- .../surgery/advanced/necrotic_revival.dm | 2 +- code/modules/surgery/advanced/pacification.dm | 2 +- .../surgery/advanced/reconstruction.dm | 2 +- code/modules/surgery/advanced/revival.dm | 2 +- .../modules/surgery/advanced/viral_bonding.dm | 2 +- code/modules/surgery/amputation.dm | 2 +- code/modules/surgery/bodyparts/bodyparts.dm | 20 +- .../surgery/bodyparts/dismemberment.dm | 6 +- code/modules/surgery/bodyparts/head.dm | 4 +- code/modules/surgery/bodyparts/helpers.dm | 46 +-- code/modules/surgery/brain_surgery.dm | 2 +- code/modules/surgery/cavity_implant.dm | 6 +- code/modules/surgery/core_removal.dm | 70 ++--- code/modules/surgery/dental_implant.dm | 2 +- code/modules/surgery/eye_surgery.dm | 2 +- code/modules/surgery/helpers.dm | 26 +- code/modules/surgery/implant_removal.dm | 2 +- code/modules/surgery/limb_augmentation.dm | 2 +- code/modules/surgery/lipoplasty.dm | 2 +- code/modules/surgery/organ_manipulation.dm | 10 +- code/modules/surgery/organs/appendix.dm | 2 +- code/modules/surgery/organs/augments_arms.dm | 38 +-- code/modules/surgery/organs/augments_chest.dm | 2 +- code/modules/surgery/organs/augments_eyes.dm | 2 +- .../surgery/organs/augments_internal.dm | 4 +- code/modules/surgery/organs/ears.dm | 2 +- code/modules/surgery/organs/eyes.dm | 4 +- code/modules/surgery/organs/heart.dm | 2 +- code/modules/surgery/organs/helpers.dm | 56 ++-- code/modules/surgery/organs/liver.dm | 2 +- code/modules/surgery/organs/lungs.dm | 2 +- code/modules/surgery/organs/organ_internal.dm | 2 +- code/modules/surgery/organs/stomach.dm | 2 +- code/modules/surgery/organs/tails.dm | 2 +- code/modules/surgery/organs/tongue.dm | 2 +- code/modules/surgery/organs/vocal_cords.dm | 6 +- code/modules/surgery/plastic_surgery.dm | 2 +- .../modules/surgery/prosthetic_replacement.dm | 8 +- .../modules/surgery/remove_embedded_object.dm | 2 +- code/modules/surgery/surgery.dm | 2 +- code/modules/zombie/items.dm | 2 +- code/modules/zombie/organs.dm | 2 +- 148 files changed, 687 insertions(+), 672 deletions(-) diff --git a/code/__DEFINES/combat.dm b/code/__DEFINES/combat.dm index 750c107980..98f6c58b34 100644 --- a/code/__DEFINES/combat.dm +++ b/code/__DEFINES/combat.dm @@ -146,3 +146,18 @@ #define GRENADE_CLUMSY_FUMBLE 1 #define GRENADE_NONCLUMSY_FUMBLE 2 #define GRENADE_NO_FUMBLE 3 + +#define BODY_ZONE_HEAD "head" +#define BODY_ZONE_CHEST "chest" +#define BODY_ZONE_L_ARM "l_arm" +#define BODY_ZONE_R_ARM "r_arm" +#define BODY_ZONE_L_LEG "l_leg" +#define BODY_ZONE_R_LEG "r_leg" + +#define BODY_ZONE_PRECISE_EYES "eyes" +#define BODY_ZONE_PRECISE_MOUTH "mouth" +#define BODY_ZONE_PRECISE_GROIN "groin" +#define BODY_ZONE_PRECISE_L_HAND "l_hand" +#define BODY_ZONE_PRECISE_R_HAND "r_hand" +#define BODY_ZONE_PRECISE_L_FOOT "l_foot" +#define BODY_ZONE_PRECISE_R_FOOT "r_foot" diff --git a/code/__HELPERS/type2type.dm b/code/__HELPERS/type2type.dm index c06484f556..d4d69df017 100644 --- a/code/__HELPERS/type2type.dm +++ b/code/__HELPERS/type2type.dm @@ -354,47 +354,47 @@ return 0 if(bpc & FULL_BODY) - covered_parts |= list("l_arm","r_arm","head","chest","l_leg","r_leg") + covered_parts |= list(BODY_ZONE_L_ARM,BODY_ZONE_R_ARM,BODY_ZONE_HEAD,BODY_ZONE_CHEST,BODY_ZONE_L_LEG,BODY_ZONE_R_LEG) else if(bpc & HEAD) - covered_parts |= list("head") + covered_parts |= list(BODY_ZONE_HEAD) if(bpc & CHEST) - covered_parts |= list("chest") + covered_parts |= list(BODY_ZONE_CHEST) if(bpc & GROIN) - covered_parts |= list("chest") + covered_parts |= list(BODY_ZONE_CHEST) if(bpc & ARMS) - covered_parts |= list("l_arm","r_arm") + covered_parts |= list(BODY_ZONE_L_ARM,BODY_ZONE_R_ARM) else if(bpc & ARM_LEFT) - covered_parts |= list("l_arm") + covered_parts |= list(BODY_ZONE_L_ARM) if(bpc & ARM_RIGHT) - covered_parts |= list("r_arm") + covered_parts |= list(BODY_ZONE_R_ARM) if(bpc & HANDS) - covered_parts |= list("l_arm","r_arm") + covered_parts |= list(BODY_ZONE_L_ARM,BODY_ZONE_R_ARM) else if(bpc & HAND_LEFT) - covered_parts |= list("l_arm") + covered_parts |= list(BODY_ZONE_L_ARM) if(bpc & HAND_RIGHT) - covered_parts |= list("r_arm") + covered_parts |= list(BODY_ZONE_R_ARM) if(bpc & LEGS) - covered_parts |= list("l_leg","r_leg") + covered_parts |= list(BODY_ZONE_L_LEG,BODY_ZONE_R_LEG) else if(bpc & LEG_LEFT) - covered_parts |= list("l_leg") + covered_parts |= list(BODY_ZONE_L_LEG) if(bpc & LEG_RIGHT) - covered_parts |= list("r_leg") + covered_parts |= list(BODY_ZONE_R_LEG) if(bpc & FEET) - covered_parts |= list("l_leg","r_leg") + covered_parts |= list(BODY_ZONE_L_LEG,BODY_ZONE_R_LEG) else if(bpc & FOOT_LEFT) - covered_parts |= list("l_leg") + covered_parts |= list(BODY_ZONE_L_LEG) if(bpc & FOOT_RIGHT) - covered_parts |= list("r_leg") + covered_parts |= list(BODY_ZONE_R_LEG) return covered_parts diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index cbd73627ff..a63ff6bdf0 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -736,21 +736,21 @@ Turf and target are separate in case you want to teleport some distance from a t return /proc/parse_zone(zone) - if(zone == "r_hand") + if(zone == BODY_ZONE_PRECISE_R_HAND) return "right hand" - else if (zone == "l_hand") + else if (zone == BODY_ZONE_PRECISE_L_HAND) return "left hand" - else if (zone == "l_arm") + else if (zone == BODY_ZONE_L_ARM) return "left arm" - else if (zone == "r_arm") + else if (zone == BODY_ZONE_R_ARM) return "right arm" - else if (zone == "l_leg") + else if (zone == BODY_ZONE_L_LEG) return "left leg" - else if (zone == "r_leg") + else if (zone == BODY_ZONE_R_LEG) return "right leg" - else if (zone == "l_foot") + else if (zone == BODY_ZONE_PRECISE_L_FOOT) return "left foot" - else if (zone == "r_foot") + else if (zone == BODY_ZONE_PRECISE_R_FOOT) return "right foot" else return zone diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index e582e3ec0b..18cd821399 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -374,7 +374,7 @@ name = "damage zone" icon_state = "zone_sel" screen_loc = ui_zonesel - var/selecting = "chest" + var/selecting = BODY_ZONE_CHEST /obj/screen/zone_sel/Click(location, control,params) if(isobserver(usr)) @@ -389,44 +389,44 @@ if(1 to 9) //Legs switch(icon_x) if(10 to 15) - choice = "r_leg" + choice = BODY_ZONE_R_LEG if(17 to 22) - choice = "l_leg" + choice = BODY_ZONE_L_LEG else return 1 if(10 to 13) //Hands and groin switch(icon_x) if(8 to 11) - choice = "r_arm" + choice = BODY_ZONE_R_ARM if(12 to 20) - choice = "groin" + choice = BODY_ZONE_PRECISE_GROIN if(21 to 24) - choice = "l_arm" + choice = BODY_ZONE_L_ARM else return 1 if(14 to 22) //Chest and arms to shoulders switch(icon_x) if(8 to 11) - choice = "r_arm" + choice = BODY_ZONE_R_ARM if(12 to 20) - choice = "chest" + choice = BODY_ZONE_CHEST if(21 to 24) - choice = "l_arm" + choice = BODY_ZONE_L_ARM else return 1 if(23 to 30) //Head, but we need to check for eye or mouth if(icon_x in 12 to 20) - choice = "head" + choice = BODY_ZONE_HEAD switch(icon_y) if(23 to 24) if(icon_x in 15 to 17) - choice = "mouth" + choice = BODY_ZONE_PRECISE_MOUTH if(26) //Eyeline, eyes are on 15 and 17 if(icon_x in 14 to 18) - choice = "eyes" + choice = BODY_ZONE_PRECISE_EYES if(25 to 27) if(icon_x in 15 to 17) - choice = "eyes" + choice = BODY_ZONE_PRECISE_EYES return set_selected_zone(choice, usr) diff --git a/code/_onclick/other_mobs.dm b/code/_onclick/other_mobs.dm index 587236e802..187fa45c45 100644 --- a/code/_onclick/other_mobs.dm +++ b/code/_onclick/other_mobs.dm @@ -91,7 +91,7 @@ return var/mob/living/carbon/ML = A if(istype(ML)) - var/dam_zone = pick("chest", "l_hand", "r_hand", "l_leg", "r_leg") + var/dam_zone = pick(BODY_ZONE_CHEST, BODY_ZONE_PRECISE_L_HAND, BODY_ZONE_PRECISE_R_HAND, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG) var/obj/item/bodypart/affecting = null if(ishuman(ML)) var/mob/living/carbon/human/H = ML diff --git a/code/datums/components/caltrop.dm b/code/datums/components/caltrop.dm index 9193651ee2..7001523235 100644 --- a/code/datums/components/caltrop.dm +++ b/code/datums/components/caltrop.dm @@ -30,7 +30,7 @@ if((flags & CALTROP_IGNORE_WALKERS) && H.m_intent == MOVE_INTENT_WALK) return - var/picked_def_zone = pick("l_leg", "r_leg") + var/picked_def_zone = pick(BODY_ZONE_L_LEG, BODY_ZONE_R_LEG) var/obj/item/bodypart/O = H.get_bodypart(picked_def_zone) if(!istype(O)) return diff --git a/code/datums/datumvars.dm b/code/datums/datumvars.dm index 3158a2660e..c6c0f2353a 100644 --- a/code/datums/datumvars.dm +++ b/code/datums/datumvars.dm @@ -1178,9 +1178,9 @@ var/edit_action = input(usr, "What would you like to do?","Modify Body Part") as null|anything in list("add","remove", "augment") if(!edit_action) return - var/list/limb_list = list("head", "l_arm", "r_arm", "l_leg", "r_leg") + var/list/limb_list = list(BODY_ZONE_HEAD, BODY_ZONE_L_ARM, BODY_ZONE_R_ARM, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG) if(edit_action == "augment") - limb_list += "chest" + limb_list += BODY_ZONE_CHEST var/result = input(usr, "Please choose which body part to [edit_action]","[capitalize(edit_action)] Body Part") as null|anything in limb_list if(!C) diff --git a/code/datums/diseases/_MobProcs.dm b/code/datums/diseases/_MobProcs.dm index c302059324..1a28c3eadf 100644 --- a/code/datums/diseases/_MobProcs.dm +++ b/code/datums/diseases/_MobProcs.dm @@ -47,13 +47,13 @@ if(satiety>0 && prob(satiety/10)) // positive satiety makes it harder to contract the disease. return if(!target_zone) - target_zone = pick(head_ch;"head",body_ch;"body",hands_ch;"hands",feet_ch;"feet") + target_zone = pick(head_ch;BODY_ZONE_HEAD,body_ch;"body",hands_ch;"hands",feet_ch;"feet") if(ishuman(src)) var/mob/living/carbon/human/H = src switch(target_zone) - if("head") + if(BODY_ZONE_HEAD) if(isobj(H.head) && !istype(H.head, /obj/item/paper)) Cl = H.head passed = prob((Cl.permeability_coefficient*100) - 1) @@ -90,7 +90,7 @@ else if(ismonkey(src)) var/mob/living/carbon/monkey/M = src switch(target_zone) - if("head") + if(BODY_ZONE_HEAD) if(M.wear_mask && isobj(M.wear_mask)) Cl = M.wear_mask passed = prob((Cl.permeability_coefficient*100) - 1) diff --git a/code/datums/diseases/advance/symptoms/itching.dm b/code/datums/diseases/advance/symptoms/itching.dm index 1da9f5e8d7..c1952bf716 100644 --- a/code/datums/diseases/advance/symptoms/itching.dm +++ b/code/datums/diseases/advance/symptoms/itching.dm @@ -45,7 +45,7 @@ BONUS if(!..()) return var/mob/living/carbon/M = A.affected_mob - var/picked_bodypart = pick("head", "chest", "r_arm", "l_arm", "r_leg", "l_leg") + var/picked_bodypart = pick(BODY_ZONE_HEAD, BODY_ZONE_CHEST, BODY_ZONE_R_ARM, BODY_ZONE_L_ARM, BODY_ZONE_R_LEG, BODY_ZONE_L_LEG) var/obj/item/bodypart/bodypart = M.get_bodypart(picked_bodypart) if(bodypart && bodypart.status == BODYPART_ORGANIC && !bodypart.is_pseudopart) //robotic limbs will mean less scratching overall var/can_scratch = scratch && !M.incapacitated() && get_location_accessible(M, picked_bodypart) diff --git a/code/datums/martial/psychotic_brawl.dm b/code/datums/martial/psychotic_brawl.dm index b7b5e27926..ce3463367d 100644 --- a/code/datums/martial/psychotic_brawl.dm +++ b/code/datums/martial/psychotic_brawl.dm @@ -42,8 +42,8 @@ D.visible_message("[A] [atk_verb] [D]!", \ "[A] [atk_verb] you!") playsound(get_turf(D), 'sound/weapons/punch1.ogg', 40, 1, -1) - D.apply_damage(rand(5,10), BRUTE, "head") - A.apply_damage(rand(5,10), BRUTE, "head") + D.apply_damage(rand(5,10), BRUTE, BODY_ZONE_HEAD) + A.apply_damage(rand(5,10), BRUTE, BODY_ZONE_HEAD) if(!istype(D.head,/obj/item/clothing/head/helmet/) && !istype(D.head,/obj/item/clothing/head/hardhat)) D.adjustBrainLoss(5) A.Stun(rand(10,45)) diff --git a/code/datums/martial/sleeping_carp.dm b/code/datums/martial/sleeping_carp.dm index 024bacf6bb..743738e9a9 100644 --- a/code/datums/martial/sleeping_carp.dm +++ b/code/datums/martial/sleeping_carp.dm @@ -42,7 +42,7 @@ playsound(get_turf(A), 'sound/weapons/thudswoosh.ogg', 50, 1, -1) D.emote("scream") D.dropItemToGround(D.get_active_held_item()) - D.apply_damage(5, BRUTE, pick("l_arm", "r_arm")) + D.apply_damage(5, BRUTE, pick(BODY_ZONE_L_ARM, BODY_ZONE_R_ARM)) D.Knockdown(60)//CIT CHANGE - makes sleepingcarp use knockdown() for its stuns instead of stun() return 1 add_logs(A, D, "wrist wrenched (Sleeping Carp)") @@ -78,7 +78,7 @@ A.do_attack_animation(D, ATTACK_EFFECT_KICK) D.visible_message("[A] kicks [D] in the head!", \ "[A] kicks you in the jaw!") - D.apply_damage(20, BRUTE, "head") + D.apply_damage(20, BRUTE, BODY_ZONE_HEAD) D.drop_all_held_items() playsound(get_turf(D), 'sound/weapons/punch1.ogg', 50, 1, -1) D.Knockdown(80)//CIT CHANGE - makes sleepingcarp use knockdown() for its stuns instead of stun() @@ -93,7 +93,7 @@ "[A] piledrives you with their elbow!") if(D.stat) D.death() //FINISH HIM! - D.apply_damage(50, BRUTE, "chest") + D.apply_damage(50, BRUTE, BODY_ZONE_CHEST) playsound(get_turf(D), 'sound/weapons/punch1.ogg', 75, 1, -1) return 1 add_logs(A, D, "elbow dropped (Sleeping Carp)") @@ -202,7 +202,7 @@ user.Knockdown(60) 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 diff --git a/code/datums/mutations/sight.dm b/code/datums/mutations/sight.dm index 60f5d75c5e..464d435afd 100644 --- a/code/datums/mutations/sight.dm +++ b/code/datums/mutations/sight.dm @@ -60,7 +60,7 @@ dna_block = NON_SCANNABLE text_gain_indication = "You feel pressure building up behind your eyes." layer_used = FRONT_MUTATIONS_LAYER - limb_req = "head" + limb_req = BODY_ZONE_HEAD /datum/mutation/human/laser_eyes/New() ..() diff --git a/code/datums/mutations/telekinesis.dm b/code/datums/mutations/telekinesis.dm index 3aa562ee74..a5b15eacb8 100644 --- a/code/datums/mutations/telekinesis.dm +++ b/code/datums/mutations/telekinesis.dm @@ -5,7 +5,7 @@ get_chance = 20 lowest_value = 256 * 12 text_gain_indication = "You feel smarter!" - limb_req = "head" + limb_req = BODY_ZONE_HEAD /datum/mutation/human/telekinesis/New() ..() diff --git a/code/datums/status_effects/buffs.dm b/code/datums/status_effects/buffs.dm index 63b5ca81ba..6fb7637f82 100644 --- a/code/datums/status_effects/buffs.dm +++ b/code/datums/status_effects/buffs.dm @@ -499,11 +499,11 @@ if(!itemUser.has_hand_for_held_index(hand)) //If user does not have the corresponding hand anymore, give them one and return the rod to their hand if(((hand % 2) == 0)) - var/obj/item/bodypart/L = itemUser.newBodyPart("r_arm", FALSE, FALSE) + var/obj/item/bodypart/L = itemUser.newBodyPart(BODY_ZONE_R_ARM, FALSE, FALSE) L.attach_limb(itemUser) itemUser.put_in_hand(newRod, hand, forced = TRUE) else - var/obj/item/bodypart/L = itemUser.newBodyPart("l_arm", FALSE, FALSE) + var/obj/item/bodypart/L = itemUser.newBodyPart(BODY_ZONE_L_ARM, FALSE, FALSE) L.attach_limb(itemUser) itemUser.put_in_hand(newRod, hand, forced = TRUE) to_chat(itemUser, "Your arm suddenly grows back with the Rod of Asclepius still attached!") diff --git a/code/datums/status_effects/debuffs.dm b/code/datums/status_effects/debuffs.dm index 915d5bce8d..584e689d74 100644 --- a/code/datums/status_effects/debuffs.dm +++ b/code/datums/status_effects/debuffs.dm @@ -130,11 +130,11 @@ if(GLOB.ratvar_awakens) owner.Knockdown(20) if(iscultist(owner)) - owner.apply_damage(cultist_damage_on_toggle * 0.5, BURN, "l_leg") - owner.apply_damage(cultist_damage_on_toggle * 0.5, BURN, "r_leg") + owner.apply_damage(cultist_damage_on_toggle * 0.5, BURN, BODY_ZONE_L_LEG) + owner.apply_damage(cultist_damage_on_toggle * 0.5, BURN, BODY_ZONE_R_LEG) else - owner.apply_damage(leg_damage_on_toggle * 0.5, BURN, "l_leg") - owner.apply_damage(leg_damage_on_toggle * 0.5, BURN, "r_leg") + owner.apply_damage(leg_damage_on_toggle * 0.5, BURN, BODY_ZONE_L_LEG) + owner.apply_damage(leg_damage_on_toggle * 0.5, BURN, BODY_ZONE_R_LEG) if(owner.m_intent != MOVE_INTENT_WALK) if(!iscultist(owner)) to_chat(owner, "Your leg[number_legs > 1 ? "s shiver":" shivers"] with pain!") diff --git a/code/datums/traits/negative.dm b/code/datums/traits/negative.dm index 56e2947059..59957ef2bc 100644 --- a/code/datums/traits/negative.dm +++ b/code/datums/traits/negative.dm @@ -85,21 +85,21 @@ var/slot_string = "limb" /datum/trait/prosthetic_limb/on_spawn() - var/limb_slot = pick("l_arm", "r_arm", "l_leg", "r_leg") + var/limb_slot = pick(BODY_ZONE_L_ARM, BODY_ZONE_R_ARM, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG) var/mob/living/carbon/human/H = trait_holder var/obj/item/bodypart/old_part = H.get_bodypart(limb_slot) var/obj/item/bodypart/prosthetic switch(limb_slot) - if("l_arm") + if(BODY_ZONE_L_ARM) prosthetic = new/obj/item/bodypart/l_arm/robot/surplus(trait_holder) slot_string = "left arm" - if("r_arm") + if(BODY_ZONE_R_ARM) prosthetic = new/obj/item/bodypart/r_arm/robot/surplus(trait_holder) slot_string = "right arm" - if("l_leg") + if(BODY_ZONE_L_LEG) prosthetic = new/obj/item/bodypart/l_leg/robot/surplus(trait_holder) slot_string = "left leg" - if("r_leg") + if(BODY_ZONE_R_LEG) prosthetic = new/obj/item/bodypart/r_leg/robot/surplus(trait_holder) slot_string = "right leg" prosthetic.replace_limb(H) diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm index 36e06663f6..d540f84b51 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -449,7 +449,7 @@ // brain function, they also have no limbs or internal organs. if(!H.has_trait(TRAIT_NODISMEMBER)) - var/static/list/zones = list("r_arm", "l_arm", "r_leg", "l_leg") + var/static/list/zones = list(BODY_ZONE_R_ARM, BODY_ZONE_L_ARM, BODY_ZONE_R_LEG, BODY_ZONE_L_LEG) for(var/zone in zones) var/obj/item/bodypart/BP = H.get_bodypart(zone) if(BP) diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 134aba6b27..c557223881 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -746,7 +746,7 @@ H.visible_message("[user] headbutts the airlock.", \ "You headbutt the airlock!") H.Knockdown(100) - H.apply_damage(10, BRUTE, "head") + H.apply_damage(10, BRUTE, BODY_ZONE_HEAD) else visible_message("[user] headbutts the airlock. Good thing [user.p_theyre()] wearing a helmet.") return @@ -1085,7 +1085,7 @@ H.Unconscious(160) H.adjust_fire_stacks(20) H.IgniteMob() //Guaranteed knockout and ignition for nearby people - H.apply_damage(40, BRUTE, "chest") + H.apply_damage(40, BRUTE, BODY_ZONE_CHEST) return if(forced < 2) if(obj_flags & EMAGGED) diff --git a/code/game/machinery/iv_drip.dm b/code/game/machinery/iv_drip.dm index 7aa3859cdf..2442e40943 100644 --- a/code/game/machinery/iv_drip.dm +++ b/code/game/machinery/iv_drip.dm @@ -114,7 +114,7 @@ if(!(get_dist(src, attached) <= 1 && isturf(attached.loc))) to_chat(attached, "The IV drip needle is ripped out of you!") - attached.apply_damage(3, BRUTE, pick("r_arm", "l_arm")) + attached.apply_damage(3, BRUTE, pick(BODY_ZONE_R_ARM, BODY_ZONE_L_ARM)) attached = null update_icon() return PROCESS_KILL diff --git a/code/game/mecha/equipment/tools/mining_tools.dm b/code/game/mecha/equipment/tools/mining_tools.dm index 71790e0a44..de19c28ef6 100644 --- a/code/game/mecha/equipment/tools/mining_tools.dm +++ b/code/game/mecha/equipment/tools/mining_tools.dm @@ -121,8 +121,8 @@ target.gib() else //drill makes a hole - var/obj/item/bodypart/target_part = target.get_bodypart(ran_zone("chest")) - target.apply_damage(10, BRUTE, "chest", target.run_armor_check(target_part, "melee")) + var/obj/item/bodypart/target_part = target.get_bodypart(ran_zone(BODY_ZONE_CHEST)) + target.apply_damage(10, BRUTE, BODY_ZONE_CHEST, target.run_armor_check(target_part, "melee")) //blood splatters var/splatter_dir = get_dir(chassis, target) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index b5c4e5bfb8..d19f9d1ab6 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -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 diff --git a/code/game/objects/items/body_egg.dm b/code/game/objects/items/body_egg.dm index 13dd2c1f18..a8f5894b7c 100644 --- a/code/game/objects/items/body_egg.dm +++ b/code/game/objects/items/body_egg.dm @@ -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) diff --git a/code/game/objects/items/cigs_lighters.dm b/code/game/objects/items/cigs_lighters.dm index f2b656a074..b9f2276e23 100644 --- a/code/game/objects/items/cigs_lighters.dm +++ b/code/game/objects/items/cigs_lighters.dm @@ -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].", "After a few attempts, you manage to light [src].") 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("After a few attempts, [user] manages to light [src] - however, [user.p_they()] burn their finger in the process.", "You burn yourself while lighting the lighter!") 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) diff --git a/code/game/objects/items/clown_items.dm b/code/game/objects/items/clown_items.dm index 376f003232..ab30e7ea18 100644 --- a/code/game/objects/items/clown_items.dm +++ b/code/game/objects/items/clown_items.dm @@ -69,7 +69,7 @@ if(do_after(user, src.cleanspeed, target = target)) to_chat(user, "You scrub \the [target.name] out.") 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("\the [user] washes \the [target]'s mouth out with [src.name]!", "You wash \the [target]'s mouth out with [src.name]!") //washes mouth out with soap sounds better than 'the soap' here H.lip_style = null //removes lipstick diff --git a/code/game/objects/items/cosmetics.dm b/code/game/objects/items/cosmetics.dm index 9f1e05599d..8475e7d00e 100644 --- a/code/game/objects/items/cosmetics.dm +++ b/code/game/objects/items/cosmetics.dm @@ -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("[user] begins shaving [user.p_them()]self without the razor guard! It looks like [user.p_theyre()] trying to commit suicide!") - 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, "[H] doesn't have a head!") return - if(location == "mouth") + if(location == BODY_ZONE_PRECISE_MOUTH) if(!(FACEHAIR in H.dna.species.species_traits)) to_chat(user, "There is no facial hair to shave!") return @@ -158,7 +158,7 @@ "You shave [H]'s facial hair clean off.") shave(H, location) - else if(location == "head") + else if(location == BODY_ZONE_HEAD) if(!(HAIR in H.dna.species.species_traits)) to_chat(user, "There is no hair to shave!") return diff --git a/code/game/objects/items/defib.dm b/code/game/objects/items/defib.dm index e3194cd1a7..e52231f64f 100644 --- a/code/game/objects/items/defib.dm +++ b/code/game/objects/items/defib.dm @@ -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, "You need to target your patient's chest with [src]!") return @@ -507,7 +507,7 @@ H.visible_message("[H] thrashes wildly, clutching at their chest!", "You feel a horrible agony in your chest!") 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 diff --git a/code/game/objects/items/devices/flashlight.dm b/code/game/objects/items/devices/flashlight.dm index f8ffc8aafb..13e5105439 100644 --- a/code/game/objects/items/devices/flashlight.dm +++ b/code/game/objects/items/devices/flashlight.dm @@ -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, "You don't have the dexterity to do this!") return - if(!M.get_bodypart("head")) + if(!M.get_bodypart(BODY_ZONE_HEAD)) to_chat(user, "[M] doesn't have a head!") 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, "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.") return @@ -90,7 +90,7 @@ else //they're okay! to_chat(user, "[M]'s pupils narrow.") - 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, "You're going to need to remove that [(M.head && M.head.flags_cover & HEADCOVERSMOUTH) ? "helmet" : "mask"] first.") @@ -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 diff --git a/code/game/objects/items/devices/laserpointer.dm b/code/game/objects/items/devices/laserpointer.dm index 2e65a6c108..098643e87f 100644 --- a/code/game/objects/items/devices/laserpointer.dm +++ b/code/game/objects/items/devices/laserpointer.dm @@ -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 diff --git a/code/game/objects/items/devices/reverse_bear_trap.dm b/code/game/objects/items/devices/reverse_bear_trap.dm index dbdddb829b..0d41b12ccd 100644 --- a/code/game/objects/items/devices/reverse_bear_trap.dm +++ b/code/game/objects/items/devices/reverse_bear_trap.dm @@ -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) diff --git a/code/game/objects/items/handcuffs.dm b/code/game/objects/items/handcuffs.dm index 3a66268bd3..c8c43bc521 100644 --- a/code/game/objects/items/handcuffs.dm +++ b/code/game/objects/items/handcuffs.dm @@ -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) diff --git a/code/game/objects/items/kitchen.dm b/code/game/objects/items/kitchen.dm index abdca9e77a..c6b2a85d34 100644 --- a/code/game/objects/items/kitchen.dm +++ b/code/game/objects/items/kitchen.dm @@ -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) diff --git a/code/game/objects/items/melee/misc.dm b/code/game/objects/items/melee/misc.dm index 7d74a00ce6..a78ba00bd6 100644 --- a/code/game/objects/items/melee/misc.dm +++ b/code/game/objects/items/melee/misc.dm @@ -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 diff --git a/code/game/objects/items/robot/robot_items.dm b/code/game/objects/items/robot/robot_items.dm index 4851e111a8..11712f475f 100644 --- a/code/game/objects/items/robot/robot_items.dm +++ b/code/game/objects/items/robot/robot_items.dm @@ -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("[user] playfully boops [M] on the head!", \ "You playfully boop [M] on the head!") user.do_attack_animation(M, ATTACK_EFFECT_BOOP) @@ -95,7 +95,7 @@ if(M.lying) user.visible_message("[user] shakes [M] trying to get [M.p_them()] up!", \ "You shake [M] trying to get [M.p_them()] up!") - else if(user.zone_selected == "head") + else if(user.zone_selected == BODY_ZONE_HEAD) user.visible_message("[user] bops [M] on the head!", \ "You bop [M] on the head!") user.do_attack_animation(M, ATTACK_EFFECT_PUNCH) diff --git a/code/game/objects/items/storage/book.dm b/code/game/objects/items/storage/book.dm index cea183d493..5e8b78769e 100644 --- a/code/game/objects/items/storage/book.dm +++ b/code/game/objects/items/storage/book.dm @@ -215,7 +215,7 @@ GLOBAL_LIST_INIT(bibleitemstates, list("bible", "koran", "scrapbook", "bible", uses -= 1 to_chat(H, "You try to open the book AND IT BITES YOU!") 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, "Your name appears on the inside cover, in blood.") var/ownername = H.real_name desc += "The name [ownername] is written in blood inside the cover." diff --git a/code/game/objects/items/storage/boxes.dm b/code/game/objects/items/storage/boxes.dm index 9987784f97..6d62ac9e77 100644 --- a/code/game/objects/items/storage/boxes.dm +++ b/code/game/objects/items/storage/boxes.dm @@ -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("[user] puts [user.p_their()] head into \the [src], and begins closing it! It looks like [user.p_theyre()] trying to commit suicide!") myhead.dismember() diff --git a/code/game/objects/items/tools/screwdriver.dm b/code/game/objects/items/tools/screwdriver.dm index 530580fab5..56537e703a 100644 --- a/code/game/objects/items/tools/screwdriver.dm +++ b/code/game/objects/items/tools/screwdriver.dm @@ -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 diff --git a/code/game/objects/items/tools/wirecutters.dm b/code/game/objects/items/tools/wirecutters.dm index d2981fc839..f189c26bb2 100644 --- a/code/game/objects/items/tools/wirecutters.dm +++ b/code/game/objects/items/tools/wirecutters.dm @@ -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) diff --git a/code/game/objects/items/twohanded.dm b/code/game/objects/items/twohanded.dm index 8ae0508492..774ff2f7ce 100644 --- a/code/game/objects/items/twohanded.dm +++ b/code/game/objects/items/twohanded.dm @@ -294,7 +294,7 @@ if(wielded) user.visible_message("[user] begins spinning way too fast! It looks like [user.p_theyre()] trying to commit suicide!") - 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("[user] begins to tear [user.p_their()] head off with [src]! It looks like [user.p_theyre()] trying to commit suicide!") 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 @@ "\"As you pick up [src] your arms ignite, reminding you of all your past sins.\"") 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, "[src] burns in your hands.") - 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) diff --git a/code/game/objects/items/weaponry.dm b/code/game/objects/items/weaponry.dm index 713f5761c0..c0802dfb55 100644 --- a/code/game/objects/items/weaponry.dm +++ b/code/game/objects/items/weaponry.dm @@ -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("[user] are stroking the head of [M] with a bangammer", "[user] are stroking the head with a bangammer", "you hear a bangammer stroking a head"); else M.visible_message("[M] has been banned FOR NO REISIN by [user]", "You have been banned FOR NO REISIN by [user]", "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("[user] slaps [M]!", diff --git a/code/game/objects/structures/mirror.dm b/code/game/objects/structures/mirror.dm index 65b6e97a70..23d7682792 100644 --- a/code/game/objects/structures/mirror.dm +++ b/code/game/objects/structures/mirror.dm @@ -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 diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm index 047408c760..81a08c77a1 100644 --- a/code/game/objects/structures/watercloset.dm +++ b/code/game/objects/structures/watercloset.dm @@ -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("[user] starts washing their [washing_face ? "face" : "hands"]...", \ "You start washing your [washing_face ? "face" : "hands"]...") diff --git a/code/modules/antagonists/abductor/equipment/abduction_surgery.dm b/code/modules/antagonists/abductor/equipment/abduction_surgery.dm index 656fb61f43..819dbafd6a 100644 --- a/code/modules/antagonists/abductor/equipment/abduction_surgery.dm +++ b/code/modules/antagonists/abductor/equipment/abduction_surgery.dm @@ -1,7 +1,7 @@ /datum/surgery/organ_extraction name = "experimental dissection" steps = list(/datum/surgery_step/incise, /datum/surgery_step/clamp_bleeders, /datum/surgery_step/retract_skin, /datum/surgery_step/incise, /datum/surgery_step/extract_organ, /datum/surgery_step/gland_insert) - possible_locs = list("chest") + possible_locs = list(BODY_ZONE_CHEST) ignore_clothes = 1 /datum/surgery/organ_extraction/can_start(mob/user, mob/living/carbon/target) diff --git a/code/modules/antagonists/changeling/powers/headcrab.dm b/code/modules/antagonists/changeling/powers/headcrab.dm index 673212ab23..70edf1e788 100644 --- a/code/modules/antagonists/changeling/powers/headcrab.dm +++ b/code/modules/antagonists/changeling/powers/headcrab.dm @@ -11,7 +11,7 @@ if(alert("Are we sure we wish to kill ourself and create a headslug?",,"Yes", "No") == "No") return var/datum/mind/M = user.mind - var/list/organs = user.getorganszone("head", 1) + var/list/organs = user.getorganszone(BODY_ZONE_HEAD, 1) for(var/obj/item/organ/I in organs) I.Remove(user, 1) diff --git a/code/modules/antagonists/changeling/powers/mutations.dm b/code/modules/antagonists/changeling/powers/mutations.dm index d176de0ccd..e3fb55fa42 100644 --- a/code/modules/antagonists/changeling/powers/mutations.dm +++ b/code/modules/antagonists/changeling/powers/mutations.dm @@ -43,9 +43,9 @@ return var/limb_regen = 0 if(user.active_hand_index % 2 == 0) //we regen the arm before changing it into the weapon - limb_regen = user.regenerate_limb("r_arm", 1) + limb_regen = user.regenerate_limb(BODY_ZONE_R_ARM, 1) else - limb_regen = user.regenerate_limb("l_arm", 1) + limb_regen = user.regenerate_limb(BODY_ZONE_L_ARM, 1) if(limb_regen) user.visible_message("[user]'s missing arm reforms, making a loud, grotesque sound!", "Your arm regrows, making a loud, crunchy sound and giving you great pain!", "You hear organic matter ripping and tearing!") user.emote("scream") @@ -307,7 +307,7 @@ for(var/obj/item/I in H.held_items) if(I.is_sharp()) C.visible_message("[H] impales [C] with [H.p_their()] [I.name]!", "[H] impales you with [H.p_their()] [I.name]!") - C.apply_damage(I.force, BRUTE, "chest") + C.apply_damage(I.force, BRUTE, BODY_ZONE_CHEST) H.do_item_attack_animation(C, used_item = I) H.add_mob_blood(C) playsound(get_turf(H),I.hitsound,75,1) diff --git a/code/modules/antagonists/changeling/powers/revive.dm b/code/modules/antagonists/changeling/powers/revive.dm index 4165eeeff2..4dcc87ce74 100644 --- a/code/modules/antagonists/changeling/powers/revive.dm +++ b/code/modules/antagonists/changeling/powers/revive.dm @@ -1,36 +1,36 @@ -/obj/effect/proc_holder/changeling/revive - name = "Revive" - desc = "We regenerate, healing all damage from our form." - helptext = "Does not regrow lost organs or a missing head." - req_stat = DEAD - always_keep = TRUE - ignores_fakedeath = TRUE - -//Revive from revival stasis -/obj/effect/proc_holder/changeling/revive/sting_action(mob/living/carbon/user) - user.cure_fakedeath("changeling") - user.revive(full_heal = 1) - var/list/missing = user.get_missing_limbs() - missing -= "head" // headless changelings are funny - if(missing.len) - playsound(user, 'sound/magic/demon_consume.ogg', 50, 1) - user.visible_message("[user]'s missing limbs \ - reform, making a loud, grotesque sound!", - "Your limbs regrow, making a \ - loud, crunchy sound and giving you great pain!", - "You hear organic matter ripping \ - and tearing!") - user.emote("scream") - user.regenerate_limbs(0, list("head")) - user.regenerate_organs() - to_chat(user, "We have revived ourselves.") - var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) - changeling.purchasedpowers -= src - return TRUE - -/obj/effect/proc_holder/changeling/revive/can_be_used_by(mob/living/user) - if((user.stat != DEAD) && !(user.has_trait(TRAIT_FAKEDEATH))) - var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) - changeling.purchasedpowers -= src - return 0 +/obj/effect/proc_holder/changeling/revive + name = "Revive" + desc = "We regenerate, healing all damage from our form." + helptext = "Does not regrow lost organs or a missing head." + req_stat = DEAD + always_keep = TRUE + ignores_fakedeath = TRUE + +//Revive from revival stasis +/obj/effect/proc_holder/changeling/revive/sting_action(mob/living/carbon/user) + user.cure_fakedeath("changeling") + user.revive(full_heal = 1) + var/list/missing = user.get_missing_limbs() + missing -= BODY_ZONE_HEAD // headless changelings are funny + if(missing.len) + playsound(user, 'sound/magic/demon_consume.ogg', 50, 1) + user.visible_message("[user]'s missing limbs \ + reform, making a loud, grotesque sound!", + "Your limbs regrow, making a \ + loud, crunchy sound and giving you great pain!", + "You hear organic matter ripping \ + and tearing!") + user.emote("scream") + user.regenerate_limbs(0, list(BODY_ZONE_HEAD)) + user.regenerate_organs() + to_chat(user, "We have revived ourselves.") + var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) + changeling.purchasedpowers -= src + return TRUE + +/obj/effect/proc_holder/changeling/revive/can_be_used_by(mob/living/user) + if((user.stat != DEAD) && !(user.has_trait(TRAIT_FAKEDEATH))) + var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) + changeling.purchasedpowers -= src + return 0 . = ..() diff --git a/code/modules/antagonists/clockcult/clock_items/clockwork_armor.dm b/code/modules/antagonists/clockcult/clock_items/clockwork_armor.dm index 95ae8ff65f..8b018fa6d3 100644 --- a/code/modules/antagonists/clockcult/clock_items/clockwork_armor.dm +++ b/code/modules/antagonists/clockcult/clock_items/clockwork_armor.dm @@ -48,7 +48,7 @@ to_chat(user, "\"Do you have a hole in your head? You're about to.\"") to_chat(user, "The helmet tries to drive a spike through your head as you scramble to remove it!") user.emote("scream") - user.apply_damage(30, BRUTE, "head") + user.apply_damage(30, BRUTE, BODY_ZONE_HEAD) user.adjustBrainLoss(30) addtimer(CALLBACK(user, /mob/living.proc/dropItemToGround), src, 1) //equipped happens before putting stuff on(but not before picking items up), 1). thus, we need to wait for it to be on before forcing it off. @@ -114,7 +114,7 @@ to_chat(user, "\"I think this armor is too hot for you to handle.\"") to_chat(user, "The curiass emits a burst of flame as you scramble to get it off!") user.emote("scream") - user.apply_damage(15, BURN, "chest") + user.apply_damage(15, BURN, BODY_ZONE_CHEST) user.adjust_fire_stacks(2) user.IgniteMob() addtimer(CALLBACK(user, /mob/living.proc/dropItemToGround, src, TRUE), 1) @@ -175,8 +175,8 @@ to_chat(user, "\"Did you like having arms?\"") to_chat(user, "The gauntlets suddenly squeeze tight, crushing your arms before you manage to get them off!") user.emote("scream") - user.apply_damage(7, BRUTE, "l_arm") - user.apply_damage(7, BRUTE, "r_arm") + user.apply_damage(7, BRUTE, BODY_ZONE_L_ARM) + user.apply_damage(7, BRUTE, BODY_ZONE_R_ARM) addtimer(CALLBACK(user, /mob/living.proc/dropItemToGround, src, TRUE), 1) /obj/item/clothing/shoes/clockwork @@ -225,6 +225,6 @@ to_chat(user, "\"Let's see if you can dance with these.\"") to_chat(user, "The treads turn searing hot as you scramble to get them off!") user.emote("scream") - user.apply_damage(7, BURN, "l_leg") - user.apply_damage(7, BURN, "r_leg") + user.apply_damage(7, BURN, BODY_ZONE_L_LEG) + user.apply_damage(7, BURN, BODY_ZONE_R_LEG) addtimer(CALLBACK(user, /mob/living.proc/dropItemToGround, src, TRUE), 1) diff --git a/code/modules/antagonists/clockcult/clock_items/clockwork_slab.dm b/code/modules/antagonists/clockcult/clock_items/clockwork_slab.dm index 01160e8b2e..158a644c23 100644 --- a/code/modules/antagonists/clockcult/clock_items/clockwork_slab.dm +++ b/code/modules/antagonists/clockcult/clock_items/clockwork_slab.dm @@ -143,8 +143,8 @@ playsound(get_turf(user), 'sound/weapons/sear.ogg', 50, 1) user.dropItemToGround(src) user.emote("scream") - user.apply_damage(5, BURN, "l_arm") - user.apply_damage(5, BURN, "r_arm") + user.apply_damage(5, BURN, BODY_ZONE_L_ARM) + user.apply_damage(5, BURN, BODY_ZONE_R_ARM) return 0 if(!is_servant_of_ratvar(user)) to_chat(user, "The information on [src]'s display shifts rapidly. After a moment, your head begins to pound, and you tear your eyes away.") diff --git a/code/modules/antagonists/clockcult/clock_items/soul_vessel.dm b/code/modules/antagonists/clockcult/clock_items/soul_vessel.dm index 9dbbf4a11b..48466238a7 100644 --- a/code/modules/antagonists/clockcult/clock_items/soul_vessel.dm +++ b/code/modules/antagonists/clockcult/clock_items/soul_vessel.dm @@ -79,7 +79,7 @@ if(I.flags_inv & HIDEHAIR) //they're wearing a mask that covers their skull to_chat(user, "[H]'s head is covered, remove [H.wear_mask] first!") return - var/obj/item/bodypart/head/HE = H.get_bodypart("head") + var/obj/item/bodypart/head/HE = H.get_bodypart(BODY_ZONE_HEAD) if(!HE) //literally headless to_chat(user, "[H] has no head, and thus no mind to claim!") return diff --git a/code/modules/antagonists/clockcult/clock_structures/traps/brass_skewer.dm b/code/modules/antagonists/clockcult/clock_structures/traps/brass_skewer.dm index 20a18d18f6..93a3e14045 100644 --- a/code/modules/antagonists/clockcult/clock_structures/traps/brass_skewer.dm +++ b/code/modules/antagonists/clockcult/clock_structures/traps/brass_skewer.dm @@ -64,7 +64,7 @@ squirrel.emote("scream") playsound(squirrel, 'sound/effects/splat.ogg', 50, TRUE) playsound(squirrel, 'sound/misc/desceration-03.ogg', 50, TRUE) - squirrel.apply_damage(20, BRUTE, "chest") + squirrel.apply_damage(20, BRUTE, BODY_ZONE_CHEST) mouse_opacity = MOUSE_OPACITY_OPAQUE //So players can interact with the tile it's on to pull them off buckle_mob(squirrel, TRUE) else @@ -96,7 +96,7 @@ if(!do_after(user, 300, target = user)) user.visible_message("[user] slides back down [src]!") user.emote("scream") - user.apply_damage(10, BRUTE, "chest") + user.apply_damage(10, BRUTE, BODY_ZONE_CHEST) playsound(user, 'sound/misc/desceration-03.ogg', 50, TRUE) wiggle_wiggle = FALSE return diff --git a/code/modules/antagonists/cult/blood_magic.dm b/code/modules/antagonists/cult/blood_magic.dm index acf516259f..81bdd5815f 100644 --- a/code/modules/antagonists/cult/blood_magic.dm +++ b/code/modules/antagonists/cult/blood_magic.dm @@ -385,9 +385,9 @@ user.whisper(invocation, language = /datum/language/common) if(health_cost) if(user.active_hand_index == 1) - user.apply_damage(health_cost, BRUTE, "l_arm") + user.apply_damage(health_cost, BRUTE, BODY_ZONE_L_ARM) else - user.apply_damage(health_cost, BRUTE, "r_arm") + user.apply_damage(health_cost, BRUTE, BODY_ZONE_R_ARM) if(uses <= 0) qdel(src) else if(source) diff --git a/code/modules/antagonists/cult/cult_items.dm b/code/modules/antagonists/cult/cult_items.dm index be014ae770..1b744863d8 100644 --- a/code/modules/antagonists/cult/cult_items.dm +++ b/code/modules/antagonists/cult/cult_items.dm @@ -57,7 +57,7 @@ "\"You shouldn't play with sharp things. You'll poke someone's eye out.\"") if(ishuman(user)) var/mob/living/carbon/human/H = user - H.apply_damage(rand(force/2, force), BRUTE, pick("l_arm", "r_arm")) + H.apply_damage(rand(force/2, force), BRUTE, pick(BODY_ZONE_L_ARM, BODY_ZONE_R_ARM)) else user.adjustBruteLoss(rand(force/2,force)) return @@ -79,7 +79,7 @@ to_chat(user, "\"One of Ratvar's toys is trying to play with things [user.p_they()] shouldn't. Cute.\"") to_chat(user, "A horrible force yanks at your arm!") user.emote("scream") - user.apply_damage(30, BRUTE, pick("l_arm", "r_arm")) + user.apply_damage(30, BRUTE, pick(BODY_ZONE_L_ARM, BODY_ZONE_R_ARM)) user.dropItemToGround(src) /obj/item/twohanded/required/cult_bastard @@ -147,7 +147,7 @@ to_chat(user, "\"One of Ratvar's toys is trying to play with things [user.p_they()] shouldn't. Cute.\"") to_chat(user, "A horrible force yanks at your arm!") user.emote("scream") - user.apply_damage(30, BRUTE, pick("l_arm", "r_arm")) + user.apply_damage(30, BRUTE, pick(BODY_ZONE_L_ARM, BODY_ZONE_R_ARM)) user.dropItemToGround(src, TRUE) user.Knockdown(50) return diff --git a/code/modules/antagonists/cult/ritual.dm b/code/modules/antagonists/cult/ritual.dm index 8167a1c0d9..dd129708a8 100644 --- a/code/modules/antagonists/cult/ritual.dm +++ b/code/modules/antagonists/cult/ritual.dm @@ -114,7 +114,7 @@ This file contains the cult dagger and rune list code user.visible_message("[user] [user.blood_volume ? "cuts open their arm and begins writing in their own blood":"begins sketching out a strange design"]!", \ "You [user.blood_volume ? "slice open your arm and ":""]begin drawing a sigil of the Geometer.") if(user.blood_volume) - user.apply_damage(initial(rune_to_scribe.scribe_damage), BRUTE, pick("l_arm", "r_arm")) + user.apply_damage(initial(rune_to_scribe.scribe_damage), BRUTE, pick(BODY_ZONE_L_ARM, BODY_ZONE_R_ARM)) var/scribe_mod = initial(rune_to_scribe.scribe_delay) if(istype(get_turf(user), /turf/open/floor/engine/cult)) scribe_mod *= 0.5 diff --git a/code/modules/antagonists/cult/runes.dm b/code/modules/antagonists/cult/runes.dm index eacf4fb518..8474bd63f1 100644 --- a/code/modules/antagonists/cult/runes.dm +++ b/code/modules/antagonists/cult/runes.dm @@ -637,7 +637,7 @@ structure_check() searches for nearby cultist structures required for the invoca "You channel [carbon_user ? "your life ":""]energy into [src], [density ? "temporarily preventing" : "allowing"] passage above it.") if(carbon_user) var/mob/living/carbon/C = user - C.apply_damage(2, BRUTE, pick("l_arm", "r_arm")) + C.apply_damage(2, BRUTE, pick(BODY_ZONE_L_ARM, BODY_ZONE_R_ARM)) /obj/effect/rune/wall/proc/spread_density() for(var/R in GLOB.wall_runes) diff --git a/code/modules/antagonists/wizard/equipment/artefact.dm b/code/modules/antagonists/wizard/equipment/artefact.dm index 5a88607d55..cd2e4f60f0 100644 --- a/code/modules/antagonists/wizard/equipment/artefact.dm +++ b/code/modules/antagonists/wizard/equipment/artefact.dm @@ -263,7 +263,7 @@ target = input(user, "Select your victim!", "Voodoo") as null|anything in possible return - if(user.zone_selected == "chest") + if(user.zone_selected == BODY_ZONE_CHEST) if(voodoo_link) target = null voodoo_link.forceMove(drop_location()) @@ -274,24 +274,24 @@ if(target && cooldown < world.time) switch(user.zone_selected) - if("mouth") + if(BODY_ZONE_PRECISE_MOUTH) var/wgw = sanitize(input(user, "What would you like the victim to say", "Voodoo", null) as text) target.say(wgw) log_game("[user][user.key] made [target][target.key] say [wgw] with a voodoo doll.") - if("eyes") + if(BODY_ZONE_PRECISE_EYES) user.set_machine(src) user.reset_perspective(target) spawn(100) user.reset_perspective(null) user.unset_machine() - if("r_leg","l_leg") + if(BODY_ZONE_R_LEG,BODY_ZONE_L_LEG) to_chat(user, "You move the doll's legs around.") var/turf/T = get_step(target,pick(GLOB.cardinals)) target.Move(T) - if("r_arm","l_arm") + if(BODY_ZONE_R_ARM,BODY_ZONE_L_ARM) target.click_random_mob() GiveHint(target) - if("head") + if(BODY_ZONE_HEAD) to_chat(user, "You smack the doll's head with your hand.") target.Dizzy(10) to_chat(target, "You suddenly feel as if your head was hit with a hammer!") diff --git a/code/modules/assembly/mousetrap.dm b/code/modules/assembly/mousetrap.dm index 2ffe64f327..90b3b55b71 100644 --- a/code/modules/assembly/mousetrap.dm +++ b/code/modules/assembly/mousetrap.dm @@ -1,142 +1,142 @@ -/obj/item/device/assembly/mousetrap - name = "mousetrap" - desc = "A handy little spring-loaded trap for catching pesty rodents." - icon_state = "mousetrap" - materials = list(MAT_METAL=100) - attachable = 1 - var/armed = 0 - - -/obj/item/device/assembly/mousetrap/examine(mob/user) - ..() - if(armed) - to_chat(user, "The mousetrap is armed!") - else - to_chat(user, "The mousetrap is not armed.") - -/obj/item/device/assembly/mousetrap/activate() - if(..()) - armed = !armed - if(!armed) - if(ishuman(usr)) - var/mob/living/carbon/human/user = usr - if((user.has_trait(TRAIT_DUMB) || user.has_trait(TRAIT_CLUMSY)) && prob(50)) - to_chat(user, "Your hand slips, setting off the trigger!") - pulse(0) - update_icon() - if(usr) - playsound(usr.loc, 'sound/weapons/handcuffs.ogg', 30, 1, -3) - -/obj/item/device/assembly/mousetrap/describe() - return "The pressure switch is [armed?"primed":"safe"]." - -/obj/item/device/assembly/mousetrap/update_icon() - if(armed) - icon_state = "mousetraparmed" - else - icon_state = "mousetrap" - if(holder) - holder.update_icon() - -/obj/item/device/assembly/mousetrap/proc/triggered(mob/target, type = "feet") - if(!armed) - return - var/obj/item/bodypart/affecting = null - if(ishuman(target)) - var/mob/living/carbon/human/H = target - if(H.has_trait(TRAIT_PIERCEIMMUNE)) - playsound(src.loc, 'sound/effects/snap.ogg', 50, 1) - armed = 0 - update_icon() - pulse(0) - return 0 - switch(type) - if("feet") - if(!H.shoes) - affecting = H.get_bodypart(pick("l_leg", "r_leg")) - H.Knockdown(60) - if("l_hand", "r_hand") - if(!H.gloves) - affecting = H.get_bodypart(type) - H.Stun(60) - if(affecting) - if(affecting.receive_damage(1, 0)) - H.update_damage_overlays() - else if(ismouse(target)) - var/mob/living/simple_animal/mouse/M = target - visible_message("SPLAT!") - M.splat() - playsound(src.loc, 'sound/effects/snap.ogg', 50, 1) - armed = 0 - update_icon() - pulse(0) - - -/obj/item/device/assembly/mousetrap/attack_self(mob/living/carbon/human/user) - if(!armed) - to_chat(user, "You arm [src].") - else - if((user.has_trait(TRAIT_DUMB) || user.has_trait(TRAIT_CLUMSY)) && prob(50)) - var/which_hand = "l_hand" - if(!(user.active_hand_index % 2)) - which_hand = "r_hand" - triggered(user, which_hand) - user.visible_message("[user] accidentally sets off [src], breaking their fingers.", \ - "You accidentally trigger [src]!") - return - to_chat(user, "You disarm [src].") - armed = !armed - update_icon() - playsound(user.loc, 'sound/weapons/handcuffs.ogg', 30, 1, -3) - - -/obj/item/device/assembly/mousetrap/attack_hand(mob/living/carbon/human/user) - if(armed) - if((user.has_trait(TRAIT_DUMB) || user.has_trait(TRAIT_CLUMSY)) && prob(50)) - var/which_hand = "l_hand" - if(!(user.active_hand_index % 2)) - which_hand = "r_hand" - triggered(user, which_hand) - user.visible_message("[user] accidentally sets off [src], breaking their fingers.", \ - "You accidentally trigger [src]!") - return - ..() - - -/obj/item/device/assembly/mousetrap/Crossed(atom/movable/AM as mob|obj) - if(armed) - if(ismob(AM)) - var/mob/MM = AM - if(!(MM.movement_type & FLYING)) - if(ishuman(AM)) - var/mob/living/carbon/H = AM - if(H.m_intent == MOVE_INTENT_RUN) - triggered(H) - H.visible_message("[H] accidentally steps on [src].", \ - "You accidentally step on [src]") - else if(ismouse(MM)) - triggered(MM) - else if(AM.density) // For mousetrap grenades, set off by anything heavy - triggered(AM) - ..() - - -/obj/item/device/assembly/mousetrap/on_found(mob/finder) - if(armed) - finder.visible_message("[finder] accidentally sets off [src], breaking their fingers.", \ - "You accidentally trigger [src]!") - triggered(finder, (finder.active_hand_index % 2 == 0) ? "r_hand" : "l_hand") - return 1 //end the search! - return 0 - - -/obj/item/device/assembly/mousetrap/hitby(A as mob|obj) - if(!armed) - return ..() - visible_message("[src] is triggered by [A].") - triggered(null) - - -/obj/item/device/assembly/mousetrap/armed - icon_state = "mousetraparmed" +/obj/item/device/assembly/mousetrap + name = "mousetrap" + desc = "A handy little spring-loaded trap for catching pesty rodents." + icon_state = "mousetrap" + materials = list(MAT_METAL=100) + attachable = 1 + var/armed = 0 + + +/obj/item/device/assembly/mousetrap/examine(mob/user) + ..() + if(armed) + to_chat(user, "The mousetrap is armed!") + else + to_chat(user, "The mousetrap is not armed.") + +/obj/item/device/assembly/mousetrap/activate() + if(..()) + armed = !armed + if(!armed) + if(ishuman(usr)) + var/mob/living/carbon/human/user = usr + if((user.has_trait(TRAIT_DUMB) || user.has_trait(TRAIT_CLUMSY)) && prob(50)) + to_chat(user, "Your hand slips, setting off the trigger!") + pulse(0) + update_icon() + if(usr) + playsound(usr.loc, 'sound/weapons/handcuffs.ogg', 30, 1, -3) + +/obj/item/device/assembly/mousetrap/describe() + return "The pressure switch is [armed?"primed":"safe"]." + +/obj/item/device/assembly/mousetrap/update_icon() + if(armed) + icon_state = "mousetraparmed" + else + icon_state = "mousetrap" + if(holder) + holder.update_icon() + +/obj/item/device/assembly/mousetrap/proc/triggered(mob/target, type = "feet") + if(!armed) + return + var/obj/item/bodypart/affecting = null + if(ishuman(target)) + var/mob/living/carbon/human/H = target + if(H.has_trait(TRAIT_PIERCEIMMUNE)) + playsound(src.loc, 'sound/effects/snap.ogg', 50, 1) + armed = 0 + update_icon() + pulse(0) + return 0 + switch(type) + if("feet") + if(!H.shoes) + affecting = H.get_bodypart(pick(BODY_ZONE_L_LEG, BODY_ZONE_R_LEG)) + H.Knockdown(60) + if(BODY_ZONE_PRECISE_L_HAND, BODY_ZONE_PRECISE_R_HAND) + if(!H.gloves) + affecting = H.get_bodypart(type) + H.Stun(60) + if(affecting) + if(affecting.receive_damage(1, 0)) + H.update_damage_overlays() + else if(ismouse(target)) + var/mob/living/simple_animal/mouse/M = target + visible_message("SPLAT!") + M.splat() + playsound(src.loc, 'sound/effects/snap.ogg', 50, 1) + armed = 0 + update_icon() + pulse(0) + + +/obj/item/device/assembly/mousetrap/attack_self(mob/living/carbon/human/user) + if(!armed) + to_chat(user, "You arm [src].") + else + if((user.has_trait(TRAIT_DUMB) || user.has_trait(TRAIT_CLUMSY)) && prob(50)) + var/which_hand = BODY_ZONE_PRECISE_L_HAND + if(!(user.active_hand_index % 2)) + which_hand = BODY_ZONE_PRECISE_R_HAND + triggered(user, which_hand) + user.visible_message("[user] accidentally sets off [src], breaking their fingers.", \ + "You accidentally trigger [src]!") + return + to_chat(user, "You disarm [src].") + armed = !armed + update_icon() + playsound(user.loc, 'sound/weapons/handcuffs.ogg', 30, 1, -3) + + +/obj/item/device/assembly/mousetrap/attack_hand(mob/living/carbon/human/user) + if(armed) + if((user.has_trait(TRAIT_DUMB) || user.has_trait(TRAIT_CLUMSY)) && prob(50)) + var/which_hand = BODY_ZONE_PRECISE_L_HAND + if(!(user.active_hand_index % 2)) + which_hand = BODY_ZONE_PRECISE_R_HAND + triggered(user, which_hand) + user.visible_message("[user] accidentally sets off [src], breaking their fingers.", \ + "You accidentally trigger [src]!") + return + ..() + + +/obj/item/device/assembly/mousetrap/Crossed(atom/movable/AM as mob|obj) + if(armed) + if(ismob(AM)) + var/mob/MM = AM + if(!(MM.movement_type & FLYING)) + if(ishuman(AM)) + var/mob/living/carbon/H = AM + if(H.m_intent == MOVE_INTENT_RUN) + triggered(H) + H.visible_message("[H] accidentally steps on [src].", \ + "You accidentally step on [src]") + else if(ismouse(MM)) + triggered(MM) + else if(AM.density) // For mousetrap grenades, set off by anything heavy + triggered(AM) + ..() + + +/obj/item/device/assembly/mousetrap/on_found(mob/finder) + if(armed) + finder.visible_message("[finder] accidentally sets off [src], breaking their fingers.", \ + "You accidentally trigger [src]!") + triggered(finder, (finder.active_hand_index % 2 == 0) ? BODY_ZONE_PRECISE_R_HAND : BODY_ZONE_PRECISE_L_HAND) + return 1 //end the search! + return 0 + + +/obj/item/device/assembly/mousetrap/hitby(A as mob|obj) + if(!armed) + return ..() + visible_message("[src] is triggered by [A].") + triggered(null) + + +/obj/item/device/assembly/mousetrap/armed + icon_state = "mousetraparmed" armed = 1 diff --git a/code/modules/atmospherics/machinery/pipes/heat_exchange/he_pipes.dm b/code/modules/atmospherics/machinery/pipes/heat_exchange/he_pipes.dm index c50ccc942b..ee52d89e5b 100644 --- a/code/modules/atmospherics/machinery/pipes/heat_exchange/he_pipes.dm +++ b/code/modules/atmospherics/machinery/pipes/heat_exchange/he_pipes.dm @@ -87,4 +87,4 @@ if(pipe_air.temperature > heat_limit + 1) for(var/m in buckled_mobs) var/mob/living/buckled_mob = m - buckled_mob.apply_damage(4 * log(pipe_air.temperature - heat_limit), BURN, "chest") + buckled_mob.apply_damage(4 * log(pipe_air.temperature - heat_limit), BURN, BODY_ZONE_CHEST) diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index e739e7ea86..db43713697 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -1069,7 +1069,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) undershirt = random_undershirt(gender) if("socks") socks = random_socks() - if("eyes") + if(BODY_ZONE_PRECISE_EYES) eye_color = random_eye_color() if("s_tone") skin_tone = random_skin_tone() @@ -1211,7 +1211,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) if(new_socks) socks = new_socks - if("eyes") + if(BODY_ZONE_PRECISE_EYES) var/new_eyes = input(user, "Choose your character's eye colour:", "Character Preference","#"+eye_color) as color|null if(new_eyes) eye_color = sanitize_hexcolor(new_eyes) diff --git a/code/modules/clothing/head/_head.dm b/code/modules/clothing/head/_head.dm index 9ec6542cf5..d3dfa189d8 100644 --- a/code/modules/clothing/head/_head.dm +++ b/code/modules/clothing/head/_head.dm @@ -1,5 +1,5 @@ /obj/item/clothing/head - name = "head" + name = BODY_ZONE_HEAD icon = 'icons/obj/clothing/hats.dmi' icon_state = "top_hat" item_state = "that" diff --git a/code/modules/clothing/neck/_neck.dm b/code/modules/clothing/neck/_neck.dm index 7d81e2d005..1d92ab6e62 100644 --- a/code/modules/clothing/neck/_neck.dm +++ b/code/modules/clothing/neck/_neck.dm @@ -79,7 +79,7 @@ if(M.stat == DEAD && heart && world.time - M.timeofdeath < DEFIB_TIME_LIMIT * 10) heart_strength = "a faint, fluttery" - var/diagnosis = (body_part == "chest" ? "You hear [heart_strength] pulse and [lung_strength] respiration." : "You faintly hear [heart_strength] pulse.") + var/diagnosis = (body_part == BODY_ZONE_CHEST ? "You hear [heart_strength] pulse and [lung_strength] respiration." : "You faintly hear [heart_strength] pulse.") user.visible_message("[user] places [src] against [M]'s [body_part] and listens attentively.", "You place [src] against [M]'s [body_part]. [diagnosis]") return return ..(M,user) diff --git a/code/modules/clothing/shoes/_shoes.dm b/code/modules/clothing/shoes/_shoes.dm index e725a24df1..0758013698 100644 --- a/code/modules/clothing/shoes/_shoes.dm +++ b/code/modules/clothing/shoes/_shoes.dm @@ -22,8 +22,8 @@ /obj/item/clothing/shoes/suicide_act(mob/living/carbon/user) if(rand(2)>1) user.visible_message("[user] begins tying \the [src] up waaay too tightly! It looks like [user.p_theyre()] trying to commit suicide!") - var/obj/item/bodypart/l_leg = user.get_bodypart("l_leg") - var/obj/item/bodypart/r_leg = user.get_bodypart("r_leg") + var/obj/item/bodypart/l_leg = user.get_bodypart(BODY_ZONE_L_LEG) + var/obj/item/bodypart/r_leg = user.get_bodypart(BODY_ZONE_R_LEG) if(l_leg) l_leg.dismember() playsound(user,pick('sound/misc/desceration-01.ogg','sound/misc/desceration-02.ogg','sound/misc/desceration-01.ogg') ,50, 1, -1) diff --git a/code/modules/clothing/suits/armor.dm b/code/modules/clothing/suits/armor.dm index f3ce410933..37d48b484e 100644 --- a/code/modules/clothing/suits/armor.dm +++ b/code/modules/clothing/suits/armor.dm @@ -149,7 +149,7 @@ var/hit_reflect_chance = 40 /obj/item/clothing/suit/armor/laserproof/IsReflect(def_zone) - if(!(def_zone in list("chest", "groin"))) //If not shot where ablative is covering you, you don't get the reflection bonus! + if(!(def_zone in list(BODY_ZONE_CHEST, BODY_ZONE_PRECISE_GROIN))) //If not shot where ablative is covering you, you don't get the reflection bonus! return 0 if (prob(hit_reflect_chance)) return 1 diff --git a/code/modules/food_and_drinks/drinks/drinks.dm b/code/modules/food_and_drinks/drinks/drinks.dm index bbc56f9fe4..d6426cf20d 100644 --- a/code/modules/food_and_drinks/drinks/drinks.dm +++ b/code/modules/food_and_drinks/drinks/drinks.dm @@ -393,7 +393,7 @@ return BRUTELOSS /obj/item/reagent_containers/food/drinks/soda_cans/attack(mob/M, mob/user) - if(M == user && !src.reagents.total_volume && user.a_intent == INTENT_HARM && user.zone_selected == "head") + if(M == user && !src.reagents.total_volume && user.a_intent == INTENT_HARM && user.zone_selected == BODY_ZONE_HEAD) user.visible_message("[user] crushes the can of [src] on [user.p_their()] forehead!", "You crush the can of [src] on your forehead.") playsound(user.loc,'sound/weapons/pierce.ogg', rand(10,50), 1) var/obj/item/trash/can/crushed_can = new /obj/item/trash/can(user.loc) diff --git a/code/modules/food_and_drinks/drinks/drinks/bottle.dm b/code/modules/food_and_drinks/drinks/drinks/bottle.dm index 821b09ae1a..1ab92e601d 100644 --- a/code/modules/food_and_drinks/drinks/drinks/bottle.dm +++ b/code/modules/food_and_drinks/drinks/drinks/bottle.dm @@ -67,7 +67,7 @@ armor_block = H.run_armor_check(affecting, "melee","","",armour_penetration) // For normal attack damage //If they have a hat/helmet and the user is targeting their head. - if(istype(H.head, /obj/item/clothing/head) && affecting == "head") + if(istype(H.head, /obj/item/clothing/head) && affecting == BODY_ZONE_HEAD) headarmor = H.head.armor.melee else headarmor = 0 @@ -78,7 +78,7 @@ else //Only humans can have armor, right? armor_block = target.run_armor_check(affecting, "melee") - if(affecting == "head") + if(affecting == BODY_ZONE_HEAD) armor_duration = duration + force //Apply the damage! @@ -87,7 +87,7 @@ // You are going to knock someone out for longer if they are not wearing a helmet. var/head_attack_message = "" - if(affecting == "head" && istype(target, /mob/living/carbon/)) + if(affecting == BODY_ZONE_HEAD && istype(target, /mob/living/carbon/)) head_attack_message = " on the head" //Knockdown the target for the duration that we calculated and divide it by 5. if(armor_duration) diff --git a/code/modules/food_and_drinks/kitchen_machinery/deep_fryer.dm b/code/modules/food_and_drinks/kitchen_machinery/deep_fryer.dm index 301585c13a..a008be2f22 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/deep_fryer.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/deep_fryer.dm @@ -142,7 +142,7 @@ God bless America. var/mob/living/carbon/C = user.pulling user.visible_message("[user] dunks [C]'s face in [src]!") reagents.reaction(C, TOUCH) - C.apply_damage(min(30, reagents.total_volume), BURN, "head") + C.apply_damage(min(30, reagents.total_volume), BURN, BODY_ZONE_HEAD) reagents.remove_any((reagents.total_volume/2)) C.Knockdown(60) user.changeNext_move(CLICK_CD_MELEE) diff --git a/code/modules/hydroponics/hydroitemdefines.dm b/code/modules/hydroponics/hydroitemdefines.dm index 77a69f0475..c471ba8bb1 100644 --- a/code/modules/hydroponics/hydroitemdefines.dm +++ b/code/modules/hydroponics/hydroitemdefines.dm @@ -125,7 +125,7 @@ user.visible_message("[user] is beheading [user.p_them()]self with [src]! It looks like [user.p_theyre()] trying to commit suicide!") 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(src,pick('sound/misc/desceration-01.ogg','sound/misc/desceration-02.ogg','sound/misc/desceration-01.ogg') ,50, 1, -1) diff --git a/code/modules/mob/living/brain/brain_item.dm b/code/modules/mob/living/brain/brain_item.dm index 671685a95a..a63c8f7424 100644 --- a/code/modules/mob/living/brain/brain_item.dm +++ b/code/modules/mob/living/brain/brain_item.dm @@ -5,7 +5,7 @@ throw_speed = 3 throw_range = 5 layer = ABOVE_MOB_LAYER - zone = "head" + zone = BODY_ZONE_HEAD slot = ORGAN_SLOT_BRAIN vital = TRUE attack_verb = list("attacked", "slapped", "whacked") @@ -112,7 +112,7 @@ add_fingerprint(user) - if(user.zone_selected != "head") + if(user.zone_selected != BODY_ZONE_HEAD) return ..() if((C.head && (C.head.flags_cover & HEADCOVERSEYES)) || (C.wear_mask && (C.wear_mask.flags_cover & MASKCOVERSEYES)) || (C.glasses && (C.glasses.flags_1 & GLASSESCOVERSEYES))) @@ -122,7 +122,7 @@ //since these people will be dead M != usr if(!C.getorgan(/obj/item/organ/brain)) - if(!C.get_bodypart("head") || !user.temporarilyRemoveItemFromInventory(src)) + if(!C.get_bodypart(BODY_ZONE_HEAD) || !user.temporarilyRemoveItemFromInventory(src)) return var/msg = "[C] has [src] inserted into [C.p_their()] head by [user]." if(C == user) diff --git a/code/modules/mob/living/carbon/alien/organs.dm b/code/modules/mob/living/carbon/alien/organs.dm index 61ae0cba5d..1a407d0ca3 100644 --- a/code/modules/mob/living/carbon/alien/organs.dm +++ b/code/modules/mob/living/carbon/alien/organs.dm @@ -30,7 +30,7 @@ name = "plasma vessel" icon_state = "plasma" w_class = WEIGHT_CLASS_NORMAL - zone = "chest" + zone = BODY_ZONE_CHEST slot = "plasmavessel" alien_powers = list(/obj/effect/proc_holder/alien/plant, /obj/effect/proc_holder/alien/transfer) @@ -104,7 +104,7 @@ /obj/item/organ/alien/hivenode name = "hive node" icon_state = "hivenode" - zone = "head" + zone = BODY_ZONE_HEAD slot = "hivenode" w_class = WEIGHT_CLASS_TINY var/recent_queen_death = 0 //Indicates if the queen died recently, aliens are heavily weakened while this is active. @@ -156,7 +156,7 @@ /obj/item/organ/alien/resinspinner name = "resin spinner" icon_state = "stomach-x" - zone = "mouth" + zone = BODY_ZONE_PRECISE_MOUTH slot = "resinspinner" alien_powers = list(/obj/effect/proc_holder/alien/resin) @@ -164,7 +164,7 @@ /obj/item/organ/alien/acid name = "acid gland" icon_state = "acid" - zone = "mouth" + zone = BODY_ZONE_PRECISE_MOUTH slot = "acidgland" alien_powers = list(/obj/effect/proc_holder/alien/acid) @@ -172,7 +172,7 @@ /obj/item/organ/alien/neurotoxin name = "neurotoxin gland" icon_state = "neurotox" - zone = "mouth" + zone = BODY_ZONE_PRECISE_MOUTH slot = "neurotoxingland" alien_powers = list(/obj/effect/proc_holder/alien/neurotoxin) @@ -180,7 +180,7 @@ /obj/item/organ/alien/eggsac name = "egg sac" icon_state = "eggsac" - zone = "groin" + zone = BODY_ZONE_PRECISE_GROIN slot = "eggsac" w_class = WEIGHT_CLASS_BULKY alien_powers = list(/obj/effect/proc_holder/alien/lay_egg) diff --git a/code/modules/mob/living/carbon/alien/special/alien_embryo.dm b/code/modules/mob/living/carbon/alien/special/alien_embryo.dm index 01626c5694..b4739f943e 100644 --- a/code/modules/mob/living/carbon/alien/special/alien_embryo.dm +++ b/code/modules/mob/living/carbon/alien/special/alien_embryo.dm @@ -56,7 +56,7 @@ if(stage == 5 && prob(50)) for(var/datum/surgery/S in owner.surgeries) - if(S.location == "chest" && istype(S.get_surgery_step(), /datum/surgery_step/manipulate_organs)) + if(S.location == BODY_ZONE_CHEST && istype(S.get_surgery_step(), /datum/surgery_step/manipulate_organs)) AttemptGrow(0) return AttemptGrow() diff --git a/code/modules/mob/living/carbon/alien/special/facehugger.dm b/code/modules/mob/living/carbon/alien/special/facehugger.dm index fe4454caeb..20036f2fb2 100644 --- a/code/modules/mob/living/carbon/alien/special/facehugger.dm +++ b/code/modules/mob/living/carbon/alien/special/facehugger.dm @@ -131,7 +131,7 @@ return FALSE var/mob/living/carbon/target = M // gotta have a head to be implanted (no changelings or sentient plants) - if(!target.get_bodypart("head")) + if(!target.get_bodypart(BODY_ZONE_HEAD)) return FALSE if(target.getorgan(/obj/item/organ/alien/hivenode) || target.getorgan(/obj/item/organ/body_egg/alien_embryo)) @@ -208,7 +208,7 @@ Die() icon_state = "[initial(icon_state)]_impregnated" - var/obj/item/bodypart/chest/LC = target.get_bodypart("chest") + var/obj/item/bodypart/chest/LC = target.get_bodypart(BODY_ZONE_CHEST) if((!LC || LC.status != BODYPART_ROBOTIC) && !target.getorgan(/obj/item/organ/body_egg/alien_embryo)) new /obj/item/organ/body_egg/alien_embryo(target) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 33d50bcd6f..3b7e60213c 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -29,7 +29,7 @@ var/obj/item/I = user.get_active_held_item() if(I && I.force) var/d = rand(round(I.force / 4), I.force) - var/obj/item/bodypart/BP = get_bodypart("chest") + var/obj/item/bodypart/BP = get_bodypart(BODY_ZONE_CHEST) if(BP.receive_damage(d, 0)) update_damage_overlays() visible_message("[user] attacks [src]'s stomach wall with the [I.name]!", \ diff --git a/code/modules/mob/living/carbon/carbon_defense.dm b/code/modules/mob/living/carbon/carbon_defense.dm index 31be31160c..0444398fba 100644 --- a/code/modules/mob/living/carbon/carbon_defense.dm +++ b/code/modules/mob/living/carbon/carbon_defense.dm @@ -97,7 +97,7 @@ if(get_dist(user, src) <= 1) //people with TK won't get smeared with blood user.add_mob_blood(src) - if(affecting.body_zone == "head") + if(affecting.body_zone == BODY_ZONE_HEAD) if(wear_mask) wear_mask.add_mob_blood(src) update_inv_wear_mask() @@ -195,7 +195,7 @@ var/list/things_to_ruin = shuffle(bodyparts.Copy()) for(var/B in things_to_ruin) var/obj/item/bodypart/bodypart = B - if(bodypart.body_zone == "head" || bodypart.body_zone == "chest") + if(bodypart.body_zone == BODY_ZONE_HEAD || bodypart.body_zone == BODY_ZONE_CHEST) continue if(!affecting || ((affecting.get_damage() / affecting.max_damage) < (bodypart.get_damage() / bodypart.max_damage))) affecting = bodypart @@ -371,7 +371,7 @@ if(damage_type != BRUTE && damage_type != BURN) return damage_amount *= 0.5 //0.5 multiplier for balance reason, we don't want clothes to be too easily destroyed - if(!def_zone || def_zone == "head") + if(!def_zone || def_zone == BODY_ZONE_HEAD) var/obj/item/clothing/hit_clothes if(wear_mask) hit_clothes = wear_mask diff --git a/code/modules/mob/living/carbon/death.dm b/code/modules/mob/living/carbon/death.dm index 5969c72b41..4de59d4c3e 100644 --- a/code/modules/mob/living/carbon/death.dm +++ b/code/modules/mob/living/carbon/death.dm @@ -35,7 +35,7 @@ qdel(O) //so the brain isn't transfered to the head when the head drops. continue var/org_zone = check_zone(O.zone) //both groin and chest organs. - if(org_zone == "chest") + if(org_zone == BODY_ZONE_CHEST) O.Remove(src) O.forceMove(Tsec) O.throw_at(get_edge_target_turf(src,pick(GLOB.alldirs)),rand(1,3),5) diff --git a/code/modules/mob/living/carbon/examine.dm b/code/modules/mob/living/carbon/examine.dm index 48df33345c..9e0838210e 100644 --- a/code/modules/mob/living/carbon/examine.dm +++ b/code/modules/mob/living/carbon/examine.dm @@ -28,12 +28,12 @@ appears_dead = 1 if(getorgan(/obj/item/organ/brain)) msg += "[t_He] [t_is] limp and unresponsive, with no signs of life.\n" - else if(get_bodypart("head")) + else if(get_bodypart(BODY_ZONE_HEAD)) msg += "It appears that [t_his] brain is missing...\n" var/list/missing = get_missing_limbs() for(var/t in missing) - if(t=="head") + if(t==BODY_ZONE_HEAD) msg += "[t_His] [parse_zone(t)] is missing!\n" continue msg += "[t_His] [parse_zone(t)] is missing!\n" diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index d090b9f0f7..a280928731 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -131,14 +131,14 @@ msg += " and [t_his] soul has departed" msg += "...\n" - if(get_bodypart("head") && !getorgan(/obj/item/organ/brain)) + if(get_bodypart(BODY_ZONE_HEAD) && !getorgan(/obj/item/organ/brain)) msg += "It appears that [t_his] brain is missing...\n" var/temp = getBruteLoss() //no need to calculate each of these twice msg += "" - var/list/missing = list("head", "chest", "l_arm", "r_arm", "l_leg", "r_leg") + var/list/missing = list(BODY_ZONE_HEAD, BODY_ZONE_CHEST, BODY_ZONE_L_ARM, BODY_ZONE_R_ARM, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG) for(var/X in bodyparts) var/obj/item/bodypart/BP = X missing -= BP.body_zone @@ -149,12 +149,12 @@ var/l_limbs_missing = 0 var/r_limbs_missing = 0 for(var/t in missing) - if(t=="head") + if(t==BODY_ZONE_HEAD) msg += "[t_His] [parse_zone(t)] is missing!\n" continue - if(t == "l_arm" || t == "l_leg") + if(t == BODY_ZONE_L_ARM || t == BODY_ZONE_L_LEG) l_limbs_missing++ - else if(t == "r_arm" || t == "r_leg") + else if(t == BODY_ZONE_R_ARM || t == BODY_ZONE_R_LEG) r_limbs_missing++ msg += "[capitalize(t_his)] [parse_zone(t)] is missing!\n" diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 06cf675427..fd60a60296 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -203,10 +203,10 @@ dna.species.spec_attack_hand(H, src) /mob/living/carbon/human/attack_paw(mob/living/carbon/monkey/M) - var/dam_zone = pick("chest", "l_hand", "r_hand", "l_leg", "r_leg") + var/dam_zone = pick(BODY_ZONE_CHEST, BODY_ZONE_PRECISE_L_HAND, BODY_ZONE_PRECISE_R_HAND, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG) var/obj/item/bodypart/affecting = get_bodypart(ran_zone(dam_zone)) if(!affecting) - affecting = get_bodypart("chest") + affecting = get_bodypart(BODY_ZONE_CHEST) if(M.a_intent == INTENT_HELP) ..() //shaking return 0 @@ -253,7 +253,7 @@ return 0 var/obj/item/bodypart/affecting = get_bodypart(ran_zone(M.zone_selected)) if(!affecting) - affecting = get_bodypart("chest") + affecting = get_bodypart(BODY_ZONE_CHEST) var/armor_block = run_armor_check(affecting, "melee","","",10) playsound(loc, 'sound/weapons/slice.ogg', 25, 1, -1) @@ -288,7 +288,7 @@ L.amount_grown = min(L.amount_grown + damage, L.max_grown) var/obj/item/bodypart/affecting = get_bodypart(ran_zone(L.zone_selected)) if(!affecting) - affecting = get_bodypart("chest") + affecting = get_bodypart(BODY_ZONE_CHEST) var/armor_block = run_armor_check(affecting, "melee") apply_damage(damage, BRUTE, affecting, armor_block) @@ -299,12 +299,12 @@ var/damage = rand(M.melee_damage_lower, M.melee_damage_upper) if(check_shields(M, damage, "the [M.name]", MELEE_ATTACK, M.armour_penetration)) return FALSE - var/dam_zone = dismembering_strike(M, pick("chest", "l_hand", "r_hand", "l_leg", "r_leg")) + var/dam_zone = dismembering_strike(M, pick(BODY_ZONE_CHEST, BODY_ZONE_PRECISE_L_HAND, BODY_ZONE_PRECISE_R_HAND, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG)) if(!dam_zone) //Dismemberment successful return TRUE var/obj/item/bodypart/affecting = get_bodypart(ran_zone(dam_zone)) if(!affecting) - affecting = get_bodypart("chest") + affecting = get_bodypart(BODY_ZONE_CHEST) var/armor = run_armor_check(affecting, "melee", armour_penetration = M.armour_penetration) apply_damage(damage, M.melee_damage_type, affecting, armor) @@ -318,13 +318,13 @@ if(check_shields(M, damage, "the [M.name]")) return 0 - var/dam_zone = dismembering_strike(M, pick("head", "chest", "l_arm", "r_arm", "l_leg", "r_leg")) + var/dam_zone = dismembering_strike(M, pick(BODY_ZONE_HEAD, BODY_ZONE_CHEST, BODY_ZONE_L_ARM, BODY_ZONE_R_ARM, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG)) if(!dam_zone) //Dismemberment successful return 1 var/obj/item/bodypart/affecting = get_bodypart(ran_zone(dam_zone)) if(!affecting) - affecting = get_bodypart("chest") + affecting = get_bodypart(BODY_ZONE_CHEST) var/armor_block = run_armor_check(affecting, "melee") apply_damage(damage, BRUTE, affecting, armor_block) @@ -334,7 +334,7 @@ M.do_attack_animation(src) if(M.damtype == "brute") step_away(src,M,15) - var/obj/item/bodypart/temp = get_bodypart(pick("chest", "chest", "chest", "head")) + var/obj/item/bodypart/temp = get_bodypart(pick(BODY_ZONE_CHEST, BODY_ZONE_CHEST, BODY_ZONE_CHEST, BODY_ZONE_HEAD)) if(temp) var/update = 0 var/dmg = rand(M.force/2, M.force) @@ -416,7 +416,7 @@ var/max_limb_loss = round(4/severity) //so you don't lose four limbs at severity 3. for(var/X in bodyparts) var/obj/item/bodypart/BP = X - if(prob(50/severity) && !prob(getarmor(BP, "bomb")) && BP.body_zone != "head" && BP.body_zone != "chest") + if(prob(50/severity) && !prob(getarmor(BP, "bomb")) && BP.body_zone != BODY_ZONE_HEAD && BP.body_zone != BODY_ZONE_CHEST) BP.brute_dam = BP.max_damage BP.dismember() max_limb_loss-- @@ -428,7 +428,7 @@ if(stat == DEAD) return show_message("The blob attacks you!") - var/dam_zone = pick("chest", "l_hand", "r_hand", "l_leg", "r_leg") + var/dam_zone = pick(BODY_ZONE_CHEST, BODY_ZONE_PRECISE_L_HAND, BODY_ZONE_PRECISE_R_HAND, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG) var/obj/item/bodypart/affecting = get_bodypart(ran_zone(dam_zone)) apply_damage(5, BRUTE, affecting, run_armor_check(affecting, "melee")) @@ -489,7 +489,7 @@ var/list/inventory_items_to_kill = list() var/acidity = acidpwr * min(acid_volume*0.005, 0.1) //HEAD// - if(!bodyzone_hit || bodyzone_hit == "head") //only if we didn't specify a zone or if that zone is the head. + if(!bodyzone_hit || bodyzone_hit == BODY_ZONE_HEAD) //only if we didn't specify a zone or if that zone is the head. var/obj/item/clothing/head_clothes = null if(glasses) head_clothes = glasses @@ -509,14 +509,14 @@ else to_chat(src, "Your [head_clothes.name] protects your head and face from the acid!") else - . = get_bodypart("head") + . = get_bodypart(BODY_ZONE_HEAD) if(.) damaged += . if(ears) inventory_items_to_kill += ears //CHEST// - if(!bodyzone_hit || bodyzone_hit == "chest") + if(!bodyzone_hit || bodyzone_hit == BODY_ZONE_CHEST) var/obj/item/clothing/chest_clothes = null if(w_uniform) chest_clothes = w_uniform @@ -530,7 +530,7 @@ else to_chat(src, "Your [chest_clothes.name] protects your body from the acid!") else - . = get_bodypart("chest") + . = get_bodypart(BODY_ZONE_CHEST) if(.) damaged += . if(wear_id) @@ -544,7 +544,7 @@ //ARMS & HANDS// - if(!bodyzone_hit || bodyzone_hit == "l_arm" || bodyzone_hit == "r_arm") + if(!bodyzone_hit || bodyzone_hit == BODY_ZONE_L_ARM || bodyzone_hit == BODY_ZONE_R_ARM) var/obj/item/clothing/arm_clothes = null if(gloves) arm_clothes = gloves @@ -562,16 +562,16 @@ else to_chat(src, "Your [arm_clothes.name] protects your arms and hands from the acid!") else - . = get_bodypart("r_arm") + . = get_bodypart(BODY_ZONE_R_ARM) if(.) damaged += . - . = get_bodypart("l_arm") + . = get_bodypart(BODY_ZONE_L_ARM) if(.) damaged += . //LEGS & FEET// - if(!bodyzone_hit || bodyzone_hit == "l_leg" || bodyzone_hit == "r_leg" || bodyzone_hit == "feet") + if(!bodyzone_hit || bodyzone_hit == BODY_ZONE_L_LEG || bodyzone_hit == BODY_ZONE_R_LEG || bodyzone_hit == "feet") var/obj/item/clothing/leg_clothes = null if(shoes) leg_clothes = shoes @@ -588,10 +588,10 @@ else to_chat(src, "Your [leg_clothes.name] protects your legs and feet from the acid!") else - . = get_bodypart("r_leg") + . = get_bodypart(BODY_ZONE_R_LEG) if(.) damaged += . - . = get_bodypart("l_leg") + . = get_bodypart(BODY_ZONE_L_LEG) if(.) damaged += . @@ -600,7 +600,7 @@ for(var/obj/item/bodypart/affecting in damaged) affecting.receive_damage(acidity, 2*acidity) - if(affecting.name == "head") + if(affecting.name == BODY_ZONE_HEAD) if(prob(min(acidpwr*acid_volume/10, 90))) //Applies disfigurement affecting.receive_damage(acidity, 2*acidity) emote("scream") @@ -645,7 +645,7 @@ visible_message("[src] examines [p_them()]self.", \ "You check yourself for injuries.") - var/list/missing = list("head", "chest", "l_arm", "r_arm", "l_leg", "r_leg") + var/list/missing = list(BODY_ZONE_HEAD, BODY_ZONE_CHEST, BODY_ZONE_L_ARM, BODY_ZONE_R_ARM, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG) for(var/X in bodyparts) var/obj/item/bodypart/LB = X missing -= LB.body_zone @@ -732,7 +732,7 @@ var/list/torn_items = list() //HEAD// - if(!def_zone || def_zone == "head") + if(!def_zone || def_zone == BODY_ZONE_HEAD) var/obj/item/clothing/head_clothes = null if(glasses) head_clothes = glasses @@ -748,7 +748,7 @@ torn_items += ears //CHEST// - if(!def_zone || def_zone == "chest") + if(!def_zone || def_zone == BODY_ZONE_CHEST) var/obj/item/clothing/chest_clothes = null if(w_uniform) chest_clothes = w_uniform @@ -758,7 +758,7 @@ torn_items += chest_clothes //ARMS & HANDS// - if(!def_zone || def_zone == "l_arm" || def_zone == "r_arm") + if(!def_zone || def_zone == BODY_ZONE_L_ARM || def_zone == BODY_ZONE_R_ARM) var/obj/item/clothing/arm_clothes = null if(gloves) arm_clothes = gloves @@ -770,7 +770,7 @@ torn_items += arm_clothes //LEGS & FEET// - if(!def_zone || def_zone == "l_leg" || def_zone == "r_leg") + if(!def_zone || def_zone == BODY_ZONE_L_LEG || def_zone == BODY_ZONE_R_LEG) var/obj/item/clothing/leg_clothes = null if(shoes) leg_clothes = shoes diff --git a/code/modules/mob/living/carbon/human/human_helpers.dm b/code/modules/mob/living/carbon/human/human_helpers.dm index f3f0fe0215..74562d6adb 100644 --- a/code/modules/mob/living/carbon/human/human_helpers.dm +++ b/code/modules/mob/living/carbon/human/human_helpers.dm @@ -55,7 +55,7 @@ return if_no_face if( head && (head.flags_inv&HIDEFACE) ) return if_no_face //Likewise for hats - var/obj/item/bodypart/O = get_bodypart("head") + var/obj/item/bodypart/O = get_bodypart(BODY_ZONE_HEAD) if( !O || (has_trait(TRAIT_DISFIGURED)) || (O.brutestate+O.burnstate)>2 || cloneloss>50 || !real_name ) //disfigured. use id-name if possible return if_no_face return real_name diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index c60eafbad2..8b132f3b38 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -221,7 +221,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) tail = new mutanttail() tail.Insert(C) - if(C.get_bodypart("head")) + if(C.get_bodypart(BODY_ZONE_HEAD)) if(eyes && (replace_current || !should_have_eyes)) eyes.Remove(C,1) QDEL_NULL(eyes) @@ -315,7 +315,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) /datum/species/proc/handle_hair(mob/living/carbon/human/H, forced_colour) H.remove_overlay(HAIR_LAYER) - var/obj/item/bodypart/head/HD = H.get_bodypart("head") + var/obj/item/bodypart/head/HD = H.get_bodypart(BODY_ZONE_HEAD) if(!HD) //Decapitated return @@ -458,7 +458,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) var/list/standing = list() - var/obj/item/bodypart/head/HD = H.get_bodypart("head") + var/obj/item/bodypart/head/HD = H.get_bodypart(BODY_ZONE_HEAD) if(HD && !(H.has_trait(TRAIT_HUSK))) // lipstick @@ -526,7 +526,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) if(!mutant_bodyparts) return - var/obj/item/bodypart/head/HD = H.get_bodypart("head") + var/obj/item/bodypart/head/HD = H.get_bodypart(BODY_ZONE_HEAD) if("tail_lizard" in mutant_bodyparts) if(H.wear_suit && (H.wear_suit.flags_inv & HIDEJUMPSUIT) || (!H.dna.features["taur"] == "None")) @@ -897,7 +897,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) return 0 if( !(I.slot_flags & SLOT_MASK) ) return 0 - if(!H.get_bodypart("head")) + if(!H.get_bodypart(BODY_ZONE_HEAD)) return 0 return equip_delay_self_check(I, H, bypass_equip_delay_self) if(slot_neck) @@ -942,7 +942,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) if(H.belt) return 0 - var/obj/item/bodypart/O = H.get_bodypart("chest") + var/obj/item/bodypart/O = H.get_bodypart(BODY_ZONE_CHEST) if(!H.w_uniform && !nojumpsuit && (!O || O.status != BODYPART_ROBOTIC)) if(!disable_warning) @@ -956,7 +956,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) return 0 if( !(I.slot_flags & SLOT_EYES) ) return 0 - if(!H.get_bodypart("head")) + if(!H.get_bodypart(BODY_ZONE_HEAD)) return 0 return equip_delay_self_check(I, H, bypass_equip_delay_self) if(slot_head) @@ -964,7 +964,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) return 0 if( !(I.slot_flags & SLOT_HEAD) ) return 0 - if(!H.get_bodypart("head")) + if(!H.get_bodypart(BODY_ZONE_HEAD)) return 0 return equip_delay_self_check(I, H, bypass_equip_delay_self) if(slot_ears) @@ -972,7 +972,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) return 0 if( !(I.slot_flags & SLOT_EARS) ) return 0 - if(!H.get_bodypart("head")) + if(!H.get_bodypart(BODY_ZONE_HEAD)) return 0 return equip_delay_self_check(I, H, bypass_equip_delay_self) if(slot_w_uniform) @@ -985,7 +985,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) if(H.wear_id) return 0 - var/obj/item/bodypart/O = H.get_bodypart("chest") + var/obj/item/bodypart/O = H.get_bodypart(BODY_ZONE_CHEST) if(!H.w_uniform && !nojumpsuit && (!O || O.status != BODYPART_ROBOTIC)) if(!disable_warning) to_chat(H, "You need a jumpsuit before you can attach this [I.name]!") @@ -999,7 +999,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) if(H.l_store) return 0 - var/obj/item/bodypart/O = H.get_bodypart("l_leg") + var/obj/item/bodypart/O = H.get_bodypart(BODY_ZONE_L_LEG) if(!H.w_uniform && !nojumpsuit && (!O || O.status != BODYPART_ROBOTIC)) if(!disable_warning) @@ -1015,7 +1015,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) if(H.r_store) return 0 - var/obj/item/bodypart/O = H.get_bodypart("r_leg") + var/obj/item/bodypart/O = H.get_bodypart(BODY_ZONE_R_LEG) if(!H.w_uniform && !nojumpsuit && (!O || O.status != BODYPART_ROBOTIC)) if(!disable_warning) @@ -1584,7 +1584,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) user.add_mob_blood(H) switch(hit_area) - if("head") + if(BODY_ZONE_HEAD) if(H.stat == CONSCIOUS && armor_block < 50) if(prob(I.force)) H.visible_message("[H] has been knocked senseless!", \ @@ -1614,7 +1614,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) H.glasses.add_mob_blood(H) H.update_inv_glasses() - if("chest") + if(BODY_ZONE_CHEST) if(H.stat == CONSCIOUS && armor_block < 50) if(prob(I.force)) H.visible_message("[H] has been knocked down!", \ diff --git a/code/modules/mob/living/carbon/human/species_types/dullahan.dm b/code/modules/mob/living/carbon/human/species_types/dullahan.dm index 3a0e5a8415..6029182afe 100644 --- a/code/modules/mob/living/carbon/human/species_types/dullahan.dm +++ b/code/modules/mob/living/carbon/human/species_types/dullahan.dm @@ -26,7 +26,7 @@ /datum/species/dullahan/on_species_gain(mob/living/carbon/human/H, datum/species/old_species) . = ..() H.flags_1 &= ~HEAR_1 - var/obj/item/bodypart/head/head = H.get_bodypart("head") + var/obj/item/bodypart/head/head = H.get_bodypart(BODY_ZONE_HEAD) if(head) head.drop_limb() head.flags_1 = HEAR_1 @@ -42,14 +42,14 @@ myhead = null DR.owner = null qdel(DR) - H.regenerate_limb("head",FALSE) + H.regenerate_limb(BODY_ZONE_HEAD,FALSE) ..() /datum/species/dullahan/spec_life(mob/living/carbon/human/H) if(QDELETED(myhead)) myhead = null H.gib() - var/obj/item/bodypart/head/head2 = H.get_bodypart("head") + var/obj/item/bodypart/head/head2 = H.get_bodypart(BODY_ZONE_HEAD) if(head2) myhead = null H.gib() diff --git a/code/modules/mob/living/carbon/human/species_types/jellypeople.dm b/code/modules/mob/living/carbon/human/species_types/jellypeople.dm index 809c657f23..2ae8125c5e 100644 --- a/code/modules/mob/living/carbon/human/species_types/jellypeople.dm +++ b/code/modules/mob/living/carbon/human/species_types/jellypeople.dm @@ -59,13 +59,13 @@ regenerate_limbs.UpdateButtonIcon() /datum/species/jelly/proc/Cannibalize_Body(mob/living/carbon/human/H) - var/list/limbs_to_consume = list("r_arm", "l_arm", "r_leg", "l_leg") - H.get_missing_limbs() + var/list/limbs_to_consume = list(BODY_ZONE_R_ARM, BODY_ZONE_L_ARM, BODY_ZONE_R_LEG, BODY_ZONE_L_LEG) - H.get_missing_limbs() var/obj/item/bodypart/consumed_limb if(!limbs_to_consume.len) H.losebreath++ return if(H.get_num_legs()) //Legs go before arms - limbs_to_consume -= list("r_arm", "l_arm") + limbs_to_consume -= list(BODY_ZONE_R_ARM, BODY_ZONE_L_ARM) consumed_limb = H.get_bodypart(pick(limbs_to_consume)) consumed_limb.drop_limb() to_chat(H, "Your [consumed_limb] is drawn back into your body, unable to maintain its shape!") diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index 3c57b172fe..ab4e39f922 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -208,7 +208,7 @@ There are several things that need to be remembered: /mob/living/carbon/human/update_inv_glasses() remove_overlay(GLASSES_LAYER) - if(!get_bodypart("head")) //decapitated + if(!get_bodypart(BODY_ZONE_HEAD)) //decapitated return if(client && hud_used) @@ -235,7 +235,7 @@ There are several things that need to be remembered: /mob/living/carbon/human/update_inv_ears() remove_overlay(EARS_LAYER) - if(!get_bodypart("head")) //decapitated + if(!get_bodypart(BODY_ZONE_HEAD)) //decapitated return if(client && hud_used) diff --git a/code/modules/mob/living/carbon/monkey/monkey_defense.dm b/code/modules/mob/living/carbon/monkey/monkey_defense.dm index fe15e50975..f6b8e19468 100644 --- a/code/modules/mob/living/carbon/monkey/monkey_defense.dm +++ b/code/modules/mob/living/carbon/monkey/monkey_defense.dm @@ -7,10 +7,10 @@ /mob/living/carbon/monkey/attack_paw(mob/living/M) if(..()) //successful monkey bite. - var/dam_zone = pick("chest", "l_hand", "r_hand", "l_leg", "r_leg") + var/dam_zone = pick(BODY_ZONE_CHEST, BODY_ZONE_PRECISE_L_HAND, BODY_ZONE_PRECISE_R_HAND, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG) var/obj/item/bodypart/affecting = get_bodypart(ran_zone(dam_zone)) if(!affecting) - affecting = get_bodypart("chest") + affecting = get_bodypart(BODY_ZONE_CHEST) if(M.limb_destroyer) dismembering_strike(M, affecting.body_zone) if(stat != DEAD) @@ -24,7 +24,7 @@ L.amount_grown = min(L.amount_grown + damage, L.max_grown) var/obj/item/bodypart/affecting = get_bodypart(ran_zone(L.zone_selected)) if(!affecting) - affecting = get_bodypart("chest") + affecting = get_bodypart(BODY_ZONE_CHEST) apply_damage(damage, BRUTE, affecting) /mob/living/carbon/monkey/attack_hand(mob/living/carbon/human/M) @@ -52,7 +52,7 @@ "[M] has knocked out [name]!", null, 5) var/obj/item/bodypart/affecting = get_bodypart(ran_zone(M.zone_selected)) if(!affecting) - affecting = get_bodypart("chest") + affecting = get_bodypart(BODY_ZONE_CHEST) apply_damage(damage, BRUTE, affecting) add_logs(M, src, "attacked") @@ -92,7 +92,7 @@ var/obj/item/bodypart/affecting = get_bodypart(ran_zone(M.zone_selected)) add_logs(M, src, "attacked") if(!affecting) - affecting = get_bodypart("chest") + affecting = get_bodypart(BODY_ZONE_CHEST) if(!dismembering_strike(M, affecting.body_zone)) //Dismemberment successful return 1 apply_damage(damage, BRUTE, affecting) @@ -123,12 +123,12 @@ . = ..() if(.) var/damage = rand(M.melee_damage_lower, M.melee_damage_upper) - var/dam_zone = dismembering_strike(M, pick("chest", "l_hand", "r_hand", "l_leg", "r_leg")) + var/dam_zone = dismembering_strike(M, pick(BODY_ZONE_CHEST, BODY_ZONE_PRECISE_L_HAND, BODY_ZONE_PRECISE_R_HAND, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG)) if(!dam_zone) //Dismemberment successful return TRUE var/obj/item/bodypart/affecting = get_bodypart(ran_zone(dam_zone)) if(!affecting) - affecting = get_bodypart("chest") + affecting = get_bodypart(BODY_ZONE_CHEST) apply_damage(damage, M.melee_damage_type, affecting) /mob/living/carbon/monkey/attack_slime(mob/living/simple_animal/slime/M) @@ -136,17 +136,17 @@ var/damage = rand(5, 35) if(M.is_adult) damage = rand(20, 40) - var/dam_zone = dismembering_strike(M, pick("head", "chest", "l_arm", "r_arm", "l_leg", "r_leg")) + var/dam_zone = dismembering_strike(M, pick(BODY_ZONE_HEAD, BODY_ZONE_CHEST, BODY_ZONE_L_ARM, BODY_ZONE_R_ARM, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG)) if(!dam_zone) //Dismemberment successful return 1 var/obj/item/bodypart/affecting = get_bodypart(ran_zone(dam_zone)) if(!affecting) - affecting = get_bodypart("chest") + affecting = get_bodypart(BODY_ZONE_CHEST) apply_damage(damage, BRUTE, affecting) /mob/living/carbon/monkey/acid_act(acidpwr, acid_volume, bodyzone_hit) . = 1 - if(!bodyzone_hit || bodyzone_hit == "head") + if(!bodyzone_hit || bodyzone_hit == BODY_ZONE_HEAD) if(wear_mask) if(!(wear_mask.resistance_flags & UNACIDABLE)) wear_mask.acid_act(acidpwr, acid_volume) @@ -192,7 +192,7 @@ var/max_limb_loss = round(4/severity) //so you don't lose four limbs at severity 3. for(var/X in bodyparts) var/obj/item/bodypart/BP = X - if(prob(50/severity) && BP.body_zone != "chest") + if(prob(50/severity) && BP.body_zone != BODY_ZONE_CHEST) BP.brute_dam = BP.max_damage BP.dismember() max_limb_loss-- diff --git a/code/modules/mob/living/carbon/monkey/update_icons.dm b/code/modules/mob/living/carbon/monkey/update_icons.dm index def7640b76..c807251af4 100644 --- a/code/modules/mob/living/carbon/monkey/update_icons.dm +++ b/code/modules/mob/living/carbon/monkey/update_icons.dm @@ -15,7 +15,7 @@ /mob/living/carbon/monkey/update_hair() remove_overlay(HAIR_LAYER) - var/obj/item/bodypart/head/HD = get_bodypart("head") + var/obj/item/bodypart/head/HD = get_bodypart(BODY_ZONE_HEAD) if(!HD) //Decapitated return diff --git a/code/modules/mob/living/carbon/update_icons.dm b/code/modules/mob/living/carbon/update_icons.dm index d798a3cd25..abd02de061 100644 --- a/code/modules/mob/living/carbon/update_icons.dm +++ b/code/modules/mob/living/carbon/update_icons.dm @@ -115,7 +115,7 @@ /mob/living/carbon/update_inv_wear_mask() remove_overlay(FACEMASK_LAYER) - if(!get_bodypart("head")) //Decapitated + if(!get_bodypart(BODY_ZONE_HEAD)) //Decapitated return if(client && hud_used && hud_used.inv_slots[slot_wear_mask]) @@ -159,7 +159,7 @@ /mob/living/carbon/update_inv_head() remove_overlay(HEAD_LAYER) - if(!get_bodypart("head")) //Decapitated + if(!get_bodypart(BODY_ZONE_HEAD)) //Decapitated return if(client && hud_used && hud_used.inv_slots[slot_back]) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 5bd526efd5..2ddd4281ae 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -446,8 +446,8 @@ /mob/living/proc/get_organ_target() var/mob/shooter = src var/t = shooter.zone_selected - if ((t in list( "eyes", "mouth" ))) - t = "head" + if ((t in list( BODY_ZONE_PRECISE_EYES, BODY_ZONE_PRECISE_MOUTH ))) + t = BODY_ZONE_HEAD var/def_zone = ran_zone(t) return def_zone diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index 6450c13bb7..085f43075c 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -64,7 +64,7 @@ /mob/living/hitby(atom/movable/AM, skipcatch, hitpush = TRUE, blocked = FALSE) if(istype(AM, /obj/item)) var/obj/item/I = AM - var/zone = ran_zone("chest", 65)//Hits a random part of the body, geared towards the chest + var/zone = ran_zone(BODY_ZONE_CHEST, 65)//Hits a random part of the body, geared towards the chest var/dtype = BRUTE var/volume = I.get_volume_by_throwforce_and_or_w_class() dtype = I.damtype diff --git a/code/modules/mob/living/simple_animal/bot/mulebot.dm b/code/modules/mob/living/simple_animal/bot/mulebot.dm index 37cf224edd..ad59ce7e34 100644 --- a/code/modules/mob/living/simple_animal/bot/mulebot.dm +++ b/code/modules/mob/living/simple_animal/bot/mulebot.dm @@ -641,12 +641,12 @@ playsound(loc, 'sound/effects/splat.ogg', 50, 1) var/damage = rand(5,15) - H.apply_damage(2*damage, BRUTE, "head", run_armor_check("head", "melee")) - H.apply_damage(2*damage, BRUTE, "chest", run_armor_check("chest", "melee")) - H.apply_damage(0.5*damage, BRUTE, "l_leg", run_armor_check("l_leg", "melee")) - H.apply_damage(0.5*damage, BRUTE, "r_leg", run_armor_check("r_leg", "melee")) - H.apply_damage(0.5*damage, BRUTE, "l_arm", run_armor_check("l_arm", "melee")) - H.apply_damage(0.5*damage, BRUTE, "r_arm", run_armor_check("r_arm", "melee")) + H.apply_damage(2*damage, BRUTE, BODY_ZONE_HEAD, run_armor_check(BODY_ZONE_HEAD, "melee")) + H.apply_damage(2*damage, BRUTE, BODY_ZONE_CHEST, run_armor_check(BODY_ZONE_CHEST, "melee")) + H.apply_damage(0.5*damage, BRUTE, BODY_ZONE_L_LEG, run_armor_check(BODY_ZONE_L_LEG, "melee")) + H.apply_damage(0.5*damage, BRUTE, BODY_ZONE_R_LEG, run_armor_check(BODY_ZONE_R_LEG, "melee")) + H.apply_damage(0.5*damage, BRUTE, BODY_ZONE_L_ARM, run_armor_check(BODY_ZONE_L_ARM, "melee")) + H.apply_damage(0.5*damage, BRUTE, BODY_ZONE_R_ARM, run_armor_check(BODY_ZONE_R_ARM, "melee")) var/turf/T = get_turf(src) T.add_mob_blood(H) diff --git a/code/modules/mob/living/simple_animal/friendly/dog.dm b/code/modules/mob/living/simple_animal/friendly/dog.dm index ae1681cbef..4dab39e397 100644 --- a/code/modules/mob/living/simple_animal/friendly/dog.dm +++ b/code/modules/mob/living/simple_animal/friendly/dog.dm @@ -85,7 +85,7 @@ var/armorval = 0 if(def_zone) - if(def_zone == "head") + if(def_zone == BODY_ZONE_HEAD) if(inventory_head) armorval = inventory_head.armor.getRating(type) else @@ -139,7 +139,7 @@ return var/remove_from = href_list["remove_inv"] switch(remove_from) - if("head") + if(BODY_ZONE_HEAD) if(inventory_head) inventory_head.forceMove(drop_location()) inventory_head = null @@ -168,7 +168,7 @@ var/add_to = href_list["add_inv"] switch(add_to) - if("head") + if(BODY_ZONE_HEAD) place_on_head(usr.get_active_held_item(),usr) if("back") diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm index e0e7efd11b..1dfd27c7e5 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm @@ -252,7 +252,7 @@ Difficulty: Hard if(!faction_check_mob(L)) to_chat(L, "[src] rends you!") playsound(T, attack_sound, 100, 1, -1) - var/limb_to_hit = L.get_bodypart(pick("head", "chest", "r_arm", "l_arm", "r_leg", "l_leg")) + var/limb_to_hit = L.get_bodypart(pick(BODY_ZONE_HEAD, BODY_ZONE_CHEST, BODY_ZONE_R_ARM, BODY_ZONE_L_ARM, BODY_ZONE_R_LEG, BODY_ZONE_L_LEG)) L.apply_damage(25, BRUTE, limb_to_hit, L.run_armor_check(limb_to_hit, "melee", null, null, armour_penetration)) sleep(3) diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm index 142883fa02..22891265ae 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm @@ -628,7 +628,7 @@ Difficulty: Hard flash_color(L.client, "#660099", 1) playsound(L,'sound/weapons/sear.ogg', 50, 1, -4) to_chat(L, "You're struck by a [name]!") - var/limb_to_hit = L.get_bodypart(pick("head", "chest", "r_arm", "l_arm", "r_leg", "l_leg")) + var/limb_to_hit = L.get_bodypart(pick(BODY_ZONE_HEAD, BODY_ZONE_CHEST, BODY_ZONE_R_ARM, BODY_ZONE_L_ARM, BODY_ZONE_R_LEG, BODY_ZONE_L_LEG)) var/armor = L.run_armor_check(limb_to_hit, "melee", "Your armor absorbs [src]!", "Your armor blocks part of [src]!", 50, "Your armor was penetrated by [src]!") L.apply_damage(damage, BURN, limb_to_hit, armor) if(ishostile(L)) diff --git a/code/modules/mob/living/simple_animal/parrot.dm b/code/modules/mob/living/simple_animal/parrot.dm index 5b8976396a..46e5b4f3b1 100644 --- a/code/modules/mob/living/simple_animal/parrot.dm +++ b/code/modules/mob/living/simple_animal/parrot.dm @@ -65,7 +65,7 @@ var/parrot_state = PARROT_WANDER //Hunt for a perch when created var/parrot_sleep_max = 25 //The time the parrot sits while perched before looking around. Mosly a way to avoid the parrot's AI in life() being run every single tick. var/parrot_sleep_dur = 25 //Same as above, this is the var that physically counts down - var/parrot_dam_zone = list("chest", "head", "l_arm", "l_leg", "r_arm", "r_leg") //For humans, select a bodypart to attack + var/parrot_dam_zone = list(BODY_ZONE_CHEST, BODY_ZONE_HEAD, BODY_ZONE_L_ARM, BODY_ZONE_L_LEG, BODY_ZONE_R_ARM, BODY_ZONE_R_LEG) //For humans, select a bodypart to attack var/parrot_speed = 5 //"Delay in world ticks between movement." according to byond. Yeah, that's BS but it does directly affect movement. Higher number = slower. var/parrot_lastmove = null //Updates/Stores position of the parrot while it's moving diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 3b9930faa9..242e1c8177 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -16,22 +16,22 @@ /proc/check_zone(zone) if(!zone) - return "chest" + return BODY_ZONE_CHEST switch(zone) - if("eyes") - zone = "head" - if("mouth") - zone = "head" - if("l_hand") - zone = "l_arm" - if("r_hand") - zone = "r_arm" - if("l_foot") - zone = "l_leg" - if("r_foot") - zone = "r_leg" - if("groin") - zone = "chest" + if(BODY_ZONE_PRECISE_EYES) + zone = BODY_ZONE_HEAD + if(BODY_ZONE_PRECISE_MOUTH) + zone = BODY_ZONE_HEAD + if(BODY_ZONE_PRECISE_L_HAND) + zone = BODY_ZONE_L_ARM + if(BODY_ZONE_PRECISE_R_HAND) + zone = BODY_ZONE_R_ARM + if(BODY_ZONE_PRECISE_L_FOOT) + zone = BODY_ZONE_L_LEG + if(BODY_ZONE_PRECISE_R_FOOT) + zone = BODY_ZONE_R_LEG + if(BODY_ZONE_PRECISE_GROIN) + zone = BODY_ZONE_CHEST return zone @@ -45,22 +45,22 @@ var/t = rand(1, 18) // randomly pick a different zone, or maybe the same one switch(t) if(1) - return "head" + return BODY_ZONE_HEAD if(2) - return "chest" + return BODY_ZONE_CHEST if(3 to 6) - return "l_arm" + return BODY_ZONE_L_ARM if(7 to 10) - return "r_arm" + return BODY_ZONE_R_ARM if(11 to 14) - return "l_leg" + return BODY_ZONE_L_LEG if(15 to 18) - return "r_leg" + return BODY_ZONE_R_LEG return zone /proc/above_neck(zone) - var/list/zones = list("head", "mouth", "eyes") + var/list/zones = list(BODY_ZONE_HEAD, BODY_ZONE_PRECISE_MOUTH, BODY_ZONE_PRECISE_EYES) if(zones.Find(zone)) return 1 else diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm index 0e441361d1..291ae1e425 100644 --- a/code/modules/mob/mob_movement.dm +++ b/code/modules/mob/mob_movement.dm @@ -282,12 +282,12 @@ var/next_in_line switch(mob.zone_selected) - if("head") - next_in_line = "eyes" - if("eyes") - next_in_line = "mouth" + if(BODY_ZONE_HEAD) + next_in_line = BODY_ZONE_PRECISE_EYES + if(BODY_ZONE_PRECISE_EYES) + next_in_line = BODY_ZONE_PRECISE_MOUTH else - next_in_line = "head" + next_in_line = BODY_ZONE_HEAD var/obj/screen/zone_sel/selector = mob.hud_used.zone_select selector.set_selected_zone(next_in_line, mob) @@ -300,7 +300,7 @@ return var/obj/screen/zone_sel/selector = mob.hud_used.zone_select - selector.set_selected_zone("r_arm", mob) + selector.set_selected_zone(BODY_ZONE_R_ARM, mob) /client/verb/body_chest() set name = "body-chest" @@ -310,7 +310,7 @@ return var/obj/screen/zone_sel/selector = mob.hud_used.zone_select - selector.set_selected_zone("chest", mob) + selector.set_selected_zone(BODY_ZONE_CHEST, mob) /client/verb/body_l_arm() set name = "body-l-arm" @@ -320,7 +320,7 @@ return var/obj/screen/zone_sel/selector = mob.hud_used.zone_select - selector.set_selected_zone("l_arm", mob) + selector.set_selected_zone(BODY_ZONE_L_ARM, mob) /client/verb/body_r_leg() set name = "body-r-leg" @@ -330,7 +330,7 @@ return var/obj/screen/zone_sel/selector = mob.hud_used.zone_select - selector.set_selected_zone("r_leg", mob) + selector.set_selected_zone(BODY_ZONE_R_LEG, mob) /client/verb/body_groin() set name = "body-groin" @@ -340,7 +340,7 @@ return var/obj/screen/zone_sel/selector = mob.hud_used.zone_select - selector.set_selected_zone("groin", mob) + selector.set_selected_zone(BODY_ZONE_PRECISE_GROIN, mob) /client/verb/body_l_leg() set name = "body-l-leg" @@ -350,7 +350,7 @@ return var/obj/screen/zone_sel/selector = mob.hud_used.zone_select - selector.set_selected_zone("l_leg", mob) + selector.set_selected_zone(BODY_ZONE_L_LEG, mob) /client/verb/toggle_walk_run() set name = "toggle-walk-run" diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm index 9178a2341b..84dbb6ef9f 100644 --- a/code/modules/mob/transform_procs.dm +++ b/code/modules/mob/transform_procs.dm @@ -17,7 +17,7 @@ var/obj/item/cavity_object - var/obj/item/bodypart/chest/CH = get_bodypart("chest") + var/obj/item/bodypart/chest/CH = get_bodypart(BODY_ZONE_CHEST) if(CH.cavity_item) cavity_object = CH.cavity_item CH.cavity_item = null @@ -107,7 +107,7 @@ var/obj/item/organ/I = X I.Insert(O, 1) - var/obj/item/bodypart/chest/torso = O.get_bodypart("chest") + var/obj/item/bodypart/chest/torso = O.get_bodypart(BODY_ZONE_CHEST) if(cavity_object) torso.cavity_item = cavity_object //cavity item is given to the new chest cavity_object.forceMove(O) @@ -167,7 +167,7 @@ var/obj/item/cavity_object - var/obj/item/bodypart/chest/CH = get_bodypart("chest") + var/obj/item/bodypart/chest/CH = get_bodypart(BODY_ZONE_CHEST) if(CH.cavity_item) cavity_object = CH.cavity_item CH.cavity_item = null @@ -266,7 +266,7 @@ I.Insert(O, 1) - var/obj/item/bodypart/chest/torso = get_bodypart("chest") + var/obj/item/bodypart/chest/torso = get_bodypart(BODY_ZONE_CHEST) if(cavity_object) torso.cavity_item = cavity_object //cavity item is given to the new chest cavity_object.forceMove(O) diff --git a/code/modules/paperwork/paper_cutter.dm b/code/modules/paperwork/paper_cutter.dm index 92543bad90..c3ffc14b80 100644 --- a/code/modules/paperwork/paper_cutter.dm +++ b/code/modules/paperwork/paper_cutter.dm @@ -23,7 +23,7 @@ user.visible_message("[user] is beheading [user.p_them()]self with [src.name]! It looks like [user.p_theyre()] trying to commit suicide!") 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) diff --git a/code/modules/power/supermatter/supermatter.dm b/code/modules/power/supermatter/supermatter.dm index 7a07ba5a7f..d060286efb 100644 --- a/code/modules/power/supermatter/supermatter.dm +++ b/code/modules/power/supermatter/supermatter.dm @@ -486,7 +486,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_shard) if(iscarbon(user)) var/mob/living/carbon/C = user to_chat(C, "That was a really dumb idea.") - var/obj/item/bodypart/head/rip_u = C.get_bodypart("head") + var/obj/item/bodypart/head/rip_u = C.get_bodypart(BODY_ZONE_HEAD) rip_u.dismember(BURN) //nice try jedi /obj/machinery/power/supermatter_shard/attack_paw(mob/user) diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 7b7daadc18..6500374a6a 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -138,7 +138,7 @@ return if(!ismob(target) || user.a_intent == INTENT_HARM) //melee attack return - if(target == user && user.zone_selected != "mouth") //so we can't shoot ourselves (unless mouth selected) + if(target == user && user.zone_selected != BODY_ZONE_PRECISE_MOUTH) //so we can't shoot ourselves (unless mouth selected) return if(istype(user))//Check if the user can use the gun, if the user isn't alive(turrets) assume it can. @@ -151,7 +151,7 @@ return if(flag) - if(user.zone_selected == "mouth") + if(user.zone_selected == BODY_ZONE_PRECISE_MOUTH) handle_suicide(user, target, params) return @@ -161,7 +161,7 @@ if(istype(user)) if (user.has_trait(TRAIT_CLUMSY) && prob(40)) to_chat(user, "You shoot yourself in the foot with [src]!") - var/shot_leg = pick("l_leg", "r_leg") + var/shot_leg = pick(BODY_ZONE_L_LEG, BODY_ZONE_R_LEG) process_fire(user, user, FALSE, params, shot_leg) user.dropItemToGround(src, TRUE) return @@ -429,7 +429,7 @@ semicd = TRUE - if(!do_mob(user, target, 120) || user.zone_selected != "mouth") + if(!do_mob(user, target, 120) || user.zone_selected != BODY_ZONE_PRECISE_MOUTH) if(user) if(user == target) user.visible_message("[user] decided not to shoot.") diff --git a/code/modules/projectiles/guns/ballistic.dm b/code/modules/projectiles/guns/ballistic.dm index f7cb05486f..f83a2d9edd 100644 --- a/code/modules/projectiles/guns/ballistic.dm +++ b/code/modules/projectiles/guns/ballistic.dm @@ -159,7 +159,7 @@ sleep(25) if(user.is_holding(src)) var/turf/T = get_turf(user) - process_fire(user, user, FALSE, null, "head") + process_fire(user, user, FALSE, null, BODY_ZONE_HEAD) user.visible_message("[user] blows [user.p_their()] brain[user.p_s()] out with [src]!") var/turf/target = get_ranged_target_turf(user, turn(user.dir, 180), BRAINS_BLOWN_THROW_RANGE) B.Remove(user) diff --git a/code/modules/projectiles/guns/ballistic/revolver.dm b/code/modules/projectiles/guns/ballistic/revolver.dm index 489f88ffad..3cbff78aee 100644 --- a/code/modules/projectiles/guns/ballistic/revolver.dm +++ b/code/modules/projectiles/guns/ballistic/revolver.dm @@ -218,7 +218,7 @@ playsound(user, fire_sound, 50, 1) var/zone = check_zone(user.zone_selected) var/obj/item/bodypart/affecting = H.get_bodypart(zone) - if(zone == "head" || zone == "eyes" || zone == "mouth") + if(zone == BODY_ZONE_HEAD || zone == BODY_ZONE_PRECISE_EYES || zone == BODY_ZONE_PRECISE_MOUTH) shoot_self(user, affecting) else user.visible_message("[user.name] cowardly fires [src] at [user.p_their()] [affecting.name]!", "You cowardly fire [src] at your [affecting.name]!", "You hear a gunshot!") @@ -228,7 +228,7 @@ user.visible_message("*click*") playsound(src, "gun_dry_fire", 30, 1) -/obj/item/gun/ballistic/revolver/russian/proc/shoot_self(mob/living/carbon/human/user, affecting = "head") +/obj/item/gun/ballistic/revolver/russian/proc/shoot_self(mob/living/carbon/human/user, affecting = BODY_ZONE_HEAD) user.apply_damage(300, BRUTE, affecting) user.visible_message("[user.name] fires [src] at [user.p_their()] head!", "You fire [src] at your head!", "You hear a gunshot!") @@ -349,7 +349,7 @@ /obj/item/gun/ballistic/revolver/reverse/can_trigger_gun(mob/living/user) if((user.has_trait(TRAIT_CLUMSY)) || (user.mind && user.mind.assigned_role == "Clown")) return ..() - if(process_fire(user, user, FALSE, null, "head")) + if(process_fire(user, user, FALSE, null, BODY_ZONE_HEAD)) user.visible_message("[user] somehow manages to shoot [user.p_them()]self in the face!", "You somehow shoot yourself in the face! How the hell?!") user.emote("scream") user.drop_all_held_items() diff --git a/code/modules/projectiles/guns/misc/beam_rifle.dm b/code/modules/projectiles/guns/misc/beam_rifle.dm index 59465eb989..80cbf11318 100644 --- a/code/modules/projectiles/guns/misc/beam_rifle.dm +++ b/code/modules/projectiles/guns/misc/beam_rifle.dm @@ -332,7 +332,7 @@ return if(!ismob(target) || user.a_intent == INTENT_HARM) //melee attack return - if(target == user && user.zone_selected != "mouth") //so we can't shoot ourselves (unless mouth selected) + if(target == user && user.zone_selected != BODY_ZONE_PRECISE_MOUTH) //so we can't shoot ourselves (unless mouth selected) return if(!passthrough && (aiming_time > aiming_time_fire_threshold)) return diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index db43917d6c..ad1d0f76d0 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -105,7 +105,7 @@ if(get_bodypart(hit_zone)) return hit_zone else //when a limb is missing the damage is actually passed to the chest - return "chest" + return BODY_ZONE_CHEST /obj/item/projectile/proc/prehit(atom/target) return TRUE diff --git a/code/modules/research/experimentor.dm b/code/modules/research/experimentor.dm index 9ffe65f7b9..0e66644c6f 100644 --- a/code/modules/research/experimentor.dm +++ b/code/modules/research/experimentor.dm @@ -257,7 +257,7 @@ else if(prob(EFFECT_PROB_VERYLOW-badThingCoeff)) visible_message("[src] malfunctions and destroys [exp_on], lashing its arms out at nearby people!") for(var/mob/living/m in oview(1, src)) - m.apply_damage(15, BRUTE, pick("head","chest","groin")) + m.apply_damage(15, BRUTE, pick(BODY_ZONE_HEAD,BODY_ZONE_CHEST,BODY_ZONE_PRECISE_GROIN)) investigate_log("Experimentor dealt minor brute to [m].", INVESTIGATE_EXPERIMENTOR) ejectItem(TRUE) else if(prob(EFFECT_PROB_LOW-badThingCoeff)) @@ -390,7 +390,7 @@ visible_message("[src] malfunctions, activating its emergency coolant systems!") throwSmoke(loc) for(var/mob/living/m in oview(1, src)) - m.apply_damage(5, BURN, pick("head","chest","groin")) + m.apply_damage(5, BURN, pick(BODY_ZONE_HEAD,BODY_ZONE_CHEST,BODY_ZONE_PRECISE_GROIN)) investigate_log("Experimentor has dealt minor burn damage to [m]", INVESTIGATE_EXPERIMENTOR) ejectItem() //////////////////////////////////////////////////////////////////////////////////////////////// @@ -503,7 +503,7 @@ visible_message("Experimentor draws the life essence of those nearby!") for(var/mob/living/m in view(4,src)) to_chat(m, "You feel your flesh being torn from you, mists of blood drifting to [src]!") - m.apply_damage(50, BRUTE, "chest") + m.apply_damage(50, BRUTE, BODY_ZONE_CHEST) investigate_log("Experimentor has taken 50 brute a blood sacrifice from [m]", INVESTIGATE_EXPERIMENTOR) if(globalMalf > 51 && globalMalf < 75) visible_message("[src] encounters a run-time error!") diff --git a/code/modules/surgery/advanced/bioware/nerve_grounding.dm b/code/modules/surgery/advanced/bioware/nerve_grounding.dm index 9868956efe..7834884f52 100644 --- a/code/modules/surgery/advanced/bioware/nerve_grounding.dm +++ b/code/modules/surgery/advanced/bioware/nerve_grounding.dm @@ -12,7 +12,7 @@ /datum/surgery_step/incise, /datum/surgery_step/ground_nerves, /datum/surgery_step/close) - possible_locs = list("chest") + possible_locs = list(BODY_ZONE_CHEST) bioware_target = BIOWARE_NERVES /datum/surgery_step/ground_nerves diff --git a/code/modules/surgery/advanced/bioware/nerve_splicing.dm b/code/modules/surgery/advanced/bioware/nerve_splicing.dm index 54a71e1fc9..770a8d67e6 100644 --- a/code/modules/surgery/advanced/bioware/nerve_splicing.dm +++ b/code/modules/surgery/advanced/bioware/nerve_splicing.dm @@ -12,7 +12,7 @@ /datum/surgery_step/incise, /datum/surgery_step/splice_nerves, /datum/surgery_step/close) - possible_locs = list("chest") + possible_locs = list(BODY_ZONE_CHEST) bioware_target = BIOWARE_NERVES /datum/surgery_step/splice_nerves diff --git a/code/modules/surgery/advanced/bioware/vein_threading.dm b/code/modules/surgery/advanced/bioware/vein_threading.dm index a94caeecaa..99f6506de8 100644 --- a/code/modules/surgery/advanced/bioware/vein_threading.dm +++ b/code/modules/surgery/advanced/bioware/vein_threading.dm @@ -12,7 +12,7 @@ /datum/surgery_step/incise, /datum/surgery_step/thread_veins, /datum/surgery_step/close) - possible_locs = list("chest") + possible_locs = list(BODY_ZONE_CHEST) bioware_target = BIOWARE_CIRCULATION /datum/surgery_step/thread_veins diff --git a/code/modules/surgery/advanced/brainwashing.dm b/code/modules/surgery/advanced/brainwashing.dm index 3cf3c264b3..0c67b8267d 100644 --- a/code/modules/surgery/advanced/brainwashing.dm +++ b/code/modules/surgery/advanced/brainwashing.dm @@ -14,7 +14,7 @@ /datum/surgery_step/close) species = list(/mob/living/carbon/human) - possible_locs = list("head") + possible_locs = list(BODY_ZONE_HEAD) /datum/surgery/advanced/brainwashing/can_start(mob/user, mob/living/carbon/target) if(!..()) diff --git a/code/modules/surgery/advanced/lobotomy.dm b/code/modules/surgery/advanced/lobotomy.dm index 0f4f8daace..94eea5d8ff 100644 --- a/code/modules/surgery/advanced/lobotomy.dm +++ b/code/modules/surgery/advanced/lobotomy.dm @@ -14,7 +14,7 @@ /datum/surgery_step/close) species = list(/mob/living/carbon/human, /mob/living/carbon/monkey) - possible_locs = list("head") + possible_locs = list(BODY_ZONE_HEAD) requires_bodypart_type = 0 /datum/surgery/advanced/lobotomy/can_start(mob/user, mob/living/carbon/target) diff --git a/code/modules/surgery/advanced/necrotic_revival.dm b/code/modules/surgery/advanced/necrotic_revival.dm index 7fb31c9b8e..55f502a3d0 100644 --- a/code/modules/surgery/advanced/necrotic_revival.dm +++ b/code/modules/surgery/advanced/necrotic_revival.dm @@ -12,7 +12,7 @@ /datum/surgery_step/bionecrosis, /datum/surgery_step/close) - possible_locs = list("head") + possible_locs = list(BODY_ZONE_HEAD) /datum/surgery/advanced/necrotic_revival/can_start(mob/user, mob/living/carbon/target) . = ..() diff --git a/code/modules/surgery/advanced/pacification.dm b/code/modules/surgery/advanced/pacification.dm index e9b557cf5c..ed3da3665f 100644 --- a/code/modules/surgery/advanced/pacification.dm +++ b/code/modules/surgery/advanced/pacification.dm @@ -13,7 +13,7 @@ /datum/surgery_step/close) species = list(/mob/living/carbon/human, /mob/living/carbon/monkey) - possible_locs = list("head") + possible_locs = list(BODY_ZONE_HEAD) requires_bodypart_type = 0 /datum/surgery/advanced/pacify/can_start(mob/user, mob/living/carbon/target) diff --git a/code/modules/surgery/advanced/reconstruction.dm b/code/modules/surgery/advanced/reconstruction.dm index 180a7cd81c..9fbf97070c 100644 --- a/code/modules/surgery/advanced/reconstruction.dm +++ b/code/modules/surgery/advanced/reconstruction.dm @@ -16,7 +16,7 @@ /datum/surgery_step/close) species = list(/mob/living/carbon/human, /mob/living/carbon/monkey) - possible_locs = list("chest") + possible_locs = list(BODY_ZONE_CHEST) requires_bodypart_type = 0 /datum/surgery_step/reconstruct diff --git a/code/modules/surgery/advanced/revival.dm b/code/modules/surgery/advanced/revival.dm index 61244066b2..cd602eabdf 100644 --- a/code/modules/surgery/advanced/revival.dm +++ b/code/modules/surgery/advanced/revival.dm @@ -14,7 +14,7 @@ /datum/surgery_step/close) species = list(/mob/living/carbon/human, /mob/living/carbon/monkey) - possible_locs = list("head") + possible_locs = list(BODY_ZONE_HEAD) requires_bodypart_type = 0 /datum/surgery/advanced/revival/can_start(mob/user, mob/living/carbon/target) diff --git a/code/modules/surgery/advanced/viral_bonding.dm b/code/modules/surgery/advanced/viral_bonding.dm index 7b4f986560..61f7185db6 100644 --- a/code/modules/surgery/advanced/viral_bonding.dm +++ b/code/modules/surgery/advanced/viral_bonding.dm @@ -13,7 +13,7 @@ /datum/surgery_step/close) species = list(/mob/living/carbon/human, /mob/living/carbon/monkey) - possible_locs = list("chest") + possible_locs = list(BODY_ZONE_CHEST) /datum/surgery/advanced/viral_bonding/can_start(mob/user, mob/living/carbon/target) if(!..()) diff --git a/code/modules/surgery/amputation.dm b/code/modules/surgery/amputation.dm index 0f8003b9b4..8465a6d332 100644 --- a/code/modules/surgery/amputation.dm +++ b/code/modules/surgery/amputation.dm @@ -3,7 +3,7 @@ name = "amputation" steps = list(/datum/surgery_step/incise, /datum/surgery_step/clamp_bleeders, /datum/surgery_step/retract_skin, /datum/surgery_step/saw, /datum/surgery_step/clamp_bleeders, /datum/surgery_step/sever_limb) species = list(/mob/living/carbon/human, /mob/living/carbon/monkey) - possible_locs = list("r_arm", "l_arm", "l_leg", "r_leg", "head") + possible_locs = list(BODY_ZONE_R_ARM, BODY_ZONE_L_ARM, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG, BODY_ZONE_HEAD) requires_bodypart_type = 0 diff --git a/code/modules/surgery/bodyparts/bodyparts.dm b/code/modules/surgery/bodyparts/bodyparts.dm index 133c22510e..4261e52e04 100644 --- a/code/modules/surgery/bodyparts/bodyparts.dm +++ b/code/modules/surgery/bodyparts/bodyparts.dm @@ -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 diff --git a/code/modules/surgery/bodyparts/dismemberment.dm b/code/modules/surgery/bodyparts/dismemberment.dm index 2cf8389a6b..5b128de600 100644 --- a/code/modules/surgery/bodyparts/dismemberment.dm +++ b/code/modules/surgery/bodyparts/dismemberment.dm @@ -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("[C]'s [src.name] has been violently dismembered!") 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) diff --git a/code/modules/surgery/bodyparts/head.dm b/code/modules/surgery/bodyparts/head.dm index 50dd2641e4..57b1c09cab 100644 --- a/code/modules/surgery/bodyparts/head.dm +++ b/code/modules/surgery/bodyparts/head.dm @@ -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 diff --git a/code/modules/surgery/bodyparts/helpers.dm b/code/modules/surgery/bodyparts/helpers.dm index 2c90496eb6..36081ad677 100644 --- a/code/modules/surgery/bodyparts/helpers.dm +++ b/code/modules/surgery/bodyparts/helpers.dm @@ -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) diff --git a/code/modules/surgery/brain_surgery.dm b/code/modules/surgery/brain_surgery.dm index 840c40a102..fcd626ad97 100644 --- a/code/modules/surgery/brain_surgery.dm +++ b/code/modules/surgery/brain_surgery.dm @@ -9,7 +9,7 @@ /datum/surgery_step/close) species = list(/mob/living/carbon/human, /mob/living/carbon/monkey) - possible_locs = list("head") + possible_locs = list(BODY_ZONE_HEAD) requires_bodypart_type = 0 /datum/surgery_step/fix_brain diff --git a/code/modules/surgery/cavity_implant.dm b/code/modules/surgery/cavity_implant.dm index 0d13e81188..fe4f1a6edf 100644 --- a/code/modules/surgery/cavity_implant.dm +++ b/code/modules/surgery/cavity_implant.dm @@ -2,7 +2,7 @@ name = "cavity implant" steps = list(/datum/surgery_step/incise, /datum/surgery_step/clamp_bleeders, /datum/surgery_step/retract_skin, /datum/surgery_step/incise, /datum/surgery_step/handle_cavity, /datum/surgery_step/close) species = list(/mob/living/carbon/human, /mob/living/carbon/monkey) - possible_locs = list("chest") + possible_locs = list(BODY_ZONE_CHEST) //handle cavity @@ -14,7 +14,7 @@ var/obj/item/IC = null /datum/surgery_step/handle_cavity/preop(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool, datum/surgery/surgery) - var/obj/item/bodypart/chest/CH = target.get_bodypart("chest") + var/obj/item/bodypart/chest/CH = target.get_bodypart(BODY_ZONE_CHEST) IC = CH.cavity_item if(tool) if(istype(tool, /obj/item/surgical_drapes) || istype(tool, /obj/item/bedsheet)) @@ -27,7 +27,7 @@ user.visible_message("[user] checks for items in [target]'s [target_zone].", "You check for items in [target]'s [target_zone]...") /datum/surgery_step/handle_cavity/success(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool, datum/surgery/surgery) - var/obj/item/bodypart/chest/CH = target.get_bodypart("chest") + var/obj/item/bodypart/chest/CH = target.get_bodypart(BODY_ZONE_CHEST) if(tool) if(IC || tool.w_class > WEIGHT_CLASS_NORMAL || (tool.flags_1 & NODROP_1) || istype(tool, /obj/item/organ)) to_chat(user, "You can't seem to fit [tool] in [target]'s [target_zone]!") diff --git a/code/modules/surgery/core_removal.dm b/code/modules/surgery/core_removal.dm index fe6b9a5b88..98b69b5eae 100644 --- a/code/modules/surgery/core_removal.dm +++ b/code/modules/surgery/core_removal.dm @@ -1,36 +1,36 @@ -/datum/surgery/core_removal - name = "core removal" - steps = list(/datum/surgery_step/incise, /datum/surgery_step/extract_core) - species = list(/mob/living/simple_animal/slime) - possible_locs = list("r_arm","l_arm","r_leg","l_leg","chest","head") - -/datum/surgery/core_removal/can_start(mob/user, mob/living/target) - if(target.stat == DEAD) - return 1 - return 0 - -//extract brain -/datum/surgery_step/extract_core - name = "extract core" - implements = list(/obj/item/hemostat = 100, TOOL_CROWBAR = 100) - time = 16 - -/datum/surgery_step/extract_core/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) - user.visible_message("[user] begins to extract a core from [target].", "You begin to extract a core from [target]...") - -/datum/surgery_step/extract_core/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) - var/mob/living/simple_animal/slime/slime = target - if(slime.cores > 0) - slime.cores-- - user.visible_message("[user] successfully extracts a core from [target]!", "You successfully extract a core from [target]. [slime.cores] core\s remaining.") - - new slime.coretype(slime.loc) - - if(slime.cores <= 0) - slime.icon_state = "[slime.colour] baby slime dead-nocore" - return 1 - else - return 0 - else +/datum/surgery/core_removal + name = "core removal" + steps = list(/datum/surgery_step/incise, /datum/surgery_step/extract_core) + species = list(/mob/living/simple_animal/slime) + possible_locs = list(BODY_ZONE_R_ARM,BODY_ZONE_L_ARM,BODY_ZONE_R_LEG,BODY_ZONE_L_LEG,BODY_ZONE_CHEST,BODY_ZONE_HEAD) + +/datum/surgery/core_removal/can_start(mob/user, mob/living/target) + if(target.stat == DEAD) + return 1 + return 0 + +//extract brain +/datum/surgery_step/extract_core + name = "extract core" + implements = list(/obj/item/hemostat = 100, TOOL_CROWBAR = 100) + time = 16 + +/datum/surgery_step/extract_core/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + user.visible_message("[user] begins to extract a core from [target].", "You begin to extract a core from [target]...") + +/datum/surgery_step/extract_core/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + var/mob/living/simple_animal/slime/slime = target + if(slime.cores > 0) + slime.cores-- + user.visible_message("[user] successfully extracts a core from [target]!", "You successfully extract a core from [target]. [slime.cores] core\s remaining.") + + new slime.coretype(slime.loc) + + if(slime.cores <= 0) + slime.icon_state = "[slime.colour] baby slime dead-nocore" + return 1 + else + return 0 + else to_chat(user, "There aren't any cores left in [target]!") - return 1 \ No newline at end of file + return 1 diff --git a/code/modules/surgery/dental_implant.dm b/code/modules/surgery/dental_implant.dm index 0073c59f8d..4e1d8eb743 100644 --- a/code/modules/surgery/dental_implant.dm +++ b/code/modules/surgery/dental_implant.dm @@ -1,7 +1,7 @@ /datum/surgery/dental_implant name = "dental implant" steps = list(/datum/surgery_step/drill, /datum/surgery_step/insert_pill) - possible_locs = list("mouth") + possible_locs = list(BODY_ZONE_PRECISE_MOUTH) /datum/surgery_step/insert_pill name = "insert pill" diff --git a/code/modules/surgery/eye_surgery.dm b/code/modules/surgery/eye_surgery.dm index dad5c3551c..e700d02be1 100644 --- a/code/modules/surgery/eye_surgery.dm +++ b/code/modules/surgery/eye_surgery.dm @@ -2,7 +2,7 @@ name = "eye surgery" steps = list(/datum/surgery_step/incise, /datum/surgery_step/retract_skin, /datum/surgery_step/clamp_bleeders, /datum/surgery_step/fix_eyes, /datum/surgery_step/close) species = list(/mob/living/carbon/human, /mob/living/carbon/monkey) - possible_locs = list("eyes") + possible_locs = list(BODY_ZONE_PRECISE_EYES) requires_bodypart_type = 0 //fix eyes diff --git a/code/modules/surgery/helpers.dm b/code/modules/surgery/helpers.dm index c3322126e4..2470146532 100644 --- a/code/modules/surgery/helpers.dm +++ b/code/modules/surgery/helpers.dm @@ -128,43 +128,43 @@ eyesmouth_covered |= I.flags_cover switch(location) - if("head") + if(BODY_ZONE_HEAD) if(covered_locations & HEAD) return 0 - if("eyes") + if(BODY_ZONE_PRECISE_EYES) if(covered_locations & HEAD || face_covered & HIDEEYES || eyesmouth_covered & GLASSESCOVERSEYES) return 0 - if("mouth") + if(BODY_ZONE_PRECISE_MOUTH) if(covered_locations & HEAD || face_covered & HIDEFACE || eyesmouth_covered & MASKCOVERSMOUTH || eyesmouth_covered & HEADCOVERSMOUTH) return 0 - if("chest") + if(BODY_ZONE_CHEST) if(covered_locations & CHEST) return 0 - if("groin") + if(BODY_ZONE_PRECISE_GROIN) if(covered_locations & GROIN) return 0 - if("l_arm") + if(BODY_ZONE_L_ARM) if(covered_locations & ARM_LEFT) return 0 - if("r_arm") + if(BODY_ZONE_R_ARM) if(covered_locations & ARM_RIGHT) return 0 - if("l_leg") + if(BODY_ZONE_L_LEG) if(covered_locations & LEG_LEFT) return 0 - if("r_leg") + if(BODY_ZONE_R_LEG) if(covered_locations & LEG_RIGHT) return 0 - if("l_hand") + if(BODY_ZONE_PRECISE_L_HAND) if(covered_locations & HAND_LEFT) return 0 - if("r_hand") + if(BODY_ZONE_PRECISE_R_HAND) if(covered_locations & HAND_RIGHT) return 0 - if("l_foot") + if(BODY_ZONE_PRECISE_L_FOOT) if(covered_locations & FOOT_LEFT) return 0 - if("r_foot") + if(BODY_ZONE_PRECISE_R_FOOT) if(covered_locations & FOOT_RIGHT) return 0 diff --git a/code/modules/surgery/implant_removal.dm b/code/modules/surgery/implant_removal.dm index 7dc2a6afa9..92c5e05246 100644 --- a/code/modules/surgery/implant_removal.dm +++ b/code/modules/surgery/implant_removal.dm @@ -2,7 +2,7 @@ name = "implant removal" steps = list(/datum/surgery_step/incise, /datum/surgery_step/clamp_bleeders, /datum/surgery_step/retract_skin, /datum/surgery_step/extract_implant, /datum/surgery_step/close) species = list(/mob/living/carbon/human, /mob/living/carbon/monkey) - possible_locs = list("chest") + possible_locs = list(BODY_ZONE_CHEST) //extract implant diff --git a/code/modules/surgery/limb_augmentation.dm b/code/modules/surgery/limb_augmentation.dm index 0183b2bba1..10ef58ff18 100644 --- a/code/modules/surgery/limb_augmentation.dm +++ b/code/modules/surgery/limb_augmentation.dm @@ -44,7 +44,7 @@ name = "augmentation" steps = list(/datum/surgery_step/incise, /datum/surgery_step/clamp_bleeders, /datum/surgery_step/retract_skin, /datum/surgery_step/replace, /datum/surgery_step/saw, /datum/surgery_step/add_limb) species = list(/mob/living/carbon/human) - possible_locs = list("r_arm","l_arm","r_leg","l_leg","chest","head") + possible_locs = list(BODY_ZONE_R_ARM,BODY_ZONE_L_ARM,BODY_ZONE_R_LEG,BODY_ZONE_L_LEG,BODY_ZONE_CHEST,BODY_ZONE_HEAD) requires_real_bodypart = TRUE //SURGERY STEP SUCCESSES diff --git a/code/modules/surgery/lipoplasty.dm b/code/modules/surgery/lipoplasty.dm index 002b68fdf9..7bc7553023 100644 --- a/code/modules/surgery/lipoplasty.dm +++ b/code/modules/surgery/lipoplasty.dm @@ -1,7 +1,7 @@ /datum/surgery/lipoplasty name = "lipoplasty" steps = list(/datum/surgery_step/incise, /datum/surgery_step/clamp_bleeders, /datum/surgery_step/cut_fat, /datum/surgery_step/remove_fat, /datum/surgery_step/close) - possible_locs = list("chest") + possible_locs = list(BODY_ZONE_CHEST) /datum/surgery/lipoplasty/can_start(mob/user, mob/living/carbon/target) if(target.has_trait(TRAIT_FAT)) diff --git a/code/modules/surgery/organ_manipulation.dm b/code/modules/surgery/organ_manipulation.dm index d8b4bf4229..3b260017d3 100644 --- a/code/modules/surgery/organ_manipulation.dm +++ b/code/modules/surgery/organ_manipulation.dm @@ -1,7 +1,7 @@ /datum/surgery/organ_manipulation name = "organ manipulation" species = list(/mob/living/carbon/human, /mob/living/carbon/monkey) - possible_locs = list("chest", "head") + possible_locs = list(BODY_ZONE_CHEST, BODY_ZONE_HEAD) requires_real_bodypart = 1 steps = list( /datum/surgery_step/incise, @@ -15,7 +15,7 @@ ) /datum/surgery/organ_manipulation/soft - possible_locs = list("groin", "eyes", "mouth", "l_arm", "r_arm") + possible_locs = list(BODY_ZONE_PRECISE_GROIN, BODY_ZONE_PRECISE_EYES, BODY_ZONE_PRECISE_MOUTH, BODY_ZONE_L_ARM, BODY_ZONE_R_ARM) steps = list( /datum/surgery_step/incise, /datum/surgery_step/retract_skin, @@ -27,7 +27,7 @@ /datum/surgery/organ_manipulation/alien name = "alien organ manipulation" - possible_locs = list("chest", "head", "groin", "eyes", "mouth", "l_arm", "r_arm") + possible_locs = list(BODY_ZONE_CHEST, BODY_ZONE_HEAD, BODY_ZONE_PRECISE_GROIN, BODY_ZONE_PRECISE_EYES, BODY_ZONE_PRECISE_MOUTH, BODY_ZONE_L_ARM, BODY_ZONE_R_ARM) species = list(/mob/living/carbon/alien/humanoid) steps = list( /datum/surgery_step/saw, @@ -40,7 +40,7 @@ /datum/surgery/organ_manipulation/mechanic name = "prosthesis organ manipulation" - possible_locs = list("chest", "head") + possible_locs = list(BODY_ZONE_CHEST, BODY_ZONE_HEAD) requires_bodypart_type = BODYPART_ROBOTIC steps = list( /datum/surgery_step/mechanic_open, @@ -53,7 +53,7 @@ ) /datum/surgery/organ_manipulation/mechanic/soft - possible_locs = list("groin", "eyes", "mouth", "l_arm", "r_arm") + possible_locs = list(BODY_ZONE_PRECISE_GROIN, BODY_ZONE_PRECISE_EYES, BODY_ZONE_PRECISE_MOUTH, BODY_ZONE_L_ARM, BODY_ZONE_R_ARM) steps = list( /datum/surgery_step/mechanic_open, /datum/surgery_step/open_hatch, diff --git a/code/modules/surgery/organs/appendix.dm b/code/modules/surgery/organs/appendix.dm index 4494148082..34a7e16ebf 100644 --- a/code/modules/surgery/organs/appendix.dm +++ b/code/modules/surgery/organs/appendix.dm @@ -1,7 +1,7 @@ /obj/item/organ/appendix name = "appendix" icon_state = "appendix" - zone = "groin" + zone = BODY_ZONE_PRECISE_GROIN slot = ORGAN_SLOT_APPENDIX var/inflamed = 0 diff --git a/code/modules/surgery/organs/augments_arms.dm b/code/modules/surgery/organs/augments_arms.dm index ef0101d36a..4b9a472b32 100644 --- a/code/modules/surgery/organs/augments_arms.dm +++ b/code/modules/surgery/organs/augments_arms.dm @@ -1,7 +1,7 @@ /obj/item/organ/cyberimp/arm name = "arm-mounted implant" desc = "You shouldn't see this! Adminhelp and report this as an issue on github!" - zone = "r_arm" + zone = BODY_ZONE_R_ARM icon_state = "implant-toolkit" w_class = WEIGHT_CLASS_NORMAL actions_types = list(/datum/action/item_action/organ_action/toggle) @@ -24,31 +24,31 @@ /obj/item/organ/cyberimp/arm/proc/SetSlotFromZone() switch(zone) - if("l_arm") + if(BODY_ZONE_L_ARM) slot = ORGAN_SLOT_LEFT_ARM_AUG - if("r_arm") + if(BODY_ZONE_R_ARM) slot = ORGAN_SLOT_RIGHT_ARM_AUG else CRASH("Invalid zone for [type]") /obj/item/organ/cyberimp/arm/update_icon() - if(zone == "r_arm") + if(zone == BODY_ZONE_R_ARM) transform = null else // Mirroring the icon transform = matrix(-1, 0, 0, 0, 1, 0) /obj/item/organ/cyberimp/arm/examine(mob/user) ..() - to_chat(user, "[src] is assembled in the [zone == "r_arm" ? "right" : "left"] arm configuration. You can use a screwdriver to reassemble it.") + to_chat(user, "[src] is assembled in the [zone == BODY_ZONE_R_ARM ? "right" : "left"] arm configuration. You can use a screwdriver to reassemble it.") /obj/item/organ/cyberimp/arm/screwdriver_act(mob/living/user, obj/item/I) I.play_tool_sound(src) - if(zone == "r_arm") - zone = "l_arm" + if(zone == BODY_ZONE_R_ARM) + zone = BODY_ZONE_L_ARM else - zone = "r_arm" + zone = BODY_ZONE_R_ARM SetSlotFromZone() - to_chat(user, "You modify [src] to be installed on the [zone == "r_arm" ? "right" : "left"] arm.") + to_chat(user, "You modify [src] to be installed on the [zone == BODY_ZONE_R_ARM ? "right" : "left"] arm.") update_icon() /obj/item/organ/cyberimp/arm/Remove(mob/living/carbon/M, special = 0) @@ -66,8 +66,8 @@ if(!holder || (holder in src)) return - owner.visible_message("[owner] retracts [holder] back into [owner.p_their()] [zone == "r_arm" ? "right" : "left"] arm.", - "[holder] snaps back into your [zone == "r_arm" ? "right" : "left"] arm.", + owner.visible_message("[owner] retracts [holder] back into [owner.p_their()] [zone == BODY_ZONE_R_ARM ? "right" : "left"] arm.", + "[holder] snaps back into your [zone == BODY_ZONE_R_ARM ? "right" : "left"] arm.", "You hear a short mechanical noise.") if(istype(holder, /obj/item/device/assembly/flash/armimplant)) @@ -102,7 +102,7 @@ else to_chat(owner, "You drop [arm_item] to activate [src]!") - var/result = (zone == "r_arm" ? owner.put_in_r_hand(holder) : owner.put_in_l_hand(holder)) + var/result = (zone == BODY_ZONE_R_ARM ? owner.put_in_r_hand(holder) : owner.put_in_l_hand(holder)) if(!result) to_chat(owner, "Your [name] fails to activate!") return @@ -110,8 +110,8 @@ // Activate the hand that now holds our item. owner.swap_hand(result)//... or the 1st hand if the index gets lost somehow - owner.visible_message("[owner] extends [holder] from [owner.p_their()] [zone == "r_arm" ? "right" : "left"] arm.", - "You extend [holder] from your [zone == "r_arm" ? "right" : "left"] arm.", + owner.visible_message("[owner] extends [holder] from [owner.p_their()] [zone == BODY_ZONE_R_ARM ? "right" : "left"] arm.", + "You extend [holder] from your [zone == BODY_ZONE_R_ARM ? "right" : "left"] arm.", "You hear a short mechanical noise.") playsound(get_turf(owner), 'sound/mecha/mechmove03.ogg', 50, 1) @@ -136,9 +136,9 @@ /obj/item/organ/cyberimp/arm/gun/emp_act(severity) if(prob(30/severity) && owner && !crit_fail) Retract() - owner.visible_message("A loud bang comes from [owner]\'s [zone == "r_arm" ? "right" : "left"] arm!") + owner.visible_message("A loud bang comes from [owner]\'s [zone == BODY_ZONE_R_ARM ? "right" : "left"] arm!") playsound(get_turf(owner), 'sound/weapons/flashbang.ogg', 100, 1) - to_chat(owner, "You feel an explosion erupt inside your [zone == "r_arm" ? "right" : "left"] arm as your implant breaks!") + to_chat(owner, "You feel an explosion erupt inside your [zone == BODY_ZONE_R_ARM ? "right" : "left"] arm as your implant breaks!") owner.adjust_fire_stacks(20) owner.IgniteMob() owner.adjustFireLoss(25) @@ -154,7 +154,7 @@ contents = newlist(/obj/item/gun/energy/laser/mounted) /obj/item/organ/cyberimp/arm/gun/laser/l - zone = "l_arm" + zone = BODY_ZONE_L_ARM /obj/item/organ/cyberimp/arm/gun/taser @@ -164,7 +164,7 @@ contents = newlist(/obj/item/gun/energy/e_gun/advtaser/mounted) /obj/item/organ/cyberimp/arm/gun/taser/l - zone = "l_arm" + zone = BODY_ZONE_L_ARM /obj/item/organ/cyberimp/arm/toolset name = "integrated toolset implant" @@ -173,7 +173,7 @@ /obj/item/crowbar/cyborg, /obj/item/wirecutters/cyborg, /obj/item/device/multitool/cyborg) /obj/item/organ/cyberimp/arm/toolset/l - zone = "l_arm" + zone = BODY_ZONE_L_ARM /obj/item/organ/cyberimp/arm/toolset/emag_act() if(!(locate(/obj/item/kitchen/knife/combat/cyborg) in items_list)) diff --git a/code/modules/surgery/organs/augments_chest.dm b/code/modules/surgery/organs/augments_chest.dm index ad8727ef50..e50e0e3fc3 100644 --- a/code/modules/surgery/organs/augments_chest.dm +++ b/code/modules/surgery/organs/augments_chest.dm @@ -3,7 +3,7 @@ desc = "Implants for the organs in your torso." icon_state = "chest_implant" implant_overlay = "chest_implant_overlay" - zone = "chest" + zone = BODY_ZONE_CHEST /obj/item/organ/cyberimp/chest/nutriment name = "Nutriment pump implant" diff --git a/code/modules/surgery/organs/augments_eyes.dm b/code/modules/surgery/organs/augments_eyes.dm index 37cbb9e022..86732ae2eb 100644 --- a/code/modules/surgery/organs/augments_eyes.dm +++ b/code/modules/surgery/organs/augments_eyes.dm @@ -4,7 +4,7 @@ icon_state = "eye_implant" implant_overlay = "eye_implant_overlay" slot = ORGAN_SLOT_EYES - zone = "eyes" + zone = BODY_ZONE_PRECISE_EYES w_class = WEIGHT_CLASS_TINY // HUD implants diff --git a/code/modules/surgery/organs/augments_internal.dm b/code/modules/surgery/organs/augments_internal.dm index 7e209a1de0..0e9e08bf08 100644 --- a/code/modules/surgery/organs/augments_internal.dm +++ b/code/modules/surgery/organs/augments_internal.dm @@ -26,7 +26,7 @@ desc = "Injectors of extra sub-routines for the brain." icon_state = "brain_implant" implant_overlay = "brain_implant_overlay" - zone = "head" + zone = BODY_ZONE_HEAD w_class = WEIGHT_CLASS_TINY /obj/item/organ/cyberimp/brain/emp_act(severity) @@ -125,7 +125,7 @@ //[[[[MOUTH]]]] /obj/item/organ/cyberimp/mouth - zone = "mouth" + zone = BODY_ZONE_PRECISE_MOUTH /obj/item/organ/cyberimp/mouth/breathing_tube name = "breathing tube implant" diff --git a/code/modules/surgery/organs/ears.dm b/code/modules/surgery/organs/ears.dm index 83646ab4d0..db90bbf924 100644 --- a/code/modules/surgery/organs/ears.dm +++ b/code/modules/surgery/organs/ears.dm @@ -2,7 +2,7 @@ name = "ears" icon_state = "ears" desc = "There are three parts to the ear. Inner, middle and outer. Only one of these parts should be normally visible." - zone = "head" + zone = BODY_ZONE_HEAD slot = ORGAN_SLOT_EARS gender = PLURAL diff --git a/code/modules/surgery/organs/eyes.dm b/code/modules/surgery/organs/eyes.dm index b840d82670..456ff681fe 100644 --- a/code/modules/surgery/organs/eyes.dm +++ b/code/modules/surgery/organs/eyes.dm @@ -1,8 +1,8 @@ /obj/item/organ/eyes - name = "eyes" + name = BODY_ZONE_PRECISE_EYES icon_state = "eyeballs" desc = "I see you!" - zone = "eyes" + zone = BODY_ZONE_PRECISE_EYES slot = ORGAN_SLOT_EYES gender = PLURAL diff --git a/code/modules/surgery/organs/heart.dm b/code/modules/surgery/organs/heart.dm index f36d9c7a14..6de223e67b 100644 --- a/code/modules/surgery/organs/heart.dm +++ b/code/modules/surgery/organs/heart.dm @@ -2,7 +2,7 @@ name = "heart" desc = "I feel bad for the heartless bastard who lost this." icon_state = "heart-on" - zone = "chest" + zone = BODY_ZONE_CHEST slot = ORGAN_SLOT_HEART // Heart attack code is in code/modules/mob/living/carbon/human/life.dm var/beating = 1 diff --git a/code/modules/surgery/organs/helpers.dm b/code/modules/surgery/organs/helpers.dm index f58b18d164..8728544323 100644 --- a/code/modules/surgery/organs/helpers.dm +++ b/code/modules/surgery/organs/helpers.dm @@ -1,29 +1,29 @@ -/mob/proc/getorgan(typepath) - return - -/mob/proc/getorganszone(zone) - return - -/mob/proc/getorganslot(slot) - return - -/mob/living/carbon/getorgan(typepath) - return (locate(typepath) in internal_organs) - -/mob/living/carbon/getorganszone(zone, subzones = 0) - var/list/returnorg = list() - if(subzones) - // Include subzones - groin for chest, eyes and mouth for head - if(zone == "head") - returnorg = getorganszone("eyes") + getorganszone("mouth") - if(zone == "chest") - returnorg = getorganszone("groin") - - for(var/X in internal_organs) - var/obj/item/organ/O = X - if(zone == O.zone) - returnorg += O - return returnorg - -/mob/living/carbon/getorganslot(slot) +/mob/proc/getorgan(typepath) + return + +/mob/proc/getorganszone(zone) + return + +/mob/proc/getorganslot(slot) + return + +/mob/living/carbon/getorgan(typepath) + return (locate(typepath) in internal_organs) + +/mob/living/carbon/getorganszone(zone, subzones = 0) + var/list/returnorg = list() + if(subzones) + // Include subzones - groin for chest, eyes and mouth for head + if(zone == BODY_ZONE_HEAD) + returnorg = getorganszone(BODY_ZONE_PRECISE_EYES) + getorganszone(BODY_ZONE_PRECISE_MOUTH) + if(zone == BODY_ZONE_CHEST) + returnorg = getorganszone(BODY_ZONE_PRECISE_GROIN) + + for(var/X in internal_organs) + var/obj/item/organ/O = X + if(zone == O.zone) + returnorg += O + return returnorg + +/mob/living/carbon/getorganslot(slot) return internal_organs_slot[slot] diff --git a/code/modules/surgery/organs/liver.dm b/code/modules/surgery/organs/liver.dm index 7e106e0b45..0cc7af703c 100755 --- a/code/modules/surgery/organs/liver.dm +++ b/code/modules/surgery/organs/liver.dm @@ -6,7 +6,7 @@ name = "liver" icon_state = "liver" w_class = WEIGHT_CLASS_NORMAL - zone = "chest" + zone = BODY_ZONE_CHEST slot = ORGAN_SLOT_LIVER desc = "Pairing suggestion: chianti and fava beans." var/damage = 0 //liver damage, 0 is no damage, damage=maxHealth causes liver failure diff --git a/code/modules/surgery/organs/lungs.dm b/code/modules/surgery/organs/lungs.dm index 737ffbe6e8..aaed5757d1 100644 --- a/code/modules/surgery/organs/lungs.dm +++ b/code/modules/surgery/organs/lungs.dm @@ -11,7 +11,7 @@ /obj/item/organ/lungs name = "lungs" icon_state = "lungs" - zone = "chest" + zone = BODY_ZONE_CHEST slot = ORGAN_SLOT_LUNGS gender = PLURAL w_class = WEIGHT_CLASS_NORMAL diff --git a/code/modules/surgery/organs/organ_internal.dm b/code/modules/surgery/organs/organ_internal.dm index fe613af015..1408bff60c 100644 --- a/code/modules/surgery/organs/organ_internal.dm +++ b/code/modules/surgery/organs/organ_internal.dm @@ -5,7 +5,7 @@ var/status = ORGAN_ORGANIC w_class = WEIGHT_CLASS_SMALL throwforce = 0 - var/zone = "chest" + var/zone = BODY_ZONE_CHEST var/slot // DO NOT add slots with matching names to different zones - it will break internal_organs_slot list! var/vital = 0 diff --git a/code/modules/surgery/organs/stomach.dm b/code/modules/surgery/organs/stomach.dm index d54f94b0be..e0d3dbb384 100755 --- a/code/modules/surgery/organs/stomach.dm +++ b/code/modules/surgery/organs/stomach.dm @@ -2,7 +2,7 @@ name = "stomach" icon_state = "stomach" w_class = WEIGHT_CLASS_NORMAL - zone = "chest" + zone = BODY_ZONE_CHEST slot = ORGAN_SLOT_STOMACH attack_verb = list("gored", "squished", "slapped", "digested") desc = "Onaka ga suite imasu." diff --git a/code/modules/surgery/organs/tails.dm b/code/modules/surgery/organs/tails.dm index 9fd4a337a0..076db2390d 100644 --- a/code/modules/surgery/organs/tails.dm +++ b/code/modules/surgery/organs/tails.dm @@ -4,7 +4,7 @@ name = "tail" desc = "A severed tail. What did you cut this off of?" icon_state = "severedtail" - zone = "groin" + zone = BODY_ZONE_PRECISE_GROIN slot = ORGAN_SLOT_TAIL var/tail_type = "None" diff --git a/code/modules/surgery/organs/tongue.dm b/code/modules/surgery/organs/tongue.dm index 09926a3fdc..90f0cde100 100644 --- a/code/modules/surgery/organs/tongue.dm +++ b/code/modules/surgery/organs/tongue.dm @@ -2,7 +2,7 @@ name = "tongue" desc = "A fleshy muscle mostly used for lying." icon_state = "tonguenormal" - zone = "mouth" + zone = BODY_ZONE_PRECISE_MOUTH slot = ORGAN_SLOT_TONGUE attack_verb = list("licked", "slobbered", "slapped", "frenched", "tongued") var/list/languages_possible diff --git a/code/modules/surgery/organs/vocal_cords.dm b/code/modules/surgery/organs/vocal_cords.dm index a07722cb3b..480c65fe5b 100644 --- a/code/modules/surgery/organs/vocal_cords.dm +++ b/code/modules/surgery/organs/vocal_cords.dm @@ -6,7 +6,7 @@ /obj/item/organ/vocal_cords //organs that are activated through speech with the :x channel name = "vocal cords" icon_state = "appendix" - zone = "mouth" + zone = BODY_ZONE_PRECISE_MOUTH slot = ORGAN_SLOT_VOICE gender = PLURAL var/list/spans = null @@ -23,7 +23,7 @@ /obj/item/organ/adamantine_resonator name = "adamantine resonator" desc = "Fragments of adamantine exist in all golems, stemming from their origins as purely magical constructs. These are used to \"hear\" messages from their leaders." - zone = "head" + zone = BODY_ZONE_HEAD slot = ORGAN_SLOT_ADAMANTINE_RESONATOR icon_state = "adamantine_resonator" @@ -312,7 +312,7 @@ cooldown = COOLDOWN_DAMAGE for(var/V in listeners) var/mob/living/L = V - L.apply_damage(15 * power_multiplier, def_zone = "chest") + L.apply_damage(15 * power_multiplier, def_zone = BODY_ZONE_CHEST) //BLEED else if((findtext(message, bleed_words))) diff --git a/code/modules/surgery/plastic_surgery.dm b/code/modules/surgery/plastic_surgery.dm index fbb2e64cd2..3a3dd6a1dd 100644 --- a/code/modules/surgery/plastic_surgery.dm +++ b/code/modules/surgery/plastic_surgery.dm @@ -1,7 +1,7 @@ /datum/surgery/plastic_surgery name = "plastic surgery" steps = list(/datum/surgery_step/incise, /datum/surgery_step/retract_skin, /datum/surgery_step/reshape_face, /datum/surgery_step/close) - possible_locs = list("head") + possible_locs = list(BODY_ZONE_HEAD) //reshape_face /datum/surgery_step/reshape_face diff --git a/code/modules/surgery/prosthetic_replacement.dm b/code/modules/surgery/prosthetic_replacement.dm index bb5301d79e..9032964ae4 100644 --- a/code/modules/surgery/prosthetic_replacement.dm +++ b/code/modules/surgery/prosthetic_replacement.dm @@ -2,7 +2,7 @@ name = "prosthetic replacement" steps = list(/datum/surgery_step/incise, /datum/surgery_step/clamp_bleeders, /datum/surgery_step/retract_skin, /datum/surgery_step/add_prosthetic) species = list(/mob/living/carbon/human, /mob/living/carbon/monkey) - possible_locs = list("r_arm", "l_arm", "l_leg", "r_leg", "head") + possible_locs = list(BODY_ZONE_R_ARM, BODY_ZONE_L_ARM, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG, BODY_ZONE_HEAD) requires_bodypart = FALSE //need a missing limb requires_bodypart_type = 0 @@ -52,7 +52,7 @@ else to_chat(user, "[tool] isn't the right type for [parse_zone(target_zone)].") return -1 - else if(target_zone == "l_arm" || target_zone == "r_arm") + else if(target_zone == BODY_ZONE_L_ARM || target_zone == BODY_ZONE_R_ARM) user.visible_message("[user] begins to attach [tool] onto [target].", "You begin to attach [tool] onto [target]...") else to_chat(user, "[tool] must be installed onto an arm.") @@ -79,10 +79,10 @@ qdel(tool) if(istype(tool, /obj/item/twohanded/required/chainsaw)) var/obj/item/mounted_chainsaw/new_arm = new(target) - target_zone == "r_arm" ? target.put_in_r_hand(new_arm) : target.put_in_l_hand(new_arm) + target_zone == BODY_ZONE_R_ARM ? target.put_in_r_hand(new_arm) : target.put_in_l_hand(new_arm) return 1 else if(istype(tool, /obj/item/melee/synthetic_arm_blade)) var/obj/item/melee/arm_blade/new_arm = new(target,TRUE,TRUE) - target_zone == "r_arm" ? target.put_in_r_hand(new_arm) : target.put_in_l_hand(new_arm) + target_zone == BODY_ZONE_R_ARM ? target.put_in_r_hand(new_arm) : target.put_in_l_hand(new_arm) return 1 diff --git a/code/modules/surgery/remove_embedded_object.dm b/code/modules/surgery/remove_embedded_object.dm index 8f3fad38f8..2818ea2ab5 100644 --- a/code/modules/surgery/remove_embedded_object.dm +++ b/code/modules/surgery/remove_embedded_object.dm @@ -1,7 +1,7 @@ /datum/surgery/embedded_removal name = "removal of embedded objects" steps = list(/datum/surgery_step/incise, /datum/surgery_step/clamp_bleeders, /datum/surgery_step/retract_skin, /datum/surgery_step/remove_object) - possible_locs = list("r_arm","l_arm","r_leg","l_leg","chest","head") + possible_locs = list(BODY_ZONE_R_ARM,BODY_ZONE_L_ARM,BODY_ZONE_R_LEG,BODY_ZONE_L_LEG,BODY_ZONE_CHEST,BODY_ZONE_HEAD) /datum/surgery_step/remove_object diff --git a/code/modules/surgery/surgery.dm b/code/modules/surgery/surgery.dm index 7b40b790fa..ff4703c601 100644 --- a/code/modules/surgery/surgery.dm +++ b/code/modules/surgery/surgery.dm @@ -5,7 +5,7 @@ var/step_in_progress = 0 //Actively performing a Surgery var/can_cancel = 1 //Can cancel this surgery after step 1 with cautery var/list/species = list(/mob/living/carbon/human) //Acceptable Species - var/location = "chest" //Surgery location + var/location = BODY_ZONE_CHEST //Surgery location var/requires_bodypart_type = BODYPART_ORGANIC //Prevents you from performing an operation on incorrect limbs. 0 for any limb type var/list/possible_locs = list() //Multiple locations var/ignore_clothes = 0 //This surgery ignores clothes diff --git a/code/modules/zombie/items.dm b/code/modules/zombie/items.dm index cc42b7a67e..154941ce70 100644 --- a/code/modules/zombie/items.dm +++ b/code/modules/zombie/items.dm @@ -54,7 +54,7 @@ user.visible_message("[user] is ripping [user.p_their()] brains out! It looks like [user.p_theyre()] trying to commit suicide!") if(isliving(user)) var/mob/living/L = user - var/obj/item/bodypart/O = L.get_bodypart("head") + var/obj/item/bodypart/O = L.get_bodypart(BODY_ZONE_HEAD) if(O) O.dismember() return (BRUTELOSS) diff --git a/code/modules/zombie/organs.dm b/code/modules/zombie/organs.dm index 119ed27926..12aa2e41f6 100644 --- a/code/modules/zombie/organs.dm +++ b/code/modules/zombie/organs.dm @@ -1,7 +1,7 @@ /obj/item/organ/zombie_infection name = "festering ooze" desc = "A black web of pus and viscera." - zone = "head" + zone = BODY_ZONE_HEAD slot = ORGAN_SLOT_ZOMBIE icon_state = "blacktumor" var/datum/species/old_species = /datum/species/human