If you control 0 swamps, then the Nightmare has 0 toughness and will be put into its owner’s graveyard as a state-based action right before the next player gains priority.

Artwork
Loading artwork…
Nightmare
30th Anniversary Edition · #412 · EN
Nonfoil—Foil—
Card rules
Flying (This creature can't be blocked except by creatures with flying or reach.)
Nightmare's power and toughness are each equal to the number of Swamps you control.
*/*
The Nightmare arises from its lair in the swamps. As the poisoned land spreads, so does the Nightmare's rage and terrifying strength.
Rare · Illustrated by Melissa A. Benson
Format legality
Alchemy Legal
Brawl Legal
Commander Legal
Competitive Brawl Legal
Duel Legal
Gladiator Legal
Historic Legal
Legacy Legal
Modern Legal
Oathbreaker Legal
Penny Legal
Pioneer Legal
PreDH Legal
Premodern Legal
Timeless Legal
Vintage Legal
Future Not Legal
Old School Not Legal
Pauper Not Legal
Pauper Commander Not Legal
Standard Not Legal
Standard Brawl Not Legal
Tlr Not Legal
Rulings
Published rulings from the downloaded Scryfall catalog. Source card record · Rules and interactions
Nightmare’s power and toughness changes as the number of Swamps you control changes.
Nightmare’s ability counts all lands you control with the subtype Swamp, not just ones named Swamp.
The ability that defines Nightmare’s power and toughness works everywhere, not just on the battlefield.