From b9bdc95a7eb7796be15a0ec8fe9b6e781b6af80f Mon Sep 17 00:00:00 2001 From: AlexVinS Date: Fri, 6 Feb 2015 19:07:03 +0300 Subject: [PATCH] Handle monster agressivness for VISIONS spell --- lib/mapObjects/MiscObjects.cpp | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/lib/mapObjects/MiscObjects.cpp b/lib/mapObjects/MiscObjects.cpp index e67e3a372..96f6b6e7b 100644 --- a/lib/mapObjects/MiscObjects.cpp +++ b/lib/mapObjects/MiscObjects.cpp @@ -103,11 +103,33 @@ std::string CGCreature::getHoverText(const CGHeroInstance * hero) const { std::string hoverName; if(hero->hasVisions(this, 0)) - { + { MetaString ms; ms << stacks.begin()->second->count; ms << " " ; ms.addTxt(MetaString::CRE_PL_NAMES,subID); + + ms << "\n"; + + int decision = takenAction(hero, true); + + switch (decision) + { + case FIGHT: + ms.addTxt(MetaString::GENERAL_TXT,246); + break; + case FLEE: + ms.addTxt(MetaString::GENERAL_TXT,245); + break; + case JOIN_FOR_FREE: + ms.addTxt(MetaString::GENERAL_TXT,243); + break; + default: //decision = cost in gold + VLC->generaltexth->allTexts[244]; + ms << boost::to_string(boost::format(VLC->generaltexth->allTexts[244]) % decision); + break; + } + ms.toString(hoverName); } else