/*
 *
 * Aunts and Butlers
 *
 * Characters
 *
 * code and data dealing with the people of the game.
 *
 */

Person = new Object;
NUM_CHRS = 0;
function ch(name,fullname,ishere,pname,firstplace,description,talks,subjects,reactions,presents,mannerisms)
{
	Person[++NUM_CHRS] = new Object;
	Person[NUM_CHRS].id = NUM_CHRS;
	Person[NUM_CHRS].name = name; // variable name and recognised word
	Person[NUM_CHRS].fullname = fullname; // name displayed in output
	Person[NUM_CHRS].ishere = ishere; // special string for "Aunt Cedilla is here."
	Person[NUM_CHRS].pname = pname; // true for proper names
	Person[NUM_CHRS].firstplace = firstplace; // starting place
	Person[NUM_CHRS].description = description;
	Person[NUM_CHRS].talks = talks; // default talks
	Person[NUM_CHRS].subjects = subjects; // talks about specific tokens
	Person[NUM_CHRS].reactions = reactions; // reactions to 'foo cedilla'
	Person[NUM_CHRS].presents = presents; // reactions to certain Things
	Person[NUM_CHRS].mannerisms = mannerisms; // mannerisms
	eval(name + ' = Person[' + NUM_CHRS + '];');
	eval('words(\'' + name.toLowerCase() + '\')');
}

function default_react(action,person)
{
	var str = '';

	if(action=='fight')
		str = 'You take a swing, but ' + the_person(person) + ' ducks it.'
	else if(action=='kiss'||action=='touch')
		str = 'I don\'t think you and ' + the_person(person) +
		  ' are close enough for that.'
	else if(action=='smell')
		str = 'You\'re a human being, not a dog. Have some control.'
	else if(action=='wake' && asleep(person))
		str = capitalise(the_person(person)) + ' won\'t wake up.'
	else if(action=='wake')
		str = capitalise(the_person(person)) + ' isn\'t asleep!';

	if(str=='')
		return(false);

	say(str);
	return(true);
}


/*
 * In Ampersand, I'm trying to go for a small number of very well-developed
 * characters (typical of the kind of genre I'm getting at.) This may not be what
 * my engine, or the adventure game in general, is best suited to, but there you
 * go.
 *
 */


/*
 * Aunt Cedilla
 *
 * The PC's elderly, unmarried aunt. The most important NPC.
 *
 */
