mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-07-22 05:34:49 +01:00
[MIRROR] Ventcrawler update (#11930)
Co-authored-by: Will <7099514+Willburd@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
4f048b932d
commit
c0da916575
@@ -260,3 +260,22 @@ Pipelines + Other Objects -> Pipe network
|
||||
if(user.buckled)
|
||||
user.buckled.unbuckle_mob(user, TRUE)
|
||||
user.throw_at(get_edge_target_turf(user, get_dir(src, user) || pick(GLOB.cardinal)), pressures / 250, pressures / 1250)
|
||||
|
||||
/// Blows out a pipe, deconstructing it, breaking the floor and releasing all mobs crawling inside it
|
||||
/obj/machinery/atmospherics/proc/blowout(mob/user)
|
||||
// Deconstruct turf
|
||||
var/turf/our_turf = loc
|
||||
if(!our_turf.is_plating() && istype(our_turf,/turf/simulated/floor)) //intact floor, pop the tile
|
||||
var/turf/simulated/floor/our_floor = our_turf
|
||||
our_floor.make_plating(TRUE)
|
||||
// Deconstruct pipe
|
||||
var/datum/gas_mixture/int_air = return_air()
|
||||
var/datum/gas_mixture/env_air = our_turf.return_air()
|
||||
var/internal_pressure = int_air.return_pressure()-env_air.return_pressure()
|
||||
deconstruct()
|
||||
// Release pressure
|
||||
playsound(our_turf, 'sound/effects/bang.ogg', 70, 0, 0)
|
||||
playsound(our_turf, 'sound/effects/clang2.ogg', 70, 0, 0)
|
||||
if(internal_pressure > 2*ONE_ATMOSPHERE)
|
||||
unsafe_pressure_release(user, internal_pressure)
|
||||
playsound(our_turf, 'sound/machines/hiss.ogg', 50, 0, 0)
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
var/datum/pipe_network/network
|
||||
|
||||
var/welded = 0 //defining this here for ventcrawl stuff
|
||||
var/welded = FALSE //defining this here for ventcrawl stuff
|
||||
|
||||
/obj/machinery/atmospherics/unary/Initialize(mapload)
|
||||
. = ..()
|
||||
|
||||
@@ -68,7 +68,9 @@
|
||||
if(!istype(T))
|
||||
return
|
||||
|
||||
if(!powered())
|
||||
if(welded)
|
||||
scrubber_icon += "weld"
|
||||
else if(!powered())
|
||||
scrubber_icon += "off"
|
||||
else
|
||||
scrubber_icon += "[use_power ? "[scrubbing ? "on" : "in"]" : "off"]"
|
||||
@@ -269,6 +271,27 @@
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/attackby(var/obj/item/W as obj, var/mob/user as mob)
|
||||
if(W.has_tool_quality(TOOL_WELDER))
|
||||
var/obj/item/weldingtool/WT = W
|
||||
if (WT.remove_fuel(0,user))
|
||||
to_chat(user, span_notice("Now welding the vent."))
|
||||
|
||||
if(do_after(user, 20 * WT.toolspeed))
|
||||
if(!src || !WT.isOn()) return
|
||||
playsound(src, WT.usesound, 50, 1)
|
||||
if(!welded)
|
||||
user.visible_message(span_notice("<b>\The [user]</b> welds the vent shut."), span_notice("You weld the vent shut."), "You hear welding.")
|
||||
welded = TRUE
|
||||
update_icon()
|
||||
else
|
||||
user.visible_message(span_notice("[user] unwelds the vent."), span_notice("You unweld the vent."), "You hear welding.")
|
||||
welded = FALSE
|
||||
update_icon()
|
||||
else
|
||||
to_chat(user, span_notice("The welding tool needs to be on to start this task."))
|
||||
else
|
||||
to_chat(user, span_warning("You need more welding fuel to complete this task."))
|
||||
return 1
|
||||
if (!W.has_tool_quality(TOOL_WRENCH))
|
||||
return ..()
|
||||
if (!(stat & NOPOWER) && use_power)
|
||||
@@ -278,6 +301,9 @@
|
||||
if (node && node.level==1 && isturf(T) && !T.is_plating())
|
||||
to_chat(user, span_warning("You must remove the plating first."))
|
||||
return 1
|
||||
if(welded)
|
||||
to_chat(user, span_warning("You cannot unwrench \the [src], it is welded down firmly."))
|
||||
return 1
|
||||
if(!can_unwrench())
|
||||
to_chat(user, span_warning("You cannot unwrench \the [src], it is too exerted due to internal pressure."))
|
||||
add_fingerprint(user)
|
||||
@@ -297,3 +323,5 @@
|
||||
. += "A small gauge in the corner reads [round(last_flow_rate, 0.1)] L/s; [round(last_power_draw)] W"
|
||||
else
|
||||
. += "You are too far away to read the gauge."
|
||||
if(welded)
|
||||
. += "It is welded shut."
|
||||
|
||||
Reference in New Issue
Block a user