78 if (hitPoints > 0 && energyPoints > 0) {
79 std::cout <<
"ScavTrap " << name <<
" attacks " << target <<
", causing " << attackDamage
82 }
else if (hitPoints == 0) {
83 std::cout <<
"ScavTrap " << name <<
" is out of hit points and cannot attack!" <<
std::endl;
85 std::cout <<
"ScavTrap " << name <<
" is out of energy points and cannot attack!" <<
std::endl;
Represents a basic robot character.
ClapTrap & operator=(const ClapTrap &other)
Copy assignment operator implementation.
Represents a ScavTrap robot, a specialized type derived from ClapTrap.
ScavTrap & operator=(const ScavTrap &other)
Copy assignment operator implementation for ScavTrap.
virtual void attack(const std::string &target)
Attack function implementation for ScavTrap.
virtual ~ScavTrap()
Virtual destructor implementation for ScavTrap.
void guardGate()
guardGate function implementation for ScavTrap.
ScavTrap()
Default constructor implementation for ScavTrap.
Header file for the ScavTrap class, a derived class of ClapTrap.