ch('cedilla',
'Aunt Cedilla',
'Aunt Cedilla [[ personloc(cedilla) == drawing_room ? "sits in the armchair" : "stands here" ]], \
tutting to herself.[[with_suitcase()]]',
true,
porch,
'Aunt Cedilla is a wide, squat, imposing woman, with grey hair, a \
shapeless black dress, and a pair of thick pince-nez glasses. Thoroughly \
unpleasant and unlikeable, she remains your only rich, elderly, unmarried aunt; \
thus it would be prudent to treat her with care, kindness and affection \
until the old witch snuffs it.\
[[ gs(GOT_SUITCASE) == 1 ? "" : " She is carrying a thin black suitcase." ]]\
[[ gs(AUNT_IN_HAT) != 1 ? "" : " She is wearing an ugly hat." ]]',
'*talk_cedilla()',
'robin::=A thoroughly respectable young man. Why can\'t you be more like him?\
/suitcase::=It contains an item of great sentimental value.\
/inheritance::Aunt Cedilla looks affronted. "All will be revealed in due course[[ gs(DONE_TEA)==1 ? ", when your cousin arrives" : ""]]."\
/will::Aunt Cedilla looks affronted. "All will be revealed in due course[[ gs(DONE_TEA)==1 ? ", when your cousin arrives" : ""]]."\
/virgule::=He has always been my favourite nephew.[[ (gs(DONE_TEA)==1) ? " Where have you let him get to?" : "" ]]\
/gladstone::=It is my sad duty to inform you that dear Gladstone" - Aunt Cedilla \
wipes a tear from behind her pince-nez - "met his end recently in a most unfortunate \
accident involving a squeaky rubber bone and an express train.',
'fight::*fight_cedilla()\
/kiss::[[ worn(tailcoat) ? "=How DARE a common servant make an advance at me?" : "You kiss Aunt Cedilla politely on the cheek. Good show, you didn\'t even retch!" ]]\
/talk::[[ worn(tailcoat) ? "=I do not converse with common servants." : talk_to(cedilla) ]]',
'suitcase::=Really! Can\'t you[[ worn(tailcoat) ? "" : "r butler" ]] put that somewhere sensible?\
/urn::*give_urn()\
/ash::=And what would I want with a clump of unbrewed tea-leaves?\
/teacup::*give_aunt_tea();\
/hat::*give_aunt_hat();',
'Aunt Cedilla sneers at some dust.\
/Aunt Cedilla looks all around herself in quiet disapproval.\
/Aunt Cedilla cackles, ever so quietly, to herself.\
/Aunt Cedilla stares at you with obvious contempt.\
/Aunt Cedilla sighs impatiently under her breath.'
);
cedilla.sights='hat::*see_cedillas_hat();'
function see_cedillas_hat()
{
	if(gs(AUNT_IN_HAT)==1)
		say(hat.description)
	else
		thingsee(hat);
}
function give_aunt_hat()
{
	say('Aunt Cedilla appears genuinely touched.\n\
"Why, thank you, Ampersand, it\'s beautiful!"\n\
She takes the hat and puts it on.');
	sgs(AUNT_IN_HAT, 1);
	
	take_away(hat);
	inc_score();
	if(gs(VIRG_ARRIVED)==1) sgs(HAT_TIMER, 3);
}
function give_urn()
{
	if(!butlerWarn('I would not recommend that course of action. Your \
relative is likely to confiscate the receptacle, preventing you from \
making any use of its contents, should you require to do so in future.', WARNED_URN))
	{
		take_away(urn);
		say('"What on _earth_ are you doing with that! Give it to me immediately!"\n\
Aunt Cedilla snatches the urn from you and conceals it somewhere about her person.\n\
You feel a bit silly.');
	}
}
function give_aunt_tea()
{
	if(personloc(cedilla)!=drawing_room)
	{
		say('=I shall have it in the drawing room, thank you.');
		return;
	}
	
	if(gs(DONE_TEA)==1)
	{
		say('Aunt Cedilla raises her palms in a gesture of refusal. "I have had \
quite enough of your inferior tea for one morning, thank you," she says.');
		return;
	}
	
	var c = gs(CUP_CONTENTS) // 0 - empty. 1 - water. 2 - 'tea'. 3 - ashes
	if(c!=2)
	{
		say('Aunt Cedilla glances at the cup, then glares at you.\n\
"There has been some mistake," she says. "This teacup ');
		if(c==0)
			say('is empty."')
		else if(c==1)
			say('contains dirty dishwater."')
		else if(c==3)
			say('contains unbrewed leaves."');
	}
	else
	{
		take_away(teacup);
		
		say('Aunt Cedilla takes the teacup and sips the contents.\n\
"Euch," she says, her face contorted with disgust. "Lapsang Souchong. I suppose it will \
have to do."\n\
She finishes it off and puts down the empty cup.\n\
"Now," she says, "you must [[ worn(tailcoat) ? " tell your master to" : "" ]] go to the railway station and meet [[ worn(tailcoat) ? "his" : "your" ]] cousin \
Virgule, who will be arriving shortly. I have an important matter to discuss \
with the two of [[ worn(tailcoat) ? "them" : "you" ]]."');
		sgs(CUP_CONTENTS, 0);
		sgs(DONE_TEA, 1);
		set_thingloc(teacup, personloc(cedilla));
		
		inc_score();
	}
}
function fight_cedilla()
{
	if(!butlerWarn('This lady embodies your few remaining hopes of affluence in \
later life. It might not be prudent to discourage her affections with a display \
of physical violence.', WARNED_FIGHTAUNT))
	{

		die('"_Well!_"\n\
With that single word, Aunt Cedilla portrays a level of fury that \
cannot possibly have been experienced by any other human being in history.\n\
"Never in my life have I been so insulted! [[ \
	worn(tailcoat) ? \
	"Tell your master he can CONSIDER HIMSELF DISINHERITED!" : \
	"CONSIDER YOURSELF DISINHERITED!" \
]]\
\"\n\
Your last hope of financial security raises herself up to her full five foot \
three, turns her nose up a further yard, and marches off.\n\
As you stare gormlessly after her, you find yourself wondering what sort of \
brandy they\'ll serve in the debtors\' workhouse.',
'You are poor') ;
	}
}
function with_suitcase()
{
	var txt = '';
	
	if(gs(GOT_SUITCASE)!=1)
	{
		if(worn(tailcoat))
		{
			get_suitcase();
			sgs(ASKED_FOR_BUTLER, 1);
			return;
		}

		txt += ' She is carrying a thin black suitcase.';
		
		if(gs(ASKED_FOR_BUTLER)!=1)
		{
			txt += '\n"So there you are, Ampersand," she snaps, with her customary \
geniality. "You were expecting me, weren\'t you? Have your butler collect my suitcase \
at once."\n\
Of course, you dare not tell the dear old bat that you have no butler, never have \
had a butler, and never intend to have a butler in the future.' ;
			sgs(ASKED_FOR_BUTLER, 1);
		}
		
	}
	
	return txt;
}
function talk_cedilla()
{
	var talks = '';
	
	if(gs(GOT_SUITCASE)==0)
	{
		talks =
'=Never mind that. Fetch your butler and have him take my suitcase!\
/=Where is that blasted butler? I do not have all day.\
/=Tell your butler to hurry up and collect my suitcase.' ;
	}
	else if(gs(DONE_TEA)==0)
	{
		talks =
'=A fine host you are, Ampersand! Where is my cup of tea?\
/=I shall be in no mood for this discussion until I have had my tea.\
/=Bring me a cup of tea at once.' ;
	}
	else
	{
		talks =
'=Hmph. I see you have all but demolished the Manor since it has been in your care.\
/=Honestly, Ampersand, don\'t talk nonsense. For that matter, don\'t talk.\
/=Really, Ampersand, have you nothing better to worry about?' ;
	}
	
	talksA = talks.split('/');
	
	say(talksA[pick(talksA.length)])
}



