code:
package classes
{
import classes.Scenes.Places.TelAdre.UmasShop;
import classes.Items.JewelryLib;
import classes.GlobalFlags.kFLAGS;

/**
	 * Character class for player and NPCs. Has subclasses Player and NonPlayer.
	 * @author Yoffy
	 */
	public class Character extends Creature
	{
		//BEARDS! Not used anywhere right now but WHO WANTS A BEARD?
		//Kitteh6660: I want a beard! I'll code in obtainable beard. (DONE!)

		//Used for hip ratings
		public var thickness:Number = 0;

		//Body tone i.e. Lithe, stocky, etc
		public var tone:Number = 0;

		private var _pregnancyType:int = 0;
		public function get pregnancyType():int { return _pregnancyType; }

		private var _pregnancyIncubation:int = 0;
		public function get pregnancyIncubation():int { return _pregnancyIncubation; }

		private var _buttPregnancyType:int = 0;
		public function get buttPregnancyType():int { return _buttPregnancyType; }

		private var _buttPregnancyIncubation:int = 0;
		public function get buttPregnancyIncubation():int { return _buttPregnancyIncubation; }

		//Key items
		public var keyItems:Array;

		public function Character()
		{
			keyItems = [];
		}

		//Return bonus fertility

		//return total fertility

		public function faceDesc():String
		{
			var faceo:String = "";
			//0-10
			if (femininity < 10)
			{
				faceo = "a square chin";
				if (!hasBeard())
					faceo += " and chiseled jawline";
				else
					faceo += ", chiseled jawline, and " + beard();
			}
			//10+ -20
			else if (femininity < 20)
			{
				faceo = "a rugged looking " + face() + " ";
				if (hasBeard())
					faceo += "and " + beard();
				faceo += "that's surely handsome";
			}
			//21-28
			else if (femininity < 28)
				faceo = "a well-defined jawline and a fairly masculine profile";
			//28+-35
			else if (femininity < 35)
				faceo = "a somewhat masculine, angular jawline";
			//35-45
			else if (femininity < 45)
				faceo = "the barest hint of masculinity on its features";
			//45-55
			else if (femininity <= 55)
				faceo = "an androgynous set of features that would look normal on a male or female";
			//55+-65
			else if (femininity <= 65)
				faceo = "a tiny touch of femininity to it, with gentle curves";
			//65+-72
			else if (femininity <= 72)
				faceo = "a nice set of cheekbones and lips that have the barest hint of pout";
			//72+-80
			else if (femininity <= 80)
				faceo = "a beautiful, feminine shapeliness that's sure to draw the attention of males";
			//81-90
			else if (femininity <= 90)
				faceo = "a gorgeous profile with full lips, a button nose, and noticeable eyelashes";
			//91-100
			else
				faceo = "a jaw-droppingly feminine shape with full, pouting lips, an adorable nose, and long, beautiful eyelashes";
			return faceo;
		}

		//Modify femininity!
		public function modFem(goal:Number, strength:Number = 1):String
		{
			var output:String = "";
			var old:String = faceDesc();
			var oldN:Number = femininity;
			var Changed:Boolean = false;
			//If already perfect!
			if (goal == femininity)
				return "";
			//If turning MANLYMAN
			if (goal < femininity && goal <= 50)
			{
				femininity -= strength;
				//YOUVE GONE TOO FAR! TURN BACK!
				if (femininity < goal)
					femininity = goal;
				Changed = true;
			}
			//if turning GIRLGIRLY, like duh!
			if (goal > femininity && goal >= 50)
			{
				femininity += strength;
				//YOUVE GONE TOO FAR! TURN BACK!
				if (femininity > goal)
					femininity = goal;
				Changed = true;
			}
			//Fix if it went out of bounds!
			if (findPerk(PerkLib.Androgyny) < 0)
				fixFemininity();
			//Abort if nothing changed!
			if (!Changed)
				return "";
			//See if a change happened!
			if (old != faceDesc())
			{
				//Gain fem?
				if (goal > oldN)
					output = "\n\nYour facial features soften as your body becomes more feminine. (+" + strength + ")";
				if (goal < oldN)
					output = "\n\nYour facial features harden as your body becomes more masculine. (+" + strength + ")";
			}
			//Barely noticable change!
			else
			{
				if (goal > oldN)
					output = "\n\nThere's a tingling in your " + face() + " as it changes imperceptibly towards being more feminine. (+" + strength + ")";
				else if (goal < oldN)
					output = "\n\nThere's a tingling in your " + face() + " as it changes imperciptibly towards being more masculine. (+" + strength + ")";
			}
			return output;
		}

		public function modThickness(goal:Number, strength:Number = 1):String
		{
			if (goal == thickness)
				return "";
			//Lose weight fatty!
			if (goal < thickness && goal < 50)
			{
				thickness -= strength;
				//YOUVE GONE TOO FAR! TURN BACK!
				if (thickness < goal)
					thickness = goal;
			}
			//Sup tubby!
			if (goal > thickness && goal > 50)
			{
				thickness += strength;
				//YOUVE GONE TOO FAR! TURN BACK!
				if (thickness > goal)
					thickness = goal;
			}
			trace("MOD THICKNESS FIRE");
			//DIsplay 'U GOT FAT'
			if (goal >= thickness && goal >= 50)
				return "\n\nYour center of balance changes a little bit as your body noticeably widens. (+" + strength + " body thickness)";
			//GET THIN BITCH
			else if (goal <= thickness && goal <= 50)
				return "\n\nEach movement feels a tiny bit easier than the last.  Did you just lose a little weight!? (+" + strength + " thin)";
			return "";
		}

		public function modTone(goal:Number, strength:Number = 1):String
		{
			if (goal == tone)
				return "";
			//Lose muscle visibility!
			if (goal < tone && goal < 50)
			{
				tone -= strength;
				//YOUVE GONE TOO FAR! TURN BACK!
				if (tone < goal)
				{
					tone = goal;
					return "\n\nYou've lost some tone, but can't lose any more this way. (-" + strength + " muscle tone)";
				}
			}
			//MOAR hulkness
			if (goal > tone && goal > 50)
			{
				tone += strength;
				//YOUVE GONE TOO FAR! TURN BACK!
				if (tone > goal)
				{
					tone = goal;
					return "\n\nYou've gained some muscle tone, but can't gain any more this way. (+" + strength + " muscle tone)";
				}
			}
			//DIsplay BITCH I WORK OUT
			if (goal >= tone && goal > 50)
				return "\n\nYour body feels a little more solid as you move, and your muscles look slightly more visible. (+" + strength + " muscle tone)";
			//Display DERP I HAVE GIRL MUSCLES
			else if (goal <= tone && goal < 50)
				return "\n\nMoving brings with it a little more jiggle than you're used to.  You don't seem to have gained weight, but your muscles look less visible. (-" + strength + " muscle tone)";
			return "";
		}

		//Run this every hour to 'fix' femininity.
		public function fixFemininity():String
		{
			var output:String = "";
			//Genderless/herms share the same bounds
			if (gender == 0 || gender == 3)
			{
				if (femininity < 20)
				{
					output += "\nYour incredibly masculine, chiseled features become a little bit softer from your body's changing hormones.";
					/*if (hasBeard())
					{
						output += "  As if that wasn't bad enough, your " + beard() + " falls out too!";
						beardLength = 0;
						beardStyle = 0;
					}*/
					output += "\n";
					femininity = 20;
				}
				else if (femininity > 85)
				{
					output += "\nYou find your overly feminine face loses a little bit of its former female beauty due to your body's changing hormones.\n";
					femininity = 85;
				}
			}
			//GURLS!
			else if (gender == 2)
			{
				if (femininity < 30)
				{
					output += "\nYour incredibly masculine, chiseled features become a little bit softer from your body's changing hormones.";
					/*if (hasBeard())
					{
						output += "  As if that wasn't bad enough, your " + beard() + " falls out too!";
						beardLength = 0;
						beardStyle = 0;
					}*/
					output += "\n";
					femininity = 30;
				}
			}
			//BOIZ!
			else if (gender == 1)
			{
				if (femininity > 70)
				{
					output += "\nYou find your overly feminine face loses a little bit of its former female beauty due to your body's changing hormones.\n";
					femininity = 70;
				}
				/*if (femininity > 40 && hasBeard())
				{
					output += "\nYour beard falls out, leaving you with " + faceDesc() + ".\n";
					beardLength = 0;
					beardStyle = 0;
				}*/
			}
			/*if (gender != 1 && hasBeard())
			{
				output += "\nYour beard falls out, leaving you with " + faceDesc() + ".\n";
				beardLength = 0;
				beardStyle = 0;
			}*/
			return output;
		}

		public function hasBeard():Boolean
		{
			return beardLength > 0;
		}

		public function beard():String
		{
			if (hasBeard())
				return "beard";
			else
			{
				//CoC_Settings.error("");
				return "ERROR: NO BEARD! YOU ARE NOT A VIKING AND SHOULD TELL KITTEH IMMEDIATELY.";
			}
		}

		public function skin(noAdj:Boolean = false, noTone:Boolean = false):String
		{
			var skinzilla:String = "";
			//Only show stuff other than skinDesc if justSkin is false
			if (!noAdj)
			{
				//Adjectives first!
				if (skinAdj != "" && !noTone && skinTone != "rough gray")
				{
					skinzilla += skinAdj;
					if (noTone)
						skinzilla += " ";
					else
						skinzilla += ", ";
				}
			}
			if (!noTone)
				skinzilla += skinTone + " ";
			//Fur handled a little differently since it uses
			//haircolor
			if (skinType == 1)
				skinzilla += "skin";
			else
				skinzilla += skinDesc;
			return skinzilla;
		}

		public function hasMuzzle():Boolean
		{
			if (faceType == FACE_HORSE || faceType == FACE_DOG || faceType == FACE_CAT || faceType == FACE_LIZARD || faceType == FACE_KANGAROO || faceType == FACE_FOX || faceType == FACE_DRAGON || faceType == FACE_RHINO || faceType == FACE_ECHIDNA || faceType == FACE_DEER)
				return true;
			return false;
		}

		public function face():String
		{
			var stringo:String = "";
			//0 - human
			//5 - Human w/Naga fangz
			//8 - bunnah faceahhh bunbun
			//10 - spidah-face (humanish)
			if (faceType == 0)
				return "face";
			//1 - horse
			//2 - dogface
			//6 - kittah face
			//7 - lizard face (durned argonians!)
			//9 - kangaface
			if (hasMuzzle())
			{
				if (int(Math.random() * 3) == 0 && faceType == FACE_HORSE)
					stringo = "long ";
				if (int(Math.random() * 3) == 0 && faceType == FACE_CAT)
					stringo = "feline ";
				if (int(Math.random() * 3) == 0 && faceType == FACE_RHINO)
					stringo = "rhino ";
				if (int(Math.random() * 3) == 0 && (faceType == FACE_LIZARD || faceType == FACE_DRAGON))
					stringo = "reptilian ";
				switch(rand(3)) {
					case 0:
						return stringo + "muzzle";
					case 1:
						return stringo + "snout";
					case 2:
						return stringo + "face";
					default:
						return stringo + "face";
				}
			}
			//3 - cowface
			if (faceType == FACE_COW_MINOTAUR)
			{
				if (Math.floor(Math.random() * 4) == 0)
					stringo = "bovine ";
				if (int(Math.random() * 2) == 0)
					return "muzzle";
				return stringo + "face";
			}
			//4 - sharkface-teeth
			if (faceType == FACE_SHARK_TEETH)
			{
				if (Math.floor(Math.random() * 4) == 0)
					stringo = "angular ";
				return stringo + "face";
			}
			if (faceType == FACE_PIG || faceType == FACE_BOAR)
			{
				if (Math.floor(Math.random() * 4) == 0)
					stringo = (faceType == FACE_PIG ? "pig" : "boar") + "-like ";
				if (Math.floor(Math.random() * 4) == 0)
					return stringo + "snout";
				return stringo + "face";
			}
			return "face";
		}

		public function hasLongTail():Boolean
		{
			//7 - shark tail!
			//8 - catTAIIIIIL
			//9 - lizard tail
			//10 - bunbuntail
			//11 - harpybutt
			//12 - rootail
			//13 - foxtail
			//14 - dagron tail
			if (isNaga())
				return true;
			if (tailType == 2 || tailType == 3 || tailType == 4 || tailType == 7 || tailType == 8 || tailType == 9 || tailType == 12 || tailType == 13 || tailType == 14 || tailType == 15 || tailType == 16 || tailType == 17 || tailType == 18 || tailType == 20)
				return true;
			return false;
		}

		public function isPregnant():Boolean { return _pregnancyType != 0; }

		public function isButtPregnant():Boolean { return _buttPregnancyType != 0; }

		//fertility must be >= random(0-beat)
		//If arg == 1 then override any contraceptives and guarantee fertilization
		public function knockUp(type:int = 0, incubation:int = 0, beat:int = 100, arg:int = 0):void
		{
			//Contraceptives cancel!
			if (findStatusEffect(StatusEffects.Contraceptives) >= 0 && arg < 1)
				return;
//			if (findStatusEffect(StatusEffects.GooStuffed) >= 0) return; //No longer needed thanks to PREGNANCY_GOO_STUFFED being used as a blocking value
			var bonus:int = 0;
			//If arg = 1 (always pregnant), bonus = 9000
			if (arg >= 1)
				bonus = 9000;
			if (arg <= -1)
				bonus = -9000;
			//If unpregnant and fertility wins out:
			if (pregnancyIncubation == 0 && totalFertility() + bonus > Math.floor(Math.random() * beat) && hasVagina())
			{
				knockUpForce(type, incubation);
				trace("PC Knocked up with pregnancy type: " + type + " for " + incubation + " incubation.");
			}
			//Chance for eggs fertilization - ovi elixir and imps excluded!
			if (type != PregnancyStore.PREGNANCY_IMP && type != PregnancyStore.PREGNANCY_OVIELIXIR_EGGS && type != PregnancyStore.PREGNANCY_ANEMONE)
			{
				if (findPerk(PerkLib.SpiderOvipositor) >= 0 || findPerk(PerkLib.BeeOvipositor) >= 0)
				{
					if (totalFertility() + bonus > Math.floor(Math.random() * beat))
					{
						fertilizeEggs();
					}
				}
			}
		}

		//The more complex knockUp function used by the player is defined above
		//The player doesn't need to be told of the last event triggered, so the code here is quite a bit simpler than that in PregnancyStore
		public function knockUpForce(type:int = 0, incubation:int = 0):void
		{
			_pregnancyType = type;
			_pregnancyIncubation = (type == 0 ? 0 : incubation); //Won't allow incubation time without pregnancy type
		}

		//fertility must be >= random(0-beat)
		public function buttKnockUp(type:int = 0, incubation:int = 0, beat:int = 100, arg:int = 0):void
		{
			//Contraceptives cancel!
			if (findStatusEffect(StatusEffects.Contraceptives) >= 0 && arg < 1)
				return;
			var bonus:int = 0;
			//If arg = 1 (always pregnant), bonus = 9000
			if (arg >= 1)
				bonus = 9000;
			if (arg <= -1)
				bonus = -9000;
			//If unpregnant and fertility wins out:
			if (buttPregnancyIncubation == 0 && totalFertility() + bonus > Math.floor(Math.random() * beat))
			{
				buttKnockUpForce(type, incubation);
				trace("PC Butt Knocked up with pregnancy type: " + type + " for " + incubation + " incubation.");
			}
		}

		//The more complex buttKnockUp function used by the player is defined in Character.as
		public function buttKnockUpForce(type:int = 0, incubation:int = 0):void
		{
			_buttPregnancyType = type;
			_buttPregnancyIncubation = (type == 0 ? 0 : incubation); //Won't allow incubation time without pregnancy type
		}

		public function pregnancyAdvance():Boolean {
			if (_pregnancyIncubation > 0) _pregnancyIncubation--;
			if (_pregnancyIncubation < 0) _pregnancyIncubation = 0;
			if (_buttPregnancyIncubation > 0) _buttPregnancyIncubation--;
			if (_buttPregnancyIncubation < 0) _buttPregnancyIncubation = 0;
			return pregnancyUpdate();
		}

		public function pregnancyUpdate():Boolean { return false; }

		//Create a keyItem
		public function createKeyItem(keyName:String, value1:Number, value2:Number, value3:Number, value4:Number):void
		{
			var newKeyItem:KeyItemClass = new KeyItemClass();
			//used to denote that the array has already had its new spot pushed on.
			var arrayed:Boolean = false;
			//used to store where the array goes
			var keySlot:Number = 0;
			var counter:Number = 0;
			//Start the array if its the first bit
			if (keyItems.length == 0)
			{
				//trace("New Key Item Started Array! " + keyName);
				keyItems.push(newKeyItem);
				arrayed = true;
				keySlot = 0;
			}
			//If it belongs at the end, push it on
			if (keyItems[keyItems.length - 1].keyName < keyName && !arrayed)
			{
				//trace("New Key Item Belongs at the end!! " + keyName);
				keyItems.push(newKeyItem);
				arrayed = true;
				keySlot = keyItems.length - 1;
			}
			//If it belongs in the beginning, splice it in
			if (keyItems[0].keyName > keyName && !arrayed)
			{
				//trace("New Key Item Belongs at the beginning! " + keyName);
				keyItems.splice(0, 0, newKeyItem);
				arrayed = true;
				keySlot = 0;
			}
			//Find the spot it needs to go in and splice it in.
			if (!arrayed)
			{
				//trace("New Key Item using alphabetizer! " + keyName);
				counter = keyItems.length;
				while (counter > 0 && !arrayed)
				{
					counter--;
					//If the current slot is later than new key
					if (keyItems[counter].keyName > keyName)
					{
						//If the earlier slot is earlier than new key && a real spot
						if (counter - 1 >= 0)
						{
							//If the earlier slot is earlier slot in!
							if (keyItems[counter - 1].keyName <= keyName)
							{
								arrayed = true;
								keyItems.splice(counter, 0, newKeyItem);
								keySlot = counter;
							}
						}
						//If the item after 0 slot is later put here!
						else
						{
							//If the next slot is later we are go
							if (keyItems[counter].keyName <= keyName)
							{
								arrayed = true;
								keyItems.splice(counter, 0, newKeyItem);
								keySlot = counter;
							}
						}
					}
				}
			}
			//Fallback
			if (!arrayed)
			{
				//trace("New Key Item Belongs at the end!! " + keyName);
				keyItems.push(newKeyItem);
				keySlot = keyItems.length - 1;
			}

			keyItems[keySlot].keyName = keyName;
			keyItems[keySlot].value1 = value1;
			keyItems[keySlot].value2 = value2;
			keyItems[keySlot].value3 = value3;
			keyItems[keySlot].value4 = value4;
			//trace("NEW KEYITEM FOR PLAYER in slot " + keySlot + ": " + keyItems[keySlot].keyName);
		}

		//Remove a key item
		public function removeKeyItem(itemName:String):void
		{
			var counter:Number = keyItems.length;
			//Various Errors preventing action
			if (keyItems.length <= 0)
			{
				//trace("ERROR: KeyItem could not be removed because player has no key items.");
				return;
			}
			while (counter > 0)
			{
				counter--;
				if (keyItems[counter].keyName == itemName)
				{
					keyItems.splice(counter, 1);
					trace("Attempted to remove \"" + itemName + "\" keyItem.");
					counter = 0;
				}
			}
		}

		public function addKeyValue(statusName:String, statusValueNum:Number = 1, newNum:Number = 0):void
		{
			var counter:Number = keyItems.length;
			//Various Errors preventing action
			if (keyItems.length <= 0)
			{
				return;
					//trace("ERROR: Looking for keyitem '" + statusName + "' to change value " + statusValueNum + ", and player has no key items.");
			}
			while (counter > 0)
			{
				counter--;
				//Find it, change it, quit out
				if (keyItems[counter].keyName == statusName)
				{
					if (statusValueNum < 1 || statusValueNum > 4)
					{
						//trace("ERROR: AddKeyValue called with invalid key value number.");
						return;
					}
					if (statusValueNum == 1)
						keyItems[counter].value1 += newNum;
					if (statusValueNum == 2)
						keyItems[counter].value2 += newNum;
					if (statusValueNum == 3)
						keyItems[counter].value3 += newNum;
					if (statusValueNum == 4)
						keyItems[counter].value4 += newNum;
					return;
				}
			}
			//trace("ERROR: Looking for keyitem '" + statusName + "' to change value " + statusValueNum + ", and player does not have the key item.");
		}

		public function keyItemv1(statusName:String):Number
		{
			var counter:Number = keyItems.length;
			//Various Errors preventing action
			if (keyItems.length <= 0)
			{
				return 0;
					//trace("ERROR: Looking for keyItem '" + statusName + "', and player has no key items.");
			}
			while (counter > 0)
			{
				counter--;
				if (keyItems[counter].keyName == statusName)
					return keyItems[counter].value1;
			}
			//trace("ERROR: Looking for key item '" + statusName + "', but player does not have it.");
			return 0;
		}

		public function keyItemv2(statusName:String):Number
		{
			var counter:Number = keyItems.length;
			//Various Errors preventing action
			if (keyItems.length <= 0)
			{
				return 0;
					//trace("ERROR: Looking for keyItem '" + statusName + "', and player has no key items.");
			}
			while (counter > 0)
			{
				counter--;
				if (keyItems[counter].keyName == statusName)
					return keyItems[counter].value2;
			}
			//trace("ERROR: Looking for key item '" + statusName + "', but player does not have it.");
			return 0;
		}

		public function keyItemv3(statusName:String):Number
		{
			var counter:Number = keyItems.length;
			//Various Errors preventing action
			if (keyItems.length <= 0)
			{
				return 0;
					//trace("ERROR: Looking for keyItem '" + statusName + "', and player has no key items.");
			}
			while (counter > 0)
			{
				counter--;
				if (keyItems[counter].keyName == statusName)
					return keyItems[counter].value3;
			}
			//trace("ERROR: Looking for key item '" + statusName + "', but player does not have it.");
			return 0;
		}

		public function keyItemv4(statusName:String):Number
		{
			var counter:Number = keyItems.length;
			//Various Errors preventing action
			if (keyItems.length <= 0)
			{
				return 0;
					//trace("ERROR: Looking for keyItem '" + statusName + "', and player has no key items.");
			}
			while (counter > 0)
			{
				counter--;
				if (keyItems[counter].keyName == statusName)
					return keyItems[counter].value4;
			}
			//trace("ERROR: Looking for key item '" + statusName + "', but player does not have it.");
			return 0;
		}

		public function removeKeyItems():void
		{
			var counter:Number = keyItems.length;
			while (counter > 0)
			{
				counter--;
				keyItems.splice(counter, 1);
			}
		}

		public function hasKeyItem(keyName:String):Number
		{
			var counter:Number = keyItems.length;
			//Various Errors preventing action
			if (keyItems.length <= 0)
				return -2;
			while (counter > 0)
			{
				counter--;
				if (keyItems[counter].keyName == keyName)
					return counter;
			}
			return -1;
		}

		//Grow

		//BreastCup

		/*OLD AND UNUSED
		   public function breastCupS(rowNum:Number):String {
		   if (breastRows[rowNum].breastRating < 1) return "tiny";
		   else if (breastRows[rowNum].breastRating < 2) return "A";
		   else if (breastRows[rowNum].breastRating < 3) return "B";
		   else if (breastRows[rowNum].breastRating < 4) return "C";
		   else if (breastRows[rowNum].breastRating < 5) return "D";
		   else if (breastRows[rowNum].breastRating < 6) return "DD";
		   else if (breastRows[rowNum].breastRating < 7) return "E";
		   else if (breastRows[rowNum].breastRating < 8) return "F";
		   else if (breastRows[rowNum].breastRating < 9) return "G";
		   else if (breastRows[rowNum].breastRating < 10) return "GG";
		   else if (breastRows[rowNum].breastRating < 11) return "H";
		   else if (breastRows[rowNum].breastRating < 12) return "HH";
		   else if (breastRows[rowNum].breastRating < 13) return "HHH";
		   return "massive custom-made";
		 }*/
		public function viridianChange():Boolean
		{
			var count:int = cockTotal();
			if (count == 0)
				return false;
			while (count > 0)
			{
				count--;
				if (cocks[count].sock == "amaranthine" && cocks[count].cockType != CockTypesEnum.DISPLACER)
					return true;
			}
			return false;
		}

		public function hasKnot(arg:int = 0):Boolean
		{
			if (arg > cockTotal() - 1 || arg < 0)
				return false;
			return cocks[arg].hasKnot();
		}

		public function maxHP():Number
		{
			var max:Number = 0;
			max += int(tou * 2 + 50);
			if (findPerk(PerkLib.Tank) >= 0) max += 50;
			if (findPerk(PerkLib.Tank2) >= 0) max += Math.round(tou);
			if (findPerk(PerkLib.ChiReflowDefense) >= 0) max += UmasShop.NEEDLEWORK_DEFENSE_EXTRA_HP;
			if (flags[kFLAGS.KAIZO_MODE] >= 1)
				max += level * 5;
			else
				max += level * 15;
			if (jewelryEffectId == JewelryLib.MODIFIER_HP) max += jewelryEffectMagnitude;
			max *= 1 + (countCockSocks("green") * 0.02);
			max = Math.round(max);
			if (max > 9999) max = 9999;
			return max;
		}

		public function maxLust():Number
		{
			var max:Number = 100;
			if (game.player.demonScore() >= 4) max += 20;
			if (findPerk(PerkLib.ImprovedSelfControl) >= 0) max += 20;
			if (findPerk(PerkLib.BroBody) >= 0 || findPerk(PerkLib.BimboBody) >= 0 || findPerk(PerkLib.FutaForm) >= 0) max += 20;
			if (findPerk(PerkLib.OmnibusGift) >= 0) max += 15;
			if (findPerk(PerkLib.AscensionDesires) >= 0) max += perkv1(PerkLib.AscensionDesires) * 5;
			if (max > 999) max = 999;
			return max;
		}

		public function maxFatigue():Number
		{
			var max:Number = 100;
			if (findPerk(PerkLib.ImprovedEndurance) >= 0) max += 20;
			if (findPerk(PerkLib.AscensionEndurance) >= 0) max += perkv1(PerkLib.AscensionEndurance) * 5;
			if (max > 999) max = 999;
			return max;
		}

		public function growHair(amount:Number = .1):Boolean {
			//Grow hair!
			var tempHair:Number = hairLength;
			if (hairType == HAIR_BASILISK_SPINES) return false;
			hairLength += amount;
			if (hairType == HAIR_BASILISK_PLUME && hairLength > 8) hairLength = 8;
			if (hairLength > 0 && tempHair == 0) {
				game.outputText("\nYou are no longer bald.  You now have " + hairDescript() + " coating your head.\n", false);
				return true;
			}
			else if (hairLength >= 1 && tempHair < 1) {
				game.outputText("\nYour hair's growth has reached a new threshhold, giving you " + hairDescript() + ".\n", false);
				return true;
			}
			else if (hairLength >= 3 && tempHair < 3) {
				game.outputText("\nYour hair's growth has reached a new threshhold, giving you " + hairDescript() + ".\n", false);
				return true;
			}
			else if (hairLength >= 6 && tempHair < 6) {
				game.outputText("\nYour hair's growth has reached a new threshhold, giving you " + hairDescript() + ".\n", false);
				return true;
			}
			else if (hairLength >= 10 && tempHair < 10) {
				game.outputText("\nYour hair's growth has reached a new threshhold, giving you " + hairDescript() + ".\n", false);
				return true;
			}
			else if (hairLength >= 16 && tempHair < 16) {
				game.outputText("\nYour hair's growth has reached a new threshhold, giving you " + hairDescript() + ".\n", false);
				return true;
			}
			else if (hairLength >= 26 && tempHair < 26) {
				game.outputText("\nYour hair's growth has reached a new threshhold, giving you " + hairDescript() + ".\n", false);
				return true;
			}
			else if (hairLength >= 40 && tempHair < 40) {
				game.outputText("\nYour hair's growth has reached a new threshhold, giving you " + hairDescript() + ".\n", false);
				return true;
			}
			else if (hairLength >= 40 && hairLength >= tallness && tempHair < tallness) {
				game.outputText("\nYour hair's growth has reached a new threshhold, giving you " + hairDescript() + ".\n", false);
				return true;
			}
			return false;
		}

		public function growBeard(amount:Number = .1):Boolean {
			//Grow beard!
			var tempBeard:Number = beardLength;
			beardLength += amount;
			if (beardLength > 0 && tempBeard == 0) {
				game.outputText("\nYou feel a tingling in your cheeks and chin.  You now have " + beardDescript() + " coating your cheeks and chin.\n", false);
				return true;
			}
			else if (beardLength >= 0.2 && tempBeard < 0.2) {
				game.outputText("\nYour beard's growth has reached a new threshhold, giving you " + beardDescript() + ".\n", false);
				return true;
			}
			else if (beardLength >= 0.5 && tempBeard < 0.5) {
				game.outputText("\nYour beard's growth has reached a new threshhold, giving you " + beardDescript() + ".\n", false);
				return true;
			}
			else if (beardLength >= 1.5 && tempBeard < 1.5) {
				game.outputText("\nYour beard's growth has reached a new threshhold, giving you " + beardDescript() + ".\n", false);
				return true;
			}
			else if (beardLength >= 3 && tempBeard < 3) {
				game.outputText("\nYour beard's growth has reached a new threshhold, giving you " + beardDescript() + ".\n", false);
				return true;
			}
			else if (beardLength >= 6 && tempBeard < 6) {
				game.outputText("\nYour beard's growth has reached a new threshhold, giving you " + beardDescript() + ".\n", false);
				return true;
			}

			return false;
		}

		public function hairOrFur():String
		{
			return Appearance.hairOrFur(this);
		}

		public function hairDescript():String
		{
			return Appearance.hairDescription(this);
		}

		public function beardDescript():String
		{
			return Appearance.beardDescription(this);
		}

		public function hipDescript():String
		{
			return Appearance.hipDescription(this);
		}

		public function assDescript():String
		{
			return buttDescript();
		}

		public function buttDescript():String
		{
			return Appearance.buttDescription(this);
		}

		public function tongueDescript():String
		{
			return Appearance.tongueDescription(this);
		}

		public function hornDescript():String
		{
			return Appearance.DEFAULT_HORNS_NAMES[hornType] + " horns";
		}

		public function tailDescript():String
		{
			return Appearance.tailDescript(this);
		}

		public function oneTailDescript():String
		{
			return Appearance.oneTailDescript(this);
		}

		public function wingsDescript():String
		{
			return Appearance.wingsDescript(this);
		}

		public function eyesDescript():String
		{
			return Appearance.eyesDescript(this);
		}
	}

}

