<commit_before>/*
 * Copyright  2014 <NAME>
 * Distributed under the GNU Affero General Public License, version 3.
 * Your changes must be made public.
 * For the full license text, see LICENSE.txt.
 */
proc
	bubblesort(list/L)
		var i, j
		for(i=L.len,i>0,i--)
			for(j=1,j<i,j++)
				if(L[j]>L[j+1])
					L.Swap(j,j+1)
		return L
	bubblesort_by_value(list/L, variable = null, associated = FALSE)
		var i, j
		for(i=L.len,i>0,i--)
			for(j=1,j<i,j++)
				if(variable)
					if(associated)
						var/datum/d  = L[L[j]]
						var/datum/d1 = L[L[j+1]]
						if(d.vars[variable] > d1.vars[variable])
							L.Swap(j,j+1)
					else
						var/datum/d  = L[j]
						var/datum/d1 = L[j + 1]
						if(d.vars[variable] > d1.vars[variable])
							L.Swap(j,j+1)
				else
					if(L[L[j]]>L[L[j+1]])
						L.Swap(j,j+1)
		return L
	bubblesort_atom_name(list/L)
	//Looks awful, but seems to work
		var i, j
		for(i=L.len,i>0,i--)
			for(j=1,j<i,j++)
				var/mob/j1 = L[j]
				var/mob/j2 = L[j+1]
				if(j1 && j2)
					if(j1.name == "Robed Figure" && j2.name != "Robed Figure")
						if(j1.prevname>j2.name) L.Swap(j,j+1)
					else if(j1.name == "<NAME>" && j2.name == "Robed Figure")
						if(j1.prevname>j2.prevname) L.Swap(j,j+1)
					if(j1.name != "Robed Figure" && j2.name == "Robed Figure")
						if(j1.name>j2.prevname) L.Swap(j,j+1)
					else if(j1.name != "Robed Figure" && j2.name != "Robed Figure")
						if(j1.name>j2.name) L.Swap(j,j+1)
turf
	duelmat_gryff
		name = "<NAME>"
		icon = 'DuelArena.dmi'
	duelmat_raven
		name = "<NAME>"
		icon = 'DuelArena.dmi'
	duelmat_slyth
		name = "<NAME>"
		icon = 'DuelArena.dmi'
	duelmat_huffle
		name = "<NAME>"
		icon = 'DuelArena.dmi'
var/list/turf/duelsystemcenter/duelsystems = list()
#define DUEL_DISTANCE 9

Duel
	var/mob/player1 = null
	var/mob/player2 = null
	var/ready1 = 0
	var/ready2 = 0
	var/countdown = 5
	var/atom/duelcenter
	New(var/atom/duelcenter)
		..()
		src.duelcenter = duelcenter
	Del()
		for(var/turf/duelblock/B in block(locate(duelcenter.x-5,duelcenter.y,duelcenter.z),locate(duelcenter.x+5,duelcenter.y,duelcenter.z)))
			B.density = 0
		player1.movable = 0
		if(player2)player2.movable = 0
		..()
	proc
		Pre_Duel()
			player1.followplayer = 0
			player2.followplayer = 0
			sleep(100)
			if(!(ready1 && ready2))
				range(9,duelcenter) << errormsg("<i>The players did not ready themselves within the time limit. Duel cancelled.</i>")<commit_msg>Duel runtime fix<commit_after>/*
 * Copyright  2014 <NAME>
 * Distributed under the GNU Affero General Public License, version 3.
 * Your changes must be made public.
 * For the full license text, see LICENSE.txt.
 */
proc
	bubblesort(list/L)
		var i, j
		for(i=L.len,i>0,i--)
			for(j=1,j<i,j++)
				if(L[j]>L[j+1])
					L.Swap(j,j+1)
		return L
	bubblesort_by_value(list/L, variable = null, associated = FALSE)
		var i, j
		for(i=L.len,i>0,i--)
			for(j=1,j<i,j++)
				if(variable)
					if(associated)
						var/datum/d  = L[L[j]]
						var/datum/d1 = L[L[j+1]]
						if(d.vars[variable] > d1.vars[variable])
							L.Swap(j,j+1)
					else
						var/datum/d  = L[j]
						var/datum/d1 = L[j + 1]
						if(d.vars[variable] > d1.vars[variable])
							L.Swap(j,j+1)
				else
					if(L[L[j]]>L[L[j+1]])
						L.Swap(j,j+1)
		return L
	bubblesort_atom_name(list/L)
	//Looks awful, but seems to work
		var i, j
		for(i=L.len,i>0,i--)
			for(j=1,j<i,j++)
				var/mob/j1 = L[j]
				var/mob/j2 = L[j+1]
				if(j1 && j2)
					if(j1.name == "Robed Figure" && j2.name != "Robed Figure")
						if(j1.prevname>j2.name) L.Swap(j,j+1)
					else if(j1.name == "Robed Figure" && j2.name == "Robed Figure")
						if(j1.prevname>j2.prevname) L.Swap(j,j+1)
					if(j1.name != "Robed Figure" && j2.name == "Robed Figure")
						if(j1.name>j2.prevname) L.Swap(j,j+1)
					else if(j1.name != "Robed Figure" && j2.name != "Robed Figure")
						if(j1.name>j2.name) L.Swap(j,j+1)
turf
	duelmat_gryff
		name = "<NAME>"
		icon = 'DuelArena.dmi'
	duelmat_raven
		name = "<NAME>"
		icon = 'DuelArena.dmi'
	duelmat_slyth
		name = "<NAME>"
		icon = 'DuelArena.dmi'
	duelmat_huffle
		name = "<NAME>"
		icon = 'DuelArena.dmi'
var/list/turf/duelsystemcenter/duelsystems = list()
#define DUEL_DISTANCE 9

Duel
	var/mob/player1 = null
	var/mob/player2 = null
	var/ready1 = 0
	var/ready2 = 0
	var/countdown = 5
	var/atom/duelcenter
	New(var/atom/duelcenter)
		..()
		src.duelcenter = duelcenter
	Del()
		for(var/turf/duelblock/B in block(locate(duelcenter.x-5,duelcenter.y,duelcenter.z),locate(duelcenter.x+5,duelcenter.y,duelcenter.z)))
			B.density = 0
		if(player1)player1.movable = 0
		if(player2)player2.movable = 0
		..()
	proc
		Pre_Duel()
			player1.followplayer = 0
			player2.followplayer = 0
			sleep(100)
			if(!(ready1 && ready2))
				range(9,duelcenter) << errormsg("<i>The players did not ready themselves within the time limit. Duel cancelled.</i>")
{'fraction_non_alphanumeric': 0.17651922281934684, 'fraction_numerical': 0.03079785035138487, 'mean_word_length': 3.066386554621849, 'pattern_counts': {'":': 0, '<': 28, '<?xml version=': 0, '>': 40, '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': '7170768', 'n_tokens_mistral': 2555, 'n_tokens_neox': 2192, 'n_words': 392}