code:
package classes.Scenes.Dungeons.DesertCave
{
	import classes.*;
	import classes.BodyParts.Butt;
	import classes.BodyParts.Hips;
	import classes.internals.*;

	public class SandMother extends Monster
	{
		//Notes:
		//Starts combat with sandstorm.  GigaFire's every fifth round.
		//Whispers every fourth.
		public function sandWitchMotherAI():void {
			var actionChoices:MonsterAI = new MonsterAI();
			if (!hasStatusEffect(StatusEffects.Sandstorm)) {
				sandStormAttack();
				return;
			}
			if (hasStatusEffect(StatusEffects.Gigafire)) {
				gigaFire2();
				return;
			}
			actionChoices.add(getWhispered, 1, !player.hasStatusEffect(StatusEffects.Whispered), 15, FATIGUE_MAGICAL,RANGE_RANGED);
			actionChoices.add(eatALightningBolt, 1, true, 10, FATIGUE_MAGICAL,RANGE_RANGED);
			actionChoices.add(gigaFire, 1, true, 10, FATIGUE_MAGICAL,RANGE_RANGED);
			actionChoices.add(earthShield, 1, !hasStatusEffect(StatusEffects.Earthshield), 10, FATIGUE_MAGICAL,RANGE_SELF);
			actionChoices.add(sandMotherTelekinesis, 1, true, 10, FATIGUE_MAGICAL,RANGE_RANGED);
			actionChoices.exec();
		}
		//Earthshield
		public function earthShield():void {
			//Surrounds the witch a vortex of stones, raising her defense greatly and conferring 25% block to standard attacks.
			outputText("Lowering her scepter towards the ground, the eight-foot tall sorceress suddenly grunts, lifting it as if carrying great weight.  As the small staff passes her chest, bits of stone and rock begin to lift out of the ground, accelerating into a vortex of earth that spins around her.  It's going to be harder to hit her with physical attacks now!");
			createStatusEffect(StatusEffects.Earthshield,0,0,0,0);

		}
		//*GigaFire
		public function gigaFire():void {
			//Begins focusing into her staff, which floats in front of her.  PC disrupt attack by attacking.  Attack hits at half strength if disrupted.
			outputText("Releasing the scepter, the Sand Mother spreads her hands, each glowing with eldritch, white flames.  Her heels slowly float up off the ground as she closes her eyes in concentration.  You can sense the power and heat rolling off her in waves, and if you don't do something to disrupt her, you'll likely be burned to a crisp.");
			if (player.inte > 40) outputText("  She's not even looking at you and seems steeled against lusty interruptions.  Perhaps you can hit her hard enough to shatter her concentration.");
			createStatusEffect(StatusEffects.Gigafire,0,0,0,0);

		}
		public function gigaFire2():void {
			game.combat.monsterDamageType = game.combat.DAMAGE_FIRE;
			var damage:int = 40 + rand(11);
			//Not interrupted:
			if (statusEffectv1(StatusEffects.Gigafire) < 10) {
				outputText("The Sand Mother grabs her scepter in both hands, combining the flames that wreath them into an immense, blinding conflagration.  She points at you, and the fire washes out in a wave like a serpent, twisting at you as you try to avoid it, doubling back on itself whenever it misses.  It's unavoidable!  You're enveloped in the consuming fire!");
				damage *= 3;
			}
			//Interrupted:
			else {
				outputText("Thumbling back to the ground from your damaging hit, the Sand Mother grabs at her head, one flame going out.  She recovers in time to grab the staff and fling it towards you, but it's at a fraction of the strength she intended.  Still, it burns all the same. ");
			}
			damage = player.takeDamage(damage, true);
			removeStatusEffect(StatusEffects.Gigafire);

		}

		//*Telekinesis
		//Throws the PC against the wall.  Does more damage to shorter, thinner PCs.
		public function sandMotherTelekinesis():void {
			outputText("She narrows her eyes at you, and an immense, magical pressure reaches out, taking hold of you.  It spins you in the air before slamming you into the walls!");

			var sizeMod:Number = 100;
			var thickMod:Number = player.thickness / 100 + 0.5;
			sizeMod += player.tallness * thickMod;
			if (sizeMod < 140) outputText("  You immediately wish you weren't so small, as you're sure she couldn't have flung a heavier champion nearly as easily. ");
			else if (sizeMod >= 200) outputText("  You're glad for your size, as she couldn't seem to accelerate you into the stone as fast as she'd like.  Sometimes eating plenty pays off. ");
			//0 thickness, 4' tall: 124
			//100 thickness, 4' tall: 172
			//0 thickness, 6' tall: 136
			//100 thickness, 6' tall: 208
			//0 thickness, 8' tall: 148
			//100 thickness, 8' tall: 244
			var multiplier:Number = sizeMod / 170;
			var damage:Number = 20;
			damage = multiplier * damage;
			damage = player.takeDamage(damage, true);

		}

		//*Lightning Bolt
		//Unavoidable magic damage.
		public function eatALightningBolt():void {
			outputText("Holding her staff back, she lifts her free hand with her fingers outstretched in a fan.  Sparks dance between her slender digits, coiling around them like snakes.  In a flash, they rush to her palm and erupt in a lightning bolt, striking you instantly and unavoidably! ");
			var damage:int = 30 + rand(10);
			damage = player.takeDamage(damage, true);

		}
		//*Whisper:
		//As ackbal, stuns the PC 1 round.  Cannot be resisted.
		public function getWhispered():void {
			outputText("Mouthing, \"Can you hear me?\" the witch's voice intrudes into your mind, matching her mouth word for word.  She floods your psyche with words and thoughts, all of your defeat or submission, each more degrading and more humiliating than the last.  Perhaps the worst are the ones where she turns you over to Lethice after you're broken...  The tumultuous thoughts and emotions both stun and arouse you, preventing you from attacking while you try to clear your beleaguered consciousness.");
			player.createStatusEffect(StatusEffects.Whispered,0,0,0,0);
			player.takeLustDamage(15, true);

		}
		public function sandStormAttack():void {
			outputText("With a smirk, the Sand Mother decrees, \"You fight not just me, but the shifting sands as well.\"  She casually flicks her wrist, and sand rises up from the floors, the walls, everywhere really.  It begins to spin about, blown by an unseen wind, and the entire chamber is wreathed in a shifting sandstorm.  The grit constantly tries to get into your eyes.  It's likely you're going to be blinded by it every now and then.");
			createStatusEffect(StatusEffects.Sandstorm,0,0,0,0);

		}

		override public function defeated(hpVictory:Boolean):void
		{
			game.dungeons.desertcave.defeatTheSandMother();
		}

		override public function won(hpVictory:Boolean, pcCameWorms:Boolean = false):void
		{
			game.dungeons.desertcave.loseToTheSandMother();
		}

		public function SandMother()
		{
			this.a = "the ";
			this.short = "Sand Mother";
			this.imageName = "sandmother";
			this.long = "The Sand Mother is a towering woman of imposing stature and bust.  She wears a much silkier, regal-looking robe than her sisters, and it barely serves to contain her four milk-laden breasts, straining under their jiggling weight.  Dangling around her in a way that reminds you oddly of a halo, the Sand Mother's blonde-white hair fans around her, hanging long behind her.  The queen witch is brandishing a pearly white scepter rather threateningly, though from the way she holds it, it's clear she doesn't intend to use it as a physical weapon.";
			this.race = "Human?";
			// this.plural = false;
			this.createVagina(false, Vagina.WETNESS_WET, Vagina.LOOSENESS_LOOSE);
			this.createStatusEffect(StatusEffects.BonusVCapacity, 70, 0, 0, 0);
			this.createBreastRow(Appearance.breastCupInverse("DD"));
			this.createBreastRow(Appearance.breastCupInverse("DD"));
			this.ass.analLooseness = Ass.LOOSENESS_TIGHT;
			this.ass.analWetness = Ass.WETNESS_NORMAL;
			this.createStatusEffect(StatusEffects.BonusACapacity,50,0,0,0);
			this.tallness = 8*12+6;
			this.hips.rating = Hips.RATING_CURVY;
			this.butt.rating = Butt.RATING_LARGE;
			this.skin.tone = "bronzed";
			this.hair.color = "platinum-blonde";
			this.hair.length = 15;
			initStrTouSpeInte(55, 55, 35, 45);
			initLibSensCor(55, 40, 30);
			this.weaponName = "fists";
			this.weaponVerb="punches";
			this.weaponAttack = 0;
			this.weaponPerk = [];
			this.weaponValue = 150;
			this.armorName = "robes";
			this.armorDef = 1;
			this.bonusHP = 130;
			this.lust = 20;
			this.lustVuln = .6;
			this.temperment = TEMPERMENT_LOVE_GRAPPLES;
			this.level = 7;
			this.gems = rand(15) + 55;
			this.createPerk(PerkLib.Resolute,0,0,0,0);
			this.createPerk(PerkLib.Focused,0,0,0,0);
			this.createPerk(PerkLib.ImprovedSelfControl, 0, 0, 0, 0);
            this.createPerk(PerkLib.SpellcastingAffinity,65,0,0,0);
            this.createPerk(PerkLib.SpeedyRecovery,0,0,0,0);
            this.createPerk(PerkLib.ControlledBreath);
			this.drop = NO_DROP;
			checkMonster();
		}

	}

}


