“I’m going to do something bad,” a cretinous villain (Walton Goggins of “Justified”) announces about an hour into Nima Nourizadeh’s wild, woozy and irredeemably junky action comedy “American Ultra.” It’s a line that Nourizadeh (“Project X”), scripter Max Landis (“Chronicle”) and all the cast members might have intoned before making the picture. The summer’s releases have been heavy on superheroes and spies, and “Ultra” falls into the latter category, but not in the mode of “Mission: Impossible.” Instead it opts for the jokey, elbow-to-the-ribs approach of “Spy” and “The Man from U.N.C.L.E.,” with lots of drug humor added to the mix to stoke things up. Unfortunately it winds up closer to Guy Ritchie’s misguided reboot than Melissa McCarthy’s crowd-pleaser, failing to blend the violence and farcical elements into an engaging whole.

Jesse Eisenberg, looking different from his usual self with long, stringy hair and adopting a gentle, hesitant manner not at all like his usual hyper persona, plays Mike Howell, a frequently-stoned slacker working as a clerk at a dumpy all-night convenience store in a sleepy West Virginia burg. The only drawback in his relationship with Phoebe (Kristen Stewart), the supportive live-in girlfriend he hopes to marry, is that he suffers from panic attacks every time he tries to leave town; the condition even prevents him from taking her on a Hawaiian trip during which he’d planned to propose.

Luckily for him Phoebe, though disappointed, is understanding. But Mike’s life is quickly changed in another way. After being visited during the wee hours at the store by a strange woman (Connie Britton) who babbles some unintelligible formulas at him, he notices two strange men in the parking lot poking around his car, and when he goes out to investigate, they come at him threateningly. He reacts by dispatching them both, stabbing one in the neck with a spoon and killing the other after throwing a cup of hot soup in his face. Bewildered by his ability to pull off such a devastating stunt, he summons Phoebe for help; and the two are quickly taken in for questioning by the local sheriff.

That’s just the start of the action. It turns out that Howell was part of a secret project headed by Victoria (Britton) to produce a super-agent; when the scheme was mothballed as a failure, he was left to live as an ordinary schlub with the memory of his past erased, but with a mental quirk that would cause attacks if he even tried to leave his safe zone. Protective Victoria’s apparent gibberish triggered his training so that he could protect himself against the machinations of her agency rival, an arrogant twit named Yates (Topher Grace), who aims to terminate Mike as a potential loose cannon. To get rid of him, Yates will employ not only military personnel and equipment—including, at one point, a drone—but a secret army of black-clothed assassins he’s assembled, all dangerous mental patients who’ve been programmed to do his bidding. Thus the initial altercation at the convenience store, in which the first two such goons perish at Mike’s hand.

After that initial assault fails, Yates sends more forces in, including Goggins’ cackling maniac, and eventually helicopters to West Virginia to spearhead the operation personally. Confrontations follow at the jailhouse, at the house of Mike’s drug-dealing pal (a scenery-chewing John Leguizamo), at Howell’s own house (where he teams up with Victoria, who becomes another quarry of Yates), and finally at a supermarket where Mike has to take on the surviving members of Yates’ army as well as the man himself, who’s taken Phoebe hostage. And there are further revelations about Phoebe, Victoria, and Mike, as well as the details of Yates’ nefarious plans. In the end the shadowy CIA chief (Bill Pullman) shows up to settle things definitively.

The main problem with “American Ultra” is one of tone. It strives to be a dark comedy, but the humor is variable, ranging from the low-key, befuddled charm of Eisenberg to the wildly over-the-top antics of Grace, Goggins and Leguizamo, all of whom shoot for the rafters in ways that can be grating (Grace’s shtick, to be frank, gets tiresome very fast). Stewart has surprisingly little to do, but she brings a bit more to what basically descends into a damsel-in-distress routine than other actresses might, simply on the basis of her star quality. As the plot rolls on, however, the picture minimizes the farcical elements in favor of violent action, which is designed to be garishly cartoonish but frequently becomes merely mean-spirited and unpleasant. (By the time Mike is literally hacking his way through Yates’ men in the supermarket, the effect is pretty gruesome.) There’s an amusing running gag about Mike trying to find the right moment to propose to Phoebe that winds up in one of the rare episodes when the comic and action elements come together cleverly, but that’s the exception rather than the rule.

In visual terms the picture looks suitably grungy, with Richard Bridgland’s production design, Jon Danniells’ set decoration and David C. Robinson’s costumes all contributing to make Mike and Phoebe’s world appear as unkempt as their lives are, and Michael Bonvillain’s cinematography captures the run-down ambience well. The one spectacular scenic set piece is one set in the basement of Leguizamo’s pad, which briefly takes the movie into full comic-book mode with its neon colors and weird lighting effects, in contrast to the usual flat palette.

But though “American Ultra” wants desperately to come across as an outrageous mix of action and comedy, in the end the recipe produces a curiously unpalatable dish.