/*
 * Hamlet
 *
 * Hints file
 */

var Hint = new Object;
var NUM_HNTS = 0;

function write_hints()
{
	for(var i = 0; i<= NUM_HNTS; ++i)
	{
		if(i) write_hint(i);
	}
}

function write_hint(h)
{
	document.write('<a name="a_' + h + '"><b>' + Hint[h].header + '</b>');
	write_answer(h, 0);
	document.write('<br/><br/>');
}

function write_answer(h, a)
{
	var divId = 'h_' + h + '_' + a;
	var aId = 'a_' + h;
	document.write(' <u><font color="#0000ff"><a style="cursor: hand;" onClick="javascript:document.getElementById(\'' + divId + '\').style.display = \'\'">[more]</a></font></u>');
	document.write('<div id="h_' + h + '_' + a + '" style="display: none">');
	document.write(Hint[h].answer[a]);
		if(a < Hint[h].answer.length - 1)
		{
			write_answer(h, 1 + a)
		}
	document.write('</div>');
}

function do_hint(n)
{
	var i = 0;
	var more_hints = true;
	while(more_hints)
	{
		var str = Hint[n].header + ':\n\n';
		str += Hint[n].answer[i++];
		
		if(i >= Hint[n].answer.length)
		{
				alert(str);
				more_hints = false;
		}
		else
			more_hints = confirm(str + '\n\n(Click OK if you want to see the next hint.)')
	}
}

function hint_for(header,answers)
{
	Hint[++NUM_HNTS] = new Object;
	Hint[NUM_HNTS].header = header;
	Hint[NUM_HNTS].answer = answers.split('/');
}

hint_for('The ghostly mist',
'Have you been to the balcony yet?\
/Seen the ghost?\
/Talked to the ghost?\
/Once you have talked to the ghost, the \"ghostly mist\" disappears and \
you can get down the stairs.'
);

hint_for('Horatio',
'Tried talking to Horatio?\
/Tried killing him?\
/There\'s not much point in either. He isn\'t important to the game.'
);

hint_for('Ophelia',
'Talked to Ophelia much?\
/Simpering bint, isn\'t she?\
/Seen the picture on her wall?\
/Looked out the window?\
/Jumped out the window?\
/Don\'t.\
/Tried closing the window?\
/You can\'t.\
/Ophelia loves her daddy very much.\
/Do you know how Ophelia dies in Shakespeare?\
/In Shakespeare, Ophelia commits suicide by drowning herself.\
/What might drive Ophelia to suicide?\
/You need to find and kill her father first.\
/Go and look in the Queen\'s bedchamber.\
/See the hints on the Queen\'s bedchamber, if you must.\
/If you bring the dead body of Polonius to Ophelia, she\'ll jump out the window.'
);

hint_for('The Queen\'s bedchamber',
'Have you examined the curtain?\
/Having read or seen Shakespeare\'s Hamlet may help you here.\
/Tried asking Gertrude about the curtain?\
/Tried opening or moving the curtain?\
/Tried talking to the curtain?\
/Looks like there\'s someone behind there.\
/Tried attacking the curtain?\
/You need a weapon of some sort.\
/You won\'t be able to get any further with this until you\'ve left town and come back.\
/Stab the curtain with the dagger and see what happens.'
);

hint_for('Gertrude',
'Have you tried killing Claudius with Gertrude upstairs?\
/Interferes a bit, doesn\'t she?\
/She\'ll have to go.\
/You need to get rid of her somehow.\
/Tried attacking her?\
/Tried talking to her?\
/There\'s something she wants.\
/Tried giving her the whisky?\
/Sorry, Gertrude doesn\'t like whisky.\
/Do you know how she dies in Shakespeare?\
/She drinks poison from a golden chalice.\
/You need to bring her the chalice.\
/You can get the chalice from the witch. Eventually.'
);

hint_for('Claudius',
'Have you talked to Claudius?\
/Asked him about your father?\
/Asked him about your mother?\
/You\'re going to have to kill the bastard.\
/Claudius is the Big Baddie. You won\'t have to kill him till near the end.\
/Really, I wouldn\'t worry about it for now.\
/Very well. Have you tried fighting Claudius?\
/Gertrude stops you fighting Claudius.\
/Have you asked Gertrude about Claudius?\
/You\'ll need to get Gertrude out of the way before you can kill him.'
);

