The lightning will strike you if you're wearing metallic items, take all of your weapons and metallic armour off and you won't get hit by lightning.
The yellow hearts are temporary.
You can also gain them by cooking and eating food. If you get hit and lose the heart it won't come back, as...