Check for level up? in Developer Help
|
|
Code:
mob icon = 'person.dmi' bug icon = 'bug.dmi' HP = 5 mxp = 1 def = 0 var HP = 30 wealth = 0 level = 1 xp = 0 str = 3 mxp = 0 def = 3 proc DeathCheck() if (HP <= 0) world << "[src] was killed by [usr]!" del(src) usr.xp += src.mxp proc LevelCheck() if (xp == 2) usr << "You leveled up! You are now level [level]!" str += 1 xp -= 99 Del() var/obj/gold/G = new(loc) G.amount = rand(1,100) ..() Login() icon_state = gender usr << "Welcome to Cypher Wars!" world << "[usr] has logged in." ..() verb attack(mob/M as mob in oview(1)) if (M.HP <=0) usr << "[M] is already dead!" else usr << "You attack [M]!" oview() << "[usr] attacks [M]!" var/dmg=usr.str-M.def world << "[dmg] damage!" M.HP -= dmg M.DeathCheck() usr.LevelCheck() say(msg as text) world << "[usr]: [msg]" check() usr << "You have [wealth] gold." usr << "You are level [level]. You have [xp] xp. You have [str] strentgth."
|
Thats all that matters.
Problem description:
Okay, so i try to level up. I go kill a few bugs, but i still don't level up, and the check msg says i still have 0 xp. What can i do?
|