hint_for('Othello',
'Othello looks tough. Have you tried fighting him?\
/Don\'t.\
/Have you talked to Othello?\
/Having seen or read Shakespeare\'s Othello may help you here.\
/Othello is a jealous man. He\'s also married.\
/Have you asked him about his wife?\
/Othello\'s wife\'s name is Desdemona.\
/Othello couldn\'t stand it if he thought Desdemona was cheating on him.\
/Maybe if you brought him something of hers?\
/Desdemona works at the Croaking Raven Inn on the waterfront. Go and have a look there.'
);

hint_for('Getting out of the palace',
'Have you tried fighting Rosencrantz and Guildenstern?\
/Try all you want, it\'s useless.\
/Have you talked to them?\
/Why won\'t they let you out?\
/How can you prove to them that you\'re sane?\
/There\'s something in the dungeon that might help you.\
/Have you examined the certificate from the dungeon?\
/Show the certificate to Rosencrantz or Guildenstern.'
);

hint_for('The gravedigger',
'Have you looked at him?\
/A bit odd, isn\'t he?\
/Have you talked to him?\
/Asked him about his dress?\
/Have you looked at his shovel?\
/Asked him for it?\
/The gravedigger really wants a career change.\
/He wants to be a famous actress.\
/There\'s a way for you to give him his big break.\
/Have you looked in the theatre in Elsinore?\
/You ought to bring him something from the theatre.\
/Give him the auditions form from the theatre.'
);

hint_for('The inn',
'Have you talked to the landlady?\
/This doesn\'t seem to be a normal, respectable inn.\
/Have you tried to go through to the \"private suite\"?\
/Have you asked Nell about the private suite?\
/She\'ll let you go through if you buy a drink.\
/You\'ll need some money though.\
/You need to dig to find the money.\
/Where do pirates bury their treasure?\
/Take the shovel to the beach near Elsinore and dig.\
/You can buy a drink with the gold coins from the chest. Then you can go through.'
);

hint_for('In the private suite',
'Have you talked to Desdemona?\
/Tried kissing her?\
/Tried anything else?\
/Well, shame on you.\
/Asked her about Othello?\
/Desdemona has something you want.\
/Have you examined the handkerchief she\'s holding?\
/Tried asking for the handkerchief?\
/Tried fighting her for it?\
/Tried taking it off her?\
/Looks like you\'ll have to convince her you need it.\
/What would make her give you the handkerchief?\
/Tried sneezing?\
/Okay, so you can\'t just sneeze at will. You\'ll need to make yourself sneeze.\
/What well known everyday item or substance is likely to make you sneeze?\
/There\'s something in the kitchen back in the palace.\
/It\'s in the cupboards.\
/You need the pepper from the cupboards in the palace kitchen.\
/Sniff the pepper in Dessie\'s presence, and she\'ll surrender the handkerchief.'
);

hint_for('The ship',
'Have you examined the ship?\
/The ship can take you between Denmark and England.\
/Have you talked to the sailor?\
/He wants to see a ticket.\
/Seen a ticket anywhere?\
/Theatres have tickets. Look in the theatre.\
/Have you looked at the vending machine?\
/Tried pushing the button?\
/Push the button on the vending machine in the theatre to get a ticket.\
/Looked at the ticket?\
/Oh, it\'s a ferry ticket. Go to the boat and show it to the sailor to make \
the journey, in either direction. You can do this as many times as you like.'
);

hint_for('Richard III',
'Do you know what Richard III\'s dying words are in Shakespeare?\
/Well, try talking to him.\
/To be honest, reading Shakespeare won\'t help you here anyway.\
/He wants a horse.\
/Didn\'t you see a horse back in Elsinore somewhere?\
/Go to the stable.\
/Have you examined the horse?\
/Have you tried talking to the horse?\
/Don\'t bother.\
/Have you tried fighting the horse?\
/That hurt, didn\'t it? Serves you right for attacking an innocent animal.\
/Have you tried riding the horse?\
/Oh well, it was worth a try.\
/There\'s something the horse wants.\
/It\'s a hungry horse.\
/Horses like carrots.\
/Found the carrot yet?\
/You need to dig somewhere for it.\
/Look around the palace gardens.\
/Carrots are vegtables, by the way.\
/You can dig up the carrot from the vegetable patch, if you have the shovel.\
/Tried giving the carrot to the horse?\
/Uh oh. You shouldn\'t have given the carrot to the horse.\
/Noticed how the horse reacts to the carrot?\
/When you have the carrot, the horse will follow you.\
/Mercifully, if you drop the carrot, the horse will stop following you and won\'t eat it.\
/The horse will even follow you up and down stairs, ladders and ropes! Clever, isn\'t it?\
/It will even follow you on to boats!\
/Lead the horse to Richard and he\'ll reward you.'
);

