#include "item.h"
#include "level.h"
#include "generalfunc.h"
#include "backpack.h"
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <libintl.h>
#include <locale.h>
Functions | |
char | get_key (struct item *inv, int n, struct item itm) |
Returns/generates struct item::key value for item. | |
int | compare_items (struct item i1, struct item i2, int mode) |
Compares 2 items. | |
char * | makesuggestion (struct item *inv, int n, int class) |
Retuns keys of items with current class. | |
int | find_item (struct item *inv, int n, struct item itm) |
Finds an item. | |
int | remove_item (struct item *inv, int *n, struct item itm) |
Removes an item from inventory. | |
void | add_item (struct item *inv, int *n, struct item itm) |
Adds an item to inventory. | |
void | generate_items (struct leveldata ld) |
Generates items on level. | |
void | place_random (struct leveldata ld, struct item it) |
Puts an item onto random free cell on level. |
Adds an item to inventory.
Arguments as for get_key
Compares 2 items.
Use KEY_CMP mode to make this function be key-sensitive
Finds an item.
Arguments as for get_key
void generate_items | ( | struct leveldata | ld | ) |
Generates items on level.
ld | - Level structure |
Returns/generates struct item::key value for item.
Use this function every time you want to place new item in inventory
inv | - player's inventory | |
n | - number of items in inventory | |
itm | - new item |
char* makesuggestion | ( | struct item * | inv, | |
int | n, | |||
int | class | |||
) |
Retuns keys of items with current class.
inv | - inventory | |
n | - number of items in inventory | |
class | - class of items |
Puts an item onto random free cell on level.
ld | - Level structure | |
it | - Item to work with |