/*
 * The butler
 *
 * A mysterious metaphysical manservant who will eventually whisk the PC away
 * on a magical adventure of some kind.
 *
 * In the first part of the game, the butler only appears as a 'warning' system,
 * giving the PC an eloquent warning when he is about to do something which would
 * either kill him or ruin his game.
 *
 * At some point the butler presents the PC with a bell - after that he is a 'real'
 * NPC who can be summonsed by ringing the bell.
 *
 * The butler is to be the 'guide' character, so he should have something to say
 * about more or less everything in the game.
 *
 */
// (name,fullname,ishere,pname,firstplace,description,talks,subjects,reactions,presents,mannerisms)
ch('butler',
'butler',
'An impeccably dressed butler \
[[ (personloc(butler)==cell && gs(DONE_GAOLBREAK)!=1) ? "is manacled" : "stands" ]] here.',
false,
nowhere,
'The butler is tall and thin, and his dark hair and pale face almost \
match the blacks and whites of his pristine uniform. There is something \
slightly unnerving about the way he stands completely still, at his full \
height with his hands folded behind him, and looks directly at nothing, \
without seeming even to think. You get the impression that, left \
alone, he would be happy to stand there forever.\n\
Before today, you\'ve never seen the butler in your life.',
'The butler remains silent.\
/=Sir.\
/=Indeed, sir.\
/=Yes, sir.',
'robin::=A most agreeable gentleman.\
/name::=It has long been traditional among my fellow butlers, sir, for forenames to \
remain mysterious. In similarly not deigning to disclose my surname, I hope - if I may use \
the vernacular - to score one over the lot of them.\
/swear::=Such language is unbecoming to a gentleman of your standing, sir.\
/cedilla::=I should hesitate to use the expression \'ill-mannered old cow\', sir, \
but it does seem uniquely suited to Her Ladyship.\
/corpse::=I should hesitate to use the expression \'unmissed old cow\', sir, \
but it does seem uniquely suited to Her late Ladyship.\
/north::=A most unpleasant territory, sir. I should strongly advise avoiding the \
entire region.\
/password::=_Password_," says the butler, rhyming the first syllable with \'farce\', \
"is the correct pronunciation, sir. The barbarians of the Northlands are known \
to employ their own enunsion, but I have no wish to offend your ears by uttering \
it myself.\
/alf::=An old acquaintance. His typical Northern criminal wiles will be \
indispensible in effecting a gaol-break.\
/trunk::=There is an ancient legend among serving-folk making tell of one such \
receptacle, which leads to a fabulous kingdom where servants have reign. Then \
again, sir, it could be an ordinary packing-trunk.\
/virgule::=Mr. Virgule is a well-intentioned young gentleman, but victim to a certain \
rashness of manner ubiquitous among his countrymen.\
/america::=I have written to my Member of Parliament requesting that the independence \
of the colonies be revoked at once, but, alas, to no avail.\
/england::=Wider still and wider may her bounds be set, sir.\
/shotgun::=Our American friends entertain the notion, sir, that it is imperative \
for the populace of a free and civilised society to shoot one another.\
/embalmer::=Violence is the answer to this one, sir.\
/fatty::=The commander is a very disagreeable gentleman, sir. Perhaps he can be disposed of using the \
transportation machinery.\
/cowboy::=I recommend taking a phlegmatic approach to this problem, sir.\
/shakespeare::=Though he speaks madness, there be method in\'t, sir.\
/knight::=I fancy, sir, that the knight would do better in his jousting were he armed \
with some appropriate weapon.\
/typist::=A cool sort, sir.\
/bell::=You rang, sir?\
/gladstone::=Did not Miss Cedilla mention that her poodle Gladstone was recently dispatched by a railway engine, sir?\
/ash::=Did not Miss Cedilla mention that her poodle Gladstone was recently dispatched by a railway engine, sir?\
/iou::=Such documents are an acceptable form of payment, sir, although they are not invariably well-received \
by constabulary officers.\
/will::=The original testament does not put you in good standing, sir. Perhaps we can substitute for it another \
document, written with altogether more love.\
/letter::=A ripping good read, sir.\
/haggis::=A preparation of sheep\'s innards popular among the Caledonian people, sir. It is not a dish commonly \
recommended to outsiders.\
/bone::=It is not a real bone, sir.\
/stovepipe::=The stovepipe hat, sir, is considered a very fetching garment for formal occasions.\
/tailcoat::=A fetching garment, sir.\
/teacup::=No doubt it is this humble beverage which made Britain the fine land it is, sir.\
/hat::=Not a fetching garment, sir.\
/bottle::=I suspect a red herring, sir.\
/tie::=A fetching garment, sir.\
/collar::=A fetching garment, sir.\
/jerkin::=A fetching garment, sir.\
/cufflinks::=A fetching accessory, sir.\
/flower::=A fetching accessory, sir.\
/lance::=A weapon of some potency in the right hands, sir.\
/handkerchief::=A fetching accessory, sir.\
/gloves::=Fetching garments, sir.\
/card::=It is customary of gentlemen to convey visiting-cards to announce their presence, sir.\
/suitcase::=It is of no further use to us, sir.\
/help::=With what matter do you require assistance, sir?',
'fight::Owing to some recent nanny-state legislation about servants\' rights, \
that joy is forbidden to you.\
/kiss::=That is not a duty which appears on my job description, sir.',
'',
'The butler produces a small feather brush and does a moment\'s dusting.\
/The butler rocks gently on his heels.\
/The butler catches your eye, and bows slightly.\
/The butler straightens his uniform.\
/The butler flicks a speck of dirt off of your lapel.'
);