license: unknown


code:
/*
 CoC Main File - This is what loads when the game begins. If you want to start understanding the structure of CoC,
 this is the place to start.
 First, we import all the classes from many different files across the codebase. It would be wise not to alter the
 order of these imports until more is known about what needs to load and when.
*/

package classes
{
	// BREAKING ALL THE RULES.
	import classes.GlobalFlags.kFLAGS; // This file contains most of the persistent gamestate flags.
	import classes.GlobalFlags.kGAMECLASS; // This file creates the gameclass that the game will run within.
	import classes.GlobalFlags.kACHIEVEMENTS; // This file creates the flags for the achievements system.
	import classes.Scenes.Combat.Combat;
	import classes.Scenes.Dungeons.DungeonCore; // This file creates all the dungeons, their rooms, and their completion states except for D3. This also includes cabin code. See file for more details.
	import classes.Scenes.Dungeons.D3.D3; // Likely due to D3's complexity, that dungeon is split out separately.
	import classes.Scenes.Seasonal.AprilFools;
	import classes.Scenes.Seasonal.Fera;
	import classes.Scenes.Seasonal.Thanksgiving;
	import classes.Scenes.Seasonal.Valentines;
	import classes.Scenes.Seasonal.XmasBase;

	import classes.CoC_Settings; // This file creates basic variables for CoC itself (debug flags, buffers, button manipulation)

/*
One very important thing to know about descriptions in this game is that many words are based on hidden integer values.
These integers are compared to tables or queried directly to get the words used for particular parts of descriptions. For instance,
AssClass below has variables for wetness, looseness, fullness, and virginity. You'll often find little tables like this
scattered through the code:
butt looseness
		0 - virgin
		1 - normal
		2 - loose
		3 - very loose
		4 - gaping
		5 - monstrous
Tracking down a full list of description variables, how their integer values translate to descriptions, and how to call them
would be a very useful task for anyone who wants to extend content using variables.
Further complicating this is that the code will also sometimes have a randomized list of words for certain things just to keep
the text from being too boring.
*/

	import classes.AssClass; // Creates the class that holds ass-related variables as described above.
	import classes.BreastRowClass; // Creates the class that holds breast-related variables.
	import classes.Items.*; // This pulls in all the files in the Items folder. Basically any inventory item in the game
	import classes.PerkLib; // This instantiates the IDs, names, and descriptions of perks. Does NOT have any code related to the actual perk! Use the ID field to search the code base for that.

	import classes.Player; // Creates a player with all that entails. See file for more info. Also see Creature.as.
	import classes.Cock; // Creates the class that holds cock-related variables. Also has several functions for growing and shrinking cocks.
	import classes.Creature; // Creates basic information for all characters in CoC. Contains many descriptors.
	import classes.ItemSlotClass; // Creates item slots
	import classes.PerkClass; // The function in this file pulls perk information from PerkLib for later querying
	import classes.StatusEffectClass; // Similar to PerkClass, but for status effects in combat.
	import classes.VaginaClass; // Creates vaginas
	import classes.ImageManager; // Image voodoo for sprites
	import classes.internals.Utils; // This file contains much voodoo for randomizing item arrays and other useful functions.

	// This line not necessary, but added because I'm pedantic like that.
	import classes.InputManager;

	import classes.Parser.Parser; // Much text voodoo for how to make all the description/pronoun/etc replacement work.

// All the files below with Scenes loads the main content for the game.

	import classes.Scenes.*;
	import classes.Scenes.Areas.*;
	import classes.Scenes.Areas.Desert.*
	import classes.Scenes.Areas.Forest.*
	import classes.Scenes.Areas.HighMountains.*
	import classes.Scenes.Areas.Mountain.*
	import classes.Scenes.Areas.Swamp.*
	import classes.Scenes.Dungeons.DeepCave.*;
	import classes.Scenes.Dungeons.DesertCave.*;
	import classes.Scenes.Dungeons.Factory.*;
	import classes.Scenes.Dungeons.HelDungeon.*;
	import classes.Scenes.Explore.*;
	import classes.Scenes.Monsters.*;
	import classes.Scenes.NPCs.*;
	import classes.Scenes.Places.*;
	import classes.Scenes.Places.TelAdre.*;
	import classes.Scenes.Seasonal.*;
	import classes.Scenes.Quests.*;
	import coc.view.MainView; // Creates the framework for the game screen.
	import coc.model.GameModel; // Uncertain.
	import coc.model.TimeModel; // Various time-related functions for setting the game clock and querying its state.

	// Class based content? In my CoC?! It's more likely than you think!
	import classes.content.*;

	// All the imports below are for Flash.
	import fl.controls.ComboBox;
	import fl.data.DataProvider;
	import flash.display.Loader;
	import flash.display.MovieClip;
	import flash.events.*
	import flash.net.FileReference;
	import flash.net.navigateToURL;
	import flash.net.registerClassAlias;
	import flash.net.SharedObject;
	import flash.net.SharedObjectFlushStatus;
	import flash.net.URLLoader;
	import flash.net.URLLoaderDataFormat;
	import flash.net.URLRequest;
	import flash.text.*;
	import flash.utils.ByteArray;
	import flash.system.Capabilities;
	import flash.display.Sprite;

	/****
		classes.CoC: The Document class of Corruption of the Champions.
	****/

	// This class instantiates the game. If you create a new place/location/scene you'll likely have to add it into here.
	// Add in descriptions for the include statements. Many of the description text code is inside of these.
	// Suggest moving or removing old comments referencing things that aren't needed anymore.

	[SWF( width="1000", height="800", pageTitle="Corruption of Champions" )]

	public class CoC extends MovieClip
	{

		// Include the functions. ALL THE FUNCTIONS
//No longer needed. Added into CharCreation.as:		include "../../includes/customCharCreation.as";

//No longer needed:		include "../../includes/descriptors.as";
//No longer needed. Moved to PlayerAppearance.as:		include "../../includes/appearance.as";

//No longer needed:		include "../../includes/InitialiseUI.as";
		include "../../includes/input.as";
		include "../../includes/OnLoadVariables.as";
		include "../../includes/startUp.as";

//No longer needed. Split up into 3 files.		include "../../includes/combat.as";
		include "../../includes/debug.as";
//No longer needed. This file has been chopped up and spread throughout the codebase:		include "../../includes/doEvent.as";
		include "../../includes/eventParser.as";
//Merged into debug.as:		include "../../includes/eventTest.as";
		include "../../includes/engineCore.as";

		// Lots of constants
		include "../../includes/appearanceDefs.as";

		//Any classes that need to be made aware when the game is saved or loaded can add themselves to this array using saveAwareAdd.
		//	Once in the array they will be notified by Saves.as whenever the game needs them to write or read their data to the flags array.
		private static var _saveAwareClassList:Vector.<SaveAwareInterface> = new Vector.<SaveAwareInterface>();

		//Called by the saveGameObject function in Saves
		public static function saveAllAwareClasses(game:CoC):void { for (var sac:int = 0; sac < _saveAwareClassList.length ; sac++) _saveAwareClassList[sac].updateBeforeSave(game); }

		//Called by the loadGameObject function in Saves
		public static function loadAllAwareClasses(game:CoC):void { for (var sac:int = 0; sac < _saveAwareClassList.length ; sac++) _saveAwareClassList[sac].updateAfterLoad(game); }

		public static function saveAwareClassAdd(newEntry:SaveAwareInterface):void { _saveAwareClassList.push(newEntry); }

		//Any classes that need to be aware of the passage of time can add themselves to this array using timeAwareAdd.
		//	Once in the array they will be notified as each hour passes, allowing them to update actions, lactation, pregnancy, etc.
		private static var _timeAwareClassList:Vector.<TimeAwareInterface> = new Vector.<TimeAwareInterface>(); //Accessed by goNext function in eventParser
		private static var timeAwareLargeLastEntry:int = -1; //Used by the eventParser in calling timeAwareLarge
		private var playerEvent:PlayerEvents;

		public static function timeAwareClassAdd(newEntry:TimeAwareInterface):void { _timeAwareClassList.push(newEntry); }

		private static var doCamp:Function; //Set by campInitialize, should only be called by playerMenu
		private static function campInitialize(passDoCamp:Function):void { doCamp = passDoCamp; }

		// /
		private var _perkLib:PerkLib = new PerkLib();// to init the static
		private var _statusEffects:StatusEffects = new StatusEffects();// to init the static
		public var charCreation:CharCreation = new CharCreation();
		public var playerAppearance:PlayerAppearance = new PlayerAppearance();
		public var playerInfo:PlayerInfo = new PlayerInfo();
		public var saves:Saves = new Saves(gameStateDirectGet, gameStateDirectSet);
		// Items/
		public var mutations:Mutations = Mutations.init();
		public var consumables:ConsumableLib = new ConsumableLib();
		public var useables:UseableLib;
		public var weapons:WeaponLib = new WeaponLib();
		public var armors:ArmorLib = new ArmorLib();
		public var undergarments:UndergarmentLib = new UndergarmentLib();
		public var jewelries:JewelryLib = new JewelryLib();
		public var shields:ShieldLib = new ShieldLib();
		public var miscItems:MiscItemLib = new MiscItemLib();
		// Scenes/
		public var camp:Camp = new Camp(campInitialize);
		public var dreams:Dreams = new Dreams();
		public var exploration:Exploration = new Exploration();
		public var followerInteractions:FollowerInteractions = new FollowerInteractions();
		public var inventory:Inventory = new Inventory(saves);
		public var masturbation:Masturbation = new Masturbation();
		public var pregnancyProgress:PregnancyProgression = new PregnancyProgression();
		// Scenes/Areas/
		public var bog:Bog = new Bog();
		public var desert:Desert = new Desert();
		public var forest:Forest = new Forest();
		public var glacialRift:GlacialRift = new GlacialRift();
		public var highMountains:HighMountains = new HighMountains();
		public var lake:Lake = new Lake();
		public var mountain:Mountain = new Mountain();
		public var plains:Plains = new Plains();
		public var swamp:Swamp = new Swamp();
		public var volcanicCrag:VolcanicCrag = new VolcanicCrag();
		// Scenes/Combat/
		public var combat:Combat = new Combat();
		// Scenes/Dungeons
		public var brigidScene:BrigidScene = new BrigidScene();
		public var d3:D3 = new D3();
		// Scenes/Explore/
		public var gargoyle:Gargoyle = new Gargoyle();
		public var lumi:Lumi = new Lumi();
		public var giacomoShop:Giacomo = new Giacomo();
		// Scenes/Monsters/
		public var goblinScene:GoblinScene = new GoblinScene();
		public var goblinAssassinScene:GoblinAssassinScene = new GoblinAssassinScene();
		public var goblinWarriorScene:GoblinWarriorScene = new GoblinWarriorScene();
		public var goblinShamanScene:GoblinShamanScene = new GoblinShamanScene();
		public var goblinElderScene:PriscillaScene = new PriscillaScene();
		public var impScene:ImpScene = new ImpScene();
		public var mimicScene:MimicScene = new MimicScene();
		public var succubusScene:SuccubusScene = new SuccubusScene();
		// Scenes/NPC/
		public var amilyScene:AmilyScene = new AmilyScene();
		public var anemoneScene:AnemoneScene = new AnemoneScene();
		public var arianScene:ArianScene = new ArianScene();
		public var ceraphScene:CeraphScene = new CeraphScene();
		public var ceraphFollowerScene:CeraphFollowerScene = new CeraphFollowerScene();
		public var emberScene:EmberScene = new EmberScene();
		public var exgartuan:Exgartuan = new Exgartuan();
		public var helFollower:HelFollower = new HelFollower();
		public var helScene:HelScene = new HelScene();
		public var helSpawnScene:HelSpawnScene = new HelSpawnScene();
		public var holliScene:HolliScene = new HolliScene();
		public var isabellaScene:IsabellaScene = new IsabellaScene();
		public var isabellaFollowerScene:IsabellaFollowerScene = new IsabellaFollowerScene();
		public var izmaScene:IzmaScene = new IzmaScene();
		public var jojoScene:JojoScene = new JojoScene();
		public var joyScene:JoyScene = new JoyScene();
		public var kihaFollower:KihaFollower = new KihaFollower();
		public var kihaScene:KihaScene = new KihaScene();
		public var latexGirl:LatexGirl = new LatexGirl();
		public var marbleScene:MarbleScene = new MarbleScene();
		public var marblePurification:MarblePurification = new MarblePurification();
		public var milkWaifu:MilkWaifu = new MilkWaifu();
		public var raphael:Raphael = new Raphael();
		public var rathazul:Rathazul = new Rathazul();
		public var sheilaScene:SheilaScene = new SheilaScene();
		public var shouldraFollower:ShouldraFollower = new ShouldraFollower();
		public var shouldraScene:ShouldraScene = new ShouldraScene();
		public var sophieBimbo:SophieBimbo = new SophieBimbo();
		public var sophieFollowerScene:SophieFollowerScene = new SophieFollowerScene();
		public var sophieScene:SophieScene = new SophieScene();
		public var urta:Urta = new Urta();
		public var urtaHeatRut:UrtaHeatRut = new UrtaHeatRut();
		public var urtaPregs:UrtaPregs = new UrtaPregs();
		public var valeria:Valeria = new Valeria();
		public var vapula:Vapula = new Vapula();
		// Scenes/Places/
		public var bazaar:Bazaar = new Bazaar();
		public var boat:Boat = new Boat();
		public var farm:Farm = new Farm();
		public var owca:Owca = new Owca();
		public var telAdre:TelAdre = new TelAdre();
		public var dungeons:DungeonCore = new DungeonCore();
		public var ingnam:Ingnam = new Ingnam();
		public var prison:Prison = new Prison();
		// Scenes/Seasonal/
		public var aprilFools:AprilFools = new AprilFools();
		public var fera:Fera = new Fera();
		public var thanksgiving:Thanksgiving = new Thanksgiving();
		public var valentines:Valentines = new Valentines();
		public var xmas:XmasBase = new XmasBase();
		// Scenes/Quests/
		public var urtaQuest:UrtaQuest = new UrtaQuest();

		public var debugMenu:DebugMenu = new DebugMenu();

		public var crafting:Crafting = new Crafting();

		// Force updates in Pepper Flash ahuehue
		private var _updateHack:Sprite = new Sprite();

		public var mainViewManager:MainViewManager = new MainViewManager();
		//Scenes in includes folder GONE! Huzzah!

		public var bindings:Bindings = new Bindings();
		public var output:Output = Output.init();
		public var measurements:Measurements = Measurements.init();
		public function get currentText():String { return output.currentText; }
		public function set currentText(text:String):void { output.currentText = text; }
		/****
			This is used purely for bodges while we get things cleaned up.
			Hopefully, anything you stick to this object can be removed eventually.
			I only used it because for some reason the Flash compiler wasn't seeing
			certain functions, even though they were in the same scope as the
			function calling them.
		****/

		public var mainView :MainView;

		public var model :GameModel;

		public var parser:Parser;

		// ALL THE VARIABLES:
		// Declare the various global variables as class variables.
		// Note that they're set up in the constructor, not here.
		public var debug:Boolean;
		public var ver:String;
		public var version:String;
		public var versionID:uint = 0;
		public var permObjVersionID:uint = 0;
		public var mobile:Boolean;
		public var images:ImageManager;
		public var player:Player;
		public var player2:Player;
		public var monster:Monster;
		public var flags:DefaultDict;
		public var achievements:DefaultDict;
		private var _gameState:int;
		public function get gameState():int { return _gameState; }
		public var time :TimeModel;

		public var temp:int;
		public var args:Array;
		public var funcs:Array;
		public var oldStats:*; // I *think* this is a generic object
		public var inputManager:InputManager;

		public var kFLAGS_REF:*;
		public var kACHIEVEMENTS_REF:*;

		public var fetishManager:FetishManager = new FetishManager();

		public function get inCombat():Boolean { return _gameState == 1; }

		public function set inCombat(value:Boolean):void { _gameState = (value ? 1 : 0); }

		private function gameStateDirectGet():int { return _gameState; }

		private function gameStateDirectSet(value:int):void { _gameState = value; }

		public function rand(max:int):int
		{
			return Utils.rand(max);
		}

		public function CoC()
		{
			// Cheatmode.
			kGAMECLASS = this;

			useables = new UseableLib();

			this.kFLAGS_REF = kFLAGS;
			this.kACHIEVEMENTS_REF = kACHIEVEMENTS;
			// cheat for the parser to be able to find kFLAGS
			// If you're not the parser, DON'T USE THIS

			this.parser = new Parser(this, CoC_Settings);

			this.model = new GameModel();
			this.mainView = new MainView(/*this.model*/);
			this.mainView.name = "mainView";
			this.stage.addChild( this.mainView );

			// Hooking things to MainView.
			this.mainView.onNewGameClick = charCreation.newGameGo;
			this.mainView.onAppearanceClick = playerAppearance.appearance;
			this.mainView.onDataClick = saves.saveLoad;
			this.mainView.onLevelClick = playerInfo.levelUpGo;
			this.mainView.onPerksClick = playerInfo.displayPerks;
			this.mainView.onStatsClick = playerInfo.displayStats;

			// Set up all the messy global stuff:

			// ******************************************************************************************

			var mainView :MainView = this.mainView;
			var model :GameModel = this.model;

			/**
			 * Global Variables used across the whole game. I hope to whittle it down slowly.
			 */

			/**
			 * System Variables
			 * Debug, Version, etc
			 */
			//{ region SystemVariables

			//DEBUG, used all over the place
			debug = false;
			//model.debug = debug; // TODO: Set on model?

			//Version NUMBER
			ver = "1.0.2_mod_1.4_/hgg/_0.2";
			version = ver + " (<b>Mistakes were made edition (test)</b>)";

			//Indicates if building for mobile?
			mobile = false;
			model.mobile = mobile;

			this.images = new ImageManager(stage);
			this.inputManager = new InputManager(stage, false);
			include "../../includes/ControlBindings.as";

			//} endregion

			/**
			 * Player specific variables
			 * The player object and variables associated with the player
			 */
			//{ region PlayerVariables

			//The Player object, used everywhere
			player = new Player();
			model.player = player;
			player2 = new Player();
			playerEvent = new PlayerEvents();

			//Used in perk selection, mainly eventParser, input and engineCore
			//tempPerk = null;

			//Create monster, used all over the place
			monster = new Monster();
			//} endregion

			/**
			 * State Variables
			 * They hold all the information about item states, menu states, game states, etc
			 */
			//{ region StateVariables

			//User all over the place whenever items come up
//No longer used:			itemSwapping = false;

			//The extreme flag state array. This needs to go. Holds information about everything, whether it be certain attacks for NPCs
			//or state information to do with the game.
			flags = new DefaultDict();
			//model.flags = flags;

			achievements = new DefaultDict();
			//model.achievements = achievements;

			///Used everywhere to establish what the current game state is
			// Key system variables
			//0 = normal
			//1 = in combat
			//2 = in combat in grapple
			//3 = at start or game over screen
			_gameState = 0;

			/**
			 * Display Variables
			 * Variables that hold display information like number of days and all the current displayed text
			 */
			//{ region DisplayVariables

			//Holds the date and time display in the bottom left
			time = new TimeModel();
			model.time = time;

			//The string holds all the "story" text, mainly used in engineCore
			currentText = "";
			//}endregion

			/**
			 * Item variables
			 * Holds all the information about items in your inventory and stashes away
			 */
			//{region ItemVariables

			/**
			 * Plot Variables
			 * Booleans and numbers about whether you've found certain places
			 */
			//{ region PlotVariables

			//Plot variables

//			itemStorage = [];
//			gearStorage = [];
			//}endregion

			// These are toggled between by the [home] key.
			mainView.textBGWhite.visible = false;
			mainView.textBGTan.visible = false;

			// *************************************************************************************

			// import flash.events.MouseEvent;

			//const DOUBLE_ATTACK_STYLE:int = 867;
			//const SPELLS_CAST:int = 868;

			//Fenoxo loves his temps
			temp = 0;

			//Used to set what each action buttons displays and does.
			args = [];
			funcs = [];

			//Used for stat tracking to keep up/down arrows correct.
			oldStats = {};
			model.oldStats = oldStats;
			oldStats.oldStr  = 0;
			oldStats.oldTou  = 0;
			oldStats.oldSpe  = 0;
			oldStats.oldInte = 0;
			oldStats.oldSens = 0;
			oldStats.oldLib  = 0;
			oldStats.oldCor  = 0;
			oldStats.oldHP   = 0;
			oldStats.oldLust = 0;
			oldStats.oldFatigue = 0;
			oldStats.oldHunger = 0;

			//model.maxHP = maxHP;

			// ******************************************************************************************

			mainView.aCb.dataProvider = new DataProvider([{label:"TEMP",perk:new PerkClass(PerkLib.Acclimation)}]);
			mainView.aCb.addEventListener(Event.CHANGE, playerInfo.changeHandler);

			//mainView._getButtonToolTipText = getButtonToolTipText;

			//Register the classes we need to be able to serialize and reconstitute so
			// they'll get reconstituted into the correct class when deserialized
			registerClassAlias("AssClass", AssClass);
			registerClassAlias("Character", Character);
			registerClassAlias("Cock", Cock);
			registerClassAlias("CockTypesEnum", CockTypesEnum);
			registerClassAlias("Enum", Enum);
			registerClassAlias("Creature", Creature);
			registerClassAlias("ItemSlotClass", ItemSlotClass);
			registerClassAlias("KeyItemClass", KeyItemClass);
			registerClassAlias("Monster", Monster);
			registerClassAlias("Player", Player);
			registerClassAlias("StatusEffectClass", StatusEffectClass);
			registerClassAlias("VaginaClass", VaginaClass);
			//registerClassAlias("Enum", Enum);

			//Hide sprites
			mainView.hideSprite();
			//Hide up/down arrows
			mainView.statsView.hideUpDown();

			this.addFrameScript( 0, this.run );
		}

		public function run():void
		{
			mainMenu();
			this.stop();

			_updateHack.name = "wtf";
			_updateHack.graphics.beginFill(0xFF0000, 1);
			_updateHack.graphics.drawRect(0, 0, 2, 2);
			_updateHack.graphics.endFill();

			stage.addChild(_updateHack);
			_updateHack.x = 999;
			_updateHack.y = 799;
		}

		public function forceUpdate():void
		{
			_updateHack.x = 999;
			_updateHack.addEventListener(Event.ENTER_FRAME, moveHackUpdate);
		}

		public function moveHackUpdate(e:Event):void
		{
			_updateHack.x -= 84;

			if (_updateHack.x < 0)
			{
				_updateHack.x = 0;
				_updateHack.removeEventListener(Event.ENTER_FRAME, moveHackUpdate);
			}
		}
	}
}


