proc/Death(mob/M)
if(M)
if(istype(M,/turf/rock/))
// M:opacity=0
// M:density=0
// M:icon_state="dirt"
// M:hp=5
var/dropgem = rand(1,256)
if(dropgem==1)
new/obj/pickup/Diamond(M.loc)
view()<<"<font color=white>A Diamond has fallen to the ground!</font>"
if(dropgem>=2 && dropgem<=3)
new/obj/pickup/Onyx(M.loc)
view()<<"<font color=white>A Diamond has fallen to the ground!</font>"
if(dropgem>=4 && dropgem<=7)
new/obj/pickup/Pearl(M.loc)
view()<<"<font color=white>A Pearl has fallen to the ground!</font>"
if(dropgem>=8 && dropgem<=16)
new/obj/pickup/Ruby(M.loc)
view()<<"<font color=red>A Ruby has fallen to the ground!</font>"
if(dropgem>=17 && dropgem<=33)
new/obj/pickup/Sapphire(M.loc)
view()<<"<font color=blue>A Sapphire has fallen to the ground!</font>"
if(dropgem>=34 && dropgem<=65)
new/obj/pickup/Amethyst(M.loc)
view()<<"<font color=#9900cc>A Amethyst has fallen to the ground!</font>"
if(dropgem>=66 && dropgem<=130)
new/obj/pickup/Topaz(M.loc)
view()<<"<font color=yellow>A Topaz has fallen to the ground!</font>"
if(dropgem>=131 && dropgem<=256)
new/obj/pickup/Emerald(M.loc)
view()<<"<font color=green>A Emerald has fallen to the ground!</font>"
M:opacity=0
M:density=0
M:icon_state="dirt"
Spawngem(M.loc)
return
if(istype(M,/obj/tree)||istype(M,/obj/tree))
var/drop = rand(1,10)
if(drop <= 2)
new/obj/pickup/Wood(M.loc)
if(drop >= 3)
new/turf/grass(M.loc)
del M
return
if(istype(M,/obj/wallm)||istype(M,/obj/wall)||istype(M,/obj/wallu)||istype(M,/obj/underwall)||istype(M,/obj/underwallu)||istype(M,/obj/underwallm)||istype(M,/obj/woodwall)||istype(M,/obj/woodwallu)||istype(M,/obj/woodwallm))
var/drop = rand(1,10)
if(drop <= 5)
new/obj/pickup/Brick(M.loc)
if(drop >= 1)
new/turf/woodfloor(M.loc)
del M
return
Problem description: So as you can see by my code, this is what happens when Death() procs. The problem is, the first part of the code involves turfs, which is where my question is. The second part of the code involves obj. The second part that involves obj works just fine, and I have no problems, however, the first part of the code, with the turfs, it tells me the "view()<<" string along with what dropped, but it does not ever drop an the gem item.
These are coded exactly the same, except for ones a obj, and ones a turf, and I already had to deal with obj and turfs interacting with the player. I decided to make turfs clickable, and just changing the icon state when the turf "dies". Now it seems that items do not want to drop if its related to a turf. Any help would be appreciated! Thanks!
Edit:Sorry A.T.H.K, I'm not familiar with forums all so much and I have alot on my mind with work + overtime and my finace and life's crazyness and this game so I appoligize if I formatted it wrong. Thanks for letting me know B).
<DM>
Code here
</DM>