code:
/obj/structure/transit_tube_pod
	icon = 'icons/obj/atmospherics/pipes/transit_tube_pod.dmi'
	icon_state = "pod"
	animate_movement = FORWARD_STEPS
	anchored = 1
	density = 1
	var/moving = 0
	var/datum/gas_mixture/air_contents = new()

/obj/structure/transit_tube_pod/New(loc)
	..(loc)

	air_contents.assert_gases("o2", "n2")
	air_contents.gases["o2"][MOLES] = MOLES_O2STANDARD * 2
	air_contents.gases["n2"][MOLES] = MOLES_N2STANDARD
	air_contents.temperature = T20C

	// Give auto tubes time to align before trying to start moving
	spawn(5)
		follow_tube()

/obj/structure/transit_tube_pod/Destroy()
	for(var/atom/movable/AM in contents)
		AM.loc = loc

	return ..()

/obj/structure/transit_tube_pod/attackby(obj/item/I, mob/user, params)
	if(istype(I, /obj/item/weapon/crowbar))
		if(!moving)
			for(var/obj/structure/transit_tube/station/T in loc)
				return
			if(src.contents.len)
				user.visible_message("[user] empties \the [src].", "You empty \the [src].")
				src.empty()
				return
			else
				user << "You free \the [src]."
				var/obj/structure/c_transit_tube_pod/R = new/obj/structure/c_transit_tube_pod(src.loc)
				src.transfer_fingerprints_to(R)
				R.add_fingerprint(user)
				qdel(src)

/obj/structure/transit_tube_pod/container_resist()
	var/mob/living/user = usr
	if(!moving)
		user.changeNext_move(CLICK_CD_BREAKOUT)
		user.last_special = world.time + CLICK_CD_BREAKOUT
		user << "You start trying to escape from the pod..."
		if(do_after(user, 600, target = src))
			user << "You manage to open the pod."
			src.empty()

/obj/structure/transit_tube_pod/proc/empty()
	for(var/atom/movable/M in src.contents)
		M.loc = src.loc

/obj/structure/transit_tube_pod/Process_Spacemove()
	if(moving) //No drifting while moving in the tubes
		return 1
	else return ..()

/obj/structure/transit_tube_pod/proc/follow_tube(reverse_launch)
	set waitfor = 0
	if(moving)
		return

	moving = 1

	var/obj/structure/transit_tube/current_tube = null
	var/next_dir
	var/next_loc
	var/last_delay = 0
	var/exit_delay

	if(reverse_launch)
		dir = turn(dir, 180) // Back it up

	for(var/obj/structure/transit_tube/tube in loc)
		if(tube.has_exit(dir))
			current_tube = tube
			break

	while(current_tube)
		next_dir = current_tube.get_exit(dir)

		if(!next_dir)
			break

		exit_delay = current_tube.exit_delay(src, dir)
		last_delay += exit_delay

		sleep(exit_delay)

		next_loc = get_step(loc, next_dir)

		current_tube = null
		for(var/obj/structure/transit_tube/tube in next_loc)
			if(tube.has_entrance(next_dir))
				current_tube = tube
				break

		if(current_tube == null)
			dir = next_dir
			Move(get_step(loc, dir), dir) // Allow collisions when leaving the tubes.
			break

		last_delay = current_tube.enter_delay(src, next_dir)
		sleep(last_delay)
		dir = next_dir
		loc = next_loc // When moving from one tube to another, skip collision and such.
		density = current_tube.density

		if(current_tube && current_tube.should_stop_pod(src, next_dir))
			current_tube.pod_stopped(src, dir)
			break

	density = 1
	moving = 0

// Should I return a copy here? If the caller edits or del()s the returned
//  datum, there might be problems if I don't...
/obj/structure/transit_tube_pod/return_air()
	var/datum/gas_mixture/GM = new()
	GM.copy_from(air_contents)
	return GM

// For now, copying what I found in an unused FEA file (and almost identical in a
//  used ZAS file). Means that assume_air and remove_air don't actually alter the
//  air contents.
/obj/structure/transit_tube_pod/assume_air(datum/gas_mixture/giver)
	return air_contents.merge(giver)

/obj/structure/transit_tube_pod/remove_air(amount)
	return air_contents.remove(amount)

// Called when a pod arrives at, and before a pod departs from a station,
//  giving it a chance to mix its internal air supply with the turf it is
//  currently on.
/obj/structure/transit_tube_pod/proc/mix_air()
	var/datum/gas_mixture/environment = loc.return_air()
	var/env_pressure = environment.return_pressure()
	var/int_pressure = air_contents.return_pressure()
	var/total_pressure = env_pressure + int_pressure

	if(total_pressure == 0)
		return

	// Math here: Completely made up, not based on realistic equasions.
	//  Goal is to balance towards equal pressure, but ensure some gas
	//  transfer in both directions regardless.
	// Feel free to rip this out and replace it with something better,
	//  I don't really know muhch about how gas transfer rates work in
	//  SS13.
	var/transfer_in = max(0.1, 0.5 * (env_pressure - int_pressure) / total_pressure)
	var/transfer_out = max(0.1, 0.3 * (int_pressure - env_pressure) / total_pressure)

	var/datum/gas_mixture/from_env = loc.remove_air(environment.total_moles() * transfer_in)
	var/datum/gas_mixture/from_int = air_contents.remove(air_contents.total_moles() * transfer_out)

	loc.assume_air(from_int)
	air_contents.merge(from_env)

// When the player moves, check if the pos is currently stopped at a station.
//  if it is, check the direction. If the direction matches the direction of
//  the station, try to exit. If the direction matches one of the station's
//  tube directions, launch the pod in that direction.
/obj/structure/transit_tube_pod/relaymove(mob/mob, direction)
	if(istype(mob, /mob) && mob.client)
		// If the pod is not in a tube at all, you can get out at any time.
		if(!(locate(/obj/structure/transit_tube) in loc))
			mob.loc = loc
			mob.client.Move(get_step(loc, direction), direction)
			mob.reset_perspective(null)

			//if(moving && istype(loc, /turf/open/space))
				// Todo: If you get out of a moving pod in space, you should move as well.
				//  Same direction as pod? Direcion you moved? Halfway between?

		if(!moving)
			for(var/obj/structure/transit_tube/station/station in loc)
				if(dir in station.directions())
					if(!station.pod_moving)
						if(direction == station.dir)
							if(station.icon_state == "open")
								mob.loc = loc
								mob.client.Move(get_step(loc, direction), direction)
								mob.reset_perspective(null)

							else
								station.open_animation()

						else if(direction in station.directions())
							dir = direction
							station.launch_pod()
					return

			for(var/obj/structure/transit_tube/tube in loc)
				if(dir in tube.directions())
					if(tube.has_exit(direction))
						dir = direction
						return


code:
/obj/structure/toilet
	name = "toilet"
	desc = "The HT-451, a torque rotation-based, waste disposal unit for small matter. This one seems remarkably clean."
	icon = 'icons/obj/watercloset.dmi'
	icon_state = "toilet00"
	density = 0
	anchored = 1
	var/open = 0			//if the lid is up
	var/cistern = 0			//if the cistern bit is open
	var/w_items = 0			//the combined w_class of all the items in the cistern
	var/mob/living/swirlie = null	//the mob being given a swirlie

/obj/structure/toilet/New()
	open = round(rand(0, 1))
	update_icon()

/obj/structure/toilet/attack_hand(mob/living/user)
	if(swirlie)
		user.changeNext_move(CLICK_CD_MELEE)
		playsound(src.loc, "swing_hit", 25, 1)
		swirlie.visible_message("[user] slams the toilet seat onto [swirlie]'s head!", "[user] slams the toilet seat onto your head!", "You hear reverberating porcelain.")
		swirlie.adjustBruteLoss(5)
		return

	if(cistern && !open)
		if(!contents.len)
			user << "The cistern is empty."
			return
		else
			var/obj/item/I = pick(contents)
			if(ishuman(user))
				user.put_in_hands(I)
			else
				I.loc = get_turf(src)
			user << "You find [I] in the cistern."
			w_items -= I.w_class
			return

	open = !open
	update_icon()

/obj/structure/toilet/update_icon()
	icon_state = "toilet[open][cistern]"

/obj/structure/toilet/attackby(obj/item/I, mob/living/user, params)
	if(istype(I, /obj/item/weapon/crowbar))
		user << "You start to [cistern ? "replace the lid on the cistern" : "lift the lid off the cistern"]..."
		playsound(loc, 'sound/effects/stonedoor_openclose.ogg', 50, 1)
		if(do_after(user, 30/I.toolspeed, target = src))
			user.visible_message("[user] [cistern ? "replaces the lid on the cistern" : "lifts the lid off the cistern"]!", "You [cistern ? "replace the lid on the cistern" : "lift the lid off the cistern"]!", "You hear grinding porcelain.")
			cistern = !cistern
			update_icon()
			return

	if(istype(I, /obj/item/weapon/reagent_containers))
		if (!open)
			return
		var/obj/item/weapon/reagent_containers/RG = I
		RG.reagents.add_reagent("water", min(RG.volume - RG.reagents.total_volume, RG.amount_per_transfer_from_this))
		user << "You fill [RG] from [src]. Gross."
		return

	if(istype(I, /obj/item/weapon/grab))
		user.changeNext_move(CLICK_CD_MELEE)
		var/obj/item/weapon/grab/G = I
		if(!G.confirm())
			return
		if(isliving(G.affecting))
			var/mob/living/GM = G.affecting
			if(G.state >= GRAB_AGGRESSIVE)
				if(GM.loc != get_turf(src))
					user << "[GM] needs to be on [src]!"
					return
				if(!swirlie)
					if(open)
						GM.visible_message("[user] starts to give [GM] a swirlie!", "[user] starts to give you a swirlie...")
						swirlie = GM
						if(do_after(user, 30, 0, target = src))
							GM.visible_message("[user] gives [GM] a swirlie!", "[user] gives you a swirlie!", "You hear a toilet flushing.")
							if(iscarbon(GM))
								var/mob/living/carbon/C = GM
								if(!C.internal)
									C.adjustOxyLoss(5)
							else
								GM.adjustOxyLoss(5)
						swirlie = null
					else
						playsound(src.loc, 'sound/effects/bang.ogg', 25, 1)
						GM.visible_message("[user] slams [GM.name] into [src]!", "[user] slams you into [src]!")
						GM.adjustBruteLoss(5)
			else
				user << "You need a tighter grip!"

	if(cistern)
		if(I.w_class > 3)
			user << "[I] does not fit!"
			return
		if(w_items + I.w_class > 5)
			user << "The cistern is full!"
			return
		if(!user.drop_item())
			user << "\The [I] is stuck to your hand, you cannot put it in the cistern!"
			return
		I.loc = src
		w_items += I.w_class
		user << "You carefully place [I] into the cistern."
		return

/obj/structure/urinal
	name = "urinal"
	desc = "The HU-452, an experimental urinal."
	icon = 'icons/obj/watercloset.dmi'
	icon_state = "urinal"
	density = 0
	anchored = 1

/obj/structure/urinal/attackby(obj/item/I, mob/user, params)
	if(istype(I, /obj/item/weapon/grab))
		var/obj/item/weapon/grab/G = I
		if(!G.confirm())
			return
		if(isliving(G.affecting))
			var/mob/living/GM = G.affecting
			if(G.state >= GRAB_AGGRESSIVE)
				if(GM.loc != get_turf(src))
					user << "[GM.name] needs to be on [src]."
					return
				user.changeNext_move(CLICK_CD_MELEE)
				user.visible_message("[user] slams [GM] into [src]!", "You slam [GM] into [src]!")
				GM.adjustBruteLoss(8)
			else
				user << "You need a tighter grip!"

/obj/machinery/shower
	name = "shower"
	desc = "The HS-451. Installed in the 2550s by the Nanotrasen Hygiene Division."
	icon = 'icons/obj/watercloset.dmi'
	icon_state = "shower"
	density = 0
	anchored = 1
	use_power = 0
	var/on = 0
	var/obj/effect/mist/mymist = null
	var/ismist = 0				//needs a var so we can make it linger~
	var/watertemp = "normal"	//freezing, normal, or boiling

/obj/effect/mist
	name = "mist"
	icon = 'icons/obj/watercloset.dmi'
	icon_state = "mist"
	layer = MOB_LAYER + 1
	anchored = 1
	mouse_opacity = 0

/obj/machinery/shower/attack_hand(mob/M)
	on = !on
	update_icon()
	add_fingerprint(M)
	if(on)
		wash_turf()
		for(var/atom/movable/G in loc)
			if(isliving(G))
				var/mob/living/L = G
				wash_mob(L)
			else
				wash_obj(G)
	else
		if(istype(loc, /turf/open))
			var/turf/open/tile = loc
			tile.MakeSlippery()

/obj/machinery/shower/attackby(obj/item/I, mob/user, params)
	if(I.type == /obj/item/device/analyzer)
		user << "The water temperature seems to be [watertemp]."
	if(istype(I, /obj/item/weapon/wrench))
		user << "You begin to adjust the temperature valve with \the [I]..."
		if(do_after(user, 50/I.toolspeed, target = src))
			switch(watertemp)
				if("normal")
					watertemp = "freezing"
				if("freezing")
					watertemp = "boiling"
				if("boiling")
					watertemp = "normal"
			user.visible_message("[user] adjusts the shower with \the [I].", "You adjust the shower with \the [I] to [watertemp] temperature.")
			log_game("[key_name(user)] has wrenched a shower to [watertemp] at ([x],[y],[z])")
			add_hiddenprint(user)

/obj/machinery/shower/update_icon()	//this is terribly unreadable, but basically it makes the shower mist up
	overlays.Cut()					//once it's been on for a while, in addition to handling the water overlay.
	if(mymist)
		qdel(mymist)

	if(on)
		overlays += image('icons/obj/watercloset.dmi', src, "water", MOB_LAYER + 1, dir)
		if(watertemp == "freezing")
			return
		if(!ismist)
			spawn(50)
				if(src && on)
					ismist = 1
					mymist = new /obj/effect/mist(loc)
		else
			ismist = 1
			mymist = new /obj/effect/mist(loc)
	else if(ismist)
		ismist = 1
		mymist = new /obj/effect/mist(loc)
		spawn(250)
			if(!on && mymist)
				qdel(mymist)
				ismist = 0

