From a4681d5d3d7e674d82fd2d9adaf4b6359a66056d Mon Sep 17 00:00:00 2001 From: "elly1989@rocketmail.com" Date: Sun, 22 Jul 2012 02:57:26 +0000 Subject: [PATCH] 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 --- code/modules/admin/verbs/randomverbs.dm | 2 +- .../carbon/alien/humanoid/alien_powers.dm | 74 ------------------ .../mob/living/carbon/alien/humanoid/queen.dm | 13 ++-- .../mob/living/carbon/alien/larva/powers.dm | 44 ----------- .../modules/mob/living/carbon/alien/powers.dm | 5 ++ code/modules/mob/living/carbon/carbon.dm | 77 +++++++++++++++++++ .../mob/living/carbon/metroid/metroid.dm | 5 +- .../mob/living/carbon/metroid/powers.dm | 55 +------------ .../mob/living/carbon/monkey/powers.dm | 49 +----------- tgstation.dme | 1 + 10 files changed, 98 insertions(+), 227 deletions(-) create mode 100644 code/modules/mob/living/carbon/alien/powers.dm diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 66d33b5bead..0822256a695 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -630,7 +630,7 @@ Traitors and the like can also be revived with the previous role mostly intact. if (alert(src, "Are you sure you want to do this? It will laaag.", "Confirmation", "Yes", "No") == "No") return - explosion (O, devastation, heavy, light, flash) + explosion(O, devastation, heavy, light, flash) log_admin("[key_name(usr)] created an explosion ([devastation],[heavy],[light],[flash]) at ([O.x],[O.y],[O.z])") message_admins("[key_name_admin(usr)] created an explosion ([devastation],[heavy],[light],[flash]) at ([O.x],[O.y],[O.z])", 1) feedback_add_details("admin_verb","EXPL") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! diff --git a/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm b/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm index 10ebd1e2a8b..5fe835c7ba3 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm @@ -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("[src] scrambles into the ventillation ducts!"), 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)" diff --git a/code/modules/mob/living/carbon/alien/humanoid/queen.dm b/code/modules/mob/living/carbon/alien/humanoid/queen.dm index 91a93d498a0..fd040971307 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/queen.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/queen.dm @@ -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) - //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 + 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() + handle_regular_hud_updates() diff --git a/code/modules/mob/living/carbon/alien/larva/powers.dm b/code/modules/mob/living/carbon/alien/larva/powers.dm index 97a44f39787..15c02bfb393 100644 --- a/code/modules/mob/living/carbon/alien/larva/powers.dm +++ b/code/modules/mob/living/carbon/alien/larva/powers.dm @@ -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("[src] scrambles into the ventillation ducts!"), 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" diff --git a/code/modules/mob/living/carbon/alien/powers.dm b/code/modules/mob/living/carbon/alien/powers.dm new file mode 100644 index 00000000000..47059c78e32 --- /dev/null +++ b/code/modules/mob/living/carbon/alien/powers.dm @@ -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() \ No newline at end of file diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 6ba7f7506e9..652e2e3eb7f 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -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("[src] scrambles into the ventillation ducts!"), 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 + diff --git a/code/modules/mob/living/carbon/metroid/metroid.dm b/code/modules/mob/living/carbon/metroid/metroid.dm index 4ad92a47e17..1712d5bf766 100644 --- a/code/modules/mob/living/carbon/metroid/metroid.dm +++ b/code/modules/mob/living/carbon/metroid/metroid.dm @@ -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 diff --git a/code/modules/mob/living/carbon/metroid/powers.dm b/code/modules/mob/living/carbon/metroid/powers.dm index e7011c0f8a6..38ccf90ae3d 100644 --- a/code/modules/mob/living/carbon/metroid/powers.dm +++ b/code/modules/mob/living/carbon/metroid/powers.dm @@ -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 am much too big to fit in this small vent..." - return - - if(!stat) - - if(Victim) - src << "Not while I am a feeding..." - 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 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()) - if ((O.client && !( O.blinded ))) - O.show_message(text("[src] scrambles into the ventillation ducts!"), 1) - loc = target_vent.loc - else - src << "I must remain still while entering a vent..." - else - src << "This vent is not connected to anything..." - else - src << "I must be standing on or beside an air vent to enter it..." - else - src << "I must be conscious to do this..." - return - - - - + if(Victim) return + handle_ventcrawl() diff --git a/code/modules/mob/living/carbon/monkey/powers.dm b/code/modules/mob/living/carbon/monkey/powers.dm index 873c35dcc38..e7c6937cda2 100644 --- a/code/modules/mob/living/carbon/monkey/powers.dm +++ b/code/modules/mob/living/carbon/monkey/powers.dm @@ -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("[src] scrambles into the ventillation ducts!"), 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 \ No newline at end of file + handle_ventcrawl() diff --git a/tgstation.dme b/tgstation.dme index 3b486e968f5..c63d6205387 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -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"