Generic ventcrawling + Bugfixes

This commit makes the ventcrawling system operate independant of
ventcrawling verbs. Every type of /mob/living now has a ventcrawling
variable, which allows them to interact with the ventcrawling system if
set to 1 or 2. The AltClickOn() defines for each ventcrawling mob have
been removed, and replaced with a single AltClick() define on ventcrawl
machinery.
This commit is contained in:
Tigercat2000
2015-05-11 06:28:44 -07:00
parent f6a88fa251
commit 1266df1f3d
20 changed files with 108 additions and 177 deletions
+1 -34
View File
@@ -2,37 +2,4 @@
Creature-level abilities.
*/
/var/global/list/ability_verbs = list( )
/*
/mob/living/carbon/human/slime/proc/slimepeople_ventcrawl() // Slime people ventcrawling commented out
set category = "Abilities"
set name = "Ventcrawl (Slime People)"
set desc = "The ability to crawl through vents if naked and not holding anything."
if(istype(usr,/mob/living/carbon/human/slime))
var/mob/living/carbon/human/slime/M = usr
// Check if the client has a mob and if the mob is valid and alive.
if(M.stat==2)
M << "\red You must be corporeal and alive to do that."
return 0
//Handcuff check.
if(M.restrained())
M << "\red You cannot do this while restrained."
return 0
if(M.handcuffed)
M << "\red You cannot do this while cuffed."
return 0
if(M.contents.len != 0)
M << "\red You need to be naked and have nothing in your hands to ventcrawl."
return 0
M.handle_ventcrawl()
else
src << "This should not be happening. At all."
*/
/var/global/list/ability_verbs = list( )
@@ -33,6 +33,7 @@
var/large = 0
var/heat_protection = 0.5
var/leaping = 0
ventcrawler = 2
/mob/living/carbon/alien/New()
verbs += /mob/living/carbon/verb/mob_sleep
@@ -10,6 +10,7 @@
move_delay_add = 3
max_plasma = 1000
large = 1
ventcrawler = 0
/mob/living/carbon/alien/humanoid/empress/large
name = "alien empress"
@@ -47,7 +48,6 @@
real_name = src.name
verbs.Add(/mob/living/carbon/alien/humanoid/proc/corrosive_acid,/mob/living/carbon/alien/humanoid/proc/resin)
verbs -= /mob/living/carbon/alien/verb/ventcrawl
..()
/mob/living/carbon/alien/humanoid/empress
@@ -8,6 +8,7 @@
heal_rate = 5
plasma_rate = 20
large = 1
ventcrawler = 0
/mob/living/carbon/alien/humanoid/queen/New()
var/datum/reagents/R = new/datum/reagents(100)
@@ -24,7 +25,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
..()
@@ -1,5 +0,0 @@
/mob/living/carbon/alien/verb/ventcrawl(var/atom/pipe) // -- TLE
set name = "Crawl Through Vent(Alien)"
set desc = "Enter an air vent and crawl through the pipe system."
set category = "Alien"
handle_ventcrawl(pipe)
+71 -50
View File
@@ -268,70 +268,79 @@ mob/living
/mob/living/carbon/proc/setDNA(var/datum/dna/newDNA)
dna = newDNA
/mob/living/carbon/can_use_vents()
return
var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump, /obj/machinery/atmospherics/unary/vent_scrubber)
/mob/living/proc/handle_ventcrawl(var/atom/clicked_on) // -- TLE -- Merged by Carn
diary << "[src] is ventcrawling."
if(!stat)
if(!lying)
if(!Adjacent(clicked_on))
return
/*
if(clicked_on)
world << "We start with [clicked_on], and [clicked_on.type]"
*/
var/obj/machinery/atmospherics/unary/vent_found
var/IsVentcrawler = 1
if(!ventcrawler)
IsVentcrawler = 0
if(ishuman(src))
var/mob/living/carbon/human/H = src
if(!H.species.ventcrawler) IsVentcrawler = 1
if(clicked_on && Adjacent(clicked_on))
vent_found = clicked_on
if(!istype(vent_found) || !vent_found.can_crawl_through())
vent_found = null
if(!IsVentcrawler) return
if(stat)
src << "You must be conscious to do this!"
return
if(lying)
src << "You can't vent crawl while you're stunned!"
return
var/obj/machinery/atmospherics/unary/vent_found
if(clicked_on)
vent_found = clicked_on
if(!istype(vent_found) || !vent_found.can_crawl_through())
vent_found = null
if(!vent_found)
for(var/obj/machinery/atmospherics/machine in range(1,src))
if(is_type_in_list(machine, ventcrawl_machinery))
vent_found = machine
if(!vent_found)
for(var/obj/machinery/atmospherics/machine in range(1,src))
if(is_type_in_list(machine, ventcrawl_machinery))
vent_found = machine
if(!vent_found.can_crawl_through())
vent_found = null
if(vent_found)
break
if(!vent_found.can_crawl_through())
vent_found = null
if(vent_found)
if(vent_found.network && (vent_found.network.normal_members.len || vent_found.network.line_members.len))
break
src << "You begin climbing into the ventilation system..."
if(!do_after(src, 45))
if(vent_found)
if(vent_found.network && (vent_found.network.normal_members.len || vent_found.network.line_members.len))
visible_message("<span class='notice'>[src] begins climbing into the ventilation system...</span>", \
"<span class='notice'>You begin climbing into the ventilation system...</span>")
if(!do_after(src, 45))
return
if(!client)
return
if(iscarbon(src) && contents.len && ventcrawler < 2)//It must have atleast been 1 to get this far
for(var/obj/item/I in contents)
var/failed = 0
if(istype(I, /obj/item/weapon/implant))
continue
else
failed++
if(failed)
src << "<span class='warning'>You can't crawl around in the ventilation ducts with items!</span>"
return
if(!client)
return
if(contents.len && !isrobot(src))
for(var/obj/item/carried_item in contents)//If the ventcrawler got on objects.
if(!(isInTypes(carried_item, canEnterVentWith)))
src << "<SPAN CLASS='warning'>You can't be carrying items or have items equipped when vent crawling!</SPAN>"
return
visible_message("<B>[src] scrambles into the ventilation ducts!</B>", "You climb into the ventilation system.")
loc = vent_found
add_ventcrawl(vent_found)
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!"
visible_message("<b>[src] scrambles into the ventilation ducts!</b>", "You climb into the ventilation system.")
src.loc = vent_found
add_ventcrawl(vent_found)
else
src << "You must be conscious to do this!"
return
src << "<span class='warning'>This ventilation duct is not connected to anything!</span>"
/mob/living/proc/add_ventcrawl(obj/machinery/atmospherics/starting_machine)
var/datum/pipe_network/network = starting_machine.return_network(starting_machine)
@@ -352,6 +361,18 @@ mob/living
pipes_shown.len = 0
//OOP
/atom/proc/update_pipe_vision()
return
/mob/living/update_pipe_vision()
if(pipes_shown.len)
if(!istype(loc, /obj/machinery/atmospherics))
remove_ventcrawl()
else
if(istype(loc, /obj/machinery/atmospherics))
add_ventcrawl(loc)
/mob/living/carbon/clean_blood()
. = ..()
if(ishuman(src))
@@ -225,11 +225,4 @@
else
src << "<i>I am not ready to reproduce yet...</i>"
else
src << "<i>I am not old enough to reproduce yet...</i>"
/mob/living/carbon/slime/verb/ventcrawl(var/atom/pipe)
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(pipe)
src << "<i>I am not old enough to reproduce yet...</i>"
@@ -10,6 +10,7 @@
icon_state = "nymph1"
var/list/donors = list()
var/ready_evolve = 0
ventcrawler = 1
/mob/living/carbon/monkey/diona/New()
@@ -17,7 +18,6 @@
gender = NEUTER
greaterform = "Diona"
add_language("Rootspeak")
verbs -= /mob/living/carbon/monkey/verb/ventcrawl
/mob/living/carbon/monkey/diona/attack_hand(mob/living/carbon/human/M as mob)
@@ -50,13 +50,6 @@
src.verbs += /mob/living/carbon/monkey/diona/proc/merge
//Verbs after this point.
/mob/living/carbon/monkey/diona/verb/dionaventcrawl()
set name = "Crawl through Vent"
set desc = "Enter an air vent and crawl through the pipe system."
set category = "Diona"
handle_ventcrawl()
/mob/living/carbon/monkey/diona/proc/merge()
set category = "Diona"
@@ -15,6 +15,7 @@
var/list/uni_append = list(0x12C,0x4E2) // Same as above for DNA2.
var/update_muts = 1 // Monkey gene must be set at start.
var/alien = 0 //Used for reagent metabolism.
ventcrawler = 2
/mob/living/carbon/monkey/tajara
name = "farwa"
@@ -1,5 +0,0 @@
/mob/living/carbon/monkey/verb/ventcrawl(var/atom/pipe)
set name = "Crawl through Vent"
set desc = "Enter an air vent and crawl through the pipe system."
set category = "Monkey"
handle_ventcrawl(pipe)
+4 -1
View File
@@ -47,6 +47,8 @@
var/max_hurt_damage = 9 // Max melee damage dealt + 5 if hulk
var/list/default_genes = list()
var/ventcrawler = 0 //Determines if the mob can go through the vents.
var/flags = 0 // Various specific features.
var/bloodflags=0
var/bodyflags=0
@@ -559,11 +561,12 @@
bodyflags = HAS_SKIN_COLOR
bloodflags = BLOOD_SLIME
//ventcrawler = 1 //ventcrawling commented out
has_organ = list(
"brain" = /obj/item/organ/brain/slime
)
/datum/species/grey
name = "Grey"
icobase = 'icons/mob/human_races/r_grey.dmi'
@@ -47,5 +47,6 @@
var/floating = 0
var/nightvision = 0
var/ventcrawler = 0 //0 No vent crawling, 1 vent crawling in the nude, 2 vent crawling always
var/list/icon/pipes_shown = list()
var/last_played_vent
+9 -4
View File
@@ -7,10 +7,15 @@
//If they're SSD, remove it so they can wake back up.
player_logged = 0
//login during ventcrawl
if(istype(loc, /obj/machinery/atmospherics)) //attach us back into the pipes
remove_ventcrawl()
add_ventcrawl(loc)
//Vents
if(ishuman(src))
var/mob/living/carbon/human/H
if(H.species.ventcrawler)
src << "<span class='notice'>You can ventcrawl! Use alt+click on vents to quickly travel about the station.</span>"
if(ventcrawler)
src << "<span class='notice'>You can ventcrawl! Use alt+click on vents to quickly travel about the station.</span>"
//Should update regardless of if we can ventcrawl, since we can end up in pipes in other ways.
update_pipe_vision()
//Round specific stuff like hud updates
if(ticker && ticker.mode)
@@ -51,6 +51,7 @@
small = 1
density = 0
pass_flags = PASSTABLE
ventcrawler = 2
var/used_dominate
var/chemicals = 10 // Chemicals used for reproduction and spitting neurotoxin.
@@ -456,12 +457,6 @@ mob/living/simple_animal/borer/proc/detatch()
host_brain.real_name = M.real_name
host.status_flags |= PASSEMOTES
/mob/living/simple_animal/borer/verb/ventcrawl(var/atom/pipe)
set name = "Crawl through vent (borer)"
set desc = "Enter an air vent and crawl through the pipe system."
set category = "Alien"
handle_ventcrawl(pipe)
/mob/living/simple_animal/borer/can_use_vents()
return
@@ -29,6 +29,7 @@
maxbodytemp = 323 //Above 50 Degrees Celcius
universal_speak = 0
can_hide = 1
ventcrawler = 2
/mob/living/simple_animal/mouse/Life()
..()
@@ -69,13 +70,6 @@
if(client)
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(var/atom/pipe)
set name = "Crawl through Vent"
set desc = "Enter an air vent and crawl through the pipe system."
set category = "Mouse"
handle_ventcrawl(pipe)
//make mice fit under tables etc? this was hacky, and not working
/*
/mob/living/simple_animal/mouse/Move(var/dir)
@@ -41,6 +41,7 @@
small = 1
speak_emote = list("beeps","clicks","chirps")
can_hide = 1
ventcrawler = 2
/mob/living/simple_animal/spiderbot/attackby(var/obj/item/O as obj, var/mob/user as mob, params)
@@ -217,13 +218,6 @@
robogibs(src.loc, viruses)
src.Destroy()
return
//copy paste from alien/larva, if that func is updated please update this one also
/mob/living/simple_animal/spiderbot/verb/ventcrawl(var/atom/pipe)
set name = "Crawl through Vent"
set desc = "Enter an air vent and crawl through the pipe system."
set category = "Spiderbot"
handle_ventcrawl(pipe)
//Cannibalized from the parrot mob. ~Zuhayr
/mob/living/simple_animal/spiderbot/verb/drop_held_item()
+7
View File
@@ -228,6 +228,8 @@
callHook("borgify", list(O))
O.update_pipe_vision()
O.Namepick()
spawn(0)//To prevent the proc from returning null.
@@ -262,6 +264,7 @@
new_xeno.key = key
new_xeno << "<B>You are now an alien.</B>"
new_xeno.update_pipe_vision()
spawn(0)//To prevent the proc from returning null.
del(src)
return
@@ -297,6 +300,7 @@
new_slime.key = key
new_slime << "<B>You are now a slime. Skreee!</B>"
new_slime.update_pipe_vision()
spawn(0)//To prevent the proc from returning null.
del(src)
return
@@ -319,6 +323,7 @@
new_corgi.key = key
new_corgi << "<B>You are now a Corgi. Yap Yap!</B>"
new_corgi.update_pipe_vision()
spawn(0)//To prevent the proc from returning null.
del(src)
return
@@ -353,6 +358,7 @@
new_mob << "You suddenly feel more... animalistic."
new_mob.update_pipe_vision()
spawn()
del(src)
return
@@ -371,6 +377,7 @@
new_mob.key = key
new_mob.a_intent = "harm"
new_mob << "You feel more... animalistic"
new_mob.update_pipe_vision()
del(src)