Min fixes
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
|
||||
#include "ScavTrap.hpp"
|
||||
|
||||
ScavTrap::ScavTrap() : ClapTrap("(NULL)")
|
||||
ScavTrap::ScavTrap() : ClapTrap("(NULL)"), guarding_gate(false)
|
||||
{
|
||||
this->health = 100;
|
||||
this->energy = 50;
|
||||
@@ -21,7 +21,7 @@ ScavTrap::ScavTrap() : ClapTrap("(NULL)")
|
||||
<< std::endl;
|
||||
}
|
||||
|
||||
ScavTrap::ScavTrap(std::string name) : ClapTrap(name)
|
||||
ScavTrap::ScavTrap(std::string name) : ClapTrap(name), guarding_gate(false)
|
||||
{
|
||||
this->health = 100;
|
||||
this->energy = 50;
|
||||
@@ -62,22 +62,21 @@ void ScavTrap::attack(const std::string &target)
|
||||
this->energy -= 1;
|
||||
} else {
|
||||
std::cout << "ScavTrap " << this->name
|
||||
<< " cant attack anymore..." << std::endl;
|
||||
<< " can't attack anymore..." << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
void ScavTrap::guardGate()
|
||||
{
|
||||
if (this->guardGate)
|
||||
if (!this->guarding_gate)
|
||||
{
|
||||
this->guardGate = false;
|
||||
std::cout << "ScavTrap " << this->name << " is not in Gate keeper mode"
|
||||
this->guarding_gate = true;
|
||||
std::cout << "ScavTrap " << this->name << " is in Gate keeper mode"
|
||||
<< std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
this->guardGate = true;
|
||||
std::cout << "ScavTrap " << this->name << " is in Gate keeper mode"
|
||||
std::cout << "ScavTrap " << this->name << " is already in Gate keeper mode"
|
||||
<< std::endl;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
class ScavTrap : public ClapTrap
|
||||
{
|
||||
private:
|
||||
boold guarding_gate;
|
||||
bool guarding_gate;
|
||||
public:
|
||||
ScavTrap();
|
||||
ScavTrap(std::string name);
|
||||
|
||||
Reference in New Issue
Block a user