ID:261374
 
I am having trouble with the typesof() proc. I am trying to add verbs to the user, with the typesof proc. This is my current code:
usr.verbs += typesof(/obj/cards/Card_I/Card_A/verb)

It is not adding a single verb to the users verbs. Could anybody please tell me what I am doing that is wrong?

Thank you.

☺~White Flame~☺
Try using a for() loop to loop through stuff in typesof(yourverbs).
mob/guytoholdverbs/verb
verb1()
world << "1"
verb2()
world << "2"
verb3()
world << "3"

mob
verb
add_all_verbs()
for(var/t in typesof(/mob/guytoholdverbs/verb)
usr.verbs += t
world << "added [t]" //DBG

Try something like that :)
In response to Vortezz
Well, I tried it, and it still didnt work.
obj
Card_I
icon = 'cards.dmi'
verb
Activate()
if(usr.card_active == 0)
if(usr.wearing_belt == 1)
usr.card_active = 1
src.suffix = "Active"
for(var/t in typesof(/obj/Card_A/verb))
usr.verbs += t
usr << "Added"
else
usr << "You are not wearing an activation belt."
else
usr << "A card is already active."


That is my code. It doesn't even say 'Added'. It just skips that whole part..


☺~White Flame~☺