Star Trek: The Original Series/Recap/S1/E21 The Return of the Archons

Down on the planet of Beta III, Sulu and a Red Shirt are being hounded by a group of Black brown-cloaked figures wielding the world's longest Swiss Roll(TM); the Red Shirt runs off and disappears, while Sulu is beamed aboard the Enterprise, but not before being touched by the Swiss Roll, converting him into a hippie ditz. Concerned by this turn of events, Kirk takes a landing party down to scope things out.

What they find isn't promising; a giant Lotus Eater Machine disguised as a 19th-century town, where every Victorian-clad citizen is nice and friendly and not at all a Stepford Smiler...until the evening falls, during which they, well...aren't. Nice, friendly, and a Stepford Smiler, I mean; for the entire night, everyone goes crazy and destructive, like the entire cast of Equilibrium went off their Prozium at the same time and started going through the withdrawl symptom of violent mood swings. The away team finds shelter at a local boarding house run by a man named Roger, who grows interested in their lack of going nuts like the rest of the town and questions if they're "Archons", referring to the crew of the ship that the Enterprise came to the planet to find; Kirk refuses to say, thanks to that pesky Prime Directive.

The next day, though, someone tips the Black Brown Cloaks off to the landing party, and attempts to "absorb" them into the Lotus Eater Machine. Fortunately, Kirk's uncanny ability to Logic Bomb any computer-like being saves the day, and they escape with Roger to a safer location...but not without picking up the Red Shirt, now a member of the machine, against Roger's warnings not to. Once out of danger, Roger explains the whole thing: he is a resistance fighter against the Blasck Brown Cloaks and their master, Landru, who controls the people via Mind Control, and polices them with the Black Brown Cloaks; anyone out of its thrall is told You Will Be Assimilated (so, nothing like the Borg, then), and are killed if they can't be. Even worse, Landru has the ability to pull entire starships out of the sky to assimilate its crew, which is what it's doing to the Enterprise, currently (though with heat beams...yeah, major You Fail Physics Forever, there). Unfortunately, since the Red Shirt has been assimilated, Landru finds the group through him, and knocks them out in an attempt to capture and assimilate them.

The away team finds themselves deep in Landru's sanctuary, on call to be assimilated, and with no hope of escape now that the Black Brown Cloaks have adapted to Kirk's Logic Bombs (again, no Borg similarities here). In a stroke of luck, though, it turns out the master assimilator is a member of Roger's underground, and manages to keep Kirk and Spock from being absorbed. After subduing their captors (why they didn't do that, before, is anyone's guess, as is why Landru bothered to bring them to his inner sanctum to assimilate them instead of having the Black Brown Cloaks touch them with their Swiss Rolls), Kirk has Roger and the assimilator take them to Landru...which turns out to be a giant computer (what else?).

As it turns out, Landru was once a real person, a leader of the colony on the planet, who built the machine to help him keep the peace over the people; once Landru died, the computer took over his name, identity, and purpose, and went through a Zeroth Law Rebellion, force-assimilating people into the Hive Mind in order to keep order. When the Archon crew came, it saw them as a threat to its perfect society, and assimilated them, just like it's trying to assimilate the crew of the Enterprise. Unfortunately for it, Kirk regains his Logic Bomb mojo and makes it explode by forcing it to realize it's harming the very people it sought to protect by stifling their free will and creativity (how Anvilicious of you). Having ruined yet another idyllic society, Kirk leaves the once-absorbed Red Shirt to guide the colony to a more "human" existence, Kirk goes gallivanting off to a new adventure.