The city of Richmond, Calif. juts into the San Francisco Bay like the head of a rhinoceros looking west across the water, toward San Quentin State Prison and the tony towns north of the Golden Gate. It’s a low, industrial town, and 2,900 acres of it is an oil refinery. Chevron is Richmond’s biggest employer, and through taxes contributes about a quarter of the city’s total budget.

Chevron is also Richmond’s eternal nemesis. Industrial accidents are an ongoing issue. A fire at the refinery in 2012 sent 15,000 people to hospitals, resulting in a city lawsuit and a $5 million settlement. And in January Richmond joined six other California cities in suing oil companies for growing coastal threats related to climate change—primarily the sea level rise jeopardizing Richmond’s working coastline.

“We have 32 miles of shoreline on San Francisco bay, more than any other community, and a substantial amount of it is low-lying and subject to inundation,” says Tom Butt, Richmond’s mayor. “The root of this lawsuit and my biggest disappointment with these fossil fuel companies is that they’re all more interested in perpetuating themselves than they are in making a transition. They’re more interested in self-preservation than preserving the planet.”

In addition to the California cities’ various lawsuits, New York, Seattle, and municipalities in Colorado have all filed lawsuits against various combinations of oil companies since the summer of 2017. The suits are all at different stages; along with San Mateo, Richmond has been moved from state court to federal. Others have gone from federal back to state. On Thursday in a federal court in San Francisco, a judge heard a motion to dismiss from five fossil fuel companies, the defendants in the suit brought by San Francisco and Oakland. The same thing will happen in New York in June.

It’s a confusing landscape. The idea of cities using the courts as recourse in the fight against climate change is one that goes back at least to the 1990s, and the plaintiff side mapped out the detailed strategy just a few years ago. Now, in an era of federal deregulation and rising seas, these lawsuits feel increasingly urgent. The question is whether the courts will even see them as plausible.

In 1998, a third-year law student at Yale named Eduardo Peñalver wrote a journal article called “Acts of God or Toxic Torts—Applying Tort Principles to the Problem of Climate Change,” examining the possibility that, if regulatory or legislative action couldn’t stop climate change, maybe lawsuits could. (Peñalver is now dean of Cornell Law School.) Scientists came to the idea a few years later. Myles Allen, a University of Oxford researcher wrote an opinion piece for the journal Nature suggesting the idea, though Allen acknowledged that it’d be difficult to figure out who the plaintiffs and who the defendants would be. Everyone burns carbon-based fuels, and everyone benefits (and suffers).

A 2012 meeting of climate activists, scientists, and lawyers in La Jolla, Calif. may have been where the strategy really got worked out, though. Allen was on the list of attendees, as were attorneys who’d been involved in the Department of Justice’s case against tobacco companies in the 1990s—a partial model for the suite of climate lawsuits today. (Lead paint is another one.) At that time they didn’t have a piece of the puzzle: evidence that the climate companies knew their products caused harm, as the tobacco companies did.

In 2015 an investigation by the Los Angeles Times and Columbia Graduate School of Journalism partially closed that gap, showing that oil companies like Exxon had acknowledged the planetary risks of their products as early as the 1980s. Attorneys general started asking questions. The oil companies said they saw malfeasance in all this, and it’s true that some of the same lawyers involved in those ideas back then are serving as outside counsel for the cities that have filed the recent lawsuits.