code:
package classes
{
	/**
	 * ...
	 * @author Fake-Name
	 */
	public class CoC_Settings
	{

		public static var debugBuild:Boolean = true;

		// Horrible static abuse FTW
		public static var haltOnErrors:Boolean = false;
		public static var buttonEvents:Array = [];
		private static const bufferSize:int = 50;

		/**
		 * trace("ERROR "+description);
		 * If haltOnErrors=true, throws Error
		 */
		public static function error(description:String=""):void {
			trace("ERROR "+description);
			if (haltOnErrors) throw Error(description);
		}

		/**
		 * trace("ERROR Abstract method call: "+clazz+"."+method+"(). "+description);
		 * If haltOnErrors=true, throws Error
		 */
		public static function errorAMC(clazz:String,method:String,description:String=""):void{
			error("Abstract method call: "+clazz+"."+method+"(). "+description);
		}

		public static function appendButtonEvent(inString:String):void
		{

			CoC_Settings.buttonEvents.unshift(inString);  // Push the new item onto the head of the array

			if (CoC_Settings.buttonEvents.length > CoC_Settings.bufferSize)  // if the array has become too long, pop the last item
			{
				CoC_Settings.buttonEvents.pop();
			}
		}
		public static function getButtonEvents():String
		{
			var retStr:String = "";
			for (var x:String in CoC_Settings.buttonEvents)
			{
				retStr += CoC_Settings.buttonEvents[x] + "\n";
				trace("x = ", x, "Array Val = ", CoC_Settings.buttonEvents[x]);
			}
			return retStr;
		}

		public function CoC_Settings()
		{

		}

	}

}


