ID:143569
 
Code: Level Up
    var/list/spells
...
New()
..()
spells=list() // this is a list of spells you can learn at different levels
var/list/level_learned_spells=list(
"Wind"=1, // learn "Heal" at level 3
"Water"=5, // learn "Fire" at level 5
"Earth"=10) // learn "Maim" at level 10
...
proc/LevelUp()
++level
src << "Welcome to level [level]."
for(var/thespell in level_learned_spells)
if(level>=level_learned_spells[thespell])
if(!(thespell in spells))
src << "You learn the [thespell] spell."
spells+=thespell

    proc
Levelup()
if(src.exp>=src.maxexp)//If your exp var equals, or passes your maxexp var
src.level++//Add to your level
src.exp=0//resets your exp to 0
src.maxexp*=2//makes your maxexp double
src<<"You gained a level!"
src.Statup()
else
..()//defaults if the if() doesn't return it's arguments

proc
Statup()
src.maxhealth+=20//adds to your health
src.health=src.maxhealth
src<<"Your stats increase!"//Outputs a message telling you that you gained stats

var
health = 100//Makes a var called health and gives it the value 100
maxhealth = 100
exp = 0
maxexp = 1000
level = 1


Problem description:This codes are great for my game but I need them to work together. What I want my Level up code to do is increase magic(for new spells), str(for more damage), atk(for new weapons), range(for new bows), stealth(for agility),ninjutus, genjutus, taijutus, prayer(for monk spells) and, health points. Could anyone help me with this?

How Do I get this to work with....
    Del()
var/obj/Gold/G = new(loc)
G.amount = rand(1,100)
..()


...this?

obj
Gold
icon = 'Gold.dmi'
Large_Amount
icon_state = "Large"
Medium_Amount
icon_state = "Medium"
Small_Amount
icon_state = "Small"
var
amount


Also how would you use the write proc(datum) and the read proc (datum)in a code? To save peoples character?