mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-13 11:43:31 +00:00
@@ -338,13 +338,13 @@
|
|||||||
return
|
return
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Alt-click to ventcrawl - Monkeys, aliens, and slimes
|
Alt-click to ventcrawl - Monkeys, aliens, slimes and mice.
|
||||||
This is a little buggy but somehow that just seems to plague ventcrawl.
|
This is a little buggy but somehow that just seems to plague ventcrawl.
|
||||||
I am sorry, I don't know why.
|
I am sorry, I don't know why.
|
||||||
*/
|
*/
|
||||||
/obj/machinery/atmospherics/unary/vent_pump/AltClick(var/mob/living/carbon/ML)
|
/obj/machinery/atmospherics/unary/vent_pump/AltClick(var/mob/living/ML)
|
||||||
if(istype(ML))
|
if(istype(ML))
|
||||||
var/list/ventcrawl_verbs = list(/mob/living/carbon/monkey/verb/ventcrawl, /mob/living/carbon/alien/verb/ventcrawl, /mob/living/carbon/slime/verb/ventcrawl)
|
var/list/ventcrawl_verbs = list(/mob/living/carbon/monkey/verb/ventcrawl, /mob/living/carbon/alien/verb/ventcrawl, /mob/living/carbon/slime/verb/ventcrawl,/mob/living/simple_animal/mouse/verb/ventcrawl)
|
||||||
if(length(ML.verbs & ventcrawl_verbs)) // alien queens have this removed, an istype would be complicated
|
if(length(ML.verbs & ventcrawl_verbs)) // alien queens have this removed, an istype would be complicated
|
||||||
ML.handle_ventcrawl(src)
|
ML.handle_ventcrawl(src)
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -221,99 +221,6 @@
|
|||||||
|
|
||||||
// ++++ROCKDTBEN++++ MOB PROCS //END
|
// ++++ROCKDTBEN++++ MOB PROCS //END
|
||||||
|
|
||||||
/mob/living/carbon/proc/handle_ventcrawl(var/obj/machinery/atmospherics/unary/vent_pump/vent_found = null) // -- TLE -- Merged by Carn
|
|
||||||
if(stat)
|
|
||||||
src << "You must be conscious to do this!"
|
|
||||||
return
|
|
||||||
if(lying)
|
|
||||||
src << "You can't vent crawl while you're stunned!"
|
|
||||||
return
|
|
||||||
|
|
||||||
if(vent_found) // one was passed in, probably from vent/AltClick()
|
|
||||||
if(vent_found.welded)
|
|
||||||
src << "That vent is welded shut."
|
|
||||||
return
|
|
||||||
if(!vent_found.Adjacent(src))
|
|
||||||
return // don't even acknowledge that
|
|
||||||
else
|
|
||||||
for(var/obj/machinery/atmospherics/unary/vent_pump/v in range(1,src))
|
|
||||||
if(!v.welded)
|
|
||||||
if(v.Adjacent(src))
|
|
||||||
vent_found = v
|
|
||||||
if(!vent_found)
|
|
||||||
src << "You'll need a non-welded vent to crawl into!"
|
|
||||||
return
|
|
||||||
|
|
||||||
if(!vent_found.network || !vent_found.network.normal_members.len)
|
|
||||||
src << "This vent is not connected to anything."
|
|
||||||
return
|
|
||||||
|
|
||||||
var/list/vents = list()
|
|
||||||
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in vent_found.network.normal_members)
|
|
||||||
if(temp_vent.welded)
|
|
||||||
continue
|
|
||||||
if(temp_vent in loc)
|
|
||||||
continue
|
|
||||||
var/turf/T = get_turf(temp_vent)
|
|
||||||
|
|
||||||
if(!T || T.z != loc.z)
|
|
||||||
continue
|
|
||||||
|
|
||||||
var/i = 1
|
|
||||||
var/index = "[T.loc.name]\[[i]\]"
|
|
||||||
while(index in vents)
|
|
||||||
i++
|
|
||||||
index = "[T.loc.name]\[[i]\]"
|
|
||||||
vents[index] = temp_vent
|
|
||||||
if(!vents.len)
|
|
||||||
src << "\red There are no available vents to travel to, they could be welded."
|
|
||||||
return
|
|
||||||
|
|
||||||
var/obj/selection = input("Select a destination.", "Duct System") as null|anything in sortAssoc(vents)
|
|
||||||
if(!selection) return
|
|
||||||
|
|
||||||
if(!vent_found.Adjacent(src))
|
|
||||||
src << "Never mind, you left."
|
|
||||||
return
|
|
||||||
|
|
||||||
for(var/obj/item/carried_item in contents)//If the monkey got on objects.
|
|
||||||
if( !istype(carried_item, /obj/item/weapon/implant) && !istype(carried_item, /obj/item/clothing/mask/facehugger) )//If it's not an implant or a facehugger
|
|
||||||
src << "\red You can't be carrying items or have items equipped when vent crawling!"
|
|
||||||
return
|
|
||||||
if(isslime(src))
|
|
||||||
var/mob/living/carbon/slime/S = src
|
|
||||||
if(S.Victim)
|
|
||||||
src << "\red You'll have to let [S.Victim] go or finish eating \him first."
|
|
||||||
return
|
|
||||||
|
|
||||||
var/obj/machinery/atmospherics/unary/vent_pump/target_vent = vents[selection]
|
|
||||||
if(!target_vent)
|
|
||||||
return
|
|
||||||
|
|
||||||
for(var/mob/O in viewers(src, null))
|
|
||||||
O.show_message(text("<B>[src] scrambles into the ventillation ducts!</B>"), 1)
|
|
||||||
loc = target_vent
|
|
||||||
|
|
||||||
var/travel_time = round(get_dist(loc, target_vent.loc) / 2)
|
|
||||||
|
|
||||||
spawn(travel_time)
|
|
||||||
|
|
||||||
if(!target_vent) return
|
|
||||||
for(var/mob/O in hearers(target_vent,null))
|
|
||||||
O.show_message("You hear something squeezing through the ventilation ducts.",2)
|
|
||||||
|
|
||||||
sleep(travel_time)
|
|
||||||
|
|
||||||
if(!target_vent) return
|
|
||||||
if(target_vent.welded) //the vent can be welded while alien scrolled through the list or travelled.
|
|
||||||
target_vent = vent_found //travel back. No additional time required.
|
|
||||||
src << "\red The vent you were heading to appears to be welded."
|
|
||||||
loc = target_vent.loc
|
|
||||||
var/area/new_area = get_area(loc)
|
|
||||||
if(new_area)
|
|
||||||
new_area.Entered(src)
|
|
||||||
|
|
||||||
|
|
||||||
/mob/living/carbon/clean_blood()
|
/mob/living/carbon/clean_blood()
|
||||||
. = ..()
|
. = ..()
|
||||||
if(ishuman(src))
|
if(ishuman(src))
|
||||||
|
|||||||
@@ -674,4 +674,96 @@
|
|||||||
set category = "IC"
|
set category = "IC"
|
||||||
|
|
||||||
resting = !resting
|
resting = !resting
|
||||||
src << "\blue You are now [resting ? "resting" : "getting up"]"
|
src << "\blue You are now [resting ? "resting" : "getting up"]"
|
||||||
|
|
||||||
|
/mob/living/proc/handle_ventcrawl(var/obj/machinery/atmospherics/unary/vent_pump/vent_found = null) // -- TLE -- Merged by Carn
|
||||||
|
if(stat)
|
||||||
|
src << "You must be conscious to do this!"
|
||||||
|
return
|
||||||
|
if(lying)
|
||||||
|
src << "You can't vent crawl while you're stunned!"
|
||||||
|
return
|
||||||
|
|
||||||
|
if(vent_found) // one was passed in, probably from vent/AltClick()
|
||||||
|
if(vent_found.welded)
|
||||||
|
src << "That vent is welded shut."
|
||||||
|
return
|
||||||
|
if(!vent_found.Adjacent(src))
|
||||||
|
return // don't even acknowledge that
|
||||||
|
else
|
||||||
|
for(var/obj/machinery/atmospherics/unary/vent_pump/v in range(1,src))
|
||||||
|
if(!v.welded)
|
||||||
|
if(v.Adjacent(src))
|
||||||
|
vent_found = v
|
||||||
|
if(!vent_found)
|
||||||
|
src << "You'll need a non-welded vent to crawl into!"
|
||||||
|
return
|
||||||
|
|
||||||
|
if(!vent_found.network || !vent_found.network.normal_members.len)
|
||||||
|
src << "This vent is not connected to anything."
|
||||||
|
return
|
||||||
|
|
||||||
|
var/list/vents = list()
|
||||||
|
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in vent_found.network.normal_members)
|
||||||
|
if(temp_vent.welded)
|
||||||
|
continue
|
||||||
|
if(temp_vent in loc)
|
||||||
|
continue
|
||||||
|
var/turf/T = get_turf(temp_vent)
|
||||||
|
|
||||||
|
if(!T || T.z != loc.z)
|
||||||
|
continue
|
||||||
|
|
||||||
|
var/i = 1
|
||||||
|
var/index = "[T.loc.name]\[[i]\]"
|
||||||
|
while(index in vents)
|
||||||
|
i++
|
||||||
|
index = "[T.loc.name]\[[i]\]"
|
||||||
|
vents[index] = temp_vent
|
||||||
|
if(!vents.len)
|
||||||
|
src << "\red There are no available vents to travel to, they could be welded."
|
||||||
|
return
|
||||||
|
|
||||||
|
var/obj/selection = input("Select a destination.", "Duct System") as null|anything in sortAssoc(vents)
|
||||||
|
if(!selection) return
|
||||||
|
|
||||||
|
if(!vent_found.Adjacent(src))
|
||||||
|
src << "Never mind, you left."
|
||||||
|
return
|
||||||
|
|
||||||
|
for(var/obj/item/carried_item in contents)//If the monkey got on objects.
|
||||||
|
if( !istype(carried_item, /obj/item/weapon/implant) && !istype(carried_item, /obj/item/clothing/mask/facehugger) )//If it's not an implant or a facehugger
|
||||||
|
src << "\red You can't be carrying items or have items equipped when vent crawling!"
|
||||||
|
return
|
||||||
|
if(isslime(src))
|
||||||
|
var/mob/living/carbon/slime/S = src
|
||||||
|
if(S.Victim)
|
||||||
|
src << "\red You'll have to let [S.Victim] go or finish eating \him first."
|
||||||
|
return
|
||||||
|
|
||||||
|
var/obj/machinery/atmospherics/unary/vent_pump/target_vent = vents[selection]
|
||||||
|
if(!target_vent)
|
||||||
|
return
|
||||||
|
|
||||||
|
for(var/mob/O in viewers(src, null))
|
||||||
|
O.show_message(text("<B>[src] scrambles into the ventillation ducts!</B>"), 1)
|
||||||
|
loc = target_vent
|
||||||
|
|
||||||
|
var/travel_time = round(get_dist(loc, target_vent.loc) / 2)
|
||||||
|
|
||||||
|
spawn(travel_time)
|
||||||
|
|
||||||
|
if(!target_vent) return
|
||||||
|
for(var/mob/O in hearers(target_vent,null))
|
||||||
|
O.show_message("You hear something squeezing through the ventilation ducts.",2)
|
||||||
|
|
||||||
|
sleep(travel_time)
|
||||||
|
|
||||||
|
if(!target_vent) return
|
||||||
|
if(target_vent.welded) //the vent can be welded while alien scrolled through the list or travelled.
|
||||||
|
target_vent = vent_found //travel back. No additional time required.
|
||||||
|
src << "\red The vent you were heading to appears to be welded."
|
||||||
|
loc = target_vent.loc
|
||||||
|
var/area/new_area = get_area(loc)
|
||||||
|
if(new_area)
|
||||||
|
new_area.Entered(src)
|
||||||
@@ -69,58 +69,11 @@
|
|||||||
if(client)
|
if(client)
|
||||||
client.time_died_as_mouse = world.time
|
client.time_died_as_mouse = world.time
|
||||||
|
|
||||||
//copy paste from alien/larva, if that func is updated please update this one also
|
|
||||||
/mob/living/simple_animal/mouse/verb/ventcrawl()
|
/mob/living/simple_animal/mouse/verb/ventcrawl()
|
||||||
set name = "Crawl through Vent"
|
set name = "Crawl through Vent"
|
||||||
set desc = "Enter an air vent and crawl through the pipe system."
|
set desc = "Enter an air vent and crawl through the pipe system."
|
||||||
set category = "Mouse"
|
set category = "Mouse"
|
||||||
|
handle_ventcrawl()
|
||||||
// if(!istype(V,/obj/machinery/atmoalter/siphs/fullairsiphon/air_vent))
|
|
||||||
// return
|
|
||||||
|
|
||||||
if(src.stat != CONSCIOUS) return
|
|
||||||
|
|
||||||
var/obj/machinery/atmospherics/unary/vent_pump/vent_found
|
|
||||||
var/welded = 0
|
|
||||||
for(var/obj/machinery/atmospherics/unary/vent_pump/v in range(1,src))
|
|
||||||
if(!v.welded)
|
|
||||||
vent_found = v
|
|
||||||
break
|
|
||||||
else
|
|
||||||
welded = 1
|
|
||||||
if(vent_found)
|
|
||||||
if(vent_found.network&&vent_found.network.normal_members.len)
|
|
||||||
var/list/vents = list()
|
|
||||||
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in vent_found.network.normal_members)
|
|
||||||
if(temp_vent.loc == loc)
|
|
||||||
continue
|
|
||||||
vents.Add(temp_vent)
|
|
||||||
var/list/choices = list()
|
|
||||||
for(var/obj/machinery/atmospherics/unary/vent_pump/vent in vents)
|
|
||||||
if(vent.loc.z != loc.z)
|
|
||||||
continue
|
|
||||||
var/atom/a = get_turf(vent)
|
|
||||||
choices.Add(a.loc)
|
|
||||||
var/turf/startloc = loc
|
|
||||||
var/obj/selection = input("Select a destination.", "Duct System") in choices
|
|
||||||
var/selection_position = choices.Find(selection)
|
|
||||||
if(loc==startloc)
|
|
||||||
var/obj/target_vent = vents[selection_position]
|
|
||||||
if(target_vent)
|
|
||||||
/*
|
|
||||||
for(var/mob/O in oviewers(src, null))
|
|
||||||
if ((O.client && !( O.blinded )))
|
|
||||||
O.show_message(text("<B>[src] scrambles into the ventillation ducts!</B>"), 1)
|
|
||||||
*/
|
|
||||||
loc = target_vent.loc
|
|
||||||
else
|
|
||||||
src << "\blue You need to remain still while entering a vent."
|
|
||||||
else
|
|
||||||
src << "\blue This vent is not connected to anything."
|
|
||||||
else if(welded)
|
|
||||||
src << "\red That vent is welded."
|
|
||||||
else
|
|
||||||
src << "\blue You must be standing on or beside an air vent to enter it."
|
|
||||||
return
|
return
|
||||||
|
|
||||||
//copy paste from alien/larva, if that func is updated please update this one alsoghost
|
//copy paste from alien/larva, if that func is updated please update this one alsoghost
|
||||||
|
|||||||
Reference in New Issue
Block a user