mob
var
grabvar = 0 // 0 = allow move 1 = block move
Move()
if(grabvar)
return 0
else
..()
mob
verb
Grab(mob/M in get_step(usr,usr.dir))
set category="Taijutsu"
if(!M || !ismob(M))return
if(usr.tai+usr.cbat+(rand (3,18)-2)<=M.eva+M.spd+(rand (3,18)))
src<<"<font color=\"blue\">Your attack was evaded!</font>"
else
M.grabvar = !M.grabvar
src.grabvar = !src.grabvar
ID:1868922
![]() Jun 8 2015, 7:20 pm
|
|
So, I've managed to cobble together a grab verb and it seems to work fine say for that when I kill the mob I'm still stuck in place. So I was wondering if I can get some help coming up with something that would reset my move back to 0 when the mob dies or is no longer adjacent to the src.
|
You can set 'grabvar' to be the mob you are grabbing, then run if(grabvar in orange(1, src)) return That's an O(N) complexity. It can be done in O(1) complexity. #ifdef TILE_MODE |
I'm still pretty new, could you point me in the direction of where atoms are explained in the DM so that I might get a better understanding?
|
You could even reset grabvar if it isn't beside the character.