|
@ -7,6 +7,7 @@ class Character |
|
|
{ |
|
|
{ |
|
|
protected: |
|
|
protected: |
|
|
char name[16]; |
|
|
char name[16]; |
|
|
|
|
|
int maxHp; |
|
|
int hp; |
|
|
int hp; |
|
|
|
|
|
|
|
|
int att; |
|
|
int att; |
|
@ -16,6 +17,7 @@ class Character |
|
|
Character(char *name) |
|
|
Character(char *name) |
|
|
{ |
|
|
{ |
|
|
strncpy(this->name, name, sizeof(this->name)); |
|
|
strncpy(this->name, name, sizeof(this->name)); |
|
|
|
|
|
this->maxHp = 100; |
|
|
this->hp = 100; |
|
|
this->hp = 100; |
|
|
this->att = 10; |
|
|
this->att = 10; |
|
|
this->def = 5; |
|
|
this->def = 5; |
|
@ -24,6 +26,7 @@ class Character |
|
|
Character(char *name, int hp, int att, int def) |
|
|
Character(char *name, int hp, int att, int def) |
|
|
{ |
|
|
{ |
|
|
strncpy(this->name, name, sizeof(this->name)); |
|
|
strncpy(this->name, name, sizeof(this->name)); |
|
|
|
|
|
this->maxHp = hp; |
|
|
this->hp = hp; |
|
|
this->hp = hp; |
|
|
this->att = att; |
|
|
this->att = att; |
|
|
this->def = def; |
|
|
this->def = def; |
|
|