Browse Source

prod: new Stat and getter Setter

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

8
src/c/character.c

@ -172,4 +172,12 @@ int calculateDamage (Character *character,Weapon *weapon) {
default: default:
return 1; return 1;
} }
}
void setCharacterStatPoints (Character* character, int newStatPoints) {
character->statPoints = newStatPoints;
}
int getCharacterStatPoints (Character* character) {
return character->statPoints;
} }

6
src/c/character.h

@ -3,7 +3,7 @@
typedef struct { typedef struct {
int strength,dexterity,intelligence,healthPoints,manaPoints,level,exp,maxExp; int strength,dexterity,intelligence,healthPoints,manaPoints,level,exp,maxExp;
int attack,armor,maxHealthPoints,gold,items[10],weaponClass;
int attack,armor,maxHealthPoints,gold,items[10],weaponClass,statPoints;
char name [50]; char name [50];
} Character; } Character;
typedef struct { typedef struct {
@ -85,4 +85,8 @@ int getWeaponDurability (Weapon *weapon);
int setWeaponDurability (Weapon *weapon, int newDurability); int setWeaponDurability (Weapon *weapon, int newDurability);
int calculateDamage (Character *character,Weapon *weapon); int calculateDamage (Character *character,Weapon *weapon);
void setCharacterStatPoints (Character *character, int newStatPoints);
int getCharacterStatPoints (Character *character);
#endif #endif
Loading…
Cancel
Save