first things first, im a newbie
ok, im trying to make a simple simple rpg just for s's & g's. so heres my inventory uses a structure for each weapon with its attributes therein. those will be declared in game when the player discovers the weapons. same with items, armor and spells. now, the actual inventory is another structure with counters to make sure the player doesnt have 46 weapons .
my question is this... when the user finds the weapon, that weapon gets its own struct, but, will i be able to add that struct to the inventory struct?
heres the source code for the inventory header:
#ifndef __INVENTORY_H__
#define __INVENTORY_H__
#endif
struct Weapon
{
char Name[255];
int Damage;
int Weight;
};
struct Armor
{
char Name[255];
int Protection;
int Weight;
};
struct Item
{
char Name[255];
int StrPlus;
int SpdPlus;
int IntelPlus;
};
struct Spell
{
char Name[255];
int Damage;
};
struct Inventory
{
int WeaponCount;
int ArmorCount;
int ItemCount;
int SpellCount;
};
void InvenGen(void);
žÅNžÅ
ok, im trying to make a simple simple rpg just for s's & g's. so heres my inventory uses a structure for each weapon with its attributes therein. those will be declared in game when the player discovers the weapons. same with items, armor and spells. now, the actual inventory is another structure with counters to make sure the player doesnt have 46 weapons .
my question is this... when the user finds the weapon, that weapon gets its own struct, but, will i be able to add that struct to the inventory struct?
heres the source code for the inventory header:
#ifndef __INVENTORY_H__
#define __INVENTORY_H__
#endif
struct Weapon
{
char Name[255];
int Damage;
int Weight;
};
struct Armor
{
char Name[255];
int Protection;
int Weight;
};
struct Item
{
char Name[255];
int StrPlus;
int SpdPlus;
int IntelPlus;
};
struct Spell
{
char Name[255];
int Damage;
};
struct Inventory
{
int WeaponCount;
int ArmorCount;
int ItemCount;
int SpellCount;
};
void InvenGen(void);
žÅNžÅ