Merge branch 'master' of https://github.com/Citadel-Station-13/Citadel-Station-13 into arousal-bad
This commit is contained in:
@@ -1,41 +1,41 @@
|
||||
/datum/surgery/core_removal
|
||||
name = "Core removal"
|
||||
steps = list(/datum/surgery_step/incise, /datum/surgery_step/extract_core)
|
||||
target_mobtypes = 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)
|
||||
lying_required = FALSE
|
||||
ignore_clothes = TRUE
|
||||
|
||||
/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(TOOL_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)
|
||||
display_results(user, target, "<span class='notice'>You begin to extract a core from [target]...</span>",
|
||||
"[user] begins to extract a core from [target].",
|
||||
"[user] begins 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--
|
||||
display_results(user, target, "<span class='notice'>You successfully extract a core from [target]. [slime.cores] core\s remaining.</span>",
|
||||
"[user] successfully extracts a core from [target]!",
|
||||
"[user] successfully extracts a core from [target]!")
|
||||
|
||||
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, "<span class='warning'>There aren't any cores left in [target]!</span>")
|
||||
return 1
|
||||
/datum/surgery/core_removal
|
||||
name = "Core removal"
|
||||
steps = list(/datum/surgery_step/incise, /datum/surgery_step/extract_core)
|
||||
target_mobtypes = 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)
|
||||
lying_required = FALSE
|
||||
ignore_clothes = TRUE
|
||||
|
||||
/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(TOOL_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)
|
||||
display_results(user, target, "<span class='notice'>You begin to extract a core from [target]...</span>",
|
||||
"[user] begins to extract a core from [target].",
|
||||
"[user] begins 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--
|
||||
display_results(user, target, "<span class='notice'>You successfully extract a core from [target]. [slime.cores] core\s remaining.</span>",
|
||||
"[user] successfully extracts a core from [target]!",
|
||||
"[user] successfully extracts a core from [target]!")
|
||||
|
||||
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, "<span class='warning'>There aren't any cores left in [target]!</span>")
|
||||
return 1
|
||||
|
||||
@@ -1,46 +1,46 @@
|
||||
/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)
|
||||
target_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey)
|
||||
possible_locs = list(BODY_ZONE_PRECISE_EYES)
|
||||
requires_bodypart_type = 0
|
||||
//fix eyes
|
||||
/datum/surgery_step/fix_eyes
|
||||
name = "fix eyes"
|
||||
implements = list(TOOL_HEMOSTAT = 100, TOOL_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 someone's eyes when [target.p_they()] [target.p_do()]n't have any.")
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/datum/surgery_step/fix_eyes/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
|
||||
display_results(user, target, "<span class='notice'>You begin to fix [target]'s eyes...</span>",
|
||||
"[user] begins to fix [target]'s eyes.",
|
||||
"[user] begins to perform surgery on [target]'s eyes.")
|
||||
|
||||
/datum/surgery_step/fix_eyes/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
|
||||
var/obj/item/organ/eyes/E = target.getorganslot(ORGAN_SLOT_EYES)
|
||||
display_results(user, target, "<span class='notice'>You succeed in fixing [target]'s eyes.</span>",
|
||||
"[user] successfully fixes [target]'s eyes!",
|
||||
"[user] completes the surgery on [target]'s eyes.")
|
||||
target.cure_blind(list(EYE_DAMAGE))
|
||||
target.set_blindness(0)
|
||||
target.cure_nearsighted(list(EYE_DAMAGE))
|
||||
target.blur_eyes(35) //this will fix itself slowly.
|
||||
E.setOrganDamage(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))
|
||||
display_results(user, target, "<span class='warning'>You accidentally stab [target] right in the brain!</span>",
|
||||
"<span class='warning'>[user] accidentally stabs [target] right in the brain!</span>",
|
||||
"<span class='warning'>[user] accidentally stabs [target] right in the brain!</span>")
|
||||
target.adjustOrganLoss(ORGAN_SLOT_BRAIN, 70)
|
||||
else
|
||||
display_results(user, target, "<span class='warning'>You accidentally stab [target] right in the brain! Or would have, if [target] had a brain.</span>",
|
||||
"<span class='warning'>[user] accidentally stabs [target] right in the brain! Or would have, if [target] had a brain.</span>",
|
||||
"<span class='warning'>[user] accidentally stabs [target] right in the brain!</span>")
|
||||
return FALSE
|
||||
/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)
|
||||
target_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey)
|
||||
possible_locs = list(BODY_ZONE_PRECISE_EYES)
|
||||
requires_bodypart_type = 0
|
||||
//fix eyes
|
||||
/datum/surgery_step/fix_eyes
|
||||
name = "fix eyes"
|
||||
implements = list(TOOL_HEMOSTAT = 100, TOOL_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 someone's eyes when [target.p_they()] [target.p_do()]n't have any.")
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/datum/surgery_step/fix_eyes/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
|
||||
display_results(user, target, "<span class='notice'>You begin to fix [target]'s eyes...</span>",
|
||||
"[user] begins to fix [target]'s eyes.",
|
||||
"[user] begins to perform surgery on [target]'s eyes.")
|
||||
|
||||
/datum/surgery_step/fix_eyes/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
|
||||
var/obj/item/organ/eyes/E = target.getorganslot(ORGAN_SLOT_EYES)
|
||||
display_results(user, target, "<span class='notice'>You succeed in fixing [target]'s eyes.</span>",
|
||||
"[user] successfully fixes [target]'s eyes!",
|
||||
"[user] completes the surgery on [target]'s eyes.")
|
||||
target.cure_blind(list(EYE_DAMAGE))
|
||||
target.set_blindness(0)
|
||||
target.cure_nearsighted(list(EYE_DAMAGE))
|
||||
target.blur_eyes(35) //this will fix itself slowly.
|
||||
E.setOrganDamage(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))
|
||||
display_results(user, target, "<span class='warning'>You accidentally stab [target] right in the brain!</span>",
|
||||
"<span class='warning'>[user] accidentally stabs [target] right in the brain!</span>",
|
||||
"<span class='warning'>[user] accidentally stabs [target] right in the brain!</span>")
|
||||
target.adjustOrganLoss(ORGAN_SLOT_BRAIN, 70)
|
||||
else
|
||||
display_results(user, target, "<span class='warning'>You accidentally stab [target] right in the brain! Or would have, if [target] had a brain.</span>",
|
||||
"<span class='warning'>[user] accidentally stabs [target] right in the brain! Or would have, if [target] had a brain.</span>",
|
||||
"<span class='warning'>[user] accidentally stabs [target] right in the brain!</span>")
|
||||
return FALSE
|
||||
|
||||
+175
-175
@@ -1,175 +1,175 @@
|
||||
/proc/attempt_initiate_surgery(obj/item/I, mob/living/M, mob/user)
|
||||
if(!istype(M))
|
||||
return
|
||||
|
||||
var/mob/living/carbon/C
|
||||
var/obj/item/bodypart/affecting
|
||||
var/selected_zone = user.zone_selected
|
||||
|
||||
if(iscarbon(M))
|
||||
C = M
|
||||
affecting = C.get_bodypart(check_zone(selected_zone))
|
||||
|
||||
var/datum/surgery/current_surgery
|
||||
|
||||
for(var/datum/surgery/S in M.surgeries)
|
||||
if(S.location == selected_zone)
|
||||
current_surgery = S
|
||||
|
||||
if(!current_surgery)
|
||||
var/list/all_surgeries = GLOB.surgeries_list.Copy()
|
||||
var/list/available_surgeries = list()
|
||||
|
||||
for(var/datum/surgery/S in all_surgeries)
|
||||
if(!S.possible_locs.Find(selected_zone))
|
||||
continue
|
||||
if(affecting)
|
||||
if(!S.requires_bodypart)
|
||||
continue
|
||||
if(S.requires_bodypart_type && affecting.status != S.requires_bodypart_type)
|
||||
continue
|
||||
if(S.requires_real_bodypart && affecting.is_pseudopart)
|
||||
continue
|
||||
else if(C && S.requires_bodypart) //mob with no limb in surgery zone when we need a limb
|
||||
continue
|
||||
if(S.lying_required && !(M.lying))
|
||||
continue
|
||||
if(!S.can_start(user, M))
|
||||
continue
|
||||
for(var/path in S.target_mobtypes)
|
||||
if(istype(M, path))
|
||||
available_surgeries[S.name] = S
|
||||
break
|
||||
|
||||
if(!available_surgeries.len)
|
||||
return
|
||||
|
||||
var/P = input("Begin which procedure?", "Surgery", null, null) as null|anything in available_surgeries
|
||||
if(P && user && user.Adjacent(M) && (I in user))
|
||||
var/datum/surgery/S = available_surgeries[P]
|
||||
|
||||
for(var/datum/surgery/other in M.surgeries)
|
||||
if(other.location == S.location)
|
||||
return //during the input() another surgery was started at the same location.
|
||||
|
||||
//we check that the surgery is still doable after the input() wait.
|
||||
if(C)
|
||||
affecting = C.get_bodypart(check_zone(selected_zone))
|
||||
if(affecting)
|
||||
if(!S.requires_bodypart)
|
||||
return
|
||||
if(S.requires_bodypart_type && affecting.status != S.requires_bodypart_type)
|
||||
return
|
||||
else if(C && S.requires_bodypart)
|
||||
return
|
||||
if(S.lying_required && !(M.lying))
|
||||
return
|
||||
if(!S.can_start(user, M))
|
||||
return
|
||||
|
||||
if(S.ignore_clothes || get_location_accessible(M, selected_zone))
|
||||
var/datum/surgery/procedure = new S.type(M, selected_zone, affecting)
|
||||
user.visible_message("[user] drapes [I] over [M]'s [parse_zone(selected_zone)] to prepare for surgery.", \
|
||||
"<span class='notice'>You drape [I] over [M]'s [parse_zone(selected_zone)] to prepare for \an [procedure.name].</span>")
|
||||
|
||||
log_combat(user, M, "operated on", null, "(OPERATION TYPE: [procedure.name]) (TARGET AREA: [selected_zone])")
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You need to expose [M]'s [parse_zone(selected_zone)] first!</span>")
|
||||
|
||||
else if(!current_surgery.step_in_progress)
|
||||
attempt_cancel_surgery(current_surgery, I, M, user)
|
||||
|
||||
return 1
|
||||
|
||||
/proc/attempt_cancel_surgery(datum/surgery/S, obj/item/I, mob/living/M, mob/user)
|
||||
var/selected_zone = user.zone_selected
|
||||
if(S.status == 1)
|
||||
M.surgeries -= S
|
||||
user.visible_message("[user] removes [I] from [M]'s [parse_zone(selected_zone)].", \
|
||||
"<span class='notice'>You remove [I] from [M]'s [parse_zone(selected_zone)].</span>")
|
||||
qdel(S)
|
||||
else if(S.can_cancel)
|
||||
var/close_tool_type = /obj/item/cautery
|
||||
var/obj/item/close_tool = user.get_inactive_held_item()
|
||||
var/is_robotic = S.requires_bodypart_type == BODYPART_ROBOTIC
|
||||
if(is_robotic)
|
||||
close_tool_type = /obj/item/screwdriver
|
||||
if(istype(close_tool, close_tool_type) || iscyborg(user))
|
||||
M.surgeries -= S
|
||||
user.visible_message("[user] closes [M]'s [parse_zone(selected_zone)] with [close_tool] and removes [I].", \
|
||||
"<span class='notice'>You close [M]'s [parse_zone(selected_zone)] with [close_tool] and remove [I].</span>")
|
||||
qdel(S)
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You need to hold a [is_robotic ? "screwdriver" : "cautery"] in your inactive hand to stop [M]'s surgery!</span>")
|
||||
|
||||
/proc/get_location_modifier(mob/M)
|
||||
var/turf/T = get_turf(M)
|
||||
if(locate(/obj/structure/table/optable, T))
|
||||
return 1
|
||||
else if(locate(/obj/structure/table, T))
|
||||
return 0.8
|
||||
else if(locate(/obj/structure/bed, T))
|
||||
return 0.7
|
||||
else
|
||||
return 0.5
|
||||
|
||||
|
||||
/proc/get_location_accessible(mob/M, location)
|
||||
var/covered_locations = 0 //based on body_parts_covered
|
||||
var/face_covered = 0 //based on flags_inv
|
||||
var/eyesmouth_covered = 0 //based on flags_cover
|
||||
if(iscarbon(M))
|
||||
var/mob/living/carbon/C = M
|
||||
for(var/obj/item/clothing/I in list(C.back, C.wear_mask, C.head))
|
||||
covered_locations |= I.body_parts_covered
|
||||
face_covered |= I.flags_inv
|
||||
eyesmouth_covered |= I.flags_cover
|
||||
if(ishuman(C))
|
||||
var/mob/living/carbon/human/H = C
|
||||
for(var/obj/item/I in list(H.wear_suit, H.w_uniform, H.shoes, H.belt, H.gloves, H.glasses, H.ears))
|
||||
covered_locations |= I.body_parts_covered
|
||||
face_covered |= I.flags_inv
|
||||
eyesmouth_covered |= I.flags_cover
|
||||
|
||||
switch(location)
|
||||
if(BODY_ZONE_HEAD)
|
||||
if(covered_locations & HEAD)
|
||||
return 0
|
||||
if(BODY_ZONE_PRECISE_EYES)
|
||||
if(covered_locations & HEAD || face_covered & HIDEEYES || eyesmouth_covered & GLASSESCOVERSEYES)
|
||||
return 0
|
||||
if(BODY_ZONE_PRECISE_MOUTH)
|
||||
if(covered_locations & HEAD || face_covered & HIDEFACE || eyesmouth_covered & MASKCOVERSMOUTH || eyesmouth_covered & HEADCOVERSMOUTH)
|
||||
return 0
|
||||
if(BODY_ZONE_CHEST)
|
||||
if(covered_locations & CHEST)
|
||||
return 0
|
||||
if(BODY_ZONE_PRECISE_GROIN)
|
||||
if(covered_locations & GROIN)
|
||||
return 0
|
||||
if(BODY_ZONE_L_ARM)
|
||||
if(covered_locations & ARM_LEFT)
|
||||
return 0
|
||||
if(BODY_ZONE_R_ARM)
|
||||
if(covered_locations & ARM_RIGHT)
|
||||
return 0
|
||||
if(BODY_ZONE_L_LEG)
|
||||
if(covered_locations & LEG_LEFT)
|
||||
return 0
|
||||
if(BODY_ZONE_R_LEG)
|
||||
if(covered_locations & LEG_RIGHT)
|
||||
return 0
|
||||
if(BODY_ZONE_PRECISE_L_HAND)
|
||||
if(covered_locations & HAND_LEFT)
|
||||
return 0
|
||||
if(BODY_ZONE_PRECISE_R_HAND)
|
||||
if(covered_locations & HAND_RIGHT)
|
||||
return 0
|
||||
if(BODY_ZONE_PRECISE_L_FOOT)
|
||||
if(covered_locations & FOOT_LEFT)
|
||||
return 0
|
||||
if(BODY_ZONE_PRECISE_R_FOOT)
|
||||
if(covered_locations & FOOT_RIGHT)
|
||||
return 0
|
||||
|
||||
return 1
|
||||
/proc/attempt_initiate_surgery(obj/item/I, mob/living/M, mob/user)
|
||||
if(!istype(M))
|
||||
return
|
||||
|
||||
var/mob/living/carbon/C
|
||||
var/obj/item/bodypart/affecting
|
||||
var/selected_zone = user.zone_selected
|
||||
|
||||
if(iscarbon(M))
|
||||
C = M
|
||||
affecting = C.get_bodypart(check_zone(selected_zone))
|
||||
|
||||
var/datum/surgery/current_surgery
|
||||
|
||||
for(var/datum/surgery/S in M.surgeries)
|
||||
if(S.location == selected_zone)
|
||||
current_surgery = S
|
||||
|
||||
if(!current_surgery)
|
||||
var/list/all_surgeries = GLOB.surgeries_list.Copy()
|
||||
var/list/available_surgeries = list()
|
||||
|
||||
for(var/datum/surgery/S in all_surgeries)
|
||||
if(!S.possible_locs.Find(selected_zone))
|
||||
continue
|
||||
if(affecting)
|
||||
if(!S.requires_bodypart)
|
||||
continue
|
||||
if(S.requires_bodypart_type && affecting.status != S.requires_bodypart_type)
|
||||
continue
|
||||
if(S.requires_real_bodypart && affecting.is_pseudopart)
|
||||
continue
|
||||
else if(C && S.requires_bodypart) //mob with no limb in surgery zone when we need a limb
|
||||
continue
|
||||
if(S.lying_required && !(M.lying))
|
||||
continue
|
||||
if(!S.can_start(user, M))
|
||||
continue
|
||||
for(var/path in S.target_mobtypes)
|
||||
if(istype(M, path))
|
||||
available_surgeries[S.name] = S
|
||||
break
|
||||
|
||||
if(!available_surgeries.len)
|
||||
return
|
||||
|
||||
var/P = input("Begin which procedure?", "Surgery", null, null) as null|anything in available_surgeries
|
||||
if(P && user && user.Adjacent(M) && (I in user))
|
||||
var/datum/surgery/S = available_surgeries[P]
|
||||
|
||||
for(var/datum/surgery/other in M.surgeries)
|
||||
if(other.location == S.location)
|
||||
return //during the input() another surgery was started at the same location.
|
||||
|
||||
//we check that the surgery is still doable after the input() wait.
|
||||
if(C)
|
||||
affecting = C.get_bodypart(check_zone(selected_zone))
|
||||
if(affecting)
|
||||
if(!S.requires_bodypart)
|
||||
return
|
||||
if(S.requires_bodypart_type && affecting.status != S.requires_bodypart_type)
|
||||
return
|
||||
else if(C && S.requires_bodypart)
|
||||
return
|
||||
if(S.lying_required && !(M.lying))
|
||||
return
|
||||
if(!S.can_start(user, M))
|
||||
return
|
||||
|
||||
if(S.ignore_clothes || get_location_accessible(M, selected_zone))
|
||||
var/datum/surgery/procedure = new S.type(M, selected_zone, affecting)
|
||||
user.visible_message("[user] drapes [I] over [M]'s [parse_zone(selected_zone)] to prepare for surgery.", \
|
||||
"<span class='notice'>You drape [I] over [M]'s [parse_zone(selected_zone)] to prepare for \an [procedure.name].</span>")
|
||||
|
||||
log_combat(user, M, "operated on", null, "(OPERATION TYPE: [procedure.name]) (TARGET AREA: [selected_zone])")
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You need to expose [M]'s [parse_zone(selected_zone)] first!</span>")
|
||||
|
||||
else if(!current_surgery.step_in_progress)
|
||||
attempt_cancel_surgery(current_surgery, I, M, user)
|
||||
|
||||
return 1
|
||||
|
||||
/proc/attempt_cancel_surgery(datum/surgery/S, obj/item/I, mob/living/M, mob/user)
|
||||
var/selected_zone = user.zone_selected
|
||||
if(S.status == 1)
|
||||
M.surgeries -= S
|
||||
user.visible_message("[user] removes [I] from [M]'s [parse_zone(selected_zone)].", \
|
||||
"<span class='notice'>You remove [I] from [M]'s [parse_zone(selected_zone)].</span>")
|
||||
qdel(S)
|
||||
else if(S.can_cancel)
|
||||
var/close_tool_type = /obj/item/cautery
|
||||
var/obj/item/close_tool = user.get_inactive_held_item()
|
||||
var/is_robotic = S.requires_bodypart_type == BODYPART_ROBOTIC
|
||||
if(is_robotic)
|
||||
close_tool_type = /obj/item/screwdriver
|
||||
if(istype(close_tool, close_tool_type) || iscyborg(user))
|
||||
M.surgeries -= S
|
||||
user.visible_message("[user] closes [M]'s [parse_zone(selected_zone)] with [close_tool] and removes [I].", \
|
||||
"<span class='notice'>You close [M]'s [parse_zone(selected_zone)] with [close_tool] and remove [I].</span>")
|
||||
qdel(S)
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You need to hold a [is_robotic ? "screwdriver" : "cautery"] in your inactive hand to stop [M]'s surgery!</span>")
|
||||
|
||||
/proc/get_location_modifier(mob/M)
|
||||
var/turf/T = get_turf(M)
|
||||
if(locate(/obj/structure/table/optable, T))
|
||||
return 1
|
||||
else if(locate(/obj/structure/table, T))
|
||||
return 0.8
|
||||
else if(locate(/obj/structure/bed, T))
|
||||
return 0.7
|
||||
else
|
||||
return 0.5
|
||||
|
||||
|
||||
/proc/get_location_accessible(mob/M, location)
|
||||
var/covered_locations = 0 //based on body_parts_covered
|
||||
var/face_covered = 0 //based on flags_inv
|
||||
var/eyesmouth_covered = 0 //based on flags_cover
|
||||
if(iscarbon(M))
|
||||
var/mob/living/carbon/C = M
|
||||
for(var/obj/item/clothing/I in list(C.back, C.wear_mask, C.head))
|
||||
covered_locations |= I.body_parts_covered
|
||||
face_covered |= I.flags_inv
|
||||
eyesmouth_covered |= I.flags_cover
|
||||
if(ishuman(C))
|
||||
var/mob/living/carbon/human/H = C
|
||||
for(var/obj/item/I in list(H.wear_suit, H.w_uniform, H.shoes, H.belt, H.gloves, H.glasses, H.ears))
|
||||
covered_locations |= I.body_parts_covered
|
||||
face_covered |= I.flags_inv
|
||||
eyesmouth_covered |= I.flags_cover
|
||||
|
||||
switch(location)
|
||||
if(BODY_ZONE_HEAD)
|
||||
if(covered_locations & HEAD)
|
||||
return 0
|
||||
if(BODY_ZONE_PRECISE_EYES)
|
||||
if(covered_locations & HEAD || face_covered & HIDEEYES || eyesmouth_covered & GLASSESCOVERSEYES)
|
||||
return 0
|
||||
if(BODY_ZONE_PRECISE_MOUTH)
|
||||
if(covered_locations & HEAD || face_covered & HIDEFACE || eyesmouth_covered & MASKCOVERSMOUTH || eyesmouth_covered & HEADCOVERSMOUTH)
|
||||
return 0
|
||||
if(BODY_ZONE_CHEST)
|
||||
if(covered_locations & CHEST)
|
||||
return 0
|
||||
if(BODY_ZONE_PRECISE_GROIN)
|
||||
if(covered_locations & GROIN)
|
||||
return 0
|
||||
if(BODY_ZONE_L_ARM)
|
||||
if(covered_locations & ARM_LEFT)
|
||||
return 0
|
||||
if(BODY_ZONE_R_ARM)
|
||||
if(covered_locations & ARM_RIGHT)
|
||||
return 0
|
||||
if(BODY_ZONE_L_LEG)
|
||||
if(covered_locations & LEG_LEFT)
|
||||
return 0
|
||||
if(BODY_ZONE_R_LEG)
|
||||
if(covered_locations & LEG_RIGHT)
|
||||
return 0
|
||||
if(BODY_ZONE_PRECISE_L_HAND)
|
||||
if(covered_locations & HAND_LEFT)
|
||||
return 0
|
||||
if(BODY_ZONE_PRECISE_R_HAND)
|
||||
if(covered_locations & HAND_RIGHT)
|
||||
return 0
|
||||
if(BODY_ZONE_PRECISE_L_FOOT)
|
||||
if(covered_locations & FOOT_LEFT)
|
||||
return 0
|
||||
if(BODY_ZONE_PRECISE_R_FOOT)
|
||||
if(covered_locations & FOOT_RIGHT)
|
||||
return 0
|
||||
|
||||
return 1
|
||||
|
||||
@@ -1,60 +1,60 @@
|
||||
/datum/surgery/implant_removal
|
||||
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)
|
||||
target_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey)
|
||||
possible_locs = list(BODY_ZONE_CHEST)
|
||||
//extract implant
|
||||
/datum/surgery_step/extract_implant
|
||||
name = "extract implant"
|
||||
implements = list(TOOL_HEMOSTAT = 100, TOOL_CROWBAR = 65)
|
||||
time = 64
|
||||
var/obj/item/implant/I = null
|
||||
/datum/surgery_step/extract_implant/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
|
||||
for(var/obj/item/O in target.implants)
|
||||
I = O
|
||||
break
|
||||
if(I)
|
||||
display_results(user, target, "<span class='notice'>You begin to extract [I] from [target]'s [target_zone]...</span>",
|
||||
"[user] begins to extract [I] from [target]'s [target_zone].",
|
||||
"[user] begins to extract something from [target]'s [target_zone].")
|
||||
else
|
||||
display_results(user, target, "<span class='notice'>You look for an implant in [target]'s [target_zone]...</span>",
|
||||
"[user] looks for an implant in [target]'s [target_zone].",
|
||||
"[user] looks for something in [target]'s [target_zone].")
|
||||
|
||||
/datum/surgery_step/extract_implant/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
|
||||
if(I)
|
||||
display_results(user, target, "<span class='notice'>You successfully remove [I] from [target]'s [target_zone].</span>",
|
||||
"[user] successfully removes [I] from [target]'s [target_zone]!",
|
||||
"[user] successfully removes something from [target]'s [target_zone]!")
|
||||
I.removed(target)
|
||||
|
||||
var/obj/item/implantcase/case
|
||||
for(var/obj/item/implantcase/ic in user.held_items)
|
||||
case = ic
|
||||
break
|
||||
if(!case)
|
||||
case = locate(/obj/item/implantcase) in get_turf(target)
|
||||
if(case && !case.imp)
|
||||
case.imp = I
|
||||
I.forceMove(case)
|
||||
case.update_icon()
|
||||
display_results(user, target, "<span class='notice'>You place [I] into [case].</span>",
|
||||
"[user] places [I] into [case]!",
|
||||
"[user] places it into [case]!")
|
||||
else
|
||||
qdel(I)
|
||||
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You can't find anything in [target]'s [target_zone]!</span>")
|
||||
return 1
|
||||
/datum/surgery/implant_removal/mechanic
|
||||
name = "implant removal"
|
||||
requires_bodypart_type = BODYPART_ROBOTIC
|
||||
steps = list(
|
||||
/datum/surgery_step/mechanic_open,
|
||||
/datum/surgery_step/open_hatch,
|
||||
/datum/surgery_step/mechanic_unwrench,
|
||||
/datum/surgery_step/extract_implant,
|
||||
/datum/surgery_step/mechanic_wrench,
|
||||
/datum/surgery_step/mechanic_close)
|
||||
/datum/surgery/implant_removal
|
||||
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)
|
||||
target_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey)
|
||||
possible_locs = list(BODY_ZONE_CHEST)
|
||||
//extract implant
|
||||
/datum/surgery_step/extract_implant
|
||||
name = "extract implant"
|
||||
implements = list(TOOL_HEMOSTAT = 100, TOOL_CROWBAR = 65)
|
||||
time = 64
|
||||
var/obj/item/implant/I = null
|
||||
/datum/surgery_step/extract_implant/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
|
||||
for(var/obj/item/O in target.implants)
|
||||
I = O
|
||||
break
|
||||
if(I)
|
||||
display_results(user, target, "<span class='notice'>You begin to extract [I] from [target]'s [target_zone]...</span>",
|
||||
"[user] begins to extract [I] from [target]'s [target_zone].",
|
||||
"[user] begins to extract something from [target]'s [target_zone].")
|
||||
else
|
||||
display_results(user, target, "<span class='notice'>You look for an implant in [target]'s [target_zone]...</span>",
|
||||
"[user] looks for an implant in [target]'s [target_zone].",
|
||||
"[user] looks for something in [target]'s [target_zone].")
|
||||
|
||||
/datum/surgery_step/extract_implant/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
|
||||
if(I)
|
||||
display_results(user, target, "<span class='notice'>You successfully remove [I] from [target]'s [target_zone].</span>",
|
||||
"[user] successfully removes [I] from [target]'s [target_zone]!",
|
||||
"[user] successfully removes something from [target]'s [target_zone]!")
|
||||
I.removed(target)
|
||||
|
||||
var/obj/item/implantcase/case
|
||||
for(var/obj/item/implantcase/ic in user.held_items)
|
||||
case = ic
|
||||
break
|
||||
if(!case)
|
||||
case = locate(/obj/item/implantcase) in get_turf(target)
|
||||
if(case && !case.imp)
|
||||
case.imp = I
|
||||
I.forceMove(case)
|
||||
case.update_icon()
|
||||
display_results(user, target, "<span class='notice'>You place [I] into [case].</span>",
|
||||
"[user] places [I] into [case]!",
|
||||
"[user] places it into [case]!")
|
||||
else
|
||||
qdel(I)
|
||||
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You can't find anything in [target]'s [target_zone]!</span>")
|
||||
return 1
|
||||
/datum/surgery/implant_removal/mechanic
|
||||
name = "implant removal"
|
||||
requires_bodypart_type = BODYPART_ROBOTIC
|
||||
steps = list(
|
||||
/datum/surgery_step/mechanic_open,
|
||||
/datum/surgery_step/open_hatch,
|
||||
/datum/surgery_step/mechanic_unwrench,
|
||||
/datum/surgery_step/extract_implant,
|
||||
/datum/surgery_step/mechanic_wrench,
|
||||
/datum/surgery_step/mechanic_close)
|
||||
|
||||
@@ -1,60 +1,50 @@
|
||||
/////AUGMENTATION SURGERIES//////
|
||||
//SURGERY STEPS
|
||||
/datum/surgery_step/replace
|
||||
name = "sever muscles"
|
||||
implements = list(TOOL_SCALPEL = 100, TOOL_WIRECUTTER = 55)
|
||||
time = 32
|
||||
|
||||
|
||||
/datum/surgery_step/replace/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
|
||||
display_results(user, target, "<span class ='notice'>You begin to sever the muscles on [target]'s [parse_zone(user.zone_selected)]...</span>",
|
||||
"[user] begins to sever the muscles on [target]'s [parse_zone(user.zone_selected)].",
|
||||
"[user] begins an incision on [target]'s [parse_zone(user.zone_selected)].")
|
||||
|
||||
/datum/surgery_step/replace_limb
|
||||
name = "replace limb"
|
||||
implements = list(/obj/item/bodypart = 100, /obj/item/organ_storage = 100)
|
||||
time = 32
|
||||
var/obj/item/bodypart/L = null // L because "limb"
|
||||
/datum/surgery_step/replace_limb/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
|
||||
if(istype(tool, /obj/item/organ_storage) && istype(tool.contents[1], /obj/item/bodypart))
|
||||
tool = tool.contents[1]
|
||||
var/obj/item/bodypart/aug = tool
|
||||
if(aug.status != BODYPART_ROBOTIC)
|
||||
to_chat(user, "<span class='warning'>That's not an augment, silly!</span>")
|
||||
return -1
|
||||
if(aug.body_zone != target_zone)
|
||||
to_chat(user, "<span class='warning'>[tool] isn't the right type for [parse_zone(target_zone)].</span>")
|
||||
return -1
|
||||
L = surgery.operated_bodypart
|
||||
if(L)
|
||||
display_results(user, target, "<span class ='notice'>You begin to augment [target]'s [parse_zone(user.zone_selected)]...</span>",
|
||||
"[user] begins to augment [target]'s [parse_zone(user.zone_selected)] with [aug].",
|
||||
"[user] begins to augment [target]'s [parse_zone(user.zone_selected)].")
|
||||
else
|
||||
user.visible_message("[user] looks for [target]'s [parse_zone(user.zone_selected)].", "<span class ='notice'>You look for [target]'s [parse_zone(user.zone_selected)]...</span>")
|
||||
|
||||
//ACTUAL SURGERIES
|
||||
/datum/surgery/augmentation
|
||||
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/replace_limb)
|
||||
target_mobtypes = list(/mob/living/carbon/human)
|
||||
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
|
||||
/datum/surgery_step/replace_limb/success(mob/user, mob/living/carbon/target, target_zone, obj/item/bodypart/tool, datum/surgery/surgery)
|
||||
if(L)
|
||||
if(istype(tool, /obj/item/organ_storage))
|
||||
tool.icon_state = initial(tool.icon_state)
|
||||
tool.desc = initial(tool.desc)
|
||||
tool.cut_overlays()
|
||||
tool = tool.contents[1]
|
||||
if(istype(tool) && user.temporarilyRemoveItemFromInventory(tool))
|
||||
tool.replace_limb(target, TRUE)
|
||||
display_results(user, target, "<span class='notice'>You successfully augment [target]'s [parse_zone(target_zone)].</span>",
|
||||
"[user] successfully augments [target]'s [parse_zone(target_zone)] with [tool]!",
|
||||
"[user] successfully augments [target]'s [parse_zone(target_zone)]!")
|
||||
log_combat(user, target, "augmented", addition="by giving him new [parse_zone(target_zone)] INTENT: [uppertext(user.a_intent)]")
|
||||
else
|
||||
to_chat(user, "<span class='warning'>[target] has no organic [parse_zone(target_zone)] there!</span>")
|
||||
return TRUE
|
||||
/////AUGMENTATION SURGERIES//////
|
||||
//SURGERY STEPS
|
||||
|
||||
/datum/surgery_step/replace_limb
|
||||
name = "replace limb"
|
||||
implements = list(/obj/item/bodypart = 100, /obj/item/organ_storage = 100)
|
||||
time = 32
|
||||
var/obj/item/bodypart/L = null // L because "limb"
|
||||
/datum/surgery_step/replace_limb/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
|
||||
if(istype(tool, /obj/item/organ_storage) && istype(tool.contents[1], /obj/item/bodypart))
|
||||
tool = tool.contents[1]
|
||||
var/obj/item/bodypart/aug = tool
|
||||
if(aug.status != BODYPART_ROBOTIC)
|
||||
to_chat(user, "<span class='warning'>That's not an augment, silly!</span>")
|
||||
return -1
|
||||
if(aug.body_zone != target_zone)
|
||||
to_chat(user, "<span class='warning'>[tool] isn't the right type for [parse_zone(target_zone)].</span>")
|
||||
return -1
|
||||
L = surgery.operated_bodypart
|
||||
if(L)
|
||||
display_results(user, target, "<span class ='notice'>You begin to augment [target]'s [parse_zone(user.zone_selected)]...</span>",
|
||||
"[user] begins to augment [target]'s [parse_zone(user.zone_selected)] with [aug].",
|
||||
"[user] begins to augment [target]'s [parse_zone(user.zone_selected)].")
|
||||
else
|
||||
user.visible_message("[user] looks for [target]'s [parse_zone(user.zone_selected)].", "<span class ='notice'>You look for [target]'s [parse_zone(user.zone_selected)]...</span>")
|
||||
|
||||
//ACTUAL SURGERIES
|
||||
/datum/surgery/augmentation
|
||||
name = "Augmentation"
|
||||
steps = list(/datum/surgery_step/incise, /datum/surgery_step/clamp_bleeders, /datum/surgery_step/retract_skin, /datum/surgery_step/replace_limb)
|
||||
target_mobtypes = list(/mob/living/carbon/human)
|
||||
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
|
||||
/datum/surgery_step/replace_limb/success(mob/user, mob/living/carbon/target, target_zone, obj/item/bodypart/tool, datum/surgery/surgery)
|
||||
if(L)
|
||||
if(istype(tool, /obj/item/organ_storage))
|
||||
tool.icon_state = initial(tool.icon_state)
|
||||
tool.desc = initial(tool.desc)
|
||||
tool.cut_overlays()
|
||||
tool = tool.contents[1]
|
||||
if(istype(tool) && user.temporarilyRemoveItemFromInventory(tool))
|
||||
tool.replace_limb(target, TRUE)
|
||||
display_results(user, target, "<span class='notice'>You successfully augment [target]'s [parse_zone(target_zone)].</span>",
|
||||
"[user] successfully augments [target]'s [parse_zone(target_zone)] with [tool]!",
|
||||
"[user] successfully augments [target]'s [parse_zone(target_zone)]!")
|
||||
log_combat(user, target, "augmented", addition="by giving him new [parse_zone(target_zone)] INTENT: [uppertext(user.a_intent)]")
|
||||
else
|
||||
to_chat(user, "<span class='warning'>[target] has no organic [parse_zone(target_zone)] there!</span>")
|
||||
return TRUE
|
||||
|
||||
@@ -1,56 +1,56 @@
|
||||
/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(BODY_ZONE_CHEST)
|
||||
/datum/surgery/lipoplasty/can_start(mob/user, mob/living/carbon/target)
|
||||
if(HAS_TRAIT(target, TRAIT_FAT))
|
||||
return 1
|
||||
return 0
|
||||
//cut fat
|
||||
/datum/surgery_step/cut_fat
|
||||
name = "cut excess fat"
|
||||
implements = list(TOOL_SAW = 100, /obj/item/hatchet = 35, /obj/item/kitchen/knife/butcher = 25) //why we need a saw to cut adipose tissue is beyond me, shit's soft as fuck
|
||||
time = 64
|
||||
|
||||
/datum/surgery_step/cut_fat/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
|
||||
display_results(user, target, "<span class='notice'>You begin to cut away [target]'s excess fat...</span>",
|
||||
"[user] begins to cut away [target]'s excess fat.",
|
||||
"[user] begins to cut [target]'s [target_zone] with [tool].")
|
||||
|
||||
/datum/surgery_step/cut_fat/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
|
||||
display_results(user, target, "<span class='notice'>You cut [target]'s excess fat loose.</span>",
|
||||
"[user] cuts [target]'s excess fat loose!",
|
||||
"[user] finishes the cut on [target]'s [target_zone].")
|
||||
return 1
|
||||
|
||||
//remove fat
|
||||
/datum/surgery_step/remove_fat
|
||||
name = "remove loose fat"
|
||||
implements = list(TOOL_RETRACTOR = 100, TOOL_SCREWDRIVER = 45, TOOL_WIRECUTTER = 35)
|
||||
time = 32
|
||||
|
||||
/datum/surgery_step/remove_fat/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
|
||||
display_results(user, target, "<span class='notice'>You begin to extract [target]'s loose fat...</span>",
|
||||
"[user] begins to extract [target]'s loose fat!",
|
||||
"[user] begins to extract something from [target]'s [target_zone].")
|
||||
|
||||
/datum/surgery_step/remove_fat/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
|
||||
display_results(user, target, "<span class='notice'>You extract [target]'s fat.</span>",
|
||||
"[user] extracts [target]'s fat!",
|
||||
"[user] extracts [target]'s fat!")
|
||||
target.overeatduration = 0 //patient is unfatted
|
||||
var/removednutriment = target.nutrition
|
||||
target.nutrition = NUTRITION_LEVEL_WELL_FED
|
||||
removednutriment -= 450 //whatever was removed goes into the meat
|
||||
var/mob/living/carbon/human/H = target
|
||||
var/typeofmeat = /obj/item/reagent_containers/food/snacks/meat/slab/human
|
||||
if(H.dna && H.dna.species)
|
||||
typeofmeat = H.dna.species.meat
|
||||
var/obj/item/reagent_containers/food/snacks/meat/slab/human/newmeat = new typeofmeat
|
||||
newmeat.name = "fatty meat"
|
||||
newmeat.desc = "Extremely fatty tissue taken from a patient."
|
||||
newmeat.subjectname = H.real_name
|
||||
newmeat.subjectjob = H.job
|
||||
newmeat.reagents.add_reagent (/datum/reagent/consumable/nutriment, (removednutriment / 15)) //To balance with nutriment_factor of nutriment
|
||||
newmeat.forceMove(target.loc)
|
||||
return 1
|
||||
/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(BODY_ZONE_CHEST)
|
||||
/datum/surgery/lipoplasty/can_start(mob/user, mob/living/carbon/target)
|
||||
if(HAS_TRAIT(target, TRAIT_FAT))
|
||||
return 1
|
||||
return 0
|
||||
//cut fat
|
||||
/datum/surgery_step/cut_fat
|
||||
name = "cut excess fat"
|
||||
implements = list(TOOL_SAW = 100, /obj/item/hatchet = 35, /obj/item/kitchen/knife/butcher = 25) //why we need a saw to cut adipose tissue is beyond me, shit's soft as fuck
|
||||
time = 64
|
||||
|
||||
/datum/surgery_step/cut_fat/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
|
||||
display_results(user, target, "<span class='notice'>You begin to cut away [target]'s excess fat...</span>",
|
||||
"[user] begins to cut away [target]'s excess fat.",
|
||||
"[user] begins to cut [target]'s [target_zone] with [tool].")
|
||||
|
||||
/datum/surgery_step/cut_fat/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
|
||||
display_results(user, target, "<span class='notice'>You cut [target]'s excess fat loose.</span>",
|
||||
"[user] cuts [target]'s excess fat loose!",
|
||||
"[user] finishes the cut on [target]'s [target_zone].")
|
||||
return 1
|
||||
|
||||
//remove fat
|
||||
/datum/surgery_step/remove_fat
|
||||
name = "remove loose fat"
|
||||
implements = list(TOOL_RETRACTOR = 100, TOOL_SCREWDRIVER = 45, TOOL_WIRECUTTER = 35)
|
||||
time = 32
|
||||
|
||||
/datum/surgery_step/remove_fat/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
|
||||
display_results(user, target, "<span class='notice'>You begin to extract [target]'s loose fat...</span>",
|
||||
"[user] begins to extract [target]'s loose fat!",
|
||||
"[user] begins to extract something from [target]'s [target_zone].")
|
||||
|
||||
/datum/surgery_step/remove_fat/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
|
||||
display_results(user, target, "<span class='notice'>You extract [target]'s fat.</span>",
|
||||
"[user] extracts [target]'s fat!",
|
||||
"[user] extracts [target]'s fat!")
|
||||
target.overeatduration = 0 //patient is unfatted
|
||||
var/removednutriment = target.nutrition
|
||||
target.nutrition = NUTRITION_LEVEL_WELL_FED
|
||||
removednutriment -= 450 //whatever was removed goes into the meat
|
||||
var/mob/living/carbon/human/H = target
|
||||
var/typeofmeat = /obj/item/reagent_containers/food/snacks/meat/slab/human
|
||||
if(H.dna && H.dna.species)
|
||||
typeofmeat = H.dna.species.meat
|
||||
var/obj/item/reagent_containers/food/snacks/meat/slab/human/newmeat = new typeofmeat
|
||||
newmeat.name = "fatty meat"
|
||||
newmeat.desc = "Extremely fatty tissue taken from a patient."
|
||||
newmeat.subjectname = H.real_name
|
||||
newmeat.subjectjob = H.job
|
||||
newmeat.reagents.add_reagent (/datum/reagent/consumable/nutriment, (removednutriment / 15)) //To balance with nutriment_factor of nutriment
|
||||
newmeat.forceMove(target.loc)
|
||||
return 1
|
||||
|
||||
@@ -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 == 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]
|
||||
/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,121 +1,121 @@
|
||||
#define LIVER_DEFAULT_HEALTH 100 //amount of damage required for liver failure
|
||||
#define LIVER_DEFAULT_TOX_TOLERANCE 3 //amount of toxins the liver can filter out
|
||||
#define LIVER_DEFAULT_TOX_LETHALITY 0.01 //lower values lower how harmful toxins are to the liver
|
||||
#define LIVER_SWELLING_MOVE_MODIFY "pharma"
|
||||
|
||||
/obj/item/organ/liver
|
||||
name = "liver"
|
||||
icon_state = "liver"
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
zone = BODY_ZONE_CHEST
|
||||
slot = ORGAN_SLOT_LIVER
|
||||
desc = "Pairing suggestion: chianti and fava beans."
|
||||
|
||||
maxHealth = STANDARD_ORGAN_THRESHOLD
|
||||
healing_factor = STANDARD_ORGAN_HEALING
|
||||
decay_factor = STANDARD_ORGAN_DECAY
|
||||
|
||||
var/alcohol_tolerance = ALCOHOL_RATE//affects how much damage the liver takes from alcohol
|
||||
var/failing //is this liver failing?
|
||||
var/toxTolerance = LIVER_DEFAULT_TOX_TOLERANCE//maximum amount of toxins the liver can just shrug off
|
||||
var/toxLethality = LIVER_DEFAULT_TOX_LETHALITY//affects how much damage toxins do to the liver
|
||||
var/filterToxins = TRUE //whether to filter toxins
|
||||
var/swelling = 0
|
||||
var/cachedmoveCalc = 1
|
||||
|
||||
/obj/item/organ/liver/on_life()
|
||||
var/mob/living/carbon/C = owner
|
||||
|
||||
if(istype(C))
|
||||
if(!(organ_flags & ORGAN_FAILING))//can't process reagents with a failing liver
|
||||
//slowly heal liver damage
|
||||
damage = max(0, damage - 0.1)
|
||||
|
||||
if(filterToxins && !HAS_TRAIT(owner, TRAIT_TOXINLOVER))
|
||||
//handle liver toxin filtration
|
||||
for(var/datum/reagent/toxin/T in C.reagents.reagent_list)
|
||||
var/thisamount = C.reagents.get_reagent_amount(T.type)
|
||||
if (thisamount && thisamount <= toxTolerance)
|
||||
C.reagents.remove_reagent(T.type, 1)
|
||||
else
|
||||
damage += (thisamount*toxLethality)
|
||||
|
||||
//metabolize reagents
|
||||
C.reagents.metabolize(C, can_overdose=TRUE)
|
||||
|
||||
if(damage > 10 && prob(damage/3))//the higher the damage the higher the probability
|
||||
to_chat(C, "<span class='warning'>You feel a dull pain in your abdomen.</span>")
|
||||
|
||||
if(damage > maxHealth)//cap liver damage
|
||||
damage = maxHealth
|
||||
|
||||
if(swelling >= 10)
|
||||
pharmacokinesis()
|
||||
|
||||
/obj/item/organ/liver/prepare_eat()
|
||||
var/obj/S = ..()
|
||||
S.reagents.add_reagent(/datum/reagent/iron, 5)
|
||||
return S
|
||||
|
||||
//Just in case
|
||||
/obj/item/organ/liver/Remove(mob/living/carbon/M, special = 0)
|
||||
..()
|
||||
M.remove_movespeed_modifier(LIVER_SWELLING_MOVE_MODIFY)
|
||||
M.ResetBloodVol() //At the moment, this shouldn't allow application twice. You either have this OR a thirsty ferret.
|
||||
sizeMoveMod(1, M)
|
||||
|
||||
//Applies some of the effects to the patient.
|
||||
/obj/item/organ/liver/proc/pharmacokinesis()
|
||||
var/moveCalc = 1+((round(swelling) - 9)/3)
|
||||
if(moveCalc == cachedmoveCalc)//reduce calculations
|
||||
return
|
||||
if(prob(5))
|
||||
to_chat(owner, "<span class='notice'>You feel a stange ache in your side, almost like a stitch. This pain is affecting your movements and making you feel lightheaded.</span>")
|
||||
var/mob/living/carbon/human/H = owner
|
||||
H.add_movespeed_modifier(LIVER_SWELLING_MOVE_MODIFY, TRUE, 100, NONE, override = TRUE, multiplicative_slowdown = moveCalc)
|
||||
H.AdjustBloodVol(moveCalc/3)
|
||||
sizeMoveMod(moveCalc, H)
|
||||
|
||||
/obj/item/organ/liver/proc/sizeMoveMod(var/value, mob/living/carbon/human/H)
|
||||
if(cachedmoveCalc == value)
|
||||
return
|
||||
H.next_move_modifier /= cachedmoveCalc
|
||||
H.next_move_modifier *= value
|
||||
cachedmoveCalc = value
|
||||
|
||||
/obj/item/organ/liver/fly
|
||||
name = "insectoid liver"
|
||||
icon_state = "liver-x" //xenomorph liver? It's just a black liver so it fits.
|
||||
desc = "A mutant liver designed to handle the unique diet of a flyperson."
|
||||
alcohol_tolerance = 0.007 //flies eat vomit, so a lower alcohol tolerance is perfect!
|
||||
|
||||
/obj/item/organ/liver/plasmaman
|
||||
name = "reagent processing crystal"
|
||||
icon_state = "liver-p"
|
||||
desc = "A large crystal that is somehow capable of metabolizing chemicals, these are found in plasmamen."
|
||||
|
||||
/obj/item/organ/liver/cybernetic
|
||||
name = "cybernetic liver"
|
||||
icon_state = "liver-c"
|
||||
desc = "An electronic device designed to mimic the functions of a human liver. It has no benefits over an organic liver, but is easy to produce."
|
||||
organ_flags = ORGAN_SYNTHETIC
|
||||
maxHealth = 1.1 * STANDARD_ORGAN_THRESHOLD
|
||||
|
||||
/obj/item/organ/liver/cybernetic/upgraded
|
||||
name = "upgraded cybernetic liver"
|
||||
icon_state = "liver-c-u"
|
||||
desc = "An upgraded version of the cybernetic liver, designed to improve upon organic livers. It is resistant to alcohol poisoning and is very robust at filtering toxins."
|
||||
alcohol_tolerance = 0.001
|
||||
maxHealth = 2 * STANDARD_ORGAN_THRESHOLD
|
||||
toxTolerance = 15 //can shrug off up to 15u of toxins
|
||||
toxLethality = 0.008 //20% less damage than a normal liver
|
||||
|
||||
/obj/item/organ/liver/cybernetic/emp_act(severity)
|
||||
. = ..()
|
||||
if(. & EMP_PROTECT_SELF)
|
||||
return
|
||||
switch(severity)
|
||||
if(1)
|
||||
damage+=100
|
||||
if(2)
|
||||
damage+=50
|
||||
#define LIVER_DEFAULT_HEALTH 100 //amount of damage required for liver failure
|
||||
#define LIVER_DEFAULT_TOX_TOLERANCE 3 //amount of toxins the liver can filter out
|
||||
#define LIVER_DEFAULT_TOX_LETHALITY 0.01 //lower values lower how harmful toxins are to the liver
|
||||
#define LIVER_SWELLING_MOVE_MODIFY "pharma"
|
||||
|
||||
/obj/item/organ/liver
|
||||
name = "liver"
|
||||
icon_state = "liver"
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
zone = BODY_ZONE_CHEST
|
||||
slot = ORGAN_SLOT_LIVER
|
||||
desc = "Pairing suggestion: chianti and fava beans."
|
||||
|
||||
maxHealth = STANDARD_ORGAN_THRESHOLD
|
||||
healing_factor = STANDARD_ORGAN_HEALING
|
||||
decay_factor = STANDARD_ORGAN_DECAY
|
||||
|
||||
var/alcohol_tolerance = ALCOHOL_RATE//affects how much damage the liver takes from alcohol
|
||||
var/failing //is this liver failing?
|
||||
var/toxTolerance = LIVER_DEFAULT_TOX_TOLERANCE//maximum amount of toxins the liver can just shrug off
|
||||
var/toxLethality = LIVER_DEFAULT_TOX_LETHALITY//affects how much damage toxins do to the liver
|
||||
var/filterToxins = TRUE //whether to filter toxins
|
||||
var/swelling = 0
|
||||
var/cachedmoveCalc = 1
|
||||
|
||||
/obj/item/organ/liver/on_life()
|
||||
var/mob/living/carbon/C = owner
|
||||
|
||||
if(istype(C))
|
||||
if(!(organ_flags & ORGAN_FAILING))//can't process reagents with a failing liver
|
||||
//slowly heal liver damage
|
||||
damage = max(0, damage - 0.1)
|
||||
|
||||
if(filterToxins && !HAS_TRAIT(owner, TRAIT_TOXINLOVER))
|
||||
//handle liver toxin filtration
|
||||
for(var/datum/reagent/toxin/T in C.reagents.reagent_list)
|
||||
var/thisamount = C.reagents.get_reagent_amount(T.type)
|
||||
if (thisamount && thisamount <= toxTolerance)
|
||||
C.reagents.remove_reagent(T.type, 1)
|
||||
else
|
||||
damage += (thisamount*toxLethality)
|
||||
|
||||
//metabolize reagents
|
||||
C.reagents.metabolize(C, can_overdose=TRUE)
|
||||
|
||||
if(damage > 10 && prob(damage/3))//the higher the damage the higher the probability
|
||||
to_chat(C, "<span class='warning'>You feel a dull pain in your abdomen.</span>")
|
||||
|
||||
if(damage > maxHealth)//cap liver damage
|
||||
damage = maxHealth
|
||||
|
||||
if(swelling >= 10)
|
||||
pharmacokinesis()
|
||||
|
||||
/obj/item/organ/liver/prepare_eat()
|
||||
var/obj/S = ..()
|
||||
S.reagents.add_reagent(/datum/reagent/iron, 5)
|
||||
return S
|
||||
|
||||
//Just in case
|
||||
/obj/item/organ/liver/Remove(mob/living/carbon/M, special = 0)
|
||||
..()
|
||||
M.remove_movespeed_modifier(LIVER_SWELLING_MOVE_MODIFY)
|
||||
M.ResetBloodVol() //At the moment, this shouldn't allow application twice. You either have this OR a thirsty ferret.
|
||||
sizeMoveMod(1, M)
|
||||
|
||||
//Applies some of the effects to the patient.
|
||||
/obj/item/organ/liver/proc/pharmacokinesis()
|
||||
var/moveCalc = 1+((round(swelling) - 9)/3)
|
||||
if(moveCalc == cachedmoveCalc)//reduce calculations
|
||||
return
|
||||
if(prob(5))
|
||||
to_chat(owner, "<span class='notice'>You feel a stange ache in your side, almost like a stitch. This pain is affecting your movements and making you feel lightheaded.</span>")
|
||||
var/mob/living/carbon/human/H = owner
|
||||
H.add_movespeed_modifier(LIVER_SWELLING_MOVE_MODIFY, TRUE, 100, NONE, override = TRUE, multiplicative_slowdown = moveCalc)
|
||||
H.AdjustBloodVol(moveCalc/3)
|
||||
sizeMoveMod(moveCalc, H)
|
||||
|
||||
/obj/item/organ/liver/proc/sizeMoveMod(var/value, mob/living/carbon/human/H)
|
||||
if(cachedmoveCalc == value)
|
||||
return
|
||||
H.next_move_modifier /= cachedmoveCalc
|
||||
H.next_move_modifier *= value
|
||||
cachedmoveCalc = value
|
||||
|
||||
/obj/item/organ/liver/fly
|
||||
name = "insectoid liver"
|
||||
icon_state = "liver-x" //xenomorph liver? It's just a black liver so it fits.
|
||||
desc = "A mutant liver designed to handle the unique diet of a flyperson."
|
||||
alcohol_tolerance = 0.007 //flies eat vomit, so a lower alcohol tolerance is perfect!
|
||||
|
||||
/obj/item/organ/liver/plasmaman
|
||||
name = "reagent processing crystal"
|
||||
icon_state = "liver-p"
|
||||
desc = "A large crystal that is somehow capable of metabolizing chemicals, these are found in plasmamen."
|
||||
|
||||
/obj/item/organ/liver/cybernetic
|
||||
name = "cybernetic liver"
|
||||
icon_state = "liver-c"
|
||||
desc = "An electronic device designed to mimic the functions of a human liver. It has no benefits over an organic liver, but is easy to produce."
|
||||
organ_flags = ORGAN_SYNTHETIC
|
||||
maxHealth = 1.1 * STANDARD_ORGAN_THRESHOLD
|
||||
|
||||
/obj/item/organ/liver/cybernetic/upgraded
|
||||
name = "upgraded cybernetic liver"
|
||||
icon_state = "liver-c-u"
|
||||
desc = "An upgraded version of the cybernetic liver, designed to improve upon organic livers. It is resistant to alcohol poisoning and is very robust at filtering toxins."
|
||||
alcohol_tolerance = 0.001
|
||||
maxHealth = 2 * STANDARD_ORGAN_THRESHOLD
|
||||
toxTolerance = 15 //can shrug off up to 15u of toxins
|
||||
toxLethality = 0.008 //20% less damage than a normal liver
|
||||
|
||||
/obj/item/organ/liver/cybernetic/emp_act(severity)
|
||||
. = ..()
|
||||
if(. & EMP_PROTECT_SELF)
|
||||
return
|
||||
switch(severity)
|
||||
if(1)
|
||||
damage+=100
|
||||
if(2)
|
||||
damage+=50
|
||||
|
||||
@@ -1,98 +1,98 @@
|
||||
/obj/item/organ/stomach
|
||||
name = "stomach"
|
||||
icon_state = "stomach"
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
zone = BODY_ZONE_CHEST
|
||||
slot = ORGAN_SLOT_STOMACH
|
||||
attack_verb = list("gored", "squished", "slapped", "digested")
|
||||
desc = "Onaka ga suite imasu."
|
||||
var/disgust_metabolism = 1
|
||||
|
||||
healing_factor = STANDARD_ORGAN_HEALING
|
||||
decay_factor = STANDARD_ORGAN_DECAY
|
||||
|
||||
low_threshold_passed = "<span class='info'>Your stomach flashes with pain before subsiding. Food doesn't seem like a good idea right now.</span>"
|
||||
high_threshold_passed = "<span class='warning'>Your stomach flares up with constant pain- you can hardly stomach the idea of food right now!</span>"
|
||||
high_threshold_cleared = "<span class='info'>The pain in your stomach dies down for now, but food still seems unappealing.</span>"
|
||||
low_threshold_cleared = "<span class='info'>The last bouts of pain in your stomach have died out.</span>"
|
||||
|
||||
/obj/item/organ/stomach/on_life()
|
||||
..()
|
||||
var/datum/reagent/consumable/nutriment/Nutri
|
||||
if(ishuman(owner))
|
||||
var/mob/living/carbon/human/H = owner
|
||||
if(!(organ_flags & ORGAN_FAILING))
|
||||
H.dna.species.handle_digestion(H)
|
||||
handle_disgust(H)
|
||||
Nutri = locate(/datum/reagent/consumable/nutriment) in H.reagents.reagent_list
|
||||
|
||||
if(Nutri)
|
||||
if(prob((damage/40) * Nutri.volume * Nutri.volume))
|
||||
H.vomit(damage)
|
||||
to_chat(H, "<span class='warning'>Your stomach reels in pain as you're incapable of holding down all that food!</span>")
|
||||
|
||||
else if(Nutri && damage > high_threshold)
|
||||
if(prob((damage/10) * Nutri.volume * Nutri.volume))
|
||||
H.vomit(damage)
|
||||
to_chat(H, "<span class='warning'>Your stomach reels in pain as you're incapable of holding down all that food!</span>")
|
||||
|
||||
|
||||
else if(iscarbon(owner))
|
||||
var/mob/living/carbon/C = owner
|
||||
Nutri = locate(/datum/reagent/consumable/nutriment) in C.reagents.reagent_list
|
||||
|
||||
if(damage < low_threshold)
|
||||
return
|
||||
|
||||
|
||||
/obj/item/organ/stomach/proc/handle_disgust(mob/living/carbon/human/H)
|
||||
if(H.disgust)
|
||||
var/pukeprob = 5 + 0.05 * H.disgust
|
||||
if(H.disgust >= DISGUST_LEVEL_GROSS)
|
||||
if(prob(10))
|
||||
H.stuttering += 1
|
||||
H.confused += 2
|
||||
if(prob(10) && !H.stat)
|
||||
to_chat(H, "<span class='warning'>You feel kind of iffy...</span>")
|
||||
H.jitteriness = max(H.jitteriness - 3, 0)
|
||||
if(H.disgust >= DISGUST_LEVEL_VERYGROSS)
|
||||
if(prob(pukeprob)) //iT hAndLeS mOrE ThaN PukInG
|
||||
H.confused += 2.5
|
||||
H.stuttering += 1
|
||||
H.vomit(10, 0, 1, 0, 1, 0)
|
||||
H.Dizzy(5)
|
||||
if(H.disgust >= DISGUST_LEVEL_DISGUSTED)
|
||||
if(prob(25))
|
||||
H.blur_eyes(3) //We need to add more shit down here
|
||||
|
||||
H.adjust_disgust(-0.5 * disgust_metabolism)
|
||||
switch(H.disgust)
|
||||
if(0 to DISGUST_LEVEL_GROSS)
|
||||
H.clear_alert("disgust")
|
||||
SEND_SIGNAL(H, COMSIG_CLEAR_MOOD_EVENT, "disgust")
|
||||
if(DISGUST_LEVEL_GROSS to DISGUST_LEVEL_VERYGROSS)
|
||||
H.throw_alert("disgust", /obj/screen/alert/gross)
|
||||
SEND_SIGNAL(H, COMSIG_ADD_MOOD_EVENT, "disgust", /datum/mood_event/gross)
|
||||
if(DISGUST_LEVEL_VERYGROSS to DISGUST_LEVEL_DISGUSTED)
|
||||
H.throw_alert("disgust", /obj/screen/alert/verygross)
|
||||
SEND_SIGNAL(H, COMSIG_ADD_MOOD_EVENT, "disgust", /datum/mood_event/verygross)
|
||||
if(DISGUST_LEVEL_DISGUSTED to INFINITY)
|
||||
H.throw_alert("disgust", /obj/screen/alert/disgusted)
|
||||
SEND_SIGNAL(H, COMSIG_ADD_MOOD_EVENT, "disgust", /datum/mood_event/disgusted)
|
||||
|
||||
/obj/item/organ/stomach/Remove(mob/living/carbon/M, special = 0)
|
||||
var/mob/living/carbon/human/H = owner
|
||||
if(istype(H))
|
||||
H.clear_alert("disgust")
|
||||
SEND_SIGNAL(H, COMSIG_CLEAR_MOOD_EVENT, "disgust")
|
||||
..()
|
||||
|
||||
/obj/item/organ/stomach/fly
|
||||
name = "insectoid stomach"
|
||||
icon_state = "stomach-x" //xenomorph liver? It's just a black liver so it fits.
|
||||
desc = "A mutant stomach designed to handle the unique diet of a flyperson."
|
||||
|
||||
/obj/item/organ/stomach/plasmaman
|
||||
name = "digestive crystal"
|
||||
icon_state = "stomach-p"
|
||||
desc = "A strange crystal that is responsible for metabolizing the unseen energy force that feeds plasmamen."
|
||||
/obj/item/organ/stomach
|
||||
name = "stomach"
|
||||
icon_state = "stomach"
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
zone = BODY_ZONE_CHEST
|
||||
slot = ORGAN_SLOT_STOMACH
|
||||
attack_verb = list("gored", "squished", "slapped", "digested")
|
||||
desc = "Onaka ga suite imasu."
|
||||
var/disgust_metabolism = 1
|
||||
|
||||
healing_factor = STANDARD_ORGAN_HEALING
|
||||
decay_factor = STANDARD_ORGAN_DECAY
|
||||
|
||||
low_threshold_passed = "<span class='info'>Your stomach flashes with pain before subsiding. Food doesn't seem like a good idea right now.</span>"
|
||||
high_threshold_passed = "<span class='warning'>Your stomach flares up with constant pain- you can hardly stomach the idea of food right now!</span>"
|
||||
high_threshold_cleared = "<span class='info'>The pain in your stomach dies down for now, but food still seems unappealing.</span>"
|
||||
low_threshold_cleared = "<span class='info'>The last bouts of pain in your stomach have died out.</span>"
|
||||
|
||||
/obj/item/organ/stomach/on_life()
|
||||
..()
|
||||
var/datum/reagent/consumable/nutriment/Nutri
|
||||
if(ishuman(owner))
|
||||
var/mob/living/carbon/human/H = owner
|
||||
if(!(organ_flags & ORGAN_FAILING))
|
||||
H.dna.species.handle_digestion(H)
|
||||
handle_disgust(H)
|
||||
Nutri = locate(/datum/reagent/consumable/nutriment) in H.reagents.reagent_list
|
||||
|
||||
if(Nutri)
|
||||
if(prob((damage/40) * Nutri.volume * Nutri.volume))
|
||||
H.vomit(damage)
|
||||
to_chat(H, "<span class='warning'>Your stomach reels in pain as you're incapable of holding down all that food!</span>")
|
||||
|
||||
else if(Nutri && damage > high_threshold)
|
||||
if(prob((damage/10) * Nutri.volume * Nutri.volume))
|
||||
H.vomit(damage)
|
||||
to_chat(H, "<span class='warning'>Your stomach reels in pain as you're incapable of holding down all that food!</span>")
|
||||
|
||||
|
||||
else if(iscarbon(owner))
|
||||
var/mob/living/carbon/C = owner
|
||||
Nutri = locate(/datum/reagent/consumable/nutriment) in C.reagents.reagent_list
|
||||
|
||||
if(damage < low_threshold)
|
||||
return
|
||||
|
||||
|
||||
/obj/item/organ/stomach/proc/handle_disgust(mob/living/carbon/human/H)
|
||||
if(H.disgust)
|
||||
var/pukeprob = 5 + 0.05 * H.disgust
|
||||
if(H.disgust >= DISGUST_LEVEL_GROSS)
|
||||
if(prob(10))
|
||||
H.stuttering += 1
|
||||
H.confused += 2
|
||||
if(prob(10) && !H.stat)
|
||||
to_chat(H, "<span class='warning'>You feel kind of iffy...</span>")
|
||||
H.jitteriness = max(H.jitteriness - 3, 0)
|
||||
if(H.disgust >= DISGUST_LEVEL_VERYGROSS)
|
||||
if(prob(pukeprob)) //iT hAndLeS mOrE ThaN PukInG
|
||||
H.confused += 2.5
|
||||
H.stuttering += 1
|
||||
H.vomit(10, 0, 1, 0, 1, 0)
|
||||
H.Dizzy(5)
|
||||
if(H.disgust >= DISGUST_LEVEL_DISGUSTED)
|
||||
if(prob(25))
|
||||
H.blur_eyes(3) //We need to add more shit down here
|
||||
|
||||
H.adjust_disgust(-0.5 * disgust_metabolism)
|
||||
switch(H.disgust)
|
||||
if(0 to DISGUST_LEVEL_GROSS)
|
||||
H.clear_alert("disgust")
|
||||
SEND_SIGNAL(H, COMSIG_CLEAR_MOOD_EVENT, "disgust")
|
||||
if(DISGUST_LEVEL_GROSS to DISGUST_LEVEL_VERYGROSS)
|
||||
H.throw_alert("disgust", /obj/screen/alert/gross)
|
||||
SEND_SIGNAL(H, COMSIG_ADD_MOOD_EVENT, "disgust", /datum/mood_event/gross)
|
||||
if(DISGUST_LEVEL_VERYGROSS to DISGUST_LEVEL_DISGUSTED)
|
||||
H.throw_alert("disgust", /obj/screen/alert/verygross)
|
||||
SEND_SIGNAL(H, COMSIG_ADD_MOOD_EVENT, "disgust", /datum/mood_event/verygross)
|
||||
if(DISGUST_LEVEL_DISGUSTED to INFINITY)
|
||||
H.throw_alert("disgust", /obj/screen/alert/disgusted)
|
||||
SEND_SIGNAL(H, COMSIG_ADD_MOOD_EVENT, "disgust", /datum/mood_event/disgusted)
|
||||
|
||||
/obj/item/organ/stomach/Remove(mob/living/carbon/M, special = 0)
|
||||
var/mob/living/carbon/human/H = owner
|
||||
if(istype(H))
|
||||
H.clear_alert("disgust")
|
||||
SEND_SIGNAL(H, COMSIG_CLEAR_MOOD_EVENT, "disgust")
|
||||
..()
|
||||
|
||||
/obj/item/organ/stomach/fly
|
||||
name = "insectoid stomach"
|
||||
icon_state = "stomach-x" //xenomorph liver? It's just a black liver so it fits.
|
||||
desc = "A mutant stomach designed to handle the unique diet of a flyperson."
|
||||
|
||||
/obj/item/organ/stomach/plasmaman
|
||||
name = "digestive crystal"
|
||||
icon_state = "stomach-p"
|
||||
desc = "A strange crystal that is responsible for metabolizing the unseen energy force that feeds plasmamen."
|
||||
|
||||
@@ -1,51 +1,51 @@
|
||||
/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(BODY_ZONE_HEAD)
|
||||
//reshape_face
|
||||
/datum/surgery_step/reshape_face
|
||||
name = "reshape face"
|
||||
implements = list(TOOL_SCALPEL = 100, /obj/item/kitchen/knife = 50, TOOL_WIRECUTTER = 35)
|
||||
time = 64
|
||||
|
||||
/datum/surgery_step/reshape_face/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
|
||||
display_results(user, target, "<span class='notice'>You begin to alter [target]'s appearance...</span>",
|
||||
"[user] begins to alter [target]'s appearance.",
|
||||
"[user] begins to make an incision in [target]'s face.")
|
||||
|
||||
/datum/surgery_step/reshape_face/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
|
||||
if(HAS_TRAIT_FROM(target, TRAIT_DISFIGURED, TRAIT_GENERIC))
|
||||
REMOVE_TRAIT(target, TRAIT_DISFIGURED, TRAIT_GENERIC)
|
||||
display_results(user, target, "<span class='notice'>You successfully restore [target]'s appearance.</span>",
|
||||
"[user] successfully restores [target]'s appearance!",
|
||||
"[user] finishes the operation on [target]'s face.")
|
||||
else
|
||||
var/list/names = list()
|
||||
if(!isabductor(user))
|
||||
for(var/i in 1 to 10)
|
||||
names += target.dna.species.random_name(target.gender, TRUE)
|
||||
else
|
||||
for(var/_i in 1 to 9)
|
||||
names += "Subject [target.gender == MALE ? "i" : "o"]-[pick("a", "b", "c", "d", "e")]-[rand(10000, 99999)]"
|
||||
names += target.dna.species.random_name(target.gender, TRUE) //give one normal name in case they want to do regular plastic surgery
|
||||
var/chosen_name = input(user, "Choose a new name to assign.", "Plastic Surgery") as null|anything in names
|
||||
if(!chosen_name)
|
||||
return
|
||||
var/oldname = target.real_name
|
||||
target.real_name = chosen_name
|
||||
var/newname = target.real_name //something about how the code handles names required that I use this instead of target.real_name
|
||||
display_results(user, target, "<span class='notice'>You alter [oldname]'s appearance completely, [target.p_they()] is now [newname].</span>",
|
||||
"[user] alters [oldname]'s appearance completely, [target.p_they()] is now [newname]!",
|
||||
"[user] finishes the operation on [target]'s face.")
|
||||
if(ishuman(target))
|
||||
var/mob/living/carbon/human/H = target
|
||||
H.sec_hud_set_ID()
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
/datum/surgery_step/reshape_face/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
|
||||
display_results(user, target, "<span class='warning'>You screw up, leaving [target]'s appearance disfigured!</span>",
|
||||
"[user] screws up, disfiguring [target]'s appearance!",
|
||||
"[user] finishes the operation on [target]'s face.")
|
||||
ADD_TRAIT(target, TRAIT_DISFIGURED, TRAIT_GENERIC)
|
||||
return FALSE
|
||||
/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(BODY_ZONE_HEAD)
|
||||
//reshape_face
|
||||
/datum/surgery_step/reshape_face
|
||||
name = "reshape face"
|
||||
implements = list(TOOL_SCALPEL = 100, /obj/item/kitchen/knife = 50, TOOL_WIRECUTTER = 35)
|
||||
time = 64
|
||||
|
||||
/datum/surgery_step/reshape_face/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
|
||||
display_results(user, target, "<span class='notice'>You begin to alter [target]'s appearance...</span>",
|
||||
"[user] begins to alter [target]'s appearance.",
|
||||
"[user] begins to make an incision in [target]'s face.")
|
||||
|
||||
/datum/surgery_step/reshape_face/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
|
||||
if(HAS_TRAIT_FROM(target, TRAIT_DISFIGURED, TRAIT_GENERIC))
|
||||
REMOVE_TRAIT(target, TRAIT_DISFIGURED, TRAIT_GENERIC)
|
||||
display_results(user, target, "<span class='notice'>You successfully restore [target]'s appearance.</span>",
|
||||
"[user] successfully restores [target]'s appearance!",
|
||||
"[user] finishes the operation on [target]'s face.")
|
||||
else
|
||||
var/list/names = list()
|
||||
if(!isabductor(user))
|
||||
for(var/i in 1 to 10)
|
||||
names += target.dna.species.random_name(target.gender, TRUE)
|
||||
else
|
||||
for(var/_i in 1 to 9)
|
||||
names += "Subject [target.gender == MALE ? "i" : "o"]-[pick("a", "b", "c", "d", "e")]-[rand(10000, 99999)]"
|
||||
names += target.dna.species.random_name(target.gender, TRUE) //give one normal name in case they want to do regular plastic surgery
|
||||
var/chosen_name = input(user, "Choose a new name to assign.", "Plastic Surgery") as null|anything in names
|
||||
if(!chosen_name)
|
||||
return
|
||||
var/oldname = target.real_name
|
||||
target.real_name = chosen_name
|
||||
var/newname = target.real_name //something about how the code handles names required that I use this instead of target.real_name
|
||||
display_results(user, target, "<span class='notice'>You alter [oldname]'s appearance completely, [target.p_they()] is now [newname].</span>",
|
||||
"[user] alters [oldname]'s appearance completely, [target.p_they()] is now [newname]!",
|
||||
"[user] finishes the operation on [target]'s face.")
|
||||
if(ishuman(target))
|
||||
var/mob/living/carbon/human/H = target
|
||||
H.sec_hud_set_ID()
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
/datum/surgery_step/reshape_face/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
|
||||
display_results(user, target, "<span class='warning'>You screw up, leaving [target]'s appearance disfigured!</span>",
|
||||
"[user] screws up, disfiguring [target]'s appearance!",
|
||||
"[user] finishes the operation on [target]'s face.")
|
||||
ADD_TRAIT(target, TRAIT_DISFIGURED, TRAIT_GENERIC)
|
||||
return FALSE
|
||||
|
||||
@@ -1,130 +1,130 @@
|
||||
/datum/surgery_step
|
||||
var/name
|
||||
var/list/implements = list() //format is path = probability of success. alternatively
|
||||
var/implement_type = null //the current type of implement used. This has to be stored, as the actual typepath of the tool may not match the list type.
|
||||
var/accept_hand = FALSE //does the surgery step require an open hand? If true, ignores implements. Compatible with accept_any_item.
|
||||
var/accept_any_item = FALSE //does the surgery step accept any item? If true, ignores implements. Compatible with require_hand.
|
||||
var/time = 10 //how long does the step take?
|
||||
var/repeatable = FALSE //can this step be repeated? Make shure it isn't last step, or it used in surgery with `can_cancel = 1`. Or surgion will be stuck in the loop
|
||||
var/list/chems_needed = list() //list of chems needed to complete the step. Even on success, the step will have no effect if there aren't the chems required in the mob.
|
||||
var/require_all_chems = TRUE //any on the list or all on the list?
|
||||
var/silicons_obey_prob = FALSE
|
||||
|
||||
/datum/surgery_step/proc/try_op(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/surgery, try_to_fail = FALSE)
|
||||
var/success = FALSE
|
||||
if(accept_hand)
|
||||
if(!tool)
|
||||
success = TRUE
|
||||
if(iscyborg(user))
|
||||
success = TRUE
|
||||
if(accept_any_item)
|
||||
if(tool && tool_check(user, tool))
|
||||
success = TRUE
|
||||
else if(tool)
|
||||
for(var/key in implements)
|
||||
var/match = FALSE
|
||||
if(ispath(key) && istype(tool, key))
|
||||
match = TRUE
|
||||
else if(tool.tool_behaviour == key)
|
||||
match = TRUE
|
||||
if(match)
|
||||
implement_type = key
|
||||
if(tool_check(user, tool))
|
||||
success = TRUE
|
||||
break
|
||||
if(success)
|
||||
if(target_zone == surgery.location)
|
||||
if(get_location_accessible(target, target_zone) || surgery.ignore_clothes)
|
||||
return initiate(user, target, target_zone, tool, surgery, try_to_fail)
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You need to expose [target]'s [parse_zone(target_zone)] to perform surgery on it!</span>")
|
||||
return TRUE //returns TRUE so we don't stab the guy in the dick or wherever.
|
||||
if(repeatable)
|
||||
var/datum/surgery_step/next_step = surgery.get_surgery_next_step()
|
||||
if(next_step)
|
||||
surgery.status++
|
||||
if(next_step.try_op(user, target, user.zone_selected, user.get_active_held_item(), surgery))
|
||||
return TRUE
|
||||
else
|
||||
surgery.status--
|
||||
return FALSE
|
||||
|
||||
/datum/surgery_step/proc/initiate(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/surgery, try_to_fail = FALSE)
|
||||
surgery.step_in_progress = TRUE
|
||||
var/speed_mod = 1
|
||||
var/advance = FALSE
|
||||
if(preop(user, target, target_zone, tool, surgery) == -1)
|
||||
surgery.step_in_progress = FALSE
|
||||
return FALSE
|
||||
if(tool)
|
||||
speed_mod = tool.toolspeed
|
||||
if(do_after(user, time * speed_mod, target = target))
|
||||
var/prob_chance = 100
|
||||
if(implement_type) //this means it isn't a require hand or any item step.
|
||||
prob_chance = implements[implement_type]
|
||||
prob_chance *= surgery.get_propability_multiplier()
|
||||
|
||||
if((prob(prob_chance) || (iscyborg(user) && !silicons_obey_prob)) && chem_check(target) && !try_to_fail)
|
||||
if(success(user, target, target_zone, tool, surgery))
|
||||
advance = TRUE
|
||||
else
|
||||
if(failure(user, target, target_zone, tool, surgery))
|
||||
advance = TRUE
|
||||
if(advance && !repeatable)
|
||||
surgery.status++
|
||||
if(surgery.status > surgery.steps.len)
|
||||
surgery.complete()
|
||||
surgery.step_in_progress = FALSE
|
||||
return advance
|
||||
|
||||
/datum/surgery_step/proc/preop(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/surgery)
|
||||
display_results(user, target, "<span class='notice'>You begin to perform surgery on [target]...</span>",
|
||||
"[user] begins to perform surgery on [target].",
|
||||
"[user] begins to perform surgery on [target].")
|
||||
|
||||
/datum/surgery_step/proc/success(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/surgery)
|
||||
display_results(user, target, "<span class='notice'>You succeed.</span>",
|
||||
"[user] succeeds!",
|
||||
"[user] finishes.")
|
||||
return TRUE
|
||||
|
||||
/datum/surgery_step/proc/failure(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/surgery)
|
||||
display_results(user, target, "<span class='warning'>You screw up!</span>",
|
||||
"<span class='warning'>[user] screws up!</span>",
|
||||
"[user] finishes.", TRUE) //By default the patient will notice if the wrong thing has been cut
|
||||
return FALSE
|
||||
|
||||
/datum/surgery_step/proc/tool_check(mob/user, obj/item/tool)
|
||||
return TRUE
|
||||
|
||||
/datum/surgery_step/proc/chem_check(mob/living/target)
|
||||
if(!LAZYLEN(chems_needed))
|
||||
return TRUE
|
||||
if(require_all_chems)
|
||||
. = TRUE
|
||||
for(var/R in chems_needed)
|
||||
if(!target.reagents.has_reagent(R))
|
||||
return FALSE
|
||||
else
|
||||
. = FALSE
|
||||
for(var/R in chems_needed)
|
||||
if(target.reagents.has_reagent(R))
|
||||
return TRUE
|
||||
/datum/surgery_step/proc/get_chem_list()
|
||||
if(!LAZYLEN(chems_needed))
|
||||
return
|
||||
var/list/chems = list()
|
||||
for(var/R in chems_needed)
|
||||
var/datum/reagent/temp = GLOB.chemical_reagents_list[R]
|
||||
if(temp)
|
||||
var/chemname = temp.name
|
||||
chems += chemname
|
||||
return english_list(chems, and_text = require_all_chems ? " and " : " or ")
|
||||
|
||||
//Replaces visible_message during operations so only people looking over the surgeon can tell what they're doing, allowing for shenanigans.
|
||||
/datum/surgery_step/proc/display_results(mob/user, mob/living/carbon/target, self_message, detailed_message, vague_message, target_detailed = FALSE)
|
||||
var/list/detailed_mobs = get_hearers_in_view(1, user) //Only the surgeon and people looking over his shoulder can see the operation clearly
|
||||
if(!target_detailed)
|
||||
detailed_mobs -= target //The patient can't see well what's going on, unless it's something like getting cut
|
||||
user.visible_message(detailed_message, self_message, vision_distance = 1, ignored_mobs = target_detailed ? null : target)
|
||||
user.visible_message(vague_message, "", ignored_mobs = detailed_mobs)
|
||||
/datum/surgery_step
|
||||
var/name
|
||||
var/list/implements = list() //format is path = probability of success. alternatively
|
||||
var/implement_type = null //the current type of implement used. This has to be stored, as the actual typepath of the tool may not match the list type.
|
||||
var/accept_hand = FALSE //does the surgery step require an open hand? If true, ignores implements. Compatible with accept_any_item.
|
||||
var/accept_any_item = FALSE //does the surgery step accept any item? If true, ignores implements. Compatible with require_hand.
|
||||
var/time = 10 //how long does the step take?
|
||||
var/repeatable = FALSE //can this step be repeated? Make shure it isn't last step, or it used in surgery with `can_cancel = 1`. Or surgion will be stuck in the loop
|
||||
var/list/chems_needed = list() //list of chems needed to complete the step. Even on success, the step will have no effect if there aren't the chems required in the mob.
|
||||
var/require_all_chems = TRUE //any on the list or all on the list?
|
||||
var/silicons_obey_prob = FALSE
|
||||
|
||||
/datum/surgery_step/proc/try_op(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/surgery, try_to_fail = FALSE)
|
||||
var/success = FALSE
|
||||
if(accept_hand)
|
||||
if(!tool)
|
||||
success = TRUE
|
||||
if(iscyborg(user))
|
||||
success = TRUE
|
||||
if(accept_any_item)
|
||||
if(tool && tool_check(user, tool))
|
||||
success = TRUE
|
||||
else if(tool)
|
||||
for(var/key in implements)
|
||||
var/match = FALSE
|
||||
if(ispath(key) && istype(tool, key))
|
||||
match = TRUE
|
||||
else if(tool.tool_behaviour == key)
|
||||
match = TRUE
|
||||
if(match)
|
||||
implement_type = key
|
||||
if(tool_check(user, tool))
|
||||
success = TRUE
|
||||
break
|
||||
if(success)
|
||||
if(target_zone == surgery.location)
|
||||
if(get_location_accessible(target, target_zone) || surgery.ignore_clothes)
|
||||
return initiate(user, target, target_zone, tool, surgery, try_to_fail)
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You need to expose [target]'s [parse_zone(target_zone)] to perform surgery on it!</span>")
|
||||
return TRUE //returns TRUE so we don't stab the guy in the dick or wherever.
|
||||
if(repeatable)
|
||||
var/datum/surgery_step/next_step = surgery.get_surgery_next_step()
|
||||
if(next_step)
|
||||
surgery.status++
|
||||
if(next_step.try_op(user, target, user.zone_selected, user.get_active_held_item(), surgery))
|
||||
return TRUE
|
||||
else
|
||||
surgery.status--
|
||||
return FALSE
|
||||
|
||||
/datum/surgery_step/proc/initiate(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/surgery, try_to_fail = FALSE)
|
||||
surgery.step_in_progress = TRUE
|
||||
var/speed_mod = 1
|
||||
var/advance = FALSE
|
||||
if(preop(user, target, target_zone, tool, surgery) == -1)
|
||||
surgery.step_in_progress = FALSE
|
||||
return FALSE
|
||||
if(tool)
|
||||
speed_mod = tool.toolspeed
|
||||
if(do_after(user, time * speed_mod, target = target))
|
||||
var/prob_chance = 100
|
||||
if(implement_type) //this means it isn't a require hand or any item step.
|
||||
prob_chance = implements[implement_type]
|
||||
prob_chance *= surgery.get_propability_multiplier()
|
||||
|
||||
if((prob(prob_chance) || (iscyborg(user) && !silicons_obey_prob)) && chem_check(target) && !try_to_fail)
|
||||
if(success(user, target, target_zone, tool, surgery))
|
||||
advance = TRUE
|
||||
else
|
||||
if(failure(user, target, target_zone, tool, surgery))
|
||||
advance = TRUE
|
||||
if(advance && !repeatable)
|
||||
surgery.status++
|
||||
if(surgery.status > surgery.steps.len)
|
||||
surgery.complete()
|
||||
surgery.step_in_progress = FALSE
|
||||
return advance
|
||||
|
||||
/datum/surgery_step/proc/preop(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/surgery)
|
||||
display_results(user, target, "<span class='notice'>You begin to perform surgery on [target]...</span>",
|
||||
"[user] begins to perform surgery on [target].",
|
||||
"[user] begins to perform surgery on [target].")
|
||||
|
||||
/datum/surgery_step/proc/success(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/surgery)
|
||||
display_results(user, target, "<span class='notice'>You succeed.</span>",
|
||||
"[user] succeeds!",
|
||||
"[user] finishes.")
|
||||
return TRUE
|
||||
|
||||
/datum/surgery_step/proc/failure(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/surgery)
|
||||
display_results(user, target, "<span class='warning'>You screw up!</span>",
|
||||
"<span class='warning'>[user] screws up!</span>",
|
||||
"[user] finishes.", TRUE) //By default the patient will notice if the wrong thing has been cut
|
||||
return FALSE
|
||||
|
||||
/datum/surgery_step/proc/tool_check(mob/user, obj/item/tool)
|
||||
return TRUE
|
||||
|
||||
/datum/surgery_step/proc/chem_check(mob/living/target)
|
||||
if(!LAZYLEN(chems_needed))
|
||||
return TRUE
|
||||
if(require_all_chems)
|
||||
. = TRUE
|
||||
for(var/R in chems_needed)
|
||||
if(!target.reagents.has_reagent(R))
|
||||
return FALSE
|
||||
else
|
||||
. = FALSE
|
||||
for(var/R in chems_needed)
|
||||
if(target.reagents.has_reagent(R))
|
||||
return TRUE
|
||||
/datum/surgery_step/proc/get_chem_list()
|
||||
if(!LAZYLEN(chems_needed))
|
||||
return
|
||||
var/list/chems = list()
|
||||
for(var/R in chems_needed)
|
||||
var/datum/reagent/temp = GLOB.chemical_reagents_list[R]
|
||||
if(temp)
|
||||
var/chemname = temp.name
|
||||
chems += chemname
|
||||
return english_list(chems, and_text = require_all_chems ? " and " : " or ")
|
||||
|
||||
//Replaces visible_message during operations so only people looking over the surgeon can tell what they're doing, allowing for shenanigans.
|
||||
/datum/surgery_step/proc/display_results(mob/user, mob/living/carbon/target, self_message, detailed_message, vague_message, target_detailed = FALSE)
|
||||
var/list/detailed_mobs = get_hearers_in_view(1, user) //Only the surgeon and people looking over his shoulder can see the operation clearly
|
||||
if(!target_detailed)
|
||||
detailed_mobs -= target //The patient can't see well what's going on, unless it's something like getting cut
|
||||
user.visible_message(detailed_message, self_message, vision_distance = 1, ignored_mobs = target_detailed ? null : target)
|
||||
user.visible_message(vague_message, "", ignored_mobs = detailed_mobs)
|
||||
|
||||
+360
-360
@@ -1,360 +1,360 @@
|
||||
/obj/item/retractor
|
||||
name = "retractor"
|
||||
desc = "Retracts stuff."
|
||||
icon = 'icons/obj/surgery.dmi'
|
||||
icon_state = "retractor"
|
||||
materials = list(MAT_METAL=6000, MAT_GLASS=3000)
|
||||
item_flags = SURGICAL_TOOL
|
||||
flags_1 = CONDUCT_1
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
tool_behaviour = TOOL_RETRACTOR
|
||||
toolspeed = 1
|
||||
|
||||
/obj/item/retractor/advanced
|
||||
name = "mechanical pinches"
|
||||
desc = "An agglomerate of rods and gears."
|
||||
icon = 'icons/obj/surgery.dmi'
|
||||
icon_state = "retractor_a"
|
||||
toolspeed = 0.7
|
||||
|
||||
/obj/item/retractor/advanced/attack_self(mob/user)
|
||||
playsound(get_turf(user), 'sound/items/change_drill.ogg', 50, TRUE)
|
||||
if(tool_behaviour == TOOL_RETRACTOR)
|
||||
tool_behaviour = TOOL_HEMOSTAT
|
||||
to_chat(user, "<span class='notice'>You configure the gears of [src], they are now in hemostat mode.</span>")
|
||||
icon_state = "hemostat_a"
|
||||
else
|
||||
tool_behaviour = TOOL_RETRACTOR
|
||||
to_chat(user, "<span class='notice'>You configure the gears of [src], they are now in retractor mode.</span>")
|
||||
icon_state = "retractor_a"
|
||||
|
||||
/obj/item/retractor/advanced/examine(mob/living/user)
|
||||
. = ..()
|
||||
. += "<span class = 'notice> It resembles a [tool_behaviour == TOOL_RETRACTOR ? "retractor" : "hemostat"]. </span>"
|
||||
|
||||
/obj/item/retractor/augment
|
||||
name = "retractor"
|
||||
desc = "Micro-mechanical manipulator for retracting stuff."
|
||||
icon = 'icons/obj/surgery.dmi'
|
||||
icon_state = "retractor"
|
||||
materials = list(MAT_METAL=6000, MAT_GLASS=3000)
|
||||
flags_1 = CONDUCT_1
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
toolspeed = 0.5
|
||||
|
||||
/obj/item/hemostat
|
||||
name = "hemostat"
|
||||
desc = "You think you have seen this before."
|
||||
icon = 'icons/obj/surgery.dmi'
|
||||
icon_state = "hemostat"
|
||||
materials = list(MAT_METAL=5000, MAT_GLASS=2500)
|
||||
item_flags = SURGICAL_TOOL
|
||||
flags_1 = CONDUCT_1
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
attack_verb = list("attacked", "pinched")
|
||||
tool_behaviour = TOOL_HEMOSTAT
|
||||
toolspeed = 1
|
||||
|
||||
/obj/item/hemostat/augment
|
||||
name = "hemostat"
|
||||
desc = "Tiny servos power a pair of pincers to stop bleeding."
|
||||
icon = 'icons/obj/surgery.dmi'
|
||||
icon_state = "hemostat"
|
||||
materials = list(MAT_METAL=5000, MAT_GLASS=2500)
|
||||
flags_1 = CONDUCT_1
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
toolspeed = 0.5
|
||||
attack_verb = list("attacked", "pinched")
|
||||
|
||||
|
||||
/obj/item/cautery
|
||||
name = "cautery"
|
||||
desc = "This stops bleeding."
|
||||
icon = 'icons/obj/surgery.dmi'
|
||||
icon_state = "cautery"
|
||||
materials = list(MAT_METAL=2500, MAT_GLASS=750)
|
||||
item_flags = SURGICAL_TOOL
|
||||
flags_1 = CONDUCT_1
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
attack_verb = list("burnt")
|
||||
tool_behaviour = TOOL_CAUTERY
|
||||
toolspeed = 1
|
||||
|
||||
/obj/item/cautery/augment
|
||||
name = "cautery"
|
||||
desc = "A heated element that cauterizes wounds."
|
||||
icon = 'icons/obj/surgery.dmi'
|
||||
icon_state = "cautery"
|
||||
materials = list(MAT_METAL=2500, MAT_GLASS=750)
|
||||
flags_1 = CONDUCT_1
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
toolspeed = 0.5
|
||||
attack_verb = list("burnt")
|
||||
|
||||
|
||||
/obj/item/surgicaldrill
|
||||
name = "surgical drill"
|
||||
desc = "You can drill using this item. You dig?"
|
||||
icon = 'icons/obj/surgery.dmi'
|
||||
icon_state = "drill"
|
||||
lefthand_file = 'icons/mob/inhands/equipment/tools_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi'
|
||||
hitsound = 'sound/weapons/circsawhit.ogg'
|
||||
materials = list(MAT_METAL=10000, MAT_GLASS=6000)
|
||||
item_flags = SURGICAL_TOOL
|
||||
flags_1 = CONDUCT_1
|
||||
force = 15
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
attack_verb = list("drilled")
|
||||
tool_behaviour = TOOL_DRILL
|
||||
toolspeed = 1
|
||||
|
||||
/obj/item/surgicaldrill/advanced
|
||||
name = "searing tool"
|
||||
desc = "It projects a high power laser used for medical application."
|
||||
icon = 'icons/obj/surgery.dmi'
|
||||
icon_state = "surgicaldrill_a"
|
||||
hitsound = 'sound/items/welder.ogg'
|
||||
|
||||
/obj/item/surgicaldrill/advanced/Initialize()
|
||||
. = ..()
|
||||
set_light(1)
|
||||
|
||||
/obj/item/surgicaldrill/advanced/attack_self(mob/user)
|
||||
playsound(get_turf(user), 'sound/weapons/tap.ogg', 50, TRUE)
|
||||
if(tool_behaviour == TOOL_DRILL)
|
||||
tool_behaviour = TOOL_CAUTERY
|
||||
to_chat(user, "<span class='notice'>You focus the lenses of [src], it is now in mending mode.</span>")
|
||||
icon_state = "cautery_a"
|
||||
else
|
||||
tool_behaviour = TOOL_DRILL
|
||||
to_chat(user, "<span class='notice'>You dilate the lenses of [src], it is now in drilling mode.</span>")
|
||||
icon_state = "surgicaldrill_a"
|
||||
|
||||
/obj/item/surgicaldrill/advanced/examine(mob/living/user)
|
||||
. = ..()
|
||||
. += "<span class = 'notice> It's set to [tool_behaviour == TOOL_DRILL ? "drilling" : "mending"] mode.</span>"
|
||||
|
||||
/obj/item/surgicaldrill/augment
|
||||
name = "surgical drill"
|
||||
desc = "Effectively a small power drill contained within your arm, edges dulled to prevent tissue damage. May or may not pierce the heavens."
|
||||
icon = 'icons/obj/surgery.dmi'
|
||||
icon_state = "drill"
|
||||
hitsound = 'sound/weapons/circsawhit.ogg'
|
||||
materials = list(MAT_METAL=10000, MAT_GLASS=6000)
|
||||
flags_1 = CONDUCT_1
|
||||
force = 10
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
toolspeed = 0.5
|
||||
attack_verb = list("drilled")
|
||||
|
||||
|
||||
/obj/item/scalpel
|
||||
name = "scalpel"
|
||||
desc = "Cut, cut, and once more cut."
|
||||
icon = 'icons/obj/surgery.dmi'
|
||||
icon_state = "scalpel"
|
||||
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
|
||||
flags_1 = CONDUCT_1
|
||||
force = 10
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
throwforce = 5
|
||||
throw_speed = 3
|
||||
throw_range = 5
|
||||
materials = list(MAT_METAL=4000, MAT_GLASS=1000)
|
||||
item_flags = SURGICAL_TOOL
|
||||
attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
|
||||
hitsound = 'sound/weapons/bladeslice.ogg'
|
||||
sharpness = IS_SHARP_ACCURATE
|
||||
tool_behaviour = TOOL_SCALPEL
|
||||
toolspeed = 1
|
||||
|
||||
/obj/item/scalpel/Initialize()
|
||||
. = ..()
|
||||
AddComponent(/datum/component/butchering, 80 * toolspeed, 100, 0)
|
||||
|
||||
/obj/item/scalpel/advanced
|
||||
name = "laser scalpel"
|
||||
desc = "An advanced scalpel which uses laser technology to cut."
|
||||
icon = 'icons/obj/surgery.dmi'
|
||||
icon_state = "scalpel_a"
|
||||
hitsound = 'sound/weapons/blade1.ogg'
|
||||
force = 16
|
||||
toolspeed = 0.7
|
||||
light_color = LIGHT_COLOR_GREEN
|
||||
sharpness = IS_SHARP_ACCURATE
|
||||
|
||||
/obj/item/scalpel/advanced/Initialize()
|
||||
. = ..()
|
||||
set_light(1)
|
||||
|
||||
/obj/item/scalpel/advanced/attack_self(mob/user)
|
||||
playsound(get_turf(user), 'sound/machines/click.ogg', 50, TRUE)
|
||||
if(tool_behaviour == TOOL_SCALPEL)
|
||||
tool_behaviour = TOOL_SAW
|
||||
to_chat(user, "<span class='notice'>You increase the power of [src], now it can cut bones.</span>")
|
||||
set_light(2)
|
||||
force += 1 //we don't want to ruin sharpened stuff
|
||||
icon_state = "saw_a"
|
||||
else
|
||||
tool_behaviour = TOOL_SCALPEL
|
||||
to_chat(user, "<span class='notice'>You lower the power of [src], it can no longer cut bones.</span>")
|
||||
set_light(1)
|
||||
force -= 1
|
||||
icon_state = "scalpel_a"
|
||||
|
||||
/obj/item/scalpel/advanced/examine(mob/living/user)
|
||||
. = ..()
|
||||
. += "<span class = 'notice> It's set to [tool_behaviour == TOOL_SCALPEL ? "scalpel" : "saw"] mode. </span>"
|
||||
|
||||
/obj/item/scalpel/augment
|
||||
name = "scalpel"
|
||||
desc = "Ultra-sharp blade attached directly to your bone for extra-accuracy."
|
||||
icon = 'icons/obj/surgery.dmi'
|
||||
icon_state = "scalpel"
|
||||
flags_1 = CONDUCT_1
|
||||
force = 10
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
throwforce = 5
|
||||
throw_speed = 3
|
||||
throw_range = 5
|
||||
materials = list(MAT_METAL=4000, MAT_GLASS=1000)
|
||||
attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
|
||||
toolspeed = 0.5
|
||||
hitsound = 'sound/weapons/bladeslice.ogg'
|
||||
sharpness = IS_SHARP_ACCURATE
|
||||
|
||||
/obj/item/scalpel/suicide_act(mob/user)
|
||||
user.visible_message("<span class='suicide'>[user] is slitting [user.p_their()] [pick("wrists", "throat", "stomach")] with [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
|
||||
return (BRUTELOSS)
|
||||
|
||||
|
||||
/obj/item/circular_saw
|
||||
name = "circular saw"
|
||||
desc = "For heavy duty cutting."
|
||||
icon = 'icons/obj/surgery.dmi'
|
||||
icon_state = "saw"
|
||||
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
|
||||
hitsound = 'sound/weapons/circsawhit.ogg'
|
||||
throwhitsound = 'sound/weapons/pierce.ogg'
|
||||
item_flags = SURGICAL_TOOL
|
||||
flags_1 = CONDUCT_1
|
||||
force = 15
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
throwforce = 9
|
||||
throw_speed = 2
|
||||
throw_range = 5
|
||||
materials = list(MAT_METAL=10000, MAT_GLASS=6000)
|
||||
attack_verb = list("attacked", "slashed", "sawed", "cut")
|
||||
sharpness = IS_SHARP
|
||||
tool_behaviour = TOOL_SAW
|
||||
toolspeed = 1
|
||||
|
||||
/obj/item/circular_saw/Initialize()
|
||||
. = ..()
|
||||
AddComponent(/datum/component/butchering, 40 * toolspeed, 100, 5, 'sound/weapons/circsawhit.ogg') //saws are very accurate and fast at butchering
|
||||
|
||||
|
||||
/obj/item/circular_saw/augment
|
||||
name = "circular saw"
|
||||
desc = "A small but very fast spinning saw. Edges dulled to prevent accidental cutting inside of the surgeon."
|
||||
icon = 'icons/obj/surgery.dmi'
|
||||
icon_state = "saw"
|
||||
hitsound = 'sound/weapons/circsawhit.ogg'
|
||||
throwhitsound = 'sound/weapons/pierce.ogg'
|
||||
flags_1 = CONDUCT_1
|
||||
force = 10
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
throwforce = 9
|
||||
throw_speed = 2
|
||||
throw_range = 5
|
||||
materials = list(MAT_METAL=10000, MAT_GLASS=6000)
|
||||
toolspeed = 0.5
|
||||
attack_verb = list("attacked", "slashed", "sawed", "cut")
|
||||
sharpness = IS_SHARP
|
||||
|
||||
/obj/item/surgical_drapes
|
||||
name = "surgical drapes"
|
||||
desc = "Nanotrasen brand surgical drapes provide optimal safety and infection control."
|
||||
icon = 'icons/obj/surgery.dmi'
|
||||
icon_state = "surgical_drapes"
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
attack_verb = list("slapped")
|
||||
|
||||
/obj/item/surgical_drapes/attack(mob/living/M, mob/user)
|
||||
if(!attempt_initiate_surgery(src, M, user))
|
||||
..()
|
||||
|
||||
/obj/item/organ_storage //allows medical cyborgs to manipulate organs without hands
|
||||
name = "organ storage bag"
|
||||
desc = "A container for holding body parts."
|
||||
icon = 'icons/obj/storage.dmi'
|
||||
icon_state = "evidenceobj"
|
||||
item_flags = SURGICAL_TOOL
|
||||
|
||||
/obj/item/organ_storage/afterattack(obj/item/I, mob/user, proximity)
|
||||
. = ..()
|
||||
if(!proximity)
|
||||
return
|
||||
if(contents.len)
|
||||
to_chat(user, "<span class='notice'>[src] already has something inside it.</span>")
|
||||
return
|
||||
if(!isorgan(I) && !isbodypart(I))
|
||||
to_chat(user, "<span class='notice'>[src] can only hold body parts!</span>")
|
||||
return
|
||||
|
||||
user.visible_message("[user] puts [I] into [src].", "<span class='notice'>You put [I] inside [src].</span>")
|
||||
icon_state = "evidence"
|
||||
var/xx = I.pixel_x
|
||||
var/yy = I.pixel_y
|
||||
I.pixel_x = 0
|
||||
I.pixel_y = 0
|
||||
var/image/img = image("icon"=I, "layer"=FLOAT_LAYER)
|
||||
img.plane = FLOAT_PLANE
|
||||
I.pixel_x = xx
|
||||
I.pixel_y = yy
|
||||
add_overlay(img)
|
||||
add_overlay("evidence")
|
||||
desc = "An organ storage container holding [I]."
|
||||
I.forceMove(src)
|
||||
w_class = I.w_class
|
||||
|
||||
/obj/item/organ_storage/attack_self(mob/user)
|
||||
if(contents.len)
|
||||
var/obj/item/I = contents[1]
|
||||
user.visible_message("[user] dumps [I] from [src].", "<span class='notice'>You dump [I] from [src].</span>")
|
||||
cut_overlays()
|
||||
I.forceMove(get_turf(src))
|
||||
icon_state = "evidenceobj"
|
||||
desc = "A container for holding body parts."
|
||||
else
|
||||
to_chat(user, "[src] is empty.")
|
||||
return
|
||||
|
||||
/obj/item/surgical_processor //allows medical cyborgs to scan and initiate advanced surgeries
|
||||
name = "\improper Surgical Processor"
|
||||
desc = "A device for scanning and initiating surgeries from a disk or operating computer."
|
||||
icon = 'icons/obj/device.dmi'
|
||||
icon_state = "spectrometer"
|
||||
item_flags = NOBLUDGEON
|
||||
var/list/advanced_surgeries = list()
|
||||
|
||||
/obj/item/surgical_processor/afterattack(obj/item/O, mob/user, proximity)
|
||||
. = ..()
|
||||
if(!proximity)
|
||||
return
|
||||
if(istype(O, /obj/item/disk/surgery))
|
||||
to_chat(user, "<span class='notice'>You load the surgery protocol from [O] into [src].</span>")
|
||||
var/obj/item/disk/surgery/D = O
|
||||
if(do_after(user, 10, target = O))
|
||||
advanced_surgeries |= D.surgeries
|
||||
return TRUE
|
||||
if(istype(O, /obj/machinery/computer/operating))
|
||||
to_chat(user, "<span class='notice'>You copy surgery protocols from [O] into [src].</span>")
|
||||
var/obj/machinery/computer/operating/OC = O
|
||||
if(do_after(user, 10, target = O))
|
||||
advanced_surgeries |= OC.advanced_surgeries
|
||||
return TRUE
|
||||
return
|
||||
/obj/item/retractor
|
||||
name = "retractor"
|
||||
desc = "Retracts stuff."
|
||||
icon = 'icons/obj/surgery.dmi'
|
||||
icon_state = "retractor"
|
||||
materials = list(MAT_METAL=6000, MAT_GLASS=3000)
|
||||
item_flags = SURGICAL_TOOL
|
||||
flags_1 = CONDUCT_1
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
tool_behaviour = TOOL_RETRACTOR
|
||||
toolspeed = 1
|
||||
|
||||
/obj/item/retractor/advanced
|
||||
name = "mechanical pinches"
|
||||
desc = "An agglomerate of rods and gears."
|
||||
icon = 'icons/obj/surgery.dmi'
|
||||
icon_state = "retractor_a"
|
||||
toolspeed = 0.7
|
||||
|
||||
/obj/item/retractor/advanced/attack_self(mob/user)
|
||||
playsound(get_turf(user), 'sound/items/change_drill.ogg', 50, TRUE)
|
||||
if(tool_behaviour == TOOL_RETRACTOR)
|
||||
tool_behaviour = TOOL_HEMOSTAT
|
||||
to_chat(user, "<span class='notice'>You configure the gears of [src], they are now in hemostat mode.</span>")
|
||||
icon_state = "hemostat_a"
|
||||
else
|
||||
tool_behaviour = TOOL_RETRACTOR
|
||||
to_chat(user, "<span class='notice'>You configure the gears of [src], they are now in retractor mode.</span>")
|
||||
icon_state = "retractor_a"
|
||||
|
||||
/obj/item/retractor/advanced/examine(mob/living/user)
|
||||
. = ..()
|
||||
. += "<span class = 'notice> It resembles a [tool_behaviour == TOOL_RETRACTOR ? "retractor" : "hemostat"]. </span>"
|
||||
|
||||
/obj/item/retractor/augment
|
||||
name = "retractor"
|
||||
desc = "Micro-mechanical manipulator for retracting stuff."
|
||||
icon = 'icons/obj/surgery.dmi'
|
||||
icon_state = "retractor"
|
||||
materials = list(MAT_METAL=6000, MAT_GLASS=3000)
|
||||
flags_1 = CONDUCT_1
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
toolspeed = 0.5
|
||||
|
||||
/obj/item/hemostat
|
||||
name = "hemostat"
|
||||
desc = "You think you have seen this before."
|
||||
icon = 'icons/obj/surgery.dmi'
|
||||
icon_state = "hemostat"
|
||||
materials = list(MAT_METAL=5000, MAT_GLASS=2500)
|
||||
item_flags = SURGICAL_TOOL
|
||||
flags_1 = CONDUCT_1
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
attack_verb = list("attacked", "pinched")
|
||||
tool_behaviour = TOOL_HEMOSTAT
|
||||
toolspeed = 1
|
||||
|
||||
/obj/item/hemostat/augment
|
||||
name = "hemostat"
|
||||
desc = "Tiny servos power a pair of pincers to stop bleeding."
|
||||
icon = 'icons/obj/surgery.dmi'
|
||||
icon_state = "hemostat"
|
||||
materials = list(MAT_METAL=5000, MAT_GLASS=2500)
|
||||
flags_1 = CONDUCT_1
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
toolspeed = 0.5
|
||||
attack_verb = list("attacked", "pinched")
|
||||
|
||||
|
||||
/obj/item/cautery
|
||||
name = "cautery"
|
||||
desc = "This stops bleeding."
|
||||
icon = 'icons/obj/surgery.dmi'
|
||||
icon_state = "cautery"
|
||||
materials = list(MAT_METAL=2500, MAT_GLASS=750)
|
||||
item_flags = SURGICAL_TOOL
|
||||
flags_1 = CONDUCT_1
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
attack_verb = list("burnt")
|
||||
tool_behaviour = TOOL_CAUTERY
|
||||
toolspeed = 1
|
||||
|
||||
/obj/item/cautery/augment
|
||||
name = "cautery"
|
||||
desc = "A heated element that cauterizes wounds."
|
||||
icon = 'icons/obj/surgery.dmi'
|
||||
icon_state = "cautery"
|
||||
materials = list(MAT_METAL=2500, MAT_GLASS=750)
|
||||
flags_1 = CONDUCT_1
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
toolspeed = 0.5
|
||||
attack_verb = list("burnt")
|
||||
|
||||
|
||||
/obj/item/surgicaldrill
|
||||
name = "surgical drill"
|
||||
desc = "You can drill using this item. You dig?"
|
||||
icon = 'icons/obj/surgery.dmi'
|
||||
icon_state = "drill"
|
||||
lefthand_file = 'icons/mob/inhands/equipment/tools_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi'
|
||||
hitsound = 'sound/weapons/circsawhit.ogg'
|
||||
materials = list(MAT_METAL=10000, MAT_GLASS=6000)
|
||||
item_flags = SURGICAL_TOOL
|
||||
flags_1 = CONDUCT_1
|
||||
force = 15
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
attack_verb = list("drilled")
|
||||
tool_behaviour = TOOL_DRILL
|
||||
toolspeed = 1
|
||||
|
||||
/obj/item/surgicaldrill/advanced
|
||||
name = "searing tool"
|
||||
desc = "It projects a high power laser used for medical application."
|
||||
icon = 'icons/obj/surgery.dmi'
|
||||
icon_state = "surgicaldrill_a"
|
||||
hitsound = 'sound/items/welder.ogg'
|
||||
|
||||
/obj/item/surgicaldrill/advanced/Initialize()
|
||||
. = ..()
|
||||
set_light(1)
|
||||
|
||||
/obj/item/surgicaldrill/advanced/attack_self(mob/user)
|
||||
playsound(get_turf(user), 'sound/weapons/tap.ogg', 50, TRUE)
|
||||
if(tool_behaviour == TOOL_DRILL)
|
||||
tool_behaviour = TOOL_CAUTERY
|
||||
to_chat(user, "<span class='notice'>You focus the lenses of [src], it is now in mending mode.</span>")
|
||||
icon_state = "cautery_a"
|
||||
else
|
||||
tool_behaviour = TOOL_DRILL
|
||||
to_chat(user, "<span class='notice'>You dilate the lenses of [src], it is now in drilling mode.</span>")
|
||||
icon_state = "surgicaldrill_a"
|
||||
|
||||
/obj/item/surgicaldrill/advanced/examine(mob/living/user)
|
||||
. = ..()
|
||||
. += "<span class = 'notice> It's set to [tool_behaviour == TOOL_DRILL ? "drilling" : "mending"] mode.</span>"
|
||||
|
||||
/obj/item/surgicaldrill/augment
|
||||
name = "surgical drill"
|
||||
desc = "Effectively a small power drill contained within your arm, edges dulled to prevent tissue damage. May or may not pierce the heavens."
|
||||
icon = 'icons/obj/surgery.dmi'
|
||||
icon_state = "drill"
|
||||
hitsound = 'sound/weapons/circsawhit.ogg'
|
||||
materials = list(MAT_METAL=10000, MAT_GLASS=6000)
|
||||
flags_1 = CONDUCT_1
|
||||
force = 10
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
toolspeed = 0.5
|
||||
attack_verb = list("drilled")
|
||||
|
||||
|
||||
/obj/item/scalpel
|
||||
name = "scalpel"
|
||||
desc = "Cut, cut, and once more cut."
|
||||
icon = 'icons/obj/surgery.dmi'
|
||||
icon_state = "scalpel"
|
||||
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
|
||||
flags_1 = CONDUCT_1
|
||||
force = 10
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
throwforce = 5
|
||||
throw_speed = 3
|
||||
throw_range = 5
|
||||
materials = list(MAT_METAL=4000, MAT_GLASS=1000)
|
||||
item_flags = SURGICAL_TOOL
|
||||
attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
|
||||
hitsound = 'sound/weapons/bladeslice.ogg'
|
||||
sharpness = IS_SHARP_ACCURATE
|
||||
tool_behaviour = TOOL_SCALPEL
|
||||
toolspeed = 1
|
||||
|
||||
/obj/item/scalpel/Initialize()
|
||||
. = ..()
|
||||
AddComponent(/datum/component/butchering, 80 * toolspeed, 100, 0)
|
||||
|
||||
/obj/item/scalpel/advanced
|
||||
name = "laser scalpel"
|
||||
desc = "An advanced scalpel which uses laser technology to cut."
|
||||
icon = 'icons/obj/surgery.dmi'
|
||||
icon_state = "scalpel_a"
|
||||
hitsound = 'sound/weapons/blade1.ogg'
|
||||
force = 16
|
||||
toolspeed = 0.7
|
||||
light_color = LIGHT_COLOR_GREEN
|
||||
sharpness = IS_SHARP_ACCURATE
|
||||
|
||||
/obj/item/scalpel/advanced/Initialize()
|
||||
. = ..()
|
||||
set_light(1)
|
||||
|
||||
/obj/item/scalpel/advanced/attack_self(mob/user)
|
||||
playsound(get_turf(user), 'sound/machines/click.ogg', 50, TRUE)
|
||||
if(tool_behaviour == TOOL_SCALPEL)
|
||||
tool_behaviour = TOOL_SAW
|
||||
to_chat(user, "<span class='notice'>You increase the power of [src], now it can cut bones.</span>")
|
||||
set_light(2)
|
||||
force += 1 //we don't want to ruin sharpened stuff
|
||||
icon_state = "saw_a"
|
||||
else
|
||||
tool_behaviour = TOOL_SCALPEL
|
||||
to_chat(user, "<span class='notice'>You lower the power of [src], it can no longer cut bones.</span>")
|
||||
set_light(1)
|
||||
force -= 1
|
||||
icon_state = "scalpel_a"
|
||||
|
||||
/obj/item/scalpel/advanced/examine(mob/living/user)
|
||||
. = ..()
|
||||
. += "<span class = 'notice> It's set to [tool_behaviour == TOOL_SCALPEL ? "scalpel" : "saw"] mode. </span>"
|
||||
|
||||
/obj/item/scalpel/augment
|
||||
name = "scalpel"
|
||||
desc = "Ultra-sharp blade attached directly to your bone for extra-accuracy."
|
||||
icon = 'icons/obj/surgery.dmi'
|
||||
icon_state = "scalpel"
|
||||
flags_1 = CONDUCT_1
|
||||
force = 10
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
throwforce = 5
|
||||
throw_speed = 3
|
||||
throw_range = 5
|
||||
materials = list(MAT_METAL=4000, MAT_GLASS=1000)
|
||||
attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
|
||||
toolspeed = 0.5
|
||||
hitsound = 'sound/weapons/bladeslice.ogg'
|
||||
sharpness = IS_SHARP_ACCURATE
|
||||
|
||||
/obj/item/scalpel/suicide_act(mob/user)
|
||||
user.visible_message("<span class='suicide'>[user] is slitting [user.p_their()] [pick("wrists", "throat", "stomach")] with [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
|
||||
return (BRUTELOSS)
|
||||
|
||||
|
||||
/obj/item/circular_saw
|
||||
name = "circular saw"
|
||||
desc = "For heavy duty cutting."
|
||||
icon = 'icons/obj/surgery.dmi'
|
||||
icon_state = "saw"
|
||||
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
|
||||
hitsound = 'sound/weapons/circsawhit.ogg'
|
||||
throwhitsound = 'sound/weapons/pierce.ogg'
|
||||
item_flags = SURGICAL_TOOL
|
||||
flags_1 = CONDUCT_1
|
||||
force = 15
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
throwforce = 9
|
||||
throw_speed = 2
|
||||
throw_range = 5
|
||||
materials = list(MAT_METAL=10000, MAT_GLASS=6000)
|
||||
attack_verb = list("attacked", "slashed", "sawed", "cut")
|
||||
sharpness = IS_SHARP
|
||||
tool_behaviour = TOOL_SAW
|
||||
toolspeed = 1
|
||||
|
||||
/obj/item/circular_saw/Initialize()
|
||||
. = ..()
|
||||
AddComponent(/datum/component/butchering, 40 * toolspeed, 100, 5, 'sound/weapons/circsawhit.ogg') //saws are very accurate and fast at butchering
|
||||
|
||||
|
||||
/obj/item/circular_saw/augment
|
||||
name = "circular saw"
|
||||
desc = "A small but very fast spinning saw. Edges dulled to prevent accidental cutting inside of the surgeon."
|
||||
icon = 'icons/obj/surgery.dmi'
|
||||
icon_state = "saw"
|
||||
hitsound = 'sound/weapons/circsawhit.ogg'
|
||||
throwhitsound = 'sound/weapons/pierce.ogg'
|
||||
flags_1 = CONDUCT_1
|
||||
force = 10
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
throwforce = 9
|
||||
throw_speed = 2
|
||||
throw_range = 5
|
||||
materials = list(MAT_METAL=10000, MAT_GLASS=6000)
|
||||
toolspeed = 0.5
|
||||
attack_verb = list("attacked", "slashed", "sawed", "cut")
|
||||
sharpness = IS_SHARP
|
||||
|
||||
/obj/item/surgical_drapes
|
||||
name = "surgical drapes"
|
||||
desc = "Nanotrasen brand surgical drapes provide optimal safety and infection control."
|
||||
icon = 'icons/obj/surgery.dmi'
|
||||
icon_state = "surgical_drapes"
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
attack_verb = list("slapped")
|
||||
|
||||
/obj/item/surgical_drapes/attack(mob/living/M, mob/user)
|
||||
if(!attempt_initiate_surgery(src, M, user))
|
||||
..()
|
||||
|
||||
/obj/item/organ_storage //allows medical cyborgs to manipulate organs without hands
|
||||
name = "organ storage bag"
|
||||
desc = "A container for holding body parts."
|
||||
icon = 'icons/obj/storage.dmi'
|
||||
icon_state = "evidenceobj"
|
||||
item_flags = SURGICAL_TOOL
|
||||
|
||||
/obj/item/organ_storage/afterattack(obj/item/I, mob/user, proximity)
|
||||
. = ..()
|
||||
if(!proximity)
|
||||
return
|
||||
if(contents.len)
|
||||
to_chat(user, "<span class='notice'>[src] already has something inside it.</span>")
|
||||
return
|
||||
if(!isorgan(I) && !isbodypart(I))
|
||||
to_chat(user, "<span class='notice'>[src] can only hold body parts!</span>")
|
||||
return
|
||||
|
||||
user.visible_message("[user] puts [I] into [src].", "<span class='notice'>You put [I] inside [src].</span>")
|
||||
icon_state = "evidence"
|
||||
var/xx = I.pixel_x
|
||||
var/yy = I.pixel_y
|
||||
I.pixel_x = 0
|
||||
I.pixel_y = 0
|
||||
var/image/img = image("icon"=I, "layer"=FLOAT_LAYER)
|
||||
img.plane = FLOAT_PLANE
|
||||
I.pixel_x = xx
|
||||
I.pixel_y = yy
|
||||
add_overlay(img)
|
||||
add_overlay("evidence")
|
||||
desc = "An organ storage container holding [I]."
|
||||
I.forceMove(src)
|
||||
w_class = I.w_class
|
||||
|
||||
/obj/item/organ_storage/attack_self(mob/user)
|
||||
if(contents.len)
|
||||
var/obj/item/I = contents[1]
|
||||
user.visible_message("[user] dumps [I] from [src].", "<span class='notice'>You dump [I] from [src].</span>")
|
||||
cut_overlays()
|
||||
I.forceMove(get_turf(src))
|
||||
icon_state = "evidenceobj"
|
||||
desc = "A container for holding body parts."
|
||||
else
|
||||
to_chat(user, "[src] is empty.")
|
||||
return
|
||||
|
||||
/obj/item/surgical_processor //allows medical cyborgs to scan and initiate advanced surgeries
|
||||
name = "\improper Surgical Processor"
|
||||
desc = "A device for scanning and initiating surgeries from a disk or operating computer."
|
||||
icon = 'icons/obj/device.dmi'
|
||||
icon_state = "spectrometer"
|
||||
item_flags = NOBLUDGEON
|
||||
var/list/advanced_surgeries = list()
|
||||
|
||||
/obj/item/surgical_processor/afterattack(obj/item/O, mob/user, proximity)
|
||||
. = ..()
|
||||
if(!proximity)
|
||||
return
|
||||
if(istype(O, /obj/item/disk/surgery))
|
||||
to_chat(user, "<span class='notice'>You load the surgery protocol from [O] into [src].</span>")
|
||||
var/obj/item/disk/surgery/D = O
|
||||
if(do_after(user, 10, target = O))
|
||||
advanced_surgeries |= D.surgeries
|
||||
return TRUE
|
||||
if(istype(O, /obj/machinery/computer/operating))
|
||||
to_chat(user, "<span class='notice'>You copy surgery protocols from [O] into [src].</span>")
|
||||
var/obj/machinery/computer/operating/OC = O
|
||||
if(do_after(user, 10, target = O))
|
||||
advanced_surgeries |= OC.advanced_surgeries
|
||||
return TRUE
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user