1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-19 21:10:12 +02:00

Support for Aurora Borealis

This commit is contained in:
DjWarmonger 2010-06-19 10:42:30 +00:00
parent a53be2d382
commit db2bde9ae2
2 changed files with 14 additions and 3 deletions

View File

@ -17,6 +17,7 @@
* Full text of license available in license.txt file, in main folder * Full text of license available in license.txt file, in main folder
* *
*/ */
typedef ui16 spelltype;
class DLL_EXPORT CSpell class DLL_EXPORT CSpell
{ {

View File

@ -1578,6 +1578,15 @@ void CGameHandler::giveSpells( const CGTownInstance *t, const CGHeroInstance *h
cs.hid = h->id; cs.hid = h->id;
cs.learn = true; cs.learn = true;
for(int i=0; i<std::min(t->mageGuildLevel(),h->getSecSkillLevel(7)+2);i++) for(int i=0; i<std::min(t->mageGuildLevel(),h->getSecSkillLevel(7)+2);i++)
{
if (t->subID == 8 && vstd::contains(t->builtBuildings, 26)) //Aurora Borealis
{
std::vector<ui16> spells;
getAllowedSpells(spells, i);
for (int j = 0; j < spells.size(); ++j)
cs.spells.insert(spells[j]);
}
else
{ {
for(int j=0; j<t->spellsAtLevel(i+1,true) && j<t->spells[i].size(); j++) for(int j=0; j<t->spellsAtLevel(i+1,true) && j<t->spells[i].size(); j++)
{ {
@ -1585,6 +1594,7 @@ void CGameHandler::giveSpells( const CGTownInstance *t, const CGHeroInstance *h
cs.spells.insert(t->spells[i][j]); cs.spells.insert(t->spells[i][j]);
} }
} }
}
if(cs.spells.size()) if(cs.spells.size())
sendAndApply(&cs); sendAndApply(&cs);
} }