/*
 * Aunts and Butlers
 *
 * Special code
 *
 */

GAME_NAME = 'Aunts and Butlers'
GAME_ID = 'AMP'
MAX_SCORE = 32;

HIGHLIGHT_COLOUR = '#000000' ;
INPUT_COLOUR = '#666666';

INV_CAP = 20; // number of items in inventory

MANNER_FREQ = 5 // 1 in (this) chance of a character doing a 'mannerism' each turn

rating = new Object;
rating[0] = 'an imbecile';
rating[1] = 'mentally negligible';
rating[10] = 'an amiable halfwit';
rating[20] = 'a promising sort';
rating[30] = 'a half-decent chap';
rating[40] = 'a decent chap';
rating[50] = 'a splendid chap';
rating[60] = 'a jolly good fellow';
rating[70] = 'an aspiring gentleman';
rating[80] = 'a gentleman';
rating[90] = 'a nobleman';
rating[100] = 'an esteemed personage';

function score_rating()
{
	var txt = ('\nThe butler rates you as ')
	for(var i=sc_percent();i>=0;--i)
		if(rating[i])
		{
			txt += (rating[i]);
			break;
		}
	txt += '.'
	return(txt);
}

START_LOC = drawing_room;

/*
INTRO = 'Morning. Light. Pain. You were on the sauce last night. Angry \
about something...\n\
Aunt Cedilla.\n\
Oh, no. Your only elderly, unmarried relative will be arriving for tea today - \
probably accompanied by her wretched poodle, Gladstone - and \
she may get around to discussing the matter of your inheritance. \
If you plan to keep a roof over your head much longer, it is vital \
that you present yourself as a gentleman and give the old plague whatever she \
wants.\n\
All this comes back to you as you emerge half-dazed from your bedroom, and the knocking of \
a fist at your front door raps unpleasantly against the inside of your skull.\n\n';
*/


INTRO = 'Dressing for dinner!\n\
It\'s pretty good dressing, to be fair, but you do wish you had a bit of salad \
to go with it, and one or two more courses. Alas, you\'ve been a mite strapped for \
cash lately and it\'s been a tricky thing keeping the old wolf from the old door. \
This is why it\'s so important for you, the Hon. Ampersand Fodge, to be on extra-top, \
supra-gentlemanly form when dear old Aunt Cedilla - dear old uninherited Aunt Cedilla - \
arrives, wretched poodle Gladstone in tow; and why it\'s so thick that all you\'ve \
got to wine and/or dine the old plague with is a bottle of balsamic vinaigrette. \
Perhaps you\'d better not ask her to stay for supper after all.\n\
There is a knock at your front door. You absent-mindedly down the vinaigrette, \
and wipe your mouth on your cuff.\n\n';

function initialiseGame()
{
	give_hero(bottle);
	sleep(cowboy);
}

PARDON = 'Pardon?';

