Advertisement
Tkap1

Untitled

Dec 29th, 2022
1,154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.58 KB | None | 0 0
  1.  
  2. struct Skill
  3. {
  4.     float timePassed;
  5. };
  6.  
  7. Skill* get_skill(Entity* entity, int skillID)
  8. {
  9.     if(entity.type == TYPE_HERO)
  10.     {
  11.         for(int skillIdx = 0; skillIdx < heroStates[entity.heroStateIndex].skillCount; skillIdx++)
  12.         {
  13.             if(heroStates[entity.heroStateIndex].skills[skillIndex].id == skillID)
  14.             {
  15.                 // this hero has the queried skill, return it somehow
  16.                 // return &entity.skills[???];
  17.             }
  18.         }
  19.     }
  20.     if(entity.type == TYPE_ENEMY)
  21.     {
  22.         // idk how enemy skills work, maybe they are based on the enemy type?
  23.         // so switch on the type
  24.         // return &entity.skills[??];
  25.     }
  26. }
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement