-- Colours: 	210,87,116 (Pink)
--			71,167,191 (Blue)

function Intro()
	setvar("Ice Blaster Xp Needed",ICE_BLASTER_START_XP);
	setvar("Glacier Launcher Xp Needed",GLACIER_LAUNCHER_START_XP);
	setvar("Snow Bouncer Xp Needed",SNOW_BOUNCER_START_XP);
	setvar("Laser Cannon Xp Needed",LASER_CANNON_START_XP);
	hidetextinstant();
	w(15);
	showtext();
	chnm("You");
	chav("You");
	s("Ah another day atop my Mountain top lab, soon I should have the *winter machine* completed!");
	s("Soon every little child will awaken and find snow on their windowsills... They'll leap out of bed and go outside and play!");
	chav("Bently");
	chnm("Bently");
	s("Ah sir you are quite the evil genius!");
	chnm("You");
	chav("You Evil Laugh");
	s("This scheme, it's brilliant! Mwahahahahaha!");
	chav("Bently Shocked");
	chnm("Bently");
	s("Sir! Incoming threat detected!");
	chav("You Shocked");
	chnm("You");
	s("What?! What could it be!?");
	snd("damage.ogg",100);
	getnpcpos("Pot","POTX","POTY");
	cam(POTX,POTY);
	chav("Pot");
	chnm("Companion Pot");
	s("Aha!");
	s("Now I've got you!");
	chav("You Shocked");
	chnm("You");
	s("C-c-c-c-companion pot?!");
	chav("Pot");
	chnm("Companion Pot");
	s("Yes, yes it is I - the pot of companionship!");
	s("Former *bestest buddy* I have come to stop your evil plans!");
	chav("You Shocked");
	chnm("You");
	s("Evil...? I'm only making a *winter machine*.");
	chav("Pot");
	chnm("Companion Pot");
	s("Don't you try to brainwash me! Quick *VEXAL* get him!");
	snd("damage.ogg",100);
	bang(POTX-22,POTY-9);
	setnpcpos("Vexal",POTX-22,POTY-9);
	chav("Vexal");
	chnm("Vexal");
	s("Sir yes sir!");
	chav("You Shocked");
	chnm("You");
	s("Wait what? Don't you touch my lab!");
	s("It might just be the auxiliary lab but I'm not letting you destroy all my work.");
	chav("Vexal");
	chnm("Vexal");
	s("_*BATTLE SEQUENCE INITIATED*");
	chav("You");
	chnm("You");
	s("Brace yourself *bently*!");
	chav("Bently");
	chnm("Bently");
	s("Battle systems online sir! *Ice Blaster* equipped!");
	getframe("FRAME");
	frame(FRAME + 1);
	endtext();
end

function ItsNoUseSir()
	chav("Bently");
	chnm("Bently");
	getnpcpos("Vexal","X","Y");
	showarrow(X,Y-16,0);
	s("Sir! He seems to be employing some form of shield!");
	s("There must be a way to disrupt it, look around!");
	getnpcpos("Switch","X","Y");
	cam(X,Y);
	s("Maybe that *switch* could be of some assistance?");
	showarrow(X,Y+16,180);
	s("Remember to use the action button!");
	hidearrow();
	endtext();
end

function BeatVexal()
	hidetextinstant();
	getnpcpos("Vexal","X","Y");
	bang(X,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-16);
	snd("damage.ogg",100);
	w(5);
	showtext();
	chnm("Vexal");
	chav("Vexal");
	s("Aargh! Sir this one is strong!");
	chav("Bently");
	chnm("Bently");
	s("Threat levels decreasing sir!");	
	chav("Pot");
	chnm("Companion Pot");
	s("Hah no matter *vexal* I've alreay set the bomb!");
	s("I'm sorry bestest buddy, it didn't have to be like this!");
	chav("You Shocked");
	chnm("You");
	s("What? A bomb?!");
	s("How did you even set a bomb?! You're a *pot*?");
	chnm("Vexal");
	chav("Vexal");
	s("I'm outta here!");
	getnpcpos("Vexal","VX","VY");
	bang(VX-8,VY-8);
	snd("damage.ogg",100);
	npckill("Vexal");
	npckill("Vexal Shield");
	npckill("Pot");
	chav("Bently");
	chnm("Bently");
	s("There's no time for this sir! Run for the door!");
	getframe("Frame");
	frame(Frame+1);
	endtext();
end

function NoThroughDoor()
	chnm("Bently");
	chav("Bently");
	s("I don't think that's a very good idea sir.");
	s("There seems to be gaping chasm where that room used to be...");
	endtext();
end

function SkyDragonEggs()
	chav("Bently");
	chnm("Bently");
	s("Sir, if the worms have escaped... I don't think heading into the *Sky Dragon Egg Chamber* is a good idea...");
	s("They might be... Angry... And hatched...");
	endtext();
end

function WormEscape()
		chnm("Bently");
		chav("Bently");
		s("Sir! The *worms* seem to have escaped from their cages!");
		chav("You Shocked");
		chnm("You");
		s("Damn! Will I ever know why they hate me?!");
		chnm("Bently");
		chav("Bently");
		s("I am unsure sir, perhaps you smell like *worm food*?");
		s("Do you know what that just up-ahead is sir?");
		yn("DOIKNOWSTUFF","No, refresh my memory","I most certainly do");
		if (DOIKNOWSTUFF == 0) then
			s("Very well sir, on we go.");
			setvar("WormEscape",1);
			endtext();		
		else
			getnpcpos("Save","X","Y");
			showarrow(X,Y-16,0);
			s("Just ahead is a *save point*.");
			s("This will let you save your progress, and allow you to resurrect yourself from the grave upon an untimely - or even timely - death.");
			getnpcpos("Food","X","Y");
			showarrow(X,Y-16,0);
			s("Next to that, is a *health restore point* these fries found on the *underside* of the planet have since made their way all around the globe.");
			s("Do try some sir!");
			hidearrow();
			chnm("You");
			chav("You");
			s("Thanks for the lesson, *bently*...");
			chnm("Bently");
			chav("Bently");
			s("Your welcome sir, any time.");
			setvar("WormEscape",1);
			endtext();
		end
end
	
function SpikeTowerSign()
	chnm("Sign");
	chav("Sign");
	s("Welcome to the spike tower, remember to *look downwards*!");
	chnm("Bently");
	chav("Bently");
	s("Ah yes sir, remember you can look both upwards and downwards using the *up* and *down* keys!");
	chav("You");
	chnm("You");
	s("Wonderful, simply wonderful.");
	endtext();
end

function SpikePitSign()
	chnm("Sign");
	chav("Sign");
	s("This is the infamous *spike pit*!");
	s("Known throughout the land for being the least accessible way into a lab ever.");
	endtext();
end

function SystemFail()
	chnm("Bently");
	chav("Bently");
	s("Sir! Are you aware that holding the *Jump* button will allow you to jump higher?");
	chav("You");
	chnm("You");
	s("You only tell me this now? What kind of useless system are you!");
	chnm("Bently");
	chav("Bently");
	s("...");
	s("On we go...");
	setvar("SystemFail",1);
	endtext();
end

function SwitchInfo()
	chnm("Bently");
	chav("Bently");
	s("Do you see that *switch* up ahead sir?");
	getnpcpos("Switch","X","Y");
	showarrow(X,Y-16,0);
	s("My primary scanner suggests that it is a *block master* series, a 3000 if I'm not mistaken.");
	s("Upon activation these devices have been known to alter the environment around them for a limited period of time.");
	s("I can tap into their system and display the time limit for you sir.");
	hidearrow();
	chav("You");
	chnm("You");
	s("Sounds useful - I did build you, you know.");
	s("I am aware of a good portion of your features.");
	chnm("Bently");
	chav("Bently");
	s("If you say so...");
	s("Sir...");
	setvar("SwitchInfo",1);
	endtext();
end

function ExitLab()
	chnm("Bently");
	chav("Bently");
	s("Sir, you're about to leave the lab...");
	s("Are you sure you want to face... *the general public*.");
	s("I've heard, sir, that they don't bathe...");
	chav("You");
	chnm("You");
	s("Don't worry *bently*.");
	s("We'll... We'll be ok... I think...");
	setvar("ExitLab",1);
	endtext();
end

function RedRobot()
	getvar("RedRobot","REDROBOT");
	if (REDROBOT == 0) then
		chnm("Red Eyed Robot");
		chav("Red Robot");
		s("Welcomes you to house mine...");
		s("Wish for thing what do we?");
		s("Ke-ke-ke... Ke...");
		chnm("You");
		chav("You");
		s("Err, pardon?");
		chnm("Red Eyed Robot");
		chav("Red Robot");
		s("We spoked, which want you do?");
		chnm("Bently");
		chav("Bently");
		s("Sir, he err, seems to be asking what you want...");
		chnm("You");
		chav("You");
		s("Oh... Well, there were these locks... And one was red...");
		s("And there was a red door... And I went through... And then you were here...");
		chnm("Red Eyed Robot");
		chav("Red Robot");
		s("Oh guess! This is correcting!");
		s("Lock be vanish now if you wishing?");
		chnm("You");
		chav("You");
		s("Yes please...");
		chnm("Red Eyed Robot");
		chav("Red Robot");
		s("Done be it!");
		s("Now travel you far!");
		s("Sees you again us perhaps will be maybe...");
		chnm("You");
		chav("You");
		s("Perhapses... I mean, urgh, bye.");
		setvar("RedRobot",1);
		endtext();
	end
	if (REDROBOT == 1) then
		chnm("Red Eyed Robot");
		chav("Red Robot");
		s("Oh-ho such the funs meeting them peoples...");
		s("Hopes they bring foods nexts time...");
		s("Oh the mans! He be here, *SLEEP MODE ACTIVE*");
		setvar("RedRobot",2);
		endtext();
	end
	if (REDROBOT == 2) then
		chnm("Red Eyed Robot");
		chav("Red Robot");
		s("Sleep Mode active... Ke-ke-ke... Ke... Ke...");
		endtext();
	end
end

function Snowing()
	chnm("Bently");
	chav("Bently");
	s("Great Scott Sir!");
	s("It seems to be snowing!");
	chav("You Shocked");
	chnm("You");
	s("That's... That's... Impossible!");
	s("I'm the only person with a *Winter Machine* powerful enough to make it snow *inside*");
	chnm("Bently");
	chav("Bently");
	s("Never mind that sir! My scans indicate that the snow is increasing the power of hostile lifeforms in the area!");
	chav("You Shocked");
	chnm("You");
	s("It's worse than I thought... Well Bently...");
	s("It's *Battle Time*!");
	setvar("Snowing",1);
	endtext();
end
	

function BlueRobotHouseSign()
	chnm("Sign");
	chav("Sign");
	s("The home of the almighty Blue Eyed Robot.");
	s("Please wipe feet before entering.");
	endtext();
end

function BlueRobotIntro()
	chnm("Blue Eyed Robot");
	chav("Blue Robot");
	s("Ehe! Finally some company around here!");
	hidetext();
	w(10);
	npcanim("Blue Robot",7);
	w(90);
	showtext();
	s("I've been alone for so long!");
	s("What brings you by my humble abode?");
	chnm("You");
	chav("You");	
	s("Well, there's this blue lock blocking my way...");
	chnm("Blue Eyed Robot");
	chav("Blue Robot");
	s("Oh that silly thing! Yes well, I'll get rid of that right away... If you do me a favour.");
	yn("DOAFAVOUR","Sure!","Err, what do I have to do?");
	if (DOAFAVOUR == 1) then
		s("Oh excellent! Just go into my basement and kill the monster there please!");
		chnm("You");
		chav("You Shocked");	
		s("W-w-w-w-what?!");
		s("A monster!?");
		s("F-f-fine... I'll go...");
		setvar("BlueRobotIntro",1);
		setvar("BlueRobot",1);
		endtext();
	else
		s("You just have to kill the thing in my basement!");
		chnm("You");
		chav("You");	
		s("Sounds simple enough.");
		s("Alright, I'll be back in a bit!");
		setvar("BlueRobotIntro",1);
		setvar("BlueRobot",1);
		endtext();
	end
end

function BlueRobot()
	getvar("BlueRobot","BR");
	chnm("Blue Eyed Robot");
	chav("Blue Robot");
	if (BR == 1) then
		s("Off to kill that monster then aren't you?");
		endtext();
	end
	if (BR == 2) then
		s("Oh terrifical! You have cleaned the basement monsters right out!");
		s("The lock should be gone now, but please *PLEASE* visit me again!");
		chnm("You");
		chav("You");	
		s("S-s-sure... Erm... Buh-Bye...");
		s("I'll put on my to-do list.");
		s("Just below *die painful death*");
		setvar("BlueRobot",3);
		endtext();
	end
	if (BR == 3) then
		s("Hello! Enjoying that lack of lock are we?");
		endtext();
	end
end

function Ghostie()
	getvar("Ghost Chat","GC");
	if (GC == 0) then
		chnm("Bell");
		chav("Bell");
		snd("BELL06.WAV",100);
		s("DING DONG!!!!");
		getnpcpos("GhostieSleep","X","Y");
		npckill("GhostieSleep");
		func("Ghostie");
		bang(X-8,Y-8);
		snd("damage.ogg",100);
		chnm("???");
		chav("Ghostie");
		s("Who dares wake me!?");
		chnm("You");
		chav("You Shocked");	
		s("Err... It was the bell!");	
		chnm("???");
		chav("Ghostie");
		s("I am *ghostie* king amongst ghosts!");
		chnm("Ghostie");
		s("I can see through your lies!");
		s("Who sent you here?");
		chnm("You");
		chav("You");	
		s("The *Blue Robot*.");
		chav("Ghostie");
		chnm("Ghostie");
		s("No! Not another of his hired goons...");
		s("Well time to kill you I guess...");
		chnm("You");
		chav("You Shocked");	
		s("Wait what? *another*?");
		chav("Ghostie");
		chnm("Ghostie");
		s("Oh shut up, let's finish this up already I have places to be...");
		func("GhostieBattle");
		setvar("Ghost Chat",1);
		endtext();
	end
	if (GC == 1) then
		chav("Bell");
		chnm("Bell");
		s("I already said *ding dong* what more do you want?");
		endtext();
	end
end

function GhostieDead()
	chav("Ghostie Sad");
	chnm("Ghostie");
	tcol(255,0,0);
	s("ARRRRGGGGHHHHH!");
	tres();
	hidetext();
	getnpcpos("Ghostie","X","Y");
	bang(X,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-16);
	snd("damage.ogg",100);
	w(5);
	npckill("Ghostie");
	bang(32,144);
	makeblock(32,144);
	bang(0,176);
	makeblock(0,176);
	bang(64,176);
	makeblock(64,176);
	bang(80,176);
	makeblock(80,176);
	bang(144,176);
	makeblock(144,176);	
	bang(160,176);
	makeblock(160,176);
	bang(224,176);
	makeblock(224,176);
	bang(240,176);
	makeblock(240,176);
	bang(304,176);
	makeblock(304,176);
	showtext();
	chav("Bently");
	chnm("Bently");
	s("Terrific work, sir!");
	s("You showed record levels of Ghost slaying just now!");
	setvar("KilledGhostie",1);
	setvar("BlueRobot",2);
	endtext();
end

function RunOverGap()
	chav("Bently");
	chnm("Bently");
	s("Um, sir?");
	chav("You Shocked");
	chnm("You");
	s("What!? You're still here???");
	chav("Bently");
	chnm("Bently");
	s("Yes, sir...");
	getnpcpos("Spike","X","Y");
	showarrow(X,Y-16,0);
	s("You see, sir, it would appear you are incapable of jumping the spikes with this low ceiling.");
	s("However, sir, your standard walking speed coupled with your jumping ability will be sufficient enough to clear the gap!");
	hidearrow();
	chav("You");
	chnm("You");
	s("Aah so you mean...");
	s("Like it always has been?!");
	chav("Bently");
	chnm("Bently");
	s("...");
	s("...Yes. Precisely, sir...");
	setvar("RunOverGap",1);
	endtext();
end

function HairGuy()
	getvar("HairGuy","HG");
	if (HG == 0) then
		chnm("Hair Guy");
		chav("Hair Guy");
		s("Oh hey there!");
		s("Listen, could you do me a favour?");
		s("See, I was exploring these here caves, for fun of course...");
		s("When all of a sudden! Out pops a worm, the little devil scared me so much!");
		s("I then realised that my *hair* was missing!");
		chav("You");
		chnm("You");
		s("Ah! So the worms hate you too?");
		s("This could be a breakthrough in my research!");
		chnm("Hair Guy");
		chav("Hair Guy");
		s("EHEM! As I was saying...");
		s("So I blocked off the exit to stop any passers escaping with it.");
		s("You couldn't find it for me could you?");
		yn("FINDHAIR","Sure Thing!","Not another favour...");
		if (FINDHAIR == 1) then
			chav("You");
			chnm("You");
			s("Sure, but what's in it for me?");
			chnm("Hair Guy");
			chav("Hair Guy");
			s("I'll let you through here of course!");
			chav("You");
			chnm("You");
			s("Well... Off I go I guess...");
			setvar("HairGuy",1);
			endtext();
		else
			chav("You");
			chnm("You");
			s("Why does *everyone* want favours these days?");
			s("What happened to good old-fasioned courtesy?");
			chnm("Hair Guy");
			chav("Hair Guy");
			s("Yeah well, no hair equals no passing.");		
			chav("You");
			chnm("You");
			s("...");
			s("Why even ask me?");
			s("Why give me an option...");
			s("You... I... Urgh.. Fine I'll do it.");
			setvar("HairGuy",1);
			endtext();
		end
	end	
	if (HG == 1) then
		chnm("Hair Guy");
		chav("Hair Guy");
		s("Please find my hair... *please*...");
		endtext();
	end
	if (HG == 2) then
		chnm("Hair Guy");
		chav("Hair Guy");
		s("My hair! I'll never again let my hair be free, man.");
		chav("You");
		chnm("You");
		s("Yeah, right, whatever. Let me past.");
		chnm("Wiggypoo");
		chav("Wiggypoo");
		s("B-B-But... You said... You said we would play hide and seek!");
		s("You lied!");
		chav("You");
		chnm("You");
		s("We... We can still play! You wait here and I'll go hide ok?");
		s("Count to 9999999");
		chav("You Evil Laugh");
		s("Mwahahaha...");
		chnm("Hair Guy");
		chav("Hair Guy 2");
		setvar("HairGuyHairOn",1);
		s("Alright, well, I'm outta here!");
		tcol(255,0,0);
		s("_*WIG-TELEPORT ACTIVATE*!");
		tres();
		getnpcpos("Hair Guy","X","Y");
		bang(X,Y);
		npckill("Hair Guy");
		snd("damage.ogg",100);
		bang(1696,384);
		takeitem("wig");
		setvar("HairGuy",3);
		endtext();
	end
