Merged all those vent-crawl procs D:

As such the same rules apply to all mobs now. They all make noise as they exit the vent. They can all be blocked by welded vents. They all cannot carry items through (except implants and facehuggers). They all have a delay in arriving at their destination.

This removes any meta "Vent noise! Must be aliums cos monkeys don't have that code!". Fixes a bug that stopped ventcrawl working. And, best of all, you can vent-crawl to any connected vent..not just one per area. :3

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4137 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
elly1989@rocketmail.com
2012-07-22 02:57:26 +00:00
parent fcdbc4190c
commit a4681d5d3d
10 changed files with 98 additions and 227 deletions

View File

@@ -101,80 +101,6 @@ I kind of like the right click only--the window version can get a little confusi
src << "\green Target is too far away."
return
/mob/living/carbon/alien/humanoid/verb/ventcrawl() // -- TLE
set name = "Crawl through Vent"
set desc = "Enter an air vent and crawl through the pipes."
set category = "Alien"
// if(!istype(V,/obj/machinery/atmoalter/siphs/fullairsiphon/air_vent))
// return
if(powerc())
var/obj/machinery/atmospherics/unary/vent_pump/vent_found
for(var/obj/machinery/atmospherics/unary/vent_pump/v in range(1,src))
if(!v.welded)
vent_found = v
else
src << "\red That vent is welded."
if(vent_found)
var/list/vents = list()
if(vent_found.network&&vent_found.network.normal_members.len)
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in vent_found.network.normal_members)
if(temp_vent.loc == loc)
continue
if(temp_vent.welded)
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
if(vent.welded)
continue
var/atom/a = get_turf_loc(vent)
choices.Add(a.loc)
var/turf/startloc = loc
var/obj/selection = input("Select a destination.", "Duct System") in sortAtom(choices)
var/selection_position = choices.Find(selection)
if(loc==startloc)
// Hacky way of hopefully preventing a runtime error from happening
if(vents.len < selection_position)
vents.len = selection_position//What the fuck is this I dont even, Right will likely have to fix this later
var/obj/machinery/atmospherics/unary/vent_pump/target_vent = vents[selection_position]
if(target_vent)
for(var/mob/O in viewers(src, null))
O.show_message(text("<B>[src] scrambles into the ventillation ducts!</B>"), 1)
// var/list/huggers = list()
// for(var/obj/effect/alien/facehugger/F in view(3, src))
// if(istype(F, /obj/effect/alien/facehugger))
// huggers.Add(F)
loc = vent_found
// for(var/obj/effect/alien/facehugger/F in huggers)
// F.loc = vent_found
var/travel_time = get_dist(loc, target_vent.loc)
spawn(round(travel_time/2))//give sound warning to anyone near the target vent
if(!target_vent.welded)
for(var/mob/O in hearers(target_vent, null))
O.show_message("You hear something crawling through the ventilation pipes.",2)
spawn(travel_time)
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
// for(var/obj/effect/alien/facehugger/F in huggers)
// F.loc = loc
else
src << "\green You need to remain still while entering a vent."
else
src << "\green This vent is not connected to anything."
else
src << "\green You must be standing on or beside an open air vent to enter it."
return
/mob/living/carbon/alien/humanoid/proc/neurotoxin(mob/target as mob in oview())
set name = "Spit Neurotoxin (50)"

View File

@@ -13,19 +13,20 @@
real_name = src.name
verbs.Add(/mob/living/carbon/alien/humanoid/proc/corrosive_acid,/mob/living/carbon/alien/humanoid/proc/neurotoxin,/mob/living/carbon/alien/humanoid/proc/resin)
verbs -= /mob/living/carbon/alien/humanoid/verb/ventcrawl
verbs -= /mob/living/carbon/alien/verb/ventcrawl
/mob/living/carbon/alien/humanoid/queen
updatehealth()
if (src.nodamage == 0)
if (src.nodamage)
src.health = 250
src.stat = 0
else
//oxyloss is only used for suicide
//toxloss isn't used for aliens, its actually used as alien powers!!
src.health = 250 - src.getOxyLoss() - src.getFireLoss() - src.getBruteLoss()
else
src.health = 250
src.stat = 0
handle_regular_hud_updates()

View File

