1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-15 01:24:45 +02:00

* added slow spell

* a few mistakes in AC_desc.txt fixed
* appropriate spells cannot be casted at any tile
* small memory optimizations in CDefHandler
* minor fixes
This commit is contained in:
mateuszb
2008-11-11 15:17:58 +00:00
parent 6b9146f998
commit d2db5ba18e
9 changed files with 152 additions and 28 deletions

View File

@ -5,6 +5,7 @@
#include "CLodHandler.h"
#include "CDefObjInfoHandler.h"
#include "CHeroHandler.h"
#include "CSpellHandler.h"
#include <boost/algorithm/string/replace.hpp>
#include <boost/random/linear_congruential.hpp>
#include "CTownHandler.h"
@ -407,6 +408,33 @@ const CArtifact * CGHeroInstance::getArt(int pos) const
else
return NULL;
}
int CGHeroInstance::getSpellSecLevel(int spell) const
{
int bestslvl = 0;
if(VLC->spellh->spells[spell].air)
if(getSecSkillLevel(15) >= bestslvl)
{
bestslvl = getSecSkillLevel(15);
}
if(VLC->spellh->spells[spell].fire)
if(getSecSkillLevel(14) >= bestslvl)
{
bestslvl = getSecSkillLevel(14);
}
if(VLC->spellh->spells[spell].water)
if(getSecSkillLevel(16) >= bestslvl)
{
bestslvl = getSecSkillLevel(16);
}
if(VLC->spellh->spells[spell].earth)
if(getSecSkillLevel(17) >= bestslvl)
{
bestslvl = getSecSkillLevel(17);
}
return bestslvl;
}
int CGTownInstance::getSightDistance() const //returns sight distance
{
return 10;