// flag abbreviations
OPENED_TRUNK = 'f1'; // opened trunk in servants' quarters
TRUNK_OPEN = OPENED_TRUNK; // quick, nasty bugfix
DONE_TEA = 'f2'; // given Aunt Cedilla her tea
CUP_CONTENTS = 'f3'; // 0 = nothing; 1 = water; 2 = 'tea'  ;3= ash only
GOT_SUITCASE = 'f4'; // got Aunt Cedilla's suitcase
OPENED_CASE = 'f5'; // opened it
ASKED_FOR_BUTLER = 'f6'; // Aunt Cedilla has asked for the butler
WATER_POINT = 'f7'; // filled cup with water and got point for it
WARNED_FIGHTAUNT = 'f10'; // Butler has warned of fighting Cedilla
WARNED_URN = 'f11'; // Butler has warned of giving Cedilla urn
WARNED_MAZE = 'f12'; // Butler has warned about the maze (The North)
WARNED_VIRGULE = 'f13'; // warned about fighting Virgule
WARNED_TEA = 'f14'; // warned not to drink the tea
WARNED_FIGHTPLANK = 'f15'; // warned not to fight Sergeant Plank
WARNED_CROSSRAILS = 'f16'; // warned not to walk on railway
WARNED_LEAVESTN = 'f17'; // warned not to leave station before Virgule arrives
WARNED_SHOWHAT = 'f18'; // warned not to show hat to virgule
WARNED_HAT = 'f18'; // warned not to wear hat
WARNED_HAGGIS = 'f19'; // warned not to eat haggis
WARNED_FIGHTFATTY = 'ff10'; // warned not to fight Commander Fatty
WARNED_FEEDFATTY = 'ff11'; // warned not to give Fatty the haggis
NO_WARNINGS = 'f20'; // set when butler becomes 'proper' character, no automatic warnings!
STATION_CLOSED = 'f21'; // station is closed
NORTH_OF_DIVIDE = 'f22'; // player is north of "divide" room (affects its description)
NORTH_OF_BRIDLE = 'f23'; // player is north of bridleway (affects "seems like hours")
VIRG_ARRIVED = 'f24'; // Cousin Vrigule arrived
VIRG_FOLLOW = 'f25'; // Cousin Virgule is following the PC
GOT_HAT = 'f30'; // got hat out of lost-property box
HAT_TIMER = 'f31'; // timer for Ampersand or Cedilla wearing the hat - they get shot on 1
AUNT_IN_HAT = 'f32'; // Aunt Cedilla is wearing the hat
DONE_MURDER = 'f40'; // Cedilla dead
SEEN_MURDER = 'f41'; // Player told of murder (it can happen when he\'s not there)
MURDER_TIMER = 'f42'; // counter that counts upwards during the murder
DONE_GAOLBREAK = 'f50'; // Butler has been broken out of gaol
GOT_PIGEON = 'f51'; // Got the pigeon at the moment
DONE_PIGEON = 'f52'; // Ever done the pigeon
ALF_FOLLOW = 'f53'; // Alf following
ALF_WANDER = 'f54'; // Alf's wander through the house.
RIPPED_LETTER = 'f60'; // IOU ripped in half so it is now fake will
BEEN_BELOW = 'f71'; // been below stairs yet
FATTY_FED = 'f80'; // Fatty has had his supper
FATTY_ON_CIRCLE = 'f81'; // Fatty is standing on the circle
GOT_COLLAR = 'f82'; // Got the collar from the stardrive
STARSHIP_EXPLODING = 'f83'; // Starship begins to explode...
STARSHIP_EXPLOSION_OVER = 'f84'; // kludge. Starship has exploded and won't again.
MILL_WINDOWOPEN = 'f90'; // Window is open in mill
FALL_OFF_ROOF = 'f91'; // Falling off the roof
GOT_STOVEPIPE = 'f92'; // Broken the stovepipe
DONE_WHEEL = 'f93'; // Grabbed the wheel for the first time
GOT_TIE = 'f100'; // Office worker has taken his tie off
DONE_SPIT = 'f110'; // Done spitting into the spittoon
GOT_JERKIN = 'f111'; // Got the jerkin
PUSHED_EMBALMER = 'f120'; // Pushed the embalmer into the sarcophagus
EMBALMER_TALKED = 'f121'; // Embalmer introduced himself
GOT_FLOWER = 'f130'; // Picked flower in cave
KNIGHT_HAS_LANCE = 'f140'; // Knight has lance
GOT_HANKY = 'f141'; // player has handkerchief
GOT_CARD = 'f150'; // player has visiting card

// flags which are initially zero needn't be set here
function set_gameflags()
{
}

function game_help()
{
	window.open('amphelp.html','help',
	  'width=600,height=400,scrollbars=yes,menubar=no,resizable=yes,status=no,toolbar=no');
//	say('See the file "walkthru.txt" for a full walkthrough.');
}

function anywhere_append()
{
	var txt = '';

	if(gs(GOT_PIGEON)==1)
	{
		txt += ('\nThere is a carrier pigeon circling your head.');
		var hlName = heroloc().name;
		if(hlName.indexOf('maze')==0)
		{
			var mazeN = 1 * hlName.substring(4, hlName.length);
			txt += (' Its orbit errs toward the ' + MAZESOLUTION[mazeN] + '.');
		}
	}
	
		
	return(txt);
}

// function run after every move in the game. This is the lazy place to pick up special commands
function anywhere_do()
{
	// fuse for arrival of Cousin Virgule (after a few turns waiting on the platform)
	var virgArr = gs(VIRG_ARRIVED);
	if(visited(platform) && virgArr!=1)
	{
		if(virgArr==0)
		{
			sgs(VIRG_ARRIVED, 5)
		}
		else if(virgArr==2)
		{
			virguleArrives()
			sgs(VIRG_ARRIVED, 1);
		}
		else
		{
			sgs(VIRG_ARRIVED, virgArr - 1);
			if(heroloc()==platform)
				say('\nThe engine noise becomes louder.');
		}
	}
	
	// hat fuse
	var hatTime = gs(HAT_TIMER)
	if(hatTime > 0 && gs(DONE_MURDER)!=1)
	{
		if(hatTime!=1)
		{
			sgs(HAT_TIMER, hatTime - 1);
		}
		else if(worn(hat))
		{
			die('\nSuddenly, Cousin Virgule leaps out from \
[[ heroloc()==drawing_room ? "behind the piano" : "nowhere" ]], with his shotgun \
pointed straight at the stuffed pheasant on your hat. "Hey, pheasant!" he \
yells - "take this!"\n*BLAM*');
		}
		else // the hat is on Aunt Cedilla
		{
			
			var hLoc = heroloc();
			if(hLoc==personloc(cedilla))
			{
				say('\nSuddenly, Cousin Virgule leaps out from behind the piano, \
with his shotgun pointed straight at Aunt Cedilla\'s hat. "Hey, pheasant!" he yells - \
"take this!"\n\
*BLAM*\n\
\It\'s a good shot. The hat is completely destroyed, along with much of Aunt Cedilla\'s head. Her corpse \
slithers out of the chair and onto the carpet.\n\
"Whoopsie," says Cousin Virgule soberly. "My bad."');
				sgs(DONE_MURDER, 1);
				sgs(SEEN_MURDER, 1);
				sgs(MURDER_TIMER, 1);
				sgs(HAT_TIMER, 0); 
				set_personloc(virgule, drawing_room);
				set_personloc(cedilla, nowhere);
				set_thingloc(corpse, drawing_room);
			}
			else if(gs(DONE_MURDER)!=1)
			{
				if(hLoc==porch || hLoc==lobby || hLoc==top_of_stairs || hLoc==bedroom)
					say('\nYou hear an unsettling BLAM from the direction of the drawing room.')
				else
					say('\nYou hear an unsettling BLAM from the direction of the Manor.');

				sgs(HAT_TIMER, 0);
				sgs(DONE_MURDER, 1);
				// but not SEEN_MURDER. Plot doesn't progress until PC comes back to drawing room.
				set_personloc(virgule, drawing_room);
				set_personloc(cedilla, nowhere);
				set_thingloc(corpse, drawing_room);
			}
		}
		
	}
	
	// murder counter
	var mTime = gs(MURDER_TIMER)
	if(mTime > 0)
	{
		if(mTime==1) // warnings over. Butler about to be introduced as 'real' character
			sgs(NO_WARNINGS, 1);
		
		sgs(MURDER_TIMER, ++mTime); // increment both local variable and Game_state content
		if(mTime==3)
		{
			say('\nSergeant Plank arrives.\n\
"I was passin\' by," he says, "and I couldn\'t \'elp \'earin\' this sort of \'blam\'..." His eyes \
land on the corpse. \n\
"Blimey," he observes, looking slowly from you to Cousin Virgule to Cousin Virgule\'s shotgun.\n\
Cousin Virgule points at you, hollers "It was him!" and runs out the door.\n\
"That\'s good enough for me," says the Sergeant, turning to you aggressively. "Right, Fodge, you\'re nicked!"');

			set_personloc(plank, heroloc());
			set_personloc(virgule, nowhere);
		}
		else if(mTime==4)
		{
			say('\n"Well, well," jeers Sergeant Plank. "Looks like I\'ve nicked meself \
a haristocrat. I could be famous for this," he muses.');
		}
		else if(mTime==5)
		{
			give_hero(bell);
			say('\nYou hear what sounds like a polite cough at your \
shoulder, and you suddenly notice that you are holding a silver bell.');
		}
		else if(mTime==7)
		{
			die('\n"Enough dilly-dallyin\'," says Sergeant Plank. "Let\'s \
get you to a gallows."', 'Cripes, you\'re for it now');
		}
			
//			// butler\'s big entrance
//			set_personloc(butler, heroloc())
//			say('\nAn impeccably dressed butler sidles into the room.\n\
//"Excuse me, Sergeant," he says, "I did it."\n\
//Sergeant Plank scratches his head.\n\
//"Er... right then," he says, looking rather disappointed. "_You\'re_ nicked. Looks like you got \
//away with it this time then, Fodge," he adds, and leads the butler away in handcuffs.');
//			sgs(MURDER_TIMER, 0);
//			set_personloc(plank, police);
//			set_personloc(butler, cell);
	}

	// alf frees butler from cell
	if(heroloc()==cell && personloc(alf)==cell && personloc(butler)==cell && gs(DONE_GAOLBREAK)==0)
	{
		say('\nAlf kneels, temporarily produces a pick-axe from behind one ear, and neatly breaks \
the butler\'s chains.\n\
"Thank you, sir," says the butler. "And now, with your permission, I shall return to your \
residence and attend to the small matter of burying Her Ladyship.\"\n\
He shimmers off, without waiting for permission at all. Alf lopes after him.');

		set_personloc(butler, drawing_room);
		set_personloc(alf, drawing_room);
		set_thingloc(corpse, nowhere);
		
		sgs(ALF_WANDER, 1);

		inc_score();

		sgs(DONE_GAOLBREAK, 1);
		
		// butler warnings enabled again
		sgs(NO_WARNINGS, 0);
	}

	// fill cup
	var cupConts = gs(CUP_CONTENTS)
	if((cupConts==0 || cupConts==3) && thingloc(teacup)==scullery)
	{
		sgs(CUP_CONTENTS, cupConts==0 ? 1 : 2);
		if(heroloc()==scullery)
		{
			// can\'t use cupConts in [[here]] - it's not evaluated as part of this function
			say('\nThe cup fills up with rainwater from the leak.[[ gs(CUP_CONTENTS)==3 ? " The ash dissolves, turning the water a pale greasy brown." : "" ]]');
			if(gs(WATER_POINT)!=1)
			{
				sgs(WATER_POINT, 1);
				inc_score();
			}
			if(cupConts==3) inc_score();
		}
	}
	
	// Alf's wander
	if(gs(ALF_WANDER)!=0)
		do_alf_wander();
	
	// butler appears first time player goes below stairs
	if(heroloc()==below_stairs && gs(BEEN_BELOW)==0)
	{
		say('\nA polite cough at your shoulder tells you that the butler has joined you.');
		set_personloc(butler, below_stairs);
		sgs(BEEN_BELOW, 1);
	}


	// servant jostling in the Servants' Hall
	if(heroloc()==servants_hall)
	{
		var crowd_servant = crowd_servants[pick(crowd_servants.length)];

		var tunnelDirs = new Array(
			'north','northeast','east','southeast','south',
		        'southwest','west','northwest');

		var fromDir = tunnelDirs[pick(tunnelDirs.length)];
		var toDir = tunnelDirs[pick(tunnelDirs.length)];
		while(toDir == fromDir)
			toDir = tunnelDirs[pick(tunnelDirs.length)];

		var jostles = new Array(
			'jostles against you',
			'brushes by you',
			'beats a path through the crowd',
			'rushes through the crowd',
			'hurries across the room'
		)

		say('\n' + crowd_servant + ' enters from the ' + fromDir + ', ' +                            jostles[pick(jostles.length)] +  ', and exits to the ' + toDir + '.');

	}

	// falling off the roof
	if(heroloc()==roof)
	{
		if(gs(FALL_OFF_ROOF) < roof_falling_messages.length)
		{
			say('\n' + roof_falling_messages[gs(FALL_OFF_ROOF)]);
			sgs(FALL_OFF_ROOF, 1 + parseInt(gs(FALL_OFF_ROOF), 10))
		}
		else
		{
			say('\n');
			fall_off_roof();
		}
	}
	
	// make the starship explode
	if(gs(STARSHIP_EXPLODING) != -1 && gs(GOT_COLLAR)==1)
	{
		if(gs(STARSHIP_EXPLODING) < starship_explosion_warnings.length)
		{
			if(heroloc()==starship)
			{
				say('\n' + starship_explosion_warnings[gs(STARSHIP_EXPLODING)]);
			}
			sgs(STARSHIP_EXPLODING, 1 + parseInt(gs(STARSHIP_EXPLODING), 10));
	
		}
		else
		{
			if(gs(STARSHIP_EXPLOSION_OVER)==0)
			{
				sgs(STARSHIP_EXPLOSION_OVER, 1);
				starship_explode();
				inc_score();
				sgs(STARSHIP_EXPLODING, -1);
			}
		}	
	}

	// Shakespeare talking about gloves
	if(heroloc()==globe)
	{
		var thisLine = glove_lines[pick(glove_lines.length)];
		say('\nShakespeare says, "' + thisLine + '"');
	}
}


// Alf wanders through the manor
function do_alf_wander()
{
	var i = gs(ALF_WANDER)
	
//	alert(personloc(alf).name + '\n i is ' + i);
	var oldAlfLoc = personloc(alf);
	var newAlfLoc;
	
	var fromDir;
	var toDir;
	
	// 1-2-3-4-5-6-7-8-9-10-11-12-13-14-15-
	// drawing-lobby-servants -lobby      -
	
	if(i==1)
	{
		newAlfLoc = drawing_room;
		toDir = 'east'; fromDir = 'west';
	}
	else if(i==5)
	{
		newAlfLoc = lobby;
		toDir = 'west'; fromDir = 'east';
	}
	else if(i==12)
	{
		newAlfLoc = lobby;
		toDir = 'east'; fromDir = 'west';
	}
	else if(i==8)
	{
		newAlfLoc = servants_quarters;
		toDir = 'west'; fromDir = 'east';
	}
	else
		newAlfLoc = oldAlfLoc;
		
	
	if(newAlfLoc != oldAlfLoc)
	{
		var swag = new Array();
		
		// Alf steals things that are lying around in newAlfLoc
		
		for(var i=1; i <= NUM_THNG; ++i)
		{
			if(thingloc(Thing[i])==newAlfLoc)
			{
//				alert('stealing ' + Thing[i].name);
				swag[swag.length++] = Thing[i];
				
				set_thingloc(Thing[i], nowhere);

//				ALFS_SWAG[ALFS_SWAG.length++] = Thing[i]; // don't make game unwinnable?
 			}
		}
		
		if(heroloc() == oldAlfLoc)
		{
			say('\nAlf wanders ' + toDir + ', looking for something to steal.');
		}
		else if(heroloc() == newAlfLoc)
		{
			say('\nAlf wanders in from the ' + fromDir);
			
			for(i=0; i<swag.length; ++i)
			{
				if(i==0)
					say(', and steals ');
				say('the ' + swag[i].name + (i < (swag.length - 1) ? ', ' : ''));
				if(i == swag.length - 2)
					say('and ');
			}

			say('.');
			
		}
		set_personloc(alf, newAlfLoc)
	}
	
	if(gs(ALF_WANDER) < 15)
		sgs(ALF_WANDER, 1 + parseInt(gs(ALF_WANDER)))
	else
		sgs(ALF_WANDER, 1);
}


