code:
package classes
{
	import classes.GlobalFlags.*;
	import classes.display.SettingPane;
	import classes.saves.*;
	import coc.view.MainView;
	import coc.view.StatsView;
	import flash.display.DisplayObject;
	import flash.display.StageQuality;
	import flash.text.TextField;
	import flash.text.TextFormat;
	/**
	 * ...
	 * @author ...
	 */
	public class GameSettings extends BaseContent implements SelfSaving
	{
		private var lastDisplayedPane:SettingPane;
		private var initializedPanes:Boolean = false;

		private var panes:Array = [];

		private static const PANES_CONFIG:Array = [
			["settingPaneGameplay", "Gameplay Settings", "You can adjust gameplay experience such as game difficulty and NPC standards."],
			["settingPaneInterface", "Interface Settings", "You can customize aspects of the interface to your liking."],
			["settingPaneFetish", "Fetish Settings", "You can turn on or off weird and extreme fetishes.\nWarning: May override other settings."],
			["settingGameMods", "Game Modes", "You can turn on or off any of OtherCoCAnon's gameplay settings."],
			["settingNPCMods", "NPC Settings", "You can make various changes to NPCs here.\nThese settings will likely be overwritten when you load a save, so load before changing them."]
		];

		public function GameSettings() { SelfSaver.register(this); }

		public function configurePanes():void {
			//Gameplay Settings
			for (var i:int = 0; i < PANES_CONFIG.length; i++) {
				var pane:SettingPane = new SettingPane(game.mainView.mainText.x, game.mainView.mainText.y, game.mainView.mainText.width + 16, game.mainView.mainText.height);
				pane.name = PANES_CONFIG[i][0];
				var hl:TextField = pane.addHelpLabel();
				hl.htmlText = game.formatHeader(PANES_CONFIG[i][1]) + PANES_CONFIG[i][2] + "\n\n";
				setOrUpdateSettings(pane);
				panes.push(pane);
			}
			//All done!
			initializedPanes = true;
		}

		private function setOrUpdateSettings(pane:SettingPane):void {
			if (pane.name == PANES_CONFIG[0][0]) { //Gameplay
				pane.addOrUpdateToggleSettings("Game Difficulty", [
					["Choose", difficultySelectionMenu, getDifficultyText(), false],
					"overridesLabel"
				]);
				pane.addOrUpdateToggleSettings("Debug Mode", [
					["ON", createCallBackFunction(toggleDebug, true), "Items will not be consumed by use, fleeing always succeeds, and bad-ends can be ignored.", debug == true],
					["OFF", createCallBackFunction(toggleDebug, false), "Items consumption will occur as normal.", debug == false]
				]);
				pane.addOrUpdateToggleSettings("Silly Mode", [
					["ON", createCallBackFunction(toggleSetting, kFLAGS.SILLY_MODE_ENABLE_FLAG, true), "Crazy, nonsensical, and possibly hilarious things may occur.", flags[kFLAGS.SILLY_MODE_ENABLE_FLAG] == true],
					["OFF", createCallBackFunction(toggleSetting, kFLAGS.SILLY_MODE_ENABLE_FLAG, false), "You're an incorrigible stick-in-the-mud with no sense of humor.", flags[kFLAGS.SILLY_MODE_ENABLE_FLAG] == false]
				]);
				pane.addOrUpdateToggleSettings("NoFur Mode", [
					["ON", createCallBackFunction(toggleSetting, kFLAGS.NOFUR_MODE_ENABLE_FLAG, true), "The furries are gone now. It's safe.", flags[kFLAGS.NOFUR_MODE_ENABLE_FLAG] == true],
					["OFF", createCallBackFunction(toggleSetting, kFLAGS.NOFUR_MODE_ENABLE_FLAG, false), "You can't throw a rock without hitting three muzzles and a snout.", flags[kFLAGS.NOFUR_MODE_ENABLE_FLAG] == false]
				]);
				pane.addOrUpdateToggleSettings("Low Standards", [
					["ON", createCallBackFunction(toggleSetting, kFLAGS.LOW_STANDARDS_FOR_ALL, true), "NPCs ignore body type preferences. Not gender preferences though; you still need the right hole.", flags[kFLAGS.LOW_STANDARDS_FOR_ALL] == true],
					["OFF", createCallBackFunction(toggleSetting, kFLAGS.LOW_STANDARDS_FOR_ALL, false), "NPCs have body-type preferences.", flags[kFLAGS.LOW_STANDARDS_FOR_ALL] == false]
				]);
				pane.addOrUpdateToggleSettings("Hyper Happy", [
					["ON", createCallBackFunction(toggleSetting, kFLAGS.HYPER_HAPPY, true), "Only reducto and humus shrink endowments. Incubus draft doesn't affect breasts, and succubi milk doesn't affect cocks.", flags[kFLAGS.HYPER_HAPPY] == true],
					["OFF", createCallBackFunction(toggleSetting, kFLAGS.HYPER_HAPPY, false), "Male enhancement potions shrink female endowments, and vice versa.", flags[kFLAGS.HYPER_HAPPY] == false]
				]);
				pane.addOrUpdateToggleSettings("Automatic Leveling", [
					["ON", createCallBackFunction(toggleSetting, kFLAGS.AUTO_LEVEL, true), "Leveling up is done automatically once you accumulate enough experience.", flags[kFLAGS.AUTO_LEVEL] == true],
					["OFF", createCallBackFunction(toggleSetting, kFLAGS.AUTO_LEVEL, false), "Leveling up is done manually by pressing 'Level Up' button.", flags[kFLAGS.AUTO_LEVEL] == false]
				]);
				pane.addOrUpdateToggleSettings("SFW Mode", [
					["ON", createCallBackFunction(toggleSetting, kFLAGS.SFW_MODE, true), "SFW mode is enabled. You won't see sex scenes nor will you get raped.", flags[kFLAGS.SFW_MODE] == true],
					["OFF", createCallBackFunction(toggleSetting, kFLAGS.SFW_MODE, false), "SFW mode is disabled. You'll see sex scenes.", flags[kFLAGS.SFW_MODE] == false]
				]);
				pane.addOrUpdateToggleSettings("Prison", [
					["ON", createCallBackFunction(toggleSetting, kFLAGS.PRISON_ENABLED, true), "The prison can be accessed.\nWARNING: The prison is very buggy and may break your game. Enter it at your own risk!", flags[kFLAGS.PRISON_ENABLED] == true],
					["OFF", createCallBackFunction(toggleSetting, kFLAGS.PRISON_ENABLED, false), "The prison cannot be accessed.", flags[kFLAGS.PRISON_ENABLED] == false]
				]);
				pane.addOrUpdateToggleSettings("Ascension Reset", [
					["ON", createCallBackFunction(toggleSetting, kFLAGS.ASCENSION_MODE, true), "Ascension resets your character.", flags[kFLAGS.ASCENSION_MODE] == true],
					["OFF", createCallBackFunction(toggleSetting, kFLAGS.ASCENSION_MODE, false), "Ascension does not reset your character.", flags[kFLAGS.ASCENSION_MODE] == false]
				]);
				pane.addOrUpdateToggleSettings("Enable Survival", [
					["Enable", enableSurvivalPrompt, "Survival mode is already enabled.", flags[kFLAGS.HUNGER_ENABLED] >= 0.5]
				]);
				pane.addOrUpdateToggleSettings("Enable Realistic", [
					["Enable", enableRealisticPrompt, "Realistic mode is already enabled.", flags[kFLAGS.HUNGER_ENABLED] >= 1]
				]);
				pane.update();
			}
			else if (pane.name == PANES_CONFIG[1][0]) { //Interface
				pane.addOrUpdateToggleSettings("Main Background", [
					["Choose", menuMainBackground, "", false]
				]);
				pane.addOrUpdateToggleSettings("Text Background", [
					["Choose", menuTextBackground, "", false]
				]);
				pane.addOrUpdateToggleSettings("Font Size", [
					["Adjust", fontSettingsMenu, "Font Size: " + (flags[kFLAGS.CUSTOM_FONT_SIZE] || 20) + "", false],
					"overridesLabel"
				]);
				pane.addOrUpdateToggleSettings("Sidebar Font", [
					["New", createCallBackFunction(toggleSetting, kFLAGS.USE_OLD_FONT, false), "Palatino Linotype will be used. This is the current font.", flags[kFLAGS.USE_OLD_FONT] == false],
					["Old", createCallBackFunction(toggleSetting, kFLAGS.USE_OLD_FONT, true), "Lucida Sans Typewriter will be used. This is the old font.", flags[kFLAGS.USE_OLD_FONT] == true]
				]);
				pane.addOrUpdateToggleSettings("Sprites", [
					["Off", createCallBackFunction(toggleSetting, kFLAGS.SHOW_SPRITES_FLAG, 0), "There are only words. Nothing else.", flags[kFLAGS.SHOW_SPRITES_FLAG] == 0],
					["Old", createCallBackFunction(toggleSetting, kFLAGS.SHOW_SPRITES_FLAG, 1), "You like to look at pretty pictures. Old, 8-bit sprites will be shown.", flags[kFLAGS.SHOW_SPRITES_FLAG] == 1],
					["New", createCallBackFunction(toggleSetting, kFLAGS.SHOW_SPRITES_FLAG, 2), "You like to look at pretty pictures. New, 16-bit sprites will be shown.", flags[kFLAGS.SHOW_SPRITES_FLAG] == 2]
				]);
				pane.addOrUpdateToggleSettings("Image Pack", [
					["ON", createCallBackFunction(toggleSetting, kFLAGS.IMAGEPACK_ENABLED, true), "Image pack is currently enabled.", flags[kFLAGS.IMAGEPACK_ENABLED] == true],
					["OFF", createCallBackFunction(toggleSetting, kFLAGS.IMAGEPACK_ENABLED, false), "Images from image pack won't be shown.", flags[kFLAGS.IMAGEPACK_ENABLED] == false]
				]);
				pane.addOrUpdateToggleSettings("Animate Stats Bars", [
					["ON", createCallBackFunction(toggleSetting, kFLAGS.ANIMATE_STATS_BARS, true), "The stats bars and numbers will be animated if changed.", flags[kFLAGS.ANIMATE_STATS_BARS] == true],
					["OFF", createCallBackFunction(toggleSetting, kFLAGS.ANIMATE_STATS_BARS, false), "The stats will not animate. Basically classic.", flags[kFLAGS.ANIMATE_STATS_BARS] == false]
				]);
				pane.addOrUpdateToggleSettings("Time Format", [
					["12-hour", createCallBackFunction(toggleSetting, kFLAGS.USE_12_HOURS, true), "Time will be shown in 12-hour format. (AM/PM)", flags[kFLAGS.USE_12_HOURS] == true],
					["24-hour", createCallBackFunction(toggleSetting, kFLAGS.USE_12_HOURS, false), "Time will be shown in 24-hour format.", flags[kFLAGS.USE_12_HOURS] == false]
				]);
				pane.addOrUpdateToggleSettings("Measurements", [
					["Metric", createCallBackFunction(toggleSetting, kFLAGS.USE_METRICS, true), "Various measurements will be shown in metrics. (Centimeters, meters)", flags[kFLAGS.USE_METRICS] == true],
					["Imperial", createCallBackFunction(toggleSetting, kFLAGS.USE_METRICS, false), "Various measurements will be shown in imperial units. (Inches, feet)", flags[kFLAGS.USE_METRICS] == false]
				]);
				pane.addOrUpdateToggleSettings("Quicksave Confirmation", [
					["ON", createCallBackFunction(toggleSetting, kFLAGS.DISABLE_QUICKSAVE_CONFIRM, false), "Quicksave confirmation dialog is enabled.", flags[kFLAGS.DISABLE_QUICKSAVE_CONFIRM] == false],
					["OFF", createCallBackFunction(toggleSetting, kFLAGS.DISABLE_QUICKSAVE_CONFIRM, true), "Quicksave confirmation dialog is disabled.", flags[kFLAGS.DISABLE_QUICKSAVE_CONFIRM] == true]
				]);
				pane.addOrUpdateToggleSettings("Quickload Confirmation", [
					["ON", createCallBackFunction(toggleSetting, kFLAGS.DISABLE_QUICKLOAD_CONFIRM, false), "Quickload confirmation dialog is enabled.", flags[kFLAGS.DISABLE_QUICKLOAD_CONFIRM] == false],
					["OFF", createCallBackFunction(toggleSetting, kFLAGS.DISABLE_QUICKLOAD_CONFIRM, true), "Quickload confirmation dialog is disabled.", flags[kFLAGS.DISABLE_QUICKLOAD_CONFIRM] == true]
				]);
				pane.addOrUpdateToggleSettings("Quickload Anywhere", [
					["ON", createCallBackFunction(toggleSetting, kFLAGS.QUICKLOAD_ANYWHERE_ENABLED, true), "You may now use quickload anywhere.\nWARNING: Experimental. May glitch.", flags[kFLAGS.QUICKLOAD_ANYWHERE_ENABLED] == true],
					["OFF", createCallBackFunction(toggleSetting, kFLAGS.QUICKLOAD_ANYWHERE_ENABLED, false), "You may only quickload at areas where saving is possible.", flags[kFLAGS.QUICKLOAD_ANYWHERE_ENABLED] == false]
				]);
				pane.addOrUpdateToggleSettings("Char Viewer", [
					["OFF", createCallBackFunction(toggleSetting, kFLAGS.USING_CHARVIEWER, false), "Charviewer is disabled.", flags[kFLAGS.USING_CHARVIEWER] == false],
					["ON", createCallBackFunction(toggleSetting, kFLAGS.USING_CHARVIEWER, true), "Charviewer is enabled.", flags[kFLAGS.USING_CHARVIEWER] == true]
				]);
				pane.update();
			}
			else if (pane.name == PANES_CONFIG[2][0]) { //Fetishes
				pane.addOrUpdateToggleSettings("Watersports (Urine)", [
					["ON", createCallBackFunction(toggleSetting, kFLAGS.WATERSPORTS_ENABLED, true), "Watersports are enabled. You kinky person.", flags[kFLAGS.WATERSPORTS_ENABLED] == true],
					["OFF", createCallBackFunction(toggleSetting, kFLAGS.WATERSPORTS_ENABLED, false), "You won't see watersports scenes.", flags[kFLAGS.WATERSPORTS_ENABLED] == false]
				]);
				pane.addOrUpdateToggleSettings("Addictions", [
					["ON", createCallBackFunction(toggleSetting, kFLAGS.ADDICTIONS_DISABLED, false), "You can get addicted to certain substances.", !flags[kFLAGS.ADDICTIONS_DISABLED]],
					["OFF", createCallBackFunction(toggleSetting, kFLAGS.ADDICTIONS_DISABLED, true), "You cannot get addicted at all. Doesn't remove existing addictions.", flags[kFLAGS.ADDICTIONS_DISABLED]]
				]);
				pane.addOrUpdateToggleSettings("Worms", [
					["ON", createCallBackFunction(setWorms, true, false), "You have chosen to encounter worms as you find the mountains.", player.hasStatusEffect(StatusEffects.WormsOn) && !player.hasStatusEffect(StatusEffects.WormsHalf)],
					["ON (Half)", createCallBackFunction(setWorms, true, true), "You have chosen to encounter worms as you find the mountains, albeit at reduced rate.", player.hasStatusEffect(StatusEffects.WormsHalf)],
					["OFF", createCallBackFunction(setWorms, false, false), "You have chosen not to encounter worms.", player.hasStatusEffect(StatusEffects.WormsOff)],
				]);
				pane.addOrUpdateToggleSettings("Gore", [
					["ON", createCallBackFunction(toggleSetting, kFLAGS.GORE_ENABLED, true), "You might see extreme sexual violence or gore.", flags[kFLAGS.GORE_ENABLED] == true],
					["OFF", createCallBackFunction(toggleSetting, kFLAGS.GORE_ENABLED, false), "You won't see extreme sexual violence or gore.", flags[kFLAGS.GORE_ENABLED] == false]
				]);
				pane.addOrUpdateToggleSettings("Underage", [
					["ON", createCallBackFunction(toggleSetting, kFLAGS.UNDERAGE_ENABLED, 1), "There's no such thing as too young.", flags[kFLAGS.UNDERAGE_ENABLED] > 0],
					["ON (Half)", createCallBackFunction(toggleSetting, kFLAGS.UNDERAGE_ENABLED, 0), "Underage content is enabled, but not too underage (no babies or toddlers).", flags[kFLAGS.UNDERAGE_ENABLED] == 0],
					["OFF", createCallBackFunction(toggleSetting, kFLAGS.UNDERAGE_ENABLED, -1), "You won't see sexual content involving children.", flags[kFLAGS.UNDERAGE_ENABLED] < 0],
				]);
				pane.update();
			}else if (pane.name == PANES_CONFIG[3][0]){ //OtherCoCAnonStuff
				pane.addOrUpdateToggleSettings("Temptation", [
					["Off", createCallBackFunction(flipSettingBit,kFLAGS.OTHERCOCANON_SURVIVALTWEAK,0), "Player has full control over their libido.", !(flags[kFLAGS.OTHERCOCANON_SURVIVALTWEAK] & 1)],
					["On", createCallBackFunction(flipSettingBit,kFLAGS.OTHERCOCANON_SURVIVALTWEAK,0), "Player may be unable to resist sex with monsters.", flags[kFLAGS.OTHERCOCANON_SURVIVALTWEAK] & 1]
				]);
				pane.addOrUpdateToggleSettings("Creeping Taint", [
					["Off", createCallBackFunction(flipSettingBit,kFLAGS.OTHERCOCANON_SURVIVALTWEAK,1), "Player will not gain corruption over time.", !(flags[kFLAGS.OTHERCOCANON_SURVIVALTWEAK] & 2)],
					["On", createCallBackFunction(flipSettingBit,kFLAGS.OTHERCOCANON_SURVIVALTWEAK,1), "Player will gain small amounts of corruption every hour. Can be stopped by finding a cure.", flags[kFLAGS.OTHERCOCANON_SURVIVALTWEAK] & 2],
				]);
				pane.addOrUpdateToggleSettings("Take a Breather", [
					["Off", createCallBackFunction(flipSettingBit,kFLAGS.OTHERCOCANON_SURVIVALTWEAK,2), "Spells and abilities do not have cooldowns.", !(flags[kFLAGS.OTHERCOCANON_SURVIVALTWEAK] & 4)],
					["On", createCallBackFunction(flipSettingBit,kFLAGS.OTHERCOCANON_SURVIVALTWEAK,2), "Spells and abilities have cooldowns.", flags[kFLAGS.OTHERCOCANON_SURVIVALTWEAK] & 4],
				]);
				pane.addOrUpdateToggleSettings("Regular Training", [
					["Off", createCallBackFunction(flipSettingBit,kFLAGS.OTHERCOCANON_SURVIVALTWEAK,3), "Enemies do not scale to your level.", !(flags[kFLAGS.OTHERCOCANON_SURVIVALTWEAK] & 8)],
					["On", createCallBackFunction(flipSettingBit,kFLAGS.OTHERCOCANON_SURVIVALTWEAK,3), "Enemies scale to your level.", flags[kFLAGS.OTHERCOCANON_SURVIVALTWEAK] & 8],
				]);
                pane.addOrUpdateToggleSettings("Long Haul", [
                    ["Off", createCallBackFunction(flipSettingBit,kFLAGS.OTHERCOCANON_SURVIVALTWEAK,4), "Exploration always results in one encounter per attempt.", !(flags[kFLAGS.OTHERCOCANON_SURVIVALTWEAK] & 16)],
                    ["On", createCallBackFunction(flipSettingBit,kFLAGS.OTHERCOCANON_SURVIVALTWEAK,4), "You may run into multiple encounters before heading back to camp.", flags[kFLAGS.OTHERCOCANON_SURVIVALTWEAK] & 16],
                ]);
				pane.update();
			}else if (pane.name == PANES_CONFIG[4][0]){ //NPCs
				pane.addOrUpdateToggleSettings("Shouldra", [
					["Child", createCallBackFunction(setNPCSetting, "shouldraChild", true), "Shouldra is a little girl.", npcSettings.shouldraChild == true],
					["Young Woman", createCallBackFunction(setNPCSetting, "shouldraChild", false), "You can make Shouldra a little girl.", npcSettings.shouldraChild == false],
				]);
				pane.addOrUpdateToggleSettings("Gargoyle", [
					["Child", createCallBackFunction(setNPCSetting, "gargoyleChild", true), "The gargoyle is a little girl.", npcSettings.gargoyleChild == true],
					["Mature", createCallBackFunction(setNPCSetting, "gargoyleChild", false), "You can make the gargoyle a little girl", npcSettings.gargoyleChild == false],
				]);
				// pane.addOrUpdateToggleSettings("Kid A", [
					// ["Younger", createCallBackFunction(setNPCSetting, "kidAYounger", true), "Kid A will be less developed.", npcSettings.kidAYounger == true],
					// ["Normal", createCallBackFunction(setNPCSetting, "kidAYounger", false), "You can make Kid A less developed.", npcSettings.kidAYounger == false],
				// ]);
				pane.addOrUpdateToggleSettings("Urta", [
					["Doesn't exist", createCallBackFunction(setNPCSetting, "urtaDisabled", true), "Urta doesn't exist, unless you've already interacted with her too much.", npcSettings.urtaDisabled == true],
					["Exists", createCallBackFunction(setNPCSetting, "urtaDisabled", false), "", npcSettings.urtaDisabled == false],
				]);
				pane.addOrUpdateToggleSettings("Generic NPCs", [
					["More kids", createCallBackFunction(setNPCSetting, "genericLoliShota", true), "Some minor, unnamed characters will now be younger.", npcSettings.genericLoliShota == true],
					["Normal", createCallBackFunction(setNPCSetting, "genericLoliShota", false), "You can make some minor, unnamed characters younger.", npcSettings.genericLoliShota == false],
				]);
				pane.update();
			}
		}

		public function enterSettings():void {
			game.saves.savePermObject(false);
			game.mainMenu.hideMainMenu();
			hideMenus();
			if (!initializedPanes) configurePanes();
			clearOutput();
			disableHardcoreCheatSettings();
			displaySettingPane(panes[0]);
			setButtons();
		}
		public function exitSettings():void {
			game.saves.savePermObject(false);
			hideSettingPane();
			game.mainMenu.mainMenu();
		}

		private function setButtons():void {
			menu();
			addButton(0, "Gameplay", displaySettingPane, panes[0]);
			addButton(1, "Interface", displaySettingPane, panes[1]);
			addButton(2, "Fetishes", displaySettingPane, panes[2]);
			addButton(3, "Game Modes", displaySettingPane, panes[3]);
			addButton(4, "NPCs", displaySettingPane, panes[4]);
			addButton(5, "Controls", displayControls);
			addButton(10, "Debug Info", enterDebugPane);
			addButton(14, "Back", exitSettings);
			for (var i:int = 0; i < panes.length; i++) {
				if (lastDisplayedPane == panes[i]) {
					addButtonDisabled(i, mainView.bottomButtons[i].labelText);
				}
			}
		}

		private function displaySettingPane(pane:SettingPane):void {
			hideSettingPane();
			lastDisplayedPane = pane;
			mainView.mainText.visible = false;
			mainView.addChild(pane);
			setOrUpdateSettings(pane);
			pane.update();
			setButtons();
		}
		private function hideSettingPane():void {
			mainView.mainText.visible = true;
			if (lastDisplayedPane != null && lastDisplayedPane.parent != null) lastDisplayedPane.parent.removeChild(lastDisplayedPane);
		}

		private function enterDebugPane():void {
			hideSettingPane();
			game.debugPane();
		}

		//------------
		// GAMEPLAY
		//------------
		private function getDifficultyText():String {
			var text:String = "Difficulty: ";
			switch(flags[kFLAGS.GAME_DIFFICULTY]) {
				case 0:
					if (flags[kFLAGS.EASY_MODE_ENABLE_FLAG]) text += "Easy\nCombat is easier and bad-ends can be ignored.";
					else text += "Normal\nNo opponent stats modifiers. You can resume from bad-ends with penalties.";
					break;
				case 1:
					text += "Hard\nOpponent has 25% more HP and does 15% more damage. Bad-ends can ruin your game.";
					break;
				case 2:
					text += "Nightmare\nOpponent has 50% more HP and does 30% more damage.";
					break;
				case 3:
					text += "Extreme\nOpponent has 100% more HP and does more 50% damage.";
					break;
				default:
					text += "Something derped with the coding!";
			}
			return text;
		}
		public function disableHardcoreCheatSettings():void {
			if (flags[kFLAGS.HARDCORE_MODE] > 0) {
				outputText("Hardcore mode is enabled. Cheats are disabled.\n\n");
				debug = false;
				flags[kFLAGS.EASY_MODE_ENABLE_FLAG] = 0;
				flags[kFLAGS.HYPER_HAPPY] = 0;
				flags[kFLAGS.LOW_STANDARDS_FOR_ALL] = 0;
			}
			if (flags[kFLAGS.GRIMDARK_MODE] > 0) {
				debug = false;
				flags[kFLAGS.EASY_MODE_ENABLE_FLAG] = 0;
				flags[kFLAGS.GAME_DIFFICULTY] = 3;
			}
		}

		private function difficultySelectionMenu():void {
			hideSettingPane();
			clearOutput();
			outputText("You can choose a difficulty to set how hard battles will be.\n");
			outputText("\nEasy: -50% damage, can ignore bad-ends.");
			outputText("\nNormal: No stats changes.");
			outputText("\nHard: +25% HP, +15% damage.");
			outputText("\nNightmare: +50% HP, +30% damage.");
			outputText("\nExtreme: +100% HP, +50% damage.");
			menu();
			addButton(0, "Easy", chooseDifficulty, -1);
			addButton(1, "Normal", chooseDifficulty, 0);
			addButton(2, "Hard", chooseDifficulty, 1);
			addButton(3, "Nightmare", chooseDifficulty, 2);
			addButton(4, "EXTREME", chooseDifficulty, 3);
			addButton(14, "Back", displaySettingPane, lastDisplayedPane);
		}
		private function chooseDifficulty(difficulty:int = 0):void {
			if (difficulty < 0) {
				flags[kFLAGS.EASY_MODE_ENABLE_FLAG] = -difficulty;
				flags[kFLAGS.GAME_DIFFICULTY] = 0;
			}
			else {
				flags[kFLAGS.EASY_MODE_ENABLE_FLAG] = 0;
				flags[kFLAGS.GAME_DIFFICULTY] = difficulty;
			}
			setOrUpdateSettings(lastDisplayedPane);
			displaySettingPane(lastDisplayedPane);
		}

		private function setWorms(enabled:Boolean, half:Boolean):void {
			//Clear status effects
			if (player.hasStatusEffect(StatusEffects.WormsOn)) player.removeStatusEffect(StatusEffects.WormsOn);
			if (player.hasStatusEffect(StatusEffects.WormsHalf)) player.removeStatusEffect(StatusEffects.WormsHalf);
			if (player.hasStatusEffect(StatusEffects.WormsOff)) player.removeStatusEffect(StatusEffects.WormsOff);
			//Set status effects
			if (enabled) {
				player.createStatusEffect(StatusEffects.WormsOn, 0, 0, 0, 0);
				if (half) player.createStatusEffect(StatusEffects.WormsHalf, 0, 0, 0, 0);
			}
			else {
				player.createStatusEffect(StatusEffects.WormsOff, 0, 0, 0, 0);
			}
			setOrUpdateSettings(lastDisplayedPane);
		}

		//Survival Mode
		public function enableSurvivalPrompt():void {
			hideSettingPane();
			clearOutput();
			outputText("Are you sure you want to enable Survival Mode?\n\n");
			outputText("You will NOT be able to turn it off! (Unless you reload immediately.)");
			doYesNo(enableSurvivalForReal, createCallBackFunction(displaySettingPane, lastDisplayedPane));
		}
		public function enableSurvivalForReal():void {
			clearOutput();
			outputText("Survival mode is now enabled.");
			player.hunger = 80;
			flags[kFLAGS.HUNGER_ENABLED] = 0.5;
			doNext(createCallBackFunction(displaySettingPane, lastDisplayedPane));
		}

		//Realistic Mode
		public function enableRealisticPrompt():void {
			hideSettingPane();
			clearOutput();
			outputText("Are you sure you want to enable Realistic Mode?\n\n");
			outputText("You will NOT be able to turn it off! (Unless you reload immediately.)");
			doYesNo(enableRealisticForReal, createCallBackFunction(displaySettingPane, lastDisplayedPane));
		}
		public function enableRealisticForReal():void {
			clearOutput();
			outputText("Realistic mode is now enabled.")
			flags[kFLAGS.HUNGER_ENABLED] = 1;
			doNext(createCallBackFunction(displaySettingPane, lastDisplayedPane));
		}

		//------------
		// INTERFACE
		//------------
		public function menuMainBackground():void {
			hideSettingPane();
			clearOutput();
			outputText("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed vitae turpis nec ipsum fermentum pellentesque. Nam consectetur euismod diam. Proin vitae neque in massa tempor suscipit eget at mi. In hac habitasse platea dictumst. Morbi laoreet erat et sem hendrerit mattis. Cras in mauris vestibulum nunc fringilla condimentum. Nam sed arcu non ipsum luctus dignissim a eget ante. Curabitur dapibus neque at elit iaculis, ac aliquam libero dapibus. Sed non lorem diam. In pretium vehicula facilisis. In euismod imperdiet felis, vitae ultrices magna cursus at. Vivamus orci urna, fringilla ac elementum eu, accumsan vel nunc. Donec faucibus dictum erat convallis efficitur. Maecenas cursus suscipit magna, id dapibus augue posuere ut.\n\n");
			menu();
			addButton(0, "Map (Default)", setMainBackground, 0).disableIf(flags[kFLAGS.BACKGROUND_STYLE] == 0);
			addButton(1, "Parchment", setMainBackground, 1).disableIf(flags[kFLAGS.BACKGROUND_STYLE] == 1);
			addButton(2, "Marble", setMainBackground, 2).disableIf(flags[kFLAGS.BACKGROUND_STYLE] == 2);
			addButton(3, "Obsidian", setMainBackground, 3).disableIf(flags[kFLAGS.BACKGROUND_STYLE] == 3);
			addButton(4, "Stone", setMainBackground, 4).disableIf(flags[kFLAGS.BACKGROUND_STYLE] == 4);
			addButton(5, "Night Mode", setMainBackground, 9).hint("Good if you're playing at night to make the game easier on your eyes.").disableIf(flags[kFLAGS.BACKGROUND_STYLE] == 9);
			if (flags[kFLAGS.GRIMDARK_BACKGROUND_UNLOCKED] > 0) addButton(6, "Grimdark", setMainBackground, 8).disableIf(flags[kFLAGS.BACKGROUND_STYLE] == 8);
			addButton(14, "Back", displaySettingPane, lastDisplayedPane);
		}
		public function setMainBackground(type:int):void {
			flags[kFLAGS.BACKGROUND_STYLE]           = type;
			mainView.background.bitmapClass          = MainView.Backgrounds[flags[kFLAGS.BACKGROUND_STYLE]];
			mainView.statsView.setBackground(StatsView.SidebarBackgrounds[flags[kFLAGS.BACKGROUND_STYLE]]);
			menuMainBackground();
		}

		public function menuTextBackground():void {
			hideSettingPane();
			clearOutput();
			outputText("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed vitae turpis nec ipsum fermentum pellentesque. Nam consectetur euismod diam. Proin vitae neque in massa tempor suscipit eget at mi. In hac habitasse platea dictumst. Morbi laoreet erat et sem hendrerit mattis. Cras in mauris vestibulum nunc fringilla condimentum. Nam sed arcu non ipsum luctus dignissim a eget ante. Curabitur dapibus neque at elit iaculis, ac aliquam libero dapibus. Sed non lorem diam. In pretium vehicula facilisis. In euismod imperdiet felis, vitae ultrices magna cursus at. Vivamus orci urna, fringilla ac elementum eu, accumsan vel nunc. Donec faucibus dictum erat convallis efficitur. Maecenas cursus suscipit magna, id dapibus augue posuere ut.\n\n");
			menu();
			addButton(0, "Normal", chooseTextBackground, 0);
			addButton(1, "White", chooseTextBackground, 1);
			addButton(2, "Tan", chooseTextBackground, 2);
			addButton(3, "Clear", chooseTextBackground, -1);
			addButton(4, "Back", displaySettingPane, lastDisplayedPane);
		}
		private function chooseTextBackground(type:int):void {
			flags[kFLAGS.TEXT_BACKGROUND_STYLE] = type;
			mainView.setTextBackground(flags[kFLAGS.TEXT_BACKGROUND_STYLE]);
		}

		//Needed for keys
		public function cycleBackground():void {
			flags[kFLAGS.TEXT_BACKGROUND_STYLE]++;
			if (flags[kFLAGS.TEXT_BACKGROUND_STYLE] > 2) {
				flags[kFLAGS.TEXT_BACKGROUND_STYLE] = 0;
			}
			mainView.setTextBackground(flags[kFLAGS.TEXT_BACKGROUND_STYLE]);
		}

		public function cycleQuality():void {
			if (mainView.stage.quality == StageQuality.LOW) mainView.stage.quality = StageQuality.MEDIUM;
			else if (mainView.stage.quality == StageQuality.MEDIUM) mainView.stage.quality = StageQuality.HIGH;
			else if (mainView.stage.quality == StageQuality.HIGH) mainView.stage.quality = StageQuality.LOW;
		}

		public function toggleDebug(selection:Boolean):void {
			debug = selection;
			setOrUpdateSettings(lastDisplayedPane);
		}

		public function toggleSetting(flag:int, selection:int):void {
			flags[flag] = selection;
			setOrUpdateSettings(lastDisplayedPane);
		}

		//flips a bit on a setting
		public function flipSettingBit(flag:int,flipBit:uint):void{
			flags[flag] ^= (1 << flipBit) ;
			setOrUpdateSettings(lastDisplayedPane);
		}

		public function setNPCSetting(option:String, value:*):void {
			npcSettings[option] = value;
			setOrUpdateSettings(lastDisplayedPane);
		}

		//------------
		// FONT SIZE
		//------------
		public function fontSettingsMenu():void {
			hideSettingPane();
			clearOutput();
			outputText("Font size is currently set at " + (flags[kFLAGS.CUSTOM_FONT_SIZE] > 0 ? flags[kFLAGS.CUSTOM_FONT_SIZE] : 20) +  ".\n\n");
			outputText("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed vitae turpis nec ipsum fermentum pellentesque. Nam consectetur euismod diam. Proin vitae neque in massa tempor suscipit eget at mi. In hac habitasse platea dictumst. Morbi laoreet erat et sem hendrerit mattis. Cras in mauris vestibulum nunc fringilla condimentum. Nam sed arcu non ipsum luctus dignissim a eget ante. Curabitur dapibus neque at elit iaculis, ac aliquam libero dapibus. Sed non lorem diam. In pretium vehicula facilisis. In euismod imperdiet felis, vitae ultrices magna cursus at. Vivamus orci urna, fringilla ac elementum eu, accumsan vel nunc. Donec faucibus dictum erat convallis efficitur. Maecenas cursus suscipit magna, id dapibus augue posuere ut.\n\n");
			menu();
			addButton(0, "Smaller Font", adjustFontSize, -1);
			addButton(1, "Larger Font", adjustFontSize, 1);
			addButton(2, "Reset Size", adjustFontSize, 0);
			addButton(4, "Back", displaySettingPane, lastDisplayedPane);
		}
		public function adjustFontSize(change:int):void {
			var fmt:TextFormat = mainView.mainText.getTextFormat();
			if (fmt.size == null) fmt.size = 20;
			fmt.size = (fmt.size as Number) + change;
			if (change == 0) fmt.size = 20;
			if ((fmt.size as Number) < 14) fmt.size = 14;
			if ((fmt.size as Number) > 32) fmt.size = 32;
			mainView.mainText.setTextFormat(fmt);
			flags[kFLAGS.CUSTOM_FONT_SIZE] = fmt.size;
			setOrUpdateSettings(lastDisplayedPane);
			fontSettingsMenu();
		}

		//------------
		// CONTROLS
		//------------
		public function displayControls():void {
			hideSettingPane();
			mainView.hideAllMenuButtons();
			game.inputManager.DisplayBindingPane();
			menu();
			addButton(0, "Reset Ctrls", resetControls);
			addButton(1, "Clear Ctrls", clearControls);
			addButton(14, "Back", hideControls);
		}
		public function hideControls():void {
			game.inputManager.HideBindingPane();
			displaySettingPane(lastDisplayedPane);
		}

		public function resetControls():void {
			game.inputManager.HideBindingPane();
			clearOutput();
			outputText("Are you sure you want to reset all of the currently bound controls to their defaults?");
			doYesNo(resetControlsYes, displayControls);
		}
		public function resetControlsYes():void {
			game.inputManager.ResetToDefaults();
			clearOutput();
			outputText("Controls have been reset to defaults!\n\n");
			doNext(displayControls);
		}

		public function clearControls():void {
			game.inputManager.HideBindingPane();
			clearOutput();
			outputText("Are you sure you want to clear all of the currently bound controls?");
			doYesNo(clearControlsYes, displayControls);
		}
		public function clearControlsYes():void {
			game.inputManager.ClearAllBinds();
			clearOutput();
			outputText("Controls have been cleared!");
			doNext(displayControls);
		}

		//------------
		// SAVING TEST
		//------------
		public var npcSettings:Object = {
			gargoyleChild:false,
			shouldraChild:false,
			kidAYounger:false,
			genericLoliShota:false,
			urtaDisabled:false
		}

		public function get saveName():String {
			return "settings";
		}

		public function get saveVersion():int {
			return 1;
		}

		public function load(version:int, saveObject:Object):void {
			for (var property:String in npcSettings) {
				if (saveObject.hasOwnProperty(property)) npcSettings[property] = saveObject[property];
			}
		}

		public function reset():void {
			//In case property doesn't exist in save, use old loli mode flag to decide defaults
			var loliMode:Boolean = flags[kFLAGS.APPLES_OF_IDUNN] == 1;
			npcSettings.gargoyleChild = loliMode;
			npcSettings.shouldraChild = loliMode;
			npcSettings.kidAYounger = loliMode;
			npcSettings.genericLoliShota = loliMode;
		}

		public function onAscend(reset:Boolean):void {}

		public function saveToObject():Object {
			return npcSettings;
		}

		public function loadFromObject(o:Object, ignoreErrors:Boolean):void {
		}
	}
}


