mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
Fixes any transformation getting people stuck as contents during transformation.
Span class fixes for all of atmospherics files. Calls new ..() for dice, adds minsides for admins to play with Fixes bug where people would magically change the size of objects using wrapping paper
This commit is contained in:
@@ -43,11 +43,11 @@
|
||||
return ..()
|
||||
var/turf/T = get_turf(src)
|
||||
playsound(T, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
user << "\blue You begin to remove \the [src]..."
|
||||
user << "<span class='notice'>You begin to remove \the [src]...</span>"
|
||||
if (do_after(user, 40))
|
||||
user.visible_message( \
|
||||
"[user] removes \the [src].", \
|
||||
"\blue You have removed \the [src].", \
|
||||
"<span class='notice'>You have removed \the [src].</span>", \
|
||||
"You hear a ratchet.")
|
||||
//new /obj/item/pipe(T, make_from=src)
|
||||
del(src)
|
||||
|
||||
@@ -10,15 +10,6 @@
|
||||
|
||||
level = 1
|
||||
|
||||
high_volume
|
||||
name = "Large Dual Port Air Vent"
|
||||
|
||||
New()
|
||||
..()
|
||||
|
||||
air1.volume = 1000
|
||||
air2.volume = 1000
|
||||
|
||||
var/on = 0
|
||||
var/pump_direction = 1 //0 = siphoning, 1 = releasing
|
||||
|
||||
@@ -31,195 +22,203 @@
|
||||
//2: Do not pass input_pressure_min
|
||||
//4: Do not pass output_pressure_max
|
||||
|
||||
update_icon()
|
||||
if(on)
|
||||
if(pump_direction)
|
||||
icon_state = "[level == 1 && istype(loc, /turf/simulated) ? "h" : "" ]out"
|
||||
else
|
||||
icon_state = "[level == 1 && istype(loc, /turf/simulated) ? "h" : "" ]in"
|
||||
else
|
||||
icon_state = "[level == 1 && istype(loc, /turf/simulated) ? "h" : "" ]off"
|
||||
on = 0
|
||||
|
||||
return
|
||||
|
||||
hide(var/i) //to make the little pipe section invisible, the icon changes.
|
||||
if(on)
|
||||
if(pump_direction)
|
||||
icon_state = "[i == 1 && istype(loc, /turf/simulated) ? "h" : "" ]out"
|
||||
else
|
||||
icon_state = "[i == 1 && istype(loc, /turf/simulated) ? "h" : "" ]in"
|
||||
else
|
||||
icon_state = "[i == 1 && istype(loc, /turf/simulated) ? "h" : "" ]off"
|
||||
on = 0
|
||||
return
|
||||
|
||||
multitool_menu(var/mob/user,var/obj/item/device/multitool/P)
|
||||
return {"
|
||||
<ul>
|
||||
<li><b>Frequency:</b> <a href="?src=\ref[src];set_freq=-1">[format_frequency(frequency)] GHz</a> (<a href="?src=\ref[src];set_freq=[1439]">Reset</a>)</li>
|
||||
<li><b>ID Tag:</b> <a href="?src=\ref[src];set_id=1">[id_tag]</a></li>
|
||||
</ul>
|
||||
"}
|
||||
|
||||
process()
|
||||
..()
|
||||
|
||||
if(!on)
|
||||
return 0
|
||||
|
||||
var/datum/gas_mixture/environment = loc.return_air()
|
||||
var/environment_pressure = environment.return_pressure()
|
||||
|
||||
if(pump_direction) //input -> external
|
||||
var/pressure_delta = 10000
|
||||
|
||||
if(pressure_checks&1)
|
||||
pressure_delta = min(pressure_delta, (external_pressure_bound - environment_pressure))
|
||||
if(pressure_checks&2)
|
||||
pressure_delta = min(pressure_delta, (air1.return_pressure() - input_pressure_min))
|
||||
|
||||
if(pressure_delta > 0)
|
||||
if(air1.temperature > 0)
|
||||
var/transfer_moles = pressure_delta*environment.volume/(air1.temperature * R_IDEAL_GAS_EQUATION)
|
||||
|
||||
var/datum/gas_mixture/removed = air1.remove(transfer_moles)
|
||||
|
||||
loc.assume_air(removed)
|
||||
|
||||
if(network1)
|
||||
network1.update = 1
|
||||
|
||||
else //external -> output
|
||||
var/pressure_delta = 10000
|
||||
|
||||
if(pressure_checks&1)
|
||||
pressure_delta = min(pressure_delta, (environment_pressure - external_pressure_bound))
|
||||
if(pressure_checks&4)
|
||||
pressure_delta = min(pressure_delta, (output_pressure_max - air2.return_pressure()))
|
||||
|
||||
if(pressure_delta > 0)
|
||||
if(environment.temperature > 0)
|
||||
var/transfer_moles = pressure_delta*air2.volume/(environment.temperature * R_IDEAL_GAS_EQUATION)
|
||||
|
||||
var/datum/gas_mixture/removed = loc.remove_air(transfer_moles)
|
||||
|
||||
air2.merge(removed)
|
||||
|
||||
if(network2)
|
||||
network2.update = 1
|
||||
|
||||
return 1
|
||||
|
||||
//Radio remote control
|
||||
|
||||
proc
|
||||
set_frequency(new_frequency)
|
||||
radio_controller.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
if(frequency)
|
||||
radio_connection = radio_controller.add_object(src, frequency, filter = RADIO_ATMOSIA)
|
||||
|
||||
broadcast_status()
|
||||
if(!radio_connection)
|
||||
return 0
|
||||
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 //radio signal
|
||||
signal.source = src
|
||||
|
||||
signal.data = list(
|
||||
"tag" = id_tag,
|
||||
"device" = "ADVP",
|
||||
"power" = on,
|
||||
"direction" = pump_direction?("release"):("siphon"),
|
||||
"checks" = pressure_checks,
|
||||
"input" = input_pressure_min,
|
||||
"output" = output_pressure_max,
|
||||
"external" = external_pressure_bound,
|
||||
"sigtype" = "status"
|
||||
)
|
||||
radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA)
|
||||
|
||||
return 1
|
||||
|
||||
var/frequency = 0
|
||||
var/id_tag = null
|
||||
var/datum/radio_frequency/radio_connection
|
||||
|
||||
initialize()
|
||||
..()
|
||||
if(frequency)
|
||||
set_frequency(frequency)
|
||||
/obj/machinery/atmospherics/binary/dp_vent_pump/high_volume
|
||||
name = "Large Dual Port Air Vent"
|
||||
|
||||
receive_signal(datum/signal/signal)
|
||||
/obj/machinery/atmospherics/binary/dp_vent_pump/high_volume/New()
|
||||
..()
|
||||
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id_tag) || (signal.data["sigtype"]!="command"))
|
||||
return 0
|
||||
air1.volume = 1000
|
||||
air2.volume = 1000
|
||||
|
||||
var/handled=0
|
||||
if("power" in signal.data)
|
||||
on = text2num(signal.data["power"])
|
||||
handled=1
|
||||
/obj/machinery/atmospherics/binary/dp_vent_pump/update_icon()
|
||||
if(on)
|
||||
if(pump_direction)
|
||||
icon_state = "[level == 1 && istype(loc, /turf/simulated) ? "h" : "" ]out"
|
||||
else
|
||||
icon_state = "[level == 1 && istype(loc, /turf/simulated) ? "h" : "" ]in"
|
||||
else
|
||||
icon_state = "[level == 1 && istype(loc, /turf/simulated) ? "h" : "" ]off"
|
||||
on = 0
|
||||
|
||||
if("power_toggle" in signal.data)
|
||||
on = !on
|
||||
handled=1
|
||||
return
|
||||
|
||||
if("direction" in signal.data)
|
||||
pump_direction = text2num(signal.data["direction"])
|
||||
handled=1
|
||||
/obj/machinery/atmospherics/binary/dp_vent_pump/hide(var/i) //to make the little pipe section invisible, the icon changes.
|
||||
if(on)
|
||||
if(pump_direction)
|
||||
icon_state = "[i == 1 && istype(loc, /turf/simulated) ? "h" : "" ]out"
|
||||
else
|
||||
icon_state = "[i == 1 && istype(loc, /turf/simulated) ? "h" : "" ]in"
|
||||
else
|
||||
icon_state = "[i == 1 && istype(loc, /turf/simulated) ? "h" : "" ]off"
|
||||
on = 0
|
||||
return
|
||||
|
||||
if("checks" in signal.data)
|
||||
pressure_checks = text2num(signal.data["checks"])
|
||||
handled=1
|
||||
/obj/machinery/atmospherics/binary/dp_vent_pump/multitool_menu(var/mob/user,var/obj/item/device/multitool/P)
|
||||
return {"
|
||||
<ul>
|
||||
<li><b>Frequency:</b> <a href="?src=\ref[src];set_freq=-1">[format_frequency(frequency)] GHz</a> (<a href="?src=\ref[src];set_freq=[1439]">Reset</a>)</li>
|
||||
<li><b>ID Tag:</b> <a href="?src=\ref[src];set_id=1">[id_tag]</a></li>
|
||||
</ul>
|
||||
"}
|
||||
|
||||
if("purge" in signal.data)
|
||||
pressure_checks &= ~1
|
||||
pump_direction = 0
|
||||
handled=1
|
||||
/obj/machinery/atmospherics/binary/dp_vent_pump/process()
|
||||
..()
|
||||
|
||||
if("stabilize" in signal.data)
|
||||
pressure_checks |= 1
|
||||
pump_direction = 1
|
||||
handled=1
|
||||
if(!on)
|
||||
return 0
|
||||
|
||||
if("set_input_pressure" in signal.data)
|
||||
input_pressure_min = Clamp(
|
||||
text2num(signal.data["set_input_pressure"]),
|
||||
0,
|
||||
ONE_ATMOSPHERE*50
|
||||
)
|
||||
handled=1
|
||||
var/datum/gas_mixture/environment = loc.return_air()
|
||||
var/environment_pressure = environment.return_pressure()
|
||||
|
||||
if("set_output_pressure" in signal.data)
|
||||
output_pressure_max = Clamp(
|
||||
text2num(signal.data["set_output_pressure"]),
|
||||
0,
|
||||
ONE_ATMOSPHERE*50
|
||||
)
|
||||
handled=1
|
||||
if(pump_direction) //input -> external
|
||||
var/pressure_delta = 10000
|
||||
|
||||
if("set_external_pressure" in signal.data)
|
||||
external_pressure_bound = Clamp(
|
||||
text2num(signal.data["set_external_pressure"]),
|
||||
0,
|
||||
ONE_ATMOSPHERE*50
|
||||
)
|
||||
handled=1
|
||||
if(pressure_checks&1)
|
||||
pressure_delta = min(pressure_delta, (external_pressure_bound - environment_pressure))
|
||||
if(pressure_checks&2)
|
||||
pressure_delta = min(pressure_delta, (air1.return_pressure() - input_pressure_min))
|
||||
|
||||
if("status" in signal.data)
|
||||
spawn(2)
|
||||
broadcast_status()
|
||||
return //do not update_icon
|
||||
if(!handled)
|
||||
testing("\[[world.timeofday]\]: dp_vent_pump/receive_signal: unknown command \n[signal.debug_print()]")
|
||||
if(pressure_delta > 0)
|
||||
if(air1.temperature > 0)
|
||||
var/transfer_moles = pressure_delta*environment.volume/(air1.temperature * R_IDEAL_GAS_EQUATION)
|
||||
|
||||
var/datum/gas_mixture/removed = air1.remove(transfer_moles)
|
||||
|
||||
loc.assume_air(removed)
|
||||
|
||||
if(network1)
|
||||
network1.update = 1
|
||||
|
||||
else //external -> output
|
||||
var/pressure_delta = 10000
|
||||
|
||||
if(pressure_checks&1)
|
||||
pressure_delta = min(pressure_delta, (environment_pressure - external_pressure_bound))
|
||||
if(pressure_checks&4)
|
||||
pressure_delta = min(pressure_delta, (output_pressure_max - air2.return_pressure()))
|
||||
|
||||
if(pressure_delta > 0)
|
||||
if(environment.temperature > 0)
|
||||
var/transfer_moles = pressure_delta*air2.volume/(environment.temperature * R_IDEAL_GAS_EQUATION)
|
||||
|
||||
var/datum/gas_mixture/removed = loc.remove_air(transfer_moles)
|
||||
|
||||
air2.merge(removed)
|
||||
|
||||
if(network2)
|
||||
network2.update = 1
|
||||
|
||||
return 1
|
||||
|
||||
//Radio remote control
|
||||
|
||||
/obj/machinery/atmospherics/binary/dp_vent_pump/proc/set_frequency(new_frequency)
|
||||
radio_controller.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
if(frequency)
|
||||
radio_connection = radio_controller.add_object(src, frequency, filter = RADIO_ATMOSIA)
|
||||
|
||||
/obj/machinery/atmospherics/binary/dp_vent_pump/proc/broadcast_status()
|
||||
if(!radio_connection)
|
||||
return 0
|
||||
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 //radio signal
|
||||
signal.source = src
|
||||
|
||||
signal.data = list(
|
||||
"tag" = id_tag,
|
||||
"device" = "ADVP",
|
||||
"power" = on,
|
||||
"direction" = pump_direction?("release"):("siphon"),
|
||||
"checks" = pressure_checks,
|
||||
"input" = input_pressure_min,
|
||||
"output" = output_pressure_max,
|
||||
"external" = external_pressure_bound,
|
||||
"sigtype" = "status"
|
||||
)
|
||||
radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA)
|
||||
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/binary/dp_vent_pump/initialize()
|
||||
..()
|
||||
if(frequency)
|
||||
set_frequency(frequency)
|
||||
|
||||
/obj/machinery/atmospherics/binary/dp_vent_pump/receive_signal(datum/signal/signal)
|
||||
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id_tag) || (signal.data["sigtype"]!="command"))
|
||||
return 0
|
||||
|
||||
var/handled=0
|
||||
if("power" in signal.data)
|
||||
on = text2num(signal.data["power"])
|
||||
handled=1
|
||||
|
||||
if("power_toggle" in signal.data)
|
||||
on = !on
|
||||
handled=1
|
||||
|
||||
if("direction" in signal.data)
|
||||
pump_direction = text2num(signal.data["direction"])
|
||||
handled=1
|
||||
|
||||
if("checks" in signal.data)
|
||||
pressure_checks = text2num(signal.data["checks"])
|
||||
handled=1
|
||||
|
||||
if("purge" in signal.data)
|
||||
pressure_checks &= ~1
|
||||
pump_direction = 0
|
||||
handled=1
|
||||
|
||||
if("stabilize" in signal.data)
|
||||
pressure_checks |= 1
|
||||
pump_direction = 1
|
||||
handled=1
|
||||
|
||||
if("set_input_pressure" in signal.data)
|
||||
input_pressure_min = Clamp(
|
||||
text2num(signal.data["set_input_pressure"]),
|
||||
0,
|
||||
ONE_ATMOSPHERE*50
|
||||
)
|
||||
handled=1
|
||||
|
||||
if("set_output_pressure" in signal.data)
|
||||
output_pressure_max = Clamp(
|
||||
text2num(signal.data["set_output_pressure"]),
|
||||
0,
|
||||
ONE_ATMOSPHERE*50
|
||||
)
|
||||
handled=1
|
||||
|
||||
if("set_external_pressure" in signal.data)
|
||||
external_pressure_bound = Clamp(
|
||||
text2num(signal.data["set_external_pressure"]),
|
||||
0,
|
||||
ONE_ATMOSPHERE*50
|
||||
)
|
||||
handled=1
|
||||
|
||||
if("status" in signal.data)
|
||||
spawn(2)
|
||||
broadcast_status()
|
||||
update_icon()
|
||||
return //do not update_icon
|
||||
if(!handled)
|
||||
testing("\[[world.timeofday]\]: dp_vent_pump/receive_signal: unknown command \n[signal.debug_print()]")
|
||||
spawn(2)
|
||||
broadcast_status()
|
||||
update_icon()
|
||||
|
||||
attackby(var/obj/item/W as obj, var/mob/user as mob)
|
||||
if(istype(W, /obj/item/device/multitool))
|
||||
interact(user)
|
||||
return 1
|
||||
return ..()
|
||||
/obj/machinery/atmospherics/binary/dp_vent_pump/attackby(var/obj/item/W as obj, var/mob/user as mob)
|
||||
if(istype(W, /obj/item/device/multitool))
|
||||
interact(user)
|
||||
return 1
|
||||
return ..()
|
||||
@@ -139,7 +139,7 @@
|
||||
return
|
||||
src.add_fingerprint(usr)
|
||||
if(!src.allowed(user))
|
||||
user << "\red Access denied."
|
||||
user << "<span class='warning'>Access denied.</span>"
|
||||
return
|
||||
usr.set_machine(src)
|
||||
interact(user)
|
||||
|
||||
@@ -157,7 +157,7 @@ Thus, the two variables affect pump operation are set in New():
|
||||
return
|
||||
src.add_fingerprint(usr)
|
||||
if(!src.allowed(user))
|
||||
user << "\red Access denied."
|
||||
user << "<span class='warning'>Access denied.</span>"
|
||||
return
|
||||
usr.set_machine(src)
|
||||
interact(user)
|
||||
@@ -185,6 +185,6 @@ Thus, the two variables affect pump operation are set in New():
|
||||
if (!istype(W, /obj/item/weapon/wrench))
|
||||
return ..()
|
||||
if (!(stat & NOPOWER) && on)
|
||||
user << "\red You cannot unwrench this [src], turn it off first."
|
||||
user << "<span class='warning'>You cannot unwrench this [src], turn it off first.</span>"
|
||||
return 1
|
||||
return ..()
|
||||
@@ -80,7 +80,7 @@
|
||||
|
||||
/obj/machinery/atmospherics/binary/valve/attack_hand(mob/user as mob)
|
||||
if(isobserver(user) && !canGhostWrite(user,src,"toggles"))
|
||||
user << "\red Nope."
|
||||
user << "<span class='warning'>Nope.</span>"
|
||||
return
|
||||
src.add_fingerprint(usr)
|
||||
update_icon(1)
|
||||
@@ -121,7 +121,7 @@
|
||||
|
||||
/obj/machinery/atmospherics/binary/valve/digital/attack_hand(mob/user as mob)
|
||||
if(!src.allowed(user))
|
||||
user << "\red Access denied."
|
||||
user << "<span class='warning'>Access denied.</span>"
|
||||
return
|
||||
..()
|
||||
|
||||
@@ -220,6 +220,6 @@
|
||||
update_multitool_menu(user)
|
||||
return 1
|
||||
if(src.frequency && istype(W, /obj/item/weapon/wrench))
|
||||
user << "\red You cannot unwrench this [src], it's digitally connected to another device."
|
||||
user << "<span class='warning'>You cannot unwrench this [src], it's digitally connected to another device.</span>"
|
||||
return 1
|
||||
return ..() // Pass to the method below (does stuff ALL valves should do)
|
||||
|
||||
@@ -148,7 +148,7 @@ Thus, the two variables affect pump operation are set in New():
|
||||
return
|
||||
src.add_fingerprint(usr)
|
||||
if(!src.allowed(user))
|
||||
user << "\red Access denied."
|
||||
user << "<span class='warning'>Access denied.</span>"
|
||||
return
|
||||
usr.set_machine(src)
|
||||
interact(user)
|
||||
|
||||
@@ -141,7 +141,7 @@ obj/machinery/atmospherics/trinary/filter/attack_hand(user as mob) // -- TLE
|
||||
return
|
||||
|
||||
if(!src.allowed(user))
|
||||
user << "\red Access denied."
|
||||
user << "<span class='warning'>Access denied.</span>"
|
||||
return
|
||||
|
||||
var/dat
|
||||
|
||||
@@ -95,7 +95,7 @@ obj/machinery/atmospherics/trinary/mixer/attack_hand(user as mob)
|
||||
return
|
||||
src.add_fingerprint(usr)
|
||||
if(!src.allowed(user))
|
||||
user << "\red Access denied."
|
||||
user << "<span class='warning'>Access denied.</span>"
|
||||
return
|
||||
usr.set_machine(src)
|
||||
var/dat = {"<b>Power: </b><a href='?src=\ref[src];power=1'>[on?"On":"Off"]</a><br>
|
||||
|
||||
@@ -123,7 +123,7 @@
|
||||
|
||||
/obj/machinery/atmospherics/trinary/tvalve/attack_hand(mob/user as mob)
|
||||
if(isobserver(user) && !canGhostWrite(user,src,"toggles"))
|
||||
user << "\red Nope."
|
||||
user << "<span class='warning'>Nope.</span>"
|
||||
return
|
||||
|
||||
investigation_log(I_ATMOS,"was [state ? "opened (straight)" : "closed (side)"] by [key_name(usr)]")
|
||||
@@ -190,7 +190,7 @@
|
||||
|
||||
/obj/machinery/atmospherics/trinary/tvalve/digital/attack_hand(mob/user as mob)
|
||||
if(!src.allowed(user))
|
||||
user << "\red Access denied."
|
||||
user << "<span class='warning'>Access denied.</span>"
|
||||
return
|
||||
..()
|
||||
|
||||
|
||||
@@ -104,25 +104,25 @@
|
||||
if(istype(W, /obj/item/weapon/reagent_containers/glass/paint/red))
|
||||
src._color = "red"
|
||||
src.color = PIPE_COLOR_RED
|
||||
user << "\red You paint the pipe red."
|
||||
user << "<span class='warning'>You paint the pipe red.</span>"
|
||||
update_icon()
|
||||
return 1
|
||||
if(istype(W, /obj/item/weapon/reagent_containers/glass/paint/blue))
|
||||
src._color = "blue"
|
||||
src.color = PIPE_COLOR_BLUE
|
||||
user << "\red You paint the pipe blue."
|
||||
user << "<span class='warning'>You paint the pipe blue.</span>"
|
||||
update_icon()
|
||||
return 1
|
||||
if(istype(W, /obj/item/weapon/reagent_containers/glass/paint/green))
|
||||
src._color = "green"
|
||||
src.color = PIPE_COLOR_GREEN
|
||||
user << "\red You paint the pipe green."
|
||||
user << "<span class='warning'>You paint the pipe green.</span>"
|
||||
update_icon()
|
||||
return 1
|
||||
if(istype(W, /obj/item/weapon/reagent_containers/glass/paint/yellow))
|
||||
src._color = "yellow"
|
||||
src.color = PIPE_COLOR_YELLOW
|
||||
user << "\red You paint the pipe yellow."
|
||||
user << "<span class='warning'>You paint the pipe yellow.</span>"
|
||||
update_icon()
|
||||
return 1
|
||||
|
||||
|
||||
@@ -12,31 +12,31 @@
|
||||
var/current_temperature = T20C
|
||||
var/current_heat_capacity = 50000 //totally random
|
||||
|
||||
update_icon()
|
||||
if(node)
|
||||
icon_state = "intact_[on?("on"):("off")]"
|
||||
else
|
||||
icon_state = "exposed"
|
||||
/obj/machinery/atmospherics/unary/cold_sink/update_icon()
|
||||
if(node)
|
||||
icon_state = "intact_[on?("on"):("off")]"
|
||||
else
|
||||
icon_state = "exposed"
|
||||
|
||||
on = 0
|
||||
on = 0
|
||||
|
||||
return
|
||||
return
|
||||
|
||||
process()
|
||||
..()
|
||||
if(!on || !network)
|
||||
return 0
|
||||
var/air_heat_capacity = air_contents.heat_capacity()
|
||||
var/combined_heat_capacity = current_heat_capacity + air_heat_capacity
|
||||
var/old_temperature = air_contents.temperature
|
||||
/obj/machinery/atmospherics/unary/cold_sink/process()
|
||||
..()
|
||||
if(!on || !network)
|
||||
return 0
|
||||
var/air_heat_capacity = air_contents.heat_capacity()
|
||||
var/combined_heat_capacity = current_heat_capacity + air_heat_capacity
|
||||
var/old_temperature = air_contents.temperature
|
||||
|
||||
if(combined_heat_capacity > 0)
|
||||
var/combined_energy = current_temperature*current_heat_capacity + air_heat_capacity*air_contents.temperature
|
||||
if(air_contents.temperature > current_temperature) //if it's hotter than we can cool it, cool it
|
||||
air_contents.temperature = combined_energy/combined_heat_capacity
|
||||
if(combined_heat_capacity > 0)
|
||||
var/combined_energy = current_temperature*current_heat_capacity + air_heat_capacity*air_contents.temperature
|
||||
if(air_contents.temperature > current_temperature) //if it's hotter than we can cool it, cool it
|
||||
air_contents.temperature = combined_energy/combined_heat_capacity
|
||||
|
||||
//todo: have current temperature affected. require power to bring down current temperature again
|
||||
//todo: have current temperature affected. require power to bring down current temperature again
|
||||
|
||||
if(abs(old_temperature-air_contents.temperature) > 1)
|
||||
network.update = 1
|
||||
return 1
|
||||
if(abs(old_temperature-air_contents.temperature) > 1)
|
||||
network.update = 1
|
||||
return 1
|
||||
@@ -10,60 +10,57 @@
|
||||
var/obj/machinery/atmospherics/unary/heat_exchanger/partner = null
|
||||
var/update_cycle
|
||||
|
||||
update_icon()
|
||||
if(node)
|
||||
icon_state = "intact"
|
||||
else
|
||||
icon_state = "exposed"
|
||||
/obj/machinery/atmospherics/unary/heat_exchanger/update_icon()
|
||||
if(node)
|
||||
icon_state = "intact"
|
||||
else
|
||||
icon_state = "exposed"
|
||||
|
||||
return
|
||||
return
|
||||
|
||||
initialize()
|
||||
if(!partner)
|
||||
var/partner_connect = turn(dir,180)
|
||||
/obj/machinery/atmospherics/unary/heat_exchanger/initialize()
|
||||
if(!partner)
|
||||
var/partner_connect = turn(dir,180)
|
||||
|
||||
for(var/obj/machinery/atmospherics/unary/heat_exchanger/target in get_step(src,partner_connect))
|
||||
if(target.dir & get_dir(src,target))
|
||||
partner = target
|
||||
partner.partner = src
|
||||
break
|
||||
for(var/obj/machinery/atmospherics/unary/heat_exchanger/target in get_step(src,partner_connect))
|
||||
if(target.dir & get_dir(src,target))
|
||||
partner = target
|
||||
partner.partner = src
|
||||
break
|
||||
|
||||
..()
|
||||
..()
|
||||
|
||||
process()
|
||||
..()
|
||||
if(!partner)
|
||||
return 0
|
||||
/obj/machinery/atmospherics/unary/heat_exchanger/process()
|
||||
..()
|
||||
if(!partner)
|
||||
return 0
|
||||
|
||||
if(!air_master || air_master.current_cycle <= update_cycle)
|
||||
return 0
|
||||
if(!air_master || air_master.current_cycle <= update_cycle)
|
||||
return 0
|
||||
|
||||
update_cycle = air_master.current_cycle
|
||||
partner.update_cycle = air_master.current_cycle
|
||||
update_cycle = air_master.current_cycle
|
||||
partner.update_cycle = air_master.current_cycle
|
||||
|
||||
var/air_heat_capacity = air_contents.heat_capacity()
|
||||
var/other_air_heat_capacity = partner.air_contents.heat_capacity()
|
||||
var/combined_heat_capacity = other_air_heat_capacity + air_heat_capacity
|
||||
var/air_heat_capacity = air_contents.heat_capacity()
|
||||
var/other_air_heat_capacity = partner.air_contents.heat_capacity()
|
||||
var/combined_heat_capacity = other_air_heat_capacity + air_heat_capacity
|
||||
|
||||
var/old_temperature = air_contents.temperature
|
||||
var/other_old_temperature = partner.air_contents.temperature
|
||||
var/old_temperature = air_contents.temperature
|
||||
var/other_old_temperature = partner.air_contents.temperature
|
||||
|
||||
if(combined_heat_capacity > 0)
|
||||
var/combined_energy = partner.air_contents.temperature*other_air_heat_capacity + air_heat_capacity*air_contents.temperature
|
||||
if(combined_heat_capacity > 0)
|
||||
var/combined_energy = partner.air_contents.temperature*other_air_heat_capacity + air_heat_capacity*air_contents.temperature
|
||||
|
||||
var/new_temperature = combined_energy/combined_heat_capacity
|
||||
air_contents.temperature = new_temperature
|
||||
partner.air_contents.temperature = new_temperature
|
||||
var/new_temperature = combined_energy/combined_heat_capacity
|
||||
air_contents.temperature = new_temperature
|
||||
partner.air_contents.temperature = new_temperature
|
||||
|
||||
if(network)
|
||||
if(abs(old_temperature-air_contents.temperature) > 1)
|
||||
network.update = 1
|
||||
if(network)
|
||||
if(abs(old_temperature-air_contents.temperature) > 1)
|
||||
network.update = 1
|
||||
|
||||
if(partner.network)
|
||||
if(abs(other_old_temperature-partner.air_contents.temperature) > 1)
|
||||
partner.network.update = 1
|
||||
if(partner.network)
|
||||
if(abs(other_old_temperature-partner.air_contents.temperature) > 1)
|
||||
partner.network.update = 1
|
||||
|
||||
return 1
|
||||
|
||||
attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
return ..()
|
||||
return 1
|
||||
|
||||
@@ -14,31 +14,31 @@
|
||||
var/current_temperature = T20C
|
||||
var/current_heat_capacity = 50000 //totally random
|
||||
|
||||
update_icon()
|
||||
if(node)
|
||||
icon_state = "intact_[on?("on"):("off")]"
|
||||
else
|
||||
icon_state = "exposed"
|
||||
/obj/machinery/atmospherics/unary/heat_reservoir/update_icon()
|
||||
if(node)
|
||||
icon_state = "intact_[on?("on"):("off")]"
|
||||
else
|
||||
icon_state = "exposed"
|
||||
|
||||
on = 0
|
||||
on = 0
|
||||
|
||||
return
|
||||
return
|
||||
|
||||
process()
|
||||
..()
|
||||
if(!on)
|
||||
return 0
|
||||
var/air_heat_capacity = air_contents.heat_capacity()
|
||||
var/combined_heat_capacity = current_heat_capacity + air_heat_capacity
|
||||
var/old_temperature = air_contents.temperature
|
||||
/obj/machinery/atmospherics/unary/heat_reservoir/process()
|
||||
..()
|
||||
if(!on)
|
||||
return 0
|
||||
var/air_heat_capacity = air_contents.heat_capacity()
|
||||
var/combined_heat_capacity = current_heat_capacity + air_heat_capacity
|
||||
var/old_temperature = air_contents.temperature
|
||||
|
||||
if(combined_heat_capacity > 0)
|
||||
var/combined_energy = current_temperature*current_heat_capacity + air_heat_capacity*air_contents.temperature
|
||||
if(air_contents.temperature < current_temperature) //if its colder than we can heat it, heat it
|
||||
air_contents.temperature = combined_energy/combined_heat_capacity
|
||||
if(combined_heat_capacity > 0)
|
||||
var/combined_energy = current_temperature*current_heat_capacity + air_heat_capacity*air_contents.temperature
|
||||
if(air_contents.temperature < current_temperature) //if its colder than we can heat it, heat it
|
||||
air_contents.temperature = combined_energy/combined_heat_capacity
|
||||
|
||||
//todo: have current temperature affected. require power to bring up current temperature again
|
||||
//todo: have current temperature affected. require power to bring up current temperature again
|
||||
|
||||
if(abs(old_temperature-air_contents.temperature) > 1)
|
||||
network.update = 1
|
||||
return 1
|
||||
if(abs(old_temperature-air_contents.temperature) > 1)
|
||||
network.update = 1
|
||||
return 1
|
||||
@@ -18,153 +18,152 @@
|
||||
|
||||
level = 1
|
||||
|
||||
update_icon()
|
||||
if(node)
|
||||
if(on && !(stat & NOPOWER))
|
||||
icon_state = "[level == 1 && istype(loc, /turf/simulated) ? "h" : "" ]on"
|
||||
else
|
||||
icon_state = "[level == 1 && istype(loc, /turf/simulated) ? "h" : "" ]off"
|
||||
/obj/machinery/atmospherics/unary/outlet_injector/update_icon()
|
||||
if(node)
|
||||
if(on && !(stat & NOPOWER))
|
||||
icon_state = "[level == 1 && istype(loc, /turf/simulated) ? "h" : "" ]on"
|
||||
else
|
||||
icon_state = "exposed"
|
||||
on = 0
|
||||
icon_state = "[level == 1 && istype(loc, /turf/simulated) ? "h" : "" ]off"
|
||||
else
|
||||
icon_state = "exposed"
|
||||
on = 0
|
||||
|
||||
return
|
||||
return
|
||||
|
||||
power_change()
|
||||
var/old_stat = stat
|
||||
..()
|
||||
if(old_stat != stat)
|
||||
update_icon()
|
||||
|
||||
|
||||
process()
|
||||
..()
|
||||
injecting = 0
|
||||
|
||||
if(!on || stat & NOPOWER)
|
||||
return 0
|
||||
|
||||
if(air_contents.temperature > 0)
|
||||
var/transfer_moles = (air_contents.return_pressure())*volume_rate/(air_contents.temperature * R_IDEAL_GAS_EQUATION)
|
||||
|
||||
var/datum/gas_mixture/removed = air_contents.remove(transfer_moles)
|
||||
|
||||
loc.assume_air(removed)
|
||||
|
||||
if(network)
|
||||
network.update = 1
|
||||
|
||||
return 1
|
||||
|
||||
proc/inject()
|
||||
if(on || injecting)
|
||||
return 0
|
||||
|
||||
injecting = 1
|
||||
|
||||
if(air_contents.temperature > 0)
|
||||
var/transfer_moles = (air_contents.return_pressure())*volume_rate/(air_contents.temperature * R_IDEAL_GAS_EQUATION)
|
||||
|
||||
var/datum/gas_mixture/removed = air_contents.remove(transfer_moles)
|
||||
|
||||
loc.assume_air(removed)
|
||||
|
||||
if(network)
|
||||
network.update = 1
|
||||
|
||||
flick("inject", src)
|
||||
|
||||
proc
|
||||
set_frequency(new_frequency)
|
||||
radio_controller.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
if(frequency)
|
||||
radio_connection = radio_controller.add_object(src, frequency)
|
||||
|
||||
broadcast_status()
|
||||
if(!radio_connection)
|
||||
return 0
|
||||
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 //radio signal
|
||||
signal.source = src
|
||||
|
||||
signal.data = list(
|
||||
"tag" = id_tag,
|
||||
"device" = "AO",
|
||||
"power" = on,
|
||||
"volume_rate" = volume_rate,
|
||||
//"timestamp" = world.time,
|
||||
"sigtype" = "status"
|
||||
)
|
||||
|
||||
radio_connection.post_signal(src, signal)
|
||||
|
||||
return 1
|
||||
|
||||
initialize()
|
||||
..()
|
||||
|
||||
set_frequency(frequency)
|
||||
|
||||
receive_signal(datum/signal/signal)
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id_tag) || (signal.data["sigtype"]!="command"))
|
||||
return 0
|
||||
|
||||
if("power" in signal.data)
|
||||
on = text2num(signal.data["power"])
|
||||
|
||||
if("power_toggle" in signal.data)
|
||||
on = !on
|
||||
|
||||
if("inject" in signal.data)
|
||||
spawn inject()
|
||||
return
|
||||
|
||||
if("set_volume_rate" in signal.data)
|
||||
var/number = text2num(signal.data["set_volume_rate"])
|
||||
volume_rate = Clamp(number, 0, air_contents.volume)
|
||||
|
||||
if("status" in signal.data)
|
||||
spawn(2)
|
||||
broadcast_status()
|
||||
return //do not update_icon
|
||||
|
||||
//log_admin("DEBUG \[[world.timeofday]\]: outlet_injector/receive_signal: unknown command \"[signal.data["command"]]\"\n[signal.debug_print()]")
|
||||
//return
|
||||
spawn(2)
|
||||
broadcast_status()
|
||||
/obj/machinery/atmospherics/unary/outlet_injector/power_change()
|
||||
var/old_stat = stat
|
||||
..()
|
||||
if(old_stat != stat)
|
||||
update_icon()
|
||||
|
||||
hide(var/i) //to make the little pipe section invisible, the icon changes.
|
||||
if(node)
|
||||
if(on)
|
||||
icon_state = "[i == 1 && istype(loc, /turf/simulated) ? "h" : "" ]on"
|
||||
else
|
||||
icon_state = "[i == 1 && istype(loc, /turf/simulated) ? "h" : "" ]off"
|
||||
else
|
||||
icon_state = "[i == 1 && istype(loc, /turf/simulated) ? "h" : "" ]exposed"
|
||||
on = 0
|
||||
|
||||
/obj/machinery/atmospherics/unary/outlet_injector/process()
|
||||
..()
|
||||
injecting = 0
|
||||
|
||||
if(!on || stat & NOPOWER)
|
||||
return 0
|
||||
|
||||
if(air_contents.temperature > 0)
|
||||
var/transfer_moles = (air_contents.return_pressure())*volume_rate/(air_contents.temperature * R_IDEAL_GAS_EQUATION)
|
||||
|
||||
var/datum/gas_mixture/removed = air_contents.remove(transfer_moles)
|
||||
|
||||
loc.assume_air(removed)
|
||||
|
||||
if(network)
|
||||
network.update = 1
|
||||
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/unary/outlet_injector/proc/inject()
|
||||
if(on || injecting)
|
||||
return 0
|
||||
|
||||
injecting = 1
|
||||
|
||||
if(air_contents.temperature > 0)
|
||||
var/transfer_moles = (air_contents.return_pressure())*volume_rate/(air_contents.temperature * R_IDEAL_GAS_EQUATION)
|
||||
|
||||
var/datum/gas_mixture/removed = air_contents.remove(transfer_moles)
|
||||
|
||||
loc.assume_air(removed)
|
||||
|
||||
if(network)
|
||||
network.update = 1
|
||||
|
||||
flick("inject", src)
|
||||
|
||||
/obj/machinery/atmospherics/unary/outlet_injector/proc/set_frequency(new_frequency)
|
||||
radio_controller.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
if(frequency)
|
||||
radio_connection = radio_controller.add_object(src, frequency)
|
||||
|
||||
/obj/machinery/atmospherics/unary/outlet_injector/proc/broadcast_status()
|
||||
if(!radio_connection)
|
||||
return 0
|
||||
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 //radio signal
|
||||
signal.source = src
|
||||
|
||||
signal.data = list(
|
||||
"tag" = id_tag,
|
||||
"device" = "AO",
|
||||
"power" = on,
|
||||
"volume_rate" = volume_rate,
|
||||
//"timestamp" = world.time,
|
||||
"sigtype" = "status"
|
||||
)
|
||||
|
||||
radio_connection.post_signal(src, signal)
|
||||
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/unary/outlet_injector/initialize()
|
||||
..()
|
||||
|
||||
set_frequency(frequency)
|
||||
|
||||
/obj/machinery/atmospherics/unary/outlet_injector/receive_signal(datum/signal/signal)
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id_tag) || (signal.data["sigtype"]!="command"))
|
||||
return 0
|
||||
|
||||
if("power" in signal.data)
|
||||
on = text2num(signal.data["power"])
|
||||
|
||||
if("power_toggle" in signal.data)
|
||||
on = !on
|
||||
|
||||
if("inject" in signal.data)
|
||||
spawn inject()
|
||||
return
|
||||
|
||||
interact(mob/user as mob)
|
||||
update_multitool_menu(user)
|
||||
if("set_volume_rate" in signal.data)
|
||||
var/number = text2num(signal.data["set_volume_rate"])
|
||||
volume_rate = Clamp(number, 0, air_contents.volume)
|
||||
|
||||
multitool_menu(var/mob/user,var/obj/item/device/multitool/P)
|
||||
return {"
|
||||
<ul>
|
||||
<li><b>Frequency:</b> <a href="?src=\ref[src];set_freq=-1">[format_frequency(frequency)] GHz</a> (<a href="?src=\ref[src];set_freq=[1439]">Reset</a>)</li>
|
||||
<li>[format_tag("ID Tag","id_tag","set_id")]</a></li>
|
||||
</ul>
|
||||
if("status" in signal.data)
|
||||
spawn(2)
|
||||
broadcast_status()
|
||||
return //do not update_icon
|
||||
|
||||
//log_admin("DEBUG \[[world.timeofday]\]: outlet_injector/receive_signal: unknown command \"[signal.data["command"]]\"\n[signal.debug_print()]")
|
||||
//return
|
||||
spawn(2)
|
||||
broadcast_status()
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/unary/outlet_injector/hide(var/i) //to make the little pipe section invisible, the icon changes.
|
||||
if(node)
|
||||
if(on)
|
||||
icon_state = "[i == 1 && istype(loc, /turf/simulated) ? "h" : "" ]on"
|
||||
else
|
||||
icon_state = "[i == 1 && istype(loc, /turf/simulated) ? "h" : "" ]off"
|
||||
else
|
||||
icon_state = "[i == 1 && istype(loc, /turf/simulated) ? "h" : "" ]exposed"
|
||||
on = 0
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/unary/outlet_injector/interact(mob/user as mob)
|
||||
update_multitool_menu(user)
|
||||
|
||||
/obj/machinery/atmospherics/unary/outlet_injector/multitool_menu(var/mob/user,var/obj/item/device/multitool/P)
|
||||
return {"
|
||||
<ul>
|
||||
<li><b>Frequency:</b> <a href="?src=\ref[src];set_freq=-1">[format_frequency(frequency)] GHz</a> (<a href="?src=\ref[src];set_freq=[1439]">Reset</a>)</li>
|
||||
<li>[format_tag("ID Tag","id_tag","set_id")]</a></li>
|
||||
</ul>
|
||||
"}
|
||||
|
||||
attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if(istype(W, /obj/item/device/multitool))
|
||||
interact(user)
|
||||
return 1
|
||||
if (!istype(W, /obj/item/weapon/wrench))
|
||||
return ..()
|
||||
if (!(stat & NOPOWER) && on)
|
||||
user << "\red You cannot unwrench this [src], turn it off first."
|
||||
return 1
|
||||
return ..()
|
||||
/obj/machinery/atmospherics/unary/outlet_injector/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if(istype(W, /obj/item/device/multitool))
|
||||
interact(user)
|
||||
return 1
|
||||
if (!istype(W, /obj/item/weapon/wrench))
|
||||
return ..()
|
||||
if (!(stat & NOPOWER) && on)
|
||||
user << "<span class='warning'>You cannot unwrench this [src], turn it off first.</span>"
|
||||
return 1
|
||||
return ..()
|
||||
@@ -13,37 +13,37 @@ obj/machinery/atmospherics/unary/oxygen_generator
|
||||
|
||||
var/oxygen_content = 10
|
||||
|
||||
update_icon()
|
||||
if(node)
|
||||
icon_state = "intact_[on?("on"):("off")]"
|
||||
else
|
||||
icon_state = "exposed_off"
|
||||
obj/machinery/atmospherics/unary/oxygen_generator/update_icon()
|
||||
if(node)
|
||||
icon_state = "intact_[on?("on"):("off")]"
|
||||
else
|
||||
icon_state = "exposed_off"
|
||||
|
||||
on = 0
|
||||
on = 0
|
||||
|
||||
return
|
||||
return
|
||||
|
||||
New()
|
||||
..()
|
||||
obj/machinery/atmospherics/unary/oxygen_generator/New()
|
||||
..()
|
||||
|
||||
air_contents.volume = 50
|
||||
air_contents.volume = 50
|
||||
|
||||
process()
|
||||
..()
|
||||
if(!on)
|
||||
return 0
|
||||
obj/machinery/atmospherics/unary/oxygen_generator/process()
|
||||
..()
|
||||
if(!on)
|
||||
return 0
|
||||
|
||||
var/total_moles = air_contents.total_moles()
|
||||
var/total_moles = air_contents.total_moles()
|
||||
|
||||
if(total_moles < oxygen_content)
|
||||
var/current_heat_capacity = air_contents.heat_capacity()
|
||||
if(total_moles < oxygen_content)
|
||||
var/current_heat_capacity = air_contents.heat_capacity()
|
||||
|
||||
var/added_oxygen = oxygen_content - total_moles
|
||||
var/added_oxygen = oxygen_content - total_moles
|
||||
|
||||
air_contents.temperature = (current_heat_capacity*air_contents.temperature + 20*added_oxygen*T0C)/(current_heat_capacity+20*added_oxygen)
|
||||
air_contents.oxygen += added_oxygen
|
||||
air_contents.temperature = (current_heat_capacity*air_contents.temperature + 20*added_oxygen*T0C)/(current_heat_capacity+20*added_oxygen)
|
||||
air_contents.oxygen += added_oxygen
|
||||
|
||||
if(network)
|
||||
network.update = 1
|
||||
if(network)
|
||||
network.update = 1
|
||||
|
||||
return 1
|
||||
return 1
|
||||
@@ -12,75 +12,75 @@
|
||||
level = 0
|
||||
|
||||
|
||||
New()
|
||||
initialize_directions = dir
|
||||
..()
|
||||
/obj/machinery/atmospherics/unary/portables_connector/New()
|
||||
initialize_directions = dir
|
||||
..()
|
||||
|
||||
update_icon()
|
||||
if(node)
|
||||
icon_state = "[level == 1 && istype(loc, /turf/simulated) ? "h" : "" ]intact"
|
||||
dir = get_dir(src, node)
|
||||
else
|
||||
icon_state = "exposed"
|
||||
/obj/machinery/atmospherics/unary/portables_connector/update_icon()
|
||||
if(node)
|
||||
icon_state = "[level == 1 && istype(loc, /turf/simulated) ? "h" : "" ]intact"
|
||||
dir = get_dir(src, node)
|
||||
else
|
||||
icon_state = "exposed"
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/unary/portables_connector/hide(var/i) //to make the little pipe section invisible, the icon changes.
|
||||
if(node)
|
||||
icon_state = "[i == 1 && istype(loc, /turf/simulated) ? "h" : "" ]intact"
|
||||
dir = get_dir(src, node)
|
||||
else
|
||||
icon_state = "exposed"
|
||||
|
||||
/obj/machinery/atmospherics/unary/portables_connector/process()
|
||||
..()
|
||||
if(!on)
|
||||
return
|
||||
if(!connected_device)
|
||||
on = 0
|
||||
return
|
||||
if(network)
|
||||
network.update = 1
|
||||
return 1
|
||||
|
||||
hide(var/i) //to make the little pipe section invisible, the icon changes.
|
||||
if(node)
|
||||
icon_state = "[i == 1 && istype(loc, /turf/simulated) ? "h" : "" ]intact"
|
||||
dir = get_dir(src, node)
|
||||
else
|
||||
icon_state = "exposed"
|
||||
/obj/machinery/atmospherics/unary/portables_connector/Destroy()
|
||||
if(connected_device)
|
||||
connected_device.disconnect()
|
||||
|
||||
process()
|
||||
..()
|
||||
if(!on)
|
||||
return
|
||||
if(!connected_device)
|
||||
on = 0
|
||||
return
|
||||
if(network)
|
||||
network.update = 1
|
||||
return 1
|
||||
if(node)
|
||||
node.disconnect(src)
|
||||
del(network)
|
||||
|
||||
Destroy()
|
||||
if(connected_device)
|
||||
connected_device.disconnect()
|
||||
node = null
|
||||
|
||||
if(node)
|
||||
node.disconnect(src)
|
||||
del(network)
|
||||
..()
|
||||
|
||||
node = null
|
||||
/obj/machinery/atmospherics/unary/portables_connector/return_network(obj/machinery/atmospherics/reference)
|
||||
build_network()
|
||||
|
||||
..()
|
||||
if(reference==node)
|
||||
return network
|
||||
|
||||
return_network(obj/machinery/atmospherics/reference)
|
||||
build_network()
|
||||
if(reference==connected_device)
|
||||
return network
|
||||
|
||||
if(reference==node)
|
||||
return network
|
||||
return null
|
||||
|
||||
if(reference==connected_device)
|
||||
return network
|
||||
/obj/machinery/atmospherics/unary/portables_connector/return_network_air(datum/pipe_network/reference)
|
||||
var/list/results = list()
|
||||
|
||||
return null
|
||||
if(connected_device)
|
||||
results += connected_device.air_contents
|
||||
|
||||
return_network_air(datum/pipe_network/reference)
|
||||
var/list/results = list()
|
||||
|
||||
if(connected_device)
|
||||
results += connected_device.air_contents
|
||||
|
||||
return results
|
||||
return results
|
||||
|
||||
|
||||
attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if (!istype(W, /obj/item/weapon/wrench))
|
||||
return ..()
|
||||
if (connected_device)
|
||||
user << "\red You cannot unwrench this [src], dettach [connected_device] first."
|
||||
return 1
|
||||
if (locate(/obj/machinery/portable_atmospherics, src.loc))
|
||||
return 1
|
||||
/obj/machinery/atmospherics/unary/portables_connector/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if (!istype(W, /obj/item/weapon/wrench))
|
||||
return ..()
|
||||
if (connected_device)
|
||||
user << "<span class='warning'>You cannot unwrench this [src], dettach [connected_device] first.</span>"
|
||||
return 1
|
||||
if (locate(/obj/machinery/portable_atmospherics, src.loc))
|
||||
return 1
|
||||
return ..()
|
||||
|
||||
@@ -12,79 +12,79 @@
|
||||
name = "Thermal Transfer Plate"
|
||||
desc = "Transfers heat to and from an area"
|
||||
|
||||
update_icon()
|
||||
var/prefix=""
|
||||
//var/suffix="_idle" // Also available: _heat, _cool
|
||||
if(level == 1 && istype(loc, /turf/simulated))
|
||||
prefix="h"
|
||||
icon_state = "[prefix]off"
|
||||
/obj/machinery/atmospherics/unary/thermal_plate/update_icon()
|
||||
var/prefix=""
|
||||
//var/suffix="_idle" // Also available: _heat, _cool
|
||||
if(level == 1 && istype(loc, /turf/simulated))
|
||||
prefix="h"
|
||||
icon_state = "[prefix]off"
|
||||
|
||||
process()
|
||||
..()
|
||||
/obj/machinery/atmospherics/unary/thermal_plate/process()
|
||||
..()
|
||||
|
||||
var/datum/gas_mixture/environment = loc.return_air()
|
||||
var/datum/gas_mixture/environment = loc.return_air()
|
||||
|
||||
//Get processable air sample and thermal info from environment
|
||||
//Get processable air sample and thermal info from environment
|
||||
|
||||
var/transfer_moles = 0.25 * environment.total_moles()
|
||||
var/datum/gas_mixture/external_removed = environment.remove(transfer_moles)
|
||||
var/transfer_moles = 0.25 * environment.total_moles()
|
||||
var/datum/gas_mixture/external_removed = environment.remove(transfer_moles)
|
||||
|
||||
if (!external_removed)
|
||||
return radiate()
|
||||
if (!external_removed)
|
||||
return radiate()
|
||||
|
||||
if (external_removed.total_moles() < 10)
|
||||
return radiate()
|
||||
if (external_removed.total_moles() < 10)
|
||||
return radiate()
|
||||
|
||||
//Get same info from connected gas
|
||||
//Get same info from connected gas
|
||||
|
||||
var/internal_transfer_moles = 0.25 * air_contents.total_moles()
|
||||
var/datum/gas_mixture/internal_removed = air_contents.remove(internal_transfer_moles)
|
||||
var/internal_transfer_moles = 0.25 * air_contents.total_moles()
|
||||
var/datum/gas_mixture/internal_removed = air_contents.remove(internal_transfer_moles)
|
||||
|
||||
if (!internal_removed)
|
||||
environment.merge(external_removed)
|
||||
return 1
|
||||
|
||||
var/combined_heat_capacity = internal_removed.heat_capacity() + external_removed.heat_capacity()
|
||||
var/combined_energy = internal_removed.temperature * internal_removed.heat_capacity() + external_removed.heat_capacity() * external_removed.temperature
|
||||
|
||||
if(!combined_heat_capacity) combined_heat_capacity = 1
|
||||
var/final_temperature = combined_energy / combined_heat_capacity
|
||||
|
||||
external_removed.temperature = final_temperature
|
||||
if (!internal_removed)
|
||||
environment.merge(external_removed)
|
||||
return 1
|
||||
|
||||
internal_removed.temperature = final_temperature
|
||||
air_contents.merge(internal_removed)
|
||||
var/combined_heat_capacity = internal_removed.heat_capacity() + external_removed.heat_capacity()
|
||||
var/combined_energy = internal_removed.temperature * internal_removed.heat_capacity() + external_removed.heat_capacity() * external_removed.temperature
|
||||
|
||||
if(!combined_heat_capacity) combined_heat_capacity = 1
|
||||
var/final_temperature = combined_energy / combined_heat_capacity
|
||||
|
||||
external_removed.temperature = final_temperature
|
||||
environment.merge(external_removed)
|
||||
|
||||
internal_removed.temperature = final_temperature
|
||||
air_contents.merge(internal_removed)
|
||||
|
||||
network.update = 1
|
||||
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/unary/thermal_plate/hide(var/i) //to make the little pipe section invisible, the icon changes.
|
||||
var/prefix=""
|
||||
//var/suffix="_idle" // Also available: _heat, _cool
|
||||
if(i == 1 && istype(loc, /turf/simulated))
|
||||
prefix="h"
|
||||
icon_state = "[prefix]off"
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/unary/thermal_plate/proc/radiate()
|
||||
|
||||
var/internal_transfer_moles = 0.25 * air_contents.total_moles()
|
||||
var/datum/gas_mixture/internal_removed = air_contents.remove(internal_transfer_moles)
|
||||
|
||||
if (!internal_removed)
|
||||
return 1
|
||||
|
||||
var/combined_heat_capacity = internal_removed.heat_capacity() + RADIATION_CAPACITY
|
||||
var/combined_energy = internal_removed.temperature * internal_removed.heat_capacity() + (RADIATION_CAPACITY * 6.4)
|
||||
|
||||
var/final_temperature = combined_energy / combined_heat_capacity
|
||||
|
||||
internal_removed.temperature = final_temperature
|
||||
air_contents.merge(internal_removed)
|
||||
|
||||
if (network)
|
||||
network.update = 1
|
||||
|
||||
return 1
|
||||
|
||||
hide(var/i) //to make the little pipe section invisible, the icon changes.
|
||||
var/prefix=""
|
||||
//var/suffix="_idle" // Also available: _heat, _cool
|
||||
if(i == 1 && istype(loc, /turf/simulated))
|
||||
prefix="h"
|
||||
icon_state = "[prefix]off"
|
||||
return
|
||||
|
||||
proc/radiate()
|
||||
|
||||
var/internal_transfer_moles = 0.25 * air_contents.total_moles()
|
||||
var/datum/gas_mixture/internal_removed = air_contents.remove(internal_transfer_moles)
|
||||
|
||||
if (!internal_removed)
|
||||
return 1
|
||||
|
||||
var/combined_heat_capacity = internal_removed.heat_capacity() + RADIATION_CAPACITY
|
||||
var/combined_energy = internal_removed.temperature * internal_removed.heat_capacity() + (RADIATION_CAPACITY * 6.4)
|
||||
|
||||
var/final_temperature = combined_energy / combined_heat_capacity
|
||||
|
||||
internal_removed.temperature = final_temperature
|
||||
air_contents.merge(internal_removed)
|
||||
|
||||
if (network)
|
||||
network.update = 1
|
||||
|
||||
return 1
|
||||
return 1
|
||||
|
||||
@@ -4,98 +4,82 @@
|
||||
layer = 2.45 // Cable says we're at 2.45, so we're at 2.45. (old: TURF_LAYER+0.1)
|
||||
|
||||
var/datum/gas_mixture/air_contents
|
||||
|
||||
var/obj/machinery/atmospherics/node
|
||||
|
||||
var/datum/pipe_network/network
|
||||
|
||||
New()
|
||||
..()
|
||||
initialize_directions = dir
|
||||
air_contents = new
|
||||
/obj/machinery/atmospherics/unary/New()
|
||||
..()
|
||||
initialize_directions = dir
|
||||
air_contents = new
|
||||
|
||||
air_contents.temperature = T0C
|
||||
air_contents.volume = starting_volume
|
||||
air_contents.temperature = T0C
|
||||
air_contents.volume = starting_volume
|
||||
|
||||
buildFrom(var/mob/usr,var/obj/item/pipe/pipe)
|
||||
dir = pipe.dir
|
||||
initialize_directions = pipe.get_pipe_dir()
|
||||
if (pipe.pipename)
|
||||
name = pipe.pipename
|
||||
var/turf/T = loc
|
||||
level = T.intact ? 2 : 1
|
||||
initialize()
|
||||
build_network()
|
||||
if (node)
|
||||
node.initialize()
|
||||
node.build_network()
|
||||
return 1
|
||||
/obj/machinery/atmospherics/unary/buildFrom(var/mob/usr,var/obj/item/pipe/pipe)
|
||||
dir = pipe.dir
|
||||
initialize_directions = pipe.get_pipe_dir()
|
||||
if (pipe.pipename)
|
||||
name = pipe.pipename
|
||||
var/turf/T = loc
|
||||
level = T.intact ? 2 : 1
|
||||
initialize()
|
||||
build_network()
|
||||
if (node)
|
||||
node.initialize()
|
||||
node.build_network()
|
||||
return 1
|
||||
|
||||
// Housekeeping and pipe network stuff below
|
||||
network_expand(datum/pipe_network/new_network, obj/machinery/atmospherics/pipe/reference)
|
||||
if(reference == node)
|
||||
network = new_network
|
||||
/obj/machinery/atmospherics/unary/network_expand(datum/pipe_network/new_network, obj/machinery/atmospherics/pipe/reference)
|
||||
if(reference == node)
|
||||
network = new_network
|
||||
if(new_network.normal_members.Find(src))
|
||||
return 0
|
||||
new_network.normal_members += src
|
||||
return null
|
||||
|
||||
if(new_network.normal_members.Find(src))
|
||||
return 0
|
||||
/obj/machinery/atmospherics/unary/Destroy()
|
||||
if(node)
|
||||
node.disconnect(src)
|
||||
del(network)
|
||||
node = null
|
||||
..()
|
||||
|
||||
new_network.normal_members += src
|
||||
/obj/machinery/atmospherics/unary/initialize()
|
||||
if(node) return
|
||||
var/node_connect = dir
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node_connect))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
node = target
|
||||
break
|
||||
update_icon()
|
||||
|
||||
return null
|
||||
/obj/machinery/atmospherics/unary/build_network()
|
||||
if(!network && node)
|
||||
network = new /datum/pipe_network()
|
||||
network.normal_members += src
|
||||
network.build_network(node, src)
|
||||
|
||||
Destroy()
|
||||
if(node)
|
||||
node.disconnect(src)
|
||||
del(network)
|
||||
|
||||
node = null
|
||||
|
||||
..()
|
||||
|
||||
initialize()
|
||||
if(node) return
|
||||
|
||||
var/node_connect = dir
|
||||
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node_connect))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
node = target
|
||||
break
|
||||
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/unary/return_network(obj/machinery/atmospherics/reference)
|
||||
build_network()
|
||||
if(!network && node)
|
||||
network = new /datum/pipe_network()
|
||||
network.normal_members += src
|
||||
network.build_network(node, src)
|
||||
if(reference==node)
|
||||
return network
|
||||
return null
|
||||
|
||||
/obj/machinery/atmospherics/unary/reassign_network(datum/pipe_network/old_network, datum/pipe_network/new_network)
|
||||
if(network == old_network)
|
||||
network = new_network
|
||||
return 1
|
||||
|
||||
return_network(obj/machinery/atmospherics/reference)
|
||||
build_network()
|
||||
/obj/machinery/atmospherics/unary/return_network_air(datum/pipe_network/reference)
|
||||
var/list/results = list()
|
||||
if(network == reference)
|
||||
results += air_contents
|
||||
return results
|
||||
|
||||
if(reference==node)
|
||||
return network
|
||||
|
||||
return null
|
||||
|
||||
reassign_network(datum/pipe_network/old_network, datum/pipe_network/new_network)
|
||||
if(network == old_network)
|
||||
network = new_network
|
||||
|
||||
return 1
|
||||
|
||||
return_network_air(datum/pipe_network/reference)
|
||||
var/list/results = list()
|
||||
|
||||
if(network == reference)
|
||||
results += air_contents
|
||||
|
||||
return results
|
||||
|
||||
disconnect(obj/machinery/atmospherics/reference)
|
||||
if(reference==node)
|
||||
del(network)
|
||||
node = null
|
||||
|
||||
return null
|
||||
/obj/machinery/atmospherics/unary/disconnect(obj/machinery/atmospherics/reference)
|
||||
if(reference==node)
|
||||
del(network)
|
||||
node = null
|
||||
return null
|
||||
@@ -26,272 +26,272 @@
|
||||
var/area_uid
|
||||
var/radio_filter_out
|
||||
var/radio_filter_in
|
||||
New()
|
||||
..()
|
||||
area_uid = areaMaster.uid
|
||||
if (!id_tag)
|
||||
assign_uid()
|
||||
id_tag = num2text(uid)
|
||||
if(ticker && ticker.current_state == 3)//if the game is running
|
||||
src.initialize()
|
||||
src.broadcast_status()
|
||||
|
||||
update_icon()
|
||||
var/hidden=""
|
||||
if(level == 1 && istype(loc, /turf/simulated))
|
||||
hidden="h"
|
||||
var/suffix=""
|
||||
if(scrub_O2)
|
||||
suffix="1"
|
||||
if(node && on && !(stat & (NOPOWER|BROKEN)))
|
||||
if(scrubbing)
|
||||
icon_state = "[hidden]on[suffix]"
|
||||
else
|
||||
icon_state = "[hidden]in"
|
||||
else
|
||||
icon_state = "[hidden]off"
|
||||
return
|
||||
|
||||
proc
|
||||
set_frequency(new_frequency)
|
||||
radio_controller.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
radio_connection = radio_controller.add_object(src, frequency, radio_filter_in)
|
||||
|
||||
broadcast_status()
|
||||
if(!radio_connection)
|
||||
return 0
|
||||
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 //radio signal
|
||||
signal.source = src
|
||||
signal.data = list(
|
||||
"area" = area_uid,
|
||||
"tag" = id_tag,
|
||||
"device" = "AScr",
|
||||
"timestamp" = world.time,
|
||||
"power" = on,
|
||||
"scrubbing" = scrubbing,
|
||||
"panic" = panic,
|
||||
"filter_co2" = scrub_CO2,
|
||||
"filter_tox" = scrub_Toxins,
|
||||
"filter_n2o" = scrub_N2O,
|
||||
"filter_o2" = scrub_O2,
|
||||
"filter_n2" = scrub_N2,
|
||||
"sigtype" = "status"
|
||||
)
|
||||
if(!areaMaster.air_scrub_names[id_tag])
|
||||
var/new_name = "[areaMaster.name] Air Scrubber #[areaMaster.air_scrub_names.len+1]"
|
||||
areaMaster.air_scrub_names[id_tag] = new_name
|
||||
src.name = new_name
|
||||
areaMaster.air_scrub_info[id_tag] = signal.data
|
||||
radio_connection.post_signal(src, signal, radio_filter_out)
|
||||
|
||||
return 1
|
||||
|
||||
initialize()
|
||||
..()
|
||||
radio_filter_in = frequency==initial(frequency)?(RADIO_FROM_AIRALARM):null
|
||||
radio_filter_out = frequency==initial(frequency)?(RADIO_TO_AIRALARM):null
|
||||
if (frequency)
|
||||
set_frequency(frequency)
|
||||
|
||||
process()
|
||||
..()
|
||||
CHECK_DISABLED(scrubbers)
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
if (!node)
|
||||
return 0 // Let's not shut it off, for now.
|
||||
//broadcast_status()
|
||||
if(!on)
|
||||
return 0
|
||||
// New GC does this sometimes
|
||||
if(!loc) return
|
||||
|
||||
|
||||
var/datum/gas_mixture/environment = loc.return_air()
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/New()
|
||||
..()
|
||||
area_uid = areaMaster.uid
|
||||
if (!id_tag)
|
||||
assign_uid()
|
||||
id_tag = num2text(uid)
|
||||
if(ticker && ticker.current_state == 3)//if the game is running
|
||||
src.initialize()
|
||||
src.broadcast_status()
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/update_icon()
|
||||
var/hidden=""
|
||||
if(level == 1 && istype(loc, /turf/simulated))
|
||||
hidden="h"
|
||||
var/suffix=""
|
||||
if(scrub_O2)
|
||||
suffix="1"
|
||||
if(node && on && !(stat & (NOPOWER|BROKEN)))
|
||||
if(scrubbing)
|
||||
// Are we scrubbing gasses that are present?
|
||||
if(\
|
||||
(scrub_Toxins && environment.toxins > 0) ||\
|
||||
(scrub_CO2 && environment.carbon_dioxide > 0) ||\
|
||||
(scrub_N2O && environment.trace_gases.len > 0) ||\
|
||||
(scrub_O2 && environment.oxygen > 0) ||\
|
||||
(scrub_N2 && environment.nitrogen > 0))
|
||||
var/transfer_moles = min(1, volume_rate/environment.volume)*environment.total_moles()
|
||||
icon_state = "[hidden]on[suffix]"
|
||||
else
|
||||
icon_state = "[hidden]in"
|
||||
else
|
||||
icon_state = "[hidden]off"
|
||||
return
|
||||
|
||||
//Take a gas sample
|
||||
var/datum/gas_mixture/removed = loc.remove_air(transfer_moles)
|
||||
if (isnull(removed)) //in space
|
||||
return
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/proc/set_frequency(new_frequency)
|
||||
radio_controller.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
radio_connection = radio_controller.add_object(src, frequency, radio_filter_in)
|
||||
|
||||
//Filter it
|
||||
var/datum/gas_mixture/filtered_out = new
|
||||
filtered_out.temperature = removed.temperature
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/proc/broadcast_status()
|
||||
if(!radio_connection)
|
||||
return 0
|
||||
|
||||
if(scrub_Toxins)
|
||||
filtered_out.toxins = removed.toxins
|
||||
removed.toxins = 0
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 //radio signal
|
||||
signal.source = src
|
||||
signal.data = list(
|
||||
"area" = area_uid,
|
||||
"tag" = id_tag,
|
||||
"device" = "AScr",
|
||||
"timestamp" = world.time,
|
||||
"power" = on,
|
||||
"scrubbing" = scrubbing,
|
||||
"panic" = panic,
|
||||
"filter_co2" = scrub_CO2,
|
||||
"filter_tox" = scrub_Toxins,
|
||||
"filter_n2o" = scrub_N2O,
|
||||
"filter_o2" = scrub_O2,
|
||||
"filter_n2" = scrub_N2,
|
||||
"sigtype" = "status"
|
||||
)
|
||||
if(!areaMaster.air_scrub_names[id_tag])
|
||||
var/new_name = "[areaMaster.name] Air Scrubber #[areaMaster.air_scrub_names.len+1]"
|
||||
areaMaster.air_scrub_names[id_tag] = new_name
|
||||
src.name = new_name
|
||||
areaMaster.air_scrub_info[id_tag] = signal.data
|
||||
radio_connection.post_signal(src, signal, radio_filter_out)
|
||||
|
||||
if(scrub_CO2)
|
||||
filtered_out.carbon_dioxide = removed.carbon_dioxide
|
||||
removed.carbon_dioxide = 0
|
||||
return 1
|
||||
|
||||
if(scrub_O2)
|
||||
filtered_out.oxygen = removed.oxygen
|
||||
removed.oxygen = 0
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/initialize()
|
||||
..()
|
||||
radio_filter_in = frequency==initial(frequency)?(RADIO_FROM_AIRALARM):null
|
||||
radio_filter_out = frequency==initial(frequency)?(RADIO_TO_AIRALARM):null
|
||||
if (frequency)
|
||||
set_frequency(frequency)
|
||||
|
||||
if(scrub_N2)
|
||||
filtered_out.nitrogen = removed.nitrogen
|
||||
removed.nitrogen = 0
|
||||
|
||||
if(removed.trace_gases.len>0)
|
||||
for(var/datum/gas/trace_gas in removed.trace_gases)
|
||||
if(istype(trace_gas, /datum/gas/oxygen_agent_b))
|
||||
removed.trace_gases -= trace_gas
|
||||
filtered_out.trace_gases += trace_gas
|
||||
else if(istype(trace_gas, /datum/gas/sleeping_agent) && scrub_N2O)
|
||||
removed.trace_gases -= trace_gas
|
||||
filtered_out.trace_gases += trace_gas
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/process()
|
||||
..()
|
||||
CHECK_DISABLED(scrubbers)
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
if (!node)
|
||||
return 0 // Let's not shut it off, for now.
|
||||
//broadcast_status()
|
||||
if(!on)
|
||||
return 0
|
||||
// New GC does this sometimes
|
||||
if(!loc) return
|
||||
|
||||
|
||||
//Remix the resulting gases
|
||||
air_contents.merge(filtered_out)
|
||||
var/datum/gas_mixture/environment = loc.return_air()
|
||||
|
||||
loc.assume_air(removed)
|
||||
if(scrubbing)
|
||||
// Are we scrubbing gasses that are present?
|
||||
if(\
|
||||
(scrub_Toxins && environment.toxins > 0) ||\
|
||||
(scrub_CO2 && environment.carbon_dioxide > 0) ||\
|
||||
(scrub_N2O && environment.trace_gases.len > 0) ||\
|
||||
(scrub_O2 && environment.oxygen > 0) ||\
|
||||
(scrub_N2 && environment.nitrogen > 0))
|
||||
var/transfer_moles = min(1, volume_rate/environment.volume)*environment.total_moles()
|
||||
|
||||
if(network)
|
||||
network.update = 1
|
||||
|
||||
else //Just siphoning all air
|
||||
if (air_contents.return_pressure()>=50*ONE_ATMOSPHERE)
|
||||
//Take a gas sample
|
||||
var/datum/gas_mixture/removed = loc.remove_air(transfer_moles)
|
||||
if (isnull(removed)) //in space
|
||||
return
|
||||
|
||||
var/transfer_moles = environment.total_moles()*(volume_rate/environment.volume)
|
||||
//Filter it
|
||||
var/datum/gas_mixture/filtered_out = new
|
||||
filtered_out.temperature = removed.temperature
|
||||
|
||||
var/datum/gas_mixture/removed = loc.remove_air(transfer_moles)
|
||||
if(scrub_Toxins)
|
||||
filtered_out.toxins = removed.toxins
|
||||
removed.toxins = 0
|
||||
|
||||
air_contents.merge(removed)
|
||||
if(scrub_CO2)
|
||||
filtered_out.carbon_dioxide = removed.carbon_dioxide
|
||||
removed.carbon_dioxide = 0
|
||||
|
||||
if(scrub_O2)
|
||||
filtered_out.oxygen = removed.oxygen
|
||||
removed.oxygen = 0
|
||||
|
||||
if(scrub_N2)
|
||||
filtered_out.nitrogen = removed.nitrogen
|
||||
removed.nitrogen = 0
|
||||
|
||||
if(removed.trace_gases.len>0)
|
||||
for(var/datum/gas/trace_gas in removed.trace_gases)
|
||||
if(istype(trace_gas, /datum/gas/oxygen_agent_b))
|
||||
removed.trace_gases -= trace_gas
|
||||
filtered_out.trace_gases += trace_gas
|
||||
else if(istype(trace_gas, /datum/gas/sleeping_agent) && scrub_N2O)
|
||||
removed.trace_gases -= trace_gas
|
||||
filtered_out.trace_gases += trace_gas
|
||||
|
||||
|
||||
//Remix the resulting gases
|
||||
air_contents.merge(filtered_out)
|
||||
|
||||
loc.assume_air(removed)
|
||||
|
||||
if(network)
|
||||
network.update = 1
|
||||
|
||||
return 1
|
||||
else //Just siphoning all air
|
||||
if (air_contents.return_pressure()>=50*ONE_ATMOSPHERE)
|
||||
return
|
||||
|
||||
var/transfer_moles = environment.total_moles()*(volume_rate/environment.volume)
|
||||
|
||||
var/datum/gas_mixture/removed = loc.remove_air(transfer_moles)
|
||||
|
||||
air_contents.merge(removed)
|
||||
|
||||
if(network)
|
||||
network.update = 1
|
||||
|
||||
return 1
|
||||
/* //unused piece of code
|
||||
hide(var/i) //to make the little pipe section invisible, the icon changes.
|
||||
if(on&&node)
|
||||
if(scrubbing)
|
||||
icon_state = "[i == 1 && istype(loc, /turf/simulated) ? "h" : "" ]on"
|
||||
else
|
||||
icon_state = "[i == 1 && istype(loc, /turf/simulated) ? "h" : "" ]in"
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/hide(var/i) //to make the little pipe section invisible, the icon changes.
|
||||
if(on&&node)
|
||||
if(scrubbing)
|
||||
icon_state = "[i == 1 && istype(loc, /turf/simulated) ? "h" : "" ]on"
|
||||
else
|
||||
icon_state = "[i == 1 && istype(loc, /turf/simulated) ? "h" : "" ]off"
|
||||
on = 0
|
||||
return
|
||||
icon_state = "[i == 1 && istype(loc, /turf/simulated) ? "h" : "" ]in"
|
||||
else
|
||||
icon_state = "[i == 1 && istype(loc, /turf/simulated) ? "h" : "" ]off"
|
||||
on = 0
|
||||
return
|
||||
*/
|
||||
|
||||
receive_signal(datum/signal/signal)
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id_tag) || (signal.data["sigtype"]!="command"))
|
||||
return 0
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/receive_signal(datum/signal/signal)
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id_tag) || (signal.data["sigtype"]!="command"))
|
||||
return 0
|
||||
|
||||
if(signal.data["power"] != null)
|
||||
on = text2num(signal.data["power"])
|
||||
if(signal.data["power_toggle"] != null)
|
||||
on = !on
|
||||
if(signal.data["power"] != null)
|
||||
on = text2num(signal.data["power"])
|
||||
if(signal.data["power_toggle"] != null)
|
||||
on = !on
|
||||
|
||||
if(signal.data["panic_siphon"]) //must be before if("scrubbing" thing
|
||||
panic = text2num(signal.data["panic_siphon"]) // We send 0 for false in the alarm.
|
||||
if(panic)
|
||||
on = 1
|
||||
scrubbing = 0
|
||||
volume_rate = 2000
|
||||
else
|
||||
scrubbing = 1
|
||||
volume_rate = initial(volume_rate)
|
||||
if(signal.data["toggle_panic_siphon"] != null)
|
||||
panic = !panic
|
||||
if(panic)
|
||||
on = 1
|
||||
scrubbing = 0
|
||||
volume_rate = 2000
|
||||
else
|
||||
scrubbing = 1
|
||||
volume_rate = initial(volume_rate)
|
||||
if(signal.data["panic_siphon"]) //must be before if("scrubbing" thing
|
||||
panic = text2num(signal.data["panic_siphon"]) // We send 0 for false in the alarm.
|
||||
if(panic)
|
||||
on = 1
|
||||
scrubbing = 0
|
||||
volume_rate = 2000
|
||||
else
|
||||
scrubbing = 1
|
||||
volume_rate = initial(volume_rate)
|
||||
if(signal.data["toggle_panic_siphon"] != null)
|
||||
panic = !panic
|
||||
if(panic)
|
||||
on = 1
|
||||
scrubbing = 0
|
||||
volume_rate = 2000
|
||||
else
|
||||
scrubbing = 1
|
||||
volume_rate = initial(volume_rate)
|
||||
|
||||
if(signal.data["scrubbing"] != null)
|
||||
scrubbing = text2num(signal.data["scrubbing"])
|
||||
if(signal.data["toggle_scrubbing"])
|
||||
scrubbing = !scrubbing
|
||||
if(signal.data["scrubbing"] != null)
|
||||
scrubbing = text2num(signal.data["scrubbing"])
|
||||
if(signal.data["toggle_scrubbing"])
|
||||
scrubbing = !scrubbing
|
||||
|
||||
if(signal.data["co2_scrub"] != null)
|
||||
scrub_CO2 = text2num(signal.data["co2_scrub"])
|
||||
if(signal.data["toggle_co2_scrub"])
|
||||
scrub_CO2 = !scrub_CO2
|
||||
if(signal.data["co2_scrub"] != null)
|
||||
scrub_CO2 = text2num(signal.data["co2_scrub"])
|
||||
if(signal.data["toggle_co2_scrub"])
|
||||
scrub_CO2 = !scrub_CO2
|
||||
|
||||
if(signal.data["tox_scrub"] != null)
|
||||
scrub_Toxins = text2num(signal.data["tox_scrub"])
|
||||
if(signal.data["toggle_tox_scrub"])
|
||||
scrub_Toxins = !scrub_Toxins
|
||||
if(signal.data["tox_scrub"] != null)
|
||||
scrub_Toxins = text2num(signal.data["tox_scrub"])
|
||||
if(signal.data["toggle_tox_scrub"])
|
||||
scrub_Toxins = !scrub_Toxins
|
||||
|
||||
if(signal.data["n2o_scrub"] != null)
|
||||
scrub_N2O = text2num(signal.data["n2o_scrub"])
|
||||
if(signal.data["toggle_n2o_scrub"])
|
||||
scrub_N2O = !scrub_N2O
|
||||
if(signal.data["n2o_scrub"] != null)
|
||||
scrub_N2O = text2num(signal.data["n2o_scrub"])
|
||||
if(signal.data["toggle_n2o_scrub"])
|
||||
scrub_N2O = !scrub_N2O
|
||||
|
||||
if(signal.data["o2_scrub"] != null)
|
||||
scrub_O2 = text2num(signal.data["o2_scrub"])
|
||||
if(signal.data["toggle_o2_scrub"])
|
||||
scrub_O2 = !scrub_O2
|
||||
if(signal.data["o2_scrub"] != null)
|
||||
scrub_O2 = text2num(signal.data["o2_scrub"])
|
||||
if(signal.data["toggle_o2_scrub"])
|
||||
scrub_O2 = !scrub_O2
|
||||
|
||||
if(signal.data["n2_scrub"] != null)
|
||||
scrub_N2 = text2num(signal.data["n2_scrub"])
|
||||
if(signal.data["toggle_n2_scrub"])
|
||||
scrub_N2 = !scrub_N2
|
||||
if(signal.data["n2_scrub"] != null)
|
||||
scrub_N2 = text2num(signal.data["n2_scrub"])
|
||||
if(signal.data["toggle_n2_scrub"])
|
||||
scrub_N2 = !scrub_N2
|
||||
|
||||
if(signal.data["init"] != null)
|
||||
name = signal.data["init"]
|
||||
return
|
||||
|
||||
if(signal.data["status"] != null)
|
||||
spawn(2)
|
||||
broadcast_status()
|
||||
return //do not update_icon
|
||||
|
||||
// log_admin("DEBUG \[[world.timeofday]\]: vent_scrubber/receive_signal: unknown command \"[signal.data["command"]]\"\n[signal.debug_print()]")
|
||||
spawn(2)
|
||||
broadcast_status()
|
||||
update_icon()
|
||||
if(signal.data["init"] != null)
|
||||
name = signal.data["init"]
|
||||
return
|
||||
|
||||
power_change()
|
||||
if(powered(power_channel))
|
||||
stat &= ~NOPOWER
|
||||
else
|
||||
stat |= NOPOWER
|
||||
update_icon()
|
||||
if(signal.data["status"] != null)
|
||||
spawn(2)
|
||||
broadcast_status()
|
||||
return //do not update_icon
|
||||
|
||||
attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if(istype(W, /obj/item/device/multitool))
|
||||
update_multitool_menu(user)
|
||||
return 1
|
||||
if (!istype(W, /obj/item/weapon/wrench))
|
||||
return ..()
|
||||
if (!(stat & NOPOWER) && on)
|
||||
user << "\red You cannot unwrench this [src], turn it off first."
|
||||
return 1
|
||||
// log_admin("DEBUG \[[world.timeofday]\]: vent_scrubber/receive_signal: unknown command \"[signal.data["command"]]\"\n[signal.debug_print()]")
|
||||
spawn(2)
|
||||
broadcast_status()
|
||||
update_icon()
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/power_change()
|
||||
if(powered(power_channel))
|
||||
stat &= ~NOPOWER
|
||||
else
|
||||
stat |= NOPOWER
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if(istype(W, /obj/item/device/multitool))
|
||||
update_multitool_menu(user)
|
||||
return 1
|
||||
if (!istype(W, /obj/item/weapon/wrench))
|
||||
return ..()
|
||||
if (!(stat & NOPOWER) && on)
|
||||
user << "<span class='warning'>You cannot unwrench this [src], turn it off first.</span>"
|
||||
return 1
|
||||
return ..()
|
||||
|
||||
multitool_menu(var/mob/user,var/obj/item/device/multitool/P)
|
||||
return {"
|
||||
<ul>
|
||||
<li><b>Frequency:</b> <a href="?src=\ref[src];set_freq=-1">[format_frequency(frequency)] GHz</a> (<a href="?src=\ref[src];set_freq=[1439]">Reset</a>)</li>
|
||||
<li>[format_tag("ID Tag","id_tag")]</li>
|
||||
</ul>
|
||||
"}
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/multitool_menu(var/mob/user,var/obj/item/device/multitool/P)
|
||||
return {"
|
||||
<ul>
|
||||
<li><b>Frequency:</b> <a href="?src=\ref[src];set_freq=-1">[format_frequency(frequency)] GHz</a> (<a href="?src=\ref[src];set_freq=[1439]">Reset</a>)</li>
|
||||
<li>[format_tag("ID Tag","id_tag")]</li>
|
||||
</ul>
|
||||
"}
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/Destroy()
|
||||
areaMaster.air_scrub_info.Remove(id_tag)
|
||||
|
||||
@@ -10,145 +10,145 @@ var/global/list/datum/pipe_network/pipe_networks = list()
|
||||
var/update = 1
|
||||
var/datum/gas_mixture/air_transient = null
|
||||
|
||||
New()
|
||||
air_transient = new()
|
||||
/datum/pipe_network/New()
|
||||
air_transient = new()
|
||||
|
||||
..()
|
||||
..()
|
||||
|
||||
proc/process()
|
||||
//Equalize gases amongst pipe if called for
|
||||
if(update)
|
||||
update = 0
|
||||
reconcile_air() //equalize_gases(gases)
|
||||
/datum/pipe_network/proc/process()
|
||||
//Equalize gases amongst pipe if called for
|
||||
if(update)
|
||||
update = 0
|
||||
reconcile_air() //equalize_gases(gases)
|
||||
|
||||
#ifdef ATMOS_PIPELINE_PROCESSING
|
||||
//Give pipelines their process call for pressure checking and what not. Have to remove pressure checks for the time being as pipes dont radiate heat - Mport
|
||||
for(var/datum/pipeline/line_member in line_members)
|
||||
line_member.process()
|
||||
//Give pipelines their process call for pressure checking and what not. Have to remove pressure checks for the time being as pipes dont radiate heat - Mport
|
||||
for(var/datum/pipeline/line_member in line_members)
|
||||
line_member.process()
|
||||
#endif
|
||||
|
||||
proc/build_network(obj/machinery/atmospherics/start_normal, obj/machinery/atmospherics/reference)
|
||||
//Purpose: Generate membership roster
|
||||
//Notes: Assuming that members will add themselves to appropriate roster in network_expand()
|
||||
/datum/pipe_network/proc/build_network(obj/machinery/atmospherics/start_normal, obj/machinery/atmospherics/reference)
|
||||
//Purpose: Generate membership roster
|
||||
//Notes: Assuming that members will add themselves to appropriate roster in network_expandz()
|
||||
|
||||
if(!start_normal)
|
||||
qdel(src)
|
||||
if(!start_normal)
|
||||
qdel(src)
|
||||
|
||||
start_normal.network_expand(src, reference)
|
||||
start_normal.network_expand(src, reference)
|
||||
|
||||
update_network_gases()
|
||||
update_network_gases()
|
||||
|
||||
if((normal_members.len>0)||(line_members.len>0))
|
||||
pipe_networks += src
|
||||
else
|
||||
qdel(src)
|
||||
|
||||
/datum/pipe_network/proc/merge(datum/pipe_network/giver)
|
||||
if(giver==src) return 0
|
||||
|
||||
normal_members |= giver.normal_members
|
||||
|
||||
line_members |= giver.line_members
|
||||
|
||||
for(var/obj/machinery/atmospherics/normal_member in giver.normal_members)
|
||||
normal_member.reassign_network(giver, src)
|
||||
|
||||
for(var/datum/pipeline/line_member in giver.line_members)
|
||||
line_member.network = src
|
||||
|
||||
|
||||
update_network_gases()
|
||||
return 1
|
||||
|
||||
/datum/pipe_network/proc/update_network_gases()
|
||||
//Go through membership roster and make sure gases is up to date
|
||||
|
||||
gases = list()
|
||||
|
||||
for(var/obj/machinery/atmospherics/normal_member in normal_members)
|
||||
var/result = normal_member.return_network_air(src)
|
||||
if(result) gases += result
|
||||
|
||||
for(var/datum/pipeline/line_member in line_members)
|
||||
gases += line_member.air
|
||||
|
||||
/datum/pipe_network/proc/reconcile_air()
|
||||
//Perfectly equalize all gases members instantly
|
||||
|
||||
//Calculate totals from individual components
|
||||
var/total_thermal_energy = 0
|
||||
var/total_heat_capacity = 0
|
||||
|
||||
//air_transient.volume = 0
|
||||
var/air_transient_volume = 0
|
||||
|
||||
air_transient.oxygen = 0
|
||||
air_transient.nitrogen = 0
|
||||
air_transient.toxins = 0
|
||||
air_transient.carbon_dioxide = 0
|
||||
|
||||
|
||||
air_transient.trace_gases = list()
|
||||
|
||||
for(var/datum/gas_mixture/gas in gases)
|
||||
air_transient_volume += gas.volume
|
||||
var/temp_heatcap = gas.heat_capacity()
|
||||
total_thermal_energy += gas.temperature*temp_heatcap
|
||||
total_heat_capacity += temp_heatcap
|
||||
|
||||
air_transient.oxygen += gas.oxygen
|
||||
air_transient.nitrogen += gas.nitrogen
|
||||
air_transient.toxins += gas.toxins
|
||||
air_transient.carbon_dioxide += gas.carbon_dioxide
|
||||
|
||||
if(gas.trace_gases.len)
|
||||
for(var/datum/gas/trace_gas in gas.trace_gases)
|
||||
var/datum/gas/corresponding = locate(trace_gas.type) in air_transient.trace_gases
|
||||
if(!corresponding)
|
||||
corresponding = new trace_gas.type()
|
||||
air_transient.trace_gases += corresponding
|
||||
|
||||
corresponding.moles += trace_gas.moles
|
||||
|
||||
air_transient.volume = air_transient_volume
|
||||
|
||||
if(air_transient_volume > 0)
|
||||
|
||||
if(total_heat_capacity > 0)
|
||||
air_transient.temperature = total_thermal_energy/total_heat_capacity
|
||||
|
||||
//Allow air mixture to react
|
||||
if(air_transient.react())
|
||||
update = 1
|
||||
|
||||
if((normal_members.len>0)||(line_members.len>0))
|
||||
pipe_networks += src
|
||||
else
|
||||
qdel(src)
|
||||
|
||||
proc/merge(datum/pipe_network/giver)
|
||||
if(giver==src) return 0
|
||||
|
||||
normal_members |= giver.normal_members
|
||||
|
||||
line_members |= giver.line_members
|
||||
|
||||
for(var/obj/machinery/atmospherics/normal_member in giver.normal_members)
|
||||
normal_member.reassign_network(giver, src)
|
||||
|
||||
for(var/datum/pipeline/line_member in giver.line_members)
|
||||
line_member.network = src
|
||||
|
||||
|
||||
update_network_gases()
|
||||
return 1
|
||||
|
||||
proc/update_network_gases()
|
||||
//Go through membership roster and make sure gases is up to date
|
||||
|
||||
gases = list()
|
||||
|
||||
for(var/obj/machinery/atmospherics/normal_member in normal_members)
|
||||
var/result = normal_member.return_network_air(src)
|
||||
if(result) gases += result
|
||||
|
||||
for(var/datum/pipeline/line_member in line_members)
|
||||
gases += line_member.air
|
||||
|
||||
proc/reconcile_air()
|
||||
//Perfectly equalize all gases members instantly
|
||||
|
||||
//Calculate totals from individual components
|
||||
var/total_thermal_energy = 0
|
||||
var/total_heat_capacity = 0
|
||||
|
||||
//air_transient.volume = 0
|
||||
var/air_transient_volume = 0
|
||||
|
||||
air_transient.oxygen = 0
|
||||
air_transient.nitrogen = 0
|
||||
air_transient.toxins = 0
|
||||
air_transient.carbon_dioxide = 0
|
||||
|
||||
|
||||
air_transient.trace_gases = list()
|
||||
air_transient.temperature = 0
|
||||
|
||||
//Update individual gas_mixtures by volume ratio
|
||||
for(var/datum/gas_mixture/gas in gases)
|
||||
air_transient_volume += gas.volume
|
||||
var/temp_heatcap = gas.heat_capacity()
|
||||
total_thermal_energy += gas.temperature*temp_heatcap
|
||||
total_heat_capacity += temp_heatcap
|
||||
var/volume_ratio = gas.volume / air_transient.volume
|
||||
|
||||
air_transient.oxygen += gas.oxygen
|
||||
air_transient.nitrogen += gas.nitrogen
|
||||
air_transient.toxins += gas.toxins
|
||||
air_transient.carbon_dioxide += gas.carbon_dioxide
|
||||
gas.oxygen = air_transient.oxygen * volume_ratio
|
||||
gas.nitrogen = air_transient.nitrogen * volume_ratio
|
||||
gas.toxins = air_transient.toxins * volume_ratio
|
||||
gas.carbon_dioxide = air_transient.carbon_dioxide * volume_ratio
|
||||
|
||||
gas.temperature = air_transient.temperature
|
||||
|
||||
if(air_transient.trace_gases.len)
|
||||
for(var/datum/gas/trace_gas in air_transient.trace_gases)
|
||||
var/datum/gas/corresponding = locate(trace_gas.type) in gas.trace_gases
|
||||
|
||||
if(gas.trace_gases.len)
|
||||
for(var/datum/gas/trace_gas in gas.trace_gases)
|
||||
var/datum/gas/corresponding = locate(trace_gas.type) in air_transient.trace_gases
|
||||
if(!corresponding)
|
||||
corresponding = new trace_gas.type()
|
||||
air_transient.trace_gases += corresponding
|
||||
gas.trace_gases += corresponding
|
||||
|
||||
corresponding.moles += trace_gas.moles
|
||||
corresponding.moles = trace_gas.moles * volume_ratio
|
||||
|
||||
air_transient.volume = air_transient_volume
|
||||
gas.update_values()
|
||||
|
||||
if(air_transient_volume > 0)
|
||||
|
||||
if(total_heat_capacity > 0)
|
||||
air_transient.temperature = total_thermal_energy/total_heat_capacity
|
||||
|
||||
//Allow air mixture to react
|
||||
if(air_transient.react())
|
||||
update = 1
|
||||
|
||||
else
|
||||
air_transient.temperature = 0
|
||||
|
||||
//Update individual gas_mixtures by volume ratio
|
||||
for(var/datum/gas_mixture/gas in gases)
|
||||
var/volume_ratio = gas.volume / air_transient.volume
|
||||
|
||||
gas.oxygen = air_transient.oxygen * volume_ratio
|
||||
gas.nitrogen = air_transient.nitrogen * volume_ratio
|
||||
gas.toxins = air_transient.toxins * volume_ratio
|
||||
gas.carbon_dioxide = air_transient.carbon_dioxide * volume_ratio
|
||||
|
||||
gas.temperature = air_transient.temperature
|
||||
|
||||
if(air_transient.trace_gases.len)
|
||||
for(var/datum/gas/trace_gas in air_transient.trace_gases)
|
||||
var/datum/gas/corresponding = locate(trace_gas.type) in gas.trace_gases
|
||||
|
||||
if(!corresponding)
|
||||
corresponding = new trace_gas.type()
|
||||
gas.trace_gases += corresponding
|
||||
|
||||
corresponding.moles = trace_gas.moles * volume_ratio
|
||||
|
||||
gas.update_values()
|
||||
|
||||
air_transient.update_values()
|
||||
return 1
|
||||
air_transient.update_values()
|
||||
return 1
|
||||
|
||||
proc/equalize_gases(datum/gas_mixture/list/gases)
|
||||
//Perfectly equalize all gases members instantly
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
..()
|
||||
|
||||
datum/pipeline/proc/process()//This use to be called called from the pipe networks
|
||||
/datum/pipeline/proc/process()//This use to be called called from the pipe networks
|
||||
if((world.timeofday - last_pressure_check) / 10 >= PRESSURE_CHECK_DELAY)
|
||||
//Check to see if pressure is within acceptable limits
|
||||
var/pressure = air.return_pressure()
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
switch(buildstage)
|
||||
if(2)
|
||||
if(isscrewdriver(W))
|
||||
user << "You begin unscrewing \the [src]."
|
||||
playsound(get_turf(src), 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
if(do_after(user,10))
|
||||
user << "<span class='notice'>You unscrew the cover blocking the inner wiring of \the [src].</span>"
|
||||
@@ -44,6 +45,7 @@
|
||||
return
|
||||
if(1)
|
||||
if(isscrewdriver(W))
|
||||
user << "You begin screwing closed \the [src]."
|
||||
playsound(get_turf(src), 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
if(do_after(user,10))
|
||||
user << "<span class='notice'>You tightly screw closed the cover of \the [src].</span>"
|
||||
@@ -51,6 +53,7 @@
|
||||
power_change()
|
||||
return
|
||||
if(iswirecutter(W))
|
||||
user << "You begin cutting the wiring from \the [src]."
|
||||
playsound(get_turf(src), 'sound/items/Wirecutter.ogg', 50, 1)
|
||||
if(do_after(user,10))
|
||||
user << "<span class='notice'>You cut the wiring to the lighting power line.</span>"
|
||||
@@ -63,12 +66,14 @@
|
||||
if(coil.amount < 3)
|
||||
user << "<span class='warning'>You need at least two wire pieces for this!</span>"
|
||||
return
|
||||
user << "You begin wiring \the [src]."
|
||||
if(do_after(user,10))
|
||||
user << "<span class='notice'>You wire \the [src]!.</span>"
|
||||
coil.use(3)
|
||||
buildstage = 1
|
||||
return
|
||||
if(iscrowbar(W))
|
||||
user << "You begin prying \the [src] off the wall."
|
||||
playsound(get_turf(src), 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
if(do_after(user,10))
|
||||
user << "<span class='notice'>You pry the frame off of the wall.</span>"
|
||||
|
||||
@@ -5,10 +5,12 @@
|
||||
icon_state = "d6"
|
||||
w_class = 1
|
||||
var/sides = 6
|
||||
var/minsides = 1
|
||||
var/result = null
|
||||
|
||||
/obj/item/weapon/dice/New()
|
||||
result = rand(1, sides)
|
||||
..()
|
||||
result = rand(minsides, sides)
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/dice/d2
|
||||
@@ -64,7 +66,7 @@
|
||||
diceroll(user, 1)
|
||||
|
||||
/obj/item/weapon/dice/proc/diceroll(mob/user as mob, thrown)
|
||||
result = rand(1, sides)
|
||||
result = rand(minsides, sides)
|
||||
var/comment = ""
|
||||
if(sides == 20 && result == 20)
|
||||
comment = "Nat 20!"
|
||||
|
||||
@@ -27,6 +27,10 @@
|
||||
item_state = "gift-large"
|
||||
w_class = 4.0
|
||||
|
||||
/obj/item/weapon/gift/New(var/W)
|
||||
..()
|
||||
w_class = W
|
||||
|
||||
/obj/item/weapon/gift/attack_self(mob/user as mob)
|
||||
user.drop_item()
|
||||
if(gift)
|
||||
@@ -357,12 +361,9 @@
|
||||
return
|
||||
*/
|
||||
|
||||
/obj/item/weapon/wrapping_paper/examine()
|
||||
set src in oview(1)
|
||||
|
||||
/obj/item/weapon/wrapping_paper/examine(mob/user)
|
||||
..()
|
||||
usr << "There is about [amount] square units of paper left!"
|
||||
return
|
||||
user << "There is about [amount] square units of paper left!"
|
||||
|
||||
/obj/item/weapon/wrapping_paper/attack(mob/target as mob, mob/user as mob)
|
||||
if (!istype(target, /mob/living/carbon/human)) return
|
||||
@@ -427,11 +428,11 @@
|
||||
|
||||
switch(i)
|
||||
if(0 to 2)
|
||||
G = new /obj/item/weapon/gift/small(get_turf(O.loc))
|
||||
G = new /obj/item/weapon/gift/small(get_turf(O.loc),i)
|
||||
if(3)
|
||||
G = new /obj/item/weapon/gift(get_turf(O.loc))
|
||||
G = new /obj/item/weapon/gift(get_turf(O.loc),i)
|
||||
else
|
||||
G = new /obj/item/weapon/gift/large(get_turf(O.loc))
|
||||
G = new /obj/item/weapon/gift/large(get_turf(O.loc),i)
|
||||
|
||||
if(!istype(O.loc, /turf))
|
||||
if(user.client)
|
||||
|
||||
@@ -233,7 +233,6 @@
|
||||
|
||||
/obj/item/device/mmi/examine(mob/user)
|
||||
user << "<span class='info'>*---------*</span>"
|
||||
..()
|
||||
if(src.brainmob)
|
||||
if(src.brainmob.stat == DEAD)
|
||||
user << "<span class='deadsay'>It appears the brain has suffered irreversible tissue degeneration</span>" //suicided
|
||||
@@ -241,5 +240,5 @@
|
||||
user << "<span class='notice'>It appears to be lost in its own thoughts</span>" //closed game window
|
||||
else if(!src.brainmob.key)
|
||||
user << "<span class='warning'>It seems to be in a deep dream-state</span>" //ghosted
|
||||
user << "<span class='info'>*---------*</span>"
|
||||
user << "<span class='info'>It's interface is [locked ? "locked" : "unlocked"] </span>"
|
||||
user << "<span class='info'>*---------*</span>"
|
||||
|
||||
@@ -118,7 +118,6 @@
|
||||
|
||||
/obj/item/device/mmi/posibrain/examine(mob/user)
|
||||
user << "<span class='info'>*---------</span>*"
|
||||
..()
|
||||
if(src.brainmob)
|
||||
if(src.brainmob.stat == DEAD)
|
||||
user << "<span class='deadsay'>It appears to be completely inactive.</span>" //suicided
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
var/mob/living/carbon/monkey/O = null
|
||||
|
||||
O = new species.primitive(loc)
|
||||
O = new species.primitive(get_turf(src))
|
||||
|
||||
O.dna = dna.Clone()
|
||||
O.dna.SetSEState(MONKEYBLOCK,1)
|
||||
@@ -66,7 +66,7 @@
|
||||
for(var/t in organs) //this really should not be necessary
|
||||
del(t)
|
||||
|
||||
var/mob/living/simple_animal/hostile/retaliate/cluwne/new_mob = new (src.loc)
|
||||
var/mob/living/simple_animal/hostile/retaliate/cluwne/new_mob = new (get_turf(src))
|
||||
new_mob.gender=src.gender
|
||||
new_mob.name = pick(clown_names)
|
||||
new_mob.real_name = new_mob.name
|
||||
@@ -109,7 +109,7 @@
|
||||
/mob/proc/AIize()
|
||||
if(client)
|
||||
src << sound(null, repeat = 0, wait = 0, volume = 85, channel = 1) // stop the jams for AIs
|
||||
var/mob/living/silicon/ai/O = new (loc, base_law_type,,1)//No MMI but safety is in effect.
|
||||
var/mob/living/silicon/ai/O = new (get_turf(src), base_law_type,,1)//No MMI but safety is in effect.
|
||||
O.invisibility = 0
|
||||
O.aiRestorePowerRoutine = 0
|
||||
|
||||
@@ -228,7 +228,7 @@
|
||||
for(var/t in organs)
|
||||
del(t)
|
||||
|
||||
var/mob/living/silicon/robot/mommi/O = new /mob/living/silicon/robot/mommi( loc )
|
||||
var/mob/living/silicon/robot/mommi/O = new /mob/living/silicon/robot/mommi(get_turf(src))
|
||||
|
||||
// MoMMIs produced by Robotize get an automatic power cell
|
||||
O.cell = new(O)
|
||||
@@ -280,11 +280,11 @@
|
||||
var/mob/living/carbon/alien/humanoid/new_xeno
|
||||
switch(alien_caste)
|
||||
if("Hunter")
|
||||
new_xeno = new /mob/living/carbon/alien/humanoid/hunter(loc)
|
||||
new_xeno = new /mob/living/carbon/alien/humanoid/hunter(get_turf(src))
|
||||
if("Sentinel")
|
||||
new_xeno = new /mob/living/carbon/alien/humanoid/sentinel(loc)
|
||||
new_xeno = new /mob/living/carbon/alien/humanoid/sentinel(get_turf(src))
|
||||
if("Drone")
|
||||
new_xeno = new /mob/living/carbon/alien/humanoid/drone(loc)
|
||||
new_xeno = new /mob/living/carbon/alien/humanoid/drone(get_turf(src))
|
||||
|
||||
new_xeno.a_intent = I_HURT
|
||||
new_xeno.key = key
|
||||
@@ -312,16 +312,16 @@
|
||||
var/number = pick(14;2,3,4) //reproduce (has a small chance of producing 3 or 4 offspring)
|
||||
var/list/babies = list()
|
||||
for(var/i=1,i<=number,i++)
|
||||
var/mob/living/carbon/slime/M = new/mob/living/carbon/slime(loc)
|
||||
var/mob/living/carbon/slime/M = new/mob/living/carbon/slime(get_turf(src))
|
||||
M.nutrition = round(nutrition/number)
|
||||
step_away(M,src)
|
||||
babies += M
|
||||
new_slime = pick(babies)
|
||||
else
|
||||
if(adult)
|
||||
new_slime = new /mob/living/carbon/slime/adult(loc)
|
||||
new_slime = new /mob/living/carbon/slime/adult(get_turf(src))
|
||||
else
|
||||
new_slime = new /mob/living/carbon/slime(loc)
|
||||
new_slime = new /mob/living/carbon/slime(get_turf(src))
|
||||
new_slime.a_intent = I_HURT
|
||||
new_slime.key = key
|
||||
|
||||
@@ -343,7 +343,7 @@
|
||||
for(var/t in organs) //this really should not be necessary
|
||||
del(t)
|
||||
|
||||
var/mob/living/simple_animal/corgi/new_corgi = new /mob/living/simple_animal/corgi (loc)
|
||||
var/mob/living/simple_animal/corgi/new_corgi = new /mob/living/simple_animal/corgi (get_turf(src))
|
||||
new_corgi.a_intent = I_HURT
|
||||
new_corgi.key = key
|
||||
|
||||
@@ -375,7 +375,7 @@
|
||||
for(var/t in organs)
|
||||
del(t)
|
||||
|
||||
var/mob/new_mob = new mobpath(src.loc)
|
||||
var/mob/new_mob = new mobpath(get_turf(src))
|
||||
|
||||
new_mob.key = key
|
||||
new_mob.a_intent = I_HURT
|
||||
@@ -395,7 +395,7 @@
|
||||
usr << "\red Sorry but this mob type is currently unavailable."
|
||||
return
|
||||
|
||||
var/mob/new_mob = new mobpath(src.loc)
|
||||
var/mob/new_mob = new mobpath(get_turf(src))
|
||||
|
||||
new_mob.key = key
|
||||
new_mob.a_intent = I_HURT
|
||||
|
||||
Reference in New Issue
Block a user