
#ifndef COMMON_OBJET_H_INCLUDED
#define COMMON_OBJET_H_INCLUDED

// rapport avec perso
#define SCALE_OBJET     1.0

// --------------
// --- objets ---
// --------------

// nul = objet visible / detruit = invisible / sans mesh
const std::string CONTENEUR_NULL = "null";
const std::string CONTENEUR_DETRUIT = "***";
const std::string CONTENEUR_VIRTUAL = "???";    // pour les inventaires, séparation des quantités : un objet devient deux objets
const std::string CONTENEUR_EQUIPE = "equipe";


// type d'objet
enum {
    OBJ_NULL,
    OBJ_CASQUE, OBJ_BOUCLIER, OBJ_ARME, OBJ_ARME_TIR,
    OBJ_POTION, OBJ_SOIF, OBJ_FAIM,
    OBJ_SOIN, OBJ_BOMBE, OBJ_LIVRE, OBJ_DIVERS, OBJ_CEINTURE,
    OBJ_PIECE, OBJ_QUETE
};

const std::string gl_str_type_object[] = {
    "null",
    "casque", "bouclier", "arme", "arme tir",
    "potion", "boisson", "nourriture",
    "soin", "bombe", "livre", "divers", "ceinture",
    "piece", "quete"
};

// genre dans la liste d'inventaire (selon radio button)
enum { GEN_TOUT, GEN_ARME, GEN_CONSOMMABLE, GEN_LIVRE, GEN_DIVERS, GEN_QUETE };

// ---

enum {
    EFF_NULL,
    EFF_CA, EFF_CD, EFF_BELT, EFF_CARE, EFF_LIFE, EFF_MANA, EFF_MAN_P, EFF_MAN_R,
};

const std::string gl_objet_code_effet[] = {
    "null",
    "ca", "cd", "belt", "care", "life", "mana", "mana_pow", "mana_regenerate"
};

struct s_objet_attribut
{
    std::string code;   // permet d'avoir une reference sans tenir compte de la position dans la liste (ajout suppression d'élément)
    std::string path, file, name;
    int         type;
    int         price;
    float       weight;
    int         cull_face;
    OVec2_i     srcImage;
    std::string effect; // plus souple, permet des combinaisons
    // ex : épée = ca 10 / vamp 10 > classe d'attaque de 10 contre adversaire + vampirisme de 10 au bénéfice de l'attaquant
};

