mob
verb
punch()
if(src.dir == NORTH)
if(usr in src.loc + (src.y + 1))
usr.HP--
mob/var/HP = 10
ID:157470
Mar 2 2010, 12:04 pm
|
|
How would I go about checking if there is a mob within 1 space away from my direction or in the same exact place as me. I would like to know how to do this so that I can create many attacks in this way. Thanks for any help! Oh, here is a start of what I was thinking about doing, but I'm not sure if it was the best way to go about it or if it is going to work.
|
Mar 2 2010, 12:07 pm
|
|
In response to Kaiochao
|
|
so...is this good?
var/mob/m = locate(src.x, src.y + 1, src.z)in view(1,src) |
In response to Darkjohn66
|
|
No.
var/mob/m = locate()in oview(1, get_step(src,dir)) |
Darkjohn66 wrote:
How would I go about checking if there is a mob within 1 space away from my direction or in the same exact place as me. I would like to know how to do this so that I can create many attacks in this way. Thanks for any help! Oh, here is a start of what I was thinking about doing, but I'm not sure if it was the best way to go about it or if it is going to work. That you second-guessed this method was definitely a good instinct. There is a better way. The turf 1 space away in your current direction is get_step(src,src.dir). mob/verb/punch() Lummox JR |
In response to Lummox JR
|
|
cool, I am going to test this out right now.
client The next thing I am going to try out is checking if I can have a limited randomization with coordinate change on an object bumping a mob |