hint_for('Getting into the tower',
'Why does Banquo stop you getting into the tower?\
/Have you talked to him?\
/Have you tried fighting him?\
/Don\'t.\
/He needs to be convinced that you\'re of royal blood.\
/Yes, I know you are, but you don\'t have anything to show it, do you?\
/Supposing you were wearing a crown.\
/Didn\'t you see someone else with a crown?\
/No, not Claudius.\
/Richard III has a crown.\
/Once you\'ve dealt with him, this should be easy.\
/You can get into the tower if you\'re wearing the crown.'
);

hint_for('Macbeth',
'Have you tried fighting Macbeth?\
/Don\'t.\
/Have you examined the dagger?\
/You\'ll need something to cut the thread.\
/You need to bring something from the palace.\
/You need something from Ophelia\'s room.\
/You need the nailscissors.\
/The scissors are too blunt. Can you think of any way to sharpen them?\
/Have you looked in the blacksmith\'s hut in Elsinore?\
/Try examining the machine in the blacksmith\'s hut.\
/The machine in the blacksmith\'s hut is a sharpener.\
/Sharpen the scissors in the blacksmith\'s hut, then use them to cut the thread.'
);

hint_for('Getting upstairs in the tower',
'Looked at the tower from outside?\
/From inside?\
/Looked up?\
/You\'ll need something to climb.\
/There\'s a rope somewhere.\
/This is probably the puzzle that more people get stuck on than any other.\
/All text adventures should have one, and only one, puzzle like this.\
/This is where I get my revenge on the authors of all the games I ever got stuck on.\
/Have you asked any other characters about Macbeth?\
/He\'s not popular, is he?\
/What sort of people, in particular, dislike Macbeth?\
/All right. Look in the theatre in Elsinore.\
/See the sign on the wall?\
/Theatre people are superstitious folk, you know.\
/What, in particular, shouldn\'t you say in a theatre?\
/In case you didn\'t know, there\'s a superstition that it\'s bad luck to utter the name of \"The Scottish Play\" in a theatre.\
/I\'ve heard this is because, during a performance of Macbeth at the globe, the authorities locked the gates and drafted the entire audience into military service.\
/I\'m not sure how that would have gone down with Queen Elizabeth though.\
/Say \"Macbeth\" while standing in the theatre.\
/Hmmm. A rope.\
/Examined the rope?\
/Hmmm, looks like an ancient Indian magic rope.\
/Seen anything else that was ancient Indian and magic?\
/Something from the palace perhaps?\
/Something from the Queen\'s bedchamber?\
/There\'s an ancient Indian magic flute in Gertrude\'s bedchamber.\
/Heard of the Indian rope trick?\
/Tried playing the flute while you\'re carrying the rope?\
/Tried playing the flute while the rope is on the floor in front of you?\
/Of course, you need to do this in the right place.\
/Put the rope in the bottom of the tower, then stand there and play the flute.\
/Cool. You can now climb up the rope.'
);

hint_for('The porter',
'Have you read Shakespeare\'s Macbeth?\
/Dull, isn\'t it.\
/I liked that comic relief scene with the porter, though.\
/The drunk porter.\
/Tried talking to the porter?\
/Tried fighting him?\
/Have you looked at him?\
/Is there something he might want?\
/He wants whisky.\
/Give him the whisky you bought at the inn. He\'ll go to sleep and not bother you again.');

hint_for('Juliet',
'There\'s something you want in Juliet\'s room.\
/Gosh, Juliet seems sad about something.\
/Tried talking to her?\
/Seems she\'s under the impression that her boyfriend is dead.\
/And we all know Romeo\'s not *really* dead, is he?\
/All right, so I got it the wrong way round.\
/Pedant.\
/It\'s not like she should even be in Scotland, is it?\
/Anyway, have you seen any other characters that might be able to help a bit?\
/Looked in the dungeons of the palace in Elsinore?\
/Talked to the monk?\
/Read the telegram?\
/This monk is useless. You\'re going to have to do his job for him.\
/Take the telegram to Juliet. She\'ll cheer up and go, leaving her stuff behind.'
);

