mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2025-12-22 08:01:06 +00:00
Bayport - welded scrubbers (#1160)
Port is credit to Zuhayr changes: rscadd: "Bayport: Scrubbers are now weldable." bugfix: "Fixed incorrect messages when welding vents."
This commit is contained in:
@@ -90,4 +90,14 @@
|
||||
update_icon()
|
||||
update_underlays()
|
||||
|
||||
return null
|
||||
return null
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_pump/proc/is_welded() // TODO: refactor welding into unary
|
||||
if (welded > 0)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/proc/is_welded()
|
||||
if (welded > 0)
|
||||
return 1
|
||||
return 0
|
||||
@@ -351,32 +351,29 @@
|
||||
/obj/machinery/atmospherics/unary/vent_pump/attackby(obj/item/W, mob/user)
|
||||
if(istype(W, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
if (WT.remove_fuel(0,user))
|
||||
if (!WT.welding)
|
||||
user << "<span class='danger'>\The [WT] must be turned on!</span>"
|
||||
else if (WT.remove_fuel(0,user))
|
||||
user << "<span class='notice'>Now welding the vent.</span>"
|
||||
if(do_after(user, 20))
|
||||
if(!src || !WT.isOn()) return
|
||||
playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1)
|
||||
if(!welded)
|
||||
user.visible_message("<span class='notice'>\The [user] welds the vent shut.</span>", "<span class='notice'>You weld the vent shut.</span>", "You hear welding.")
|
||||
user.visible_message("<span class='danger'>\The [user] welds \the [src] shut.</span>", "<span class='notice'>You weld \the [src] shut.</span>", "You hear welding.")
|
||||
welded = 1
|
||||
update_icon()
|
||||
else
|
||||
user.visible_message("<span class='notice'>[user] unwelds the vent.</span>", "<span class='notice'>You unweld the vent.</span>", "You hear welding.")
|
||||
user.visible_message("<span class='danger'>[user] unwelds \the [src].</span>", "<span class='notice'>You unweld \the [src].</span>", "You hear welding.")
|
||||
welded = 0
|
||||
update_icon()
|
||||
else
|
||||
user << "<span class='notice'>The welding tool needs to be on to start this task.</span>"
|
||||
user << "<span class='notice'>You fail to complete the welding.</span>"
|
||||
else
|
||||
user << "<span class='warning'>You need more welding fuel to complete this task.</span>"
|
||||
return 1
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_pump/proc/is_welded()
|
||||
if (welded > 0)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_pump/examine(mob/user)
|
||||
if(..(user, 1))
|
||||
user << "A small gauge in the corner reads [round(last_flow_rate, 0.1)] L/s; [round(last_power_draw)] W"
|
||||
|
||||
@@ -27,6 +27,8 @@
|
||||
var/radio_filter_out
|
||||
var/radio_filter_in
|
||||
|
||||
var/welded = 0
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/on
|
||||
use_power = 1
|
||||
icon_state = "map_scrubber_on"
|
||||
@@ -53,16 +55,18 @@
|
||||
|
||||
overlays.Cut()
|
||||
|
||||
var/scrubber_icon = "scrubber"
|
||||
|
||||
var/turf/T = get_turf(src)
|
||||
if(!istype(T))
|
||||
return
|
||||
|
||||
if(!powered())
|
||||
scrubber_icon += "off"
|
||||
var/scrubber_icon = "scrubber"
|
||||
if(welded)
|
||||
scrubber_icon += "weld"
|
||||
else
|
||||
scrubber_icon += "[use_power ? "[scrubbing ? "on" : "in"]" : "off"]"
|
||||
if(!powered())
|
||||
scrubber_icon += "off"
|
||||
else
|
||||
scrubber_icon += "[use_power ? "[scrubbing ? "on" : "in"]" : "off"]"
|
||||
|
||||
overlays += icon_manager.get_atmos_icon("device", , , scrubber_icon)
|
||||
|
||||
@@ -135,6 +139,8 @@
|
||||
//broadcast_status()
|
||||
if(!use_power || (stat & (NOPOWER|BROKEN)))
|
||||
return 0
|
||||
if(welded)
|
||||
return 0
|
||||
|
||||
var/datum/gas_mixture/environment = loc.return_air()
|
||||
|
||||
@@ -253,36 +259,62 @@
|
||||
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/weapon/wrench))
|
||||
return ..()
|
||||
if (!(stat & NOPOWER) && use_power)
|
||||
user << "<span class='warning'>You cannot unwrench \the [src], turn it off first.</span>"
|
||||
if (istype(W, /obj/item/weapon/wrench))
|
||||
if (!(stat & NOPOWER) && use_power)
|
||||
user << "<span class='warning'>You cannot unwrench \the [src], turn it off first.</span>"
|
||||
return 1
|
||||
var/turf/T = src.loc
|
||||
if (node && node.level==1 && isturf(T) && !T.is_plating())
|
||||
user << "<span class='warning'>You must remove the plating first.</span>"
|
||||
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 << "<span class='warning'>You cannot unwrench \the [src], it is too exerted due to internal pressure.</span>"
|
||||
add_fingerprint(user)
|
||||
return 1
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
user << "<span class='notice'>You begin to unfasten \the [src]...</span>"
|
||||
if (do_after(user, 40))
|
||||
user.visible_message( \
|
||||
"<span class='notice'>\The [user] unfastens \the [src].</span>", \
|
||||
"<span class='notice'>You have unfastened \the [src].</span>", \
|
||||
"You hear a ratchet.")
|
||||
new /obj/item/pipe(loc, make_from=src)
|
||||
qdel(src)
|
||||
return 1
|
||||
var/turf/T = src.loc
|
||||
if (node && node.level==1 && isturf(T) && !T.is_plating())
|
||||
user << "<span class='warning'>You must remove the plating first.</span>"
|
||||
|
||||
if(istype(W, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
if (!WT.welding)
|
||||
user << "<span class='danger'>\The [WT] must be turned on!</span>"
|
||||
else if (WT.remove_fuel(0,user))
|
||||
user << "<span class='notice'>Now welding \the [src].</span>"
|
||||
if(do_after(user, 20))
|
||||
if(!src || !WT.isOn()) return
|
||||
playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1)
|
||||
if(!welded)
|
||||
user.visible_message("<span class='danger'>\The [user] welds \the [src] shut.</span>", "<span class='notice'>You weld \the [src] shut.</span>", "You hear welding.")
|
||||
welded = 1
|
||||
update_icon()
|
||||
else
|
||||
user.visible_message("<span class='danger'>[user] unwelds \the [src].</span>", "<span class='notice'>You unweld \the [src].</span>", "You hear welding.")
|
||||
welded = 0
|
||||
update_icon()
|
||||
else
|
||||
user << "<span class='notice'>You fail to complete the welding.</span>"
|
||||
else
|
||||
user << "<span class='warning'>You need more welding fuel to complete this task.</span>"
|
||||
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 << "<span class='warning'>You cannot unwrench \the [src], it is too exerted due to internal pressure.</span>"
|
||||
add_fingerprint(user)
|
||||
return 1
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
user << "<span class='notice'>You begin to unfasten \the [src]...</span>"
|
||||
if (do_after(user, 40))
|
||||
user.visible_message( \
|
||||
"<span class='notice'>\The [user] unfastens \the [src].</span>", \
|
||||
"<span class='notice'>You have unfastened \the [src].</span>", \
|
||||
"You hear a ratchet.")
|
||||
new /obj/item/pipe(loc, make_from=src)
|
||||
qdel(src)
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/examine(mob/user)
|
||||
if(..(user, 1))
|
||||
user << "A small gauge in the corner reads [round(last_flow_rate, 0.1)] L/s; [round(last_power_draw)] W"
|
||||
else
|
||||
user << "You are too far away to read the gauge."
|
||||
if(welded)
|
||||
user << "It seems welded shut."
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/Destroy()
|
||||
if(initial_loc)
|
||||
|
||||
@@ -4,7 +4,7 @@ var/list/ventcrawl_machinery = list(
|
||||
)
|
||||
|
||||
// Vent crawling whitelisted items, whoo
|
||||
/mob/living/var/list/can_enter_vent_with = list(
|
||||
var/global/list/can_enter_vent_with = list(
|
||||
/obj/item/device/mmi,
|
||||
/obj/item/weapon/implant,
|
||||
/obj/item/device/radio/borg,
|
||||
@@ -154,7 +154,7 @@ var/list/ventcrawl_machinery = list(
|
||||
if(vent_found)
|
||||
break
|
||||
|
||||
if(istype(vent_found, /obj/machinery/atmospherics/unary/vent_pump/) && vent_found:is_welded()) // welded check
|
||||
if(vent_found:is_welded()) // welded check
|
||||
src << "<span class='warning'>You can't crawl into a welded vent!</span>"
|
||||
return
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
/obj/machinery/atmospherics/proc/ventcrawl_to(var/mob/living/user, var/obj/machinery/atmospherics/target_move, var/direction)
|
||||
if(target_move)
|
||||
if(is_type_in_list(target_move, ventcrawl_machinery) && target_move.can_crawl_through())
|
||||
if(istype(target_move, /obj/machinery/atmospherics/unary/vent_pump/) && target_move:is_welded())
|
||||
if(target_move:is_welded())
|
||||
user.visible_message("<span class='warning'>You hear something banging on \the [target_move.name]!</span>", "<span class='notice'>You can't escape from a welded vent.</span>")
|
||||
else
|
||||
user.remove_ventcrawl()
|
||||
|
||||
Reference in New Issue
Block a user