functions.hpp 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. #ifndef _functions_
  2. #define _functions_
  3. //#includes here
  4. #include "definitions.hpp"
  5. #include "player.hpp"
  6. #include "bullet.hpp"
  7. #include "powerup.hpp"
  8. #include "enemy.hpp"
  9. #include "wall.hpp"
  10. #include "boss.hpp"
  11. typedef std::list<bullet> b_list;
  12. typedef std::list<enemy> e_list;
  13. typedef std::vector<wall> w_vec;
  14. typedef std::list<rocket> r_list;
  15. class record
  16. {
  17. public:
  18. int score;
  19. std::string nick;
  20. bool operator==(record& record2)
  21. {
  22. if(score==record2.score && nick==record2.nick)
  23. return true;
  24. else return false;
  25. }
  26. void print();
  27. void printwin(WINDOW*);
  28. void print(std::ofstream& record);
  29. };
  30. typedef std::list<bullet> b_list;
  31. typedef std::list<enemy> e_list;
  32. typedef std::vector<record> r_vec;
  33. typedef std::vector<wall> w_vec;
  34. void print_title();
  35. void print_catchphrase(std::string phrase);
  36. std::string choose_phrase();
  37. void print_info();
  38. void print_scores();
  39. int choose_level(int* commands);
  40. void setup_level(int level, double& shootr, int& refresh_t, boss& boss1, int& enemy_num, int* commands);
  41. void change_commands(int* commands);
  42. void load_enemies(e_list& enemies,int enemy_num);
  43. char playagain(WINDOW*);
  44. bool gameover(player&,b_list&);
  45. void reset(player&, e_list &, boss&, b_list& bullets, b_list& bombs, w_vec& walls, b_list &powerups,r_list&,char level,int& chflag);
  46. bool enemyalive(e_list &);
  47. void refreshrecords(int,WINDOW*);
  48. void write_score(WINDOW*,int);
  49. void write_bosshp(WINDOW*,int,int,std::string);
  50. void pause_game(int&);
  51. void Victory(std::string,int,char,int);
  52. void Defeat(int);
  53. int choose_level_bossrush(int* commands);
  54. void setup_level_bossrush(int level, double& shootr,int& refresh_t);
  55. void resetbosses(boss* Bosses,boss& boss1,player& player1);
  56. void Victory_bossrush(std::string,int,char,int);
  57. void refreshrecords_bossrush(int,WINDOW*);
  58. void print_scores_bossrush();
  59. void get_SpecialMode(int,int&,boss&,e_list&,b_list&,b_list&,b_list&,r_list&);
  60. bool get_KonamiCode(int);
  61. void get_cheat(char,player&,e_list&,double&);
  62. void activate_combo(boss&,e_list&,b_list&,b_list&,b_list&,r_list&);
  63. void drop_powerup(int x,int y,b_list& powerups);
  64. void interactions(player& player1,b_list& bullets,b_list& bombs,e_list& enemies,w_vec& walls,b_list& powerups,r_list& rockets,boss& boss1,int& score);
  65. void draw(player& player1,b_list& bullets,b_list& bombs,e_list& enemies,w_vec& walls,b_list& powerups,r_list& rockets,boss& boss1);
  66. void create_readme();
  67. void create_std_bosses();
  68. //void create_setsize();
  69. void create_folder(int);
  70. // FORK FUNCTIONS (unused)
  71. /*void music();
  72. void kill_music(int);*/
  73. /*//PTHREAD FUNCTIONS
  74. void *pmusic(void *arg);
  75. void *pshoot_sound(void* arg);
  76. void *penshoot_sound(void* arg);
  77. void *pwin_theme(void *arg);
  78. void *plose_theme(void* arg);
  79. void pkill_music(pthread_t);*/
  80. #endif