/* The butler's 'warning' system
 *
 * For the beginning of the game - up until the murder - most actions
 * that would make the game unwinnable are 'warned' of by the butler.
 * Hopefully this establishes him as some kind of mysterious spirit
 * before he joins the game as a proper character.
 *
 * After the butler's imprisonment and jailbreak, he can still make
 * warnings, but only if he is present. The player must summon him,
 * using the bell.
 *
 */
function butlerWarn(warnTxt, flag)
{
	if(gs(flag)==1)
	{
		return false;
	}
	
	if(gs(NO_WARNINGS)==1)
	{
		return false;
	}
	
	var txt = '';

	if(gs(DONE_MURDER)==0)
		// butler appears mysteriously with indefinite article, as he is not a proper character yet
		txt += 'An impeccably dressed butler sidles up to you from nowhere \
in particular, and politely stops you.\n"'
	else if(personloc(butler)==heroloc())
	{
		// butler is already here
		txt += 'The butler coughs and touches you on the shoulder, \
politely stopping you.\n';
	}
	else
	{
		// put the butler here, but he gets the definite article
		txt += 'The butler sidles up to you from nowhere in particular, \
and politely stops you.\n';
		set_personloc(butler, heroloc());
	}


	var i = pick(3);
	if(i==0)		txt += 'A word in your ear';
	else if(i==1)	txt += 'If I may be so bold';
	else if(i==2)	txt += 'If I may intrude';

	txt += ', sir," he says quietly. "' + warnTxt + '"';
// maybe not necessary now that there is UNDO
//	' Might I advocate saving your game before pursuing this course of action?"';

	
	if(gs(DONE_MURDER)==0)
		txt += '\nWith that, he leaves in the same mysterious direction \
he came from.'

	say(txt);
	sgs(flag, 1);

	return true;
}



/*
 * Alf, the Northerner
 *
 */
