RogueLife/src/player.h

28 lines
677 B
C

//---
// player: Dynamic player information
//---
#pragma once
#include "comp/entity.h"
#include "comp/mechanical.h"
#include "comp/fighter.h"
#include <stdbool.h>
typedef struct {
/* Associated entity */
entity_t *entity;
/* Mechanical limits (dynamically recomputed) */
mechanical_limits_t mechanical_limits;
/* Fighter model (dynamically recomputed) */
fighter_stat_model_t stat_model;
/* Experience level, total to next level, current points (within level) */
int xp_level;
int xp_to_next_level;
int xp_current;
} player_t;
/* Add XP points to a player. Returns true if levels up */
bool player_add_xp(player_t *p, int points);