mob/proc/levelup()
if(exp>=mexp)
usr.exp=0
usr.Level+=1
usr.expgain()
mob
Beetle
icon = 'monster.dmi'
icon_state = "1"
Str = 35
Hp = 25
expgive=100
//We will begin Wandering and try to target the mob
var/mob/Target
New()
..()
spawn(5)
src.Wander()
proc
Wander()
while(src)
sleep(5)
for(var/mob/M in oview()) // how far you want the enemy to target a player
src.Target = M
break
if(src.Target) .
walk_towards(src,Target,5)
else
walk_rand(src,5)
//Here we will actually get the mob to attack.
Bump(mob/M)
if(istype(M,/mob))
var/damage = round(usr.Str/5)
if(damage <=0)
damage = 2
M.Hp -= damage
view() << "The [src] attacks [M] for [damage] damage!"
M.deathcheck(src)
if(src.Hp <=0)
M.exp += src.expgive
del(src)
Problem description:
i want the monsters that i kill to give my charecter exp but when i get the exp it always goes over the max exp. like 100/50 100 being the exp and 50 being the max exp. when i killed a monster that gives 100 exp and i got 50 max exp it goes over it and doesnt gain a level. any help will be appreciated greatly :)