end

function Hair()
	chnm("???");
	chav("Wiggypoo");
	s("You found me!");
	s("Yaaaaaaaaaaaaaaaaaaaaaaaaaaay!");
	s("Now it's your turn to hide and mine to seek!");
	chav("You");
	chnm("You");
	s("...");
	s("Erm... What?");
	chav("Bently");
	chnm("Bently");
	s("Sir, it seems to be part of the new generation of talking wigs!");
	chnm("???");
	chav("Wiggypoo");
	s("That I am! The name's *Wiggypoo*");
	chnm("Wiggypoo");
	s("And I'm one bad-@$$ Biatch");
	chav("You WTFing");
	chnm("You");
	s("...");
	s("O.... k...");
	chav("You");
	s("Look... *Wiggypoo*, I've gotta take you back to that balding guy so I can get through.");
	s("So you're coming whether you like it or not.");
	chnm("Wiggypoo");
	chav("Wiggypoo");
	s("That all depends on whether or not...");
	s("We can play hide and seek!");
	chav("You Shocked");
	chnm("You");
	s("S-s-s-sure... Sure we can!");
	chav("Bently Shocked");
	chnm("Bently");
	s("But sir, you hate games - you said so yourself!");
	s("It's why you didn't come to my birthday!");
	chav("Bently Sad");
	s("... Isn't it?");
	chav("You");
	chnm("You");
	s("Shhh!");
	tcol(128,128,128);
	s("I'm just lying!");
	tres();
	chav("Bently Shocked");
	chnm("Bently");
	s("Oooh, quite the deviant aren't we sir?");
	chnm("Wiggypoo");
	chav("Wiggypoo");
	s("Hello? bad-@$$ Biatch here?");
	chav("You");
	chnm("You");
	s("Ah, yes. You.");
	s("Come with us, now.");
	chnm("Wiggypoo");
	chav("Wiggypoo");
	s("Oooooook!");
	additem("wig");
	setvar("HairGuy",2);
	endtext();
end

function Alphonso()
	getvar("Alphonso","A");
	if (A == 0) then
		chnm("???");
		chav("Alphonso");
		s("Ah, you-a-come to *the Alphonso farm* eh?");
		chnm("You");
		chav("You");
		s("Apparently yes...")
		chnm("Alphonso");
		chav("Alphonso");
		s("You-a-stay for dinner eh? Alphonso make you-a-nice-a-meal!");
		s("Keep-a-you fit for-a-travelling eh?");
		chnm("You");
		chav("You");
		s("Er, sure... what are we having?");
		chnm("Alphonso");
		chav("Alphonso");
		s("Alphonso-a-make some of Alphonso's nice-a-pizza eh!");
		s("We can a make a fresh-a-pizza right-a-now if you help Alphonso prepare it!");
		chnm("You");
		chav("You");
		s("Sure, why not...");
		s("What Ingredients do you need then?");
		chnm("Alphonso");
		chav("Alphonso");
		s("Ah, Alphonso-a-needs *mushrooms*, *tomatoes*, *dough*, *cheese* and-a-*meat*.");
		s("You can-a-start with the meat.");
		s("We can use-a-some of Alphonso's own-a-stock, eh?");
		s("You can-a-do the honours!");
		chnm("You");
		chav("You WTFing");
		s("...!");
		setvar("Alphonso",1);
		endtext();
	end
	if (A == 1)  then
		chnm("Alphonso");
		chav("Alphonso");
		s("You got-a-the ingredients-a-yet eh?");
		s("I need-a-the *mushrooms*, *tomatoes*, *dough*, *cheese* and-a-*meat*.");
		checkitem("wormmeat","A");
		checkitem("cheese","B");
		checkitem("dough","C");
		checkitem("tomatoe","D");
		checkitem("mushroom","E");
		if (A == 1 and B == 1 and C == 1 and D == 1 and E == 1) then
			s("Eh! You got-a-the ingredients!");
			s("Alphonso make-a-you a *pizza* now! You come back-a-later and we eat-a-it together!");
			takeitem("wormmeat");
			takeitem("cheese");
			takeitem("dough");
			takeitem("tomatoe");
			takeitem("mushroom");			
			setvar("Alphonso",2);
			endtext();
		else
			endtext();
		end
	end
	if (A == 2) then
		chnm("Alphonso");
		chav("Alphonso");
		s("Come-a-back later and I'll have the *pizza* eh?");
		endtext();
	end
	if (A == 3) then
		chnm("Alphonso");
		chav("Alphonso");
		s("Where you been eh?");
		s("The *pizza* is-a-done!");
		s("We eat-a-dinner now eh?");
		chnm("You");
		chav("You");
		s("Well.. To tell you the truth, I need to be somewhere right now...");
		chnm("Alphonso");
		chav("Alphonso");
		s("Oh...");
		s("Well take-a-the *pizza* with you then, I'm sure you'll enjoy it!");
		s("It, err, tastes-a-better than it looks, eh?");
		s("Bye-bye eh!");
		additem("pizza");
		setvar("Alphonso",4);
		endtext();
	end
	if (A == 4) then
		chnm("Alphonso");
		chav("Alphonso");
		s("Come back and visit me eh?");
		endtext();
	end
end

function Billy()
	getvar("Billy","B");
	if (B == 0) then
		chnm("???");
		chav("Billy");
		s("Ah'm Billy");
		chnm("Billy");
		s("I likes grapes!");
		chnm("You");
		chav("You");
		s("Good for you, Billy...")
		chnm("Bently");
		chav("Bently");
		s("Sir, I don't mean to be rude but this isn't exactly helping us-");
		chav("Billy");
		chnm("Billy");
		s("I has a tomatoe patch out back!");
		s("I likes tomatoes too!");
		chnm("You");
		chav("You Evil Laugh");
		s("Do you just?");
		s("Mind if we take some?");
		chav("Billy");
		chnm("Billy");
		s("Oh, I sorry");
		s("I don'ts gives away me tomatoes");
		chnm("You");
		chav("You");
		s("Oh...");
		s("Well then you wouldn't mind if we just... *borrowed* some?");
		chnm("Billy");
		chav("Billy");
		s("Hmmm... well, I s'pose that's ok!");
		s("Y'all have fun now!");
		setvar("Billy",1);
		endtext();
	end
	if (B == 1) then
		chnm("Billy");	
		chav("Billy");
		s("Ya'll bring them tomatoes back now!");
		endtext();
	end	
end
	
function WormMeat()
	chnm("Worm Meat");
	chav("Worm Meat");
	s("Got the *worm meat*!");
	s("Mmmmmmm... Smells... Like worms I guess!");
	setvar("Worm Meat",1);
	additem("wormmeat");
	endtext();
end

function MassiveWorm()
	chav("Massive Worm");
	chnm("Massive Worm");
	s("Alphonso says I'm his pwemium stock!");
	s("He says he wuvs me the most!");
	endtext();
end

function Bital()
	getvar("Bital","B");
		if (B == 0) then
			chav("Bital");
			chnm("Bital");
			s("Oh hello there my boy!");
			s("Good to see you! It's been a while!");
			s("I'm currently conducting an experiment into the floativity of *chicken*.");
			s("So far, results point to it floating!");
			s("Anyway, what brings you here?");
			chnm("You");
			chav("You");
			s("Well, I was just passing through actually.");
			s("I'm on the way to my secondary lab - that stupid pot blew up my machinery in the old one...");
			chav("Bital");
			chnm("Bital");
			s("Oh rotten luck my boy!");
			s("Well, best of luck to you!");
			setvar("Bital",1);
			getvar("Alphonso","A");
			if (A == 1) then
				s("Oh my boy, by the way!");
				s("I've got this *cheese* left-over from my *cheesy chicken* experiments!");
				s("You can take it, if it's any use to you.");
				additem("cheese");
				chnm("???");
				chav("none");
				s("got the *cheese*!");
				endtext();
			else
				endtext();
			end
		end
		if (B == 1) then
		chav("Bital");
		chnm("Bital");
		s("Good to see you old bean!");
		getvar("Alphonso","A");
		checkitem("cheese","I2");
		if(I2 == 0)then
			if (A == 1) then
				s("I've got this *cheese* left-over from my *cheesy chicken* experiments!");
				s("You can take it, if it's any use to you.");
				additem("cheese");
				chnm("???");
				chav("none");
				s("got the *cheese*!");
				endtext();
			else
				endtext();
			end
		else
			endtext();
		end
	end
end

function Tomatoe()
	getvar("Tomatoe","T");
	if (T == 0) then
		chav("Tomatoe");
		chnm("Tomatoe");
		s("'Sup homies!");
		s("What be pimpin' in yo crib?");
		chav("You Shocked");
		chnm("You");
		s("Erm... Uhh...");
		chav("Tomatoe");
		chnm("Tomatoe");
		s("Oh my man! You did not just go there!");	
		chav("You");
		chnm("You");
		s("Didn't I?");
		chav("Bently");
		chnm("Bently");
		tcol(255,0,0);
		s("_*Language module - GANGSTA activated*");
		tres();
		s("Yo good sir!");
		s("Me and my fellow bro' here be lookin' for some *tomatoe* for our little par-tay.");
		s("You, err, digg? Dawg?");
		chav("Tomatoe");
		chnm("Tomatoe");
		s("Oh my homie! I'm always down for a good party - when's this going down yo?");		
		chav("Bently");
		chnm("Bently");
		s("Why just... pimp... with us now!");	
		s("We'll take you right-on-over there.");
		chav("Tomatoe");
		chnm("Tomatoe");
		s("Sweet holmes, let's get crackin'!");	
		chav("none");
		chnm("???");
		s("got the *tomatoe*!");
		setvar("Tomatoe",1);
		additem("tomatoe");
		chav("You");
		chnm("You");
		s("Phew... Glad that's over...");	
		chav("Bently");
		chnm("Bently");
		s("It most certinaly is - homie.");	
		chav("You Shocked");
		chnm("You");
		s("Bently! Deactivate the language module!");
		chav("Bently");
		chnm("Bently");
		s("You just be hatin' on me 'coz I'm white yo!");		
		chav("You");
		chnm("You");
		s("...");
		s("Let's try the manual override shall we?");
		chav("Bently");
		chnm("Bently");
		s("Yo holmes, get outta there that's ma - *Language module - Proper english activated*.");
		s("Ooh... Sir I feel all... Supa fly...");
		chav("You");
		chnm("You");
		s("...");
		s("Well it's close enough...");
		endtext();
	end
	if (T == 1) then
		chav("none");
		chnm("???");
		s("You here a faint cry of 'Yo homie...'.");
		endtext();
	end
end

function Coach()
	getvar("Coach","C");
	if (C == 0) then
		chnm("Coach");
		chav("Coach");
		s("Yeah, uh, welcome to the Town Gymnasium I guess...");
		chnm("You");
		chav("You");
		s("A gym, eh?");
		s("Seems a bit bare to be a gym...");
		chnm("Coach");
		chav("Coach");
		s("Oho, this ain't your ordinary gym, boy!");
		s("See that switch behind me?");
		chnm("You");
		chav("You Evil Laugh");
		s("With great difficulty but yes, I can.");
		chnm("Coach");
		chav("Coach");
		s("Well, flick that switch and an obstacle course leading to the top of the building will appear!");
		s("But you must be fast, or time will run out and the course will vanish!");
		s("Only the fittest can make it to the top in the right time!");
		chnm("You");
		chav("You");
		s("Oh, okay.")
		s("Just out of curiousity, have you ever made it to the top?");
		chnm("Coach");
		chav("Coach");
		s("I'm here to run this joint, boy, not use it for myself.");
		s("Though, why do you ask?");
		chnm("You");
		chav("You");
		s("...");
		s("Oh, no particular reason...");
		setvar("Coach",1);
		endtext();
	end
	if (C == 1) then
		chnm("Coach");
		chav("Coach");
		s("Hurry up! I wanna close up and try to make it over to *Alphonso's* for a *pizza*!");
		endtext();
	end
end

function MushroomSign()
	chnm("Sign");
	chav("Sign");
	s("This is the cave of *the great mushroom*.");
	s("Approach him if you have a question for him.");
	endtext();
end

function Mushroom()
	chnm("Great Mushroom");
	chav("Great Mushroom");
	s("Who dares approach the great mushroom!?");
	s("Do you have a question!?");
	chav("You Shocked");
	chnm("You");
	s("Err, no...");
	chnm("Great Mushroom");
	chav("Great Mushroom");
	s("Such ignorance!?");
	s("You mush be crushed!");
	setvar("Mushroom",1);
	func("Mushroom");
	endtext();
end
	
function MushroomDead()
	chnm("Great Mushroom");
	chav("Great Mushroom");
	s("Who dares slay the great mushroom!?");
	s("Nooooooo!!!");
	setvar("MushroomDead",1);
	endtext();
end

function MushroomItem()
	chnm("Mushroom");
	chav("Mushroom");
	s("Got the *mushroom*!");
	additem("mushroom");
	setvar("MushroomItem",1);
	endtext();
end

function Jessica()
	getvar("Jessica","J");
	if (J == 0) then
		chav("Jessica");
		chnm("???");
		s("Hey there.");
		s("I haven't seen you around here before, have I?");
		chav("You Blush");
		chnm("You");
		s("Uhhh... N-no I'm just passing through.");
		chav("Jessica");
		chnm("???");
		s("Well, it's nice to meet you.");
		s("My name's *Jessica*.");
		chnm("Jessica");
		s("I run the local bakery.");
		getvar("Alphonso","A");
		if (A == 1) then
			chav("You");
			chnm("You");
			s("Oh, a bakery you say?");
			s("You don't have any spare *dough* by chance do you?");
			chav("Jessica");
			chnm("Jessica");
			s("I sure do, we can go out back and look for it...");
			s("If you know what I mean?");
			chav("You Blush");
			chnm("You");
			s("Uhh... Ahh... Err.. ");
			chav("Jessica");
			chnm("Jessica");
			s("Oh...");
			s("I understand...");
			chav("Jessica Cry");
			s("You don't think I'm attractive do you?!");
			s("It's my lack of nose isn't it?!");
			s("Well take your *dough* and get out! Don't come back here!!");
			chav("None");
			chnm("???");
			spic("DoughBig");
			s("Got *Dough*!");
			additem("dough");
			hpic();
			setvar("Jessica",2);
			endtext();
		else
			s("If you need anything be sure to drop by!");
			setvar("Jessica",1);
			endtext();
		end
	end
	if (J == 1) then
		getvar("Alphonso","A");
		chav("Jessica");
		chnm("Jessica");
		s("Do you need something?");
		if (A == 1) then
			chav("You");
			chnm("You");
			s("Uhh, yeah.");
			s("Do you have any, *dough* spare?");
			chav("Jessica");
			chnm("Jessica");
			s("I sure do, we can go out back and look for it...");
			s("If you know what I mean?");
			chav("You Blush");
			chnm("You");
			s("Uhh... Ahh... Err.. ");
			chav("Jessica");
			chnm("Jessica");
			s("Oh...");
			s("I understand...");
			chav("Jessica Cry");
			s("You don't think I'm attractive do you?!");
			s("It's my lack of nose isn't it?!");
			s("Well take your *dough* and get out! Don't come back here!!");
			chav("None");
			chnm("???");
			spic("DoughBig");
			s("Got *Dough*!");
			additem("dough");
			hpic();
			setvar("Jessica",2);
			endtext();
		else
			s("If you need anything be sure to drop by!");
			endtext();
		end
	end
	if (J == 2) then
		chav("Jessica Cry");
		chnm("Jessica");
		s("I told you to leave. me. alone!!");
		s("Why are men so insensitive?!");
		checkitem("NecklaceSmall","N");
		if (N == 0) then
			chav("You");
			chnm("You");
			s("...");
			endtext();
		else
			s("Oh!");
			s("Is that necklace for me?!");
			chav("You Blush");
			chnm("You");
			s("Why... of course!");
			takeitem("NecklaceSmall");
			chav("Jessica");
			chnm("Jessica");
			s("O... M... G...!");
			s("You're so sweet!! #");
			s("Here take this!");
			spic("KissBig");
			chav("Bently");
			chnm("Bently");
			s("Got the *kiss* sir!");
			additem("Kiss");
			hpic();
			chav("You Blush");
			chnm("You");
			s("Erm... Ohh... Uhh");
			s("I have to... go...");
			setvar("Jessica",3);
			endtext();
		end
	end
	if (J == 3) then
		chav("Jessica");
		chnm("Jessica");
		s("Hi there!! #");
		endtext();
	end
end

function BillyEnding()
	chav("You");
	chnm("You");
	s("So, *Billy*, You like grapes?");
	s("How about you have...");
	chav("You Evil Laugh");
	s("_*all the grapes in the world*!!");
	bang(263,263);
	bang(263+16,263);
	snd("damage.ogg");
	func("BillyFall");
	hidetext();
	w(40);
	showtext();
	chav("Billy");
	chnm("Billy");
	s("Gawsh what a nice man.");
	hidetext();
	w(60);
	frame(SCENES);
end
-- 1337!
function WormPipeEnding()
	chav("You");
	chnm("You");
	s("Alright, let's see how they fit all those worms into a pipe..!");
	chav("Bently");
	chnm("Bently");
	s("Preparing to fire the pipe splitter 3000...");
	s("3...");
	s("2...");
	s("1...");
	hidetext();
	getnpcpos("Pipe","X","Y");
	cam(X,Y);
	w(15);
	snd("Damage.ogg",100);
	func("Flash");
	func("SplitPipe");
	w(30);
	showtext();
	chav("You WTFing");
	chnm("You");
	s("Aaaaaaaaah!!");
	hidetext();
	w(100);
	frame(SCENES);
