mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2025-12-22 16:12:19 +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:
@@ -91,3 +91,13 @@
|
|||||||
update_underlays()
|
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)
|
/obj/machinery/atmospherics/unary/vent_pump/attackby(obj/item/W, mob/user)
|
||||||
if(istype(W, /obj/item/weapon/weldingtool))
|
if(istype(W, /obj/item/weapon/weldingtool))
|
||||||
var/obj/item/weapon/weldingtool/WT = W
|
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>"
|
user << "<span class='notice'>Now welding the vent.</span>"
|
||||||
if(do_after(user, 20))
|
if(do_after(user, 20))
|
||||||
if(!src || !WT.isOn()) return
|
if(!src || !WT.isOn()) return
|
||||||
playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1)
|
playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1)
|
||||||
if(!welded)
|
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
|
welded = 1
|
||||||
update_icon()
|
update_icon()
|
||||||
else
|
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
|
welded = 0
|
||||||
update_icon()
|
update_icon()
|
||||||
else
|
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
|
else
|
||||||
user << "<span class='warning'>You need more welding fuel to complete this task.</span>"
|
user << "<span class='warning'>You need more welding fuel to complete this task.</span>"
|
||||||
return 1
|
return 1
|
||||||
else
|
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)
|
/obj/machinery/atmospherics/unary/vent_pump/examine(mob/user)
|
||||||
if(..(user, 1))
|
if(..(user, 1))
|
||||||
user << "A small gauge in the corner reads [round(last_flow_rate, 0.1)] L/s; [round(last_power_draw)] W"
|
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_out
|
||||||
var/radio_filter_in
|
var/radio_filter_in
|
||||||
|
|
||||||
|
var/welded = 0
|
||||||
|
|
||||||
/obj/machinery/atmospherics/unary/vent_scrubber/on
|
/obj/machinery/atmospherics/unary/vent_scrubber/on
|
||||||
use_power = 1
|
use_power = 1
|
||||||
icon_state = "map_scrubber_on"
|
icon_state = "map_scrubber_on"
|
||||||
@@ -53,16 +55,18 @@
|
|||||||
|
|
||||||
overlays.Cut()
|
overlays.Cut()
|
||||||
|
|
||||||
var/scrubber_icon = "scrubber"
|
|
||||||
|
|
||||||
var/turf/T = get_turf(src)
|
var/turf/T = get_turf(src)
|
||||||
if(!istype(T))
|
if(!istype(T))
|
||||||
return
|
return
|
||||||
|
|
||||||
if(!powered())
|
var/scrubber_icon = "scrubber"
|
||||||
scrubber_icon += "off"
|
if(welded)
|
||||||
|
scrubber_icon += "weld"
|
||||||
else
|
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)
|
overlays += icon_manager.get_atmos_icon("device", , , scrubber_icon)
|
||||||
|
|
||||||
@@ -135,6 +139,8 @@
|
|||||||
//broadcast_status()
|
//broadcast_status()
|
||||||
if(!use_power || (stat & (NOPOWER|BROKEN)))
|
if(!use_power || (stat & (NOPOWER|BROKEN)))
|
||||||
return 0
|
return 0
|
||||||
|
if(welded)
|
||||||
|
return 0
|
||||||
|
|
||||||
var/datum/gas_mixture/environment = loc.return_air()
|
var/datum/gas_mixture/environment = loc.return_air()
|
||||||
|
|
||||||
@@ -253,36 +259,62 @@
|
|||||||
update_icon()
|
update_icon()
|
||||||
|
|
||||||
/obj/machinery/atmospherics/unary/vent_scrubber/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
/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))
|
if (istype(W, /obj/item/weapon/wrench))
|
||||||
return ..()
|
if (!(stat & NOPOWER) && use_power)
|
||||||
if (!(stat & NOPOWER) && use_power)
|
user << "<span class='warning'>You cannot unwrench \the [src], turn it off first.</span>"
|
||||||
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
|
return 1
|
||||||
var/turf/T = src.loc
|
|
||||||
if (node && node.level==1 && isturf(T) && !T.is_plating())
|
if(istype(W, /obj/item/weapon/weldingtool))
|
||||||
user << "<span class='warning'>You must remove the plating first.</span>"
|
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
|
return 1
|
||||||
var/datum/gas_mixture/int_air = return_air()
|
return ..()
|
||||||
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)
|
|
||||||
|
|
||||||
/obj/machinery/atmospherics/unary/vent_scrubber/examine(mob/user)
|
/obj/machinery/atmospherics/unary/vent_scrubber/examine(mob/user)
|
||||||
if(..(user, 1))
|
if(..(user, 1))
|
||||||
user << "A small gauge in the corner reads [round(last_flow_rate, 0.1)] L/s; [round(last_power_draw)] W"
|
user << "A small gauge in the corner reads [round(last_flow_rate, 0.1)] L/s; [round(last_power_draw)] W"
|
||||||
else
|
else
|
||||||
user << "You are too far away to read the gauge."
|
user << "You are too far away to read the gauge."
|
||||||
|
if(welded)
|
||||||
|
user << "It seems welded shut."
|
||||||
|
|
||||||
/obj/machinery/atmospherics/unary/vent_scrubber/Destroy()
|
/obj/machinery/atmospherics/unary/vent_scrubber/Destroy()
|
||||||
if(initial_loc)
|
if(initial_loc)
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ var/list/ventcrawl_machinery = list(
|
|||||||
)
|
)
|
||||||
|
|
||||||
// Vent crawling whitelisted items, whoo
|
// 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/device/mmi,
|
||||||
/obj/item/weapon/implant,
|
/obj/item/weapon/implant,
|
||||||
/obj/item/device/radio/borg,
|
/obj/item/device/radio/borg,
|
||||||
@@ -154,7 +154,7 @@ var/list/ventcrawl_machinery = list(
|
|||||||
if(vent_found)
|
if(vent_found)
|
||||||
break
|
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>"
|
src << "<span class='warning'>You can't crawl into a welded vent!</span>"
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
/obj/machinery/atmospherics/proc/ventcrawl_to(var/mob/living/user, var/obj/machinery/atmospherics/target_move, var/direction)
|
/obj/machinery/atmospherics/proc/ventcrawl_to(var/mob/living/user, var/obj/machinery/atmospherics/target_move, var/direction)
|
||||||
if(target_move)
|
if(target_move)
|
||||||
if(is_type_in_list(target_move, ventcrawl_machinery) && target_move.can_crawl_through())
|
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>")
|
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
|
else
|
||||||
user.remove_ventcrawl()
|
user.remove_ventcrawl()
|
||||||
|
|||||||
7
html/changelogs/Bedshaped-PR-1160.yml
Normal file
7
html/changelogs/Bedshaped-PR-1160.yml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
author: Bedshaped
|
||||||
|
|
||||||
|
delete-after: True
|
||||||
|
|
||||||
|
changes:
|
||||||
|
- rscadd: "Bayport: Scrubbers are now weldable."
|
||||||
|
- bugfix: "Fixed incorrect messages when welding vents."
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Reference in New Issue
Block a user