/obj/machinery/shower/Crossed(atom/movable/O)
	..()
	if(on)
		if(isliving(O))
			var/mob/living/L = O
			if(wash_mob(L)) //it's a carbon mob.
				var/mob/living/carbon/C = L
				C.slip(4,2,null,NO_SLIP_WHEN_WALKING)
		else
			wash_obj(O)

/obj/machinery/shower/proc/wash_obj(atom/movable/O)
	O.clean_blood()

	if(istype(O,/obj/item))
		var/obj/item/I = O
		I.extinguish()

/obj/machinery/shower/proc/wash_turf()
	if(isturf(loc))
		var/turf/tile = loc
		loc.clean_blood()
		for(var/obj/effect/E in tile)
			if(is_cleanable(E))
				qdel(E)

/obj/machinery/shower/proc/wash_mob(mob/living/L)
	L.ExtinguishMob()
	L.adjust_fire_stacks(-20) //Douse ourselves with water to avoid fire more easily
	if(iscarbon(L))
		var/mob/living/carbon/M = L
		. = 1
		check_heat(M)
		if(M.r_hand)
			M.r_hand.clean_blood()
		if(M.l_hand)
			M.l_hand.clean_blood()
		if(M.back)
			if(M.back.clean_blood())
				M.update_inv_back(0)
		if(ishuman(M))
			var/mob/living/carbon/human/H = M
			var/washgloves = 1
			var/washshoes = 1
			var/washmask = 1
			var/washears = 1
			var/washglasses = 1

			if(H.wear_suit)
				washgloves = !(H.wear_suit.flags_inv & HIDEGLOVES)
				washshoes = !(H.wear_suit.flags_inv & HIDESHOES)

			if(H.head)
				washmask = !(H.head.flags_inv & HIDEMASK)
				washglasses = !(H.head.flags_inv & HIDEEYES)
				washears = !(H.head.flags_inv & HIDEEARS)

			if(H.wear_mask)
				if (washears)
					washears = !(H.wear_mask.flags_inv & HIDEEARS)
				if (washglasses)
					washglasses = !(H.wear_mask.flags_inv & HIDEEYES)

			if(H.head)
				if(H.head.clean_blood())
					H.update_inv_head()
			if(H.wear_suit)
				if(H.wear_suit.clean_blood())
					H.update_inv_wear_suit()
			else if(H.w_uniform)
				if(H.w_uniform.clean_blood())
					H.update_inv_w_uniform()
			if(washgloves)
				clean_blood()
			if(H.shoes && washshoes)
				if(H.shoes.clean_blood())
					H.update_inv_shoes()
			if(H.wear_mask)
				if(washmask)
					if(H.wear_mask.clean_blood())
						H.update_inv_wear_mask()
			else
				H.lip_style = null
				H.update_body()
			if(H.glasses && washglasses)
				if(H.glasses.clean_blood())
					H.update_inv_glasses()
			if(H.ears && washears)
				if(H.ears.clean_blood())
					H.update_inv_ears()
			if(H.belt)
				if(H.belt.clean_blood())
					H.update_inv_belt()
		else
			if(M.wear_mask)						//if the mob is not human, it cleans the mask without asking for bitflags
				if(M.wear_mask.clean_blood())
					M.update_inv_wear_mask(0)
			M.clean_blood()
	else
		L.clean_blood()

/obj/machinery/shower/process()
	if(on)
		wash_turf()
		for(var/atom/movable/G in loc)
			if(isliving(G))
				var/mob/living/L = G
				wash_mob(L)
			else
				wash_obj(G)

/obj/machinery/shower/proc/check_heat(mob/living/carbon/C)
	if(watertemp == "freezing")
		C.bodytemperature = max(80, C.bodytemperature - 80)
		C << "The water is freezing!"
	else if(watertemp == "boiling")
		C.bodytemperature = min(500, C.bodytemperature + 35)
		C.adjustFireLoss(5)
		C << "The water is searing!"

/obj/item/weapon/bikehorn/rubberducky
	name = "rubber ducky"
	desc = "Rubber ducky you're so fine, you make bathtime lots of fuuun. Rubber ducky I'm awfully fooooond of yooooouuuu~"	//thanks doohl
	icon = 'icons/obj/watercloset.dmi'
	icon_state = "rubberducky"
	item_state = "rubberducky"

/obj/structure/sink
	name = "sink"
	icon = 'icons/obj/watercloset.dmi'
	icon_state = "sink"
	desc = "A sink used for washing one's hands and face."
	anchored = 1
	var/busy = 0 	//Something's being washed at the moment

/obj/structure/sink/attack_hand(mob/living/user)
	if(!user || !istype(user))
		return
	if(!iscarbon(user))
		return
	if(!Adjacent(user))
		return

	if(busy)
		user << "Someone's already washing here."
		return
	var/selected_area = parse_zone(user.zone_selected)
	var/washing_face = 0
	if(selected_area in list("head", "mouth", "eyes"))
		washing_face = 1
	user.visible_message("[user] start washing their [washing_face ? "face" : "hands"]...", \
						"You start washing your [washing_face ? "face" : "hands"]...")
	busy = 1

	if(!do_after(user, 40, target = src))
		busy = 0
		return

	busy = 0

	user.visible_message("[user] washes their [washing_face ? "face" : "hands"] using [src].", \
						"You wash your [washing_face ? "face" : "hands"] using [src].")
	if(washing_face)
		if(ishuman(user))
			var/mob/living/carbon/human/H = user
			H.lip_style = null //Washes off lipstick
			H.lip_color = initial(H.lip_color)
			H.regenerate_icons()
		user.drowsyness = max(user.drowsyness - rand(2,3), 0) //Washing your face wakes you up if you're falling asleep
	else
		user.clean_blood()

/obj/structure/sink/attackby(obj/item/O, mob/user, params)
	if(busy)
		user << "Someone's already washing here!"
		return

	if(istype(O, /obj/item/weapon/reagent_containers))
		var/obj/item/weapon/reagent_containers/RG = O
		if(RG.flags & OPENCONTAINER)
			RG.reagents.add_reagent("water", min(RG.volume - RG.reagents.total_volume, RG.amount_per_transfer_from_this))
			user << "You fill [RG] from [src]."
			return

	if(istype(O, /obj/item/weapon/melee/baton))
		var/obj/item/weapon/melee/baton/B = O
		if(B.bcell)
			if(B.bcell.charge > 0 && B.status == 1)
				flick("baton_active", src)
				var/stunforce = B.stunforce
				user.Stun(stunforce)
				user.Weaken(stunforce)
				user.stuttering = stunforce
				B.deductcharge(B.hitcost)
				user.visible_message("[user] shocks themself while attempting to wash the active [B.name]!", \
									"You unwisely attempt to wash [B] while it's still on.")
				playsound(src, "sparks", 50, 1)
				return

	if(istype(O, /obj/item/weapon/mop))
		O.reagents.add_reagent("water", 5)
		user << "You wet [O] in [src]."
		playsound(loc, 'sound/effects/slosh.ogg', 25, 1)

	var/obj/item/I = O
	if(!I || !istype(I))
		return
	if(I.flags & ABSTRACT) //Abstract items like grabs won't wash. No-drop items will though because it's still technically an item in your hand.
		return

	user << "You start washing [I]..."
	busy = 1
	if(!do_after(user, 40, target = src))
		busy = 0
		return
	busy = 0
	O.clean_blood()
	user.visible_message("[user] washes [I] using [src].", \
						"You wash [I] using [src].")

/obj/structure/sink/kitchen
	name = "kitchen sink"
	icon_state = "sink_alt"

/obj/structure/sink/puddle	//splishy splashy ^_^
	name = "puddle"
	icon_state = "puddle"

/obj/structure/sink/puddle/attack_hand(mob/M)
	icon_state = "puddle-splash"
	..()
	icon_state = "puddle"

/obj/structure/sink/puddle/attackby(obj/item/O, mob/user, params)
	icon_state = "puddle-splash"
	..()
	icon_state = "puddle"

license: mit


code:
/* Windoor (window door) assembly -Nodrak
 * Step 1: Create a windoor out of rglass
 * Step 2: Add r-glass to the assembly to make a secure windoor (Optional)
 * Step 3: Rotate or Flip the assembly to face and open the way you want
 * Step 4: Wrench the assembly in place
 * Step 5: Add cables to the assembly
 * Step 6: Set access for the door.
 * Step 7: Screwdriver the door to complete
 */

/obj/structure/windoor_assembly
	icon = 'icons/obj/doors/windoor.dmi'

	name = "windoor Assembly"
	icon_state = "l_windoor_assembly01"
	anchored = 0
	density = 0
	dir = NORTH

	var/ini_dir
	var/obj/item/weapon/electronics/airlock/electronics = null
	var/created_name = null

	//Vars to help with the icon's name
	var/facing = "l"	//Does the windoor open to the left or right?
	var/secure = 0		//Whether or not this creates a secure windoor
	var/state = "01"	//How far the door assembly has progressed

/obj/structure/windoor_assembly/examine(mob/user)
	..()
	user << "Alt-click to rotate it clockwise."

/obj/structure/windoor_assembly/New(dir=NORTH)
	..()
	ini_dir = dir
	air_update_turf(1)

/obj/structure/windoor_assembly/Destroy()
	density = 0
	air_update_turf(1)
	return ..()

/obj/structure/windoor_assembly/Move()
	var/turf/T = loc
	..()
	move_update_air(T)

/obj/structure/windoor_assembly/update_icon()
	icon_state = "[facing]_[secure ? "secure_" : ""]windoor_assembly[state]"

/obj/structure/windoor_assembly/CanPass(atom/movable/mover, turf/target, height=0)
	if(istype(mover) && mover.checkpass(PASSGLASS))
		return 1
	if(get_dir(loc, target) == dir) //Make sure looking at appropriate border
		return !density
	else
		return 1

/obj/structure/windoor_assembly/CanAtmosPass(turf/T)
	if(get_dir(loc, T) == dir)
		return !density
	else
		return 1

/obj/structure/windoor_assembly/CheckExit(atom/movable/mover as mob|obj, turf/target)
	if(istype(mover) && mover.checkpass(PASSGLASS))
		return 1
	if(get_dir(loc, target) == dir)
		return !density
	else
		return 1

