DungeonCrawl
|
Implements functionality for the inventory mode. More...
#include "inventory_mode.h"
#include "../character/character.h"
#include "../common.h"
#include "../game.h"
#include "../io/input/input_handler.h"
#include "../io/output/specific/inventory_output.h"
#include "../item/gear.h"
#include "../local/local_handler.h"
#include "../src/combat/combat_mode.h"
#include "local/inventory_mode_local.h"
Go to the source code of this file.
Functions | |
bool | can_equip_gear (character_t *player, gear_t *gear) |
Checks if the equipment can be equipped in case it occupies a hands slot. | |
void | collect_inventory_gear_options (gear_t *gear_inventory[], int count) |
Checks which options are available in the inventory menu for display. | |
void | collect_inventory_equipment_options (gear_t *equipment[]) |
Checks which options are available in the equipment menu for display. | |
void | collect_inv_potion_options (potion_t *potion_inventory[], int count) |
Checks which options are available in the potion menu for display. | |
int | init_inventory_mode () |
Initialize the inventory mode. | |
inventory_result_t | start_inventory (character_t *player, character_t *monster) |
Starts the inventory mode. | |
internal_inventory_state_t | inventory_menu (character_t *player, character_t *monster) |
Displays the main inventory menu. | |
internal_inventory_state_t | inventory_gear_menu (character_t *player, character_t *monster) |
Displays the gear inventory menu. | |
internal_inventory_state_t | inventory_equipment_menu (character_t *player, character_t *monster) |
Displays the equipment inventory menu. | |
internal_inventory_state_t | inventory_potion_menu (character_t *player, character_t *monster) |
Displays the potion inventory menu. | |
void | shutdown_inventory_mode (void) |
Shuts down the inventory mode and frees allocated resources. |
Variables | |
vector2d_t | inventory_view_anchor = {1, 1} |
internal_inventory_state_t | inventory_state = INVENTORY_MENU |
int | inventory_gear_count = 0 |
int | inventory_potion_count = 0 |
char ** | inventory_gear_options = NULL |
char ** | inventory_equipment_options = NULL |
char ** | inventory_potion_options = NULL |
Implements functionality for the inventory mode.
Definition in file inventory_mode.c.
bool can_equip_gear | ( | character_t * | player, |
gear_t * | gear ) |
Checks if the equipment can be equipped in case it occupies a hands slot.
Checks wether the character can equip certain gear or not.
player | The player character. |
gear | The gear to check. |
player | Pointer to the player. |
gear | Pointer to the gear to check. |
Definition at line 277 of file inventory_mode.c.
void collect_inv_potion_options | ( | potion_t * | potion_inventory[], |
int | count ) |
Checks which options are available in the potion menu for display.
Collects all the options for inventory potions for displaying.
potion_inventory | The potion inventory to check. |
count | The number of items in the potion inventory. |
potion_inventory | An array of potions. |
count | Ammount of potions in the array. |
Definition at line 556 of file inventory_mode.c.
void collect_inventory_equipment_options | ( | gear_t * | equipment[] | ) |
Checks which options are available in the equipment menu for display.
Collects equipment inventory options for display.
equipment | The equipment to check. |
equipment | An array of equipment. |
Definition at line 513 of file inventory_mode.c.
void collect_inventory_gear_options | ( | gear_t * | gear_inventory[], |
int | count ) |
Checks which options are available in the inventory menu for display.
Collects all the options for inventory gear for displaying.
gear_inventory | The gear inventory to check. |
count | The number of items in the gear inventory. |
gear_inventory | An array of gear. |
count | Ammount of items in the array. |
Definition at line 468 of file inventory_mode.c.
int init_inventory_mode | ( | ) |
Initialize the inventory mode.
Definition at line 54 of file inventory_mode.c.
internal_inventory_state_t inventory_equipment_menu | ( | character_t * | player, |
character_t * | monster ) |
Displays the equipment inventory menu.
player | The player character whose inventory is being managed. |
monster | The defeated monster whose inventory will be looted if not NULL. |
Definition at line 290 of file inventory_mode.c.
internal_inventory_state_t inventory_gear_menu | ( | character_t * | player, |
character_t * | monster ) |
Displays the gear inventory menu.
player | The player character whose inventory is being managed. |
monster | The defeated monster whose inventory will be looted if not NULL. |
Definition at line 177 of file inventory_mode.c.
internal_inventory_state_t inventory_menu | ( | character_t * | player, |
character_t * | monster ) |
Displays the main inventory menu.
player | The player character whose inventory is being managed. |
monster | The defeated monster whose inventory will be looted if not NULL. |
Definition at line 112 of file inventory_mode.c.
internal_inventory_state_t inventory_potion_menu | ( | character_t * | player, |
character_t * | monster ) |
Displays the potion inventory menu.
player | The player character whose inventory is being managed. |
monster | The defeated monster whose inventory will be looted if not NULL. |
Definition at line 370 of file inventory_mode.c.
void shutdown_inventory_mode | ( | void | ) |
Shuts down the inventory mode and frees allocated resources.
Definition at line 595 of file inventory_mode.c.
inventory_result_t start_inventory | ( | character_t * | player, |
character_t * | monster ) |
Starts the inventory mode.
player | The player character whose inventory will be managed. |
monster | The defeated monster whose inventory will be looted if not NULL. |
Definition at line 81 of file inventory_mode.c.
char** inventory_equipment_options = NULL |
Definition at line 51 of file inventory_mode.c.
int inventory_gear_count = 0 |
Definition at line 47 of file inventory_mode.c.
char** inventory_gear_options = NULL |
Definition at line 50 of file inventory_mode.c.
int inventory_potion_count = 0 |
Definition at line 48 of file inventory_mode.c.
char** inventory_potion_options = NULL |
Definition at line 52 of file inventory_mode.c.
internal_inventory_state_t inventory_state = INVENTORY_MENU |
Definition at line 45 of file inventory_mode.c.
vector2d_t inventory_view_anchor = {1, 1} |
Definition at line 44 of file inventory_mode.c.