Files
Bubberstation/code/game/objects/structures/plasticflaps.dm
Kyle Spier-Swenson dedb16826e Speeds up world init. (93s -> 49s) (#21992)
* Speeds up world init.

* Armor is now new inited for obj and the first level of subpaths.
* Actions is now lazyinited and deleted with empty.
* Actiontypes is now only inited when actually used and deleted once it pre-fills actions with the action buttons.
* Pipes now prefill their node list(s) in new() using new /list/ (count) syntax to speed up the list initaliztions and remove the init proc.
* Pipes no longer store their item version, instead creating it on the fly when deconned
* Walls no longer store their metal stacks, instead creating it on the fly when deconned.
* obj, walls, floor, plating, item, machinery, structure, pipe, pipenet, atom, and movable no longer have an (init) proc. (along with a few other smaller examples)
* Atmos can pass checking is now a var with the ability to have a proc be call in advance cases.
  * (as a side effect, I had to fix a few things that were calling atmosCanPass rather then using the pre-calculated list, this should speed up chemfoam and flame effects greatly)

* Reverts upload limit
(remind me one day to defuck this, it could easily be a config thats not editable by vv to make changes easier)

* Makes apc update icon a bit faster.
APC new is some what high on the profile of world init, still not sure why, but this stood out as a waste of cpu so i fixed it.

* Fixes runtime with atmos backpack water tanks.

* Makes smoothing faster (and fixes turfs smoothing twice at init)

* Makes apcs init faster by replacing some spawns with addtimer

* fix transit turfs.
2016-12-08 21:50:15 +13:00

63 lines
1.9 KiB
Plaintext

/obj/structure/plasticflaps
name = "plastic flaps"
desc = "Definitely can't get past those. No way."
icon = 'icons/obj/stationobjs.dmi'
icon_state = "plasticflaps"
armor = list(melee = 100, bullet = 80, laser = 80, energy = 100, bomb = 50, bio = 100, rad = 100, fire = 50, acid = 50)
density = 0
anchored = 1
layer = ABOVE_MOB_LAYER
/obj/structure/plasticflaps/CanAStarPass(ID, to_dir, caller)
if(isliving(caller))
if(isbot(caller))
return 1
var/mob/living/M = caller
if(!M.ventcrawler && M.mob_size != MOB_SIZE_TINY)
return 0
return 1 //diseases, stings, etc can pass
/obj/structure/plasticflaps/CanPass(atom/movable/A, turf/T)
if(istype(A) && A.checkpass(PASSGLASS))
return prob(60)
var/obj/structure/bed/B = A
if(istype(A, /obj/structure/bed) && (B.has_buckled_mobs() || B.density))//if it's a bed/chair and is dense or someone is buckled, it will not pass
return 0
if(istype(A, /obj/structure/closet/cardboard))
var/obj/structure/closet/cardboard/C = A
if(C.move_delay)
return 0
if(istype(A, /obj/mecha))
return 0
else if(isliving(A)) // You Shall Not Pass!
var/mob/living/M = A
if(isbot(A)) //Bots understand the secrets
return 1
if(M.buckled && istype(M.buckled, /mob/living/simple_animal/bot/mulebot)) // mulebot passenger gets a free pass.
return 1
if(!M.lying && !M.ventcrawler && M.mob_size != MOB_SIZE_TINY) //If your not laying down, or a ventcrawler or a small creature, no pass.
return 0
return ..()
/obj/structure/plasticflaps/mining //A specific type for mining that doesn't allow airflow because of them damn crates
name = "airtight plastic flaps"
desc = "Heavy duty, airtight, plastic flaps."
CanAtmosPass = ATMOS_PASS_NO
/obj/structure/plasticflaps/mining/New()
air_update_turf(1)
. = ..()
/obj/structure/plasticflaps/mining/Destroy()
var/atom/oldloc = loc
. = ..()
if (oldloc)
oldloc.air_update_turf(1)