/obj/structure/windoor_assembly/attackby(obj/item/W, mob/user, params)
	//I really should have spread this out across more states but thin little windoors are hard to sprite.
	add_fingerprint(user)
	switch(state)
		if("01")
			if(istype(W, /obj/item/weapon/weldingtool) && !anchored )
				var/obj/item/weapon/weldingtool/WT = W
				if (WT.remove_fuel(0,user))
					user.visible_message("[user] disassembles the windoor assembly.", "You start to disassemble the windoor assembly...")
					playsound(loc, 'sound/items/Welder2.ogg', 50, 1)

					if(do_after(user, 40/W.toolspeed, target = src))
						if(!src || !WT.isOn()) return
						user << "You disassemble the windoor assembly."
						var/obj/item/stack/sheet/rglass/RG = new (get_turf(src), 5)
						RG.add_fingerprint(user)
						if(secure)
							var/obj/item/stack/rods/R = new (get_turf(src), 4)
							R.add_fingerprint(user)
						qdel(src)
				else
					return

			//Wrenching an unsecure assembly anchors it in place. Step 4 complete
			if(istype(W, /obj/item/weapon/wrench) && !anchored)
				for(var/obj/machinery/door/window/WD in loc)
					if(WD.dir == dir)
						user << "There is already a windoor in that location!"
						return
				playsound(loc, 'sound/items/Ratchet.ogg', 100, 1)
				user.visible_message("[user] secures the windoor assembly to the floor.", "You start to secure the windoor assembly to the floor...")

				if(do_after(user, 40/W.toolspeed, target = src))
					if(!src || anchored)
						return
					for(var/obj/machinery/door/window/WD in loc)
						if(WD.dir == dir)
							user << "There is already a windoor in that location!"
							return
					user << "You secure the windoor assembly."
					anchored = 1
					if(secure)
						name = "secure anchored windoor assembly"
					else
						name = "anchored windoor assembly"

			//Unwrenching an unsecure assembly un-anchors it. Step 4 undone
			else if(istype(W, /obj/item/weapon/wrench) && anchored)
				playsound(loc, 'sound/items/Ratchet.ogg', 100, 1)
				user.visible_message("[user] unsecures the windoor assembly to the floor.", "You start to unsecure the windoor assembly to the floor...")

				if(do_after(user, 40/W.toolspeed, target = src))
					if(!src || !anchored)
						return
					user << "You unsecure the windoor assembly."
					anchored = 0
					if(secure)
						name = "secure windoor assembly"
					else
						name = "windoor assembly"

			//Adding plasteel makes the assembly a secure windoor assembly. Step 2 (optional) complete.
			else if(istype(W, /obj/item/stack/sheet/plasteel) && !secure)
				var/obj/item/stack/sheet/plasteel/P = W
				if(P.amount < 2)
					user << "You need more plasteel to do this!"
					return
				user << "You start to reinforce the windoor with plasteel..."

				if(do_after(user,40, target = src))
					if(!src || secure)
						return

					P.use(2)
					user << "You reinforce the windoor."
					secure = 1
					if(anchored)
						name = "secure anchored windoor assembly"
					else
						name = "secure windoor assembly"

			//Adding cable to the assembly. Step 5 complete.
			else if(istype(W, /obj/item/stack/cable_coil) && anchored)
				user.visible_message("[user] wires the windoor assembly.", "You start to wire the windoor assembly...")

				if(do_after(user, 40, target = src))
					if(!src || !anchored || src.state != "01")
						return
					var/obj/item/stack/cable_coil/CC = W
					if(!CC.use(1))
						user << "You need more cable to do this!"
						return
					user << "You wire the windoor."
					state = "02"
					if(secure)
						name = "secure wired windoor assembly"
					else
						name = "wired windoor assembly"
			else
				..()

		if("02")

			//Removing wire from the assembly. Step 5 undone.
			if(istype(W, /obj/item/weapon/wirecutters))
				playsound(loc, 'sound/items/Wirecutter.ogg', 100, 1)
				user.visible_message("[user] cuts the wires from the airlock assembly.", "You start to cut the wires from airlock assembly...")

				if(do_after(user, 40/W.toolspeed, target = src))
					if(!src || state != "02")
						return

					user << "You cut the windoor wires."
					new/obj/item/stack/cable_coil(get_turf(user), 1)
					state = "01"
					if(secure)
						name = "secure anchored windoor assembly"
					else
						name = "anchored windoor assembly"

			//Adding airlock electronics for access. Step 6 complete.
			else if(istype(W, /obj/item/weapon/electronics/airlock))
				if(!user.drop_item())
					return
				playsound(loc, 'sound/items/Screwdriver.ogg', 100, 1)
				user.visible_message("[user] installs the electronics into the airlock assembly.", "You start to install electronics into the airlock assembly...")
				W.loc = src

				if(do_after(user, 40, target = src))
					if(!src || electronics)
						W.loc = src.loc
						return
					user << "You install the airlock electronics."
					name = "near finished windoor assembly"
					electronics = W
				else
					W.loc = loc

			//Screwdriver to remove airlock electronics. Step 6 undone.
			else if(istype(W, /obj/item/weapon/screwdriver))
				if(!electronics)
					return

				playsound(loc, 'sound/items/Screwdriver.ogg', 100, 1)
				user.visible_message("[user] removes the electronics from the airlock assembly.", "You start to uninstall electronics from the airlock assembly...")

				if(do_after(user, 40/W.toolspeed, target = src))
					if(!src || !electronics)
						return
					user << "You remove the airlock electronics."
					name = "wired windoor assembly"
					var/obj/item/weapon/electronics/airlock/ae
					ae = electronics
					electronics = null
					ae.loc = loc

			else if(istype(W, /obj/item/weapon/pen))
				var/t = stripped_input(user, "Enter the name for the door.", name, created_name,MAX_NAME_LEN)
				if(!t)
					return
				if(!in_range(src, usr) && loc != usr)
					return
				created_name = t
				return

			//Crowbar to complete the assembly, Step 7 complete.
			else if(istype(W, /obj/item/weapon/crowbar))
				if(!electronics)
					usr << "The assembly is missing electronics!"
					return
				usr << browse(null, "window=windoor_access")
				playsound(loc, 'sound/items/Crowbar.ogg', 100, 1)
				user.visible_message("[user] pries the windoor into the frame.", "You start prying the windoor into the frame...")

				if(do_after(user, 40/W.toolspeed, target = src))

					if(loc && electronics)

						density = 1 //Shouldn't matter but just incase
						user << "You finish the windoor."

						if(secure)
							var/obj/machinery/door/window/brigdoor/windoor = new /obj/machinery/door/window/brigdoor(loc)
							if(facing == "l")
								windoor.icon_state = "leftsecureopen"
								windoor.base_state = "leftsecure"
							else
								windoor.icon_state = "rightsecureopen"
								windoor.base_state = "rightsecure"
							windoor.dir = dir
							windoor.density = 0

							if(electronics.one_access)
								windoor.req_one_access = electronics.accesses
							else
								windoor.req_access = electronics.accesses
							windoor.electronics = electronics
							electronics.loc = windoor
							if(created_name)
								windoor.name = created_name
							qdel(src)
							windoor.close()

						else
							var/obj/machinery/door/window/windoor = new /obj/machinery/door/window(loc)
							if(facing == "l")
								windoor.icon_state = "leftopen"
								windoor.base_state = "left"
							else
								windoor.icon_state = "rightopen"
								windoor.base_state = "right"
							windoor.dir = dir
							windoor.density = 0

							windoor.req_access = electronics.accesses
							windoor.electronics = electronics
							electronics.loc = windoor
							if(created_name)
								windoor.name = created_name
							qdel(src)
							windoor.close()

			else
				..()

	//Update to reflect changes(if applicable)
	update_icon()

//Rotates the windoor assembly clockwise
/obj/structure/windoor_assembly/verb/revrotate()
	set name = "Rotate Windoor Assembly"
	set category = "Object"
	set src in oview(1)
	if(usr.stat || !usr.canmove || usr.restrained())
		return
	if (anchored)
		usr << "[src] cannot be rotated while it is fastened to the floor!"
		return 0
	//if(state != "01")
		//update_nearby_tiles(need_rebuild=1) //Compel updates before

	dir = turn(dir, 270)

	//if(state != "01")
		//update_nearby_tiles(need_rebuild=1)

	ini_dir = dir
	update_icon()
	return

/obj/structure/windoor_assembly/AltClick(mob/user)
	..()
	if(user.incapacitated())
		user << "You can't do that right now!"
		return
	if(!in_range(src, user))
		return
	else
		revrotate()

//Flips the windoor assembly, determines whather the door opens to the left or the right
/obj/structure/windoor_assembly/verb/flip()
	set name = "Flip Windoor Assembly"
	set category = "Object"
	set src in oview(1)
	if(usr.stat || !usr.canmove || usr.restrained())
		return

	if(facing == "l")
		usr << "The windoor will now slide to the right."
		facing = "r"
	else
		facing = "l"
		usr << "The windoor will now slide to the left."

	update_icon()
	return


code:
/obj/structure/window
	name = "window"
	desc = "A window."
	icon_state = "window"
	density = 1
	layer = 3.2//Just above doors
	pressure_resistance = 4*ONE_ATMOSPHERE
	anchored = 1 //initially is 0 for tile smoothing
	flags = ON_BORDER
	var/maxhealth = 25
	var/health = 0
	var/ini_dir = null
	var/state = 0
	var/reinf = 0
	var/disassembled = 0
	var/wtype = "glass"
	var/fulltile = 0
	var/list/storeditems = list()
//	var/silicate = 0 // number of units of silicate
//	var/icon/silicateIcon = null // the silicated icon
	var/image/crack_overlay
	can_be_unanchored = 1

/obj/structure/window/examine(mob/user)
	..()
	user << "Alt-click to rotate it clockwise."

/obj/structure/window/New(Loc,re=0)
	..()
	health = maxhealth
	if(re)
		reinf = re
	if(reinf)
		state = 2*anchored

	spawn(5) // The NODECONSTRUCT flag gets added immediately by the holodeck (but not immediately enough)
		if(!(flags & NODECONSTRUCT))
			storeditems.Add(new/obj/item/weapon/shard(src))
			if(fulltile)
				storeditems.Add(new/obj/item/weapon/shard(src))
			if(reinf)
				var/obj/item/stack/rods/R = new/obj/item/stack/rods(src)
				storeditems.Add(R)
				if(fulltile)
					R.add(1)

	ini_dir = dir
	air_update_turf(1)

	return

/obj/structure/window/bullet_act(obj/item/projectile/Proj)
	if((Proj.damage_type == BRUTE || Proj.damage_type == BURN))
		health -= Proj.damage
		update_nearby_icons()
	..()
	if(health <= 0)
		spawnfragments()
	return

/obj/structure/window/ex_act(severity, target)
	if(severity == 1)
		qdel(src)
	else
		spawnfragments()

/obj/structure/window/blob_act()
	spawnfragments()

/obj/structure/window/narsie_act()
	color = "#7D1919"

/obj/structure/window/singularity_pull(S, current_size)
	if(current_size >= STAGE_FIVE)
		spawnfragments()

/obj/structure/window/CanPass(atom/movable/mover, turf/target, height=0)
	if(istype(mover) && mover.checkpass(PASSGLASS))
		return 1
	if(dir == SOUTHWEST || dir == SOUTHEAST || dir == NORTHWEST || dir == NORTHEAST)
		return 0	//full tile window, you can't move into it!
	if(get_dir(loc, target) == dir)
		return !density
	else
		return 1

/obj/structure/window/CheckExit(atom/movable/O as mob|obj, target)
	if(istype(O) && O.checkpass(PASSGLASS))
		return 1
	if(get_dir(O.loc, target) == dir)
		return 0
	return 1

/obj/structure/window/hitby(AM as mob|obj)
	..()
	var/tforce = 0
	if(ismob(AM))
		tforce = 40

	else if(isobj(AM))
		var/obj/item/I = AM
		tforce = I.throwforce

	if(reinf)
		tforce *= 0.25

	playsound(loc, 'sound/effects/Glasshit.ogg', 100, 1)
	health = max(0, health - tforce)
	if(health <= 7 && !reinf)
		anchored = 0
		update_nearby_icons()
		step(src, get_dir(AM, src))

	if(health <= 0)
		spawnfragments()
	update_nearby_icons()

/obj/structure/window/attack_tk(mob/user)
	user.changeNext_move(CLICK_CD_MELEE)
	user.visible_message("Something knocks on [src].")
	add_fingerprint(user)
	playsound(loc, 'sound/effects/Glassknock.ogg', 50, 1)

/obj/structure/window/attack_hulk(mob/living/carbon/human/user)
	if(!can_be_reached(user))
		return
	..(user, 1)
	user.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!"))
	user.visible_message("[user] smashes through [src]!")
	add_fingerprint(user)
	hit(50)
	return 1

/obj/structure/window/attack_hand(mob/user)
	if(!can_be_reached(user))
		return
	user.changeNext_move(CLICK_CD_MELEE)
	user.visible_message("[user] knocks on [src].")
	add_fingerprint(user)
	playsound(loc, 'sound/effects/Glassknock.ogg', 50, 1)

/obj/structure/window/attack_paw(mob/user)
	return attack_hand(user)

/obj/structure/window/proc/attack_generic(mob/user, damage = 0)	//used by attack_alien, attack_animal, and attack_slime
	if(!can_be_reached(user))
		return
	user.changeNext_move(CLICK_CD_MELEE)
	health -= damage
	if(health <= 0)
		user.visible_message("[user] smashes through [src]!")
		spawnfragments()
	else	//for nicer text~
		user.visible_message("[user] smashes into [src]!")
		playsound(loc, 'sound/effects/Glasshit.ogg', 100, 1)

/obj/structure/window/attack_alien(mob/living/user)
	user.do_attack_animation(src)
	if(islarva(user)) return
	attack_generic(user, 15)
	update_nearby_icons()

/obj/structure/window/attack_animal(mob/living/user)
	if(!isanimal(user))
		return

	var/mob/living/simple_animal/M = user
	M.do_attack_animation(src)
	if(M.melee_damage_upper <= 0 || (M.melee_damage_type != BRUTE && M.melee_damage_type != BURN))
		return

	attack_generic(M, M.melee_damage_upper)
	update_nearby_icons()

/obj/structure/window/attack_slime(mob/living/simple_animal/slime/user)
	user.do_attack_animation(src)
	if(!user.is_adult)
		return

	attack_generic(user, rand(10, 15))
	update_nearby_icons()

/obj/structure/window/attackby(obj/item/I, mob/living/user, params)
	if(!can_be_reached(user))
		return 1 //skip the afterattack

	add_fingerprint(user)
	if(istype(I, /obj/item/weapon/weldingtool) && user.a_intent == "help")
		var/obj/item/weapon/weldingtool/WT = I
		if(health < maxhealth)
			if(WT.remove_fuel(0,user))
				user << "You begin repairing [src]..."
				playsound(loc, 'sound/items/Welder.ogg', 40, 1)
				if(do_after(user, 40/I.toolspeed, target = src))
					health = maxhealth
					playsound(loc, 'sound/items/Welder2.ogg', 50, 1)
					update_nearby_icons()
					user << "You repair [src]."
		else
			user << "[src] is already in good condition!"
		return

	if(!(flags&NODECONSTRUCT))
		if(istype(I, /obj/item/weapon/screwdriver))
			playsound(loc, 'sound/items/Screwdriver.ogg', 75, 1)
			if(reinf && (state == 2 || state == 1))
				user << (state == 2 ? "You begin to unscrew the window from the frame..." : "You begin to screw the window to the frame...")
			else if(reinf && state == 0)
				user << (anchored ? "You begin to unscrew the frame from the floor..." : "You begin to screw the frame to the floor...")
			else if(!reinf)
				user << (anchored ? "You begin to unscrew the window from the floor..." : "You begin to screw the window to the floor...")

			if(do_after(user, 40/I.toolspeed, target = src))
				if(reinf && (state == 1 || state == 2))
					//If state was unfastened, fasten it, else do the reverse
					state = (state == 1 ? 2 : 1)
					user << (state == 1 ? "You unfasten the window from the frame." : "You fasten the window to the frame.")
				else if(reinf && state == 0)
					anchored = !anchored
					update_nearby_icons()
					user << (anchored ? "You fasten the frame to the floor." : "You unfasten the frame from the floor.")
				else if(!reinf)
					anchored = !anchored
					update_nearby_icons()
					user << (anchored ? "You fasten the window to the floor." : "You unfasten the window.")
			return

		else if (istype(I, /obj/item/weapon/crowbar) && reinf && (state == 0 || state == 1))
			user << (state == 0 ? "You begin to lever the window into the frame..." : "You begin to lever the window out of the frame...")
			playsound(loc, 'sound/items/Crowbar.ogg', 75, 1)
			if(do_after(user, 40/I.toolspeed, target = src))
				//If state was out of frame, put into frame, else do the reverse
				state = (state == 0 ? 1 : 0)
				user << (state == 1 ? "You pry the window into the frame." : "You pry the window out of the frame.")
			return

		else if(istype(I, /obj/item/weapon/wrench) && !anchored)
			playsound(loc, 'sound/items/Ratchet.ogg', 75, 1)
			user << " You begin to disassemble [src]..."
			if(do_after(user, 40/I.toolspeed, target = src))
				if(disassembled)
					return //Prevents multiple deconstruction attempts

				if(reinf)
					var/obj/item/stack/sheet/rglass/RG = new (user.loc)
					RG.add_fingerprint(user)
					if(fulltile) //fulltiles drop two panes
						RG = new (user.loc)
						RG.add_fingerprint(user)

				else
					var/obj/item/stack/sheet/glass/G = new (user.loc)
					G.add_fingerprint(user)
					if(fulltile)
						G = new (user.loc)
						G.add_fingerprint(user)

				playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
				disassembled = 1
				user << "You successfully disassemble [src]."
				qdel(src)
			return

	if(istype(I, /obj/item/weapon/rcd)) //Do not attack the window if the user is holding an RCD
		return

	if(I.damtype == BRUTE || I.damtype == BURN)
		user.changeNext_move(CLICK_CD_MELEE)
		hit(I.force)
	else
		playsound(loc, 'sound/effects/Glasshit.ogg', 75, 1)
	..()
	return

