123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146 |
- /* This file is part of Invaders.
- *
- * Copyright (C) 2020 LCM.
- * You may use, distribute and modify Invaders under the terms of the
- * GPLv3 license, available at <https://www.gnu.org/licenses/\>.
- */
- #ifndef _functions_
- #define _functions_
- //#includes here
- #include "definitions.hpp"
- #include "player.hpp"
- #include "bullet.hpp"
- #include "powerup.hpp"
- #include "enemy.hpp"
- #include "wall.hpp"
- #include "boss.hpp"
- typedef std::list<bullet> b_list;
- typedef std::list<enemy> e_list;
- typedef std::vector<wall> w_vec;
- typedef std::list<rocket> r_list;
- class record
- {
- public:
- int score;
- std::string nick;
- bool operator==(record& record2)
- {
- if(score==record2.score && nick==record2.nick)
- return true;
- else return false;
- }
-
-
- void print();
-
- void printwin(WINDOW*);
- void print(std::ofstream& record);
-
- };
- typedef std::list<bullet> b_list;
- typedef std::list<enemy> e_list;
- typedef std::vector<record> r_vec;
- typedef std::vector<wall> w_vec;
- void print_title();
- void print_catchphrase(std::string phrase);
- std::string choose_phrase();
- void print_info();
- void print_scores();
- int choose_level(int* commands);
- void setup_level(int level, double& shootr, double& poweruprate, int& refresh_t, boss& boss1, int& enemy_num, int& walls_num);
- void change_commands(int* commands);
- void load_enemies(e_list& enemies,int enemy_num);
- char playagain(WINDOW*);
- bool gameover(player&,b_list&);
- void reset(player&, e_list &, boss&, b_list& bullets, b_list& bombs, w_vec& walls, int walls_num, b_list &powerups, r_list&, int& chflag);
- bool enemyalive(e_list &);
- void refreshrecords(int,WINDOW*);
- void write_score(WINDOW*,int);
- void write_bosshp(WINDOW*,int,int,std::string);
- void pause_game(int&);
- void Victory(std::string,int,int,int);
- void Defeat(int);
- int choose_level_bossrush(int* commands);
- void setup_level_bossrush(int level, double& shootr, double& poweruprate, int& walls_num, int& refresh_t);
- void resetbosses(boss* Bosses,boss& boss1,player& player1);
- void Victory_bossrush(std::string,int,int,int);
- void refreshrecords_bossrush(int,WINDOW*);
- void print_scores_bossrush();
- void get_SpecialMode(int,int&,boss&,e_list&,b_list&,b_list&,r_list&);
- bool get_KonamiCode(int);
- void get_cheat(char,player&,e_list&,double&);
- void activate_combo(boss&,e_list&,b_list&,b_list&,r_list&);
- void drop_powerup(int x,int y,b_list& powerups);
- 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, double poweruprate);
- void draw(player& player1,b_list& bullets,b_list& bombs,e_list& enemies,w_vec& walls,b_list& powerups,r_list& rockets,boss& boss1);
- void create_readme();
- void create_std_bosses();
- //void create_setsize();
- void create_folder(int);
- // FORK FUNCTIONS (unused)
- /*void music();
- void kill_music(int);*/
- /*//PTHREAD FUNCTIONS
- void *pmusic(void *arg);
- void *pshoot_sound(void* arg);
- void *penshoot_sound(void* arg);
- void *pwin_theme(void *arg);
- void *plose_theme(void* arg);
- void pkill_music(pthread_t);*/
- #endif
|