<commit_before>/obj/machinery/door/poddoor
	name = "blast door"
	desc = "A heavy duty blast door that opens mechanically."
	icon = 'icons/obj/doors/blastdoor.dmi'
	icon_state = "closed"
	var/preposition = ""
	var/id = 1
	var/auto_close = 0 // Time in seconds to automatically close when opened, 0 if it doesn't.
	explosion_block = 3

/obj/machinery/door/poddoor/preopen
	icon_state = "open"
	density = 0
	opacity = 0


/obj/machinery/door/poddoor/Bumped(atom/AM)
	if(density)
		return 0
	else
		return ..()


/obj/machinery/door/poddoor/attackby(obj/item/I, mob/user, params)
	add_fingerprint(user)

	if(!istype(I, /obj/item/weapon/crowbar))
		return
	if(istype(I, /obj/item/weapon/twohanded/fireaxe))
		var/obj/item/weapon/twohanded/fireaxe/F = I
		if(!F.wielded)
			return

	if(stat & NOPOWER)
		open(1)	//ignore the usual power requirement.

/obj/machinery/door/poddoor/ex_act(severity, target)
	switch(severity)
		if(1.0)
			if(prob(80))
				qdel(src)
			else
				var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
				s.set_up(2, 1, src)
				s.start()
		if(2.0)
			if(prob(20))
				qdel(src)
			else
				var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
				s.set_up(2, 1, src)
				s.start()

		if(3.0)
			if(prob(80))
				var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
				s.set_up(2, 1, src)
				s.start()

/obj/machinery/door/poddoor/open(ignorepower = 0)
	if(operating)
		return
	if(!density)
		return
	if(!ignorepower && (stat & NOPOWER))
		return

	operating = 1
	flick("opening", src)
	icon_state = "open"
	playsound(src.loc, 'sound/machines/blast_door.ogg', 100, 1)
	SetOpacity(0)
	sleep(5)
	density = 0
	sleep(5)
	air_update_turf(1)
	update_freelook_sight()
	operating = 0

	if(auto_close)
		spawn(auto_close)
			// Checks for being able to close are in close().
			close()

	return 1


/obj/machinery/door/poddoor/close(ignorepower = 0)
	if(operating)
		return
	if(density)
		return
	if(!ignorepower && (stat & NOPOWER))
		return

	operating = 1
	flick("closing", src)
	icon_state = "closed"
	SetOpacity(1)
	air_update_turf(1)
	update_freelook_sight()
	sleep(5)
	playsound(src.loc, 'sound/machines/blast_door.ogg', 100, 1)
	crush()
	density = 1
	sleep(5)

	operating = 0

/*/



/obj/machinery/door/poddoor/two_tile_hor/open()
	if (src.operating == 1) //doors can still open when emag-disabled
		return
	if (!ticker)
		return 0
	if(!src.operating) //in case of emag
		src.operating = 1<commit_msg>Returns density back to 1 after close<commit_after>/obj/machinery/door/poddoor
	name = "blast door"
	desc = "A heavy duty blast door that opens mechanically."
	icon = 'icons/obj/doors/blastdoor.dmi'
	icon_state = "closed"
	var/preposition = ""
	var/id = 1
	var/auto_close = 0 // Time in seconds to automatically close when opened, 0 if it doesn't.
	explosion_block = 3

/obj/machinery/door/poddoor/preopen
	icon_state = "open"
	density = 0
	opacity = 0


/obj/machinery/door/poddoor/Bumped(atom/AM)
	if(density)
		return 0
	else
		return ..()


/obj/machinery/door/poddoor/attackby(obj/item/I, mob/user, params)
	add_fingerprint(user)

	if(!istype(I, /obj/item/weapon/crowbar))
		return
	if(istype(I, /obj/item/weapon/twohanded/fireaxe))
		var/obj/item/weapon/twohanded/fireaxe/F = I
		if(!F.wielded)
			return

	if(stat & NOPOWER)
		open(1)	//ignore the usual power requirement.

/obj/machinery/door/poddoor/ex_act(severity, target)
	switch(severity)
		if(1.0)
			if(prob(80))
				qdel(src)
			else
				var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
				s.set_up(2, 1, src)
				s.start()
		if(2.0)
			if(prob(20))
				qdel(src)
			else
				var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
				s.set_up(2, 1, src)
				s.start()

		if(3.0)
			if(prob(80))
				var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
				s.set_up(2, 1, src)
				s.start()

/obj/machinery/door/poddoor/open(ignorepower = 0)
	if(operating)
		return
	if(!density)
		return
	if(!ignorepower && (stat & NOPOWER))
		return

	operating = 1
	flick("opening", src)
	icon_state = "open"
	playsound(src.loc, 'sound/machines/blast_door.ogg', 100, 1)
	SetOpacity(0)
	sleep(5)
	density = 0
	sleep(5)
	air_update_turf(1)
	update_freelook_sight()
	operating = 0

	if(auto_close)
		spawn(auto_close)
			// Checks for being able to close are in close().
			close()

	return 1


/obj/machinery/door/poddoor/close(ignorepower = 0)
	if(operating)
		return
	if(density)
		return
	if(!ignorepower && (stat & NOPOWER))
		return

	operating = 1
	flick("closing", src)
	icon_state = "closed"
	SetOpacity(1)
	sleep(5)
	density = 1
	sleep(5)
	air_update_turf(1)
	update_freelook_sight()
	sleep(5)
	playsound(src.loc, 'sound/machines/blast_door.ogg', 100, 1)
	crush()
	sleep(5)

	operating = 0

/*/



/obj/machinery/door/poddoor/two_tile_hor/open()
	if (src.operating == 1) //doors can still open when emag-disabled
		return
	if (!ticker)
		return 0
	if(!src.operating) //in case of emag
		src.operating = 1
{'fraction_non_alphanumeric': 0.14035087719298245, 'fraction_numerical': 0.021637426900584796, 'mean_word_length': 3.593554162936437, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7373902', 'n_tokens_mistral': 2386, 'n_tokens_neox': 2082, 'n_words': 405}