mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-12 07:33:34 +01:00
Ghost interaction with atmos machinery
This commit is contained in:
@@ -88,7 +88,7 @@
|
||||
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/binary/passive_gate/interact(mob/user as mob)
|
||||
/obj/machinery/atmospherics/binary/passive_gate/interact(mob/user)
|
||||
var/dat = {"<b>Power: </b><a href='?src=[UID()];power=1'>[on?"On":"Off"]</a><br>
|
||||
<b>Desirable output pressure: </b>
|
||||
[round(target_pressure,0.1)]kPa | <a href='?src=[UID()];set_press=1'>Change</a>
|
||||
@@ -131,32 +131,37 @@
|
||||
update_icon()
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/binary/passive_gate/attack_hand(user as mob)
|
||||
/obj/machinery/atmospherics/binary/passive_gate/attack_hand(mob/user)
|
||||
if(..())
|
||||
return
|
||||
src.add_fingerprint(usr)
|
||||
if(!src.allowed(user))
|
||||
add_fingerprint(user)
|
||||
if(!allowed(user))
|
||||
to_chat(user, "<span class='alert'>Access denied.</span>")
|
||||
return
|
||||
usr.set_machine(src)
|
||||
user.set_machine(src)
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/atmospherics/binary/passive_gate/attack_ghost(mob/user)
|
||||
add_fingerprint(user)
|
||||
user.set_machine(src)
|
||||
interact(user)
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/binary/passive_gate/Topic(href,href_list)
|
||||
if(..()) return
|
||||
if(..())
|
||||
return 1
|
||||
if(href_list["power"])
|
||||
on = !on
|
||||
investigate_log("was turned [on ? "on" : "off"] by [key_name(usr)]", "atmos")
|
||||
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))
|
||||
var/new_pressure = input(usr,"Enter new output pressure (0-4500kPa)","Pressure control",target_pressure) as num
|
||||
target_pressure = max(0, min(4500, new_pressure))
|
||||
investigate_log("was set to [target_pressure] kPa by [key_name(usr)]", "atmos")
|
||||
usr.set_machine(src)
|
||||
src.update_icon()
|
||||
src.updateUsrDialog()
|
||||
update_icon()
|
||||
updateUsrDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/binary/passive_gate/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob, params)
|
||||
/obj/machinery/atmospherics/binary/passive_gate/attackby(var/obj/item/weapon/W, var/mob/user, params)
|
||||
if(!istype(W, /obj/item/weapon/wrench))
|
||||
return ..()
|
||||
if(on)
|
||||
|
||||
@@ -103,7 +103,7 @@ Thus, the two variables affect pump operation are set in New():
|
||||
radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA)
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/interact(mob/user as mob)
|
||||
/obj/machinery/atmospherics/binary/pump/interact(mob/user)
|
||||
var/dat = {"<b>Power: </b><a href='?src=[UID()];power=1'>[on?"On":"Off"]</a><br>
|
||||
<b>Desirable output pressure: </b>
|
||||
[round(target_pressure,0.1)]kPa | <a href='?src=[UID()];set_press=1'>Change</a>
|
||||
@@ -151,16 +151,20 @@ Thus, the two variables affect pump operation are set in New():
|
||||
update_icon()
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/attack_hand(user as mob)
|
||||
/obj/machinery/atmospherics/binary/pump/attack_hand(mob/user)
|
||||
if(..())
|
||||
return
|
||||
src.add_fingerprint(usr)
|
||||
if(!src.allowed(user))
|
||||
add_fingerprint(user)
|
||||
if(!allowed(user))
|
||||
to_chat(user, "<span class='alert'>Access denied.</span>")
|
||||
return
|
||||
usr.set_machine(src)
|
||||
user.set_machine(src)
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/attack_ghost(mob/user)
|
||||
add_fingerprint(user)
|
||||
user.set_machine(src)
|
||||
interact(user)
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/Topic(href,href_list)
|
||||
if(..())
|
||||
@@ -169,13 +173,12 @@ Thus, the two variables affect pump operation are set in New():
|
||||
on = !on
|
||||
investigate_log("was turned [on ? "on" : "off"] by [key_name(usr)]", "atmos")
|
||||
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))
|
||||
var/new_pressure = input(usr,"Enter new output pressure (0-4500kPa)","Pressure control",target_pressure) as num
|
||||
target_pressure = max(0, min(4500, new_pressure))
|
||||
investigate_log("was set to [target_pressure] kPa by [key_name(usr)]", "atmos")
|
||||
usr.set_machine(src)
|
||||
src.update_icon()
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
update_icon()
|
||||
updateUsrDialog()
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/power_change()
|
||||
var/old_stat = stat
|
||||
@@ -183,7 +186,7 @@ Thus, the two variables affect pump operation are set in New():
|
||||
if(old_stat != stat)
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob, params)
|
||||
/obj/machinery/atmospherics/binary/pump/attackby(var/obj/item/weapon/W, var/mob/user, params)
|
||||
if(!istype(W, /obj/item/weapon/wrench))
|
||||
return ..()
|
||||
if(!(stat & NOPOWER) && on)
|
||||
|
||||
@@ -45,17 +45,21 @@
|
||||
investigate_log("was closed by [usr ? key_name(usr) : "a remote signal"]", "atmos")
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/binary/valve/attack_ai(mob/user as mob)
|
||||
/obj/machinery/atmospherics/binary/valve/attack_ai(mob/user)
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/binary/valve/attack_ghost(mob/user)
|
||||
if(user.can_advanced_admin_interact())
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/atmospherics/binary/valve/attack_hand(mob/user as mob)
|
||||
/obj/machinery/atmospherics/binary/valve/attack_hand(mob/user)
|
||||
add_fingerprint(usr)
|
||||
update_icon(1)
|
||||
sleep(10)
|
||||
if(open)
|
||||
close()
|
||||
return
|
||||
open()
|
||||
else
|
||||
open()
|
||||
|
||||
/obj/machinery/atmospherics/binary/valve/digital // can be controlled by AI
|
||||
name = "digital valve"
|
||||
@@ -67,13 +71,13 @@
|
||||
var/datum/radio_frequency/radio_connection
|
||||
settagwhitelist = list("id_tag")
|
||||
|
||||
/obj/machinery/atmospherics/binary/valve/digital/attack_ai(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
/obj/machinery/atmospherics/binary/valve/digital/attack_ai(mob/user)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/atmospherics/binary/valve/digital/attack_hand(mob/user as mob)
|
||||
/obj/machinery/atmospherics/binary/valve/digital/attack_hand(mob/user)
|
||||
if(!powered())
|
||||
return
|
||||
if(!src.allowed(user))
|
||||
if(!allowed(user) && !user.can_advanced_admin_interact())
|
||||
to_chat(user, "<span class='alert'>Access denied.</span>")
|
||||
return
|
||||
..()
|
||||
@@ -130,7 +134,7 @@
|
||||
if(open)
|
||||
close()
|
||||
|
||||
/obj/machinery/atmospherics/binary/valve/digital/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
/obj/machinery/atmospherics/binary/valve/digital/attackby(var/obj/item/weapon/W as obj, var/mob/user)
|
||||
if(istype(W, /obj/item/device/multitool))
|
||||
update_multitool_menu(user)
|
||||
return 1
|
||||
|
||||
@@ -99,7 +99,7 @@ Thus, the two variables affect pump operation are set in New():
|
||||
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/binary/volume_pump/interact(mob/user as mob)
|
||||
/obj/machinery/atmospherics/binary/volume_pump/interact(mob/user)
|
||||
var/dat = {"<b>Power: </b><a href='?src=[UID()];power=1'>[on?"On":"Off"]</a><br>
|
||||
<b>Desirable output flow: </b>
|
||||
[round(transfer_rate,1)]l/s | <a href='?src=[UID()];set_transfer_rate=1'>Change</a>
|
||||
@@ -142,16 +142,20 @@ Thus, the two variables affect pump operation are set in New():
|
||||
broadcast_status()
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/binary/volume_pump/attack_hand(user as mob)
|
||||
/obj/machinery/atmospherics/binary/volume_pump/attack_hand(mob/user)
|
||||
if(..())
|
||||
return
|
||||
src.add_fingerprint(usr)
|
||||
if(!src.allowed(user))
|
||||
add_fingerprint(user)
|
||||
if(!allowed(user) && !user.can_admin_interact())
|
||||
to_chat(user, "<span class='alert'>Access denied.</span>")
|
||||
return
|
||||
usr.set_machine(src)
|
||||
user.set_machine(src)
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/atmospherics/binary/volume_pump/attack_ghost(mob/user)
|
||||
add_fingerprint(user)
|
||||
user.set_machine(src)
|
||||
interact(user)
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/binary/volume_pump/Topic(href,href_list)
|
||||
if(..())
|
||||
@@ -160,13 +164,12 @@ Thus, the two variables affect pump operation are set in New():
|
||||
on = !on
|
||||
investigate_log("was turned [on ? "on" : "off"] by [key_name(usr)]", "atmos")
|
||||
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))
|
||||
var/new_transfer_rate = input(usr,"Enter new output volume (0-200l/s)","Flow control",transfer_rate) as num
|
||||
transfer_rate = max(0, min(200, new_transfer_rate))
|
||||
investigate_log("was set to [transfer_rate] L/s by [key_name(usr)]", "atmos")
|
||||
usr.set_machine(src)
|
||||
src.update_icon()
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
update_icon()
|
||||
updateUsrDialog()
|
||||
|
||||
/obj/machinery/atmospherics/binary/volume_pump/power_change()
|
||||
var/old_stat = stat
|
||||
@@ -174,7 +177,7 @@ Thus, the two variables affect pump operation are set in New():
|
||||
if(old_stat != stat)
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/binary/volume_pump/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob, params)
|
||||
/obj/machinery/atmospherics/binary/volume_pump/attackby(var/obj/item/weapon/W, var/mob/user, params)
|
||||
if(!istype(W, /obj/item/weapon/wrench))
|
||||
return ..()
|
||||
if(!(stat & NOPOWER) && on)
|
||||
|
||||
@@ -107,7 +107,7 @@
|
||||
to_chat(user, "<span class='danger'>You cannot unwrench [src], it is too exerted due to internal pressure.</span>")
|
||||
add_fingerprint(user)
|
||||
return 1
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
playsound(loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
to_chat(user, "<span class='notice'>You begin to unfasten \the [src]...</span>")
|
||||
if(do_after(user, 40, target = src))
|
||||
user.visible_message( \
|
||||
@@ -119,14 +119,17 @@
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/omni/attack_hand(user as mob)
|
||||
/obj/machinery/atmospherics/omni/attack_hand(mob/user)
|
||||
if(..())
|
||||
return
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
add_fingerprint(usr)
|
||||
ui_interact(user)
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/omni/attack_ghost(mob/user)
|
||||
add_fingerprint(usr)
|
||||
ui_interact(user)
|
||||
|
||||
/obj/machinery/atmospherics/omni/proc/build_icons()
|
||||
if(!check_icon_cache())
|
||||
return
|
||||
|
||||
@@ -146,15 +146,25 @@ Filter types:
|
||||
/obj/machinery/atmospherics/trinary/filter/initialize()
|
||||
set_frequency(frequency)
|
||||
..()
|
||||
|
||||
/obj/machinery/atmospherics/trinary/filter/attack_ghost(mob/user)
|
||||
add_fingerprint(user)
|
||||
user.set_machine(src)
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/atmospherics/trinary/filter/attack_hand(user as mob) // -- TLE
|
||||
/obj/machinery/atmospherics/trinary/filter/attack_hand(mob/user)
|
||||
if(..())
|
||||
return
|
||||
|
||||
if(!src.allowed(user))
|
||||
add_fingerprint(user)
|
||||
if(!allowed(user) && !user.can_admin_interact())
|
||||
to_chat(user, "<span class='alert'>Access denied.</span>")
|
||||
return
|
||||
|
||||
|
||||
user.set_machine(src)
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/atmospherics/trinary/filter/interact(mob/user)
|
||||
var/dat
|
||||
var/current_filter_type
|
||||
switch(filter_type)
|
||||
@@ -184,34 +194,27 @@ Filter types:
|
||||
<A href='?src=[UID()];filterset=4'>Nitrous Oxide</A><BR>
|
||||
<A href='?src=[UID()];filterset=-1'>Nothing</A><BR>
|
||||
<HR><B>Desirable output pressure:</B>
|
||||
[src.target_pressure]kPa | <a href='?src=[UID()];set_press=1'>Change</a>
|
||||
[target_pressure]kPa | <a href='?src=[UID()];set_press=1'>Change</a>
|
||||
"}
|
||||
|
||||
var/datum/browser/popup = new(user, "atmo_filter", name, 400, 400)
|
||||
popup.set_content(dat)
|
||||
popup.open(0)
|
||||
onclose(user, "atmo_filter")
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/trinary/filter/Topic(href, href_list) // -- TLE
|
||||
if(..())
|
||||
return 1
|
||||
usr.set_machine(src)
|
||||
src.add_fingerprint(usr)
|
||||
add_fingerprint(usr)
|
||||
if(href_list["filterset"])
|
||||
src.filter_type = text2num(href_list["filterset"])
|
||||
filter_type = text2num(href_list["filterset"])
|
||||
if(href_list["temp"])
|
||||
src.temp = null
|
||||
temp = null
|
||||
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))
|
||||
var/new_pressure = input(usr,"Enter new output pressure (0-4500kPa)","Pressure control",target_pressure) as num
|
||||
target_pressure = max(0, min(4500, new_pressure))
|
||||
if(href_list["power"])
|
||||
on=!on
|
||||
src.update_icon()
|
||||
src.updateUsrDialog()
|
||||
/*
|
||||
for(var/mob/M in viewers(1, src))
|
||||
if((M.client && M.machine == src))
|
||||
src.attack_hand(M)
|
||||
*/
|
||||
return
|
||||
update_icon()
|
||||
updateUsrDialog()
|
||||
@@ -107,14 +107,25 @@
|
||||
parent3.update = 1
|
||||
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/trinary/mixer/attack_ghost(mob/user)
|
||||
add_fingerprint(user)
|
||||
user.set_machine(src)
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/atmospherics/trinary/mixer/attack_hand(user as mob)
|
||||
/obj/machinery/atmospherics/trinary/mixer/attack_hand(mob/user)
|
||||
if(..())
|
||||
return
|
||||
src.add_fingerprint(usr)
|
||||
if(!src.allowed(user))
|
||||
|
||||
add_fingerprint(user)
|
||||
if(!allowed(user) && !user.can_admin_interact())
|
||||
to_chat(user, "<span class='alert'>Access denied.</span>")
|
||||
return
|
||||
|
||||
user.set_machine(src)
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/atmospherics/trinary/mixer/interact(mob/user)
|
||||
usr.set_machine(src)
|
||||
var/dat = {"<b>Power: </b><a href='?src=[UID()];power=1'>[on?"On":"Off"]</a><br>
|
||||
<b>Desirable output pressure: </b>
|
||||
@@ -139,7 +150,6 @@
|
||||
popup.set_content(dat)
|
||||
popup.open(0)
|
||||
onclose(user, "atmo_mixer")
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/trinary/mixer/Topic(href,href_list)
|
||||
if(..())
|
||||
@@ -147,16 +157,16 @@
|
||||
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))
|
||||
var/new_pressure = input(usr,"Enter new output pressure (0-4500kPa)","Pressure control",target_pressure) as num
|
||||
target_pressure = max(0, min(4500, new_pressure))
|
||||
if(href_list["node1_c"])
|
||||
var/value = text2num(href_list["node1_c"])
|
||||
src.node1_concentration = max(0, min(1, src.node1_concentration + value))
|
||||
src.node2_concentration = max(0, min(1, src.node2_concentration - value))
|
||||
node1_concentration = max(0, min(1, node1_concentration + value))
|
||||
node2_concentration = max(0, min(1, node2_concentration - value))
|
||||
if(href_list["node2_c"])
|
||||
var/value = text2num(href_list["node2_c"])
|
||||
src.node2_concentration = max(0, min(1, src.node2_concentration + value))
|
||||
src.node1_concentration = max(0, min(1, src.node1_concentration - value))
|
||||
src.update_icon()
|
||||
src.updateUsrDialog()
|
||||
node2_concentration = max(0, min(1, node2_concentration + value))
|
||||
node1_concentration = max(0, min(1, node1_concentration - value))
|
||||
update_icon()
|
||||
updateUsrDialog()
|
||||
return
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
if(flipped)
|
||||
flipstate = "m"
|
||||
if(animation)
|
||||
flick("tvalve[flipstate][src.state][!src.state]",src)
|
||||
flick("tvalve[flipstate][state][!state]",src)
|
||||
else
|
||||
icon_state = "tvalve[flipstate][state]"
|
||||
|
||||
@@ -52,9 +52,9 @@
|
||||
|
||||
/obj/machinery/atmospherics/trinary/tvalve/proc/switch_side()
|
||||
if(state == TVALVE_STATE_STRAIGHT)
|
||||
src.go_to_side()
|
||||
go_to_side()
|
||||
else
|
||||
src.go_straight()
|
||||
go_straight()
|
||||
|
||||
/obj/machinery/atmospherics/trinary/tvalve/proc/go_to_side()
|
||||
if(state == TVALVE_STATE_SIDE)
|
||||
@@ -86,10 +86,14 @@
|
||||
investigate_log("was set to straight by [usr ? key_name(usr) : "a remote signal"]", "atmos")
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/trinary/tvalve/attack_ai(mob/user as mob)
|
||||
/obj/machinery/atmospherics/trinary/tvalve/attack_ai(mob/user)
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/trinary/tvalve/attack_ghost(mob/user)
|
||||
if(user.can_advanced_admin_interact())
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/atmospherics/trinary/tvalve/attack_hand(mob/user as mob)
|
||||
/obj/machinery/atmospherics/trinary/tvalve/attack_hand(mob/usermob)
|
||||
add_fingerprint(usr)
|
||||
update_icon(1)
|
||||
sleep(10)
|
||||
@@ -128,13 +132,13 @@
|
||||
if(!powered())
|
||||
icon_state = "tvalvenopower"
|
||||
|
||||
/obj/machinery/atmospherics/trinary/tvalve/digital/attack_ai(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
/obj/machinery/atmospherics/trinary/tvalve/digital/attack_ai(mob/user)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/atmospherics/trinary/tvalve/digital/attack_hand(mob/user as mob)
|
||||
/obj/machinery/atmospherics/trinary/tvalve/digital/attack_hand(mob/user)
|
||||
if(!powered())
|
||||
return
|
||||
if(!src.allowed(user))
|
||||
if(!allowed(user) && !user.can_admin_interact())
|
||||
to_chat(user, "<span class='alert'>Access denied.</span>")
|
||||
return
|
||||
..()
|
||||
|
||||
Reference in New Issue
Block a user