code:
package classes.Scenes.Dungeons.DesertCave
{
	import classes.*;
	import classes.BodyParts.Butt;
	import classes.BodyParts.Hips;
	import classes.internals.*;

	public class SandWitchMob extends Monster
	{
		public function sandWitchMobAI():void {
			var actionChoices:MonsterAI = new MonsterAI();
			actionChoices.add(sandStormAttack, 1, !hasStatusEffect(StatusEffects.Sandstorm) , 10, FATIGUE_MAGICAL,RANGE_RANGED);
			actionChoices.add(drankSomeMialk, 2, HPRatio() < .5, 10, FATIGUE_PHYSICAL,RANGE_SELF);
			actionChoices.add(sandstonesAreCool, 0.33, hasStatusEffect(StatusEffects.Sandstorm) && rand(2) == 0 && !player.hasStatusEffect(StatusEffects.LustStones), 10, FATIGUE_MAGICAL,RANGE_RANGED);
			actionChoices.add(gangrush, 1,true,0,FATIGUE_NONE,RANGE_MELEE);
			actionChoices.exec();
		}

		//Sand Witch Mob Attacks:
		//Swarm
		//-Mob gangrushes the PC; multiple hits, light damage
		public function gangrush():void {
			outputText("The witches close ranks and advance with raised fists, intent on beating you into submission!\n");
			//3-5 attacks.at half strength
			str -= 10;
			createStatusEffect(StatusEffects.Attacks,2 + rand(3),0,0,0);
			eAttack();
			str += 10;

		}

		//Headbutt
		//Single, high damage attack
		//High hit chance
		public function headbuttABitch():void {
			outputText("The crowd parts, and a stockier, sturdier sorceress ambles out, fists up and head cocked back.  She makes to punch at you before pulling her fist at the last second, snapping her head forward in a powerful headbutt!  You barely have time to react!");
			var damage:int = player.reduceDamage(str + weaponAttack + 10,this);
			//Dodge
			if (!combatAvoidDamage({doDodge:true,doParry:false,doBlock:false}).failed) {
				outputText("\nThrowing yourself out of the way, you manage to avoid the hit.  Your foe doesn't seem nearly as pleased while she fades back in between her sisters.");
			}
			//Block
			else if (damage <= 0) {
				outputText("\nYou catch the hit on your forearm, stopping her cold.  The thuggish woman snarls as she fades back in between her sisters, disappointed at doing so little damage.");
			}
			//Hit
			else {
				outputText("\nShe hits you square in the face, bloodying your face and sending you stumbling back in agony. ");
				damage = player.takeDamage(damage, true);
			}

		}

		//Sand Stones
		//-Mob summons vibrating sands sands to  lust increase PCs lust
		//- Lust gained each round they use it is determined by how many naughty bits a PC has.
		//-For every dick, set of breast(nips?), cunts and ass-hole on a PC, the lust gain is increased by 3, Not accounting for lust resistance.
		//-Goo bodies will gain 30 Lust by default, not accounting lust resistance.
		//-Stones will randomly vibrate throughout the battle if they get the PC.

		public function sandstonesAreCool():void {
			outputText("The sandstorm whirling around the room suddenly ceases, and all the tiny sand particles gather together into balls, growing into several smooth stones.  Then, all the sand stones fall to the ground and slither towards you.");

			var bonus:int = 0;
			//[If they attack lands]
			if (!combatAvoidDamage({doDodge:true,doParry:false,doBlock:false}).failed) {
				//[IF PC has solid body]
				if (!player.isGoo()) {
					outputText("\n\nThey crawl up your [legs].  You try to swat them all off, but there are too many.");
					//If PC has 1 cock:
					if (player.cockTotal() == 1) outputText("  A stone crawls onto your [cock].");
					//[If PC has multi-cocks:
					if (player.cockTotal() > 1) outputText("  A bunch of the stones crawl onto your " + player.multiCockDescriptLight() + ".");
					if (player.hasCock()) bonus++;
					//[If PC has cunt]
					if (player.hasVagina()) {
						outputText("  One stone slides up your inner thigh");
						if (player.balls > 0) outputText(" behind your [sack]");
						outputText(" and pops itself right into your [vagina]");
						if (player.hasVirginVagina()) outputText(", robbing you of your virginity as a trickle of blood runs down your [leg].");
						bonus++;
					}
					//[If PC has balls:
					if (player.balls > 0) {
						outputText("  A small set of stones settle on your [balls].");
						bonus++;
					}
					outputText("  " + num2Text(player.totalNipples()) + " crawl up to your chest and over your top " + player.nippleDescript(0) + "s");
					if (player.bRows() > 1) {
						if (player.bRows() == 2) outputText(" and");
						else outputText(",");
						outputText(" your middle " +  player.nippleDescript(1) + "s");
						bonus++;
					}
					if (player.bRows() > 2) {
						outputText(", and your bottom " + player.nippleDescript(2) + "s");
						bonus++;
					}
					outputText(".");
					outputText("  The last stone travels up the back of your [legs] and slides right into your [asshole].");
					outputText("\n\nYou try to get the stones off and out of you, but some kind of magic is keeping them stuck to you like glue.  One sand-witch snaps her fingers, and all the of the smooth stones begin vibrating, making numbing waves of pleasure that rattle your body.  You have to end this quick, or else!");
				}
				//[IF PC has goo body]
				else {
					outputText("\n\nThe stones launch themselves into your gooey body.  You try your best to dislodge these foreign objects from your insides, but some-kind of magic is holding them in place.  A sand-witch snaps her fingers and all the stones begin vibrating, sending ripples throughout your sentative gooey body.  It feels like your whole body is one, big pleasure-bomb right now.  You had better end this fight soon!");
					bonus = 5;

				}
				player.createStatusEffect(StatusEffects.LustStones,bonus,0,0,0);
				player.takeLustDamage(bonus * 2 + 5 + player.sens/7, true);
			}
			//[If attack misses]
			else {
				outputText("\nThe stones then make a ninety degree turn into the purple fire, and then nothing.  One sand-witch smacks another upside the head, yelling something about focusing.");
			}
			removeStatusEffect(StatusEffects.Sandstorm);

		}

		//Milk is Good
		//-Mob's members start sucking on each other's tits. Arouses PC and restores health to mob, decreases (increases?) mob's lust.
		public function drankSomeMialk():void {
			outputText("One of the blonde beauties turns to another and asks, \"A drink, sister?  Fighting this intruder has given me a powerful thirst.\"  The other woman wordlessly opens her robe, baring her breasts, exposing four heaving, milk-fueled mounds to the air before the other woman claims a nipple for herself.  Three others crowd in on the exposed teats, their rumps shaking contentedly as they grab a quick snack.");
			outputText("\n\nAfter wiping the excess from their lips, they close their robes and resume a fighting stance, seeming healthier than before.");
			player.takeLustDamage(4 + player.lib/10, true);
			//+ 30 HP, +light lust damage to PC and mob
			addHP(30);

		}

		//*Sandstorm
		//Creates a sandstorm that blinds the PC one out of every 3 rounds.  Used first turn. Deals light HP damage every turn.  Reduces breath attacks damage by 80%.  Makes bow miss 50% of the time.
		public function sandStormAttack():void {
			outputText("The witches link their hands together and begin to chant together, lifting their voices high as loose sand trickles in from every corner, every doorway, even the ceiling.  \"Enevretni llahs tresed eht!\"  Swirling around the chamber, a cloud of biting, stinging sand clouds your vision and bites into your skin.  It's going to keep blinding you and hurting you every round!");
			createStatusEffect(StatusEffects.Sandstorm,0,0,0,0);

		}

		override protected function performCombatAction():void
		{
			sandWitchMobAI();
		}

		override public function defeated(hpVictory:Boolean):void
		{
			game.dungeons.desertcave.yoYouBeatUpSomeSandWitchesYOUMONSTER();
		}

		override public function won(hpVictory:Boolean,pcCameWorms:Boolean = false):void
		{
			game.dungeons.desertcave.loseToSammitchMob();
		}

		public function SandWitchMob()
		{
			this.a = "the ";
			this.short = "sand witches";
			this.imageName = "sandwitchmob";
			this.long = "You are surrounded by a veritable tribe of sand witches.  Like the ones that roam the sands, they have simple robes, blond hair, and four big breasts that push at the concealing cloth immodestly.  Glowering at you hatefully, the pack of female spellcasters readies itself to drag you down with sheer numbers.";
			this.race = "Humans?";
			this.plural = true;
			this.pronoun1 = "they";
			this.pronoun2 = "them";
			this.pronoun3 = "their";
			this.createVagina(false, Vagina.WETNESS_WET, Vagina.LOOSENESS_LOOSE);
			this.createBreastRow(Appearance.breastCupInverse("DD"));
			this.createBreastRow(Appearance.breastCupInverse("DD"));
			this.ass.analLooseness = Ass.LOOSENESS_TIGHT;
			this.ass.analWetness = Ass.WETNESS_NORMAL;
			this.tallness = rand(12) + 55;
			this.hips.rating = Hips.RATING_CURVY;
			this.butt.rating = Butt.RATING_LARGE;
			this.skin.tone = "bronzed";
			this.hair.color = "sandy-blonde";
			this.hair.length = 15;
			initStrTouSpeInte(25, 25, 35, 45);
			initLibSensCor(55, 40, 30);
			this.weaponName = "fists";
			this.weaponVerb="punches";
			this.weaponAttack = 0;
			this.weaponPerk = [];
			this.weaponValue = 150;
			this.armorName = "robes";
			this.armorDef = 1;
			this.armorPerk = "";
			this.armorValue = 5;
			this.bonusHP = 80;
			this.lust = 30;
			this.lustVuln = .5;
			this.temperment = TEMPERMENT_LOVE_GRAPPLES;
			this.level = 4;
			this.gems = rand(15) + 5;
			this.drop = NO_DROP;
			this.createPerk(PerkLib.Immovable);
			checkMonster();

		}

	}

}

license: unknown


code:
package classes.Scenes.Dungeons {
	import classes.*;
	import classes.GlobalFlags.kGAMECLASS;
	import classes.Scenes.Dungeons.DungeonCore;

import mx.controls.List;

/**
	 * ...
	 * @author Kitteh6660
	 */
	public class DungeonAbstractContent extends BaseContent {
		protected function get dungeons():DungeonCore {
			return game.dungeons;
		}
		public function DungeonAbstractContent() {
		}
        public var dungeonRooms:Object = new Object();
		public var dungeonMap:List.<DungeonRoom> = new List.<DungeonRoom>;
		public function runFunc():void{
            clearOutput();
            dungeons.setDungeonButtons();
            if(game.dungeons.map.walkedLayout.indexOf(dungeons.playerLoc) == -1) game.dungeons.map.walkedLayout.push(dungeons.playerLoc);
            dungeonRooms[dungeons.playerLoc]();
            output.flush();
		}

        public function leave():void{
			dungeonRooms = new Object();
            game.inDungeon = false;
            dungeons.usingAlternative = false;
            doNext(camp.returnToCampUseTwoHours);
        }
        public function initRooms():void {
        }
        public function initMap():void{

		}
	}
}