@@ -1,47 +1,3 @@
/mob/living/carbon/alien/larva/verb/ventcrawl() // -- TLE
set name = "Crawl through Vent"
set desc = "Enter an air vent and crawl through the pipe system."
set category = "Alien"
// if(!istype(V,/obj/machinery/atmoalter/siphs/fullairsiphon/air_vent))
// return
if(powerc())
var/obj/machinery/atmospherics/unary/vent_pump/vent_found
for(var/obj/machinery/atmospherics/unary/vent_pump/v in range(1,src))
if(!v.welded)
vent_found = v
else
src << "\red That vent is welded."
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_loc(vent)
choices.Add(a.loc)
var/turf/startloc = loc
var/obj/selection = input("Select a destination.", "Duct System") in sortAtom(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 << "\green You need to remain still while entering a vent."
else
src << "\green This vent is not connected to anything."
else
src << "\green You must be standing on or beside an air vent to enter it."
return
/mob/living/carbon/alien/larva/verb/hide()
set name = "Hide"

View File

@@ -0,0 +1,5 @@
/mob/living/carbon/alien/verb/ventcrawl() // -- TLE
set name = "Crawl through Vent"
set desc = "Enter an air vent and crawl through the pipe system."
set category = "Alien"
handle_ventcrawl()

View File

@@ -245,3 +245,80 @@
dna = newDNA
// ++++ROCKDTBEN++++ MOB PROCS //END
/mob/living/carbon/proc/handle_ventcrawl() // -- TLE -- Merged by Carn
if(!stat)
if(!lying)
var/obj/machinery/atmospherics/unary/vent_pump/vent_found
for(var/obj/machinery/atmospherics/unary/vent_pump/v in range(1,src))
if(!v.welded)
vent_found = v
else
src << "\red That vent is welded."
if(vent_found)
if(vent_found.network&&vent_found.network.normal_members.len)
var/list/vents[0]
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in vent_found.network.normal_members)
if(temp_vent.loc == 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
var/turf/startloc = loc
var/obj/selection = input("Select a destination.", "Duct System") as null|anything in sortList(vents)
if(!selection) return
if(loc==startloc)
if(contents.len)
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
var/obj/machinery/atmospherics/unary/vent_pump/target_vent = vents[selection]
if(target_vent)
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
else
src << "You need to remain still while entering a vent."
else
src << "This vent is not connected to anything."
else
src << "You must be standing on or beside an air vent to enter it."
else
src << "You can't vent crawl while you're stunned!"
else
src << "You must be conscious to do this!"
return

View File

@@ -6,13 +6,16 @@
name = text("baby metroid ([rand(1, 1000)])")
else
name = text("adult metroid ([rand(1,1000)])")
real_name = name
spawn (1)
regenerate_icons()
src << "\blue Your icons have been generated!"
..()
/mob/living/carbon/metroid/adult/New()
verbs.Remove(/mob/living/carbon/metroid/verb/ventcrawl)
..()
/mob/living/carbon/metroid/proc/mind_initialize(mob/G)
mind = new
mind.current = src

View File

@@ -232,56 +232,5 @@
set name = "Crawl through Vent"
set desc = "Enter an air vent and crawl through the pipe system."
set category = "Metroid"
if(istype(src, /mob/living/carbon/metroid/adult))
src << "<i>I am much too big to fit in this small vent...</i>"
return
if(!stat)
if(Victim)
src << "<i>Not while I am a feeding...</i>"
return
var/obj/machinery/atmospherics/unary/vent_pump/vent_found
for(var/obj/machinery/atmospherics/unary/vent_pump/v in range(1,src))
if(!v.welded)
vent_found = v
else
src << "\red <i>That vent is welded...</i>"
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_loc(vent)
choices.Add(a.loc)
var/turf/startloc = loc
var/obj/selection = input("Select a destination.", "Duct System") in sortAtom(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())
if ((O.client && !( O.blinded )))
O.show_message(text("<B>[src] scrambles into the ventillation ducts!</B>"), 1)
loc = target_vent.loc
else
src << "<i>I must remain still while entering a vent...</i>"
else
src << "<i>This vent is not connected to anything...</i>"
else
src << "<i>I must be standing on or beside an air vent to enter it...</i>"
else
src << "<i>I must be conscious to do this...</i>"
return
if(Victim) return
handle_ventcrawl()

View File

@@ -2,51 +2,4 @@
set name = "Crawl through Vent"
set desc = "Enter an air vent and crawl through the pipe system."
set category = "Monkey"
if(stat == CONSCIOUS)
if(!lying)
var/obj/machinery/atmospherics/unary/vent_pump/vent_found
for(var/obj/machinery/atmospherics/unary/vent_pump/v in range(1,src))
if(!v.welded)
vent_found = v
else
src << "\red That vent is welded."
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_loc(vent)
choices.Add(a.loc)
var/turf/startloc = loc
var/obj/selection = input("Select a destination.", "Duct System") in sortAtom(choices)
var/selection_position = choices.Find(selection)
if(loc==startloc)
if(contents.len)
for(var/obj/item/carried_item in contents)//If the monkey got on objects.
if(!istype(carried_item, /obj/item/weapon/implant))//If it's not an implant.
src << "\red You can't be carrying items or have items equipped when vent crawling!"
return
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 << "You need to remain still while entering a vent."
else
src << "This vent is not connected to anything."
else
src << "You must be standing on or beside an air vent to enter it."
else
src << "You can't vent crawl while you're stunned!"
else
src << "You must be conscious to do this!"
return
handle_ventcrawl()

View File

@@ -743,6 +743,7 @@
#include "code\modules\mob\living\carbon\carbon_defines.dm"
#include "code\modules\mob\living\carbon\alien\alien.dm"
#include "code\modules\mob\living\carbon\alien\death.dm"
#include "code\modules\mob\living\carbon\alien\powers.dm"
#include "code\modules\mob\living\carbon\alien\say.dm"
#include "code\modules\mob\living\carbon\alien\humanoid\alien_powers.dm"
#include "code\modules\mob\living\carbon\alien\humanoid\death.dm"