ID:155087
 
how would you make a explosion where it would make the ground it explodes on a circular shape of dirt afterwordslike bare miniumim coding kind of code cause i suck when it come to some super complex code
make some dirt icon then find out location of explosion use
for(var/turf/T in oview(5))
T.icon_state="Dirt"icon_state
In response to Hassanjalil
true that works but it makes more of a square then a circle
In response to Mastergamerxxx
obj
crater
icon = 'crater.dmi'
var
list/edges = list()
New()
..()
if(src.loc)
var/startx = src.x-1
var/starty = src.y-1
for(var/count=0;count<9;count++)
if(count==4)
continue
var/turf/T = locate(startx+count%3,starty+round(count/3),src.z)
if(T)
var/obj/O = new/obj
O.name = "crater"
O.icon = src.icon
O.icon_state = "[count+1]"
O.loc = T
src.edges += O
spawn(150)
del src
Del()
for(var/obj/O in src.edges)
del O
..()

mob
proc
Crater()
new/obj/crater(src.loc) //note the use of src, not usr.
How about you simply do this?
var/range=6
for(var/turf/T in range(range,src))
if(sqrt((T.x-x)**2+(T.y-y)**2)<=range)
T.icon_state="dirt"
I dug this out of one of my projects:

proc/Distance(atom/M,atom/N)
return sqrt((N.x-M.x)**2 + (N.y-M.y)**2)

proc/GetRing(atom/M, radius) //Abyss Dragon's, it didn't come in a library.
var/ring[] = list()
var/turf/T
for(T as turf in range(radius+1,M))
if(abs(Distance(T, M)-radius) < 0.5)//The < 0.5 check is to make sure the ring is smooth
ring += T
return ring


Notice my comment with the code says where it came from. I try to do that so if I ever have a situation like this I can say whose it was. I've used this proc before and it's brilliant! Couldn't ask for a smoother ring. You'll have to play with it to fill in the whole circle though.

I was using this code to make a sort of druid ring dynamically. Then I decided on something a bit more simple and scrapped it, but I still have the code:
proc/findspot()
var/turf/t = locate(20,20,3)
//var/count = 0
for(var/turf/x in GetRing(t,5))
if(x.density)

continue

else
for(var/atom/y in x.contents)
if(y.density) break
src.dir=get_dir(x,t)
src.Move(locate(x))
In response to Hassanjalil
Or he could just make one big crater image and offset it.
But this is more of how to make a multi-tile crater effect, not a circular explosion.