code:
package classes.Scenes.Dungeons
{
	import classes.*;
	import classes.BaseContent;
	import classes.GlobalFlags.kFLAGS;
	import classes.GlobalFlags.kGAMECLASS;
	import classes.Scenes.Dungeons.LethicesKeep.LethicesKeep;
	import classes.Scenes.PregnancyProgression;
	import classes.display.SpriteDb;
	import classes.internals.*;

	import coc.view.MainView;

import com.bit101.components.List;

public class DungeonCore extends BaseContent
	{
		public var rooms:Object = {};
		public var currDungeon:DungeonAbstractContent;
		public var _currentRoom:String; // I don't think we'll need to save/load this, as we're not gonna allow saving in the dungeon, and it'll be overwritten by calling enterD3();

		//Dungeon constants
		//Factory
		public static const DUNGEON_FACTORY_FOYER:int			=  0;
		public static const DUNGEON_FACTORY_BREAK_ROOM:int		=  1;
		public static const DUNGEON_FACTORY_PUMP_ROOM:int		=  2;
		public static const DUNGEON_FACTORY_FURNACE_ROOM:int	=  3;
		public static const DUNGEON_FACTORY_REPAIR_CLOSET:int	=  4;
		public static const DUNGEON_FACTORY_MAIN_CHAMBER:int	=  5;
		public static const DUNGEON_FACTORY_FOREMANS_OFFICE:int	=  6;
		public static const DUNGEON_FACTORY_PUMP_CONTROL:int	=  7;
		public static const DUNGEON_FACTORY_STORE_ROOM:int		=  8;
		public static const DUNGEON_FACTORY_BATHROOM:int		=  9;
		//Deep Cave
		public static const DUNGEON_CAVE_ENTRANCE:int			= 10;
		public static const DUNGEON_CAVE_TUNNEL:int				= 11;
		public static const DUNGEON_CAVE_GATHERING_HALL:int		= 12;
		public static const DUNGEON_CAVE_FUNGUS_CAVERN:int		= 13;
		public static const DUNGEON_CAVE_TORTURE_ROOM:int		= 14;
		public static const DUNGEON_CAVE_SECRET_TUNNEL:int		= 15;
		public static const DUNGEON_CAVE_ZETAZ_CHAMBER:int		= 16;
		//Phoenix Tower
		public static const DUNGEON_HEL_GUARD_HALL:int			= 17;
		public static const DUNGEON_HEL_WINE_CELLAR:int			= 18;
		public static const DUNGEON_HEL_STAIR_WELL:int			= 19;
		public static const DUNGEON_HEL_DUNGEON:int				= 20;
		public static const DUNGEON_HEL_MEZZANINE:int			= 21;
		public static const DUNGEON_HEL_THRONE_ROOM:int			= 22;
		//Desert Cave
		public static const DUNGEON_WITCH_ENTRANCE_GATEWAY:int	= 23;
		public static const DUNGEON_WITCH_CAVERNOUS_COMMONS:int	= 24;
		public static const DUNGEON_WITCH_WEST_WARRENS_MAIN:int	= 25;
		public static const DUNGEON_WITCH_CHILDRENS_PLAYROOM:int= 26;
		public static const DUNGEON_WITCH_PREGNANT_LUST_ROOM:int= 27;
		public static const DUNGEON_WITCH_WEST_WARRENS_WEST:int	= 28;
		public static const DUNGEON_WITCH_NURSERY:int			= 29;
		public static const DUNGEON_WITCH_PHARMACY:int			= 30;
		public static const DUNGEON_WITCH_EAST_WARRENS_MAIN:int	= 31;
		public static const DUNGEON_WITCH_SLEEPING_CHAMBER:int	= 32;
		public static const DUNGEON_WITCH_BATH_ROOM:int			= 33;
		public static const DUNGEON_WITCH_EAST_WARRENS_EAST:int	= 34;
		public static const DUNGEON_WITCH_CUM_WITCH_BEDROOM:int	= 35;
		public static const DUNGEON_WITCH_CUM_WITCH_OFFICE:int	= 36;
		public static const DUNGEON_WITCH_SACRIFICIAL_ALTAR:int	= 37;
		public static const DUNGEON_WITCH_THRONE_ROOM:int		= 38;
		//Anzu's Palace
		public static const DUNGEON_ANZU_OUTSIDE:int			= 39;
		public static const DUNGEON_ANZU_HALL_FLOOR1:int 		= 40;
		public static const DUNGEON_ANZU_LIVING_ROOM:int 		= 41;
		public static const DUNGEON_ANZU_BATHROOM:int 			= 42;
		public static const DUNGEON_ANZU_DINING_ROOM:int 		= 43;
		public static const DUNGEON_ANZU_KITCHEN:int 			= 44;
		public static const DUNGEON_ANZU_HALL_FLOOR2:int		= 45;
		public static const DUNGEON_ANZU_BEDROOM:int 			= 46;
		public static const DUNGEON_ANZU_LIBRARY:int 			= 47;
		public static const DUNGEON_ANZU_MULTIUSE_ROOM:int 		= 48;
		public static const DUNGEON_ANZU_HALL_FLOOR3:int 		= 49;
		public static const DUNGEON_ANZU_PALACE_VAULTS:int 		= 50;
		public static const DUNGEON_ANZU_ALCHEMY_ROOM:int 		= 51;
		public static const DUNGEON_ANZU_ROOF:int 				= 52;
		public static const DUNGEON_ANZU_BASEMENT:int 			= 53;
		public static const DUNGEON_ANZU_ARMORY:int 			= 54;
		//Manor
		public static const DUNGEON_MANOR_GARDEN:int 			= 55;
		public static const DUNGEON_MANOR_MAINHALL:int 			= 56;
		public static const DUNGEON_MANOR_STAIRSSTART:int 		= 57;
		public static const DUNGEON_MANOR_LIBRARY:int 		    = 58;
		public static const DUNGEON_MANOR_LIBRARYSECRET:int 	= 59;
		public static const DUNGEON_MANOR_DININGROOM:int 		= 60;
		public static const DUNGEON_MANOR_STAIRS0:int 		    = 61;
		public static const DUNGEON_MANOR_STAIRS1:int 		    = 62;
		public static const DUNGEON_MANOR_STAIRS2:int 		    = 63;
		public static const DUNGEON_MANOR_STAIRS3:int 		    = 64;
		public static const DUNGEON_MANOR_BEDROOM:int 		    = 65;
		public static const DUNGEON_MANOR_STUDY:int 		    = 66;
		public static const DUNGEON_MANOR_TUNNELS1:int 		    = 67;
		public static const DUNGEON_MANOR_TUNNELS2:int 		    = 68;
		public static const DUNGEON_MANOR_TUNNELS3:int 		    = 69;
		public static const DUNGEON_MANOR_TUNNELS4:int 		    = 70;
		public static const DUNGEON_MANOR_TUNNELS5:int 		    = 71;
		public static const DUNGEON_MANOR_CHAMBER:int 		    = 72;
		public static const DUNGEON_MANOR_LETHICITETUNNEL1:int 	= 73;
		public static const DUNGEON_MANOR_LETHICITETUNNEL2:int 	= 74;
		public static const DUNGEON_MANOR_INFINITY1:int 		= 75;
		public static const DUNGEON_MANOR_INFINITY2:int 		= 76;
		public static const DUNGEON_MANOR_INFINITY3:int 		= 77;
		public static const DUNGEON_MANOR_INFINITY4:int 		= 78;
		public static const DUNGEON_MANOR_INFINITY5:int 		= 79;
		//Wizard Tower
		public static const DUNGEON_WIZARDTOWER:int 			= 80;
		public function DungeonCore(pregnancyProgression:PregnancyProgression) {
			this.desertcave = new DesertCave(pregnancyProgression);
		}
		//Register dungeons
		public var factory:Factory = new Factory;
		public var deepcave:DeepCave = new DeepCave;
		public var desertcave:DesertCave;
		public var heltower:HelDungeon = new HelDungeon;
		public var palace:AnzuPalace = new AnzuPalace;
		public var manor:Manor = new Manor;
		public var wizardTower:classes.Scenes.Dungeons.WizardTower = new WizardTower;
		public var randomDungeon:RandomDungeon = new RandomDungeon;
		public var map:DungeonMap;

		//Wizard Tower stuff. TESTS!
		public var mapLayout:List.<DungeonRoom>;
		public var playerLoc:int = 0;
		public var mapModulus:int;
		public var usingAlternative:Boolean = false;
		public var dungeonName:String = "";

		public function checkRoom():void
		{
			//Cabin
			if (game.dungeonLoc == -10) cabin.enterCabin();
			//Factory
			if (game.dungeonLoc == DUNGEON_FACTORY_FOYER) factory.roomLobby();
			if (game.dungeonLoc == DUNGEON_FACTORY_BREAK_ROOM) factory.roomBreakRoom();
			if (game.dungeonLoc == DUNGEON_FACTORY_PUMP_ROOM) factory.roomPumpRoom();
			if (game.dungeonLoc == DUNGEON_FACTORY_FURNACE_ROOM) factory.roomFurnaceRoom();
			if (game.dungeonLoc == DUNGEON_FACTORY_REPAIR_CLOSET) factory.roomRepairCloset();
			if (game.dungeonLoc == DUNGEON_FACTORY_MAIN_CHAMBER) factory.roomMainChamber();
			if (game.dungeonLoc == DUNGEON_FACTORY_FOREMANS_OFFICE) factory.roomForemanOffice();
			if (game.dungeonLoc == DUNGEON_FACTORY_PUMP_CONTROL) factory.roomControlRoom();
			if (game.dungeonLoc == DUNGEON_FACTORY_STORE_ROOM) factory.roomPremiumStorage();
			if (game.dungeonLoc == DUNGEON_FACTORY_BATHROOM) factory.roomBathroom();
			//Deep Cave
			if (game.dungeonLoc == DUNGEON_CAVE_ENTRANCE) deepcave.roomEntrance();
			if (game.dungeonLoc == DUNGEON_CAVE_TUNNEL) deepcave.roomTunnel();
			if (game.dungeonLoc == DUNGEON_CAVE_GATHERING_HALL) deepcave.roomGatheringHall();
			if (game.dungeonLoc == DUNGEON_CAVE_FUNGUS_CAVERN) deepcave.roomFungusCavern();
			if (game.dungeonLoc == DUNGEON_CAVE_TORTURE_ROOM) deepcave.roomTortureRoom();
			if (game.dungeonLoc == DUNGEON_CAVE_SECRET_TUNNEL) deepcave.roomSecretPassage();
			if (game.dungeonLoc == DUNGEON_CAVE_ZETAZ_CHAMBER) deepcave.roomZetazChamber();
			//Tower of the Phoenix (Helia's Quest)
			if (game.dungeonLoc == DUNGEON_HEL_GUARD_HALL) heltower.roomGuardHall();
			if (game.dungeonLoc == DUNGEON_HEL_WINE_CELLAR) heltower.roomCellar();
			if (game.dungeonLoc == DUNGEON_HEL_STAIR_WELL) heltower.roomStairwell();
			if (game.dungeonLoc == DUNGEON_HEL_DUNGEON) heltower.roomDungeon();
			if (game.dungeonLoc == DUNGEON_HEL_MEZZANINE) heltower.roomMezzanine();
			if (game.dungeonLoc == DUNGEON_HEL_THRONE_ROOM) heltower.roomThroneRoom();
			//Desert Cave
			if (game.dungeonLoc == DUNGEON_WITCH_ENTRANCE_GATEWAY) desertcave.roomEntrance();
			if (game.dungeonLoc == DUNGEON_WITCH_CAVERNOUS_COMMONS) desertcave.roomCaveCommons();
			if (game.dungeonLoc == DUNGEON_WITCH_WEST_WARRENS_MAIN) desertcave.roomWestHall1();
			if (game.dungeonLoc == DUNGEON_WITCH_CHILDRENS_PLAYROOM) desertcave.roomPlayRoom();
			if (game.dungeonLoc == DUNGEON_WITCH_PREGNANT_LUST_ROOM) desertcave.roomLustRoom();
			if (game.dungeonLoc == DUNGEON_WITCH_WEST_WARRENS_WEST) desertcave.roomWestHall2();
			if (game.dungeonLoc == DUNGEON_WITCH_NURSERY) desertcave.roomNursery();
			if (game.dungeonLoc == DUNGEON_WITCH_PHARMACY) desertcave.roomPharmacy();
			if (game.dungeonLoc == DUNGEON_WITCH_EAST_WARRENS_MAIN) desertcave.roomEastHall1();
			if (game.dungeonLoc == DUNGEON_WITCH_SLEEPING_CHAMBER) desertcave.roomSleepingChamber();
			if (game.dungeonLoc == DUNGEON_WITCH_BATH_ROOM) desertcave.roomBathroom();
			if (game.dungeonLoc == DUNGEON_WITCH_EAST_WARRENS_EAST) desertcave.roomEastHall2();
			if (game.dungeonLoc == DUNGEON_WITCH_CUM_WITCH_BEDROOM) desertcave.roomCumWitchBedroom();
			if (game.dungeonLoc == DUNGEON_WITCH_CUM_WITCH_OFFICE) desertcave.roomCumWitchOffice();
			if (game.dungeonLoc == DUNGEON_WITCH_SACRIFICIAL_ALTAR) desertcave.roomSacrificalAltar();
			if (game.dungeonLoc == DUNGEON_WITCH_THRONE_ROOM) desertcave.roomSandMotherThrone();
			//Anzu's Palace
			if (game.dungeonLoc == DUNGEON_ANZU_OUTSIDE) palace.roomEntrance();
			if (game.dungeonLoc == DUNGEON_ANZU_HALL_FLOOR1) palace.roomFoyer();
			if (game.dungeonLoc == DUNGEON_ANZU_LIVING_ROOM) palace.roomLivingRoom();
			if (game.dungeonLoc == DUNGEON_ANZU_BATHROOM) palace.roomBathroom();
			if (game.dungeonLoc == DUNGEON_ANZU_DINING_ROOM) palace.roomDiningRoom();
			if (game.dungeonLoc == DUNGEON_ANZU_KITCHEN) palace.roomKitchen();
			if (game.dungeonLoc == DUNGEON_ANZU_HALL_FLOOR2) palace.roomHallFloor2();
			if (game.dungeonLoc == DUNGEON_ANZU_BEDROOM) palace.roomBedroom();
			if (game.dungeonLoc == DUNGEON_ANZU_LIBRARY) palace.roomLibrary();
			if (game.dungeonLoc == DUNGEON_ANZU_MULTIUSE_ROOM) palace.roomMultiuse();
			if (game.dungeonLoc == DUNGEON_ANZU_HALL_FLOOR3) palace.roomHallFloor3();
			if (game.dungeonLoc == DUNGEON_ANZU_PALACE_VAULTS) palace.roomVault();
			if (game.dungeonLoc == DUNGEON_ANZU_ALCHEMY_ROOM) palace.roomAlchemyRoom();
			if (game.dungeonLoc == DUNGEON_ANZU_ROOF) palace.roomRoof();
			if (game.dungeonLoc == DUNGEON_ANZU_BASEMENT) palace.roomBasement();
			if (game.dungeonLoc == DUNGEON_ANZU_ARMORY) palace.roomArmory();
			//Manor
			if (game.dungeonLoc == DUNGEON_MANOR_GARDEN) manor.enterManor();
			if (game.dungeonLoc == DUNGEON_MANOR_MAINHALL) manor.mainHall();
			if (game.dungeonLoc == DUNGEON_MANOR_STAIRSSTART) manor.stairsStart();
			if (game.dungeonLoc == DUNGEON_MANOR_STAIRS0) manor.stairs0();
			if (game.dungeonLoc == DUNGEON_MANOR_STAIRS1) manor.stairs1();
			if (game.dungeonLoc == DUNGEON_MANOR_STAIRS2) manor.stairs2();
			if (game.dungeonLoc == DUNGEON_MANOR_STAIRS3) manor.stairs3();
			if (game.dungeonLoc == DUNGEON_MANOR_BEDROOM) manor.bedroom();
			if (game.dungeonLoc == DUNGEON_MANOR_STUDY) manor.study();
			if (game.dungeonLoc == DUNGEON_MANOR_DININGROOM) manor.diningRoom();
			if (game.dungeonLoc == DUNGEON_MANOR_LIBRARY) manor.libraryRoom();
			if (game.dungeonLoc == DUNGEON_MANOR_LIBRARYSECRET) manor.librarySecret();
			if (game.dungeonLoc == DUNGEON_MANOR_TUNNELS1) manor.tunnels1();
			if (game.dungeonLoc == DUNGEON_MANOR_TUNNELS2) manor.tunnels2();
			if (game.dungeonLoc == DUNGEON_MANOR_TUNNELS3) manor.tunnels3();
			if (game.dungeonLoc == DUNGEON_MANOR_TUNNELS4) manor.tunnels4();
			if (game.dungeonLoc == DUNGEON_MANOR_TUNNELS5) manor.tunnels5();
			if (game.dungeonLoc == DUNGEON_MANOR_LETHICITETUNNEL1) manor.lethiciteTunnel1();
			if (game.dungeonLoc == DUNGEON_MANOR_LETHICITETUNNEL2) manor.lethiciteTunnel2();
			if (game.dungeonLoc == DUNGEON_MANOR_CHAMBER) manor.theChamber();
			if (game.dungeonLoc == DUNGEON_MANOR_INFINITY1) manor.infinity1();
			if (game.dungeonLoc == DUNGEON_MANOR_INFINITY2) manor.infinity2();
			if (game.dungeonLoc == DUNGEON_MANOR_INFINITY3) manor.infinity3();
			if (game.dungeonLoc == DUNGEON_MANOR_INFINITY4) manor.infinity4();
			if (game.dungeonLoc == DUNGEON_MANOR_INFINITY5) manor.infinity5();
			//Wizard Tower
			if (game.dungeonLoc == DUNGEON_WIZARDTOWER) wizardTower.runFunc();
            if (game.dungeonLoc == 81) randomDungeon.runFunc();

		}

		public function checkFactoryClear():Boolean {
			return (flags[kFLAGS.FACTORY_SHUTDOWN] > 0 && flags[kFLAGS.FACTORY_SUCCUBUS_DEFEATED] > 0 && (flags[kFLAGS.FACTORY_INCUBUS_DEFEATED] > 0 || flags[kFLAGS.D3_DISCOVERED] > 0) && flags[kFLAGS.FACTORY_OMNIBUS_DEFEATED] > 0);
		}
		public function checkDeepCaveClear():Boolean {
			return (flags[kFLAGS.ZETAZ_IMP_HORDE_DEFEATED] > 0 && flags[kFLAGS.ZETAZ_FUNGUS_ROOM_DEFEATED] > 0 && flags[kFLAGS.FREED_VALA] == 1 && player.hasKeyItem("Zetaz's Map"));
		}
		public function checkSandCaveClear():Boolean {
			return ((flags[kFLAGS.ESSRAYLE_ESCAPED_DUNGEON] > 0 || flags[kFLAGS.MET_ESSY] == 0) && (flags[kFLAGS.SAND_WITCHES_FRIENDLY] > 0 || flags[kFLAGS.SAND_WITCHES_COWED] > 0));
		}
		public function checkPhoenixTowerClear():Boolean {
			return (flags[kFLAGS.HARPY_QUEEN_EXECUTED] != 0 && flags[kFLAGS.HEL_HARPIES_DEFEATED] > 0 && flags[kFLAGS.HEL_PHOENIXES_DEFEATED] > 0 && flags[kFLAGS.HEL_BRIGID_DEFEATED] > 0);
		}
		public function checkLethiceStrongholdClear():Boolean {
			return (flags[kFLAGS.D3_MIRRORS_SHATTERED] > 0 && flags[kFLAGS.D3_JEAN_CLAUDE_DEFEATED] > 0 && flags[kFLAGS.D3_GARDENER_DEFEATED] > 0 && flags[kFLAGS.D3_CENTAUR_DEFEATED] > 0 && flags[kFLAGS.LETHICE_DEFEATED] > 0);
		}
		public function checkManorClear():Boolean{
			return (flags[kFLAGS.MANOR_PROGRESS] & 128) > 0;
		}
		public function checkTowerDeceptionClear():Boolean{
			return (flags[kFLAGS.WIZARD_TOWER_PROGRESS] & 256) > 0;
		}

		public function enterFactory():void {
			factory.enterDungeon();
		}
		public function canFindDeepCave():Boolean {
			return flags[kFLAGS.DISCOVERED_DUNGEON_2_ZETAZ] == 0 && flags[kFLAGS.FACTORY_SHUTDOWN] > 0;
		}
		public function enterDeepCave():void {
			deepcave.enterDungeon();
		}
		public function enterAnzuPalace():void {
			palace.enterDungeon();
		}

		public function navigateToRoom(room:Function = null, timeToPass:Number = 1/12):void {
			cheatTime(timeToPass);
			room();
		}

		/**
		 * Set the top buttons for use while in dungeons.
		 */
		public function setTopButtons():void { //Set top buttons.
			mainView.setMenuButton( MainView.MENU_NEW_MAIN, "Main Menu", game.mainMenu.mainMenu );
			mainView.showMenuButton( MainView.MENU_APPEARANCE );
			mainView.showMenuButton( MainView.MENU_PERKS );
			mainView.showMenuButton( MainView.MENU_STATS );
			mainView.hideMenuButton( MainView.MENU_DATA );
			mainView.showMenuButton( MainView.MENU_NEW_MAIN );
			if ((player.XP >= (player.level) * 100 && player.level < game.levelCap) || player.perkPoints > 0 || player.statPoints > 0) {
				if (player.XP < player.level * 100 || player.level >= game.levelCap)
				{
					if (player.statPoints > 0) mainView.setMenuButton( MainView.MENU_LEVEL, "Stat Up" );
					else mainView.setMenuButton( MainView.MENU_LEVEL, "Perk Up" );
				}
				else {
					mainView.setMenuButton( MainView.MENU_LEVEL, "Level Up" );
					if (flags[kFLAGS.AUTO_LEVEL] > 0) {
						game.playerInfo.levelUpGo();
						return;
					}
				}
				mainView.showMenuButton( MainView.MENU_LEVEL );
				mainView.statsView.showLevelUp();
			}
			else {
				mainView.hideMenuButton( MainView.MENU_LEVEL );
				mainView.statsView.hideLevelUp();
			}
		}

		/**
		 * Set the buttons for use in dungeons. The parameters can be used to connect to rooms.
		 * @param	northFunction
		 * @param	southFunction
		 * @param	westFunction
		 * @param	eastFunction
		 */
		public function setDungeonButtons(northFunction:Function = null, southFunction:Function = null, westFunction:Function = null, eastFunction:Function = null):void {
			statScreenRefresh();
			hideUpDown();
			spriteSelect(null);
			imageSelect(null);
			menu();
			if (usingAlternative) setAlternativeDungeonButton();
			else{
				if (northFunction != null) addButton(6, "North", navigateToRoom, northFunction);
				if (southFunction != null) addButton(11, "South", navigateToRoom, southFunction);
				if (westFunction != null) addButton(10, "West", navigateToRoom, westFunction);
				if (eastFunction != null) addButton(12, "East", navigateToRoom, eastFunction);
			}
			addButton(13, "Inventory", inventory.inventoryMenu).hint("The inventory allows you to use an item.  Be careful as this leaves you open to a counterattack when in combat.");
			addButton(14, "Map", map.displayMap).hint("View the map of this dungeon.");
			setTopButtons();
			palace.setAnzuButton();
		}

		//Wizard Tower testbed
		public function startAlternative(newDungeon:DungeonAbstractContent, initLoc:int, name:String = ""):void{//starts an alternative dungeon setup.
			clearOutput();
			playerLoc = initLoc;
            dungeonName = name;
            currDungeon = newDungeon;
            currDungeon.initMap();
            currDungeon.initRooms();
			mapModulus = Math.sqrt(newDungeon.dungeonMap.length);
			mapLayout = newDungeon.dungeonMap;
			mapLayout[playerLoc].playerLoc = true;
			usingAlternative = true;
            game.inDungeon = true;
		}

		public function teleportPlayer(location:int):void{
			mapLayout[playerLoc] -= 3;
			mapLayout[location] += 3;
			playerLoc = location;
		}
		public function setAlternativeDungeonButton():void{
			if ((mapLayout[playerLoc - mapModulus] == 0  || mapLayout[playerLoc - mapModulus] == 4) && !(playerLoc - (mapModulus - 1) <= 0)){
				addButton(6, "North", moveAlternative,0).hint("Move north.");
			}
			if ((mapLayout[playerLoc + mapModulus] == 0  || mapLayout[playerLoc + mapModulus] == 4) && !(playerLoc + mapModulus >= mapLayout.length)){
				addButton(11, "South", moveAlternative,1).hint("Move south.");
			}
			if ((mapLayout[playerLoc - 1] == 0  || mapLayout[playerLoc - 1] == 4) && playerLoc != 0){
				addButton(10, "West", moveAlternative,2).hint("Move west.");
			}
			if ((mapLayout[playerLoc + 1] == 0  || mapLayout[playerLoc + 1] == 4) && (playerLoc + 1)%mapModulus != 0 ){
				addButton(12, "East", moveAlternative,3).hint("Move east.");
			}

		}

		public function moveAlternative(direction:int):void{
			mapLayout[playerLoc] -= 3;
			if(mapLayout[playerLoc] < 0) mapLayout[playerLoc] = 3;
				if (direction == 0){
					playerLoc -= mapModulus;
				}
				if (direction == 1){
					playerLoc += mapModulus;
				}
				if (direction == 2){
					playerLoc -= 1;
				}
				if (direction == 3){
					playerLoc += 1;
				}
			cheatTime(1/12);
			mapLayout[playerLoc] += 3;
			currDungeon.runFunc();
		}

		//Dungeon 3 & Grimdark Stuff
		public function resumeFromFight():void
		{
			move(_currentRoom);
		}

		//End of test stuff

		public function generateRoomMenu(tRoom:room):void
		{
			statScreenRefresh();
			hideUpDown();
			spriteSelect(null);
			imageSelect(null);
			setTopButtons();
			if (tRoom.NorthExit != null && tRoom.NorthExit.length > 0)
			{
				if (tRoom.NorthExitCondition == null || tRoom.NorthExitCondition())
				{
					addButton(6, "North", move, tRoom.NorthExit, 1/12);
				}
			}

			if (tRoom.EastExit != null && tRoom.EastExit.length > 0)
			{
				if (tRoom.EastExitCondition == null || tRoom.EastExitCondition())
				{
					addButton(12, "East", move, tRoom.EastExit, 1/12);
				}
			}

			if (tRoom.SouthExit != null && tRoom.SouthExit.length > 0)
			{
				if (tRoom.SouthExitCondition == null || tRoom.SouthExitCondition())
				{
					addButton(11, "South", move, tRoom.SouthExit, 1/12);
				}
			}

			if (tRoom.WestExit != null && tRoom.WestExit.length > 0)
			{
				if (tRoom.WestExitCondition == null || tRoom.WestExitCondition())
				{
					addButton(10, "West", move, tRoom.WestExit, 1/12);
				}
			}

			addButton(13, "Inventory", inventory.inventoryMenu);
			addButton(14, "Map", game.dungeons.map.displayMap);
			game.masturbation.setMasturbateButton(true);
		}

		public function move(roomName:String, timeToPass:Number = 0):void
		{
			//trace("Entering room", roomName);
			cheatTime(timeToPass);
			clearOutput();

			if (rooms[roomName] == undefined)
			{
				clearOutput();
				outputText("Error: Couldn't find the room indexed as: " + roomName);
				menu();
				return;
			}

			var tRoom:room = rooms[roomName];

			if (tRoom.RoomFunction == null)
			{
				outputText("Error: Room entry function for room indexed as '" + roomName + "' was not set.");
				return;
			}

			menu();
            _currentRoom = roomName;
			if (!tRoom.RoomFunction())
			{
				generateRoomMenu(tRoom);
			}

		}
	}

}


code:
package classes.Scenes.Dungeons {
	import classes.*;
	import classes.GlobalFlags.*;
	import classes.Scenes.Dungeons.*;

import com.bit101.components.List;

public class DungeonMap extends BaseContent
	{

		public function DungeonMap() {}

		public function get mapModulus():int{
			return game.dungeons.mapModulus;
		}

		public function get mapLayout():List.<DungeonRoom>{
			return game.dungeons.mapLayout;
		}

		public var walkedLayout:Array = [];

		//Declare those map variables. They're set in such a way that the map can be updated as flags change.
		public var mapFactoryF1:Array;
		public var mapFactoryF2:Array;
		public var mapDeepcave:Array;
		public var mapStrongholdP1:Array;
		public var mapStrongholdP2:Array;
		public var mapDesertcave:Array;
		public var mapPhoenixtowerB1:Array;
		public var mapPhoenixtowerF1:Array;
		public var mapPhoenixtowerF2:Array;
		public var mapPhoenixtowerF3:Array;
		public var mapAnzupalaceB1:Array;
		public var mapAnzupalaceF1:Array;
		public var mapAnzupalaceF2:Array;
		public var mapAnzupalaceF3:Array;
		public var mapAnzupalaceF4:Array;

		//How to work with the refactored map:
		//-1 is wide empty space 1x3.
		//-2 is narrow empty space 1x1.
		//-3 is vertical passage. (|)
		//-4 is horizontal passage.  (-)
		//-5 and -6 are locked passage. Only used for boolean checks. (L)
		//The numbered rooms correspond to the room ID.

		public function updateMap():void {
			// -- Factory --
			mapFactoryF1 = [ //Room 00-05 + 06
				"Factory, Floor 1",
				[-1, -2,  4, -2, -1],
				[-1, -2, -3, -2, -1],
				[ 5, -4,  2, -4,  3],
				[-1, -2, d1, -2, -1],
				[ 9, -4,  0, -4,  1],
				[-1, -2, -3, -2, -1]
			];
			mapFactoryF2 = [ //Room 06-08
				"Factory, Floor 2",
				[ 6, -4,  7],
				[d2, -2, -1],
				[ 8, -2, -1]
			];

			// -- Deep Cave --
			mapDeepcave = [ //Room 10-16
				"Zetaz's Lair",
				[-1, -2, 16, -4, 15],
				[-1, -2, d3, -2, -3],
				[13, -4, 12, -4, 14],
				[-1, -2, -3, -2, -1],
				[-1, -2, 11, -2, -1],
				[-1, -2, -3, -2, -1],
				[-1, -2, 10, -2, -1],
				[-1, -2, -3, -2, -1]
			];

			// -- Lethice's Stronghold --
			mapStrongholdP1 = [
				"Basilisk Cave",
				[-1, -2, "tunnel2", -4, -1],
				[-1, -2, -3, -2, -1],
				[-1, -2, "magpiehalls", -2, -1], //Will need to account for magpiehalln
				[-1, -2, -3, -2, -1],
				[-1, -2, "antechamber", -4, "roomofmirrors"],
				[-1, -2, -3, -2, -1],
				["entrance", -4, "tunnel", -2, -1],
				[-3, -2, -1, -2, -1]
			];
			mapStrongholdP2 = [
				"Lethice's Keep",
				[-1, -2, -1, -2, "throneroom", -2, -1, -2, -1],
				[-1, -2, -1, -2, d5, -2, -1, -2, -1],
				[-1, -2, "northwestcourtyard", -4, "northcourtyard", -4, "northeastcourtyard", -2, -1],
				[-1, -2, -3, -2, -1, -2, -3, -2, -1],
				[-1, -4, "northwestwalk", -2, -1, -2, "northeastwalk", -4, -1],
				[-1, -2, -3, -2, -1, -2, -3, -2, -1],
				[-1, -2, "westwalk", -4, "courtyardsquare", -4, "eastwalk", -2, -1],
				[-1, -2, -3, -2, -1, -2, -3, -2, -1],
				[-1, -2, "southwestwalk", -2, -1, -2, "southeastwalk", -2, -1],
				[-1, -2, -3, -2, -1, -2, -3, -2, -1],
				[-1, -4, "southwestcourtyard", -4, "southcourtyard", -4, "southeastcourtyard", -4, -1],
				[-1, -2, -1, -2, -3, -2, -3, -2, -1],
				[-1, -2, -1, -2, "northentry", -2, "greatlift", -2, -1],
				[-1, -2, -1, -2, -3, -2, -1, -2, -1],
				[-1, -2, -1, -4, "edgeofkeep", -2, -1, -2, -1]
			];

			// -- Desert Cave --
			mapDesertcave = [
				"Cave of the Sand Witches",
				[-1, -2, -1, -2, 38, -2, -1, -2, -1],
				[-1, -2, -1, -2, -3, -2, -1, -2, -1],
				[29, -2, 26, -2, 37, -2, 32, -4, 33],
				[-3, -2, -3, -2, -3, -2, -3, -2, -2],
				[28, -4, 25, -4, 24, -4, 31, -4, 34],
				[-3, -2, -3, -2, -3, -2, -1, -2, -3],
				[30, -2, 27, -2, 23, -2, 36, -4, 35],
				[-1, -2, -1, -2, -3, -2, -1, -2, -1]
			];

			// -- Phoenix Tower --
			mapPhoenixtowerB1 = [
				"Tower of the Phoenix, Basement",
				[-1, -2, 20],
				[-1, -2, -1],
				[-1, -2, 18]
			];
			mapPhoenixtowerF1 = [
				"Tower of the Phoenix, Floor 1",
				[-1, -2, 19],
				[-1, -2, -3],
				[-1, -2, 17],
				[-1, -2, -3]
			];
			mapPhoenixtowerF2 = [
				"Tower of the Phoenix, Floor 2",
				[-1, -2, 21],
				[-1, -2, -1],
				[-1, -2, -1]
			];
			mapPhoenixtowerF3 = [
				"Tower of the Phoenix, Floor 3",
				[-1, -2, 22],
				[-1, -2, -1],
				[-1, -2, -1]
			];

			// -- Anzu's Palace --
			mapAnzupalaceB1 = [
				"Anzu's Palace, Basement",
				[-1, -2, -1, -2, -1],
				[-1, -2, -1, -2, -1],
				[54, -4, 53, -2, -1]
			];
			mapAnzupalaceF1 = [
				"Anzu's Palace, Floor 1",
				[42, -2, -1, -2, 44],
				[-3, -2, -1, -2, -3],
				[41, -4, 40, -4, 43],
				[-1, -2, -3, -2, -1],
				[-1, -2, 39, -2, -1],
				[-1, -2, -3, -2, -1]
			];
			mapAnzupalaceF2 = [
				"Anzu's Palace, Floor 2",
				[-1, -2, 48, -2, -1],
				[-1, -2, -3, -2, -1],
				[46, -4, 45, -4, 47]
			];
			mapAnzupalaceF3 = [
				"Anzu's Palace, Floor 3",
				[-1, -2, -1, -2, -1],
				[-1, -2, -1, -2, -1],
				[50, -4, 49, -4, 51]
			];
			mapAnzupalaceF4 = [
				"Anzu's Palace, Roof",
				[-1, -2, -1, -2, -1],
				[-1, -2, -1, -2, -1],
				[-1, -2, 52, -2, -1]
			];
		}

		public function get d1():int { //Door that requires iron key.
			return (player.hasKeyItem("Iron Key") ? -3 : -5);
		}
		public function get d2():int { //Door that requires supervisors key.
			return (player.hasKeyItem("Supervisor's Key") ? -3 : -5);
		}
		public function get d3():int { //Door in Zetaz's lair.
			return (flags[kFLAGS.ZETAZ_DOOR_UNLOCKED] > 0 ? -3 : -5);
		}
		public function get d4():int { //Door in desert cave.
			return (flags[kFLAGS.SANDWITCH_THRONE_UNLOCKED] > 0 ? -3 : -5);
		}
		public function get d5():int {
			return (game.lethicesKeep.unlockedThroneRoom() ? -3 : -5);
		}

		public function chooseRoomToDisplay():String {
			updateMap();
			var newMap:String = "";
            if (game.dungeons.usingAlternative) return redraw();
			if (game.inRoomedDungeon) {
				//if (game.inRoomedDungeonName == "GrimdarkMareth") buildMapDisplay(MAP_MARETH);
				if (game.inRoomedDungeonName == "BasiliskCave") newMap = buildMapDisplay(mapStrongholdP1);
				if (game.inRoomedDungeonName == "LethicesKeep") newMap = buildMapDisplay(mapStrongholdP2);
			}
			else if (game.dungeonLoc >= 0 && game.dungeonLoc < 10) { //Factory
				if (game.dungeonLoc < 6 || game.dungeonLoc == 9)
                    newMap = buildMapDisplay(mapFactoryF1);
				else
                    newMap = buildMapDisplay(mapFactoryF2);
			}
			else if (game.dungeonLoc >= 10 && game.dungeonLoc < 17) { //Zetaz's Lair
                newMap = buildMapDisplay(mapDeepcave);
			}
			else if (game.dungeonLoc >= 17 && game.dungeonLoc < 23) { //Tower of the Phoenix
				switch(game.dungeonLoc) {
					case 18:
					case 20:
                        newMap = buildMapDisplay(mapPhoenixtowerB1);
						break;
					case 17:
					case 19:
                        newMap = buildMapDisplay(mapPhoenixtowerF1);
						break;
					case 21:
                        newMap = buildMapDisplay(mapPhoenixtowerF2);
						break;
					case 22:
                        newMap = buildMapDisplay(mapPhoenixtowerF3);
						break;
					default:
                        newMap = buildMapDisplay(mapPhoenixtowerF1);
				}
			}
			else if (game.dungeonLoc >= 23 && game.dungeonLoc < 39) { //Desert Cave
                newMap = buildMapDisplay(mapDesertcave);
			}
			else if (game.dungeonLoc >= 39 && game.dungeonLoc < 55) { //Anzu's Palace
				if (game.dungeonLoc >= 39 && game.dungeonLoc <= 44) newMap = buildMapDisplay(mapAnzupalaceF1);
				if (game.dungeonLoc >= 45 && game.dungeonLoc <= 48) newMap = buildMapDisplay(mapAnzupalaceF2);
				if (game.dungeonLoc >= 49 && game.dungeonLoc <= 51) newMap = buildMapDisplay(mapAnzupalaceF3);
				if (game.dungeonLoc == 52) newMap = buildMapDisplay(mapAnzupalaceF4);
				if (game.dungeonLoc == 53 || game.dungeonLoc == 54) newMap = buildMapDisplay(mapAnzupalaceB1);
			}
			else if (game.dungeonLoc >= 55 && game.dungeonLoc < 75) { //Old Manor
                newMap += "Old Manor";
				//Map display
				if (game.dungeonLoc == 55) { //Floor 1
                    newMap +="\n[ ] [ ] [↕]";
                    newMap +="\n |   |   | ";
                    newMap +="\n[ ]—[ ]—[ ]";
                    newMap +="\n     |     ";
                    newMap +="\n    [@]    ";
                    newMap +="\n     |     ";
				}
				else if (game.dungeonLoc == 56) { //Floor 1
                    newMap +="\n[ ] [ ] [↕]";
                    newMap +="\n |   |   | ";
                    newMap +="\n[ ]—[@]—[ ]";
                    newMap +="\n     |     ";
                    newMap +="\n    [ ]    ";
                    newMap +="\n     |     "
				}
				else if (game.dungeonLoc == 57) { //Floor 1
                    newMap +="\n[ ] [ ] [↕]";
                    newMap +="\n |   |   | ";
                    newMap +="\n[ ]—[ ]—[@]";
                    newMap +="\n     |     ";
                    newMap +="\n    [ ]    ";
                    newMap +="\n     |     ";
				}
				else if (game.dungeonLoc == 58) { //Floor 1
                    newMap +="\n[ ] [ ] [↕]";
                    newMap +="\n |   |   | ";
                    newMap +="\n[@]—[ ]—[ ]";
                    newMap +="\n     |     ";
                    newMap +="\n    [ ]    ";
                    newMap +="\n     |     ";
				}
				else if (game.dungeonLoc == 59) { //Floor 1
                    newMap +="\n[@] [ ] [↕]";
                    newMap +="\n |   |   | ";
                    newMap +="\n[ ]—[ ]—[ ]";
                    newMap +="\n     |     ";
                    newMap +="\n    [ ]    ";
                    newMap +="\n     |     "
				}
				else if (game.dungeonLoc == 60) { //Floor 1
                    newMap +="\n[ ] [@] [↕]";
                    newMap +="\n |   |   | ";
                    newMap +="\n[ ]—[ ]—[ ]";
                    newMap +="\n     |     ";
                    newMap +="\n    [ ]    ";
                    newMap +="\n     |     "
				}
				else if (game.dungeonLoc == 61) { //Floor 1
                    newMap +="\n[ ] [ ] [@]";
                    newMap +="\n |   |   | ";
                    newMap +="\n[ ]—[ ]—[ ]";
                    newMap +="\n     |     ";
                    newMap +="\n    [ ]    ";
                    newMap +="\n     |     ";
				}
				else if (game.dungeonLoc == 62) { //Floor 2
					newMap += "\n    [ ]—[ ]";
					newMap += "\n     |     ";
					newMap += "\n[ ]—[ ]    ";
					newMap += "\n     |     ";
					newMap += "\n    [@]    ";
				}
				else if (game.dungeonLoc == 63) { //Floor 2
					newMap += "\n    [ ]—[ ]";
					newMap += "\n     |     ";
					newMap += "\n[ ]—[@]    ";
					newMap += "\n     |     ";
					newMap += "\n    [↕]    ";
				}
				else if (game.dungeonLoc == 64) { //Floor 2
					newMap += "\n    [@]—[ ]";
					newMap += "\n     |     ";
					newMap += "\n[ ]—[ ]    ";
					newMap += "\n     |     ";
					newMap += "\n    [↕]    ";
				}
				else if (game.dungeonLoc == 65) { //Floor 2
					newMap += "\n    [ ]—[@]";
					newMap += "\n     |     ";
					newMap += "\n[ ]—[ ]    ";
					newMap += "\n     |     ";
					newMap += "\n    [↕]    ";
				}
				else if (game.dungeonLoc == 66) { //Floor 2
					newMap += "\n    [ ]—[ ]";
					newMap += "\n     |     ";
					newMap += "\n[@]—[ ]    ";
					newMap += "\n     |     ";
					newMap += "\n    [↕]    ";
				}
				else if (game.dungeonLoc == 67) { //Underground
					newMap += "\n                [ ]    ";
					newMap += "\n                 |     ";
					newMap += "\n                [ ]    ";
					newMap += "\n                 |     ";
					newMap += "\n[ ]—[ ]—[ ]—[ ]—[ ]—[@]";

				}
				else if (game.dungeonLoc == 68) { //Underground
					newMap += "\n                [ ]    ";
					newMap += "\n                 |     ";
					newMap += "\n                [ ]    ";
					newMap += "\n                 |     ";
					newMap += "\n[ ]—[ ]—[ ]—[ ]—[@]—[ ]";

				}
				else if (game.dungeonLoc == 69) { //Underground
					newMap += "\n                [ ]    ";
					newMap += "\n                 |     ";
					newMap += "\n                [ ]    ";
					newMap += "\n                 |     ";
					newMap += "\n[ ]—[ ]—[ ]—[@]—[ ]—[ ]";

				}
				else if (game.dungeonLoc == 70) { //Underground
					newMap += "\n                [ ]    ";
					newMap += "\n                 |     ";
					newMap += "\n                [ ]    ";
					newMap += "\n                 |     ";
					newMap += "\n[ ]—[ ]—[@]—[ ]—[ ]—[ ]"

				}
				else if (game.dungeonLoc == 71) { //Underground
					newMap += "\n                [ ]    ";
					newMap += "\n                 |     ";
					newMap += "\n                [ ]    ";
					newMap += "\n                 |     ";
					newMap += "\n[ ]—[@]—[ ]—[ ]—[ ]—[ ]";

				}
				else if (game.dungeonLoc == 72) { //Underground
					newMap += "\n                [ ]    ";
					newMap += "\n                 |     ";
					newMap += "\n                [ ]    ";
					newMap += "\n                 |     ";
					newMap += "\n[@]—[ ]—[ ]—[ ]—[ ]—[ ]";

				}
				else if (game.dungeonLoc == 73) { //Underground
					newMap += "\n                [ ]    ";
					newMap += "\n                 |     ";
					newMap += "\n                [@]    ";
					newMap += "\n                 |     ";
					newMap += "\n[ ]—[ ]—[ ]—[ ]—[ ]—[ ]";

				}
				else if (game.dungeonLoc == 74) { //Underground
					newMap += "\n                [@]    ";
					newMap += "\n                 |     ";
					newMap += "\n                [ ]    ";
					newMap += "\n                 |     ";
					newMap += "\n[ ]—[ ]—[ ]—[ ]—[ ]—[ ]";

				}
				newMap +="";
			}
			else if (game.dungeonLoc >= 75 && game.dungeonLoc < 80) {//Old Manor, Infinite Nothingness
                newMap +="Infinite Nothingness";
				if (game.dungeonLoc == 75) {
					newMap += "\n     [ ]     [ ]         ";
					newMap += "\n[ ]     [ ]     [ ]      ";
					newMap += "\n                         ";
					newMap += "\n[ ]     [@]   [ ]        ";
					newMap += "\n [ ]            [ ]      ";
					newMap += "\n    [ ]   [ ]            ";
					newMap += "\n         [ ]       [ ]   ";
					newMap += "\n[ ]         [ ]       [ ]";
					newMap += "\n        [ ]              ";
				}
				else if (game.dungeonLoc == 76) {
					newMap += "\n     [ ]     [ ]         ";
					newMap += "\n[ ]     [@]     [ ]      ";
					newMap += "\n                         ";
					newMap += "\n[ ]     [ ]   [ ]        ";
					newMap += "\n [ ]            [ ]      ";
					newMap += "\n    [ ]   [@]            ";
					newMap += "\n         [ ]       [@]   ";
					newMap += "\n[@]         [ ]       [ ]";
					newMap += "\n        [ ]              ";
				}
				else if (game.dungeonLoc == 77) {
					newMap += "\n     [ ]     [@]         ";
					newMap += "\n[ ]     [ ]     [ ]      ";
					newMap += "\n                         ";
					newMap += "\n[@]     [ ]   [ ]        ";
					newMap += "\n [ ]            [ ]      ";
					newMap += "\n    [ ]   [@]            ";
					newMap += "\n         [ ]       [ ]   ";
					newMap += "\n[ ]         [ ]       [ ]";
					newMap += "\n        [@]              ";
				}
				else if (game.dungeonLoc == 78) {
					newMap += "\n     [ ]     [ ]         ";
					newMap += "\n[ ]     [ ]     [↕]      ";
					newMap += "\n                         ";
					newMap += "\n[ ]     [↕]   [ ]        ";
					newMap += "\n [ ]            [ ]      ";
					newMap += "\n    [ ]   [ ]            ";
					newMap += "\n         [ ]       [↕]   ";
					newMap += "\n[ ]         [ ]       [ ]";
					newMap += "\n        [ ]              ";
				}
				else if (game.dungeonLoc == 79) {
					newMap += "\n     [@]     [@]         ";
					newMap += "\n[@]     [@]     [@]      ";
					newMap += "\n                         ";
					newMap += "\n[@]     [@]   [@]        ";
					newMap += "\n [@]            [@]      ";
					newMap += "\n    [@]   [@]            ";
					newMap += "\n         [@]       [@]   ";
					newMap += "\n[@]         [@]          ";
					newMap += "\n                         "
				}
                newMap += ""
			}
			//rawOutputText(newMap);
			return newMap;
	}

		public function buildMapDisplay(map:Array):String {
            var newMap:String = map[0] + "\n";

            newMap += "";
			for (var i:int = 1; i < map.length; i++) {
				for (var j:int = 0; j < map[i].length; j++) {
					//Negative numbers are special.
					if (map[i][j] is int && map[i][j] < 0) {
						switch(map[i][j]) {
							case -1:
                                newMap += "   ";
								break;
							case -2:
                                newMap +=" ";
								break;
							case -3:
                                newMap +=" | ";
								break;
							case -4:
                                newMap +="—";
								break;
							case -5:
                                newMap +=" L ";
								break;
							case -6:
                                newMap +="L";
								break;
						}
					}
					else if (game.inDungeon && map[i][j] is int && map[i][j] >= 0) {
						switch(map[i][j]) {
							case game.dungeonLoc:
                                newMap +="[@]";
								break;
							case  5:
							case 18:
							case 20:
							case 53:
                                newMap +="[^]";
								break;
							case  6:
							case 17:
							case 22:
							case 52:
                                newMap +="[v]";
								break;
							case 19:
							case 21:
							case 40:
							case 45:
							case 49:
                                newMap +="[↕]";
								break;
							default:
                                newMap +="[ ]";
						}
					}
					else if (game.inRoomedDungeon) {
						if (game.dungeons._currentRoom == map[i][j])
                            newMap +="[@]";
						else
                        	newMap +="[ ]";
					}
				}
                newMap +="\n";
			}
            newMap +="";
			return newMap;
		}

	public function isTileVisible(index:int):Boolean{
		//return (mapLayout[index - 1] == 3) || (mapLayout[index + 1] == 3) || (mapLayout[index + mapModulus] == 3) || (mapLayout[index - mapModulus] == 3) || walkedLayout.indexOf(index) != -1;
		return true;
	}

		//0 - open passage
		//1 - empty space(blocked)
		//2 - locked door
		//3 - player spot
		//4 - stairs

		public function setWestEastConnection(a:DungeonRoom,b:DungeonRoom):String{
			if(a.moveEast && b.moveWest){
				return "-";
			}
			if(a.moveEast && !b.moveWest){
				return ">";
			}
			if(!a.moveEast && b.moveWest){
				return "<";
			}
			if(!a.moveEast && b.moveWest){
				return " ";
			}
		}
        public function setNorthSouthConnection(a:DungeonRoom,b:DungeonRoom):String{
            if(a.moveSouth && b.moveNorth){
                return "|";
            }
            if(a.moveSouth && !b.moveNorth){
                return "v";
            }
            if(!a.moveSouth && b.moveNorth){
                return "^";
            }
            if(!a.moveSouth && b.moveNorth){
                return " ";
            }
        }
	public function redraw():String{
		//clearOutput();
		var draw:String = game.dungeons.dungeonName + "\n";
		draw += "";
		for (var i:int = 0; i < mapModulus; i++){
			for (var j:int = 0; j < mapModulus; j++){
                if (mapLayout[j + i * mapModulus].isvoid) continue;
				if (mapLayout[j + i * mapModulus].empty || !isTileVisible(j + i * mapModulus)) draw += "    ";
				else{
					if (mapLayout[j + i*mapModulus].isCorridor()) draw += "[ ]";
					if (mapLayout[j + i * mapModulus].lockedDoor) draw += "[L]";
					if (mapLayout[j + i * mapModulus].playerLoc) draw += "[P]";
					if (mapLayout[j + i * mapModulus].stairs) draw += "[S]";
					if (j + 1 < mapModulus) draw += setWestEastConnection(mapLayout[j+i*mapModulus],mapLayout[j + i * mapModulus + 1]);
					else draw += " ";
				}
			}
			draw += "\n";
			for (var k:int = 0; k < mapModulus; k++){
                if (mapLayout[k + i * mapModulus].isvoid) continue;
				if (k + i*mapModulus + mapModulus < mapLayout.length){
					setNorthSouthConnection(mapLayout[k + i*mapModulus],mapLayout[k + i*mapModulus + mapModulus]);
				}
			}
			draw += "\n";

		}
		draw += "";
		return draw;
	}

		public function displayMap():void {
			clearOutput();
			if (game.dungeons.usingAlternative) rawOutputText(redraw());
			else rawOutputText(chooseRoomToDisplay());
			outputText("\n\nLegend");
			outputText("\n@ — Player Location");
			outputText("\nL — Locked Door");
			outputText("\n^v↕ — Stairs");
			menu();
			addButton(0, "Close Map", playerMenu);
		}

	}

}


