bug //new prototype
icon = 'bug.dmi' //override the parent's icon, which was 'person.dmi'
HP = 60 //define a new variable called HP, with a value of 20
MP = 5 //define a new variable called MP, with a value of 5
AGI = 1 //define a new variable called AGI, with a value of 1
ATK = 5 //define a new variable called ATK, with a value of 5
EXP = 100 //define a new variable called EXP, with a value of 100
exp_max = 100 //define a new variable called exp_max, with a valure of 100
CHA = 1 //define a new variable called CHA, with a value of 1
DEF = 5 //define a new variable called DEF, with a value of 5
LEA = 1 //define a new variable called LEA, with a value of 1
LUK = 1 //define a new variable called LUK, with a value of 1
INT = 1 //define a new variable called INT, with a value of 1
STR = 5 //define a new variable called STR, with a value of 5
WIS = 1 //define a new variable called WIS, with a value of 1
And then the attack code
verb
attack(mob/M as mob in oview(1))
if (M.HP <= 0) //if M's HP are at or below 0...
usr << "[M] is already dead!"
del(src)
if (M.HP <- 0)
usr << "[M] is already dead!"
del(src)
else //otherwise...
usr << "You attack [M]!"
oview() << "[usr] attacks [M]!"
var/damage = rand(150,1500)
world << "[damage] damage dealt out!"
M.HP -= damage
usr.EXP += M.EXP
usr.exp_max += 100
M.DeathCheck()
del(M)
DeathCheck()
if (HP <= 0)
world << "[src] dies!"
world << "[usr] gains [EXP]!"
del(M)
del(src) //delete whatever just died
And now the levelup code
mob/proc/Check_Level()
if(src.EXP >= src.exp_max)
src.Level_Up()
return
mob/proc/Level_Up()
src.level += 1 // I added in the level and HP for ex
src.HP += rand(20,100)
src.MP += rand(10, 50)
src.AGI += rand(1, 10)
src.ATK += rand(1, 10)
src.CHA += rand(1, 10)
src.DEF += rand(1, 10)
src.LEA += rand(1, 10)
src.LUK += rand(1, 10)
src.INT += rand(1, 10)
src.STR += rand(1, 10)
src.WIS += rand(1, 10)
This all work out good yeah? just need mob fix to get XP