var anywhere_sights = '';

function anywhere_sight(sight,description)
{
	anywhere_sights += '/' + sight + '::' + description;
}
anywhere_sight('self',
'You are a wiry, bleary-eyed gentleman with a twee little \
moustache and a worn check suit[[ list_worn_in_parens() ]]. You\'re quite handsome, in a \
roguish, greasy, perpetually-hung-over sort of way.'
);
anywhere_sight('pigeon',
'[[ see_pigeon() ]]'
);
function see_pigeon()
{
	var txt = '';
	if(gs(GOT_PIGEON)==1)
	{
		txt += ('A grey carrier pigeon, circling your head erratically.');
		var hlName = heroloc().name;
		if(hlName.indexOf('maze')==0)
		{
			var mazeN = 1 * hlName.substring(4, hlName.length);
			txt += (' Its orbit errs toward the ' + MAZESOLUTION[mazeN] + '.');
		}
	}
	else
		txt = 'Nothing special.';
	
	return txt;
}

function list_worn_in_parens()
{
	var strOut = '';
	for(var i=1; i<=NUM_THNG; ++i) if(worn(Thing[i]))
		strOut += (strOut ? ', and ' : '') + Thing[i].fullname;
	if(strOut) return ' (and ' + strOut + ')';
}


// all 'special command' attempts come this way if they are
// not caught by a specific place. Return true if a command
// is interpreted and obeyed (even if it is to no effect)
function anywhere_special()
{
	// on-the-fly synonym: 'body' is 'aunt' after the murder is done
	if(gs(DONE_MURDER)==1 && Token_str.indexOf('cedilla')!=-1)
	{
		Token_str = Token_str.split('cedilla').join('corpse');
		for(var i=1; i<=MAX_TOKENS; ++i)
			if(Token[i]=='cedilla') Token[i] = 'corpse';
	}
	// ...and 'half' is 'letter' after it is ripped
	if(gs(RIPPED_LETTER)==1 && Token_str.indexOf('half')!=-1)
	{
		Token_str = Token_str.split('half').join('letter');
		for(var i=1; i<=MAX_TOKENS; ++i)
			if(Token[i]=='half') Token[i] = 'letter';
	}

	
	if(Token[1]=='talk'&&Token[2]=='password')
	{
		sayPassword();
		return true;
	}
	else if(Token_str.indexOf('drop.ash.teacup')==0 || Token_str.indexOf('drop.ash.in.teacup')==0 || Token_str.indexOf('make.teacup.ash')==0)
	{
		if(!in_inv(ash))
			say('You haven\'t got the ash.')
		else if(!in_inv(teacup) && thingloc(teacup)!=heroloc())
			say('You haven\'t got the teacup.')
		else
		{
			var cupConts = gs(CUP_CONTENTS) // 0 - empty; 1 - water, 2 - tea, 3 - just ash
			if(cupConts==1) // easy
			{
				say('The ash dissolves neatly in the teacup, turning the contents \
a pale greasy brown.');
				take_away(ash);
				inc_score();
				sgs(CUP_CONTENTS, 2);
			}
			else if(cupConts==0)
			{
				say('Okay. The ash is now in the teacup.');
				take_away(ash);
				sgs(CUP_CONTENTS, 3);
			}
			
		}
		return true;
	}
	else if(Token_str.indexOf('make.teacup')==0)
	{
		say('You\'ll have to tell me how to do that.');
		return true;
	}
	// allow 'look at ash' if it's in the cup and the PC can see the cup
	else if((Token_str + '.').indexOf('look.ash')==0 && gs(CUP_CONTENTS)==3 && (in_inv(teacup)||thingloc(teacup)==heroloc()))
	{
		say(ash.description);
		return true;
	}
	// and allow the PC to take the ash if it's in the teacup
	else if((Token_str + '.').indexOf('take.ash')==0 && gs(CUP_CONTENTS)==3 && (in_inv(teacup)||thingloc(teacup)==heroloc()))
	{
		give_hero(ash);
		sgs(CUP_CONTENTS, 0);
		say('Okay. You have taken the ash.\nThe teacup is now empty.');
		return true;
	}
	// and allow the PC to "drink water" out of the teacup
	else if(Token_str.indexOf('drink.water')==0)
	{
		var cupConts = gs(CUP_CONTENTS);
		if(heroloc()==scullery && !in_inv(teacup))
		{
			say('You put your mouth under the leak for a second... euch! It tastes foul.');
			return true;
		}
		else if(!in_inv(teacup) || cupConts==0 || cupConts==3)
		{
			say('You haven\'t got any.');
			return true;
		}
		else
		{
			Token[2] = 'teacup';
			Token_str = 'drink.teacup';
			return false;
		}
	}
	// or "empty water" from teacup
	else if(Token_str.indexOf('empty.water')==0)
	{
		var cupConts = gs(CUP_CONTENTS)
		if(in_inv(teacup)||thingloc(teacup)==heroloc())
		{
			Token[2] = 'teacup';
			Token_str = 'empty.teacup';
			return false;
		}
		else if(heroloc()==scullery)
		{
			say('You can\'t.');
			return true;
		}
		else
		{
			say('You haven\'t got any.');
			return true;
		}
	}
	else if(heroloc()==scullery && (
		Token_str.indexOf('drop.water.in.teacup')==0 ||
		Token_str.indexOf('take.water.in.teacup')==0 ||
		Token_str.indexOf('drop.water.teacup')==0 ||
		Token_str.indexOf('take.water.teacup')==0
	))
	{
		fill_cup();
		return true;
	}
	// and I am never coding a liquid, ever again.
	
	
	// useless flavour
	else if(Token[1]=='xyzzy')
	{
		say('Is that some sort of telegraphic cypher?');
		return true;
	}
	
	else if(('.' + Token_str + '.').indexOf('.coffee.')!=-1)
	{
		// todo: only allow this if tea is in scope?
		say('You don\'t take coffee; you take tea, my dear.');
		return true;
	}
	else if(Token[1]=='sing')
	{
		say('You\'re not in the mood.');
		return true;
	}
	else if(Token[1]=='clean')
	{
		say('You\'re not in the mood.');
		return true;
	}
	else if(Token[1]=='yes')
	{
		say('You sound rather positive.');
		return true;
	}
	else if(Token[1]=='no')
	{
		say('You sound rather negative.');
		return true;
	}

	else if(Token_str.indexOf('fight.self')==0)
	{
		say('Don\'t you know attempted suicide is a hanging offence?');
		return true;
	}
	
	else if(Token_str.indexOf('blow.nose')!=-1)
	{
		say('Bad manners.');
		return true;
	}
	else if(Token[1]=='jump')
	{
		say('Athletic feats are hardly becoming to a gentleman.');
		return true;
	}
	else if(Token[1]=='shout')
	{
		say('\"AHOY!!\"')
		return true;
	}
	else if(Token[1]=='sneeze')
	{
		say('Ah-choo!');
		return true;
	}
	else if(Token[1]=='swear'||Token[2]=='swear')
	{
		say('Take your potty mouth back to Putney, oik.');
		return true;
	}
	else if(Token[1]=='sit'||Token[1]=='sleep')
	{
		say('Lazy!');
		return true;
	}
	else if(Token[1]=='smell' && !is_thingname(Token[2]))
	{
		say('Sniff, sniff.');
		return true;
	}

	return(false);
}
