This commit is contained in:
Tastyfish
2015-10-28 18:49:58 -04:00
11 changed files with 509 additions and 233 deletions
+150 -124
View File
@@ -7,6 +7,8 @@
icon = 'icons/obj/Cryogenic2.dmi'
icon_state = "console"
var/obj/machinery/sleeper/connected = null
var/ui_title = "Sleeper"
anchored = 1 //About time someone fixed this.
density = 1
var/orient = "LEFT"
@@ -39,10 +41,6 @@
/obj/machinery/sleep_console/RefreshParts()
/obj/machinery/sleep_console/process()
if(stat & (NOPOWER|BROKEN))
return
src.updateUsrDialog()
return
/obj/machinery/sleep_console/ex_act(severity)
switch(severity)
@@ -116,88 +114,137 @@
findsleeper()
if (src.connected)
var/mob/living/occupant = src.connected.occupant
var/dat = "<font color='blue'><B>Occupant Statistics:</B></FONT><BR>"
if (occupant)
var/t1
switch(occupant.stat)
if(0)
t1 = "Conscious"
if(1)
t1 = "<font color='blue'>Unconscious</font>"
if(2)
t1 = "<font color='red'>*dead*</font>"
else
dat += text("[]\tHealth %: [] ([])</FONT><BR>", (occupant.health > 50 ? "<font color='blue'>" : "<font color='red'>"), occupant.health, t1)
if(iscarbon(occupant))
var/mob/living/carbon/C = occupant
dat += text("[]\t-Pulse, bpm: []</FONT><BR>", (C.pulse == PULSE_NONE || C.pulse == PULSE_THREADY ? "<font color='red'>" : "<font color='blue'>"), C.get_pulse(GETPULSE_TOOL))
dat += text("[]\t-Brute Damage %: []</FONT><BR>", (occupant.getBruteLoss() < 60 ? "<font color='blue'>" : "<font color='red'>"), occupant.getBruteLoss())
dat += text("[]\t-Respiratory Damage %: []</FONT><BR>", (occupant.getOxyLoss() < 60 ? "<font color='blue'>" : "<font color='red'>"), occupant.getOxyLoss())
dat += text("[]\t-Toxin Content %: []</FONT><BR>", (occupant.getToxLoss() < 60 ? "<font color='blue'>" : "<font color='red'>"), occupant.getToxLoss())
dat += text("[]\t-Burn Severity %: []</FONT><BR>", (occupant.getFireLoss() < 60 ? "<font color='blue'>" : "<font color='red'>"), occupant.getFireLoss())
dat += text("<HR>Paralysis Summary %: [] ([] seconds left!)<BR>", occupant.paralysis, round(occupant.paralysis / 4))
if(occupant.reagents)
for(var/chemical in connected.injection_chems)
var/datum/reagent/C = chemical_reagents_list[chemical]
dat += "[C.name]: [occupant.reagents.get_reagent_amount(chemical)] units<br>"
dat += "<A href='?src=\ref[src];refresh=1'>Refresh Meter Readings</A><BR>"
if(src.connected.beaker)
dat += "<HR><A href='?src=\ref[src];removebeaker=1'>Remove Beaker</A><BR>"
if(src.connected.filtering)
dat += "<A href='?src=\ref[src];togglefilter=1'>Stop Dialysis</A><BR>"
dat += text("Output Beaker has [] units of free space remaining<BR><HR>", src.connected.beaker.reagents.maximum_volume - src.connected.beaker.reagents.total_volume)
else
dat += "<HR><A href='?src=\ref[src];togglefilter=1'>Start Dialysis</A><BR>"
dat += text("Output Beaker has [] units of free space remaining<BR><HR>", src.connected.beaker.reagents.maximum_volume - src.connected.beaker.reagents.total_volume)
else
dat += "<HR>No Dialysis Output Beaker is present.<BR><HR>"
for(var/chemical in connected.injection_chems)
var/datum/reagent/C = chemical_reagents_list[chemical]
dat += "Inject [C.name]: "
for(var/amount in connected.amounts)
dat += "<a href ='?src=\ref[src];chemical=[chemical];amount=[amount]'>[amount] units</a><br> "
dat += "<HR><A href='?src=\ref[src];ejectify=1'>Eject Patient</A>"
else
dat += "The sleeper is empty."
dat += text("<BR><BR><A href='?src=\ref[];mach_close=sleeper'>Close</A>", user)
user << browse(dat, "window=sleeper;size=400x500")
onclose(user, "sleeper")
return
ui_interact(user)
/obj/machinery/sleep_console/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
var/data[0]
var/mob/living/carbon/human/occupant = connected.occupant
data["hasOccupant"] = occupant ? 1 : 0
var/occupantData[0]
var/crisis = 0
if (occupant)
occupantData["name"] = occupant.name
occupantData["stat"] = occupant.stat
occupantData["health"] = occupant.health
occupantData["maxHealth"] = occupant.maxHealth
occupantData["minHealth"] = config.health_threshold_dead
occupantData["bruteLoss"] = occupant.getBruteLoss()
occupantData["oxyLoss"] = occupant.getOxyLoss()
occupantData["toxLoss"] = occupant.getToxLoss()
occupantData["fireLoss"] = occupant.getFireLoss()
occupantData["paralysis"] = occupant.paralysis
occupantData["hasBlood"] = 0
occupantData["bodyTemperature"] = occupant.bodytemperature
occupantData["maxTemp"] = 1000 // If you get a burning vox armalis into the sleeper, congratulations
// Because we can put simple_animals in here, we need to do something tricky to get things working nice
occupantData["temperatureSuitability"] = 0 // 0 is the baseline
if (ishuman(occupant) && occupant.species)
// I wanna do something where the bar gets bluer as the temperature gets lower
// For now, I'll just use the standard format for the temperature status
var/datum/species/sp = occupant.species
if (occupant.bodytemperature < sp.cold_level_3)
occupantData["temperatureSuitability"] = -3
else if (occupant.bodytemperature < sp.cold_level_2)
occupantData["temperatureSuitability"] = -2
else if (occupant.bodytemperature < sp.cold_level_1)
occupantData["temperatureSuitability"] = -1
else if (occupant.bodytemperature > sp.heat_level_3)
occupantData["temperatureSuitability"] = 3
else if (occupant.bodytemperature > sp.heat_level_2)
occupantData["temperatureSuitability"] = 2
else if (occupant.bodytemperature > sp.heat_level_1)
occupantData["temperatureSuitability"] = 1
else if (istype(occupant, /mob/living/simple_animal))
var/mob/living/simple_animal/silly = occupant
if (silly.bodytemperature < silly.minbodytemp)
occupantData["temperatureSuitability"] = -3
else if (silly.bodytemperature > silly.maxbodytemp)
occupantData["temperatureSuitability"] = 3
// Blast you, imperial measurement system
occupantData["btCelsius"] = occupant.bodytemperature - T0C
occupantData["btFaren"] = ((occupant.bodytemperature - T0C) * (9.0/5.0))+ 32
crisis = (occupant.health < connected.min_health)
// I'm not sure WHY you'd want to put a simple_animal in a sleeper, but precedent is precedent
// Runtime is aptly named, isn't she?
if (ishuman(occupant) && occupant.vessel && !(occupant.species && occupant.species.flags & NO_BLOOD))
occupantData["pulse"] = occupant.get_pulse(GETPULSE_TOOL)
occupantData["hasBlood"] = 1
occupantData["bloodLevel"] = round(occupant.vessel.get_reagent_amount("blood"))
occupantData["bloodMax"] = occupant.max_blood
occupantData["bloodPercent"] = round(100*(occupant.vessel.get_reagent_amount("blood")/occupant.max_blood), 0.01)
data["occupant"] = occupantData
data["maxchem"] = connected.max_chem
data["minhealth"] = connected.min_health
data["dialysis"] = connected.filtering
if (connected.beaker)
data["isBeakerLoaded"] = 1
data["beakerFreeSpace"] = round(connected.beaker.reagents.maximum_volume - connected.beaker.reagents.total_volume)
var/chemicals[0]
for (var/re in connected.injection_chems)
var/datum/reagent/temp = chemical_reagents_list[re]
if(temp)
var/reagent_amount = 0
var/pretty_amount
var/injectable = occupant ? 1 : 0
var/overdosing = 0
var/caution = 0 // To make things clear that you're coming close to an overdose
if (crisis && !(temp.id in connected.emergency_chems))
injectable = 0
if (occupant && occupant.reagents)
reagent_amount = occupant.reagents.get_reagent_amount(temp.id)
// If they're mashing the highest concentration, they get one warning
if (temp.overdose_threshold && reagent_amount + 10 > temp.overdose_threshold)
caution = 1
if (temp.id in occupant.reagents.overdose_list())
overdosing = 1
// Because I don't know how to do this on the nano side
pretty_amount = round(reagent_amount, 0.05)
chemicals.Add(list(list("title" = temp.name, "id" = temp.id, "commands" = list("chemical" = temp.id), "occ_amount" = reagent_amount, "pretty_amount" = pretty_amount, "injectable" = injectable, "overdosing" = overdosing, "od_warning" = caution)))
data["chemicals"] = chemicals
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "sleeper.tmpl", ui_title, 550, 655)
ui.set_initial_data(data)
ui.open()
ui.set_auto_update(1)
/obj/machinery/sleep_console/Topic(href, href_list)
if(!connected | usr == connected.occupant)
return 0
if(..())
return 1
if(panel_open)
usr << "<span class='notice'>Close the maintenance panel first.</span>"
return 1
return 0
if ((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon/ai)))
usr.set_machine(src)
if (href_list["chemical"])
if (src.connected)
if (src.connected.occupant)
if (src.connected.occupant.stat == DEAD)
usr << "\red \b This person has no life for to preserve anymore. Take them to a department capable of reanimating them."
else if(src.connected.occupant.health > src.connected.min_health || href_list["chemical"] == "epinephrine")
usr << "<span class='danger'>This person has no life for to preserve anymore. Take them to a department capable of reanimating them.</span>"
else if(src.connected.occupant.health > src.connected.min_health || (href_list["chemical"] in connected.emergency_chems))
src.connected.inject_chemical(usr,href_list["chemical"],text2num(href_list["amount"]))
else
usr << "\red \b This person is not in good enough condition for sleepers to be effective! Use another means of treatment, such as cryogenics!"
src.updateUsrDialog()
if (href_list["refresh"])
src.updateUsrDialog()
usr << "<span class='danger'>This person is not in good enough condition for sleepers to be effective! Use another means of treatment, such as cryogenics!</span>"
if (href_list["removebeaker"])
src.connected.remove_beaker()
src.updateUsrDialog()
if (href_list["togglefilter"])
src.connected.toggle_filter()
src.updateUsrDialog()
if (href_list["ejectify"])
src.connected.eject()
src.updateUsrDialog()
src.add_fingerprint(usr)
return
return 1
/////////////////////////////////////////
// THE SLEEPER ITSELF
@@ -216,24 +263,25 @@
list("epinephrine", "ether", "salbutamol", "styptic_powder", "oculine"),
list("epinephrine", "ether", "salbutamol", "styptic_powder", "oculine", "charcoal", "mutadone", "mannitol"),
list("epinephrine", "ether", "salbutamol", "styptic_powder", "oculine", "charcoal", "mutadone", "mannitol", "pen_acid", "omnizine"))
var/emergency_chems = list("epinephrine") // Desnowflaking
var/amounts = list(5, 10)
var/obj/item/weapon/reagent_containers/glass/beaker = null
var/filtering = 0
var/efficiency
var/max_chem
var/initial_bin_rating = 1
var/min_health = 25
var/min_health = -25
var/injection_chems = list()
idle_power_usage = 1250
active_power_usage = 2500
light_color = LIGHT_COLOR_CYAN
power_change()
..()
if(!(stat & (BROKEN|NOPOWER)))
set_light(2)
else
set_light(0)
/obj/machinery/sleeper/power_change()
..()
if(!(stat & (BROKEN|NOPOWER)))
set_light(2)
else
set_light(0)
/obj/machinery/sleeper/New()
..()
@@ -271,16 +319,20 @@
I += M.rating
injection_chems = possible_chems[I]
efficiency = E
max_chem = E * 20
min_health = -E * 25
/obj/machinery/sleeper/process()
if(filtering > 0)
if(beaker)
// To prevent runtimes from drawing blood from runtime, and to prevent getting IPC blood.
if(!istype(occupant) || !occupant.dna || (occupant.species && occupant.species.flags & NO_BLOOD))
filtering = 0
return
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)
// world << "FILTERING CHEMS"
src.occupant.reagents.trans_to(beaker, 3)
src.occupant.vessel.trans_to(beaker, 1)
src.updateDialog()
@@ -306,11 +358,10 @@
beaker = G
G.forceMove(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."
user << "<span class='warning'>The sleeper has a beaker already.</span>"
return
if (istype(G, /obj/item/weapon/screwdriver))
@@ -342,12 +393,12 @@
if(istype(G, /obj/item/weapon/grab))
if(panel_open)
user << "\blue <b>Close the maintenance panel first.</b>"
user << "<span class='boldnotice'>Close the maintenance panel first.</span>"
return
if(!ismob(G:affecting))
return
if(src.occupant)
user << "\blue <B>The sleeper is already occupied!</B>"
user << "<span class='boldnotice'>The sleeper is already occupied!</span>"
return
for(var/mob/living/carbon/slime/M in range(1,G:affecting))
if(M.Victim == G:affecting)
@@ -358,7 +409,7 @@
if(do_after(user, 20, target = G:affecting))
if(src.occupant)
user << "\blue <B>The sleeper is already occupied!</B>"
user << "<span class='boldnotice'>The sleeper is already occupied!</span>"
return
if(!G || !G:affecting) return
var/mob/M = G:affecting
@@ -368,7 +419,7 @@
M.forceMove(src)
src.occupant = M
src.icon_state = "sleeper"
M << "\blue <b>You feel cool air surround you. You go numb as your senses turn inward.</b>"
M << "<span class='boldnotice'>You feel cool air surround you. You go numb as your senses turn inward.</span>"
src.add_fingerprint(user)
qdel(G)
@@ -412,6 +463,8 @@
go_out()
..(severity)
// ???
// This looks cool, although mildly broken, should it be included again?
/obj/machinery/sleeper/alter_health(mob/living/M as mob)
if (M.health > 0)
if (M.getOxyLoss() >= 10)
@@ -447,11 +500,14 @@
return
/obj/machinery/sleeper/proc/inject_chemical(mob/living/user as mob, chemical, amount)
if (!(chemical in injection_chems))
user << "<span class='notice'>The sleeper does not offer that chemical!</notice>"
return
if(src.occupant)
if(src.occupant.reagents)
if(src.occupant.reagents.get_reagent_amount(chemical) + amount <= 20 * efficiency)
if(src.occupant.reagents.get_reagent_amount(chemical) + amount <= max_chem)
src.occupant.reagents.add_reagent(chemical, amount)
user << "Occupant now has [src.occupant.reagents.get_reagent_amount(chemical)] units of [chemical] in his/her bloodstream."
return
else
user << "You can not inject any more of this chemical."
@@ -463,39 +519,9 @@
user << "There's no occupant in the sleeper!"
return
/obj/machinery/sleeper/proc/check(mob/living/user as mob)
if(src.occupant)
user << text("\blue <B>Occupant ([]) Statistics:</B>", 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: []&deg;C ([]&deg;F)</FONT><BR>", (src.occupant.bodytemperature > 50 ? "<font color='blue'>" : "<font color='red'>"), 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 = null
set category = "Object"
set src in oview(1)
if(usr.stat != 0)
return
@@ -506,7 +532,7 @@
/obj/machinery/sleeper/verb/remove_beaker()
set name = "Remove Beaker"
set category = null
set category = "Object"
set src in oview(1)
if(usr.stat != 0)
return
@@ -520,7 +546,7 @@
/obj/machinery/sleeper/MouseDrop_T(atom/movable/O as mob|obj, mob/user as mob)
if(O.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
if(user.incapacitated()) //are you cuffed, dying, lying, stunned or other
return
if(get_dist(user, src) > 1 || get_dist(user, O) > 1 || user.contents.Find(src)) // is the mob anchored, too far away from you, or are you too far away from the source
return
@@ -535,10 +561,10 @@
if(!istype(user.loc, /turf) || !istype(O.loc, /turf)) // are you in a container/closet/pod/etc?
return
if(panel_open)
user << "\blue <B>Close the maintenance panel first.</B>"
user << "<span class='boldnotice'>Close the maintenance panel first.</span>"
return
if(occupant)
user << "\blue <B>The sleeper is already occupied!</B>"
user << "<span class='boldnotice'>The sleeper is already occupied!</span>"
return
/* if(isrobot(user))
if(!istype(user:module, /obj/item/weapon/robot_module/medical))
@@ -548,7 +574,7 @@
if(!istype(L) || L.buckled)
return
if(L.abiotic())
user << "\blue <B>Subject cannot have abiotic items on.</B>"
user << "<span class='boldnotice'>Subject cannot have abiotic items on.</span>"
return
for(var/mob/living/carbon/slime/M in range(1,L))
if(M.Victim == L)
@@ -561,7 +587,7 @@
if(do_after(user, 20, target = L))
if(src.occupant)
user << "\blue <B>The sleeper is already occupied!</B>"
user << "<span class='boldnotice'>>The sleeper is already occupied!</span>"
return
if(!L) return
@@ -571,7 +597,7 @@
L.forceMove(src)
src.occupant = L
src.icon_state = "sleeper"
L << "\blue <b>You feel cool air surround you. You go numb as your senses turn inward.</b>"
L << "<span class='boldnotice'>You feel cool air surround you. You go numb as your senses turn inward.</span>"
src.add_fingerprint(user)
if(user.pulling == L)
user.pulling = null
@@ -583,15 +609,15 @@
/obj/machinery/sleeper/verb/move_inside()
set name = "Enter Sleeper"
set category = null
set category = "Object"
set src in oview(1)
if(usr.stat != 0 || !(ishuman(usr)))
return
if(src.occupant)
usr << "\blue <B>The sleeper is already occupied!</B>"
usr << "<span class='boldnotice'>The sleeper is already occupied!</span>"
return
if (panel_open)
usr << "\blue <B>Close the maintenance panel first.</B>"
usr << "<span class='boldnotice'>Close the maintenance panel first.</span>"
return
if(usr.restrained() || usr.stat || usr.weakened || usr.stunned || usr.paralysis || usr.resting) //are you cuffed, dying, lying, stunned or other
return
@@ -602,7 +628,7 @@
visible_message("[usr] starts climbing into the sleeper.")
if(do_after(usr, 20, target = usr))
if(src.occupant)
usr << "\blue <B>The sleeper is already occupied!</B>"
usr << "<span class='boldnotice'>The sleeper is already occupied!</span>"
return
usr.stop_pulling()
usr.client.perspective = EYE_PERSPECTIVE
+12 -11
View File
@@ -53,11 +53,11 @@
var/mob/living/carbon/human/target = grabbed
if(issmall(target))
if(target.stat == 0)
user << "\red The monkey is struggling far too much to put it in the recycler."
user << "<span class='warning'>The monkey is struggling far too much to put it in the recycler.</span>"
else
user.drop_item()
qdel(target)
user << "\blue You stuff the monkey in the machine."
user << "<span class='notice'>You stuff the monkey in the machine.</span>"
playsound(src.loc, 'sound/machines/juicer.ogg', 50, 1)
var/offset = prob(50) ? -2 : 2
animate(src, pixel_x = pixel_x + offset, time = 0.2, loop = 200) //start shaking
@@ -65,22 +65,23 @@
src.grinded++
sleep(50)
pixel_x = initial(pixel_x)
user << "\blue The machine now has [grinded] monkeys worth of material stored."
user << "<span class='notice'>The machine now has [grinded] monkey\s worth of material stored.</span>"
else
user << "\red The machine only accepts monkeys!"
user << "<span class='warning'>The machine only accepts monkeys!</span>"
else
user << "\red The machine only accepts monkeys!"
user << "<span class='warning'>The machine only accepts monkeys!</span>"
return
/obj/machinery/monkey_recycler/attack_hand(var/mob/user as mob)
if (src.stat != 0) //NOPOWER etc
return
if(grinded >= required_grind)
user << "\blue The machine hisses loudly as it condenses the grinded monkey meat. After a moment, it dispenses a brand new monkey cube."
user << "<span class='notice'>The machine hisses loudly as it condenses the grinded monkey meat. After a moment, it dispenses a brand new monkey cube.</span>"
playsound(src.loc, 'sound/machines/hiss.ogg', 50, 1)
grinded -= required_grind
new /obj/item/weapon/reagent_containers/food/snacks/monkeycube/wrapped(src.loc)
user << "\blue The machine's display flashes that it has [grinded] monkeys worth of material left."
else
user << "\red The machine needs at least [required_grind] monkey\s worth of material to produce a monkey cube. It only has [grinded]."
return
for(var/i = 0, i < cube_production, i++) // Forgot to fix this bit the first time through
new /obj/item/weapon/reagent_containers/food/snacks/monkeycube/wrapped(src.loc)
user << "<span class='notice'>The machine's display flashes that it has [grinded] monkey\s worth of material left.</span>"
else // I'm not sure if the \s macro works with a word in between; I'll play it safe
user << "<span class='warning'>The machine needs at least [required_grind] monkey\s worth of material to compress [cube_production] monkey\s. It only has [grinded].</span>"
return
+90 -92
View File
@@ -85,6 +85,7 @@
pr_give_air = null
qdel(ion_trail)
ion_trail = null
occupant_sanity_check()
if(occupant)
occupant.forceMove(get_turf(src))
occupant = null
@@ -148,6 +149,7 @@
var/oldhealth = health
health = max(0, health - damage)
var/percentage = (health / initial(health)) * 100
occupant_sanity_check()
if(occupant && oldhealth > health && percentage <= 25 && percentage > 0)
var/sound/S = sound('sound/effects/engine_alert2.ogg')
S.wait = 0 //No queue
@@ -186,6 +188,7 @@
/obj/spacepod/ex_act(severity)
occupant_sanity_check()
switch(severity)
if(1)
var/mob/living/carbon/human/H = occupant
@@ -207,6 +210,7 @@
deal_damage(50)
/obj/spacepod/emp_act(severity)
occupant_sanity_check()
switch(severity)
if(1)
if(src.occupant) src.occupant << "<span class='warning'>The pod console flashes 'Heavy EMP WAVE DETECTED'.</span>" //warn the occupants
@@ -464,129 +468,118 @@
. = t_air.return_temperature()
return
/obj/spacepod/proc/moved_inside(var/mob/living/carbon/human/H as mob)
var/fukkendisk = usr.GetTypeInAllContents(/obj/item/weapon/disk/nuclear)
if(fukkendisk)
usr << "\red <B>The nuke-disk locks the door as you try to get in. You evil person.</b>"
return
if(H && H.client && H in range(1))
if(src.occupant && src.occupant2)
H << "<span class='notice'>[src.name] is full.</span>"
return
if(src.occupant && !src.occupant2)
if(src.occupant == H)
H.visible_message("You climb over the console and drop down into the secondary seat.")
H.reset_view(src)
H.stop_pulling()
H.forceMove(src)
if(src.occupant == H) occupant = null
src.occupant2 = H
src.add_fingerprint(H)
src.forceMove(src.loc)
playsound(src, 'sound/machines/windowdoor.ogg', 50, 1)
return 1
else
if(!src.occupant)
H.reset_view(src)
H.stop_pulling()
H.forceMove(src)
src.occupant = H
src.add_fingerprint(H)
src.forceMove(src.loc)
playsound(src, 'sound/machines/windowdoor.ogg', 50, 1)
return 1
else
return
else
return 0
/obj/spacepod/proc/moved_other_inside(var/mob/living/carbon/human/H as mob)
if(!src.occupant2)
H.reset_view(src)
occupant_sanity_check()
if(!occupant2)
H.stop_pulling()
H.forceMove(src)
src.occupant2 = H
src.forceMove(src.loc)
occupant2 = H
H.forceMove(src)
playsound(src, 'sound/machines/windowdoor.ogg', 50, 1)
return 1
else
/obj/spacepod/MouseDrop_T(mob/M, mob/user)
if(!isliving(M))
return
/obj/spacepod/MouseDrop_T(mob/M as mob, mob/user as mob)
if(!isliving(M)) return
occupant_sanity_check()
if(M != user && M.stat == DEAD && allow2enter)
if(src.occupant2 && !src.occupant)
if(occupant2 && !occupant)
usr << "<span class='danger'><b>You can't put a corpse into the driver's seat!</b></span>"
return
if(!src.occupant2)
return 0
if(!occupant2)
visible_message("<span class='danger'>[user.name] starts loading [M.name] into the pod!</span>")
sleep(10)
moved_other_inside(M)
if(M == user)
move_inside(user)
enter_pod(user)
/obj/spacepod/verb/move_inside(var/mob/user)
/obj/spacepod/verb/enter_pod(mob/user = usr)
set category = "Object"
set name = "Enter Pod"
set src in oview(1)
var/fukkendisk = usr.GetTypeInAllContents(/obj/item/weapon/disk/nuclear)
if(user.restrained() || user.stat || user.weakened || user.stunned || user.paralysis || user.resting) //are you cuffed, dying, lying, stunned or other
return
if (!ishuman(user)) return
if(!istype(user))
return 0
var/fukkendisk = user.GetTypeInAllContents(/obj/item/weapon/disk/nuclear)
if(user.incapacitated()) //are you cuffed, dying, lying, stunned or other
return 0
if(!ishuman(user))
return 0
if(fukkendisk)
user << "<span class='warning'><B>The nuke-disk is locking the door every time you try to open it. You get the feeling that it doesn't want to go into the spacepod.</b></span>"
return
user << "<span class='danger'><B>The nuke-disk is locking the door every time you try to open it. You get the feeling that it doesn't want to go into the spacepod.</b></span>"
return 0
for(var/mob/living/carbon/slime/S in range(1,usr))
if(S.Victim == user)
user << "You're too busy getting your life sucked out of you."
return
return 0
try_user_enter(user)
move_inside(user)
/obj/spacepod/proc/try_user_enter(var/mob/user)
if(!src.occupant && !src.occupant2)
visible_message("<span class='notice'>[user] starts to climb into [src.name]</span>")
if(enter_after(40,user))
if(!src.occupant)
moved_inside(user)
else if(src.occupant != user)
user << "<span class='notice'>[src.occupant] was faster. Try better next time, loser.</span>"
else user << "<span class='notice'>You stop entering the spacepod.</span>"
return
/obj/spacepod/proc/move_inside(mob/user)
if(!istype(user))
log_debug("SHIT'S GONE WRONG WITH THE SPACEPOD [src] AT [x], [y], [z], AREA [get_area(src)], TURF [get_turf(src)]")
if(!allow2enter)
user << "<span class='danger'>The door is locked!</span>"
return
occupant_sanity_check()
if(occupant && occupant2)
user << "<span class='danger'>You can't fit in \the [src], it's full!</span>"
return
if(!occupant)
visible_message("<span class='notice'>[user] starts to climb into \the [src].</span>")
if(do_after(user, 40, target = src))
if(!occupant)
user.stop_pulling()
occupant = user
user.forceMove(src)
add_fingerprint(user)
playsound(src, 'sound/machines/windowdoor.ogg', 50, 1)
else
user << "<span class='notice'>[occupant] was faster. Try better next time, loser.</span>"
else
user << "<span class='notice'>You stop entering \the [src].</span>"
if(occupant && !occupant2)
user << "<span class='notice'><b>You start climbing into the passenger bay.</b></span>"
user_enter(user)
if(!occupant && occupant2)
user << "<span class='notice'><b>You start climbing into the pilot's seat.</b></span>"
user_enter(user)
/obj/spacepod/proc/user_enter(var/mob/user)
visible_message("<span class='notice'>[user] starts to climb into \the [src.name].</span>")
if(enter_after(40,user))
moved_inside(user)
else if(!occupant2)
visible_message("<span class='notice'>[user] starts to climb into \the [src].</span>")
if(do_after(user, 40, target = src))
if(!occupant2)
user.stop_pulling()
occupant2 = user
user.forceMove(src)
add_fingerprint(user)
playsound(src, 'sound/machines/windowdoor.ogg', 50, 1)
else
user << "<span class='notice'>[occupant] was faster. Try better next time, loser.</span>"
else
user << "<span class='notice'>You stop entering \the [src].</span>"
else
user << "You stop entering the spacepod."
user << "<span class='danger'>You can't fit in \the [src], it's full!</span>"
/obj/spacepod/proc/occupant_sanity_check()
if(occupant)
if(!ismob(occupant))
occupant.forceMove(get_turf(src))
log_debug("##SPACEPOD WARNING: NON-MOB OCCUPANT [occupant], TURF [get_turf(src)] | AREA [get_area(src)] | COORDS [x], [y], [z]")
occupant = null
else if(occupant.loc != src)
log_debug("##SPACEPOD WARNING: OCCUPANT [occupant] ESCAPED, TURF [get_turf(src)] | AREA [get_area(src)] | COORDS [x], [y], [z]")
occupant = null
if(occupant2)
if(!ismob(occupant2))
occupant2.forceMove(get_turf(src))
log_debug("##SPACEPOD WARNING: NON-MOB OCCUPANT [occupant2], TURF [get_turf(src)] | AREA [get_area(src)] | COORDS [x], [y], [z]")
occupant2 = null
else if(occupant2.loc != src)
log_debug("##SPACEPOD WARNING: OCCUPANT [occupant2] ESCAPED, TURF [get_turf(src)] | AREA [get_area(src)] | COORDS [x], [y], [z]")
occupant2 = null
if(!occupant && !allow2enter)
allow2enter = 1
log_debug("##SPACEPOD WARNING: DOORS WERE STILL LOCKED WITH NO OCCUPANT, TURF [get_turf(src)] | AREA [get_area(src)] | COORDS [x], [y], [z]")
/obj/spacepod/verb/exit_pod()
set name = "Exit pod"
@@ -595,7 +588,10 @@
var/mob/user = usr
var/spos = 0
if(!ismob(user)) return
if(!istype(user))
return
occupant_sanity_check()
if(occupant == user) spos = 1
if(occupant2 == user) spos = 2
@@ -618,6 +614,8 @@
set category = "Spacepod"
set src = usr.loc
occupant_sanity_check()
if(!occupant2)
usr << "<span class='notice'>There is no one in the second seat.</span>"
return
@@ -685,7 +683,7 @@
return
equipment_system.weapon_system.fire_weapons()
obj/spacepod/verb/toggleLights()
/obj/spacepod/verb/toggleLights()
set name = "Toggle Lights"
set category = "Spacepod"
set src = usr.loc
@@ -84,6 +84,9 @@
if(stat == DEAD) return
if(healths) healths.icon_state = "health5"
if(!gibbed)
emote("deathgasp") //let the world KNOW WE ARE DEAD
stat = DEAD
dizziness = 0
jitteriness = 0
@@ -128,8 +131,6 @@
H.mind.kills += "[name] ([ckey])"
if(!gibbed)
emote("deathgasp") //let the world KNOW WE ARE DEAD
update_canmove()
if(client) blind.layer = 0
@@ -175,4 +176,4 @@
/mob/living/carbon/human/proc/Drain()
ChangeToHusk()
mutations |= NOCLONE
return
return
@@ -1,4 +1,8 @@
/mob/living/carbon/human/emote(var/act,var/m_type=1,var/message = null,var/force)
if (stat == DEAD)
return // No screaming bodies
var/param = null
if (findtext(act, "-", 1, null))
var/t1 = findtext(act, "-", 1, null)
@@ -814,4 +818,4 @@
set desc = "Sets an extended description of your character's features."
set category = "IC"
flavor_text = TextPreview(input(usr, "Please enter your new flavour text.", "Flavour text", null) as text)
flavor_text = TextPreview(input(usr, "Please enter your new flavour text.", "Flavour text", null) as text)
@@ -73,6 +73,7 @@
var/mob/remoteview_target = null
var/meatleft = 3 //For chef item
var/decaylevel = 0 // For rotting bodies
var/max_blood = 560 // For stuff in the vessel
var/slime_color = "blue" //For slime people this defines their color, it's blue by default to pay tribute to the old icons
var/check_mutations=0 // Check mutations on next life tick
@@ -98,6 +98,9 @@ About the Holder:
Returns the amount of the matching reagent inside the
holder. Returns 0 if the reagent is missing.
overdose_list()
Returns a list of all the chemical IDs in the reagent holder that are overdosing
Important variables:
total_volume
@@ -82,6 +82,14 @@ datum/reagents/proc/metabolize(var/mob/M)
addiction_tick++
update_total()
/datum/reagents/proc/overdose_list()
var/od_chems[0]
for(var/datum/reagent/R in reagent_list)
if(R.overdosed)
od_chems.Add(R.id)
return od_chems
datum/reagents/proc/reagent_on_tick()
for(var/datum/reagent/R in reagent_list)
R.on_tick()
+25
View File
@@ -606,4 +606,29 @@ th.misc {
.Pearl {
color: #C6CACB;
}
/* Status bar colors for sleeper temperatures */
.cold1 {
color: #94B8FF;
}
.cold2 {
color: #6699FF;
}
.cold3 {
color: #293D66;
}
.hot1 {
color: #FF9966;
}
.hot2 {
color: #993D00;
}
.hot3 {
color: #FF6600;
}
+10 -2
View File
@@ -69,6 +69,14 @@ Used In File(s): \code\game\objects\items\devices\PDA\PDA.dm
margin: 0 2px 2px 0;
}
.uiIcon16 {
background-image: none;
float: left;
width: auto;
height: auto;
margin: 0 0 0 0;
}
#uiTitleText {
color: #000000;
}
@@ -307,7 +315,7 @@ Used In File(s): \code\game\objects\items\devices\PDA\PDA.dm
<H3>Current Conversations</H3>
{{for data.convopdas}}
<div class="item">
{{:helper.link(value.Name, 'circle-arrow-s', {'choice' : "Select Conversation", 'convo' : value.Reference } , null, 'pdalink fixedLeftWider')}}
{{:helper.link(value.Name, 'circle-arrow-s', {'choice' : "Select Conversation", 'convo' : value.Reference } , null, 'pdalink')}}
{{if data.cartridge}}
{{if data.cartridge.access.access_detonate_pda && value.Detonate}}
{{:helper.link('*Detonate*', 'radiation', {'choice' : "Detonate", 'target' : value.Reference}, null, 'pdalink fixedLeft')}}
@@ -324,7 +332,7 @@ Used In File(s): \code\game\objects\items\devices\PDA\PDA.dm
<H3>Other PDAs</H3>
{{for data.pdas}}
<div class="item">
{{:helper.link(value.Name, 'circle-arrow-s', {'choice' : "Message", 'target' : value.Reference}, null, 'pdalink fixedLeftWider')}}
{{:helper.link(value.Name, 'circle-arrow-s', {'choice' : "Message", 'target' : value.Reference}, null, 'pdalink')}}
{{if data.cartridge}}
{{if data.cartridge.access.access_detonate_pda && value.Detonate}} {{:helper.link('*Detonate*', 'radiation', {'choice' : "Detonate", 'target' : value.Reference}, null, 'pdalink fixedLeft')}} {{/if}}
{{if data.cartridge.access.access_clown}} {{:helper.link('*Send Virus*', 'star', {'choice' : "Send Honk", 'target' : value.Reference}, null, 'pdalink fixedLeft')}} {{/if}}
+201
View File
@@ -0,0 +1,201 @@
<!--
Title: Sleeper Status UI
Used In File(s): \code\game\machinery\Sleeper.dm
-->
<h3>Sleeper Status</h3>
<div class="statusDisplay">
{{if !data.hasOccupant}}
<div class="line">Sleeper Unoccupied</div>
{{else}}
<div class="line">
{{:data.occupant.name}}&nbsp;=>&nbsp;
{{if data.occupant.stat == 0}}
<span class="good">Conscious</span>
{{else data.occupant.stat == 1}}
<span class="average">Unconscious</span>
{{else}}
<span class="bad">DEAD</span>
{{/if}}
</div>
<div class="line">
<div class="statusLabel">Health:</div>
{{if data.occupant.health >= data.occupant.maxHealth}}
{{:helper.displayBar(data.occupant.health, 0, data.occupant.maxHealth, 'good')}}
{{else data.occupant.health > 0}}
{{:helper.displayBar(data.occupant.health, 0, data.occupant.maxHealth, 'average')}}
{{else data.occupant.health >= data.minhealth}}
{{:helper.displayBar(data.occupant.health, 0, data.occupant.minHealth, 'average alignRight')}}
{{else}}
{{:helper.displayBar(data.occupant.health, 0, data.occupant.minHealth, 'bad alignRight')}}
{{/if}}
<div class="statusValue">{{:helper.round(data.occupant.health)}}</div>
</div>
<div class="line">
<div class="statusLabel">=&gt; Brute Damage:</div>
{{:helper.displayBar(data.occupant.bruteLoss, 0, data.occupant.maxHealth, 'bad')}}
<div class="statusValue">{{:helper.round(data.occupant.bruteLoss)}}</div>
</div>
<div class="line">
<div class="statusLabel">=&gt; Resp. Damage:</div>
{{:helper.displayBar(data.occupant.oxyLoss, 0, data.occupant.maxHealth, 'bad')}}
<div class="statusValue">{{:helper.round(data.occupant.oxyLoss)}}</div>
</div>
<div class="line">
<div class="statusLabel">=&gt; Toxin Damage:</div>
{{:helper.displayBar(data.occupant.toxLoss, 0, data.occupant.maxHealth, 'bad')}}
<div class="statusValue">{{:helper.round(data.occupant.toxLoss)}}</div>
</div>
<div class="line">
<div class="statusLabel">=&gt; Burn Severity:</div>
{{:helper.displayBar(data.occupant.fireLoss, 0, data.occupant.maxHealth, 'bad')}}
<div class="statusValue">{{:helper.round(data.occupant.fireLoss)}}</div>
</div>
<br>
<div class="line">
<!--
<div class="statusLabel">Patient Temperature:</div>
{{if data.occupant.temperatureSuitability == -3}}
{{:helper.displayBar(data.occupant.bodyTemperature, 0, data.occupant.maxTemp, 'cold3')}}
<div class="statusValue bad">{{:helper.round(data.occupant.btCelsius)}}&deg;C, {{:helper.round(data.occupant.btFaren)}}&deg;F</div>
{{else data.occupant.temperatureSuitability == -2}}
{{:helper.displayBar(data.occupant.bodyTemperature, 0, data.occupant.maxTemp, 'cold2')}}
<div class="statusValue bad">{{:helper.round(data.occupant.btCelsius)}}&deg;C, {{:helper.round(data.occupant.btFaren)}}&deg;F</div>
{{else data.occupant.temperatureSuitability == -1}}
{{:helper.displayBar(data.occupant.bodyTemperature, 0, data.occupant.maxTemp, 'cold1')}}
<div class="statusValue">{{:helper.round(data.occupant.btCelsius)}}&deg;C, {{:helper.round(data.occupant.btFaren)}}&deg;F</div>
{{else data.occupant.temperatureSuitability == 0}}
{{:helper.displayBar(data.occupant.bodyTemperature, 0, data.occupant.maxTemp, 'good')}}
<div class="statusValue">{{:helper.round(data.occupant.btCelsius)}}&deg;C, {{:helper.round(data.occupant.btFaren)}}&deg;F</div>
{{else data.occupant.temperatureSuitability == 1}}
{{:helper.displayBar(data.occupant.bodyTemperature, 0, data.occupant.maxTemp, 'hot1')}}
<div class="statusValue">{{:helper.round(data.occupant.btCelsius)}}&deg;C, {{:helper.round(data.occupant.btFaren)}}&deg;F</div>
{{else data.occupant.temperatureSuitability == 2}}
{{:helper.displayBar(data.occupant.bodyTemperature, 0, data.occupant.maxTemp, 'hot2')}}
<div class="statusValue bad">{{:helper.round(data.occupant.btCelsius)}}&deg;C, {{:helper.round(data.occupant.btFaren)}}&deg;F</div>
{{else data.occupant.temperatureSuitability == 3}}
{{:helper.displayBar(data.occupant.bodyTemperature, 0, data.occupant.maxTemp, 'hot3')}}
<div class="statusValue bad">{{:helper.round(data.occupant.btCelsius)}}&deg;C, {{:helper.round(data.occupant.btFaren)}}&deg;F</div>
{{/if}}
If you can get the changing temperature bars to work right, congratulations
-->
<div class="statusLabel">Patient Temperature:</div>
{{if data.occupant.temperatureSuitability == -3}}
{{:helper.displayBar(data.occupant.bodyTemperature, 0, data.occupant.maxTemp, 'bad')}}
<div class="statusValue bad">{{:helper.round(data.occupant.btCelsius)}}&deg;C, {{:helper.round(data.occupant.btFaren)}}&deg;F</div>
{{else data.occupant.temperatureSuitability == -2}}
{{:helper.displayBar(data.occupant.bodyTemperature, 0, data.occupant.maxTemp, 'average')}}
<div class="statusValue bad">{{:helper.round(data.occupant.btCelsius)}}&deg;C, {{:helper.round(data.occupant.btFaren)}}&deg;F</div>
{{else data.occupant.temperatureSuitability == -1}}
{{:helper.displayBar(data.occupant.bodyTemperature, 0, data.occupant.maxTemp, 'average')}}
<div class="statusValue">{{:helper.round(data.occupant.btCelsius)}}&deg;C, {{:helper.round(data.occupant.btFaren)}}&deg;F</div>
{{else data.occupant.temperatureSuitability == 0}}
{{:helper.displayBar(data.occupant.bodyTemperature, 0, data.occupant.maxTemp, 'good')}}
<div class="statusValue">{{:helper.round(data.occupant.btCelsius)}}&deg;C, {{:helper.round(data.occupant.btFaren)}}&deg;F</div>
{{else data.occupant.temperatureSuitability == 1}}
{{:helper.displayBar(data.occupant.bodyTemperature, 0, data.occupant.maxTemp, 'average')}}
<div class="statusValue">{{:helper.round(data.occupant.btCelsius)}}&deg;C, {{:helper.round(data.occupant.btFaren)}}&deg;F</div>
{{else data.occupant.temperatureSuitability == 2}}
{{:helper.displayBar(data.occupant.bodyTemperature, 0, data.occupant.maxTemp, 'average')}}
<div class="statusValue bad">{{:helper.round(data.occupant.btCelsius)}}&deg;C, {{:helper.round(data.occupant.btFaren)}}&deg;F</div>
{{else data.occupant.temperatureSuitability == 3}}
{{:helper.displayBar(data.occupant.bodyTemperature, 0, data.occupant.maxTemp, 'bad')}}
<div class="statusValue bad">{{:helper.round(data.occupant.btCelsius)}}&deg;C, {{:helper.round(data.occupant.btFaren)}}&deg;F</div>
{{/if}}
</div>
{{if data.occupant.hasBlood}}
<br>
<div class="line">
<div class="statusLabel">Pulse:</div> <div class="statusValue">{{:data.occupant.pulse}} bpm</div>
</div>
<div class="line">
<div class="statusLabel">Blood Level:</div>
{{if data.occupant.bloodPercent <= 60}}
{{:helper.displayBar(data.occupant.bloodLevel, 0, data.occupant.bloodMax, 'bad')}}
<div class="statusValue">
{{:data.occupant.bloodPercent}}%, {{:data.occupant.bloodLevel}}cl
</div>
{{else data.occupant.bloodPercent <= 90}}
{{:helper.displayBar(data.occupant.bloodLevel, 0, data.occupant.bloodMax, 'average')}}
<div class="statusValue">
{{:data.occupant.bloodPercent}}%, {{:data.occupant.bloodLevel}}cl
</div>
{{else}}
{{:helper.displayBar(data.occupant.bloodLevel, 0, data.occupant.bloodMax, 'good')}}
<div class="statusValue">
{{:data.occupant.bloodPercent}}%, {{:data.occupant.bloodLevel}}cl
</div>
{{/if}}
</div>
{{/if}}
{{/if}}
</div>
<h3>Sleeper Operation</h3>
<div class="item">
<div class="itemLabel">
Sleeper Status:
</div>
<div class="itemContent" style="width: 26%;">
{{:helper.link('Eject Occupant', 'arrowreturnthick-1-s', {'ejectify' : 1}, data.hasOccupant ? null : 'disabled')}}
</div>
</div>
<div class="item">&nbsp;</div>
<div class="item">
<div class="itemLabel">
Dialysis Beaker:
</div>
<div class="itemContent" style="width: 40%;">
{{if data.isBeakerLoaded}}
<span class="highlight">{{:helper.round(data.beakerFreeSpace)}} units of space remaining</span><br>
{{else}}
<span class="average"><i>No Dialysis Output Beaker Loaded</i></span>
{{/if}}
</div>
<div class="itemContent" style="width: 26%;">
{{:helper.link('Eject Beaker', 'eject', {'removebeaker' : 1}, data.isBeakerLoaded ? null : 'disabled')}}
{{if data.isBeakerLoaded}}
<div class="line">
<div class="itemContent">
{{:helper.link('On', 'power', {'togglefilter' : 1}, data.occupant.hasBlood ? (data.dialysis ? 'selected' : null) : 'disabled')}}{{:helper.link('Off', 'close', {'togglefilter' : 1}, data.dialysis ? null : 'selected')}}
</div>
</div>
{{/if}}
</div>
</div>
<div class="item">
<div class="itemLabel">
Chemicals:
</div>
{{for data.chemicals}}
<div class="line">
<b>{{:value.title}}:</b>
{{if value.overdosing}}
{{:helper.displayBar(value.occ_amount, 0, data.maxchem, 'bad')}}
{{else value.od_warning}}
{{:helper.displayBar(value.occ_amount, 0, data.maxchem, 'average')}}
{{else}}
{{:helper.displayBar(value.occ_amount, 0, data.maxchem, 'good')}}
{{/if}}
<div class="statusValue">{{:value.pretty_amount}}/{{:data.maxchem}}</div>
<br>
</div>
<div class="line>
<div class="itemContent">
{{:helper.link('5', 'gear', {'chemical' : value.id, 'amount' : 5}, (!value.injectable || ((value.occ_amount + 5) > data.maxchem)) ? 'disabled' : null)}}
{{:helper.link('10', 'gear', {'chemical' : value.id, 'amount' : 10}, (!value.injectable || ((value.occ_amount + 10) > data.maxchem)) ? 'disabled' : null)}}
</div>
</div>
{{/for}}
</div>