mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 02:09:41 +00:00
Merge pull request #6082 from Heroman3003/sleeper-a-roo
Fixes several issues with sleepers
This commit is contained in:
@@ -15,6 +15,11 @@
|
||||
..()
|
||||
findsleeper()
|
||||
|
||||
/obj/machinery/sleep_console/Destroy()
|
||||
if(sleeper)
|
||||
sleeper.console = null
|
||||
return ..()
|
||||
|
||||
/obj/machinery/sleep_console/proc/findsleeper()
|
||||
spawn(5)
|
||||
var/obj/machinery/sleeper/sleepernew = null
|
||||
@@ -34,16 +39,18 @@
|
||||
if(..())
|
||||
return 1
|
||||
|
||||
if(!sleeper)
|
||||
findsleeper()
|
||||
if(!sleeper)
|
||||
to_chat(user, "<span class='notice'>Sleeper not found!</span>")
|
||||
return
|
||||
|
||||
if(sleeper.panel_open)
|
||||
to_chat(user, "<span class='notice'>Close the maintenance panel first.</span>")
|
||||
return
|
||||
|
||||
if(!sleeper)
|
||||
findsleeper()
|
||||
if(sleeper)
|
||||
return ui_interact(user)
|
||||
else
|
||||
to_chat(user, "<span class='warning'>Sleeper not found!</span>")
|
||||
|
||||
/obj/machinery/sleep_console/attackby(var/obj/item/I, var/mob/user)
|
||||
if(computer_deconstruction_screwdriver(user, I))
|
||||
@@ -155,7 +162,8 @@
|
||||
anchored = 1
|
||||
circuit = /obj/item/weapon/circuitboard/sleeper
|
||||
var/mob/living/carbon/human/occupant = null
|
||||
var/list/available_chemicals = list("inaprovaline" = "Inaprovaline", "paracetamol" = "Paracetamol", "anti_toxin" = "Dylovene", "dexalin" = "Dexalin")
|
||||
var/list/available_chemicals = list()
|
||||
var/list/base_chemicals = list("inaprovaline" = "Inaprovaline", "paracetamol" = "Paracetamol", "anti_toxin" = "Dylovene", "dexalin" = "Dexalin")
|
||||
var/obj/item/weapon/reagent_containers/glass/beaker = null
|
||||
var/filtering = 0
|
||||
var/obj/machinery/sleep_console/console
|
||||
@@ -180,13 +188,19 @@
|
||||
component_parts += new /obj/item/weapon/reagent_containers/syringe(src)
|
||||
component_parts += new /obj/item/stack/material/glass/reinforced(src, 2)
|
||||
|
||||
RefreshParts(0)
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/sleeper/RefreshParts(var/limited = 1)
|
||||
/obj/machinery/sleeper/Destroy()
|
||||
if(console)
|
||||
console.sleeper = null
|
||||
return ..()
|
||||
|
||||
/obj/machinery/sleeper/RefreshParts(var/limited = 0)
|
||||
var/man_rating = 0
|
||||
var/cap_rating = 0
|
||||
|
||||
available_chemicals = initial(available_chemicals)
|
||||
available_chemicals.Cut()
|
||||
available_chemicals = base_chemicals.Copy()
|
||||
idle_power_usage = initial(idle_power_usage)
|
||||
active_power_usage = initial(active_power_usage)
|
||||
|
||||
@@ -204,14 +218,14 @@
|
||||
if(istype(P, /obj/item/weapon/stock_parts/manipulator))
|
||||
man_rating += P.rating - 1
|
||||
|
||||
var/new_chemicals = list()
|
||||
var/list/new_chemicals = list()
|
||||
|
||||
if(man_rating >= 4) // Alien tech.
|
||||
var/reag_ID = pickweight(
|
||||
var/reag_ID = pickweight(list(
|
||||
"healing_nanites" = 10,
|
||||
"shredding_nanites" = 5,
|
||||
"irradiated_nanites" = 5,
|
||||
"neurophage_nanites" = 2
|
||||
"neurophage_nanites" = 2)
|
||||
)
|
||||
new_chemicals[reag_ID] = "Nanite"
|
||||
if(man_rating >= 3) // Anomalous tech.
|
||||
@@ -221,6 +235,7 @@
|
||||
if(man_rating >= 1) // Tier 2.
|
||||
new_chemicals["leporazine"] = "Leporazine"
|
||||
|
||||
if(new_chemicals.len)
|
||||
available_chemicals += new_chemicals
|
||||
return
|
||||
|
||||
@@ -258,11 +273,8 @@
|
||||
var/obj/item/weapon/grab/G = I
|
||||
if(G.affecting)
|
||||
go_in(G.affecting, user)
|
||||
else if(default_deconstruction_screwdriver(user, I))
|
||||
return
|
||||
else if(default_deconstruction_crowbar(user, I))
|
||||
return
|
||||
else if(istype(I, /obj/item/weapon/reagent_containers/glass))
|
||||
if(istype(I, /obj/item/weapon/reagent_containers/glass))
|
||||
if(!beaker)
|
||||
beaker = I
|
||||
user.drop_item()
|
||||
@@ -271,6 +283,13 @@
|
||||
else
|
||||
to_chat(user, "<span class='warning'>\The [src] has a beaker already.</span>")
|
||||
return
|
||||
if(!occupant)
|
||||
if(default_deconstruction_screwdriver(user, I))
|
||||
return
|
||||
if(default_deconstruction_crowbar(user, I))
|
||||
return
|
||||
if(default_part_replacement(user, I))
|
||||
return
|
||||
|
||||
/obj/machinery/sleeper/verb/move_eject()
|
||||
set name = "Eject occupant"
|
||||
@@ -397,4 +416,4 @@
|
||||
|
||||
/obj/machinery/sleeper/survival_pod/Initialize()
|
||||
..()
|
||||
RefreshParts()
|
||||
RefreshParts(1)
|
||||
|
||||
@@ -24,6 +24,11 @@
|
||||
component_parts += new /obj/item/stack/material/glass/reinforced(src, 2)
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/bodyscanner/Destroy()
|
||||
if(console)
|
||||
console.scanner = null
|
||||
return ..()
|
||||
|
||||
/obj/machinery/bodyscanner/power_change()
|
||||
..()
|
||||
if(!(stat & (BROKEN|NOPOWER)))
|
||||
@@ -32,11 +37,7 @@
|
||||
set_light(0)
|
||||
|
||||
/obj/machinery/bodyscanner/attackby(var/obj/item/G, user as mob)
|
||||
if(default_deconstruction_screwdriver(user, G))
|
||||
return
|
||||
else if(default_deconstruction_crowbar(user, G))
|
||||
return
|
||||
else if(istype(G, /obj/item/weapon/grab))
|
||||
if(istype(G, /obj/item/weapon/grab))
|
||||
var/obj/item/weapon/grab/H = G
|
||||
if(panel_open)
|
||||
to_chat(user, "<span class='notice'>Close the maintenance panel first.</span>")
|
||||
@@ -61,6 +62,11 @@
|
||||
update_icon() //icon_state = "body_scanner_1" //VOREStation Edit - Health display for consoles with light and such.
|
||||
add_fingerprint(user)
|
||||
qdel(G)
|
||||
if(!occupant)
|
||||
if(default_deconstruction_screwdriver(user, G))
|
||||
return
|
||||
if(default_deconstruction_crowbar(user, G))
|
||||
return
|
||||
|
||||
/obj/machinery/bodyscanner/MouseDrop_T(mob/living/carbon/O, mob/user as mob)
|
||||
if(!istype(O))
|
||||
@@ -176,6 +182,11 @@
|
||||
..()
|
||||
findscanner()
|
||||
|
||||
/obj/machinery/body_scanconsole/Destroy()
|
||||
if(scanner)
|
||||
scanner.console = null
|
||||
return ..()
|
||||
|
||||
/obj/machinery/body_scanconsole/attackby(var/obj/item/I, var/mob/user)
|
||||
if(computer_deconstruction_screwdriver(user, I))
|
||||
return
|
||||
@@ -245,18 +256,18 @@
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
|
||||
if(!scanner)
|
||||
findscanner()
|
||||
if(!scanner)
|
||||
to_chat(user, "<span class='notice'>Scanner not found!</span>")
|
||||
return
|
||||
|
||||
if (scanner.panel_open)
|
||||
to_chat(user, "<span class='notice'>Close the maintenance panel first.</span>")
|
||||
return
|
||||
|
||||
if(!scanner)
|
||||
findscanner()
|
||||
if(scanner)
|
||||
return ui_interact(user)
|
||||
else if(scanner)
|
||||
return ui_interact(user)
|
||||
else
|
||||
to_chat(user, "<span class='warning'>Scanner not found!</span>")
|
||||
|
||||
/obj/machinery/body_scanconsole/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
var/data[0]
|
||||
|
||||
Reference in New Issue
Block a user