code:
package classes.Scenes.Dungeons {
public class DungeonRoom {
    public var moveWest:Boolean = true;
    public var moveEast:Boolean = true;
    public var moveNorth:Boolean = true;
    public var moveSouth:Boolean = true;
    public var stairs:Boolean = false;
    public var lockedDoor:Boolean = false;
    public var empty: Boolean = false;
    public var runFunc:Function;
    public var isvoid:Boolean = false;
    public var playerLoc:Boolean = false;

    public function DungeonRoom(north:Boolean = true,south:Boolean = true,east:Boolean=true,west:Boolean=true) {
        this.moveNorth= north;
        this.moveSouth = south;
        this.moveEast = east;
        this.moveWest = west;
    }

    public function setStairs():void{
        this.stairs = true;
    }
    public function setLockedDoor():void{
        this.lockedDoor = true;
    }
    public function setEmpty():void{
        this.empty = true;
    }
    public function setVoid():void{
        this.isvoid = true;
    }
    public static function CreateEmptyRoom():DungeonRoom{
        var dr:DungeonRoom  = new DungeonRoom(false,false,false,false);
        dr.setEmpty();
        return dr;
    }
    public static function CreateVoid():DungeonRoom{
        var dr:DungeonRoom  = new DungeonRoom(false,false,false,false);
        dr.setVoid();
        return dr;
    }
    public function isCorridor():Boolean{
        return !stairs && !isvoid && !empty && !lockedDoor;
    }

}
}


