Rogue.cpp 548 B

123456789101112131415161718192021222324
  1. #pragma once
  2. #include <iostream>
  3. #include <random>
  4. #include <ctime>
  5. #include "unit.h"
  6. #include "Rogue.h"
  7. Rogue::Rogue(std::string id) {
  8. }
  9. Rogue::~Rogue() {}
  10. bool Rogue::canAttackForDistance(int distance) {
  11. return (canMoveForDistance(attack_cost_ * getMovementSpeed() + distance - attack_range_));
  12. }
  13. bool Rogue::canAttackToCell(Cell * destination) {
  14. return lenOfActualPath(destination) != 0 &&
  15. canAttackForDistance(lenOfActualPath(destination));
  16. }
  17. bool Rogue::canAttackUnit(Unit * target) {
  18. return canAttackToCell(target->getLocation());
  19. }