1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

* fixed bug 298

* fixed INDEPENDENT_MIN bonus value type
* minor changes
This commit is contained in:
mateuszb
2011-02-21 16:53:23 +00:00
parent 43468e16e1
commit 1458cf64c2
10 changed files with 147 additions and 39 deletions

View File

@ -188,6 +188,21 @@ std::set<ui16> CSpell::rangeInHexes(unsigned int centralHex, ui8 schoolLvl ) con
return ret;
}
CSpell::ETargetType CSpell::getTargetType() const
{
if(attributes.find("CREATURE_TARGET_1") != std::string::npos
|| attributes.find("CREATURE_TARGET_2") != std::string::npos)
return CREATURE_EXPERT_MASSIVE;
if(attributes.find("CREATURE_TARGET") != std::string::npos)
return CREATURE;
if(attributes.find("OBSTACLE_TARGET") != std::string::npos)
return OBSTACLE;
return NO_TARGET;
}
static bool startsWithX(const std::string &s)
{
return s.size() && s[0] == 'x';