code:
package classes.Scenes.Dungeons.Factory
{
	import classes.*;
	import classes.BodyParts.*;
	import classes.GlobalFlags.kFLAGS;
	import classes.Items.Armors.LustyMaidensArmor;
	import classes.Items.Armors.NaughtyNunsHabit;
	import classes.Items.Shields.DragonShellShield;
	import classes.Scenes.Dungeons.Factory;
	import classes.internals.*;
	import flash.display.InteractiveObject;
	import classes.GlobalFlags.kFLAGS;
	import classes.GlobalFlags.kGAMECLASS;

	public class IncubusMechanic extends Monster {

		override public function defeated(hpVictory:Boolean):void
		{
			if (flags[kFLAGS.D3_DISCOVERED] == 0)
			{
				defeatedInDungeon1(hpVictory);
			}
			else
			{
				defeatedInDungeon3(hpVictory);
			}
		}

		private function defeatedInDungeon1(hpVictory:Boolean):void {
			clearOutput();
			game.output.menu();
			if (hpVictory)
				outputText("You smile in satisfaction as the " + short + " collapses, unable to continue fighting.");
			else outputText("You smile in satisfaction as the " + short + " collapses, masturbating happily.");
			outputText("  Now would be the perfect opportunity to put his tool to use...\n\nWhat do you do?");
			if (flags[kFLAGS.NEW_GAME_PLUS_LEVEL] >= 2 && flags[kFLAGS.FACTORY_INCUBUS_BRIBED] == 0) outputText("\n\n<b>You swear you can hear a clicking sound coming from the west.</b>");
			if (flags[kFLAGS.FACTORY_INCUBUS_BRIBED] > 0) player.createKeyItem("Hentai Comic", 0, 0, 0, 0);

			if (!player.isGenderless()) {
				game.output.addButton(0, "Rape", game.lethicesKeep.incubusMechanic.doRapeIncubus).hint(player.hasCock() ? "Fuck his butt." : "Ride him vaginally.");
			} else {
				game.output.addButtonDisabled(0, "Rape", "This scene requires you to have genitals.");
			}
			game.output.addButton(1, "Service Him", game.lethicesKeep.incubusMechanic.doOralIncubus).hint("Service the incubus orally.");
			game.output.addButton(2, "AnalRide", game.lethicesKeep.incubusMechanic.doRideIncubusAnally).hint("Ride him anally.");
			if (player.hasVagina() && player.biggestTitSize() >= 4 && player.armor == armors.LMARMOR) game.output.addButton(3, "B.Titfuck", (player.armor as LustyMaidensArmor).lustyMaidenPaizuri, player, this);
			if (player.armor is NaughtyNunsHabit) game.output.addButton(4, "Worship Cock", (player.armor as NaughtyNunsHabit).naughtyNunCockWorship).hint("Praise your lord through devotion to this creatures's cock.");
			// no disabled button for this option
			game.output.addButton(14, "Leave", game.combat.cleanupAfterCombat);
		}

		private function defeatedInDungeon3(hpVictory:Boolean):void
		{
			game.lethicesKeep.incubusMechanic.beatDaMechanic(hpVictory);
		}

		override public function won(hpVictory:Boolean, pcCameWorms:Boolean = false):void
		{
			if (flags[kFLAGS.D3_DISCOVERED] == 0)
			{
				wonInDungeon1(hpVictory, pcCameWorms);
			}
			else
			{
				wonInDungeon3(hpVictory, pcCameWorms);
			}
		}

		private function wonInDungeon1(hpVictory:Boolean, pcCameWorms:Boolean = false):void
		{
			if (pcCameWorms){
				outputText("\n\nYour foe doesn't seem to care...");
				doNext(game.combat.endLustLoss);
			} else {
				game.lethicesKeep.incubusMechanic.doLossIncubus();
			}
		}

		private function wonInDungeon3(hpVictory:Boolean, pcCameWorms:Boolean = false):void
		{
			if (flags[kFLAGS.LETHICE_DEFEATED] > 0) game.lethicesKeep.incubusMechanic.doLossIncubus();
			else game.lethicesKeep.incubusMechanic.mechanicFuckedYouUp(hpVictory, pcCameWorms);
		}

		private function cockTripAttack():void {
			if (hasStatusEffect(StatusEffects.Blind)) { //Blind dodge change
				outputText(capitalA + short + " suddenly grows it's dick to obscene lengths and tries to trip you with it.  Thankfully he's so blind he wasn't aiming anywhere near you!");

				return;
			}
			outputText("The incubus lunges forward in a clumsy attack that you start to side-step, only to feel something grip behind your " + player.buttDescript() + " and pull your " + player.legs() + " out from under you.");
			if ((player.spe-30) > rand(60)) {
				outputText("  You spin as you fall, twisting your " + player.legs() + " free and springing back to your " + player.feet() + " unharmed.");
			}
			else { //Fall down go boom
				outputText("  You land hard on your ass, momentarily stunned as the demonic cock-tentacle curls around your " + player.legs() + ", smearing them with oozing demonic fluids.");
				if (player.lust100 >= 80 || player.cor >= 80) {
					outputText("  Moaning with desire, you lick your lips as you slide your well-lubricated " + player.legs() + " free.  You gather a dollop of cum and lick it seductively, winking at the incubus and hoping to make him cave into his desire.");
					player.takeLustDamage(13, true);
					game.dynStats("cor", 1);
				}
				else if (player.lust100 >= 50 || player.cor >= 50) {
					outputText("  Blushing at the scent and feel of cum on your " + player.legs() + ", you twist and pull free.  You find yourself wondering what this demon's dick would taste like.");
					player.takeLustDamage(8 + player.cor / 20, true);
				}
				else {
					outputText("  Disgusted, you pull away from the purplish monstrosity, the act made easier by your well-slimed " + player.legs() + ".");
					player.takeLustDamage(5 + player.cor / 20, true);
				}
				player.takeDamage(5);
			}
			outputText("\nThe incubus gives an overconfident smile as his cock retracts away from you, returning to its normal size.");

		}

		private function spoogeAttack():void {
			if (hasStatusEffect(StatusEffects.Blind)) { //Blind dodge change
				outputText(capitalA + short + " pumps and thrusts his hips lewdly before cumming with intense force in your direction!  Thankfully his aim was off due to the blindness currently affect him.");

				return;
			}
			outputText("Your demonic foe places his hands behind his head and lewdly pumps and thrusts his hips at you.  Your eyes open wide as a globule of cum erupts from the demon-prick and flies right at you.  ");
			if (player.shield is DragonShellShield && rand(2) == 0)
			{
				outputText("Your shield managed to absorb the attack!")

				return;
			}
			outputText("You do your best to dodge, but some still lands on your ");
			switch (rand(3)) {
				case 0: //Face
					outputText("face.  The gooey demon-seed oozes and slides over you with a mind of its own, forcing its way into your mouth and nose!  You can feel it moving around inside you, doing its best to prepare you for its master.");
					game.dynStats("lus", 3);
					if (!player.hasStatusEffect(StatusEffects.DemonSeed))
						player.createStatusEffect(StatusEffects.DemonSeed, 5, 0, 0, 0);
					else player.addStatusValue(StatusEffects.DemonSeed, 1, 7);
					player.slimeFeed();
					break;
				case 1: //Chest
					if (player.hasFuckableNipples()) {
						outputText(allBreastsDescript() + ".  The gooey demon-seed oozes and slides over you with a mind of its own, forcing its way into your open nipples.  You can feel it moving around inside you, doing its best to prepare you for its master.");
						game.dynStats("lus", 3);
						if (!player.hasStatusEffect(StatusEffects.DemonSeed))
							player.createStatusEffect(StatusEffects.DemonSeed, 5, 0, 0, 0);
						else player.addStatusValue(StatusEffects.DemonSeed, 1, 8);
						player.slimeFeed();
					}
					else outputText(allBreastsDescript() + ".  Thankfully it doesn't seem to have much effect.");
					break;
				default: //Crotch
					if (player.vaginas.length > 0) {
						outputText("crotch.  The gooey demon-seed oozes and slides over you with a mind of its own, forcing its way past your " + player.armorName + " and into your " + player.vaginaDescript(0) + ".  You can feel it moving around inside you, doing its best to prepare you for its master.");
						game.dynStats("lus", 3);
						if (!player.hasStatusEffect(StatusEffects.DemonSeed))
							player.createStatusEffect(StatusEffects.DemonSeed, 5, 0, 0, 0);
						else player.addStatusValue(StatusEffects.DemonSeed, 1, 8);
						player.slimeFeed();
					}
					else outputText("crotch.  Thankfully, it doesn't seem to have much effect.");
			}

			lust -= 10;
			if (lust < 0) lust = 10;
		}

		override protected function performCombatAction():void
		{
			var actionChoices:MonsterAI = new MonsterAI();
			actionChoices.add(cockTripAttack, 1, true, 10, FATIGUE_MAGICAL,RANGE_MELEE);
			actionChoices.add(spoogeAttack, 1, true, 10, FATIGUE_PHYSICAL,RANGE_RANGED);
			actionChoices.add(eAttack, 1, true, 0, FATIGUE_NONE,RANGE_MELEE);
			actionChoices.exec();

		}

		public function IncubusMechanic() {
			this.a = "the ";
			this.short = "incubus mechanic";
			this.imageName = "incubusmechanic";
			this.long = "The demon before you is clad only in cut-off denim overalls.  Covered in stains of oil and other strange fluids, they appear to be in pretty rough shape.  There is a large hole ripped in the crotch, allowing the demon's foot-long member to hang free.  His skin is light purple and perfect, contrasting with the slovenly appearance of his clothing.  His face is rugged and handsome, topped with a simple black ponytail and two large horns that sprout from his forehead like twisted tree-trunks.  He wears a narrow goatee on his chin that is kept skillfully braided.  A cocky smile always seems to grace his features, giving him an air of supreme confidence.";
			this.race = "Demon";
			// this.plural = false;
			this.createCock(12,1.75,CockTypesEnum.DEMON);
			this.balls = 2;
			this.ballSize = 2;
			this.cumMultiplier = 3;
			// this.hoursSinceCum = 0;
			createBreastRow(0);
			this.ass.analLooseness = Ass.LOOSENESS_STRETCHED;
			this.ass.analWetness = Ass.WETNESS_SLIME_DROOLING;
			this.tallness = rand(9) + 70;
			this.hips.rating = Hips.RATING_AMPLE;
			this.butt.rating = Butt.RATING_TIGHT;
			this.lowerBody.type= LowerBody.DEMONIC_CLAWS;
			this.skin.tone = "light purple";
			this.hair.color = "black";
			this.hair.length = 12;
			initStrTouSpeInte(65, 40, 45, 85);
			initLibSensCor(80, 70, 80);
			this.weaponName = "claws";
			this.weaponVerb="claw";
			this.weaponAttack = 10;
			this.weaponPerk = [];
			this.weaponValue = 150;
			this.armorName = "demonic skin";
			this.armorDef = 10;
			this.bonusHP = 150;
			this.lust = 50;
			this.lustVuln = .5;
			this.temperment = TEMPERMENT_LOVE_GRAPPLES;
			this.level = 8;
			this.drop = new WeightedDrop(consumables.GROPLUS, 1);
			this.gems = rand(25) + 10;
			this.additionalXP = 50;
            if (flags[kFLAGS.D3_DISCOVERED] > 0) {
                this.gems += rand(25) + 50;
				this.additionalXP += 50;
				this.level += 13;
				this.bonusHP += 225;
				this.str += 25;
				this.tou += 20;
				this.spe += 15;
				this.inte += 20;
				this.weaponAttack += 5;
				this.HP = maxHP();
			}
			/*this.special1 = cockTripAttack;
			this.special2 = spoogeAttack;*/
			this.tail.type = Tail.DEMONIC;
			this.wings.type = Wings.BAT_LIKE_TINY;
			checkMonster();
		}
	}
}


