diff --git a/code/modules/mob/living/simple_animal/friendly/mouse.dm b/code/modules/mob/living/simple_animal/friendly/mouse.dm
index 75d57824077..e9fd6078cf2 100644
--- a/code/modules/mob/living/simple_animal/friendly/mouse.dm
+++ b/code/modules/mob/living/simple_animal/friendly/mouse.dm
@@ -55,6 +55,9 @@
if (stat == CONSCIOUS && prob(speak_chance*0.1))
squeak_soft(0)
+ if(is_ventcrawling == 0)
+ sight = SEE_SELF // Returns mouse sight to normal when they leave a vent
+
if (squeals < maxSqueals)
var/diff = world.time - last_squealgain
if (diff > 600)
diff --git a/code/modules/ventcrawl/ventcrawl.dm b/code/modules/ventcrawl/ventcrawl.dm
index d23ca1ad75a..6253294d065 100644
--- a/code/modules/ventcrawl/ventcrawl.dm
+++ b/code/modules/ventcrawl/ventcrawl.dm
@@ -62,8 +62,8 @@ var/list/ventcrawl_machinery = list(
return 1
/obj/machinery/atmospherics/AltClick(mob/living/user)
- if(is_type_in_list(src,ventcrawl_machinery) && user.can_ventcrawl())
- user.handle_ventcrawl()
+ if(is_type_in_list(src, ventcrawl_machinery) && user.can_ventcrawl())
+ user.handle_ventcrawl(src)
return 1
return ..()
@@ -111,6 +111,21 @@ var/list/ventcrawl_machinery = list(
var/delayticks = size * 3
return delayticks >= 3 ? delayticks : 3
+/mob/living/proc/vent_trap_check(var/status, var/atom/location)
+ switch (status)
+ if ("departing")
+ for (var/obj/item/device/assembly/mousetrap/S in location.loc)
+ if (prob(25))
+ visible_message("[src] gets caught in the mousetrap while trying to crawl into the vent!", "You get caught in the mousetrap while trying to crawl into the vent!")
+ S.Crossed(src) // Triggers mousetrap
+ forceMove(location.loc)
+ if ("arriving")
+ for (var/obj/item/device/assembly/mousetrap/S in location.loc)
+ if (prob(75))
+ S.Crossed(src) // Triggers mousetrap
+ else
+ return
+
/mob/living/var/ventcrawl_layer = 3
/mob/living/proc/handle_ventcrawl(var/atom/clicked_on)
@@ -120,12 +135,16 @@ var/list/ventcrawl_machinery = list(
var/obj/machinery/atmospherics/unary/vent_found
- if(clicked_on && Adjacent(clicked_on))
- vent_found = clicked_on
- if(!istype(vent_found) || !vent_found.can_crawl_through())
- vent_found = null
+ if(clicked_on)
+ if (Adjacent(clicked_on))
+ vent_found = clicked_on
+ if(!is_type_in_list(vent_found, ventcrawl_machinery) || !vent_found.can_crawl_through())
+ vent_found = null
+ else
+ src << "Stand next to the selected vent!"
+ return
- if(!vent_found)
+ if(!vent_found && isnull(clicked_on))
for(var/obj/machinery/atmospherics/machine in range(1,src))
if(is_type_in_list(machine, ventcrawl_machinery))
vent_found = machine
@@ -140,6 +159,8 @@ var/list/ventcrawl_machinery = list(
src << "You can't crawl into a welded vent!"
return
+ vent_trap_check("departing", vent_found)
+
if(vent_found)
if(vent_found.network && (vent_found.network.normal_members.len || vent_found.network.line_members.len))
@@ -178,7 +199,7 @@ var/list/ventcrawl_machinery = list(
visible_message("[src] scrambles into the ventilation ducts!", "You climb into the ventilation system.")
forceMove(vent_found)
- add_ventcrawl(vent_found)
+ add_ventcrawl(vent_found.node)
sight = (SEE_TURFS|BLIND)
else
diff --git a/code/modules/ventcrawl/ventcrawl_atmospherics.dm b/code/modules/ventcrawl/ventcrawl_atmospherics.dm
index 1f8efdfd250..ac9d4d5c6c0 100644
--- a/code/modules/ventcrawl/ventcrawl_atmospherics.dm
+++ b/code/modules/ventcrawl/ventcrawl_atmospherics.dm
@@ -32,12 +32,13 @@
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())
- user.visible_message("", "You can't escape from a welded vent.")
+ user.visible_message("You hear something banging on \the [target_move.name]!", "You can't escape from a welded vent.")
else
user.remove_ventcrawl()
user.forceMove(target_move.loc) //handles entering and so on
user.sight &= ~(SEE_TURFS|BLIND)
user.visible_message("You hear something squeezing through the ducts.", "You climb out the ventilation system.")
+ user.vent_trap_check("arriving", target_move)
else if(target_move.can_crawl_through())
if(target_move.return_network(target_move) != return_network(src))
user.remove_ventcrawl()
@@ -51,7 +52,9 @@
if((direction & initialize_directions) || is_type_in_list(src, ventcrawl_machinery) && src.can_crawl_through()) //if we move in a way the pipe can connect, but doesn't - or we're in a vent
user.remove_ventcrawl()
user.forceMove(src.loc)
+ user.sight &= ~(SEE_TURFS|BLIND)
user.visible_message("You hear something squeezing through the pipes.", "You climb out the ventilation system.")
+ user.vent_trap_check("arriving", target_move)
user.canmove = 0
spawn(1)
user.canmove = 1
@@ -68,6 +71,11 @@
/obj/machinery/atmospherics/proc/isConnectable(var/obj/machinery/atmospherics/target)
return (target == node1 || target == node2)
+/obj/machinery/atmospherics/omni/isConnectable(var/obj/machinery/atmospherics/target)
+ for (var/datum/omni_port/P in ports)
+ if (P.node == target)
+ return P.node
+
/obj/machinery/atmospherics/pipe/manifold/isConnectable(var/obj/machinery/atmospherics/target)
return (target == node3 || ..())
diff --git a/code/modules/ventcrawl/ventcrawl_verb.dm b/code/modules/ventcrawl/ventcrawl_verb.dm
index bdc71660073..45d7dfc237b 100644
--- a/code/modules/ventcrawl/ventcrawl_verb.dm
+++ b/code/modules/ventcrawl/ventcrawl_verb.dm
@@ -6,4 +6,4 @@
return
var/pipe = start_ventcrawl()
if(pipe)
- handle_ventcrawl()
\ No newline at end of file
+ handle_ventcrawl(pipe)
\ No newline at end of file