mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-24 08:32:34 +02:00
parent
f4f2af664f
commit
0dbd7ee3c8
@ -3150,10 +3150,15 @@ void CBattleInterface::spellCast( const BattleSpellCast * sc )
|
||||
{
|
||||
boost::algorithm::replace_first(text, "%s", curInt->cb->battleGetFightingHero(sc->side)->name);
|
||||
}
|
||||
else
|
||||
else if(sc->attackerType < CGI->creh->creatures.size())
|
||||
{
|
||||
boost::algorithm::replace_first(text, "%s", CGI->creh->creatures[sc->attackerType]->namePl); //creature caster
|
||||
}
|
||||
else
|
||||
{
|
||||
//TODO artifacts that cast spell; scripts some day
|
||||
boost::algorithm::replace_first(text, "Something", CGI->creh->creatures[sc->attackerType]->namePl); //creature caster
|
||||
}
|
||||
boost::algorithm::replace_first(text, "%s", CGI->spellh->spells[sc->id]->name);
|
||||
console->addText(text);
|
||||
}
|
||||
|
2
global.h
2
global.h
@ -34,7 +34,7 @@ typedef si32 TBonusSubtype;
|
||||
#define THC
|
||||
#endif
|
||||
|
||||
#define NAME_VER ("VCMI 0.84d")
|
||||
#define NAME_VER ("VCMI 0.85")
|
||||
extern std::string NAME; //full name
|
||||
extern std::string NAME_AFFIX; //client / server
|
||||
#define CONSOLE_LOGGING_LEVEL 5
|
||||
|
@ -819,7 +819,8 @@ int3 CGameInfoCallback::getMapSize() const
|
||||
std::vector<const CGHeroInstance *> CGameInfoCallback::getAvailableHeroes(const CGObjectInstance * townOrTavern) const
|
||||
{
|
||||
std::vector<const CGHeroInstance *> ret;
|
||||
ERROR_RET_VAL_IF(!isOwnedOrVisited(townOrTavern), "Town or tavern must be owned or visited!", ret);
|
||||
//ERROR_RET_VAL_IF(!isOwnedOrVisited(townOrTavern), "Town or tavern must be owned or visited!", ret);
|
||||
//TODO: town needs to be owned, advmap tavern needs to be visited; to be reimplemented when visit tracking is done
|
||||
ret.resize(gs->players[player].availableHeroes.size());
|
||||
std::copy(gs->players[player].availableHeroes.begin(),gs->players[player].availableHeroes.end(),ret.begin());
|
||||
return ret;
|
||||
|
@ -1370,7 +1370,7 @@ struct BattleSpellCast : public CPackForClient//3009
|
||||
ui16 tile; //destination tile (may not be set in some global/mass spells
|
||||
std::vector<ui32> resisted; //ids of creatures that resisted this spell
|
||||
std::set<ui32> affectedCres; //ids of creatures affected by this spell, generally used if spell does not set any effect (like dispel or cure)
|
||||
TCreature attackerType;//id of caster to generate console message
|
||||
TCreature attackerType;//id of caster to generate console message; -1 if not set (eg. spell casted by artifact)
|
||||
ui8 castedByHero; //if true - spell has been casted by hero, otherwise by a creature
|
||||
template <typename Handler> void serialize(Handler &h, const int version)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user