mob/proc
expGain(mob/M)
var/difference = M.Level - Level
if(difference>= -6)
switch(difference)
if(-6)
src<<"+7 experience"
return 7
if(-5)
src<<"+14 experience"
return 14
if(-4)
src<<"+21 experience"
return 21
if(-3)
src<<"+28 experience"
return 28
if(-2)
src<<"+35 experience"
return 35
if(-1)
src<<"+42 experience"
return 42
if(0)
src<<"+49 experience"
return 49
else
src<<"+[7*difference] experience"
return 7*difference
else src<<"+0 expience"
So is there a more efficient way of doing that little tidit?</6>
I'm not sure that you intend your proc to work the way it does. Correct me if you do. Here's a table of experience gains by delta:
If you do want to drop back down at difference=1, you'd have to modify my snippet above like so: