ID:2003421
 
(See the best response by Ter13.)
Problem description:
So... I have a bunch of verbs(attacks) under mob/Ootori, and i want to be able to call then from the code, as i want to make an clone that use these attacks.
From my tests, if i call the verb from another verb with:
src.verb()

It works, but that would call the attack from the user of the verb, not from the clone.
Then i tried:
var/mob/clone/C = new()
C.verb()

but then i get the error "undefined proc"
I tried do this too:
proc/CallAttack(mob/M)
src = M
src.verb()

And it gets me the same error...
I also tried to create the clone under mob/Ootori/Clone too, but when i do this and call the verb in any ways said before, the verb is used from the user and not from the clone.
Any idea how do i do this? :(
Best response
proc
CallAttack(mob/clone/M)
M.burning_attack()


If your verb relies on usr, though, usr will still be the player and not the clone.
Oh, really? Then i should use src instead of usr right? c:
Then i should use src instead of usr right?

Whenever possible, you should always use src instead of usr. There is never a case where usr and src are the same object and you would want to use usr instead.
In response to Ter13
Ter13 wrote:
There is never a case where usr and src are the same object and you would want to use usr instead.

Wut.

obj/item/verb/drop()
usr << "You dropped the thing"
src.loc = usr.loc


I'm not disagreeing with using src instead of usr but... wut...


I'm dumb.
In response to Rushnut
Rushnut wrote:
I'm dumb.

Yep. =D
Thanks for the answers!
Had to do some adaptations, but it worked in the end.
I can kinda guess why i should use src instead of user...

Anyway, thanks a lot for the answer c: