<commit_before>#define GIRDER_NORMAL 0
#define GIRDER_REINF_STRUTS 1
#define GIRDER_REINF 2
#define GIRDER_DISPLACED 3
#define GIRDER_DISASSEMBLED 4

/obj/structure/girder
	name = "girder"
	icon_state = "girder"
	anchored = 1
	density = 1
	layer = BELOW_OBJ_LAYER
	var/state = GIRDER_NORMAL
	var/girderpasschance = 20 // percentage chance that a projectile passes through the girder.
	var/can_displace = TRUE //If the girder can be moved around by wrenching it
	var/health = 100

/obj/structure/girder/attackby(obj/item/W, mob/user, params)
	add_fingerprint(user)
	if(istype(W, /obj/item/weapon/screwdriver))
		if(state == GIRDER_DISPLACED)
			playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1)
			user.visible_message("<span class='warning'>[user] disassembles the girder.</span>", \
								"<span class='notice'>You start to disassemble the girder...</span>", "You hear clanking and banging noises.")
			if(do_after(user, 40/W.toolspeed, target = src))
				if(state != GIRDER_DISPLACED)
					return
				state = GIRDER_DISASSEMBLED
				user << "<span class='notice'>You disassemble the girder.</span>"
				var/obj/item/stack/sheet/metal/M = new (loc, 2)
				M.add_fingerprint(user)
				qdel(src)
		else if(state == GIRDER_REINF)
			playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1)
			user << "<span class='notice'>You start unsecuring support struts...</span>"
			if(do_after(user, 40/W.toolspeed, target = src))
				if(state != GIRDER_REINF)
					return
				user << "<span class='notice'>You unsecure the support struts.</span>"
				state = GIRDER_REINF_STRUTS

	else if(istype(W, /obj/item/weapon/wrench))
		if(state == GIRDER_DISPLACED)
			var/turf/T = loc
			if(!istype(T, /turf/open) || !(T.flags & GIRDERABLE))
				user << "<span class='warning'>A floor must be present to secure the girder!</span>"
				return
			playsound(src.loc, 'sound/items/Ratchet.ogg', 100, 1)
			user << "<span class='notice'>You start securing the girder...</span>"
			if(do_after(user, 40/W.toolspeed, target = src))
				user << "<span class='notice'>You secure the girder.</span>"
				var/obj/structure/girder/G = new (loc)
				transfer_fingerprints_to(G)
				qdel(src)
		else if(state == GIRDER_NORMAL && can_displace)
			playsound(src.loc, 'sound/items/Ratchet.ogg', 100, 1)
			user << "<span class='notice'>You start unsecuring the girder...</span>"
			if(do_after(user, 40/W.toolspeed, target = src))
				user << "<span class='notice'>You unsecure the girder.</span>"
				var/obj/structure/girder/displaced/D = new (loc)
				transfer_fingerprints_to(D)
				qdel(src)

	else if(istype(W, /obj/item/weapon/gun/energy/plasmacutter))
		user << "<span class='notice'>You start slicing apart the girder...</span>"
		playsound(src, 'sound/items/Welder.ogg', 100, 1)
		if(do_after(user, 30, target = src))
			user << "<span class='notice'>You slice apart the girder.</span>"
			var/obj/item/stack/sheet/metal/M = new (loc, 2)
			M.add_fingerprint(user)
			qdel(src)

	else if(istype(W, /obj/item/weapon/pickaxe/drill/jackhammer))
		var/obj/item/weapon/pickaxe/drill/jackhammer/D = W
		user << "<span class='notice'>You smash through the girder!</span>"
		new /obj/item/stack/sheet/metal(get_turf(src))
		D.playDigSound()
		qdel(src)

	else if(istype(W, /obj/item/weapon/wirecutters) && state == GIRDER_REINF_STRUTS)
		playsound(src.loc, 'sound/items/Wirecutter.ogg', 100, 1)
		user << "<span class='notice'>You start removing support struts...</span>"
		if(do_after(user, 40/W.toolspeed, target = src))
			user << "<span class='notice'>You remove the support struts.</span>"
			new /obj/item/stack/sheet/plasteel(get_turf(src))
			var/obj/structure/girder/G = new (loc)
			transfer_fingerprints_to(G)
			qdel(src)

	else if(istype(W, /obj/item/stack))
		if (istype(src.loc, /turf/closed/wall))
			user << "<span class='warning'>There is already a wall present!</span>"
			return
		if (!istype(src.loc, /turf/open/floor))
			user << "<span class='warning'>A floor must be present to build a false wall!</span>"
			return
		if (locate(/obj/structure/falsewall) in src.loc.contents)
			user << "<span class='warning'>There is already a false wall present!</span>"
			return<commit_msg>Fixed being able to put a falsewall on lava to make it floor<commit_after>#define GIRDER_NORMAL 0
#define GIRDER_REINF_STRUTS 1
#define GIRDER_REINF 2
#define GIRDER_DISPLACED 3
#define GIRDER_DISASSEMBLED 4

/obj/structure/girder
	name = "girder"
	icon_state = "girder"
	anchored = 1
	density = 1
	layer = BELOW_OBJ_LAYER
	var/state = GIRDER_NORMAL
	var/girderpasschance = 20 // percentage chance that a projectile passes through the girder.
	var/can_displace = TRUE //If the girder can be moved around by wrenching it
	var/health = 100

/obj/structure/girder/attackby(obj/item/W, mob/user, params)
	add_fingerprint(user)
	if(istype(W, /obj/item/weapon/screwdriver))
		if(state == GIRDER_DISPLACED)
			playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1)
			user.visible_message("<span class='warning'>[user] disassembles the girder.</span>", \
								"<span class='notice'>You start to disassemble the girder...</span>", "You hear clanking and banging noises.")
			if(do_after(user, 40/W.toolspeed, target = src))
				if(state != GIRDER_DISPLACED)
					return
				state = GIRDER_DISASSEMBLED
				user << "<span class='notice'>You disassemble the girder.</span>"
				var/obj/item/stack/sheet/metal/M = new (loc, 2)
				M.add_fingerprint(user)
				qdel(src)
		else if(state == GIRDER_REINF)
			playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1)
			user << "<span class='notice'>You start unsecuring support struts...</span>"
			if(do_after(user, 40/W.toolspeed, target = src))
				if(state != GIRDER_REINF)
					return
				user << "<span class='notice'>You unsecure the support struts.</span>"
				state = GIRDER_REINF_STRUTS

	else if(istype(W, /obj/item/weapon/wrench))
		if(state == GIRDER_DISPLACED)
			var/turf/T = loc
			if(!istype(T, /turf/open) || !(T.flags & GIRDERABLE))
				user << "<span class='warning'>A floor must be present to secure the girder!</span>"
				return
			playsound(src.loc, 'sound/items/Ratchet.ogg', 100, 1)
			user << "<span class='notice'>You start securing the girder...</span>"
			if(do_after(user, 40/W.toolspeed, target = src))
				user << "<span class='notice'>You secure the girder.</span>"
				var/obj/structure/girder/G = new (loc)
				transfer_fingerprints_to(G)
				qdel(src)
		else if(state == GIRDER_NORMAL && can_displace)
			playsound(src.loc, 'sound/items/Ratchet.ogg', 100, 1)
			user << "<span class='notice'>You start unsecuring the girder...</span>"
			if(do_after(user, 40/W.toolspeed, target = src))
				user << "<span class='notice'>You unsecure the girder.</span>"
				var/obj/structure/girder/displaced/D = new (loc)
				transfer_fingerprints_to(D)
				qdel(src)

	else if(istype(W, /obj/item/weapon/gun/energy/plasmacutter))
		user << "<span class='notice'>You start slicing apart the girder...</span>"
		playsound(src, 'sound/items/Welder.ogg', 100, 1)
		if(do_after(user, 30, target = src))
			user << "<span class='notice'>You slice apart the girder.</span>"
			var/obj/item/stack/sheet/metal/M = new (loc, 2)
			M.add_fingerprint(user)
			qdel(src)

	else if(istype(W, /obj/item/weapon/pickaxe/drill/jackhammer))
		var/obj/item/weapon/pickaxe/drill/jackhammer/D = W
		user << "<span class='notice'>You smash through the girder!</span>"
		new /obj/item/stack/sheet/metal(get_turf(src))
		D.playDigSound()
		qdel(src)

	else if(istype(W, /obj/item/weapon/wirecutters) && state == GIRDER_REINF_STRUTS)
		playsound(src.loc, 'sound/items/Wirecutter.ogg', 100, 1)
		user << "<span class='notice'>You start removing support struts...</span>"
		if(do_after(user, 40/W.toolspeed, target = src))
			user << "<span class='notice'>You remove the support struts.</span>"
			new /obj/item/stack/sheet/plasteel(get_turf(src))
			var/obj/structure/girder/G = new (loc)
			transfer_fingerprints_to(G)
			qdel(src)

	else if(istype(W, /obj/item/stack))
		if (istype(src.loc, /turf/closed/wall))
			user << "<span class='warning'>There is already a wall present!</span>"
			return
		if (!istype(src.loc, /turf/open/floor) || !(T.flags & GIRDERABLE))
			user << "<span class='warning'>A floor must be present to build a false wall!</span>"
			return
		if (locate(/obj/structure/falsewall) in src.loc.contents)
			user << "<span class='warning'>There is already a false wall present!</span>"
			return
{'fraction_non_alphanumeric': 0.1540194451031539, 'fraction_numerical': 0.011856770215793217, 'mean_word_length': 4.087454764776839, 'pattern_counts': {'":': 0, '<': 139, '<?xml version=': 0, '>': 75, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6424825', 'n_tokens_mistral': 3550, 'n_tokens_neox': 3087, 'n_words': 693}