: GameInstance(), HaveSymbol(), HaveHp(), HaveGameTime(), HavePosition(fieldIt, x, y), HaveInventory(), HaveSize()
{
WipeData();
- sightList.resize((12*2+1)*(12*2+1));
- fieldIt->second->GetSight(sightList, 12, x, y);
+ sightList.resize((this->sightRange * 2 + 1)*(this->sightRange * 2 + 1));
+ fieldIt->second->GetSight(sightList, this->sightRange, x, y);
SetSpeciesData(speciesIt->second.get());
}
maxStatus.Set(8, 8, 8, 8, 8, 8);
maxMaxStatus.Set(20, 20, 20, 20, 20, 20);
+ sightRange = BASE_SIGHT_RANGE;
+
this->calcHPTable();
this->currentHp = this->maxHp = this->GetNorMaxHP();
cx = this->position.GetX();
cy = this->position.GetY();
- fieldPtr->GetSight(this->sightList, 12, cx, cy);
- for(y = -12; y < 12; y++)
+ fieldPtr->GetSight(this->sightList, this->sightRange, cx, cy);
+ for(y = -this->sightRange; y < this->sightRange; y++)
{
- for(x = -12; x < 12; x++)
+ for(x = -this->sightRange; x < this->sightRange; x++)
{
- if(this->sightList[(y + 12) * 25 + x + 12]) this->GetLore()->PutFieldLore(0, cx + x, cy + y);
+ if(this->sightList[(y + this->sightRange) * (this->sightRange * 2 + 1) + x + this->sightRange]) this->GetLore()->PutFieldLore(0, cx + x, cy + y);
}
}
}
{
MAP_LENGTH rx = x - this->position.GetX();
MAP_LENGTH ry = y - this->position.GetY();
- if(rx > 12 || ry > 12 || rx < -12 || ry < -12)
+ if(rx > this->sightRange || ry > this->sightRange || rx < -this->sightRange || ry < -this->sightRange)
{
return false;
}
return false;
}
- return this->sightList[(ry + 12) * 25 + rx + 12];
+ return this->sightList[(ry + this->sightRange) * (this->sightRange * 2 + 1) + rx + this->sightRange];
}
}
\ No newline at end of file
SDL_Rect checkRect4 = {GameSurfaceSDL::sideBarWidth + (px - x) * squareGraphicWidth - 1, 30 + (py - y) * squareGraphicHeight - 6 + 12, 2, 12};
*/
- if(subJectCreaturePtr->GetLore()->GetFieldLore(0, px, py) > 0)
+ if(subJectCreaturePtr->InSight(px, py))
{
TAG tag = fieldPtr->GetSquare(px, py)->GetFloorTag();
SDL_RenderCopy(renderer, floorTextures[tag], &symbolRect, &blitRect);