This commit is contained in:
Camille Chauvet 2023-08-09 14:07:18 +00:00
parent 9e3822aee0
commit 21a47da9b5
3 changed files with 15 additions and 15 deletions

View File

@ -45,19 +45,19 @@ void ClapTrap::beRepaired(unsigned int amount)
{ {
if (this->_life == 0 || this->_energy == 0) if (this->_life == 0 || this->_energy == 0)
{ {
std::cerr << "error: ClapTrap " << this->_name << " dead" << std::endl; std::cout << "error: ClapTrap " << this->_name << " dead" << std::endl;
return; return;
} }
this->_life += amount; this->_life += amount;
this->_energy--; this->_energy--;
std::cerr << "ClapTrap " << this->_name << " beRepaired causing life is now " << this->_life << std::endl; std::cout << "ClapTrap " << this->_name << " beRepaired causing life is now " << this->_life << std::endl;
} }
void ClapTrap::takeDamage(unsigned int amount) void ClapTrap::takeDamage(unsigned int amount)
{ {
if (this->_life == 0 || this->_energy == 0) if (this->_life == 0 || this->_energy == 0)
{ {
std::cerr << "error: ClapTrap " << this->_name << " dead" << std::endl; std::cout << "error: ClapTrap " << this->_name << " dead" << std::endl;
return; return;
} }
this->_life -= amount; this->_life -= amount;
@ -68,9 +68,9 @@ void ClapTrap::attack(const std::string &target)
{ {
if (this->_life == 0 || this->_energy == 0) if (this->_life == 0 || this->_energy == 0)
{ {
std::cerr << "error: ClapTrap " << this->_name << " dead" << std::endl; std::cout << "error: ClapTrap " << this->_name << " dead" << std::endl;
return; return;
} }
this->_energy--; this->_energy--;
std::cerr << "ClapTrap " << this->_name << " attacks " << target << ", causing " << this->_damage << " points of damage" << std::endl; std::cout << "ClapTrap " << this->_name << " attacks " << target << ", causing " << this->_damage << " points of damage!" << std::endl;
} }

View File

@ -45,19 +45,19 @@ void ClapTrap::beRepaired(unsigned int amount)
{ {
if (this->_life == 0 || this->_energy == 0) if (this->_life == 0 || this->_energy == 0)
{ {
std::cerr << "error: ClapTrap " << this->_name << " dead" << std::endl; std::cout << "error: ClapTrap " << this->_name << " dead" << std::endl;
return; return;
} }
this->_life += amount; this->_life += amount;
this->_energy--; this->_energy--;
std::cerr << "ClapTrap " << this->_name << " beRepaired causing life is now " << this->_life << std::endl; std::cout << "ClapTrap " << this->_name << " beRepaired causing life is now " << this->_life << std::endl;
} }
void ClapTrap::takeDamage(unsigned int amount) void ClapTrap::takeDamage(unsigned int amount)
{ {
if (this->_life == 0 || this->_energy == 0) if (this->_life == 0 || this->_energy == 0)
{ {
std::cerr << "error: ClapTrap " << this->_name << " dead" << std::endl; std::cout << "error: ClapTrap " << this->_name << " dead" << std::endl;
return; return;
} }
this->_life -= amount; this->_life -= amount;
@ -68,11 +68,11 @@ void ClapTrap::attack(const std::string &target)
{ {
if (this->_life == 0 || this->_energy == 0) if (this->_life == 0 || this->_energy == 0)
{ {
std::cerr << "error: ClapTrap " << this->_name << " dead" << std::endl; std::cout << "error: ClapTrap " << this->_name << " dead" << std::endl;
return; return;
} }
this->_energy--; this->_energy--;
std::cerr << "ClapTrap " << this->_name << " attacks " << target << ", causing " << this->_damage << " points of damage" << std::endl; std::cout << "ClapTrap " << this->_name << " attacks " << target << ", causing " << this->_damage << " points of damage!" << std::endl;
} }
const std::string& ClapTrap::getName() const const std::string& ClapTrap::getName() const

View File

@ -45,19 +45,19 @@ void ClapTrap::beRepaired(unsigned int amount)
{ {
if (this->_life == 0 || this->_energy == 0) if (this->_life == 0 || this->_energy == 0)
{ {
std::cerr << "error: ClapTrap " << this->_name << " dead" << std::endl; std::cout << "error: ClapTrap " << this->_name << " dead" << std::endl;
return; return;
} }
this->_life += amount; this->_life += amount;
this->_energy--; this->_energy--;
std::cerr << "ClapTrap " << this->_name << " beRepaired causing life is now " << this->_life << std::endl; std::cout << "ClapTrap " << this->_name << " beRepaired causing life is now " << this->_life << std::endl;
} }
void ClapTrap::takeDamage(unsigned int amount) void ClapTrap::takeDamage(unsigned int amount)
{ {
if (this->_life == 0 || this->_energy == 0) if (this->_life == 0 || this->_energy == 0)
{ {
std::cerr << "error: ClapTrap " << this->_name << " dead" << std::endl; std::cout << "error: ClapTrap " << this->_name << " dead" << std::endl;
return; return;
} }
this->_life -= amount; this->_life -= amount;
@ -68,11 +68,11 @@ void ClapTrap::attack(const std::string &target)
{ {
if (this->_life == 0 || this->_energy == 0) if (this->_life == 0 || this->_energy == 0)
{ {
std::cerr << "error: ClapTrap " << this->_name << " dead" << std::endl; std::cout << "error: ClapTrap " << this->_name << " dead" << std::endl;
return; return;
} }
this->_energy--; this->_energy--;
std::cerr << "ClapTrap " << this->_name << " attacks " << target << ", causing " << this->_damage << " points of damage" << std::endl; std::cout << "ClapTrap " << this->_name << " attacks " << target << ", causing " << this->_damage << " points of damage!" << std::endl;
} }
const std::string& ClapTrap::getName() const const std::string& ClapTrap::getName() const