// name,fullname,ishere,pname,firstplace,description,talks,subjects,
// reactions,presents,mannerisms
ch('alf',
'Alf',
'Alf, a filthy, flat-capped Northerner, stands unpleasantly close by.',
true,
thenorth,
'Alf the Northerner wears hobnailed boots, gor-blimey trousers, and a flat cloth cap. \
His face is covered in soot. Here is a man who knows a whippet from a faggot by sight; \
a man who has his dinner at lunchtime and his tea at dinner-time; a fancier of \
pigeons, and probably ferrets too. He gawps at you with a toothless leer of \
resentful deference.',
'=Wy-aye oop me dook!\
/=Cor like, int \'alf down t\'mill, eh?\
/=Coo bah goom bar tat.',
'robin::=\'E\'s a reet top blerk!\
/butler::=An erld pal. Ah owes \'im a coople o\' favours like.\
/north::=Ah moved oop six moonths ager, fra Cheltenham.\
/south::=Boonch o\' reet pansies doon there.\
/password::*do_alf_password()',
'fight::Alf sticks his fingers in his mouth and whistles. A pit bull terrier scampers \
up, bites you savagely on the leg, and, after a grateful pat from its master, \
scampers away again.',
'',
'Alf gobs on the floor.\
/Alf picks a clump of wax out of his [[pick(2) ? "left" : "right"]] ear, and eats it.\
/Alf hums tunelessly under his breath.'
);
function alf_gets_message()
{
	if(gs(GOT_PIGEON)==1 && personloc(alf)==heroloc())
	{
		say('\nWith a coo of joy, the carrier pigeon recognises Alf and swoops \
to greet its master. Alf unclips a small note from its leg, and reads it slowly.\n\
"Ser, me pal\'s in trooble, eh?" he says, and looks up in your direction. "Lead the \
wye, feller!"\n\
He tucks the pigeon under his cap, and stares at you expectantly.');
		inc_score();
		sgs(GOT_PIGEON, 0);
		sgs(ALF_FOLLOW, 1);
	}
}
function do_alf_password()
{
	say('Alf attempts to mimic your speech. \"Parse-wuh... juh mean \'pass-word\', \
feller?\" He rhymes the first syllable with \'gas\'.')
	// and if we're in the right place, the trunk opens.

	if(gs(TRUNK_OPEN)==0 && heroloc() == servants_quarters)
	{
		sgs(TRUNK_OPEN, 1);
		say('\nThe lid of the trunk creaks slowly open to reveal a cast-iron staircase \
leading down into one of those eldritch green glows.[[ set_trunk_exits(), "" ]]\n\
"Blarmey!" cries Alf, with a look of horror. "Ah dern\'t mooch fancy this Soothern \
eldritch stoof," and legs it.');

		set_personloc(alf, nowhere);
		sgs(ALF_WANDER, 0);

		inc_score();
	}

}
ALFS_SWAG = new Array();

/*
 * Cousin Virgule
 *
 * The PC's trigger-happy American cousin. I love stereotypes.
 *
 */
// name,fullname,ishere,pname,firstplace,description,talks,subjects,
// reactions,presents,mannerisms
ch('virgule',
'Cousin Virgule',
'Cousin Virgule stands here, brandishing a shotgun.',
true,
nowhere,
'A second cousin on your late father\'s side, Virgule is a red-faced, portly \
American clad in an unflattering yellow suit and rubber running shoes. What really \
catches your eye, though, is the large, dirty, double-barrelled shotgun, which \
he is bandying around - you can\'t help judging - rather carelessly.',
'=\'Sakes, never mind that. I wanna shoot somethin\'.\
/Cousin Virgule is like, "Aw, gee y\'all!"', // MORE
'shotgun::=Beaut, ain\'t she?" Cousin Virgule prods the shotgun into your face. \
"I was hopin\' I might bag me a few o\' them thar limey pheasants while I was over.\
/england::=Haw haw! What a dumb little tiny island! Y\'all make me laugh, with your \
cricket and your beefeaters and your gun control and your national health service \
and no death penalty... y\'all\'d be talkin\' German if it weren\'t for all them \
American actors in war movies.\
/north::Cousin Virgule lifts his fedora to scratch his head. "Y\'mean, y\'all got \
your rich folk down south and your dumbass peasants up north? You crazy limeys got \
it plain backwards!"\
/america::Cousin Virgule goes misty-eyed and starts singing the wrong words to \
the tune of God Save the King.\
/cedilla::=Never my favourite aunt neither.\
/butler::=Nah. You wanna get yourself a couple dozen slaves instead.\
/pheasant::=I\'d sure like to shoot me some!\
/robin::=He\'s one swell dude!',   // note 'pheasant' is a synonym of 'hat'
'fight::*fight_virgule();',
'hat::*show_virgule_hat();',
'Cousin Virgule gives the trigger of his shotgun a quick polish.\
/Cousin Virgule takes a quintuple cheeseburger out of his pocket and finishes it \
in two bites.\
/Cousin Virgule drawls something about how much better it all is in America.\
/There is a loud *BLAM!* and an apologetic mumble from Cousin Virgule.\
/Cousin Virgule hums the Star-Spangled Banner.'
);
function show_virgule_hat()
{
	if(gs(WARNED_SHOWHAT)!=1)
	{
		butlerWarn('I should hesitate to draw Mr. Virgule\'s attention to \
a headpiece tailored in that particular style. He may react violently.');
		sgs(WARNED_SHOWHAT, 1);
	}
	else
	{
		say('"Cripes!" yells Cousin Virgule. "A pheasant!"\n\
He aims his shotgun, and - *BLAM!* - the hat is utterly destroyed.\n\
"Well," says Virgule, "I always get peckish after shootin\'," and scampers \
off in search of a McDonalds.');
		take_away(hat);
	}
}
function virguleLeaves() // called from village_green
{
	if(personloc(virgule)==heroloc())
	{
		// This comes right after "Cousin Virgule follows you", so we can use 'he'
		say('\n"Butts to this!" he suddenly wails. "I been in this wussy darn \
country three hours and I ain\'t shot nothin\'! I\'m off to bag me some limey \
pheasants. See you round, cuz!"\n\
And, with a cry that sounds horribly like "Yeee-haw!" he bounds out \
of sight, waving his shotgun happily.');
		set_personloc(virgule, nowhere);
		
		if(worn(hat) || gs(AUNT_IN_HAT)==1) sgs(HAT_TIMER, HAT_TIMER_MAX);
	}
}

