diff --git a/src/c/character.c b/src/c/character.c index 9c436ff..344b0e1 100644 --- a/src/c/character.c +++ b/src/c/character.c @@ -66,6 +66,30 @@ int calculateStatIncrease (Character *character, int amount) { return character->level*amount; } +void setCharacterMaxHealthPoints (Character *character, int newMaxHealthPoints){ + character->maxHealthPoints = newMaxHealthPoints; +} + +int getCharacterMaxHealthPoints (Character *character){ + return character->maxHealthPoints; +} + +void setCharacterAttack (Character *character, int newAttack){ + character->attack = newAttack; +} + +int getCharacterAttack (Character *character){ + return character->attack; +} + +void setCharacterArmor (Character *character, int newArmor){ + character->armor = newArmor; +} + +int getCharacterArmor (Character *character){ + return character->armor; +} + void increaseStat (Character *character, int stat, int amount) { switch (stat) { diff --git a/src/c/character.h b/src/c/character.h index 7ed09b4..acae866 100644 --- a/src/c/character.h +++ b/src/c/character.h @@ -2,7 +2,7 @@ #define CHARACTER_H typedef struct { - int strength,dexterity,intelligence,healthPoints,manaPoints,level,exp,maxExp; + int strength,dexterity,intelligence,healthPoints,manaPoints,level,exp,maxExp,attack,armor,maxHealthPoints; char name [50]; } Character; @@ -42,5 +42,17 @@ void increaseStat (Character *character, int stat, int amount); int calculateStatIncrease (Character *character, int amount); +void setCharacterMaxHealthPoints (Character *character, int newMaxHealthPoints); + +int getCharacterMaxHealthPoints (Character *character); + +void setCharacterAttack (Character *character, int newAttack); + +int getCharacterAttack (Character *character); + +void setCharacterArmor (Character *character, int newArmor); + +int getCharacterArmor (Character *character); + void levelUp (Character *character); #endif \ No newline at end of file