I would like to add a certain behavior to all verbs. Is it possible to do this in one spot, or do I need to add a check in every verb.
EX.
mob
var
isasleep
verb
if(isasleep)
usr << "You can't do that while you are sleeping."
return
// ^^^^^^ This is what I want to do essentially^^^^
// Have this default behavior for all verbs when asleep
Sleep(M as mob)
M.isasleep = TRUE
spawn(500)
M.isasleep = FALSE
I know this doesn't work, just trying to express what I'm looking for. I could also set verbs to null, but I dont like the default responses when you do that.
ID:150904
Jul 6 2001, 5:02 am
|
|
In response to Deadron
|
|
On 7/6/01 8:53 am Deadron wrote:
On 7/6/01 8:02 am Flick wrote: Kinda figured that. I was hoping there was some sort of Login(), Start(), Call() or something that happened when you use a verb. At least theres only 60 or so verbs so far. I guess I'll have to call an Isavailable() proc in each verb to test for possible reasons it wouldn't be. Thanks |
You can't avoid a check in every verb. Even if you could do it just once, you'd still have to call the superclass method first to get the check and so it would take the same number of lines of code.