48 #define NUMBER_OF_MONSTERS 5
51 #define PATHFINDING_RANDOM 0
52 #define PATHFINDING_SEARCHING 1
53 #define PATHFINDING_TOWARDS_PLAYER 2
54 #define PATHFINDING_AWAY_FROM_PLAYER 3
55 #define PATHFINDING_RECRUITING 4
61 #define RAT_SYMBOL 'r'
62 #define RAT_COLOR COLOR_GREEN
63 #define RAT_GOLD_MIN 1
64 #define RAT_GOLD_MAX 2
65 #define RAT_NOISE "squeaks and sniffles"
68 #define GOBLIN_HEALTH 30
69 #define GOBLIN_ATTACK 5
70 #define GOBLIN_DEFENSE 10
71 #define GOBLIN_SYMBOL 'g'
72 #define GOBLIN_COLOR COLOR_MAGENTA
73 #define GOBLIN_GOLD_MIN 1
74 #define GOBLIN_GOLD_MAX 3
75 #define GOBLIN_NOISE "robbing noises"
80 #define ORC_DEFENSE 20
81 #define ORC_SYMBOL 'o'
82 #define ORC_COLOR COLOR_RED
83 #define ORC_GOLD_MIN 2
84 #define ORC_GOLD_MAX 4
85 #define ORC_NOISE "grunts and growls"
88 #define TROLL_HEALTH 50
89 #define TROLL_ATTACK 10
90 #define TROLL_DEFENSE 30
91 #define TROLL_SYMBOL 't'
92 #define TROLL_COLOR COLOR_YELLOW
93 #define TROLL_GOLD_MIN 3
94 #define TROLL_GOLD_MAX 4
95 #define TROLL_NOISE "laughs and grunts"
98 #define DRAGON_HEALTH 60
99 #define DRAGON_ATTACK 20
100 #define DRAGON_DEFENSE 50
101 #define DRAGON_SYMBOL 'd'
102 #define DRAGON_COLOR COLOR_BLUE
103 #define DRAGON_GOLD_MIN 4
104 #define DRAGON_GOLD_MAX 5
105 #define DRAGON_NOISE "roars and growls"
107 Monster *
initMonster(
int x,
int y,
int health,
int attack,
int defense,
char symbol,
char *name,
int color,
int pathfinding,
int gold,
const char *noise,
int index);
void freeMonster(void *p)
Free the monster.
Definition: monster.c:515
void moveMonsters(State *st, Monster **monsters, int nMonsters)
Move all the monsters.
Definition: monster.c:476
void moveMonster(State *st, Monster *monster, int x, int y)
Move the monster to the given coordinates.
Definition: monster.c:168
struct monster Monster
Structure of a monster.
void drawMonsters(State *st)
Draw all the monsters on the map.
Definition: monster.c:151
Monster * initMonster(int x, int y, int health, int attack, int defense, char symbol, char *name, int color, int pathfinding, int gold, const char *noise, int index)
Initialize a new monster.
Definition: monster.c:29
Monster ** generateMonsters(Map *map)
Generate monsters array randomly.
Definition: monster.c:457
Structure that represents a map in the game.
Definition: map.h:26
Structure of a monster.
Definition: monster.h:28
int health
Definition: monster.h:31
int attack
Definition: monster.h:33
int max_health
Definition: monster.h:32
int color
Definition: monster.h:39
char symbol
Definition: monster.h:37
int defense
Definition: monster.h:34
unsigned int x
Definition: monster.h:29
int pathfinding
Definition: monster.h:41
int default_color
Definition: monster.h:40
char * name
Definition: monster.h:38
unsigned int y
Definition: monster.h:30
int is_alive
Definition: monster.h:36
int gold
Definition: monster.h:42
int index
Definition: monster.h:44
const char * noise
Definition: monster.h:43
Sructure of the game state.
Definition: state.h:38