mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Merge remote-tracking branch 'remotes/git-svn' into bs12_with_tgport
Conflicts: code/ATMOSPHERICS/pipes.dm code/datums/organs/organ_external.dm code/game/gamemodes/changeling/modularchangling.dm code/game/gamemodes/events.dm code/game/gamemodes/events/ninja_equipment.dm code/game/hud.dm code/game/jobs/job/captain.dm code/game/machinery/atmoalter/area_atmos_computer.dm code/game/machinery/recharger.dm code/game/objects/hud.dm code/game/turfs/turf.dm code/modules/client/client defines.dm code/modules/clothing/head/misc.dm code/modules/clothing/spacesuits/rig.dm code/modules/clothing/under/miscellaneous.dm code/modules/mob/living/carbon/alien/humanoid/hud.dm code/modules/mob/living/carbon/human/hud.dm code/modules/mob/living/carbon/human/update_icons.dm code/modules/mob/living/carbon/monkey/hud.dm code/modules/mob/mob_cleanup.dm code/modules/mob/mob_defines.dm code/modules/mob/mob_helpers.dm code/modules/mob/mob_movement.dm code/modules/mob/screen.dm code/modules/paperwork/filingcabinet.dm code/modules/power/cable_heavyduty.dm code/modules/projectiles/guns/energy/temperature.dm code/setup.dm config/game_options.txt icons/mob/screen1_Midnight.dmi icons/mob/screen1_Orange.dmi icons/mob/screen1_alien.dmi icons/mob/screen1_old.dmi icons/obj/atmospherics/passive_gate.dmi icons/obj/pipe-item.dmi interface/interface.dm
This commit is contained in:
@@ -10,6 +10,10 @@ obj/machinery/atmospherics/binary/passive_gate
|
||||
var/on = 0
|
||||
var/target_pressure = ONE_ATMOSPHERE
|
||||
|
||||
var/frequency = 0
|
||||
var/id = null
|
||||
var/datum/radio_frequency/radio_connection
|
||||
|
||||
update_icon()
|
||||
if(node1&&node2)
|
||||
icon_state = "intact_[on?("on"):("off")]"
|
||||
@@ -52,4 +56,133 @@ obj/machinery/atmospherics/binary/passive_gate
|
||||
network1.update = 1
|
||||
|
||||
if(network2)
|
||||
network2.update = 1
|
||||
network2.update = 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,
|
||||
"device" = "AGP",
|
||||
"power" = on,
|
||||
"target_output" = target_pressure,
|
||||
"sigtype" = "status"
|
||||
)
|
||||
|
||||
radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA)
|
||||
|
||||
return 1
|
||||
|
||||
interact(mob/user as mob)
|
||||
var/dat = {"<b>Power: </b><a href='?src=\ref[src];power=1'>[on?"On":"Off"]</a><br>
|
||||
<b>Desirable output pressure: </b>
|
||||
[round(target_pressure,0.1)]kPa | <a href='?src=\ref[src];set_press=1'>Change</a>
|
||||
"}
|
||||
|
||||
user << browse("<HEAD><TITLE>[src.name] control</TITLE></HEAD><TT>[dat]</TT>", "window=atmo_pump")
|
||||
onclose(user, "atmo_pump")
|
||||
|
||||
initialize()
|
||||
..()
|
||||
if(frequency)
|
||||
set_frequency(frequency)
|
||||
|
||||
receive_signal(datum/signal/signal)
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id) || (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("set_output_pressure" in signal.data)
|
||||
target_pressure = between(
|
||||
0,
|
||||
text2num(signal.data["set_output_pressure"]),
|
||||
ONE_ATMOSPHERE*50
|
||||
)
|
||||
|
||||
if("status" in signal.data)
|
||||
spawn(2)
|
||||
broadcast_status()
|
||||
return //do not update_icon
|
||||
|
||||
spawn(2)
|
||||
broadcast_status()
|
||||
update_icon()
|
||||
return
|
||||
|
||||
|
||||
|
||||
attack_hand(user as mob)
|
||||
if(..())
|
||||
return
|
||||
src.add_fingerprint(usr)
|
||||
if(!src.allowed(user))
|
||||
user << "\red Access denied."
|
||||
return
|
||||
usr.machine = src
|
||||
interact(user)
|
||||
return
|
||||
|
||||
Topic(href,href_list)
|
||||
if(..()) return
|
||||
if(href_list["power"])
|
||||
on = !on
|
||||
if(href_list["set_press"])
|
||||
var/new_pressure = input(usr,"Enter new output pressure (0-4500kPa)","Pressure control",src.target_pressure) as num
|
||||
src.target_pressure = max(0, min(4500, new_pressure))
|
||||
usr.machine = src
|
||||
src.update_icon()
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
power_change()
|
||||
..()
|
||||
update_icon()
|
||||
|
||||
|
||||
|
||||
attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if (!istype(W, /obj/item/weapon/wrench))
|
||||
return ..()
|
||||
if (on)
|
||||
user << "\red You cannot unwrench this [src], turn it off first."
|
||||
return 1
|
||||
var/turf/T = src.loc
|
||||
if (level==1 && isturf(T) && T.intact)
|
||||
user << "\red You must remove the plating first."
|
||||
return 1
|
||||
var/datum/gas_mixture/int_air = return_air()
|
||||
var/datum/gas_mixture/env_air = loc.return_air()
|
||||
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
|
||||
user << "\red You cannot unwrench this [src], it too exerted due to internal pressure."
|
||||
add_fingerprint(user)
|
||||
return 1
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
user << "\blue You begin to unfasten \the [src]..."
|
||||
if (do_after(user, 40))
|
||||
user.visible_message( \
|
||||
"[user] unfastens \the [src].", \
|
||||
"\blue You have unfastened \the [src].", \
|
||||
"You hear ratchet.")
|
||||
new /obj/item/pipe(loc, make_from=src)
|
||||
del(src)
|
||||
|
||||
|
||||
@@ -26,11 +26,9 @@ obj/machinery/atmospherics/binary/pump
|
||||
var/id = null
|
||||
var/datum/radio_frequency/radio_connection
|
||||
|
||||
/*
|
||||
attack_hand(mob/user)
|
||||
on = !on
|
||||
update_icon()
|
||||
*/
|
||||
on
|
||||
on = 1
|
||||
icon_state = "intact_on"
|
||||
|
||||
update_icon()
|
||||
if(node1&&node2)
|
||||
|
||||
@@ -16,8 +16,8 @@ obj/machinery/atmospherics/binary/volume_pump
|
||||
icon = 'icons/obj/atmospherics/volume_pump.dmi'
|
||||
icon_state = "intact_off"
|
||||
|
||||
name = "Gas pump"
|
||||
desc = "A pump"
|
||||
name = "Volumetric gas pump"
|
||||
desc = "A volumetric pump"
|
||||
|
||||
var/on = 0
|
||||
var/transfer_rate = 200
|
||||
@@ -26,6 +26,10 @@ obj/machinery/atmospherics/binary/volume_pump
|
||||
var/id = null
|
||||
var/datum/radio_frequency/radio_connection
|
||||
|
||||
on
|
||||
on = 1
|
||||
icon_state = "intact_on"
|
||||
|
||||
update_icon()
|
||||
if(node1&&node2)
|
||||
icon_state = "intact_[on?("on"):("off")]"
|
||||
@@ -36,15 +40,23 @@ obj/machinery/atmospherics/binary/volume_pump
|
||||
icon_state = "exposed_2_off"
|
||||
else
|
||||
icon_state = "exposed_3_off"
|
||||
on = 0
|
||||
|
||||
return
|
||||
|
||||
process()
|
||||
// ..()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
if(!on)
|
||||
return 0
|
||||
|
||||
// Pump mechanism just won't do anything if the pressure is too high/too low
|
||||
|
||||
var/input_starting_pressure = air1.return_pressure()
|
||||
var/output_starting_pressure = air2.return_pressure()
|
||||
|
||||
if((input_starting_pressure < 0.01) || (output_starting_pressure > 9000))
|
||||
return 1
|
||||
|
||||
var/transfer_ratio = max(1, transfer_rate/air1.volume)
|
||||
|
||||
var/datum/gas_mixture/removed = air1.remove_ratio(transfer_ratio)
|
||||
@@ -85,6 +97,17 @@ obj/machinery/atmospherics/binary/volume_pump
|
||||
|
||||
return 1
|
||||
|
||||
interact(mob/user as mob)
|
||||
var/dat = {"<b>Power: </b><a href='?src=\ref[src];power=1'>[on?"On":"Off"]</a><br>
|
||||
<b>Desirable output flow: </b>
|
||||
[round(transfer_rate,1)]l/s | <a href='?src=\ref[src];set_transfer_rate=1'>Change</a>
|
||||
"}
|
||||
|
||||
user << browse("<HEAD><TITLE>[src.name] control</TITLE></HEAD><TT>[dat]</TT>", "window=atmo_pump")
|
||||
onclose(user, "atmo_pump")
|
||||
|
||||
|
||||
|
||||
initialize()
|
||||
..()
|
||||
|
||||
@@ -114,4 +137,61 @@ obj/machinery/atmospherics/binary/volume_pump
|
||||
|
||||
spawn(2)
|
||||
broadcast_status()
|
||||
update_icon()
|
||||
update_icon()
|
||||
|
||||
|
||||
attack_hand(user as mob)
|
||||
if(..())
|
||||
return
|
||||
src.add_fingerprint(usr)
|
||||
if(!src.allowed(user))
|
||||
user << "\red Access denied."
|
||||
return
|
||||
usr.machine = src
|
||||
interact(user)
|
||||
return
|
||||
|
||||
Topic(href,href_list)
|
||||
if(..()) return
|
||||
if(href_list["power"])
|
||||
on = !on
|
||||
if(href_list["set_transfer_rate"])
|
||||
var/new_transfer_rate = input(usr,"Enter new output volume (0-200l/s)","Flow control",src.transfer_rate) as num
|
||||
src.transfer_rate = max(0, min(200, new_transfer_rate))
|
||||
usr.machine = src
|
||||
src.update_icon()
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
power_change()
|
||||
..()
|
||||
update_icon()
|
||||
|
||||
|
||||
|
||||
attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
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
|
||||
var/turf/T = src.loc
|
||||
if (level==1 && isturf(T) && T.intact)
|
||||
user << "\red You must remove the plating first."
|
||||
return 1
|
||||
var/datum/gas_mixture/int_air = return_air()
|
||||
var/datum/gas_mixture/env_air = loc.return_air()
|
||||
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
|
||||
user << "\red You cannot unwrench this [src], it too exerted due to internal pressure."
|
||||
add_fingerprint(user)
|
||||
return 1
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
user << "\blue You begin to unfasten \the [src]..."
|
||||
if (do_after(user, 40))
|
||||
user.visible_message( \
|
||||
"[user] unfastens \the [src].", \
|
||||
"\blue You have unfastened \the [src].", \
|
||||
"You hear ratchet.")
|
||||
new /obj/item/pipe(loc, make_from=src)
|
||||
del(src)
|
||||
|
||||
|
||||
@@ -63,4 +63,27 @@
|
||||
if(abs(other_old_temperature-partner.air_contents.temperature) > 1)
|
||||
partner.network.update = 1
|
||||
|
||||
return 1
|
||||
return 1
|
||||
|
||||
attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if (!istype(W, /obj/item/weapon/wrench))
|
||||
return ..()
|
||||
var/turf/T = src.loc
|
||||
if (level==1 && isturf(T) && T.intact)
|
||||
user << "\red You must remove the plating first."
|
||||
return 1
|
||||
var/datum/gas_mixture/int_air = return_air()
|
||||
var/datum/gas_mixture/env_air = loc.return_air()
|
||||
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
|
||||
user << "\red You cannot unwrench this [src], it too exerted due to internal pressure."
|
||||
add_fingerprint(user)
|
||||
return 1
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
user << "\blue You begin to unfasten \the [src]..."
|
||||
if (do_after(user, 40))
|
||||
user.visible_message( \
|
||||
"[user] unfastens \the [src].", \
|
||||
"\blue You have unfastened \the [src].", \
|
||||
"You hear ratchet.")
|
||||
new /obj/item/pipe(loc, make_from=src)
|
||||
del(src)
|
||||
@@ -8,7 +8,6 @@
|
||||
level = 1
|
||||
var/area_uid
|
||||
var/id_tag = null
|
||||
power_channel = ENVIRON
|
||||
|
||||
var/on = 0
|
||||
var/pump_direction = 1 //0 = siphoning, 1 = releasing
|
||||
@@ -29,6 +28,18 @@
|
||||
var/radio_filter_out
|
||||
var/radio_filter_in
|
||||
|
||||
on
|
||||
on = 1
|
||||
icon_state = "out"
|
||||
|
||||
siphon
|
||||
pump_direction = 0
|
||||
icon_state = "off"
|
||||
|
||||
on
|
||||
on = 1
|
||||
icon_state = "in"
|
||||
|
||||
New()
|
||||
var/area/A = get_area(loc)
|
||||
if (A.master)
|
||||
|
||||
@@ -226,7 +226,7 @@
|
||||
return
|
||||
|
||||
power_change()
|
||||
if(powered(ENVIRON))
|
||||
if(powered(power_channel))
|
||||
stat &= ~NOPOWER
|
||||
else
|
||||
stat |= NOPOWER
|
||||
|
||||
@@ -17,6 +17,10 @@ obj/machinery/atmospherics/valve
|
||||
var/datum/pipe_network/network_node1
|
||||
var/datum/pipe_network/network_node2
|
||||
|
||||
open
|
||||
open = 1
|
||||
icon_state = "valve1"
|
||||
|
||||
update_icon(animation)
|
||||
if(animation)
|
||||
flick("valve[src.open][!src.open]",src)
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user