summaryrefslogtreecommitdiff
path: root/players.h
blob: 062bde5b1784c145f7088ea592c1e13630ad6876 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#ifndef PLAYERS_H
#define PLAYERS_H

#include <stdbool.h>
#include <SDL/SDL.h>

#include "constantes.h"
#include "structures.h"

struct character_t {
    struct team_t *team;

    int idx;

    enum character_class_t class_;

    char *name;
    bool cpu;

    union {
        struct ally_t ally;
        struct enemy_t enemy;
    };

    SDL_Surface *def_surf;
    SDL_Surface *red_surf;

    SDL_Surface *surf;

    SDL_Surface *curs;

    SDL_Rect pos;
    SDL_Rect pos_hp;
    SDL_Rect pos_mp;
    SDL_Rect pos_curs;

    bool alive;

    int hp;
    int max_hp;
    int mp;
    int max_mp;
    int magic;
    int strength;
    int defense;
    int spirit;

    /* one for each element */
    enum affinity_t affinities[ELEMENT_COUNT];
};

struct team_t {
    bool cpu;
    int chr_cnt;
    int chr_cur;

    char *name;

    struct character_t *chrs;

    struct objects_t objects;
};

struct stats_base_class_t {
    int hp;
    int mp;
    int magic;
    int strength;
    int defense;
    int spirit;
};

extern struct stats_base_class_t base_stats_g[CLASS_CNT];

#endif /* PLAYERS_H */