mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-15 01:24:45 +02:00
tweaks
This commit is contained in:
@ -311,7 +311,7 @@ BattleAction CBattleAI::useCatapult(const CStack * stack)
|
|||||||
if(cb->battleGetGateState() == EGateState::CLOSED)
|
if(cb->battleGetGateState() == EGateState::CLOSED)
|
||||||
{
|
{
|
||||||
targetHex = cb->wallPartToBattleHex(EWallPart::GATE);
|
targetHex = cb->wallPartToBattleHex(EWallPart::GATE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
EWallPart::EWallPart wallParts[] = {
|
EWallPart::EWallPart wallParts[] = {
|
||||||
|
@ -10,6 +10,9 @@
|
|||||||
#include "StdInc.h"
|
#include "StdInc.h"
|
||||||
#include "CComponent.h"
|
#include "CComponent.h"
|
||||||
|
|
||||||
|
#include <vcmi/spells/Service.h>
|
||||||
|
#include <vcmi/spells/Spell.h>
|
||||||
|
|
||||||
#include "../gui/CGuiHandler.h"
|
#include "../gui/CGuiHandler.h"
|
||||||
#include "../gui/CCursorHandler.h"
|
#include "../gui/CCursorHandler.h"
|
||||||
|
|
||||||
@ -23,7 +26,6 @@
|
|||||||
#include "../../lib/CTownHandler.h"
|
#include "../../lib/CTownHandler.h"
|
||||||
#include "../../lib/CCreatureHandler.h"
|
#include "../../lib/CCreatureHandler.h"
|
||||||
#include "../../lib/CSkillHandler.h"
|
#include "../../lib/CSkillHandler.h"
|
||||||
#include "../../lib/spells/CSpellHandler.h"
|
|
||||||
#include "../../lib/CGeneralTextHandler.h"
|
#include "../../lib/CGeneralTextHandler.h"
|
||||||
#include "../../lib/NetPacksBase.h"
|
#include "../../lib/NetPacksBase.h"
|
||||||
|
|
||||||
@ -164,7 +166,7 @@ std::string CComponent::getDescription()
|
|||||||
return art->getEffectiveDescription();
|
return art->getEffectiveDescription();
|
||||||
}
|
}
|
||||||
case experience: return CGI->generaltexth->allTexts[241];
|
case experience: return CGI->generaltexth->allTexts[241];
|
||||||
case spell: return CGI->spellh->objects[subtype]->getLevelDescription(val);
|
case spell: return SpellID(subtype).toSpell(CGI->spells())->getLevelDescription(val);
|
||||||
case morale: return CGI->generaltexth->heroscrn[ 4 - (val>0) + (val<0)];
|
case morale: return CGI->generaltexth->heroscrn[ 4 - (val>0) + (val<0)];
|
||||||
case luck: return CGI->generaltexth->heroscrn[ 7 - (val>0) + (val<0)];
|
case luck: return CGI->generaltexth->heroscrn[ 7 - (val>0) + (val<0)];
|
||||||
case building: return (*CGI->townh)[subtype]->town->buildings[BuildingID(val)]->Description();
|
case building: return (*CGI->townh)[subtype]->town->buildings[BuildingID(val)]->Description();
|
||||||
|
@ -761,13 +761,13 @@ std::string CArtifactInstance::getEffectiveDescription(const CGHeroInstance * he
|
|||||||
// we expect scroll description to be like this: This scroll contains the [spell name] spell which is added into your spell book for as long as you carry the scroll.
|
// we expect scroll description to be like this: This scroll contains the [spell name] spell which is added into your spell book for as long as you carry the scroll.
|
||||||
// so we want to replace text in [...] with a spell name
|
// so we want to replace text in [...] with a spell name
|
||||||
// however other language versions don't have name placeholder at all, so we have to be careful
|
// however other language versions don't have name placeholder at all, so we have to be careful
|
||||||
int32_t spellID = getGivenSpellID();
|
SpellID spellID = getGivenSpellID();
|
||||||
size_t nameStart = text.find_first_of('[');
|
size_t nameStart = text.find_first_of('[');
|
||||||
size_t nameEnd = text.find_first_of(']', nameStart);
|
size_t nameEnd = text.find_first_of(']', nameStart);
|
||||||
if(spellID >= 0)
|
if(spellID.getNum() >= 0)
|
||||||
{
|
{
|
||||||
if(nameStart != std::string::npos && nameEnd != std::string::npos)
|
if(nameStart != std::string::npos && nameEnd != std::string::npos)
|
||||||
text = text.replace(nameStart, nameEnd - nameStart + 1, VLC->spellh->objects[spellID]->name);
|
text = text.replace(nameStart, nameEnd - nameStart + 1, spellID.toSpell(VLC->spells())->getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(hero && artType->constituentOf.size()) //display info about set
|
else if(hero && artType->constituentOf.size()) //display info about set
|
||||||
|
@ -11,6 +11,8 @@
|
|||||||
#include "StdInc.h"
|
#include "StdInc.h"
|
||||||
#include "CQuest.h"
|
#include "CQuest.h"
|
||||||
|
|
||||||
|
#include <vcmi/spells/Spell.h>
|
||||||
|
|
||||||
#include "../NetPacks.h"
|
#include "../NetPacks.h"
|
||||||
#include "../CSoundBase.h"
|
#include "../CSoundBase.h"
|
||||||
#include "../CGeneralTextHandler.h"
|
#include "../CGeneralTextHandler.h"
|
||||||
@ -23,7 +25,6 @@
|
|||||||
#include "../CModHandler.h"
|
#include "../CModHandler.h"
|
||||||
#include "../GameConstants.h"
|
#include "../GameConstants.h"
|
||||||
#include "../StringConstants.h"
|
#include "../StringConstants.h"
|
||||||
#include "../spells/CSpellHandler.h"
|
|
||||||
#include "../CSkillHandler.h"
|
#include "../CSkillHandler.h"
|
||||||
#include "../mapping/CMap.h"
|
#include "../mapping/CMap.h"
|
||||||
|
|
||||||
|
@ -1773,7 +1773,7 @@ void CGScholar::serializeJsonOptions(JsonSerializeFormat & handler)
|
|||||||
handler.serializeString("rewardSkill", value);
|
handler.serializeString("rewardSkill", value);
|
||||||
break;
|
break;
|
||||||
case SPELL:
|
case SPELL:
|
||||||
value = VLC->spellh->objects.at(bonusID)->identifier;
|
value = SpellID::encode(bonusID);
|
||||||
handler.serializeString("rewardSpell", value);
|
handler.serializeString("rewardSpell", value);
|
||||||
break;
|
break;
|
||||||
case RANDOM:
|
case RANDOM:
|
||||||
|
Reference in New Issue
Block a user