(The Doctor lies motionless at the foot of the tower which he has just fallen off from a great height. Adric, Tegan and then Nyssa
run up and crouch around the Doctor's body.)

NYSSA: Doctor!TEGAN: Doctor!ADRIC: Doctor!

(The Doctor slowly grins at Adric.)

DOCTOR: It's the end...But the moment has been prepared for...

(His eyes move towards something behind him, and we see The Watcher standing there. The Doctor outstretches his arm towards The Watcher,
who walks towards him.)

ADRIC: The Watcher!NYSSA: So he was the Doctor all the time.

(The Watcher walks towards the Doctor and begins to merge with him, shrinking into a green light over the Doctor's face. Then
in close-up, the fourth Doctor's face is seen for the last time before becoming first The Watcher and then gradually regenerating into
a new face, the fifth Doctor.)

OPENING CREDITS

Castrovalva
by Christopher H. Bidmead
Part One

2, EXT: PHAROS PROJECT AREA

(An alarm is sounding. The newly regenerated Doctor is being supported by Adric and Tegan as they hurry back to the TARDIS, Nyssa
is running behind. The Doctor looks very weak. The TARDIS is at the end of a field in front of them. Three security officers hurry out
at the sound of the alarm. As the Doctor and his friends get closer to the TARDIS, he suddenly loses his balance and falls, Adric and
Tegan can't support him. They all collapse on the ground.)

DOCTOR: I....Oh.

(The security men have caught up with them.)

HEAD OF SECURITY: These are secure premises! Now you lot have got some explaining to do.TEGAN: But the Doctor...HEAD OF SECURITY: He'll be taken care of.

(He gestures to his two colleagues to apprehend the four travellers. One of them gets hold of both Nyssa and Tegan, and the other
grabs Adric. The Doctor is left where he is.)

ADRIC: Look, will you let me go!TEGAN: Look, take your hands off me, this is an official uniform!NYSSA: Leave me alone!ADRIC: Don't be silly! We would like to help you, but we can't just leave the Doctor! Something might've gone wrong with his
regeneration!

(An ambulance pulls up and a man gets out.)

HEAD OF SECURITY: HANDS UP! AND LEAN ON IT! C'MON QUICK!

(Nyssa, Tegan and Adric are shoved up against the ambulance and forced to put the hands onto it. Two ambulance officers hurry over
to the Doctor, one has a stretcher. Meanwhile Tegan is being searched by the security man.)

TEGAN: We're perfectly harmless, unfortunately.

(As Nyssa is being searched and the Doctor is being carried on the stretcher, Tegan notices the keys are still in the ambulance.
Now Adric is being searched.)

ADRIC: I thought the whole point of this Pharos Project of yours was to track down alien intelligences. (He turns around
and smiles.) We thought we'd save you the trouble and come to you.HEAD OF SECURITY: Oh yes.ADRIC: Yes! We're what you've been looking for. Alien intelligences. You see I come from somewhere up there. (He points into
the sky) That is the way into E-Space.

(The ambulance takes off. And Tegan is at the wheel! Nyssa is in the passengers seat.)

NYSSA: ADRIC, QUICK!

(Adric tries to escape from the security men, but they tackle him to the ground.)

ADRIC: Get off me!

(The ambulance goes towards the TARDIS. Meanwhile Adric is trying desperately to hold off two security men, he bites the hand of
one, then he kicks out at the other.)

TEGAN: Get the Doctor, quick!

(Nyssa and Tegan get out of the ambulance, just as Adric has been overcome by the security men.)

HEAD OF SECURITY: I'll hold him. GET THE TWO GIRLS!

(The other men run off towards the ambulance. Nyssa, Tegan and a hobbling Doctor finally get into the TARDIS, seconds before the
men arrive at the door.)

NYSSA: This works the door, that's all I know about these controls.TEGAN: We can't take off without Adric. Doctor!

(She turns to see the interior door close.)

TEGAN: Where's he off to now?

(Tegan walks over to the door, and Nyssa operates the scanner. Adric is still being held by the Head of Security.)

4, EXT: PHAROS PROJECT AREA

HEAD OF SECURITY: Right young man, you better come along with me.ADRIC: Look, I hope you realize, the Doctors just saved us all from the Master, and now he's gonna take off and you'll never have
a chance to...

(He looks up at the sound of the TARDIS. But actually the sound is from the Master's TARDIS materialising, still in the guise of
an Ionic column.)

5, INT: MASTER'S TARDIS

(The Master grins and then laughs for about five seconds.)

6, INT: TARDIS CONSOLE

NYSSA: TEGAN!TEGAN: What's the matter?NYSSA: The Master's TARDIS.

(They watch the scanner, which shows the Master's TARDIS emitting blue and yellow lightning. All of the security men collapse, and
Adric is seen running towards the Master's TARDIS.)

7, EXT: PHAROS PROJECT AREA

(Tegan and Nyssa exit the TARDIS.)

TEGAN: ADRIC! ADRIC, WHERE ARE YOU?!

(They watch the Master's TARDIS dematerialize, and Adric is on his knees where it used to be. Tegan and Nyssa run over to him. They
help him up and go back into the TARDIS. As they enter, the Master's TARDIS hovers above the Doctor's.)

8, INT: TARDIS CONSOLE

TEGAN: I suppose we'd better take off or something.

(Adric silently operates the controls.)

TEGAN: I hope he knows what he's doing.NYSSA: He took off once before, he said, but that was by mistake!

(They look over towards him, he is still operating controls.)

9, EXT: PHAROS PROJECT AREA

(The Doctor's TARDIS dematerializes, and then the Master's TARDIS goes straight after it, the Master can be heard laughing.)

10, INT: TARDIS CONSOLE

(Nyssa is watching the scanner, which shows the Earth getting smaller and smaller.)

NYSSA: Good takeoff.

(Tegan runs up.)

TEGAN: The Doctor's very strange.NYSSA: He's weak, it's the shock.TEGAN: Well, you better go talk to him, because I don't understand this scientific stuff. He's looking for something called a
'Zero Room'.ADRIC: 'Zero Room'? I'll go.

(Adric walks out and shuts the interior door.)

TEGAN: That boy never even said thank-you.

11, INT: TARDIS INTERIOR

(Adric is holding the fourth Doctor's coat, which has clearly been discarded by the new Doctor. He looks around uneasily. He is about
to set off down a corridor when he notices a string attached to the door. He begins to follow it and finds the Doctor, unravelling his
scarf. He looks up at Adric.)

DOCTOR: Ah. You've come to help me find the Zero Room. Welcome aboard. I'm the Doctor... (He shakes Adric's hand.)
Or will be if this regeneration works out...

(The Doctor walks off, leaving a bemused Adric, who looks briefly at his hand, before following the Doctor.)

12, INT: TARDIS CONSOLE

NYSSA: I suppose this is the mean free path tracker. (She walks around the console.) And this panel must be a referential
difference.TEGAN: I know the TARDIS is huge, but it can't be taking them this long surely. What's a Zero Room anyway? The Doctor said something
about 'null interfaces'.NYSSA: I suppose it's some sort of neutral environment. An isolated space, cut off from the rest of the universe.TEGAN: He should've told me that's what he wanted, I could've shown him Brisbane.

13, INT: TARDIS INTERIOR

(The Doctor is walking with Adric, furiously unravelling more of the scarf.)

DOCTOR: Now, ordinary spaces of course show up on the architectural configuration indicators, but any good Zero Room is balanced
to zero energy with respect to the world outside its four walls...or however many walls it has.

(He scratches his head, and seems disturbed for a few seconds by his new hair.)

DOCTOR: There was a very good polygonal Zero Room under the Junior Senate block on Gallifrey, widely acclaimed for it's healing
properties...Romana's always telling me I need a holiday.ADRIC: But Romana's gone, Doctor.

(The Doctor looks sad and confused.)

DOCTOR: Gone? Really? Did she leave a note?ADRIC: We said goodbye to her at the gateway! Don't you remember?

(The Doctor clearly doesn't.)

DOCTOR: Well if we did, we did.

(He gets preoccupied again, and wraps the rest of the unravelled scarf around a door handle behind him.)

DOCTOR: This should get you back to the console room, when the time comes.

(Suddenly, he turns around and grabs the wall.)

ADRIC: Are you sure you're alright?DOCTOR: There's strong dimensioning forces this deep in the TARDIS, tend to make one a bit giddy.ADRIC: And the regeneration?DOCTOR: I don't know. I can feel it isn't going to be as smooth as on other occasions. (He cheers up.) Sooner we get to
this Zero Room place the better, eh?

(He gives Adric a friendly slap on the chest and they move off again, the Doctor suddenly takes off one of his shoes and leaves it
on the ground.)

14, INT: TARDIS CONSOLE

NYSSA: These mechanisms are too complex. We just can't fly the TARDIS without the Doctor's help.TEGAN: What if we don't get it? Anything could've happened to him and Adric.NYSSA: Then the TARDIS will just fly on, and on, until it crashes into something.TEGAN: Crash? Is that likely?NYSSA: Inevitable. The star densities in this galaxy vary inversely with the sq...

(Tegan bangs on the console.)

TEGAN: Oh rabbits!NYSSA: Tegan, I don't know what's happening to the Doctor, none of us understands it but, I do know that panicking is no use.TEGAN: You're right....Well if only we had a manual.NYSSA: There's nothing we can do here. I'm going to try and find them.

(She walks off.)

TEGAN: Wait! You don't know those corridors. I got lost in them when I first came into the TARDIS and I can tell you they're
a nightmare.NYSSA: Then you'd better stay here.TEGAN: I'll come with you.

(The Doctor continues walking, now clutching his lapels like the first Doctor.)

DOCTOR: I wonder, boy, what would you do if you were me, hmmm? ... Or perhaps I should ask, what would I do if I were me.

(He suddenly starts giggling and walks off again.)

16, INT: TARDIS CONSOLE

(Nyssa is reading the TARDIS Information System.)

TEGAN: Will it tell us how to fly the TARDIS?NYSSA: I'm sure that's in here somewhere, once we find the index file.TEGAN: How do we find the index file? Of course, if we had an index file, we could look it up in the index file, under index
file! ... What am I saying? I'm talking nonsense.NYSSA: Recursion isn't nonsense.TEGAN: Eh?NYSSA: That's an example of recursion, when procedures fold back on themselves. If you had an index file, you could look it up
in the index file.

(Tegan looks confused.)

TEGAN: If. My Dad used to say that 'if' was the most powerful word in the English language.NYSSA: Recursion's a powerful mathematical concept. But I don't see how it can help us now.TEGAN: If...(She suddenly has an idea.) I-F! Stands for index file!

17, INT: TARDIS INTERIOR

(The Doctor is still walking, except now his mannerisms are similar to that of the third Doctor.)

DOCTOR: Not far now, Brigadier, if the Ice Warriors don't get there first. (He stops and leans on a column.) Oh no.
(He suddenly looks and sounds very frightened.) Oh dear. We've wandered into the wrong corridor! We must be close to the main
TARDIS drive now. (He now regressed into the second Doctor) Jamie! Jamie, you go back!ADRIC: No I have to stay with you, Doctor.DOCTOR: No nonsense, be sensible, go back! When I say run, run! Don't you understand? The regeneration is failing...

18, INT: TARDIS CONSOLE

TEGAN: I-F! It works. Let me have a go on it.NYSSA: Look up...destination setting.TEGAN: Right...D-S. (She types it in.) You know, once you get into it, this whole funny system on the TARDIS does start
to make a sort of weird sense...Except this. (She reads what is on the screen.) TARDIS Flight Data; Programmed Journey; Departure:
Earth, Pharos Project; Destination: Hydrogen In-Rush: Event One!

19, INT: TARDIS INTERIOR

(The Doctor know sits up against a wall, looking worried. Adric walks off down a corridor.)

DOCTOR: ADRIC! ADRIC! NOT THAT WAY! ... Adric. I remembered his name.

20, INT: TARDIS INTERIOR

(Nyssa and Tegan are now looking for the Doctor, and have found the unravelled scarf hung on a door handle.)

TEGAN: Seems the old doc is coming unravelled in more ways than one. Look, you'd better go back to the console room.NYSSA: We're on a programmed flight. We won't crash. ... At least I don't think so.

21, INT: TARDIS INTERIOR

(There is a mirror, and next to it a hat stand, where a white hat and a cream blazer hang.)

DOCTOR: ADRIC!

(The Doctor sees himself in the mirror. He has a good look at his new body, and moves in closer and looks worried.)

DOCTOR: That's the trouble with regeneration, you never quite know what you're going to get.

(He stands up and finds a recorder on top of the mirror. He plays a few out-of-tune notes.)

DOCTOR: No.

(He looks down and discovers a cricket bat instead. He picks it up and looks admiringly down the back of the blade.)

DOCTOR: Dear me. Needs a drop of linseed oil though.

(He turns and notices a door. He looks around nervously, and then closes his eyes and pushes open the door. The room is like a cricket
dressing room. There are badges on the wall, a few bats and stumps and a notice board as well as some cricket whites scattered around.
The Doctor walks in and closes the door.)

22, INT: TARDIS INTERIOR

(Adric is walking uneasily around in the corridors.)

23, INT: TARDIS INTERIOR

(Nyssa has found half of the Doctor's waistcoat.)

TEGAN: No that looks like the end of the trail.

(Nyssa opens a nearby door, which contains some boxes and sheets.)

NYSSA: This part of the TARDIS can't have been used for centuries.TEGAN: It does go on and on.NYSSA: Deeper and deeper. TEGAN: Yes I get that feeling too, that we're going downwards.

(She points a direction and they start walking.)

24, INT: MASTER'S TARDIS

(On a screen, Adric is wandering in the corridors of the Doctor's TARDIS.)

(The Doctor comes out of the cricket room, now dressed in a white shirt and a cricket jumper, and trousers. He still carries the
bat. He walks over to the mirror and plays a practice cricket shot. He then puts the bat down, and puts on the coat and the hat. Then
he removes the hat again as he seems unhappy with his appearance.)

DOCTOR: Well, I suppose I'll get used to it in time.

(He hears running footsteps, and then a thumping noise.)

DOCTOR: THAT'S IT, THAT'S THE DOOR!

(He runs off.)

26, INT: TARDIS INTERIOR

NYSSA: This way, come on!

(They run off as well, and they run straight into the Doctor.)

NYSSA: DOCTOR!TEGAN: Thank heavens.DOCTOR: The Zero Room door, I heard it slam.TEGAN: Doctor, are you alright?DOCTOR: Fit as a fiddle, Vicki, but something very peculiar is going on with the TARDIS. The Zero Room. Have you seen it anywhere?TEGAN: I think the noise came from this direction. (She points.)DOCTOR: Good. I'll follow you.

(He runs off, leaving Nyssa and Tegan to look at each other in amazement.)

27, INT: TARDIS INTERIOR

(Now they are in another part of the TARDIS)

TEGAN: Must be around here somewhere.

(The Doctor sees a red line on the wall, he touches it and looks at his fingers.)

TEGAN: Doctor?DOCTOR: Hello, carmine seepage.TEGAN: Actually, Doctor, it's me, my lipstick. We passed this way before.DOCTOR: Oh that's a relief, I thought the TARDIS's auto-systems were playing up again. Dreadful. Always going wrong. It's time
we went to Logopolis to get it all sorted out once and for all.

TEGAN: We've been already, Doctor.NYSSA: Doctor? What does the Zero Room look like?DOCTOR: Zero Room? Oh, it's very big... empty... and sort of grey...pinkish-grey.TEGAN: Come on Doctor, through this way.

28, INT: ZERO ROOM

(She leads the Doctor to where Nyssa is standing, in the Zero Room, and he immediately looks more relaxed.)

DOCTOR: Thank you. You must be Tegan. Works even better if you close the doors, Nyssa. (She does so.)TEGAN: It smells like roses.DOCTOR: Yes. I've never quite understood why. It's quite peaceful, isn't it.TEGAN: Peaceful...Doctor it's like...NYSSA: Like Traken...used to be.TEGAN: Will you have to stay here long?DOCTOR: Oh just until my dendrites heal. (He taps his head.) The nervous system's a very delicate network of logic junctions.NYSSA: The synapses, yes.DOCTOR: Oh yes, I was forgetting Nyssa, bioelectronics is your strong point. Yes, well, my tussle with the Master came at precisely
the wrong moment. When the synapses are weak they're like radio receivers, picking up all sorts of jumbled signals.TEGAN: I get it, the Zero Room cuts out all interference!DOCTOR: Completely! Even the gravities only local. (He jumps on the spot.) My goodness me I'm tired.NYSSA: But there isn't even a bed.DOCTOR: Bed? Oh I don't need a bed, not in the Zero Room.

(He touches his head, and Nyssa and Tegan watch as he slowly begins to levitate into a sleeping position in front of them.)

DOCTOR: One of the advantages of stark simplicity.TEGAN: Can anybody do that?DOCTOR: You don't do it, it just sort of comes to you, like sleep... very like sleep.

(The Doctor now speaks as if he wasn't there, as if he was watching over the Zero Room. His mouth doesn't move.)

DOCTOR: We only just made it to the Zero Room in time. This regeneration is going to be difficult, and I shall need you all,
every one of you. You Tegan, you have it in you to be a fine co-ordinator, keeping us all together during the healing time. Nyssa of
course has the technical skill and understanding. All the information you need is in the TARDIS databank. I'm sure you can find your
way to it.TEGAN: We already have Doctor.DOCTOR: Good, good, of course you have. And Adric, Adric with his badge for mathematical excellence, Adric is the navigator,
he knows the way. He knows me, my old self. Adric, you must help me heal the disconnection. Your role is very crucial.TEGAN: ...Adric.

(Suddenly Nyssa gasps and they look up on the wall at an image of Adric trapped in some sort of web.)

NYSSA: Adric.TEGAN: Adric. What are you doing up there?ADRIC: A trap! He set a trap, the Master!NYSSA: The Master? Where?ADRIC: Me! I'm the trap! I locked the co-ordinates. Event One!TEGAN: Adric! Hold on, I'm coming up to get you.ADRIC: No, no, this isn't me, it isn't me! It's an illusion! Projection! Block transfer. Tegan! The co-ordinates!

(The image of Adric in the web fade from the wall.)

TEGAN: Horrible.

29, INT: MASTER'S TARDIS

(The Master stands in front of the web in which Adric is trapped. He laughs. Every word is an effort for Adric.)

ADRIC: Escape! Must...escape.MASTER: So. These simulated projections are real enough to have a will of their own...Almost.ADRIC: Ca...Can't reach me in the Zero Room.MASTER: Is that what you thought? Well my dear young man, it was your own computational powers that made the block transfer possible.
If escape were that easy Adric, we could all be free of this nasty world. Now, save your energies, there is so much yet to be done!

(He presses a switch on a hand-held device, and Adric collapses.)

30, INT: ZERO ROOM

(The Doctor still levitates and is asleep.)

NYSSA: We can't tell him now, he's in a dangerously unstable state!TEGAN: Adric was trying to warn us.NYSSA: The co-ordinates. And something about a trap. You stay here and keep an eye on the Doctor.

(She turns to leave.)

31, INT: TARDIS INTERIOR

(Nyssa comes out of the Zero Room, followed by Tegan.)

TEGAN: Where are you going?NYSSA: Console room. Look after the Doctor.

(Nyssa walks off and Tegan goes in and closes the doors of the Zero Room. Nyssa continues and finds Tegan's lipstick on a shelf,
it has melted. She goes over to the wall and finds the lines of lipstick are running as well. She hears a knocking sound.)

NYSSA: That's odd...

(She walks off in the direction of the noise.)

32, INT: ZERO ROOM

TEGAN: Poor Adric. If only we could do something!

(The Doctor now lies on the ground.)

DOCTOR: What's the matter?TEGAN: Sorry, I didn't mean to wake you.

(The Doctor sits up.)

DOCTOR: There seems to be something distinctly wrong. I can feel it.

33, INT: TARDIS INTERIOR

(Nyssa hurries along the corridors, she rests her hand on a column, but recoils from it due to the heat. The cloister bell can be
heard.)

34, INT: ZERO ROOM

(The Doctor listens to the cloister bell.)

DOCTOR: Sshh. The TARDIS cloister bell. Imminent disaster.TEGAN: For us?DOCTOR: Oh worse than that, the TARDIS is in danger. Who's in the console room?TEGAN: Nyssa.DOCTOR: And Adric!TEGAN: Adric's...DOCTOR: Well is he, or isn't he!TEGAN: ...Doctor.

(The Doctor is exasperated and hurries out of the Zero Room.)

35, INT: TARDIS INTERIOR

TEGAN (OOV): NO YOU CAN'T GO OUT THERE!

(The Doctor pushes through the doors and immediately collapses, Tegan helps him back in.)

DOCTOR: Adric isn't what, tell me!

36, INT: ZERO ROOM

TEGAN: Look. You stay here, I'll go. After all, I am the co-ordinator.

(She lets go of the Doctor, who sighs in relief.)

37, INT: TARDIS CONSOLE

(Nyssa has reached the console. She looks at the screen which reads "APPROACHING HYDROGEN IN-RUSH, EVENT ONE", flashing below that
is "ENVIRONMENT BEYOND ENGINEERING TOLERANCES". Nyssa looks very worried.)

38, INT: TARDIS INTERIOR

(Tegan has reached the place where the Doctor's unravelled scarf ran out. She grabs it and prepares to leave.)

39, INT: TARDIS CONSOLE

(Nyssa is reading from the screen, steam is now billowing around her.)

NYSSA: Hydrogen. Abundant element. Highly explosive in the presence of oxygen. Believed to be the basic constituent out of
which the galaxy was first...

(She trails off and seems to realize something. Tegan runs in breathing hard.)

TEGAN: Oh, this heat! Has something gone wrong with the TARDIS air-conditioning?NYSSA: Of course, that's it! It's not the TARDIS!TEGAN: What else could it be?NYSSA: Outside! You'd better read this.

40, INT: TARDIS INTERIOR

(The Doctor breaks out of the Zero Room again, half collapsing again in the heat.)

DOCTOR: I've got to do something.

41, INT: TARDIS CONSOLE

TEGAN: Event One.NYSSA: A trap, Adric said. This is a time machine.TEGAN: And we're travelling backwards in time! Back to first event!NYSSA: The creation of the galaxy out of a huge in-rush of hydrogen. We're heading straight into the biggest explosion in history!

(The warning screen is shown again. Then the console is shaken by a small explosion, Nyssa and Tegan stumble.)

42, INT: TARDIS INTERIOR

(Outside the Zero Room, the Doctor struggles to keep his feet. He falls on his back.)

43, INT: TARDIS CONSOLE

(Tegan and Nyssa regain their balance, and run to the console, Tegan burns herself. Suddenly the scanner opens, and the Master is
on the screen, grinning.)

44, INT: MASTER'S TARDIS

(The Master stands in front of his web, with Adric in it, and waves.)

MASTER: Farewell, my friends. Farewell, forever!

45, INT: TARDIS CONSOLE

(Nyssa and Tegan stare at the screen in horror as the Master laughs again.)