mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-28 06:27:26 +01:00
Additional constructable and upgradeable machines, adds soap to drones, updates teleporter
This commit is contained in:
+107
-50
@@ -1,47 +1,69 @@
|
||||
/obj/machinery/atmospherics/unary/cold_sink/freezer
|
||||
name = "gas cooling system"
|
||||
name = "freezer"
|
||||
icon = 'icons/obj/Cryogenic2.dmi'
|
||||
icon_state = "freezer_0"
|
||||
icon_state = "freezer"
|
||||
density = 1
|
||||
|
||||
var/min_temperature = 0
|
||||
anchored = 1.0
|
||||
|
||||
use_power = 1
|
||||
current_heat_capacity = 1000
|
||||
|
||||
/obj/machinery/atmospherics/unary/cold_sink/freezer/New()
|
||||
..()
|
||||
initialize_directions = dir
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/thermomachine(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/micro_laser(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/micro_laser(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(src)
|
||||
component_parts += new /obj/item/stack/cable_coil(src, 1)
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/atmospherics/unary/cold_sink/freezer/initialize()
|
||||
if(node) return
|
||||
/obj/machinery/atmospherics/unary/cold_sink/freezer/RefreshParts()
|
||||
var/H
|
||||
var/T
|
||||
for(var/obj/item/weapon/stock_parts/matter_bin/M in component_parts)
|
||||
H += M.rating
|
||||
for(var/obj/item/weapon/stock_parts/micro_laser/M in component_parts)
|
||||
T += M.rating
|
||||
min_temperature = T0C - (170 + (T*15))
|
||||
current_heat_capacity = 1000 * ((H - 1) ** 2)
|
||||
|
||||
var/node_connect = dir
|
||||
/obj/machinery/atmospherics/unary/cold_sink/freezer/attackby(obj/item/I, mob/user)
|
||||
if(default_deconstruction_screwdriver(user, "freezer-o", "freezer", I))
|
||||
on = 0
|
||||
update_icon()
|
||||
return
|
||||
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node_connect))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
node = target
|
||||
break
|
||||
if(exchange_parts(user, I))
|
||||
return
|
||||
|
||||
update_icon()
|
||||
default_deconstruction_crowbar(I)
|
||||
|
||||
if(default_change_direction_wrench(user, I))
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/unary/cold_sink/freezer/update_icon()
|
||||
if(src.node)
|
||||
if(src.on)
|
||||
icon_state = "freezer_1"
|
||||
else
|
||||
icon_state = "freezer"
|
||||
if(panel_open)
|
||||
icon_state = "freezer-o"
|
||||
else if(src.on)
|
||||
icon_state = "freezer_1"
|
||||
else
|
||||
icon_state = "freezer_0"
|
||||
icon_state = "freezer"
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/unary/cold_sink/freezer/attack_ai(mob/user as mob)
|
||||
src.ui_interact(user)
|
||||
src.attack_hand(user)
|
||||
|
||||
/obj/machinery/atmospherics/unary/cold_sink/freezer/attack_paw(mob/user as mob)
|
||||
src.ui_interact(user)
|
||||
src.attack_hand(user)
|
||||
|
||||
/obj/machinery/atmospherics/unary/cold_sink/freezer/attack_hand(mob/user as mob)
|
||||
if(panel_open)
|
||||
user << "<span class='notice'>Close the maintenance panel first.</span>"
|
||||
return
|
||||
src.ui_interact(user)
|
||||
|
||||
/obj/machinery/atmospherics/unary/cold_sink/freezer/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
@@ -50,7 +72,7 @@
|
||||
data["on"] = on ? 1 : 0
|
||||
data["gasPressure"] = round(air_contents.return_pressure())
|
||||
data["gasTemperature"] = round(air_contents.temperature)
|
||||
data["minGasTemperature"] = round(T0C - 200)
|
||||
data["minGasTemperature"] = round(min_temperature)
|
||||
data["maxGasTemperature"] = round(T20C)
|
||||
data["targetGasTemperature"] = round(current_temperature)
|
||||
|
||||
@@ -74,7 +96,7 @@
|
||||
// auto update every Master Controller tick
|
||||
ui.set_auto_update(1)
|
||||
|
||||
/obj/machinery/atmospherics/unary/cold_sink/freezer/Topic(href, href_list)
|
||||
/obj/machinery/atmospherics/unary/cold_sink/freezer/Topic(href, href_list)
|
||||
if (href_list["toggleStatus"])
|
||||
src.on = !src.on
|
||||
update_icon()
|
||||
@@ -83,20 +105,25 @@
|
||||
if(amount > 0)
|
||||
src.current_temperature = min(T20C, src.current_temperature+amount)
|
||||
else
|
||||
src.current_temperature = max((T0C - 200), src.current_temperature+amount)
|
||||
|
||||
src.current_temperature = max(min_temperature, src.current_temperature+amount)
|
||||
src.add_fingerprint(usr)
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/unary/cold_sink/freezer/process()
|
||||
..()
|
||||
|
||||
/obj/machinery/atmospherics/unary/heat_reservoir/heater
|
||||
name = "gas heating system"
|
||||
icon = 'icons/obj/Cryogenic2.dmi'
|
||||
icon_state = "freezer_0"
|
||||
density = 1
|
||||
/obj/machinery/atmospherics/unary/cold_sink/freezer/power_change()
|
||||
..()
|
||||
if(stat & NOPOWER)
|
||||
on = 0
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/unary/heat_reservoir/heater/
|
||||
name = "heater"
|
||||
icon = 'icons/obj/Cryogenic2.dmi'
|
||||
icon_state = "heater"
|
||||
density = 1
|
||||
var/max_temperature = 0
|
||||
anchored = 1.0
|
||||
|
||||
current_heat_capacity = 1000
|
||||
@@ -104,39 +131,64 @@
|
||||
/obj/machinery/atmospherics/unary/heat_reservoir/heater/New()
|
||||
..()
|
||||
initialize_directions = dir
|
||||
var/obj/item/weapon/circuitboard/thermomachine/H = new /obj/item/weapon/circuitboard/thermomachine(null)
|
||||
H.build_path = /obj/machinery/atmospherics/unary/heat_reservoir/heater
|
||||
H.name = "circuit board (Heater)"
|
||||
component_parts = list()
|
||||
component_parts += H
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/micro_laser(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/micro_laser(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(src)
|
||||
component_parts += new /obj/item/stack/cable_coil(src, 1)
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/atmospherics/unary/heat_reservoir/heater/initialize()
|
||||
if(node) return
|
||||
/obj/machinery/atmospherics/unary/heat_reservoir/heater/RefreshParts()
|
||||
var/H
|
||||
var/T
|
||||
for(var/obj/item/weapon/stock_parts/matter_bin/M in component_parts)
|
||||
H += M.rating
|
||||
for(var/obj/item/weapon/stock_parts/micro_laser/M in component_parts)
|
||||
T += M.rating
|
||||
max_temperature = T20C + (140 * T)
|
||||
current_heat_capacity = 1000 * ((H - 1) ** 2)
|
||||
|
||||
var/node_connect = dir
|
||||
/obj/machinery/atmospherics/unary/heat_reservoir/heater/attackby(obj/item/I, mob/user)
|
||||
if(default_deconstruction_screwdriver(user, "heater-o", "heater", I))
|
||||
on = 0
|
||||
update_icon()
|
||||
return
|
||||
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node_connect))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
node = target
|
||||
break
|
||||
if(exchange_parts(user, I))
|
||||
return
|
||||
|
||||
update_icon()
|
||||
default_deconstruction_crowbar(I)
|
||||
|
||||
if(default_change_direction_wrench(user, I))
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/unary/heat_reservoir/heater/update_icon()
|
||||
if(src.node)
|
||||
if(src.on)
|
||||
icon_state = "heater_1"
|
||||
else
|
||||
icon_state = "heater"
|
||||
if(panel_open)
|
||||
icon_state = "heater-o"
|
||||
else if(src.on)
|
||||
icon_state = "heater_1"
|
||||
else
|
||||
icon_state = "heater_0"
|
||||
icon_state = "heater"
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/unary/heat_reservoir/heater/attack_ai(mob/user as mob)
|
||||
src.ui_interact(user)
|
||||
src.attack_hand(user)
|
||||
|
||||
/obj/machinery/atmospherics/unary/heat_reservoir/heater/attack_paw(mob/user as mob)
|
||||
src.ui_interact(user)
|
||||
src.attack_hand(user)
|
||||
|
||||
/obj/machinery/atmospherics/unary/heat_reservoir/heater/attack_hand(mob/user as mob)
|
||||
if(panel_open)
|
||||
user << "<span class='notice'>Close the maintenance panel first.</span>"
|
||||
return
|
||||
src.ui_interact(user)
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/unary/heat_reservoir/heater/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
// this is the data which will be sent to the ui
|
||||
var/data[0]
|
||||
@@ -144,7 +196,7 @@
|
||||
data["gasPressure"] = round(air_contents.return_pressure())
|
||||
data["gasTemperature"] = round(air_contents.temperature)
|
||||
data["minGasTemperature"] = round(T20C)
|
||||
data["maxGasTemperature"] = round(T20C+280)
|
||||
data["maxGasTemperature"] = round(T20C+max_temperature)
|
||||
data["targetGasTemperature"] = round(current_temperature)
|
||||
|
||||
var/temp_class = "normal"
|
||||
@@ -172,12 +224,17 @@
|
||||
if(href_list["temp"])
|
||||
var/amount = text2num(href_list["temp"])
|
||||
if(amount > 0)
|
||||
src.current_temperature = min((T20C+280), src.current_temperature+amount)
|
||||
src.current_temperature = min((T20C+max_temperature), src.current_temperature+amount)
|
||||
else
|
||||
src.current_temperature = max(T20C, src.current_temperature+amount)
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/unary/heat_reservoir/heater/process()
|
||||
..()
|
||||
..()
|
||||
|
||||
/obj/machinery/atmospherics/unary/heat_reservoir/heater/power_change()
|
||||
..()
|
||||
if(stat & NOPOWER)
|
||||
on = 0
|
||||
update_icon()
|
||||
|
||||
+298
-254
@@ -9,17 +9,34 @@
|
||||
var/obj/machinery/sleeper/connected = null
|
||||
anchored = 1 //About time someone fixed this.
|
||||
density = 1
|
||||
var/orient = "LEFT" // "RIGHT" changes the dir suffix to "-r"
|
||||
dir = 4
|
||||
|
||||
l_color = "#7BF9FF"
|
||||
power_change()
|
||||
..()
|
||||
if(!(stat & (BROKEN|NOPOWER)))
|
||||
SetLuminosity(2)
|
||||
else
|
||||
SetLuminosity(0)
|
||||
var/orient = "LEFT"
|
||||
dir = 8
|
||||
idle_power_usage = 250
|
||||
active_power_usage = 500
|
||||
|
||||
/obj/machinery/sleep_console/power_change()
|
||||
if(stat & BROKEN)
|
||||
icon_state = "console-p"
|
||||
else if(powered() && !panel_open)
|
||||
icon_state = initial(icon_state)
|
||||
stat &= ~NOPOWER
|
||||
else
|
||||
spawn(rand(0, 15))
|
||||
src.icon_state = "console-p"
|
||||
stat |= NOPOWER
|
||||
|
||||
/obj/machinery/sleep_console/New()
|
||||
..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/sleep_console(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(src)
|
||||
component_parts += new /obj/item/stack/cable_coil(src, 2)
|
||||
RefreshParts()
|
||||
findsleeper()
|
||||
|
||||
/obj/machinery/sleep_console/RefreshParts()
|
||||
|
||||
/obj/machinery/sleep_console/process()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
@@ -40,8 +57,7 @@
|
||||
else
|
||||
return
|
||||
|
||||
/obj/machinery/sleep_console/New()
|
||||
..()
|
||||
/obj/machinery/sleep_console/proc/findsleeper()
|
||||
spawn( 5 )
|
||||
var/obj/machinery/sleeper/sleepernew = null
|
||||
// Loop through every direction
|
||||
@@ -51,6 +67,28 @@
|
||||
src.connected = sleepernew
|
||||
return
|
||||
return
|
||||
|
||||
/obj/machinery/sleep_console/attackby(var/obj/item/weapon/G as obj, var/mob/user as mob)
|
||||
if (istype(G, /obj/item/weapon/screwdriver))
|
||||
default_deconstruction_screwdriver(user, "console-p", "console", G)
|
||||
return
|
||||
|
||||
if (istype(G, /obj/item/weapon/wrench))
|
||||
if(panel_open)
|
||||
user << "<span class='notice'>Close the maintenance panel first.</span>"
|
||||
return
|
||||
if(dir == 4)
|
||||
orient = "LEFT"
|
||||
dir = 8
|
||||
else
|
||||
orient = "RIGHT"
|
||||
dir = 4
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
|
||||
if(exchange_parts(user, G))
|
||||
return
|
||||
|
||||
default_deconstruction_crowbar(G)
|
||||
|
||||
/obj/machinery/sleep_console/attack_ai(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
@@ -61,13 +99,13 @@
|
||||
/obj/machinery/sleep_console/attack_hand(mob/user as mob)
|
||||
if(..())
|
||||
return
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
if (panel_open)
|
||||
user << "<span class='notice'>Close the maintenance panel first.</span>"
|
||||
return
|
||||
if (!src.connected)
|
||||
var/obj/machinery/sleeper/sleepernew = null
|
||||
// Loop through every direction
|
||||
for(dir in list(NORTH,EAST,SOUTH,WEST))
|
||||
// Try to find a scanner in that direction
|
||||
sleepernew = locate(/obj/machinery/sleeper, get_step(src, dir))
|
||||
src.connected = sleepernew
|
||||
findsleeper()
|
||||
if (src.connected)
|
||||
var/mob/living/occupant = src.connected.occupant
|
||||
var/dat = "<font color='blue'><B>Occupant Statistics:</B></FONT><BR>"
|
||||
@@ -121,6 +159,9 @@
|
||||
/obj/machinery/sleep_console/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
if(panel_open)
|
||||
usr << "<span class='notice'>Close the maintenance panel first.</span>"
|
||||
return
|
||||
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"])
|
||||
@@ -147,11 +188,6 @@
|
||||
src.add_fingerprint(usr)
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/sleep_console/power_change()
|
||||
return
|
||||
// no change - sleeper works without power (you just can't inject more)
|
||||
|
||||
/////////////////////////////////////////
|
||||
// THE SLEEPER ITSELF
|
||||
/////////////////////////////////////////
|
||||
@@ -162,6 +198,7 @@
|
||||
icon_state = "sleeper-open"
|
||||
density = 1
|
||||
anchored = 1
|
||||
dir = 8
|
||||
var/orient = "LEFT" // "RIGHT" changes the dir suffix to "-r"
|
||||
var/mob/living/carbon/human/occupant = null
|
||||
var/possible_chems = list(list("inaprovaline", "stoxin", "dexalin", "bicaridine", "kelotane"),
|
||||
@@ -174,280 +211,287 @@
|
||||
var/initial_bin_rating = 1
|
||||
var/min_health = 25
|
||||
var/injection_chems = list()
|
||||
dir = 4
|
||||
|
||||
New()
|
||||
idle_power_usage = 1250
|
||||
active_power_usage = 2500
|
||||
|
||||
l_color = "#7BF9FF"
|
||||
|
||||
power_change()
|
||||
..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/sleeper(src)
|
||||
if(!(stat & (BROKEN|NOPOWER)))
|
||||
SetLuminosity(2)
|
||||
else
|
||||
SetLuminosity(0)
|
||||
|
||||
// Customizable bin rating, used by the labor camp to stop people filling themselves with chemicals and escaping.
|
||||
var/obj/item/weapon/stock_parts/matter_bin/B = new(src)
|
||||
B.rating = initial_bin_rating
|
||||
component_parts += B
|
||||
/obj/machinery/sleeper/New()
|
||||
..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/sleeper(src)
|
||||
|
||||
component_parts += new /obj/item/weapon/stock_parts/manipulator(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(src)
|
||||
component_parts += new /obj/item/stack/cable_coil(src, 1)
|
||||
RefreshParts()
|
||||
// Customizable bin rating, used by the labor camp to stop people filling themselves with chemicals and escaping.
|
||||
var/obj/item/weapon/stock_parts/matter_bin/B = new(src)
|
||||
B.rating = initial_bin_rating
|
||||
component_parts += B
|
||||
|
||||
component_parts += new /obj/item/weapon/stock_parts/manipulator(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(src)
|
||||
component_parts += new /obj/item/stack/cable_coil(src, 1)
|
||||
RefreshParts()
|
||||
var/E
|
||||
var/I
|
||||
for(var/obj/item/weapon/stock_parts/matter_bin/B in component_parts)
|
||||
E += B.rating
|
||||
for(var/obj/item/weapon/stock_parts/manipulator/M in component_parts)
|
||||
I += M.rating
|
||||
|
||||
injection_chems = possible_chems[I]
|
||||
efficiency = E
|
||||
min_health = -E * 25
|
||||
/obj/machinery/sleeper/RefreshParts()
|
||||
var/E
|
||||
var/I
|
||||
for(var/obj/item/weapon/stock_parts/matter_bin/B in component_parts)
|
||||
E += B.rating
|
||||
for(var/obj/item/weapon/stock_parts/manipulator/M in component_parts)
|
||||
I += M.rating
|
||||
|
||||
injection_chems = possible_chems[I]
|
||||
efficiency = E
|
||||
min_health = -E * 25
|
||||
|
||||
process()
|
||||
if(filtering > 0)
|
||||
if(beaker)
|
||||
if(beaker.reagents.total_volume < beaker.reagents.maximum_volume)
|
||||
/obj/machinery/sleeper/process()
|
||||
if(filtering > 0)
|
||||
if(beaker)
|
||||
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)
|
||||
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()
|
||||
return
|
||||
src.updateDialog()
|
||||
return
|
||||
|
||||
|
||||
blob_act()
|
||||
if(prob(75))
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.loc = src.loc
|
||||
A.blob_act()
|
||||
del(src)
|
||||
return
|
||||
/obj/machinery/sleeper/blob_act()
|
||||
if(prob(75))
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.loc = src.loc
|
||||
A.blob_act()
|
||||
del(src)
|
||||
return
|
||||
|
||||
|
||||
attackby(var/obj/item/weapon/G as obj, var/mob/user as mob)
|
||||
if(istype(G, /obj/item/weapon/reagent_containers/glass))
|
||||
if(!beaker)
|
||||
beaker = G
|
||||
user.drop_item()
|
||||
G.loc = 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."
|
||||
return
|
||||
|
||||
if (istype(G, /obj/item/weapon/screwdriver))
|
||||
if(src.occupant)
|
||||
user << "<span class='notice'>The maintenance panel is locked.</span>"
|
||||
return
|
||||
default_deconstruction_screwdriver(user, "sleeper-o", "sleeper-open", G)
|
||||
return
|
||||
|
||||
if (istype(G, /obj/item/weapon/wrench))
|
||||
if(src.occupant)
|
||||
user << "<span class='notice'>The scanner is occupied.</span>"
|
||||
return
|
||||
if(panel_open)
|
||||
user << "<span class='notice'>Close the maintenance panel first.</span>"
|
||||
return
|
||||
if(dir == 4)
|
||||
orient = "LEFT"
|
||||
dir = 8
|
||||
else
|
||||
orient = "RIGHT"
|
||||
dir = 4
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
|
||||
if(exchange_parts(user, G))
|
||||
/obj/machinery/sleeper/attackby(var/obj/item/weapon/G as obj, var/mob/user as mob)
|
||||
if(istype(G, /obj/item/weapon/reagent_containers/glass))
|
||||
if(!beaker)
|
||||
beaker = G
|
||||
user.drop_item()
|
||||
G.loc = 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."
|
||||
return
|
||||
|
||||
if (istype(G, /obj/item/weapon/screwdriver))
|
||||
if(src.occupant)
|
||||
user << "<span class='notice'>The maintenance panel is locked.</span>"
|
||||
return
|
||||
default_deconstruction_screwdriver(user, "sleeper-o", "sleeper-open", G)
|
||||
return
|
||||
|
||||
if (istype(G, /obj/item/weapon/wrench))
|
||||
if(src.occupant)
|
||||
user << "<span class='notice'>The scanner is occupied.</span>"
|
||||
return
|
||||
if(panel_open)
|
||||
user << "<span class='notice'>Close the maintenance panel first.</span>"
|
||||
return
|
||||
if(dir == 4)
|
||||
orient = "LEFT"
|
||||
dir = 8
|
||||
else
|
||||
orient = "RIGHT"
|
||||
dir = 4
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
|
||||
if(exchange_parts(user, G))
|
||||
return
|
||||
|
||||
default_deconstruction_crowbar(G)
|
||||
|
||||
if(istype(G, /obj/item/weapon/grab))
|
||||
if(panel_open)
|
||||
user << "\blue <b>Close the maintenance panel first.</b>"
|
||||
return
|
||||
if(!ismob(G:affecting))
|
||||
default_deconstruction_crowbar(G)
|
||||
|
||||
if(istype(G, /obj/item/weapon/grab))
|
||||
if(panel_open)
|
||||
user << "\blue <b>Close the maintenance panel first.</b>"
|
||||
return
|
||||
if(!ismob(G:affecting))
|
||||
return
|
||||
if(src.occupant)
|
||||
user << "\blue <B>The sleeper is already occupied!</B>"
|
||||
return
|
||||
for(var/mob/living/carbon/slime/M in range(1,G:affecting))
|
||||
if(M.Victim == G:affecting)
|
||||
usr << "[G:affecting.name] will not fit into the sleeper because they have a slime latched onto their head."
|
||||
return
|
||||
|
||||
visible_message("[user] starts putting [G:affecting:name] into the sleeper.", 3)
|
||||
|
||||
if(do_after(user, 20))
|
||||
if(src.occupant)
|
||||
user << "\blue <B>The sleeper is already occupied!</B>"
|
||||
return
|
||||
for(var/mob/living/carbon/slime/M in range(1,G:affecting))
|
||||
if(M.Victim == G:affecting)
|
||||
usr << "[G:affecting.name] will not fit into the sleeper because they have a slime latched onto their head."
|
||||
return
|
||||
if(!G || !G:affecting) return
|
||||
var/mob/M = G:affecting
|
||||
if(M.client)
|
||||
M.client.perspective = EYE_PERSPECTIVE
|
||||
M.client.eye = src
|
||||
M.loc = 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>"
|
||||
|
||||
visible_message("[user] starts putting [G:affecting:name] into the sleeper.", 3)
|
||||
|
||||
if(do_after(user, 20))
|
||||
if(src.occupant)
|
||||
user << "\blue <B>The sleeper is already occupied!</B>"
|
||||
return
|
||||
if(!G || !G:affecting) return
|
||||
var/mob/M = G:affecting
|
||||
if(M.client)
|
||||
M.client.perspective = EYE_PERSPECTIVE
|
||||
M.client.eye = src
|
||||
M.loc = src
|
||||
src.occupant = M
|
||||
src.icon_state = "sleeper_1"
|
||||
if(orient == "RIGHT")
|
||||
icon_state = "sleeper_1-r"
|
||||
M << "\blue <b>You feel cool air surround you. You go numb as your senses turn inward.</b>"
|
||||
|
||||
src.add_fingerprint(user)
|
||||
del(G)
|
||||
return
|
||||
src.add_fingerprint(user)
|
||||
del(G)
|
||||
return
|
||||
return
|
||||
|
||||
|
||||
ex_act(severity)
|
||||
if(filtering)
|
||||
toggle_filter()
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
/obj/machinery/sleeper/ex_act(severity)
|
||||
if(filtering)
|
||||
toggle_filter()
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.loc = src.loc
|
||||
ex_act(severity)
|
||||
qdel(src)
|
||||
return
|
||||
if(2.0)
|
||||
if(prob(50))
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.loc = src.loc
|
||||
ex_act(severity)
|
||||
qdel(src)
|
||||
return
|
||||
if(2.0)
|
||||
if(prob(50))
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.loc = src.loc
|
||||
ex_act(severity)
|
||||
qdel(src)
|
||||
return
|
||||
if(3.0)
|
||||
if(prob(25))
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.loc = src.loc
|
||||
ex_act(severity)
|
||||
qdel(src)
|
||||
return
|
||||
return
|
||||
emp_act(severity)
|
||||
if(filtering)
|
||||
toggle_filter()
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
..(severity)
|
||||
return
|
||||
if(occupant)
|
||||
go_out()
|
||||
if(3.0)
|
||||
if(prob(25))
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.loc = src.loc
|
||||
ex_act(severity)
|
||||
qdel(src)
|
||||
return
|
||||
return
|
||||
|
||||
/obj/machinery/sleeper/emp_act(severity)
|
||||
if(filtering)
|
||||
toggle_filter()
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
..(severity)
|
||||
|
||||
alter_health(mob/living/M as mob)
|
||||
if (M.health > 0)
|
||||
if (M.getOxyLoss() >= 10)
|
||||
var/amount = max(0.15, 1)
|
||||
M.adjustOxyLoss(-amount)
|
||||
else
|
||||
M.adjustOxyLoss(-12)
|
||||
M.updatehealth()
|
||||
M.AdjustParalysis(-4)
|
||||
M.AdjustWeakened(-4)
|
||||
M.AdjustStunned(-4)
|
||||
M.Paralyse(1)
|
||||
M.Weaken(1)
|
||||
M.Stun(1)
|
||||
if (M:reagents.get_reagent_amount("inaprovaline") < 5)
|
||||
M:reagents.add_reagent("inaprovaline", 5)
|
||||
return
|
||||
if(occupant)
|
||||
go_out()
|
||||
..(severity)
|
||||
|
||||
proc/toggle_filter()
|
||||
if(filtering)
|
||||
filtering = 0
|
||||
/obj/machinery/sleeper/alter_health(mob/living/M as mob)
|
||||
if (M.health > 0)
|
||||
if (M.getOxyLoss() >= 10)
|
||||
var/amount = max(0.15, 1)
|
||||
M.adjustOxyLoss(-amount)
|
||||
else
|
||||
filtering = 1
|
||||
M.adjustOxyLoss(-12)
|
||||
M.updatehealth()
|
||||
M.AdjustParalysis(-4)
|
||||
M.AdjustWeakened(-4)
|
||||
M.AdjustStunned(-4)
|
||||
M.Paralyse(1)
|
||||
M.Weaken(1)
|
||||
M.Stun(1)
|
||||
if (M:reagents.get_reagent_amount("inaprovaline") < 5)
|
||||
M:reagents.add_reagent("inaprovaline", 5)
|
||||
return
|
||||
|
||||
proc/go_out()
|
||||
if(filtering)
|
||||
toggle_filter()
|
||||
if(!src.occupant)
|
||||
return
|
||||
if(src.occupant.client)
|
||||
src.occupant.client.eye = src.occupant.client.mob
|
||||
src.occupant.client.perspective = MOB_PERSPECTIVE
|
||||
src.occupant.loc = src.loc
|
||||
src.occupant = null
|
||||
if(orient == "RIGHT")
|
||||
icon_state = "sleeper_0-r"
|
||||
/obj/machinery/sleeper/proc/toggle_filter()
|
||||
if(filtering)
|
||||
filtering = 0
|
||||
else
|
||||
filtering = 1
|
||||
|
||||
/obj/machinery/sleeper/proc/go_out()
|
||||
if(filtering)
|
||||
toggle_filter()
|
||||
if(!src.occupant)
|
||||
return
|
||||
if(src.occupant.client)
|
||||
src.occupant.client.eye = src.occupant.client.mob
|
||||
src.occupant.client.perspective = MOB_PERSPECTIVE
|
||||
src.occupant.loc = src.loc
|
||||
src.occupant = null
|
||||
icon_state = "sleeper-open"
|
||||
return
|
||||
|
||||
|
||||
proc/inject_chemical(mob/living/user as mob, chemical, amount)
|
||||
if(src.occupant)
|
||||
if(src.occupant.reagents)
|
||||
if(src.occupant.reagents.get_reagent_amount(chemical) + amount <= 20 * efficiency)
|
||||
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."
|
||||
return
|
||||
/obj/machinery/sleeper/proc/inject_chemical(mob/living/user as mob, chemical, amount)
|
||||
if(src.occupant)
|
||||
if(src.occupant.reagents)
|
||||
if(src.occupant.reagents.get_reagent_amount(chemical) + amount <= 20 * efficiency)
|
||||
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 << "The patient rejects the chemicals!"
|
||||
user << "You can not inject any more of this chemical."
|
||||
return
|
||||
else
|
||||
user << "There's no occupant in the sleeper!"
|
||||
user << "The patient rejects the chemicals!"
|
||||
return
|
||||
else
|
||||
user << "There's no occupant in the sleeper!"
|
||||
return
|
||||
|
||||
|
||||
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: []°C ([]°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)
|
||||
/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 << "\blue No Dialysis Output Beaker loaded."
|
||||
user << text("[]\t Health %: [] ([])", (src.occupant.health > 50 ? "\blue " : "\red "), src.occupant.health, t1)
|
||||
user << text("[]\t -Core Temperature: []°C ([]°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 There is no one inside!"
|
||||
return
|
||||
user << "\blue No Dialysis Output Beaker loaded."
|
||||
else
|
||||
user << "\blue There is no one inside!"
|
||||
return
|
||||
|
||||
|
||||
verb/eject()
|
||||
set name = "Eject Sleeper"
|
||||
set category = null
|
||||
set src in oview(1)
|
||||
if(usr.stat != 0)
|
||||
return
|
||||
src.icon_state = "sleeper-open"
|
||||
src.go_out()
|
||||
add_fingerprint(usr)
|
||||
/obj/machinery/sleeper/verb/eject()
|
||||
set name = "Eject Sleeper"
|
||||
set category = null
|
||||
set src in oview(1)
|
||||
if(usr.stat != 0)
|
||||
return
|
||||
src.icon_state = "sleeper-open"
|
||||
src.go_out()
|
||||
add_fingerprint(usr)
|
||||
return
|
||||
|
||||
verb/remove_beaker()
|
||||
set name = "Remove Beaker"
|
||||
set category = null
|
||||
set src in oview(1)
|
||||
if(usr.stat != 0)
|
||||
return
|
||||
if(beaker)
|
||||
filtering = 0
|
||||
beaker.loc = usr.loc
|
||||
beaker = null
|
||||
add_fingerprint(usr)
|
||||
/obj/machinery/sleeper/verb/remove_beaker()
|
||||
set name = "Remove Beaker"
|
||||
set category = null
|
||||
set src in oview(1)
|
||||
if(usr.stat != 0)
|
||||
return
|
||||
if(beaker)
|
||||
filtering = 0
|
||||
beaker.loc = usr.loc
|
||||
beaker = null
|
||||
add_fingerprint(usr)
|
||||
return
|
||||
|
||||
/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
|
||||
@@ -502,9 +546,7 @@
|
||||
L.client.eye = src
|
||||
L.loc = src
|
||||
src.occupant = L
|
||||
src.icon_state = "sleeper_1"
|
||||
if(orient == "RIGHT")
|
||||
icon_state = "sleeper_1-r"
|
||||
src.icon_state = "sleeper"
|
||||
L << "\blue <b>You feel cool air surround you. You go numb as your senses turn inward.</b>"
|
||||
src.add_fingerprint(user)
|
||||
if(user.pulling == L)
|
||||
@@ -521,10 +563,12 @@
|
||||
set src in oview(1)
|
||||
if(usr.stat != 0 || !(ishuman(usr) || ismonkey(usr)))
|
||||
return
|
||||
|
||||
if(src.occupant)
|
||||
usr << "\blue <B>The sleeper is already occupied!</B>"
|
||||
return
|
||||
if (panel_open)
|
||||
usr << "\blue <B>Close the maintenance panel first.</B>"
|
||||
return
|
||||
if(usr.restrained() || usr.stat || usr.weakened || usr.stunned || usr.paralysis || usr.resting) //are you cuffed, dying, lying, stunned or other
|
||||
return
|
||||
for(var/mob/living/carbon/slime/M in range(1,usr))
|
||||
|
||||
+305
-218
@@ -1,18 +1,17 @@
|
||||
// Pretty much everything here is stolen from the dna scanner FYI
|
||||
|
||||
|
||||
/obj/machinery/bodyscanner
|
||||
var/mob/living/carbon/occupant
|
||||
var/locked
|
||||
name = "Body Scanner"
|
||||
icon = 'icons/obj/Cryogenic2.dmi'
|
||||
icon_state = "body_scanner_0"
|
||||
icon_state = "bodyscanner-open"
|
||||
density = 1
|
||||
dir = 8
|
||||
anchored = 1
|
||||
idle_power_usage = 1250
|
||||
active_power_usage = 2500
|
||||
|
||||
l_color = "#00FF00"
|
||||
|
||||
power_change()
|
||||
..()
|
||||
if(!(stat & (BROKEN|NOPOWER)))
|
||||
@@ -20,6 +19,72 @@
|
||||
else
|
||||
SetLuminosity(0)
|
||||
|
||||
/obj/machinery/bodyscanner/New()
|
||||
..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/bodyscanner(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/scanning_module(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(src)
|
||||
component_parts += new /obj/item/stack/cable_coil(src, 2)
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/bodyscanner/RefreshParts()
|
||||
|
||||
/obj/machinery/bodyscanner/attackby(var/obj/item/weapon/G as obj, var/mob/user as mob)
|
||||
if (istype(G, /obj/item/weapon/screwdriver))
|
||||
if(src.occupant)
|
||||
user << "<span class='notice'>The maintenance panel is locked.</span>"
|
||||
return
|
||||
default_deconstruction_screwdriver(user, "bodyscanner-o", "bodyscanner-open", G)
|
||||
return
|
||||
|
||||
if (istype(G, /obj/item/weapon/wrench))
|
||||
if(src.occupant)
|
||||
user << "<span class='notice'>The scanner is occupied.</span>"
|
||||
return
|
||||
if(panel_open)
|
||||
user << "<span class='notice'>Close the maintenance panel first.</span>"
|
||||
return
|
||||
if(dir == 4)
|
||||
dir = 8
|
||||
else
|
||||
dir = 4
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
|
||||
if(exchange_parts(user, G))
|
||||
return
|
||||
|
||||
default_deconstruction_crowbar(G)
|
||||
|
||||
if(istype(G, /obj/item/weapon/grab))
|
||||
if(panel_open)
|
||||
user << "\blue <b>Close the maintenance panel first.</b>"
|
||||
return
|
||||
if(!ismob(G:affecting))
|
||||
return
|
||||
if (src.occupant)
|
||||
user << "\blue <B>The scanner is already occupied!</B>"
|
||||
return
|
||||
for(var/mob/living/carbon/slime/M in range(1,G:affecting))
|
||||
if(M.Victim == G:affecting)
|
||||
usr << "[G:affecting.name] will not fit into the sleeper because they have a slime latched onto their head."
|
||||
return
|
||||
var/mob/M = G:affecting
|
||||
if (M.abiotic())
|
||||
user << "\blue <B>Subject cannot have abiotic items on.</B>"
|
||||
return
|
||||
if (M.client)
|
||||
M.client.perspective = EYE_PERSPECTIVE
|
||||
M.client.eye = src
|
||||
M.loc = src
|
||||
src.occupant = M
|
||||
src.icon_state = "body_scanner_1"
|
||||
src.add_fingerprint(user)
|
||||
//G = null
|
||||
del(G)
|
||||
return
|
||||
|
||||
/obj/machinery/bodyscanner/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
|
||||
@@ -37,6 +102,9 @@
|
||||
return
|
||||
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>"
|
||||
return
|
||||
if(occupant)
|
||||
user << "\blue <B>The body scanner is already occupied!</B>"
|
||||
return
|
||||
@@ -60,10 +128,7 @@
|
||||
L.client.eye = src
|
||||
L.loc = src
|
||||
src.occupant = L
|
||||
src.icon_state = "body_scanner_1"
|
||||
for(var/obj/OO in src)
|
||||
OO.loc = src.loc
|
||||
//Foreach goto(154)
|
||||
src.icon_state = "bodyscanner"
|
||||
src.add_fingerprint(user)
|
||||
return
|
||||
|
||||
@@ -97,6 +162,9 @@
|
||||
if (src.occupant)
|
||||
usr << "\blue <B>The scanner is already occupied!</B>"
|
||||
return
|
||||
if (panel_open)
|
||||
usr << "\blue <B>Close the maintenance panel first.</B>"
|
||||
return
|
||||
if (usr.abiotic())
|
||||
usr << "\blue <B>Subject cannot have abiotic items on.</B>"
|
||||
return
|
||||
@@ -105,7 +173,7 @@
|
||||
usr.client.eye = src
|
||||
usr.loc = src
|
||||
src.occupant = usr
|
||||
src.icon_state = "body_scanner_1"
|
||||
src.icon_state = "bodyscanner"
|
||||
for(var/obj/O in src)
|
||||
//O = null
|
||||
del(O)
|
||||
@@ -116,9 +184,6 @@
|
||||
/obj/machinery/bodyscanner/proc/go_out()
|
||||
if ((!( src.occupant ) || src.locked))
|
||||
return
|
||||
for(var/obj/O in src)
|
||||
O.loc = src.loc
|
||||
//Foreach goto(30)
|
||||
if (src.occupant.client)
|
||||
src.occupant.client.eye = src.occupant.client.mob
|
||||
src.occupant.client.perspective = MOB_PERSPECTIVE
|
||||
@@ -127,30 +192,6 @@
|
||||
src.icon_state = "body_scanner_0"
|
||||
return
|
||||
|
||||
/obj/machinery/bodyscanner/attackby(obj/item/weapon/grab/G as obj, user as mob)
|
||||
if ((!( istype(G, /obj/item/weapon/grab) ) || !( ismob(G.affecting) )))
|
||||
return
|
||||
if (src.occupant)
|
||||
user << "\blue <B>The scanner is already occupied!</B>"
|
||||
return
|
||||
if (G.affecting.abiotic())
|
||||
user << "\blue <B>Subject cannot have abiotic items on.</B>"
|
||||
return
|
||||
var/mob/M = G.affecting
|
||||
if (M.client)
|
||||
M.client.perspective = EYE_PERSPECTIVE
|
||||
M.client.eye = src
|
||||
M.loc = src
|
||||
src.occupant = M
|
||||
src.icon_state = "body_scanner_1"
|
||||
for(var/obj/O in src)
|
||||
O.loc = src.loc
|
||||
//Foreach goto(154)
|
||||
src.add_fingerprint(user)
|
||||
//G = null
|
||||
del(G)
|
||||
return
|
||||
|
||||
/obj/machinery/bodyscanner/ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
@@ -188,8 +229,44 @@
|
||||
A.loc = src.loc
|
||||
del(src)
|
||||
|
||||
/obj/machinery/body_scanconsole/ex_act(severity)
|
||||
/obj/machinery/body_scanconsole
|
||||
var/obj/machinery/bodyscanner/connected
|
||||
var/known_implants = list(/obj/item/weapon/implant/chem, /obj/item/weapon/implant/death_alarm, /obj/item/weapon/implant/loyalty, /obj/item/weapon/implant/tracking)
|
||||
var/delete
|
||||
var/temphtml
|
||||
name = "Body Scanner Console"
|
||||
icon = 'icons/obj/Cryogenic2.dmi'
|
||||
icon_state = "bodyscannerconsole"
|
||||
density = 1
|
||||
anchored = 1
|
||||
dir = 8
|
||||
idle_power_usage = 250
|
||||
active_power_usage = 500
|
||||
|
||||
/obj/machinery/body_scanconsole/power_change()
|
||||
if(stat & BROKEN)
|
||||
icon_state = "bodyscannerconsole-p"
|
||||
else if(powered() && !panel_open)
|
||||
icon_state = initial(icon_state)
|
||||
stat &= ~NOPOWER
|
||||
else
|
||||
spawn(rand(0, 15))
|
||||
src.icon_state = "bodyscannerconsole-p"
|
||||
stat |= NOPOWER
|
||||
|
||||
/obj/machinery/body_scanconsole/New()
|
||||
..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/bodyscanner_console(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(src)
|
||||
component_parts += new /obj/item/stack/cable_coil(src, 2)
|
||||
RefreshParts()
|
||||
findscanner()
|
||||
|
||||
/obj/machinery/body_scanconsole/RefreshParts()
|
||||
|
||||
/obj/machinery/body_scanconsole/ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
//SN src = null
|
||||
@@ -204,40 +281,20 @@
|
||||
return
|
||||
|
||||
/obj/machinery/body_scanconsole/blob_act()
|
||||
|
||||
if(prob(50))
|
||||
del(src)
|
||||
|
||||
/obj/machinery/body_scanconsole/power_change()
|
||||
if(stat & BROKEN)
|
||||
icon_state = "body_scannerconsole-p"
|
||||
else if(powered())
|
||||
icon_state = initial(icon_state)
|
||||
stat &= ~NOPOWER
|
||||
else
|
||||
spawn(rand(0, 15))
|
||||
src.icon_state = "body_scannerconsole-p"
|
||||
stat |= NOPOWER
|
||||
|
||||
/obj/machinery/body_scanconsole
|
||||
var/obj/machinery/bodyscanner/connected
|
||||
var/known_implants = list(/obj/item/weapon/implant/chem, /obj/item/weapon/implant/death_alarm, /obj/item/weapon/implant/loyalty, /obj/item/weapon/implant/tracking)
|
||||
var/delete
|
||||
var/temphtml
|
||||
name = "Body Scanner Console"
|
||||
icon = 'icons/obj/Cryogenic2.dmi'
|
||||
icon_state = "body_scannerconsole"
|
||||
density = 1
|
||||
anchored = 1
|
||||
|
||||
|
||||
/obj/machinery/body_scanconsole/New()
|
||||
..()
|
||||
/obj/machinery/body_scanconsole/proc/findscanner()
|
||||
spawn( 5 )
|
||||
src.connected = locate(/obj/machinery/bodyscanner, get_step(src, WEST))
|
||||
var/obj/machinery/bodyscanner/bodyscannernew = null
|
||||
// Loop through every direction
|
||||
for(dir in list(NORTH,EAST,SOUTH,WEST))
|
||||
// Try to find a scanner in that direction
|
||||
bodyscannernew = locate(/obj/machinery/bodyscanner, get_step(src, dir))
|
||||
src.connected = bodyscannernew
|
||||
return
|
||||
return
|
||||
|
||||
return
|
||||
|
||||
/*
|
||||
|
||||
/obj/machinery/body_scanconsole/process() //not really used right now
|
||||
@@ -261,6 +318,25 @@
|
||||
|
||||
*/
|
||||
|
||||
/obj/machinery/body_scanconsole/attackby(var/obj/item/weapon/G as obj, var/mob/user as mob)
|
||||
if (istype(G, /obj/item/weapon/screwdriver))
|
||||
default_deconstruction_screwdriver(user, "bodyscannerconsole-p", "bodyscannerconsole", G)
|
||||
return
|
||||
|
||||
if (istype(G, /obj/item/weapon/wrench))
|
||||
if(panel_open)
|
||||
user << "<span class='notice'>Close the maintenance panel first.</span>"
|
||||
return
|
||||
if(dir == 4)
|
||||
dir = 8
|
||||
else
|
||||
dir = 4
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
|
||||
if(exchange_parts(user, G))
|
||||
return
|
||||
|
||||
default_deconstruction_crowbar(G)
|
||||
|
||||
/obj/machinery/body_scanconsole/attack_paw(user as mob)
|
||||
return src.attack_hand(user)
|
||||
@@ -271,158 +347,169 @@
|
||||
/obj/machinery/body_scanconsole/attack_hand(user as mob)
|
||||
if(..())
|
||||
return
|
||||
if(!ishuman(connected.occupant))
|
||||
user << "\red This device can only scan compatible lifeforms."
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
var/dat
|
||||
if (src.delete && src.temphtml) //Window in buffer but its just simple message, so nothing
|
||||
src.delete = src.delete
|
||||
else if (!src.delete && src.temphtml) //Window in buffer - its a menu, dont add clear message
|
||||
dat = text("[]<BR><BR><A href='?src=\ref[];clear=1'>Main Menu</A>", src.temphtml, src)
|
||||
else
|
||||
if (src.connected) //Is something connected?
|
||||
var/mob/living/carbon/human/occupant = src.connected.occupant
|
||||
dat = "<font color='blue'><B>Occupant Statistics:</B></FONT><BR>" //Blah obvious
|
||||
if (istype(occupant)) //is there REALLY someone in there?
|
||||
var/t1
|
||||
switch(occupant.stat) // obvious, see what their status is
|
||||
if(0)
|
||||
t1 = "Conscious"
|
||||
if(1)
|
||||
t1 = "Unconscious"
|
||||
else
|
||||
t1 = "*dead*"
|
||||
if (!istype(occupant,/mob/living/carbon/human))
|
||||
dat += "<font color='red'>This device can only scan human occupants.</FONT>"
|
||||
else
|
||||
dat += text("[]\tHealth %: [] ([])</FONT><BR>", (occupant.health > 50 ? "<font color='blue'>" : "<font color='red'>"), occupant.health, t1)
|
||||
|
||||
if(occupant.virus2.len)
|
||||
dat += text("<font color='red'>Viral pathogen detected in blood stream.</font><BR>")
|
||||
|
||||
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><BR>", (occupant.getFireLoss() < 60 ? "<font color='blue'>" : "<font color='red'>"), occupant.getFireLoss())
|
||||
|
||||
dat += text("[]\tRadiation Level %: []</FONT><BR>", (occupant.radiation < 10 ?"<font color='blue'>" : "<font color='red'>"), occupant.radiation)
|
||||
dat += text("[]\tGenetic Tissue Damage %: []</FONT><BR>", (occupant.getCloneLoss() < 1 ?"<font color='blue'>" : "<font color='red'>"), occupant.getCloneLoss())
|
||||
dat += text("[]\tApprox. Brain Damage %: []</FONT><BR>", (occupant.getBrainLoss() < 1 ?"<font color='blue'>" : "<font color='red'>"), occupant.getBrainLoss())
|
||||
dat += text("Paralysis Summary %: [] ([] seconds left!)<BR>", occupant.paralysis, round(occupant.paralysis / 4))
|
||||
dat += text("Body Temperature: [occupant.bodytemperature-T0C]°C ([occupant.bodytemperature*1.8-459.67]°F)<BR><HR>")
|
||||
|
||||
if(occupant.has_brain_worms())
|
||||
dat += "Large growth detected in frontal lobe, possibly cancerous. Surgical removal is recommended.<BR/>"
|
||||
|
||||
if(occupant.vessel)
|
||||
var/blood_volume = round(occupant.vessel.get_reagent_amount("blood"))
|
||||
var/blood_percent = blood_volume / 560
|
||||
blood_percent *= 100
|
||||
dat += text("[]\tBlood Level %: [] ([] units)</FONT><BR>", (blood_volume > 448 ?"<font color='blue'>" : "<font color='red'>"), blood_percent, blood_volume)
|
||||
if(occupant.reagents)
|
||||
dat += text("Inaprovaline units: [] units<BR>", occupant.reagents.get_reagent_amount("inaprovaline"))
|
||||
dat += text("Soporific (Sleep Toxin): [] units<BR>", occupant.reagents.get_reagent_amount("stoxin"))
|
||||
dat += text("[]\tDermaline: [] units</FONT><BR>", (occupant.reagents.get_reagent_amount("dermaline") < 30 ? "<font color='black'>" : "<font color='red'>"), occupant.reagents.get_reagent_amount("dermaline"))
|
||||
dat += text("[]\tBicaridine: [] units<BR>", (occupant.reagents.get_reagent_amount("bicaridine") < 30 ? "<font color='black'>" : "<font color='red'>"), occupant.reagents.get_reagent_amount("bicaridine"))
|
||||
dat += text("[]\tDexalin: [] units<BR>", (occupant.reagents.get_reagent_amount("dexalin") < 30 ? "<font color='black'>" : "<font color='red'>"), occupant.reagents.get_reagent_amount("dexalin"))
|
||||
|
||||
dat += "<HR><table border='1'>"
|
||||
dat += "<tr>"
|
||||
dat += "<th>Organ</th>"
|
||||
dat += "<th>Burn Damage</th>"
|
||||
dat += "<th>Brute Damage</th>"
|
||||
dat += "<th>Other Wounds</th>"
|
||||
dat += "</tr>"
|
||||
|
||||
for(var/datum/organ/external/e in occupant.organs)
|
||||
|
||||
dat += "<tr>"
|
||||
var/AN = ""
|
||||
var/open = ""
|
||||
var/infected = ""
|
||||
var/robot = ""
|
||||
var/imp = ""
|
||||
var/bled = ""
|
||||
var/splint = ""
|
||||
var/internal_bleeding = ""
|
||||
var/lung_ruptured = ""
|
||||
for(var/datum/wound/W in e.wounds) if(W.internal)
|
||||
internal_bleeding = "<br>Internal bleeding"
|
||||
break
|
||||
if(istype(e, /datum/organ/external/chest) && occupant.is_lung_ruptured())
|
||||
lung_ruptured = "Lung ruptured:"
|
||||
if(e.status & ORGAN_SPLINTED)
|
||||
splint = "Splinted:"
|
||||
if(e.status & ORGAN_BLEEDING)
|
||||
bled = "Bleeding:"
|
||||
if(e.status & ORGAN_BROKEN)
|
||||
AN = "[e.broken_description]:"
|
||||
if(e.status & ORGAN_ROBOT)
|
||||
robot = "Prosthetic:"
|
||||
if(e.open)
|
||||
open = "Open:"
|
||||
switch (e.germ_level)
|
||||
if (INFECTION_LEVEL_ONE to INFECTION_LEVEL_ONE + 200)
|
||||
infected = "Mild Infection:"
|
||||
if (INFECTION_LEVEL_ONE + 200 to INFECTION_LEVEL_ONE + 300)
|
||||
infected = "Mild Infection+:"
|
||||
if (INFECTION_LEVEL_ONE + 300 to INFECTION_LEVEL_ONE + 400)
|
||||
infected = "Mild Infection++:"
|
||||
if (INFECTION_LEVEL_TWO to INFECTION_LEVEL_TWO + 200)
|
||||
infected = "Acute Infection:"
|
||||
if (INFECTION_LEVEL_TWO + 200 to INFECTION_LEVEL_TWO + 300)
|
||||
infected = "Acute Infection+:"
|
||||
if (INFECTION_LEVEL_TWO + 300 to INFECTION_LEVEL_TWO + 400)
|
||||
infected = "Acute Infection++:"
|
||||
if (INFECTION_LEVEL_THREE to INFINITY)
|
||||
infected = "Septic:"
|
||||
|
||||
var/unknown_body = 0
|
||||
for(var/I in e.implants)
|
||||
if(is_type_in_list(I,known_implants))
|
||||
imp += "[I] implanted:"
|
||||
else
|
||||
unknown_body++
|
||||
|
||||
if(unknown_body || e.hidden)
|
||||
imp += "Unknown body present:"
|
||||
if(!AN && !open && !infected & !imp)
|
||||
AN = "None:"
|
||||
if(!(e.status & ORGAN_DESTROYED))
|
||||
dat += "<td>[e.display_name]</td><td>[e.burn_dam]</td><td>[e.brute_dam]</td><td>[robot][bled][AN][splint][open][infected][imp][internal_bleeding][lung_ruptured]</td>"
|
||||
else
|
||||
dat += "<td>[e.display_name]</td><td>-</td><td>-</td><td>Not Found</td>"
|
||||
dat += "</tr>"
|
||||
for(var/n in occupant.internal_organs_by_name)
|
||||
var/datum/organ/internal/i = occupant.internal_organs_by_name[n]
|
||||
var/mech = i.desc
|
||||
var/infection = "None"
|
||||
switch (i.germ_level)
|
||||
if (1 to INFECTION_LEVEL_ONE + 200)
|
||||
infection = "Mild Infection:"
|
||||
if (INFECTION_LEVEL_ONE + 200 to INFECTION_LEVEL_ONE + 300)
|
||||
infection = "Mild Infection+:"
|
||||
if (INFECTION_LEVEL_ONE + 300 to INFECTION_LEVEL_ONE + 400)
|
||||
infection = "Mild Infection++:"
|
||||
if (INFECTION_LEVEL_TWO to INFECTION_LEVEL_TWO + 200)
|
||||
infection = "Acute Infection:"
|
||||
if (INFECTION_LEVEL_TWO + 200 to INFECTION_LEVEL_TWO + 300)
|
||||
infection = "Acute Infection+:"
|
||||
if (INFECTION_LEVEL_TWO + 300 to INFINITY)
|
||||
infection = "Acute Infection++:"
|
||||
|
||||
dat += "<tr>"
|
||||
dat += "<td>[i.name]</td><td>N/A</td><td>[i.damage]</td><td>[infection]:[mech]</td><td></td>"
|
||||
dat += "</tr>"
|
||||
dat += "</table>"
|
||||
if(occupant.sdisabilities & BLIND)
|
||||
dat += text("<font color='red'>Cataracts detected.</font><BR>")
|
||||
if(occupant.sdisabilities & NEARSIGHTED)
|
||||
dat += text("<font color='red'>Retinal misalignment detected.</font><BR>")
|
||||
else
|
||||
dat += "\The [src] is empty."
|
||||
if (panel_open)
|
||||
user << "<span class='notice'>Close the maintenance panel first.</span>"
|
||||
return
|
||||
if(!src.connected)
|
||||
findscanner()
|
||||
if (src.connected)
|
||||
if(!connected.occupant)
|
||||
user << "<span class='notice'>The scanner is empty.</span>"
|
||||
return
|
||||
if(!ishuman(connected.occupant))
|
||||
user << "\red This device can only scan compatible lifeforms."
|
||||
return
|
||||
var/dat
|
||||
if (src.delete && src.temphtml) //Window in buffer but its just simple message, so nothing
|
||||
src.delete = src.delete
|
||||
else if (!src.delete && src.temphtml) //Window in buffer - its a menu, dont add clear message
|
||||
dat = text("[]<BR><BR><A href='?src=\ref[];clear=1'>Main Menu</A>", src.temphtml, src)
|
||||
else
|
||||
dat = "<font color='red'> Error: No Body Scanner connected.</font>"
|
||||
dat += text("<BR><BR><A href='?src=\ref[];mach_close=scanconsole'>Close</A>", user)
|
||||
user << browse(dat, "window=scanconsole;size=430x600")
|
||||
if (src.connected) //Is something connected?
|
||||
var/mob/living/carbon/human/occupant = src.connected.occupant
|
||||
dat = "<font color='blue'><B>Occupant Statistics:</B></FONT><BR>" //Blah obvious
|
||||
if (istype(occupant)) //is there REALLY someone in there?
|
||||
var/t1
|
||||
switch(occupant.stat) // obvious, see what their status is
|
||||
if(0)
|
||||
t1 = "Conscious"
|
||||
if(1)
|
||||
t1 = "Unconscious"
|
||||
else
|
||||
t1 = "*dead*"
|
||||
if (!istype(occupant,/mob/living/carbon/human))
|
||||
dat += "<font color='red'>This device can only scan human occupants.</FONT>"
|
||||
else
|
||||
dat += text("[]\tHealth %: [] ([])</FONT><BR>", (occupant.health > 50 ? "<font color='blue'>" : "<font color='red'>"), occupant.health, t1)
|
||||
|
||||
if(occupant.virus2.len)
|
||||
dat += text("<font color='red'>Viral pathogen detected in blood stream.</font><BR>")
|
||||
|
||||
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><BR>", (occupant.getFireLoss() < 60 ? "<font color='blue'>" : "<font color='red'>"), occupant.getFireLoss())
|
||||
|
||||
dat += text("[]\tRadiation Level %: []</FONT><BR>", (occupant.radiation < 10 ?"<font color='blue'>" : "<font color='red'>"), occupant.radiation)
|
||||
dat += text("[]\tGenetic Tissue Damage %: []</FONT><BR>", (occupant.getCloneLoss() < 1 ?"<font color='blue'>" : "<font color='red'>"), occupant.getCloneLoss())
|
||||
dat += text("[]\tApprox. Brain Damage %: []</FONT><BR>", (occupant.getBrainLoss() < 1 ?"<font color='blue'>" : "<font color='red'>"), occupant.getBrainLoss())
|
||||
dat += text("Paralysis Summary %: [] ([] seconds left!)<BR>", occupant.paralysis, round(occupant.paralysis / 4))
|
||||
dat += text("Body Temperature: [occupant.bodytemperature-T0C]°C ([occupant.bodytemperature*1.8-459.67]°F)<BR><HR>")
|
||||
|
||||
if(occupant.has_brain_worms())
|
||||
dat += "Large growth detected in frontal lobe, possibly cancerous. Surgical removal is recommended.<BR/>"
|
||||
|
||||
if(occupant.vessel)
|
||||
var/blood_volume = round(occupant.vessel.get_reagent_amount("blood"))
|
||||
var/blood_percent = blood_volume / 560
|
||||
blood_percent *= 100
|
||||
dat += text("[]\tBlood Level %: [] ([] units)</FONT><BR>", (blood_volume > 448 ?"<font color='blue'>" : "<font color='red'>"), blood_percent, blood_volume)
|
||||
if(occupant.reagents)
|
||||
dat += text("Inaprovaline units: [] units<BR>", occupant.reagents.get_reagent_amount("inaprovaline"))
|
||||
dat += text("Soporific (Sleep Toxin): [] units<BR>", occupant.reagents.get_reagent_amount("stoxin"))
|
||||
dat += text("[]\tDermaline: [] units</FONT><BR>", (occupant.reagents.get_reagent_amount("dermaline") < 30 ? "<font color='black'>" : "<font color='red'>"), occupant.reagents.get_reagent_amount("dermaline"))
|
||||
dat += text("[]\tBicaridine: [] units<BR>", (occupant.reagents.get_reagent_amount("bicaridine") < 30 ? "<font color='black'>" : "<font color='red'>"), occupant.reagents.get_reagent_amount("bicaridine"))
|
||||
dat += text("[]\tDexalin: [] units<BR>", (occupant.reagents.get_reagent_amount("dexalin") < 30 ? "<font color='black'>" : "<font color='red'>"), occupant.reagents.get_reagent_amount("dexalin"))
|
||||
|
||||
dat += "<HR><table border='1'>"
|
||||
dat += "<tr>"
|
||||
dat += "<th>Organ</th>"
|
||||
dat += "<th>Burn Damage</th>"
|
||||
dat += "<th>Brute Damage</th>"
|
||||
dat += "<th>Other Wounds</th>"
|
||||
dat += "</tr>"
|
||||
|
||||
for(var/datum/organ/external/e in occupant.organs)
|
||||
|
||||
dat += "<tr>"
|
||||
var/AN = ""
|
||||
var/open = ""
|
||||
var/infected = ""
|
||||
var/robot = ""
|
||||
var/imp = ""
|
||||
var/bled = ""
|
||||
var/splint = ""
|
||||
var/internal_bleeding = ""
|
||||
var/lung_ruptured = ""
|
||||
for(var/datum/wound/W in e.wounds) if(W.internal)
|
||||
internal_bleeding = "<br>Internal bleeding"
|
||||
break
|
||||
if(istype(e, /datum/organ/external/chest) && occupant.is_lung_ruptured())
|
||||
lung_ruptured = "Lung ruptured:"
|
||||
if(e.status & ORGAN_SPLINTED)
|
||||
splint = "Splinted:"
|
||||
if(e.status & ORGAN_BLEEDING)
|
||||
bled = "Bleeding:"
|
||||
if(e.status & ORGAN_BROKEN)
|
||||
AN = "[e.broken_description]:"
|
||||
if(e.status & ORGAN_ROBOT)
|
||||
robot = "Prosthetic:"
|
||||
if(e.open)
|
||||
open = "Open:"
|
||||
switch (e.germ_level)
|
||||
if (INFECTION_LEVEL_ONE to INFECTION_LEVEL_ONE + 200)
|
||||
infected = "Mild Infection:"
|
||||
if (INFECTION_LEVEL_ONE + 200 to INFECTION_LEVEL_ONE + 300)
|
||||
infected = "Mild Infection+:"
|
||||
if (INFECTION_LEVEL_ONE + 300 to INFECTION_LEVEL_ONE + 400)
|
||||
infected = "Mild Infection++:"
|
||||
if (INFECTION_LEVEL_TWO to INFECTION_LEVEL_TWO + 200)
|
||||
infected = "Acute Infection:"
|
||||
if (INFECTION_LEVEL_TWO + 200 to INFECTION_LEVEL_TWO + 300)
|
||||
infected = "Acute Infection+:"
|
||||
if (INFECTION_LEVEL_TWO + 300 to INFECTION_LEVEL_TWO + 400)
|
||||
infected = "Acute Infection++:"
|
||||
if (INFECTION_LEVEL_THREE to INFINITY)
|
||||
infected = "Septic:"
|
||||
|
||||
var/unknown_body = 0
|
||||
for(var/I in e.implants)
|
||||
if(is_type_in_list(I,known_implants))
|
||||
imp += "[I] implanted:"
|
||||
else
|
||||
unknown_body++
|
||||
|
||||
if(unknown_body || e.hidden)
|
||||
imp += "Unknown body present:"
|
||||
if(!AN && !open && !infected & !imp)
|
||||
AN = "None:"
|
||||
if(!(e.status & ORGAN_DESTROYED))
|
||||
dat += "<td>[e.display_name]</td><td>[e.burn_dam]</td><td>[e.brute_dam]</td><td>[robot][bled][AN][splint][open][infected][imp][internal_bleeding][lung_ruptured]</td>"
|
||||
else
|
||||
dat += "<td>[e.display_name]</td><td>-</td><td>-</td><td>Not Found</td>"
|
||||
dat += "</tr>"
|
||||
for(var/n in occupant.internal_organs_by_name)
|
||||
var/datum/organ/internal/i = occupant.internal_organs_by_name[n]
|
||||
var/mech = i.desc
|
||||
var/infection = "None"
|
||||
switch (i.germ_level)
|
||||
if (1 to INFECTION_LEVEL_ONE + 200)
|
||||
infection = "Mild Infection:"
|
||||
if (INFECTION_LEVEL_ONE + 200 to INFECTION_LEVEL_ONE + 300)
|
||||
infection = "Mild Infection+:"
|
||||
if (INFECTION_LEVEL_ONE + 300 to INFECTION_LEVEL_ONE + 400)
|
||||
infection = "Mild Infection++:"
|
||||
if (INFECTION_LEVEL_TWO to INFECTION_LEVEL_TWO + 200)
|
||||
infection = "Acute Infection:"
|
||||
if (INFECTION_LEVEL_TWO + 200 to INFECTION_LEVEL_TWO + 300)
|
||||
infection = "Acute Infection+:"
|
||||
if (INFECTION_LEVEL_TWO + 300 to INFINITY)
|
||||
infection = "Acute Infection++:"
|
||||
|
||||
dat += "<tr>"
|
||||
dat += "<td>[i.name]</td><td>N/A</td><td>[i.damage]</td><td>[infection]:[mech]</td><td></td>"
|
||||
dat += "</tr>"
|
||||
dat += "</table>"
|
||||
if(occupant.sdisabilities & BLIND)
|
||||
dat += text("<font color='red'>Cataracts detected.</font><BR>")
|
||||
if(occupant.sdisabilities & NEARSIGHTED)
|
||||
dat += text("<font color='red'>Retinal misalignment detected.</font><BR>")
|
||||
else
|
||||
dat += "\The [src] is empty."
|
||||
else
|
||||
dat = "<font color='red'> Error: No Body Scanner connected.</font>"
|
||||
dat += text("<BR><BR><A href='?src=\ref[];mach_close=scanconsole'>Close</A>", user)
|
||||
user << browse(dat, "window=scanconsole;size=430x600")
|
||||
return
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
// name = "Circuit board (Shield Control)"
|
||||
// build_path = "/obj/machinery/computer/stationshield"
|
||||
/obj/item/weapon/circuitboard/teleporter
|
||||
name = "Circuit board (Teleporter)"
|
||||
name = "Circuit board (Teleporter Console)"
|
||||
build_path = "/obj/machinery/computer/teleporter"
|
||||
origin_tech = "programming=2;bluespace=2"
|
||||
/obj/item/weapon/circuitboard/secure_data
|
||||
@@ -222,6 +222,10 @@
|
||||
name = "Circuit board (Prison Shuttle)"
|
||||
build_path = "/obj/machinery/computer/prison_shuttle"
|
||||
origin_tech = "programming=2"
|
||||
/obj/item/weapon/circuitboard/telesci_console
|
||||
name = "Circuit board (Telepad Control Console)"
|
||||
build_path = "/obj/machinery/computer/telescience"
|
||||
origin_tech = "programming=3;bluespace=2"
|
||||
|
||||
/obj/item/weapon/circuitboard/HONKputer
|
||||
name = "Circuit board (HONKputer)"
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
var/trueY // Y + offset
|
||||
var/obj/machinery/telepad/telepad
|
||||
var/tele_id = "Telesci"
|
||||
var/obj/item/device/sps/inserted_sps
|
||||
var/last_target
|
||||
|
||||
/obj/machinery/computer/telescience/update_icon()
|
||||
if(stat & BROKEN)
|
||||
@@ -24,6 +26,12 @@
|
||||
else
|
||||
icon_state = initial(icon_state)
|
||||
stat &= ~NOPOWER
|
||||
|
||||
/obj/machinery/computer/telescience/Destroy()
|
||||
if(inserted_sps)
|
||||
inserted_sps.loc = loc
|
||||
inserted_sps = null
|
||||
..()
|
||||
|
||||
/obj/machinery/computer/telescience/attack_paw(mob/user)
|
||||
usr << "You are too primitive to use this computer."
|
||||
@@ -53,6 +61,7 @@
|
||||
data["coordx"] = x_co
|
||||
data["coordy"] = y_co
|
||||
data["coordz"] = z_co
|
||||
data["sps"] = inserted_sps
|
||||
|
||||
// Set up the Nano UI
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
@@ -144,6 +153,7 @@
|
||||
trueX = (x_co + x_off)
|
||||
trueY = (y_co + y_off)
|
||||
var/target = locate(trueX, trueY, z_co)
|
||||
last_target = target
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(5, 1, tele)
|
||||
s.start()
|
||||
@@ -222,6 +232,17 @@
|
||||
/obj/machinery/computer/telescience/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
if(href_list["ejectSPS"])
|
||||
inserted_sps.loc = loc
|
||||
inserted_sps = null
|
||||
nanomanager.update_uis(src)
|
||||
if(href_list["setMemory"])
|
||||
if(last_target)
|
||||
inserted_sps.locked_location = last_target
|
||||
usr << "\blue Location saved."
|
||||
else
|
||||
usr << "\red Error: No data stored."
|
||||
nanomanager.update_uis(src)
|
||||
if(href_list["setx"])
|
||||
var/a = input("Please input desired X coordinate.", name, x_co) as num
|
||||
a = copytext(sanitize(a), 1, 20)
|
||||
@@ -270,12 +291,25 @@
|
||||
nanomanager.update_uis(src)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/telescience/attackby(I as obj, user as mob) // Emagging
|
||||
/obj/machinery/computer/telescience/attackby(I as obj, var/mob/user as mob) // Emagging
|
||||
if(istype(I,/obj/item/weapon/card/emag))
|
||||
if (src.emagged == 0)
|
||||
user << "\blue You scramble the Telescience authentication key to an unknown signal. You should be able to teleport to more places now!"
|
||||
src.emagged = 1
|
||||
else
|
||||
user << "\red The machine seems unaffected by the card swipe..."
|
||||
else if(istype(I, /obj/item/device/sps))
|
||||
if(!inserted_sps)
|
||||
inserted_sps = I
|
||||
user.before_take_item(I)
|
||||
inserted_sps.loc = src
|
||||
user.visible_message("<span class='notice'>You insert [I] into the SPS device slot.</span>")
|
||||
attack_hand(user)
|
||||
else if(istype(I, /obj/item/device/multitool))
|
||||
var/obj/item/device/multitool/M = I
|
||||
if(M.buffer && istype(M.buffer, /obj/machinery/telepad))
|
||||
telepad = M.buffer
|
||||
M.buffer = null
|
||||
user << "<span class='caution'>You upload the data from [I]'s buffer.</span>"
|
||||
else
|
||||
return attack_hand(user)
|
||||
..()
|
||||
@@ -94,7 +94,7 @@
|
||||
user << "<span class='notice'>You remove the cables.</span>"
|
||||
state = 1
|
||||
icon_state = "box_0"
|
||||
var/obj/item/stack/cable_coil/A = new /obj/item/stack/cable_coil( src.loc )
|
||||
var/obj/item/stack/cable_coil/A = new /obj/item/stack/cable_coil(src.loc,5)
|
||||
A.amount = 5
|
||||
|
||||
if(3)
|
||||
@@ -138,6 +138,7 @@
|
||||
for(var/I in req_components)
|
||||
if(istype(P, text2path(I)) && (req_components[I] > 0))
|
||||
success=1
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
if(istype(P, /obj/item/stack/cable_coil))
|
||||
var/obj/item/stack/cable_coil/CP = P
|
||||
var/camt = min(CP.amount, req_components[I])
|
||||
@@ -165,6 +166,29 @@ micro-manipulator, console screen, beaker, Microlaser, matter bin, power cells.
|
||||
Note: Once everything is added to the public areas, will add m_amt and g_amt to circuit boards since autolathe won't be able
|
||||
to destroy them and players will be able to make replacements.
|
||||
*/
|
||||
/obj/item/weapon/circuitboard/thermomachine
|
||||
name = "circuit board (Freezer)"
|
||||
desc = "Use screwdriver to switch between heating and cooling modes."
|
||||
build_path = /obj/machinery/atmospherics/unary/cold_sink/freezer
|
||||
board_type = "machine"
|
||||
origin_tech = "programming=3;plasmatech=3"
|
||||
req_components = list(
|
||||
"/obj/item/weapon/stock_parts/matter_bin" = 2,
|
||||
"/obj/item/weapon/stock_parts/micro_laser" = 2,
|
||||
"/obj/item/stack/cable_coil" = 1,
|
||||
"/obj/item/weapon/stock_parts/console_screen" = 1)
|
||||
|
||||
/obj/item/weapon/circuitboard/thermomachine/attackby(obj/item/I, mob/user)
|
||||
if(istype(I, /obj/item/weapon/screwdriver))
|
||||
if(build_path == /obj/machinery/atmospherics/unary/cold_sink/freezer)
|
||||
build_path = /obj/machinery/atmospherics/unary/heat_reservoir/heater
|
||||
name = "circuit board (Heater)"
|
||||
user << "<span class='notice'>You set the board to heating.</span>"
|
||||
else
|
||||
build_path = /obj/machinery/atmospherics/unary/cold_sink/freezer
|
||||
name = "circuit board (Freezer)"
|
||||
user << "<span class='notice'>You set the board to cooling.</span>"
|
||||
|
||||
/obj/item/weapon/circuitboard/biogenerator
|
||||
name = "circuit board (Biogenerator)"
|
||||
build_path = /obj/machinery/biogenerator
|
||||
@@ -325,6 +349,37 @@ obj/item/weapon/circuitboard/rdserver
|
||||
"/obj/item/weapon/stock_parts/console_screen" = 1,
|
||||
"/obj/item/stack/cable_coil" = 2,)
|
||||
|
||||
/obj/item/weapon/circuitboard/mech_recharger
|
||||
name = "circuit board (Mechbay Recharger)"
|
||||
build_path = /obj/machinery/mech_bay_recharge_port
|
||||
board_type = "machine"
|
||||
origin_tech = "programming=3;powerstorage=4;engineering=4"
|
||||
frame_desc = "Requires 1 piece of cable and 5 Capacitors."
|
||||
req_components = list(
|
||||
"/obj/item/stack/cable_coil" = 1,
|
||||
"/obj/item/weapon/stock_parts/capacitor" = 5)
|
||||
|
||||
/obj/item/weapon/circuitboard/teleporter_hub
|
||||
name = "circuit board (Teleporter Hub)"
|
||||
build_path = /obj/machinery/teleport/hub
|
||||
board_type = "machine"
|
||||
origin_tech = "programming=3;engineering=5;bluespace=5;materials=4"
|
||||
frame_desc = "Requires 3 Bluespace Crystals and 1 Matter Bin."
|
||||
req_components = list(
|
||||
"/obj/item/bluespace_crystal" = 3,
|
||||
"/obj/item/weapon/stock_parts/matter_bin" = 1)
|
||||
|
||||
/obj/item/weapon/circuitboard/teleporter_station
|
||||
name = "circuit board (Teleporter Station)"
|
||||
build_path = /obj/machinery/teleport/station
|
||||
board_type = "machine"
|
||||
origin_tech = "programming=4;engineering=4;bluespace=4"
|
||||
frame_desc = "Requires 2 Bluespace Crystals, 2 Capacitors and 1 Console Screen."
|
||||
req_components = list(
|
||||
"/obj/item/bluespace_crystal" = 2,
|
||||
"/obj/item/weapon/stock_parts/capacitor" = 2,
|
||||
"/obj/item/weapon/stock_parts/console_screen" = 1)
|
||||
|
||||
/obj/item/weapon/circuitboard/telesci_pad
|
||||
name = "Circuit board (Telepad)"
|
||||
build_path = /obj/machinery/telepad
|
||||
@@ -343,12 +398,43 @@ obj/item/weapon/circuitboard/rdserver
|
||||
build_path = /obj/machinery/sleeper
|
||||
board_type = "machine"
|
||||
origin_tech = "programming=3;biotech=2;engineering=3;materials=3"
|
||||
frame_desc = "Requires 1 Matter Bin, 1 Manipulator, 1 piece of cable and 1 Console Screen."
|
||||
frame_desc = "Requires 1 Matter Bin, 1 Manipulator, 1 piece of cable and 2 Console Screens."
|
||||
req_components = list(
|
||||
"/obj/item/weapon/stock_parts/matter_bin" = 1,
|
||||
"/obj/item/weapon/stock_parts/manipulator" = 1,
|
||||
"/obj/item/stack/cable_coil" = 1,
|
||||
"/obj/item/weapon/stock_parts/console_screen" = 2)
|
||||
|
||||
/obj/item/weapon/circuitboard/sleep_console
|
||||
name = "circuit board (Sleeper Console)"
|
||||
build_path = /obj/machinery/sleep_console
|
||||
board_type = "machine"
|
||||
origin_tech = "programming=3;biotech=2;engineering=3;materials=3"
|
||||
frame_desc = "Requires 2 pieces of cable and 2 Console Screens."
|
||||
req_components = list(
|
||||
"/obj/item/stack/cable_coil" = 2,
|
||||
"/obj/item/weapon/stock_parts/console_screen" = 2)
|
||||
|
||||
/obj/item/weapon/circuitboard/bodyscanner
|
||||
name = "circuit board (Body Scanner)"
|
||||
build_path = /obj/machinery/bodyscanner
|
||||
board_type = "machine"
|
||||
origin_tech = "programming=3;biotech=2;engineering=3;materials=3"
|
||||
frame_desc = "Requires 1 Scanning Module, 2 pieces of cable and 2 Console Screens."
|
||||
req_components = list(
|
||||
"/obj/item/weapon/stock_parts/scanning_module" = 1,
|
||||
"/obj/item/stack/cable_coil" = 2,
|
||||
"/obj/item/weapon/stock_parts/console_screen" = 2)
|
||||
|
||||
/obj/item/weapon/circuitboard/bodyscanner_console
|
||||
name = "circuit board (Body Scanner Console)"
|
||||
build_path = /obj/machinery/body_scanconsole
|
||||
board_type = "machine"
|
||||
origin_tech = "programming=3;biotech=2;engineering=3;materials=3"
|
||||
frame_desc = "Requires 2 pieces of cable and 2 Console Screens."
|
||||
req_components = list(
|
||||
"/obj/item/stack/cable_coil" = 2,
|
||||
"/obj/item/weapon/stock_parts/console_screen" = 2)
|
||||
|
||||
/obj/item/weapon/circuitboard/cryo_tube
|
||||
name = "circuit board (Cryotube)"
|
||||
@@ -375,7 +461,7 @@ obj/item/weapon/circuitboard/rdserver
|
||||
// Telecomms circuit boards:
|
||||
/obj/item/weapon/circuitboard/telecomms/receiver
|
||||
name = "Circuit Board (Subspace Receiver)"
|
||||
build_path = "/obj/machinery/telecomms/receiver"
|
||||
build_path = /obj/machinery/telecomms/receiver
|
||||
board_type = "machine"
|
||||
origin_tech = "programming=4;engineering=3;bluespace=2"
|
||||
frame_desc = "Requires 1 Subspace Ansible, 1 Hyperwave Filter, 2 Manipulators, and 1 Micro-Laser."
|
||||
@@ -387,7 +473,7 @@ obj/item/weapon/circuitboard/rdserver
|
||||
|
||||
/obj/item/weapon/circuitboard/telecomms/hub
|
||||
name = "Circuit Board (Hub Mainframe)"
|
||||
build_path = "/obj/machinery/telecomms/hub"
|
||||
build_path = /obj/machinery/telecomms/hub
|
||||
board_type = "machine"
|
||||
origin_tech = "programming=4;engineering=4"
|
||||
frame_desc = "Requires 2 Manipulators, 2 Cable Coil and 2 Hyperwave Filter."
|
||||
@@ -398,7 +484,7 @@ obj/item/weapon/circuitboard/rdserver
|
||||
|
||||
/obj/item/weapon/circuitboard/telecomms/relay
|
||||
name = "Circuit Board (Relay Mainframe)"
|
||||
build_path = "/obj/machinery/telecomms/relay"
|
||||
build_path = /obj/machinery/telecomms/relay
|
||||
board_type = "machine"
|
||||
origin_tech = "programming=3;engineering=4;bluespace=3"
|
||||
frame_desc = "Requires 2 Manipulators, 2 Cable Coil and 2 Hyperwave Filters."
|
||||
@@ -409,7 +495,7 @@ obj/item/weapon/circuitboard/rdserver
|
||||
|
||||
/obj/item/weapon/circuitboard/telecomms/bus
|
||||
name = "Circuit Board (Bus Mainframe)"
|
||||
build_path = "/obj/machinery/telecomms/bus"
|
||||
build_path = /obj/machinery/telecomms/bus
|
||||
board_type = "machine"
|
||||
origin_tech = "programming=4;engineering=4"
|
||||
frame_desc = "Requires 2 Manipulators, 1 Cable Coil and 1 Hyperwave Filter."
|
||||
@@ -420,7 +506,7 @@ obj/item/weapon/circuitboard/rdserver
|
||||
|
||||
/obj/item/weapon/circuitboard/telecomms/processor
|
||||
name = "Circuit Board (Processor Unit)"
|
||||
build_path = "/obj/machinery/telecomms/processor"
|
||||
build_path = /obj/machinery/telecomms/processor
|
||||
board_type = "machine"
|
||||
origin_tech = "programming=4;engineering=4"
|
||||
frame_desc = "Requires 3 Manipulators, 1 Hyperwave Filter, 2 Treatment Disks, 1 Wavelength Analyzer, 2 Cable Coils and 1 Subspace Amplifier."
|
||||
@@ -434,7 +520,7 @@ obj/item/weapon/circuitboard/rdserver
|
||||
|
||||
/obj/item/weapon/circuitboard/telecomms/server
|
||||
name = "Circuit Board (Telecommunication Server)"
|
||||
build_path = "/obj/machinery/telecomms/server"
|
||||
build_path = /obj/machinery/telecomms/server
|
||||
board_type = "machine"
|
||||
origin_tech = "programming=4;engineering=4"
|
||||
frame_desc = "Requires 2 Manipulators, 1 Cable Coil and 1 Hyperwave Filter."
|
||||
@@ -445,7 +531,7 @@ obj/item/weapon/circuitboard/rdserver
|
||||
|
||||
/obj/item/weapon/circuitboard/telecomms/broadcaster
|
||||
name = "Circuit Board (Subspace Broadcaster)"
|
||||
build_path = "/obj/machinery/telecomms/broadcaster"
|
||||
build_path = /obj/machinery/telecomms/broadcaster
|
||||
board_type = "machine"
|
||||
origin_tech = "programming=4;engineering=4;bluespace=2"
|
||||
frame_desc = "Requires 2 Manipulators, 1 Cable Coil, 1 Hyperwave Filter, 1 Ansible Crystal and 2 High-Powered Micro-Lasers. "
|
||||
|
||||
@@ -297,6 +297,25 @@ Class Procs:
|
||||
user << "<span class='notice'>You close the maintenance hatch of [src].</span>"
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/machinery/proc/default_change_direction_wrench(var/mob/user, var/obj/item/weapon/wrench/W)
|
||||
if(panel_open && istype(W))
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
dir = pick(WEST,EAST,SOUTH,NORTH)
|
||||
user << "<span class='notice'>You clumsily rotate [src].</span>"
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/machinery/proc/default_unfasten_wrench(mob/user, obj/item/weapon/wrench/W, time = 20)
|
||||
if(istype(W))
|
||||
user << "<span class='notice'>Now [anchored ? "un" : ""]securing [name].</span>"
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
if(do_after(user, time))
|
||||
user << "<span class='notice'>You've [anchored ? "un" : ""]secured [name].</span>"
|
||||
anchored = !anchored
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/machinery/proc/state(var/msg)
|
||||
for(var/mob/O in hearers(src, null))
|
||||
|
||||
+359
-318
@@ -1,165 +1,236 @@
|
||||
/obj/machinery/computer/teleporter
|
||||
name = "Teleporter"
|
||||
name = "Teleporter Control Console"
|
||||
desc = "Used to control a linked teleportation Hub and Station."
|
||||
icon_state = "teleport"
|
||||
circuit = "/obj/item/weapon/circuitboard/teleporter"
|
||||
var/obj/item/locked = null
|
||||
var/obj/item/device/sps/locked = null
|
||||
var/regime_set = "Teleporter"
|
||||
var/id = null
|
||||
var/one_time_use = 0 //Used for one-time-use teleport cards (such as clown planet coordinates.)
|
||||
var/obj/machinery/teleport/station/power_station
|
||||
var/calibrating
|
||||
var/turf/target //Used for one-time-use teleport cards (such as clown planet coordinates.)
|
||||
//Setting this to 1 will set src.locked to null after a player enters the portal and will not allow hand-teles to open portals to that location.
|
||||
var/data[0]
|
||||
|
||||
/obj/machinery/computer/teleporter/New()
|
||||
src.id = "[rand(1000, 9999)]"
|
||||
link_power_station()
|
||||
..()
|
||||
return
|
||||
|
||||
/*
|
||||
/obj/machinery/computer/teleporter/attackby(I as obj, mob/living/user as mob)
|
||||
if(istype(I, /obj/item/weapon/card/data/))
|
||||
var/obj/item/weapon/card/data/C = I
|
||||
if(stat & (NOPOWER|BROKEN) & (C.function != "teleporter"))
|
||||
src.attack_hand()
|
||||
/obj/machinery/computer/teleporter/initialize()
|
||||
link_power_station()
|
||||
|
||||
var/obj/L = null
|
||||
|
||||
for(var/obj/effect/landmark/sloc in landmarks_list)
|
||||
if(sloc.name != C.data) continue
|
||||
if(locate(/mob/living) in sloc.loc) continue
|
||||
L = sloc
|
||||
/obj/machinery/computer/teleporter/proc/link_power_station()
|
||||
if(power_station)
|
||||
return
|
||||
for(dir in list(NORTH,EAST,SOUTH,WEST))
|
||||
power_station = locate(/obj/machinery/teleport/station, get_step(src, dir))
|
||||
if(power_station)
|
||||
break
|
||||
|
||||
if(!L)
|
||||
L = locate("landmark*[C.data]") // use old stype
|
||||
|
||||
|
||||
if(istype(L, /obj/effect/landmark/) && istype(L.loc, /turf))
|
||||
usr << "You insert the coordinates into the machine."
|
||||
usr << "A message flashes across the screen reminding the traveller that the nuclear authentication disk is to remain on the station at all times."
|
||||
user.drop_item()
|
||||
del(I)
|
||||
|
||||
if(C.data == "Clown Land")
|
||||
//whoops
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message("\red Incoming bluespace portal detected, unable to lock in.", 2)
|
||||
|
||||
for(var/obj/machinery/teleport/hub/H in range(1))
|
||||
var/amount = rand(2,5)
|
||||
for(var/i=0;i<amount;i++)
|
||||
new /mob/living/simple_animal/hostile/carp(get_turf(H))
|
||||
//
|
||||
else
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message("\blue Locked In", 2)
|
||||
src.locked = L
|
||||
one_time_use = 1
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
else
|
||||
..()
|
||||
|
||||
return
|
||||
*/
|
||||
return power_station
|
||||
|
||||
/obj/machinery/computer/teleporter/attackby(I as obj, mob/living/user as mob)
|
||||
if(istype(I, /obj/item/weapon/card/data/))
|
||||
var/obj/item/weapon/card/data/C = I
|
||||
if(stat & (NOPOWER|BROKEN) & (C.function != "teleporter"))
|
||||
src.attack_hand()
|
||||
|
||||
var/obj/L = null
|
||||
|
||||
for(var/obj/effect/landmark/sloc in landmarks_list)
|
||||
if(sloc.name != C.data) continue
|
||||
if(locate(/mob/living) in sloc.loc) continue
|
||||
L = sloc
|
||||
break
|
||||
|
||||
if(!L)
|
||||
L = locate("landmark*[C.data]") // use old stype
|
||||
|
||||
|
||||
if(istype(L, /obj/effect/landmark/) && istype(L.loc, /turf))
|
||||
src.locked = L
|
||||
one_time_use = 1
|
||||
|
||||
usr << "You insert the coordinates into the machine."
|
||||
usr << "A message flashes across the screen reminding the traveller that the nuclear authentication disk is to remain on the station at all times."
|
||||
user.drop_item()
|
||||
del(I)
|
||||
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message("\blue Locked In", 2)
|
||||
src.add_fingerprint(usr)
|
||||
if(istype(I, /obj/item/device/sps))
|
||||
var/obj/item/device/sps/L = I
|
||||
if(L.locked_location && !(stat & (NOPOWER|BROKEN)))
|
||||
user.before_take_item(L)
|
||||
L.loc = src
|
||||
locked = L
|
||||
user << "<span class='caution'>You insert the SPS device into the [name]'s slot.</span>"
|
||||
src.attack_hand(user)
|
||||
else
|
||||
user << "<span class='warning'>No useable data was found on te SPS device.</span>"
|
||||
else
|
||||
..()
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/computer/teleporter/attack_paw()
|
||||
src.attack_hand()
|
||||
/obj/machinery/computer/teleporter/attack_paw(mob/user)
|
||||
usr << "You are too primitive to use this computer."
|
||||
return
|
||||
|
||||
/obj/machinery/teleport/station/attack_ai()
|
||||
src.attack_hand()
|
||||
/obj/machinery/computer/teleporter/attack_ai(mob/user)
|
||||
src.attack_hand(user)
|
||||
|
||||
/obj/machinery/computer/teleporter/attack_hand()
|
||||
/obj/machinery/computer/teleporter/attack_hand(mob/user)
|
||||
ui_interact(user)
|
||||
|
||||
/obj/machinery/computer/teleporter/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
if(..())
|
||||
return
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
|
||||
data["powerstation"] = power_station
|
||||
if(power_station)
|
||||
data["teleporterhub"] = power_station.teleporter_hub
|
||||
data["calibrated"] = power_station.teleporter_hub.calibrated
|
||||
data["accurate"] = power_station.teleporter_hub.accurate
|
||||
else
|
||||
data["teleporterhub"] = null
|
||||
data["calibrated"] = null
|
||||
data["accurate"] = null
|
||||
data["regime"] = regime_set
|
||||
data["target"] = (!target) ? "None" : get_area(target)
|
||||
data["calibrating"] = calibrating
|
||||
data["locked"] = locked
|
||||
|
||||
var/list/L = list()
|
||||
var/list/areaindex = list()
|
||||
// Set up the Nano UI
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if (!ui)
|
||||
ui = new(user, src, ui_key, "teleporter_console.tmpl", "Teleporter Console UI", 400, 400)
|
||||
ui.set_initial_data(data)
|
||||
ui.open()
|
||||
|
||||
for(var/obj/item/device/radio/beacon/R in world)
|
||||
var/turf/T = get_turf(R)
|
||||
if (!T)
|
||||
continue
|
||||
if(T.z == 2 || T.z > 6)
|
||||
if (T.z == 7 & src.emagged == 1)
|
||||
// This should be empty, allows for it to continue if the z-level is 7 and the machine.
|
||||
/obj/machinery/computer/teleporter/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
if(href_list["eject"])
|
||||
eject()
|
||||
nanomanager.update_uis(src)
|
||||
return
|
||||
|
||||
if(!check_hub_connection())
|
||||
usr << "<span class='warning'>Error: Unable to detect hub.</span>"
|
||||
nanomanager.update_uis(src)
|
||||
return
|
||||
if(calibrating)
|
||||
usr << "<span class='warning'>Error: Calibration in progress. Stand by.</span>"
|
||||
nanomanager.update_uis(src)
|
||||
return
|
||||
|
||||
if(href_list["regimeset"])
|
||||
power_station.engaged = 0
|
||||
power_station.teleporter_hub.update_icon()
|
||||
power_station.teleporter_hub.calibrated = 0
|
||||
reset_regime()
|
||||
nanomanager.update_uis(src)
|
||||
if(href_list["settarget"])
|
||||
power_station.engaged = 0
|
||||
power_station.teleporter_hub.update_icon()
|
||||
power_station.teleporter_hub.calibrated = 0
|
||||
set_target(usr)
|
||||
nanomanager.update_uis(src)
|
||||
if(href_list["locked"])
|
||||
power_station.engaged = 0
|
||||
power_station.teleporter_hub.update_icon()
|
||||
power_station.teleporter_hub.calibrated = 0
|
||||
target = get_turf(locked.locked_location)
|
||||
nanomanager.update_uis(src)
|
||||
if(href_list["calibrate"])
|
||||
if(!target)
|
||||
usr << "<span class='warning'>Error: No target set to calibrate to.</span>"
|
||||
nanomanager.update_uis(src)
|
||||
return
|
||||
if(power_station.teleporter_hub.calibrated || power_station.teleporter_hub.accurate >= 3)
|
||||
usr << "<span class='notice'>Hub is already calibrated.</span>"
|
||||
nanomanager.update_uis(src)
|
||||
return
|
||||
src.visible_message("<span class='notice'>Processing hub calibration to target...</span>")
|
||||
|
||||
calibrating = 1
|
||||
nanomanager.update_uis(src)
|
||||
spawn(50 * (3 - power_station.teleporter_hub.accurate)) //Better parts mean faster calibration
|
||||
calibrating = 0
|
||||
if(check_hub_connection())
|
||||
power_station.teleporter_hub.calibrated = 1
|
||||
src.visible_message("<span class='notice'>Calibration complete.</span>")
|
||||
else
|
||||
continue
|
||||
var/tmpname = T.loc.name
|
||||
if(areaindex[tmpname])
|
||||
tmpname = "[tmpname] ([++areaindex[tmpname]])"
|
||||
else
|
||||
areaindex[tmpname] = 1
|
||||
L[tmpname] = R
|
||||
src.visible_message("<span class='warning'>Error: Unable to detect hub.</span>")
|
||||
nanomanager.update_uis(src)
|
||||
|
||||
for (var/obj/item/weapon/implant/tracking/I in world)
|
||||
if (!I.implanted || !ismob(I.loc))
|
||||
continue
|
||||
else
|
||||
var/mob/M = I.loc
|
||||
if (M.stat == 2)
|
||||
if (M.timeofdeath + 6000 < world.time)
|
||||
continue
|
||||
var/turf/T = get_turf(M)
|
||||
if(T) continue
|
||||
if(T.z == 2) continue
|
||||
var/tmpname = M.real_name
|
||||
nanomanager.update_uis(src)
|
||||
|
||||
/obj/machinery/computer/teleporter/proc/check_hub_connection()
|
||||
if(!power_station)
|
||||
return
|
||||
if(!power_station.teleporter_hub)
|
||||
return
|
||||
return 1
|
||||
|
||||
/obj/machinery/computer/teleporter/proc/reset_regime()
|
||||
target = null
|
||||
if(regime_set == "Teleporter")
|
||||
regime_set = "Gate"
|
||||
else
|
||||
regime_set = "Teleporter"
|
||||
|
||||
/obj/machinery/computer/teleporter/proc/eject()
|
||||
if(locked)
|
||||
locked.loc = src.loc
|
||||
locked = null
|
||||
|
||||
/obj/machinery/computer/teleporter/proc/set_target(mob/user)
|
||||
if(regime_set == "Teleporter")
|
||||
var/list/L = list()
|
||||
var/list/areaindex = list()
|
||||
|
||||
for(var/obj/item/device/radio/beacon/R in world)
|
||||
var/turf/T = get_turf(R)
|
||||
if (!T)
|
||||
continue
|
||||
if(T.z == 2 || T.z > 7)
|
||||
continue
|
||||
var/tmpname = T.loc.name
|
||||
if(areaindex[tmpname])
|
||||
tmpname = "[tmpname] ([++areaindex[tmpname]])"
|
||||
else
|
||||
areaindex[tmpname] = 1
|
||||
L[tmpname] = I
|
||||
L[tmpname] = R
|
||||
|
||||
var/desc = input("Please select a location to lock in.", "Locking Computer") in L
|
||||
src.locked = L[desc]
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message("\blue Locked In", 2)
|
||||
src.add_fingerprint(usr)
|
||||
return
|
||||
for (var/obj/item/weapon/implant/tracking/I in world)
|
||||
if (!I.implanted || !ismob(I.loc))
|
||||
continue
|
||||
else
|
||||
var/mob/M = I.loc
|
||||
if (M.stat == 2)
|
||||
if (M.timeofdeath + 6000 < world.time)
|
||||
continue
|
||||
var/turf/T = get_turf(M)
|
||||
if(!T) continue
|
||||
if(T.z == 2) continue
|
||||
var/tmpname = M.real_name
|
||||
if(areaindex[tmpname])
|
||||
tmpname = "[tmpname] ([++areaindex[tmpname]])"
|
||||
else
|
||||
areaindex[tmpname] = 1
|
||||
L[tmpname] = I
|
||||
|
||||
/obj/machinery/computer/teleporter/verb/set_id(t as text)
|
||||
set category = "Object"
|
||||
set name = "Set teleporter ID"
|
||||
set src in oview(1)
|
||||
set desc = "ID Tag:"
|
||||
var/desc = input("Please select a location to lock in.", "Locking Computer") in L
|
||||
target = L[desc]
|
||||
|
||||
if(stat & (NOPOWER|BROKEN) || !istype(usr,/mob/living))
|
||||
return
|
||||
if (t)
|
||||
src.id = t
|
||||
else
|
||||
var/list/L = list()
|
||||
var/list/areaindex = list()
|
||||
var/list/S = power_station.linked_stations
|
||||
if(!S.len)
|
||||
user << "<span class='alert'>No connected stations located.</span>"
|
||||
return
|
||||
for(var/obj/machinery/teleport/station/R in S)
|
||||
var/turf/T = get_turf(R)
|
||||
if (!T || !R.teleporter_hub || !R.teleporter_console)
|
||||
continue
|
||||
if(T.z == 2 || T.z > 7)
|
||||
continue
|
||||
var/tmpname = T.loc.name
|
||||
if(areaindex[tmpname])
|
||||
tmpname = "[tmpname] ([++areaindex[tmpname]])"
|
||||
else
|
||||
areaindex[tmpname] = 1
|
||||
L[tmpname] = R
|
||||
var/desc = input("Please select a station to lock in.", "Locking Computer") in L
|
||||
target = L[desc]
|
||||
if(target)
|
||||
var/obj/machinery/teleport/station/trg = target
|
||||
trg.linked_stations |= power_station
|
||||
trg.stat &= ~NOPOWER
|
||||
if(trg.teleporter_hub)
|
||||
trg.teleporter_hub.stat &= ~NOPOWER
|
||||
trg.teleporter_hub.update_icon()
|
||||
if(trg.teleporter_console)
|
||||
trg.teleporter_console.stat &= ~NOPOWER
|
||||
trg.teleporter_console.update_icon()
|
||||
return
|
||||
|
||||
/proc/find_loc(obj/R as obj)
|
||||
@@ -168,15 +239,13 @@
|
||||
while(!istype(T, /turf))
|
||||
T = T.loc
|
||||
if(!T || istype(T, /area)) return null
|
||||
return T
|
||||
|
||||
return T
|
||||
|
||||
/obj/machinery/teleport
|
||||
name = "teleport"
|
||||
icon = 'icons/obj/stationobjs.dmi'
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
var/lockeddown = 0
|
||||
|
||||
|
||||
/obj/machinery/teleport/hub
|
||||
name = "teleporter hub"
|
||||
@@ -186,138 +255,163 @@
|
||||
use_power = 1
|
||||
idle_power_usage = 10
|
||||
active_power_usage = 2000
|
||||
var/obj/machinery/teleport/station/power_station
|
||||
var/calibrated //Calibration prevents mutation
|
||||
|
||||
/obj/machinery/teleport/hub/New()
|
||||
..()
|
||||
link_power_station()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/teleporter_hub(null)
|
||||
component_parts += new /obj/item/bluespace_crystal/artificial(null)
|
||||
component_parts += new /obj/item/bluespace_crystal/artificial(null)
|
||||
component_parts += new /obj/item/bluespace_crystal/artificial(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(null)
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/teleport/hub/initialize()
|
||||
link_power_station()
|
||||
|
||||
/obj/machinery/teleport/hub/RefreshParts()
|
||||
var/A = 0
|
||||
for(var/obj/item/weapon/stock_parts/matter_bin/M in component_parts)
|
||||
A += M.rating
|
||||
accurate = A
|
||||
|
||||
/obj/machinery/teleport/hub/proc/link_power_station()
|
||||
if(power_station)
|
||||
return
|
||||
for(dir in list(NORTH,EAST,SOUTH,WEST))
|
||||
power_station = locate(/obj/machinery/teleport/station, get_step(src, dir))
|
||||
if(power_station)
|
||||
break
|
||||
return power_station
|
||||
|
||||
/obj/machinery/teleport/hub/Bumped(M as mob|obj)
|
||||
spawn()
|
||||
if (src.icon_state == "tele1")
|
||||
teleport(M)
|
||||
use_power(5000)
|
||||
if(power_station && power_station.engaged && !panel_open)
|
||||
teleport(M)
|
||||
use_power(5000)
|
||||
return
|
||||
|
||||
/obj/machinery/teleport/hub/proc/teleport(atom/movable/M as mob|obj)
|
||||
var/atom/l = src.loc
|
||||
var/obj/machinery/computer/teleporter/com = locate(/obj/machinery/computer/teleporter, locate(l.x - 2, l.y, l.z))
|
||||
/obj/machinery/teleport/hub/attackby(obj/item/W, mob/user)
|
||||
if(default_deconstruction_screwdriver(user, "tele-o", "tele0", W))
|
||||
return
|
||||
|
||||
if(exchange_parts(user, W))
|
||||
return
|
||||
|
||||
default_deconstruction_crowbar(W)
|
||||
|
||||
/obj/machinery/teleport/hub/proc/teleport(atom/movable/M as mob|obj, turf/T)
|
||||
var/obj/machinery/computer/teleporter/com = power_station.teleporter_console
|
||||
if (!com)
|
||||
return
|
||||
if (!com.locked)
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message("\red Failure: Cannot authenticate locked on coordinates. Please reinstate coordinate matrix.")
|
||||
if (!com.target)
|
||||
visible_message("<span class='notice'>Cannot authenticate locked on coordinates. Please reinstate coordinate matrix.</span>")
|
||||
return
|
||||
if (istype(M, /atom/movable))
|
||||
if(prob(5) && !accurate) //oh dear a problem, put em in deep space
|
||||
if(!calibrated && prob(25 - ((accurate) * 10))) //oh dear a problem
|
||||
do_teleport(M, locate(rand((2*TRANSITIONEDGE), world.maxx - (2*TRANSITIONEDGE)), rand((2*TRANSITIONEDGE), world.maxy - (2*TRANSITIONEDGE)), 3), 2)
|
||||
else
|
||||
do_teleport(M, com.locked) //dead-on precision
|
||||
|
||||
if(com.one_time_use) //Make one-time-use cards only usable one time!
|
||||
com.one_time_use = 0
|
||||
com.locked = null
|
||||
else
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(5, 1, src)
|
||||
s.start()
|
||||
for(var/mob/B in hearers(src, null))
|
||||
B.show_message("\blue Test fire completed.")
|
||||
else
|
||||
do_teleport(M, com.target)
|
||||
calibrated = 0
|
||||
return
|
||||
/*
|
||||
/proc/do_teleport(atom/movable/M as mob|obj, atom/destination, precision)
|
||||
if(istype(M, /obj/effect))
|
||||
del(M)
|
||||
return
|
||||
if (istype(M, /obj/item/weapon/disk/nuclear)) // Don't let nuke disks get teleported --NeoFite
|
||||
for(var/mob/O in viewers(M, null))
|
||||
O.show_message(text("\red <B>The [] bounces off of the portal!</B>", M.name), 1)
|
||||
return
|
||||
if (istype(M, /mob/living))
|
||||
var/mob/living/MM = M
|
||||
if(MM.check_contents_for(/obj/item/weapon/disk/nuclear))
|
||||
MM << "\red Something you are carrying seems to be unable to pass through the portal. Better drop it if you want to go through."
|
||||
return
|
||||
var/disky = 0
|
||||
for (var/atom/O in M.contents) //I'm pretty sure this accounts for the maximum amount of container in container stacking. --NeoFite
|
||||
if (istype(O, /obj/item/weapon/storage) || istype(O, /obj/item/weapon/gift))
|
||||
for (var/obj/OO in O.contents)
|
||||
if (istype(OO, /obj/item/weapon/storage) || istype(OO, /obj/item/weapon/gift))
|
||||
for (var/obj/OOO in OO.contents)
|
||||
if (istype(OOO, /obj/item/weapon/disk/nuclear))
|
||||
disky = 1
|
||||
if (istype(OO, /obj/item/weapon/disk/nuclear))
|
||||
disky = 1
|
||||
if (istype(O, /obj/item/weapon/disk/nuclear))
|
||||
disky = 1
|
||||
if (istype(O, /mob/living))
|
||||
var/mob/living/MM = O
|
||||
if(MM.check_contents_for(/obj/item/weapon/disk/nuclear))
|
||||
disky = 1
|
||||
if (disky)
|
||||
for(var/mob/P in viewers(M, null))
|
||||
P.show_message(text("\red <B>The [] bounces off of the portal!</B>", M.name), 1)
|
||||
return
|
||||
|
||||
//Bags of Holding cause bluespace teleportation to go funky. --NeoFite
|
||||
if (istype(M, /mob/living))
|
||||
var/mob/living/MM = M
|
||||
if(MM.check_contents_for(/obj/item/weapon/storage/backpack/holding))
|
||||
MM << "\red The Bluespace interface on your Bag of Holding interferes with the teleport!"
|
||||
precision = rand(1,100)
|
||||
if (istype(M, /obj/item/weapon/storage/backpack/holding))
|
||||
precision = rand(1,100)
|
||||
for (var/atom/O in M.contents) //I'm pretty sure this accounts for the maximum amount of container in container stacking. --NeoFite
|
||||
if (istype(O, /obj/item/weapon/storage) || istype(O, /obj/item/weapon/gift))
|
||||
for (var/obj/OO in O.contents)
|
||||
if (istype(OO, /obj/item/weapon/storage) || istype(OO, /obj/item/weapon/gift))
|
||||
for (var/obj/OOO in OO.contents)
|
||||
if (istype(OOO, /obj/item/weapon/storage/backpack/holding))
|
||||
precision = rand(1,100)
|
||||
if (istype(OO, /obj/item/weapon/storage/backpack/holding))
|
||||
precision = rand(1,100)
|
||||
if (istype(O, /obj/item/weapon/storage/backpack/holding))
|
||||
precision = rand(1,100)
|
||||
if (istype(O, /mob/living))
|
||||
var/mob/living/MM = O
|
||||
if(MM.check_contents_for(/obj/item/weapon/storage/backpack/holding))
|
||||
precision = rand(1,100)
|
||||
|
||||
|
||||
var/turf/destturf = get_turf(destination)
|
||||
|
||||
var/tx = destturf.x + rand(precision * -1, precision)
|
||||
var/ty = destturf.y + rand(precision * -1, precision)
|
||||
|
||||
var/tmploc
|
||||
|
||||
if (ismob(destination.loc)) //If this is an implant.
|
||||
tmploc = locate(tx, ty, destturf.z)
|
||||
/obj/machinery/teleport/hub/update_icon()
|
||||
if(panel_open)
|
||||
icon_state = "tele-o"
|
||||
else if(power_station && power_station.engaged)
|
||||
icon_state = "tele1"
|
||||
else
|
||||
tmploc = locate(tx, ty, destination.z)
|
||||
icon_state = "tele0"
|
||||
|
||||
if(tx == destturf.x && ty == destturf.y && (istype(destination.loc, /obj/structure/closet) || istype(destination.loc, /obj/structure/closet/secure_closet)))
|
||||
tmploc = destination.loc
|
||||
/obj/machinery/teleport/hub/syndicate/New()
|
||||
..()
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin/super(null)
|
||||
RefreshParts()
|
||||
|
||||
if(tmploc==null)
|
||||
return
|
||||
|
||||
M.loc = tmploc
|
||||
sleep(2)
|
||||
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(5, 1, M)
|
||||
s.start()
|
||||
return
|
||||
*/
|
||||
|
||||
/obj/machinery/teleport/station
|
||||
name = "station"
|
||||
desc = "It's the station thingy of a teleport thingy." //seriously, wtf.
|
||||
desc = "The power control station for a bluespace teleporter. Used for toggling power, and can activate a test-fire to prevent malfunctions."
|
||||
icon_state = "controller"
|
||||
var/active = 0
|
||||
var/engaged = 0
|
||||
use_power = 1
|
||||
idle_power_usage = 10
|
||||
active_power_usage = 2000
|
||||
var/obj/machinery/computer/teleporter/teleporter_console
|
||||
var/obj/machinery/teleport/hub/teleporter_hub
|
||||
var/list/linked_stations = list()
|
||||
var/efficiency = 0
|
||||
|
||||
/obj/machinery/teleport/station/attackby(var/obj/item/weapon/W)
|
||||
src.attack_hand()
|
||||
/obj/machinery/teleport/station/New()
|
||||
..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/teleporter_station(null)
|
||||
component_parts += new /obj/item/bluespace_crystal/artificial(null)
|
||||
component_parts += new /obj/item/bluespace_crystal/artificial(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/capacitor(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/capacitor(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(null)
|
||||
RefreshParts()
|
||||
link_console_and_hub()
|
||||
|
||||
/obj/machinery/teleport/station/initialize()
|
||||
link_console_and_hub()
|
||||
|
||||
/obj/machinery/teleport/station/RefreshParts()
|
||||
var/E
|
||||
for(var/obj/item/weapon/stock_parts/capacitor/C in component_parts)
|
||||
E += C.rating
|
||||
efficiency = E - 1
|
||||
|
||||
/obj/machinery/teleport/station/proc/link_console_and_hub()
|
||||
for(dir in list(NORTH,EAST,SOUTH,WEST))
|
||||
teleporter_hub = locate(/obj/machinery/teleport/hub, get_step(src, dir))
|
||||
if(teleporter_hub)
|
||||
teleporter_hub.link_power_station()
|
||||
break
|
||||
for(dir in list(NORTH,EAST,SOUTH,WEST))
|
||||
teleporter_console = locate(/obj/machinery/computer/teleporter, get_step(src, dir))
|
||||
if(teleporter_console)
|
||||
teleporter_console.link_power_station()
|
||||
break
|
||||
return teleporter_hub && teleporter_console
|
||||
|
||||
|
||||
/obj/machinery/teleport/station/Destroy()
|
||||
if(teleporter_hub)
|
||||
teleporter_hub.update_icon()
|
||||
..()
|
||||
|
||||
/obj/machinery/teleport/station/attackby(var/obj/item/weapon/W, mob/user)
|
||||
if(istype(W, /obj/item/device/multitool) && !panel_open)
|
||||
var/obj/item/device/multitool/M = W
|
||||
if(M.buffer && istype(M.buffer, /obj/machinery/teleport/station) && M.buffer != src)
|
||||
if(linked_stations.len < efficiency)
|
||||
linked_stations.Add(M.buffer)
|
||||
M.buffer = null
|
||||
user << "<span class='caution'>You upload the data from the [W.name]'s buffer.</span>"
|
||||
else
|
||||
user << "<span class='alert'>This station cant hold more information, try to use better parts.</span>"
|
||||
if(default_deconstruction_screwdriver(user, "controller-o", "controller", W))
|
||||
return
|
||||
|
||||
if(exchange_parts(user, W))
|
||||
return
|
||||
|
||||
default_deconstruction_crowbar(W)
|
||||
|
||||
if(panel_open)
|
||||
if(istype(W, /obj/item/device/multitool))
|
||||
var/obj/item/device/multitool/M = W
|
||||
M.buffer = src
|
||||
user << "<span class='caution'>You download the data to the [W.name]'s buffer.</span>"
|
||||
return
|
||||
if(istype(W, /obj/item/weapon/wirecutters))
|
||||
link_console_and_hub()
|
||||
user << "<span class='caution'>You reconnect the station to nearby machinery.</span>"
|
||||
return
|
||||
|
||||
/obj/machinery/teleport/station/attack_paw()
|
||||
src.attack_hand()
|
||||
@@ -325,93 +419,40 @@
|
||||
/obj/machinery/teleport/station/attack_ai()
|
||||
src.attack_hand()
|
||||
|
||||
/obj/machinery/teleport/station/attack_hand()
|
||||
if(engaged)
|
||||
src.disengage()
|
||||
/obj/machinery/teleport/station/attack_hand(mob/user)
|
||||
if(!panel_open)
|
||||
toggle(user)
|
||||
else
|
||||
src.engage()
|
||||
user << "<span class='notice'>Close the maintenance panel first.</span>"
|
||||
|
||||
/obj/machinery/teleport/station/proc/engage()
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
/obj/machinery/teleport/station/proc/toggle(mob/user)
|
||||
if (stat & (BROKEN|NOPOWER) || !teleporter_hub || !teleporter_console)
|
||||
return
|
||||
|
||||
var/atom/l = src.loc
|
||||
var/atom/com = locate(/obj/machinery/teleport/hub, locate(l.x + 1, l.y, l.z))
|
||||
if (com)
|
||||
com.icon_state = "tele1"
|
||||
if (teleporter_hub.panel_open)
|
||||
user << "<span class='notice'>Close the hub's maintenance panel first.</span>"
|
||||
return
|
||||
if (teleporter_console.target)
|
||||
src.engaged = !src.engaged
|
||||
use_power(5000)
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message("\blue Teleporter engaged!", 2)
|
||||
src.add_fingerprint(usr)
|
||||
src.engaged = 1
|
||||
return
|
||||
|
||||
/obj/machinery/teleport/station/proc/disengage()
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
|
||||
var/atom/l = src.loc
|
||||
var/atom/com = locate(/obj/machinery/teleport/hub, locate(l.x + 1, l.y, l.z))
|
||||
if (com)
|
||||
com.icon_state = "tele0"
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message("\blue Teleporter disengaged!", 2)
|
||||
src.add_fingerprint(usr)
|
||||
src.engaged = 0
|
||||
return
|
||||
|
||||
/obj/machinery/teleport/station/verb/testfire()
|
||||
set name = "Test Fire Teleporter"
|
||||
set category = "Object"
|
||||
set src in oview(1)
|
||||
|
||||
if(stat & (BROKEN|NOPOWER) || !istype(usr,/mob/living))
|
||||
return
|
||||
|
||||
var/atom/l = src.loc
|
||||
var/obj/machinery/teleport/hub/com = locate(/obj/machinery/teleport/hub, locate(l.x + 1, l.y, l.z))
|
||||
if (com && !active)
|
||||
active = 1
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message("\blue Test firing!", 2)
|
||||
com.teleport()
|
||||
use_power(5000)
|
||||
|
||||
spawn(30)
|
||||
active=0
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
visible_message("<span class='notice'>Teleporter [engaged ? "" : "dis"]engaged!</span>")
|
||||
else
|
||||
visible_message("<span class='alert'>No target detected.</span>")
|
||||
src.engaged = 0
|
||||
teleporter_hub.update_icon()
|
||||
src.add_fingerprint(user)
|
||||
return
|
||||
|
||||
/obj/machinery/teleport/station/power_change()
|
||||
..()
|
||||
if(stat & NOPOWER)
|
||||
update_icon()
|
||||
if(teleporter_hub)
|
||||
teleporter_hub.update_icon()
|
||||
|
||||
/obj/machinery/teleport/station/update_icon()
|
||||
if(panel_open)
|
||||
icon_state = "controller-o"
|
||||
else if(stat & NOPOWER)
|
||||
icon_state = "controller-p"
|
||||
var/obj/machinery/teleport/hub/com = locate(/obj/machinery/teleport/hub, locate(x + 1, y, z))
|
||||
if(com)
|
||||
com.icon_state = "tele0"
|
||||
else
|
||||
icon_state = "controller"
|
||||
|
||||
|
||||
/obj/effect/laser/Bump()
|
||||
src.range--
|
||||
return
|
||||
|
||||
/obj/effect/laser/Move()
|
||||
src.range--
|
||||
return
|
||||
|
||||
/atom/proc/laserhit(L as obj)
|
||||
return 1
|
||||
|
||||
|
||||
/obj/machinery/computer/teleporter/attackby(I as obj, user as mob) //Emagging.
|
||||
if(istype(I,/obj/item/weapon/card/emag))
|
||||
if (src.emagged == 0)
|
||||
user << "\blue You scramble the Teleporter's circuits. You should be able to teleport to more places now!"
|
||||
src.emagged = 1
|
||||
else
|
||||
user << "\red The machine seems unaffected by the card swipe..."
|
||||
else
|
||||
return attack_hand(user)
|
||||
+117
-183
@@ -1,218 +1,152 @@
|
||||
/turf/simulated/floor/mech_bay_recharge_floor
|
||||
name = "Mech Bay Recharge Station"
|
||||
icon = 'icons/mecha/mech_bay.dmi'
|
||||
icon_state = "recharge_floor"
|
||||
var/obj/machinery/mech_bay_recharge_port/recharge_port
|
||||
var/obj/machinery/computer/mech_bay_power_console/recharge_console
|
||||
var/obj/mecha/recharging_mecha = null
|
||||
|
||||
Entered(var/obj/mecha/mecha)
|
||||
. = ..()
|
||||
if(istype(mecha))
|
||||
mecha.occupant_message("<b>Initializing power control devices.</b>")
|
||||
init_devices()
|
||||
if(recharge_console && recharge_port)
|
||||
recharging_mecha = mecha
|
||||
recharge_console.mecha_in(mecha)
|
||||
return
|
||||
else if(!recharge_console)
|
||||
mecha.occupant_message("<font color='red'>Control console not found. Terminating.</font>")
|
||||
else if(!recharge_port)
|
||||
mecha.occupant_message("<font color='red'>Power port not found. Terminating.</font>")
|
||||
return
|
||||
|
||||
Exited(atom)
|
||||
. = ..()
|
||||
if(atom == recharging_mecha)
|
||||
recharging_mecha = null
|
||||
if(recharge_console)
|
||||
recharge_console.mecha_out()
|
||||
return
|
||||
|
||||
proc/init_devices()
|
||||
recharge_console = locate() in range(1,src)
|
||||
recharge_port = locate(/obj/machinery/mech_bay_recharge_port, get_step(src, WEST))
|
||||
if(recharge_console)
|
||||
recharge_console.recharge_floor = src
|
||||
if(recharge_port)
|
||||
recharge_console.recharge_port = recharge_port
|
||||
if(recharge_port)
|
||||
recharge_port.recharge_floor = src
|
||||
if(recharge_console)
|
||||
recharge_port.recharge_console = recharge_console
|
||||
return
|
||||
|
||||
/turf/simulated/floor/mech_bay_recharge_floor // Whose idea it was
|
||||
name = "Mech Bay Recharge Station" // Recharging turfs
|
||||
icon = 'icons/turf/floors.dmi' // That are set in stone to check the west turf for recharge port
|
||||
icon_state = "recharge_floor" // Some people just want to watch the world burn i guess
|
||||
|
||||
/turf/simulated/floor/mech_bay_recharge_floor/break_tile()
|
||||
src.ChangeTurf(/turf/simulated/floor/plating)
|
||||
|
||||
/turf/simulated/floor/mech_bay_recharge_floor/airless
|
||||
icon_state = "recharge_floor_asteroid"
|
||||
oxygen = 0.01
|
||||
nitrogen = 0.01
|
||||
temperature = TCMB
|
||||
|
||||
/obj/machinery/mech_bay_recharge_port
|
||||
name = "Mech Bay Power Port"
|
||||
density = 1
|
||||
anchored = 1
|
||||
dir = 4
|
||||
icon = 'icons/mecha/mech_bay.dmi'
|
||||
icon_state = "recharge_port"
|
||||
var/turf/simulated/floor/mech_bay_recharge_floor/recharge_floor
|
||||
var/obj/mecha/recharging_mech
|
||||
var/obj/machinery/computer/mech_bay_power_console/recharge_console
|
||||
var/datum/global_iterator/mech_bay_recharger/pr_recharger
|
||||
var/max_charge = 50
|
||||
var/on = 0
|
||||
var/repairability = 0
|
||||
var/turf/recharging_turf = null
|
||||
|
||||
New()
|
||||
..()
|
||||
pr_recharger = new /datum/global_iterator/mech_bay_recharger(null,0)
|
||||
/obj/machinery/mech_bay_recharge_port/New()
|
||||
..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/mech_recharger(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/capacitor(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/capacitor(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/capacitor(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/capacitor(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/capacitor(src)
|
||||
component_parts += new /obj/item/stack/cable_coil(src, 1)
|
||||
RefreshParts()
|
||||
recharging_turf = get_step(loc, dir)
|
||||
|
||||
/obj/machinery/mech_bay_recharge_port/RefreshParts()
|
||||
var/MC
|
||||
for(var/obj/item/weapon/stock_parts/capacitor/C in component_parts)
|
||||
MC += C.rating
|
||||
max_charge = MC * 25
|
||||
|
||||
/obj/machinery/mech_bay_recharge_port/process()
|
||||
if(stat & NOPOWER || !recharge_console)
|
||||
return
|
||||
if(!recharging_mech)
|
||||
recharging_mech = locate(/obj/mecha) in recharging_turf
|
||||
if(recharging_mech)
|
||||
recharge_console.update_icon()
|
||||
if(recharging_mech && recharging_mech.cell)
|
||||
if(recharging_mech.cell.charge < recharging_mech.cell.maxcharge)
|
||||
var/delta = min(max_charge, recharging_mech.cell.maxcharge - recharging_mech.cell.charge)
|
||||
recharging_mech.give_power(delta)
|
||||
use_power(delta*150)
|
||||
else
|
||||
recharge_console.update_icon()
|
||||
if(recharging_mech.loc != recharging_turf)
|
||||
recharging_mech = null
|
||||
recharge_console.update_icon()
|
||||
|
||||
|
||||
/obj/machinery/mech_bay_recharge_port/attackby(obj/item/I, mob/user)
|
||||
if(default_deconstruction_screwdriver(user, "recharge_port-o", "recharge_port", I))
|
||||
return
|
||||
|
||||
proc/start_charge(var/obj/mecha/recharging_mecha)
|
||||
if(stat&(NOPOWER|BROKEN))
|
||||
recharging_mecha.occupant_message("<font color='red'>Power port not responding. Terminating.</font>")
|
||||
return 0
|
||||
else
|
||||
if(recharging_mecha.cell)
|
||||
recharging_mecha.occupant_message("Now charging...")
|
||||
pr_recharger.start(list(src,recharging_mecha))
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
proc/stop_charge()
|
||||
if(recharge_console && !recharge_console.stat)
|
||||
recharge_console.icon_state = initial(recharge_console.icon_state)
|
||||
pr_recharger.stop()
|
||||
if(default_change_direction_wrench(user, I))
|
||||
recharging_turf = get_step(loc, dir)
|
||||
return
|
||||
|
||||
proc/active()
|
||||
if(pr_recharger.active())
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
power_change()
|
||||
if(powered())
|
||||
stat &= ~NOPOWER
|
||||
else
|
||||
spawn(rand(0, 15))
|
||||
stat |= NOPOWER
|
||||
pr_recharger.stop()
|
||||
if(exchange_parts(user, I))
|
||||
return
|
||||
|
||||
proc/set_voltage(new_voltage)
|
||||
if(new_voltage && isnum(new_voltage))
|
||||
pr_recharger.max_charge = new_voltage
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
|
||||
/datum/global_iterator/mech_bay_recharger
|
||||
delay = 20
|
||||
var/max_charge = 45
|
||||
check_for_null = 0 //since port.stop_charge() must be called. The checks are made in process()
|
||||
|
||||
process(var/obj/machinery/mech_bay_recharge_port/port, var/obj/mecha/mecha)
|
||||
if(!port)
|
||||
return 0
|
||||
if(mecha && mecha in port.recharge_floor)
|
||||
if(!mecha.cell) return
|
||||
var/delta = min(max_charge, mecha.cell.maxcharge - mecha.cell.charge)
|
||||
if(delta>0)
|
||||
mecha.give_power(delta)
|
||||
port.use_power(delta*150)
|
||||
else
|
||||
mecha.occupant_message("<font color='blue'><b>Fully charged.</b></font>")
|
||||
port.stop_charge()
|
||||
else
|
||||
port.stop_charge()
|
||||
return
|
||||
|
||||
|
||||
|
||||
default_deconstruction_crowbar(I)
|
||||
|
||||
/obj/machinery/computer/mech_bay_power_console
|
||||
name = "Mech Bay Power Control Console"
|
||||
desc = "Used to control mechbay power ports."
|
||||
density = 1
|
||||
anchored = 1
|
||||
icon = 'icons/obj/computer.dmi'
|
||||
icon_state = "recharge_comp"
|
||||
circuit = "/obj/item/weapon/circuitboard/mech_bay_power_console"
|
||||
var/autostart = 1
|
||||
var/voltage = 45
|
||||
var/turf/simulated/floor/mech_bay_recharge_floor/recharge_floor
|
||||
circuit = /obj/item/weapon/circuitboard/mech_bay_power_console
|
||||
var/obj/machinery/mech_bay_recharge_port/recharge_port
|
||||
|
||||
proc/mecha_in(var/obj/mecha/mecha)
|
||||
if(stat&(NOPOWER|BROKEN))
|
||||
mecha.occupant_message("<font color='red'>Control console not responding. Terminating...</font>")
|
||||
return
|
||||
if(recharge_port && autostart)
|
||||
var/answer = recharge_port.start_charge(mecha)
|
||||
if(answer)
|
||||
recharge_port.set_voltage(voltage)
|
||||
src.icon_state = initial(src.icon_state)+"_on"
|
||||
/obj/machinery/computer/mech_bay_power_console/attack_ai(mob/user)
|
||||
return interact(user)
|
||||
|
||||
/obj/machinery/computer/mech_bay_power_console/attack_hand(mob/user)
|
||||
if(..())
|
||||
return
|
||||
interact(user)
|
||||
|
||||
proc/mecha_out()
|
||||
if(recharge_port)
|
||||
recharge_port.stop_charge()
|
||||
/obj/machinery/computer/mech_bay_power_console/interact(mob/user)
|
||||
var/data
|
||||
if(!recharge_port)
|
||||
data += "<div class='statusDisplay'>No recharging port detected.</div><BR>"
|
||||
data += "<A href='?src=\ref[src];reconnect=1'>Reconnect</A>"
|
||||
else
|
||||
data += "<h3>Mech status</h3>"
|
||||
if(!recharge_port.recharging_mech)
|
||||
data += "<div class='statusDisplay'>No mech detected.</div>"
|
||||
else
|
||||
data += "<div class='statusDisplay'>Integrity: [recharge_port.recharging_mech.health]<BR>"
|
||||
data += "Power: [recharge_port.recharging_mech.cell.charge]/[recharge_port.recharging_mech.cell.maxcharge]</div>"
|
||||
|
||||
var/datum/browser/popup = new(user, "mech recharger", name, 300, 300)
|
||||
popup.set_content(data)
|
||||
popup.open()
|
||||
return
|
||||
|
||||
/obj/machinery/computer/mech_bay_power_console/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
if(href_list["reconnect"])
|
||||
reconnect()
|
||||
updateUsrDialog()
|
||||
|
||||
|
||||
power_change()
|
||||
if(stat & BROKEN)
|
||||
icon_state = initial(icon_state)+"_broken"
|
||||
/obj/machinery/computer/mech_bay_power_console/proc/reconnect()
|
||||
if(recharge_port)
|
||||
return
|
||||
recharge_port = locate(/obj/machinery/mech_bay_recharge_port) in range(1)
|
||||
if(!recharge_port)
|
||||
for(var/D in cardinal)
|
||||
var/turf/A = get_step(src, D)
|
||||
A = get_step(A, D)
|
||||
recharge_port = locate(/obj/machinery/mech_bay_recharge_port) in A
|
||||
if(recharge_port)
|
||||
recharge_port.stop_charge()
|
||||
else if(powered())
|
||||
icon_state = initial(icon_state)
|
||||
stat &= ~NOPOWER
|
||||
break
|
||||
if(recharge_port)
|
||||
if(!recharge_port.recharge_console)
|
||||
recharge_port.recharge_console = src
|
||||
else
|
||||
spawn(rand(0, 15))
|
||||
icon_state = initial(icon_state)+"_nopower"
|
||||
stat |= NOPOWER
|
||||
if(recharge_port)
|
||||
recharge_port.stop_charge()
|
||||
recharge_port = null
|
||||
|
||||
set_broken()
|
||||
icon_state = initial(icon_state)+"_broken"
|
||||
stat |= BROKEN
|
||||
if(recharge_port)
|
||||
recharge_port.stop_charge()
|
||||
|
||||
attack_hand(mob/user as mob)
|
||||
if(..()) return
|
||||
var/output = "<html><head><title>[src.name]</title></head><body>"
|
||||
if(!recharge_floor)
|
||||
output += "<font color='red'>Mech Bay Recharge Station not initialized.</font><br>"
|
||||
else
|
||||
output += {"<b>Mech Bay Recharge Station Data:</b><div style='margin-left: 15px;'>
|
||||
<b>Mecha: </b>[recharge_floor.recharging_mecha||"None"]<br>"}
|
||||
if(recharge_floor.recharging_mecha)
|
||||
var/cell_charge = recharge_floor.recharging_mecha.get_charge()
|
||||
output += "<b>Cell charge: </b>[isnull(cell_charge)?"No powercell found":"[recharge_floor.recharging_mecha.cell.charge]/[recharge_floor.recharging_mecha.cell.maxcharge]"]<br>"
|
||||
output += "</div>"
|
||||
if(!recharge_port)
|
||||
output += "<font color='red'>Mech Bay Power Port not initialized.</font><br>"
|
||||
else
|
||||
output += "<b>Mech Bay Power Port Status: </b>[recharge_port.active()?"Now charging":"On hold"]<br>"
|
||||
|
||||
/*
|
||||
output += {"<hr>
|
||||
<b>Settings:</b>
|
||||
<div style='margin-left: 15px;'>
|
||||
<b>Start sequence on succesful init: </b><a href='?src=\ref[src];autostart=1'>[autostart?"On":"Off"]</a><br>
|
||||
<b>Recharge Port Voltage: </b><a href='?src=\ref[src];voltage=30'>Low</a> - <a href='?src=\ref[src];voltage=45'>Medium</a> - <a href='?src=\ref[src];voltage=60'>High</a><br>
|
||||
</div>"}
|
||||
*/
|
||||
|
||||
output += "</ body></html>"
|
||||
user << browse(output, "window=mech_bay_console")
|
||||
onclose(user, "mech_bay_console")
|
||||
return
|
||||
/obj/machinery/computer/mech_bay_power_console/process()
|
||||
if(recharge_port && recharge_port.recharging_mech && recharge_port.recharging_mech.cell)
|
||||
updateDialog()
|
||||
|
||||
|
||||
Topic(href, href_list)
|
||||
if(href_list["autostart"])
|
||||
autostart = !autostart
|
||||
if(href_list["voltage"])
|
||||
voltage = text2num(href_list["voltage"])
|
||||
if(recharge_port)
|
||||
recharge_port.set_voltage(voltage)
|
||||
updateUsrDialog()
|
||||
return
|
||||
/obj/machinery/computer/mech_bay_power_console/update_icon()
|
||||
if(!recharge_port || !recharge_port.recharging_mech || !recharge_port.recharging_mech.cell || !(recharge_port.recharging_mech.cell.charge < recharge_port.recharging_mech.cell.maxcharge))
|
||||
icon_state = "recharge_comp"
|
||||
else
|
||||
icon_state = "recharge_comp_on"
|
||||
|
||||
/obj/machinery/computer/mech_bay_power_console/initialize()
|
||||
reconnect()
|
||||
|
||||
@@ -1,19 +1,26 @@
|
||||
var/list/sps_list = list()
|
||||
/obj/item/device/sps
|
||||
name = "Space Positioning System"
|
||||
desc = "Helping lost spacemen find their way through the galaxy since 3016."
|
||||
name = "space positioning system"
|
||||
desc = "Helping lost spacemen find their way through the planets since 2016."
|
||||
icon = 'icons/obj/telescience.dmi'
|
||||
icon_state = "gps-c"
|
||||
w_class = 2.0
|
||||
flags = FPRINT
|
||||
slot_flags = SLOT_BELT
|
||||
origin_tech = "programming=2;engineering=2"
|
||||
var/gpstag = "COM0"
|
||||
origin_tech = "materials=2;magnets=3;bluespace=2"
|
||||
var/spstag = "COM0"
|
||||
var/emped = 0
|
||||
var/turf/locked_location
|
||||
|
||||
/obj/item/device/sps/New()
|
||||
name = "Space Positioning System ([gpstag])"
|
||||
..()
|
||||
sps_list.Add(src)
|
||||
name = "space positioning system ([spstag])"
|
||||
overlays += "working"
|
||||
|
||||
/obj/item/device/sps/Destroy()
|
||||
sps_list.Remove(src)
|
||||
..()
|
||||
|
||||
/obj/item/device/sps/emp_act(severity)
|
||||
emped = 1
|
||||
overlays -= "working"
|
||||
@@ -24,43 +31,54 @@
|
||||
overlays += "working"
|
||||
|
||||
/obj/item/device/sps/attack_self(mob/user as mob)
|
||||
|
||||
var/obj/item/device/sps/t = ""
|
||||
var/sps_window_height = 110 + sps_list.len * 20 // Variable window height, depending on how many sps units there are to show
|
||||
if(emped)
|
||||
t += "ERROR"
|
||||
else
|
||||
t += "<BR><A href='?src=\ref[src];tag=1'>Set Tag</A> "
|
||||
t += "<BR>Tag: [gpstag]"
|
||||
t += "<A href='?src=\ref[src];tag=1'>Set Tag</A><A href='?src=\ref[src];refresh=1'>Refresh</A>"
|
||||
t += "<BR>Tag: [spstag]"
|
||||
if(locked_location && locked_location.loc)
|
||||
t += "<BR>Bluespace coordinates saved: [locked_location.loc]"
|
||||
sps_window_height += 20
|
||||
|
||||
for(var/obj/item/device/sps/G in world)
|
||||
for(var/obj/item/device/sps/G in sps_list)
|
||||
var/turf/pos = get_turf(G)
|
||||
var/area/gps_area = get_area(G)
|
||||
var/tracked_gpstag = G.gpstag
|
||||
var/area/sps_area = get_area(G)
|
||||
var/tracked_spstag = G.spstag
|
||||
if(G.emped == 1)
|
||||
t += "<BR>[tracked_gpstag]: ERROR"
|
||||
t += "<BR>[tracked_spstag]: ERROR"
|
||||
else
|
||||
t += "<BR>[tracked_gpstag]: [format_text(gps_area.name)] ([pos.x], [pos.y], [pos.z])"
|
||||
t += "<BR>[tracked_spstag]: [format_text(sps_area.name)] ([pos.x], [pos.y], [pos.z])"
|
||||
|
||||
var/datum/browser/popup = new(user, "SPS", name, 600, 450)
|
||||
var/datum/browser/popup = new(user, "sps", name, 360, min(sps_window_height, 800))
|
||||
popup.set_content(t)
|
||||
popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
|
||||
popup.open()
|
||||
|
||||
/obj/item/device/sps/Topic(href, href_list)
|
||||
..()
|
||||
if(href_list["tag"] )
|
||||
var/a = input("Please enter desired tag.", name, gpstag) as text
|
||||
a = copytext(sanitize(a), 1, 20)
|
||||
if(length(a) != 4)
|
||||
usr << "\blue The tag must be four letters long!"
|
||||
return
|
||||
else
|
||||
gpstag = a
|
||||
name = "Space Positioning System ([gpstag])"
|
||||
return
|
||||
var/a = input("Please enter desired tag.", name, spstag) as text
|
||||
a = uppertext(copytext(sanitize(a), 1, 5))
|
||||
if(src.loc == usr)
|
||||
spstag = a
|
||||
name = "space positioning system ([spstag])"
|
||||
attack_self(usr)
|
||||
if(href_list["refresh"] )
|
||||
if(src.loc == usr)
|
||||
attack_self(usr)
|
||||
|
||||
/obj/item/device/sps/science
|
||||
icon_state = "gps-s"
|
||||
gpstag = "SCI0"
|
||||
spstag = "SCI0"
|
||||
|
||||
/obj/item/device/sps/engineering
|
||||
icon_state = "gps-e"
|
||||
gpstag = "ENG0"
|
||||
spstag = "ENG0"
|
||||
|
||||
/obj/item/device/sps/mining
|
||||
icon_state = "gps-m"
|
||||
spstag = "MINE0"
|
||||
desc = "A positioning system helpful for rescuing trapped or injured miners, keeping one on you at all times while mining might just save your life."
|
||||
|
||||
@@ -128,26 +128,26 @@ Frequency:
|
||||
icon = 'icons/obj/device.dmi'
|
||||
icon_state = "hand_tele"
|
||||
item_state = "electronic"
|
||||
throwforce = 5
|
||||
throwforce = 0
|
||||
w_class = 2.0
|
||||
throw_speed = 3
|
||||
throw_range = 5
|
||||
m_amt = 10000
|
||||
origin_tech = "magnets=1;bluespace=3"
|
||||
var/active_portals = 0
|
||||
|
||||
/obj/item/weapon/hand_tele/attack_self(mob/user as mob)
|
||||
var/turf/current_location = get_turf(user)//What turf is the user on?
|
||||
if(!current_location||current_location.z==2||current_location.z>=8)//If turf was not found or they're on z level 2 or >8 which does not currently exist.
|
||||
if(!current_location||current_location.z==2||current_location.z>=7)//If turf was not found or they're on z level 2 or >7 which does not currently exist.
|
||||
user << "<span class='notice'>\The [src] is malfunctioning.</span>"
|
||||
return
|
||||
var/list/L = list( )
|
||||
for(var/obj/machinery/teleport/hub/R in world)
|
||||
var/obj/machinery/computer/teleporter/com = locate(/obj/machinery/computer/teleporter, locate(R.x - 2, R.y, R.z))
|
||||
if (istype(com, /obj/machinery/computer/teleporter) && com.locked && !com.one_time_use)
|
||||
if(R.icon_state == "tele1")
|
||||
L["[com.id] (Active)"] = com.locked
|
||||
for(var/obj/machinery/computer/teleporter/com in world)
|
||||
if(com.target)
|
||||
if(com.power_station && com.power_station.teleporter_hub && com.power_station.engaged)
|
||||
L["[com.id] (Active)"] = com.target
|
||||
else
|
||||
L["[com.id] (Inactive)"] = com.locked
|
||||
L["[com.id] (Inactive)"] = com.target
|
||||
var/list/turfs = list( )
|
||||
for(var/turf/T in orange(10))
|
||||
if(T.x>world.maxx-8 || T.x<8) continue //putting them at the edge is dumb
|
||||
@@ -158,19 +158,16 @@ Frequency:
|
||||
var/t1 = input(user, "Please select a teleporter to lock in on.", "Hand Teleporter") in L
|
||||
if ((user.get_active_hand() != src || user.stat || user.restrained()))
|
||||
return
|
||||
var/count = 0 //num of portals from this teleport in world
|
||||
for(var/obj/effect/portal/PO in world)
|
||||
if(PO.creator == src) count++
|
||||
if(count >= 3)
|
||||
if(active_portals >= 3)
|
||||
user.show_message("<span class='notice'>\The [src] is recharging!</span>")
|
||||
return
|
||||
var/T = L[t1]
|
||||
for(var/mob/O in hearers(user, null))
|
||||
O.show_message("<span class='notice'>Locked In.</span>", 2)
|
||||
user.show_message("<span class='notice'>Locked In.</span>", 2)
|
||||
var/obj/effect/portal/P = new /obj/effect/portal( get_turf(src) )
|
||||
P.target = T
|
||||
P.creator = src
|
||||
try_move_adjacent(P)
|
||||
active_portals++
|
||||
src.add_fingerprint(user)
|
||||
return
|
||||
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
if(climbable)
|
||||
structure_shaken()
|
||||
|
||||
return
|
||||
return 1
|
||||
|
||||
/obj/structure/closet/crate/close()
|
||||
if(!src.opened)
|
||||
|
||||
@@ -395,6 +395,7 @@
|
||||
src.modules += new /obj/item/weapon/gripper(src)
|
||||
src.modules += new /obj/item/weapon/matter_decompiler(src)
|
||||
src.modules += new /obj/item/weapon/reagent_containers/spray/cleaner/drone(src)
|
||||
src.modules += new /obj/item/weapon/soap(src)
|
||||
|
||||
src.emag = new /obj/item/weapon/pickaxe/plasmacutter(src)
|
||||
src.emag.name = "Plasma Cutter"
|
||||
|
||||
@@ -56,6 +56,7 @@ display round(lastgen) and plasmatank amount
|
||||
var/open = 0
|
||||
var/recent_fault = 0
|
||||
var/power_output = 1
|
||||
var/consumption = 0
|
||||
|
||||
/obj/machinery/power/port_gen/proc/HasFuel() //Placeholder for fuel check.
|
||||
return 1
|
||||
@@ -101,7 +102,7 @@ display round(lastgen) and plasmatank amount
|
||||
var/sheet_path = /obj/item/stack/sheet/mineral/plasma
|
||||
var/board_path = "/obj/item/weapon/circuitboard/pacman"
|
||||
var/sheet_left = 0 // How much is left of the sheet
|
||||
var/time_per_sheet = 40
|
||||
var/time_per_sheet = 260
|
||||
var/heat = 0
|
||||
|
||||
/obj/machinery/power/port_gen/pacman/initialize()
|
||||
@@ -114,8 +115,8 @@ display round(lastgen) and plasmatank amount
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/micro_laser(src)
|
||||
component_parts += new /obj/item/stack/cable_coil(src)
|
||||
component_parts += new /obj/item/stack/cable_coil(src)
|
||||
component_parts += new /obj/item/stack/cable_coil(src, 1)
|
||||
component_parts += new /obj/item/stack/cable_coil(src, 1)
|
||||
component_parts += new /obj/item/weapon/stock_parts/capacitor(src)
|
||||
component_parts += new board_path(src)
|
||||
var/obj/sheet = new sheet_path(null)
|
||||
@@ -128,16 +129,16 @@ display round(lastgen) and plasmatank amount
|
||||
|
||||
/obj/machinery/power/port_gen/pacman/RefreshParts()
|
||||
var/temp_rating = 0
|
||||
var/temp_reliability = 0
|
||||
var/consumption_coeff = 0
|
||||
for(var/obj/item/weapon/stock_parts/SP in component_parts)
|
||||
if(istype(SP, /obj/item/weapon/stock_parts/matter_bin))
|
||||
max_sheets = SP.rating * SP.rating * 50
|
||||
else if(istype(SP, /obj/item/weapon/stock_parts/micro_laser) || istype(SP, /obj/item/weapon/stock_parts/capacitor))
|
||||
else if(istype(SP, /obj/item/weapon/stock_parts/capacitor))
|
||||
temp_rating += SP.rating
|
||||
for(var/obj/item/weapon/CP in component_parts)
|
||||
temp_reliability += CP.reliability
|
||||
reliability = min(round(temp_reliability / 4), 100)
|
||||
power_gen = round(initial(power_gen) * (max(2, temp_rating) / 2))
|
||||
else
|
||||
consumption_coeff += SP.rating
|
||||
power_gen = round(initial(power_gen) * temp_rating * 2)
|
||||
consumption = consumption_coeff
|
||||
|
||||
/obj/machinery/power/port_gen/pacman/examine()
|
||||
..()
|
||||
@@ -160,7 +161,7 @@ display round(lastgen) and plasmatank amount
|
||||
sheets -= amount
|
||||
|
||||
/obj/machinery/power/port_gen/pacman/UseFuel()
|
||||
var/needed_sheets = 1 / (time_per_sheet / power_output)
|
||||
var/needed_sheets = 1 / (time_per_sheet * consumption / power_output)
|
||||
var/temp = min(needed_sheets, sheet_left)
|
||||
needed_sheets -= temp
|
||||
sheet_left -= temp
|
||||
@@ -175,9 +176,9 @@ display round(lastgen) and plasmatank amount
|
||||
var/bias = 0
|
||||
if (power_output > 4)
|
||||
upper_limit = 400
|
||||
bias = power_output * 3
|
||||
bias = power_output - consumption * (4 - consumption)
|
||||
if (heat < lower_limit)
|
||||
heat += 3
|
||||
heat += 4 - consumption
|
||||
else
|
||||
heat += rand(-7 + bias, 7 + bias)
|
||||
if (heat < lower_limit)
|
||||
@@ -191,7 +192,6 @@ display round(lastgen) and plasmatank amount
|
||||
return
|
||||
|
||||
/obj/machinery/power/port_gen/pacman/handleInactive()
|
||||
|
||||
if (heat > 0)
|
||||
heat = max(heat - 2, 0)
|
||||
src.updateDialog()
|
||||
@@ -215,45 +215,29 @@ display round(lastgen) and plasmatank amount
|
||||
emagged = 1
|
||||
emp_act(1)
|
||||
else if(!active)
|
||||
|
||||
if(istype(O, /obj/item/weapon/wrench))
|
||||
|
||||
if(!anchored)
|
||||
if(!anchored && !isinspace())
|
||||
connect_to_network()
|
||||
user << "\blue You secure the generator to the floor."
|
||||
anchored = 1
|
||||
else
|
||||
disconnect_from_network()
|
||||
user << "\blue You unsecure the generator from the floor."
|
||||
anchored = 0
|
||||
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
anchored = !anchored
|
||||
|
||||
else if(istype(O, /obj/item/weapon/screwdriver))
|
||||
open = !open
|
||||
panel_open = !panel_open
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
if(open)
|
||||
user << "\blue You open the access panel."
|
||||
if(panel_open)
|
||||
user << "<span class='notice'>You open the access panel.</span>"
|
||||
else
|
||||
user << "\blue You close the access panel."
|
||||
else if(istype(O, /obj/item/weapon/crowbar) && open)
|
||||
var/obj/machinery/constructable_frame/machine_frame/new_frame = new /obj/machinery/constructable_frame/machine_frame(src.loc)
|
||||
for(var/obj/item/I in component_parts)
|
||||
if(I.reliability < 100)
|
||||
I.crit_fail = 1
|
||||
I.loc = src.loc
|
||||
while ( sheets > 0 )
|
||||
var/obj/item/stack/sheet/G = new sheet_path(src.loc)
|
||||
|
||||
if ( sheets > 50 )
|
||||
G.amount = 50
|
||||
else
|
||||
G.amount = sheets
|
||||
|
||||
sheets -= G.amount
|
||||
|
||||
new_frame.state = 2
|
||||
new_frame.icon_state = "box_1"
|
||||
del(src)
|
||||
user << "<span class='notice'>You close the access panel.</span>"
|
||||
else if(istype(O, /obj/item/weapon/storage/part_replacer) && panel_open)
|
||||
exchange_parts(user, O)
|
||||
return
|
||||
else if(istype(O, /obj/item/weapon/crowbar) && panel_open)
|
||||
default_deconstruction_crowbar(O)
|
||||
|
||||
/obj/machinery/power/port_gen/pacman/attack_hand(mob/user as mob)
|
||||
..()
|
||||
|
||||
@@ -260,9 +260,27 @@ datum/design/clonescanner
|
||||
materials = list("$glass" = 2000, "sacid" = 20)
|
||||
build_path = "/obj/item/weapon/circuitboard/clonescanner"
|
||||
|
||||
datum/design/teleport_station
|
||||
name = "Circuit Design (Teleportation Station Board)"
|
||||
desc = "Allows for the construction of circuit boards used to build a Teleporter Station."
|
||||
id = "tele_station"
|
||||
req_tech = list("programming" = 4, "bluespace" = 4, "engineering" = 4)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 1000, "sacid" = 20)
|
||||
build_path = /obj/item/weapon/circuitboard/teleporter_station
|
||||
|
||||
datum/design/teleport_hub
|
||||
name = "Circuit Design (Teleportation Hub Board)"
|
||||
desc = "Allows for the construction of circuit boards used to build a Teleportation Hub."
|
||||
id = "tele_hub"
|
||||
req_tech = list("programming" = 3, "bluespace" = 5, "materials" = 4, "engineering" = 5)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 1000, "sacid" = 20)
|
||||
build_path = /obj/item/weapon/circuitboard/teleporter_hub
|
||||
|
||||
datum/design/telepad
|
||||
name = "Circuit Design (Telepad Board)"
|
||||
desc = "The circuit board for a telescience telepad."
|
||||
desc = "Allows for the construction of circuit boards used to build a Telepad."
|
||||
id = "telepad"
|
||||
req_tech = list("programming" = 4, "bluespace" = 4, "materials" = 3, "engineering" = 3)
|
||||
build_type = IMPRINTER
|
||||
@@ -278,6 +296,33 @@ datum/design/sleeper
|
||||
materials = list("$glass" = 1000, "sacid" = 20)
|
||||
build_path = "/obj/item/weapon/circuitboard/sleeper"
|
||||
|
||||
datum/design/sleep_console
|
||||
name = "Circuit Design (Sleeper Console)"
|
||||
desc = "Allows for the construction of circuit boards used to build a Sleeper Console."
|
||||
id = "sleeper"
|
||||
req_tech = list("programming" = 3, "biotech" = 2, "materials" = 3, "engineering" = 3)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 1000, "sacid" = 20)
|
||||
build_path = "/obj/item/weapon/circuitboard/sleep_console"
|
||||
|
||||
datum/design/bodyscanner
|
||||
name = "Circuit Design (Body Scanner Board)"
|
||||
desc = "Allows for the construction of circuit boards used to build a Body Scanner."
|
||||
id = "sleeper"
|
||||
req_tech = list("programming" = 3, "biotech" = 2, "materials" = 3, "engineering" = 3)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 1000, "sacid" = 20)
|
||||
build_path = "/obj/item/weapon/circuitboard/bodyscanner"
|
||||
|
||||
datum/design/sleep_console
|
||||
name = "Circuit Design (Body Scanner Console)"
|
||||
desc = "Allows for the construction of circuit boards used to build a Body Scanner Console."
|
||||
id = "sleeper"
|
||||
req_tech = list("programming" = 3, "biotech" = 2, "materials" = 3, "engineering" = 3)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 1000, "sacid" = 20)
|
||||
build_path = "/obj/item/weapon/circuitboard/bodyscanner_console"
|
||||
|
||||
datum/design/cryotube
|
||||
name = "Circuit Design (Cryotube Board)"
|
||||
desc = "Allows for the construction of circuit boards used to build a Cryotube."
|
||||
@@ -414,7 +459,7 @@ datum/design/comm_traffic
|
||||
build_path = "/obj/item/weapon/circuitboard/comm_traffic"
|
||||
|
||||
datum/design/telesci_console
|
||||
name = "Computer Design (Telepad Control Console Board)"
|
||||
name = "Circuit Design (Telepad Control Console Board)"
|
||||
desc = "Allows for the construction of circuit boards used to build a telescience console."
|
||||
id = "telesci_console"
|
||||
req_tech = list("programming" = 3, "bluespace" = 2)
|
||||
@@ -1280,6 +1325,15 @@ datum/design/light_replacer
|
||||
////////////////////////////////////////
|
||||
//////////////MISC Boards///////////////
|
||||
////////////////////////////////////////
|
||||
datum/design/thermomachine
|
||||
name = "Machine Design (Freezer/Heater Board)"
|
||||
desc = "The circuit board for a freezer/heater."
|
||||
id = "thermomachine"
|
||||
req_tech = list("programming" = 3, "plasmatech" = 3)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 1000, "sacid" = 20)
|
||||
build_path = /obj/item/weapon/circuitboard/thermomachine
|
||||
|
||||
datum/design/biogenerator
|
||||
name = "Machine Design (Biogenerator Board)"
|
||||
desc = "The circuit board for a biogenerator."
|
||||
@@ -1388,6 +1442,15 @@ datum/design/cyborgrecharger
|
||||
materials = list("$glass" = 1000, "sacid" = 20)
|
||||
build_path = "/obj/item/weapon/circuitboard/cyborgrecharger"
|
||||
|
||||
datum/design/mech_recharger
|
||||
name = "Mechbay Recharger Board"
|
||||
desc = "The circuit board for a Mechbay Recharger."
|
||||
id = "mech_recharger"
|
||||
req_tech = list("programming" = 3, "powerstorage" = 4, "engineering" = 4)
|
||||
build_type = IMPRINTER
|
||||
materials = list("$glass" = 1000, "sacid" = 20)
|
||||
build_path = "/obj/item/weapon/circuitboard/mech_recharger"
|
||||
|
||||
/////////////////////////////////////////
|
||||
////////////Power Stuff//////////////////
|
||||
/////////////////////////////////////////
|
||||
@@ -1422,7 +1485,6 @@ datum/design/mrspacman
|
||||
materials = list("$glass" = 2000, "sacid" = 20)
|
||||
build_path = "/obj/item/weapon/circuitboard/pacman/mrs"
|
||||
|
||||
|
||||
/////////////////////////////////////////
|
||||
////////////Medical Tools////////////////
|
||||
/////////////////////////////////////////
|
||||
@@ -1974,14 +2036,14 @@ datum/design/bluespace_crystal
|
||||
reliability_base = 100
|
||||
build_path = "/obj/item/bluespace_crystal/artificial"
|
||||
|
||||
datum/design/telesci_gps
|
||||
name = "GPS Device"
|
||||
datum/design/telesci_sps
|
||||
name = "SPS Device"
|
||||
desc = "A device that can track its position at all times."
|
||||
id = "telesci_gps"
|
||||
id = "telesci_sps"
|
||||
req_tech = list("materials" = 2, "magnets" = 3, "bluespace" = 3)
|
||||
build_type = PROTOLATHE
|
||||
materials = list("$metal" = 500, "$glass" = 1000)
|
||||
build_path = /obj/item/device/gps
|
||||
build_path = /obj/item/device/sps
|
||||
|
||||
/////////////////////////////////////////
|
||||
/////////////////HUDs////////////////////
|
||||
|
||||
Reference in New Issue
Block a user