Merge pull request #11033 from kevinz000/cmo_drapes

gives CMO special surgery drapes that can initiate techweb surgeries without operating console
This commit is contained in:
Ghom
2020-02-20 11:24:50 +01:00
committed by GitHub
20 changed files with 60 additions and 35 deletions

View File

@@ -2,7 +2,7 @@
name = "enhancement surgery"
var/bioware_target = BIOWARE_GENERIC
/datum/surgery/advanced/bioware/can_start(mob/user, mob/living/carbon/human/target)
/datum/surgery/advanced/bioware/can_start(mob/user, mob/living/carbon/human/target, obj/item/tool)
if(!..())
return FALSE
if(!istype(target))

View File

@@ -16,7 +16,7 @@
target_mobtypes = list(/mob/living/carbon/human)
possible_locs = list(BODY_ZONE_HEAD)
/datum/surgery/advanced/brainwashing/can_start(mob/user, mob/living/carbon/target)
/datum/surgery/advanced/brainwashing/can_start(mob/user, mob/living/carbon/target, obj/item/tool)
if(!..())
return FALSE
var/obj/item/organ/brain/B = target.getorganslot(ORGAN_SLOT_BRAIN)

View File

@@ -12,7 +12,7 @@
target_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey)
possible_locs = list(BODY_ZONE_HEAD)
requires_bodypart_type = 0
/datum/surgery/advanced/lobotomy/can_start(mob/user, mob/living/carbon/target)
/datum/surgery/advanced/lobotomy/can_start(mob/user, mob/living/carbon/target, obj/item/tool)
if(!..())
return FALSE
var/obj/item/organ/brain/B = target.getorganslot(ORGAN_SLOT_BRAIN)

View File

@@ -8,7 +8,7 @@
/datum/surgery_step/bionecrosis,
/datum/surgery_step/close)
possible_locs = list(BODY_ZONE_HEAD)
/datum/surgery/advanced/necrotic_revival/can_start(mob/user, mob/living/carbon/target)
/datum/surgery/advanced/necrotic_revival/can_start(mob/user, mob/living/carbon/target, obj/item/tool)
. = ..()
var/obj/item/organ/zombie_infection/ZI = target.getorganslot(ORGAN_SLOT_ZOMBIE)
if(ZI)

View File

@@ -11,7 +11,7 @@
target_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey)
possible_locs = list(BODY_ZONE_HEAD)
requires_bodypart_type = 0
/datum/surgery/advanced/pacify/can_start(mob/user, mob/living/carbon/target)
/datum/surgery/advanced/pacify/can_start(mob/user, mob/living/carbon/target, obj/item/tool)
. = ..()
var/obj/item/organ/brain/B = target.getorganslot(ORGAN_SLOT_BRAIN)
if(!B)

View File

@@ -12,7 +12,7 @@
target_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey)
possible_locs = list(BODY_ZONE_HEAD)
requires_bodypart_type = 0
/datum/surgery/advanced/revival/can_start(mob/user, mob/living/carbon/target)
/datum/surgery/advanced/revival/can_start(mob/user, mob/living/carbon/target, obj/item/tool)
if(!..())
return FALSE
if(target.stat != DEAD)

View File

@@ -10,7 +10,7 @@
target_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey)
possible_locs = list(BODY_ZONE_CHEST)
/datum/surgery/advanced/viral_bonding/can_start(mob/user, mob/living/carbon/target)
/datum/surgery/advanced/viral_bonding/can_start(mob/user, mob/living/carbon/target, obj/item/tool)
if(!..())
return FALSE
if(!LAZYLEN(target.diseases))

View File

@@ -15,7 +15,7 @@
name = "fix brain"
implements = list(TOOL_HEMOSTAT = 85, TOOL_SCREWDRIVER = 35, /obj/item/pen = 15) //don't worry, pouring some alcohol on their open brain will get that chance to 100
time = 120 //long and complicated
/datum/surgery/brain_surgery/can_start(mob/user, mob/living/carbon/target)
/datum/surgery/brain_surgery/can_start(mob/user, mob/living/carbon/target, obj/item/tool)
var/obj/item/organ/brain/B = target.getorganslot(ORGAN_SLOT_BRAIN)
if(!B)
return FALSE

View File

@@ -6,7 +6,7 @@
lying_required = FALSE
ignore_clothes = TRUE
/datum/surgery/core_removal/can_start(mob/user, mob/living/target)
/datum/surgery/core_removal/can_start(mob/user, mob/living/target, obj/item/tool)
if(target.stat == DEAD)
return 1
return 0

View File

@@ -4,7 +4,7 @@
/datum/surgery_step/incise_heart, /datum/surgery_step/coronary_bypass, /datum/surgery_step/close)
possible_locs = list(BODY_ZONE_CHEST)
/datum/surgery/coronary_bypass/can_start(mob/user, mob/living/carbon/target)
/datum/surgery/coronary_bypass/can_start(mob/user, mob/living/carbon/target, obj/item/tool)
var/obj/item/organ/heart/H = target.getorganslot(ORGAN_SLOT_HEART)
if(H)
if(H.damage > 60 && !H.operated)

View File

