diff --git a/src/c/character.c b/src/c/character.c index 02254ec..f5f96ec 100644 --- a/src/c/character.c +++ b/src/c/character.c @@ -106,6 +106,22 @@ char* getCharacterName (Character *character) { return character->name; } +int getWaponAttack (Weapon *weapon) { + return weapon->attack; +} + +void setWeaponAttack (Weapon *weapon, int newAttack) { + weapon->attack = newAttack; +} + +int getWeaponDurability (Weapon *weapon) { + return weapon->durability; +} + +int setWeaponDurability (Weapon *weapon, int newDurability) { + weapon->durability = newDurability; +} + void increaseStat (Character *character, int stat, int amount) { switch (stat) { diff --git a/src/c/character.h b/src/c/character.h index d50b076..3f74401 100644 --- a/src/c/character.h +++ b/src/c/character.h @@ -3,9 +3,13 @@ typedef struct { int strength,dexterity,intelligence,healthPoints,manaPoints,level,exp,maxExp; - int attack,armor,maxHealthPoints,gold; + int attack,armor,maxHealthPoints,gold,items[10]; char name [50]; } Character; +typedef struct { + int attack,durability; + char name [50]; +} Weapon; enum { STRENGTH = 1, DEXTERITY = 2, INTELLIGENCE = 3, HEALTHPOINTS = 4, MANAPOINTS = 5, LEVEL = 6, EXP = 7, MAXEXP = 8 @@ -65,4 +69,12 @@ void setCharacterName (Character *character, char newName[]); char* getCharacterName (Character *character); +int getWaponAttack (Weapon *weapon); + +void setWeaponAttack (Weapon *weapon, int newAttack); + +int getWeaponDurability (Weapon *weapon); + +int setWeaponDurability (Weapon *weapon, int newDurability); + #endif \ No newline at end of file