Browse Source

prod: new function initializeCharacter

remotes/origin/nextcycle
Kai Kehres 2 years ago
parent
commit
cb948599c8
  1. 17
      src/c/character.c
  2. 2
      src/c/character.h

17
src/c/character.c

@ -180,4 +180,21 @@ void setCharacterStatPoints (Character* character, int newStatPoints) {
int getCharacterStatPoints (Character* character) { int getCharacterStatPoints (Character* character) {
return character->statPoints; return character->statPoints;
}
void initializeCharacter (Character *character,int weaponClass) {
setCharacterHealthPoints(character,100);
setCharacterStrength(character,10);
setCharacterDexterity(character,10);
setCharacterIntelligence(character,10);
setCharacterLevel(character,1);
setCharacterExp(character,0);
setCharacterMaxExp(character,100);
setCharacterMaxHealthPoints(character,100);
setCharacterAttack(character,10);
setCharacterArmor(character,0);
setCharacterGold(character,0);
setCharacterName(character,"Player");
setCharacterWeaponClass(character,weaponClass);
setCharacterStatPoints(character,0);
} }

2
src/c/character.h

@ -89,4 +89,6 @@ int calculateDamage (Character *character,Weapon *weapon);
void setCharacterStatPoints (Character *character, int newStatPoints); void setCharacterStatPoints (Character *character, int newStatPoints);
int getCharacterStatPoints (Character *character); int getCharacterStatPoints (Character *character);
void initializeCharacter (Character *character,int weaponClass);
#endif #endif
Loading…
Cancel
Save