end

function FattyEnding()
	chav("Police");
	chnm("Police");
	s("Stop!!");
	s("You're under arrest for the murder and consumption of one Rap-Dog Tomatoe, The Great Mushroom and for sexual harassment of one Jessica Lowngerl");
	chav("none");
	chnm("???");
	s("me innoccent me tells you!");
	hidetext();
	func("RunFatty");
	w(250);
	frame(SCENES);
end
	
	
function CPEnding()
	chav("Pot");
	chnm("Companion Pot");
	s("...and that's how you set a bomb with no hands!");
	chav("You Shocked");
	chnm("You");
	s("Of course! It all makes sense now!");
	chav("Pot");
	chnm("Companion Pot");
	s("and now that I've explained all this it's time for me to die, and go to *hell*!");
	getnpcpos("Pot","X","Y");
	bang(X,Y);
	snd("Damage.ogg",100);
	npckill("Pot");
	chav("You Shocked");
	chnm("You");
	s("Wait! You never told me how you took those steroids! Or how you talk and think! Or how you can move at all!");
	s("Companion Pot answer me!");
	s("Companion Pot!!!!!");
	hidetext();
	w(40);
	frame(SCENES);
end
	

function WiggypooEnding()
	chav("You");
	chnm("You");
	s("Ah... It's so nice to have my labs to myself...");
	hidetext();
	w(35);
	getnpcpos("Pos","X","Y");
	cam(X,Y);
	setnpcpos("Wiggypoo",X,Y);
	bang(X,Y);
	snd("Damage.ogg",100);
	showtext();
	chav("Wiggypoo");
	chnm("Wiggypoo");
	s("Found you!");
	chav("You WTFing");
	chnm("You");
	s("Oh crap!");
	hidetext();
	w(40);
	frame(SCENES);
end

function HairGuyEnding()
	getnpcpos("Hair Guy","X","Y");
	cam(X,Y);
	chav("Hair Guy 3");
	chnm("Hair Guy");
	s("...ugh...the...w-w-wig t-teleport... it di-didn't...w-work...");
	hidetext();
	w(40);
	frame(SCENES);
end

function Breadman()
	getvar("Jessica","J");
	if (J == 2) then
		chnm("Breadman");
		chav("Breadman");
		s("Durr you make *Jessica* cry!");
		s("_*Breadman* no like you no more!");
		endtext();	
	end
	if (J == 0 or J == 1) then
		chnm("Breadman");
		chav("Breadman");
		s("Durrr Me *Breadman*");
		s("_*Jessica* bake me long time ago.");
		s("She say I can stay 'coz I never sell");
		s("Durr I prove her wrong one day!");
		endtext();
	end
	if (J == 3) then
		chnm("Breadman");
		chav("Breadman");
		s("Durr you make *Jessica* happy again!");
		s("_*Jessica* happy then breadman happy!");
		s("Maybe someone buy me now?");
		endtext();
	end
end

function Breadman()
	getvar("Jessica","J");
	if (J == 2) then
		chnm("Breadman");
		chav("Breadman");
		s("Durr you make *Jessica* cry!");
		s("_*Breadman* no like you no more!");
		endtext();	
	end
	if (J == 0 or J == 1) then
		chnm("Breadman");
		chav("Breadman");
		s("Durrr Me *Breadman*");
		s("_*Jessica* bake me long time ago.");
		s("She say I can stay 'coz I never sell");
		s("Durr I prove her wrong one day!");
		endtext();
	end
	if (J == 3) then
		chnm("Breadman");
		chav("Breadman");
		s("Durr you make *Jessica* happy again!");
		s("_*Jessica* happy then breadman happy!");
		s("Maybe someone buy me now?");
		endtext();
	end
end

function HairGuyVillage()
	chnm("Hair Guy");
	chav("Hair Guy 2");
	s("I like to sit outside my house with my perfect hair.");
	s("You should get hair like mine.");
	s("Don't hide your hair under that hat.");
	s("Let the hair be free man!");
	endtext();
end

function HairGuyVillage2()
	chnm("Hair Guy");
	chav("Hair Guy 2");
	s("Man it's nice being up here with my hair.");
	chnm("You");
	chav("You WTFing");
	s("Seriously, how do you do that!?");
	endtext();
end

function HatHead()
	getvar("Hat Head","H");
	if (H == 0) then
		chnm("???");
		chav("Hat Head");
		s("Hello there!");
		s("My name is *Timothy Michael Karl Emmanuel Sanford Reginald Brown*");
		s("But you can call me *Hat Head*");
		chnm("Hat Head");
		chav("You");
		chnm("You");
		s("Wow...");
		s("So what do you do... Hat Head?");
		chnm("Hat Head");
		chav("Hat Head");
		s("Oh, I just run this here hat store.");
		s("I've always thought that hats were a very original thing, you know?");
		s("I've never seen another game... err... shop! That stocks them");
		s("But I came in today and I can't get in!");
		s("I've misplaced my *briefcase* you see, and it has my key inside.");
		s("If you ever find it, I'll be glad to give you any hats you like.");
		s("And if you ever find any hats lying around, come to me and I'll see if I can make a wearable model of it!");
		checkitem("briefcase","B");
		if (B == 1) then
			s("Oh my word! That's my briefcase right there!");
			s("Thank you so much, I'll open up shop next time you come by.");
			s("Any plans you find for hats, be sure to drop by and see what I can make from them!");
			chav("Briefcase");
			chnm("Briefcase");
			s("Daddy! I'm home!");
			s("Thankyou mister stranger!");
			spic("BriefcaseBig");
			chav("None");
			chnm("???");
			s("_*Companion Briefcase* taken!");
			hpic();
			takeitem("briefcase");
			setvar("Hat Head",2);
			endtext();
		else
			setvar("Hat Head",1);
			endtext();
		end
	end
	if (H == 1) then
		chnm("Hat Head");
		chav("Hat Head");
		s("Oh hello, found my briefcase yet?");
		checkitem("briefcase","B");
		if (B == 1) then
			s("Oh my word! That's my briefcase right there!");
			s("Thank you so much, I'll open up shop next time you come by.");
			s("Any plans you find for hats, be sure to drop by and see what I can make from them!");
			chav("Briefcase");
			chnm("Briefcase");
			s("Daddy! I'm home!");
			s("Thankyou mister stranger!");
			spic("BriefcaseBig");
			chav("None");
			chnm("???");
			s("_*Companion Briefcase* taken!");
			hpic();
			takeitem("briefcase");
			setvar("Hat Head",2);
			endtext();
		else
			s("Oh... Not this time then...");
			endtext();
		end
	end
	if (H == 2) then
		chnm("Hat Head");
		chav("Hat Head");
		s("Thanks so much for finding my case.");
		s("Go and pick out a hat if you like!");
		endtext();
	end
end

function TeleporterToTownSign()
	chav("Sign");
	chnm("Sign");
	s("Teleporter to Town.");
	endtext();
end

function TeleporterToTown()
	getvar("LabTownTeleporter","T");
	getvar("Checked Teleporter","C");
	if (T == 0) then
		if (C == 0) then
			chav("Bently");
			chnm("Bently");
			s("Oh look sir! This seems to be a teleporter!");
			s("But... It's not working right now. I think the network must be down.");
			s("I did tell them that a teleporter network managed by a windows server was a bad idea sir...");
			chav("You");
			chnm("You");
			s("It's alright Bently, I'm sure it'll be back online once they reboot... However long that takes...");
			setvar("Checked Teleporter",1);
			endtext();
		end
		if (C == 1) then
			chav("Bently");
			chnm("Bently");
			s("Still not working sir...");
			endtext();
		end
	end
	if (T == 1) then
		chav("Bently");
		chnm("Bently");
		s("Do you want to teleport to *Town* sir?");
		yn("Teleport","Yeah, Town sounds alright.","No, I like it here.");
		if (Teleport == 1) then
			getframe("F");
			setdoorvars(327,207);
			frame(97);
		else
			endtext();
		end
	end
end

function TeleporterToLabSign()
	chav("Sign");
	chnm("Sign");
	s("Teleporter to the lab ruins.");
	endtext();
end

function TeleporterToLab()
	setvar("LabTownTeleporter",1);
	getvar("LabTownTeleporter","T");
	getvar("Checked Teleporter","C");
	if (T == 0) then
		if (C == 0) then
			chav("Bently");
			chnm("Bently");
			s("Oh look sir! This seems to be a teleporter!");
			s("But... It's not working right now. I think the network must be down.");
			s("I did tell them that a teleporter network managed by a windows server was a bad idea sir...");
			chav("You");
			chnm("You");
			s("It's alright Bently, We'll just have to fix all the teleporters as we find them...");
			setvar("Checked Teleporter",1);
			endtext();
		end
		if (C == 1) then
			chav("Bently");
			chnm("Bently");
			s("Still not working sir...");
			endtext();
		end
	end
	if (T == 1) then
		chav("Bently");
		chnm("Bently");
		s("Do you want to teleport to the *Lab ruins* sir?");
		yn("Teleport","Yeah, The Lab sounds alright.","No, I like it here.");
		if (Teleport == 1) then
			setdoorvars(360,655);
			frame(12);
		else
			endtext();
		end
	end
end

function TeleporterToCavesSign()
	chav("Sign");
	chnm("Sign");
	s("Teleporter to the caves.");
	endtext();
end

function TeleporterToCaves()
	setvar("CavesTownTeleporter",1);
	getvar("CavesTownTeleporter","T");
	getvar("Checked Teleporter","C");
	if (T == 0) then
		if (C == 0) then
			chav("Bently");
			chnm("Bently");
			s("Oh look sir! This seems to be a teleporter!");
			s("But... It's not working right now. I think the network must be down.");
			s("I did tell them that a teleporter network managed by a windows server was a bad idea sir...");
			chav("You");
			chnm("You");
			s("It's alright Bently, We'll just have to fix all the teleporters as we find them...");
			setvar("Checked Teleporter",1);
			endtext();
		end
		if (C == 1) then
			chav("Bently");
			chnm("Bently");
			s("Still not working sir...");
			endtext();
		end
	end
	if (T == 1) then
		chav("Bently");
		chnm("Bently");
		s("Do you want to teleport to the *Caves* sir?");
		yn("Teleport","Yeah, The Caves sounds alright.","No, I like it here.");
		if (Teleport == 1) then
			setdoorvars(519,224);
			frame(21);
		else
			endtext();
		end
	end
end

function TeleporterToTownCaves()
	getvar("CavesTownTeleporter","T");
	getvar("Checked Teleporter","C");
	if (T == 0) then
		if (C == 0) then
			chav("Bently");
			chnm("Bently");
			s("Oh look sir! This seems to be a teleporter!");
			s("But... It's not working right now. I think the network must be down.");
			s("I did tell them that a teleporter network managed by a windows server was a bad idea sir...");
			chav("You");
			chnm("You");
			s("It's alright Bently, I'm sure it'll be back online once they reboot... However long that takes...");
			setvar("Checked Teleporter",1);
			endtext();
		end
		if (C == 1) then
			chav("Bently");
			chnm("Bently");
			s("Still not working sir...");
			endtext();
		end
	end
	if (T == 1) then
		chav("Bently");
		chnm("Bently");
		s("Do you want to teleport to *Town* sir?");
		yn("Teleport","Yeah, Town sounds alright.","No, I like it here.");
		if (Teleport == 1) then
			setdoorvars(407,208);
			frame(97);
		else
			endtext();
		end
	end
end

function Fatty()
	getvar("Fatty","F");
	if (F == 0) then
		chav("Fatty");
		chnm("Fatty");
		s("Me Fatty!");
		s("Me have key to this lock!");
		s("Me open lock for *pizza*");
		s("Me loooooooove *pizza*");
		checkitem("pizza","P");
		if (P == 1) then
			chav("You");
			chnm("You");
			s("I have *pizza* right here!");
			chav("Fatty");
			chnm("Fatty");
			s("Fatty loooooove *pizza* Fatty loooooove you Fatty open lock now!");
			getnpcpos("PIZZALOCK","X","Y");
			snd("damage.ogg",100);
			bang(X,Y);
			npckill("PIZZALOCK");
			setvar("Fatty",2);
			takeitem("pizza");
			endtext();
		else
			s("Come back when you have *pizza*!");
			setvar("Fatty",1);
			endtext();
		end
	end
	if (F == 1) then
		chav("Fatty");
		chnm("Fatty");
		s("You bring *pizza* yet?");
		checkitem("pizza","P");
		if (P == 1) then
			chav("You");
			chnm("You");
			s("I have *pizza* right here!");
			chav("Fatty");
			chnm("Fatty");
			s("Fatty loooooove *pizza* Fatty loooooove you Fatty open lock now!");
			getnpcpos("PIZZALOCK","X","Y");
			bang(X,Y);
			snd("damage.ogg",100);
			npckill("PIZZALOCK");
			setvar("Fatty",2);
			takeitem("pizza");
			endtext();
		else
			s("Come back when you have *pizza*!");
			endtext();
		end
	end
	if (F == 2) then
		chav("Fatty");
		chnm("Fatty");
		s("This one time I went to the store and bought a *pie*");
		s("And now i'm *fat*! Good Story, I'm Awesome");
		s("Oh yeah, Thankyou for *pizza*!");
		endtext();
	end
end

function LookAcrossRoom()
	hidetextinstant();
	getnpcpos("Door","X","Y");
	w(45);
	cam(X,Y);
	w(75);
	showtext();
	chav("Bently");
	chnm("Bently");
	s("Sir! I can almost see my bone china tea set from here!");
	hidetext();	
	camres();
	w(75);
	showtext();
	chav("You");
	chnm("You");
	s("It's time to go Minotaur China Shop on those pots!");
	setvar("LookAcrossRoom",1);
	endtext();
end

function VexalPlains()
	hidetextinstant();
	w(25);
	setnpcpos("Vexal",632,456);
	getnpcpos("Vexal","X","Y");
	bang(X-8,Y-8);
	snd("damage.ogg",100);
	w(25);
	showtext();
	chav("Vexal");
	chnm("Vexal");
	s("Aha there you are!");
	s("I've been waiting for you!");
	s("Your *bestest buddy* has gone on ahead, but I stayed back to fight you!");
	s("Time for round two buddy!");
	func("StartBattle");
	endtext();
end

function BeatVexalPlains()
	hidetextinstant();
	getnpcpos("Vexal","X","Y");
	bang(X,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-16);
	snd("damage.ogg",100);
	w(5);
	showtext();
	chnm("Vexal");
	chav("Vexal");
	s("Aargh! Not again!");
	chav("Bently");
	chnm("Bently");
	s("You know aiming at us with the projectiles as opposed to just firing randomly would be a better idea...");	
	chav("You Shocked");
	chnm("You");
	s("Bently don't give him ideas!");
	chnm("Vexal");
	chav("Vexal");
	s("See you later!");
	s("With *aiming* projectiles mwahahahaha!");
	getnpcpos("Vexal","VX","VY");
	bang(VX-8,VY-8);
	snd("damage.ogg",100);
	npckill("Vexal");
	chav("Bently");
	chnm("Bently");
	s("Sorry... Sir...");
	setvar("VexalPlains",1);
	chnm("You");
	chav("You");
	s("Huh?");
	s("What's this?");
	spic("snowbouncer");
	s("It seems to be a *snow bouncer*...");
	s("_*Vexal* must have dropped it!");
	hpic();
	chnm("Bently");
	chav("Bently");
	s("Very good sir, shall I add it to the *arsenal*?");
	chnm("You");
	chav("You");
	s("Please do, this may come in handy...");
	setvar("Snow Bouncer LVL",1);
	chnm("Bently");
	chav("Bently");
	s("Oh, and sir. Remember *Menu* will let you choose a gun if you hold it and press *Left*, *Right*, *Up* or *Down*");
	bang(656,480);
	snd("damage.ogg",100);
	killblock(656,480);
	endtext();
end

function SnowBouncerBarrier()
	chav("Bently");
	chnm("Bently");
	s("Oh dear sir!");
	s("It would seem there is a pesky barrier in the way...");
	s("The button to shut it off is on the other side, perhaps a different gun could penetrate it?");
	chav("You Evil Laugh");
	chnm("You");
	s("Hehehe...");
	chav("Bently Shocked");
	chnm("Bently");
	s("What's so funny sir?");
	chav("You Evil Laugh");
	chnm("You");
	s("You... You said *penetrate*!");
	chav("Bently Shocked");
	chnm("Bently");
	s("Sir?! I was un-aware you were infantile in your sense of humour!");
	s("I'm beginning to wonder how someone like you could have built a system like me...");
	setvar("SnowBounceBarrier",1);
	endtext();
end
	
function GlitchSign()
	chav("Sign");
	chnm("Sign");
	s("Welcome to *Haxville*");
	s("Population 3");
	s("(It's called *haxville* because the mountains just end over there, right in the middle of it too!)");
	endtext();
end

function Shorty()
	getvar("Shorty","S");
	if (S == 0) then
		chnm("Shorty");
		chav("Shorty");
		s("Huh?");
		s("Veldthie is that you?");
		s("Wait I know you!!");
		chnm("You");
		chav("You");
		s("Hah, *Shorty* who'd have expected you to be here");
		s("Not quite as... How do I put it?");
		s("Glamorous as your last job is it?");
		chnm("Shorty");
		chav("Shorty");
		s("If you're referring to my accomodation, then yes I suppose it is a tad of a downgrade");
		s("But this is mearly a stop-gap, I'm going to go back to the village!");
		s("As soon as I figure out how to get back up there...");
		s("So would you kindly, or unkindly, leave me to think?");
		chnm("You");
		chav("You");
		s("Oh no you're not getting rid of me that easily, I can't believe it!");
		s("You! The great *Shorty* reduced to living in this place!");
		s("This is too good to be true!");
		chav("Bently");
		chnm("Bently");
		s("Sir, is there something I'm missing here?");
		chnm("You");
		chav("You");
		s("Oh of course, *Bently* meet *Shorty*");
		s("He tried to kill me");
		s("Twice");
		chnm("Shorty");
		chav("Shorty");
		s("Well you deserved it! You and your sarcasm! You're *so* annoying!");
		s("Get outta here now!");
		getvar("Hat Head","H");
		if (H == 2) then
			s("What do you want!?");
			s("Here take these plans for making a *fez* it's all I have!");
			spic("fezplans");
			chav("None");
			chnm("???");
			s("Got the *Fez Plans*!");
			setvar("Hat 2",1);
			chnm("Shorty");
			chav("Shorty");
			s("Now go!");
			hpic();
			setvar("Shorty",2);
			endtext();
		else
			s("Just leave me alone!");
			s("There is not one thing I can give you!");
			s("Yet");
			setvar("Shorty",1);
			endtext();
		end
	end
	if (S == 1) then
		chav("Shorty");
		chnm("Shorty");
		s("What are you doing here?!");
		if (H == 2) then
			s("Take these plans for making a *fez* it's all I have!");
			spic("fezplans");
			chav("None");
			chnm("???");
			s("Got the *Fez Plans*!");
			setvar("Hat 2",1);
			chnm("Shorty");
			chav("Shorty");
			s("Now go!");
			hpic();
			setvar("Shorty",2);
			endtext();
		else
			s("Just leave me alone!");
			s("There is not one thing I can give you!");
			s("Yet");
			endtext();
		end
	end
	if (S == 2) then
		chav("Shorty");
		chnm("Shorty");
		s("Oh for goodness sake, I've given you all my earthly possesions?!");
		s("Isn't that enough?!");
		s("Are you going to mock me about being named Dhitotie now?!");
		chav("Bently");
		chnm("Bently");
		s("Sir, perhaps it would be best to leave... Immediately");
		s("I'm not sure how long his sanity will last...");
		endtext();
	end
end

function Briefcase()
	getvar("Veldthie","V");
	if (V == 0) then
		chav("Briefcase");
		chnm("Briefcase");
		s("I'm a briefcase!");
		endtext();
	else
		chav("Briefcase");
		chnm("Briefcase");
		s("Are we going on an adventure!?");
		chav("You");
		chnm("You");
		s("You could look at it like that... I guess...");
		chnm("???");
		chav("None");
		spic("BriefcaseBig");
		s("Got the *Companion Briefcase");	
		hpic();
		additem("briefcase");
		setvar("Briefcase",1);
		endtext();
	end		
end

function Veldthie()
	getvar("Veldthie","V");
	if (V == 0) then
		chav("Veldthie");
		chnm("Veldthie");
		s("My, my look who it is!");
		s("My old sarcastic friend!");
		chav("You");
		chnm("You");
		s("Look I don't know about you but when someone makes me *explode* I usually don't call them my friend");	
		s("How come you're down in this place anyway? Aren't evil geniuses rich? I know I am");
		chav("Veldthie");
		chnm("Veldthie");
		s("Oh I'm plenty rich, I quite like it here honestly...");
		s("Except for one thing, that briefcase...");
		s("I found it lying around and took it in, and now it's nothing but a pest!");
		chav("Briefcase");
		chnm("Briefcase");
		s("I can hear you!");
		s("You better be nice or I'll scream again!");
		chav("Veldthie Panicked");
		chnm("Veldthie");
		s("Oh god no");
		s("Please take him away! I don't care what you do just get rid of him");
		setvar("Veldthie",1);
		endtext();
	else
		getvar("Briefcase","B");
		if (B == 0) then
			chav("Veldthie");
			chnm("Veldthie");
			s("Please take him away!");
			endtext();
		else
			chav("Veldthie");
			chnm("Veldthie");
			s("Oh god thankyou! We're even now, over the whole defeating me thing");
			endtext();			
		end
	end
end

function AntechamberSign()
	chav("Sign");
	chnm("Sign");
	s("Watch your step!/nThough if you're reading this sign it's probably too late.");
	s("/n/n/n               - Underside Saftey Commitee");
	endtext();
end
	
function ArthursHouseTeleporter()
	chav("Bently");
	chnm("Bently");
	s("This teleporter isn't online sir... I don't know if it ever will be...");
	s("Preliminary scans suggest that it isn't connected to anything, by anything!");
	endtext();
end

function ChamberofHeroesSign()
	chav("Bently");
	chnm("Bently");
	s("Sir someone has scratched a new message over this sign!");
	s("What sort of vandal would do this?!!");
	chav("Sign");
	chnm("Chamber of Heroes Sign");
	s("The Chamber of Heroes has been opened...");
	s("...Enemies of the heir bewhere!");
	endtext();
end

function TheDoctor()
	chav("The Doctor");
	chnm("???");
	s("I am *the doctor*!");
	chnm("The Doctor");
	s("I will heal your wounds!!");
	s("Please feel better now!!!");
	chav("Bently");
	chnm("Bently");
	getvar("Max Hp","MAXHP");
	setvar("Hp",MAXHP);
	snd("heart.wav",100);
	s("Full HP restored sir!");
	endtext();
end

function ArthursHouseSign()
	chav("Sign");
	chnm("Sign");
	s("Arthurs house...");
	endtext();
end

function Jake()
	chav("Jake");
	chnm("Jake");
	s("Psst, Ricky.");
	s("I say we kick Ben out. We did all the work on this game while he sat back on his bed whipping us hours on end!");
	chav("Ricky");
	chnm("Ricky");
	s("True.");
	s("We just needed him for the engine. Once that was made we totally could have taken over and claimed EEWW2 as 	our own!.");
	chav("Jake");
	chnm("Jake");
	s("So you in?");
	chav("Ricky");
	chnm("Ricky");
	s("Definately let's go right n-");
	s("Dammit! We can't!");
	chav("Jake");
	chnm("Jake")
	s("Why not?");
	chav("Ricky");
	chnm("Ricky");
	s("The game's released in his name already!");
	chav("Jake");
	chnm("Jake")
	s("Noooooooooooooooooooooooooooooooooooooooooo!");
	s("Oh crap, here he comes! Act like we're his friends!");
	endtext();
end

function Ben()
	chav("Ben");
	chnm("Ben");
	s("Hello.");
	endtext();
end

function Ricky()
	chav("Ricky");
	chnm("Ricky");
	s("This entire game was my idea...  I should get more credit...");
	s("I could always kill *ben*... But then i would have no one to mock...");
	endtext();
end
	
function Ninja()
	getvar("Ninja","N");
	if (N == 0) then
		chav("Ninja");
		chnm("Ninja");
		s("Oh herro");
		s("I am ninja, what do you require from me?");
		chav("You");
		chnm("You");
		s("Erm, actually I was just looking around...");
		chav("Ninja");
		chnm("Ninja");
		s("Looking you say? Well I have something for you to do");
		s("There is a prize in my basement, but even I am not skilled enough to reach it");
		s("I will allow you access, but only when the man who creates headwear can access his shop");
		getvar("Hat Head","H");
		if (H == 2) then
			s("Oh, you have already allowed him access?");
			s("Very well, enter if you wish!");
			snd("damage.ogg",100);
			bang(184-8,104-8);
			bang(184-8,120-8);
			bang(184-8,136-8);
			setvar("NinjaLock",1);
			setvar("Ninja",2);
			endtext();
		else
			s("Return when this is done");
			setvar("Ninja",1);
			endtext();
		end
	end
	if (N == 1) then
		getvar("Hat Head","H");
		if (H == 2) then
			s("Oh, you have allowed him access?");
			s("Very well, enter if you wish!");
			snd("damage.ogg",100);
			bang(184-8,104-8);
			bang(184-8,120-8);
			bang(184-8,136-8);
			setvar("NinjaLock",1);
			setvar("Ninja",2);
			endtext();
		else
			chav("Ninja");
			chnm("Ninja");
			s("Allow the hat man access to his dealership!");
			endtext();
		end			
	end
	if (N == 2) then
		chav("Ninja");
		chnm("Ninja");
		s("Enjoy the basement, it is... Interesting");
		chav("You");
		chnm("You");
		s("_*I AM SORRY I DON'T SPEAK JAPANESE*!!!");
		chav("Ninja");
		chnm("Ninja");
		s("This is why I kill people...");
		endtext();
	end
end

function ComeBack()
	chav("Bently");
	chnm("Bently");
	s("Sir! We're receiving a video call!");
	s("From a Mr. *Bomb Face*...");
	chav("You");
	chnm("You");
	s("What, right now? While I'm in mid-air...?");
	s("Patch him through...");
	chav("Bomb Face");
	chnm("Bomb Face");
	s("'sup bro!");
	chav("You");
	chnm("You");
	s("Why are you calling?");
	chav("Bomb Face");
	chnm("Bomb Face");
	s("Bro, it's me, *Bomb Face*?!");
	s("Remember that wild night in vegas?");
	s("Course, you do! Tiffany says 'Hi' by the way");
	s("You remember *her* right?");
	chav("Bomb Face Winking");
	s("We're just calling to, uhh, *follow up*");
	chav("Bently Shocked");
	chnm("Bently");
	s("Sir! I'm appalled! You said that trip was strictly business!");
	chav("You Blush");
	chnm("You");
	s("Uhh... So... These calls are expensive right?");
	chav("Bently Shocked");
	chnm("Bently");
	s("But Si-");
	chav("You Blush");
	chnm("You");
	s("_*BURNING MONEY HERE*!!");
	chav("Bomb Face");
	chnm("Bomb Face");
	s("Chill, bro, bro, chill.");
	s("Anyway just calling to tell you that that platform is too high");
	s("Sounds a bit like you eh?! GET IT?!");
	s("Bahahahaa-");
	chav("Bently");
	chnm("Bently");
	s("_*call ended*");
	s("...Just a, err, connection error sir...");
	s("Anyway!");
	setvar("ComeBack",1);
	endtext();
end

function NinjaMask()
	getvar("Hat Head","H");
	if (H == 2) then
	chav("Bently");
	chnm("Bently");
	s("Sir... It seems to be...");
	s("A mask!");
	chav("None");
	chnm("???");
	s("Got the *Ninja Mask*!");
	chav("Bently");
	chnm("Bently");
	s("I'll send *hat head* a copy so he can create a wearable version!");
	setvar("Hat 7",1);
	endtext();
	else
	chav("Bently");
	chnm("Bently");
	s("Sir!");
	s("Scans are suggesting that *this* is a *hat*!!!");
	chav("You");
	chnm("You");
	s("And?");
	chav("Bently");
	chnm("Bently");
	s("I insist we ask an expert before taking further action!");
	endtext();
	end
end

function UpsetMask()
	getvar("Hat Head","H");
	if (H == 2) then
	chav("Bently");
	chnm("Bently");
	s("Sir... It seems to be...");
	s("A hat!");
	chav("None");
	chnm("???");
	s("Got the *Upset Mask*!");
	chav("Bently");
	chnm("Bently");
	s("I'll send *hat head* a copy so he can create a wearable version!");
	setvar("Hat 3",1);
	endtext();
	else
	chav("Bently");
	chnm("Bently");
	s("Sir!");
	s("Scans are suggesting that *this* is a *hat*!!!");
	chav("You");
	chnm("You");
	s("And?");
	chav("Bently");
	chnm("Bently");
	s("I insist we ask an expert before taking further action!");
	endtext();
	end
end

function BigHead()
	getvar("Hat Head","H");
	if (H == 2) then
	chav("Bently");
	chnm("Bently");
	s("Sir... It seems to be...");
	s("A hat!");
	chav("None");
	chnm("???");
	s("Got the *Big Head Mask*!");
	chav("Bently");
	chnm("Bently");
	s("I'll send *hat head* a copy so he can create a wearable version!");
	setvar("Hat 4",1);
	endtext();
	else
	chav("Bently");
	chnm("Bently");
	s("Sir!");
	s("Scans are suggesting that *this* is a *hat*!!!");
	chav("You");
	chnm("You");
	s("And?");
	chav("Bently");
	chnm("Bently");
	s("I insist we ask an expert before taking further action!");
	endtext();
	end
end

function WiggypooHair()
	getvar("Hat Head","H");
	if (H == 2) then
	chav("Bently");
	chnm("Bently");
	s("Sir... It seems to be...");
	s("A hat!");
	chav("None");
	chnm("???");
	s("Got the *Wiggypoo Wig*!");
	chav("Bently");
	chnm("Bently");
	s("I'll send *hat head* a copy so he can create a wearable version!");
	setvar("Hat 12",1);
	endtext();
	else
	chav("Bently");
	chnm("Bently");
	s("Sir!");
	s("Scans are suggesting that *this* is a *hat*!!!");
	chav("You");
	chnm("You");
	s("And?");
	chav("Bently");
	chnm("Bently");
	s("I insist we ask an expert before taking further action!");
	endtext();
	end
end

function CrownHat()
	getvar("Hat Head","H");
	if (H == 2) then
	chav("Bently");
	chnm("Bently");
	s("Sir... It seems to be...");
	s("A hat!");
	chav("None");
	chnm("???");
	s("Got the *Crown*!");
	chav("Bently");
	chnm("Bently");
	s("I'll send *hat head* a copy so he can create a wearable version!");
	setvar("Hat 15",1);
	endtext();
	else
	chav("Bently");
	chnm("Bently");
	s("Sir!");
	s("Scans are suggesting that *this* is a *hat*!!!");
	chav("You");
	chnm("You");
	s("And?");
	chav("Bently");
	chnm("Bently");
	s("I insist we ask an expert before taking further action!");
	endtext();
	end
end

function Hatless()
	getvar("Hat Head","H");
	if (H == 2) then
	chav("Bently");
	chnm("Bently");
	s("Sir... It seems to be...");
	s("A hat!");
	chav("None");
	chnm("???");
	s("Got the *No Hat Hat*!");
	chav("Bently");
	chnm("Bently");
	s("I'll send *hat head* a copy so he can create a wearable version!");
	setvar("Hat 11",1);
	endtext();
	else
	chav("Bently");
	chnm("Bently");
	s("Sir!");
	s("Scans are suggesting that *this* is a *hat*!!!");
	chav("You");
	chnm("You");
	s("And?");
	chav("Bently");
	chnm("Bently");
	s("I insist we ask an expert before taking further action!");
	endtext();
	end
end

function PotHat()
	getvar("Hat Head","H");
	if (H == 2) then
	chav("Bently");
	chnm("Bently");
	s("Sir... It seems to be...");
	s("A hat!");
	chav("None");
	chnm("???");
	s("Got the *Companion Pot Mask*!");
	chav("Bently");
	chnm("Bently");
	s("I'll send *hat head* a copy so he can create a wearable version!");
	setvar("Hat 5",1);
	endtext();
	else
	chav("Bently");
	chnm("Bently");
	s("Sir!");
	s("Scans are suggesting that *this* is a *hat*!!!");
	chav("You");
	chnm("You");
	s("And?");
	chav("Bently");
	chnm("Bently");
	s("I insist we ask an expert before taking further action!");
	endtext();
	end
end

function FlowerHead()
	getvar("Hat Head","H");
	if (H == 2) then
	chav("Bently");
	chnm("Bently");
	s("Sir... It seems to be...");
	s("A hat!");
	chav("None");
	chnm("???");
	s("Got the *Flower-Growing-Out-Of-Your-Head Mask*!");
	chav("Bently");
	chnm("Bently");
	s("I'll send *hat head* a copy so he can create a wearable version!");
	setvar("Hat 17",1);
	endtext();
	else
	chav("Bently");
	chnm("Bently");
	s("Sir!");
	s("Scans are suggesting that *this* is a *hat*!!!");
	chav("You");
	chnm("You");
	s("And?");
	chav("Bently");
	chnm("Bently");
	s("I insist we ask an expert before taking further action!");
	endtext();
	end
end

function CowboyHat()
	getvar("Hat Head","H");
	if (H == 2) then
	chav("Bently");
	chnm("Bently");
	s("Sir... It seems to be...");
	s("A hat!");
	chav("None");
	chnm("???");
	s("Got the *Cowboy Hat*!");
	chav("Bently");
	chnm("Bently");
	s("I'll send *hat head* a copy so he can create a wearable version!");
	setvar("Hat 9",1);
	endtext();
	else
	chav("Bently");
	chnm("Bently");
	s("Sir!");
	s("Scans are suggesting that *this* is a *hat*!!!");
	chav("You");
	chnm("You");
	s("And?");
	chav("Bently");
	chnm("Bently");
	s("I insist we ask an expert before taking further action!");
	endtext();
	end
end

function ChefHat()
	getvar("Hat Head","H");
	if (H == 2) then
	chav("Bently");
	chnm("Bently");
	s("Sir... It seems to be...");
	s("A hat!");
	chav("None");
	chnm("???");
	s("Got the *Chef Hat*!");
	chav("Bently");
	chnm("Bently");
	s("I'll send *hat head* a copy so he can create a wearable version!");
	setvar("Hat 10",1);
	endtext();
	else
	chav("Bently");
	chnm("Bently");
	s("Sir!");
	s("Scans are suggesting that *this* is a *hat*!!!");
	chav("You");
	chnm("You");
	s("And?");
	chav("Bently");
	chnm("Bently");
	s("I insist we ask an expert before taking further action!");
	endtext();
	end
end

function Balaclava()
	getvar("Hat Head","H");
	if (H == 2) then
	chav("Bently");
	chnm("Bently");
	s("Sir... It seems to be...");
	s("A hat!");
	chav("None");
	chnm("???");
	s("Got the *Balaclava*!");
	chav("Bently");
	chnm("Bently");
	s("I'll send *hat head* a copy so he can create a wearable version!");
	setvar("Hat 13",1);
	endtext();
	else
	chav("Bently");
	chnm("Bently");
	s("Sir!");
	s("Scans are suggesting that *this* is a *hat*!!!");
	chav("You");
	chnm("You");
	s("And?");
	chav("Bently");
	chnm("Bently");
	s("I insist we ask an expert before taking further action!");
	endtext();
	end
end

function TheresWally()
	getvar("Hat Head","H");
	if (H == 2) then
	chav("Bently");
	chnm("Bently");
	s("Sir... It seems to be...");
	s("A hat!");
	chav("None");
	chnm("???");
	s("Got the *Where's Wally Mask*!");
	chav("Bently");
	chnm("Bently");
	s("I'll send *hat head* a copy so he can create a wearable version!");
	setvar("Hat 19",1);
	endtext();
	else
	chav("Bently");
	chnm("Bently");
	s("Sir!");
	s("Scans are suggesting that *this* is a *hat*!!!");
	chav("You");
	chnm("You");
	s("And?");
	chav("Bently");
	chnm("Bently");
	s("I insist we ask an expert before taking further action!");
	endtext();
	end
