Browse Source

prod: created getter and setter StatusDuration

remotes/origin/nextcycle
Kai Kehres 2 years ago
parent
commit
08d666542d
  1. 8
      src/c/character.c
  2. 6
      src/c/character.h

8
src/c/character.c

@ -255,6 +255,14 @@ int getCharacterStatus (Character *character) {
return character->status;
}
void setCharacterStatusDuration (Character *character, int newStatusDuration) {
character->statusDuration = newStatusDuration;
}
int getCharacterStatusDuration (Character *character) {
return character->statusDuration;
}
void initializeInventory (Character *character) {
for (int i = 0; i < 10; i++)
{

6
src/c/character.h

@ -7,7 +7,7 @@ typedef struct {
} Item;
typedef struct {
int strength,dexterity,intelligence,healthPoints,manaPoints,level,exp,maxExp;
int attack,armor,maxHealthPoints,gold,weaponClass,statPoints,status;
int attack,armor,maxHealthPoints,gold,weaponClass,statPoints,status,statusDuration;
char name [50];
Item *inventory[10];
} Character;
@ -130,4 +130,8 @@ Item * getItemInInventory (Character *character, int inventorySlot);
void setCharacterStatus (Character *character, int newStatus);
int getCharacterStatus (Character *character);
void setCharacterStatusDuration (Character *character, int newStatusDuration);
int getCharacterStatusDuration (Character *character);
#endif
Loading…
Cancel
Save