While this is perfectly acceptable, it's a little neater if you use object inheritance to handle differences in levelling up. I would change this to:
mob
var/class
proc/levelup()
//do whatever happens to ALL classes upon levelup
Fighter
class = "Fighter"
levelup()
//do whatever happens to just Fighters
return ..() //neccessary to do default stuff
Mage
class = "Mage"
levelup()
//do whatever happens to just Mages
return ..()
I prefer to make the classes objects themselves. For example
datum/Class proc Level_Up() //Customize here
and add them to the mob like so:
<dm>
mob
var
datum/Class = new datum/Class/Fighter()
<dm>
That way, you can keep your classes and code for them seperate and managable apart from your mob code. Not much difference than using simple inheritances, but it does add a level of seperation. But, that's just my personal preference.
Hey digitalmouse, i subcribed to your site and i cant download that map thing, it says im not subscribed to digitalmouse.programmingthings. How do you subscribe?
var/class = "None"
Fighter
class = "Fighter"
Mage
class = "Mage"
mob/proc/levelup()
if(usr.class = "Fighter")
//do something
if(usr.class = "Mage")
//do something else