1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

implemented VISIONS spell (partially)

(-) todo: agressivnes
This commit is contained in:
AlexVinS
2015-02-06 17:36:09 +03:00
parent 2156204306
commit b846b717a1
7 changed files with 71 additions and 23 deletions

View File

@@ -101,22 +101,8 @@ std::string CGCreature::getHoverText(PlayerColor player) const
std::string CGCreature::getHoverText(const CGHeroInstance * hero) const
{
//VISIONS spell support
static const std::string cached = boost::to_string((boost::format("type_%d__subtype_0") % Bonus::VISIONS));
std::string hoverName;
const int visionsMultiplier = hero->valOfBonuses(Selector::typeSubtype(Bonus::VISIONS,0), cached);
int visionsRadius = visionsMultiplier * hero->getPrimSkillLevel(PrimarySkill::SPELL_POWER);
if (visionsMultiplier > 0)
vstd::amin(visionsRadius, 3); //minimum range is 3 tiles, but only if VISIONS bonus present
const bool inVisionsRange = (pos.dist2d(hero->pos) < visionsRadius) && (pos.z == hero->pos.z);
if(inVisionsRange)
if(hero->hasVisions(this, 0))
{
MetaString ms;
ms << stacks.begin()->second->count;