mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
Ventcrawling changes
Fixes #5573 Fixes #5891 Fixes #6191 Centralized some code for ventcrawling in ventcrawl.dm Made passive vents a type to be checked for ventcrawling into Made hunters able to carry things into vents apparently Gave contortionist jumpsuit a verb to ventcrawl with for the scrubs who dont know hotkeys
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump, /obj/machinery/atmospherics/unary/vent_scrubber)
|
||||
var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump, /obj/machinery/atmospherics/unary/vent_scrubber, /obj/machinery/atmospherics/unary/vent)
|
||||
|
||||
/mob/living/proc/can_ventcrawl()
|
||||
return 0
|
||||
@@ -29,6 +29,33 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump,
|
||||
return C.check_clothing(src)
|
||||
return 1
|
||||
|
||||
/obj/item/clothing/under/contortionist/verb/crawl_through_vent()
|
||||
set name = "Crawl Through Vent"
|
||||
set category = "Object"
|
||||
set src in usr
|
||||
|
||||
var/mob/living/carbon/human/user = usr
|
||||
if(istype(user) && user.w_uniform == src && check_clothing(user))
|
||||
var/pipe = user.start_ventcrawl()
|
||||
if(pipe)
|
||||
user.handle_ventcrawl(pipe)
|
||||
|
||||
/mob/proc/start_ventcrawl()
|
||||
var/atom/pipe
|
||||
var/list/pipes = list()
|
||||
for(var/obj/machinery/atmospherics/unary/U in range(1))
|
||||
if(is_type_in_list(U,ventcrawl_machinery) && Adjacent(U))
|
||||
pipes |= U
|
||||
if(!pipes || !pipes.len)
|
||||
src << "There are no pipes that you can ventcrawl into within range!"
|
||||
return
|
||||
if(pipes.len == 1)
|
||||
pipe = pipes[1]
|
||||
else
|
||||
pipe = input("Crawl Through Vent", "Pick a pipe") as null|anything in pipes
|
||||
if(canmove && pipe)
|
||||
return pipe
|
||||
|
||||
/mob/living/carbon/slime/can_ventcrawl()
|
||||
return 1
|
||||
|
||||
@@ -53,9 +80,13 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump,
|
||||
/mob/living/carbon/alien/can_ventcrawl()
|
||||
return 1
|
||||
|
||||
/mob/living/carbon/alien/ventcrawl_carry()
|
||||
return 1
|
||||
|
||||
/mob/living/carbon/alien/humanoid/queen/can_ventcrawl()
|
||||
return 0
|
||||
|
||||
|
||||
/mob/living/var/ventcrawl_layer = PIPING_LAYER_DEFAULT
|
||||
|
||||
/mob/living/proc/handle_ventcrawl(var/atom/clicked_on)
|
||||
|
||||
@@ -3,16 +3,6 @@
|
||||
set desc = "Enter an air vent and crawl through the pipe system."
|
||||
set category = "Alien"
|
||||
//writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\/mob/living/carbon/alien/verb/ventcrawl() called tick#: [world.time]")
|
||||
var/atom/pipe
|
||||
var/list/pipes = list()
|
||||
for(var/obj/machinery/atmospherics/unary/U in range(1))
|
||||
if((istype(U, /obj/machinery/atmospherics/unary/vent_pump) || istype(U,/obj/machinery/atmospherics/unary/vent_scrubber)) && Adjacent(U))
|
||||
pipes |= U
|
||||
if(!pipes || !pipes.len)
|
||||
return
|
||||
if(pipes.len == 1)
|
||||
pipe = pipes[1]
|
||||
else
|
||||
pipe = input("Crawl Through Vent", "Pick a pipe") as null|anything in pipes
|
||||
var/pipe = start_ventcrawl()
|
||||
if(pipe)
|
||||
handle_ventcrawl(pipe)
|
||||
|
||||
@@ -252,16 +252,6 @@
|
||||
set category = "Object"
|
||||
//writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\/mob/living/carbon/slime/verb/ventcrawl() called tick#: [world.time]")
|
||||
if(Victim) return
|
||||
var/atom/pipe
|
||||
var/list/pipes = list()
|
||||
for(var/obj/machinery/atmospherics/unary/U in range(1))
|
||||
if((istype(U, /obj/machinery/atmospherics/unary/vent_pump) || istype(U,/obj/machinery/atmospherics/unary/vent_scrubber)) && Adjacent(U))
|
||||
pipes |= U
|
||||
if(!pipes || !pipes.len)
|
||||
return
|
||||
if(pipes.len == 1)
|
||||
pipe = pipes[1]
|
||||
else
|
||||
pipe = input("Crawl Through Vent", "Pick a pipe") as null|anything in pipes
|
||||
var/pipe = start_ventcrawl()
|
||||
if(pipe && !Victim)
|
||||
handle_ventcrawl(pipe)
|
||||
|
||||
@@ -3,17 +3,6 @@
|
||||
set desc = "Enter an air vent and crawl through the pipe system."
|
||||
set category = "Object"
|
||||
//writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\/mob/living/carbon/monkey/verb/ventcrawl() called tick#: [world.time]")
|
||||
|
||||
var/atom/pipe
|
||||
var/list/pipes = list()
|
||||
for(var/obj/machinery/atmospherics/unary/U in range(1))
|
||||
if((istype(U, /obj/machinery/atmospherics/unary/vent_pump) || istype(U,/obj/machinery/atmospherics/unary/vent_scrubber)) && Adjacent(U))
|
||||
pipes |= U
|
||||
if(!pipes || !pipes.len)
|
||||
return
|
||||
if(pipes.len == 1)
|
||||
pipe = pipes[1]
|
||||
else
|
||||
pipe = input("Crawl Through Vent", "Pick a pipe") as null|anything in pipes
|
||||
var/pipe = start_ventcrawl()
|
||||
if(pipe)
|
||||
handle_ventcrawl(pipe)
|
||||
handle_ventcrawl(pipe)
|
||||
@@ -3,19 +3,8 @@
|
||||
set desc = "Enter an air vent and crawl through the pipe system."
|
||||
set category = "Robot Commands"
|
||||
//writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\/mob/living/silicon/robot/mommi/verb/ventcrawl() called tick#: [world.time]")
|
||||
var/mob/living/silicon/robot/mommi/R = src
|
||||
var/atom/pipe
|
||||
var/list/pipes = list()
|
||||
for(var/obj/machinery/atmospherics/unary/U in view(1))
|
||||
if((istype(U, /obj/machinery/atmospherics/unary/vent_pump) || istype(U,/obj/machinery/atmospherics/unary/vent_scrubber)) && Adjacent(U))
|
||||
pipes |= U
|
||||
if(!pipes || !pipes.len)
|
||||
return
|
||||
if(pipes.len == 1)
|
||||
pipe = pipes[1]
|
||||
else
|
||||
pipe = input("Crawl Through Vent", "Pick a pipe") as null|anything in pipes
|
||||
if(R.canmove && pipe)
|
||||
var/pipe = start_ventcrawl()
|
||||
if(pipe)
|
||||
handle_ventcrawl(pipe)
|
||||
|
||||
|
||||
|
||||
@@ -660,20 +660,8 @@ mob/living/simple_animal/borer/proc/detach()
|
||||
src << "<span class='warning'>You are busy evolving.</span>"
|
||||
return
|
||||
|
||||
|
||||
var/mob/living/simple_animal/borer/B = src
|
||||
var/atom/pipe
|
||||
var/list/pipes = list()
|
||||
for(var/obj/machinery/atmospherics/unary/U in view(1))
|
||||
if((istype(U, /obj/machinery/atmospherics/unary/vent_pump) || istype(U,/obj/machinery/atmospherics/unary/vent_scrubber)) && Adjacent(U))
|
||||
pipes |= U
|
||||
if(!pipes || !pipes.len)
|
||||
return
|
||||
if(pipes.len == 1)
|
||||
pipe = pipes[1]
|
||||
else
|
||||
pipe = input("Crawl Through Vent", "Pick a pipe") as null|anything in pipes
|
||||
if(B.canmove && pipe)
|
||||
var/pipe = start_ventcrawl()
|
||||
if(pipe)
|
||||
handle_ventcrawl(pipe)
|
||||
|
||||
//copy paste from alien/larva, if that func is updated please update this one alsoghost
|
||||
|
||||
@@ -81,17 +81,7 @@
|
||||
set desc = "Enter an air vent and crawl through the pipe system."
|
||||
set category = "Object"
|
||||
//writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\/mob/living/simple_animal/mouse/verb/ventcrawl() called tick#: [world.time]")
|
||||
var/atom/pipe
|
||||
var/list/pipes = list()
|
||||
for(var/obj/machinery/atmospherics/unary/U in range(1))
|
||||
if((istype(U, /obj/machinery/atmospherics/unary/vent_pump) || istype(U,/obj/machinery/atmospherics/unary/vent_scrubber)) && Adjacent(U))
|
||||
pipes |= U
|
||||
if(!pipes || !pipes.len)
|
||||
return
|
||||
if(pipes.len == 1)
|
||||
pipe = pipes[1]
|
||||
else
|
||||
pipe = input("Crawl Through Vent", "Pick a pipe") as null|anything in pipes
|
||||
var/pipe = start_ventcrawl()
|
||||
if(pipe)
|
||||
handle_ventcrawl(pipe)
|
||||
|
||||
|
||||
@@ -203,17 +203,7 @@
|
||||
set desc = "Enter an air vent and crawl through the pipe system."
|
||||
set category = "Spiderbot"
|
||||
//writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\/mob/living/simple_animal/spiderbot/verb/ventcrawl() called tick#: [world.time]")
|
||||
var/atom/pipe
|
||||
var/list/pipes = list()
|
||||
for(var/obj/machinery/atmospherics/unary/U in range(1))
|
||||
if((istype(U, /obj/machinery/atmospherics/unary/vent_pump) || istype(U,/obj/machinery/atmospherics/unary/vent_scrubber)) && Adjacent(U))
|
||||
pipes |= U
|
||||
if(!pipes || !pipes.len)
|
||||
return
|
||||
if(pipes.len == 1)
|
||||
pipe = pipes[1]
|
||||
else
|
||||
pipe = input("Crawl Through Vent", "Pick a pipe") as null|anything in pipes
|
||||
var/pipe = start_ventcrawl()
|
||||
if(pipe)
|
||||
handle_ventcrawl(pipe)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user