code:
package classes.Scenes.Dungeons.Factory
{
	import classes.*;
	import classes.BodyParts.*;
	import classes.Scenes.Dungeons.Factory;
	import classes.internals.*;

	public class OmnibusOverseer extends Monster
	{
		public var factory:Factory = new Factory()
		private var temp:Number = 0;

		override public function defeated(hpVictory:Boolean):void
		{
			factory.omnibusOverseer.winAgainstOmnibus();
		}

		override public function won(hpVictory:Boolean, pcCameWorms:Boolean = false):void
		{
			if (pcCameWorms){
				outputText("\n\nYour foe doesn't seem to care...");
				doNext(game.combat.endLustLoss);
			} else {
				factory.omnibusOverseer.doLossOmnibus();
			}
		}

		private function lustAura():void {
			outputText("The demoness blinks her eyes closed and knits her eyebrows in concentration.  The red orbs open wide and she smiles, licking her lips.   The air around her grows warmer, and muskier, as if her presence has saturated it with lust.");
			if (hasStatusEffect(StatusEffects.LustAura)) {
				outputText("  Your eyes cross with unexpected feelings as the taste of desire in the air worms its way into you.  The intense aura quickly subsides, but it's already done its job.");
				game.dynStats("lus", (8 + int(player.lib / 20 + player.cor / 25)));
			}
			else {
				createStatusEffect(StatusEffects.LustAura, 0, 0, 0, 0);
			}

		}

		private function milkAttack():void {
			if (rand(2) == 0)
				outputText("The demoness grips her sizable breasts and squeezes, spraying milk at you.\n");
			else outputText("Your foe curls up to pinch her nipples, tugging hard and squirting milk towards you.\n");
			if ((player.spe > 50 && rand(4) == 0) || (player.findPerk(PerkLib.Evade) >= 0 && rand(3) == 0) || (player.findPerk(PerkLib.Misdirection) >= 0 && rand(4) == 0 && player.armorName == "red, high-society bodysuit")) {
				outputText("You sidestep the gushing fluids.");
			}
			//You didn't dodge
			else {
				if (rand(2) == 0) {
					outputText("The milk splatters across your face and chest, soaking you with demonic cream.  Some managed to get into your mouth, and you swallow without thinking.  It makes you tingle with warmth.  ");
				}
				else {
					outputText("The milk splashes into your " + player.armorName + ", soaking you effectively.  ");
					if (player.cocks.length > 0) {
						outputText("Your " + player.cockDescript(0) + " gets hard as the milk lubricates and stimulates it.  ");
						game.dynStats("lus", 5);
					}
					if (player.vaginas.length > 0) {
						outputText("You rub your thighs together as the milk slides between your pussy lips, stimulating you far more than it should.  ");
						game.dynStats("lus", 5);
					}
				}
				player.takeLustDamage(7 + player.sens / 20, true);
				if (player.biggestLactation() > 1) outputText("Milk dribbles from your " + player.allBreastsDescript() + " in sympathy.");
			}

		}

		override protected function performCombatAction():void
		{
			var actionChoices:MonsterAI = new MonsterAI();
			actionChoices.add(lustAura, 1, true, 10, FATIGUE_MAGICAL,RANGE_RANGED);
			actionChoices.add(milkAttack, 1, true, 10, FATIGUE_PHYSICAL,RANGE_RANGED);
			actionChoices.add(eAttack, 1, true, 0, FATIGUE_NONE,RANGE_MELEE);
			actionChoices.exec();

		}
		public function OmnibusOverseer()
		{
			this.a = "the ";
			this.short = "Omnibus Overseer";
			this.imageName = "omnibusoverseer";
			this.long = "The 'woman' before you is clothed only in a single strip of fabric that wraps around her bountiful chest.  She has striking red eyes that contrast visibly with her blue skin and dark make-up.  Shiny black gloss encapsulates her kissable bubbly black lips.  Her most striking feature is her crotch, which appears neither male nor female.  She has a puffy wet vulva, but a cock-shaped protrusion sprouts from where a clit should be.";
			this.race = "Demon";
			// this.plural = false;
			this.createCock(10,1.5);
			this.balls = 0;
			this.ballSize = 0;
			this.cumMultiplier = 3;
			// this.hoursSinceCum = 0;
			this.createVagina(false, Vagina.WETNESS_DROOLING, Vagina.LOOSENESS_NORMAL);
			createBreastRow(Appearance.breastCupInverse("DD"));
			this.ass.analLooseness = Ass.LOOSENESS_TIGHT;
			this.ass.analWetness = Ass.WETNESS_SLIME_DROOLING;
			this.tallness = rand(9) + 70;
			this.hips.rating = Hips.RATING_AMPLE+2;
			this.butt.rating = Butt.RATING_TIGHT;
			this.lowerBody.type= LowerBody.DEMONIC_HIGH_HEELS;
			this.skin.tone = "light purple";
			this.hair.color = "purple";
			this.hair.length = 42;
			initStrTouSpeInte(65, 45, 45, 85);
			initLibSensCor(80, 70, 80);
			this.weaponName = "claws";
			this.weaponVerb="claw";
			this.weaponAttack = 10;
			this.weaponPerk = [];
			this.weaponValue = 150;
			this.armorName = "demonic skin";
			this.armorDef = 15;
			this.bonusHP = 200;
			this.lust = 20;
			this.lustVuln = 0.75;
			this.temperment = TEMPERMENT_LOVE_GRAPPLES;
			this.level = 8;
			this.gems = rand(25) + 10;
			this.additionalXP = 75;
			this.drop = new WeightedDrop(null, 1);
			/*this.special1 = lustAura;
			this.special2 = milkAttack;*/
			this.wings.type = Wings.BAT_LIKE_TINY;
			this.tail.type = Tail.DEMONIC;
			this.createPerk(PerkLib.ImprovedSelfControl, 0, 0, 0, 0);
			checkMonster();
		}

	}

}


