client/proc
load_tree(t)
var/skilltree/proto
switch(t)
//gotta be a better way of doing this..
if("Demon") proto=mob.dem
if("Human")proto=mob.hum
for(var/posy=1 to proto.layout.len)
//y value
var/list/li=proto.layout[posy]
for(var/posx=1 to li.len)
//x value
if(li[posx])
//don't want to spam null errors
var/skill/s=li[posx]
if(istype(s,/skill/arrow))
screen += new s
return
var/skill/ns=new s("[CURRENT_SCHEME]")
/*
var/skill/ns=new s("skilltree:[li.len-posx],[proto.layout.len-posy]")
This will make it go from right to left
var/skill/ns=new s("skilltree:[proto.layout.len-posy],[li.len-posx]")
This will make it go from top to bottom
var/skill/ns=new s("skilltree:[posx-1],[posy-1]")
This will make it go from left to right
var/skill/ns=new s("skilltree:[posy-1],[posx-1]")
This will make it go from bottom to top
*/
screen += ns
//thank you, lummox's demo - I like the idea of overriding new() for this purpose
if(!(locate(ns.type) in mob.skills))
//you haven't learned me yet
if(ns.reqskill)
//do we require a skill?
if(!(locate(ns.reqskill) in mob.skills))
//we don't have the required skill.. sadface
ns.overlays += new/skill/unbuyable
else
var/tskill=locate(ns.reqskill) in mob.skills
if(tskill)
if(mob.skills[tskill]<ns.reqskilllvl)
//you can't buy it if it has a level requirement and your level isn't high enough.
ns.overlays += new/skill/unbuyable
else
ns.overlays += new/skill/available
else
//this should never occur.
world << "Oddity here"
else
ns.overlays += new/skill/available
else
//verification that it exists
var/tskill=locate(ns.type) in mob.skills
if(tskill)
ns.curlevel=mob.skills[tskill]
//we want to show it's a maxxed out skill!
if(ns.curlevel>=ns.maxlevel)
ns.overlays+=new/skill/completed
Problem description:
What I wanna do is call this proc with a button so that players can buy skills whenever they gain the skill points