Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct Skill
- {
- float timePassed;
- };
- Skill* get_skill(Entity* entity, int skillID)
- {
- if(entity.type == TYPE_HERO)
- {
- for(int skillIdx = 0; skillIdx < heroStates[entity.heroStateIndex].skillCount; skillIdx++)
- {
- if(heroStates[entity.heroStateIndex].skills[skillIndex].id == skillID)
- {
- // this hero has the queried skill, return it somehow
- // return &entity.skills[???];
- }
- }
- }
- if(entity.type == TYPE_ENEMY)
- {
- // idk how enemy skills work, maybe they are based on the enemy type?
- // so switch on the type
- // return &entity.skills[??];
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement