<commit_before>// Import jquery related stuff
import * as jquery from 'jquery';
import 'jquery-ui';
import 'jquery.transit';

// Load phaser (https://github.com/photonstorm/phaser/issues/1974)
import PIXI from 'expose-loader?PIXI!phaser-ce/build/custom/pixi.js';
import p2 from 'expose-loader?p2!phaser-ce/build/custom/p2.js';
import Phaser from 'expose-loader?Phaser!phaser-ce/build/custom/phaser-split.js';

import { Game } from './game';

// Load the stylesheet
import './style/main.less';

// Abilities
import abolishedAbilitiesGenerator from "./abilities/Abolished";
import chimeraAbilitiesGenerator from "./abilities/Chimera";
import cyberHoundAbilitiesGenerator from "./abilities/Cyber-Hound";
import darkPriestAbilitiesGenerator from "./abilities/Dark-Priest";
import goldenWyrmAbilitiesGenerator from "./abilities/Golden-Wyrm";
import gumbleAbilitiesGenerator from "./abilities/Gumble";
import iceDemonAbilitiesGenerator from "./abilities/Ice-Demon";
import impalerAbilitiesGenerator from "./abilities/Impaler";
import lavaMolluskAbilitiesGenerator from "./abilities/Lava-Mollusk";
import magmaSpawnAbilitiesGenerator from "./abilities/Magma-Spawn";
import nightmareAbilitiesGenerator from "./abilities/Nightmare";
import nutcaseAbilitiesGenerator from "./abilities/Nutcase";
import scavengerAbilitiesGenerator from "./abilities/Scavenger";
import snowBunnyAbilitiesGenerator from "./abilities/Snow-Bunny";
import swineThugAbilitiesGenerator from "./abilities/Swine-Thug";
import uncleFungusAbilitiesGenerator from "./abilities/Uncle-Fungus";


// Export stuff that needs to be on the window object (Hack)
window.$j = jquery;
window.Phaser = Phaser;

// Create the game
const G = new Game("0.3");

// Load the abilities
const abilitiesGenerators = [
	abolishedAbilitiesGenerator,
	chimeraAbilitiesGenerator,
	cyberHoundAbilitiesGenerator,
	darkPriestAbilitiesGenerator,
	goldenWyrmAbilitiesGenerator,
	gumbleAbilitiesGenerator,
	iceDemonAbilitiesGenerator,
	impalerAbilitiesGenerator,
	lavaMolluskAbilitiesGenerator,
	magmaSpawnAbilitiesGenerator,
	nightmareAbilitiesGenerator,
	nutcaseAbilitiesGenerator,
	scavengerAbilitiesGenerator,
	snowBunnyAbilitiesGenerator,
	swineThugAbilitiesGenerator,
	uncleFungusAbilitiesGenerator,
];
abilitiesGenerators.forEach(generator => generator(G));

$j(document).ready(() => {
	$j(".typeRadio").buttonset();
	$j("#startButton").button();

	// Disable initial game setup until browser tab has focus
	window.addEventListener("blur", G.onBlur.bind(G), false);
	window.addEventListener("focus", G.onFocus.bind(G), false);
	$j("form#gameSetup").submit((e) => {
		e.preventDefault(); // Prevent submit
		var gameconfig = getGameConfig();


		if (gameconfig.background_image == "random") {
			// nth-child indices start at 1
			var index = Math.floor(Math.random() * ($j('input[name="combatLocation"]').length - 1)) + 1;
			gameconfig.background_image = $j('input[name="combatLocation"]').slice(index, index + 1).attr("value");
		}

		G.loadGame(gameconfig);
		return false; // Prevent submit
	});
});

