2017-11-30 21:00:47 +01:00
|
|
|
#ifndef PLAYER_H_
|
|
|
|
#define PLAYER_H_
|
|
|
|
|
|
|
|
#include <SDL2/SDL.h>
|
|
|
|
#include "sprite.h"
|
2017-12-12 11:20:08 +01:00
|
|
|
#include "stats.h"
|
2017-12-18 15:26:56 +01:00
|
|
|
#include "actiontext.h"
|
|
|
|
#include "camera.h"
|
2017-11-30 21:00:47 +01:00
|
|
|
|
|
|
|
enum PlayerClass { ENGINEER, MAGE, PALADIN, ROGUE, WARRIOR };
|
|
|
|
typedef enum PlayerClass class_t;
|
|
|
|
|
2017-12-15 08:08:45 +01:00
|
|
|
typedef struct Player_t {
|
2017-12-12 11:20:08 +01:00
|
|
|
Sprite *sprite;
|
2017-12-18 15:26:56 +01:00
|
|
|
ActionText *hitText;
|
|
|
|
ActionText *missText;
|
2017-12-12 11:20:08 +01:00
|
|
|
Stats stats;
|
2017-12-17 13:43:41 +01:00
|
|
|
unsigned int xp;
|
|
|
|
unsigned int total_steps;
|
|
|
|
unsigned int steps;
|
2017-12-21 08:31:25 +01:00
|
|
|
unsigned int hits;
|
|
|
|
unsigned int kills;
|
|
|
|
unsigned int misses;
|
2018-01-25 10:45:05 +01:00
|
|
|
double gold;
|
2017-12-15 08:08:45 +01:00
|
|
|
void (*handle_event)(struct Player_t*, RoomMatrix*, SDL_Event*);
|
2017-12-12 11:20:08 +01:00
|
|
|
} Player;
|
|
|
|
|
2018-01-30 15:16:14 +01:00
|
|
|
Player*
|
|
|
|
player_create(class_t, SDL_Renderer*);
|
2017-12-12 11:20:08 +01:00
|
|
|
|
2018-01-30 15:16:14 +01:00
|
|
|
void
|
|
|
|
player_hit(Player*, unsigned int dmg);
|
2017-12-18 15:26:56 +01:00
|
|
|
|
2018-01-30 15:16:14 +01:00
|
|
|
void
|
|
|
|
player_reset_steps(Player*);
|
2017-12-18 15:26:56 +01:00
|
|
|
|
2018-01-30 15:16:14 +01:00
|
|
|
void
|
|
|
|
player_render(Player*, Camera*);
|
2017-12-17 13:43:41 +01:00
|
|
|
|
2018-01-30 15:16:14 +01:00
|
|
|
void
|
|
|
|
player_destroy(Player*);
|
2017-11-30 21:00:47 +01:00
|
|
|
|
|
|
|
#endif // PLAYER_H_
|