1
Fork 0
mirror of https://github.com/Steffo99/iiiiil-gioco.git synced 2024-11-21 23:44:21 +00:00

Aggiunti valori di attacco alla classe Player

This commit is contained in:
Steffo 2016-01-05 17:39:53 +01:00
parent ebdb9cfb83
commit 096130d1cf

View file

@ -9,6 +9,7 @@
#define ROOM_SIZE 7
#define ENEMIES_IN_LEVEL 5
#define HP_MAX 50
#define STARTING_ATK 5
#define MAX_POTIONS_PER_FLOOR 5
using namespace std;
@ -72,7 +73,15 @@ class Entity
//Classe del giocatore
class Player : public Entity
{
private:
int equipment_atk = 0; //Attacco ottenuto dall'equipaggiamento
public:
int base_atk = STARTING_ATK; //Attacco di base
int atk()
{
int result = equipment_atk + base_atk;
return result;
}
int pozioni_vita_piccole = 3;
int pozioni_vita_medie = 2;
int pozioni_vita_grandi = 1;
@ -254,14 +263,14 @@ void draw()
printf("%c", map[x][y]);
}
}
printf("Piano: %d | Vita: %d/%d | x:%d y:%d\n", depth, player.hp, HP_MAX, player.x, player.y);
printf("Piano: %d | Vita: %d/%d | x:%d y:%d | atk: %d\n", depth, player.hp, HP_MAX, player.x, player.y, player.atk());
}
//Visualizza l'inventario
void inventory()
{
system("cls");
printf("Piano: %d | Vita: %d/%d | x:%d y:%d\n", depth, player.hp, HP_MAX, player.x, player.y);
printf("Piano: %d | Vita: %d/%d | x:%d y:%d | atk: %d\n", depth, player.hp, HP_MAX, player.x, player.y, player.atk());
for(int i = 0; i < X_MAX; i++)
{
printf("%c", (char) DOUBLELINE);