mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
Merge branch 'incremental_tg' r5514 (11/1/2013) into bs12_with_tgport
Conflicts: baystation12.dme code/ATMOSPHERICS/components/unary/vent_pump.dm code/ATMOSPHERICS/components/unary/vent_scrubber.dm code/__HELPERS/game.dm code/controllers/shuttle_controller.dm code/datums/datumvars.dm code/datums/supplypacks.dm code/defines/obj/storage.dm code/defines/obj/vending.dm code/defines/obj/weapon.dm code/defines/procs/command_alert.dm code/game/area/Space Station 13 areas.dm code/game/atoms.dm code/game/gamemodes/changeling/modularchangling.dm code/game/gamemodes/cult/runes.dm code/game/gamemodes/events.dm code/game/gamemodes/events/dust.dm code/game/gamemodes/events/miniblob.dm code/game/gamemodes/events/ninja_equipment.dm code/game/gamemodes/factions.dm code/game/gamemodes/game_mode.dm code/game/gamemodes/gameticker.dm code/game/jobs/access.dm code/game/jobs/job/assistant.dm code/game/jobs/job/captain.dm code/game/jobs/job/civilian.dm code/game/jobs/job/engineering.dm code/game/jobs/job/medical.dm code/game/jobs/job/science.dm code/game/jobs/job/security.dm code/game/jobs/job_controller.dm code/game/machinery/alarm.dm code/game/machinery/atmo_control.dm code/game/machinery/atmoalter/area_atmos_computer.dm code/game/machinery/bots/medbot.dm code/game/machinery/computer/HolodeckControl.dm code/game/machinery/computer/ai_core.dm code/game/machinery/computer/atmos_alert.dm code/game/machinery/computer/card.dm code/game/machinery/computer/cloning.dm code/game/machinery/computer/computer.dm code/game/machinery/computer/message.dm code/game/machinery/computer/pod.dm code/game/machinery/computer/prisoner.dm code/game/machinery/computer/syndicate_shuttle.dm code/game/machinery/constructable_frame.dm code/game/machinery/doors/door.dm code/game/machinery/doors/firedoor.dm code/game/machinery/newscaster.dm code/game/machinery/recharger.dm code/game/machinery/spaceheater.dm code/game/machinery/telecomms/broadcaster.dm code/game/machinery/telecomms/logbrowser.dm code/game/machinery/telecomms/machine_interactions.dm code/game/machinery/teleporter.dm code/game/machinery/wishgranter.dm code/game/mecha/mech_fabricator.dm code/game/mecha/working/ripley.dm code/game/objects/items.dm code/game/objects/items/blueprints.dm code/game/objects/items/devices/flashlight.dm code/game/objects/items/devices/radio/encryptionkey.dm code/game/objects/items/devices/uplinks.dm code/game/objects/items/stacks/medical.dm code/game/objects/items/weapons/cards_ids.dm code/game/objects/items/weapons/gift_wrappaper.dm code/game/objects/items/weapons/hydroponics.dm code/game/objects/items/weapons/manuals.dm code/game/objects/items/weapons/secstorage/secstorage.dm code/game/objects/items/weapons/storage/backpack.dm code/game/objects/items/weapons/storage/firstaid.dm code/game/objects/items/weapons/storage/kit.dm code/game/objects/items/weapons/storage/storage.dm code/game/objects/items/weapons/storage/toolbox.dm code/game/objects/items/weapons/storage/uplink_kits.dm code/game/objects/items/weapons/stunbaton.dm code/game/objects/items/weapons/surgery_tools.dm code/game/objects/items/weapons/tools.dm code/game/objects/structures/crates_lockers/closets/secure/cargo.dm code/game/objects/structures/crates_lockers/closets/secure/hydroponics.dm code/game/objects/structures/crates_lockers/closets/secure/scientist.dm code/game/objects/structures/crates_lockers/closets/secure/security.dm code/game/objects/structures/electricchair.dm code/game/objects/structures/extinguisher.dm code/game/objects/structures/watercloset.dm code/game/objects/weapons.dm code/game/turfs/turf.dm code/game/vehicles/airtight/airtight.dm code/game/vehicles/vehicle.dm code/global.dm code/modules/DetectiveWork/evidence.dm code/modules/admin/IsBanned.dm code/modules/admin/player_panel.dm code/modules/admin/verbs/diagnostics.dm code/modules/admin/verbs/getlogs.dm code/modules/client/preferences.dm code/modules/clothing/masks/miscellaneous.dm code/modules/clothing/spacesuits/rig.dm code/modules/clothing/suits/miscellaneous.dm code/modules/critters/critter_defenses.dm code/modules/detectivework/scanner.dm code/modules/flufftext/Hallucination.dm code/modules/food/recipes_microwave.dm code/modules/mining/mine_items.dm code/modules/mining/mine_turfs.dm code/modules/mining/satchel_ore_boxdm.dm code/modules/mob/dead/observer/observer.dm code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm code/modules/mob/living/carbon/alien/special/facehugger.dm code/modules/mob/living/carbon/carbon.dm code/modules/mob/living/carbon/carbon_defines.dm code/modules/mob/living/carbon/human/human.dm code/modules/mob/living/carbon/human/human_attackhand.dm code/modules/mob/living/carbon/human/life.dm code/modules/mob/living/carbon/human/say.dm code/modules/mob/living/carbon/human/update_icons.dm code/modules/mob/living/carbon/metroid/metroid.dm code/modules/mob/living/living.dm code/modules/mob/living/silicon/ai/life.dm code/modules/mob/living/silicon/robot/robot.dm code/modules/mob/mob_cleanup.dm code/modules/mob/mob_defines.dm code/modules/mob/mob_transformation_simple.dm code/modules/paperwork/clipboard.dm code/modules/paperwork/folders.dm code/modules/paperwork/paper.dm code/modules/paperwork/paperbin.dm code/modules/paperwork/pen.dm code/modules/power/cable.dm code/modules/projectiles/guns/energy/special.dm code/modules/projectiles/guns/projectile/revolver.dm code/modules/projectiles/projectile/change.dm code/modules/projectiles/projectile/special.dm code/modules/reagents/Chemistry-Reagents.dm code/modules/reagents/reagent_containers/glass.dm code/modules/reagents/reagent_containers/hypospray.dm code/modules/recycling/sortingmachinery.dm code/modules/research/designs.dm config/config.txt html/changelog.html icons/mob/head.dmi icons/mob/hud.dmi icons/mob/items_lefthand.dmi icons/mob/items_righthand.dmi icons/mob/mask.dmi icons/mob/suit.dmi icons/mob/ties.dmi icons/mob/uniform.dmi icons/obj/clothing/hats.dmi icons/obj/clothing/masks.dmi icons/obj/clothing/suits.dmi icons/obj/clothing/ties.dmi icons/obj/grenade.dmi icons/obj/projectiles.dmi Signed-off-by: Cael_Aislinn <cael_aislinn@yahoo.com.au>
This commit is contained in:
@@ -12,7 +12,6 @@ Pipelines + Other Objects -> Pipe network
|
||||
|
||||
obj/machinery/atmospherics
|
||||
anchored = 1
|
||||
use_power = 0
|
||||
idle_power_usage = 0
|
||||
active_power_usage = 0
|
||||
power_channel = ENVIRON
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
obj/machinery/atmospherics/binary
|
||||
dir = SOUTH
|
||||
initialize_directions = SOUTH|NORTH
|
||||
use_power = 1
|
||||
|
||||
var/datum/gas_mixture/air1
|
||||
var/datum/gas_mixture/air2
|
||||
|
||||
@@ -15,7 +15,9 @@ obj/machinery/atmospherics/binary/passive_gate
|
||||
var/datum/radio_frequency/radio_connection
|
||||
|
||||
update_icon()
|
||||
if(node1&&node2)
|
||||
if(stat & NOPOWER)
|
||||
icon_state = "intact_off"
|
||||
else if(node1 && node2)
|
||||
icon_state = "intact_[on?("on"):("off")]"
|
||||
else
|
||||
if(node1)
|
||||
@@ -24,8 +26,6 @@ obj/machinery/atmospherics/binary/passive_gate
|
||||
icon_state = "exposed_2_off"
|
||||
else
|
||||
icon_state = "exposed_3_off"
|
||||
on = 0
|
||||
|
||||
return
|
||||
|
||||
process()
|
||||
|
||||
@@ -37,7 +37,9 @@ obj/machinery/atmospherics/binary/pump
|
||||
icon_state = "intact_on"
|
||||
|
||||
update_icon()
|
||||
if(node1&&node2)
|
||||
if(stat & NOPOWER)
|
||||
icon_state = "intact_off"
|
||||
else if(node1 && node2)
|
||||
icon_state = "intact_[on?("on"):("off")]"
|
||||
else
|
||||
if(node1)
|
||||
|
||||
@@ -31,7 +31,9 @@ obj/machinery/atmospherics/binary/volume_pump
|
||||
icon_state = "intact_on"
|
||||
|
||||
update_icon()
|
||||
if(node1&&node2)
|
||||
if(stat & NOPOWER)
|
||||
icon_state = "intact_off"
|
||||
else if(node1 && node2)
|
||||
icon_state = "intact_[on?("on"):("off")]"
|
||||
else
|
||||
if(node1)
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
var/datum/pipe_network/network
|
||||
|
||||
var/on = 0
|
||||
|
||||
use_power = 0
|
||||
level = 0
|
||||
|
||||
|
||||
|
||||
@@ -39,16 +39,21 @@ Filter types:
|
||||
..()
|
||||
|
||||
update_icon()
|
||||
if(node2 && node3 && node1)
|
||||
if(stat & NOPOWER)
|
||||
icon_state = "intact_off"
|
||||
else if(node2 && node3 && node1)
|
||||
icon_state = "intact_[on?("on"):("off")]"
|
||||
else
|
||||
icon_state = "hintact_off"
|
||||
icon_state = "intact_off"
|
||||
on = 0
|
||||
|
||||
return
|
||||
|
||||
New()
|
||||
power_change()
|
||||
var/old_stat = stat
|
||||
..()
|
||||
if(old_stat != stat)
|
||||
update_icon()
|
||||
|
||||
process()
|
||||
..()
|
||||
|
||||
@@ -16,7 +16,9 @@ obj/machinery/atmospherics/trinary/mixer
|
||||
//node 3 is the outlet, nodes 1 & 2 are intakes
|
||||
|
||||
update_icon()
|
||||
if(node2 && node3 && node1)
|
||||
if(stat & NOPOWER)
|
||||
icon_state = "intact_off"
|
||||
else if(node2 && node3 && node1)
|
||||
icon_state = "intact_[on?("on"):("off")]"
|
||||
else
|
||||
icon_state = "intact_off"
|
||||
@@ -24,6 +26,12 @@ obj/machinery/atmospherics/trinary/mixer
|
||||
|
||||
return
|
||||
|
||||
power_change()
|
||||
var/old_stat = stat
|
||||
..()
|
||||
if(old_stat != stat)
|
||||
update_icon()
|
||||
|
||||
New()
|
||||
..()
|
||||
air3.volume = 300
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
obj/machinery/atmospherics/trinary
|
||||
dir = SOUTH
|
||||
initialize_directions = SOUTH|NORTH|WEST
|
||||
use_power = 1
|
||||
|
||||
var/datum/gas_mixture/air1
|
||||
var/datum/gas_mixture/air2
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
icon = 'icons/obj/atmospherics/cold_sink.dmi'
|
||||
icon_state = "intact_off"
|
||||
density = 1
|
||||
use_power = 1
|
||||
|
||||
name = "Cold Sink"
|
||||
desc = "Cools gas when connected to pipe network"
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
icon = 'icons/obj/atmospherics/cold_sink.dmi'
|
||||
icon_state = "intact_off"
|
||||
density = 1
|
||||
use_power = 1
|
||||
|
||||
name = "Heat Reservoir"
|
||||
desc = "Heats gas when connected to pipe network"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/obj/machinery/atmospherics/unary/outlet_injector
|
||||
icon = 'icons/obj/atmospherics/outlet_injector.dmi'
|
||||
icon_state = "off"
|
||||
use_power = 1
|
||||
|
||||
name = "Air Injector"
|
||||
desc = "Has a valve and pump attached to it"
|
||||
@@ -18,7 +19,7 @@
|
||||
|
||||
update_icon()
|
||||
if(node)
|
||||
if(on)
|
||||
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"
|
||||
@@ -28,11 +29,18 @@
|
||||
|
||||
return
|
||||
|
||||
power_change()
|
||||
var/old_stat = stat
|
||||
..()
|
||||
if(old_stat != stat)
|
||||
update_icon()
|
||||
|
||||
|
||||
process()
|
||||
..()
|
||||
injecting = 0
|
||||
|
||||
if(!on)
|
||||
if(!on || stat & NOPOWER)
|
||||
return 0
|
||||
|
||||
if(air_contents.temperature > 0)
|
||||
|
||||
@@ -4,15 +4,15 @@
|
||||
|
||||
name = "Air Vent"
|
||||
desc = "Has a valve and pump attached to it"
|
||||
use_power = 1
|
||||
|
||||
var/area/initial_loc
|
||||
level = 1
|
||||
var/area_uid
|
||||
var/id_tag
|
||||
power_channel = ENVIRON
|
||||
var/id_tag = null
|
||||
|
||||
var/on = 0
|
||||
var/pump_direction = 1 //0 = siphoning, 1 = releasing
|
||||
var/pump_speed = 1 //Used to adjust speed for siphons
|
||||
|
||||
var/external_pressure_bound = ONE_ATMOSPHERE
|
||||
var/internal_pressure_bound = 0
|
||||
@@ -43,27 +43,25 @@
|
||||
icon_state = "in"
|
||||
|
||||
New()
|
||||
var/area/A = get_area(loc)
|
||||
if (A.master)
|
||||
A = A.master
|
||||
area_uid = A.uid
|
||||
initial_loc = get_area(loc)
|
||||
if (initial_loc.master)
|
||||
initial_loc = initial_loc.master
|
||||
area_uid = initial_loc.uid
|
||||
if (!id_tag)
|
||||
assign_uid()
|
||||
id_tag = num2text(uid)
|
||||
if(ticker && ticker.current_state == 3)//if the game is running
|
||||
initialize()
|
||||
broadcast_status()
|
||||
src.initialize()
|
||||
src.broadcast_status()
|
||||
..()
|
||||
|
||||
high_volume
|
||||
name = "Large Air Vent"
|
||||
power_channel = EQUIP
|
||||
|
||||
New()
|
||||
..()
|
||||
air_contents.volume = 1000
|
||||
|
||||
|
||||
update_icon()
|
||||
if(welded)
|
||||
icon_state = "[level == 1 && istype(loc, /turf/simulated) ? "h" : "" ]weld"
|
||||
@@ -80,12 +78,11 @@
|
||||
|
||||
process()
|
||||
..()
|
||||
// broadcast_status()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
if (!node)
|
||||
on = 0
|
||||
|
||||
//broadcast_status() // from now air alarm/control computer should request update purposely --rastaf0
|
||||
if(!on)
|
||||
return 0
|
||||
|
||||
@@ -105,7 +102,7 @@
|
||||
|
||||
if(pressure_delta > 0)
|
||||
if(air_contents.temperature > 0)
|
||||
var/transfer_moles = pressure_delta*environment.volume*environment.group_multiplier*pump_speed/(air_contents.temperature * R_IDEAL_GAS_EQUATION)
|
||||
var/transfer_moles = pressure_delta*environment.volume/(air_contents.temperature * R_IDEAL_GAS_EQUATION)
|
||||
|
||||
var/datum/gas_mixture/removed = air_contents.remove(transfer_moles)
|
||||
|
||||
@@ -123,7 +120,7 @@
|
||||
|
||||
if(pressure_delta > 0)
|
||||
if(environment.temperature > 0)
|
||||
var/transfer_moles = pressure_delta*air_contents.volume*air_contents.group_multiplier*pump_speed/(environment.temperature * R_IDEAL_GAS_EQUATION)
|
||||
var/transfer_moles = pressure_delta*air_contents.volume/(environment.temperature * R_IDEAL_GAS_EQUATION)
|
||||
|
||||
var/datum/gas_mixture/removed = loc.remove_air(transfer_moles)
|
||||
if (isnull(removed)) //in space
|
||||
@@ -136,42 +133,45 @@
|
||||
|
||||
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,radio_filter_in)
|
||||
proc
|
||||
set_frequency(new_frequency)
|
||||
radio_controller.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
if(frequency)
|
||||
radio_connection = radio_controller.add_object(src, frequency,radio_filter_in)
|
||||
|
||||
proc/broadcast_status()
|
||||
if(!radio_connection)
|
||||
return 0
|
||||
broadcast_status()
|
||||
if(!radio_connection)
|
||||
return 0
|
||||
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 //radio signal
|
||||
signal.source = src
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 //radio signal
|
||||
signal.source = src
|
||||
|
||||
signal.data = list(
|
||||
"area" = src.area_uid,
|
||||
"tag" = src.id_tag,
|
||||
"device" = "AVP",
|
||||
"power" = on,
|
||||
"direction" = pump_direction?("release"):("siphon"),
|
||||
"checks" = pressure_checks,
|
||||
"internal" = internal_pressure_bound,
|
||||
"external" = external_pressure_bound,
|
||||
"timestamp" = world.time,
|
||||
"sigtype" = "status",
|
||||
"setting" = pump_speed
|
||||
)
|
||||
signal.data = list(
|
||||
"area" = src.area_uid,
|
||||
"tag" = src.id_tag,
|
||||
"device" = "AVP",
|
||||
"power" = on,
|
||||
"direction" = pump_direction?("release"):("siphon"),
|
||||
"checks" = pressure_checks,
|
||||
"internal" = internal_pressure_bound,
|
||||
"external" = external_pressure_bound,
|
||||
"timestamp" = world.time,
|
||||
"sigtype" = "status"
|
||||
)
|
||||
|
||||
radio_connection.post_signal(src, signal, radio_filter_out)
|
||||
if(!initial_loc.air_vent_names[id_tag])
|
||||
var/new_name = "[initial_loc.name] Vent Pump #[initial_loc.air_vent_names.len+1]"
|
||||
initial_loc.air_vent_names[id_tag] = new_name
|
||||
src.name = new_name
|
||||
initial_loc.air_vent_info[id_tag] = signal.data
|
||||
|
||||
return 1
|
||||
radio_connection.post_signal(src, signal, radio_filter_out)
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
initialize()
|
||||
@@ -183,7 +183,6 @@
|
||||
if(frequency)
|
||||
set_frequency(frequency)
|
||||
|
||||
|
||||
receive_signal(datum/signal/signal)
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
@@ -191,49 +190,67 @@
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id_tag) || (signal.data["sigtype"]!="command"))
|
||||
return 0
|
||||
|
||||
if("purge" in signal.data)
|
||||
if(signal.data["purge"] != null)
|
||||
pressure_checks &= ~1
|
||||
pump_direction = 0
|
||||
|
||||
if("stabalize" in signal.data)
|
||||
if(signal.data["stabalize"] != null)
|
||||
pressure_checks |= 1
|
||||
pump_direction = 1
|
||||
|
||||
if("power" in signal.data)
|
||||
if(signal.data["power"] != null)
|
||||
on = text2num(signal.data["power"])
|
||||
|
||||
if("power_toggle" in signal.data)
|
||||
if(signal.data["power_toggle"] != null)
|
||||
on = !on
|
||||
|
||||
if("checks" in signal.data)
|
||||
if(signal.data["checks"] != null)
|
||||
pressure_checks = text2num(signal.data["checks"])
|
||||
|
||||
if("checks_toggle" in signal.data)
|
||||
if(signal.data["checks_toggle"] != null)
|
||||
pressure_checks = (pressure_checks?0:3)
|
||||
|
||||
if("direction" in signal)
|
||||
if(signal.data["direction"] != null)
|
||||
pump_direction = text2num(signal.data["direction"])
|
||||
|
||||
if("set_internal_pressure" in signal.data)
|
||||
internal_pressure_bound = between(0, text2num(signal.data["set_internal_pressure"]), ONE_ATMOSPHERE*50)
|
||||
if(signal.data["set_internal_pressure"] != null)
|
||||
internal_pressure_bound = between(
|
||||
0,
|
||||
text2num(signal.data["set_internal_pressure"]),
|
||||
ONE_ATMOSPHERE*50
|
||||
)
|
||||
|
||||
if("set_external_pressure" in signal.data)
|
||||
external_pressure_bound = between(0, text2num(signal.data["set_external_pressure"]), ONE_ATMOSPHERE*50)
|
||||
if(signal.data["set_external_pressure"] != null)
|
||||
external_pressure_bound = between(
|
||||
0,
|
||||
text2num(signal.data["set_external_pressure"]),
|
||||
ONE_ATMOSPHERE*50
|
||||
)
|
||||
|
||||
if("adjust_internal_pressure" in signal.data)
|
||||
internal_pressure_bound = between(0, internal_pressure_bound + text2num(signal.data["adjust_internal_pressure"]), ONE_ATMOSPHERE*50)
|
||||
if(signal.data["adjust_internal_pressure"] != null)
|
||||
internal_pressure_bound = between(
|
||||
0,
|
||||
internal_pressure_bound + text2num(signal.data["adjust_internal_pressure"]),
|
||||
ONE_ATMOSPHERE*50
|
||||
)
|
||||
|
||||
if("adjust_external_pressure" in signal.data)
|
||||
external_pressure_bound = between(0, external_pressure_bound + text2num(signal.data["adjust_external_pressure"]), ONE_ATMOSPHERE*50)
|
||||
if(signal.data["adjust_external_pressure"] != null)
|
||||
external_pressure_bound = between(
|
||||
0,
|
||||
external_pressure_bound + text2num(signal.data["adjust_external_pressure"]),
|
||||
ONE_ATMOSPHERE*50
|
||||
)
|
||||
|
||||
if("init" in signal.data)
|
||||
if(signal.data["init"] != null)
|
||||
name = signal.data["init"]
|
||||
return
|
||||
|
||||
if("setting" in signal.data)
|
||||
pump_speed = text2num(signal.data["setting"])
|
||||
if(signal.data["status"] != null)
|
||||
spawn(2)
|
||||
broadcast_status()
|
||||
return //do not update_icon
|
||||
|
||||
//log_admin("DEBUG \[[world.timeofday]\]: vent_pump/receive_signal: unknown command \"[signal["command"]]\"\n[signal.debug_print()]")
|
||||
//log_admin("DEBUG \[[world.timeofday]\]: vent_pump/receive_signal: unknown command \"[signal.data["command"]]\"\n[signal.debug_print()]")
|
||||
spawn(2)
|
||||
broadcast_status()
|
||||
update_icon()
|
||||
@@ -274,7 +291,6 @@
|
||||
else
|
||||
user << "\blue You need more welding fuel to complete this task."
|
||||
return 1
|
||||
|
||||
examine()
|
||||
set src in oview(1)
|
||||
..()
|
||||
@@ -312,4 +328,11 @@
|
||||
"\blue You have unfastened \the [src].", \
|
||||
"You hear ratchet.")
|
||||
new /obj/item/pipe(loc, make_from=src)
|
||||
del(src)
|
||||
del(src)
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_pump/Del()
|
||||
if(initial_loc)
|
||||
initial_loc.air_vent_info -= id_tag
|
||||
initial_loc.air_vent_names -= id_tag
|
||||
..()
|
||||
return
|
||||
|
||||
@@ -4,39 +4,38 @@
|
||||
|
||||
name = "Air Scrubber"
|
||||
desc = "Has a valve and pump attached to it"
|
||||
use_power = 1
|
||||
|
||||
level = 1
|
||||
|
||||
var/area/initial_loc
|
||||
var/id_tag = null
|
||||
var/frequency = 1439
|
||||
var/datum/radio_frequency/radio_connection
|
||||
|
||||
var/on = 0
|
||||
var/scrubbing = 1 //0 = siphoning, 1 = scrubbing
|
||||
var/scrub_CO2 = 1
|
||||
var/scrub_Toxins = 0
|
||||
var/scrub_N2O = 0
|
||||
var/scrub_rate = 1
|
||||
|
||||
var/volume_rate = 120
|
||||
var/panic = 0 //is this scrubber panicked?
|
||||
|
||||
var/area_uid
|
||||
|
||||
var/frequency = 1439
|
||||
var/datum/radio_frequency/radio_connection
|
||||
var/radio_filter_out
|
||||
var/radio_filter_in
|
||||
|
||||
New()
|
||||
var/area/A = get_area(loc)
|
||||
if (A.master)
|
||||
A = A.master
|
||||
area_uid = A.uid
|
||||
initial_loc = get_area(loc)
|
||||
if (initial_loc.master)
|
||||
initial_loc = initial_loc.master
|
||||
area_uid = initial_loc.uid
|
||||
if (!id_tag)
|
||||
assign_uid()
|
||||
id_tag = num2text(uid)
|
||||
if(ticker && ticker.current_state == 3)//if the game is running
|
||||
initialize()
|
||||
broadcast_status()
|
||||
src.initialize()
|
||||
src.broadcast_status()
|
||||
..()
|
||||
|
||||
update_icon()
|
||||
@@ -75,6 +74,11 @@
|
||||
"filter_n2o" = scrub_N2O,
|
||||
"sigtype" = "status"
|
||||
)
|
||||
if(!initial_loc.air_scrub_names[id_tag])
|
||||
var/new_name = "[initial_loc.name] Air Scrubber #[initial_loc.air_scrub_names.len+1]"
|
||||
initial_loc.air_scrub_names[id_tag] = new_name
|
||||
src.name = new_name
|
||||
initial_loc.air_scrub_info[id_tag] = signal.data
|
||||
radio_connection.post_signal(src, signal, radio_filter_out)
|
||||
|
||||
return 1
|
||||
@@ -88,20 +92,20 @@
|
||||
|
||||
process()
|
||||
..()
|
||||
// broadcast_status()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
if (!node)
|
||||
on = 0
|
||||
|
||||
//broadcast_status()
|
||||
if(!on)
|
||||
return 0
|
||||
|
||||
|
||||
var/datum/gas_mixture/environment = loc.return_air()
|
||||
|
||||
if(scrubbing)
|
||||
if((environment.toxins>0) || (environment.carbon_dioxide>0) || (environment.trace_gases.len>0))
|
||||
var/transfer_moles = min(1, volume_rate*scrub_rate/environment.volume)*environment.total_moles
|
||||
var/transfer_moles = min(1, volume_rate/environment.volume)*environment.total_moles()
|
||||
|
||||
//Take a gas sample
|
||||
var/datum/gas_mixture/removed = loc.remove_air(transfer_moles)
|
||||
@@ -120,14 +124,15 @@
|
||||
|
||||
if(removed.trace_gases.len>0)
|
||||
for(var/datum/gas/trace_gas in removed.trace_gases)
|
||||
if(istype(trace_gas, /datum/gas/sleeping_agent) && scrub_N2O)
|
||||
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
|
||||
filtered_out.update_values()
|
||||
removed.update_values()
|
||||
air_contents.merge(filtered_out)
|
||||
|
||||
loc.assume_air(removed)
|
||||
@@ -139,7 +144,7 @@
|
||||
if (air_contents.return_pressure()>=50*ONE_ATMOSPHERE)
|
||||
return
|
||||
|
||||
var/transfer_moles = environment.total_moles*(volume_rate*scrub_rate/environment.volume)
|
||||
var/transfer_moles = environment.total_moles()*(volume_rate/environment.volume)
|
||||
|
||||
var/datum/gas_mixture/removed = loc.remove_air(transfer_moles)
|
||||
|
||||
@@ -168,13 +173,13 @@
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id_tag) || (signal.data["sigtype"]!="command"))
|
||||
return 0
|
||||
|
||||
if("power" in signal.data)
|
||||
if(signal.data["power"] != null)
|
||||
on = text2num(signal.data["power"])
|
||||
if("power_toggle" in signal.data)
|
||||
if(signal.data["power_toggle"] != null)
|
||||
on = !on
|
||||
|
||||
if("panic_siphon" in signal.data) //must be before if("scrubbing" thing
|
||||
panic = text2num(signal.data["panic_siphon"])
|
||||
if(signal.data["panic_siphon"]) //must be before if("scrubbing" thing
|
||||
panic = text2num(signal.data["panic_siphon"] != null)
|
||||
if(panic)
|
||||
on = 1
|
||||
scrubbing = 0
|
||||
@@ -182,7 +187,7 @@
|
||||
else
|
||||
scrubbing = 1
|
||||
volume_rate = initial(volume_rate)
|
||||
if("toggle_panic_siphon" in signal.data)
|
||||
if(signal.data["toggle_panic_siphon"] != null)
|
||||
panic = !panic
|
||||
if(panic)
|
||||
on = 1
|
||||
@@ -192,38 +197,35 @@
|
||||
scrubbing = 1
|
||||
volume_rate = initial(volume_rate)
|
||||
|
||||
if("scrubbing" in signal.data)
|
||||
if(signal.data["scrubbing"] != null)
|
||||
scrubbing = text2num(signal.data["scrubbing"])
|
||||
if("toggle_scrubbing" in signal.data)
|
||||
if(signal.data["toggle_scrubbing"])
|
||||
scrubbing = !scrubbing
|
||||
|
||||
if("co2_scrub" in signal.data)
|
||||
if(signal.data["co2_scrub"] != null)
|
||||
scrub_CO2 = text2num(signal.data["co2_scrub"])
|
||||
if("toggle_co2_scrub" in signal.data)
|
||||
if(signal.data["toggle_co2_scrub"])
|
||||
scrub_CO2 = !scrub_CO2
|
||||
|
||||
if("tox_scrub" in signal.data)
|
||||
if(signal.data["tox_scrub"] != null)
|
||||
scrub_Toxins = text2num(signal.data["tox_scrub"])
|
||||
if("toggle_tox_scrub" in signal.data)
|
||||
if(signal.data["toggle_tox_scrub"])
|
||||
scrub_Toxins = !scrub_Toxins
|
||||
|
||||
if("n2o_scrub" in signal.data)
|
||||
if(signal.data["n2o_scrub"] != null)
|
||||
scrub_N2O = text2num(signal.data["n2o_scrub"])
|
||||
if("toggle_n2o_scrub" in signal.data)
|
||||
if(signal.data["toggle_n2o_scrub"])
|
||||
scrub_N2O = !scrub_N2O
|
||||
|
||||
if("init" in signal.data)
|
||||
if(signal.data["init"] != null)
|
||||
name = signal.data["init"]
|
||||
return
|
||||
|
||||
if("status" in signal.data)
|
||||
if(signal.data["status"] != null)
|
||||
spawn(2)
|
||||
broadcast_status()
|
||||
return //do not update_icon
|
||||
|
||||
if("setting" in signal.data)
|
||||
scrub_rate = text2num(signal.data["setting"])
|
||||
|
||||
// log_admin("DEBUG \[[world.timeofday]\]: vent_scrubber/receive_signal: unknown command \"[signal.data["command"]]\"\n[signal.debug_print()]")
|
||||
spawn(2)
|
||||
broadcast_status()
|
||||
@@ -231,7 +233,7 @@
|
||||
return
|
||||
|
||||
power_change()
|
||||
if(powered(ENVIRON))
|
||||
if(powered(power_channel))
|
||||
stat &= ~NOPOWER
|
||||
else
|
||||
stat |= NOPOWER
|
||||
@@ -261,4 +263,11 @@
|
||||
"\blue You have unfastened \the [src].", \
|
||||
"You hear ratchet.")
|
||||
new /obj/item/pipe(loc, make_from=src)
|
||||
del(src)
|
||||
del(src)
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/Del()
|
||||
if(initial_loc)
|
||||
initial_loc.air_scrub_info -= id_tag
|
||||
initial_loc.air_scrub_names -= id_tag
|
||||
..()
|
||||
return
|
||||
|
||||
@@ -4,9 +4,10 @@ obj/machinery/atmospherics/pipe
|
||||
var/datum/pipeline/parent
|
||||
|
||||
var/volume = 0
|
||||
var/force = 20
|
||||
force = 20
|
||||
|
||||
layer = 2.4 //under wires with their 2.44
|
||||
use_power = 0
|
||||
|
||||
var/alert_pressure = 80*ONE_ATMOSPHERE
|
||||
//minimum pressure before check_pressure(...) should be called
|
||||
|
||||
Reference in New Issue
Block a user