Skip to content

Items ~ Equipment ~ Design Document

aliu65803 edited this page May 17, 2022 · 20 revisions

Battle Items and Equipment Design Document

typedef struct battle_item {

int id;

bool is_weapon;

int effectiveness_decrement;

int quantity;

int durability;

char* name;

char* description;

bool battle;

int attack;

int defense;

int hp;

struct battle_item *next;

struct battle_item *prev;

} battle_item_t;

Here is the definition for the equipment_type enum, which will be used for the battle_equipment struct:

enum equipment_type{
    ACCESSORY,
    ARMOR,
    WEAPON
};

Here is the definition for the battle equipment struct:

typedef struct battle_equipment{
    int id; // the id of the equipment, should be unique for each individual type of equipment.
    char *name; // the name of the equipment
    char *description; // the description of the equipment
    stat_changes_t *attributes; // the stats that are changed by the equipment
    equipment_type type; // determines the type of equipment (armor, weapon, accessory)
} battle_equipment_t;
Clone this wiki locally