ID:154133
 
Is this better?


proc/damage(mob/attacker,mob/victim)

Is that better than

proc/damage(mob/M)

?
Sariat wrote:
Is this better?


proc/damage(mob/attacker,mob/victim)

Is that better than

proc/damage(mob/M)

?

I use

mob/proc/damage(amount as num, mob/attacker)

src is the victim.
In response to Shadowdarke
Shadowdarke wrote:
Sariat wrote:
Is this better?


proc/damage(mob/attacker,mob/victim)

Is that better than

proc/damage(mob/M)

?

I use

mob/proc/damage(amount as num, mob/attacker)

src is the victim.

I wasn't asking for damage :P I meant the style of that kind of coding. I usually just use

proc/someproc(mob/M)
usr << "you did some proc on [M]"
M << "[usr] did some proc on you!"

In response to Sariat
Sariat wrote:
I wasn't asking for damage :P I meant the style of that kind of coding. I usually just use

proc/someproc(mob/M)
usr << "you did some proc on [M]"
M << "[usr] did some proc on you!"

You should be using src here. Even if this proc were called by a verb, it likely would only be used in cases where usr==src anyway.

The style of coding you showed in your first post, which included both the attacker and victim in the arguments, is probably redundant. The reason is that a Damage() proc, or procs like it, would usually belong to one of the mobs in question--either the attacker or the defender. Thus you have src available, and can use that.

Lummox JR
In response to Sariat
Sariat wrote:
I wasn't asking for damage :P I meant the style of that kind of coding.

What I gave you was a style of coding, silly.