00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00023
#ifndef _ITEM_H_
00024
#define _ITEM_H_
00025
00026
#include "item_types.h"
00027
#include "combat.h"
00028
00029
00030
#define ITEM_MEMBER_VARS \
00031
char *name, *desc;\
00032
enum item_type type;\
00033
unsigned int weight
00034
00036 struct item {
00037 ITEM_MEMBER_VARS;
00038 };
00039
00041 struct food {
00042 ITEM_MEMBER_VARS;
00043
int value;
00044 };
00045
00047 struct drink {
00048 ITEM_MEMBER_VARS;
00049
int value;
00050 };
00051
00053 struct gear {
00054 ITEM_MEMBER_VARS;
00055
enum gear_type gear_type;
00056
00057
int ac;
00058 };
00059
00061 struct weapon {
00062 ITEM_MEMBER_VARS;
00063
enum damage_type damage_type;
00064
00065
int range;
00066
int ammo;
00067
00068
enum dice damage_dice;
00069
int dice_count;
00070
int magic_bonus;
00071 };
00072
00074 struct text {
00075 ITEM_MEMBER_VARS;
00076
char *
text;
00077 };
00078
00080 struct container {
00081 ITEM_MEMBER_VARS;
00082
int count, max;
00083
struct item **items;
00084 };
00085
00086
void set_item_name(
struct item *
item,
const char *name);
00087
void set_item_desc(
struct item *
item,
const char *desc);
00088
void set_text_contents(
struct text *
text,
const char *contents);
00089
00090
void destroy_item(
struct item *
item);
00091
struct container *create_container(
int size);
00092
void destroy_container(
struct container *cont);
00093
00094
#endif