Skip to content

Items ~ Equipment ~ Design Document

nicholaswlee 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;
typedef struct combatant
{
    char *name;
    bool is_friendly;
    class_t *class_type;
    stat_t *stats;
    move_t *moves;
    battle_item_t *items;
    difficulty_t ai;
    battle_equipment_t *weapon;
    battle_equipment_t *accessory;
    battle_equipment_t *armor;
    struct combatant *next;
    struct combatant *prev;
} combatant_t;
Clone this wiki locally