Mage.cpp 499 B

123456789101112131415161718192021222324
  1. #pragma once
  2. #include <iostream>
  3. #include <random>
  4. #include <ctime>
  5. #include "unit.h"
  6. #include "Mage.h"
  7. Mage::Mage(std::string id){
  8. }
  9. Mage::~Mage(){}
  10. bool Mage::canAttackForDistance(int distance){ //this is a dummy
  11. srand(time(0));
  12. return rand() % 2;
  13. }
  14. bool Mage::canAttackToCell(Cell * destination){
  15. return canAttackForDistance(lenOfActualPath(destination) + getAttackCost() * getMovementSpeed());
  16. }
  17. bool Mage::canAttackUnit(Unit * target){
  18. return canAttackToCell(target->getLocation());
  19. }