@@ -15,7 +15,7 @@
requires_tech = FALSE
var/value_multiplier = 1
/datum/surgery/advanced/experimental_dissection/can_start(mob/user, mob/living/target)
/datum/surgery/advanced/experimental_dissection/can_start(mob/user, mob/living/target, obj/item/tool)
. = ..()
if(HAS_TRAIT_FROM(target, TRAIT_DISSECTED,"[name]"))
return FALSE

View File

@@ -9,7 +9,7 @@
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)
/datum/surgery/eye_surgery/can_start(mob/user, mob/living/carbon/target, obj/item/tool)
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.")

View File

@@ -34,7 +34,7 @@
continue
if(S.lying_required && !(M.lying))
continue
if(!S.can_start(user, M))
if(!S.can_start(user, M, I))
continue
for(var/path in S.target_mobtypes)
if(istype(M, path))
@@ -64,7 +64,7 @@
return
if(S.lying_required && !(M.lying))
return
if(!S.can_start(user, M))
if(!S.can_start(user, M, I))
return
if(S.ignore_clothes || get_location_accessible(M, selected_zone))

View File

@@ -2,7 +2,7 @@
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)
/datum/surgery/lipoplasty/can_start(mob/user, mob/living/carbon/target, obj/item/tool)
if(HAS_TRAIT(target, TRAIT_FAT))
return 1
return 0

View File

@@ -4,7 +4,7 @@
/datum/surgery_step/lobectomy, /datum/surgery_step/close)
possible_locs = list(BODY_ZONE_CHEST)
/datum/surgery/lobectomy/can_start(mob/user, mob/living/carbon/target)
/datum/surgery/lobectomy/can_start(mob/user, mob/living/carbon/target, obj/item/tool)
var/obj/item/organ/lungs/L = target.getorganslot(ORGAN_SLOT_LUNGS)
if(L)
if(L.damage > 60 && !L.operated)

View File

@@ -5,7 +5,7 @@
possible_locs = list(BODY_ZONE_R_ARM, BODY_ZONE_L_ARM, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG, BODY_ZONE_HEAD)
requires_bodypart = FALSE //need a missing limb
requires_bodypart_type = 0
/datum/surgery/prosthetic_replacement/can_start(mob/user, mob/living/carbon/target)
/datum/surgery/prosthetic_replacement/can_start(mob/user, mob/living/carbon/target, obj/item/tool)
if(!iscarbon(target))
return 0
var/mob/living/carbon/C = target

View File

@@ -37,7 +37,7 @@
return ..()
/datum/surgery/proc/can_start(mob/user, mob/living/patient) //FALSE to not show in list
/datum/surgery/proc/can_start(mob/user, mob/living/patient, obj/item/tool) //FALSE to not show in list
. = TRUE
if(replaced_by == /datum/surgery)
return FALSE
@@ -55,27 +55,26 @@
if(requires_tech)
. = FALSE
var/list/advanced_surgeries = list()
if(iscyborg(user))
var/mob/living/silicon/robot/R = user
var/obj/item/surgical_processor/SP = locate() in R.module.modules
if(SP)
if (replaced_by in SP.advanced_surgeries)
return .
if(type in SP.advanced_surgeries)
return TRUE
advanced_surgeries |= SP.advanced_surgeries
var/turf/T = get_turf(patient)
var/obj/structure/table/optable/table = locate(/obj/structure/table/optable, T)
if(table)
if(!table.computer)
return .
if(table.computer.stat & (NOPOWER|BROKEN))
return .
if(replaced_by in table.computer.advanced_surgeries)
return FALSE
if(type in table.computer.advanced_surgeries)
return TRUE
if(table?.computer && !CHECK_BITFIELD(table.computer.stat, NOPOWER|BROKEN))
advanced_surgeries |= table.computer.advanced_surgeries
if(istype(tool, /obj/item/surgical_drapes/advanced))
var/obj/item/surgical_drapes/advanced/A = tool
advanced_surgeries |= A.get_advanced_surgeries()
if(replaced_by in advanced_surgeries)
return FALSE
if(type in advanced_surgeries)
return TRUE
/datum/surgery/proc/next_step(mob/user, intent)
if(step_in_progress)

View File

@@ -287,6 +287,26 @@
if(!attempt_initiate_surgery(src, M, user))
..()
/obj/item/surgical_drapes/advanced
name = "smart surgical drapes"
desc = "A quite quirky set of drapes with wireless synchronization to the station's research networks, with an integrated display allowing users to execute advanced surgeries without the aid of an operating computer."
var/datum/techweb/linked_techweb
/obj/item/surgical_drapes/advanced/Initialize(mapload)
. = ..()
linked_techweb = SSresearch.science_tech
/obj/item/surgical_drapes/advanced/proc/get_advanced_surgeries()
. = list()
if(!linked_techweb)
return
for(var/subtype in subtypesof(/datum/design/surgery))
var/datum/design/surgery/prototype = subtype
var/id = initial(prototype.id)
if(id in linked_techweb.researched_designs)
prototype = SSresearch.techweb_design_by_id(id)
. |= prototype.surgery
/obj/item/organ_storage //allows medical cyborgs to manipulate organs without hands
name = "organ storage bag"
desc = "A container for holding body parts."