ID:159038
 
I'm kind of confused about using proc perimeters.
What I want the following code to do is give the person that used "Attack" to get targeted for the Stronger() proc, and the mob to get targeted for the DeathCheck() proc.

Would this do that?
mob
var
atk
def

proc
DeathCheck(mob/M)
if(src.hp<=0)
oview() << "<font color=red>[src.name] died at the hands of [M.name]!</font>"
Stronger(mob/M)
if(M.atk>(src.atk+500) && M.def>(src.def+100))
var/tmp/up = rand(1,3)
if(up == 3)
src.atk += rand(1,300)
src.def += rand(1,300)
else
return
else if(M.atk>(src.atk+200))
src.atk+=rand(1,50)
src.def+=rand(1,50)
else
var/tmp/up = rand(1,10)
if(up == 8)
src.atk+=rand(1,20)
src.def+=rand(1,20)
else
return
verb
Attack(mob/M in view(1))
set category="Fighting"
var/tmp/damage = src.atk/M.def+rand(1,100)
M.hp -= damage
oview(src) << "<font color=white>[M.name] was hit by [src.name] for [damage] health!</font>"
DeathCheck(M)
Stronger(src)
Well, currently you're doing "src.Stronger(src)", which obviously doesn't make any sense. No idea what you're trying to achieve with the Stronger() proc, so I don't know what it's supposed to be, but probably src.Stronger(M).

On a side note, if you're going to delete the mob in the DeathCheck (because I see it isn't finished yet), then be sure to add a check when calling your Stronger() proc to see if M and src exist.
Or you could just call Stronger() in your DeathCheck(), when the mob isn't dead yet.
In response to Mysame
I want DeathCheck() to check if M's HP is equal to or lower than 0, and if so display the message and [other stuff].

I want Stronger() to give them the stat boosts...but not all the time (why rand() is there); but I want it to give the boost to the killer (src), not the killed (M).
In response to Hi1
src.Stronger(M) in your deathcheck, in an else, to make sure the mob isn't defeated.