code:
package classes.Scenes.Dungeons.Factory
{
	import classes.*;
	import classes.BodyParts.*;
import classes.Scenes.Monsters.AbstractSuccubus;
	import classes.Scenes.Dungeons.Factory;
	import classes.internals.*;
	import classes.GlobalFlags.kGAMECLASS;
import classes.lists.Gender;

public class SecretarialSuccubus extends AbstractSuccubus
	{
		public var factory:Factory = new Factory()

		override public function defeated(hpVictory:Boolean):void
		{
			if (player.gender > 0) {
				clearOutput();
				if (hpVictory) {
					outputText("You smile in satisfaction as the " + short + " collapses, unable to continue fighting.  Now would be the perfect opportunity to taste the fruits of her sex-ready form...\n\nDo you rape her?");
					player.takeLustDamage(1, true);
					game.output.doYesNo(factory.secretarialSuccubus.doRapeSuccubus, factory.secretarialSuccubus.doLeaveSuccubus)
					if (player.hasKeyItem("Deluxe Dildo")) game.output.addButton(2, "Dildo Rape", factory.secretarialSuccubus.dildoSuccubus);
				} else if (player.lust >= 33) {
					outputText("You smile in satisfaction as the " + short + " gives up on fighting you and starts masturbating, begging for you to fuck her.  Now would be the perfect opportunity to taste the fruits of her sex-ready form...\n\nDo you fuck her?");
					player.takeLustDamage(1, true);
					game.output.doYesNo(factory.secretarialSuccubus.doRapeSuccubus, factory.secretarialSuccubus.doLeaveSuccubus)
					if (player.hasKeyItem("Deluxe Dildo")) game.output.addButton(2, "Dildo Rape", factory.secretarialSuccubus.dildoSuccubus);
                    game.setSexLeaveButton(factory.secretarialSuccubus.doLeaveSuccubus,"Leave",14,Gender.HERM,30);

				} else {
					doNext(factory.secretarialSuccubus.doLeaveSuccubus);
				}
			} else {
				doNext(factory.secretarialSuccubus.doLeaveSuccubus);
			}
		}

		override public function won(hpVictory:Boolean, pcCameWorms:Boolean = false):void
		{
			if (pcCameWorms){
				outputText("\n\nYour foe doesn't seem to care...");
				doNext(game.combat.endLustLoss);
			} else {
				doNext(factory.secretarialSuccubus.doLossSuccubus);
			}
		}

		override protected function performCombatAction():void
		{
			var actionChoices:MonsterAI = new MonsterAI();
			actionChoices.add(kissAttack, 1, true, 10, FATIGUE_NONE,RANGE_TEASE);
			actionChoices.add(seduceAttack, 1, true, 10, FATIGUE_PHYSICAL,RANGE_TEASE);
			actionChoices.add(whipAttack, 1, true, 10, FATIGUE_PHYSICAL,RANGE_RANGED);
			actionChoices.add(eAttack,1,true,0,FATIGUE_NONE,RANGE_MELEE);
			actionChoices.exec();

		}

		public function SecretarialSuccubus() {
			this.a = "the ";
			this.short = "secretarial succubus";
			this.imageName = "secretarialsuccubus";
			this.long = "The succubus across from you balances gracefully on her spiked heels, twirling and moving unpredictably.  Sexy dark stockings hug every curve of her perfectly shaped flesh until they disappear into her tiny miniskirt.  Her impressive breasts wobble delightfully as she moves, despite the inadequate efforts of her straining vest.  A pair of cute little nubs poke out from her otherwise perfect face and forehead, wreathed in lustrous blonde hair.  The very air around her is filled with an unidentifiable fragrance that makes you tingle and shiver.";
			this.race = "Demon";
			// this.plural = false;
			this.createVagina(false, Vagina.WETNESS_SLAVERING, Vagina.LOOSENESS_NORMAL);
			this.createStatusEffect(StatusEffects.BonusVCapacity, 30, 0, 0, 0);
			createBreastRow(Appearance.breastCupInverse("DD"));
			this.ass.analLooseness = Ass.LOOSENESS_STRETCHED;
			this.ass.analWetness = Ass.WETNESS_SLIME_DROOLING;
			this.tallness = rand(9) + 60;
			this.hips.rating = Hips.RATING_CURVY;
			this.butt.rating = Butt.RATING_LARGE+1;
			this.lowerBody.type= LowerBody.DEMONIC_HIGH_HEELS;
			this.skin.tone = "blue";
			this.hair.color = "blond";
			this.hair.length = 13;
			initStrTouSpeInte(50, 40, 75, 35);
			initLibSensCor(80, 70, 80);
			this.weaponName = "claws";
			this.weaponVerb="slap";
			this.weaponAttack = 10;
			this.weaponPerk = [];
			this.weaponValue = 150;
			this.armorName = "demonic skin";
			this.armorDef = 4;
			this.bonusHP = 100;
			this.lust = 30;
			this.temperment = TEMPERMENT_LOVE_GRAPPLES;
			this.level = 7;
			this.gems = rand(25) + 10;
			this.additionalXP = 50;
			this.drop = new WeightedDrop(consumables.LACTAID, 1);
			this.wings.type = Wings.BAT_LIKE_TINY;
			this.tail.type = Tail.DEMONIC;
			/*this.special1 = kissAttack;
			this.special2 = seduceAttack;
			this.special3 = whipAttack;*/
			checkMonster();
		}

	}

}