export function getGameConfig() {
	let defaultConfig = {
		playerMode: $j('input[name="playerMode"]:checked').val() - 0,
		creaLimitNbr: $j('input[ngame="activeUnits"]:checked').val() - 0, // DP counts as One
		unitDrops: $j('input[name="unitDrops"]:checked').val() - 0,
		abilityUpgrades: $j('input[name="abilityUpgrades"]:checked').val() - 0,<commit_msg>This never ever happend, it was all a dream.<commit_after>// Import jquery related stuff
import * as jquery from 'jquery';
import 'jquery-ui';
import 'jquery.transit';

// Load phaser (https://github.com/photonstorm/phaser/issues/1974)
import PIXI from 'expose-loader?PIXI!phaser-ce/build/custom/pixi.js';
import p2 from 'expose-loader?p2!phaser-ce/build/custom/p2.js';
import Phaser from 'expose-loader?Phaser!phaser-ce/build/custom/phaser-split.js';

import { Game } from './game';

// Load the stylesheet
import './style/main.less';

// Abilities
import abolishedAbilitiesGenerator from "./abilities/Abolished";
import chimeraAbilitiesGenerator from "./abilities/Chimera";
import cyberHoundAbilitiesGenerator from "./abilities/Cyber-Hound";
import darkPriestAbilitiesGenerator from "./abilities/Dark-Priest";
import goldenWyrmAbilitiesGenerator from "./abilities/Golden-Wyrm";
import gumbleAbilitiesGenerator from "./abilities/Gumble";
import iceDemonAbilitiesGenerator from "./abilities/Ice-Demon";
import impalerAbilitiesGenerator from "./abilities/Impaler";
import lavaMolluskAbilitiesGenerator from "./abilities/Lava-Mollusk";
import magmaSpawnAbilitiesGenerator from "./abilities/Magma-Spawn";
import nightmareAbilitiesGenerator from "./abilities/Nightmare";
import nutcaseAbilitiesGenerator from "./abilities/Nutcase";
import scavengerAbilitiesGenerator from "./abilities/Scavenger";
import snowBunnyAbilitiesGenerator from "./abilities/Snow-Bunny";
import swineThugAbilitiesGenerator from "./abilities/Swine-Thug";
import uncleFungusAbilitiesGenerator from "./abilities/Uncle-Fungus";


// Export stuff that needs to be on the window object (Hack)
window.$j = jquery;
window.Phaser = Phaser;

// Create the game
const G = new Game("0.3");

// Load the abilities
const abilitiesGenerators = [
	abolishedAbilitiesGenerator,
	chimeraAbilitiesGenerator,
	cyberHoundAbilitiesGenerator,
	darkPriestAbilitiesGenerator,
	goldenWyrmAbilitiesGenerator,
	gumbleAbilitiesGenerator,
	iceDemonAbilitiesGenerator,
	impalerAbilitiesGenerator,
	lavaMolluskAbilitiesGenerator,
	magmaSpawnAbilitiesGenerator,
	nightmareAbilitiesGenerator,
	nutcaseAbilitiesGenerator,
	scavengerAbilitiesGenerator,
	snowBunnyAbilitiesGenerator,
	swineThugAbilitiesGenerator,
	uncleFungusAbilitiesGenerator,
];
abilitiesGenerators.forEach(generator => generator(G));

$j(document).ready(() => {
	$j(".typeRadio").buttonset();
	$j("#startButton").button();

	// Disable initial game setup until browser tab has focus
	window.addEventListener("blur", G.onBlur.bind(G), false);
	window.addEventListener("focus", G.onFocus.bind(G), false);
	$j("form#gameSetup").submit((e) => {
		e.preventDefault(); // Prevent submit
		var gameconfig = getGameConfig();


		if (gameconfig.background_image == "random") {
			// nth-child indices start at 1
			var index = Math.floor(Math.random() * ($j('input[name="combatLocation"]').length - 1)) + 1;
			gameconfig.background_image = $j('input[name="combatLocation"]').slice(index, index + 1).attr("value");
		}

		G.loadGame(gameconfig);
		return false; // Prevent submit
	});
});

export function getGameConfig() {
	let defaultConfig = {
		playerMode: $j('input[name="playerMode"]:checked').val() - 0,
		creaLimitNbr: $j('input[name="activeUnits"]:checked').val() - 0, // DP counts as One
		unitDrops: $j('input[name="unitDrops"]:checked').val() - 0,
		abilityUpgrades: $j('input[name="abilityUpgrades"]:checked').val() - 0,
{'fraction_non_alphanumeric': 0.13561804335090802, 'fraction_numerical': 0.00497949619214997, 'mean_word_length': 6.098752598752599, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 2, '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': '1491868', 'n_tokens_mistral': 2184, 'n_tokens_neox': 2087, 'n_words': 441}