The Doctor, Steven and Dodo fall into the clutches of the Celestial Toymaker, an immortal who challenges his victims to games - with their souls forfeit to him should they lose. While the Doctor plays the Trilogic Game, a variation on the classic Towers of Hanoi puzzle, Steven and Dodo are sent on a quest to find the TARDIS, against opponents who may be figments of the Toymaker's imagination - or may be living beings, ensnared in his clutches, who seek to escape. If they win their games, the Toyroom will be destroyed, and the Toymaker will go on to construct another... but this means that the Doctor must find a way to make the last move of his game without destroying himself and his friends along with the Toyroom.