/obj/structure/window/mech_melee_attack(obj/mecha/M)
	if(..())
		hit(M.force, 1)

/obj/structure/window/proc/can_be_reached(mob/user)
	if(!fulltile)
		if(get_dir(user,src) & dir)
			for(var/obj/O in loc)
				if(!O.CanPass(user, user.loc, 1))
					return 0
	return 1

/obj/structure/window/proc/hit(damage, sound_effect = 1)
	if(reinf)
		damage *= 0.5
	health = max(0, health - damage)
	update_nearby_icons()
	if(sound_effect)
		playsound(loc, 'sound/effects/Glasshit.ogg', 75, 1)
	if(health <= 0)
		spawnfragments()
		return

/obj/structure/window/proc/spawnfragments()
	if(qdeleted())
		return
	var/turf/T = loc
	for(var/obj/item/I in storeditems)
		I.loc = T
		transfer_fingerprints_to(I)
	qdel(src)
	update_nearby_icons()

/obj/structure/window/verb/rotate()
	set name = "Rotate Window Counter-Clockwise"
	set category = "Object"
	set src in oview(1)

	if(usr.stat || !usr.canmove || usr.restrained())
		return

	if(anchored)
		usr << "[src] cannot be rotated while it is fastened to the floor!"
		return 0

	dir = turn(dir, 90)
//	updateSilicate()
	air_update_turf(1)
	ini_dir = dir
	add_fingerprint(usr)
	return

/obj/structure/window/verb/revrotate()
	set name = "Rotate Window Clockwise"
	set category = "Object"
	set src in oview(1)

	if(usr.stat || !usr.canmove || usr.restrained())
		return

	if(anchored)
		usr << "[src] cannot be rotated while it is fastened to the floor!"
		return 0

	dir = turn(dir, 270)
//	updateSilicate()
	air_update_turf(1)
	ini_dir = dir
	add_fingerprint(usr)
	return

/obj/structure/window/AltClick(mob/user)
	..()
	if(user.incapacitated())
		user << "You can't do that right now!"
		return
	if(!in_range(src, user))
		return
	else
		revrotate()

/*
/obj/structure/window/proc/updateSilicate() what do you call a syndicate silicon?
	if(silicateIcon && silicate)
		icon = initial(icon)

		var/icon/I = icon(icon,icon_state,dir)

		var/r = (silicate / 100) + 1
		var/g = (silicate / 70) + 1
		var/b = (silicate / 50) + 1
		I.SetIntensity(r,g,b)
		icon = I
		silicateIcon = I
*/

/obj/structure/window/Destroy()
	density = 0
	air_update_turf(1)
	if(!disassembled && !(flags&NODECONSTRUCT))
		playsound(src, "shatter", 70, 1)
	update_nearby_icons()
	return ..()

/obj/structure/window/Move()
	var/turf/T = loc
	..()
	dir = ini_dir
	move_update_air(T)

/obj/structure/window/CanAtmosPass(turf/T)
	if(get_dir(loc, T) == dir)
		return !density
	if(dir == SOUTHWEST || dir == SOUTHEAST || dir == NORTHWEST || dir == NORTHEAST)
		return !density
	return 1

//This proc is used to update the icons of nearby windows.
/obj/structure/window/proc/update_nearby_icons()
	update_icon()
	if(smooth)
		queue_smooth_neighbors(src)

//merges adjacent full-tile windows into one (blatant ripoff from game/smoothwall.dm)
/obj/structure/window/update_icon()
	//A little cludge here, since I don't know how it will work with slim windows. Most likely VERY wrong.
	//this way it will only update full-tile ones
	//This spawn is here so windows get properly updated when one gets deleted.
	spawn(2)
		if(!src) return
		if(!fulltile)
			return

		var/ratio = health / maxhealth
		ratio = Ceiling(ratio*4) * 25

		if(smooth)
			queue_smooth(src)

		overlays -= crack_overlay
		if(ratio > 75)
			return
		crack_overlay = image('icons/obj/structures.dmi',"damage[ratio]",-(layer+0.1))
		overlays += crack_overlay

/obj/structure/window/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
	if(exposed_temperature > T0C + (reinf ? 1600 : 800))
		hit(round(exposed_volume / 100), 0)
	..()

/obj/structure/window/storage_contents_dump_act(obj/item/weapon/storage/src_object, mob/user)
	return 0

/obj/structure/window/CanAStarPass(ID, to_dir)
	if(!density)
		return 1
	if((dir == SOUTHWEST) || (dir == to_dir))
		return 0

	return 1

/obj/structure/window/reinforced
	name = "reinforced window"
	icon_state = "rwindow"
	reinf = 1
	maxhealth = 50
	explosion_block = 1

/obj/structure/window/reinforced/ex_act(severity, target)
	switch(severity)
		if(1)
			qdel(src)
		if(2)
			spawnfragments()
		if(3)
			if(prob(50))
				spawnfragments()

/obj/structure/window/reinforced/tinted
	name = "tinted window"
	icon_state = "twindow"
	opacity = 1

/obj/structure/window/reinforced/tinted/frosted
	name = "frosted window"
	icon_state = "fwindow"

/* Full Tile Windows (more health) */

/obj/structure/window/fulltile
	icon = 'icons/obj/smooth_structures/window.dmi'
	icon_state = "window"
	dir = 5
	maxhealth = 50
	fulltile = 1
	smooth = SMOOTH_TRUE
	canSmoothWith = list(/obj/structure/window/fulltile, /obj/structure/window/reinforced/fulltile, /obj/structure/window/reinforced/tinted/fulltile)

/obj/structure/window/reinforced/fulltile
	icon = 'icons/obj/smooth_structures/reinforced_window.dmi'
	icon_state = "r_window"
	dir = 5
	maxhealth = 100
	fulltile = 1
	smooth = SMOOTH_TRUE
	canSmoothWith = list(/obj/structure/window/fulltile, /obj/structure/window/reinforced/fulltile, /obj/structure/window/reinforced/tinted/fulltile)
	level = 3

/obj/structure/window/reinforced/tinted/fulltile
	icon = 'icons/obj/smooth_structures/tinted_window.dmi'
	icon_state = "tinted_window"
	dir = 5
	fulltile = 1
	smooth = SMOOTH_TRUE
	canSmoothWith = list(/obj/structure/window/fulltile, /obj/structure/window/reinforced/fulltile, /obj/structure/window/reinforced/tinted/fulltile/)
	level = 3

/obj/structure/window/reinforced/fulltile/ice
	icon = 'icons/obj/smooth_structures/rice_window.dmi'
	icon_state = "ice_window"
	maxhealth = 150
	canSmoothWith = list(/obj/structure/window/fulltile, /obj/structure/window/reinforced/fulltile, /obj/structure/window/reinforced/tinted/fulltile, /obj/structure/window/reinforced/fulltile/ice)
	level = 3

/obj/structure/window/shuttle
	name = "shuttle window"
	desc = "A reinforced, air-locked pod window."
	icon = 'icons/obj/smooth_structures/shuttle_window.dmi'
	icon_state = "shuttle_window"
	dir = 5
	maxhealth = 100
	wtype = "shuttle"
	fulltile = 1
	reinf = 1
	smooth = SMOOTH_TRUE
	canSmoothWith = null
	explosion_block = 1
	level = 3

/obj/structure/window/shuttle/narsie_act()
	color = "#3C3434"


code:
/obj/item/weapon/
	name = "weapon"
	icon = 'icons/obj/weapons.dmi'

/obj/item/weapon/New()
	..()
	if(!hitsound)
		if(damtype == "fire")
			hitsound = 'sound/items/welder.ogg'
		if(damtype == "brute")
			hitsound = "swing_hit"


code:
/*
/tg/station13 /datum Pool:
---------------------------------
By RemieRichards

Creation/Deletion is laggy, so let's reduce reuse and recycle!

Usage:

To get a object, just call
 - PoolOrNew(type, arg) if you only want to pass one argument to New(), usually loc
 - PoolOrNew(type, list) if you want to pass multiple arguments to New()

To put a object back in the pool, call PlaceInPool(object)
This will call destroy on the object, set its loc to null,
and reset all of its vars to their default

You can override your object's destroy to return QDEL_HINT_PUTINPOOL
to ensure its always placed in this pool (this will only be acted on if qdel calls destroy, and destroy will not get called twice)

For almost all pooling purposes, it is better to use the QDEL hint than to pool it directly with PlaceInPool

*/

var/global/list/GlobalPool = list()

//You'll be using this proc 90% of the time.
//It grabs a type from the pool if it can
//And if it can't, it creates one
//The pool is flexible and will expand to fit
//The new created atom when it eventually
//Goes into the pool

//Second argument can be a single arg
//Or a list of arguments
//Either way it gets passed to new

/proc/PoolOrNew(get_type,second_arg)
	if(!get_type)
		return

	. = GetFromPool(get_type,second_arg)

	if(!.)
		if(ispath(get_type))
			if(islist(second_arg))
				. = new get_type (arglist(second_arg))
			else
				. = new get_type (second_arg)

/proc/GetFromPool(get_type,second_arg)
	if(!get_type)
		return

	if(isnull(GlobalPool[get_type]))
		return

	if(length(GlobalPool[get_type]) == 0)
		return

	var/datum/pooled = pop(GlobalPool[get_type])
	if(pooled)
		var/atom/movable/AM
		if(istype(pooled, /atom/movable))
			AM = pooled

		if(islist(second_arg))
			if(AM)
				AM.loc = second_arg[1] //we need to do loc setting explicetly before even calling New() to replicate new()'s behavior
			pooled.New(arglist(second_arg))

		else
			if(AM)
				AM.loc = second_arg
			pooled.New(second_arg)

		return pooled

/proc/PlaceInPool(datum/diver, destroy = 1)
	if(!istype(diver))
		return

	if(diver in GlobalPool[diver.type])
		return

	if(!GlobalPool[diver.type])
		GlobalPool[diver.type] = list()

	GlobalPool[diver.type] |= diver

	if (destroy)
		diver.Destroy()

	diver.ResetVars()

var/list/exclude = list("animate_movement", "contents", "loc", "locs", "parent_type", "vars", "verbs", "type")
var/list/pooledvariables = list()
//thanks to clusterfack @ /vg/station for these two procs
/datum/proc/createVariables()
	pooledvariables[type] = new/list()
	var/list/exclude = global.exclude + args

	for(var/key in vars)
		if(key in exclude)
			continue
		if(islist(vars[key]))
			pooledvariables[type][key] = list()
		else
			pooledvariables[type][key] = initial(vars[key])

/datum/proc/ResetVars()
	if(!pooledvariables[type])
		createVariables(args)

	for(var/key in pooledvariables[type])
		if (islist(pooledvariables[type][key]))
			vars[key] = list()
		else
			vars[key] = pooledvariables[type][key]

/atom/movable/ResetVars()
	..()
	loc = null
	contents = initial(contents) //something is really wrong if this object still has stuff in it by this point

/image/ResetVars()
	..()
	loc = null


code:
/*
 	Miauw's big Say() rewrite.
	This file has the basic atom/movable level speech procs.
	And the base of the send_speech() proc, which is the core of saycode.
*/
var/list/freqtospan = list(
	"1351" = "sciradio",
	"1355" = "medradio",
	"1357" = "engradio",
	"1347" = "suppradio",
	"1349" = "servradio",
	"1359" = "secradio",
	"1353" = "comradio",
	"1447" = "aiprivradio",
	"1213" = "syndradio",
	"1337" = "centcomradio"
	)

/atom/movable/proc/say(message)
	if(!can_speak())
		return
	if(message == "" || !message)
		return
	var/list/spans = get_spans()
	send_speech(message, 7, src, , spans)

/atom/movable/proc/Hear(message, atom/movable/speaker, message_langs, raw_message, radio_freq, list/spans)
	return

/atom/movable/proc/can_speak()
	return 1

/atom/movable/proc/send_speech(message, range = 7, obj/source = src, bubble_type, list/spans)
	var/rendered = compose_message(src, languages, message, , spans)
	for(var/atom/movable/AM in get_hearers_in_view(range, src))
		AM.Hear(rendered, src, languages, message, , spans)

//To get robot span classes, stuff like that.
/atom/movable/proc/get_spans()
	return list()

/atom/movable/proc/compose_message(atom/movable/speaker, message_langs, raw_message, radio_freq, list/spans)
	//This proc uses text() because it is faster than appending strings. Thanks BYOND.
	//Basic span
	var/spanpart1 = ""
	//Start name span.
	var/spanpart2 = ""
	//Radio freq/name display
	var/freqpart = radio_freq ? "\[[get_radio_name(radio_freq)]\] " : ""
	//Speaker name
	var/namepart =  "[speaker.GetVoice()][speaker.get_alt_name()]"
	//End name span.
	var/endspanpart = ""
	//Message
	var/messagepart = " [lang_treat(speaker, message_langs, raw_message, spans)]"

	return "[spanpart1][spanpart2][freqpart][compose_track_href(speaker, namepart)][namepart][compose_job(speaker, message_langs, raw_message, radio_freq)][endspanpart][messagepart]"

/atom/movable/proc/compose_track_href(atom/movable/speaker, message_langs, raw_message, radio_freq)
	return ""

/atom/movable/proc/compose_job(atom/movable/speaker, message_langs, raw_message, radio_freq)
	return ""

/atom/movable/proc/say_quote(input, list/spans=list())
	if(!input)
		return "says, \"...\""	//not the best solution, but it will stop a large number of runtimes. The cause is somewhere in the Tcomms code
	var/ending = copytext(input, length(input))
	if(copytext(input, length(input) - 1) == "!!")
		spans |= SPAN_YELL
		return "[verb_yell], \"[attach_spans(input, spans)]\""
	input = attach_spans(input, spans)
	if(ending == "?")
		return "[verb_ask], \"[input]\""
	if(ending == "!")
		return "[verb_exclaim], \"[input]\""

	return "[verb_say], \"[input]\""

/atom/movable/proc/lang_treat(atom/movable/speaker, message_langs, raw_message, list/spans)
	if(languages & message_langs)
		var/atom/movable/AM = speaker.GetSource()
		if(AM) //Basically means "if the speaker is virtual"
			if(AM.verb_say != speaker.verb_say || AM.verb_ask != speaker.verb_ask || AM.verb_exclaim != speaker.verb_exclaim || AM.verb_yell != speaker.verb_yell) //If the saymod was changed
				return speaker.say_quote(raw_message, spans)
			return AM.say_quote(raw_message, spans)
		else
			return speaker.say_quote(raw_message, spans)
	else if(message_langs & HUMAN)
		var/atom/movable/AM = speaker.GetSource()
		if(AM)
			return AM.say_quote(stars(raw_message), spans)
		else
			return speaker.say_quote(stars(raw_message), spans)
	else if(message_langs & MONKEY)
		return "chimpers."
	else if(message_langs & ALIEN)
		return "hisses."
	else if(message_langs & ROBOT)
		return "beeps rapidly."
	else if(message_langs & DRONE)
		return "chitters."
	else
		return "makes a strange sound."

/proc/get_radio_span(freq)
	var/returntext = freqtospan["[freq]"]
	if(returntext)
		return returntext
	return "radio"

/proc/get_radio_name(freq)
	var/returntext = radiochannelsreverse["[freq]"]
	if(returntext)
		return returntext
	return "[copytext("[freq]", 1, 4)].[copytext("[freq]", 4, 5)]"

/proc/attach_spans(input, list/spans)
	return "[message_spans_start(spans)][input]"

/proc/message_spans_start(list/spans)
	var/output = ""
	return output

/proc/say_test(text)
	var/ending = copytext(text, length(text))
	if (ending == "?")
		return "1"
	else if (ending == "!")
		return "2"
	return "0"

/atom/movable/proc/GetVoice()
	return name

/atom/movable/proc/IsVocal()
	return 1

/atom/movable/proc/get_alt_name()

//HACKY VIRTUALSPEAKER STUFF BEYOND THIS POINT
//these exist mostly to deal with the AIs hrefs and job stuff.

/atom/movable/proc/GetJob() //Get a job, you lazy butte

/atom/movable/proc/GetSource()

/atom/movable/proc/GetRadio()

//VIRTUALSPEAKERS
/atom/movable/virtualspeaker
	var/job
	var/atom/movable/source
	var/obj/item/device/radio/radio

/atom/movable/virtualspeaker/GetJob()
	return job

/atom/movable/virtualspeaker/GetSource()
	return source

/atom/movable/virtualspeaker/GetRadio()
	return radio

/atom/movable/virtualspeaker/Destroy()
	..()
	return QDEL_HINT_PUTINPOOL


code:
/obj/structure/shuttle
	name = "shuttle"
	icon = 'icons/turf/shuttle.dmi'

/obj/structure/shuttle/engine
	name = "engine"
	density = 1
	anchored = 1

/obj/structure/shuttle/engine/heater
	name = "heater"
	icon_state = "heater"

/obj/structure/shuttle/engine/platform
	name = "platform"
	icon_state = "platform"

/obj/structure/shuttle/engine/propulsion
	name = "propulsion"
	icon_state = "propulsion"
	opacity = 1

/obj/structure/shuttle/engine/propulsion/burst
	name = "burst"

/obj/structure/shuttle/engine/propulsion/burst/left
	name = "left"
	icon_state = "burst_l"

/obj/structure/shuttle/engine/propulsion/burst/right
	name = "right"
	icon_state = "burst_r"

/obj/structure/shuttle/engine/router
	name = "router"
	icon_state = "router"


code:
/mob/var/skincmds = list()
/obj/proc/SkinCmd(mob/user as mob, var/data as text)

/proc/SkinCmdRegister(mob/user, name as text, obj/O)
			user.skincmds[name] = O

/mob/verb/skincmd(data as text)
	set hidden = 1

	var/ref = copytext(data, 1, findtext(data, ";"))
	if (src.skincmds[ref] != null)
		var/obj/a = src.skincmds[ref]
		a.SkinCmd(src, copytext(data, findtext(data, ";") + 1))


code:
/proc/playsound(atom/source, soundin, vol as num, vary, extrarange as num, falloff, surround = 1)

	soundin = get_sfx(soundin) // same sound for everyone

	if(isarea(source))
		throw EXCEPTION("playsound(): source is an area")
		return

	var/frequency = get_rand_frequency() // Same frequency for everybody
	var/turf/turf_source = get_turf(source)

 	// Looping through the player list has the added bonus of working for mobs inside containers
	for (var/P in player_list)
		var/mob/M = P
		if(!M || !M.client)
			continue
		if(get_dist(M, turf_source) <= world.view + extrarange)
			var/turf/T = get_turf(M)
			if(T && T.z == turf_source.z)
				M.playsound_local(turf_source, soundin, vol, vary, frequency, falloff, surround)

/atom/proc/playsound_local(turf/turf_source, soundin, vol as num, vary, frequency, falloff, surround = 1)
	soundin = get_sfx(soundin)

	var/sound/S = sound(soundin)
	S.wait = 0 //No queue
	S.channel = 0 //Any channel
	S.volume = vol

	if (vary)
		if(frequency)
			S.frequency = frequency
		else
			S.frequency = get_rand_frequency()

	if(isturf(turf_source))
		var/turf/T = get_turf(src)

		//Atmosphere affects sound
		var/pressure_factor = 1
		var/datum/gas_mixture/hearer_env = T.return_air()
		var/datum/gas_mixture/source_env = turf_source.return_air()

		if(hearer_env && source_env)
			var/pressure = min(hearer_env.return_pressure(), source_env.return_pressure())
			if(pressure < ONE_ATMOSPHERE)
				pressure_factor = max((pressure - SOUND_MINIMUM_PRESSURE)/(ONE_ATMOSPHERE - SOUND_MINIMUM_PRESSURE), 0)
		else //space
			pressure_factor = 0

		var/distance = get_dist(T, turf_source)
		if(distance <= 1)
			pressure_factor = max(pressure_factor, 0.15) //touching the source of the sound

		S.volume *= pressure_factor
		//End Atmosphere affecting sound

		if(S.volume <= 0)
			return //No sound

		// 3D sounds, the technology is here!
		if (surround)
			var/dx = turf_source.x - T.x // Hearing from the right/left
			S.x = round(max(-SURROUND_CAP, min(SURROUND_CAP, dx)), 1)

			var/dz = turf_source.y - T.y // Hearing from infront/behind
			S.z = round(max(-SURROUND_CAP, min(SURROUND_CAP, dz)), 1)

		// The y value is for above your head, but there is no ceiling in 2d spessmens.
		S.y = 1
		S.falloff = (falloff ? falloff : FALLOFF_SOUNDS)

	src << S

/mob/playsound_local(turf/turf_source, soundin, vol as num, vary, frequency, falloff, surround = 1)
	if(!client || ear_deaf > 0)
		return
	..()

/mob/proc/stopLobbySound()
	src << sound(null, repeat = 0, wait = 0, volume = 85, channel = 1)

/client/proc/playtitlemusic()
	if(!ticker || !ticker.login_music)
		return
	if(prefs && (prefs.toggles & SOUND_LOBBY))
		src << sound(ticker.login_music, repeat = 0, wait = 0, volume = 85, channel = 1) // MAD JAMS

/proc/get_rand_frequency()
	return rand(32000, 55000) //Frequency stuff only works with 45kbps oggs.

/proc/get_sfx(soundin)
	if(istext(soundin))
		switch(soundin)
			if ("shatter")
				soundin = pick('sound/effects/Glassbr1.ogg','sound/effects/Glassbr2.ogg','sound/effects/Glassbr3.ogg')
			if ("explosion")
				soundin = pick('sound/effects/Explosion1.ogg','sound/effects/Explosion2.ogg')
			if ("sparks")
				soundin = pick('sound/effects/sparks1.ogg','sound/effects/sparks2.ogg','sound/effects/sparks3.ogg','sound/effects/sparks4.ogg')
			if ("rustle")
				soundin = pick('sound/effects/rustle1.ogg','sound/effects/rustle2.ogg','sound/effects/rustle3.ogg','sound/effects/rustle4.ogg','sound/effects/rustle5.ogg')
			if ("bodyfall")
				soundin = pick('sound/effects/bodyfall1.ogg','sound/effects/bodyfall2.ogg','sound/effects/bodyfall3.ogg','sound/effects/bodyfall4.ogg')
			if ("punch")
				soundin = pick('sound/weapons/punch1.ogg','sound/weapons/punch2.ogg','sound/weapons/punch3.ogg','sound/weapons/punch4.ogg')
			if ("clownstep")
				soundin = pick('sound/effects/clownstep1.ogg','sound/effects/clownstep2.ogg')
			if ("swing_hit")
				soundin = pick('sound/weapons/genhit1.ogg', 'sound/weapons/genhit2.ogg', 'sound/weapons/genhit3.ogg')
			if ("hiss")
				soundin = pick('sound/voice/hiss1.ogg','sound/voice/hiss2.ogg','sound/voice/hiss3.ogg','sound/voice/hiss4.ogg')
			if ("pageturn")
				soundin = pick('sound/effects/pageturn1.ogg', 'sound/effects/pageturn2.ogg','sound/effects/pageturn3.ogg')
			if ("gunshot")
				soundin = pick('sound/weapons/Gunshot.ogg', 'sound/weapons/Gunshot2.ogg','sound/weapons/Gunshot3.ogg','sound/weapons/Gunshot4.ogg')
	return soundin

/proc/playsound_global(file, repeat=0, wait, channel, volume)
	for(var/V in clients)
		V << sound(file, repeat, wait, channel, volume)


code:
/turf/closed
	var/thermite = 0

	opacity = 1
	density = 1
	blocks_air = 1

/turf/closed/indestructible
	name = "wall"
	icon = 'icons/turf/walls.dmi'
	explosion_block = 50
	layer = TURF_LAYER + 0.05

/turf/closed/indestructible/splashscreen
	name = "Space Station 13"
	icon = 'icons/misc/fullscreen.dmi'
	icon_state = "title"
	layer = FLY_LAYER
	var/titlescreen = TITLESCREEN

/turf/closed/indestructible/splashscreen/New()
	..()
	if(titlescreen)
		icon_state = titlescreen

/turf/closed/indestructible/riveted
	icon_state = "riveted"

/turf/closed/indestructible/riveted/New()
	..()
	if(smooth)
		queue_smooth(src)
		icon_state = ""

/turf/closed/indestructible/riveted/uranium
	icon = 'icons/turf/walls/uranium_wall.dmi'
	icon_state = "uranium"
	smooth = SMOOTH_TRUE

/turf/closed/indestructible/abductor
	icon_state = "alien1"

/turf/closed/indestructible/opshuttle
	icon_state = "wall3"

/turf/closed/indestructible/fakeglass
	name = "window"
	icon_state = "fakewindows"
	opacity = 0

/turf/closed/indestructible/fakedoor
	name = "Centcom Access"
	icon = 'icons/obj/doors/airlocks/centcom/centcom.dmi'
	icon_state = "fake_door"

/turf/closed/indestructible/rock
	name = "dense rock"
	desc = "An extremely densely-packed rock, most mining tools or explosives would never get through this."
	icon = 'icons/turf/mining.dmi'
	icon_state = "rock"

/turf/closed/indestructible/rock/snow
	name = "mountainside"
	desc = "An extremely densely-packed rock, sheeted over with centuries worth of ice and snow."
	icon = 'icons/turf/walls.dmi'
	icon_state = "snowrock"

/turf/closed/indestructible/rock/snow/ice
	name = "iced rock"
	desc = "Extremely densely-packed sheets of ice and rock, forged over the years of the harsh cold."
	icon = 'icons/turf/walls.dmi'
	icon_state = "icerock"


code:
/turf/open
	var/slowdown = 0 //negative for faster, positive for slower

	var/oxygen = 0
	var/carbon_dioxide = 0
	var/nitrogen = 0
	var/toxins = 0

	var/wet = 0
	var/image/wet_overlay = null

/turf/open/Initalize_Atmos(times_fired)
	excited = 0
	update_visuals()
	if (blocks_air)
		return
	current_cycle = times_fired

	//cache some vars
	var/datum/gas_mixture/air = src.air
	var/list/atmos_adjacent_turfs = src.atmos_adjacent_turfs

	for(var/direction in cardinal)
		var/turf/open/enemy_tile = get_step(src, direction)
		if(!istype(enemy_tile))
			atmos_adjacent_turfs -= enemy_tile
			continue
		var/datum/gas_mixture/enemy_air = enemy_tile.return_air()

		//only check this turf, if it didn't check us when it was initalized
		if(enemy_tile.current_cycle < times_fired)
			if(CanAtmosPass(enemy_tile))
				atmos_adjacent_turfs |= enemy_tile
				enemy_tile.atmos_adjacent_turfs |= src
			else
				atmos_adjacent_turfs -= enemy_tile
				enemy_tile.atmos_adjacent_turfs -= src
				continue
		else
			if (!(enemy_tile in atmos_adjacent_turfs))
				continue

		var/is_active = air.compare(enemy_air)

		if(is_active)
			//testing("Active turf found. Return value of compare(): [is_active]")
			if(!excited) //make sure we aren't already excited
				excited = 1
				SSair.active_turfs |= src