end

function SkullHat()
	getvar("Hat Head","H");
	if (H == 2) then
	chav("Bently");
	chnm("Bently");
	s("Sir... It seems to be...");
	s("A hat!");
	chav("None");
	chnm("???");
	s("Got the *Skull Mask*!");
	chav("Bently");
	chnm("Bently");
	s("I'll send *hat head* a copy so he can create a wearable version!");
	setvar("Hat 14",1);
	endtext();
	else
	chav("Bently");
	chnm("Bently");
	s("Sir!");
	s("Scans are suggesting that *this* is a *hat*!!!");
	chav("You");
	chnm("You");
	s("And?");
	chav("Bently");
	chnm("Bently");
	s("I insist we ask an expert before taking further action!");
	endtext();
	end
end

function BrainHat()
	getvar("Hat Head","H");
	if (H == 2) then
	chav("Bently");
	chnm("Bently");
	s("Sir... It seems to be...");
	s("A hat!");
	chav("None");
	chnm("???");
	s("Got the *Big Brain Mask*!");
	chav("Bently");
	chnm("Bently");
	s("I'll send *hat head* a copy so he can create a wearable version!");
	setvar("Hat 18",1);
	endtext();
	else
	chav("Bently");
	chnm("Bently");
	s("Sir!");
	s("Scans are suggesting that *this* is a *hat*!!!");
	chav("You");
	chnm("You");
	s("And?");
	chav("Bently");
	chnm("Bently");
	s("I insist we ask an expert before taking further action!");
	endtext();
	end
end

function CrapDisguise()
	getvar("Hat Head","H");
	if (H == 2) then
	chav("Bently");
	chnm("Bently");
	s("Sir... It seems to be...");
	s("A hat!");
	chav("None");
	chnm("???");
	s("Got the *Disguise Mask*!");
	chav("Bently");
	chnm("Bently");
	s("I'll send *hat head* a copy so he can create a wearable version!");
	setvar("Hat 16",1);
	endtext();
	else
	chav("Bently");
	chnm("Bently");
	s("Sir!");
	s("Scans are suggesting that *this* is a *hat*!!!");
	chav("You");
	chnm("You");
	s("And?");
	chav("Bently");
	chnm("Bently");
	s("I insist we ask an expert before taking further action!");
	endtext();
	end
end

function JustinMask()
	getvar("Hat Head","H");
	if (H == 2) then
	chav("Bently");
	chnm("Bently");
	s("Sir... It seems to be...");
	s("A hat!");
	chav("None");
	chnm("???");
	s("Got the *Justin Mask*!");
	chav("Bently");
	chnm("Bently");
	s("I'll send *hat head* a copy so he can create a wearable version!");
	setvar("Hat 6",1);
	endtext();
	else
	chav("Bently");
	chnm("Bently");
	s("Sir!");
	s("Scans are suggesting that *this* is a *hat*!!!");
	chav("You");
	chnm("You");
	s("And?");
	chav("Bently");
	chnm("Bently");
	s("I insist we ask an expert before taking further action!");
	endtext();
	end
end

function DemonCrown()
	getvar("Hat Head","H");
	if (H == 2) then
	chav("Bently");
	chnm("Bently");
	s("Sir... It seems to be...");
	s("A hat!");
	chav("None");
	chnm("???");
	s("Got the *Demon Crown*!");
	chav("Bently");
	chnm("Bently");
	s("I'll send *hat head* a copy so he can create a wearable version!");
	setvar("Hat 21",1);
	endtext();
	else
	chav("Bently");
	chnm("Bently");
	s("Sir!");
	s("Scans are suggesting that *this* is a *hat*!!!");
	chav("You");
	chnm("You");
	s("And?");
	chav("Bently");
	chnm("Bently");
	s("I insist we ask an expert before taking further action!");
	endtext();
	end
end

function SantaHat()
	getvar("Hat Head","H");
	if (H == 2) then
	chav("Bently");
	chnm("Bently");
	s("Sir... It seems to be...");
	s("A hat!");
	chav("None");
	chnm("???");
	s("Got the *Santa Hat*!");
	chav("Bently");
	chnm("Bently");
	s("I'll send *hat head* a copy so he can create a wearable version!");
	setvar("Hat 8",1);
	endtext();
	else
	chav("Bently");
	chnm("Bently");
	s("Sir!");
	s("Scans are suggesting that *this* is a *hat*!!!");
	chav("You");
	chnm("You");
	s("And?");
	chav("Bently");
	chnm("Bently");
	s("I insist we ask an expert before taking further action!");
	endtext();
	end
end

function Jamie()
	getvar("Jamie","J");
	if (J == 0) then
		chav("You");
		chnm("You");
		s("Oh no!");
		s("it's... it's... you?");
		s("No-one knows if your male or female, a fox a cat or a dog...");
		s("...but you even made it into this game!");
		chav("Jamie");
		chnm("Jamie");
		s("Yeah life's rigged like that");
		s("Anyway, nice to see you made it to the Jamie's Revenge fan club.");
		chav("You WTFing");
		chnm("You");
		s("Fan club? Why would you have a fan club on top of a skyscraper?");
		s("It's alot of effort to get up here you know? Did you have to do that puzzle inside like everyone else?");
		chav("Jamie");
		chnm("Jamie");
		s("What? No! I just ran up the side of the building like everyone else, DUH!");
		chav("You");
		chnm("You");
		s("...");
		s("... Of course ...");
		chav("Jamie");
		chnm("Jamie");
		s("Anyways, it's nice to see such a dedicated fan!");
		s("Did you know you the first one to get up here?");
		chav("You");
		chnm("You");
		s("Thats amazing, I would have expected hundreds of fans to have been here by now! What's it been 6 months since your game came out?");
		chav("Jamie");
		chnm("Jamie");
		s("Over a year actually...");
		chav("You");
		chnm("You");
		s("...");
		chav("Jamie");
		chnm("Jamie");
		s("...");
		chav("Bently");
		chnm("Bently");
		s("...");
		s("Sir, I must insist we move on now-");
		chav("Jamie");
		chnm("Jamie");
		s("Oh I almost forgot!");
		getvar("Hat Head","H");
		if (H == 2) then
			s("Our most dedicated fan gets this!");
			chav("None");
			chnm("???");
			s("Got the *Jamie Mask*!");
			setvar("Hat 20",1);
			chav("Jamie");
			chnm("Jamie");
			s("Yay!");
			s("Masks!");
			s("Okay, bye!");
			setvar("Jamie",2);
			endtext();
		else
			s("Oh... I was going to give you a hat... But looks like you don't have a way to make a wearable copy yet...");
			s("Bye... Come back later?");
			setvar("Jamie",1);
			endtext();
		end
	end
	if (J == 1) then
		chav("Jamie");
		chnm("Jamie");
		s("Oh hey there!");
		getvar("Hat Head","H");
		if (H == 2) then
			s("Our most dedicated fan gets this!");
			chav("None");
			chnm("???");
			s("Got the *Jamie Mask*!");
			setvar("Hat 20",1);
			chav("Jamie");
			chnm("Jamie");
			s("Yay!");
			s("Masks!");
			s("Okay, bye!");
			setvar("Jamie",2);
			endtext();
		else
			s("Oh... I was going to give you a hat... But looks like you don't have a way to make a wearable copy yet...");
			s("Bye... Come back later?");
			setvar("Jamie",1);
			endtext();
		end
	end
	if (J == 2) then
		chav("Jamie");
		chnm("Jamie");
		s("Hey! How are you going number one fan?");
		chav("You");
		chnm("You");
		s("...");
		chav("Jamie");
		chnm("Jamie");
		s("Right on!");
		endtext();
	end
end

function Huntington()
	chav("Earl Huntington");
	chnm("???");
	s("Oh good day!");
	s("I'm glad you could make it, now we can begin the hunt!");
	chav("You");
	chnm("You");
	s("Do I know you?");
	chav("Earl Huntington");
	chnm("???");
	s("Why it is me! *Earl Huntington*!");
	chnm("Earl Huntington");
	chav("You");
	chnm("You");
	s("You must be thinking of someone else, we've never met.");
	chav("Earl Huntington");
	chnm("Earl Huntington");
	s("Hahaha good chap, you are a hoot!");
	s("Now let the hunt begin!");
	setvar("huntingtonblock",1);
	bang(304,304-16);
	snd("damage.ogg",100);
	makeblock(304,304-16);
	s("Goodbye for now!");
	getnpcpos("Huntington","X","Y");
	bang(X,Y);
	snd("damage.ogg");
	npckill("Huntington");
	endtext();
end

function HuntingtonAttacks()
	chav("Earl Huntington");
	chnm("Earl Huntington");
	s("Ahahahaha!");
	s("I see you made it my good chap!");
	s("Now, let the hunt begin!");
	chav("You");
	chnm("You");
	s("huh?");	
	chav("Earl Huntington");
	chnm("Earl Huntington");
	s("Confused are we?");
	s("Let me spell it out for you:");
	s("I am the hunter, you are my prey!");
	func("startfight");
	setvar("HuntingtonAttacks",1);
	endtext();
end
	
function HurtingHuntington()
	chav("Bently");
	chnm("Bently");
	s("Sir! That seems to damage his on-board systems!");
	s("This wireless technology is so unreliable!");
	endtext();
end

function BeatHuntington()
	hidetext();
	getnpcpos("Huntington","X","Y");
	cam(X,Y);
	bang(X,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-16);
	snd("damage.ogg",100);
	w(5);
	npckill("Huntington");
	npckill("Huntington1");
	npckill("Huntington2");
	w(125);
	showtext();
	camres();
	chav("Bently");
	chnm("Bently");
	s("Sir I think that did it!");
	s("He seems to have disappeared totally...");
	s("Ah well, on we go!");
	setvar("BeatHuntington",1);
	endtext();
end

function TeleporterToTownVillage()
	setvar("VillageTownTeleporter",1);
	getvar("VillageTownTeleporter","T");
	getvar("Checked Teleporter","C");
	if (T == 0) then
		if (C == 0) then
			chav("Bently");
			chnm("Bently");
			s("Oh look sir! This seems to be a teleporter!");
			s("But... It's not working right now. I think the network must be down.");
			s("I did tell them that a teleporter network managed by a windows server was a bad idea sir...");
			chav("You");
			chnm("You");
			s("It's alright Bently, I'm sure it'll be back online once they reboot... However long that takes...");
			setvar("Checked Teleporter",1);
			endtext();
		end
		if (C == 1) then
			chav("Bently");
			chnm("Bently");
			s("Still not working sir...");
			endtext();
		end
	end
	if (T == 1) then
		chav("Bently");
		chnm("Bently");
		s("Do you want to teleport to *Town* sir?");
		yn("Teleport","Yeah, Town sounds alright.","No, I like it here.");
		if (Teleport == 1) then
			setdoorvars(567,207);
			frame(97);
		else
			endtext();
		end
	end
end	
	
function TeleporterToTownPlains()
	setvar("PlainsTownTeleporter",1);
	getvar("PlainsTownTeleporter","T");
	getvar("Checked Teleporter","C");
	if (T == 0) then
		if (C == 0) then
			chav("Bently");
			chnm("Bently");
			s("Oh look sir! This seems to be a teleporter!");
			s("But... It's not working right now. I think the network must be down.");
			s("I did tell them that a teleporter network managed by a windows server was a bad idea sir...");
			chav("You");
			chnm("You");
			s("It's alright Bently, I'm sure it'll be back online once they reboot... However long that takes...");
			setvar("Checked Teleporter",1);
			endtext();
		end
		if (C == 1) then
			chav("Bently");
			chnm("Bently");
			s("Still not working sir...");
			endtext();
		end
	end
	if (T == 1) then
		chav("Bently");
		chnm("Bently");
		s("Do you want to teleport to *Town* sir?");
		yn("Teleport","Yeah, Town sounds alright.","No, I like it here.");
		if (Teleport == 1) then
			setdoorvars(487,207);
			frame(97);
		else
			endtext();
		end
	end
end

function TeleporterToPlainsSign()
	chav("Sign");
	chnm("Sign");
	s("Teleporter to the plains.");
	endtext();
end

function TeleporterToPlains()
	getvar("PlainsTownTeleporter","T");
	getvar("Checked Teleporter","C");
	if (T == 0) then
		if (C == 0) then
			chav("Bently");
			chnm("Bently");
			s("Oh look sir! This seems to be a teleporter!");
			s("But... It's not working right now. I think the network must be down.");
			s("I did tell them that a teleporter network managed by a windows server was a bad idea sir...");
			chav("You");
			chnm("You");
			s("It's alright Bently, We'll just have to fix all the teleporters as we find them...");
			setvar("Checked Teleporter",1);
			endtext();
		end
		if (C == 1) then
			chav("Bently");
			chnm("Bently");
			s("Still not working sir...");
			endtext();
		end
	end
	if (T == 1) then
		chav("Bently");
		chnm("Bently");
		s("Do you want to teleport to the *Plains* sir?");
		yn("Teleport","Yeah, The Plains sound alright.","No, I like it here.");
		if (Teleport == 1) then
			getframe("F");
			setdoorvars(167,208);
			frame(43);
		else
			endtext();
		end
	end
end

function TeleporterToVillageSign()
	chav("Sign");
	chnm("Sign");
	s("Teleporter to the village.");
	endtext();
end

function TeleporterToVillage()
	getvar("VillageTownTeleporter","T");
	getvar("Checked Teleporter","C");
	if (T == 0) then
		if (C == 0) then
			chav("Bently");
			chnm("Bently");
			s("Oh look sir! This seems to be a teleporter!");
			s("But... It's not working right now. I think the network must be down.");
			s("I did tell them that a teleporter network managed by a windows server was a bad idea sir...");
			chav("You");
			chnm("You");
			s("It's alright Bently, We'll just have to fix all the teleporters as we find them...");
			setvar("Checked Teleporter",1);
			endtext();
		end
		if (C == 1) then
			chav("Bently");
			chnm("Bently");
			s("Still not working sir...");
			endtext();
		end
	end
	if (T == 1) then
		chav("Bently");
		chnm("Bently");
		s("Do you want to teleport to the *Village* sir?");
		yn("Teleport","Yeah, The Village sound alright.","No, I like it here.");
		if (Teleport == 1) then
			getframe("F");
			setdoorvars(102,96);
			frame(47);
		else
			endtext();
		end
	end
end

function BakerySign()
	chav("Sign");
	chnm("Sign");
	s("Town Bakery: Got dough?");
	s("Yes, yes we do...");
	endtext();
end

function VillageRestHouseSign()
	chav("Sign");
	chnm("Sign");
	s("You are at the *rest house*.");
	s("To the east is the *village*.");
	endtext();
end

function Tally()
	getvar("Tally","T");
	if (T == 0) then
		chav("Tally");
		chnm("???");
		s("Oh, hello...");
		s("I'm... Well everyone calls me *Tally* so you might as well too.");
		chnm("Tally");
		s("I'm... Well I was Shorty's best friend...");
		s("T and S BFFL we used to say, but no more...");
		s("Shorty left one day, obsessed with stopping some guy wearing nothing but a santa hat.");
		s("I haven't seen him since...");
		s("Oh gosh, sorry I'm rambling again...");
		chav("You");
		chnm("You");
		s("It's... Ok... Erm, I've actually gotta go... Somewhere...");
		s("Bye...");
		setvar("Tally",1);
		endtext();
	end
	if (T == 1) then
		chav("Tally Cry");
		chnm("Tally");
		s("Oh shorty... Will you ever come home...");
		endtext();
	end
end

function Gramps()
	getvar("Gramps","G");
	if (G == 0) then
		chav("Gramps");
		chnm("Gramps");
		s("Oh.");
		s("It's you, again.");
		chav("You");
		chnm("You");
		s("Nothing like a warm greeting is there, *gramps*");
		chav("Gramps");
		chnm("Gramps");
		s("What are you after this time?");
		s("Money? Drugs?");
		s("Money for drugs?");
		s("Whatever it is, you're not getting any!");
		chav("You");
		chnm("You");
		s("I, err, just want to go through...");
		chav("Gramps");
		chnm("Gramps");
		s("Can't do that, pillar got in the way.");
		s("Pillar blocks all.");
		chav("You");
		chnm("You");
		s("No way at all?");
		s("C'mon *gramps* it's me, your favourite person who woke up in your rest house!");
		chav("Gramps");
		chnm("Gramps");
		s("...");
		s("Don't flatter yourself.");
		s("Here take this...");
		chnm("You");
		chav("You");
		s("Huh?");
		spic("lasercannon");
		s("This looks like a *laser cannon*...");
		hpic();
		chnm("Bently");
		chav("Bently");
		s("If I do say so sir, that seems a rather cliche name for it.");
		chnm("You");
		chav("You");
		s("Yeah, it's not that hip is it? Not really something the cool dudes and dudettes would be down with? Well anyway can you add it to the *arsenal*?");
		setvar("Laser Cannon LVL",1);
		chnm("Bently");
		chav("Bently");
		s("Yes sir./nOh, and sir; Remember *Menu* will let you choose a gun if you hold it and press *Left*, *Right*, *Up* or *Down*");
		chav("Gramps");
		chnm("Gramps");
		s("Ehm.");
		s("I'm not finished.");
		s("If you really have to get through here, talk to the Bob, the builder, in the rest house.");
		s("he built this pillar...");
		s("Oh, glorious pillar...");
		setvar("Gramps",1);
		endtext();
	end
	if (G == 1) then
		chav("Gramps");
		chnm("Gramps");
		s("I said, get lost!");
		endtext();
	end
end
	
function Happy()
	chav("Happy");
	chnm("Happy Guy?");
	s("Why hello there.");
	s("I are happy.");
	endtext();
end

function Saddy()
	getvar("Saddy","S");
	if (S == 0) then
		chav("Saddy");
		chnm("Sad Guy?");
		s("Oh... Hello...");
		s("They call me *Saddy*");
		chnm("Saddy");
		s("I think I had a real name once but I don't remember it...");
		s("Oh well, what about you. Do you have a name?");
		chav("You");
		chnm("You");
		s("Err, actually... I don't think I do!");
		chav("Bently");
		chnm("Bently");
		s("You never told me if you had one, sir.");
		s("But thankfully I only ever have to address you as sir!");
		s("I guess we'll never know...");
		setvar("Saddy",1);
		endtext();
	end
	if (S == 1) then
		chav("Saddy");
		chnm("Saddy");
		s("Do you know your name yet? Do you know mine?!");
		chav("You");
		chnm("You");
		s("Nope");
		endtext();
	end
end

function BobbyTinkertots()
	chav("Bobby Tinkertots");
	chnm("???");
	s("Hel-lo I am Bob-by Tin-ker-tots");
	chnm("Bobby Tinkertots");
	s("I Live here all by my self");
	s("I am very mat-ure and smart");
	endtext();
end

function AirportGuy()
	chav("Airport Guy");
	chnm("Airport Guy");
	s("Have you seen a guy called 'Alphonso'?");
	s("I've heard he's around here, posing as an Italian chef");
	s("(Really, he's an illegal Spanish immigrant!)");
	endtext();
end

function BuilderManBob()
	getvar("BuilderManBob","B");
	if (B == 0) then
		chav("Builder Man Bob");
		chnm("???");
		s("Oh hey!");
		s("Nice to get some company, I'm *Bob*, *Builder Man Bob*");
		chav("You Evil Laugh");
		chnm("You");
		s("Hahaha, *Bob the Builder*!");
		chav("Builder Man Bob");
		chnm("Builder Man Bob");
		s("NO!");
		s("I. Am. Builder. Man. Bob. Ok?");
		chav("You");
		chnm("You");
		s("Oh... Sorry...");
		s("How come you're here then? Did they put you on that bed after you got injured or something?");
		chav("Builder Man Bob");
		chnm("Builder Man Bob");
		s("You seem to know a suspicious amount about my 'accident'...");	
		chav("You");
		chnm("You");
		s("No, actually, same thing happened to me a while ago.");
		s("But some short guy gave me a gun and attacked me when I woke up... Long story..");
		s("Anyway *gramps* sent me here to ask you about... Going onwards?");
		chav("Builder Man Bob");
		chnm("Builder Man Bob");
		s("Ah yes, see that hole in the floor there?");
		chav("You");
		chnm("You");
		s("No...");
		hidetext();
		w(50);
		bang(224,208);
		bang(224,224);
		killblock(224,208);
		killblock(224,224);
		snd("damage.ogg",100);
		setvar("RestHouseBlockage",1);
		w(50);
		showtext();
		s("Yes...");
		s("Thanks, I guess!");
		setvar("BuilderManBob",1);
		endtext();
	end
	if (B == 1) then
		chav("Builder Man Bob");
		chnm("Builder Man Bob");
		s("That's a mighty fine hole that is...");
		endtext();
	end
end

function IceBlockWarning()
	chav("Bently Shocked");
	chnm("Bently");
	s("Stop right where you are sir!");
	chav("You");
	chnm("You");
	s("I have, what is it this time *Bently*");
	chav("Bently Shocked");
	chnm("Bently");
	s("Th-those blocks sir... They're... They're covered in *ice*!");
	s("You'll slip and slide if you walk on them sir!");
	chav("You");
	chnm("You");
	s("And the big deal is...?");
	chav("Bently");
	chnm("Bently");
	s("No big deal, just thought you should know.");
	chav("You");
	chnm("You");
	s("You kinda made it sound like a... Nevermind...");
	setvar("IceBlockWarning",1);
	endtext();
end

function BombFace()
	getvar("BombFace","B");
	if (B == 0) then
		chav("Bomb Face");
		chnm("Bomb Face");
		s("You, don't come any closer!");
		s("Ex-bro!");
		s("You need to be able to fly for this next bit");
		getvar("Ice Blaster LVL","IBL");
		if (IBL == 4) then
			s("Oh wait, your *ice blaster* is already upgraded...");
			s("I guess you don't need me anymore, bro. You can fly solo...");
			setvar("BombFace",1);
			endtext();
		else
			s("You need the Level 4 *Ice Blaster* for this next area!");
			s("Since I'm such a nice guy... I'll upgrade yours for you!");
			chav("Bomb Face Winking");
			s("_*IF* you come to Vegas with me and Tiff again this weekend");
			chav("You");
			chnm("You");
			s("Errrr, sure...");
			chav("Bomb Face");
			chnm("Bomb Face");
			s("Here you go then, bro!");
			chnm("The Mystic Gun Upgrading Force");
			chav("The Mystic Gun Upgrading Force");
			setvar("Ice Blaster LVL",4);
			setvar("Ice Blaster Xp",0);
			addvar("Ice Blaster Xp Needed",999);
			s("_*Ice Blaster* Level Up!");
			s("You now have the *Ice Blaster* LVL 4, it fires bigger ice shards for more damage and increases your fire rate!");
			s("You can even fly with it! Well, sort of... More of a hover... Shoot Downwards");
			chav("Bomb Face");
			chnm("Bomb Face");
			s("Now, away with you!");
			setvar("BombFace",1);
			endtext();
		end
	end
	if (B == 1) then
		chav("Bomb Face");
		chnm("Bomb Face");
		s("Now, away with you!");
		endtext();
	end
end
	
function LockWall()
	chav("Bently");
	chnm("Bently");
	s("Hmm... Sir there seems to be some sort of *blockage* blocking the way!");
	chav("You");
	chnm("You");
	s("Really, captain obvious?");
	chav("Bently");
	chnm("Bently");
	s("Now now sir, no need to get snappy");
	s("These symbols indicate a lock, and my database entries tell me that to open a lock we need a-");
	chav("You");
	chnm("You");
	s("Key?");
	chav("Bently");
	chnm("Bently");
	s("Why yes sir! How did you know?");
	chav("You");
	chnm("You");
	s("Just a lucky guess...");
	setvar("LockWall",1);
	endtext();
end

function LockWallKey()
	chav("Bently");
	chnm("Bently");
	s("Sir! There appears to be a potentially dangerous key here!");
	chav("You");
	chnm("You");
	s("I... I think I need to look at your circuitry or something...");
	s("Anyway, can you pick it up or something? Make it all showey?");
	chav("Bently");
	chnm("Bently");
	s("Yes sir...");
	spic("KeyBig");
	s("Got the *key*!");
	additem("key");
	hpic();
	setvar("LockWallKey",1);
	endtext();
end

function KeyPit()
	chav("Sign");
	chnm("Sign");
	s("The answer is in the walls.");
	endtext();
end

function KeyPitKey()
	chav("Bently");
	chnm("Bently");
	s("Sir! There appears to be a secondary potentially dangerous key here!");
	chav("You");
	chnm("You");
	s("Why is it dangerous?");
	chav("Bently");
	chnm("Bently");
	s("I said *potentially* sir, that doesn't mean it actually is!");
	spic("Rusty Key Big");
	s("Got the * rusty key*!");
	additem("Rusty Key");
	hpic();
	setvar("KeyPitKey",1);
	endtext();
end
	
function SaveGame()
	chnm("Save Point");
	chav("Save Point");
	getvar("slot","SAVESLOT");
	s("Would you like to *save*?/n/nthis will overwrite any data in slot " .. SAVESLOT);
	yn("WANNASAVE","Yes","No");
	if (WANNASAVE == 1) then
	save(SAVESLOT);
	s("game saved! in slot " .. SAVESLOT);
	endtext();
	else
	sinstant("");
	endtext();
	end
end

function BombBoss()
	chav("Bently");
	chnm("Bently");
	s("Sir, I am detecting a large explosive threat in the immediate area!");
	s("I'll sound the alarm!");
	snd("alarm.wav",100);
	s("_*Alert alert bomb in the area*");
	hidetext();
	snd("alarm.wav",100);
	w(35);
	snd("alarm.wav",100);
	w(35);
	snd("alarm.wav",100);
	w(15);
	getnpcpos("Bomb","X","Y");
	cam(X,Y);
	w(20);
	bang(X-8,Y-8);
	snd("Damage.ogg",100);
	npckill("BombSleep");
	showtext();
	chav("Bomb");
	chnm("Bomb");
	s("RAAAAAAAAWWWWWWWRRRRR!");
	func("StartBattle");
	endtext();
end

function BombBossDie()
	chav("Bomb");
	chnm("Bomb");
	s("Why me?!");
	s("I'm too young to die!");
	hidetext();
	getnpcpos("Bomb","X","Y");
	cam(X,Y);
	bang(X,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-16);
	snd("damage.ogg",100);
	w(5);
	npckill("Bomb");
	func("HideBossHUD");
	showtext();
	chav("Bently");
	chnm("Bently");
	s("I think it's over sir!");
	chav("You");
	chnm("You");
	s("We really didn't need to wake him up you know...");
	setvar("BombBoss",1);
	hidetext();
	w(25);
	cam(864,896+16);
	makeblock(864,896+16);
	bang(864,896+16);
	snd("Damage.ogg",100);	
	w(25);
	endtext();
end

function TeleporterToTownIceFields()
	setvar("IceFieldsTownTeleporter",1);
	getvar("IceFieldsTownTeleporter","T");
	getvar("Checked Teleporter","C");
	if (T == 0) then
		if (C == 0) then
			chav("Bently");
			chnm("Bently");
			s("Oh look sir! This seems to be a teleporter!");
			s("But... It's not working right now. I think the network must be down.");
			s("I did tell them that a teleporter network managed by a windows server was a bad idea sir...");
			chav("You");
			chnm("You");
			s("It's alright Bently, I'm sure it'll be back online once they reboot... However long that takes...");
			setvar("Checked Teleporter",1);
			endtext();
		end
		if (C == 1) then
			chav("Bently");
			chnm("Bently");
			s("Still not working sir...");
			endtext();
		end
	end
	if (T == 1) then
		chav("Bently");
		chnm("Bently");
		s("Do you want to teleport to *Town* sir?");
		yn("Teleport","Yeah, Town sounds alright.","No, I like it here.");
		if (Teleport == 1) then
			getframe("F");
			setdoorvars(647,207);
			frame(97);
		else
			endtext();
		end
	end
end

function TeleporterToIceFieldsSign()
	chav("Sign");
	chnm("Sign");
	s("Teleporter to the Ice Fields.");
	endtext();
end

function TeleporterToIceFields()
	getvar("IceFieldsTownTeleporter","T");
	getvar("Checked Teleporter","C");
	if (T == 0) then
		if (C == 0) then
			chav("Bently");
			chnm("Bently");
			s("Oh look sir! This seems to be a teleporter!");
			s("But... It's not working right now. I think the network must be down.");
			s("I did tell them that a teleporter network managed by a windows server was a bad idea sir...");
			chav("You");
			chnm("You");
			s("It's alright Bently, We'll just have to fix all the teleporters as we find them...");
			setvar("Checked Teleporter",1);
			endtext();
		end
		if (C == 1) then
			chav("Bently");
			chnm("Bently");
			s("Still not working sir...");
			endtext();
		end
	end
	if (T == 1) then
		chav("Bently");
		chnm("Bently");
		s("Do you want to teleport to the *Ice Fields* sir?");
		yn("Teleport","Yeah, The Ice Fields sound alright.","No, I like it here.");
		if (Teleport == 1) then
			getframe("F");
			setdoorvars(215,80);
			frame(62);
		else
			endtext();
		end
	end
end

function TeleporterToTownMountains()
	setvar("MountainsTownTeleporter",1);
	getvar("MountainsTownTeleporter","T");
	getvar("Checked Teleporter","C");
	if (T == 0) then
		if (C == 0) then
			chav("Bently");
			chnm("Bently");
			s("Oh look sir! This seems to be a teleporter!");
			s("But... It's not working right now. I think the network must be down.");
			s("I did tell them that a teleporter network managed by a windows server was a bad idea sir...");
			chav("You");
			chnm("You");
			s("It's alright Bently, I'm sure it'll be back online once they reboot... However long that takes...");
			setvar("Checked Teleporter",1);
			endtext();
		end
		if (C == 1) then
			chav("Bently");
			chnm("Bently");
			s("Still not working sir...");
			endtext();
		end
	end
	if (T == 1) then
		chav("Bently");
		chnm("Bently");
		s("Do you want to teleport to *Town* sir?");
		yn("Teleport","Yeah, Town sounds alright.","No, I like it here.");
		if (Teleport == 1) then
			getframe("F");
			setdoorvars(919,207);
			frame(97);
		else
			endtext();
		end
	end
end

function TeleporterToMountainsSign()
	chav("Sign");
	chnm("Sign");
	s("Teleporter to the Mountains.");
	endtext();
end

function TeleporterToMountains()
	getvar("MountainsTownTeleporter","T");
	getvar("Checked Teleporter","C");
	if (T == 0) then
		if (C == 0) then
			chav("Bently");
			chnm("Bently");
			s("Oh look sir! This seems to be a teleporter!");
			s("But... It's not working right now. I think the network must be down.");
			s("I did tell them that a teleporter network managed by a windows server was a bad idea sir...");
			chav("You");
			chnm("You");
			s("It's alright Bently, We'll just have to fix all the teleporters as we find them...");
			setvar("Checked Teleporter",1);
			endtext();
		end
		if (C == 1) then
			chav("Bently");
			chnm("Bently");
			s("Still not working sir...");
			endtext();
		end
	end
	if (T == 1) then
		chav("Bently");
		chnm("Bently");
		s("Do you want to teleport to the *Mountains* sir?");
		yn("Teleport","Yeah, The Mountains sound alright.","No, I like it here.");
		if (Teleport == 1) then
			setdoorvars(743,161);
			frame(66);
		else
			endtext();
		end
	end
end

function TeleporterToTownLabs2()
	setvar("Labs2TownTeleporter",1);
	getvar("Labs2TownTeleporter","T");
	getvar("Checked Teleporter","C");
	if (T == 0) then
		if (C == 0) then
			chav("Bently");
			chnm("Bently");
			s("Oh look sir! This seems to be a teleporter!");
			s("But... It's not working right now. I think the network must be down.");
			s("I did tell them that a teleporter network managed by a windows server was a bad idea sir...");
			chav("You");
			chnm("You");
			s("It's alright Bently, I'm sure it'll be back online once they reboot... However long that takes...");
			setvar("Checked Teleporter",1);
			endtext();
		end
		if (C == 1) then
			chav("Bently");
			chnm("Bently");
			s("Still not working sir...");
			endtext();
		end
	end
	if (T == 1) then
		chav("Bently");
		chnm("Bently");
		s("Do you want to teleport to *Town* sir?");
		yn("Teleport","Yeah, Town sounds alright.","No, I like it here.");
		if (Teleport == 1) then
			getframe("F");
			setdoorvars(999,207);
			frame(97);
		else
			endtext();
		end
	end
end

function TeleporterToLabs2Sign()
	chav("Sign");
	chnm("Sign");
	s("Teleporter to the Labs.");
	endtext();
end

function TeleporterToLabs2()
	getvar("Labs2TownTeleporter","T");
	getvar("Checked Teleporter","C");
	if (T == 0) then
		if (C == 0) then
			chav("Bently");
			chnm("Bently");
			s("Oh look sir! This seems to be a teleporter!");
			s("But... It's not working right now. I think the network must be down.");
			s("I did tell them that a teleporter network managed by a windows server was a bad idea sir...");
			chav("You");
			chnm("You");
			s("It's alright Bently, We'll just have to fix all the teleporters as we find them...");
			setvar("Checked Teleporter",1);
			endtext();
		end
		if (C == 1) then
			chav("Bently");
			chnm("Bently");
			s("Still not working sir...");
			endtext();
		end
	end
	if (T == 1) then
		chav("Bently");
		chnm("Bently");
		s("Do you want to teleport to the *Main Labs* sir?");
		yn("Teleport","Yeah, The Main Labs sound alright.","No, I like it here.");
		if (Teleport == 1) then
			getframe("F");
			setdoorvars(118,256);
			frame(70);
		else
			endtext();
		end
	end
end

function TeleporterToTownLabs3()
	setvar("Labs3TownTeleporter",1);
	getvar("Labs3TownTeleporter","T");
	getvar("Checked Teleporter","C");
	if (T == 0) then
		if (C == 0) then
			chav("Bently");
			chnm("Bently");
			s("Oh look sir! This seems to be a teleporter!");
			s("But... It's not working right now. I think the network must be down.");
			s("I did tell them that a teleporter network managed by a windows server was a bad idea sir...");
			chav("You");
			chnm("You");
			s("It's alright Bently, I'm sure it'll be back online once they reboot... However long that takes...");
			setvar("Checked Teleporter",1);
			endtext();
		end
		if (C == 1) then
			chav("Bently");
			chnm("Bently");
			s("Still not working sir...");
			endtext();
		end
	end
	if (T == 1) then
		chav("Bently");
		chnm("Bently");
		s("Do you want to teleport to *Town* sir?");
		yn("Teleport","Yeah, Town sounds alright.","No, I like it here.");
		if (Teleport == 1) then
			getframe("F");
			setdoorvars(1079,207);
			frame(97);
		else
			endtext();
		end
	end
end

function TeleporterToLabs3Sign()
	chav("Sign");
	chnm("Sign");
	s("Teleporter to the Final Area Of The Labs.");
	endtext();
end

function TeleporterToLabs3()
	getvar("Labs3TownTeleporter","T");
	getvar("Checked Teleporter","C");
	if (T == 0) then
		if (C == 0) then
			chav("Bently");
			chnm("Bently");
			s("Oh look sir! This seems to be a teleporter!");
			s("But... It's not working right now. I think the network must be down.");
			s("I did tell them that a teleporter network managed by a windows server was a bad idea sir...");
			chav("You");
			chnm("You");
			s("It's alright Bently, We'll just have to fix all the teleporters as we find them...");
			setvar("Checked Teleporter",1);
			endtext();
		end
		if (C == 1) then
			chav("Bently");
			chnm("Bently");
			s("Still not working sir...");
			endtext();
		end
	end
	if (T == 1) then
		chav("Bently");
		chnm("Bently");
		s("Do you want to teleport to the *Final Area Of The Labs* sir?");
		yn("Teleport","Yeah, The Final Area Of The Labs sounds alright.","No, I like it here.");
		if (Teleport == 1) then
			getframe("F");
			setdoorvars(1143,721);
			frame(73);
		else
			endtext();
		end
	end
