ID:149527
 
Here's what I'm trying to do. I'm incorporating a system based on Wizards of the Cost's d20 system. I've gotten most of it coded, but I'm running up short with the skill system. I'm not entirely sure how best to put it in. Here's the basic formula for a skill level

Skill total = skill ranks + ability bonus + misc bonus

Skill ranks are bought with skill points and the ability bonus is determined by the skill's key ability. For example, jump's key ability is STR (strength).

There's around 30-40 skills in the system, and several of them can be taken more than once to represent different areas of ability. Knowledge (coding) would be an example.

To make matters a little more interesting, each class has certain 'class skills' that can be bought at 1 SP per level, and everything else is considered either cross class (2 SP/ level) or non-learnable.

One other thing, certain skills can be used 'untrained', that is without buying ranks in them.

Now, here's my problem. The easiest thing to do would be making skills into a list variable for the players. Unfortunately, I don't know enough about the intricacies of the list variable to know how to put all that information into a list (Lists are one of my weak areas).

If anyone can give me some ideas, maybe a push in the right direction, I'd really appreciate it. I've been trying my own ideas for the past couple of months and have been getting no-where.

Thanks in advance =)

-Sapphiremagus
I think for this you're going to need a specialized datum. Try something like this:
skill
var/SP=1 // points per level to "buy"
var/level=1
var/maxlevel // highest level attainable
var/ability // special ability (like "STR")
var/bonus // bonus to ability per level (like 5, for +5 Str)
var/list/prereq // prerequisite skills (needed to learn this)
var/list/class // character classes who can use this

proc/CanUse(_class) // call CanUse(/mob/trader), for example
if(!class) return 1 // anyone can use it
if(_class in class) return 1
return 0 // sorry, not in the list

proc/CanLearn(mob/M)
if(!CanUse(M.type)) return 0
if(!prereq) return 1
if(!M.skills) return 0
for(var/skill/S in prereq)
if(!(locate(S.type) in M.skills)) return 0
return 1

proc/CanUpgrade() // assume it's the right char class
if(maxlevel>0 && maxlevel<=SP) return 0 // no
return 1

skill/jump
maxlevel=3
ability="jump"
bonus=1

mob
var/list/skills

// this proc returns the skill if it can be learned
// or null if it can't
proc/LearnSkill(skilltype)
var/skill/S
if(skills)
S=locate(skilltype) in skills
if(S)
if(!S.CanUpgrade(src)) return null
++S.level
return S
S=new skilltype
if(!S.CanLearn(src)) return null
if(!skills) skills=list()
skills+=S

Lummox JR
In response to Lummox JR
Hmmm. . . . that's an interesting idea. Thanks lummox. The only problem with it is that the max level of a skill is determined by the characters level and whether it's a cross class skill or not. But that's easy enough to modify =) Thanks alot