There I was illustrating the skill-belongs-to-skillset idea, yes. And within that, skills would often have a %-learned attribute to them, as you've noted.
But what I'm not quite understanding is how the skill sets, spell books, abilities, etc. get attached to a given character. How can multiple such sets be attached to one character? I know it's getting off into the weeds a bit, but I'm just trying to understand; when I look at a skill set's code, will it be within a character's scope, or will it be within its own scope? Surely the data for how to execute the attack would be within the actual skill's scope, but ownership of that skill would not-- Two character's both know Blizzard, but the data for how to do Blizzard doesn't belong to either of them.
I think I just answered my own question, actually. It would end up looking something like this:
Character{
...
SpellBook[Max_spells]
SkillSet[Max_skills]
}
When issuing a command, we need to know what abilities the character has, for menus at the top level but also for building any submenus.
for (int i = 0; i < Max_spells; i++)
{
if SpellBook[i].isKnown() MasterSpellList[SpellBook[i].GetID()].DisplayName();
}
Executing a spell is gonna need to know caster and target, for damage calculations, so at that point, both of those things are known:
FigureSpellDamage(Entity caster, Entity target, Spell spell)
{
return caster.GetPower()* spell.GetEffectivity() - target.GetMagDef()
)
I guess my only real question here is how to have characters with open-ended lists of ability sets?