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

* Replaced body zone magic strings with defines

* merge conflicts
This commit is contained in:
CitadelStationBot
2018-03-19 21:18:57 -05:00
committed by Poojawa
parent 9338d18a28
commit 3d26cd4a6f
148 changed files with 687 additions and 672 deletions
+1 -1
View File
@@ -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
+19 -19
View File
@@ -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, "<span class='info'>[src] is assembled in the [zone == "r_arm" ? "right" : "left"] arm configuration. You can use a screwdriver to reassemble it.</span>")
to_chat(user, "<span class='info'>[src] is assembled in the [zone == BODY_ZONE_R_ARM ? "right" : "left"] arm configuration. You can use a screwdriver to reassemble it.</span>")
/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, "<span class='notice'>You modify [src] to be installed on the [zone == "r_arm" ? "right" : "left"] arm.</span>")
to_chat(user, "<span class='notice'>You modify [src] to be installed on the [zone == BODY_ZONE_R_ARM ? "right" : "left"] arm.</span>")
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("<span class='notice'>[owner] retracts [holder] back into [owner.p_their()] [zone == "r_arm" ? "right" : "left"] arm.</span>",
"<span class='notice'>[holder] snaps back into your [zone == "r_arm" ? "right" : "left"] arm.</span>",
owner.visible_message("<span class='notice'>[owner] retracts [holder] back into [owner.p_their()] [zone == BODY_ZONE_R_ARM ? "right" : "left"] arm.</span>",
"<span class='notice'>[holder] snaps back into your [zone == BODY_ZONE_R_ARM ? "right" : "left"] arm.</span>",
"<span class='italics'>You hear a short mechanical noise.</span>")
if(istype(holder, /obj/item/device/assembly/flash/armimplant))
@@ -102,7 +102,7 @@
else
to_chat(owner, "<span class='notice'>You drop [arm_item] to activate [src]!</span>")
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, "<span class='warning'>Your [name] fails to activate!</span>")
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("<span class='notice'>[owner] extends [holder] from [owner.p_their()] [zone == "r_arm" ? "right" : "left"] arm.</span>",
"<span class='notice'>You extend [holder] from your [zone == "r_arm" ? "right" : "left"] arm.</span>",
owner.visible_message("<span class='notice'>[owner] extends [holder] from [owner.p_their()] [zone == BODY_ZONE_R_ARM ? "right" : "left"] arm.</span>",
"<span class='notice'>You extend [holder] from your [zone == BODY_ZONE_R_ARM ? "right" : "left"] arm.</span>",
"<span class='italics'>You hear a short mechanical noise.</span>")
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("<span class='danger'>A loud bang comes from [owner]\'s [zone == "r_arm" ? "right" : "left"] arm!</span>")
owner.visible_message("<span class='danger'>A loud bang comes from [owner]\'s [zone == BODY_ZONE_R_ARM ? "right" : "left"] arm!</span>")
playsound(get_turf(owner), 'sound/weapons/flashbang.ogg', 100, 1)
to_chat(owner, "<span class='userdanger'>You feel an explosion erupt inside your [zone == "r_arm" ? "right" : "left"] arm as your implant breaks!</span>")
to_chat(owner, "<span class='userdanger'>You feel an explosion erupt inside your [zone == BODY_ZONE_R_ARM ? "right" : "left"] arm as your implant breaks!</span>")
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))
@@ -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"
+1 -1
View File
@@ -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
@@ -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"
+1 -1
View File
@@ -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
+2 -2
View File
@@ -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
+1 -1
View File
@@ -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
+28 -28
View File
@@ -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]
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
@@ -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
+1 -1
View File
@@ -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."
+1 -1
View File
@@ -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"
+1 -1
View File
@@ -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
+3 -3
View File
@@ -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)))