The Pirate Loop

The Pirate Loop is a BBC Books original novel written by Simon Guerrier and based on the long-running science fiction television series Doctor Who. It features the Tenth Doctor and Martha Jones. It was published on 26 December 2007 alongside Peacemaker and Wishing Well. It is also the second Tenth Doctor book to feature space pirates, after The Resurrection Casket.

Plot
After escaping from over-eager serving robots in Milky-Pink City, Martha asks the Doctor about the Starship Brilliant, which mysteriously disappeared. He agrees to investigate, but the TARDIS crashes on arrival and Martha is knocked out. She wakes in the ship's engine room, where she and the Doctor are led to the starship's experimental drive by the slave-like mechanics, who have small holes instead of mouths. The Doctor realises that the starship's experimental drive works by skipping out of space-time. However, it has become stalled, putting it at risk of exploding. They attempt to contact the captain, but find that the door out of the engine rooms is blocked with a membrane like scrambled egg. The Doctor notes that it separates regions where time flows at different rates, and uses his sonic screwdriver to allow them to pass through. Martha emerges by herself and meets the robot Gabriel, the ship's steward. He escorts her to the cocktail lounge, where she is befriended by Mrs Wingsworth, an egg-shaped alien.

Martha learns that the ship has been invaded and asks Gabriel to warn the Doctor, but three badger-faced space pirates enter and disintegrate him. Two of the badgers, Dashiel and Jocelyn, leave to scout out the ship, leaving the third badger, Archibald, to guard the prisoners. He is amazed at the canapés which Martha offers to him, as he was raised on recycled food, and she convinces him to share the food with the passengers. Dashiel and Jocelyn return, having been unable to find either the ship's drive or their comrades. They try some of the food and are similarly impressed, with Martha noting that the canapés are mysteriously replenished. Dashiel disintegrates Mrs Wingsworth after she expresses her scorn at their lack of culture. Martha grabs Jocelyn's gun after she shoots another passenger, but she is startled when Mrs Wingsworth enters the room, allowing Archibald to take the gun. Dashiel shoots at Martha, but she shields herself with the canapé tray, which reflects the shot at Jocelyn and kills her. Martha runs back to the engine room door, pursued by Archibald. She hits him with the tray, but she dies when he stabs her.

On emerging from the scrambled egg membrane, the Doctor is met by Gabriel, who tells him that Martha has gone to the cocktail lounge. The Doctor learns that three hours have passed since Martha's arrival, as time passes more slowly in the engine rooms. He meets Jocelyn and Archibald, who disintegrate Gabriel again. The Doctor leads them to the engine room door, deducing that they intend to steal the ship's drive. However, they cannot pass through the scrambled egg membrane, as it is impossible to move from a region of faster time to one of slower time. Jocelyn blocks off the corridor by activating the fire doors, then escorts the Doctor to Dashiel in the cocktail lounge. Mrs Wingsworth antagonises the badgers and is once again disintegrated. While the Doctor attempts to negotiate, Archibald offers him some of the canapés, which continue to be replenished. Mrs Wingsworth enters the cocktail lounge again, explaining that the passengers are brought back to life after they die. However, Archibald mentions that Martha did not come back to life after she was killed.

The Doctor resolves to find Martha's body and return it to her family once he has resolved the issues on the starship. Dashiel attacks the Doctor after he is tricked into disabling the guns using the sonic screwdriver, but runs into the window and is knocked unconscious. The Doctor takes his dagger and heads to the bridge with Mrs Wingsworth and Archibald, leaving Jocelyn to tend to Dashiel. They reach the capsule in which the badgers arrived, where Archibald mentions that Jocelyn died and woke up again there. The Doctor realises that everyone is resurrected where they first appeared and goes to open the fire doors in the engine room corridor, where he finds that both Martha and Gabriel have been resurrected. He explains that they are in a time loop, and the ship is attempting to protect the passengers by resurrecting them and replenishing the food, using its drive to alter reality. However, this is draining the ship's energy, as the loop is incomplete.

Gabriel leads them to the bridge, where the door is blocked by another scrambled egg membrane. The Doctor and Martha pass through it, and are immediately killed by an electrical barrier. They are promptly resurrected and the Doctor convinces the captain, Georgina Wet-Eleven, to let them pass. Observing the pirate vessel on the wall screens, the Doctor realises that it has been frozen in time by the starship's drive, preventing the other pirate capsules from reaching them. The three badgers then invade the bridge and attack the crew, with everyone other than the Doctor and Martha being killed. The Doctor alters the electrical barrier so that it separates the resurrected crew and badgers. He lets the badgers out after they promise to behave, but the crew initially refuse to co-operate. Archibald offers Captain Georgina some canapés, and she reluctantly agrees to a truce. The Doctor uses the transmat booth to travel back to the engine room so that they can escape from the time loop, connecting the ship's drive to the TARDIS and using it to warp space-time.

Meanwhile, the pirate ship has unfrozen and the scrambled egg membrane has disappeared. The badgers attempt to negotiate with their comrades, but they are unsuccessful. The other badger pirates board the ship, capture Martha, and shoot Dashiel and Captain Georgina. Archibald, Jocelyn and Martha are taken to Captain Florence on the pirate ship. On emerging from the TARDIS, the Doctor finds that the pirates have attacked and stolen the ship's drive. He leaves a note for Gabriel and is found by Mrs Wingsworth, who tells him that people have stopped coming back to life. They travel to the pirate ship in the TARDIS and take the lift to the bridge. The pirate ship destroys the Brilliant on Captain Florence's orders as they arrive, and she shoots Mrs Wingsworth and Archibald. The Doctor duels with her using the dagger he had taken from Dashiel, and she accidentally stabs herself. She refuses the Doctor's offer of help and shoots him.

The badgers try to shoot Martha and Jocelyn, but find that their guns have been disabled. The Brilliant reforms and everyone who died is brought back to life. The Doctor explains that the ship drained the power from their guns because the note he left for Gabriel told him that the guns were a danger to the passengers. Instead of breaking them out of the time loop, he completed it and extended it to include the pirate ship. Reality is now only adjusted once every cycle and the loop has become self-sustaining, so the ship no longer needs to expend energy. The Doctor invites the badgers to a party on the Brilliant, and Martha, Jocelyn and the resurrected Captain Florence join the other badgers as they head for the capsules. The crew, passengers, mechanics, robots and badgers all party together on the starship. The Doctor announces that he will leave in the TARDIS, and that going with him will be their last chance to leave the never-ending party and return to the real world. The party-goers make their decisions as they dance to Mika's song Grace Kelly.

Audiobook
An abridged audiobook was released in July 2008. It is read by Freema Agyeman, who plays Martha Jones in the TV series.