end

function TeleporterToTownLabs4()
	setvar("Labs4TownTeleporter",1);
	getvar("Labs4TownTeleporter","T");
	getvar("Checked Teleporter","C");
	if (T == 0) then
		if (C == 0) then
			chav("Bently");
			chnm("Bently");
			s("Oh look sir! This seems to be a teleporter!");
			s("But... It's not working right now. I think the network must be down.");
			s("I did tell them that a teleporter network managed by a windows server was a bad idea sir...");
			chav("You");
			chnm("You");
			s("It's alright Bently, I'm sure it'll be back online once they reboot... However long that takes...");
			setvar("Checked Teleporter",1);
			endtext();
		end
		if (C == 1) then
			chav("Bently");
			chnm("Bently");
			s("Still not working sir...");
			endtext();
		end
	end
	if (T == 1) then
		chav("Bently");
		chnm("Bently");
		s("Do you want to teleport to *Town* sir?");
		yn("Teleport","Yeah, Town sounds alright.","No, I like it here.");
		if (Teleport == 1) then
			getframe("F");
			setdoorvars(1159,207);
			frame(97);
		else
			endtext();
		end
	end
end

function TeleporterToLabs4Sign()
	chav("Sign");
	chnm("Sign");
	s("Teleporter to the Corridor before the final labs room.");
	endtext();
end

function TeleporterToLabs4()
	getvar("Labs4TownTeleporter","T");
	getvar("Checked Teleporter","C");
	if (T == 0) then
		if (C == 0) then
			chav("Bently");
			chnm("Bently");
			s("Oh look sir! This seems to be a teleporter!");
			s("But... It's not working right now. I think the network must be down.");
			s("I did tell them that a teleporter network managed by a windows server was a bad idea sir...");
			chav("You");
			chnm("You");
			s("It's alright Bently, We'll just have to fix all the teleporters as we find them...");
			setvar("Checked Teleporter",1);
			endtext();
		end
		if (C == 1) then
			chav("Bently");
			chnm("Bently");
			s("Still not working sir...");
			endtext();
		end
	end
	if (T == 1) then
		chav("Bently");
		chnm("Bently");
		s("Do you want to teleport to the *Corridor before the final labs room* sir?");
		yn("Teleport","Yeah, The Corridor before the final labs room sounds alright.","No, I like it here.");
		if (Teleport == 1) then
			getframe("F");
			setdoorvars(3655,289);
			frame(77);
		else
			endtext();
		end
	end
end

function TowerOfInsanity()
	chav("Bently");
	chnm("Bently");
	s("Sir, *google maps* is currently telling me that we are at the bottom of the *tower of insanity*");
	s("And that we need to get to the top of it.");
	chav("You");
	chnm("You");
	s("Why couldn't we just have a nice easy lab like the other evil geniuses...");
	setvar("TowerOfInsanity",1);
	endtext();
end

function IDidIt()
	chav("You Shocked");
	chnm("You");
	s("I freakin' did it!!");
	chav("Bently Shocked");
	chnm("Bently");
	s("You freakin' did it sir!!");
	setvar("IDidIt",1);
	endtext();
end

function RestoreHP()
	chnm("Health Restore Point");
	chav("Fries");
	getvar("Max Hp","MAXHP");
	s("Do you want to eat the food?");
	yn("WANNAHEAL","I'm Hungry!","I'll pass");
	if (WANNAHEAL == 1) then
	setvar("Hp",MAXHP);
	snd("heart.wav",100);
	s("Health Refilled! You have " .. MAXHP .. " Hp");
	endtext();
	else
	s("Yeah I don't eat food I find lying around either...");
	endtext();
	end
end

function MazeRobot()
	chav("Blue Robot");
	chnm("Blue Robot");
	s("The switch that opens this door is supposed to be up top somewhere.");
	s("But the footing's tricky up there");
	s("I fell over and over again until I broke my legs");
	endtext();
end

function BoulderMuncher()
	chav("Boulder Muncher");
	chnm("???");
	s("I am *boulder muncher*!");
	chnm("Boulder Muncher");
	s("Stop where you are!");
	s("I take it you saw the sign above that door back there?");
	s("Well I put it there! It says you have to feed me 3 boulders!");
	s("I can't hunt boulders for myself, so I need you to get them for me! Then I'll open the door for you!");
	setvar("BoulderMuncher",1);
	endtext();
end

-- Make sure to modify the code to use ASS array not alterable values

function BoulderMunched()
	chav("Boulder Muncher");
	chnm("Boulder Muncher");
	s("What?!! This isn't a boulder!");
	s("Boulder Muncher is *angered*!"); 
	s("Take this garbage and *begone*!");
	chnm("You");
	chav("You");
	s("What's this?");
	spic("glacierlauncher");
	s("It seems to be a *glacier launcher*...");
	hpic();
	chnm("Bently");
	chav("Bently");
	s("Very good sir, shall we incinerate this piece of garbage?");
	chnm("You");
	chav("You");
	s("No, no - it may be of some use...");
	setvar("Glacier Launcher LVL",1);
	chnm("Bently");
	chav("Bently");
	s("Oh, and sir. Remember *Menu* will let you choose a gun if you hold it and press *Left*, *Right*, *Up* or *Down*");
	setvar("BoulderMunched",1);
	endtext();
end

function EnterLab()
	chav("You");
	chnm("You");
	s("Now I remember why I built my lab here!");
	chav("You Evil Laugh");
	s("This place is freaking *sweet*!");
	s("Now, time to smoke that pot!");
	chav("Bently Sad");
	chnm("Bently");
	s("Please don't sir, you're not the same when you're trippin'");
	setvar("EnterLab",1);
	endtext();
end

function FinalBossBattleDoor()
	chav("Bently");
	chnm("Bently");
	s("Alright, sir, security scans have  detected two clay-based lifeforms behind this door");
	s("Its been an honour to serve you");
	s("I can't enter, there's a firewall, but in case you don't... I just wanted to tell you");
	chav("You Shocked");
	chnm("You");
	s("What is it Bently?");
	chav("Bently Sad");
	chnm("Bently");
	s("I just have this terrible itch, and if I scratch it I crash...");
	s("It pains me daily");
	chav("You");
	chnm("You");
	s("Why are you telling me this now?");
	chav("Bently");
	chnm("Bently");
	s("I just thought you should know... sir.");
	hidetext();
	w(50);
	showtext();
	chav("Bently");
	chnm("Bently");
	s("Oh, and good luck sir, I guess");
	setvar("FinalBossBattleDoor",1);
	endtext();
end

function VexalFinal()
	chav("You");
	chnm("You");
	s("Hm... Where is everyone?");
	s("I have to stop that pot!");
	hidetext();
	w(50);
	setnpcpos("Vexal",664,418);
	getnpcpos("Vexal","X","Y");
	bang(X-8,Y-8);
	snd("Damage.ogg",100);
	w(25);
	showtext();
	chav("Vexal");
	chnm("Vexal");
	s("Hah, not so fast!");
	s("You're not getting to the big CP just yet!");
	chav("You");
	chnm("You");
	s("C... P...?");
	s("Anyway, I'm just gonna kill you now, deal?");
	chav("Vexal");
	chnm("Vexal");
	s("Yeah sure, but be fore-warned! I have *aiming projectiles*!");
	s("Mwahahahahaaa!");
	func("BattleStart");
	setvar("VexalFinal",1);
	endtext();
end

function BeatVexalFinal()
	hidetextinstant();
	getnpcpos("Vexal","X","Y");
	bang(X,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-16);
	snd("damage.ogg",100);
	w(5);
	showtext();
	chnm("Vexal");
	chav("Vexal");
	s("AAaaaaaaaarrrgggghhhh!!!!!!!");
	chav("You Shocked");
	chnm("You");
	s("I did it! Woo!");
	chnm("Vexal");
	chav("Vexal");
	s("I'm not finished just yet!!");
	s("But i think i need to lie down, i'm all dizzy!");
	getnpcpos("Vexal","VX","VY");
	bang(VX-8,VY-8);
	snd("damage.ogg",100);
	npckill("Vexal");
	setvar("BeatVexalFinal",1);
	snd("damage.ogg",100);
	bang(694,472);
	bang(694,456);
	bang(711,456);
	bang(727,456);
	bang(727,472);
	endtext();
end

function SecretSantaSign()
	chav("Sign");
	chnm("Secret Santa Sign");
	s("If you read this sign comment '*I love Secret Santas*!!!' on www.create-games.com");
	endtext();
end

function PlainsTownTransit()
	chav("You");
	chnm("You");
	s("Its so bright all of a sudden! Wasn't it just *nighttime*?");
	chav("Bently");
	chnm("Bently");
	s("Yes sir, but we're in *Plains* now... why would it be night in *Plains*?")
	chav("You");
	chnm("You");
	s("...");
	s("Moving on...");
	setvar("PlainsTownTransit",1);
	endtext();
end

function Necklace()
	chav("Bently");
	chnm("Bently");
	s("Sir! That appears to be a girl's necklace!");
	chav("You");
	chnm("You");
	s("Well spotted... I knew programming you to be able to identitfy necklaces would someday be of use.");
	chav("Bently");
	chnm("Bently");
	s("Indeed, sir. Shall we take this necklace?");
	chav("You Shocked");
	chnm("You");
	s("What!? It's a girl's necklace! I have no use for it!");
	chav("Bently");
	chnm("Bently");
	s("Oh, of course not sir. I just thought we could give it to any girls we find.");
	chav("You");
	chnm("You");
	s("Well alright... 'cause we've seen *a lot* of girls so far, haven't we?");
	chav("None");
	chnm("???");
	spic("Necklace");
	s("Got the *Necklace*");	
	chav("Bently");
	chnm("Bently");
	s("On we go...");
	hpic("Necklace");
	additem("NecklaceSmall");
	setvar("Necklace",1);
	endtext();
end


function CompanionPotFinal()
	chav("Pot");
	chnm("Companion Pot");
	s("Hey bestest buddy.");
	s("Glad to see you finally made it...");
	chav("You");
	chnm("You");
	s("Companion Pot!!!");
	chav("You Evil Laugh");
	s("I see your attempt to blow up my lab has been futile!");
	chav("Pot");
	chnm("Companion Pot");
	s("Oh bestest buddy, I could've done that ages ago.");
	s("You see, I actually wanted you to be here to see it, so we can do one last thing as bestest buddies!");
	chav("You Shocked");
	chnm("You");
	s("What!? You've been here a while!? Have you touched any of my stuff??");
	chav("Pot");
	chnm("Companion Pot");
	s("I'm sorry bestest buddy, you just have the most intriguing items, and I couldn't help myself to your stash. *GULP*");
	hidetext();
	func("PotGrow" );
	w(75);
	showtext();
	chav("You Shocked");
	chnm("You");
	s("HEY!!!");
	s("THOSE WERE MY STEROIDS!!!");
	chav("Pot");
	chnm("Companion Pot");
	s("Prepare to be crushed...");
	s("...B-Bestest B-Buddy");
	func("StartFight");
	endtext();
end

function BeatCompanionPotFinal()
	chav("Pot");
	chnm("Companion Pot");
	s("Ouch!");
	s("Not bad, bestest buddy.");
	s("I was right to believe you could defeat Veldthie in the last game.");
	s("But it's not over yet. Vexal, let's go and prepare ourselves!");
	chav("You");
	chnm("You");
	s("Right...");
	s("Well come on, let's keep going, Bently!");
	chav("Bently");
	chnm("???");
	s(".....................................");
	chav("You");
	chnm("You");
	s("Oh right, yeah...");
	hidetext();
	getnpcpos("PotPos","X","Y");
	cam(X,Y);
	bang(X,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-32,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-32);
	snd("damage.ogg",100);
	w(5);
	bang(X-32,Y-32);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y+16);
	snd("damage.ogg",100);
	w(5);
	bang(X+16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X+16,Y+16);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-32,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-32);
	snd("damage.ogg",100);
	w(5);
	bang(X-32,Y-32);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y+16);
	snd("damage.ogg",100);
	w(5);
	bang(X+16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X+16,Y+16);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-32,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-32);
	snd("damage.ogg",100);
	w(5);
	bang(X-32,Y-32);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y+16);
	snd("damage.ogg",100);
	w(5);
	bang(X+16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X+16,Y+16);
	snd("damage.ogg",100);
	w(5);	
	func("KillPot");
	setvar("BeatCompanionPotFinal",1);
	w(10);
	camres();
	endtext();
end

function MixedFinal()
	getnpcpos("SceneCam","X","Y");
	cam(X,Y);
	chav("Pot");
	chnm("Companion Pot");
	s("Aha, bestest buddy! There you are, I was beginning to think you wouldn't make it!");
	chav("You");
	chnm("You");
	s("Why did you have to go and fill my lab with worms... That was uncalled for man.");
	s("I thought we were friends, and you go and fill my lab with worms? That's just not cool!");
	s("You used to be cool, but not anymore.");
	chav("Pot");
	chnm("Companion Pot");
	s("I'm... I'm still cool... Right *vexal*?");
	chav("Vexal");
	chnm("Vexal");
	s("Baha- Err I mean, sure, sure you are!");
	s("Anyway 'bestest buddy', shut up already, this is boring!");
	chav("You");
	chnm("You");
	s("Ouch");
	s("Nice insult, pot face");
	chav("Vexal");
	chnm("Vexal");
	s("Oh...");
	s("You are *so* dead!");
	s("it's time for... *pot fusion*!");
	chav("Pot");
	chnm("Companion Pot");
	s("Do we have to do a dance or something?");
	chav("Vexal");
	chnm("Vexal");
	s("Shut up.");
	hidetext();
	w(10);
	func("PotFuse");
	snd("bigbang.wav",100);
	w(50);
	showtext();
	chav("Companion Vexal");
	chnm("Companion Vexal");
	s("Bwahahahahahaha!");
	s("Prepare to meet your doom!!");
	setvar("MixedFinal",1);
	func("StartFight");
	endtext();
end

function BeatMixedFinal()
	chav("Companion Vexal");
	chnm("Companion Vexal");
	s("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARGH");
	s("How is this possible?!");
	chav("You");
	chnm("You");
	s("You forgot to use aiming projectiles again.");
	chav("Companion Vexal");
	chnm("Companion Vexal");
	s("I *knew* there was something i was forgetting...");
	s("And now I'm dead, gosh...");
	hidetext();
	getnpcpos("BossPos","X","Y");
	cam(X,Y);
	bang(X,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-32,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-32);
	snd("damage.ogg",100);
	w(5);
	bang(X-32,Y-32);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y+16);
	snd("damage.ogg",100);
	w(5);
	bang(X+16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X+16,Y+16);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-32,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-32);
	snd("damage.ogg",100);
	w(5);
	bang(X-32,Y-32);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y+16);
	snd("damage.ogg",100);
	w(5);
	bang(X+16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X+16,Y+16);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-32,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-32);
	snd("damage.ogg",100);
	w(5);
	bang(X-32,Y-32);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y+16);
	snd("damage.ogg",100);
	w(5);
	bang(X+16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X+16,Y+16);
	snd("damage.ogg",100);
	w(5);	
	func("KillBoss");
	setvar("BeatMixedFinal",1);
	w(75);
	snd("damage.ogg",100);
	cam(960,288);
	makeblock(960,288);
	bang(960,288);	
	w(35);
	snd("damage.ogg",100);
	cam(992,320);
	makeblock(992,320);
	bang(992,320);	
	w(35);
	snd("damage.ogg",100);
	cam(960,352);
	makeblock(960,352);
	bang(960,352);	
	w(35);
	snd("damage.ogg",100);
	cam(992,384);
	makeblock(992,384);
	bang(992,384);
	w(35);
	snd("damage.ogg",100);
	cam(960,416);
	makeblock(960,416);
	bang(960,416);
	w(35);
	snd("damage.ogg",100);
	cam(992,448);
	makeblock(992,448);
	bang(992,448);
	w(35);
	camres();
	w(15);
	showtext();
	chav("You");
	chnm("You");
	s("Man, that was totally awesome.");
	s("I wonder how you even set up something to make the blocks just appear like that!?");
	s("Ah well...");
	endtext();
end

function SecretBoss()
	chav("You");
	chnm("You");
	s("Oh, well look what we have here!");
	s("You look familiar... Do I know you from somewhere?");
	chav("Old You");
	chnm("???");
	s("Cut the Cabbage, pops! I'm here to pull the plug on your *evil ever eternal winter world project*!");
	chav("You Shocked");
	chnm("You");
	s("How did you know about that? My investors are gonna kill me if its leaked!");
	chav("Old You");
	chnm("???");
	s("Stick a pot in it! I'm going to kill you now! So be warned!");
	func("StartBattle");
	setvar("SecretBoss",1);
	endtext();
end

function SecretBossBeat()
	chnm("???");
	chav("Old You");
	s("Owwwiiieeee!!");
	chav("You Shocked");
	chnm("You");
	s("Wait, I know who you are...");
	s("You're... You're me?!");
	chnm("???");
	chav("Old You");
	s("No! Its impossible! You killed me!");
	chav("You");
	chnm("You");
	s("No Luke, I am you!");
	chnm("???");
	chav("Old You");
	s("_*Noooooooooooooooooooo*!!!!!!!!!!!!!!");
	hidetext();
	w(10);
	getnpcpos("BossPos","X","Y");
	bang(X,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-16);
	snd("damage.ogg",100);
	func("KillBoss");
	w(5);
	setvar("SecretBossBeat",1);
	showtext();
	chav("You");
	chnm("You");
	s("Oops...");
	func("MakeWayOut");
	endtext();
end

function FinishedNormal()
	chav("Bently");
	chnm("Bently");
	s("Sir! You're Alive! Did you defeat that *dastardly duo*?");
	chav("You");
	chnm("You");
	s("With one hand tied behind my back");
	chav("Bently");
	chnm("Bently");
	s("Excellent sir!");
	hidetext();
	w(80);
	showtext();
	chav("You");
	chnm("You");
	s("You know Bently, for someone who just destroyed his two greatest rivals I feel very unsatified...");
	hidetext();
	w(50);
	showtext();
	chav("Bently");
	chnm("Bently");
	s("... Would you like to play PS3, sir?");
	chav("You");
	chnm("You");
	s("Please");
	hidetext();
	fadein(10);
	w(50);
	setvar("EndingScene",1);
	getvar("Ending","E");
	if (E == 2) then
		frame(SECRET);
	else
		frame(CREDITS);
	end
