mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-06 09:09:40 +02:00
* New files for lib: CBattleCallback.cpp and CBattleCallback.h
* Updated MSVC project files * Filesystem: My version of .SND archive does not have \0 after WAV extension. Fixed (though hardcoded 3-char extension length). * New bonus types: BLOCK_MAGIC_ABOVE for blocking casting spells above given level and BLOCK_ALL_MAGIC for blocking all magic. * Heavy rewrite of battle callbacks. Fixed some minor bugs. Code reusage between lib/client/server (removed proxy calls). Better access control and support for various perspectives. * Fixed #1031 * Fixed Orb of Inhibition and Recanter's Cloak (they were incorrectly implemented). Fixed #97. * Fleeing hero won't lose artifacts. Spellbook won't be captured. Fixed #980. * Fixed crash when attacking stack dies before counterattack (ie. because of Fire Shield) * Server does some basic checks if action requests during battle are valid * Minor stuff.
This commit is contained in:
@@ -654,9 +654,24 @@ void CSpellWindow::SpellArea::clickLeft(tribool down, bool previousState)
|
||||
break;
|
||||
case ESpellCastProblem::SPELL_LEVEL_LIMIT_EXCEEDED:
|
||||
{
|
||||
std::string text = CGI->generaltexth->allTexts[541], caster = owner->myHero->name;
|
||||
text = boost::str(boost::format(text) % caster);
|
||||
owner->myInt->showInfoDialog(text);
|
||||
//Recanter's Cloak or similar effect. Try to retrieve bonus
|
||||
const Bonus *b = owner->myHero->getBonus(Selector::type(Bonus::BLOCK_MAGIC_ABOVE));
|
||||
//TODO what about other values and non-artifact sources?
|
||||
if(b && b->val == 2 && b->source == Bonus::ARTIFACT)
|
||||
{
|
||||
std::string artName = CGI->arth->artifacts[b->sid]->Name();
|
||||
//The %s prevents %s from casting 3rd level or higher spells.
|
||||
owner->myInt->showInfoDialog(boost::str(boost::format(CGI->generaltexth->allTexts[536])
|
||||
% artName % owner->myHero->name));
|
||||
}
|
||||
else
|
||||
{
|
||||
// General message:
|
||||
// %s recites the incantations but they seem to have no effect.
|
||||
std::string text = CGI->generaltexth->allTexts[541], caster = owner->myHero->name;
|
||||
text = boost::str(boost::format(text) % caster);
|
||||
owner->myInt->showInfoDialog(text);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ESpellCastProblem::NO_APPROPRIATE_TARGET:
|
||||
|
||||
Reference in New Issue
Block a user