mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2025-12-11 10:22:13 +00:00
Changes /obj/machinery to have atom/movable occupants
This commit is contained in:
@@ -116,12 +116,13 @@
|
||||
else
|
||||
dat += "<h3>Subject Status : </h3>"
|
||||
dat += "[occupant.name] => "
|
||||
switch(occupant.stat)
|
||||
if(0)
|
||||
var/mob/living/mob_occupant = occupant
|
||||
switch(mob_occupant.stat)
|
||||
if(CONSCIOUS)
|
||||
dat += "<span class='good'>Conscious</span>"
|
||||
if(1)
|
||||
if(UNCONSCIOUS)
|
||||
dat += "<span class='average'>Unconscious</span>"
|
||||
else
|
||||
else // DEAD
|
||||
dat += "<span class='bad'>Deceased</span>"
|
||||
dat += "<br>"
|
||||
dat += "[flash]"
|
||||
@@ -146,9 +147,11 @@
|
||||
if(href_list["close"])
|
||||
close_machine()
|
||||
return
|
||||
if(occupant && occupant.stat != DEAD)
|
||||
if(href_list["experiment"])
|
||||
flash = Experiment(occupant,href_list["experiment"])
|
||||
if(occupant)
|
||||
var/mob/living/mob_occupant = occupant
|
||||
if(mob_occupant.stat != DEAD)
|
||||
if(href_list["experiment"])
|
||||
flash = Experiment(occupant,href_list["experiment"])
|
||||
updateUsrDialog()
|
||||
add_fingerprint(usr)
|
||||
|
||||
|
||||
@@ -79,7 +79,8 @@
|
||||
/obj/machinery/sleeper/close_machine(mob/user)
|
||||
if((isnull(user) || istype(user)) && state_open && !panel_open)
|
||||
..(user)
|
||||
if(occupant && occupant.stat != DEAD)
|
||||
var/mob/living/mob_occupant = occupant
|
||||
if(mob_occupant && mob_occupant.stat != DEAD)
|
||||
to_chat(occupant, "<span class='notice'><b>You feel cool air surround you. You go numb as your senses turn inward.</b></span>")
|
||||
|
||||
/obj/machinery/sleeper/emp_act(severity)
|
||||
@@ -128,27 +129,30 @@
|
||||
data["chems"] += list(list("name" = R.name, "id" = R.id, "allowed" = chem_allowed(chem)))
|
||||
|
||||
data["occupant"] = list()
|
||||
if(occupant)
|
||||
data["occupant"]["name"] = occupant.name
|
||||
data["occupant"]["stat"] = occupant.stat
|
||||
data["occupant"]["health"] = occupant.health
|
||||
data["occupant"]["maxHealth"] = occupant.maxHealth
|
||||
var/mob/living/mob_occupant = occupant
|
||||
if(mob_occupant)
|
||||
data["occupant"]["name"] = mob_occupant.name
|
||||
data["occupant"]["stat"] = mob_occupant.stat
|
||||
data["occupant"]["health"] = mob_occupant.health
|
||||
data["occupant"]["maxHealth"] = mob_occupant.maxHealth
|
||||
data["occupant"]["minHealth"] = HEALTH_THRESHOLD_DEAD
|
||||
data["occupant"]["bruteLoss"] = occupant.getBruteLoss()
|
||||
data["occupant"]["oxyLoss"] = occupant.getOxyLoss()
|
||||
data["occupant"]["toxLoss"] = occupant.getToxLoss()
|
||||
data["occupant"]["fireLoss"] = occupant.getFireLoss()
|
||||
data["occupant"]["cloneLoss"] = occupant.getCloneLoss()
|
||||
data["occupant"]["brainLoss"] = occupant.getBrainLoss()
|
||||
data["occupant"]["bruteLoss"] = mob_occupant.getBruteLoss()
|
||||
data["occupant"]["oxyLoss"] = mob_occupant.getOxyLoss()
|
||||
data["occupant"]["toxLoss"] = mob_occupant.getToxLoss()
|
||||
data["occupant"]["fireLoss"] = mob_occupant.getFireLoss()
|
||||
data["occupant"]["cloneLoss"] = mob_occupant.getCloneLoss()
|
||||
data["occupant"]["brainLoss"] = mob_occupant.getBrainLoss()
|
||||
data["occupant"]["reagents"] = list()
|
||||
if(occupant.reagents.reagent_list.len)
|
||||
for(var/datum/reagent/R in occupant.reagents.reagent_list)
|
||||
for(var/datum/reagent/R in mob_occupant.reagents.reagent_list)
|
||||
data["occupant"]["reagents"] += list(list("name" = R.name, "volume" = R.volume))
|
||||
return data
|
||||
|
||||
/obj/machinery/sleeper/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
var/mob/living/mob_occupant = occupant
|
||||
|
||||
switch(action)
|
||||
if("door")
|
||||
if(state_open)
|
||||
@@ -158,9 +162,9 @@
|
||||
. = TRUE
|
||||
if("inject")
|
||||
var/chem = params["chem"]
|
||||
if(!is_operational() || !occupant)
|
||||
if(!is_operational() || mob_occupant)
|
||||
return
|
||||
if(occupant.health < min_health && chem != "epinephrine")
|
||||
if(mob_occupant.health < min_health && chem != "epinephrine")
|
||||
return
|
||||
if(inject_chem(chem))
|
||||
. = TRUE
|
||||
@@ -177,10 +181,11 @@
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/sleeper/proc/chem_allowed(chem)
|
||||
if(!occupant)
|
||||
return
|
||||
var/amount = occupant.reagents.get_reagent_amount(chem) + 10 <= 20 * efficiency
|
||||
var/occ_health = occupant.health > min_health || chem == "epinephrine"
|
||||
var/mob/living/mob_occupant = occupant
|
||||
if(!mob_occupant)
|
||||
return
|
||||
var/amount = mob_occupant.reagents.get_reagent_amount(chem) + 10 <= 20 * efficiency
|
||||
var/occ_health = mob_occupant.health > min_health || chem == "epinephrine"
|
||||
return amount && occ_health
|
||||
|
||||
/obj/machinery/sleeper/proc/reset_chem_buttons()
|
||||
|
||||
@@ -121,10 +121,12 @@
|
||||
|
||||
/obj/machinery/clonepod/examine(mob/user)
|
||||
..()
|
||||
var/mob/living/mob_occupant = occupant
|
||||
if(mess)
|
||||
to_chat(user, "It's filled with blood and viscera. You swear you can see it moving...")
|
||||
if (is_operational() && (!isnull(occupant)) && (occupant.stat != DEAD))
|
||||
to_chat(user, "Current clone cycle is [round(get_completion())]% complete.")
|
||||
if(is_operational() && mob_occupant)
|
||||
if(mob_occupant.stat != DEAD)
|
||||
to_chat(user, "Current clone cycle is [round(get_completion())]% complete.")
|
||||
|
||||
/obj/machinery/clonepod/return_air()
|
||||
// We want to simulate the clone not being in contact with
|
||||
@@ -136,7 +138,10 @@
|
||||
return GM
|
||||
|
||||
/obj/machinery/clonepod/proc/get_completion()
|
||||
. = (100 * ((occupant.health + 100) / (heal_level + 100)))
|
||||
. = FALSE
|
||||
var/mob/living/mob_occupant = occupant
|
||||
if(mob_occupant)
|
||||
. = (100 * ((mob_occupant.health + 100) / (heal_level + 100)))
|
||||
|
||||
/obj/machinery/clonepod/attack_ai(mob/user)
|
||||
return examine(user)
|
||||
@@ -223,25 +228,26 @@
|
||||
|
||||
//Grow clones to maturity then kick them out. FREELOADERS
|
||||
/obj/machinery/clonepod/process()
|
||||
var/mob/living/mob_occupant = occupant
|
||||
|
||||
if(!is_operational()) //Autoeject if power is lost
|
||||
if (occupant)
|
||||
if(mob_occupant)
|
||||
go_out()
|
||||
connected_message("Clone Ejected: Loss of power.")
|
||||
|
||||
else if((occupant) && (occupant.loc == src))
|
||||
if((occupant.stat == DEAD) || (occupant.suiciding) || occupant.hellbound) //Autoeject corpses and suiciding dudes.
|
||||
else if(mob_occupant && (mob_occupant.loc == src))
|
||||
if((mob_occupant.stat == DEAD) || (mob_occupant.suiciding) || mob_occupant.hellbound) //Autoeject corpses and suiciding dudes.
|
||||
connected_message("Clone Rejected: Deceased.")
|
||||
SPEAK("The cloning of [occupant.real_name] has been \
|
||||
SPEAK("The cloning of [mob_occupant.real_name] has been \
|
||||
aborted due to unrecoverable tissue failure.")
|
||||
go_out()
|
||||
|
||||
else if(occupant.cloneloss > (100 - heal_level))
|
||||
occupant.Paralyse(4)
|
||||
else if(mob_occupant.cloneloss > (100 - heal_level))
|
||||
mob_occupant.Paralyse(4)
|
||||
|
||||
//Slowly get that clone healed and finished.
|
||||
occupant.adjustCloneLoss(-((speed_coeff/2) * config.damage_multiplier))
|
||||
var/progress = CLONE_INITIAL_DAMAGE - occupant.getCloneLoss()
|
||||
mob_occupant.adjustCloneLoss(-((speed_coeff/2) * config.damage_multiplier))
|
||||
var/progress = CLONE_INITIAL_DAMAGE - mob_occupant.getCloneLoss()
|
||||
// To avoid the default cloner making incomplete clones
|
||||
progress += (100 - MINIMUM_HEAL_LEVEL)
|
||||
var/milestone = CLONE_INITIAL_DAMAGE / flesh_number
|
||||
@@ -252,24 +258,24 @@
|
||||
var/obj/item/I = pick_n_take(unattached_flesh)
|
||||
if(isorgan(I))
|
||||
var/obj/item/organ/O = I
|
||||
O.Insert(occupant)
|
||||
O.Insert(mob_occupant)
|
||||
else if(isbodypart(I))
|
||||
var/obj/item/bodypart/BP = I
|
||||
BP.attach_limb(occupant)
|
||||
BP.attach_limb(mob_occupant)
|
||||
|
||||
//Premature clones may have brain damage.
|
||||
occupant.adjustBrainLoss(-((speed_coeff/2) * config.damage_multiplier))
|
||||
mob_occupant.adjustBrainLoss(-((speed_coeff/2) * config.damage_multiplier))
|
||||
|
||||
check_brine()
|
||||
|
||||
use_power(7500) //This might need tweaking.
|
||||
|
||||
else if((occupant.cloneloss <= (100 - heal_level)))
|
||||
else if((mob_occupant.cloneloss <= (100 - heal_level)))
|
||||
connected_message("Cloning Process Complete.")
|
||||
SPEAK("The cloning cycle of [occupant.real_name] is complete.")
|
||||
SPEAK("The cloning cycle of [mob_occupant.real_name] is complete.")
|
||||
go_out()
|
||||
|
||||
else if ((!occupant) || (occupant.loc != src))
|
||||
else if (!mob_occupant || mob_occupant.loc != src)
|
||||
occupant = null
|
||||
if (!mess && !panel_open)
|
||||
icon_state = "pod_0"
|
||||
@@ -339,6 +345,7 @@
|
||||
|
||||
/obj/machinery/clonepod/proc/go_out()
|
||||
countdown.stop()
|
||||
var/mob/living/mob_occupant = occupant
|
||||
|
||||
if(mess) //Clean that mess and dump those gibs!
|
||||
mess = FALSE
|
||||
@@ -347,22 +354,25 @@
|
||||
icon_state = "pod_0"
|
||||
return
|
||||
|
||||
if(!occupant)
|
||||
if(!mob_occupant)
|
||||
return
|
||||
|
||||
|
||||
if(grab_ghost_when == CLONER_MATURE_CLONE)
|
||||
occupant.grab_ghost()
|
||||
mob_occupant.grab_ghost()
|
||||
to_chat(occupant, "<span class='notice'><b>There is a bright flash!</b><br><i>You feel like a new being.</i></span>")
|
||||
occupant.flash_act()
|
||||
mob_occupant.flash_act()
|
||||
|
||||
var/turf/T = get_turf(src)
|
||||
occupant.forceMove(T)
|
||||
icon_state = "pod_0"
|
||||
occupant.domutcheck(1) //Waiting until they're out before possible monkeyizing. The 1 argument forces powers to manifest.
|
||||
mob_occupant.domutcheck(1) //Waiting until they're out before possible monkeyizing. The 1 argument forces powers to manifest.
|
||||
|
||||
occupant = null
|
||||
|
||||
/obj/machinery/clonepod/proc/malfunction()
|
||||
if(occupant)
|
||||
var/mob/living/mob_occupant = occupant
|
||||
if(mob_occupant)
|
||||
connected_message("Critical Error!")
|
||||
SPEAK("Critical error! Please contact a Thinktronic Systems \
|
||||
technician, as your warranty may be affected.")
|
||||
|
||||
38
code/game/machinery/cloning.dm.rej
Normal file
38
code/game/machinery/cloning.dm.rej
Normal file
@@ -0,0 +1,38 @@
|
||||
diff a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm (rejected hunks)
|
||||
@@ -311,15 +311,15 @@
|
||||
to_chat(user, "<font color = #666633>-% Successfully stored \ref[P.buffer] [P.buffer.name] in buffer %-</font color>")
|
||||
return
|
||||
|
||||
+ var/mob/living/mob_occupant = occupant
|
||||
if(W.GetID())
|
||||
if(!check_access(W))
|
||||
to_chat(user, "<span class='danger'>Access Denied.</span>")
|
||||
return
|
||||
- if(!(occupant || mess))
|
||||
+ if(!(mob_occupant || mess))
|
||||
to_chat(user, "<span class='danger'>Error: Pod has no occupant.</span>")
|
||||
return
|
||||
else
|
||||
- var/mob/living/mob_occupant
|
||||
connected_message("Authorized Ejection")
|
||||
SPEAK("An authorized ejection of [clonemind.name] has occurred.")
|
||||
to_chat(user, "<span class='notice'>You force an emergency ejection. </span>")
|
||||
@@ -395,16 +395,10 @@
|
||||
go_out()
|
||||
|
||||
/obj/machinery/clonepod/emp_act(severity)
|
||||
-<<<<<<< HEAD
|
||||
- if((occupant || mess) && prob(100/(severity*efficiency)))
|
||||
- connected_message(Gibberish("EMP-caused Accidental Ejection", 0))
|
||||
- SPEAK(Gibberish("Exposure to electromagnetic fields has caused the ejection of [clonemind.name] prematurely." ,0))
|
||||
-=======
|
||||
- if(isliving(occupant) && prob(100/(severity*efficiency)))
|
||||
- var/mob/living/mob_occupant = occupant
|
||||
+ var/mob/living/mob_occupant = occupant
|
||||
+ if(mob_occupant && prob(100/(severity*efficiency)))
|
||||
connected_message(Gibberish("EMP-caused Accidental Ejection", 0))
|
||||
SPEAK(Gibberish("Exposure to electromagnetic fields has caused the ejection of [mob_occupant.real_name] prematurely." ,0))
|
||||
->>>>>>> Changes /obj/machinery to have atom/movable occupants
|
||||
go_out()
|
||||
..()
|
||||
|
||||
@@ -186,21 +186,23 @@
|
||||
// Scanner
|
||||
if (!isnull(src.scanner))
|
||||
|
||||
var/mob/living/scanner_occupant = scanner.occupant
|
||||
|
||||
dat += "<h3>Scanner Functions</h3>"
|
||||
|
||||
dat += "<div class='statusDisplay'>"
|
||||
if (!src.scanner.occupant)
|
||||
if(!scanner_occupant)
|
||||
dat += "Scanner Unoccupied"
|
||||
else if(loading)
|
||||
dat += "[src.scanner.occupant] => Scanning..."
|
||||
dat += "[scanner_occupant] => Scanning..."
|
||||
else
|
||||
if (src.scanner.occupant.ckey != scantemp_ckey)
|
||||
if(scanner_occupant.ckey != scantemp_ckey)
|
||||
scantemp = "Ready to Scan"
|
||||
scantemp_ckey = src.scanner.occupant.ckey
|
||||
dat += "[src.scanner.occupant] => [scantemp]"
|
||||
scantemp_ckey = scanner_occupant.ckey
|
||||
dat += "[scanner_occupant] => [scantemp]"
|
||||
dat += "</div>"
|
||||
|
||||
if (src.scanner.occupant)
|
||||
if(scanner_occupant)
|
||||
dat += "<a href='byond://?src=\ref[src];scan=1'>Start Scan</a>"
|
||||
dat += "<br><a href='byond://?src=\ref[src];lock=1'>[src.scanner.locked ? "Unlock Scanner" : "Lock Scanner"]</a>"
|
||||
else
|
||||
|
||||
@@ -105,13 +105,14 @@
|
||||
..()
|
||||
|
||||
// search for ghosts, if the corpse is empty and the scanner is connected to a cloner
|
||||
if(occupant)
|
||||
var/mob/living/mob_occupant = occupant
|
||||
if(mob_occupant)
|
||||
if(locate(/obj/machinery/computer/cloning, get_step(src, NORTH)) \
|
||||
|| locate(/obj/machinery/computer/cloning, get_step(src, SOUTH)) \
|
||||
|| locate(/obj/machinery/computer/cloning, get_step(src, EAST)) \
|
||||
|| locate(/obj/machinery/computer/cloning, get_step(src, WEST)))
|
||||
if(!occupant.suiciding && !(occupant.disabilities & NOCLONE) && !occupant.hellbound)
|
||||
occupant.notify_ghost_cloning("Your corpse has been placed into a cloning scanner. Re-enter your corpse if you want to be cloned!", source = src)
|
||||
if(!mob_occupant.suiciding && !(mob_occupant.disabilities & NOCLONE) && !mob_occupant.hellbound)
|
||||
mob_occupant.notify_ghost_cloning("Your corpse has been placed into a cloning scanner. Re-enter your corpse if you want to be cloned!", source = src)
|
||||
|
||||
var/obj/machinery/computer/scan_consolenew/console
|
||||
for(dir in list(NORTH,EAST,SOUTH,WEST))
|
||||
@@ -157,4 +158,4 @@
|
||||
if(..(user,1,0)) //don't set the machine, since there's no dialog
|
||||
return
|
||||
|
||||
toggle_open(user)
|
||||
toggle_open(user)
|
||||
|
||||
@@ -136,13 +136,14 @@ The console is located at computer/gulag_teleporter.dm
|
||||
/obj/machinery/gulag_teleporter/proc/strip_occupant()
|
||||
if(linked_reclaimer)
|
||||
linked_reclaimer.stored_items[occupant] = list()
|
||||
for(var/obj/item/W in occupant)
|
||||
if(!is_type_in_typecache(W, required_items) && occupant.temporarilyRemoveItemFromInventory(W))
|
||||
var/mob/living/mob_occupant = occupant
|
||||
for(var/obj/item/W in mob_occupant)
|
||||
if(!is_type_in_typecache(W, required_items) && mob_occupant.temporarilyRemoveItemFromInventory(W))
|
||||
if(istype(W, /obj/item/weapon/restraints/handcuffs))
|
||||
W.forceMove(get_turf(src))
|
||||
continue
|
||||
if(linked_reclaimer)
|
||||
linked_reclaimer.stored_items[occupant] += W
|
||||
linked_reclaimer.stored_items[mob_occupant] += W
|
||||
linked_reclaimer.contents += W
|
||||
W.forceMove(linked_reclaimer)
|
||||
else
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
Overview:
|
||||
Used to create objects that need a per step proc call. Default definition of 'New()'
|
||||
Used to create objects that need a per step proc call. Default definition of 'Initialize()'
|
||||
stores a reference to src machine in global 'machines list'. Default definition
|
||||
of 'Del' removes reference to src machine in global 'machines list'.
|
||||
of 'Destroy' removes reference to src machine in global 'machines list'.
|
||||
|
||||
Class Variables:
|
||||
use_power (num)
|
||||
@@ -44,7 +44,7 @@ Class Variables:
|
||||
EMPED:16 -- temporary broken by EMP pulse
|
||||
|
||||
Class Procs:
|
||||
New() 'game/machinery/machine.dm'
|
||||
Initialize() 'game/machinery/machine.dm'
|
||||
|
||||
Destroy() 'game/machinery/machine.dm'
|
||||
|
||||
@@ -118,14 +118,15 @@ Class Procs:
|
||||
var/panel_open = 0
|
||||
var/state_open = 0
|
||||
var/critical_machine = FALSE //If this machine is critical to station operation and should have the area be excempted from power failures.
|
||||
var/mob/living/occupant = null
|
||||
var/list/occupant_typecache = list(/mob/living) // turned into typecache in Initialize
|
||||
var/atom/movable/occupant = null
|
||||
var/unsecuring_tool = /obj/item/weapon/wrench
|
||||
var/interact_open = 0 // Can the machine be interacted with when in maint/when the panel is open.
|
||||
var/interact_offline = 0 // Can the machine be interacted with while de-powered.
|
||||
var/speed_process = 0 // Process as fast as possible?
|
||||
|
||||
/obj/machinery/Initialize()
|
||||
if (!armor)
|
||||
if(!armor)
|
||||
armor = list(melee = 25, bullet = 10, laser = 10, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 50, acid = 70)
|
||||
. = ..()
|
||||
GLOB.machines += src
|
||||
@@ -135,6 +136,8 @@ Class Procs:
|
||||
START_PROCESSING(SSfastprocess, src)
|
||||
power_change()
|
||||
|
||||
occupant_typecache = typecacheof(occupant_typecache)
|
||||
|
||||
/obj/machinery/Destroy()
|
||||
GLOB.machines.Remove(src)
|
||||
if(!speed_process)
|
||||
@@ -176,16 +179,24 @@ Class Procs:
|
||||
L.update_canmove()
|
||||
occupant = null
|
||||
|
||||
/obj/machinery/proc/close_machine(mob/living/target = null)
|
||||
/obj/machinery/proc/close_machine(atom/movable/target = null)
|
||||
state_open = 0
|
||||
density = 1
|
||||
if(!target)
|
||||
for(var/mob/living/carbon/C in loc)
|
||||
if(C.buckled || C.has_buckled_mobs())
|
||||
for(var/am in loc)
|
||||
if(!is_type_in_typecache(am, occupant_typecache))
|
||||
continue
|
||||
else
|
||||
target = C
|
||||
if(target && !target.buckled && !target.has_buckled_mobs())
|
||||
var/atom/movable/AM = am
|
||||
if(AM.has_buckled_mobs())
|
||||
continue
|
||||
if(isliving(AM))
|
||||
var/mob/living/L = am
|
||||
if(L.buckled)
|
||||
continue
|
||||
target = am
|
||||
|
||||
var/mob/living/mobtarget = target
|
||||
if(target && !target.has_buckled_mobs() && (!isliving(target) || !mobtarget.buckled))
|
||||
occupant = target
|
||||
target.forceMove(src)
|
||||
updateUsrDialog()
|
||||
|
||||
@@ -211,13 +211,13 @@
|
||||
uv = TRUE
|
||||
locked = TRUE
|
||||
update_icon()
|
||||
if(occupant)
|
||||
if(occupant)
|
||||
var/mob/living/mob_occupant = occupant
|
||||
if(uv_super)
|
||||
occupant.adjustFireLoss(rand(20, 36))
|
||||
mob_occupant.adjustFireLoss(rand(20, 36))
|
||||
else
|
||||
occupant.adjustFireLoss(rand(10, 16))
|
||||
if(iscarbon(occupant))
|
||||
occupant.emote("scream")
|
||||
mob_occupant.adjustFireLoss(rand(10, 16))
|
||||
mob_occupant.emote("scream")
|
||||
addtimer(CALLBACK(src, .proc/cook), 50)
|
||||
else
|
||||
uv_cycles = initial(uv_cycles)
|
||||
@@ -368,14 +368,15 @@
|
||||
else if(!helmet && !mask && !suit && !storage && !occupant)
|
||||
return
|
||||
else
|
||||
if(occupant)
|
||||
to_chat(occupant, "<span class='userdanger'>[src]'s confines grow warm, then hot, then scorching. You're being burned [!occupant.stat ? "alive" : "away"]!</span>")
|
||||
if(occupant)
|
||||
var/mob/living/mob_occupant = occupant
|
||||
to_chat(mob_occupant, "<span class='userdanger'>[src]'s confines grow warm, then hot, then scorching. You're being burned [!mob_occupant.stat ? "alive" : "away"]!</span>")
|
||||
cook()
|
||||
. = TRUE
|
||||
if("dispense")
|
||||
if(!state_open)
|
||||
return
|
||||
|
||||
|
||||
var/static/list/valid_items = list("helmet", "suit", "mask", "storage")
|
||||
var/item_name = params["item"]
|
||||
if(item_name in valid_items)
|
||||
|
||||
@@ -41,9 +41,10 @@
|
||||
data["open"] = state_open
|
||||
|
||||
data["occupant"] = list()
|
||||
if(occupant)
|
||||
data["occupant"]["name"] = occupant.name
|
||||
data["occupant"]["stat"] = occupant.stat
|
||||
if(occupant)
|
||||
var/mob/living/mob_occupant = occupant
|
||||
data["occupant"]["name"] = mob_occupant.name
|
||||
data["occupant"]["stat"] = mob_occupant.stat
|
||||
|
||||
data["special_name"] = special ? special_name : null
|
||||
data["ready_implants"] = ready_implants
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
icon_state = "sleeper"
|
||||
state_open = TRUE
|
||||
anchored = TRUE
|
||||
occupant_typecache = list(/mob/living/carbon/human) // turned into typecache in Initialize
|
||||
var/you_die_in_the_game_you_die_for_real = FALSE
|
||||
var/datum/effect_system/spark_spread/sparks
|
||||
var/mob/living/carbon/human/virtual_reality/vr_human
|
||||
@@ -92,11 +93,12 @@
|
||||
return
|
||||
switch(action)
|
||||
if("vr_connect")
|
||||
if(ishuman(occupant) && occupant.mind)
|
||||
var/mob/living/carbon/human/human_occupant = occupant
|
||||
if(human_occupant && human_occupant.mind)
|
||||
to_chat(occupant, "<span class='warning'>Transfering to virtual reality...</span>")
|
||||
if(vr_human)
|
||||
vr_human.revert_to_reality(FALSE, FALSE)
|
||||
occupant.mind.transfer_to(vr_human)
|
||||
human_occupant.mind.transfer_to(vr_human)
|
||||
vr_human.real_me = occupant
|
||||
to_chat(vr_human, "<span class='notice'>Transfer successful! you are now playing as [vr_human] in VR!</span>")
|
||||
SStgui.close_user_uis(vr_human, src)
|
||||
|
||||
@@ -191,20 +191,21 @@
|
||||
on = FALSE
|
||||
update_icon()
|
||||
return
|
||||
if(occupant)
|
||||
if(occupant)
|
||||
var/mob/living/mob_occupant = occupant
|
||||
var/cold_protection = 0
|
||||
var/mob/living/carbon/human/H = occupant
|
||||
if(istype(H))
|
||||
cold_protection = H.get_cold_protection(air1.temperature)
|
||||
|
||||
var/temperature_delta = air1.temperature - occupant.bodytemperature // The only semi-realistic thing here: share temperature between the cell and the occupant.
|
||||
var/temperature_delta = air1.temperature - mob_occupant.bodytemperature // The only semi-realistic thing here: share temperature between the cell and the occupant.
|
||||
if(abs(temperature_delta) > 1)
|
||||
var/air_heat_capacity = air1.heat_capacity()
|
||||
var/heat = ((1 - cold_protection) / 10 + conduction_coefficient) \
|
||||
* temperature_delta * \
|
||||
(air_heat_capacity * heat_capacity / (air_heat_capacity + heat_capacity))
|
||||
air1.temperature = max(air1.temperature - heat / air_heat_capacity, TCMB)
|
||||
occupant.bodytemperature = max(occupant.bodytemperature + heat / heat_capacity, TCMB)
|
||||
mob_occupant.bodytemperature = max(mob_occupant.bodytemperature + heat / heat_capacity, TCMB)
|
||||
|
||||
air1.gases["o2"][MOLES] -= 0.5 / efficiency // Magically consume gas? Why not, we run on cryo magic.
|
||||
|
||||
@@ -294,17 +295,18 @@
|
||||
data["autoEject"] = autoeject
|
||||
|
||||
var/list/occupantData = list()
|
||||
if(occupant)
|
||||
occupantData["name"] = occupant.name
|
||||
occupantData["stat"] = occupant.stat
|
||||
occupantData["health"] = occupant.health
|
||||
occupantData["maxHealth"] = occupant.maxHealth
|
||||
if(occupant)
|
||||
var/mob/living/mob_occupant = occupant
|
||||
occupantData["name"] = mob_occupant.name
|
||||
occupantData["stat"] = mob_occupant.stat
|
||||
occupantData["health"] = mob_occupant.health
|
||||
occupantData["maxHealth"] = mob_occupant.maxHealth
|
||||
occupantData["minHealth"] = HEALTH_THRESHOLD_DEAD
|
||||
occupantData["bruteLoss"] = occupant.getBruteLoss()
|
||||
occupantData["oxyLoss"] = occupant.getOxyLoss()
|
||||
occupantData["toxLoss"] = occupant.getToxLoss()
|
||||
occupantData["fireLoss"] = occupant.getFireLoss()
|
||||
occupantData["bodyTemperature"] = occupant.bodytemperature
|
||||
occupantData["bruteLoss"] = mob_occupant.getBruteLoss()
|
||||
occupantData["oxyLoss"] = mob_occupant.getOxyLoss()
|
||||
occupantData["toxLoss"] = mob_occupant.getToxLoss()
|
||||
occupantData["fireLoss"] = mob_occupant.getFireLoss()
|
||||
occupantData["bodyTemperature"] = mob_occupant.bodytemperature
|
||||
data["occupant"] = occupantData
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
diff a/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm b/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm (rejected hunks)
|
||||
@@ -110,8 +110,8 @@
|
||||
return
|
||||
var/datum/gas_mixture/air1 = AIR1
|
||||
var/turf/T = get_turf(src)
|
||||
- if(isliving(occupant))
|
||||
- var/mob/living/mob_occupant
|
||||
+ if(occupant)
|
||||
+ var/mob/living/mob_occupant = occupant
|
||||
if(mob_occupant.health >= 100) // Don't bother with fully healed people.
|
||||
on = FALSE
|
||||
update_icon()
|
||||
@@ -168,13 +168,14 @@
|
||||
|
||||
var/offset = prob(50) ? -2 : 2
|
||||
animate(src, pixel_x = pixel_x + offset, time = 0.2, loop = 200) //start shaking
|
||||
var/sourcename = src.occupant.real_name
|
||||
var/mob/living/mob_occupant = occupant
|
||||
var/sourcename = mob_occupant.real_name
|
||||
var/sourcejob
|
||||
if(ishuman(occupant))
|
||||
var/mob/living/carbon/human/gibee = occupant
|
||||
sourcejob = gibee.job
|
||||
var/sourcenutriment = src.occupant.nutrition / 15
|
||||
var/sourcetotalreagents = src.occupant.reagents.total_volume
|
||||
var/sourcenutriment = mob_occupant.nutrition / 15
|
||||
var/sourcetotalreagents = mob_occupant.reagents.total_volume
|
||||
var/gibtype = /obj/effect/decal/cleanable/blood/gibs
|
||||
var/typeofmeat = /obj/item/weapon/reagent_containers/food/snacks/meat/slab/human
|
||||
var/typeofskin = /obj/item/stack/sheet/animalhide/human
|
||||
@@ -212,8 +213,8 @@
|
||||
allskin = newskin
|
||||
|
||||
add_logs(user, occupant, "gibbed")
|
||||
src.occupant.death(1)
|
||||
src.occupant.ghostize()
|
||||
mob_occupant.death(1)
|
||||
mob_occupant.ghostize()
|
||||
qdel(src.occupant)
|
||||
spawn(src.gibtime)
|
||||
playsound(src.loc, 'sound/effects/splat.ogg', 50, 1)
|
||||
|
||||
Reference in New Issue
Block a user