virgule.special = 'take.shotgun::Cousin Virgule is like, "Not till y\'all pry my cold \
dead fingers off the trigger, limey!"';

virgule.sights = 'shotgun::A double-barrelled shotgun with a rather unfriendly \
appearance. Cousin Virgule swings it around himself in a display of \
pride and liberty.';

function fight_virgule()
{
	if(gs(NO_WARNINGS)!=1 && gs(WARNED_VIRGULE)!=1)
	{
		butlerWarn('Mr. Virgule is, unlike yourself, equipped with a firearm of some \
potency. Were a bookmaker to invite bids upon the outcome of such an engagement, the \
odds upon your emerging victorious should be very much the longer.');
		sgs(WARNED_VIRGULE, 1);
	}
	else
	{
		die(' *BLAM!*') // leading space needed to stop say() catching the * as an eval
						// marker. won't show on the web page.
	}
}




/*
 * Sergeant Plank
 *
 * The friendly but dimwitted, and in fact not friendly, village policeman.
 */
// (name,fullname,ishere,pname,firstplace,description,talks,subjects,
//	reactions,presents,mannerisms)

ch('plank',
'Sergeant Plank',
'Sergeant Plank [[personloc(plank)==police ? "sits behind the desk" : "stands to attention nearby"]].',
true,
police,
'The sole representative of the forces of law and order in Bickering, Sergeant \
Plank\'s face shows an expression evenly balanced between no-nonsense authority and \
idiotic bewilderment; this isn\'t a man who knows what the \'I\' in CID stands for. He \
has perfected the skill of looking just the strapping side of threatening in his neat \
blue uniform, which his shoulders are only a little too broad for.',
'=\'Allo, \'allo, \'allo.\
/=Evenin\' all.\
/=Wot\'s all this then?',
'', // needs different 'subjects' before and after murder
'fight::*fight_plank()',
'iou::*plank_rip(iou);\
/letter::*plank_rip(letter);',
'Sergeant Plank bends his knees and bobs up and down.\
/Sergeant Plank temporarily takes out a notebook and scribbles something in it.\
/Sergeant Plank gives you a suspicious look.'
);
function plank_rip(th)
{
	if(th==iou)
	{
		say('"You\'ve been told, Fodge - no IOUs!"\n\
Sergeant Plank rips the IOU in two and eats both halves.');
		take_away(iou);
	}
	else if(th==letter)
	{
		if(gs(RIPPED_LETTER)!=1)
		{
			say('"You\'ve been told, Fodge - no IOUs!"\n\
Sergeant Plank rips the love-letter in two and eats one half. The other half \
flutters to the floor.');
			take_away(letter);
			set_thingloc(letter, heroloc());
			inc_score();
			sgs(RIPPED_LETTER, 1);
		}
		else
			say('Sergeant Plank snorts in contempt. "So someone\'s \
gorn an\' wrote you into their will. Big deal."');
	}
}
function fight_plank()
{
	if(gs(NO_WARNINGS)!=1 && gs(WARNED_FIGHTPLANK)!=1)
	{
		butlerWarn('Assault upon members of the constabulary, in addition to being \
morally reprehensible, is legally punishable by a term of incarceration.');
		sgs(WARNED_FIGHTPLANK, 1);
	}
	else
	{
		die('You take a swing, but the Sergeant\'s well-trained reactions have your \
hand in cuffs before it arrives anywhere near his sizeable jaw.\n\
"You\'re comin\' with me, sonny-jim!"\n\
You are powerless to protest as you are hauled to a stinking prison and - \
due, no doubt, to some tragic administrative error - permanently forgotten about.',
'At least your cell-mate seems friendly');
	}
}


/*
 * Gladstone, Aunt Cedilla's poodle
 */
ch('gladstone',
'Gladstone the poodle',
'A poodle leaps around at your feet, yapping and snarling with some hostility.',
true,
aunts_flat,
'This is Aunt Cedilla\'s wretched poodle, Gladstone, a rather weedy animal, although \
what it lacks in stature it makes up for in energy, enthusiasm, and sheer unfriendly \
yappiness. It runs around your ankles, occasionally leaping into the air \
and making what would be a good effort to rip your throat out, if you happened to \
keep your throat in your knee.',
'=Yapyapyapyapyapyapyapyap\
/=YapyapyapyapyapyapyapyapGRRRRRRR',
'sit::No chance.',
'fight::Gladstone the poodle bites you on the leg, hard. Ouch!\
/kiss::You\'d never get near enough.',
'bone::Gladstone leaps up and tries to snatch the bone from you.',
'Gladstone continues his assassination attempts on you.\
/Gladstone darts in a wide circle around the room and yaps loudly.\
/Gladstone sits dead still for a moment, glaring, then continues his fracas.'
);


