forked from NotAShelf/rogged
various: consolidate game state into a GameState struct
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I9d8998707c02e64cf177a6eeb51e399e6a6a6964
This commit is contained in:
parent
d3798cc99f
commit
786fce3814
13 changed files with 105 additions and 102 deletions
12
src/combat.c
12
src/combat.c
|
|
@ -11,11 +11,17 @@ typedef struct {
|
|||
|
||||
static CombatEvent last_event = {NULL, 0, 0};
|
||||
|
||||
const char *combat_get_last_message(void) { return last_event.message; }
|
||||
const char *combat_get_last_message(void) {
|
||||
return last_event.message;
|
||||
}
|
||||
|
||||
int combat_get_last_damage(void) { return last_event.damage; }
|
||||
int combat_get_last_damage(void) {
|
||||
return last_event.damage;
|
||||
}
|
||||
|
||||
int combat_was_player_damage(void) { return last_event.is_player_damage; }
|
||||
int combat_was_player_damage(void) {
|
||||
return last_event.is_player_damage;
|
||||
}
|
||||
|
||||
void combat_player_attack(Player *p, Enemy *e) {
|
||||
if (e == NULL || !e->alive)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue