The Fourth Doctor and Romana have arrived on the third moon of Delta Magna, searching for the penultimate segment of the Key to Time. They find themselves caught in the middle of a dispute between the crew of a methane refinery and the natives (known as 'Swampies'). The Swampies claim that the crew have disturbed the waters, and will incur the wrath of their god, Kroll. Kroll is revealed to be a giant squid, which surfaces to feed every few centuries and is the source of the abnormally large amount of methane being mined. Originally a normal size squid, Kroll ingested the fifth segment of the Key to Time and began to grow, becoming a god-like figure to the Swampies and their descendants.
After Kroll awakens and begins to attack both the Swampies and the refinery indiscriminately, the Doctor uses the tracer to retrieve the segment of the Key, which destroys Kroll and instigates cellular regeneration within the creature to produce hundreds of normal-sized squid. This process not only saves the planet's inhabitants but removes the source of methane from the refinery. The Doctor and Romana return to the TARDIS and set off on their next adventure.