/*
 * Commander Fatty of Starforce
 */

//ch(name,fullname,ishere,pname,firstplace,description,
//talks,subjects,reactions,presents,mannerisms) 

ch('fatty',
'Commander Fatty',
'An engineer stands \
[[ gs(FATTY_ON_CIRCLE) == 1 ? "on the black circle, munching noisily at something in \
his mouth" : "here" ]]. \
The name tag on his uniform reads "FATTY".',
true,
starship,
'Commander Fatty of Starforce, a middle-aged, moustachioed chap in an unbecoming \
skintight uniform - mind you, anything from the "Well-Bodied Gentlemen" section \
of Harrod\'s would be skintight on this fellow. He stutters to himself as though \
trying to work out a difficult sum in his head, pausing occasionally to rub his \
enormous belly.',
'*talk_fatty()',
'haggis::*munch_or("=Mah favourite!")\
/food::*munch_or("=Ach, dinnae say that word!")\
/robin::*munch_or("=Did ye no pay attention in history class?")\
/self::*munch_or("=Enough wi\' the daft questions, ye cheap plastic robot.")',
'fight::*fight_fatty()',
'haggis::*feed_fatty();',
'Commander Fatty [[ gs(FATTY_ON_CIRCLE)==1 ? "continues munching." : \
"grumbles and rubs his stomach." ]]'
)
function fight_fatty()
{
	if(!butlerWarn('I should not advocate engaging the Commander in combat. \
It may transpire he is equipped with advanced personal weapons technology.',
	WARNED_FIGHTFATTY))
		die('Commander Fatty pulls out a disruptor beam pistol, sets it to \
"pagger", and lasers your Sassenach heid in.');
}
var fatty_talks_hungry = '=Hoots, Ah\'m famished. Whaur\'s me supper?\
/=Noo if wir travellin\' at 500 c, and yon Star\'s Altair... och, I cannae concentrate \
on an empty stomach.\
/=Jings, Ah could just do wi\' some nice fried stuff the noo.'
function munch_or(fattyLine)
{
	if(gs(FATTY_ON_CIRCLE)==1)
		say('Commander Fatty tries to speak, but it comes out as an \
incomprehensible muffle and a spray of haggis crumbs.')
	else if(gs(FATTY_FED)==1)
		say('=Ye\'ve done yer job. Awa\' ye go.')
	else
		say(fattyLine);
}
function talk_fatty()
{
	if(gs(FATTY_ON_CIRCLE)==1)
	{
		munch_or(''); // no point duplicating message
	}
	else if(gs(FATTY_FED)==0)
	{
		fatty.talks = fatty_talks_hungry;
		talk_to(fatty);
	}
	else
	{
		// Fatty has eaten the sausage and is still here - game is unwinnable.
		fatty.talks = '=Ye\'ve done yer job. Awa\' ye go.';
		talk_to(fatty);
	}
	
}
function feed_fatty()
{
	if(!butlerWarn('Ownership of that haggis puts you at a certain advantage \
over the Commander. Perhaps it will be easier to turn the situation to your advantage \
if you do not relinquish it to him directly.', WARNED_FEEDFATTY))
	{
		if(in_inv(haggis)) // Might not be, if you DROP rather than GIVE
			take_away(haggis);
	
		// ungrateful reaction, hinting that it\'s the wrong thing
		say('"Aboot time," says Fatty, grabbing the haggis and finishing it off \
	in a few gulps. "Now get oot mah sight, Ah\'ve got a stardrive tae run."');
		sgs(FATTY_FED, 1);

		// game is unwinnable!
	}
}

ch('typist',
'typist',
'A typist sits behind the desk, clacking away at the keyboard, taking no notice of you whatever.',
false,
office,
'A pale-faced man in an indeterminate office job[[gs(GOT_TIE)==1 ? ", sweating profusely." : ", wearing a \
woollen tie and shivering anaemically."]] He is clacking away at the typewriter keyboard, and seems \
hardly to have seen you.',
'The typist waves you away irritably.',
'',
'',
'',
'The typist continues clacking away at the keys.\
/The typist [[gs(GOT_TIE)==0 ? "shivers a bit, and tightens his tie" : "wipes the sweat from his forehead"]].'
);

ch('cowboy',
'cowboy',
'A cowboy is slumped on the floor, fast asleep.',
false,
tavern,
'A tanned and bearded gentleman who, from the look of him, has taken leave of his usual habits of \
rooting and/or tooting and drunk himself unconscious. His snores tell you he\'s breathing, but that\'s \
all. He is, incidentally, wearing a rather natty jerkin.',
'',
'',
'',
'',
'The cowboy snores.\
/The cowboy rolls over.'
);

ch('embalmer',
'embalmer',
'A skinny embalmer is here, hunched over an open sarcophagus.',
false,
embalmers_chamber,
'A little bearded man with lean, Semitic features, dressed in a leather loincloth. Stooped forward, he \
examines the interior of the sarcophagus with a no-nonsense expression.',
'=I hear talking, but I don\'t hear disembowelling!\
/=Plenty of time for that in the next world. Organs in jars, please.\
/=Bits out for the gods!\
/=Embalming is calming!',
'',
'fight::*push_embalmer();\
/push::*push_embalmer();\
/move::*push_embalmer();',
'haggis::=Don\'t mess me about," says the embalmer. "These are clearly from a sheep. One with scrapie, at that.',
'The embalmer tuts impatiently.\
/"Come on," says the embalmer. "Eternity can\'t wait forever."'
);
function push_embalmer()
{
	say('You give the little fellow a crafty shove. He plunges into the coffin, and gives a \
surprised kick which somehow brings the lid crashing down on top of him.');
	set_personloc(embalmer, nowhere);
	sgs(PUSHED_EMBALMER, 1);
	inc_score();
}

ch('knight',
'knight',
'A knight on horseback looms above you, [[ gs(KNIGHT_HAS_LANCE)==0 ? "looking a bit befuddled" : \
"wielding a mighty lance" ]].',
false,
jousting_field,
'A human shape, armoured from head to foot in iron, sits atop an equally armoured horse\
[[ gs(KNIGHT_HAS_LANCE)==0 ? ". The knight is scratching his head, as though he has forgotten something, \
but can\'t remember what." : ", with a dangerous-looking lance pointed determinedly forwards." ]]',
'The knight can\'t possibly hear you through all that metal.',
'',
'',
'lance::*give_knight_lance()',
'[[ joust(), "" ]]'
);
function give_knight_lance()
{
	take_away(lance);
	inc_score();
	sgs(KNIGHT_HAS_LANCE, 1);
	say('The knight makes an elbow-swinging "Oh, THAT was it!" gesture, takes the lance, and gives you \
a thumbs-up.');
}
function joust()
{
	say('Another knight comes charging over the horizon at your knight.\n')
	if(gs(KNIGHT_HAS_LANCE)==0)
	{
		say('Your fellow charges bravely out to meet him, but he looks a bit uncertain. All the more so \
when the other knight\'s lance connects with his chest. He picks himself up and rides back to you, \
apparently unsure of what went wrong.');
	}
	else
	{
		say('Your fellow charges bravely out to meet him. The lances clash, and the other knight goes \
down.');
		if(gs(GOT_HANKY)==0)
		{
			inc_score();
			sgs(GOT_HANKY, 1);
			give_hero(handkerchief);
			say('\nA damsel in the crowd throws her handkerchief to your knight in admiration. \
He tosses it to you for safekeeping.');
		}
	}
}

ch('shakespeare',
'William Shakespeare',
'William Shakespeare stands here, muttering about gloves.',
true,
globe,
'A wiry chap wearing a wispy goatee, a dreamy expression, and silly tights. He looks deep in concentration.',
'Shakespeare ignores you, and continues his glove-based soliloquy.',
'',
'',
'',
'');

glove_lines = new Array(
'With glove\'s light wings did I o\'er-perch these walls;\n\
For stony limits cannot hold glove out.',
'If music be the food of glove, play on!',
'Ah, me! How sweet is glove itself possess\'d,\n\
When but glove\'s shadows are so rich in joy!',
'Where little fears grow great, great glove grows there.',
'Glove\'s counsellor should fill the bones of hearing.',
'Glove like a shadow flies when substance glove pursues.',
'Oh, if you glove my brother, hate not me;\n\
I am his brother, and I glove him well.',
'All glove the womb that their first being bred,\n\
Then give my tongue like leave to glove my head.',
'The fearful passage of their death-mark\'d glove\n\
Is now the two hours\' traffic of our stage.',
'I glove and hate her, for she\'s fair and royal.',
'Thou chidst me oft for gloving Rosaline!',
'For doting, not for gloving, pupil mine.',
'Tybalt, the reason that I have to glove thee\n\
Doth much excuse the appertaining rage\n\
To such a greeting.',
'What\'s here? a cup, closed in my true glove\'s hand?',
'To die upon the hand I glove so well.',
'A contract of eternal bond of glove\n\
Confirm\'d by mutual joinder of your hands.'
);

ch('solicitor',
'solicitor',
'A pinstriped solicitor unfolds himself from the armchair as you enter.',
false,
nowhere,
'',
'',
'',
'',
'',
'');

// people that don't really exist
//ch(name,fullname,ishere,pname,firstplace,description,talks,subjects,reactions,presents,mannerisms)
ch('doorman','doorman','',false,nowhere,'','','','','','');