hint_for('The witch',
'Looked at the witch?\
/Talked to her?\
/Have you read the recipe book?\
/Asked the witch about it?\
/She needs you to bring her four ingredients.\
/One of them is in the graveyard in Elsinore.\
/You need to give her Yorick\'s skull from the graveyard.\
/Something else is in the kitchen back at the palace.\
/Look in the cupboards.\
/You need to give her the salt from the cupboards in the kitchen.\
/And wing of bat... seen any bats around?\
/Yes you have.\
/Back in Elsinore.\
/In the palace.\
/On the balcony.\
/Try catching a bat.\
/There, that wasn\'t so difficult, was it?\
/Take the bat to the witch.\
/And as for the newt...\
/It helps to examine every object closely.\
/Have you been upstairs in Macbeth\'s tower yet?\
/What you want is at the top of the tower.\
/Examine the can of hairspray in Juliet\'s room.\
/See in the ingredients - it contains newts\' eyes.\
/Give the witch the hairspray. She can now make her recipe - which is something else you need.'
);

hint_for('The finale',
'Of course, you know that no Shakespeare is in its final act until several people are dead.\
/There are five characters who should be dead by the time you need to read these hints...\
/...Polonius, Ophelia, Othello, Gertrude and Cladius.\
/Do you know how Shakespeare\'s Hamlet ends?\
/Well, what happens to most tragic heroes in the end?\
/They die, right? That\'s why they\'re tragic!\
/Tried killing yourself?\
/Actually, Hamlet is one of the few tragic heroes who doesn\'t commit suicide.\
/The Shakespeare\'s Hamlet ends in a fight scene.\
/A new character came into the game after Ophelia died.\
/Dropped in on Ophelia\'s funeral?\
/Go to the graveyard.\
/See Laertes? He\'s Ophelia\'s brother. And he\'s mad with you.\
/I mean, killed his dad and his sister, what do you expect?\
/Tried talking to him?\
/Sounds like he wants a fight.\
/I hope you\'ve remembered to bring the dagger.\
/Note that you don\'t stand a chance against him if Claudius isn\'t dead yet.\
/For the big end-game, fight laertes.\
/Congratulations! You\'re now dead, like a Shakespearean hero should be! I guess you win.'
);

hint_for("<p>Just for fun: Have you tried...","\
...cutting your nails with the scissors?/\
...jumping off the balcony?/\
...eating the dead bat?/\
...fighting the dead bat?/\
...showing the dead bat to Ophelia?/\
...kissing the dead bat (or the dead body, or the skull)?/\
...burying the bat?/\
...telling Ophelia to get herself to a nunnery?/\
...kissing Gertrude?/\
...anything else with Gertrude? (Don't worry, you won't succeed.)/\
...talking to the curtain?/\
...asking Gertrude about the curtain?/\
...asking Gertrude about the curtain, shortly after watching \"The Wizard of Oz\"?/\
...asking Gertrude about Polonius, before and after you\'ve killed him?/\
...saying something other than Macbeth in the theatre?/\
...asking Claudius about Gertrude?/\
...asking Claudius about Ophelia?/\
...drinking the whisky? (Not if you want to win the game.)/\
...talking to the horse?/\
...giving the chalice to Claudius?/\
...killing yourself when you don't have the dagger?/\
...sitting on the throne, before and after you've killed Claudius?/\
...cooking anything in the kitchen?/\
...looking at the ceiling in the 'private suite'?/\
...kissing Desdemona?/\
...anything else with Desdemona?/\
...blowing your nose on the handkerchief?/\
...giving the dead bat to the gravedigger?/\
...giving the dead body to the gravedigger? (Unfortunately you can\'t, but it\'s HILARIOUS in debug mode.)/\
...showing the dead body to the ghost?/\
...giving Polonius's body to Laertes?/\
...taking the dagger before you've cut the string?/\
...wearing the hairspray?/\
...eating the dead body (or the skull)?/\
...asking various characters about Macbeth?/\
...asking various characters about Robin Johnson?/\
...(dying by) jumping out of Ophelia's window?/\
...(dying by) stabbing yourself with the dagger?/\
...(dying by) attacking Othello?/\
...(dying by) attacking Richard III?/\
...(dying by) attacking Banquo?/\
...(dying by) attacking the witch?/\
...(dying by) drinking from the chalice?/\
...(dying by) duelling Laertes before Claudius is dead?/\
...asking Juliet about Britney Spears?/\
...soliloquising?/\
...being or not being?/\
...alas poor Yorick-ing?/\
...fixing the cookie routines under Firefox?/\
...tracking down Robin Johnson and buying him a beer?"
);

