From f0b81575e7ccbaeeefea72a9d30690fb7f1ab7cf Mon Sep 17 00:00:00 2001 From: Incoming Date: Tue, 25 Feb 2014 20:43:30 -0500 Subject: [PATCH] Removes the ventcrawl verb, all ventcrawlers are still ventcrawlers and can use ventcrawling with the alt click. This is simutaniously less buggy and far easier to do on the fly. The meat of ventcrawling is now stored in the vent pump, meaning anything can ventcrawl if it has ventcrawling on. Ventcrawling 0 is no crawling, Ventcrawling 1 is naked crawling, Ventcrawling 2 and above is always crawling. Yes you can var edit humans to be able to ventcrawl with this, great if you want to reenact diehard! Simple animals that logically should fit in a vent can now ventcrawl. Note that this only is relevent for player controlled simple animals (staff of change/badminry), it won't be used by the mob AI. --- .../components/unary/vent_pump.dm | 83 ++++++++++++++-- code/modules/mob/living/carbon/alien/alien.dm | 1 + .../mob/living/carbon/alien/humanoid/queen.dm | 4 +- .../modules/mob/living/carbon/alien/powers.dm | 5 - code/modules/mob/living/carbon/carbon.dm | 95 +------------------ .../mob/living/carbon/metroid/metroid.dm | 1 + .../mob/living/carbon/metroid/powers.dm | 11 +-- .../mob/living/carbon/monkey/monkey.dm | 1 + .../mob/living/carbon/monkey/powers.dm | 5 - code/modules/mob/living/living_defines.dm | 2 + .../mob/living/simple_animal/friendly/crab.dm | 1 + .../simple_animal/friendly/farm_animals.dm | 2 + .../living/simple_animal/friendly/lizard.dm | 3 +- .../living/simple_animal/friendly/mouse.dm | 1 + .../living/simple_animal/friendly/slime.dm | 1 + .../living/simple_animal/friendly/tomato.dm | 3 +- .../simple_animal/hostile/giant_spider.dm | 1 + .../living/simple_animal/hostile/mushroom.dm | 1 + .../simple_animal/hostile/retaliate/bat.dm | 1 + 19 files changed, 94 insertions(+), 128 deletions(-) delete mode 100644 code/modules/mob/living/carbon/alien/powers.dm delete mode 100644 code/modules/mob/living/carbon/monkey/powers.dm diff --git a/code/ATMOSPHERICS/components/unary/vent_pump.dm b/code/ATMOSPHERICS/components/unary/vent_pump.dm index 8af45a38ba4..34fb0df284a 100644 --- a/code/ATMOSPHERICS/components/unary/vent_pump.dm +++ b/code/ATMOSPHERICS/components/unary/vent_pump.dm @@ -322,14 +322,77 @@ return /* - Alt-click to ventcrawl - Monkeys, aliens, and slimes - This is a little buggy but somehow that just seems to plague ventcrawl. - I am sorry, I don't know why. + Alt-click to ventcrawl */ -/obj/machinery/atmospherics/unary/vent_pump/AltClick(var/mob/living/carbon/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) - if(length(ML.verbs & ventcrawl_verbs)) // alien queens have this removed, an istype would be complicated - ML.handle_ventcrawl(src) - return - ..() +/obj/machinery/atmospherics/unary/vent_pump/AltClick(var/mob/living/L) + if(!L.ventcrawler || !isliving(L) || !Adjacent(L)) + return + if(L.stat) + L << "You must be conscious to do this!" + return + if(L.lying) + L << "You can't vent crawl while you're stunned!" + return + if(welded) + L << "That vent is welded shut." + return + + /*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(!network || !network.normal_members.len) + L << "This vent is not connected to anything." + return + + var/list/vents = list() + for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in 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) + L << " There are no available vents to travel to, they could be welded. " + return + + var/obj/selection = input(L,"Select a destination.", "Duct System") as null|anything in sortAssoc(vents) + if(!selection) return + + if(!Adjacent(L)) + return + if(iscarbon(L) && L.ventcrawler < 2) // lesser ventcrawlers can't bring items + for(var/obj/item/carried_item in L.contents) + if(!istype(carried_item, /obj/item/weapon/implant))//If it's not an implant or a facehugger + L << " 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) + return + + for(var/mob/O in viewers(L, null)) + O.show_message(text("[L] scrambles into the ventillation ducts!"), 1) + + for(var/mob/O in hearers(target_vent,null)) + O.show_message("You hear something squeezing through the ventilation ducts.",2) + + if(target_vent.welded) //the vent can be welded while they scrolled through the list. + target_vent = src + L << " The vent you were heading to appears to be welded." + L.loc = target_vent.loc + var/area/new_area = get_area(loc) + if(new_area) + new_area.Entered(L) diff --git a/code/modules/mob/living/carbon/alien/alien.dm b/code/modules/mob/living/carbon/alien/alien.dm index 2de3f3ef8d4..ddbaeafd8b7 100644 --- a/code/modules/mob/living/carbon/alien/alien.dm +++ b/code/modules/mob/living/carbon/alien/alien.dm @@ -11,6 +11,7 @@ gender = NEUTER dna = null faction = "alien" + ventcrawler = 2 var/storedPlasma = 250 var/max_plasma = 500 diff --git a/code/modules/mob/living/carbon/alien/humanoid/queen.dm b/code/modules/mob/living/carbon/alien/humanoid/queen.dm index 524405ec1d5..bdbb5bbcad5 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/queen.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/queen.dm @@ -7,6 +7,7 @@ status_flags = CANPARALYSE heal_rate = 5 plasma_rate = 20 + ventcrawler = 0 //pull over that ass too fat /mob/living/carbon/alien/humanoid/queen/New() @@ -22,7 +23,6 @@ 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/verb/ventcrawl ..() /mob/living/carbon/alien/humanoid/queen/handle_regular_hud_updates() @@ -85,4 +85,4 @@ else icon_state = "queen_s" for(var/image/I in overlays_standing) - overlays += I + overlays += I diff --git a/code/modules/mob/living/carbon/alien/powers.dm b/code/modules/mob/living/carbon/alien/powers.dm deleted file mode 100644 index d9452a8d799..00000000000 --- a/code/modules/mob/living/carbon/alien/powers.dm +++ /dev/null @@ -1,5 +0,0 @@ -/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 99f30cceec9..35a9031a6e6 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -221,99 +221,6 @@ // ++++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("[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 - var/area/new_area = get_area(loc) - if(new_area) - new_area.Entered(src) - - /mob/living/carbon/clean_blood() if(ishuman(src)) var/mob/living/carbon/human/H = src @@ -553,4 +460,4 @@ var/const/GALOSHES_DONT_HELP = 8 loc.handle_slip(src, s_amount, w_amount, O, lube) /mob/living/carbon/fall(var/forced) - loc.handle_fall(src, forced)//it's loc so it doesn't call the mob's handle_fall which does nothing + loc.handle_fall(src, forced)//it's loc so it doesn't call the mob's handle_fall which does nothing diff --git a/code/modules/mob/living/carbon/metroid/metroid.dm b/code/modules/mob/living/carbon/metroid/metroid.dm index fd6f3c0c9f9..25ff7633f35 100644 --- a/code/modules/mob/living/carbon/metroid/metroid.dm +++ b/code/modules/mob/living/carbon/metroid/metroid.dm @@ -5,6 +5,7 @@ pass_flags = PASSTABLE voice_message = "skree!" say_message = "hums" + ventcrawler = 2 var/is_adult = 0 layer = 5 diff --git a/code/modules/mob/living/carbon/metroid/powers.dm b/code/modules/mob/living/carbon/metroid/powers.dm index 6f186f0087c..ed7149cdd83 100644 --- a/code/modules/mob/living/carbon/metroid/powers.dm +++ b/code/modules/mob/living/carbon/metroid/powers.dm @@ -225,13 +225,4 @@ else src << "I am not ready to reproduce yet..." else - src << "I am not old enough to reproduce yet..." - - - -/mob/living/carbon/slime/verb/ventcrawl() - set name = "Crawl through Vent" - set desc = "Enter an air vent and crawl through the pipe system." - set category = "Slime" - if(Victim) return - handle_ventcrawl() \ No newline at end of file + src << "I am not old enough to reproduce yet..." \ No newline at end of file diff --git a/code/modules/mob/living/carbon/monkey/monkey.dm b/code/modules/mob/living/carbon/monkey/monkey.dm index 5f013d6b304..89374137ff4 100644 --- a/code/modules/mob/living/carbon/monkey/monkey.dm +++ b/code/modules/mob/living/carbon/monkey/monkey.dm @@ -8,6 +8,7 @@ gender = NEUTER pass_flags = PASSTABLE update_icon = 0 ///no need to call regenerate_icon + ventcrawler = 1 /mob/living/carbon/monkey/New() create_reagents(1000) diff --git a/code/modules/mob/living/carbon/monkey/powers.dm b/code/modules/mob/living/carbon/monkey/powers.dm deleted file mode 100644 index e7c6937cda2..00000000000 --- a/code/modules/mob/living/carbon/monkey/powers.dm +++ /dev/null @@ -1,5 +0,0 @@ -/mob/living/carbon/monkey/verb/ventcrawl() - set name = "Crawl through Vent" - set desc = "Enter an air vent and crawl through the pipe system." - set category = "Monkey" - handle_ventcrawl() diff --git a/code/modules/mob/living/living_defines.dm b/code/modules/mob/living/living_defines.dm index 9af8ddf1526..8168e11778a 100644 --- a/code/modules/mob/living/living_defines.dm +++ b/code/modules/mob/living/living_defines.dm @@ -35,3 +35,5 @@ var/on_fire = 0 //The "Are we on fire?" var var/fire_stacks = 0 //Tracks how many stacks of fire we have on, max is usually 20 + + var/ventcrawler = 0 //0 No vent crawling, 1 vent crawling in the nude, 2 vent crawling always diff --git a/code/modules/mob/living/simple_animal/friendly/crab.dm b/code/modules/mob/living/simple_animal/friendly/crab.dm index a033f81ac63..0df85076f4f 100644 --- a/code/modules/mob/living/simple_animal/friendly/crab.dm +++ b/code/modules/mob/living/simple_animal/friendly/crab.dm @@ -16,6 +16,7 @@ response_harm = "stomps" stop_automated_movement = 1 friendly = "pinches" + ventcrawler = 2 var/obj/item/inventory_head var/obj/item/inventory_mask diff --git a/code/modules/mob/living/simple_animal/friendly/farm_animals.dm b/code/modules/mob/living/simple_animal/friendly/farm_animals.dm index e997036477f..e56df2e9648 100644 --- a/code/modules/mob/living/simple_animal/friendly/farm_animals.dm +++ b/code/modules/mob/living/simple_animal/friendly/farm_animals.dm @@ -166,6 +166,7 @@ response_harm = "kicks" attacktext = "kicks" health = 1 + ventcrawler = 2 var/amount_grown = 0 pass_flags = PASSTABLE | PASSGRILLE @@ -206,6 +207,7 @@ var/global/chicken_count = 0 response_harm = "kicks" attacktext = "kicks" health = 10 + ventcrawler = 2 var/eggsleft = 0 var/body_color pass_flags = PASSTABLE diff --git a/code/modules/mob/living/simple_animal/friendly/lizard.dm b/code/modules/mob/living/simple_animal/friendly/lizard.dm index 48b5685e6dc..5cfb67fa0e3 100644 --- a/code/modules/mob/living/simple_animal/friendly/lizard.dm +++ b/code/modules/mob/living/simple_animal/friendly/lizard.dm @@ -13,4 +13,5 @@ melee_damage_upper = 2 response_help = "pets" response_disarm = "shoos" - response_harm = "stomps on" \ No newline at end of file + response_harm = "stomps on" + ventcrawler = 2 \ No newline at end of file diff --git a/code/modules/mob/living/simple_animal/friendly/mouse.dm b/code/modules/mob/living/simple_animal/friendly/mouse.dm index e1b266d7edf..6fd06c6a3cb 100644 --- a/code/modules/mob/living/simple_animal/friendly/mouse.dm +++ b/code/modules/mob/living/simple_animal/friendly/mouse.dm @@ -18,6 +18,7 @@ response_disarm = "gently pushes aside" response_harm = "splats" density = 0 + ventcrawler = 2 var/body_color //brown, gray and white, leave blank for random /mob/living/simple_animal/mouse/New() diff --git a/code/modules/mob/living/simple_animal/friendly/slime.dm b/code/modules/mob/living/simple_animal/friendly/slime.dm index b49c3e9eabc..de3b5e5a313 100644 --- a/code/modules/mob/living/simple_animal/friendly/slime.dm +++ b/code/modules/mob/living/simple_animal/friendly/slime.dm @@ -12,6 +12,7 @@ response_disarm = "shoos" response_harm = "stomps on" emote_see = list("jiggles", "bounces in place") + ventcrawler = 2 var/colour = "grey" /mob/living/simple_animal/slime/Bump(atom/movable/AM as mob|obj, yes) diff --git a/code/modules/mob/living/simple_animal/friendly/tomato.dm b/code/modules/mob/living/simple_animal/friendly/tomato.dm index 57c0f4c939b..30e675e5a8e 100644 --- a/code/modules/mob/living/simple_animal/friendly/tomato.dm +++ b/code/modules/mob/living/simple_animal/friendly/tomato.dm @@ -12,4 +12,5 @@ response_help = "prods" response_disarm = "pushes aside" response_harm = "smacks" - harm_intent_damage = 5 \ No newline at end of file + harm_intent_damage = 5 + ventcrawler = 2 diff --git a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm index c4e1c38c32d..e0a39a8aa8d 100644 --- a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm +++ b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm @@ -34,6 +34,7 @@ var/busy = 0 pass_flags = PASSTABLE move_to_delay = 6 + ventcrawler = 2 //nursemaids - these create webs and eggs /mob/living/simple_animal/hostile/giant_spider/nurse diff --git a/code/modules/mob/living/simple_animal/hostile/mushroom.dm b/code/modules/mob/living/simple_animal/hostile/mushroom.dm index 88770679633..42ee3d600f4 100644 --- a/code/modules/mob/living/simple_animal/hostile/mushroom.dm +++ b/code/modules/mob/living/simple_animal/hostile/mushroom.dm @@ -22,6 +22,7 @@ stat_attack = 2 mouse_opacity = 1 speed = 1 + ventcrawler = 2 var/powerlevel = 0 //Tracks our general strength level gained from eating other shrooms var/bruised = 0 //If someone tries to cheat the system by attacking a shroom to lower its health, punish them so that it wont award levels to shrooms that eat it var/recovery_cooldown = 0 //So you can't repeatedly revive it during a fight diff --git a/code/modules/mob/living/simple_animal/hostile/retaliate/bat.dm b/code/modules/mob/living/simple_animal/hostile/retaliate/bat.dm index 5c575649e83..8e32e320b36 100644 --- a/code/modules/mob/living/simple_animal/hostile/retaliate/bat.dm +++ b/code/modules/mob/living/simple_animal/hostile/retaliate/bat.dm @@ -23,6 +23,7 @@ faction = "carp" attack_sound = 'sound/weapons/bite.ogg' environment_smash = 0 + ventcrawler = 2 //Space bats need no air to fly in.