<commit_before>/obj/item/grenade/flashbang
	name = "flashbang"
	icon_state = "flashbang"
	item_state = "flashbang"
	lefthand_file = 'icons/mob/inhands/equipment/security_lefthand.dmi'
	righthand_file = 'icons/mob/inhands/equipment/security_righthand.dmi'
	var/flashbang_range = 7 //how many tiles away the mob will be stunned.

/obj/item/grenade/flashbang/prime()
	update_mob()
	var/flashbang_turf = get_turf(src)
	if(!flashbang_turf)
		return
	do_sparks(rand(5, 9), FALSE, src)
	playsound(flashbang_turf, 'sound/weapons/flashbang.ogg', 100, TRUE, 8, 0.9)
	new /obj/effect/dummy/lighting_obj (flashbang_turf, LIGHT_COLOR_WHITE, (flashbang_range + 2), 4, 2)
	for(var/mob/living/M in get_hearers_in_view(flashbang_range, flashbang_turf))
		bang(get_turf(M), M)
	qdel(src)

/obj/item/grenade/flashbang/proc/bang(turf/T , mob/living/M)
	if(M.stat == DEAD)	//They're dead!
		return
	M.show_message("<span class='warning'>BANG</span>", MSG_AUDIBLE)
	var/distance = max(0,get_dist(get_turf(src),T))

//Flash
	if(M.flash_act(affect_silicon = 1))
		M.Knockdown(max(200/max(1,distance), 60))
//Bang
	if(!distance || loc == M || loc == M.loc)	//Stop allahu akbarring rooms with this.
		M.Knockdown(200)
		M.soundbang_act(1, 200, 10, 15)

	else
		M.soundbang_act(1, max(200/max(1,distance), 60), rand(0, 5))<commit_msg>Update flashbang.dm<commit_after>/obj/item/grenade/flashbang
	name = "flashbang"
	icon_state = "flashbang"
	item_state = "flashbang"
	lefthand_file = 'icons/mob/inhands/equipment/security_lefthand.dmi'
	righthand_file = 'icons/mob/inhands/equipment/security_righthand.dmi'
	var/flashbang_range = 7 //how many tiles away the mob will be stunned.

/obj/item/grenade/flashbang/prime()
	update_mob()
	var/flashbang_turf = get_turf(src)
	if(!flashbang_turf)
		return
	do_sparks(rand(5, 9), FALSE, src)
	playsound(flashbang_turf, 'sound/weapons/flashbang.ogg', 100, TRUE, 8, 0.9)
	new /obj/effect/dummy/lighting_obj (flashbang_turf, LIGHT_COLOR_WHITE, (flashbang_range + 2), 4, 2)
	flashbang_mobs(flashbang_turf, flashbang_range)
	for(var/mob/living/M in get_hearers_in_view(flashbang_range, flashbang_turf))
		bang(get_turf(M), M)
	qdel(src)

/obj/item/grenade/flashbang/proc/flashbang_mobs(turf/source, range)
	var/list/banged = get_hearers_in_view(range, source)
	var/list/flashed = viewers(range, source)
	for(var/i in banged)
		bang(i, source)
	for(var/i in flashed)
		flash(i, source)

/obj/item/grenade/flashbang/proc/bang(mob/living/M, turf/source)
	if(M.stat == DEAD)	//They're dead!
		return
	M.show_message("<span class='warning'>BANG</span>", MSG_AUDIBLE)
	var/distance = get_dist(get_turf(M), source)
	if(!distance || loc == M || loc == M.loc)	//Stop allahu akbarring rooms with this.
		M.Knockdown(200)
		M.soundbang_act(1, 200, 10, 15)
	else
		M.soundbang_act(1, max(200/max(1,distance), 60), rand(0, 5))

/obj/item/grenade/flashbang/proc/flash(mob/living/M, turf/source)
	if(M.stat == DEAD)	//They're dead!
		return
	var/distance = get_dist(get_turf(M, source))
	if(M.flash_act(affect_silicon = 1))
		M.Knockdown(max(200/max(1,distance), 60))

{'fraction_non_alphanumeric': 0.15326797385620916, 'fraction_numerical': 0.025816993464052286, 'mean_word_length': 5.2089249492900604, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '4882915', 'n_tokens_mistral': 1449, 'n_tokens_neox': 1311, 'n_words': 215}