New to Game Programming, Sub: Creating RPG Skills

Started by
10 comments, last by alnite 11 years, 11 months ago
I'd do it this way, so I can have an array of ISkill in the Actor class, and just iterates through it every frame calling applySkill(this);[/quote]

Getting a little lost again, probably due to my limited c++ experience. Are you talking about an array which holds each skill known by the actor? It's the latter half of the sentence that has me thrown, particularly the bold. From what I understand, I'd have to make an object of a class (say, UberFireball TheSkill;), then add TheSkill to the array of ISkill (maybe ISkill LearnSkills[5];). I'm using a vector to hold my skills at the moment. But yeah, uh, I think I'm way off here and what you said has something to do with actually executing the skill.

Thanks for your patience man, I'm learning a lot.
Advertisement

I'd do it this way, so I can have an array of ISkill in the Actor class, and just iterates through it every frame calling applySkill(this);


Getting a little lost again, probably due to my limited c++ experience. Are you talking about an array which holds each skill known by the actor?
[/quote]

Sorry for the confusion. We were talking about status effects. So a character may have a couple of those at a given time (e.g. poisoned, diseased, and haste). Each character then will have a list of the currently active status effects, and you would need to iterate through this list once every frame to 'update' the effect.


std::vector<ISkill*> status_effects;
for (ISkill* s : status_effects) {
s->applySkill(this);
}

This topic is closed to new replies.

Advertisement