code:
//Achievements ahoy!

package classes.GlobalFlags
{
	public class kACHIEVEMENTS
	{
		//Storyline Achievements (000-009)
		public static const STORY_NEWCOMER:int					= 0; //Enter the realm of Mareth.
		public static const STORY_MARAE_SAVIOR:int				= 1; //Complete Marae’s quest.
		public static const STORY_ZETAZ_REVENGE:int				= 2; //Defeat Zetaz and obtain the map.
		public static const STORY_FINALBOSS:int					= 3; //Defeat Lethice.
		public static const UNKNOWN_ACHIEVEMENT_004:int			= 4;
		public static const UNKNOWN_ACHIEVEMENT_005:int			= 5;
		public static const UNKNOWN_ACHIEVEMENT_006:int			= 6;
		public static const UNKNOWN_ACHIEVEMENT_007:int			= 7;
		public static const UNKNOWN_ACHIEVEMENT_008:int			= 8;
		public static const UNKNOWN_ACHIEVEMENT_009:int			= 9;

		//Zone Achievements (010-029)
		public static const ZONE_EXPLORER:int					= 10; //Discover every zone.
		public static const ZONE_SIGHTSEER:int					= 11; //Discover every place.
		public static const ZONE_WHERE_AM_I:int					= 12; //Explore for the first time.
		public static const ZONE_FOREST_RANGER:int				= 13; //Explore the forest 100 times.
		public static const ZONE_VACATIONER:int					= 14; //Explore the lake 100 times.
		public static const ZONE_DEHYDRATED:int					= 15; //Explore the desert 100 times.
		public static const ZONE_MOUNTAINEER:int				= 16; //Explore the mountain 100 times.
		public static const ZONE_WE_NEED_TO_GO_DEEPER:int		= 17; //Explore the deepwoods 100 times.
		public static const ZONE_ROLLING_HILLS:int				= 18; //Explore the plains 100 times.
		public static const ZONE_WET_ALL_OVER:int				= 19; //Explore the swamp 100 times.
		public static const ZONE_LIGHT_HEADED:int				= 20; //Explore the high mountain 100 times.
		public static const ZONE_ALL_MURKY:int					= 21; //Explore the bog 100 times.
		public static const ZONE_FROZEN:int						= 22; //Explore the glacial rift 100 times.
		public static const ZONE_ARCHAEOLOGIST:int				= 23; //Visit the town ruins 15 times.
		public static const ZONE_FARMER:int						= 24; //Visit the farm 30 times.
		public static const ZONE_SEA_LEGS:int					= 25; //Use the boat 15 times.
		public static const ZONE_ROASTED:int					= 26; //Explore the volcanic crag 50 times.
		public static const UNKNOWN_ACHIEVEMENT_027:int			= 27;
		public static const UNKNOWN_ACHIEVEMENT_028:int			= 28;
		public static const UNKNOWN_ACHIEVEMENT_029:int			= 29;

		//Level Achievements (030-039)
		public static const LEVEL_LEVEL_UP:int					= 30; //Level 2
		public static const LEVEL_NOVICE:int					= 31; //Level 5
		public static const LEVEL_APPRENTICE:int				= 32; //Level 10
		public static const LEVEL_JOURNEYMAN:int				= 33; //Level 15
		public static const LEVEL_EXPERT:int					= 34; //Level 20
		public static const LEVEL_MASTER:int					= 35; //Level 30
		public static const LEVEL_GRANDMASTER:int				= 36; //Level 40
		public static const LEVEL_ILLUSTRIOUS:int				= 37; //Level 50
		public static const LEVEL_OVERLORD:int					= 38; //Level 60
		public static const LEVEL_ARE_YOU_A_GOD:int				= 39; //Level 100 (shadow achievement)

		//Population Achievements (040-049)
		public static const POPULATION_FIRST:int				= 40; //Population 2
		public static const POPULATION_HAMLET:int				= 41; //Population 5
		public static const POPULATION_VILLAGE:int				= 42; //Population 10
		public static const POPULATION_TOWN:int					= 43; //Population 25
		public static const POPULATION_CITY:int					= 44; //Population 100
		public static const POPULATION_METROPOLIS:int			= 45; //Population 250
		public static const POPULATION_MEGALOPOLIS:int			= 46; //Population 500
		public static const POPULATION_CITY_STATE:int			= 47; //Population 1,000 (shadow achievement)
		public static const POPULATION_KINGDOM:int				= 48; //Population 2,500 (shadow achievement)
		public static const POPULATION_EMPIRE:int				= 49; //Population 5,000 (shadow achievement)

		//Time Achievements (050-059)
		public static const TIME_MONTH:int						= 50; //30 days
		public static const TIME_HALF_YEAR:int					= 51; //180 days
		public static const TIME_ANNUAL:int						= 52; //365 days
		public static const TIME_BIENNIAL:int					= 53; //730 days
		public static const TIME_TRIENNIAL:int					= 54; //1095 days
		public static const TIME_LONG_HAUL:int					= 55; //1825 days
		public static const TIME_DECADE:int						= 56; //3650 days
		public static const TIME_CENTURY:int					= 57; //36,500 days (shadow achievement)
		public static const TIME_MILLENNIUM:int					= 58;
		public static const TIME_TRAVELLER:int					= 59;

		//Dungeon Achievements (060-069)
		public static const DUNGEON_DELVER:int					= 60;
		public static const DUNGEON_DELVER_MASTER:int			= 61;
		public static const DUNGEON_SHUT_DOWN_EVERYTHING:int	= 62;
		public static const DUNGEON_YOURE_IN_DEEP:int			= 63;
		public static const DUNGEON_SAND_WITCH_FRIEND:int		= 64;
		public static const DUNGEON_PHOENIX_FALL:int			= 65;
		public static const DUNGEON_ACCOMPLICE:int				= 66; //shadow achievement
		public static const DUNGEON_EXTREMELY_CHASTE_DELVER:int	= 67; //shadow achievement
		public static const DUNGEON_DELVER_APPRENTICE:int		= 68;
		public static const DUNGEON_END_OF_REIGN:int			= 69;

		//Fashion and Wealth Achievements (070-074)(075-079)
		public static const FASHION_WANNABE_WIZARD:int			= 70;
		public static const FASHION_COSPLAYER:int				= 71;
		public static const FASHION_DOMINATRIX:int				= 72;
		public static const FASHION_GOING_COMMANDO:int			= 73;
		public static const FASHION_BLING_BLING:int				= 74;
		public static const WEALTH_RICH:int						= 75;
		public static const WEALTH_HOARDER:int					= 76;
		public static const WEALTH_GEM_VAULT:int				= 77;
		public static const WEALTH_MILLIONAIRE:int				= 78;
		//public static const WEALTH_ITEM_VAULT:int				= 79;

		//Combat Achievements (080-089)
		public static const COMBAT_WIZARD:int					= 80; //Learn all black and white spells.
		public static const COMBAT_CUM_CANNON:int				= 81; //Cum in the middle of battle.
		public static const COMBAT_PAIN:int						= 82; //50 damage
		public static const COMBAT_FRACTURED_LIMBS:int			= 83; //100 damage
		public static const COMBAT_BROKEN_BONES:int				= 84; //250 damage
		public static const COMBAT_OVERKILL:int					= 85; //500 damage (shadow achievement?)
		public static const COMBAT_SHOT_WEB:int					= 86; //How do I shot web?
		public static const COMBAT_DAMAGE_SPONGE:int			= 87;
		public static const COMBAT_BLOOD_LETTER:int				= 88;
		public static const COMBAT_PACIFIST:int					= 89;

		//Holiday Achievements (090-099)
		public static const HOLIDAY_EGG_HUNTER:int				= 90;
		public static const HOLIDAY_HELIA_BIRTHDAY:int			= 91;
		public static const HOLIDAY_THANKSGIVING_I:int			= 92;
		public static const HOLIDAY_THANKSGIVING_II:int			= 93;
		public static const HOLIDAY_HALLOWEEN_I:int				= 94;
		public static const HOLIDAY_HALLOWEEN_II:int			= 95;
		public static const HOLIDAY_CHRISTMAS_I:int				= 96;
		public static const HOLIDAY_CHRISTMAS_II:int			= 97;
		public static const HOLIDAY_CHRISTMAS_III:int			= 98;
		public static const HOLIDAY_VALENTINE:int				= 99;

		//Hunger Achievements (100-104)
		public static const REALISTIC_TASTES_LIKE_CHICKEN:int	= 100;
		public static const REALISTIC_CHAMPION_NEEDS_FOOD:int	= 101; //Champion needs food badly!
		public static const REALISTIC_GOURMAND:int				= 102;
		public static const REALISTIC_GLUTTON:int				= 103;
		public static const REALISTIC_FASTING:int				= 104;

		//Challenge Achievements (105-109)
		public static const CHALLENGE_ULTIMATE_NOOB:int			= 105; //Defeat Lethice at level 1.
		public static const CHALLENGE_ULTIMATE_MUNDANE:int		= 106; //Defeat Lethice without spells.
		public static const CHALLENGE_ULTIMATE_CELIBATE:int		= 107; //Finish without ever having orgasm or sex.
		public static const CHALLENGE_PACIFIST:int				= 108; //Beat the game without killing anyone.
		public static const CHALLENGE_SPEEDRUN:int				= 109; //Beat the game in 30 days or less.

		//General Achievements (110+)
		public static const GENERAL_PORTAL_DEFENDER:int			= 110; //Defeat 25 demons and sleep 10 times.
		public static const GENERAL_BAD_ENDER:int				= 111; //Cause 3 bad ends to various NPCs.
		public static const GENERAL_GAME_OVER:int				= 112; //Get a Bad End.
		public static const GENERAL_URINE_TROUBLE:int			= 113; //Urinate once in the realm of Mareth.
		public static const GENERAL_WHATS_HAPPENING_TO_ME:int	= 114; //Transform for the first time.
		public static const GENERAL_TRANSFORMER:int				= 115; //Transform 10 times.
		public static const GENERAL_SHAPESHIFTY:int				= 116; //Transform 25 times.
		public static const GENERAL_FAPFAPFAP:int				= 117; //Masturbate for the first time.
		public static const GENERAL_FAPTASTIC:int				= 118; //Masturbate 10 times.
		public static const GENERAL_FAPSTER:int					= 119; //Masturbate 100 times.
		public static const GENERAL_HELSPAWN:int				= 120;
		public static const GENERAL_GOO_ARMOR:int				= 121;
		public static const GENERAL_URTA_TRUE_LOVER:int			= 122;
		public static const GENERAL_DRESSTACULAR:int			= 123;
		public static const GENERAL_GODSLAYER:int				= 124;
		public static const GENERAL_GOTTA_LOVE_THEM_ALL:int		= 125;
		public static const GENERAL_FOLLOW_THE_LEADER:int		= 126;
		public static const GENERAL_MEET_YOUR_MASTER:int		= 127;
		public static const GENERAL_MEET_YOUR_MASTER_TRUE:int	= 128;
		public static const GENERAL_ALL_UR_PPLZ_R_BLNG_2_ME:int	= 129;
		public static const GENERAL_SCHOLAR:int					= 130;
		public static const GENERAL_HOLEY_BEING:int				= 131;
		public static const GENERAL_TRANSGENDER:int				= 132;
		public static const GENERAL_FREELOADER:int				= 133;
		public static const GENERAL_PERKY:int					= 134;
		public static const GENERAL_SUPER_PERKY:int				= 135;
		public static const GENERAL_STATS_50:int				= 136;
		public static const GENERAL_STATS_100:int				= 137;
		public static const GENERAL_SCHIZO:int					= 138;
		public static const GENERAL_CLEAN_SLATE:int				= 139;
		public static const GENERAL_EVERYBODY_LOVES_ME:int		= 140;
		public static const GENERAL_RETURN_TO_INGNAM:int		= 141;
		public static const GENERAL_LIKE_CHUCK_NORRIS:int		= 142;
		public static const GENERAL_FAIRY_FRENZY:int			= 143;
		public static const GENERAL_TENTACLE_BEAST_SLAYER:int	= 144;
		public static const GENERAL_HOME_SWEET_HOME:int			= 145;
		public static const GENERAL_GETAWAY:int					= 146;
		public static const GENERAL_CONVERSATIONALIST:int		= 147;
		public static const GENERAL_PEOPLE_PERSON:int			= 148;
		public static const GENERAL_RESTART_THE_RACES:int		= 149;
		public static const GENERAL_OLD_TIMES:int				= 150;
		public static const GENERAL_REGULAR:int					= 151;
		public static const GENERAL_DRUNK:int					= 152;
		public static const GENERAL_SMASHED:int					= 153;
		public static const GENERAL_IM_NO_LUMBERJACK:int		= 154;
		public static const GENERAL_DEFORESTER:int				= 155;
		public static const GENERAL_HAMMER_TIME:int				= 156;
		public static const GENERAL_NAIL_SCAVENGER:int			= 157;
		public static const GENERAL_FREE_ALL_THE_SLAVES:int		= 158;
		public static const GENERAL_YIN_YANG:int				= 159;
		public static const GENERAL_MY_TENT_NOT_BETTER:int		= 160;
		public static const GENERAL_MINERVA_PURIFICATION:int	= 161; //Shadow achievement
		public static const GENERAL_FENCER:int					= 162; //Shadow achievement
		public static const GENERAL_GAME_BREAKER:int			= 163; //Might be awarded for breaking the game.
		public static const GENERAL_FUCK_WITH_PORTALS:int		= 164;
		public static const GENERAL_GETTING_WOOD:int			= 165; //Minecraft reference
		public static const GENERAL_DICK_BANISHER:int			= 166;
		public static const GENERAL_ULTRA_PERKY:int				= 167;
		public static const GENERAL_UP_TO_11:int				= 168; //This one goes to eleven.
		public static const GENERAL_YOU_BASTARD:int				= 169;
		public static const GENERAL_YABBA_DABBA_DOO:int			= 170;
		public static const GENERAL_ANTWORKS:int				= 171;
		public static const GENERAL_OFF_WITH_HER_HEAD:int		= 172; //Awarded for beheading Lethice.
		public static const GENERAL_NOOOOOOO:int				= 173; //Insert Darth Vader voice here.
		public static const GENERAL_KAIZO_TRAP:int				= 174; //Fall victim to Kaizo Trap.
		public static const GENERAL_SAVE_SCUMMER:int			= 175; //Save scum. NOT USED.
		public static const GENERAL_MAKE_MARETH_GREAT_AGAIN:int	= 176; //Make Mareth Great Again indeed!
		public static const GENERAL_TERRACOTTA_IMPY:int			= 177; //Place 100 Imp Statues around your camp (Shadow achievement)
		public static const GENERAL_DINING_IN:int				= 178; //Eat at the Black Cock.
		public static const GENERAL_HUNTER_IS_HUNTED:int		= 179; //Turn the tables on Erlking
		public static const GENERAL_ALLAHU_AKBAL:int			= 180; //Get all the perks from Akbal.
		public static const GENERAL_JOJOS_BIZARRE_ADVENTURE:int	= 182; //Have Jojo in your camp.
		//OtherCoCAnon achievements
		public static const GENERAL_PARASITE_QUEEN:int			= 277; //Host 10 eel parasites at once. Not sure if this is even possible!
		public static const COMBAT_REVENGEANCE:int				= 278;//Kill someone with a katana counter.
		public static const DUNGEON_A_LITTLE_HOPE:int			= 279;//Completed the dullahan's request. A little hope, however desperate, is never without worth.
		public static const DUNGEON_WE_ARE_THE_FLAME:int        = 280;//Put Vilkus to rest, and finished the tale of the Inquisition in Mareth.
		public static const DUNGEON_MEETING_OF_THE_MINDS:int    = 281;//Defeated Laurentius.
        public static const LORD_BRITISH_POSTULATE:int          = 282;//Beat the Nameless Horror. How?
        public static const ALEXANDER_THE_GREAT:int             = 283;//Beat Demonfist without weapons or a shield.
		public static const GENERAL_NEPHILA_QUEEN:int			= 290; // Reach Nephila Infestation Level 10.
		public static const NIGHT_SUN:int                       = 283;
		public static const GENERAL_NEPHILA_ARCH_QUEEN:int		= 295; //Reach Nephila Infestation Level 10, hunt down and defeat an advanced Nephila, and agree to become arch queen of the subterannean goos.

	}

}

