DungeonCrawl
|
Declares functions and globals for initializing, resetting, and freeing game data such as player, goblin, abilities, and potions. More...
Go to the source code of this file.
Functions | |
int | init_game_data (void) |
Initializes game data for the application. | |
int | free_game_data (void) |
Frees game-related data structures and resources, such as ability tables, characters, and potions, by using the provided memory pool. | |
int | reset_goblin (void) |
Resets the goblin character data by deallocating the current goblin instance and creating a new one. | |
int | init_player (char *name) |
Initializes the player character with default abilities and items. | |
int | reset_player (void) |
Resets the player character to its initial state, clearing all abilities, items, and stats. |
Variables | |
ability_table_t * | ability_table |
character_t * | goblin |
character_t * | player |
potion_t * | healing_potion |
gear_table_t * | gear_table |
potion_table_t * | potion_table |
Declares functions and globals for initializing, resetting, and freeing game data such as player, goblin, abilities, and potions.
Definition in file game_data.h.
int free_game_data | ( | void | ) |
Frees game-related data structures and resources, such as ability tables, characters, and potions, by using the provided memory pool.
Definition at line 37 of file game_data.c.
int init_game_data | ( | void | ) |
Initializes game data for the application.
This function sets up the game data structures, including the ability table, potion table, gear table, and player character. It also initializes the goblin character and adds potions to the player.
Definition at line 23 of file game_data.c.
int init_player | ( | char * | name | ) |
Initializes the player character with default abilities and items.
This function sets up the player with a base attack ability, adds default potions, and equips a starting piece of gear. It is used to prepare the player only for a new game.
name | The name of the player character. |
Definition at line 57 of file game_data.c.
int reset_goblin | ( | void | ) |
Resets the goblin character data by deallocating the current goblin instance and creating a new one.
The new goblin is initialized and assigned with the "BITE" ability.
Definition at line 46 of file game_data.c.
int reset_player | ( | void | ) |
Resets the player character to its initial state, clearing all abilities, items, and stats.
This function is used when loading a saved game.
Definition at line 77 of file game_data.c.
|
extern |
Definition at line 17 of file game_data.c.
|
extern |
Definition at line 19 of file game_data.c.
|
extern |
Definition at line 20 of file game_data.c.
|
extern |
Definition at line 21 of file game_data.c.
|
extern |
Definition at line 18 of file game_data.c.