1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-09-16 09:26:28 +02:00

Initial implementation of VIEW_AIR & VIEW_EARTH

This commit is contained in:
AlexVinS
2015-02-02 15:02:27 +03:00
parent 1333f8e410
commit f6e83685e7
8 changed files with 145 additions and 24 deletions

View File

@@ -2189,6 +2189,27 @@ void CPlayerInterface::advmapSpellCast(const CGHeroInstance * caster, int spellI
}
const CSpell * spell = CGI->spellh->objects[spellID];
if(spellID == SpellID::VIEW_AIR)
{
int level = caster->getSpellSchoolLevel(spell);
adventureInt->worldViewOptions.showAllArtifacts = true;
adventureInt->worldViewOptions.showAllHeroes = (level>1);
adventureInt->worldViewOptions.showAllTowns = (level>2);
viewWorldMap();
}
else if(spellID == SpellID::VIEW_EARTH)
{
int level = caster->getSpellSchoolLevel(spell);
adventureInt->worldViewOptions.showAllResources = true;
adventureInt->worldViewOptions.showAllMines = (level>1);
adventureInt->worldViewOptions.showAllTerrain = (level>2);
viewWorldMap();
}
auto castSoundPath = spell->getCastSound();
if (!castSoundPath.empty())
CCS->soundh->playSound(castSoundPath);