/* 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 . */ #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 b_list; typedef std::list e_list; typedef std::vector w_vec; typedef std::list 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 b_list; typedef std::list e_list; typedef std::vector r_vec; typedef std::vector 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, int* commands); 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,char,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,char,int); void refreshrecords_bossrush(int,WINDOW*); void print_scores_bossrush(); void get_SpecialMode(int,int&,boss&,e_list&,b_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&,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