rej merges

This commit is contained in:
LetterJay
2017-05-12 23:57:11 -05:00
parent cc0a9b87fb
commit f5e8a7e4e4
2 changed files with 92 additions and 128 deletions
+15 -11
View File
@@ -311,16 +311,17 @@
to_chat(user, "<font color = #666633>-% Successfully stored \ref[P.buffer] [P.buffer.name] in buffer %-</font color>") to_chat(user, "<font color = #666633>-% Successfully stored \ref[P.buffer] [P.buffer.name] in buffer %-</font color>")
return return
var/mob/living/mob_occupant = occupant
if(W.GetID()) if(W.GetID())
if(!check_access(W)) if(!check_access(W))
to_chat(user, "<span class='danger'>Access Denied.</span>") to_chat(user, "<span class='danger'>Access Denied.</span>")
return return
if(!(occupant || mess)) if(!(mob_occupant || mess))
to_chat(user, "<span class='danger'>Error: Pod has no occupant.</span>") to_chat(user, "<span class='danger'>Error: Pod has no occupant.</span>")
return return
else else
connected_message("Authorized Ejection") connected_message("Authorized Ejection")
SPEAK("An authorized ejection of [occupant.real_name] has occurred.") SPEAK("An authorized ejection of [clonemind.name] has occurred.")
to_chat(user, "<span class='notice'>You force an emergency ejection. </span>") to_chat(user, "<span class='notice'>You force an emergency ejection. </span>")
go_out() go_out()
else else
@@ -377,24 +378,27 @@
SPEAK("Critical error! Please contact a Thinktronic Systems \ SPEAK("Critical error! Please contact a Thinktronic Systems \
technician, as your warranty may be affected.") technician, as your warranty may be affected.")
mess = TRUE mess = TRUE
for(var/obj/item/O in unattached_flesh)
qdel(O)
icon_state = "pod_g" icon_state = "pod_g"
if(occupant.mind != clonemind) if(mob_occupant.mind != clonemind)
clonemind.transfer_to(occupant) clonemind.transfer_to(mob_occupant)
occupant.grab_ghost() // We really just want to make you suffer. mob_occupant.grab_ghost() // We really just want to make you suffer.
flash_color(occupant, flash_color="#960000", flash_time=100) flash_color(mob_occupant, flash_color="#960000", flash_time=100)
to_chat(occupant, "<span class='warning'><b>Agony blazes across your consciousness as your body is torn apart.</b><br><i>Is this what dying is like? Yes it is.</i></span>") to_chat(mob_occupant, "<span class='warning'><b>Agony blazes across your consciousness as your body is torn apart.</b><br><i>Is this what dying is like? Yes it is.</i></span>")
playsound(src.loc, 'sound/machines/warning-buzzer.ogg', 50, 0) playsound(src.loc, 'sound/machines/warning-buzzer.ogg', 50, 0)
occupant << sound('sound/hallucinations/veryfar_noise.ogg',0,1,50) mob_occupant << sound('sound/hallucinations/veryfar_noise.ogg',0,1,50)
QDEL_IN(occupant, 40) QDEL_IN(mob_occupant, 40)
/obj/machinery/clonepod/relaymove(mob/user) /obj/machinery/clonepod/relaymove(mob/user)
if(user.stat == CONSCIOUS) if(user.stat == CONSCIOUS)
go_out() go_out()
/obj/machinery/clonepod/emp_act(severity) /obj/machinery/clonepod/emp_act(severity)
if(prob(100/(severity*efficiency))) var/mob/living/mob_occupant = occupant
if(mob_occupant && prob(100/(severity*efficiency)))
connected_message(Gibberish("EMP-caused Accidental Ejection", 0)) connected_message(Gibberish("EMP-caused Accidental Ejection", 0))
SPEAK(Gibberish("Exposure to electromagnetic fields has caused the ejection of [occupant.real_name] prematurely." ,0)) SPEAK(Gibberish("Exposure to electromagnetic fields has caused the ejection of [mob_occupant.real_name] prematurely." ,0))
go_out() go_out()
..() ..()
@@ -1,7 +1,7 @@
/obj/machinery/atmospherics/components/unary/cryo_cell /obj/machinery/atmospherics/components/unary/cryo_cell
name = "cryo cell" name = "cryo cell"
icon = 'icons/obj/cryogenics.dmi' icon = 'icons/obj/cryogenics.dmi'
icon_state = "pod0" icon_state = "cell-off"
density = 1 density = 1
anchored = 1 anchored = 1
obj_integrity = 350 obj_integrity = 350
@@ -12,7 +12,6 @@
state_open = FALSE state_open = FALSE
var/autoeject = FALSE var/autoeject = FALSE
var/volume = 100 var/volume = 100
var/running_bob_animation = FALSE
var/efficiency = 1 var/efficiency = 1
var/sleep_factor = 750 var/sleep_factor = 750
@@ -88,59 +87,17 @@
beaker = null beaker = null
/obj/machinery/atmospherics/components/unary/cryo_cell/update_icon() /obj/machinery/atmospherics/components/unary/cryo_cell/update_icon()
handle_update_icon()
/obj/machinery/atmospherics/components/unary/cryo_cell/proc/handle_update_icon() //making another proc to avoid spam in update_icon
overlays.Cut() //empty the overlay proc, just in case
if(panel_open) if(panel_open)
icon_state = "pod0-o" icon_state = "cell-o"
else if(state_open) else if(state_open)
icon_state = "pod0" icon_state = "cell-open"
else if(on && is_operational()) else if(on && is_operational())
if(occupant) if(occupant)
var/image/pickle = image(occupant.icon, occupant.icon_state) icon_state = "cell-occupied"
pickle.overlays = occupant.overlays
pickle.pixel_y = 22
overlays += pickle
icon_state = "pod1"
var/up = 0 //used to see if we are going up or down, 1 is down, 2 is up
spawn(0) // Without this, the icon update will block. The new thread will die once the occupant leaves.
running_bob_animation = TRUE
while(occupant)
overlays -= "lid1" //have to remove the overlays first, to force an update- remove cloning pod overlay
overlays -= pickle //remove mob overlay
switch(pickle.pixel_y) //this looks messy as fuck but it works, switch won't call itself twice
if(23) //inbetween state, for smoothness
switch(up) //this is set later in the switch, to keep track of where the mob is supposed to go
if(2) //2 is up
pickle.pixel_y = 24 //set to highest
if(1) //1 is down
pickle.pixel_y = 22 //set to lowest
if(22) //mob is at it's lowest
pickle.pixel_y = 23 //set to inbetween
up = 2 //have to go up
if(24) //mob is at it's highest
pickle.pixel_y = 23 //set to inbetween
up = 1 //have to go down
overlays += pickle //re-add the mob to the icon
overlays += "lid1" //re-add the overlay of the pod, they are inside it, not floating
sleep(7) //don't want to jiggle violently, just slowly bob
return
running_bob_animation = FALSE
else else
icon_state = "pod1" icon_state = "cell-on"
overlays += "lid0" //have to remove the overlays first, to force an update- remove cloning pod overlay
else else
icon_state = "pod0" icon_state = "cell-off"
overlays += "lid0" //if no occupant, just put the lid overlay on, and ignore the rest
/obj/machinery/atmospherics/components/unary/cryo_cell/process() /obj/machinery/atmospherics/components/unary/cryo_cell/process()
..() ..()
@@ -153,25 +110,26 @@
return return
var/datum/gas_mixture/air1 = AIR1 var/datum/gas_mixture/air1 = AIR1
var/turf/T = get_turf(src) var/turf/T = get_turf(src)
if(occupant) if(isliving(occupant))
if(occupant.health >= 100) // Don't bother with fully healed people. var/mob/living/mob_occupant
if(mob_occupant.health >= 100) // Don't bother with fully healed people.
on = FALSE on = FALSE
update_icon() update_icon()
playsound(T, 'sound/machines/cryo_warning.ogg', volume, 1) // Bug the doctors. playsound(T, 'sound/machines/cryo_warning.ogg', volume) // Bug the doctors.
radio.talk_into(src, "Patient fully restored", radio_channel) radio.talk_into(src, "Patient fully restored", radio_channel, get_spans(), get_default_language())
if(autoeject) // Eject if configured. if(autoeject) // Eject if configured.
radio.talk_into(src, "Auto ejecting patient now", radio_channel,get_spans(), get_default_language()) radio.talk_into(src, "Auto ejecting patient now", radio_channel, get_spans(), get_default_language())
open_machine() open_machine()
return return
else if(occupant.stat == DEAD) // We don't bother with dead people. else if(mob_occupant.stat == DEAD) // We don't bother with dead people.
return return
if(autoeject) // Eject if configured. if(autoeject) // Eject if configured.
open_machine() open_machine()
return return
if(air1.gases.len) if(air1.gases.len)
if(occupant.bodytemperature < T0C) // Sleepytime. Why? More cryo magic. if(mob_occupant.bodytemperature < T0C) // Sleepytime. Why? More cryo magic.
occupant.Sleeping((occupant.bodytemperature / sleep_factor) * 100) mob_occupant.Sleeping((mob_occupant.bodytemperature / sleep_factor) * 100)
occupant.Paralyse((occupant.bodytemperature / paralyze_factor) * 100) mob_occupant.Paralyse((mob_occupant.bodytemperature / paralyze_factor) * 100)
if(beaker) if(beaker)
if(reagent_transfer == 0) // Magically transfer reagents. Because cryo magic. if(reagent_transfer == 0) // Magically transfer reagents. Because cryo magic.
@@ -191,7 +149,7 @@
on = FALSE on = FALSE
update_icon() update_icon()
return return
if(occupant) if(isliving(occupant))
var/mob/living/mob_occupant = occupant var/mob/living/mob_occupant = occupant
var/cold_protection = 0 var/cold_protection = 0
var/mob/living/carbon/human/H = occupant var/mob/living/carbon/human/H = occupant
@@ -243,7 +201,7 @@
..() ..()
if(occupant) if(occupant)
if(on) if(on)
to_chat(user, "[occupant] is inside [src]!") to_chat(user, "Someone's inside [src]!")
else else
to_chat(user, "You can barely make out a form floating in [src].") to_chat(user, "You can barely make out a form floating in [src].")
else else
@@ -266,9 +224,11 @@
I.loc = src I.loc = src
user.visible_message("[user] places [I] in [src].", \ user.visible_message("[user] places [I] in [src].", \
"<span class='notice'>You place [I] in [src].</span>") "<span class='notice'>You place [I] in [src].</span>")
var/reagentlist = pretty_string_from_reagent_list(I.reagents.reagent_list)
log_game("[key_name(user)] added an [I] to cyro containing [reagentlist]")
return return
if(!on && !occupant && !state_open) if(!on && !occupant && !state_open)
if(default_deconstruction_screwdriver(user, "pod0-o", "pod0", I)) if(default_deconstruction_screwdriver(user, "cell-o", "cell-off", I))
return return
if(exchange_parts(user, I)) if(exchange_parts(user, I))
return return
@@ -295,7 +255,7 @@
data["autoEject"] = autoeject data["autoEject"] = autoeject
var/list/occupantData = list() var/list/occupantData = list()
if(occupant) if(isliving(occupant))
var/mob/living/mob_occupant = occupant var/mob/living/mob_occupant = occupant
occupantData["name"] = mob_occupant.name occupantData["name"] = mob_occupant.name
occupantData["stat"] = mob_occupant.stat occupantData["stat"] = mob_occupant.stat