diff --git a/code/__DEFINES/DNA.dm b/code/__DEFINES/DNA.dm
index dd5a25d8ff..8c1ce43717 100644
--- a/code/__DEFINES/DNA.dm
+++ b/code/__DEFINES/DNA.dm
@@ -127,6 +127,7 @@
#define TOXINLOVER 24
#define DIGITIGRADE 25 //Uses weird leg sprites. Optional for Lizards, required for ashwalkers. Don't give it to other races unless you make sprites for this (see human_parts_greyscale.dmi)
#define NO_UNDERWEAR 26
+<<<<<<< HEAD
#define MUTCOLORS2 27
#define MUTCOLORS3 28
#define NOLIVER 29
@@ -135,3 +136,30 @@
#define NOAROUSAL 29 //Stops all arousal effects
#define NOGENITALS 30 //Cannot create, use, or otherwise have genitals
#define NO_DNA_COPY 31
+=======
+#define NOLIVER 27
+#define NOSTOMACH 28
+#define NO_DNA_COPY 29
+
+#define ORGAN_SLOT_BRAIN "brain"
+#define ORGAN_SLOT_APPENDIX "appendix"
+#define ORGAN_SLOT_RIGHT_ARM_AUG "r_arm_device"
+#define ORGAN_SLOT_LEFT_ARM_AUG "l_arm_device"
+#define ORGAN_SLOT_STOMACH "stomach"
+#define ORGAN_SLOT_BREATHING_TUBE "breathing_tube"
+#define ORGAN_SLOT_EARS "ears"
+#define ORGAN_SLOT_EYES "eye_sight"
+#define ORGAN_SLOT_LUNGS "lungs"
+#define ORGAN_SLOT_HEART "heart"
+#define ORGAN_SLOT_ZOMBIE "zombie_infection"
+#define ORGAN_SLOT_THRUSTERS "thrusters"
+#define ORGAN_SLOT_HUD "eye_hud"
+#define ORGAN_SLOT_LIVER "liver"
+#define ORGAN_SLOT_TONGUE "tongue"
+#define ORGAN_SLOT_VOICE "vocal_cords"
+#define ORGAN_SLOT_ADAMANTINE_RESONATOR "adamantine_resonator"
+#define ORGAN_SLOT_HEART_AID "heartdrive"
+#define ORGAN_SLOT_BRAIN_ANTIDROP "brain_antidrop"
+#define ORGAN_SLOT_BRAIN_ANTISTUN "brain_antistun"
+#define ORGAN_SLOT_TAIL "tail"
+>>>>>>> 04c05d8... Adds defines for organ slots (#31737)
diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm
index 9730aaf552..6ca365d62e 100644
--- a/code/_onclick/hud/screen_objects.dm
+++ b/code/_onclick/hud/screen_objects.dm
@@ -251,7 +251,7 @@
to_chat(C, "You are no longer running on internals.")
icon_state = "internal0"
else
- if(!C.getorganslot("breathing_tube"))
+ if(!C.getorganslot(ORGAN_SLOT_BREATHING_TUBE))
if(!istype(C.wear_mask, /obj/item/clothing/mask))
to_chat(C, "You are not wearing an internals mask!")
return 1
diff --git a/code/datums/diseases/advance/symptoms/deafness.dm b/code/datums/diseases/advance/symptoms/deafness.dm
index c2afb34a9e..cc388f0b59 100644
--- a/code/datums/diseases/advance/symptoms/deafness.dm
+++ b/code/datums/diseases/advance/symptoms/deafness.dm
@@ -49,7 +49,7 @@ Bonus
to_chat(M, "[pick("You hear a ringing in your ear.", "Your ears pop.")]")
if(5)
if(power > 2)
- var/obj/item/organ/ears/ears = M.getorganslot("ears")
+ var/obj/item/organ/ears/ears = M.getorganslot(ORGAN_SLOT_EARS)
if(istype(ears) && ears.ear_damage < UNHEALING_EAR_DAMAGE)
to_chat(M, "Your ears pop painfully and start bleeding!")
ears.ear_damage = max(ears.ear_damage, UNHEALING_EAR_DAMAGE)
diff --git a/code/datums/diseases/advance/symptoms/vision.dm b/code/datums/diseases/advance/symptoms/vision.dm
index 84f9ef49cc..728dfa01d0 100644
--- a/code/datums/diseases/advance/symptoms/vision.dm
+++ b/code/datums/diseases/advance/symptoms/vision.dm
@@ -44,7 +44,7 @@ Bonus
if(!..())
return
var/mob/living/carbon/M = A.affected_mob
- var/obj/item/organ/eyes/eyes = M.getorganslot("eye_sight")
+ var/obj/item/organ/eyes/eyes = M.getorganslot(ORGAN_SLOT_EYES)
if(istype(eyes))
switch(A.stage)
if(1, 2)
@@ -106,7 +106,7 @@ Bonus
if(!..())
return
var/mob/living/M = A.affected_mob
- var/obj/item/organ/eyes/eyes = M.getorganslot("eye_sight")
+ var/obj/item/organ/eyes/eyes = M.getorganslot(ORGAN_SLOT_EYES)
if (!eyes)
return
switch(A.stage)
diff --git a/code/game/gamemodes/changeling/evolution_menu.dm b/code/game/gamemodes/changeling/evolution_menu.dm
index 59ed4ab2e8..76a37f9bb1 100644
--- a/code/game/gamemodes/changeling/evolution_menu.dm
+++ b/code/game/gamemodes/changeling/evolution_menu.dm
@@ -75,7 +75,7 @@
var/datum/changelingprofile/prof = mind.changeling.add_new_profile(C, src)
mind.changeling.first_prof = prof
- var/obj/item/organ/brain/B = C.getorganslot("brain")
+ var/obj/item/organ/brain/B = C.getorganslot(ORGAN_SLOT_BRAIN)
if(B)
B.vital = FALSE
B.decoy_override = TRUE
diff --git a/code/game/gamemodes/changeling/powers/augmented_eyesight.dm b/code/game/gamemodes/changeling/powers/augmented_eyesight.dm
index b2ddd022a4..f48464700f 100644
--- a/code/game/gamemodes/changeling/powers/augmented_eyesight.dm
+++ b/code/game/gamemodes/changeling/powers/augmented_eyesight.dm
@@ -10,7 +10,7 @@
active = FALSE
/obj/effect/proc_holder/changeling/augmented_eyesight/on_purchase(mob/user) //The ability starts inactive, so we should be protected from flashes.
- var/obj/item/organ/eyes/E = user.getorganslot("eye_sight")
+ var/obj/item/organ/eyes/E = user.getorganslot(ORGAN_SLOT_EYES)
if (E)
E.flash_protect = 2 //Adjust the user's eyes' flash protection
to_chat(user, "We adjust our eyes to protect them from bright lights.")
@@ -20,7 +20,7 @@
/obj/effect/proc_holder/changeling/augmented_eyesight/sting_action(mob/living/carbon/human/user)
if(!istype(user))
return
- var/obj/item/organ/eyes/E = user.getorganslot("eye_sight")
+ var/obj/item/organ/eyes/E = user.getorganslot(ORGAN_SLOT_EYES)
if(E)
if(!active)
E.sight_flags |= SEE_MOBS | SEE_OBJS | SEE_TURFS //Add sight flags to the user's eyes
@@ -42,7 +42,7 @@
/obj/effect/proc_holder/changeling/augmented_eyesight/on_refund(mob/user) //Get rid of x-ray vision and flash protection when the user refunds this ability
- var/obj/item/organ/eyes/E = user.getorganslot("eye_sight")
+ var/obj/item/organ/eyes/E = user.getorganslot(ORGAN_SLOT_EYES)
if(E)
if (active)
E.sight_flags ^= SEE_MOBS | SEE_OBJS | SEE_TURFS
diff --git a/code/game/gamemodes/changeling/powers/regenerate.dm b/code/game/gamemodes/changeling/powers/regenerate.dm
index a74b966bd8..f2b13a5d09 100644
--- a/code/game/gamemodes/changeling/powers/regenerate.dm
+++ b/code/game/gamemodes/changeling/powers/regenerate.dm
@@ -27,7 +27,7 @@
C.emote("scream")
C.regenerate_limbs(1)
C.regenerate_organs()
- if(!user.getorganslot("brain"))
+ if(!user.getorganslot(ORGAN_SLOT_BRAIN))
var/obj/item/organ/brain/changeling_brain/B = new()
B.Insert(C)
if(ishuman(user))
diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm
index 86e69b8973..cb5ea9df76 100644
--- a/code/game/machinery/cloning.dm
+++ b/code/game/machinery/cloning.dm
@@ -163,7 +163,7 @@
var/mob/living/carbon/human/H = new /mob/living/carbon/human(src)
if(clonemind.changeling)
- var/obj/item/organ/brain/B = H.getorganslot("brain")
+ var/obj/item/organ/brain/B = H.getorganslot(ORGAN_SLOT_BRAIN)
B.vital = FALSE
B.decoy_override = TRUE
diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm
index e158c1f90a..cbd183aca0 100644
--- a/code/game/objects/items.dm
+++ b/code/game/objects/items.dm
@@ -519,7 +519,7 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
M.adjust_blurriness(3)
M.adjust_eye_damage(rand(2,4))
- var/obj/item/organ/eyes/eyes = M.getorganslot("eye_sight")
+ var/obj/item/organ/eyes/eyes = M.getorganslot(ORGAN_SLOT_EYES)
if (!eyes)
return
if(eyes.eye_damage >= 10)
diff --git a/code/game/objects/items/airlock_painter.dm b/code/game/objects/items/airlock_painter.dm
index 378d6ebabd..2cb611e9b6 100644
--- a/code/game/objects/items/airlock_painter.dm
+++ b/code/game/objects/items/airlock_painter.dm
@@ -1,3 +1,4 @@
+<<<<<<< HEAD
/obj/item/airlock_painter
name = "airlock painter"
desc = "An advanced autopainter preprogrammed with several paintjobs for airlocks. Use it on an airlock during or after construction to change the paintjob."
@@ -124,3 +125,131 @@
user.put_in_hands(ink)
to_chat(user, "You remove [ink] from [src].")
ink = null
+=======
+/obj/item/airlock_painter
+ name = "airlock painter"
+ desc = "An advanced autopainter preprogrammed with several paintjobs for airlocks. Use it on an airlock during or after construction to change the paintjob."
+ icon = 'icons/obj/objects.dmi'
+ icon_state = "paint sprayer"
+ item_state = "paint sprayer"
+
+ w_class = WEIGHT_CLASS_SMALL
+
+ materials = list(MAT_METAL=50, MAT_GLASS=50)
+ origin_tech = "engineering=2"
+
+ flags_1 = CONDUCT_1 | NOBLUDGEON_1
+ slot_flags = SLOT_BELT
+
+ var/obj/item/device/toner/ink = null
+
+/obj/item/airlock_painter/New()
+ ..()
+ ink = new /obj/item/device/toner(src)
+
+//This proc doesn't just check if the painter can be used, but also uses it.
+//Only call this if you are certain that the painter will be used right after this check!
+/obj/item/airlock_painter/proc/use(mob/user)
+ if(can_use(user))
+ ink.charges--
+ playsound(src.loc, 'sound/effects/spray2.ogg', 50, 1)
+ return 1
+ else
+ return 0
+
+//This proc only checks if the painter can be used.
+//Call this if you don't want the painter to be used right after this check, for example
+//because you're expecting user input.
+/obj/item/airlock_painter/proc/can_use(mob/user)
+ if(!ink)
+ to_chat(user, "There is no toner cartridge installed in [src]!")
+ return 0
+ else if(ink.charges < 1)
+ to_chat(user, "[src] is out of ink!")
+ return 0
+ else
+ return 1
+
+/obj/item/airlock_painter/suicide_act(mob/user)
+ var/obj/item/organ/lungs/L = user.getorganslot(ORGAN_SLOT_LUNGS)
+
+ if(can_use(user) && L)
+ user.visible_message("[user] is inhaling toner from [src]! It looks like [user.p_theyre()] trying to commit suicide!")
+ use(user)
+
+ // Once you've inhaled the toner, you throw up your lungs
+ // and then die.
+
+ // Find out if there is an open turf in front of us,
+ // and if not, pick the turf we are standing on.
+ var/turf/T = get_step(get_turf(src), user.dir)
+ if(!isopenturf(T))
+ T = get_turf(src)
+
+ // they managed to lose their lungs between then and
+ // now. Good job.
+ if(!L)
+ return OXYLOSS
+
+ L.Remove(user)
+
+ // make some colorful reagent, and apply it to the lungs
+ L.create_reagents(10)
+ L.reagents.add_reagent("colorful_reagent", 10)
+ L.reagents.reaction(L, TOUCH, 1)
+
+ // TODO maybe add some colorful vomit?
+
+ user.visible_message("[user] vomits out their [L]!")
+ playsound(user.loc, 'sound/effects/splat.ogg', 50, 1)
+
+ L.forceMove(T)
+
+ return (TOXLOSS|OXYLOSS)
+ else if(can_use(user) && !L)
+ user.visible_message("[user] is spraying toner on [user.p_them()]self from [src]! It looks like [user.p_theyre()] trying to commit suicide.")
+ user.reagents.add_reagent("colorful_reagent", 1)
+ user.reagents.reaction(user, TOUCH, 1)
+ return TOXLOSS
+
+ else
+ user.visible_message("[user] is trying to inhale toner from [src]! It might be a suicide attempt if [src] had any toner.")
+ return SHAME
+
+
+/obj/item/airlock_painter/examine(mob/user)
+ ..()
+ if(!ink)
+ to_chat(user, "It doesn't have a toner cartridge installed.")
+ return
+ var/ink_level = "high"
+ if(ink.charges < 1)
+ ink_level = "empty"
+ else if((ink.charges/ink.max_charges) <= 0.25) //25%
+ ink_level = "low"
+ else if((ink.charges/ink.max_charges) > 1) //Over 100% (admin var edit)
+ ink_level = "dangerously high"
+ to_chat(user, "Its ink levels look [ink_level].")
+
+
+/obj/item/airlock_painter/attackby(obj/item/W, mob/user, params)
+ if(istype(W, /obj/item/device/toner))
+ if(ink)
+ to_chat(user, "[src] already contains \a [ink].")
+ return
+ if(!user.transferItemToLoc(W, src))
+ return
+ to_chat(user, "You install [W] into [src].")
+ ink = W
+ playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
+ else
+ return ..()
+
+/obj/item/airlock_painter/attack_self(mob/user)
+ if(ink)
+ playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
+ ink.loc = user.loc
+ user.put_in_hands(ink)
+ to_chat(user, "You remove [ink] from [src].")
+ ink = null
+>>>>>>> 04c05d8... Adds defines for organ slots (#31737)
diff --git a/code/game/objects/items/devices/flashlight.dm b/code/game/objects/items/devices/flashlight.dm
index eab0f030cc..5f4d02fd8e 100644
--- a/code/game/objects/items/devices/flashlight.dm
+++ b/code/game/objects/items/devices/flashlight.dm
@@ -69,7 +69,7 @@
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
- var/obj/item/organ/eyes/E = M.getorganslot("eye_sight")
+ var/obj/item/organ/eyes/E = M.getorganslot(ORGAN_SLOT_EYES)
if(!E)
to_chat(user, "[M] doesn't have any eyes!")
return
diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm
index bb2adda377..caf42fc68b 100644
--- a/code/game/objects/items/devices/scanners.dm
+++ b/code/game/objects/items/devices/scanners.dm
@@ -171,7 +171,7 @@ MASS SPECTROMETER
if(advanced)
if(iscarbon(M))
var/mob/living/carbon/C = M
- var/obj/item/organ/ears/ears = C.getorganslot("ears")
+ var/obj/item/organ/ears/ears = C.getorganslot(ORGAN_SLOT_EARS)
to_chat(user, "\t==EAR STATUS==")
if(istype(ears))
var/healthy = TRUE
@@ -189,7 +189,7 @@ MASS SPECTROMETER
to_chat(user, "\tHealthy.")
else
to_chat(user, "\tSubject does not have ears.")
- var/obj/item/organ/eyes/eyes = C.getorganslot("eye_sight")
+ var/obj/item/organ/eyes/eyes = C.getorganslot(ORGAN_SLOT_EYES)
to_chat(user, "\t==EYE STATUS==")
if(istype(eyes))
var/healthy = TRUE
diff --git a/code/game/objects/items/tanks/tanks.dm b/code/game/objects/items/tanks/tanks.dm
index 7628617923..f633781647 100644
--- a/code/game/objects/items/tanks/tanks.dm
+++ b/code/game/objects/items/tanks/tanks.dm
@@ -31,7 +31,7 @@
H.internal = null
H.update_internals_hud_icon(0)
else
- if(!H.getorganslot("breathing_tube"))
+ if(!H.getorganslot(ORGAN_SLOT_BREATHING_TUBE))
if(!H.wear_mask)
to_chat(H, "You need a mask!")
return
diff --git a/code/modules/clothing/neck/neck.dm b/code/modules/clothing/neck/neck.dm
index af3049aefd..2867aa405e 100644
--- a/code/modules/clothing/neck/neck.dm
+++ b/code/modules/clothing/neck/neck.dm
@@ -42,8 +42,8 @@
var/heart_strength = "no"
var/lung_strength = "no"
- var/obj/item/organ/heart/heart = M.getorganslot("heart")
- var/obj/item/organ/lungs/lungs = M.getorganslot("lungs")
+ var/obj/item/organ/heart/heart = M.getorganslot(ORGAN_SLOT_HEART)
+ var/obj/item/organ/lungs/lungs = M.getorganslot(ORGAN_SLOT_LUNGS)
if(!(M.stat == DEAD || (M.status_flags&FAKEDEATH)))
if(heart && istype(heart))
diff --git a/code/modules/mob/living/brain/brain_item.dm b/code/modules/mob/living/brain/brain_item.dm
index 6ac5ab1bad..a3642684db 100644
--- a/code/modules/mob/living/brain/brain_item.dm
+++ b/code/modules/mob/living/brain/brain_item.dm
@@ -6,7 +6,7 @@
throw_range = 5
layer = ABOVE_MOB_LAYER
zone = "head"
- slot = "brain"
+ slot = ORGAN_SLOT_BRAIN
vital = TRUE
origin_tech = "biotech=5"
attack_verb = list("attacked", "slapped", "whacked")
@@ -70,7 +70,7 @@
C.dna.copy_dna(brainmob.stored_dna)
if(L.disabilities & NOCLONE)
brainmob.disabilities |= NOCLONE //This is so you can't just decapitate a husked guy and clone them without needing to get a new body
- var/obj/item/organ/zombie_infection/ZI = L.getorganslot("zombie_infection")
+ var/obj/item/organ/zombie_infection/ZI = L.getorganslot(ORGAN_SLOT_ZOMBIE)
if(ZI)
brainmob.set_species(ZI.old_species) //For if the brain is cloned
if(L.mind && L.mind.current)
diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm
index 75b53d11cb..ec79da543a 100644
--- a/code/modules/mob/living/carbon/carbon.dm
+++ b/code/modules/mob/living/carbon/carbon.dm
@@ -228,7 +228,7 @@
internal = null
update_internals_hud_icon(0)
else if(ITEM && istype(ITEM, /obj/item/tank))
- if((wear_mask && (wear_mask.flags_1 & MASKINTERNALS_1)) || getorganslot("breathing_tube"))
+ if((wear_mask && (wear_mask.flags_1 & MASKINTERNALS_1)) || getorganslot(ORGAN_SLOT_BREATHING_TUBE))
internal = ITEM
update_internals_hud_icon(1)
@@ -527,7 +527,7 @@
sight = initial(sight)
lighting_alpha = initial(lighting_alpha)
- var/obj/item/organ/eyes/E = getorganslot("eye_sight")
+ var/obj/item/organ/eyes/E = getorganslot(ORGAN_SLOT_EYES)
if(!E)
update_tint()
else
@@ -584,7 +584,7 @@
if(wear_mask)
. += wear_mask.tint
- var/obj/item/organ/eyes/E = getorganslot("eye_sight")
+ var/obj/item/organ/eyes/E = getorganslot(ORGAN_SLOT_EYES)
if(E)
. += E.tint
diff --git a/code/modules/mob/living/carbon/carbon_defense.dm b/code/modules/mob/living/carbon/carbon_defense.dm
index 66f4fc8fb2..1d6f7f6484 100644
--- a/code/modules/mob/living/carbon/carbon_defense.dm
+++ b/code/modules/mob/living/carbon/carbon_defense.dm
@@ -14,7 +14,7 @@
var/obj/item/clothing/mask/MFP = src.wear_mask
number += MFP.flash_protect
- var/obj/item/organ/eyes/E = getorganslot("eye_sight")
+ var/obj/item/organ/eyes/E = getorganslot(ORGAN_SLOT_EYES)
if(!E)
number = INFINITY //Can't get flashed without eyes
else
@@ -28,7 +28,7 @@
number += 1
if(head && (head.flags_2 & BANG_PROTECT_2))
number += 1
- var/obj/item/organ/ears/E = getorganslot("ears")
+ var/obj/item/organ/ears/E = getorganslot(ORGAN_SLOT_EARS)
if(!E)
number = INFINITY
else
@@ -279,7 +279,7 @@
var/damage = intensity - get_eye_protection()
if(.) // we've been flashed
- var/obj/item/organ/eyes/eyes = getorganslot("eye_sight")
+ var/obj/item/organ/eyes/eyes = getorganslot(ORGAN_SLOT_EYES)
if (!eyes)
return
if(visual)
@@ -323,7 +323,7 @@
/mob/living/carbon/soundbang_act(intensity = 1, stun_pwr = 20, damage_pwr = 5, deafen_pwr = 15)
var/ear_safety = get_ear_protection()
- var/obj/item/organ/ears/ears = getorganslot("ears")
+ var/obj/item/organ/ears/ears = getorganslot(ORGAN_SLOT_EARS)
var/effect_amount = intensity - ear_safety
if(effect_amount > 0)
if(stun_pwr)
@@ -363,6 +363,6 @@
/mob/living/carbon/can_hear()
. = FALSE
- var/obj/item/organ/ears/ears = getorganslot("ears")
+ var/obj/item/organ/ears/ears = getorganslot(ORGAN_SLOT_EARS)
if(istype(ears) && !ears.deaf)
. = TRUE
diff --git a/code/modules/mob/living/carbon/carbon_movement.dm b/code/modules/mob/living/carbon/carbon_movement.dm
index aa37315b13..ed731408d8 100644
--- a/code/modules/mob/living/carbon/carbon_movement.dm
+++ b/code/modules/mob/living/carbon/carbon_movement.dm
@@ -39,7 +39,7 @@
return 1
// Do we have a jetpack implant (and is it on)?
- var/obj/item/organ/cyberimp/chest/thrusters/T = getorganslot("thrusters")
+ var/obj/item/organ/cyberimp/chest/thrusters/T = getorganslot(ORGAN_SLOT_THRUSTERS)
if(istype(T) && movement_dir && T.allow_thrust(0.01))
return 1
diff --git a/code/modules/mob/living/carbon/human/death.dm b/code/modules/mob/living/carbon/human/death.dm
index c3ae5c39c3..4b1afe0780 100644
--- a/code/modules/mob/living/carbon/human/death.dm
+++ b/code/modules/mob/living/carbon/human/death.dm
@@ -20,7 +20,7 @@
if(stat == DEAD)
return
stop_sound_channel(CHANNEL_HEARTBEAT)
- var/obj/item/organ/heart/H = getorganslot("heart")
+ var/obj/item/organ/heart/H = getorganslot(ORGAN_SLOT_HEART)
if(H)
H.beat = BEAT_NONE
diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm
index d1e363bb90..8f4eac4703 100644
--- a/code/modules/mob/living/carbon/human/human.dm
+++ b/code/modules/mob/living/carbon/human/human.dm
@@ -270,13 +270,13 @@
if(ishuman(usr))
var/mob/living/carbon/human/H = usr
var/perpname = get_face_name(get_id_name(""))
- if(istype(H.glasses, /obj/item/clothing/glasses/hud) || istype(H.getorganslot("eye_hud"), /obj/item/organ/cyberimp/eyes/hud))
+ if(istype(H.glasses, /obj/item/clothing/glasses/hud) || istype(H.getorganslot(ORGAN_SLOT_HUD), /obj/item/organ/cyberimp/eyes/hud))
var/datum/data/record/R = find_record("name", perpname, GLOB.data_core.general)
if(href_list["photo_front"] || href_list["photo_side"])
if(R)
if(!H.canUseHUD())
return
- else if(!istype(H.glasses, /obj/item/clothing/glasses/hud) && !istype(H.getorganslot("eye_hud"), /obj/item/organ/cyberimp/eyes/hud/medical))
+ else if(!istype(H.glasses, /obj/item/clothing/glasses/hud) && !istype(H.getorganslot(ORGAN_SLOT_HUD), /obj/item/organ/cyberimp/eyes/hud/medical))
return
var/obj/item/photo/P = null
if(href_list["photo_front"])
@@ -287,13 +287,13 @@
P.show(H)
if(href_list["hud"] == "m")
- if(istype(H.glasses, /obj/item/clothing/glasses/hud/health) || istype(H.getorganslot("eye_hud"), /obj/item/organ/cyberimp/eyes/hud/medical))
+ if(istype(H.glasses, /obj/item/clothing/glasses/hud/health) || istype(H.getorganslot(ORGAN_SLOT_HUD), /obj/item/organ/cyberimp/eyes/hud/medical))
if(href_list["p_stat"])
var/health_status = input(usr, "Specify a new physical status for this person.", "Medical HUD", R.fields["p_stat"]) in list("Active", "Physically Unfit", "*Unconscious*", "*Deceased*", "Cancel")
if(R)
if(!H.canUseHUD())
return
- else if(!istype(H.glasses, /obj/item/clothing/glasses/hud/health) && !istype(H.getorganslot("eye_hud"), /obj/item/organ/cyberimp/eyes/hud/medical))
+ else if(!istype(H.glasses, /obj/item/clothing/glasses/hud/health) && !istype(H.getorganslot(ORGAN_SLOT_HUD), /obj/item/organ/cyberimp/eyes/hud/medical))
return
if(health_status && health_status != "Cancel")
R.fields["p_stat"] = health_status
@@ -303,7 +303,7 @@
if(R)
if(!H.canUseHUD())
return
- else if(!istype(H.glasses, /obj/item/clothing/glasses/hud/health) && !istype(H.getorganslot("eye_hud"), /obj/item/organ/cyberimp/eyes/hud/medical))
+ else if(!istype(H.glasses, /obj/item/clothing/glasses/hud/health) && !istype(H.getorganslot(ORGAN_SLOT_HUD), /obj/item/organ/cyberimp/eyes/hud/medical))
return
if(health_status && health_status != "Cancel")
R.fields["m_stat"] = health_status
@@ -352,7 +352,7 @@
to_chat(usr, "Gathered data is inconsistent with the analysis, possible cause: poisoning.")
if(href_list["hud"] == "s")
- if(istype(H.glasses, /obj/item/clothing/glasses/hud/security) || istype(H.getorganslot("eye_hud"), /obj/item/organ/cyberimp/eyes/hud/security))
+ if(istype(H.glasses, /obj/item/clothing/glasses/hud/security) || istype(H.getorganslot(ORGAN_SLOT_HUD), /obj/item/organ/cyberimp/eyes/hud/security))
if(usr.stat || usr == src) //|| !usr.canmove || usr.restrained()) Fluff: Sechuds have eye-tracking technology and sets 'arrest' to people that the wearer looks and blinks at.
return //Non-fluff: This allows sec to set people to arrest as they get disarmed or beaten
// Checks the user has security clearence before allowing them to change arrest status via hud, comment out to enable all access
@@ -379,7 +379,7 @@
if(setcriminal != "Cancel")
if(R)
if(H.canUseHUD())
- if(istype(H.glasses, /obj/item/clothing/glasses/hud/security) || istype(H.getorganslot("eye_hud"), /obj/item/organ/cyberimp/eyes/hud/security))
+ if(istype(H.glasses, /obj/item/clothing/glasses/hud/security) || istype(H.getorganslot(ORGAN_SLOT_HUD), /obj/item/organ/cyberimp/eyes/hud/security))
investigate_log("[src.key] has been set from [R.fields["criminal"]] to [setcriminal] by [usr.name] ([usr.key]).", INVESTIGATE_RECORDS)
R.fields["criminal"] = setcriminal
sec_hud_set_security_status()
@@ -389,7 +389,7 @@
if(R)
if(!H.canUseHUD())
return
- else if(!istype(H.glasses, /obj/item/clothing/glasses/hud/security) && !istype(H.getorganslot("eye_hud"), /obj/item/organ/cyberimp/eyes/hud/security))
+ else if(!istype(H.glasses, /obj/item/clothing/glasses/hud/security) && !istype(H.getorganslot(ORGAN_SLOT_HUD), /obj/item/organ/cyberimp/eyes/hud/security))
return
to_chat(usr, "Name: [R.fields["name"]] Criminal Status: [R.fields["criminal"]]")
to_chat(usr, "Minor Crimes:")
@@ -418,7 +418,7 @@
return
else if(!H.canUseHUD())
return
- else if(!istype(H.glasses, /obj/item/clothing/glasses/hud/security) && !istype(H.getorganslot("eye_hud"), /obj/item/organ/cyberimp/eyes/hud/security))
+ else if(!istype(H.glasses, /obj/item/clothing/glasses/hud/security) && !istype(H.getorganslot(ORGAN_SLOT_HUD), /obj/item/organ/cyberimp/eyes/hud/security))
return
var/crime = GLOB.data_core.createCrimeEntry(t1, t2, allowed_access, worldtime2text())
GLOB.data_core.addMinorCrime(R.fields["id"], crime)
@@ -433,7 +433,7 @@
return
else if (!H.canUseHUD())
return
- else if (!istype(H.glasses, /obj/item/clothing/glasses/hud/security) && !istype(H.getorganslot("eye_hud"), /obj/item/organ/cyberimp/eyes/hud/security))
+ else if (!istype(H.glasses, /obj/item/clothing/glasses/hud/security) && !istype(H.getorganslot(ORGAN_SLOT_HUD), /obj/item/organ/cyberimp/eyes/hud/security))
return
var/crime = GLOB.data_core.createCrimeEntry(t1, t2, allowed_access, worldtime2text())
GLOB.data_core.addMajorCrime(R.fields["id"], crime)
@@ -444,7 +444,7 @@
if(R)
if(!H.canUseHUD())
return
- else if(!istype(H.glasses, /obj/item/clothing/glasses/hud/security) && !istype(H.getorganslot("eye_hud"), /obj/item/organ/cyberimp/eyes/hud/security))
+ else if(!istype(H.glasses, /obj/item/clothing/glasses/hud/security) && !istype(H.getorganslot(ORGAN_SLOT_HUD), /obj/item/organ/cyberimp/eyes/hud/security))
return
to_chat(usr, "Comments/Log:")
var/counter = 1
@@ -462,7 +462,7 @@
return
else if(!H.canUseHUD())
return
- else if(!istype(H.glasses, /obj/item/clothing/glasses/hud/security) && !istype(H.getorganslot("eye_hud"), /obj/item/organ/cyberimp/eyes/hud/security))
+ else if(!istype(H.glasses, /obj/item/clothing/glasses/hud/security) && !istype(H.getorganslot(ORGAN_SLOT_HUD), /obj/item/organ/cyberimp/eyes/hud/security))
return
var/counter = 1
while(R.fields[text("com_[]", counter)])
@@ -637,7 +637,7 @@
return 0
var/they_breathe = (!(NOBREATH in C.dna.species.species_traits))
- var/they_lung = C.getorganslot("lungs")
+ var/they_lung = C.getorganslot(ORGAN_SLOT_LUNGS)
if(C.health > HEALTH_THRESHOLD_CRIT)
return
diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm
index 7be010b3ba..2018b01c70 100644
--- a/code/modules/mob/living/carbon/human/human_defense.dm
+++ b/code/modules/mob/living/carbon/human/human_defense.dm
@@ -452,7 +452,7 @@
siemens_coeff = gloves_siemens_coeff
if(undergoing_cardiac_arrest() && !illusion)
if(shock_damage * siemens_coeff >= 1 && prob(25))
- var/obj/item/organ/heart/heart = getorganslot("heart")
+ var/obj/item/organ/heart/heart = getorganslot(ORGAN_SLOT_HEART)
heart.beating = TRUE
if(stat == CONSCIOUS)
to_chat(src, "You feel your heart beating again!")
diff --git a/code/modules/mob/living/carbon/human/inventory.dm b/code/modules/mob/living/carbon/human/inventory.dm
index 1679ff5d42..71c5dedc26 100644
--- a/code/modules/mob/living/carbon/human/inventory.dm
+++ b/code/modules/mob/living/carbon/human/inventory.dm
@@ -225,7 +225,7 @@
/mob/living/carbon/human/wear_mask_update(obj/item/clothing/C, toggle_off = 1)
if((C.flags_inv & (HIDEHAIR|HIDEFACIALHAIR)) || (initial(C.flags_inv) & (HIDEHAIR|HIDEFACIALHAIR)))
update_hair()
- if(toggle_off && internal && !getorganslot("breathing_tube"))
+ if(toggle_off && internal && !getorganslot(ORGAN_SLOT_BREATHING_TUBE))
update_internals_hud_icon(0)
internal = null
if(C.flags_inv & HIDEEYES)
diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm
index e2a257e0ce..0afe5ae0d0 100644
--- a/code/modules/mob/living/carbon/human/life.dm
+++ b/code/modules/mob/living/carbon/human/life.dm
@@ -91,7 +91,7 @@
#define HUMAN_CRIT_MAX_OXYLOSS (SSmobs.wait/30)
/mob/living/carbon/human/check_breath(datum/gas_mixture/breath)
- var/L = getorganslot("lungs")
+ var/L = getorganslot(ORGAN_SLOT_LUNGS)
if(!L)
if(health >= HEALTH_THRESHOLD_CRIT)
@@ -328,7 +328,7 @@
/mob/living/carbon/human/proc/undergoing_cardiac_arrest()
if(!can_heartattack())
return FALSE
- var/obj/item/organ/heart/heart = getorganslot("heart")
+ var/obj/item/organ/heart/heart = getorganslot(ORGAN_SLOT_HEART)
if(istype(heart) && heart.beating)
return FALSE
return TRUE
@@ -337,7 +337,7 @@
if(!can_heartattack())
return FALSE
- var/obj/item/organ/heart/heart = getorganslot("heart")
+ var/obj/item/organ/heart/heart = getorganslot(ORGAN_SLOT_HEART)
if(!istype(heart))
return
diff --git a/code/modules/mob/living/carbon/human/say.dm b/code/modules/mob/living/carbon/human/say.dm
index b02ef243c8..4332f02b6a 100644
--- a/code/modules/mob/living/carbon/human/say.dm
+++ b/code/modules/mob/living/carbon/human/say.dm
@@ -48,7 +48,7 @@
CHECK_DNA_AND_SPECIES(src)
// how do species that don't breathe talk? magic, that's what.
- if(!(NOBREATH in dna.species.species_traits) && !getorganslot("lungs"))
+ if(!(NOBREATH in dna.species.species_traits) && !getorganslot(ORGAN_SLOT_LUNGS))
return 0
if(mind)
return !mind.miming
diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm
index dce7c62879..d30e51ada9 100644
--- a/code/modules/mob/living/carbon/human/species.dm
+++ b/code/modules/mob/living/carbon/human/species.dm
@@ -124,15 +124,15 @@
//Will regenerate missing organs
/datum/species/proc/regenerate_organs(mob/living/carbon/C,datum/species/old_species,replace_current=TRUE)
- var/obj/item/organ/brain/brain = C.getorganslot("brain")
- var/obj/item/organ/heart/heart = C.getorganslot("heart")
- var/obj/item/organ/lungs/lungs = C.getorganslot("lungs")
- var/obj/item/organ/appendix/appendix = C.getorganslot("appendix")
- var/obj/item/organ/eyes/eyes = C.getorganslot("eye_sight")
- var/obj/item/organ/ears/ears = C.getorganslot("ears")
- var/obj/item/organ/tongue/tongue = C.getorganslot("tongue")
- var/obj/item/organ/liver/liver = C.getorganslot("liver")
- var/obj/item/organ/stomach/stomach = C.getorganslot("stomach")
+ var/obj/item/organ/brain/brain = C.getorganslot(ORGAN_SLOT_BRAIN)
+ var/obj/item/organ/heart/heart = C.getorganslot(ORGAN_SLOT_HEART)
+ var/obj/item/organ/lungs/lungs = C.getorganslot(ORGAN_SLOT_LUNGS)
+ var/obj/item/organ/appendix/appendix = C.getorganslot(ORGAN_SLOT_APPENDIX)
+ var/obj/item/organ/eyes/eyes = C.getorganslot(ORGAN_SLOT_EYES)
+ var/obj/item/organ/ears/ears = C.getorganslot(ORGAN_SLOT_EARS)
+ var/obj/item/organ/tongue/tongue = C.getorganslot(ORGAN_SLOT_TONGUE)
+ var/obj/item/organ/liver/liver = C.getorganslot(ORGAN_SLOT_LIVER)
+ var/obj/item/organ/stomach/stomach = C.getorganslot(ORGAN_SLOT_STOMACH)
var/should_have_brain = TRUE
var/should_have_heart = !(NOBLOOD in species_traits)
@@ -1198,7 +1198,7 @@
if(!gravity)
var/obj/item/tank/jetpack/J = H.back
var/obj/item/clothing/suit/space/hardsuit/C = H.wear_suit
- var/obj/item/organ/cyberimp/chest/thrusters/T = H.getorganslot("thrusters")
+ var/obj/item/organ/cyberimp/chest/thrusters/T = H.getorganslot(ORGAN_SLOT_THRUSTERS)
if(!istype(J) && istype(C))
J = C.jetpack
if(istype(J) && J.full_speed && J.allow_thrust(0.01, H)) //Prevents stacking
@@ -1254,7 +1254,7 @@
return 1
else
var/we_breathe = (!(NOBREATH in user.dna.species.species_traits))
- var/we_lung = user.getorganslot("lungs")
+ var/we_lung = user.getorganslot(ORGAN_SLOT_LUNGS)
if(we_breathe && we_lung)
user.do_cpr(target)
diff --git a/code/modules/mob/living/carbon/human/species_types/zombies.dm b/code/modules/mob/living/carbon/human/species_types/zombies.dm
index 016a3635ef..53a8a5b8bb 100644
--- a/code/modules/mob/living/carbon/human/species_types/zombies.dm
+++ b/code/modules/mob/living/carbon/human/species_types/zombies.dm
@@ -52,7 +52,7 @@
// Infection organ needs to be handled separately from mutant_organs
// because it persists through species transitions
var/obj/item/organ/zombie_infection/infection
- infection = C.getorganslot("zombie_infection")
+ infection = C.getorganslot(ORGAN_SLOT_ZOMBIE)
if(!infection)
infection = new()
infection.Insert(C)
diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm
index 31f8eb3f73..475b69e8e3 100644
--- a/code/modules/mob/living/carbon/life.dm
+++ b/code/modules/mob/living/carbon/life.dm
@@ -58,7 +58,7 @@
var/datum/gas_mixture/breath
- if(!getorganslot("breathing_tube"))
+ if(!getorganslot(ORGAN_SLOT_BREATHING_TUBE))
if(health <= HEALTH_THRESHOLD_FULLCRIT || (pulledby && pulledby.grab_state >= GRAB_KILL))
losebreath++ //You can't breath at all when in critical or when being choked, so you're going to miss a breath
@@ -110,7 +110,7 @@
if((status_flags & GODMODE))
return
- var/lungs = getorganslot("lungs")
+ var/lungs = getorganslot(ORGAN_SLOT_LUNGS)
if(!lungs)
adjustOxyLoss(2)
@@ -220,7 +220,7 @@
if(internal.loc != src)
internal = null
update_internals_hud_icon(0)
- else if ((!wear_mask || !(wear_mask.flags_1 & MASKINTERNALS_1)) && !getorganslot("breathing_tube"))
+ else if ((!wear_mask || !(wear_mask.flags_1 & MASKINTERNALS_1)) && !getorganslot(ORGAN_SLOT_BREATHING_TUBE))
internal = null
update_internals_hud_icon(0)
else
@@ -391,7 +391,7 @@
/////////
/mob/living/carbon/proc/handle_liver()
- var/obj/item/organ/liver/liver = getorganslot("liver")
+ var/obj/item/organ/liver/liver = getorganslot(ORGAN_SLOT_LIVER)
if((!dna && !liver) || (NOLIVER in dna.species.species_traits))
return
if(liver)
@@ -404,17 +404,17 @@
liver_failure()
/mob/living/carbon/proc/undergoing_liver_failure()
- var/obj/item/organ/liver/liver = getorganslot("liver")
+ var/obj/item/organ/liver/liver = getorganslot(ORGAN_SLOT_LIVER)
if(liver && liver.failing)
return TRUE
/mob/living/carbon/proc/return_liver_damage()
- var/obj/item/organ/liver/liver = getorganslot("liver")
+ var/obj/item/organ/liver/liver = getorganslot(ORGAN_SLOT_LIVER)
if(liver)
return liver.damage
/mob/living/carbon/proc/applyLiverDamage(var/d)
- var/obj/item/organ/liver/L = getorganslot("liver")
+ var/obj/item/organ/liver/L = getorganslot(ORGAN_SLOT_LIVER)
if(L)
L.damage += d
diff --git a/code/modules/mob/living/carbon/monkey/monkey.dm b/code/modules/mob/living/carbon/monkey/monkey.dm
index 2fcfe97d65..779e7f2f90 100644
--- a/code/modules/mob/living/carbon/monkey/monkey.dm
+++ b/code/modules/mob/living/carbon/monkey/monkey.dm
@@ -140,7 +140,7 @@
return protection
/mob/living/carbon/monkey/IsVocal()
- if(!getorganslot("lungs"))
+ if(!getorganslot(ORGAN_SLOT_LUNGS))
return 0
return 1
diff --git a/code/modules/mob/living/carbon/say.dm b/code/modules/mob/living/carbon/say.dm
index d6ee2ebbfc..526a2ea09b 100644
--- a/code/modules/mob/living/carbon/say.dm
+++ b/code/modules/mob/living/carbon/say.dm
@@ -1,6 +1,6 @@
/mob/living/carbon/treat_message(message)
message = ..(message)
- var/obj/item/organ/tongue/T = getorganslot("tongue")
+ var/obj/item/organ/tongue/T = getorganslot(ORGAN_SLOT_TONGUE)
if(!T) //hoooooouaah!
var/regex/tongueless_lower = new("\[gdntke]+", "g")
var/regex/tongueless_upper = new("\[GDNTKE]+", "g")
@@ -21,7 +21,7 @@
/mob/living/carbon/get_spans()
. = ..()
- var/obj/item/organ/tongue/T = getorganslot("tongue")
+ var/obj/item/organ/tongue/T = getorganslot(ORGAN_SLOT_TONGUE)
if(T)
. |= T.get_spans()
@@ -30,7 +30,7 @@
. |= I.get_held_item_speechspans(src)
/mob/living/carbon/could_speak_in_language(datum/language/dt)
- var/obj/item/organ/tongue/T = getorganslot("tongue")
+ var/obj/item/organ/tongue/T = getorganslot(ORGAN_SLOT_TONGUE)
if(T)
. = T.could_speak_in_language(dt)
else
diff --git a/code/modules/mob/living/carbon/status_procs.dm b/code/modules/mob/living/carbon/status_procs.dm
index ce14664a0e..7b0329d84a 100644
--- a/code/modules/mob/living/carbon/status_procs.dm
+++ b/code/modules/mob/living/carbon/status_procs.dm
@@ -3,7 +3,7 @@
// eye damage, eye_blind, eye_blurry, druggy, BLIND disability, NEARSIGHT disability, and HUSK disability.
/mob/living/carbon/damage_eyes(amount)
- var/obj/item/organ/eyes/eyes = getorganslot("eye_sight")
+ var/obj/item/organ/eyes/eyes = getorganslot(ORGAN_SLOT_EYES)
if (!eyes)
return
if(amount>0)
@@ -15,7 +15,7 @@
overlay_fullscreen("eye_damage", /obj/screen/fullscreen/impaired, 1)
/mob/living/carbon/set_eye_damage(amount)
- var/obj/item/organ/eyes/eyes = getorganslot("eye_sight")
+ var/obj/item/organ/eyes/eyes = getorganslot(ORGAN_SLOT_EYES)
if (!eyes)
return
eyes.eye_damage = max(amount,0)
@@ -28,7 +28,7 @@
clear_fullscreen("eye_damage")
/mob/living/carbon/adjust_eye_damage(amount)
- var/obj/item/organ/eyes/eyes = getorganslot("eye_sight")
+ var/obj/item/organ/eyes/eyes = getorganslot(ORGAN_SLOT_EYES)
if (!eyes)
return
eyes.eye_damage = max(eyes.eye_damage+amount, 0)
diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm
index 9c34ca4dbd..7e3d1cd320 100644
--- a/code/modules/mob/living/say.dm
+++ b/code/modules/mob/living/say.dm
@@ -362,7 +362,7 @@ GLOBAL_LIST_INIT(department_radio_keys, list(
if(message_mode == MODE_VOCALCORDS)
if(iscarbon(src))
var/mob/living/carbon/C = src
- var/obj/item/organ/vocal_cords/V = C.getorganslot("vocal_cords")
+ var/obj/item/organ/vocal_cords/V = C.getorganslot(ORGAN_SLOT_VOICE)
if(V && V.can_speak_with())
V.handle_speech(message) //message
V.speak_with(message) //action
diff --git a/code/modules/mob/living/taste.dm b/code/modules/mob/living/taste.dm
index 45fdf55fb4..c66168cee4 100644
--- a/code/modules/mob/living/taste.dm
+++ b/code/modules/mob/living/taste.dm
@@ -8,7 +8,7 @@
return DEFAULT_TASTE_SENSITIVITY
/mob/living/carbon/get_taste_sensitivity()
- var/obj/item/organ/tongue/tongue = getorganslot("tongue")
+ var/obj/item/organ/tongue/tongue = getorganslot(ORGAN_SLOT_TONGUE)
if(istype(tongue))
. = tongue.taste_sensitivity
else
diff --git a/code/modules/projectiles/guns/ballistic.dm b/code/modules/projectiles/guns/ballistic.dm
index 0b6a9f1de7..307e8b83e7 100644
--- a/code/modules/projectiles/guns/ballistic.dm
+++ b/code/modules/projectiles/guns/ballistic.dm
@@ -139,7 +139,7 @@
#define BRAINS_BLOWN_THROW_RANGE 3
#define BRAINS_BLOWN_THROW_SPEED 1
/obj/item/gun/ballistic/suicide_act(mob/user)
- var/obj/item/organ/brain/B = user.getorganslot("brain")
+ var/obj/item/organ/brain/B = user.getorganslot(ORGAN_SLOT_BRAIN)
if (B && chambered && chambered.BB && can_trigger_gun(user) && !chambered.BB.nodamage)
user.visible_message("[user] is putting the barrel of [src] in [user.p_their()] mouth. It looks like [user.p_theyre()] trying to commit suicide!")
sleep(25)
diff --git a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm
index c114f7017b..cc91819611 100644
--- a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm
+++ b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm
@@ -38,7 +38,7 @@ All effects don't start immediately, but rather get worse over time; the rate is
var/mob/living/carbon/human/H = M
if(H.drunkenness < volume * boozepwr * ALCOHOL_THRESHOLD_MODIFIER)
H.drunkenness = max((H.drunkenness + (sqrt(volume) * boozepwr * ALCOHOL_RATE)), 0) //Volume, power, and server alcohol rate effect how quickly one gets drunk
- var/obj/item/organ/liver/L = H.getorganslot("liver")
+ var/obj/item/organ/liver/L = H.getorganslot(ORGAN_SLOT_LIVER)
H.applyLiverDamage((max(sqrt(volume) * boozepwr * L.alcohol_tolerance, 0))/10)
return ..() || .
diff --git a/code/modules/reagents/chemistry/reagents/food_reagents.dm b/code/modules/reagents/chemistry/reagents/food_reagents.dm
index f1b076ca68..d25df998e3 100644
--- a/code/modules/reagents/chemistry/reagents/food_reagents.dm
+++ b/code/modules/reagents/chemistry/reagents/food_reagents.dm
@@ -550,7 +550,7 @@
if(!M.is_mouth_covered() && !M.is_eyes_covered())
unprotected = TRUE
if(unprotected)
- if(!M.getorganslot("eye_sight")) //can't blind somebody with no eyes
+ if(!M.getorganslot(ORGAN_SLOT_EYES)) //can't blind somebody with no eyes
to_chat(M, "Your eye sockets feel wet.")
else
if(!M.eye_blurry)
diff --git a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm
index dcf725819d..c5a23e5a23 100644
--- a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm
+++ b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm
@@ -671,7 +671,11 @@
taste_description = "dull toxin"
/datum/reagent/medicine/oculine/on_mob_life(mob/living/M)
+<<<<<<< HEAD
var/obj/item/organ/eyes/eyes = M.getorganslot("eyes_sight")
+=======
+ var/obj/item/organ/eyes/eyes = M.getorganslot(ORGAN_SLOT_EYES)
+>>>>>>> 04c05d8... Adds defines for organ slots (#31737)
if (!eyes)
return
if(M.disabilities & BLIND)
diff --git a/code/modules/reagents/chemistry/reagents/other_reagents.dm b/code/modules/reagents/chemistry/reagents/other_reagents.dm
index b4ff0e870b..cbf7c5fcf5 100644
--- a/code/modules/reagents/chemistry/reagents/other_reagents.dm
+++ b/code/modules/reagents/chemistry/reagents/other_reagents.dm
@@ -1568,7 +1568,7 @@
/datum/reagent/romerol/on_mob_life(mob/living/carbon/human/H)
// Silently add the zombie infection organ to be activated upon death
- if(!H.getorganslot("zombie_infection"))
+ if(!H.getorganslot(ORGAN_SLOT_ZOMBIE))
var/obj/item/organ/zombie_infection/ZI = new()
ZI.Insert(H)
..()
diff --git a/code/modules/station_goals/dna_vault.dm b/code/modules/station_goals/dna_vault.dm
index cfa95f2d1a..a90b3598ce 100644
--- a/code/modules/station_goals/dna_vault.dm
+++ b/code/modules/station_goals/dna_vault.dm
@@ -253,7 +253,7 @@
if(VAULT_TOXIN)
to_chat(H, "You feel resistant to airborne toxins.")
if(locate(/obj/item/organ/lungs) in H.internal_organs)
- var/obj/item/organ/lungs/L = H.internal_organs_slot["lungs"]
+ var/obj/item/organ/lungs/L = H.internal_organs_slot[ORGAN_SLOT_LUNGS]
L.tox_breath_dam_min = 0
L.tox_breath_dam_max = 0
S.species_traits |= VIRUSIMMUNE
diff --git a/code/modules/surgery/eye_surgery.dm b/code/modules/surgery/eye_surgery.dm
index 2aeadffc65..978a17a2f3 100644
--- a/code/modules/surgery/eye_surgery.dm
+++ b/code/modules/surgery/eye_surgery.dm
@@ -1,3 +1,4 @@
+<<<<<<< HEAD
/datum/surgery/eye_surgery
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)
@@ -35,4 +36,43 @@
target.adjustBrainLoss(100)
else
user.visible_message("[user] accidentally stabs [target] right in the brain! Or would have, if [target] had a brain.", "You accidentally stab [target] right in the brain! Or would have, if [target] had a brain.")
+=======
+/datum/surgery/eye_surgery
+ 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")
+ requires_bodypart_type = 0
+
+//fix eyes
+/datum/surgery_step/fix_eyes
+ name = "fix eyes"
+ implements = list(/obj/item/hemostat = 100, /obj/item/screwdriver = 45, /obj/item/pen = 25)
+ time = 64
+
+/datum/surgery/eye_surgery/can_start(mob/user, mob/living/carbon/target)
+ var/obj/item/organ/eyes/E = target.getorganslot(ORGAN_SLOT_EYES)
+ if(!E)
+ to_chat(user, "It's hard to do surgery on someones eyes when they don't have any.")
+ return FALSE
+
+/datum/surgery_step/fix_eyes/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
+ user.visible_message("[user] begins to fix [target]'s eyes.", "You begin to fix [target]'s eyes...")
+
+/datum/surgery_step/fix_eyes/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
+ user.visible_message("[user] successfully fixes [target]'s eyes!", "You succeed in fixing [target]'s eyes.")
+ target.cure_blind()
+ target.set_blindness(0)
+ target.cure_nearsighted()
+ target.blur_eyes(35) //this will fix itself slowly.
+ target.set_eye_damage(0)
+ return TRUE
+
+/datum/surgery_step/fix_eyes/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
+ if(target.getorgan(/obj/item/organ/brain))
+ user.visible_message("[user] accidentally stabs [target] right in the brain!", "You accidentally stab [target] right in the brain!")
+ target.adjustBrainLoss(100)
+ else
+ user.visible_message("[user] accidentally stabs [target] right in the brain! Or would have, if [target] had a brain.", "You accidentally stab [target] right in the brain! Or would have, if [target] had a brain.")
+>>>>>>> 04c05d8... Adds defines for organ slots (#31737)
return FALSE
\ No newline at end of file
diff --git a/code/modules/surgery/organs/appendix.dm b/code/modules/surgery/organs/appendix.dm
index ad51c48d85..35a2d851e3 100644
--- a/code/modules/surgery/organs/appendix.dm
+++ b/code/modules/surgery/organs/appendix.dm
@@ -2,7 +2,7 @@
name = "appendix"
icon_state = "appendix"
zone = "groin"
- slot = "appendix"
+ slot = ORGAN_SLOT_APPENDIX
var/inflamed = 0
/obj/item/organ/appendix/update_icon()
diff --git a/code/modules/surgery/organs/augments_arms.dm b/code/modules/surgery/organs/augments_arms.dm
index 3ebe5dd061..21666253f5 100644
--- a/code/modules/surgery/organs/augments_arms.dm
+++ b/code/modules/surgery/organs/augments_arms.dm
@@ -2,7 +2,6 @@
name = "arm-mounted implant"
desc = "You shouldn't see this! Adminhelp and report this as an issue on github!"
zone = "r_arm"
- slot = "r_arm_device"
icon_state = "implant-toolkit"
w_class = WEIGHT_CLASS_NORMAL
actions_types = list(/datum/action/item_action/organ_action/toggle)
@@ -20,9 +19,18 @@
holder = new holder(src)
update_icon()
- slot = zone + "_device"
+ SetSlotFromZone()
items_list = contents.Copy()
+/obj/item/organ/cyberimp/arm/proc/SetSlotFromZone()
+ switch(zone)
+ if("l_arm")
+ slot = ORGAN_SLOT_LEFT_ARM_AUG
+ if("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")
transform = null
@@ -40,7 +48,7 @@
zone = "l_arm"
else
zone = "r_arm"
- slot = zone + "_device"
+ SetSlotFromZone()
to_chat(user, "You modify [src] to be installed on the [zone == "r_arm" ? "right" : "left"] arm.")
update_icon()
else if(istype(W, /obj/item/card/emag))
diff --git a/code/modules/surgery/organs/augments_chest.dm b/code/modules/surgery/organs/augments_chest.dm
index 6ebc278e53..5843863c02 100644
--- a/code/modules/surgery/organs/augments_chest.dm
+++ b/code/modules/surgery/organs/augments_chest.dm
@@ -13,7 +13,7 @@
var/hunger_threshold = NUTRITION_LEVEL_STARVING
var/synthesizing = 0
var/poison_amount = 5
- slot = "stomach"
+ slot = ORGAN_SLOT_STOMACH
origin_tech = "materials=2;powerstorage=2;biotech=2"
/obj/item/organ/cyberimp/chest/nutriment/on_life()
@@ -51,7 +51,7 @@
icon_state = "chest_implant"
implant_color = "#AD0000"
origin_tech = "materials=5;programming=4;biotech=4"
- slot = "heartdrive"
+ slot = ORGAN_SLOT_HEART_AID
var/revive_cost = 0
var/reviving = 0
var/cooldown = 0
@@ -120,7 +120,7 @@
name = "implantable thrusters set"
desc = "An implantable set of thruster ports. They use the gas from environment or subject's internals for propulsion in zero-gravity areas. \
Unlike regular jetpack, this device has no stabilization system."
- slot = "thrusters"
+ slot = ORGAN_SLOT_THRUSTERS
icon_state = "imp_jetpack"
origin_tech = "materials=4;magnets=4;biotech=4;engineering=5"
implant_overlay = null
diff --git a/code/modules/surgery/organs/augments_eyes.dm b/code/modules/surgery/organs/augments_eyes.dm
index 62b427f883..f928db5dd6 100644
--- a/code/modules/surgery/organs/augments_eyes.dm
+++ b/code/modules/surgery/organs/augments_eyes.dm
@@ -3,7 +3,7 @@
desc = "artificial photoreceptors with specialized functionality"
icon_state = "eye_implant"
implant_overlay = "eye_implant_overlay"
- slot = "eye_sight"
+ slot = ORGAN_SLOT_EYES
zone = "eyes"
w_class = WEIGHT_CLASS_TINY
@@ -11,7 +11,7 @@
/obj/item/organ/cyberimp/eyes/hud
name = "HUD implant"
desc = "These cybernetic eyes will display a HUD over everything you see. Maybe."
- slot = "eye_hud"
+ slot = ORGAN_SLOT_HUD
var/HUD_type = 0
/obj/item/organ/cyberimp/eyes/hud/Insert(var/mob/living/carbon/M, var/special = 0, drop_if_replaced = FALSE)
diff --git a/code/modules/surgery/organs/augments_internal.dm b/code/modules/surgery/organs/augments_internal.dm
index 1eec609fc0..4232a37f78 100644
--- a/code/modules/surgery/organs/augments_internal.dm
+++ b/code/modules/surgery/organs/augments_internal.dm
@@ -44,7 +44,7 @@
var/active = 0
var/list/stored_items = list()
implant_color = "#DE7E00"
- slot = "brain_antidrop"
+ slot = ORGAN_SLOT_BRAIN_ANTIDROP
origin_tech = "materials=4;programming=5;biotech=4"
actions_types = list(/datum/action/item_action/organ_action/toggle)
@@ -101,7 +101,7 @@
name = "CNS Rebooter implant"
desc = "This implant will automatically give you back control over your central nervous system, reducing downtime when stunned."
implant_color = "#FFFF00"
- slot = "brain_antistun"
+ slot = ORGAN_SLOT_BRAIN_ANTISTUN
origin_tech = "materials=5;programming=4;biotech=5"
/obj/item/organ/cyberimp/brain/anti_stun/on_life()
@@ -133,7 +133,7 @@
name = "breathing tube implant"
desc = "This simple implant adds an internals connector to your back, allowing you to use internals without a mask and protecting you from being choked."
icon_state = "implant_mask"
- slot = "breathing_tube"
+ slot = ORGAN_SLOT_BREATHING_TUBE
w_class = WEIGHT_CLASS_TINY
origin_tech = "materials=2;biotech=3"
diff --git a/code/modules/surgery/organs/ears.dm b/code/modules/surgery/organs/ears.dm
index f8a310c8f7..e3aaec0266 100644
--- a/code/modules/surgery/organs/ears.dm
+++ b/code/modules/surgery/organs/ears.dm
@@ -3,7 +3,7 @@
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"
- slot = "ears"
+ slot = ORGAN_SLOT_EARS
gender = PLURAL
// `deaf` measures "ticks" of deafness. While > 0, the person is unable
diff --git a/code/modules/surgery/organs/eyes.dm b/code/modules/surgery/organs/eyes.dm
index 8a3b3a92ab..1b7037486a 100644
--- a/code/modules/surgery/organs/eyes.dm
+++ b/code/modules/surgery/organs/eyes.dm
@@ -3,7 +3,7 @@
icon_state = "eyeballs"
desc = "I see you!"
zone = "eyes"
- slot = "eye_sight"
+ slot = ORGAN_SLOT_EYES
gender = PLURAL
var/sight_flags = 0
diff --git a/code/modules/surgery/organs/heart.dm b/code/modules/surgery/organs/heart.dm
index 9308154c48..9ff8b1b48b 100644
--- a/code/modules/surgery/organs/heart.dm
+++ b/code/modules/surgery/organs/heart.dm
@@ -3,7 +3,7 @@
desc = "I feel bad for the heartless bastard who lost this."
icon_state = "heart-on"
zone = "chest"
- slot = "heart"
+ slot = ORGAN_SLOT_HEART
origin_tech = "biotech=5"
// Heart attack code is in code/modules/mob/living/carbon/human/life.dm
var/beating = 1
diff --git a/code/modules/surgery/organs/liver.dm b/code/modules/surgery/organs/liver.dm
index eae5e8aee8..352958d9b8 100755
--- a/code/modules/surgery/organs/liver.dm
+++ b/code/modules/surgery/organs/liver.dm
@@ -8,7 +8,7 @@
origin_tech = "biotech=3"
w_class = WEIGHT_CLASS_NORMAL
zone = "chest"
- slot = "liver"
+ 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
var/alcohol_tolerance = ALCOHOL_RATE//affects how much damage the liver takes from alcohol
diff --git a/code/modules/surgery/organs/lungs.dm b/code/modules/surgery/organs/lungs.dm
index 12ab61aaec..9f6f340a2b 100644
--- a/code/modules/surgery/organs/lungs.dm
+++ b/code/modules/surgery/organs/lungs.dm
@@ -12,7 +12,7 @@
name = "lungs"
icon_state = "lungs"
zone = "chest"
- slot = "lungs"
+ 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 681dcb21cf..1780e65087 100644
--- a/code/modules/surgery/organs/organ_internal.dm
+++ b/code/modules/surgery/organs/organ_internal.dm
@@ -118,7 +118,7 @@
var/has_liver = (!(NOLIVER in dna.species.species_traits))
var/has_stomach = (!(NOSTOMACH in dna.species.species_traits))
- if(has_liver && !getorganslot("liver"))
+ if(has_liver && !getorganslot(ORGAN_SLOT_LIVER))
var/obj/item/organ/liver/LI
if(dna.species.mutantliver)
@@ -127,7 +127,7 @@
LI = new()
LI.Insert(src)
- if(has_stomach && !getorganslot("stomach"))
+ if(has_stomach && !getorganslot(ORGAN_SLOT_STOMACH))
var/obj/item/organ/stomach/S
if(dna.species.mutantstomach)
@@ -136,15 +136,15 @@
S = new()
S.Insert(src)
- if(breathes && !getorganslot("lungs"))
+ if(breathes && !getorganslot(ORGAN_SLOT_LUNGS))
var/obj/item/organ/lungs/L = new()
L.Insert(src)
- if(blooded && !getorganslot("heart"))
+ if(blooded && !getorganslot(ORGAN_SLOT_HEART))
var/obj/item/organ/heart/H = new()
H.Insert(src)
- if(!getorganslot("tongue"))
+ if(!getorganslot(ORGAN_SLOT_TONGUE))
var/obj/item/organ/tongue/T
if(dna && dna.species && dna.species.mutanttongue)
@@ -155,7 +155,7 @@
// if they have no mutant tongues, give them a regular one
T.Insert(src)
- if(!getorganslot("eye_sight"))
+ if(!getorganslot(ORGAN_SLOT_EYES))
var/obj/item/organ/eyes/E
if(dna && dna.species && dna.species.mutanteyes)
@@ -165,7 +165,7 @@
E = new()
E.Insert(src)
- if(!getorganslot("ears"))
+ if(!getorganslot(ORGAN_SLOT_EARS))
var/obj/item/organ/ears/ears
if(dna && dna.species && dna.species.mutantears)
ears = new dna.species.mutantears
diff --git a/code/modules/surgery/organs/stomach.dm b/code/modules/surgery/organs/stomach.dm
index 36cd28ac98..2bf34334f4 100755
--- a/code/modules/surgery/organs/stomach.dm
+++ b/code/modules/surgery/organs/stomach.dm
@@ -4,7 +4,7 @@
origin_tech = "biotech=4"
w_class = WEIGHT_CLASS_NORMAL
zone = "chest"
- slot = "stomach"
+ slot = ORGAN_SLOT_STOMACH
attack_verb = list("gored", "squished", "slapped", "digested")
desc = "Onaka ga suite imasu."
var/disgust_metabolism = 1
diff --git a/code/modules/surgery/organs/tails.dm b/code/modules/surgery/organs/tails.dm
index 99d1ed2442..a909463585 100644
--- a/code/modules/surgery/organs/tails.dm
+++ b/code/modules/surgery/organs/tails.dm
@@ -2,7 +2,7 @@
name = "tail"
desc = "What did you cut this off of?"
zone = "groin"
- slot = "tail"
+ slot = ORGAN_SLOT_TAIL
/obj/item/organ/tail/cat
name = "cat tail"
diff --git a/code/modules/surgery/organs/tongue.dm b/code/modules/surgery/organs/tongue.dm
index 5e67e73a8a..5d9c96336a 100644
--- a/code/modules/surgery/organs/tongue.dm
+++ b/code/modules/surgery/organs/tongue.dm
@@ -3,7 +3,7 @@
desc = "A fleshy muscle mostly used for lying."
icon_state = "tonguenormal"
zone = "mouth"
- slot = "tongue"
+ slot = ORGAN_SLOT_TONGUE
attack_verb = list("licked", "slobbered", "slapped", "frenched", "tongued")
var/list/languages_possible
var/say_mod = null
@@ -82,7 +82,7 @@
var/mob/living/carbon/human/user = usr
var/rendered = "[user.name]: [message]"
for(var/mob/living/carbon/human/H in GLOB.living_mob_list)
- var/obj/item/organ/tongue/T = H.getorganslot("tongue")
+ var/obj/item/organ/tongue/T = H.getorganslot(ORGAN_SLOT_TONGUE)
if(!T || T.type != type)
continue
if(H.dna && H.dna.species.id == "abductor" && user.dna && user.dna.species.id == "abductor")
diff --git a/code/modules/surgery/organs/vocal_cords.dm b/code/modules/surgery/organs/vocal_cords.dm
index aa77370ea2..ec1fd7d37a 100644
--- a/code/modules/surgery/organs/vocal_cords.dm
+++ b/code/modules/surgery/organs/vocal_cords.dm
@@ -7,7 +7,7 @@
name = "vocal cords"
icon_state = "appendix"
zone = "mouth"
- slot = "vocal_cords"
+ slot = ORGAN_SLOT_VOICE
gender = PLURAL
var/list/spans = null
@@ -24,15 +24,13 @@
name = "adamantine resonator"
desc = "Fragments of adamantine exists in all golems, stemming from their origins as purely magical constructs. These are used to \"hear\" messages from their leaders."
zone = "head"
- slot = "adamantine_resonator"
+ slot = ORGAN_SLOT_ADAMANTINE_RESONATOR
icon_state = "adamantine_resonator"
/obj/item/organ/vocal_cords/adamantine
name = "adamantine vocal cords"
desc = "When adamantine resonates, it causes all nearby pieces of adamantine to resonate as well. Adamantine golems use this to broadcast messages to nearby golems."
actions_types = list(/datum/action/item_action/organ_action/use/adamantine_vocal_cords)
- zone = "mouth"
- slot = "vocal_cords"
icon_state = "adamantine_cords"
/datum/action/item_action/organ_action/use/adamantine_vocal_cords/Trigger()
@@ -48,7 +46,7 @@
for(var/m in GLOB.player_list)
if(iscarbon(m))
var/mob/living/carbon/C = m
- if(C.getorganslot("adamantine_resonator"))
+ if(C.getorganslot(ORGAN_SLOT_ADAMANTINE_RESONATOR))
to_chat(C, msg)
if(isobserver(m))
var/link = FOLLOW_LINK(m, owner)
@@ -59,8 +57,6 @@
name = "divine vocal cords"
desc = "They carry the voice of an ancient god."
icon_state = "voice_of_god"
- zone = "mouth"
- slot = "vocal_cords"
actions_types = list(/datum/action/item_action/organ_action/colossus)
var/next_command = 0
var/cooldown_mod = 1
diff --git a/code/modules/zombie/items.dm b/code/modules/zombie/items.dm
index 8db4e492e4..f203af610a 100644
--- a/code/modules/zombie/items.dm
+++ b/code/modules/zombie/items.dm
@@ -44,7 +44,7 @@
return
var/obj/item/organ/zombie_infection/infection
- infection = target.getorganslot("zombie_infection")
+ infection = target.getorganslot(ORGAN_SLOT_ZOMBIE)
if(!infection)
infection = new()
infection.Insert(target)
diff --git a/code/modules/zombie/organs.dm b/code/modules/zombie/organs.dm
index d089204fc8..3b5a06a421 100644
--- a/code/modules/zombie/organs.dm
+++ b/code/modules/zombie/organs.dm
@@ -2,7 +2,7 @@
name = "festering ooze"
desc = "A black web of pus and viscera."
zone = "head"
- slot = "zombie_infection"
+ slot = ORGAN_SLOT_ZOMBIE
icon_state = "blacktumor"
origin_tech = "biotech=5"
var/datum/species/old_species = /datum/species/human