const s_objet_attribut gl_catalogue_objet[] = {
//  code        path         object                  name                type           price    weight  c   src     effect
    {"piece",   "null",     "null",                 "piece",            OBJ_PIECE,      0,       0,      1,  {128,0},   "null" },
    {"soi_00",  "null",     "null",                 "pansement",        OBJ_SOIN,       10,	    0.1,	1,  {256,0},    "null" },
    {"soi_01",  "null",     "null",                 "pansement 1",      OBJ_SOIN,       15,	    0.1,	1,  {384,0},    "null" },
    {"soi_02",  "null",     "null",                 "pansement 2",      OBJ_SOIN,       20,	    0.1,	1,  {512,0},    "null" },
    {"soi_03",  "null",     "null",                 "onguant",          OBJ_SOIN,       30,	    0.1,	1,  {640,0},    "null" },
//
    {"div_00",  "object/",  "artifact.glb",         "belle coupe",      OBJ_DIVERS,	    500,    1.0,	1,  {0,384},    "null" },
    {"cle_00",  "object/",  "key.glb",              "clef",             OBJ_DIVERS,	    2,	    0.1,	1,  {128,384},  "null" },
    {"cle_01",  "object/",  "keyring.glb",          "clefs",            OBJ_DIVERS,	    5,      0.2,	1,  {256,384},  "null" },
    {"cle_02",  "object/",  "keyring_hanging.glb",  "clefs",            OBJ_DIVERS,     5,      0.2,	1,  {384,384},  "null" },
    {"orbe",    "object/",  "orbe.glb",             "orbe",             OBJ_DIVERS,	    500,    1.0,	1,  {0,0},      "null" },
    {"cube",    "object/",  "cube.glb",             "cube",             OBJ_DIVERS,	    500,    1.0,	1,  {0,0},      "null" },
//
    {"cei_01",  "null",     "null",                 "ceinture 1",       OBJ_CEINTURE,   50,     0.2,	1,  {0,1920},    "null" },
    {"cei_02",  "null",     "null",                 "ceinture 2",       OBJ_CEINTURE,   100,    0.3,	1,  {128,1920},  "null" },
    {"cei_03",  "null",     "null",                 "ceinture 3",       OBJ_CEINTURE,	150,    0.4,	1,  {256,1920},  "null" },
    {"cei_04",  "null",     "null",                 "ceinture 4",       OBJ_CEINTURE,	200,    0.4,	1,  {384,1920},  "null" },
//
    {"liv_00",  "null",     "null",                 "livre",            OBJ_LIVRE,      100,    0.2,	1,  {0,2048},   "null" },
    {"liv_01",  "null",     "null",                 "livre",            OBJ_LIVRE,      100,    0.2,	1,  {128,2048}, "null" },
    {"liv_02",  "null",     "null",                 "livre",            OBJ_LIVRE,      100,    0.2,	1,  {256,2048}, "null" },
    {"par_01",  "null",     "null",                 "parchemin",        OBJ_LIVRE,      100,    0.1,	1,  {768,2048}, "null" },
    {"par_02",  "null",     "null",                 "parchemin",        OBJ_LIVRE,      100,    0.1,	1,  {896,2048}, "null" },
//
    {"fai_00",  "null",     "null",                 "légume",           OBJ_FAIM,       10,     0.2,	1,  {0,2176},       "null" },
    {"fai_01",  "null",     "null",                 "oeuf",             OBJ_FAIM,       10,     0.2,	1,  {128,2176},     "null" },
    {"fai_02",  "null",     "null",                 "fromage",          OBJ_FAIM,       10,     0.2,	1,  {256,2176},     "null" },
    {"fai_03",  "null",     "null",                 "jambon",           OBJ_FAIM,       10,     0.2,	1,  {384,2176},     "null" },
    {"fai_04",  "null",     "null",                 "saucisse",         OBJ_FAIM,       10,     0.2,	1,  {512,2176},     "null" },
    {"fai_05",  "null",     "null",                 "viande",           OBJ_FAIM,       10,     0.2,	1,  {640,2176},     "null" },
    {"fai_06",  "null",     "null",                 "poulet",           OBJ_FAIM,       10,     0.2,	1,  {768,2176},     "null" },
    {"fai_07",  "null",     "null",                 "poisson",          OBJ_FAIM,       10,     0.2,	1,  {384,2176},     "null" },
    //
    {"soi_01",  "null",     "null",                 "cidre",            OBJ_SOIF,       10,     0.2,	1,  {0,2304},       "null" },
    {"soi_02",  "null",     "null",                 "biere",            OBJ_SOIF,       10,     0.2,	1,  {128,2304},     "null" },
//
    {"pot_32",  "object/",  "potionLarge_blue.glb",     "grande potion de mana",    OBJ_POTION,  50,     1,	    1,  {0,896},    "null" },
    {"pot_22",  "object/",  "potionLarge_green.glb",    "grande potion verte",      OBJ_POTION,	50,	    1,	    1,  {128,896},   "null" },
    {"pot_12",  "object/",  "potionLarge_red.glb",      "grande potion de vie",     OBJ_POTION,	50,	    1,	    1,  {256,896},  "null" },
    {"pot_31",  "object/",  "potionMedium_blue.glb",    "potion de mana",           OBJ_POTION,	30,	    0.5,	1,  {0,768},    "null" },
    {"pot_21",  "object/",  "potionMedium_green.glb",   "potion verte",             OBJ_POTION,	30,	    0.5,	1,  {128,768},   "null" },
    {"pot_11",  "object/",  "potionMedium_red.glb",     "potion de vie",            OBJ_POTION,	30,	    0.5,	1,  {256,768},  "null" },
    {"pot_30",  "object/",  "potionSmall_blue.glb",     "petite potion de mana",    OBJ_POTION,	15,	    0.2,	1,  {0,640},    "null" },
    {"pot_20",  "object/",  "potionSmall_green.glb",    "petite potion verte",      OBJ_POTION,	15,	    0.2,	1,  {128,640},   "null" },
    {"pot_10",  "object/",  "potionSmall_red.glb",      "petite potion de vie",     OBJ_POTION,	15,	    0.2,	1,  {256,640},  "null" },
//
    {"bou_00",  "shield/",  "shield_common.glb",            "simple bouclier",      OBJ_BOUCLIER,   100,    5,	1,  {0,1024},    "null" },
    {"bou_01",  "shield/",  "shield_uncommon.glb",          "bouclier solide",      OBJ_BOUCLIER,   120,    6,	1,  {128,1024},   "null" },
    {"bou_02",  "shield/",  "shield_rare.glb",              "bouclier de qualité",  OBJ_BOUCLIER,   200,    4,	1,  {256,1024},  "null" },
    {"bou_03",  "shield/",  "skeleton_Shield_Small_A.glb",  "petit bouclier",       OBJ_BOUCLIER,   80,     4,	1,  {384,1024},  "null" },
    {"bou_04",  "shield/",  "skeleton_Shield_Small_B.glb",  "bouclier usé",         OBJ_BOUCLIER,   60,     4,	1,  {512,1024},  "null" },
    {"bou_05",  "shield/",  "skeleton_Shield_Large_A.glb",  "bouclier",             OBJ_BOUCLIER,   110,    6,	1,  {640,1024},  "null" },
    {"bou_06",  "shield/",  "skeleton_Shield_Large_B.glb",  "bouclier",             OBJ_BOUCLIER,   110,    6,	1,  {768,1024},  "null" },
//
    {"cas_00",  "hat/",     "bear_hat.glb",         "crâne d'ours",     OBJ_CASQUE, 50,     5,  1,  {0,128},      "null" },
    {"cas_01",  "hat/",     "knightHelmet.glb",     "casque",           OBJ_CASQUE, 70,     6,  1,  {128,128},     "null" },
    {"cas_02",  "hat/",     "mage_hat.glb",         "chapeau de mage",  OBJ_CASQUE, 100,    2,  1,  {256,128},    "null" },
    {"cas_03",  "hat/",     "skeleton_hat.glb",     "casque",           OBJ_CASQUE, 50,     4,  1,  {384,128},    "null" },
    {"cas_04",  "hat/",     "sque_mage_hat.glb",    "chapeau de mage",  OBJ_CASQUE, 30,     2,  1,  {512,128},    "null" },
    {"cas_05",  "hat/",     "sque_rogue_hat.glb",   "cagoule",          OBJ_CASQUE, 30,     1,  1,  {640,128},    "null" },
//  code        path        object                      name                        type           price    weight  c   src         effect
    {"arm_00",  "weapon/", "arrow.glb",                "flèche",                   OBJ_ARME,        10,	    0,      1,  {0,1280},    "null" },
    {"arm_01",  "weapon/", "axe_common.glb",           "hache",                    OBJ_ARME,        30,	    4,      1,  {128,1280},   "null" },
    {"arm_02",  "weapon/", "axe_rare.glb",             "solide hache",             OBJ_ARME,        45,	    3.5,    1,  {256,1280},  "null" },
    {"arm_03",  "weapon/", "axe_uncommon.glb",         "hache de qualité",         OBJ_ARME,        40,	    4,      1,  {384,1280},  "null" },
    {"arm_04",  "weapon/", "axeDouble_common.glb",     "hache de guerre",          OBJ_ARME,        35,	    5,      1,  {512,1280},  "null" },
    {"arm_05",  "weapon/", "axeDouble_rare.glb",       "hache de guerre",          OBJ_ARME,        45,	    4.5,    1,  {640,1280},  "null" },
    {"arm_06",  "weapon/", "axeDouble_uncommon.glb",   "hache de guerre",           OBJ_ARME,       75,	    4,      1,  {768,1280},  "null" },
    {"arm_07",  "weapon/", "crossbow_common.glb",      "arbalette",                OBJ_ARME_TIR,    50,	    2,      1,  {896,1280},  "null" },
    {"arm_08",  "weapon/", "crossbow_rare.glb",        "arbalette",                OBJ_ARME_TIR,	60,	    2,      1,  {0,1408},    "null" },
    {"arm_09",  "weapon/", "crossbow_uncommon.glb",    "arbalette",                OBJ_ARME_TIR,	90,	    2,      1,  {128,1408},   "null" },
    {"arm_10",  "weapon/", "dagger_common.glb",        "dague",                    OBJ_ARME,        25,  	0.25,   1,  {256,1408},  "null" },
    {"arm_11",  "weapon/", "dagger_rare.glb",          "dague",                    OBJ_ARME,        25,	    0.25,   1,  {384,1408},  "null" },
    {"arm_12",  "weapon/", "dagger_uncommon.glb",      "dague",                    OBJ_ARME,        35,	    0.25,   1,  {512,1408},  "null" },
    {"arm_13",  "weapon/", "hammer_common.glb",        "marteau",                  OBJ_ARME,        30,	    4,      1,  {640,1408},  "null" },
    {"arm_14",  "weapon/", "hammer_rare.glb",          "marteau de guerre",        OBJ_ARME,        40,	    4,      1,  {768,1408},  "null" },
    {"arm_15",  "weapon/", "hammer_uncommon.glb",      "marteau de qualité",       OBJ_ARME,        50,	    4.5,    1,  {896,1408},  "null" },
    {"arm_16",  "weapon/", "skeleton_Axe.glb",         "hache",                    OBJ_ARME,        30,	    3.5,    1,  {0,1536},    "null" },
    {"arm_17",  "weapon/", "skeleton_Blade.glb",       "épée",                     OBJ_ARME,        40,	    3,      1,  {128,1536},   "null" },
    {"arm_18",  "weapon/", "skeleton_Crossbow.glb",    "arbalette",                OBJ_ARME_TIR,    80,  	2,      1,  {256,1536},  "null" },
    {"arm_19",  "weapon/", "skeleton_Quiver.glb",      "carquois",                 OBJ_ARME,        20,	    1,      1,  {384,1536},  "null" },
    {"arm_20",  "weapon/", "skeleton_Staff.glb",       "crosse",                   OBJ_ARME,        50,	    2,      1,  {512,1536},  "null" },
    {"arm_21",  "weapon/", "staff_common.glb",         "crosse",                   OBJ_ARME,        40,	    2,      1,  {640,1536},  "null" },
    {"arm_22",  "weapon/", "staff_rare.glb",           "crosse",                   OBJ_ARME,        50,	    2,      1,  {768,1536},  "null" },
    {"arm_23",  "weapon/", "staff_uncommon.glb",       "crosse",                   OBJ_ARME,        45,	    2,      1,  {896,1536},  "null" },
    {"arm_24",  "weapon/", "sword_uncommon.glb",       "épée simple",              OBJ_ARME,        40,	    2,      1,  {0,1664},    "null" },
    {"arm_25",  "weapon/", "sword_common.glb",         "épée",                     OBJ_ARME,        50,     2,      1,  {128,1664},   "null" },
    {"arm_26",  "weapon/", "sword_rare.glb",           "épée",                     OBJ_ARME,        75,     2.5,    1,  {256,1664},  "null" },
};

#endif // COMMON_OBJET_H_INCLUDED
