|
@@ -8,6 +8,7 @@
|
|
|
#include <vector>
|
|
|
#include <map>
|
|
|
#include <iostream>
|
|
|
+#include <cmath>
|
|
|
|
|
|
class EffectsForCell{
|
|
|
public:
|
|
@@ -203,7 +204,7 @@ void Cell::clearTable_() {
|
|
|
}
|
|
|
|
|
|
void Cell::recalcAttackable_(Cell * Now,bool isReached){
|
|
|
- /* if(Now == nullptr)return;
|
|
|
+ if(Now == nullptr)return;
|
|
|
if (!isEmpty() && !Now->isEmpty() &&
|
|
|
getCharacter()->canAttackForDistance("Melee", Now->getdistance_barrier())
|
|
|
) {
|
|
@@ -213,7 +214,7 @@ void Cell::recalcAttackable_(Cell * Now,bool isReached){
|
|
|
getCharacter()->canAttackForDistance("Range", Now->getdistance_barrier())
|
|
|
) {
|
|
|
Now->setisRangeAttackAble(true);
|
|
|
- }*/
|
|
|
+ }
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -260,6 +261,7 @@ void Cell::updateMoveableCells_(std::queue<Cell*> & Q) {
|
|
|
void Cell::updateUnMovealeCells_(std::queue<Cell*> & Q) {
|
|
|
auto f = [&Q](Cell * t, Cell * parent) {
|
|
|
if (t && !t->AddedToQuery_) {
|
|
|
+ parent->getCharacter();
|
|
|
t->AddedToQuery_ = true;
|
|
|
Q.push(t);
|
|
|
}
|
|
@@ -328,7 +330,16 @@ Cell* Cell::getRealShootTarget(Cell* next){
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-void Cell::print(){
|
|
|
- return;
|
|
|
- //do nothing, need content
|
|
|
+std::list<std::pair<double, double> > Cell::getPoints(double radius, std::pair<double, double> center){
|
|
|
+ const double delta_radians = acos(-1) / 180.0;
|
|
|
+
|
|
|
+ std::list<std::pair<double, double> > res;
|
|
|
+ res.push_back({center.first + radius * std::cos(30.0 * delta_radians), center.second + radius * std::sin(30.0 * delta_radians)});
|
|
|
+ res.push_back({center.first + radius * std::cos(90.0 * delta_radians), center.second + radius * std::sin(90.0 * delta_radians)});
|
|
|
+ res.push_back({center.first + radius * std::cos(150.0 * delta_radians), center.second + radius * std::sin(150.0 * delta_radians)});
|
|
|
+ res.push_back({center.first + radius * std::cos(210.0 * delta_radians), center.second + radius * std::sin(210.0 * delta_radians)});
|
|
|
+ res.push_back({center.first + radius * std::cos(270.0 * delta_radians), center.second + radius * std::sin(270.0 * delta_radians)});
|
|
|
+ res.push_back({center.first + radius * std::cos(330.0 * delta_radians), center.second + radius * std::sin(330.0 * delta_radians)});
|
|
|
+ return res;
|
|
|
}
|
|
|
+
|