#include "ScavTrap.hpp" ScavTrap::ScavTrap() : ClapTrap() { this->name = "Default"; this->hp = 100; this->energy = 50; this->damage = 20; std::cout << "ScavTrap " + this->name + " is created" << std::endl; } ScavTrap::ScavTrap(std::string name) : ClapTrap() { this->name = name; this->hp = 100; this->energy = 50; this->damage = 20; std::cout << "ScavTrap " + this->name + " is created" << std::endl; } ScavTrap::ScavTrap(const ScavTrap &scav) : ClapTrap(scav) { *this = scav; std::cout << "ScavTrap " + this->name + " is created" << std::endl; } ScavTrap::~ScavTrap() { std::cout << "ScavTrap " + this->name + " is destroyed" << std::endl; } ScavTrap& ScavTrap::operator=(const ScavTrap &scav) { if (this != &scav) { ClapTrap::operator=(scav); } return *this; } void ScavTrap::attack(const std::string& target) { if (this->energy > 0 && this->hp > 0) { std::cout << "ScavTrap " + this->name + " attacks " + target + ", causing " << this->damage << " points of damage! " << std::endl; this->energy--; } else std::cout << this->name + " is out of combat" << std::endl; } void ScavTrap::guardGate() { if (this->energy > 0 && this->hp > 0) { std::cout << "ScavTrap is now in Gate Keeper Mode" << std::endl; this->energy--; } else std::cout << "ScavTrap " + this->name + " is out of combat" << std::endl; }