quality of life

This commit is contained in:
Poojawa
2016-08-09 17:07:43 -05:00
parent ca4057cc11
commit 582c76840b
13 changed files with 78 additions and 18 deletions
@@ -120,6 +120,8 @@ Thus, the two variables affect pump operation are set in New():
if("power")
on = !on
investigate_log("was turned [on ? "on" : "off"] by [key_name(usr)]", "atmos")
message_admins("Pump manipulated by [key_name(usr)] at [x], [y], [z], [loc.loc]")
log_admin("[key_name(usr)] manipulated a pump at [x], [y], [z]")
. = TRUE
if("pressure")
var/pressure = params["pressure"]
@@ -135,7 +137,9 @@ Thus, the two variables affect pump operation are set in New():
. = TRUE
if(.)
target_pressure = Clamp(pressure, 0, MAX_OUTPUT_PRESSURE)
investigate_log("was set to [target_pressure] kPa by [key_name(usr)]", "atmos")
investigate_log("A pump was set to [target_pressure] kPa by [key_name(usr)]", [loc.loc], "atmos")
message_admins("A pump was set to [target_pressure] kPa by [key_name(usr)] at [x], [y], [z], [loc.loc]")
log_admin("[key_name(usr)] manipulated a pump at [x], [y], [z]")
update_icon()
/obj/machinery/atmospherics/components/binary/pump/atmosinit()
@@ -1,7 +1,7 @@
/obj/machinery/atmospherics/components/unary/cryo_cell
name = "cryo cell"
icon = 'icons/obj/cryogenics.dmi'
icon_state = "cell-off"
icon_state = "pod0"
density = 1
anchored = 1
@@ -9,7 +9,7 @@
state_open = FALSE
var/autoeject = FALSE
var/volume = 100
var/running_bob_animation = 0
var/efficiency = 1
var/sleep_factor = 750
var/paralyze_factor = 1000
@@ -54,17 +54,59 @@
return ..()
/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)
icon_state = "cell-o"
icon_state = "pod0-o"
else if(state_open)
icon_state = "cell-open"
icon_state = "pod0"
else if(on && is_operational())
if(occupant)
icon_state = "cell-occupied"
var/image/pickle = image(occupant.icon, occupant.icon_state)
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 = 1
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 = 0
else
icon_state = "cell-on"
icon_state = "pod1"
overlays += "lid0" //have to remove the overlays first, to force an update- remove cloning pod overlay
else
icon_state = "cell-off"
icon_state = "pod0"
overlays += "lid0" //if no occupant, just put the lid overlay on, and ignore the rest
/obj/machinery/atmospherics/components/unary/cryo_cell/process()
..()