code:
package classes
{
	import classes.CockTypesEnum;
	import classes.internals.Utils;

	public class Cock
	{
		private var _cockLength:Number;
		private var _cockThickness:Number;
		private var _cockType:CockTypesEnum;	//See CockTypesEnum.as for all cock types

		//Used to determine thickness of knot relative to normal thickness
		private var _knotMultiplier:Number;

		//Piercing info
		private var _isPierced:Boolean;
		private var _pierced:Number;
		//Not yet, sweet prince. PiercedType current has no uses. But it will, one day.
		// private var _pierceType:PiercingTypesEnum;
		private var _pShortDesc:String;
		private var _pLongDesc:String;

		//Sock
		private var _sock:String;

		/**
		 * @return string description of errors
		 */
		public function validate():String {
			var error:String = "";
			error += Utils.validateNonNegativeNumberFields(this,"Cock.validate",["cockLength","cockThickness","knotMultiplier","pierced"]);
			if (!_isPierced){
				if (_pShortDesc.length>0) error += "Not pierced but _pShortDesc = "+_pShortDesc+". ";
				if (_pLongDesc.length>0) error += "Not pierced but pLong = "+_pLongDesc+". ";
			} else {
				if (_pShortDesc.length==0) error += "Pierced but no _pShortDesc. ";
				if (_pLongDesc.length==0) error += "Pierced but no pLong. ";
			}
			return error;
		}

		//constructor. Default type is HUMAN
		public function Cock(i_cockLength:Number = 5.5, i_cockThickness:Number = 1, i_cockType:CockTypesEnum=null)
		{
			if (i_cockType == null) i_cockType = CockTypesEnum.HUMAN;
			_cockLength = i_cockLength;
			_cockThickness = i_cockThickness;
			_cockType = i_cockType;
			_pierced = 0;
			_knotMultiplier = 1;
			_isPierced = false;
			//_pierceType = PiercingTypesEnum.NONE;
			_pShortDesc = "";
			_pLongDesc = "";
			_sock = "";
		}

		//MEMBER FUNCTIONS
		public function cArea():Number
		{
			return cockThickness * cockLength;
		}

		public function growCock(lengthDelta:Number, bigCock:Boolean):Number
		{

			if (lengthDelta == 0) {
				trace("Whoops! growCock called with 0, aborting...");
				return lengthDelta;
			}

			var threshhold:int = 0;

			trace("growcock starting at:" +lengthDelta);

			if (lengthDelta > 0) { // growing
				trace("and growing...");
				threshhold = 24;
				// BigCock Perk increases incoming change by 50% and adds 12 to the length before diminishing returns set in
				if (bigCock) {
					trace("growCock found BigCock Perk");
					lengthDelta *= 1.5;
					threshhold += 12;
				}
				// Not a human cock? Multiple the length before dimishing returns set in by 3
				if (cockType != CockTypesEnum.HUMAN)
					threshhold *= 2;
				// Modify growth for cock socks
				if (sock == "scarlet") {
					trace("growCock found Scarlet sock");
					lengthDelta *= 1.5;
				}
				else if (sock == "cobalt") {
					trace("growCock found Cobalt sock");
					lengthDelta *= .5;
				}
				// Do diminishing returns
				if (cockLength > threshhold)
					lengthDelta /= 4;
				else if (cockLength > threshhold / 2)
					lengthDelta /= 2;
			}
			else {
				trace("and shrinking...");

				threshhold = 0;
				// BigCock Perk doubles the incoming change value and adds 12 to the length before diminishing returns set in
				if (bigCock) {
					trace("growCock found BigCock Perk");
					lengthDelta *= 0.5;
					threshhold += 12;
				}
				// Not a human cock? Add 12 to the length before dimishing returns set in
				if (cockType != CockTypesEnum.HUMAN)
					threshhold += 12;
				// Modify growth for cock socks
				if (sock == "scarlet") {
					trace("growCock found Scarlet sock");
					lengthDelta *= 0.5;
				}
				else if (sock == "cobalt") {
					trace("growCock found Cobalt sock");
					lengthDelta *= 1.5;
				}
				// Do diminishing returns
				if (cockLength > threshhold)
					lengthDelta /= 3;
				else if (cockLength > threshhold / 2)
					lengthDelta /= 2;
			}

			trace("then changing by: " + lengthDelta);

			cockLength += lengthDelta;

			if (cockLength < 1)
				cockLength = 1;

			if (cockThickness > cockLength * .33)
				cockThickness = cockLength * .33;

			return lengthDelta;
		}

		public function thickenCock(increase:Number):Number
		{
			var amountGrown:Number = 0;
			var temp:Number = 0;
			if (increase > 0)
			{
				while (increase > 0)
				{
					if (increase < 1)
						temp = increase;
					else
						temp = 1;
					//Cut thickness growth for huge dicked
					if (cockThickness > 1 && cockLength < 12)
					{
						temp /= 4;
					}
					if (cockThickness > 1.5 && cockLength < 18)
						temp /= 5;
					if (cockThickness > 2 && cockLength < 24)
						temp /= 5;
					if (cockThickness > 3 && cockLength < 30)
						temp /= 5;
					//proportional thickness diminishing returns.
					if (cockThickness > cockLength * .15)
						temp /= 3;
					if (cockThickness > cockLength * .20)
						temp /= 3;
					if (cockThickness > cockLength * .30)
						temp /= 5;
					//massive thickness limiters
					if (cockThickness > 4)
						temp /= 2;
					if (cockThickness > 5)
						temp /= 2;
					if (cockThickness > 6)
						temp /= 2;
					if (cockThickness > 7)
						temp /= 2;
					//Start adding up bonus length
					amountGrown += temp;
					cockThickness += temp;
					temp = 0;
					increase--;
				}
				increase = 0;
			}
			else if (increase < 0)
			{
				while (increase < 0)
				{
					temp = -1;
					//Cut length growth for huge dicked
					if (cockThickness <= 1)
						temp /= 2;
					if (cockThickness < 2 && cockLength < 10)
						temp /= 2;
					//Cut again for massively dicked
					if (cockThickness < 3 && cockLength < 18)
						temp /= 2;
					if (cockThickness < 4 && cockLength < 24)
						temp /= 2;
					//MINIMUM Thickness of OF .5!
					if (cockThickness <= .5)
						temp = 0;
					//Start adding up bonus length
					amountGrown += temp;
					cockThickness += temp;
					temp = 0;
					increase++;
				}
			}
			trace("thickenCock called and thickened by: " + amountGrown);
			return amountGrown;
		}

		public function get cockLength():Number
		{
			return _cockLength;
		}

		public function set cockLength(value:Number):void
		{
			_cockLength = value;
		}

		public function get cockThickness():Number
		{
			return _cockThickness;
		}

		public function set cockThickness(value:Number):void
		{
			_cockThickness = value;
		}

		public function get cockType():CockTypesEnum
		{
			return _cockType;
		}

		public function set cockType(value:CockTypesEnum):void
		{
			_cockType = value;
		}

		public function hasKnot():Boolean
		{
			return knotMultiplier > 1;
		}

		public function get knotMultiplier():Number
		{
			return _knotMultiplier;
		}

		public function set knotMultiplier(value:Number):void
		{
			_knotMultiplier = value;
		}

		public function get isPierced():Boolean
		{
			return _isPierced;
		}

		public function set isPierced(value:Boolean):void
		{
			_isPierced = value;
		}

		/*
		public function get pierceType():PiercingTypesEnum
		{
			return _pierceType;
		}

		public function set pierceType(value:PiercingTypesEnum):void
		{
			_pierceType = value;
		}
		*/

		//{ region Getter/Setters
		public function get pShortDesc():String
		{
			return _pShortDesc;
		}

		public function set pShortDesc(value:String):void
		{
			_pShortDesc = value;
		}

		public function get pLongDesc():String
		{
			return _pLongDesc;
		}

		public function set pLongDesc(value:String):void
		{
			_pLongDesc = value;
		}

		public function get sock():String
		{
			return _sock;
		}

		public function set sock(value:String):void
		{
			_sock = value;
		}

		public function get pierced():Number
		{
			return _pierced;
		}

		public function set pierced(value:Number):void
		{
			_pierced = value;
		}
		//} endregion

	}
}


