SAAB - all that chwilly's code does is to give you the distance between the player and the bomb.
You need to work out the damage from that.
A reasonable formula for damge by distance might be something like:
Damage = 100/(Dist+1)
This would do 100 damage at Dist = 0, (I use Dist + 1 to get rid of the problem of dividing by zero), then do 50 damage at one unit distance, then 33.3 at 2 units and so on down to ~9 damage at 10.
If you want a wider radius for the explosion, you could do something like:
Damage=100/((Dist/10)+1)
which would reduce much slower.
"You get what everyone gets, you get a lifetime!" - Death, The Sandman Library
First you Dream, then you ... - Neil Gaiman, 2001