/turf/open/handle_fall(mob/faller, forced)
	faller.lying = pick(90, 270)
	if(!forced)
		return
	if(has_gravity(src))
		playsound(src, "bodyfall", 50, 1)

/turf/open/handle_slip(mob/living/carbon/C, s_amount, w_amount, obj/O, lube)
	if(has_gravity(src))
		var/obj/buckled_obj
		if(C.buckled)
			buckled_obj = C.buckled
			if(!(lube&GALOSHES_DONT_HELP)) //can't slip while buckled unless it's lube.
				return 0
		else
			if(C.lying || !(C.status_flags & CANWEAKEN)) // can't slip unbuckled mob if they're lying or can't fall.
				return 0
			if(C.m_intent=="walk" && (lube&NO_SLIP_WHEN_WALKING))
				return 0

		C << "You slipped[ O ? " on the [O.name]" : ""]!"

		C.attack_log += "\[[time_stamp()]\] Slipped[O ? " on the [O.name]" : ""][(lube&SLIDE)? " (LUBE)" : ""]!"
		playsound(C.loc, 'sound/misc/slip.ogg', 50, 1, -3)

		C.accident(C.l_hand)
		C.accident(C.r_hand)

		var/olddir = C.dir
		C.Stun(s_amount)
		C.Weaken(w_amount)
		C.stop_pulling()
		if(buckled_obj)
			buckled_obj.unbuckle_mob(C)
			step(buckled_obj, olddir)
		else if(lube&SLIDE)
			for(var/i=1, i<5, i++)
				spawn (i)
					step(C, olddir)
					C.spin(1,1)
		return 1

/turf/open/proc/MakeSlippery(wet_setting = TURF_WET_WATER) // 1 = Water, 2 = Lube, 3 = Ice
	if(wet >= wet_setting)
		return
	wet = wet_setting
	if(wet_setting != TURF_DRY)
		if(wet_overlay)
			overlays -= wet_overlay
			wet_overlay = null
		var/turf/open/floor/F = src
		if(istype(F))
			wet_overlay = image('icons/effects/water.dmi', src, "wet_floor_static")
		else
			wet_overlay = image('icons/effects/water.dmi', src, "wet_static")
		overlays += wet_overlay

	spawn(rand(790, 820)) // Purely so for visual effect
		if(!istype(src, /turf)) //Because turfs don't get deleted, they change, adapt, transform, evolve and deform. they are one and they are all.
			return
		MakeDry(wet_setting)

/turf/open/proc/MakeDry(wet_setting = TURF_WET_WATER)
	if(wet > wet_setting)
		return
	wet = TURF_DRY
	if(wet_overlay)
		overlays -= wet_overlay


code:
//Janitors!  Janitors, janitors, janitors!  -Sayu

//Conspicuously not-recent versions of suspicious cleanables

/obj/effect/decal/cleanable/blood/old
	name = "dried blood"
	desc = "Looks like it's been here a while.  Eew."
	bloodiness = 0

/obj/effect/decal/cleanable/blood/old/New()
	..()
	icon_state += "-old"
	blood_DNA["Non-human DNA"] = "A+"

/obj/effect/decal/cleanable/blood/gibs/old
	name = "old rotting gibs"
	desc = "Space Jesus, why didn't anyone clean this up?  It smells terrible."
	bloodiness = 0

/obj/effect/decal/cleanable/blood/gibs/old/New()
	..()
	icon_state += "-old"
	dir = pick(1,2,4,8)
	blood_DNA["Non-human DNA"] = "A+"

/obj/effect/decal/cleanable/vomit/old
	name = "crusty dried vomit"
	desc = "You try not to look at the chunks, and fail."

/obj/effect/decal/cleanable/vomit/old/New()
	..()
	icon_state += "-old"

/obj/effect/decal/cleanable/robot_debris/old
	name = "dusty robot debris"
	desc = "Looks like nobody has touched this in a while."

//Making the station dirty, one tile at a time. Called by master controller's setup_objects

/turf/open/floor/proc/MakeDirty()
	if(prob(66))	//fastest possible exit 2/3 of the time
		return

	// These look weird if you make them dirty
	if(istype(src, /turf/open/floor/carpet) || istype(src, /turf/open/floor/grass) || istype(src, /turf/open/floor/plating/beach) || istype(src, /turf/open/floor/holofloor)|| istype(src, /turf/open/floor/plating/ironsand))
		return

	if(locate(/obj/structure/grille) in contents)
		return

	var/area/A = loc

				//zero dirt
	if(!istype(A) || istype(A, /area/centcom) || istype(A, /area/holodeck) || istype(A, /area/library) || istype(A, /area/janitor) || istype(A, /area/chapel) || istype(A, /area/mine/explored) || istype(A, /area/mine/unexplored) || istype(A, /area/solar) || istype(A, /area/atmos) || istype(A, /area/medical/virology))
		return

				//high dirt - 1/3
	if(istype(A, /area/toxins/test_area) || istype(A, /area/mine/production) || istype(A, /area/mine/living_quarters) || istype(A, /area/mine/north_outpost) || istype(A, /area/mine/west_outpost) || istype(A, /area/wreck) || istype(A, /area/derelict) || istype(A, /area/djstation))
		new /obj/effect/decal/cleanable/dirt(src)	//vanilla, but it works
		return

	if(prob(80))	//mid dirt  - 1/15
		return

	if(istype(A, /area/engine) || istype(A,/area/assembly) || istype(A,/area/maintenance) || istype(A,/area/construction))
	 	//Blood, sweat, and oil.  Oh, and dirt.
		if(prob(3))
			new /obj/effect/decal/cleanable/blood/old(src)
		else
			if(prob(35))
				if(prob(4))
					new /obj/effect/decal/cleanable/robot_debris/old(src)
				else
					new /obj/effect/decal/cleanable/oil(src)
			else
				new /obj/effect/decal/cleanable/dirt(src)
		return

	if(istype(A, /area/crew_quarters/toilet) || istype(A, /area/crew_quarters/locker/locker_toilet))
		if(prob(40))
			if(prob(90))
				new /obj/effect/decal/cleanable/vomit/old(src)
			else
				new /obj/effect/decal/cleanable/blood/old(src)
		return

	if(istype(A, /area/quartermaster))
		if(prob(25))
			new /obj/effect/decal/cleanable/oil(src)
		return

	if(prob(75))	//low dirt  - 1/60
		return

	if(istype(A, /area/turret_protected) || istype(A, /area/security))	//chance of incident
		if(prob(20))
			if(prob(5))
				new /obj/effect/decal/cleanable/blood/gibs/old(src)
			else
				new /obj/effect/decal/cleanable/blood/old(src)
		return

	if(istype(A, /area/crew_quarters/kitchen))	//Kitchen messes
		if(prob(60))
			if(prob(50))
				new /obj/effect/decal/cleanable/egg_smudge(src)
			else
				new /obj/effect/decal/cleanable/flour(src)
		return

	if(istype(A, /area/medical))	//Kept clean, but chance of blood
		if(prob(66))
			if(prob(5))
				new /obj/effect/decal/cleanable/blood/gibs/old(src)
			else
				new /obj/effect/decal/cleanable/blood/old(src)
		else
			if(prob(30))
				if(istype(A, /area/medical/morgue))
					new /obj/item/weapon/ectoplasm(src)
				else
					new /obj/effect/decal/cleanable/vomit/old(src)
		return

	if(istype(A, /area/toxins))
		if(prob(20))
			new /obj/effect/decal/cleanable/greenglow(src)	//this cleans itself up but it might startle you when you see it.
		return

	return


code:
//This is so damaged or burnt tiles or platings don't get remembered as the default tile
var/list/icons_to_ignore_at_floor_init = list("damaged1","damaged2","damaged3","damaged4",
				"damaged5","panelscorched","floorscorched1","floorscorched2","platingdmg1","platingdmg2",
				"platingdmg3","plating","light_on","light_on_flicker1","light_on_flicker2",
				"light_on_clicker3","light_on_clicker4","light_on_clicker5","light_broken",
				"light_on_broken","light_off","wall_thermite","grass", "sand",
				"asteroid","asteroid_dug",
				"asteroid0","asteroid1","asteroid2","asteroid3","asteroid4",
				"asteroid5","asteroid6","asteroid7","asteroid8","asteroid9","asteroid10","asteroid11","asteroid12",
				"basalt","basalt_dug",
				"basalt0","basalt1","basalt2","basalt3","basalt4",
				"basalt5","basalt6","basalt7","basalt8","basalt9","basalt10","basalt11","basalt12",
				"oldburning","light-on-r","light-on-y","light-on-g","light-on-b", "wood", "wood-broken",
				"carpetcorner", "carpetside", "carpet", "ironsand1", "ironsand2", "ironsand3", "ironsand4", "ironsand5",
				"ironsand6", "ironsand7", "ironsand8", "ironsand9", "ironsand10", "ironsand11",
				"ironsand12", "ironsand13", "ironsand14", "ironsand15")

/turf/open/floor
	//NOTE: Floor code has been refactored, many procs were removed and refactored
	//- you should use istype() if you want to find out whether a floor has a certain type
	//- floor_tile is now a path, and not a tile obj
	//- builtin_tile should be dropped if needed for performance reasons (eg singularity_act())
	name = "floor"
	icon = 'icons/turf/floors.dmi'

	var/icon_regular_floor = "floor" //used to remember what icon the tile should have by default
	var/icon_plating = "plating"
	thermal_conductivity = 0.040
	heat_capacity = 10000
	intact = 1
	var/broken = 0
	var/burnt = 0
	var/floor_tile = null //tile that this floor drops
	var/obj/item/stack/tile/builtin_tile = null //needed for performance reasons when the singularity rips off floor tiles
	var/list/broken_states = list("damaged1", "damaged2", "damaged3", "damaged4", "damaged5")
	var/list/burnt_states = list()

/turf/open/floor/New()
	..()
	if(icon_state in icons_to_ignore_at_floor_init) //so damaged/burned tiles or plating icons aren't saved as the default
		icon_regular_floor = "floor"
	else
		icon_regular_floor = icon_state
	if(floor_tile)
		builtin_tile = new floor_tile

/turf/open/floor/Destroy()
	if(builtin_tile)
		qdel(builtin_tile)
		builtin_tile = null
	return ..()

/turf/open/floor/ex_act(severity, target)
	var/shielded = is_shielded()
	..()
	if(severity != 1 && shielded && target != src)
		return
	if(target == src)
		src.ChangeTurf(src.baseturf)
	if(target != null)
		ex_act(3)
		return

	switch(severity)
		if(1)
			src.ChangeTurf(src.baseturf)
		if(2)
			switch(pick(1,2;75,3))
				if(1)
					src.ReplaceWithLattice()
					if(prob(33)) new /obj/item/stack/sheet/metal(src)
				if(2)
					src.ChangeTurf(src.baseturf)
				if(3)
					if(prob(80))
						src.break_tile_to_plating()
					else
						src.break_tile()
					src.hotspot_expose(1000,CELL_VOLUME)
					if(prob(33)) new /obj/item/stack/sheet/metal(src)
		if(3)
			if (prob(50))
				src.break_tile()
				src.hotspot_expose(1000,CELL_VOLUME)

/turf/open/floor/is_shielded()
	for(var/obj/structure/A in contents)
		if(A.level == 3)
			return 1

/turf/open/floor/blob_act()
	return

/turf/open/floor/proc/update_icon()
	update_visuals()
	return 1

/turf/open/floor/attack_paw(mob/user)
	return src.attack_hand(user)

/turf/open/floor/proc/gets_drilled()
	return

/turf/open/floor/proc/break_tile_to_plating()
	var/turf/open/floor/plating/T = make_plating()
	T.break_tile()

/turf/open/floor/proc/break_tile()
	if(broken)
		return
	icon_state = pick(broken_states)
	broken = 1

/turf/open/floor/burn_tile()
	if(broken || burnt)
		return
	if(burnt_states.len)
		icon_state = pick(burnt_states)
	else
		icon_state = pick(broken_states)
	burnt = 1

/turf/open/floor/proc/make_plating()
	return ChangeTurf(/turf/open/floor/plating)

/turf/open/floor/ChangeTurf(turf/open/floor/T)
	if(!istype(src,/turf/open/floor))
		return ..() //fucking turfs switch the fucking src of the fucking running procs
	if(!ispath(T,/turf/open/floor))
		return ..()
	var/old_icon = icon_regular_floor
	var/old_dir = dir
	var/turf/open/floor/W = ..()
	W.icon_regular_floor = old_icon
	W.dir = old_dir
	W.update_icon()
	return W

/turf/open/floor/attackby(obj/item/C, mob/user, params)
	if(!C || !user)
		return 1
	if(..())
		return 1
	if(intact && istype(C, /obj/item/weapon/crowbar))
		if(broken || burnt)
			broken = 0
			burnt = 0
			user << "You remove the broken plating."
		else
			if(istype(src, /turf/open/floor/wood))
				user << "You forcefully pry off the planks, destroying them in the process."
			else
				user << "You remove the floor tile."
				builtin_tile.loc = src
		make_plating()
		playsound(src, 'sound/items/Crowbar.ogg', 80, 1)
		return 1
	return 0

/turf/open/floor/singularity_pull(S, current_size)
	if(current_size == STAGE_THREE)
		if(prob(30))
			if(builtin_tile)
				builtin_tile.loc = src
				make_plating()
	else if(current_size == STAGE_FOUR)
		if(prob(50))
			if(builtin_tile)
				builtin_tile.loc = src
				make_plating()
	else if(current_size >= STAGE_FIVE)
		if(builtin_tile)
			if(prob(70))
				builtin_tile.loc = src
				make_plating()
		else if(prob(50))
			ReplaceWithLattice()

