LI2 Roguelite
combat.h
Go to the documentation of this file.
1 #ifndef _COMBAT_H_
2 #define _COMBAT_H_
3 
4 typedef struct state State;
5 typedef struct map Map;
6 typedef struct projectile Projectile;
7 typedef struct monster Monster;
8 
9 #define MAX_PROJECTILES 20
10 
11 void throwRock(State *st);
12 void throwProjectile(State *st);
13 void drawProjectiles(Map *map);
14 void updateProjectiles(State *st);
15 void freeProjectile(void *p);
16 void killMonster(State *st, int x, int y);
17 int calculateDamage(int attack, int defense, int turn);
20 
21 #endif
void drawProjectiles(Map *map)
Draw all visible projectiles.
Definition: combat.c:332
void playerAttacksMonster(State *st, Monster *monster)
Function that attacks a monster first.
Definition: combat.c:445
int calculateDamage(int attack, int defense, int turn)
Calculates the damage of an attack.
Definition: combat.c:397
void updateProjectiles(State *st)
Definition: combat.c:220
void killMonster(State *st, int x, int y)
Function to kill a monster with his coordinates.
Definition: combat.c:351
void freeProjectile(void *p)
Definition: combat.c:229
void throwRock(State *st)
Function to throw a rock projectile.
Definition: combat.c:250
void monsterAttacksPlayer(State *st, Monster *monster)
Function that attacks a player first.
Definition: combat.c:414
void throwProjectile(State *st)
Definition: combat.c:307
Structure that represents a map in the game.
Definition: map.h:26
Structure of a monster.
Definition: monster.h:28
int attack
Definition: monster.h:33
int defense
Definition: monster.h:34
unsigned int x
Definition: monster.h:29
unsigned int y
Definition: monster.h:30
(private) Structure of a thrown projectile
Definition: combat.c:24
Sructure of the game state.
Definition: state.h:38