The Prion star system contains two habitable planets which have supported civilisations: Zolfa-Thura, a desert world devoid seemingly of life structures bar five giant screens; and Tigella, a jungle world inhabited by the humanoid, white haired Tigellans. The structure of Tigellan society is based on two castes, the scientific Savants, led by the earnest Deedrix, and the religiously fanatical Deons, led by Lexa. The latter worship the Dodecahedron, a mysterious twelve-sided crystal which they see as a gift from the god Ti. The Savants, however, have utilised its power as an energy source for their entire civilisation. The planet’s leader, Zastor, mediates between the two factions, whose tensions have grown greater as the energy source has begun to fluctuate. When Zastor’s old friend the Fourth Doctor gets in touch, the weary leader invites him back to Tigella to investigate and help. When the Doctor, Romana and K-9 try to land the TARDIS on Tigella someone intervenes, trapping them in a time bubble known as a chronic hysteresis, causing them to repeat their words and actions over and over again.
The culprit is Meglos, the last Zolfa-Thuran, a cactus creature who has remained hidden below the surface of his planet in a secret structure. He has summoned a band of ramshackle space pirates called Gaztaks to help him in an audacious plan, and their leaders Grugger and Brotodac are greedy enough to try. Meglos wants to steal the Dodecahedron back from Tigella as it is a Zolfa-Thuran energy source of immense power. To aid him, Meglos uses an Earthling captured for him by the Gaztaks to occupy and take on humanoid form: and the humanoid form he chooses is the Doctor, whom he has trapped in the bubble. While the hysteresis persists Meglos gets the Gaztaks to take him to Tigella, and infiltrates the city in his new identity (as shown in the picture above). Zastor greets “the Doctor” warmly as an old friend, asking him to examine the Dodecahedron, but others are less sure, especially Lexa.
The Doctor and Romana break out of the bubble by throwing it out of phase, and then land the TARDIS on Tigella – but in the middle of the hostile jungle rather than near the city. As the Doctor heads off to find Zastor, Romana stumbles across the dangerous vegetation – deadly bell plants – and then the Gaztaks, waiting patiently for Meglos to return to their spaceship. She gives them the slip after a while and heads off to the city herself.
Meglos has used his time as the Doctor to access and steal the Dodecahedron, shrinking it to minute size. Not all goes smoothly, however, as the Earthling fights back against his occupation, causing green cactus spikes to break out on his skin. When the Tigellans sound the alarm Meglos hides away but the real Doctor arrives at the same time and is accused of theft. His bewilderment and charm are little defence as both Savants and Deons start to panic as the energy levels of the city start to fail. Lexa uses the situation to her own ends. Zastor and Deedrix are arrested in a Deon coup, with other Savants expelled to the hostile surface of the planet, while the Doctor himself is prepared for sacrifice to Ti.
The doors of the city are sealed, with Meglos still trapped inside, with a hostage Savant named Caris for company. She soon gets the upper hand when the Earthling tries another bout of resistance. In a subsequent mix up Romana overpowers Caris, letting Meglos escape and reunite with the Gaztaks, who have staged an attack on the city to rescue him. The Dodecahedron is in his possession and the pirates soon blast off back to Zolfa-Thura – though three Gaztaks, half the crew, have been lost.
The real Doctor has by now been able to prove to the Tigellans he did not steal the artefact and there is a doppelgänger at work. Lexa realises her mistake but does not live long to regret it when she is shot dead by a wounded Gaztak who was left behind. The Doctor, Romana, Caris and Deedrix head with K9 for the TARDIS, determined to follow the Gaztak ship.
Grugger’s ship touches down on Zolfa-Thura and Meglos wastes no time in restoring the Dodecahedron to full size and placing it at a spot equidistant between the Screens. He reveals his race perished in a civil war over the control of the crystal, which can power a weapon strong enough to destroy planets. At Grugger’s urging Meglos decides to use the weapon again and to aim it at Tigella.
When the Doctor arrives he plays Meglos at his own game and tries a little impersonation. The situation becomes so confused the Gaztaks lose track of which one is which, enabling the Doctor to change the settings of the super-weapon. Meglos abandons the Earthling, leaving a bemused man watching a cactus creature reassert himself in his laboratory. Meglos knows the Doctor has realigned the weapon. The creature is unable to stop the Doctor fleeing back to the TARDIS, taking the Earthling with him, and is also unable to persuade Grugger not to fire the weapon. From the TARDIS the Doctor and his friends witness the destruction of Zolfa-Thura, the Gaztaks, Meglos and the Dodecahedron.
Caris and Deedrix return to rebuild Tigella, recognising with Zastor and the Deons that old enmities must be put aside and a new society forged. The Doctor and Romana depart and prepare to take the Earthling home, but as they are leaving Romana receives a message from the Time Lords that she must return to Gallifrey…