/turf/open/floor/narsie_act()
	if(prob(20))
		ChangeTurf(/turf/open/floor/engine/cult)

/turf/open/floor/can_have_cabling()
	return !burnt && !broken

/turf/open/floor/initialize()
	..()
	MakeDirty()


code:
/* In this file:
 * Wood floor
 * Grass floor
 * Carpet floor
 */

/turf/open/floor/wood
	icon_state = "wood"
	floor_tile = /obj/item/stack/tile/wood
	broken_states = list("wood-broken", "wood-broken2", "wood-broken3", "wood-broken4", "wood-broken5", "wood-broken6", "wood-broken7")

/turf/open/floor/wood/attackby(obj/item/C, mob/user, params)
	if(..())
		return
	if(istype(C, /obj/item/weapon/screwdriver))
		if(broken || burnt)
			return
		user << "You unscrew the planks."
		new floor_tile(src)
		make_plating()
		playsound(src, 'sound/items/Screwdriver.ogg', 80, 1)
		return

/turf/open/floor/wood/cold
	temperature = 255.37

/turf/open/floor/grass
	name = "Grass patch"
	icon_state = "grass"
	floor_tile = /obj/item/stack/tile/grass
	broken_states = list("sand")

/turf/open/floor/grass/New()
	..()
	spawn(1)
		update_icon()

/turf/open/floor/grass/attackby(obj/item/C, mob/user, params)
	if(..())
		return
	if(istype(C, /obj/item/weapon/shovel))
		new /obj/item/weapon/ore/glass(src)
		new /obj/item/weapon/ore/glass(src) //Make some sand if you shovel grass
		user << "You shovel the grass."
		make_plating()

/turf/open/floor/carpet
	name = "Carpet"
	icon = 'icons/turf/floors/carpet.dmi'
	icon_state = "carpet"
	floor_tile = /obj/item/stack/tile/carpet
	broken_states = list("damaged")
	smooth = SMOOTH_TRUE
	canSmoothWith = null

/turf/open/floor/carpet/New()
	..()
	spawn(1)
		update_icon()

/turf/open/floor/carpet/update_icon()
	if(!..())
		return 0
	if(!broken && !burnt)
		if(smooth)
			queue_smooth(src)
	else
		make_plating()
		if(smooth)
			queue_smooth_neighbors(src)

/turf/open/floor/carpet/break_tile()
	broken = 1
	update_icon()

/turf/open/floor/carpet/burn_tile()
	burnt = 1
	update_icon()

/turf/open/floor/fakespace
	icon = 'icons/turf/space.dmi'
	icon_state = "0"
	floor_tile = /obj/item/stack/tile/fakespace
	broken_states = list("damaged")

/turf/open/floor/fakespace/New()
	..()
	icon_state = "[rand(0,25)]"


code:
/turf/open/floor/light
	name = "Light floor"
	luminosity = 5
	icon_state = "light_on"
	floor_tile = /obj/item/stack/tile/light
	broken_states = list("light_broken")
	var/on = 1
	var/state //0 = fine, 1 = flickering, 2 = breaking, 3 = broken
	var/list/coloredlights = list("g", "r", "y", "b", "p", "w", "s","o","g")
	var/currentcolor = 1

/turf/open/floor/light/New()
	..()
	spawn(5) //needed because when placing a light floor tile it will take a short while before setting state
		if(istype(builtin_tile, /obj/item/stack/tile/light))
			var/obj/item/stack/tile/light/L = builtin_tile
			L.state = state
	update_icon()

/turf/open/floor/light/update_icon()
	..()
	if(on)
		switch(state)
			if(0)
				icon_state = "light_on-[coloredlights[currentcolor]]"
				SetLuminosity(1)
			if(1)
				var/num = pick("1","2","3","4")
				icon_state = "light_on_flicker[num]"
				SetLuminosity(1)
			if(2)
				icon_state = "light_on_broken"
				SetLuminosity(1)
			if(3)
				icon_state = "light_off"
				SetLuminosity(0)
	else
		SetLuminosity(0)
		icon_state = "light_off"

/turf/open/floor/light/ChangeTurf(turf/T)
	SetLuminosity(0)
	..()

/turf/open/floor/light/attack_hand(mob/user)
	if(!on)
		on = 1
		currentcolor = 1
		return
	else
		currentcolor++
	if(currentcolor > coloredlights.len)
		on = 0
	update_icon()
	..()  //I am not sure what the parent procs have for attack_hand, best to check later.

/turf/open/floor/light/attack_ai(mob/user)
	attack_hand(user)

/turf/open/floor/light/attackby(obj/item/C, mob/user, params)
	if(..())
		return
	if(istype(C,/obj/item/weapon/light/bulb)) //only for light tiles
		if(state && user.drop_item())
			qdel(C)
			state = 0 //fixing it by bashing it with a light bulb, fun eh?
			update_icon()
			user << "You replace the light bulb."
		else
			user << "The lightbulb seems fine, no need to replace it."


code:
/* In this file:
 *
 * Plasma floor
 * Gold floor
 * Silver floor
 * Bananium floor
 * Diamond floor
 * Uranium floor
 */

/turf/open/floor/mineral
	name = "mineral floor"
	icon_state = ""
	var/list/icons = list()

/turf/open/floor/mineral/New()
	..()
	broken_states = list("[initial(icon_state)]_dam")

/turf/open/floor/mineral/update_icon()
	if(!..())
		return 0
	if(!broken && !burnt)
		if( !(icon_state in icons) )
			icon_state = initial(icon_state)

//PLASMA

/turf/open/floor/mineral/plasma
	name = "plasma floor"
	icon_state = "plasma"
	floor_tile = /obj/item/stack/tile/mineral/plasma
	icons = list("plasma","plasma_dam")

/turf/open/floor/mineral/plasma/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
	if(exposed_temperature > 300)
		PlasmaBurn()

/turf/open/floor/mineral/plasma/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
	if(W.is_hot() > 300)//If the temperature of the object is over 300, then ignite
		message_admins("Plasma flooring was ignited by [key_name_admin(user)](?) (FLW) in ([x],[y],[z] - JMP)",0,1)
		log_game("Plasma flooring was ignited by [key_name(user)] in ([x],[y],[z])")
		ignite(W.is_hot())
		return
	..()

/turf/open/floor/mineral/plasma/proc/PlasmaBurn()
	make_plating()
	atmos_spawn_air("plasma=20;TEMP=1000")

/turf/open/floor/mineral/plasma/proc/ignite(exposed_temperature)
	if(exposed_temperature > 300)
		PlasmaBurn()

//GOLD

/turf/open/floor/mineral/gold
	name = "gold floor"
	icon_state = "gold"
	floor_tile = /obj/item/stack/tile/mineral/gold
	icons = list("gold","gold_dam")

//SILVER

/turf/open/floor/mineral/silver
	name = "silver floor"
	icon_state = "silver"
	floor_tile = /obj/item/stack/tile/mineral/silver
	icons = list("silver","silver_dam")

//BANANIUM

/turf/open/floor/mineral/bananium
	name = "bananium floor"
	icon_state = "bananium"
	floor_tile = /obj/item/stack/tile/mineral/bananium
	icons = list("bananium","bananium_dam")
	var/spam_flag = 0

/turf/open/floor/mineral/bananium/Entered(var/mob/AM)
	.=..()
	if(!.)
		if(istype(AM))
			squeek()

/turf/open/floor/mineral/bananium/attackby(obj/item/weapon/W, mob/user, params)
	.=..()
	if(!.)
		honk()

/turf/open/floor/mineral/bananium/attack_hand(mob/user)
	.=..()
	if(!.)
		honk()

/turf/open/floor/mineral/bananium/attack_paw(mob/user)
	.=..()
	if(!.)
		honk()

/turf/open/floor/mineral/bananium/proc/honk()
	if(!spam_flag)
		spam_flag = 1
		playsound(src, 'sound/items/bikehorn.ogg', 50, 1)
		spawn(20)
			spam_flag = 0

/turf/open/floor/mineral/bananium/proc/squeek()
	if(!spam_flag)
		spam_flag = 1
		playsound(src, "clownstep", 50, 1)
		spawn(10)
			spam_flag = 0

/turf/open/floor/mineral/bananium/airless
	oxygen = 0.01
	nitrogen = 0.01
	temperature = TCMB

//DIAMOND

/turf/open/floor/mineral/diamond
	name = "diamond floor"
	icon_state = "diamond"
	floor_tile = /obj/item/stack/tile/mineral/diamond
	icons = list("diamond","diamond_dam")

//URANIUM

/turf/open/floor/mineral/uranium
	name = "uranium floor"
	icon_state = "uranium"
	floor_tile = /obj/item/stack/tile/mineral/uranium
	icons = list("uranium","uranium_dam")
	var/last_event = 0
	var/active = null

/turf/open/floor/mineral/uranium/Entered(var/mob/AM)
	.=..()
	if(!.)
		if(istype(AM))
			radiate()

/turf/open/floor/mineral/uranium/attackby(obj/item/weapon/W, mob/user, params)
	.=..()
	if(!.)
		radiate()

/turf/open/floor/mineral/uranium/attack_hand(mob/user)
	.=..()
	if(!.)
		radiate()

/turf/open/floor/mineral/uranium/attack_paw(mob/user)
	.=..()
	if(!.)
		radiate()

/turf/open/floor/mineral/uranium/proc/radiate()
	if(!active)
		if(world.time > last_event+15)
			active = 1
			radiation_pulse(get_turf(src), 3, 3, 1, 0)
			for(var/turf/open/floor/mineral/uranium/T in orange(1,src))
				T.radiate()
			last_event = world.time
			active = 0
			return

// ALIEN ALLOY
/turf/open/floor/mineral/abductor
	name = "alien floor"
	icon_state = "alienpod1"
	floor_tile = /obj/item/stack/tile/mineral/abductor
	icons = list("alienpod1", "alienpod2", "alienpod3", "alienpod4", "alienpod5", "alienpod6", "alienpod7", "alienpod8", "alienpod9")

/turf/open/floor/mineral/abductor/New()
	..()
	icon_state = "alienpod[rand(1,9)]"

/turf/open/floor/mineral/abductor/break_tile()
	return //unbreakable

/turf/open/floor/mineral/abductor/burn_tile()
	return //unburnable

/turf/open/floor/mineral/abductor/make_plating()
	return ChangeTurf(/turf/open/floor/plating/abductor2)

/turf/open/floor/plating/abductor2
	name = "alien plating"
	icon_state = "alienplating"

/turf/open/floor/plating/abductor2/break_tile()
	return //unbreakable

/turf/open/floor/plating/abductor2/burn_tile()
	return //unburnable


code:
/turf/open/floor/goonplaque
	name = "Commemorative Plaque"
	icon_state = "plaque"
	desc = "\"This is a plaque in honour of our comrades on the G4407 Stations. Hopefully TG4407 model can live up to your fame and fortune.\" Scratched in beneath that is a crude image of a meteor and a spaceman. The spaceman is laughing. The meteor is exploding."
	floor_tile = /obj/item/stack/tile/plasteel

/turf/open/floor/vault
	icon_state = "rockvault"
	floor_tile = /obj/item/stack/tile/plasteel

/turf/open/floor/bluegrid
	icon = 'icons/turf/floors.dmi'
	icon_state = "bcircuit"
	floor_tile = /obj/item/stack/tile/plasteel

/turf/open/floor/bluegrid/New()
	..()
	nuke_tiles += src

/turf/open/floor/bluegrid/Destroy()
	nuke_tiles -= src
	return ..()

/turf/open/floor/greengrid
	icon = 'icons/turf/floors.dmi'
	icon_state = "gcircuit"
	floor_tile = /obj/item/stack/tile/plasteel

/turf/open/floor/plating/beach
	name = "Beach"
	icon = 'icons/misc/beach.dmi'

/turf/open/floor/plating/beach/ex_act(severity, target)
	contents_explosion(severity, target)

/turf/open/floor/plating/beach/sand
	name = "Sand"
	icon_state = "sand"
	baseturf = /turf/open/floor/plating/beach/sand

/turf/open/floor/plating/beach/coastline_t
	name = "Coastline"
	icon_state = "sandwater_t"
	baseturf = /turf/open/floor/plating/beach/coastline_t

/turf/open/floor/plating/beach/coastline_b
	name = "Coastline"
	icon_state = "sandwater_b"
	baseturf = /turf/open/floor/plating/beach/coastline_b

/turf/open/floor/plating/beach/water
	name = "Water"
	icon_state = "water"
	baseturf = /turf/open/floor/plating/beach/water

/turf/open/floor/plating/ironsand/New()
	..()
	name = "Iron Sand"
	icon_state = "ironsand[rand(1,15)]"

/turf/open/floor/plating/ironsand/burn_tile()
	return

/turf/open/floor/plating/ice
	name = "ice sheet"
	desc = "A sheet of solid ice. Looks slippery."
	icon = 'icons/turf/snow.dmi'
	icon_state = "ice"
	temperature = 180
	baseturf = /turf/open/floor/plating/ice
	slowdown = 1
	wet = TURF_WET_ICE

/turf/open/floor/plating/ice/colder
	temperature = 140

/turf/open/floor/plating/ice/temperate
	temperature = 255.37

/turf/open/floor/plating/ice/break_tile()
	return

/turf/open/floor/plating/ice/burn_tile()
	return

/turf/open/floor/plating/snowed
	name = "snowed-over plating"
	desc = "A section of plating covered in a light layer of snow."
	icon = 'icons/turf/snow.dmi'
	icon_state = "snowplating"
	temperature = 180

/turf/open/floor/plating/snowed/colder
	temperature = 140

/turf/open/floor/plating/snowed/temperatre
	temperature = 255.37

/turf/open/floor/noslip
	name = "high-traction floor"
	icon_state = "noslip"
	floor_tile = /obj/item/stack/tile/noslip
	broken_states = list("noslip-damaged1","noslip-damaged2","noslip-damaged3")
	burnt_states = list("noslip-scorched1","noslip-scorched2")
	slowdown = -0.3

/turf/open/floor/noslip/MakeSlippery()
	return


code:
/turf/open/floor/plasteel
	icon_state = "floor"
	floor_tile = /obj/item/stack/tile/plasteel
	broken_states = list("damaged1", "damaged2", "damaged3", "damaged4", "damaged5")
	burnt_states = list("floorscorched1", "floorscorched2")

/turf/open/floor/plasteel/update_icon()
	if(!..())
		return 0
	if(!broken && !burnt)
		icon_state = icon_regular_floor

/turf/open/floor/plasteel/black
	icon_state = "dark"
/turf/open/floor/plasteel/black/side
	icon_state = "black" //NOTICE ME SEMPAI: floors.dmi contains two sprites named black, remove the incorrect one
/turf/open/floor/plasteel/black/corner
	icon_state = "blackcorner"

/turf/open/floor/plasteel/white
	icon_state = "white"
/turf/open/floor/plasteel/white/side
	icon_state = "whitehall"
/turf/open/floor/plasteel/white/corner
	icon_state = "whitecorner"

/turf/open/floor/plasteel/brown
	icon_state = "brown"
/turf/open/floor/plasteel/brown/corner
	icon_state = "browncorner"

/turf/open/floor/plasteel/darkbrown
	icon_state = "darkbrownfull"
/turf/open/floor/plasteel/darkbrown/side
	icon_state = "darkbrown"
/turf/open/floor/plasteel/darkbrown/corner
	icon_state = "darkbrowncorners"

/turf/open/floor/plasteel/green
	icon_state = "greenfull"
/turf/open/floor/plasteel/green/side
	icon_state = "green"
/turf/open/floor/plasteel/green/corner
	icon_state = "greencorner"

/turf/open/floor/plasteel/darkgreen
	icon_state = "darkgreenfull"
/turf/open/floor/plasteel/darkgreen/side
	icon_state = "darkgreen"
/turf/open/floor/plasteel/darkgreen/corner
	icon_state = "darkgreencorners"

/turf/open/floor/plasteel/whitegreen
	icon_state = "whitegreenfull"
/turf/open/floor/plasteel/whitegreen/side
	icon_state = "whitegreen"
/turf/open/floor/plasteel/whitegreen/corner
	icon_state = "whitegreencorner"

/turf/open/floor/plasteel/red
	icon_state = "redfull"
/turf/open/floor/plasteel/red/side
	icon_state = "red"
/turf/open/floor/plasteel/red/corner
	icon_state = "redcorner"

/turf/open/floor/plasteel/darkred
	icon_state = "darkredfull"
/turf/open/floor/plasteel/darkred/side
	icon_state = "darkred"
/turf/open/floor/plasteel/darkred/corner
	icon_state = "darkredcorners"

/turf/open/floor/plasteel/whitered
	icon_state = "whiteredfull"
/turf/open/floor/plasteel/whitered/side
	icon_state = "whitered"
/turf/open/floor/plasteel/whitered/corner
	icon_state = "whiteredcorner"

/turf/open/floor/plasteel/blue
	icon_state = "bluefull"
/turf/open/floor/plasteel/blue/side
	icon_state = "blue"
/turf/open/floor/plasteel/blue/corner
	icon_state = "bluecorner"

/turf/open/floor/plasteel/darkblue
	icon_state = "darkbluefull"
/turf/open/floor/plasteel/darkblue/side
	icon_state = "darkblue"
/turf/open/floor/plasteel/darkblue/corner
	icon_state = "darkbluecorners"

/turf/open/floor/plasteel/whiteblue
	icon_state = "whitebluefull"
/turf/open/floor/plasteel/whiteblue/side
	icon_state = "whiteblue"
/turf/open/floor/plasteel/whiteblue/corner
	icon_state = "whitebluecorner"

/turf/open/floor/plasteel/yellow
	icon_state = "yellowfull"
/turf/open/floor/plasteel/yellow/side
	icon_state = "yellow"
/turf/open/floor/plasteel/yellow/corner
	icon_state = "yellowcorner"

/turf/open/floor/plasteel/darkyellow
	icon_state = "darkyellowfull"
/turf/open/floor/plasteel/darkyellow/side
	icon_state = "darkyellow"
/turf/open/floor/plasteel/darkyellow/corner
	icon_state = "darkyellowcorners"

/turf/open/floor/plasteel/whiteyellow
	icon_state = "whiteyellowfull"
/turf/open/floor/plasteel/whiteyellow/side
	icon_state = "whiteyellow"
/turf/open/floor/plasteel/whiteyellow/corner
	icon_state = "whiteyellowcorner"

/turf/open/floor/plasteel/purple
	icon_state = "purplefull"
/turf/open/floor/plasteel/purple/side
	icon_state = "purple"
/turf/open/floor/plasteel/purple/corner
	icon_state = "purplecorner"

/turf/open/floor/plasteel/darkpurple
	icon_state = "darkpurplefull"
/turf/open/floor/plasteel/darkpurple/side
	icon_state = "darkpurple"
/turf/open/floor/plasteel/darkpurple/corner
	icon_state = "darkpurplecorners"

/turf/open/floor/plasteel/whitepurple
	icon_state = "whitepurplefull"
/turf/open/floor/plasteel/whitepurple/side
	icon_state = "whitepurple"
/turf/open/floor/plasteel/whitepurple/corner
	icon_state = "whitepurplecorner"

/turf/open/floor/plasteel/orange
	icon_state = "orangefull"
/turf/open/floor/plasteel/orange/side
	icon_state = "orange"
/turf/open/floor/plasteel/orange/corner
	icon_state = "orangecorner"

/turf/open/floor/plasteel/neutral
	icon_state = "neutralfull"
/turf/open/floor/plasteel/neutral/side
	icon_state = "neutral"
/turf/open/floor/plasteel/neutral/corner
	icon_state = "neutralcorner"

/turf/open/floor/plasteel/arrival
	icon_state = "arrival"
/turf/open/floor/plasteel/arrival/corner
	icon_state = "arrivalcorner"

/turf/open/floor/plasteel/escape
	icon_state = "escape"
/turf/open/floor/plasteel/escape/corner
	icon_state = "escapecorner"

/turf/open/floor/plasteel/caution
	icon_state = "caution"
/turf/open/floor/plasteel/caution/corner
	icon_state = "cautioncorner"

/turf/open/floor/plasteel/warning
	icon_state = "warning"
/turf/open/floor/plasteel/warning/corner
	icon_state = "warningcorner"

/turf/open/floor/plasteel/warnplate
	icon_state = "warnplate"
/turf/open/floor/plasteel/warnplate/corner
	icon_state = "warnplatecorner"

/turf/open/floor/plasteel/warnwhite
	icon_state = "warnwhite"
/turf/open/floor/plasteel/warnwhite/corner
	icon_state = "warnwhitecorner"

/turf/open/floor/plasteel/whitebot
	icon_state = "whitebot"
/turf/open/floor/plasteel/whitebot/delivery
	icon_state = "whitedelivery"

/turf/open/floor/plasteel/redyellow
	icon_state = "redyellowfull"
/turf/open/floor/plasteel/redyellow/side
	icon_state = "redyellow"

/turf/open/floor/plasteel/redblue
	icon_state = "redbluefull"
/turf/open/floor/plasteel/redblue/blueside
	icon_state = "bluered"
/turf/open/floor/plasteel/redblue/redside
	icon_state = "redblue"

/turf/open/floor/plasteel/redgreen
	icon_state = "redgreenfull"
/turf/open/floor/plasteel/redgreen/side
	icon_state = "redgreen"

/turf/open/floor/plasteel/greenyellow
	icon_state = "greenyellowfull"
/turf/open/floor/plasteel/greenyellow/side
	icon_state = "greenyellow"

/turf/open/floor/plasteel/greenblue
	icon_state = "greenbluefull"
/turf/open/floor/plasteel/greenblue/side
	icon_state = "greenblue"

/turf/open/floor/plasteel/blueyellow
	icon_state = "blueyellowfull"
/turf/open/floor/plasteel/blueyellow/side
	icon_state = "blueyellow"

/turf/open/floor/plasteel/darkwarning
	icon_state = "warndark"
/turf/open/floor/plasteel/darkwarning/corner
	icon_state = "warndarkcorners"

/turf/open/floor/plasteel/warningline
	icon_state = "warningline"
/turf/open/floor/plasteel/warningline/corner
	icon_state = "warninglinecorners"

/turf/open/floor/plasteel/yellowsiding
	icon_state = "yellowsiding"
/turf/open/floor/plasteel/yellowsiding/corner
	icon_state = "yellowcornersiding"

/turf/open/floor/plasteel/podhatch
	icon_state = "podhatch"
/turf/open/floor/plasteel/podhatch/corner
	icon_state = "podhatchcorner"

/turf/open/floor/plasteel/circuit
	icon_state = "bcircuit"
/turf/open/floor/plasteel/circuit/off
	icon_state = "bcircuitoff"

/turf/open/floor/plasteel/circuit/gcircuit
	icon_state = "gcircuit"
/turf/open/floor/plasteel/circuit/gcircuit/off
	icon_state = "gcircuitoff"
/turf/open/floor/plasteel/circuit/gcircuit/animated
	icon_state = "gcircuitanim"

/turf/open/floor/plasteel/circuit/rcircuit
	icon_state = "rcircuit"
/turf/open/floor/plasteel/circuit/rcircuit/animated
	icon_state = "rcircuitanim"

/turf/open/floor/plasteel/loadingarea
	icon_state = "loadingarea"
/turf/open/floor/plasteel/loadingarea/dirty
	icon_state = "loadingareadirty1"
/turf/open/floor/plasteel/loadingarea/dirtydirty
	icon_state = "loadingareadirty2"

/turf/open/floor/plasteel/shuttle
	icon_state = "shuttlefloor"
/turf/open/floor/plasteel/shuttle/red
	name = "Brig floor"
	icon_state = "shuttlefloor4"
/turf/open/floor/plasteel/shuttle/yellow
	icon_state = "shuttlefloor2"
/turf/open/floor/plasteel/shuttle/white
	icon_state = "shuttlefloor3"
/turf/open/floor/plasteel/shuttle/purple
	icon_state = "shuttlefloor5"

/turf/open/floor/plasteel/asteroid
	icon_state = "asteroidfloor"
/turf/open/floor/plasteel/asteroid/warning
	icon_state = "asteroidwarning"

/turf/open/floor/plasteel/recharge_floor
	icon_state = "recharge_floor"
/turf/open/floor/plasteel/recharge_floor/asteroid
	icon_state = "recharge_floor_asteroid"

/turf/open/floor/plasteel/chapel
	icon_state = "chapel"

/turf/open/floor/plasteel/showroomfloor
	icon_state = "showroomfloor"

/turf/open/floor/plasteel/floorgrime
	icon_state = "floorgrime"

/turf/open/floor/plasteel/solarpanel
	icon_state = "solarpanel"

/turf/open/floor/plasteel/cmo
	icon_state = "cmo"

/turf/open/floor/plasteel/barber
	icon_state = "barber"

/turf/open/floor/plasteel/hydrofloor
	icon_state = "hydrofloor"

/turf/open/floor/plasteel/delivery
	icon_state = "delivery"

/turf/open/floor/plasteel/bot
	icon_state = "bot"

/turf/open/floor/plasteel/freezer
	icon_state = "freezerfloor"

/turf/open/floor/plasteel/bar
	icon_state = "bar"

/turf/open/floor/plasteel/grimy
	icon_state = "grimy"

/turf/open/floor/plasteel/cafeteria
	icon_state = "cafeteria"

/turf/open/floor/plasteel/vault
	icon_state = "vault"

/turf/open/floor/plasteel/cult
	icon_state = "cult"
	name = "engraved floor"

/turf/open/floor/plasteel/goonplaque
	icon_state = "plaque"
	name = "Commemorative Plaque"
	desc = "\"This is a plaque in honour of our comrades on the G4407 Stations. Hopefully TG4407 model can live up to your fame and fortune.\" Scratched in beneath that is a crude image of a meteor and a spaceman. The spaceman is laughing. The meteor is exploding."

/turf/open/floor/plasteel/cult/narsie_act()
	return

/turf/open/floor/plasteel/cult/airless
	oxygen = 0
	nitrogen = 0
	temperature = TCMB

//
//unused? remove?
//
/turf/open/floor/plasteel/stage_bottom
	icon_state = "stage_bottom"
/turf/open/floor/plasteel/stage_left
	icon_state = "stage_left"
/turf/open/floor/plasteel/stage_bleft
	icon_state = "stage_bleft"

/turf/open/floor/plasteel/stairs
	icon_state = "stairs"
/turf/open/floor/plasteel/stairs/left
	icon_state = "stairs-l"
/turf/open/floor/plasteel/stairs/medium
	icon_state = "stairs-m"
/turf/open/floor/plasteel/stairs/right
	icon_state = "stairs-r"
/turf/open/floor/plasteel/stairs/old
	icon_state = "stairs-old"

/turf/open/floor/plasteel/brownold
	icon_state = "brownold"
/turf/open/floor/plasteel/brownold/corner
	icon_state = "browncornerold"

/turf/open/floor/plasteel/rockvault
	icon_state = "rockvault"
/turf/open/floor/plasteel/rockvault/alien
	icon_state = "alienvault"
/turf/open/floor/plasteel/rockvault/sandstone
	icon_state = "sandstonevault"

/turf/open/floor/plasteel/elevatorshaft
	icon_state = "elevatorshaft"

/turf/open/floor/plasteel/bluespace
	icon_state = "bluespace"

/turf/open/floor/plasteel/sepia
	icon_state = "sepia"

/turf/open/floor/plasteel/sandy
	icon_state = "sandy"
	baseturf = /turf/open/floor/plating/beach/sand

/turf/open/floor/plasteel/sandeffect
	icon_state = "sandeffect"
/turf/open/floor/plasteel/sandeffect/warning
	icon_state = "warningsandeffect"
/turf/open/floor/plasteel/sandeffect/warning/corner
	icon_state = "warningsandeffectcorners"