Ventcrawler update (#18709)

* mob atmos properly handled

* Ventcrawling signals

* ventcrawler blowout

* clarity

* fix

* fix again

* again

* consistency

* Teshari rattler

* scrubbers can be welded shut
This commit is contained in:
Will
2025-11-07 08:29:14 -05:00
committed by GitHub
parent a913850412
commit 395f618b0f
14 changed files with 155 additions and 93 deletions
+44 -56
View File
@@ -11,7 +11,6 @@
handle_weakened()
handle_paralysed()
handle_supernatural()
handle_atmos()
handle_special()
@@ -102,73 +101,62 @@
/mob/living/simple_mob/proc/handle_special()
return
// Handle interacting with and taking damage from atmos
// TODO - Refactor this to use handle_environment() like a good /mob/living
/mob/living/simple_mob/proc/handle_atmos()
var/atmos_unsuitable = 0
/mob/living/simple_mob/handle_environment(datum/gas_mixture/environment)
if(in_stasis)
return 1 // return early to skip atmos checks
if(is_incorporeal())
return 1
var/atom/A = src.loc
if( abs(environment.temperature - bodytemperature) > temperature_range )
bodytemperature += ((environment.temperature - bodytemperature) / 5)
if(istype(A,/turf))
var/turf/T = A
var/atmos_unsuitable = 0
if(min_oxy && environment.gas[GAS_O2] < min_oxy)
atmos_unsuitable = 1
throw_alert("oxy", /atom/movable/screen/alert/not_enough_oxy)
else if(max_oxy && environment.gas[GAS_O2] > max_oxy)
atmos_unsuitable = 1
throw_alert("oxy", /atom/movable/screen/alert/too_much_oxy)
else
clear_alert("oxy")
var/datum/gas_mixture/Environment = T.return_air()
if(min_tox && environment.gas[GAS_PHORON] < min_tox)
atmos_unsuitable = 2
throw_alert("tox_in_air", /atom/movable/screen/alert/not_enough_tox)
else if(max_tox && environment.gas[GAS_PHORON] > max_tox)
atmos_unsuitable = 2
throw_alert("tox_in_air", /atom/movable/screen/alert/tox_in_air)
else
clear_alert("tox_in_air")
if(Environment)
if(min_n2 && environment.gas[GAS_N2] < min_n2)
atmos_unsuitable = 1
throw_alert("n2o", /atom/movable/screen/alert/not_enough_nitro)
else if(max_n2 && environment.gas[GAS_N2] > max_n2)
atmos_unsuitable = 1
throw_alert("n2o", /atom/movable/screen/alert/too_much_nitro)
else
clear_alert("n2o")
if( abs(Environment.temperature - bodytemperature) > temperature_range ) //VOREStation Edit: heating adjustments
bodytemperature += ((Environment.temperature - bodytemperature) / 5)
if(min_co2 && environment.gas[GAS_CO2] < min_co2)
atmos_unsuitable = 1
throw_alert("co2", /atom/movable/screen/alert/not_enough_co2)
else if(max_co2 && environment.gas[GAS_CO2] > max_co2)
atmos_unsuitable = 1
throw_alert("co2", /atom/movable/screen/alert/too_much_co2)
else
clear_alert("co2")
if(min_oxy && Environment.gas[GAS_O2] < min_oxy)
atmos_unsuitable = 1
throw_alert("oxy", /atom/movable/screen/alert/not_enough_oxy)
else if(max_oxy && Environment.gas[GAS_O2] > max_oxy)
atmos_unsuitable = 1
throw_alert("oxy", /atom/movable/screen/alert/too_much_oxy)
else
clear_alert("oxy")
if(min_tox && Environment.gas[GAS_PHORON] < min_tox)
atmos_unsuitable = 2
throw_alert("tox_in_air", /atom/movable/screen/alert/not_enough_tox)
else if(max_tox && Environment.gas[GAS_PHORON] > max_tox)
atmos_unsuitable = 2
throw_alert("tox_in_air", /atom/movable/screen/alert/tox_in_air)
else
clear_alert("tox_in_air")
if(min_n2 && Environment.gas[GAS_N2] < min_n2)
atmos_unsuitable = 1
throw_alert("n2o", /atom/movable/screen/alert/not_enough_nitro)
else if(max_n2 && Environment.gas[GAS_N2] > max_n2)
atmos_unsuitable = 1
throw_alert("n2o", /atom/movable/screen/alert/too_much_nitro)
else
clear_alert("n2o")
if(min_co2 && Environment.gas[GAS_CO2] < min_co2)
atmos_unsuitable = 1
throw_alert("co2", /atom/movable/screen/alert/not_enough_co2)
else if(max_co2 && Environment.gas[GAS_CO2] > max_co2)
atmos_unsuitable = 1
throw_alert("co2", /atom/movable/screen/alert/too_much_co2)
else
clear_alert("co2")
if(min_ch4 && Environment.gas[GAS_CH4] < min_ch4)
atmos_unsuitable = 2
throw_alert("methane_in_air", /atom/movable/screen/alert/not_enough_methane)
else if(max_tox && Environment.gas[GAS_CH4] > max_ch4)
atmos_unsuitable = 2
throw_alert("methane_in_air", /atom/movable/screen/alert/methane_in_air)
else
clear_alert("methane_in_air")
if(min_ch4 && environment.gas[GAS_CH4] < min_ch4)
atmos_unsuitable = 2
throw_alert("methane_in_air", /atom/movable/screen/alert/not_enough_methane)
else if(max_tox && environment.gas[GAS_CH4] > max_ch4)
atmos_unsuitable = 2
throw_alert("methane_in_air", /atom/movable/screen/alert/methane_in_air)
else
clear_alert("methane_in_air")
//Atmos effect
if(bodytemperature < minbodytemp)
@@ -71,14 +71,12 @@
/mob/living/simple_mob/vore/demon/UnarmedAttack()
if(shifted_out)
return FALSE
. = ..()
/mob/living/simple_mob/vore/demon/can_fall()
if(shifted_out)
return FALSE
return ..()
. = ..()
/mob/living/simple_mob/vore/demon/zMove(direction)
if(shifted_out)
@@ -86,26 +84,23 @@
if(destination)
forceMove(destination)
return TRUE
return ..()
. = ..()
/mob/living/simple_mob/vore/demon/Life()
. = ..()
if(shifted_out)
density = FALSE
/mob/living/simple_mob/vore/demon/handle_atmos()
/mob/living/simple_mob/vore/demon/handle_environment(datum/gas_mixture/environment) // TODO - Refactor demons to use is_incorporeal()
if(shifted_out)
return
else
return .=..()
. = ..()
/mob/living/simple_mob/vore/demon/update_canmove()
if(is_shifting)
canmove = FALSE
return canmove
else
return ..()
. = ..()
/mob/living/simple_mob/vore/demon/apply_melee_effects(var/atom/A)
if(isliving(A))
@@ -74,14 +74,12 @@
/mob/living/simple_mob/vore/demonAI/UnarmedAttack()
if(shifted_out)
return FALSE
. = ..()
/mob/living/simple_mob/vore/demonAI/can_fall()
if(shifted_out)
return FALSE
return ..()
. = ..()
/mob/living/simple_mob/vore/demonAI/zMove(direction)
if(shifted_out)
@@ -89,19 +87,17 @@
if(destination)
forceMove(destination)
return TRUE
return ..()
. = ..()
/mob/living/simple_mob/vore/demonAI/Life()
. = ..()
if(shifted_out)
density = FALSE
/mob/living/simple_mob/vore/demonAI/handle_atmos()
/mob/living/simple_mob/vore/demonAI/handle_environment(datum/gas_mixture/environment) // TODO - Refactor demons to use is_incorporeal()
if(shifted_out)
return
else
return .=..()
. = ..()
/mob/living/simple_mob/vore/demonAI/update_canmove()
if(is_shifting)
@@ -347,11 +347,6 @@
return TRUE
return FALSE
/mob/living/simple_mob/shadekin/handle_atmos()
if(comp.in_phase)
return
else
return .=..()
/* //VOREStation AI Removal
//Friendly ones wander towards people, maybe shy-ly if they are set to shy
/mob/living/simple_mob/shadekin/handle_wander_movement()
+1
View File
@@ -262,5 +262,6 @@
VAR_PROTECTED/list/resistances
var/custom_footstep = FOOTSTEP_MOB_SHOE
var/vent_crawl_time = 4.5 SECONDS // Time to animate entering a vent
VAR_PRIVATE/is_motion_tracking = FALSE // Prevent multiple unsubs and resubs, also used to check if the vis layer is enabled, use has_motiontracking() to get externally.
VAR_PRIVATE/wants_to_see_motion_echos = TRUE
+22 -12
View File
@@ -21,8 +21,8 @@ var/list/ventcrawl_machinery = list(
/mob/living/var/list/icon/pipes_shown = list()
/mob/living/var/last_played_vent
/mob/living/var/is_ventcrawling = 0
/mob/living/var/prepping_to_ventcrawl = 0
/mob/living/var/is_ventcrawling = FALSE
/mob/living/var/prepping_to_ventcrawl = FALSE
/mob/var/next_play_vent = 0
/mob/living/proc/can_ventcrawl()
@@ -180,8 +180,12 @@ var/list/ventcrawl_machinery = list(
break
if(vent_found)
if(vent_found.network && (vent_found.network.normal_members.len || vent_found.network.line_members.len))
if(SEND_SIGNAL(src,COMSIG_MOB_VENTCRAWL_CHECK,vent_found) & VENT_CRAWL_BLOCK_ENTRY)
return
if(SEND_SIGNAL(vent_found,COMSIG_VENT_CRAWLER_CHECK,src) & VENT_CRAWL_BLOCK_ENTRY)
return
if(vent_found.network && (vent_found.network.normal_members.len || vent_found.network.line_members.len))
to_chat(src, "You begin climbing into the ventilation system...")
if(vent_found.air_contents && !issilicon(src))
@@ -202,15 +206,20 @@ var/list/ventcrawl_machinery = list(
to_chat(src, span_warning("You feel a strong drag pulling you into the vent."))
if(WARNING_HIGH_PRESSURE to HAZARD_HIGH_PRESSURE)
to_chat(src, span_warning("You feel a strong current pushing you away from the vent."))
if(HAZARD_HIGH_PRESSURE to INFINITY)
if(HAZARD_HIGH_PRESSURE to (HAZARD_HIGH_PRESSURE*2))
to_chat(src, span_danger("You feel a roaring wind pushing you away from the vent!"))
if((HAZARD_HIGH_PRESSURE*2) to INFINITY) // A little too crazy to enter
to_chat(src, span_danger("You're pushed away by the extreme pressure in the vent!"))
return
fade_towards(vent_found,45)
prepping_to_ventcrawl = 1
spawn(50)
prepping_to_ventcrawl = 0
if(!do_after(src, 45, target = src))
// Handle animation delay
fade_towards(vent_found, vent_crawl_time)
prepping_to_ventcrawl = TRUE
if(!do_after(src, vent_crawl_time, target = src))
prepping_to_ventcrawl = FALSE
return
prepping_to_ventcrawl = FALSE
if(!can_ventcrawl())
return
@@ -218,7 +227,8 @@ var/list/ventcrawl_machinery = list(
forceMove(vent_found)
add_ventcrawl(vent_found)
SEND_SIGNAL(src,COMSIG_MOB_VENTCRAWL_START,vent_found)
SEND_SIGNAL(vent_found,COMSIG_VENT_CRAWLER_ENTERED,src)
else
to_chat(src, "This vent is not connected to anything.")
@@ -226,7 +236,7 @@ var/list/ventcrawl_machinery = list(
to_chat(src, "You must be standing on or beside an air vent to enter it.")
/mob/living/proc/add_ventcrawl(obj/machinery/atmospherics/starting_machine)
is_ventcrawling = 1
is_ventcrawling = TRUE
//candrop = 0
var/datum/pipe_network/network = starting_machine.return_network(starting_machine)
if(!network)
@@ -242,7 +252,7 @@ var/list/ventcrawl_machinery = list(
client.screen += GLOB.global_hud.centermarker
/mob/living/proc/remove_ventcrawl()
is_ventcrawling = 0
is_ventcrawling = FALSE
//candrop = 1
if(client)
for(var/image/current_image in pipes_shown)
@@ -4,6 +4,8 @@
for(var/mob/living/M in src) //ventcrawling is serious business
M.remove_ventcrawl()
M.forceMove(get_turf(src))
SEND_SIGNAL(M,COMSIG_MOB_VENTCRAWL_END,src)
SEND_SIGNAL(src,COMSIG_VENT_CRAWLER_EXITED,M)
if(pipe_image)
for(var/mob/living/M in GLOB.player_list)
if(M.client)
@@ -43,6 +45,7 @@
if(world.time > user.next_play_vent)
user.next_play_vent = world.time+30
var/turf/T = get_turf(src)
SSmotiontracker.ping(T,40) // Teshari rattler
playsound(T, 'sound/machines/ventcrawl.ogg', 50, 1, -3)
var/message = pick(
prob(90);"* clunk *",
@@ -56,6 +59,8 @@
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)
SEND_SIGNAL(user,COMSIG_MOB_VENTCRAWL_END,src)
SEND_SIGNAL(src,COMSIG_VENT_CRAWLER_EXITED,user)
user.visible_message("You hear something squeezing through the pipes.", "You climb out the ventilation system.")
user.canmove = 0
spawn(1)
+5
View File
@@ -883,6 +883,11 @@
if (!(M in contents))
return 0 // They weren't in this belly anyway
// Ventcrawlings will explode their vent to avoid exploits
if(istype(owner.loc,/obj/machinery/atmospherics))
var/obj/machinery/atmospherics/our_pipe = owner.loc
our_pipe.blowout(owner)
if(istype(M, /mob/living/simple_mob/vore/morph/dominated_prey))
var/mob/living/simple_mob/vore/morph/dominated_prey/p = M
p.undo_prey_takeover(FALSE)