The value of X is determined only as Night of the Sweets' Revenge's last ability resolves. It won't change later in the turn if the number of Foods you control changes.

Artwork
Loading artwork…
Night of the Sweets' Revenge
Wilds of Eldraine · #178 · EN
Nonfoil—Foil—
Card rules
When this enchantment enters, create a Food token. (It's an artifact with "2,
, Sacrifice this token: You gain 3 life.")
Foods you control have "
: Add
."
5
, Sacrifice this enchantment: Creatures you control get +X/+X until end of turn, where X is the number of Foods you control. Activate only as a sorcery.
Uncommon · Illustrated by Leonardo Santanna
Format legality
Brawl Legal
Commander Legal
Competitive Brawl Legal
Duel Legal
Gladiator Legal
Historic Legal
Legacy Legal
Modern Legal
Oathbreaker Legal
Pioneer Legal
Standard Legal
Standard Brawl Legal
Timeless Legal
Vintage Legal
Alchemy Not Legal
Future Not Legal
Old School Not Legal
Pauper Not Legal
Pauper Commander Not Legal
Penny Not Legal
PreDH Not Legal
Premodern Not Legal
Tlr Not Legal
Rulings
Published rulings from the downloaded Scryfall catalog. Source card record · Rules and interactions
Night of the Sweets' Revenge's last ability affects only creatures you control at the time it resolves. Creatures you begin to control later in the turn won't be affected.
Whatever you do, don't eat the delicious cards.
Food is an artifact type. Even though it appears on some creatures, it's never a creature type.
You can't sacrifice a Food to pay multiple costs. For example, you can't sacrifice a Food token to activate its own ability and also to activate Maraleaf Rider's ability.
If an effect refers to a Food, it means any Food artifact, not just a Food artifact token. For example, you can sacrifice Tough Cookie (an Artifact Creature — Food Golem) to activate Maraleaf Rider's ability (an ability with "Sacrifice a Food" in its cost).