DungeonCrawl
Loading...
Searching...
No Matches
player.c
Go to the documentation of this file.
1
5
6#include "player.h"
7
9 NULL_PTR_HANDLER_RETURN(memory_pool, NULL, "Player", "Memory pool is NULL");
10
11 character_t* player = init_character(memory_pool, PLAYER, "Hero");
12 NULL_PTR_HANDLER_RETURN(player, NULL, "Player", "Failed to allocate memory for player");
13
14 set_character_stats(player, 5, 5, 5, 10);
15 set_initial_xp(player, 0);
16 set_level(player, 1);
17 set_skill_points(player, 5);
18 return player;
19}
void set_character_stats(character_t *character, int strength, int intelligence, int dexterity, int constitution)
Sets the stats for a character.
Definition character.c:66
character_t * init_character(memory_pool_t *memory_pool, const character_type_t type, const char *name)
Initializes a new character.
Definition character.c:13
void set_skill_points(character_t *character, int skill_points)
Sets the skill points for a character.
Definition character.c:315
void set_level(character_t *character, int level)
Sets the level for a character.
Definition character.c:305
void set_initial_xp(character_t *character, int xp)
sets initial xp for a character
Definition character.c:300
character_t * create_new_player(memory_pool_t *memory_pool)
Creates and initializes a new player character.
Definition player.c:8
Exposes functions for working with the player.