ID:167481
 
                spawn(42)
for(src != usr)
if(get_dist(usr,src) <= 1)
if(src.dead == 0)
src.hp -= 109
usr.deathcheck(src)
..()

Yes... my current code is a wreck. I have no experience in For so you can sum up it sucks.

I want it to do what it says in the title - Detecting other mobs in 1 tile and basicly killing them (But if your around level 60 or something you can avoid that, thats why it isn't src.hp = 0)

The game that needs it is a secret project... and yes, that number the spawn has is used the way I want it.
spawn(42)
for(var/mob/M in oview(1,src)) // for each mob within 1 tile range of src, that src can see, but is not src, or in src's inventory
//if(get_dist(usr,src) <= 1) <-- isn't necessary, you're already testing for mobs in 1 tile range
if(!M.dead) //I prefer this to == 0, because you might just leave it as null
M.hp -= 109 // I'm using M here, and used it above to refer to each mob in a 1 tile range
src.deathcheck(M) // You might be in trouble with usr here, you PROBABLY mean src, so I'll assume that
..() // you wouldn't want to put this under spawn, it belongs outside of it


Hope this clears things up a little for you. Also, hope 60 doesn't have anything to do with World of Warcraft. I've lost a number of friends to that wretched abomination.
In response to DerDragon
Thanks. No, this is not a BYOND WoW.

I was just guessing what level you had to be to get enough HP to avoid being killed by that. Ofcourse that was a real bad mistake, as the base HP is 40 and leveling up adds 5.


It seems I need to level 14 times to avoid a kill by that.

(105 / 5 = 21, 21 - 8 (8x5 is 40, you know) = 13, + 1 (For the extra 4 HP needed) = 14)
In response to RedlineM203
runtime error: Cannot modify null.loc.
proc name: Poison water (/mob/proc/Poison_bomb)
usr: RedlineM203 (/mob)
src: RedlineM203 (/mob)
call stack:
RedlineM203 (/mob): Poison bomb(RedlineM203 (/mob))

                spawn(3)
for(var/turf/T in oview(3,src))
var/obj/P = new/obj/Poison
P.loc = T.loc
for(var/mob/M in oview(3,src)) // for each turf within 3 tile range of src, that src can see, but is not src, or in src's inventory
if(!M.dead)
var/mob/poison = rand(2,12)
M.hp -= poison
M << "[src]'s Poison bomb damages you for [poison] HP!"
src << "Your Poison bomb damages [M] for [poison] HP!"
src.deathcheck(M)


Hmm... its partly the same as its "Older Brother" code.
In response to RedlineM203
new /obj/Poison(T.loc)
In response to Mysame
It seems to do nothing now. Showing more of it.

                spawn(3)
for(var/turf/T in oview(2,src))
new /obj/Poison(T.loc)
for(var/mob/M in oview(2,src)) // for each mob within 1 tile range of src, that src can see, but is not src, or in src's inventory
if(!M.dead)
var/mob/poison = rand(2,12)
M.hp -= poison
M << "[src]'s Poison Bomb damages you for [poison] HP!"
src << "Your Poison Bomb damages [M] for [poison] HP!"
src.deathcheck(M)
usr.freeze = 0

obj
Poison
name = "Poison"
icon = 'Poison.dmi'
layer = 99 //Yes...
New()
sleep(50)
del(src)


Sleep too short? <_<



UPDATE: Poison is appearing at 1,1,1.
In response to RedlineM203
Well, who and where is src? >.>
In response to Mysame
SRC is the player/AI that uses it.

They are in a location greater then 1 and lower then 20 (X and Y, Z is 1), as the playing field has boundaries.
In response to RedlineM203
Besides that, your DeathCheck() proc is backwards...
In response to RedlineM203
Look up 'BasicMath' by AbyssDragon. get_steps() is what you need.
In response to Mysame
You seem to like saying that, I saw you say it 3 times atleast ... you haven't seen my deathcheck.




Solved by just getting rid of it, and just adding a small 0.3 second overlay (not the icon used back there) and then getting rid of it.


But now I want to know how to allow a mob to jump from obj/Water (Yes...) using a verb (attached to this proc), while not diving. Also I wanted it so the jumping mob won't land back into water if the current var/shore is 1.

mob
proc
jumpup()
var/obj/T = locate(src.x,src.y,src.z)
if(src.jumping == 0 && src.diving == 0)
if(T.shore == 0)
src << "You jump above the water!"
src.layer = 56
src.jumping = 1

sleep(8)
if(T.shore == 1)
src << "You land on shore."
return
else
src.layer = 17
src.jumping = 0