ID:177089
Nov 6 2002, 6:27 pm
|
|
ok im making a game, i have several classes, BUT how can i make the level up proc be different with each class?...
|
In response to Mrhat99au
|
|
Mrhat99au wrote:
mob 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 ..() -AbyssDragon |
In response to AbyssDragon
|
|
I prefer to make the classes objects themselves. For example
datum/Class and add them to the mob like so: mob |
In response to Garthor
|
|
Garthor wrote:
Also, you might want to remember that it's "medieval," Maybe he has a more 'evil' style of Medieval gaming? |
In response to digitalmouse
|
|
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?
|
In response to Mrhat99au
|
|
MrHat - try now....and you could have easily emailed me with this instead of completely de-railing the thread, ya know... =p
|
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