From e556c9e06a6f5109ad1b476f6af00fac0224c01c Mon Sep 17 00:00:00 2001 From: jack-fractal Date: Fri, 14 Aug 2015 15:59:08 -0400 Subject: [PATCH 1/3] Click and Drag for Medical Machinery This changelist allows people to click and drag nearby people into medical machinery. This does not affect the ability to grab and click. This is an enhancement. --- code/__HELPERS/mobs.dm | 46 ++++ code/game/dna/dna_modifier.dm | 14 + code/game/machinery/Sleeper.dm | 490 +++++++++++++++++---------------- code/game/machinery/adv_med.dm | 19 +- code/game/machinery/cryo.dm | 14 + code/game/machinery/cryopod.dm | 72 ++++- 6 files changed, 420 insertions(+), 235 deletions(-) diff --git a/code/__HELPERS/mobs.dm b/code/__HELPERS/mobs.dm index 454206da..ced0307d 100644 --- a/code/__HELPERS/mobs.dm +++ b/code/__HELPERS/mobs.dm @@ -97,3 +97,49 @@ proc/RoundHealth(health) else return "health-100" return "0" + + +/proc/this_guy_is_allowed_to_drag_that_guy_into_something(atom/movable/target as mob|obj, mob/user as mob, obj/target_object as obj) + if(istype(target, /obj/screen)) //fix for HUD elements making their way into the world - Pete + return + if(target.loc == user) //no you can't pull things out of your ass + return + if(user.restrained() || user.stat || user.weakened || user.stunned || user.paralysis || user.resting) //are you cuffed, dying, lying, stunned or other + return + if(get_dist(user, target_object) > 1 || get_dist(user, target) > 1 || user.contents.Find(target_object)) // is the mob anchored, too far away from you, or are you too far away from the source + return + if(!ismob(target)) //mobs only + return + if(!ishuman(user) && !isrobot(user)) //No ghosts or mice putting people into the sleeper + return + if(user.loc==null) // just in case someone manages to get a closet into the blue light dimension, as unlikely as that seems + return + if(!istype(user.loc, /turf) || !istype(target.loc, /turf)) // are you in a container/closet/pod/etc? + return + var/mob/living/L = target + if(!istype(L) || L.buckled) + return + return TRUE + + +/proc/this_is_an_animal_or_a_robot(atom/movable/target as mob|obj) + return (istype(target, /mob/living/simple_animal) || istype(target, /mob/living/silicon)) + + +/proc/allowed_to_add_this_person_to_a_medical_machine(atom/movable/target as mob|obj, mob/user as mob, obj/target_object as obj, var/occupant) + if(!this_guy_is_allowed_to_drag_that_guy_into_something(target,user,target_object)) + return + if(this_is_an_animal_or_a_robot(target)) + return + if(occupant) + user << "\blue The [target_object] is already occupied!" + return + var/mob/living/L = target + if(L.abiotic()) + user << "\red Subject cannot have abiotic items on." + return + for(var/mob/living/carbon/slime/M in range(1,L)) + if(M.Victim == L) + usr << "\red [L.name] will not fit into the [target_object] because they have a slime latched onto their head." + return + return TRUE \ No newline at end of file diff --git a/code/game/dna/dna_modifier.dm b/code/game/dna/dna_modifier.dm index 2f7a2797..4f8e0846 100644 --- a/code/game/dna/dna_modifier.dm +++ b/code/game/dna/dna_modifier.dm @@ -120,6 +120,19 @@ src.add_fingerprint(usr) return + +/obj/machinery/dna_scannernew/MouseDrop_T(atom/movable/O as mob|obj, mob/user as mob) + if(!allowed_to_add_this_person_to_a_medical_machine(O,user,src,occupant)) + return + var/mob/living/L = O + if(L == user) + return + visible_message("[user] puts [L.name] into the DNA Scanner.", 3) + put_in(L) + if(user.pulling == L) + user.pulling = null + + /obj/machinery/dna_scannernew/attackby(var/obj/item/weapon/item as obj, var/mob/user as mob) if(istype(item, /obj/item/weapon/reagent_containers/glass)) if(beaker) @@ -829,4 +842,5 @@ return 1 + /////////////////////////// DNA MACHINES diff --git a/code/game/machinery/Sleeper.dm b/code/game/machinery/Sleeper.dm index b74f9604..d2a7d0e2 100644 --- a/code/game/machinery/Sleeper.dm +++ b/code/game/machinery/Sleeper.dm @@ -171,268 +171,298 @@ idle_power_usage = 15 active_power_usage = 200 //builtin health analyzer, dialysis machine, injectors. - New() - ..() - beaker = new /obj/item/weapon/reagent_containers/glass/beaker/large() - spawn( 5 ) - if(orient == "RIGHT") - icon_state = "sleeper_0-r" - return +/obj/machinery/sleeper/New() + ..() + beaker = new /obj/item/weapon/reagent_containers/glass/beaker/large() + spawn( 5 ) + if(orient == "RIGHT") + icon_state = "sleeper_0-r" + return + return + + +/obj/machinery/sleeper/allow_drop() + return 0 + + +/obj/machinery/sleeper/process() + if (stat & (NOPOWER|BROKEN)) return - - allow_drop() - return 0 - - - process() - if (stat & (NOPOWER|BROKEN)) - return - - if(filtering > 0) - if(beaker) - if(beaker.reagents.total_volume < beaker.reagents.maximum_volume) + if(filtering > 0) + if(beaker) + if(beaker.reagents.total_volume < beaker.reagents.maximum_volume) + src.occupant.vessel.trans_to(beaker, 1) + for(var/datum/reagent/x in src.occupant.reagents.reagent_list) + src.occupant.reagents.trans_to(beaker, 3) src.occupant.vessel.trans_to(beaker, 1) - for(var/datum/reagent/x in src.occupant.reagents.reagent_list) - src.occupant.reagents.trans_to(beaker, 3) - src.occupant.vessel.trans_to(beaker, 1) - src.updateUsrDialog() - return + src.updateUsrDialog() + return - blob_act() - if(prob(75)) - for(var/atom/movable/A as mob|obj in src) - A.loc = src.loc - A.blob_act() - del(src) - return +/obj/machinery/sleeper/blob_act() + if(prob(75)) + for(var/atom/movable/A as mob|obj in src) + A.loc = src.loc + A.blob_act() + del(src) + return - attackby(var/obj/item/weapon/G as obj, var/mob/user as mob) - if(istype(G, /obj/item/weapon/reagent_containers/glass)) - if(!beaker) - beaker = G - user.drop_item() - G.loc = src - user.visible_message("[user] adds \a [G] to \the [src]!", "You add \a [G] to \the [src]!") - src.updateUsrDialog() - return - else - user << "\red The sleeper has a beaker already." +/obj/machinery/sleeper/attackby(var/obj/item/weapon/G as obj, var/mob/user as mob) + if(istype(G, /obj/item/weapon/reagent_containers/glass)) + if(!beaker) + beaker = G + user.drop_item() + G.loc = src + user.visible_message("[user] adds \a [G] to \the [src]!", "You add \a [G] to \the [src]!") + src.updateUsrDialog() + return + else + user << "\red The sleeper has a beaker already." + return + + else if(istype(G, /obj/item/weapon/grab)) + if(!ismob(G:affecting)) + return + + if(src.occupant) + user << "\blue The sleeper is already occupied!" + return + + for(var/mob/living/carbon/slime/M in range(1,G:affecting)) + if(M.Victim == G:affecting) + usr << "[G:affecting.name] will not fit into the sleeper because they have a slime latched onto their head." return - else if(istype(G, /obj/item/weapon/grab)) - if(!ismob(G:affecting)) - return + visible_message("[user] starts putting [G:affecting:name] into the sleeper.", 3) + if(do_after(user, 20)) if(src.occupant) user << "\blue The sleeper is already occupied!" return + if(!G || !G:affecting) return + var/mob/M = G:affecting + if(M.client) + M.client.perspective = EYE_PERSPECTIVE + M.client.eye = src + M.loc = src + update_use_power(2) + src.occupant = M + src.icon_state = "sleeper_1" + if(orient == "RIGHT") + icon_state = "sleeper_1-r" - for(var/mob/living/carbon/slime/M in range(1,G:affecting)) - if(M.Victim == G:affecting) - usr << "[G:affecting.name] will not fit into the sleeper because they have a slime latched onto their head." - return - - visible_message("[user] starts putting [G:affecting:name] into the sleeper.", 3) - - if(do_after(user, 20)) - if(src.occupant) - user << "\blue The sleeper is already occupied!" - return - if(!G || !G:affecting) return - var/mob/M = G:affecting - if(M.client) - M.client.perspective = EYE_PERSPECTIVE - M.client.eye = src - M.loc = src - update_use_power(2) - src.occupant = M - src.icon_state = "sleeper_1" - if(orient == "RIGHT") - icon_state = "sleeper_1-r" - - src.add_fingerprint(user) - del(G) - return + src.add_fingerprint(user) + del(G) return + return - ex_act(severity) - if(filtering) - toggle_filter() - switch(severity) - if(1.0) +/obj/machinery/sleeper/ex_act(severity) + if(filtering) + toggle_filter() + switch(severity) + if(1.0) + for(var/atom/movable/A as mob|obj in src) + A.loc = src.loc + ex_act(severity) + del(src) + return + if(2.0) + if(prob(50)) for(var/atom/movable/A as mob|obj in src) A.loc = src.loc ex_act(severity) del(src) return - if(2.0) - if(prob(50)) - for(var/atom/movable/A as mob|obj in src) - A.loc = src.loc - ex_act(severity) - del(src) - return - if(3.0) - if(prob(25)) - for(var/atom/movable/A as mob|obj in src) - A.loc = src.loc - ex_act(severity) - del(src) - return - return - emp_act(severity) - if(filtering) - toggle_filter() - if(stat & (BROKEN|NOPOWER)) - ..(severity) - return - if(occupant) - go_out() - ..(severity) - - alter_health(mob/living/M as mob) - if (M.health > 0) - if (M.getOxyLoss() >= 10) - var/amount = max(0.15, 1) - M.adjustOxyLoss(-amount) - else - M.adjustOxyLoss(-12) - M.updatehealth() - M.AdjustParalysis(-4) - M.AdjustWeakened(-4) - M.AdjustStunned(-4) - M.Paralyse(1) - M.Weaken(1) - M.Stun(1) - if (M:reagents.get_reagent_amount("inaprovaline") < 5) - M:reagents.add_reagent("inaprovaline", 5) - return - proc/toggle_filter() - if(!src.occupant) - filtering = 0 - return - if(filtering) - filtering = 0 - else - filtering = 1 - - proc/go_out() - if(filtering) - toggle_filter() - if(!src.occupant) - return - if(src.occupant.client) - src.occupant.client.eye = src.occupant.client.mob - src.occupant.client.perspective = MOB_PERSPECTIVE - src.occupant.loc = src.loc - src.occupant = null - update_use_power(1) - if(orient == "RIGHT") - icon_state = "sleeper_0-r" - return - - - proc/inject_chemical(mob/living/user as mob, chemical, amount) - if(src.occupant && src.occupant.reagents) - if(src.occupant.reagents.get_reagent_amount(chemical) + amount <= 20) - src.occupant.reagents.add_reagent(chemical, amount) - user << "Occupant now has [src.occupant.reagents.get_reagent_amount(chemical)] units of [available_chemicals[chemical]] in his/her bloodstream." + if(3.0) + if(prob(25)) + for(var/atom/movable/A as mob|obj in src) + A.loc = src.loc + ex_act(severity) + del(src) return - user << "There's no occupant in the sleeper or the subject has too many chemicals!" + return + +/obj/machinery/sleeper/emp_act(severity) + if(filtering) + toggle_filter() + if(stat & (BROKEN|NOPOWER)) + ..(severity) return + if(occupant) + go_out() + ..(severity) - - proc/check(mob/living/user as mob) - if(src.occupant) - user << text("\blue Occupant ([]) Statistics:", src.occupant) - var/t1 - switch(src.occupant.stat) - if(0.0) - t1 = "Conscious" - if(1.0) - t1 = "Unconscious" - if(2.0) - t1 = "*dead*" - else - user << text("[]\t Health %: [] ([])", (src.occupant.health > 50 ? "\blue " : "\red "), src.occupant.health, t1) - user << text("[]\t -Core Temperature: []°C ([]°F)
", (src.occupant.bodytemperature > 50 ? "" : ""), src.occupant.bodytemperature-T0C, src.occupant.bodytemperature*1.8-459.67) - user << text("[]\t -Brute Damage %: []", (src.occupant.getBruteLoss() < 60 ? "\blue " : "\red "), src.occupant.getBruteLoss()) - user << text("[]\t -Respiratory Damage %: []", (src.occupant.getOxyLoss() < 60 ? "\blue " : "\red "), src.occupant.getOxyLoss()) - user << text("[]\t -Toxin Content %: []", (src.occupant.getToxLoss() < 60 ? "\blue " : "\red "), src.occupant.getToxLoss()) - user << text("[]\t -Burn Severity %: []", (src.occupant.getFireLoss() < 60 ? "\blue " : "\red "), src.occupant.getFireLoss()) - user << "\blue Expected time till occupant can safely awake: (note: If health is below 20% these times are inaccurate)" - user << text("\blue \t [] second\s (if around 1 or 2 the sleeper is keeping them asleep.)", src.occupant.paralysis / 5) - if(src.beaker) - user << text("\blue \t Dialysis Output Beaker has [] of free space remaining.", src.beaker.reagents.maximum_volume - src.beaker.reagents.total_volume) - else - user << "\blue No Dialysis Output Beaker loaded." +/obj/machinery/sleeper/alter_health(mob/living/M as mob) + if (M.health > 0) + if (M.getOxyLoss() >= 10) + var/amount = max(0.15, 1) + M.adjustOxyLoss(-amount) else - user << "\blue There is no one inside!" + M.adjustOxyLoss(-12) + M.updatehealth() + M.AdjustParalysis(-4) + M.AdjustWeakened(-4) + M.AdjustStunned(-4) + M.Paralyse(1) + M.Weaken(1) + M.Stun(1) + if (M:reagents.get_reagent_amount("inaprovaline") < 5) + M:reagents.add_reagent("inaprovaline", 5) + return + +/obj/machinery/sleeper/proc/toggle_filter() + if(!src.occupant) + filtering = 0 + return + if(filtering) + filtering = 0 + else + filtering = 1 + +/obj/machinery/sleeper/proc/go_out() + if(filtering) + toggle_filter() + if(!src.occupant) + return + if(src.occupant.client) + src.occupant.client.eye = src.occupant.client.mob + src.occupant.client.perspective = MOB_PERSPECTIVE + src.occupant.loc = src.loc + src.occupant = null + update_use_power(1) + if(orient == "RIGHT") + icon_state = "sleeper_0-r" + return + + +/obj/machinery/sleeper/proc/inject_chemical(mob/living/user as mob, chemical, amount) + if(src.occupant && src.occupant.reagents) + if(src.occupant.reagents.get_reagent_amount(chemical) + amount <= 20) + src.occupant.reagents.add_reagent(chemical, amount) + user << "Occupant now has [src.occupant.reagents.get_reagent_amount(chemical)] units of [available_chemicals[chemical]] in his/her bloodstream." + return + user << "There's no occupant in the sleeper or the subject has too many chemicals!" + return + + +/obj/machinery/sleeper/proc/check(mob/living/user as mob) + if(src.occupant) + user << text("\blue Occupant ([]) Statistics:", src.occupant) + var/t1 + switch(src.occupant.stat) + if(0.0) + t1 = "Conscious" + if(1.0) + t1 = "Unconscious" + if(2.0) + t1 = "*dead*" + else + user << text("[]\t Health %: [] ([])", (src.occupant.health > 50 ? "\blue " : "\red "), src.occupant.health, t1) + user << text("[]\t -Core Temperature: []°C ([]°F)
", (src.occupant.bodytemperature > 50 ? "" : ""), src.occupant.bodytemperature-T0C, src.occupant.bodytemperature*1.8-459.67) + user << text("[]\t -Brute Damage %: []", (src.occupant.getBruteLoss() < 60 ? "\blue " : "\red "), src.occupant.getBruteLoss()) + user << text("[]\t -Respiratory Damage %: []", (src.occupant.getOxyLoss() < 60 ? "\blue " : "\red "), src.occupant.getOxyLoss()) + user << text("[]\t -Toxin Content %: []", (src.occupant.getToxLoss() < 60 ? "\blue " : "\red "), src.occupant.getToxLoss()) + user << text("[]\t -Burn Severity %: []", (src.occupant.getFireLoss() < 60 ? "\blue " : "\red "), src.occupant.getFireLoss()) + user << "\blue Expected time till occupant can safely awake: (note: If health is below 20% these times are inaccurate)" + user << text("\blue \t [] second\s (if around 1 or 2 the sleeper is keeping them asleep.)", src.occupant.paralysis / 5) + if(src.beaker) + user << text("\blue \t Dialysis Output Beaker has [] of free space remaining.", src.beaker.reagents.maximum_volume - src.beaker.reagents.total_volume) + else + user << "\blue No Dialysis Output Beaker loaded." + else + user << "\blue There is no one inside!" + return + + +/obj/machinery/sleeper/verb/eject() + set name = "Eject Sleeper" + set category = "Object" + set src in oview(1) + if(usr.stat != 0) + return + if(orient == "RIGHT") + icon_state = "sleeper_0-r" + src.icon_state = "sleeper_0" + src.go_out() + add_fingerprint(usr) + return + +/obj/machinery/sleeper/verb/remove_beaker() + set name = "Remove Beaker" + set category = "Object" + set src in oview(1) + if(usr.stat != 0) + return + if(beaker) + filtering = 0 + beaker.loc = usr.loc + beaker = null + add_fingerprint(usr) + return + +/obj/machinery/sleeper/verb/move_inside() + set name = "Enter Sleeper" + set category = "Object" + set src in oview(1) + + if(usr.stat != 0 || !(ishuman(usr) || ismonkey(usr))) return - - verb/eject() - set name = "Eject Sleeper" - set category = "Object" - set src in oview(1) - if(usr.stat != 0) - return - if(orient == "RIGHT") - icon_state = "sleeper_0-r" - src.icon_state = "sleeper_0" - src.go_out() - add_fingerprint(usr) + if(src.occupant) + usr << "\blue The sleeper is already occupied!" return - verb/remove_beaker() - set name = "Remove Beaker" - set category = "Object" - set src in oview(1) - if(usr.stat != 0) + for(var/mob/living/carbon/slime/M in range(1,usr)) + if(M.Victim == usr) + usr << "You're too busy getting your life sucked out of you." return - if(beaker) - filtering = 0 - beaker.loc = usr.loc - beaker = null - add_fingerprint(usr) - return - - verb/move_inside() - set name = "Enter Sleeper" - set category = "Object" - set src in oview(1) - - if(usr.stat != 0 || !(ishuman(usr) || ismonkey(usr))) - return - + visible_message("[usr] starts climbing into the sleeper.", 3) + if(do_after(usr, 20)) if(src.occupant) usr << "\blue The sleeper is already occupied!" return + usr.stop_pulling() + usr.client.perspective = EYE_PERSPECTIVE + usr.client.eye = src + usr.loc = src + update_use_power(2) + src.occupant = usr + src.icon_state = "sleeper_1" + if(orient == "RIGHT") + icon_state = "sleeper_1-r" - for(var/mob/living/carbon/slime/M in range(1,usr)) - if(M.Victim == usr) - usr << "You're too busy getting your life sucked out of you." - return - visible_message("[usr] starts climbing into the sleeper.", 3) - if(do_after(usr, 20)) - if(src.occupant) - usr << "\blue The sleeper is already occupied!" - return - usr.stop_pulling() - usr.client.perspective = EYE_PERSPECTIVE - usr.client.eye = src - usr.loc = src - update_use_power(2) - src.occupant = usr - src.icon_state = "sleeper_1" - if(orient == "RIGHT") - icon_state = "sleeper_1-r" - - for(var/obj/O in src) - del(O) - src.add_fingerprint(usr) - return + for(var/obj/O in src) + del(O) + src.add_fingerprint(usr) return + return + + +/obj/machinery/sleeper/MouseDrop_T(atom/movable/O as mob|obj, mob/user as mob) + if(!allowed_to_add_this_person_to_a_medical_machine(O,user,src,occupant)) + return + var/mob/living/L = O + if(L == user) + visible_message("[user] starts climbing into the sleeper.", 3) + else + visible_message("[user] starts putting [L.name] into the sleeper.", 3) + if(do_after(user, 20)) + if(src.occupant) + user << "\blue The sleeper is already occupied!" + return + if(!L) return + + if(L.client) + L.client.perspective = EYE_PERSPECTIVE + L.client.eye = src + L.loc = src + src.occupant = L + src.icon_state = (orient == "RIGHT") ? "sleeper_1-r" : "sleeper_1" + L << "\blue You feel cool air surround you. You go numb as your senses turn inward." + src.add_fingerprint(user) + if(user.pulling == L) + user.pulling = null + return + return \ No newline at end of file diff --git a/code/game/machinery/adv_med.dm b/code/game/machinery/adv_med.dm index 16b21a59..fc6d27e5 100644 --- a/code/game/machinery/adv_med.dm +++ b/code/game/machinery/adv_med.dm @@ -14,8 +14,23 @@ idle_power_usage = 60 active_power_usage = 10000 //10 kW. It's a big all-body scanner. -/*/obj/machinery/bodyscanner/allow_drop() - return 0*/ + +/obj/machinery/bodyscanner/MouseDrop_T(atom/movable/O as mob|obj, mob/user as mob) + if(!allowed_to_add_this_person_to_a_medical_machine(O,user,src,occupant)) + return + var/mob/living/L = O + if(L == user) + visible_message("[user] climbs into the body scanner.", 3) + else + visible_message("[user] puts [L.name] into the body scanner.", 3) + if (L.client) + L.client.perspective = EYE_PERSPECTIVE + L.client.eye = src + L.loc = src + src.occupant = L + src.icon_state = "body_scanner_1" + src.add_fingerprint(user) + return /obj/machinery/bodyscanner/relaymove(mob/user as mob) if (user.stat) diff --git a/code/game/machinery/cryo.dm b/code/game/machinery/cryo.dm index 32ecb748..2c54faed 100644 --- a/code/game/machinery/cryo.dm +++ b/code/game/machinery/cryo.dm @@ -32,6 +32,20 @@ node = target break + +/obj/machinery/atmospherics/unary/cryo_cell/MouseDrop_T(atom/movable/O as mob|obj, mob/user as mob) + if(!allowed_to_add_this_person_to_a_medical_machine(O,user,src,occupant)) + return + var/mob/living/L = O + if(put_mob(L)) + if(L == user) + visible_message("[user] climbs into the cryo cell.", 3) + else + visible_message("[user] puts [L.name] into the cryo cell.", 3) + if(user.pulling == L) + user.pulling = null + + /obj/machinery/atmospherics/unary/cryo_cell/process() ..() if(!node) diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm index 7143e381..766749e3 100644 --- a/code/game/machinery/cryopod.dm +++ b/code/game/machinery/cryopod.dm @@ -144,6 +144,7 @@ var/global/list/frozen_items = list() desc = "A man-sized pod for entering suspended animation." icon = 'icons/obj/Cryogenic2.dmi' icon_state = "body_scanner_0" + var/occupied_icon_state = "body_scanner_1" density = 1 anchored = 1 @@ -288,7 +289,6 @@ var/global/list/frozen_items = list() del(occupant) occupant = null - return @@ -327,9 +327,9 @@ var/global/list/frozen_items = list() M.client.eye = src if(orient_right) - icon_state = "body_scanner_1-r" + icon_state = "[occupied_icon_state]-r" else - icon_state = "body_scanner_1" + icon_state = occupied_icon_state M << "\blue You feel cool air surround you. You go numb as your senses turn inward." M << "\blue If you ghost, log out or close your client now, your character will shortly be permanently removed from the round." @@ -345,6 +345,72 @@ var/global/list/frozen_items = list() //Despawning occurs when process() is called with an occupant without a client. src.add_fingerprint(M) + + +/obj/machinery/cryopod/MouseDrop_T(atom/movable/O as mob|obj, mob/user as mob) + if(!allowed_to_add_this_person_to_a_medical_machine(O,user,src,occupant)) + return + + var/mob/living/L = O + + if(L.stat == DEAD) + user << "Dead people can not be put into cryo." + return + + for(var/mob/living/carbon/slime/M in range(1,L)) + if(M.Victim == L) + usr << "[L.name] will not fit into the cryo pod because they have a slime latched onto their head." + return + + var/willing = null //We don't want to allow people to be forced into despawning. + + if(L.client) + if(alert(L,"Would you like to enter cryosleep?",,"Yes","No") == "Yes") + if(!L) return + willing = 1 + else + willing = 1 + + if(willing) + if(L == user) + visible_message("[user] starts climbing into the cryo pod.", 3) + else + visible_message("[user] starts putting [L] into the cryo pod.", 3) + + if(do_after(user, 20)) + if(!L) return + + L.loc = src + + if(L.client) + L.client.perspective = EYE_PERSPECTIVE + L.client.eye = src + else + user << "You stop [L == user ? "climbing into the cryo pod." : "putting [L] into the cryo pod."]" + return + + if(orient_right) + icon_state = "[occupied_icon_state]-r" + else + icon_state = occupied_icon_state + + L << "\blue You feel cool air surround you. You go numb as your senses turn inward." + L << "\blue If you ghost, log out or close your client now, your character will shortly be permanently removed from the round." + occupant = L + time_entered = world.time + + // Book keeping! + var/turf/location = get_turf(src) + log_admin("[key_name_admin(L)] has entered a stasis pod.") + message_admins("\blue [key_name_admin(L)] has entered a stasis pod.(JMP)") + message_mods("\blue [key_name_admin(L)] has entered a stasis pod.(JMP)") + + //Despawning occurs when process() is called with an occupant without a client. + src.add_fingerprint(L) + + return + + /obj/machinery/cryopod/verb/eject() set name = "Eject Pod" From 83631a2c28e17cf03f995ec2981bfd87fa997911 Mon Sep 17 00:00:00 2001 From: jack-fractal Date: Fri, 14 Aug 2015 16:03:23 -0400 Subject: [PATCH 2/3] Lets robots use tables This allows for surgery. --- code/game/objects/structures/tables_racks.dm | 2 -- 1 file changed, 2 deletions(-) diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm index 8165a4eb..0ab09618 100644 --- a/code/game/objects/structures/tables_racks.dm +++ b/code/game/objects/structures/tables_racks.dm @@ -349,8 +349,6 @@ if ((!( istype(O, /obj/item/weapon) ) || user.get_active_hand() != O)) return ..() - if(isrobot(user)) - return user.drop_item() if (O.loc != src.loc) step(O, get_dir(O, src)) From 44b53851eff92c4aa94e6fbc3e5c5f8a8bbcae9b Mon Sep 17 00:00:00 2001 From: jack-fractal Date: Sat, 15 Aug 2015 16:17:42 -0400 Subject: [PATCH 3/3] Dones don't get to put people in or on things Poor drones. --- code/__HELPERS/mobs.dm | 2 ++ code/game/objects/structures/tables_racks.dm | 2 ++ 2 files changed, 4 insertions(+) diff --git a/code/__HELPERS/mobs.dm b/code/__HELPERS/mobs.dm index ced0307d..09aec188 100644 --- a/code/__HELPERS/mobs.dm +++ b/code/__HELPERS/mobs.dm @@ -112,6 +112,8 @@ proc/RoundHealth(health) return if(!ishuman(user) && !isrobot(user)) //No ghosts or mice putting people into the sleeper return + if(istype(user, /mob/living/silicon/robot/drone)) // drones don't get to use medical machinery + return if(user.loc==null) // just in case someone manages to get a closet into the blue light dimension, as unlikely as that seems return if(!istype(user.loc, /turf) || !istype(target.loc, /turf)) // are you in a container/closet/pod/etc? diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm index 0ab09618..ba841e52 100644 --- a/code/game/objects/structures/tables_racks.dm +++ b/code/game/objects/structures/tables_racks.dm @@ -349,6 +349,8 @@ if ((!( istype(O, /obj/item/weapon) ) || user.get_active_hand() != O)) return ..() + if(istype(user, /mob/living/silicon/robot/drone)) // drones don't get to table people + return ..() user.drop_item() if (O.loc != src.loc) step(O, get_dir(O, src))