end

function GrampsFound()
	chav("None");
	chnm("???");
	s("You had to go ruin everything didn't you?");
	chav("You");
	chnm("You");
	s("Huh? Who's There?");
	hidetext();
	func("MoveGramps");
	w(260);
	showtext();
	s("Oh it's just you *gramps*...");
	s("How'd I ruin anything?");
	chav("Gramps");
	chnm("Gramps");
	s("You couldn't just *DIE* like all the other evil villains...");
	chav("You");
	chnm("You");
	s("_*villains*? There was only Veldthie?");
	chav("Gramps");
	chnm("Gramps");
	s("No you fool! There was the Professor, Claw Carlson, Pattison Murder, Stabby, Jabby, Inky, Blinky, Pinky, Clyde, the Captain of Death and the Fluffi-");
	chav("You");
	chnm("You");
	s("I get  the idea... What happened to them all?");
	chav("Gramps Happy");
	chnm("Gramps");
	s("I had them all killed!");
	chav("You Shocked");
	chnm("You");
	s("But... Why?");
	chav("Gramps");
	chnm("Gramps");
	s("Well then, back when I was just a youngster like yourself, I was the evilest genius the world had ever seen.");
	s("I made death rays, laser cannons the size of houses, and doomsday devices by the hundreds. But there was one thing I always wanted.");
	chav("You");
	chnm("You");
	s("New Dentures?");
	chav("Gramps");
	chnm("Gramps");
	s("Well that'd be nice... I mean, err, quiet you! A *WINTER BOMB*! A bomb so powerful it could plunge the world into a permanent state of winter!");
	chav("You");
	chnm("You");
	s("So you could do that? Why Winter?");
	chav("Gramps");
	chnm("Gramps");
	s("To prank santa! It was a bet we had when we were frat brothers.");
	chav("You");
	chnm("You");
	s("Right...");
	chav("Gramps");
	chnm("Gramps");
	s("But there was one problem : the bomb needed *power*, *power* that this world has never seen and I had no way to get it...");
	chav("You");
	chnm("You");
	s("So you're using evil souls?");
	chav("Gramps");
	chnm("Gramps");
	s("So I'm using evil sou- How'd you know that?");
	chav("You");
	chnm("You");
	s("Lucky guess...");
	chav("Gramps");
	chnm("Gramps");
	s("Well none of that matters anymore. You didn't die...");
	s("But I'm feeling nice, leave and don't come back and you will be spared!");
	setvar("GrampsFound",1);
	endtext();
end

function CameBackToGramps()
	chnm("Gramps");
	chav("Gramps Evil");
	s("You came back! Time to die!!");
	func("StartBattle");
	endtext();
end

function KilledGramps()
	chav("Gramps Evil");
	chnm("Gramps");
	s("Owwwwwwww!");
	hidetext();
	w(10);
	getnpcpos("Gramps2","X","Y");
	bang(X,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y);
	snd("damage.ogg",100);
	w(5);
	bang(X,Y-16);
	snd("damage.ogg",100);
	w(5);
	bang(X-16,Y-16);
	snd("damage.ogg",100);
	func("KillBoss");
	w(5);
	func("KillBoss");
	setvar("KilledGramps",1);
	endtext();
end	

function PowerUpWinterBomb()
	chav("You");
	chnm("You");
	s("Huh? what's going on?");
	chav("Gramps Evil");
	chnm("Gramps");
	s("The bomb controller... It's activated!");
	hidetext();
	func("Souls");
	w(300);
	showtext();
	s("No! You've activated the *Winter Bomb*");
	s("The souls of 729 *ill-tempered enemies* have powered it up!")
	chav("You");
	chnm("You");
	s("Haha! You lose Gramps! And I came out on top *again*!")
	chav("Gramps");
	chnm("Gramps");
	s("Its gonna blow!!!")
	chav("You");
	chnm("You");
	s("Awww crumpets!");
	s("...");
	hidetext();
	w(30);
	snd("bigbang.wav",100);
	func("Flash");
	endtext();
end

function WinterBombAftermath()
	hidetext();
	fadein(1);
	w(150);
	showtext();
	chav("???");
	chnm("???");
	s("Sir! Sir! Wake up!");
	hidetext();
	fadeout(20);
	w(80);
	showtext();
	chav("You");
	chnm("You Shocked");
	s("Bently? Why am I wet?");
	chav("Bently");
	chnm("Bently");
	s("Snow sir! Its snowing!");
	chav("You");
	chnm("You Shocked");
	s("I'm so... *cold*...");
	hidetext();
	fadein(20);
	w(80);
	setvar("Ending", 2);
	setvar("BlockGramps",1);
	setdoorvars(894,260);
	frame(79);
end

function LaserBlocks()
	chav("Bently");
	chnm("Bently");
	s("Sir!");
	s("It appears there are blocks ahead that we haven't encountered before...");
	s("Scans suggest that they can be destroyed by destroying an enemy nearby...");
	s("Try destroying that robo-mine enemy?");
	setvar("LaserBlocks",1);
	endtext();
end

function RunSign()
	chav("Sign");
	chnm("Sign");
	s("Quick, go back left, past the door at the start!");
	endtext();
end

function IceBlasterLVLUp()
	getvar("Ice Blaster LVL","IBLVL");
	spic("iceblasterlvlup");
		if (IBLVL == 1) then
		chnm("The Mystic Gun Upgrading Force");
		chav("The Mystic Gun Upgrading Force");
		setvar("Ice Blaster LVL",2);
		setvar("Ice Blaster Xp",0);
		addvar("Ice Blaster Xp Needed",300);
		s("_*Ice Blaster* Level Up!");
		s("You now have the *Ice Blaster* LVL 2, it fires bigger ice shards for more damage!");
		hpic();
		endtext();
		end
		if (IBLVL == 2) then
		chnm("The Mystic Gun Upgrading Force");
		chav("The Mystic Gun Upgrading Force");
		setvar("Ice Blaster LVL",3);
		setvar("Ice Blaster Xp",0);
		addvar("Ice Blaster Xp Needed",600);
		s("_*Ice Blaster* Level Up!");
		s("You now have the *Ice Blaster* LVL 3, you can now hold *Shoot* to rapid fire!");
		hpic();
		endtext();
		end
		if (IBLVL == 3) then
		chnm("The Mystic Gun Upgrading Force");
		chav("The Mystic Gun Upgrading Force");
		setvar("Ice Blaster LVL",4);
		setvar("Ice Blaster Xp",0);
		addvar("Ice Blaster Xp Needed",999);
		s("_*Ice Blaster* Level Up!");
		s("You now have the *Ice Blaster* LVL 4, it fires bigger ice shards for more damage and increases your fire rate!");
		s("You can even fly with it! Well it's more of a hover really... Just shoot down...");
		hpic();
		endtext();
		end
end

function SnowBouncerLVLUp()
	getvar("Snow Bouncer LVL","SBLVL");
	spic("snowbouncerlvlup");
		if (SBLVL == 1) then
		chnm("The Mystic Gun Upgrading Force");
		chav("The Mystic Gun Upgrading Force");
		setvar("Snow Bouncer LVL",2);
		setvar("Snow Bouncer Xp",0);
		addvar("Snow Bouncer Xp Needed",200);
		s("_*Snow Bouncer* Level Up!");
		s("You now have the *Snow Bouncer* LVL 2, it fires two mines at once!");
		hpic();
		endtext();
		end
		if (SBLVL == 2) then
		chnm("The Mystic Gun Upgrading Force");
		chav("The Mystic Gun Upgrading Force");
		setvar("Snow Bouncer LVL",3);
		setvar("Snow Bouncer Xp",0);
		addvar("Snow Bouncer Xp Needed",450);
		s("_*Snow Bouncer* Level Up!");
		s("You now have the *Snow Bouncer* LVL 3, you can now fire larger mines! These will split into smaller ones on impact!");
		hpic();
		endtext();
		end
		if (SBLVL == 3) then
		chnm("The Mystic Gun Upgrading Force");
		chav("The Mystic Gun Upgrading Force");
		setvar("Snow Bouncer LVL",4);
		setvar("Snow Bouncer Xp",0);
		addvar("Snow Bouncer Xp Needed",325);
		s("_*Snow Bouncer* Level Up!");
		s("You now have the *Snow Bouncer* LVL 4, now you can fire two large mines at once!");
		hpic();
		endtext();
		end
end

function GlacierLauncherLVLUp()
	getvar("Glacier Launcher LVL","GLLVL");
	spic("glacierlauncherlvlup");
		if (GLLVL == 1) then
		chnm("The Mystic Gun Upgrading Force");
		chav("The Mystic Gun Upgrading Force");
		setvar("Glacier Launcher LVL",2);
		setvar("Glacier Launcher Xp",0);
		addvar("Glacier Launcher Xp Needed",200);
		s("_*Glacier Launcher* Level Up!");
		s("You now have the *Glacier Launcher* LVL 2, you can now fire a more powerful... 'Glacier'!");
		hpic();
		endtext();
		end
		if (GLLVL == 2) then
		chnm("The Mystic Gun Upgrading Force");
		chav("The Mystic Gun Upgrading Force");
		setvar("Glacier Launcher LVL",3);
		setvar("Glacier Launcher Xp",0);
		addvar("Glacier Launcher Xp Needed",350);
		s("_*Glacier Launcher* Level Up!");
		s("You now have the *Glacier Launcher* LVL 3, now you can fire two Ice Rockets at once!");
		hpic();
		endtext();
		end
		if (GLLVL == 3) then
		chnm("The Mystic Gun Upgrading Force");
		chav("The Mystic Gun Upgrading Force");
		setvar("Glacier Launcher LVL",4);
		setvar("Glacier Launcher Xp",0);
		addvar("Glacier Launcher Xp Needed",325);
		s("_*Glacier Launcher* Level Up!");
		s("You now have the *Glacier Launcher* LVL 4, You can now fire 3 Rockets simultaneously!");
		hpic();
		endtext();
		end
end

function TooHigh()
	chav("Bently");
	chnm("Bently");
	s("Sir this block is too high to reach currently");
	s("Perhaps later you will have a way to get up?");
	setvar("TooHigh",1);
	endtext();
end

function FarTooHigh()
	chav("Bently");
	chnm("Bently");
	s("Sir this block is too high to reach currently");
	s("Perhaps later you will have a way to get up?");
	setvar("FarTooHigh",1);
	endtext();
end

function AngryBlocks()
	chav("Bently");
	chnm("Bently");
	s("Sir!");
	s("Look! Those blocks... they look... angry!");
	s("I don't think that any old gun will get through them!");
	s("Whatever will we do...?");
	setvar("AngryBlocks",1);
	endtext();
end

function LaserCannonLVLUp()
	getvar("Laser Cannon LVL","LCLVL");
	spic("lasercannonlvlup");
		if (LCLVL == 1) then
		chnm("The Mystic Gun Upgrading Force");
		chav("The Mystic Gun Upgrading Force");
		setvar("Laser Cannon LVL",2);
		setvar("Laser Cannon Xp",0);
		addvar("Laser Cannon Xp Needed",225);
		s("_*Laser Cannon* Level Up!");
		s("You now have the *Laser Cannon* LVL 2, it can fire a more concentrated laser!");
		hpic();
		endtext();
		end
		if (LCLVL == 2) then
		chnm("The Mystic Gun Upgrading Force");
		chav("The Mystic Gun Upgrading Force");
		setvar("Laser Cannon LVL",3);
		setvar("Laser Cannon Xp",0);
		addvar("Laser Cannon Xp Needed",375);
		s("_*Laser Cannon* Level Up!");
		s("You now have the *Laser Cannon* LVL 3, you can fire an even more powerful laser! (Disobeying most scientific theory)");
		hpic();
		endtext();
		end
		if (LCLVL == 3) then
		chnm("The Mystic Gun Upgrading Force");
		chav("The Mystic Gun Upgrading Force");
		setvar("Laser Cannon LVL",4);
		setvar("Laser Cannon Xp",0);
		addvar("Laser Cannon Xp Needed",325);
		s("_*Laser Cannon* Level Up!");
		s("You now have the *Laser Cannon* LVL 4, you can rapid fire a solid beam of laser energy!");
		s("But be warned, if you fire it constantly for too long it will overheat!");
		s("You have to wait for it to cool down before using it again!");
		hpic();
		endtext();
		end
end

function SnowBouncer()
	chnm("You");
	chav("You");
	s("What's this?");
	spic("snowbouncer");
	s("It seems to be a *snow bouncer*...");
	hpic();
	chnm("Bently");
	chav("Bently");
	s("Very good sir, shall I add it to the *arsenal*?");
	chnm("You");
	chav("You");
	s("Please do, this may come in handy...");
	setvar("Snow Bouncer LVL",1);
	chnm("Bently");
	chav("Bently");
	s("Oh, and sir. Remember *Menu* will let you choose a gun if you hold it and press *Left*, *Right*, *Up* or *Down*");
	endtext();
end

function GlacierLauncher()
	chnm("You");
	chav("You");
	s("What's this?");
	spic("glacierlauncher");
	s("It seems to be a *glacier launcher*...");
	hpic();
	chnm("Bently");
	chav("Bently");
	s("Very good sir, shall we incinerate this piece of garbage?");
	chnm("You");
	chav("You");
	s("No, no - it may be of some use...");
	setvar("Glacier Launcher LVL",1);
	chnm("Bently");
	chav("Bently");
	s("Oh, and sir. Remember *Menu* will let you choose a gun if you hold it and press *Left*, *Right*, *Up* or *Down*");
	endtext();
end

function LaserCannon()
	chnm("You");
	chav("You");
	s("Huh?");
	spic("lasercannon");
	s("This looks like a *laser cannon*...");
	hpic();
	chnm("Bently");
	chav("Bently");
	s("If I do say so sir, that seems a rather cliche name for it.");
	chnm("You");
	chav("You");
	s("Yeah, it's not that hip is it? Well anyway can you add it to the *arsenal*?");
	setvar("Laser Cannon LVL",1);
	chnm("Bently");
	chav("Bently");
	s("Yes sir./nOh, and sir; Remember *Menu* will let you choose a gun if you hold it and press *Left*, *Right*, *Up* or *Down*");
	endtext();
end

function hax()
	addvar("Hp",999);
	addvar("Max Hp",999);
	addvar("Money",9999);
	setvar("Ice Blaster LVL",4);
	s("Leet *HAX*!");
	endtext();
end

function Death()
	chnm("The Grim Reaper");
	chav("The Grim Reaper");
	s("You, have died.");
	s("Do you want to reload from the last save point?");
	yn("WANNARELOAD","Yes","No");
	if (WANNARELOAD == 1) then
		getvar("slot","SAVESLOT");
		load(SAVESLOT);
		endtext();
	else
		frame(1);
	end
end

function HpUp()
	chnm("Hp Booster");
	chav("Hp Up");
	s("_*Hp* Up!");
	snd("heart.wav",100);
	s("Your *HP* has increased by " .. HP_UP_AMOUNT .. "!");
	addvar("Max HP",HP_UP_AMOUNT);
	addvar("HP",HP_UP_AMOUNT);
	chnm("Bently");
	chav("Bently");
	s("Oh, that's most excellent sir!");
	func("checkhpups");
	endtext();
end

function TestSign()
	chnm("Sign");
	chav("Sign");
	s("Hello there! I am a *sign*!");
	s("Do you know what that means?");
	yn("DOYOUKNOWSIGNLANGUAGE","Yup!","Err... Nope!");
	if (DOYOUKNOWSIGNLANGUAGE == 1) then
		s("Oh really?");
		s("Well then Mr. Know-It-All this conversation is over!");
		hidetext();
		getnpcpos("TestSign","NPCX","NPCY");
		bang(NPCX,NPCY,0);
		snd("damage.ogg",100);
		npckill("TestSign");
		endtext();
	else
		s("It means I can only speak *sign language*!");
		s("Isn't that cool?");
		yn("ISSIGNLANGUAGECOOL","Oh god yes!","Not, really...");
		if (ISSIGNLANGUAGECOOL == 1) then
			s("That was the right answer!");
			s("Now run along!");
			endtext();
		else
			tcol(255,0,0);
			s("You... You insulent little...");
			s("Get out of my sight!");
			tres();
			s("or else I might do something *nasty*");
			hidetext();
			getnpcpos("TestSign","NPCX","NPCY");
			bang(NPCX,NPCY,0);
			snd("damage.ogg",100);
			npckill("TestSign");
			endtext();
		end
	end
end

function Ip()
	getvar("IpTalk","TALKEDTOME");
	if (TALKEDTOME == 0) then
		chnm("Ip");
		chav("Ip");
		s("Hey, who are you?");
		chnm("You");
		chav("You");
		s("I'm... Err... Look I'll be honest - I'm an *orphan*./n/nI was never named and I don't know if I even have a family...");
		chnm("Ip");
		chav("IpShock");
		s("You look like me... Wait does that mean!?");
		yn("AREWEBROTHERS","We must be brothers!","Mean what? That you're stupid?");
		if (AREWEBROTHERS == 1) then
			s("No... It's impossible... You're a blue guy in a suit and I'm an unholy mix of cat and dog!");
			chnm("You");
			chav("You");
			s("Maybe, we're *half brothers*?");
			chnm("Ip");
			chav("IpCry");
			s("But... Who the... Mum?!");
			s("I... I need to be alone for a while...");
			setvar("IpTalk",1);
			endtext();
		else
			s("Well, I guess that means no then. No relation of mine could ever employ such poor humour.");
			setvar("IpTalk",2);
			endtext();
		end
	end
	if (TALKEDTOME == 1) then
		chnm("Ip");
		chav("IpCry");
		s("Leave me alone...");
		endtext();
	end
	if (TALKEDTOME == 2) then
		chnm("Ip");
		chav("Ip");
		s("Go away...");
		endtext();
	end
end	