license: unknown


code:
/**
 * Created by aimozg on 27.03.2017.
 */
package classes.GlobalFlags {
import classes.internals.CountersStorage;

public class kCOUNTERS {
	function kCOUNTERS() {
	}

	// ======================
	// COUNTER LISTS
	// =====================
	public static const VERSION:int = 0; // May contain versioning. ATM [] is "old save" and [1] is "new save"
	// Monsters (excluding ones with low encounter limit)
	public static const MONSTER_BEEGIRL:int        = 1;
	public static const MONSTER_CUMWITCH:int       = 2;
	public static const MONSTER_GOBLIN:int         = 3;
	public static const MONSTER_GOBLINASSASSIN:int = 4;
	public static const MONSTER_GOBLINMATRON:int   = 5; // Tamani
	public static const MONSTER_GOBLINELDER:int    = 6;
	public static const MONSTER_GOBLINSHAMAN:int   = 7;
	public static const MONSTER_GOBLINWARRIOR:int  = 8;
	public static const MONSTER_IMP:int            = 9;
	public static const MONSTER_IMPLORD:int        = 10;
	public static const MONSTER_IMPWARLORD:int     = 11;
	public static const MONSTER_IMPOVERLORD:int    = 12;
	public static const MONSTER_NAGA:int           = 13;
	public static const MONSTER_SANDTRAP:int       = 14;
	public static const MONSTER_SANDWITCH:int      = 15;
	public static const MONSTER_SUCCUBUS:int       = 16;
	public static const MONSTER_TENTACLEBEAST:int  = 17;
	// Monster groups, can be nested. It's even possible to build a proper taxonomy
	public static const MONGROUP_HUMAN:int         = 201; // down to ~3/4 humanity
	public static const MONGROUP_HUMANOID:int      = 202; // giants, oni
	public static const MONGROUP_GOBLINOID:int     = 203; // all kinds of goblins
	public static const MONGROUP_DEMON:int         = 204;
	public static const MONGROUP_INSECT:int        = 205;
	public static const MONGROUP_REPTILIAN:int     = 206;

	// ======================
	// COUNTER LIST ITEMS
	// =====================
	// Monster and monster group counter list structure
	// monster WON/LOST [to] player
	public static const _MONSTER_VERSION:int       = 0;
	public static const _MONSTER_ENCOUNTERED:int   = 1;
	public static const _MONSTER_BATTLED:int       = 2;
	public static const _MONSTER_WON_TOTAL:int     = 3;
	public static const _MONSTER_WON_LUST:int      = 4;
	public static const _MONSTER_WON_HP:int        = 5;
	public static const _MONSTER_LOST_TOTAL:int    = 6;
	public static const _MONSTER_LOST_LUST:int     = 7;
	public static const _MONSTER_LOST_HP:int       = 8;
	public static const _MONSTER_RANFROM:int       = 9;
	public static const _MONSTER_SEX_TOTAL:int     = 10;
	public static const _MONSTER_SEX_WHEN_WON:int  = 11;
	public static const _MONSTER_SEX_WHEN_LOST:int = 12;
	public static const _MONSTER_SEX_NO_BATTLE:int = 13;

	public static const internals:* = {
		MAX_COUNTER: 500
	};

	public static function create():CountersStorage {
		return new CountersStorage();
	}

	/**
	 * Initialize for new game values
	 */
	public static function initialize(counters:CountersStorage):void {
		counters[VERSION] = [1];
	}

	public static function isInitialized(counters:CountersStorage):Boolean {
		return counters[VERSION] is Array && counters[VERSION].length > 0;
	}
}
}