code:
package classes
{
	import classes.Enum;

	public class CockTypesEnum extends Enum
	{
		{initEnum(CockTypesEnum);}

		/* Cock types
		 * 0 - human
		 * 1 - horse
		 * 2 - dog
		 * 3 - demon
		 * 4 - tentacle?
		 * 5 - CAT
		 * 6 - Lizard/Naga?
		 * 7 - ANEMONE!
		 * 8 - ugliest wang ever (kangaroo)
		 * 9 - dragon
		 * 10 - displacer
		 * 11 - Fox

		 Group Types used for general description code (eventually)
		 * human  	- obvious
		 * mammal 	- obvious again
		 * super 	- supernatural types
		 * tentacle - only one tentacle!
		 * reptile	- make a guess
		 * seaworld - Anything in the water
		 * other	- doesn't fit anywhere else
		 */
		public static const HUMAN:CockTypesEnum = new CockTypesEnum("human");
		public static const HORSE:CockTypesEnum = new CockTypesEnum("mammal");
		public static const DOG:CockTypesEnum = new CockTypesEnum("mammal");
		public static const DEMON:CockTypesEnum = new CockTypesEnum("super");
		public static const TENTACLE:CockTypesEnum = new CockTypesEnum("tentacle");
		public static const CAT:CockTypesEnum = new CockTypesEnum("mammal");
		public static const LIZARD:CockTypesEnum = new CockTypesEnum("reptile");
		public static const ANEMONE:CockTypesEnum = new CockTypesEnum("seaworld");
		public static const KANGAROO:CockTypesEnum = new CockTypesEnum("mammal");
		public static const DRAGON:CockTypesEnum = new CockTypesEnum("reptile");
		public static const DISPLACER:CockTypesEnum = new CockTypesEnum("other");
		public static const FOX:CockTypesEnum = new CockTypesEnum("mammal");
		public static const BEE:CockTypesEnum = new CockTypesEnum("insect");
		public static const PIG:CockTypesEnum = new CockTypesEnum("mammal");
		public static const AVIAN:CockTypesEnum = new CockTypesEnum("avian");
		public static const RHINO:CockTypesEnum = new CockTypesEnum("mammal");
		public static const ECHIDNA:CockTypesEnum = new CockTypesEnum("mammal");
		public static const UNDEFINED:CockTypesEnum = new CockTypesEnum("");

		function CockTypesEnum(i_group:String = "") { _group = i_group; }
		private var _group:String;

		public function get Group():String
		{
			return _group;
		}

		public static function ParseConstant(i_constantName:String, i_caseSensitive:Boolean = false):CockTypesEnum
		{
			return CockTypesEnum(Enum.ParseConstant(CockTypesEnum, i_constantName, i_caseSensitive));
		}

		public static function ParseConstantByIndex(i_constantIndex:int = 0):CockTypesEnum
		{
			return CockTypesEnum(Enum.ParseConstantByIndex(CockTypesEnum, i_constantIndex));
		}

	}
}