/obj/structure/plasticflaps
name = "plastic flaps"
desc = "Completely impassable - or are they?"
icon = 'icons/obj/stationobjs.dmi'
icon_state = "plasticflaps"
density = 0
anchored = 1
layer = 4
armor = list(melee = 100, bullet = 80, laser = 80, energy = 100, bomb = 50, bio = 100, rad = 100, fire = 50, acid = 50)
var/state = PLASTIC_FLAPS_NORMAL
/obj/structure/plasticflaps/examine(mob/user)
. = ..()
switch(state)
if(PLASTIC_FLAPS_NORMAL)
. += "[src] are screwed to the floor."
if(PLASTIC_FLAPS_DETACHED)
. += "[src] are no longer screwed to the floor, and the flaps can be sliced apart."
/obj/structure/plasticflaps/attackby(obj/item/W, mob/user, params)
add_fingerprint(user)
if(isscrewdriver(W))
if(state == PLASTIC_FLAPS_NORMAL)
playsound(loc, W.usesound, 100, 1)
user.visible_message("[user] unscrews [src] from the floor.", "You start to unscrew [src] from the floor...", "You hear rustling noises.")
if(do_after(user, 180*W.toolspeed, target = src))
if(state != PLASTIC_FLAPS_NORMAL)
return
state = PLASTIC_FLAPS_DETACHED
anchored = FALSE
to_chat(user, "You unscrew [src] from the floor.")
else if(state == PLASTIC_FLAPS_DETACHED)
playsound(loc, W.usesound, 100, 1)
user.visible_message("[user] screws [src] to the floor.", "You start to screw [src] to the floor...", "You hear rustling noises.")
if(do_after(user, 40*W.toolspeed, target = src))
if(state != PLASTIC_FLAPS_DETACHED)
return
state = PLASTIC_FLAPS_NORMAL
anchored = TRUE
to_chat(user, "You screw [src] to the floor.")
else if(iswelder(W))
if(state == PLASTIC_FLAPS_DETACHED)
var/obj/item/weldingtool/WT = W
if(!WT.remove_fuel(0, user))
return
playsound(loc, WT.usesound, 100, 1)
user.visible_message("[user] slices apart [src].", "You start to slice apart [src].", "You hear welding.")
if(do_after(user, 120*WT.toolspeed, target = src))
if(state != PLASTIC_FLAPS_DETACHED)
return
to_chat(user, "You slice apart [src].")
var/obj/item/stack/sheet/plastic/five/P = new(loc)
P.add_fingerprint(user)
qdel(src)
else
return ..()
/obj/structure/plasticflaps/CanPass(atom/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 FALSE
if(istype(A, /obj/structure/closet/cardboard))
var/obj/structure/closet/cardboard/C = A
if(C.move_delay)
return FALSE
if(ismecha(A))
return FALSE
else if(isliving(A)) // You Shall Not Pass!
var/mob/living/M = A
if(isbot(A)) //Bots understand the secrets
return TRUE
if(M.buckled && istype(M.buckled, /mob/living/simple_animal/bot/mulebot)) // mulebot passenger gets a free pass.
return TRUE
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 FALSE
return ..()
/obj/structure/plasticflaps/CanAStarPass(ID, to_dir, caller)
if(isliving(caller))
if(isbot(caller))
return TRUE
var/mob/living/M = caller
if(!M.ventcrawler && M.mob_size != MOB_SIZE_TINY)
return FALSE
var/atom/movable/M = caller
if(M && M.pulling)
return CanAStarPass(ID, to_dir, M.pulling)
return TRUE //diseases, stings, etc can pass
/obj/structure/plasticflaps/deconstruct(disassembled = TRUE)
if(!(flags & NODECONSTRUCT))
new /obj/item/stack/sheet/plastic/five(loc)
qdel(src)
/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."
/obj/structure/plasticflaps/mining/Initialize()
air_update_turf(TRUE)
..()
/obj/structure/plasticflaps/mining/Destroy()
var/turf/T = get_turf(src)
. = ..()
T.air_update_turf(TRUE)
/obj/structure/plasticflaps/mining/CanAtmosPass(turf/T)
return FALSE