2021-07-29 18:33:22 +02:00
|
|
|
#pragma once
|
2021-07-31 18:44:06 +02:00
|
|
|
#include "animation.h"
|
2021-08-07 01:49:03 +02:00
|
|
|
#include "engine.h"
|
2021-08-25 01:01:43 +02:00
|
|
|
#include "vec2.h"
|
2022-01-23 00:53:07 +01:00
|
|
|
#include "stats.h"
|
2022-01-24 15:15:12 +01:00
|
|
|
#include "capacite.h"
|
2022-04-18 00:06:32 +02:00
|
|
|
#include "inventory.h"
|
2022-01-27 23:53:10 +01:00
|
|
|
#include "define.h"
|
2022-05-11 00:37:56 +02:00
|
|
|
#include "type.h"
|
2021-07-31 18:44:06 +02:00
|
|
|
|
2021-08-15 03:46:49 +02:00
|
|
|
struct Player {
|
2021-08-19 02:29:51 +02:00
|
|
|
/*current position of the player on the map - Tile*/
|
2021-08-25 01:01:43 +02:00
|
|
|
struct Vec2 pos;
|
|
|
|
/*current position of the player on the map - pixels */
|
|
|
|
struct Vec2f pos_visual;
|
2022-01-23 00:53:07 +01:00
|
|
|
|
2022-02-13 21:46:52 +01:00
|
|
|
const struct Stats base_stats;
|
2022-01-23 00:53:07 +01:00
|
|
|
struct Stats stats;
|
2022-02-15 21:46:53 +01:00
|
|
|
struct Move *moves[NB_PLAYER_MOVES];
|
2022-04-18 00:06:32 +02:00
|
|
|
struct Inventory inventory;
|
2022-05-11 00:37:56 +02:00
|
|
|
struct Type type;
|
2021-08-19 02:29:51 +02:00
|
|
|
/*player mid - offset pixels*/
|
|
|
|
int x_mid, y_mid;
|
2021-08-08 01:43:26 +02:00
|
|
|
/*the direction the player facing to*/
|
2021-07-29 18:33:22 +02:00
|
|
|
int direction;
|
2021-12-23 18:37:48 +01:00
|
|
|
/*if the player is sprinting*/
|
|
|
|
int sprint;
|
2021-08-08 01:43:26 +02:00
|
|
|
/*current frame of the animation*/
|
2021-07-29 18:33:22 +02:00
|
|
|
int frame;
|
2021-08-08 01:43:26 +02:00
|
|
|
/*where to draw the player on the screen*/
|
2021-08-04 20:12:53 +02:00
|
|
|
int show_x, show_y;
|
2021-08-08 01:43:26 +02:00
|
|
|
/*the current animation*/
|
2021-07-31 18:44:06 +02:00
|
|
|
int idle;
|
2021-08-15 03:46:49 +02:00
|
|
|
struct AnimData anim;
|
2022-05-22 16:46:31 +02:00
|
|
|
int eventListZone[NB_STO_ZONE];
|
2022-05-22 23:58:00 +02:00
|
|
|
int eventListDialog[NB_STO_DIALOG];
|
2021-07-29 18:33:22 +02:00
|
|
|
};
|
|
|
|
|
2022-03-23 01:16:24 +01:00
|
|
|
struct LevelUp {
|
|
|
|
int level;
|
|
|
|
int id_move;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct LevelUpPlayer {
|
|
|
|
int nbLevelUp;
|
|
|
|
struct LevelUp *levelup[];
|
|
|
|
};
|
|
|
|
|
2021-08-08 01:43:26 +02:00
|
|
|
/*return the info tile value the player is facing to*/
|
2021-08-15 03:46:49 +02:00
|
|
|
int player_facing(struct Game const *game);
|
2021-08-27 02:11:05 +02:00
|
|
|
struct Player init_player(void);
|
2022-01-24 21:27:51 +01:00
|
|
|
void add_move(struct Player *player, struct Move move);
|
2022-01-24 23:57:07 +01:00
|
|
|
void draw_player_moves(struct Player *player);
|
2022-01-25 22:20:10 +01:00
|
|
|
void replace_capacities(struct Player *player, struct Move move);
|
2022-05-22 16:46:31 +02:00
|
|
|
void draw_ui(struct Player *player, int curr_select);
|
2022-02-17 01:04:45 +01:00
|
|
|
int get_nb_moves(struct Player *player);
|
2022-03-23 01:16:24 +01:00
|
|
|
void reset_pp(struct Player *player);
|
2022-04-02 01:57:54 +02:00
|
|
|
void check_level(struct Player *player, int prec_level);
|
2022-04-23 00:47:27 +02:00
|
|
|
void add_xp(struct Player *player, int xp);
|
|
|
|
int select_capacity(struct Player *player, char* context, bool allow_back);
|
2022-07-05 18:27:28 +02:00
|
|
|
bool add_pp(struct Player *player, int amount);
|
2022-05-16 23:57:25 +02:00
|
|
|
void change_type(struct Player *player, struct Type type);
|
2022-05-22 16:46:31 +02:00
|
|
|
bool has_move(struct Player *player, struct Move move);
|
|
|
|
int get_nb_eventzone(struct Player *player);
|
2022-05-22 23:58:00 +02:00
|
|
|
bool check_eventzone(struct Player *player, int id);
|
|
|
|
int get_nb_eventdialog(struct Player *player);
|
2022-05-26 18:47:58 +02:00
|
|
|
bool check_eventdialog(struct Player *player, int id);
|
2022-07-05 18:27:28 +02:00
|
|
|
void player_step_back(struct Player *player);
|
|
|
|
bool has_pp_left(struct Player *player);
|