mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-03 00:46:55 +02:00
[refactor] a few more cleanups
This commit is contained in:
@ -48,7 +48,6 @@ void CGDefInfo::fetchInfoFromMSK()
|
|||||||
|
|
||||||
void CDefObjInfoHandler::load()
|
void CDefObjInfoHandler::load()
|
||||||
{
|
{
|
||||||
VLC->dobjinfo = this;
|
|
||||||
auto textFile = CResourceHandler::get()->loadData(ResourceID("DATA/ZOBJCTS.TXT"));
|
auto textFile = CResourceHandler::get()->loadData(ResourceID("DATA/ZOBJCTS.TXT"));
|
||||||
|
|
||||||
std::istringstream inp(std::string((char*)textFile.first.get(), textFile.second));
|
std::istringstream inp(std::string((char*)textFile.first.get(), textFile.second));
|
||||||
@ -103,7 +102,23 @@ void CDefObjInfoHandler::load()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
static int visitableFromTop[] = {29, 82, 86, 11, 59, 8, 111,33,81,12,9,212,215,22}; //sea chest, flotsam, shipwreck survivor, buoy, ocean bottle, boat, whirlpool, garrison, scholar, campfire, borderguard, bordergate, questguard, corpse
|
using namespace Obj;
|
||||||
|
static int visitableFromTop[] =
|
||||||
|
{FLOTSAM,
|
||||||
|
SEA_CHEST,
|
||||||
|
SHIPWRECK_SURVIVOR,
|
||||||
|
BUOY,
|
||||||
|
OCEAN_BOTTLE,
|
||||||
|
BOAT,
|
||||||
|
WHIRLPOOL,
|
||||||
|
GARRISON,
|
||||||
|
SCHOLAR,
|
||||||
|
CAMPFIRE,
|
||||||
|
BORDERGUARD,
|
||||||
|
BORDER_GATE,
|
||||||
|
QUEST_GUARD,
|
||||||
|
CORPSE};
|
||||||
|
|
||||||
for(int i=0; i < ARRAY_COUNT(visitableFromTop); i++)
|
for(int i=0; i < ARRAY_COUNT(visitableFromTop); i++)
|
||||||
{
|
{
|
||||||
if(visitableFromTop[i] == nobj->id)
|
if(visitableFromTop[i] == nobj->id)
|
||||||
@ -130,9 +145,9 @@ void CDefObjInfoHandler::load()
|
|||||||
|
|
||||||
if(i)
|
if(i)
|
||||||
{
|
{
|
||||||
gobjs[124][i] = new CGDefInfo(*gobjs[124][0]);
|
gobjs[Obj::HOLE][i] = new CGDefInfo(*gobjs[Obj::HOLE][0]);
|
||||||
}
|
}
|
||||||
gobjs[124][i]->name = holeDefs[i];
|
gobjs[Obj::HOLE][i]->name = holeDefs[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,6 +83,12 @@ static void showInfoDialog(const CGHeroInstance* h, const ui32 txtID, const ui16
|
|||||||
showInfoDialog(playerID,txtID,soundID);
|
showInfoDialog(playerID,txtID,soundID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::string & visitedTxt(const bool visited)
|
||||||
|
{
|
||||||
|
int id = visited ? 352 : 353;
|
||||||
|
return VLC->generaltexth->allTexts[id];
|
||||||
|
}
|
||||||
|
|
||||||
///IObjectInterface
|
///IObjectInterface
|
||||||
void IObjectInterface::onHeroVisit(const CGHeroInstance * h) const
|
void IObjectInterface::onHeroVisit(const CGHeroInstance * h) const
|
||||||
{}
|
{}
|
||||||
@ -465,10 +471,8 @@ void CGObjectInstance::getNameVis( std::string &hname ) const
|
|||||||
hname = VLC->generaltexth->names[ID];
|
hname = VLC->generaltexth->names[ID];
|
||||||
if(h)
|
if(h)
|
||||||
{
|
{
|
||||||
if(!h->hasBonusFrom(Bonus::OBJECT,ID))
|
const bool visited = h->hasBonusFrom(Bonus::OBJECT,ID);
|
||||||
hname += " " + VLC->generaltexth->allTexts[353]; //not visited
|
hname + " " + visitedTxt(visited);
|
||||||
else
|
|
||||||
hname += " " + VLC->generaltexth->allTexts[352]; //visited
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1604,7 +1608,7 @@ void CGDwelling::initObj()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGDwelling::setProperty(ui8 what, ui32 val)
|
void CGDwelling::setPropertyDer(ui8 what, ui32 val)
|
||||||
{
|
{
|
||||||
switch (what)
|
switch (what)
|
||||||
{
|
{
|
||||||
@ -2768,9 +2772,8 @@ const std::string & CGVisitableOPH::getHoverText() const
|
|||||||
if(h)
|
if(h)
|
||||||
{
|
{
|
||||||
hoverName += "\n\n";
|
hoverName += "\n\n";
|
||||||
hoverName += (vstd::contains(visitors,h->id))
|
bool visited = vstd::contains(visitors,h->id);
|
||||||
? (VLC->generaltexth->allTexts[352]) //visited
|
hoverName += visitedTxt(visited);
|
||||||
: ( VLC->generaltexth->allTexts[353]); //not visited
|
|
||||||
}
|
}
|
||||||
return hoverName;
|
return hoverName;
|
||||||
}
|
}
|
||||||
@ -2794,7 +2797,7 @@ void CGVisitableOPH::schoolSelected(int heroID, ui32 which) const
|
|||||||
|
|
||||||
int base = (ID == Obj::SCHOOL_OF_MAGIC ? 2 : 0);
|
int base = (ID == Obj::SCHOOL_OF_MAGIC ? 2 : 0);
|
||||||
cb->setObjProperty(id, ObjProperty::VISITORS, heroID); //add to the visitors
|
cb->setObjProperty(id, ObjProperty::VISITORS, heroID); //add to the visitors
|
||||||
cb->giveResource(cb->getOwner(heroID),6,-1000); //take 1000 gold
|
cb->giveResource(cb->getOwner(heroID),Res::GOLD,-1000); //take 1000 gold
|
||||||
cb->changePrimSkill(heroID, base + which-1, +1); //give appropriate skill
|
cb->changePrimSkill(heroID, base + which-1, +1); //give appropriate skill
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2826,7 +2829,7 @@ void COPWBonus::onHeroVisit (const CGHeroInstance * h) const
|
|||||||
switch (town->subID)
|
switch (town->subID)
|
||||||
{
|
{
|
||||||
case ETownType::CASTLE: //Stables
|
case ETownType::CASTLE: //Stables
|
||||||
if (!h->hasBonusFrom(Bonus::OBJECT, 94)) //does not stack with advMap Stables
|
if (!h->hasBonusFrom(Bonus::OBJECT, Obj::STABLES)) //does not stack with advMap Stables
|
||||||
{
|
{
|
||||||
GiveBonus gb;
|
GiveBonus gb;
|
||||||
gb.bonus = Bonus(Bonus::ONE_WEEK, Bonus::LAND_MOVEMENT, Bonus::OBJECT, 600, 94, VLC->generaltexth->arraytxt[100]);
|
gb.bonus = Bonus(Bonus::ONE_WEEK, Bonus::LAND_MOVEMENT, Bonus::OBJECT, 600, 94, VLC->generaltexth->arraytxt[100]);
|
||||||
@ -3593,7 +3596,7 @@ void CGVisitableOPW::onHeroVisit( const CGHeroInstance * h ) const
|
|||||||
cb->showInfoDialog(&iw);
|
cb->showInfoDialog(&iw);
|
||||||
cb->setObjProperty(id, ObjProperty::VISITED, true);
|
cb->setObjProperty(id, ObjProperty::VISITED, true);
|
||||||
MetaString ms; //set text to "visited"
|
MetaString ms; //set text to "visited"
|
||||||
ms << std::pair<ui8,ui32>(3,ID) << " " << std::pair<ui8,ui32>(1,352);
|
ms.addTxt(MetaString::OBJ_NAMES,ID); ms << " "; ms.addTxt(MetaString::GENERAL_TXT,352);
|
||||||
cb->setHoverName(id,&ms);
|
cb->setHoverName(id,&ms);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4745,25 +4748,24 @@ void CGWitchHut::onHeroVisit( const CGHeroInstance * h ) const
|
|||||||
iw.player = h->getOwner();
|
iw.player = h->getOwner();
|
||||||
if(!wasVisited(h->tempOwner))
|
if(!wasVisited(h->tempOwner))
|
||||||
cb->setObjProperty(id,10,h->tempOwner);
|
cb->setObjProperty(id,10,h->tempOwner);
|
||||||
|
ui32 txt_id;
|
||||||
if(h->getSecSkillLevel(static_cast<CGHeroInstance::SecondarySkill>(ability))) //you alredy know this skill
|
if(h->getSecSkillLevel(static_cast<CGHeroInstance::SecondarySkill>(ability))) //you alredy know this skill
|
||||||
{
|
{
|
||||||
iw.text.addTxt(MetaString::ADVOB_TXT,172);
|
txt_id =172;
|
||||||
iw.text.addReplacement(MetaString::SEC_SKILL_NAME, ability);
|
|
||||||
}
|
}
|
||||||
else if(!h->canLearnSkill()) //already all skills slots used
|
else if(!h->canLearnSkill()) //already all skills slots used
|
||||||
{
|
{
|
||||||
iw.text.addTxt(MetaString::ADVOB_TXT,173);
|
txt_id = 173;
|
||||||
iw.text.addReplacement(MetaString::SEC_SKILL_NAME, ability);
|
|
||||||
}
|
}
|
||||||
else //give sec skill
|
else //give sec skill
|
||||||
{
|
{
|
||||||
iw.components.push_back(Component(Component::SEC_SKILL, ability, 1, 0));
|
iw.components.push_back(Component(Component::SEC_SKILL, ability, 1, 0));
|
||||||
iw.text.addTxt(MetaString::ADVOB_TXT,171);
|
txt_id = 171;
|
||||||
iw.text.addReplacement(MetaString::SEC_SKILL_NAME, ability);
|
|
||||||
cb->changeSecSkill(h->id,ability,1,true);
|
cb->changeSecSkill(h->id,ability,1,true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
iw.text.addTxt(MetaString::ADVOB_TXT,txt_id);
|
||||||
|
iw.text.addReplacement(MetaString::SEC_SKILL_NAME, ability);
|
||||||
cb->showInfoDialog(&iw);
|
cb->showInfoDialog(&iw);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4980,10 +4982,8 @@ const std::string & CGBonusingObject::getHoverText() const
|
|||||||
hoverName = VLC->generaltexth->names[ID];
|
hoverName = VLC->generaltexth->names[ID];
|
||||||
if(h)
|
if(h)
|
||||||
{
|
{
|
||||||
if(!h->hasBonusFrom(Bonus::OBJECT,ID))
|
bool visited = h->hasBonusFrom(Bonus::OBJECT,ID);
|
||||||
hoverName += " " + VLC->generaltexth->allTexts[353]; //not visited
|
hoverName += " " + visitedTxt(visited);
|
||||||
else
|
|
||||||
hoverName += " " + VLC->generaltexth->allTexts[352]; //visited
|
|
||||||
}
|
}
|
||||||
return hoverName;
|
return hoverName;
|
||||||
}
|
}
|
||||||
@ -5018,11 +5018,7 @@ void CGMagicSpring::onHeroVisit(const CGHeroInstance * h) const
|
|||||||
|
|
||||||
const std::string & CGMagicSpring::getHoverText() const
|
const std::string & CGMagicSpring::getHoverText() const
|
||||||
{
|
{
|
||||||
hoverName = VLC->generaltexth->names[ID];
|
hoverName = VLC->generaltexth->names[ID] + " " + visitedTxt(visited);
|
||||||
if(!visited)
|
|
||||||
hoverName += " " + VLC->generaltexth->allTexts[353]; //not visited
|
|
||||||
else
|
|
||||||
hoverName += " " + VLC->generaltexth->allTexts[352]; //visited
|
|
||||||
return hoverName;
|
return hoverName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5489,10 +5485,11 @@ void CGSignBottle::onHeroVisit( const CGHeroInstance * h ) const
|
|||||||
cb->removeObject(id);
|
cb->removeObject(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGScholar::giveAnyBonus( const CGHeroInstance * h ) const
|
//TODO: remove
|
||||||
{
|
//void CGScholar::giveAnyBonus( const CGHeroInstance * h ) const
|
||||||
|
//{
|
||||||
}
|
//
|
||||||
|
//}
|
||||||
|
|
||||||
void CGScholar::onHeroVisit( const CGHeroInstance * h ) const
|
void CGScholar::onHeroVisit( const CGHeroInstance * h ) const
|
||||||
{
|
{
|
||||||
@ -5691,12 +5688,8 @@ void CGOnceVisitable::onHeroVisit( const CGHeroInstance * h ) const
|
|||||||
|
|
||||||
const std::string & CGOnceVisitable::getHoverText() const
|
const std::string & CGOnceVisitable::getHoverText() const
|
||||||
{
|
{
|
||||||
hoverName = VLC->generaltexth->names[ID] + " ";
|
const bool visited = wasVisited(cb->getCurrentPlayer());
|
||||||
|
hoverName = VLC->generaltexth->names[ID] + " " + visitedTxt(visited);
|
||||||
hoverName += (wasVisited(cb->getCurrentPlayer())
|
|
||||||
? (VLC->generaltexth->allTexts[352]) //visited
|
|
||||||
: ( VLC->generaltexth->allTexts[353])); //not visited
|
|
||||||
|
|
||||||
return hoverName;
|
return hoverName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5812,11 +5805,8 @@ void CBank::initObj()
|
|||||||
}
|
}
|
||||||
const std::string & CBank::getHoverText() const
|
const std::string & CBank::getHoverText() const
|
||||||
{
|
{
|
||||||
hoverName = VLC->objh->creBanksNames[index];
|
bool visited = (bc == nullptr);
|
||||||
if (bc == NULL)
|
hoverName = VLC->objh->creBanksNames[index] + " " + visitedTxt(visited);
|
||||||
hoverName += " " + VLC->generaltexth->allTexts[352];
|
|
||||||
else
|
|
||||||
hoverName += " " + VLC->generaltexth->allTexts[353];
|
|
||||||
return hoverName;
|
return hoverName;
|
||||||
}
|
}
|
||||||
void CBank::reset(ui16 var1) //prevents desync
|
void CBank::reset(ui16 var1) //prevents desync
|
||||||
@ -6185,11 +6175,7 @@ void CGPyramid::initObj()
|
|||||||
}
|
}
|
||||||
const std::string & CGPyramid::getHoverText() const
|
const std::string & CGPyramid::getHoverText() const
|
||||||
{
|
{
|
||||||
hoverName = VLC->objh->creBanksNames[21];
|
hoverName = VLC->objh->creBanksNames[21]+ " " + visitedTxt((bc==nullptr));
|
||||||
if (bc == NULL)
|
|
||||||
hoverName += " " + VLC->generaltexth->allTexts[352];
|
|
||||||
else
|
|
||||||
hoverName += " " + VLC->generaltexth->allTexts[353];
|
|
||||||
return hoverName;
|
return hoverName;
|
||||||
}
|
}
|
||||||
void CGPyramid::onHeroVisit (const CGHeroInstance * h) const
|
void CGPyramid::onHeroVisit (const CGHeroInstance * h) const
|
||||||
@ -6253,6 +6239,14 @@ bool CGKeys::wasMyColorVisited (int player) const
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const std::string& CGKeys::getHoverText() const
|
||||||
|
{
|
||||||
|
bool visited = wasMyColorVisited (cb->getLocalPlayer());
|
||||||
|
hoverName = getName() + "\n" + visitedTxt(visited);
|
||||||
|
return hoverName;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const std::string CGKeys::getName() const
|
const std::string CGKeys::getName() const
|
||||||
{
|
{
|
||||||
std::string name;
|
std::string name;
|
||||||
@ -6260,16 +6254,6 @@ const std::string CGKeys::getName() const
|
|||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string & CGKeymasterTent::getHoverText() const
|
|
||||||
{
|
|
||||||
hoverName = getName();
|
|
||||||
if (wasMyColorVisited (cb->getCurrentPlayer()) )//TODO: use local player, not current
|
|
||||||
hoverName += "\n" + VLC->generaltexth->allTexts[352];
|
|
||||||
else
|
|
||||||
hoverName += "\n" + VLC->generaltexth->allTexts[353];
|
|
||||||
return hoverName;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CGKeymasterTent::wasVisited (ui8 player) const
|
bool CGKeymasterTent::wasVisited (ui8 player) const
|
||||||
{
|
{
|
||||||
return wasMyColorVisited (player);
|
return wasMyColorVisited (player);
|
||||||
@ -6294,16 +6278,6 @@ void CGBorderGuard::initObj()
|
|||||||
blockVisit = true;
|
blockVisit = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string & CGBorderGuard::getHoverText() const
|
|
||||||
{
|
|
||||||
hoverName = getName();
|
|
||||||
if (wasMyColorVisited (cb->getCurrentPlayer()) )//TODO: use local player, not current
|
|
||||||
hoverName += "\n" + VLC->generaltexth->allTexts[352];
|
|
||||||
else
|
|
||||||
hoverName += "\n" + VLC->generaltexth->allTexts[353];
|
|
||||||
return hoverName;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CGBorderGuard::getVisitText (MetaString &text, std::vector<Component> &components, bool isCustom, bool FirstVisit, const CGHeroInstance * h) const
|
void CGBorderGuard::getVisitText (MetaString &text, std::vector<Component> &components, bool isCustom, bool FirstVisit, const CGHeroInstance * h) const
|
||||||
{
|
{
|
||||||
text << std::pair<ui8,ui32>(11,18);
|
text << std::pair<ui8,ui32>(11,18);
|
||||||
@ -6543,8 +6517,8 @@ void IBoatGenerator::getProblemText(MetaString &out, const CGHeroInstance *visit
|
|||||||
void IShipyard::getBoatCost( std::vector<si32> &cost ) const
|
void IShipyard::getBoatCost( std::vector<si32> &cost ) const
|
||||||
{
|
{
|
||||||
cost.resize(GameConstants::RESOURCE_QUANTITY);
|
cost.resize(GameConstants::RESOURCE_QUANTITY);
|
||||||
cost[0] = 10;
|
cost[Res::WOOD] = 10;
|
||||||
cost[6] = 1000;
|
cost[Res::GOLD] = 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
IShipyard::IShipyard(const CGObjectInstance *O)
|
IShipyard::IShipyard(const CGObjectInstance *O)
|
||||||
@ -6707,11 +6681,8 @@ void CGObelisk::initObj()
|
|||||||
|
|
||||||
const std::string & CGObelisk::getHoverText() const
|
const std::string & CGObelisk::getHoverText() const
|
||||||
{
|
{
|
||||||
hoverName = VLC->generaltexth->names[ID];
|
bool visited = wasVisited(cb->getLocalPlayer());
|
||||||
if(wasVisited(cb->getCurrentPlayer()))
|
hoverName = VLC->generaltexth->names[ID] + " " + visitedTxt(visited);
|
||||||
hoverName += " " + VLC->generaltexth->allTexts[352]; //not visited
|
|
||||||
else
|
|
||||||
hoverName += " " + VLC->generaltexth->allTexts[353]; //visited
|
|
||||||
return hoverName;
|
return hoverName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6805,11 +6776,11 @@ CArmedInstance::CArmedInstance()
|
|||||||
battle = NULL;
|
battle = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CArmedInstance::valOfGlobalBonuses(CSelector selector) const
|
//int CArmedInstance::valOfGlobalBonuses(CSelector selector) const
|
||||||
{
|
//{
|
||||||
//if (tempOwner != NEUTRAL_PLAYER)
|
//// if (tempOwner != NEUTRAL_PLAYER)
|
||||||
return cb->gameState()->players[tempOwner].valOfBonuses(selector);
|
// return cb->gameState()->players[tempOwner].valOfBonuses(selector);
|
||||||
}
|
//}
|
||||||
|
|
||||||
void CArmedInstance::updateMoraleBonusFromArmy()
|
void CArmedInstance::updateMoraleBonusFromArmy()
|
||||||
{
|
{
|
||||||
|
@ -163,9 +163,6 @@ public:
|
|||||||
|
|
||||||
class DLL_LINKAGE CGObjectInstance : public IObjectInterface
|
class DLL_LINKAGE CGObjectInstance : public IObjectInterface
|
||||||
{
|
{
|
||||||
protected:
|
|
||||||
void getNameVis(std::string &hname) const;
|
|
||||||
void giveDummyBonus(int heroID, ui8 duration = Bonus::ONE_DAY) const;
|
|
||||||
public:
|
public:
|
||||||
mutable std::string hoverName;
|
mutable std::string hoverName;
|
||||||
int3 pos; //h3m pos
|
int3 pos; //h3m pos
|
||||||
@ -201,11 +198,10 @@ public:
|
|||||||
//CGObjectInstance& operator=(const CGObjectInstance & right);
|
//CGObjectInstance& operator=(const CGObjectInstance & right);
|
||||||
virtual const std::string & getHoverText() const;
|
virtual const std::string & getHoverText() const;
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
///IObjectInterface
|
||||||
void initObj();
|
void initObj() override;
|
||||||
void onHeroVisit(const CGHeroInstance * h) const;
|
void onHeroVisit(const CGHeroInstance * h) const override;
|
||||||
void setProperty(ui8 what, ui32 val);//synchr
|
void setProperty(ui8 what, ui32 val) override;//synchr
|
||||||
virtual void setPropertyDer(ui8 what, ui32 val);//synchr
|
|
||||||
|
|
||||||
friend class CGameHandler;
|
friend class CGameHandler;
|
||||||
|
|
||||||
@ -215,6 +211,11 @@ public:
|
|||||||
h & hoverName & pos & ID & subID & id & animPhaseShift & tempOwner & blockVisit & defInfo;
|
h & hoverName & pos & ID & subID & id & animPhaseShift & tempOwner & blockVisit & defInfo;
|
||||||
//definfo is handled by map serializer
|
//definfo is handled by map serializer
|
||||||
}
|
}
|
||||||
|
protected:
|
||||||
|
virtual void setPropertyDer(ui8 what, ui32 val);//synchr
|
||||||
|
|
||||||
|
void getNameVis(std::string &hname) const;
|
||||||
|
void giveDummyBonus(int heroID, ui8 duration = Bonus::ONE_DAY) const;
|
||||||
};
|
};
|
||||||
class CGHeroPlaceholder : public CGObjectInstance
|
class CGHeroPlaceholder : public CGObjectInstance
|
||||||
{
|
{
|
||||||
@ -235,7 +236,7 @@ public:
|
|||||||
std::set<ui8> players; //players that visited this object
|
std::set<ui8> players; //players that visited this object
|
||||||
|
|
||||||
bool wasVisited(ui8 player) const;
|
bool wasVisited(ui8 player) const;
|
||||||
virtual void setPropertyDer( ui8 what, ui32 val );
|
void setPropertyDer(ui8 what, ui32 val) override;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
template <typename Handler> void serialize(Handler &h, const int version)
|
||||||
{
|
{
|
||||||
@ -252,10 +253,10 @@ public:
|
|||||||
void randomizeArmy(int type);
|
void randomizeArmy(int type);
|
||||||
void updateMoraleBonusFromArmy();
|
void updateMoraleBonusFromArmy();
|
||||||
|
|
||||||
void armyChanged() OVERRIDE;
|
void armyChanged() override;
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
int valOfGlobalBonuses(CSelector selector) const; //used only for castle interface ???
|
// int valOfGlobalBonuses(CSelector selector) const; //used only for castle interface ???
|
||||||
virtual CBonusSystemNode *whereShouldBeAttached(CGameState *gs);
|
virtual CBonusSystemNode *whereShouldBeAttached(CGameState *gs);
|
||||||
virtual CBonusSystemNode *whatShouldBeAttached();
|
virtual CBonusSystemNode *whatShouldBeAttached();
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
@ -417,15 +418,17 @@ public:
|
|||||||
virtual ~CGHeroInstance();
|
virtual ~CGHeroInstance();
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
ui8 bearerType() const OVERRIDE;
|
ui8 bearerType() const override;
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
virtual CBonusSystemNode *whereShouldBeAttached(CGameState *gs) OVERRIDE;
|
CBonusSystemNode *whereShouldBeAttached(CGameState *gs) override;
|
||||||
virtual std::string nodeName() const OVERRIDE;
|
std::string nodeName() const override;
|
||||||
void deserializationFix();
|
void deserializationFix();
|
||||||
void setPropertyDer(ui8 what, ui32 val);//synchr
|
|
||||||
void initObj();
|
void initObj() override;
|
||||||
void onHeroVisit(const CGHeroInstance * h) const;
|
void onHeroVisit(const CGHeroInstance * h) const override;
|
||||||
|
protected:
|
||||||
|
void setPropertyDer(ui8 what, ui32 val) override;//synchr
|
||||||
};
|
};
|
||||||
|
|
||||||
class DLL_LINKAGE CSpecObjInfo
|
class DLL_LINKAGE CSpecObjInfo
|
||||||
@ -466,10 +469,12 @@ public:
|
|||||||
h & static_cast<CArmedInstance&>(*this) & creatures;
|
h & static_cast<CArmedInstance&>(*this) & creatures;
|
||||||
}
|
}
|
||||||
|
|
||||||
void initObj();
|
void initObj() override;
|
||||||
void setProperty(ui8 what, ui32 val);
|
void onHeroVisit(const CGHeroInstance * h) const override;
|
||||||
void onHeroVisit(const CGHeroInstance * h) const;
|
void newTurn() const override;
|
||||||
void newTurn() const;
|
protected:
|
||||||
|
void setPropertyDer(ui8 what, ui32 val) override;
|
||||||
|
private:
|
||||||
void heroAcceptsCreatures(const CGHeroInstance *h, ui32 answer) const;
|
void heroAcceptsCreatures(const CGHeroInstance *h, ui32 answer) const;
|
||||||
void fightOver(const CGHeroInstance *h, BattleResult *result) const;
|
void fightOver(const CGHeroInstance *h, BattleResult *result) const;
|
||||||
void wantsFight(const CGHeroInstance *h, ui32 answer) const;
|
void wantsFight(const CGHeroInstance *h, ui32 answer) const;
|
||||||
@ -481,22 +486,26 @@ class DLL_LINKAGE CGVisitableOPH : public CGObjectInstance //objects visitable o
|
|||||||
public:
|
public:
|
||||||
std::set<si32> visitors; //ids of heroes who have visited this obj
|
std::set<si32> visitors; //ids of heroes who have visited this obj
|
||||||
si8 ttype; //tree type - used only by trees of knowledge: 0 - give level for free; 1 - take 2000 gold; 2 - take 10 gems
|
si8 ttype; //tree type - used only by trees of knowledge: 0 - give level for free; 1 - take 2000 gold; 2 - take 10 gems
|
||||||
const std::string & getHoverText() const;
|
|
||||||
|
|
||||||
void setPropertyDer(ui8 what, ui32 val);//synchr
|
const std::string & getHoverText() const override;
|
||||||
void onHeroVisit(const CGHeroInstance * h) const;
|
void onHeroVisit(const CGHeroInstance * h) const override;
|
||||||
void onNAHeroVisit(int heroID, bool alreadyVisited) const;
|
void initObj() override;
|
||||||
void initObj();
|
bool wasVisited (const CGHeroInstance * h) const override;
|
||||||
bool wasVisited (const CGHeroInstance * h) const;
|
|
||||||
void treeSelected(int heroID, int resType, int resVal, TExpType expVal, ui32 result) const; //handle player's anwer to the Tree of Knowledge dialog
|
|
||||||
void schoolSelected(int heroID, ui32 which) const;
|
|
||||||
void arenaSelected(int heroID, int primSkill) const;
|
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
template <typename Handler> void serialize(Handler &h, const int version)
|
||||||
{
|
{
|
||||||
h & static_cast<CGObjectInstance&>(*this);
|
h & static_cast<CGObjectInstance&>(*this);
|
||||||
h & visitors & ttype;
|
h & visitors & ttype;
|
||||||
}
|
}
|
||||||
|
protected:
|
||||||
|
void setPropertyDer(ui8 what, ui32 val) override;//synchr
|
||||||
|
private:
|
||||||
|
void onNAHeroVisit(int heroID, bool alreadyVisited) const;
|
||||||
|
///dialog callbacks
|
||||||
|
void treeSelected(int heroID, int resType, int resVal, TExpType expVal, ui32 result) const;
|
||||||
|
void schoolSelected(int heroID, ui32 which) const;
|
||||||
|
void arenaSelected(int heroID, int primSkill) const;
|
||||||
};
|
};
|
||||||
class DLL_LINKAGE CGTownBuilding : public IObjectInterface
|
class DLL_LINKAGE CGTownBuilding : public IObjectInterface
|
||||||
{
|
{
|
||||||
@ -515,8 +524,8 @@ class DLL_LINKAGE COPWBonus : public CGTownBuilding
|
|||||||
{///used for OPW bonusing structures
|
{///used for OPW bonusing structures
|
||||||
public:
|
public:
|
||||||
std::set<si32> visitors;
|
std::set<si32> visitors;
|
||||||
void setProperty(ui8 what, ui32 val);
|
void setProperty(ui8 what, ui32 val) override;
|
||||||
void onHeroVisit (const CGHeroInstance * h) const;
|
void onHeroVisit (const CGHeroInstance * h) const override;
|
||||||
|
|
||||||
COPWBonus (int index, CGTownInstance *TOWN);
|
COPWBonus (int index, CGTownInstance *TOWN);
|
||||||
COPWBonus (){ID = 0; town = NULL;};
|
COPWBonus (){ID = 0; town = NULL;};
|
||||||
@ -533,8 +542,8 @@ class DLL_LINKAGE CTownBonus : public CGTownBuilding
|
|||||||
///feel free to merge inheritance tree
|
///feel free to merge inheritance tree
|
||||||
public:
|
public:
|
||||||
std::set<si32> visitors;
|
std::set<si32> visitors;
|
||||||
void setProperty(ui8 what, ui32 val);
|
void setProperty(ui8 what, ui32 val) override;
|
||||||
void onHeroVisit (const CGHeroInstance * h) const;
|
void onHeroVisit (const CGHeroInstance * h) const override;
|
||||||
|
|
||||||
CTownBonus (int index, CGTownInstance *TOWN);
|
CTownBonus (int index, CGTownInstance *TOWN);
|
||||||
CTownBonus (){ID = 0; town = NULL;};
|
CTownBonus (){ID = 0; town = NULL;};
|
||||||
@ -604,8 +613,8 @@ public:
|
|||||||
}
|
}
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
virtual CBonusSystemNode *whatShouldBeAttached() OVERRIDE;
|
CBonusSystemNode *whatShouldBeAttached() override;
|
||||||
std::string nodeName() const OVERRIDE;
|
std::string nodeName() const override;
|
||||||
void deserializationFix();
|
void deserializationFix();
|
||||||
void recreateBuildingsBonuses();
|
void recreateBuildingsBonuses();
|
||||||
bool addBonusIfBuilt(int building, int type, int val, TPropagatorPtr prop, int subtype = -1); //returns true if building is built and bonus has been added
|
bool addBonusIfBuilt(int building, int type, int val, TPropagatorPtr prop, int subtype = -1); //returns true if building is built and bonus has been added
|
||||||
@ -622,11 +631,10 @@ public:
|
|||||||
int getSightRadious() const; //returns sight distance
|
int getSightRadious() const; //returns sight distance
|
||||||
int getBoatType() const; //0 - evil (if a ship can be evil...?), 1 - good, 2 - neutral
|
int getBoatType() const; //0 - evil (if a ship can be evil...?), 1 - good, 2 - neutral
|
||||||
void getOutOffsets(std::vector<int3> &offsets) const; //offsets to obj pos when we boat can be placed
|
void getOutOffsets(std::vector<int3> &offsets) const; //offsets to obj pos when we boat can be placed
|
||||||
int getMarketEfficiency() const; //=market count
|
int getMarketEfficiency() const override; //=market count
|
||||||
bool allowsTrade(EMarketMode::EMarketMode mode) const;
|
bool allowsTrade(EMarketMode::EMarketMode mode) const;
|
||||||
std::vector<int> availableItemsIds(EMarketMode::EMarketMode mode) const;
|
std::vector<int> availableItemsIds(EMarketMode::EMarketMode mode) const;
|
||||||
void setPropertyDer(ui8 what, ui32 val);
|
|
||||||
void newTurn() const;
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@ -651,13 +659,16 @@ public:
|
|||||||
CGTownInstance();
|
CGTownInstance();
|
||||||
virtual ~CGTownInstance();
|
virtual ~CGTownInstance();
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
///IObjectInterface overrides
|
||||||
|
void newTurn() const override;
|
||||||
|
void onHeroVisit(const CGHeroInstance * h) const override;
|
||||||
|
void onHeroLeave(const CGHeroInstance * h) const override;
|
||||||
|
void initObj() override;
|
||||||
|
protected:
|
||||||
|
void setPropertyDer(ui8 what, ui32 val) override;
|
||||||
|
private:
|
||||||
|
///dialog callbacks
|
||||||
void fightOver(const CGHeroInstance *h, BattleResult *result) const;
|
void fightOver(const CGHeroInstance *h, BattleResult *result) const;
|
||||||
void onHeroVisit(const CGHeroInstance * h) const;
|
|
||||||
void onHeroLeave(const CGHeroInstance * h) const;
|
|
||||||
void initObj();
|
|
||||||
};
|
};
|
||||||
class DLL_LINKAGE CGPandoraBox : public CArmedInstance
|
class DLL_LINKAGE CGPandoraBox : public CArmedInstance
|
||||||
{
|
{
|
||||||
@ -677,13 +688,8 @@ public:
|
|||||||
std::vector<si32> spells; //gained spells
|
std::vector<si32> spells; //gained spells
|
||||||
CCreatureSet creatures; //gained creatures
|
CCreatureSet creatures; //gained creatures
|
||||||
|
|
||||||
void initObj();
|
void initObj() override;
|
||||||
void onHeroVisit(const CGHeroInstance * h) const;
|
void onHeroVisit(const CGHeroInstance * h) const override;
|
||||||
void open (const CGHeroInstance * h, ui32 accept) const;
|
|
||||||
void endBattle(const CGHeroInstance *h, BattleResult *result) const;
|
|
||||||
void giveContents(const CGHeroInstance *h, bool afterBattle) const;
|
|
||||||
void getText( InfoWindow &iw, bool &afterBattle, int val, int negative, int positive, const CGHeroInstance * h ) const;
|
|
||||||
void getText( InfoWindow &iw, bool &afterBattle, int text, const CGHeroInstance * h ) const;
|
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
template <typename Handler> void serialize(Handler &h, const int version)
|
||||||
{
|
{
|
||||||
@ -691,6 +697,13 @@ public:
|
|||||||
h & message & gainedExp & manaDiff & moraleDiff & luckDiff & resources & primskills
|
h & message & gainedExp & manaDiff & moraleDiff & luckDiff & resources & primskills
|
||||||
& abilities & abilityLevels & artifacts & spells & creatures;
|
& abilities & abilityLevels & artifacts & spells & creatures;
|
||||||
}
|
}
|
||||||
|
protected:
|
||||||
|
void endBattle(const CGHeroInstance *h, BattleResult *result) const;
|
||||||
|
void giveContents(const CGHeroInstance *h, bool afterBattle) const;
|
||||||
|
private:
|
||||||
|
void open (const CGHeroInstance * h, ui32 accept) const;
|
||||||
|
void getText( InfoWindow &iw, bool &afterBattle, int val, int negative, int positive, const CGHeroInstance * h ) const;
|
||||||
|
void getText( InfoWindow &iw, bool &afterBattle, int text, const CGHeroInstance * h ) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
class DLL_LINKAGE CGEvent : public CGPandoraBox //event objects
|
class DLL_LINKAGE CGEvent : public CGPandoraBox //event objects
|
||||||
@ -707,9 +720,9 @@ public:
|
|||||||
h & removeAfterVisit & availableFor & computerActivate & humanActivate;
|
h & removeAfterVisit & availableFor & computerActivate & humanActivate;
|
||||||
}
|
}
|
||||||
|
|
||||||
void onHeroVisit(const CGHeroInstance * h) const;
|
void onHeroVisit(const CGHeroInstance * h) const override;
|
||||||
|
private:
|
||||||
void activated(const CGHeroInstance * h) const;
|
void activated(const CGHeroInstance * h) const;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class DLL_LINKAGE CGCreature : public CArmedInstance //creatures on map
|
class DLL_LINKAGE CGCreature : public CArmedInstance //creatures on map
|
||||||
@ -724,18 +737,12 @@ public:
|
|||||||
ui8 notGrowingTeam; //if true, number of units won't grow
|
ui8 notGrowingTeam; //if true, number of units won't grow
|
||||||
ui64 temppower; //used to handle fractional stack growth for tiny stacks
|
ui64 temppower; //used to handle fractional stack growth for tiny stacks
|
||||||
|
|
||||||
void fight(const CGHeroInstance *h) const;
|
|
||||||
void onHeroVisit(const CGHeroInstance * h) const;
|
|
||||||
const std::string & getHoverText() const;
|
|
||||||
|
|
||||||
void flee( const CGHeroInstance * h ) const;
|
void onHeroVisit(const CGHeroInstance * h) const override;
|
||||||
void endBattle(BattleResult *result) const;
|
const std::string & getHoverText() const override;
|
||||||
void fleeDecision(const CGHeroInstance *h, ui32 pursue) const;
|
void initObj() override;
|
||||||
void joinDecision(const CGHeroInstance *h, int cost, ui32 accept) const;
|
void newTurn() const override;
|
||||||
void initObj();
|
|
||||||
void newTurn() const;
|
|
||||||
void setPropertyDer(ui8 what, ui32 val);
|
|
||||||
int takenAction(const CGHeroInstance *h, bool allowJoin=true) const; //action on confrontation: -2 - fight, -1 - flee, >=0 - will join for given value of gold (may be 0)
|
|
||||||
|
|
||||||
struct DLL_LINKAGE RestoredCreature // info about merging stacks after battle back into one
|
struct DLL_LINKAGE RestoredCreature // info about merging stacks after battle back into one
|
||||||
{
|
{
|
||||||
@ -751,6 +758,18 @@ public:
|
|||||||
h & static_cast<CArmedInstance&>(*this);
|
h & static_cast<CArmedInstance&>(*this);
|
||||||
h & identifier & character & message & resources & gainedArtifact & neverFlees & notGrowingTeam & temppower & restore;
|
h & identifier & character & message & resources & gainedArtifact & neverFlees & notGrowingTeam & temppower & restore;
|
||||||
}
|
}
|
||||||
|
protected:
|
||||||
|
void setPropertyDer(ui8 what, ui32 val) override;
|
||||||
|
private:
|
||||||
|
|
||||||
|
void fight(const CGHeroInstance *h) const;
|
||||||
|
void flee( const CGHeroInstance * h ) const;
|
||||||
|
void endBattle(BattleResult *result) const;
|
||||||
|
void fleeDecision(const CGHeroInstance *h, ui32 pursue) const;
|
||||||
|
void joinDecision(const CGHeroInstance *h, int cost, ui32 accept) const;
|
||||||
|
|
||||||
|
int takenAction(const CGHeroInstance *h, bool allowJoin=true) const; //action on confrontation: -2 - fight, -1 - flee, >=0 - will join for given value of gold (may be 0)
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -759,8 +778,8 @@ class DLL_LINKAGE CGSignBottle : public CGObjectInstance //signs and ocean bottl
|
|||||||
public:
|
public:
|
||||||
std::string message;
|
std::string message;
|
||||||
|
|
||||||
void onHeroVisit(const CGHeroInstance * h) const;
|
void onHeroVisit(const CGHeroInstance * h) const override;
|
||||||
void initObj();
|
void initObj() override;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
template <typename Handler> void serialize(Handler &h, const int version)
|
||||||
{
|
{
|
||||||
@ -793,11 +812,10 @@ public:
|
|||||||
std::string seerName;
|
std::string seerName;
|
||||||
|
|
||||||
CGSeerHut() : IQuestObject(){};
|
CGSeerHut() : IQuestObject(){};
|
||||||
void initObj();
|
void initObj() override;
|
||||||
const std::string & getHoverText() const;
|
const std::string & getHoverText() const override;
|
||||||
void setPropertyDer (ui8 what, ui32 val);
|
void newTurn() const override;
|
||||||
void newTurn() const;
|
void onHeroVisit(const CGHeroInstance * h) const override;
|
||||||
void onHeroVisit (const CGHeroInstance * h) const;
|
|
||||||
|
|
||||||
int checkDirection() const; //calculates the region of map where monster is placed
|
int checkDirection() const; //calculates the region of map where monster is placed
|
||||||
void setObjToKill(); //remember creatures / heroes to kill after they are initialized
|
void setObjToKill(); //remember creatures / heroes to kill after they are initialized
|
||||||
@ -813,13 +831,15 @@ public:
|
|||||||
h & static_cast<CArmedInstance&>(*this) & static_cast<IQuestObject&>(*this);
|
h & static_cast<CArmedInstance&>(*this) & static_cast<IQuestObject&>(*this);
|
||||||
h & rewardType & rID & rVal & seerName;
|
h & rewardType & rID & rVal & seerName;
|
||||||
}
|
}
|
||||||
|
protected:
|
||||||
|
void setPropertyDer(ui8 what, ui32 val) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class DLL_LINKAGE CGQuestGuard : public CGSeerHut
|
class DLL_LINKAGE CGQuestGuard : public CGSeerHut
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CGQuestGuard() : CGSeerHut(){};
|
CGQuestGuard() : CGSeerHut(){};
|
||||||
void initObj();
|
void initObj() override;
|
||||||
void completeQuest (const CGHeroInstance * h) const;
|
void completeQuest (const CGHeroInstance * h) const;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
template <typename Handler> void serialize(Handler &h, const int version)
|
||||||
@ -834,9 +854,9 @@ public:
|
|||||||
std::vector<si32> allowedAbilities;
|
std::vector<si32> allowedAbilities;
|
||||||
ui32 ability;
|
ui32 ability;
|
||||||
|
|
||||||
const std::string & getHoverText() const;
|
const std::string & getHoverText() const override;
|
||||||
void onHeroVisit(const CGHeroInstance * h) const;
|
void onHeroVisit(const CGHeroInstance * h) const override;
|
||||||
void initObj();
|
void initObj() override;
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
template <typename Handler> void serialize(Handler &h, const int version)
|
||||||
{
|
{
|
||||||
h & static_cast<CPlayersVisited&>(*this);
|
h & static_cast<CPlayersVisited&>(*this);
|
||||||
@ -851,9 +871,9 @@ public:
|
|||||||
ui8 bonusType; //255 - random, 0 - primary skill, 1 - secondary skill, 2 - spell
|
ui8 bonusType; //255 - random, 0 - primary skill, 1 - secondary skill, 2 - spell
|
||||||
ui16 bonusID; //ID of skill/spell
|
ui16 bonusID; //ID of skill/spell
|
||||||
|
|
||||||
void giveAnyBonus(const CGHeroInstance * h) const; //FIXME: unused?
|
// void giveAnyBonus(const CGHeroInstance * h) const; //TODO: remove
|
||||||
void onHeroVisit(const CGHeroInstance * h) const;
|
void onHeroVisit(const CGHeroInstance * h) const override;
|
||||||
void initObj();
|
void initObj() override;
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
template <typename Handler> void serialize(Handler &h, const int version)
|
||||||
{
|
{
|
||||||
h & static_cast<CGObjectInstance&>(*this);
|
h & static_cast<CGObjectInstance&>(*this);
|
||||||
@ -867,7 +887,7 @@ public:
|
|||||||
ui8 removableUnits;
|
ui8 removableUnits;
|
||||||
|
|
||||||
ui8 getPassableness() const;
|
ui8 getPassableness() const;
|
||||||
void onHeroVisit (const CGHeroInstance *h) const;
|
void onHeroVisit(const CGHeroInstance * h) const override;
|
||||||
void fightOver (const CGHeroInstance *h, BattleResult *result) const;
|
void fightOver (const CGHeroInstance *h, BattleResult *result) const;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
template <typename Handler> void serialize(Handler &h, const int version)
|
||||||
@ -883,11 +903,11 @@ public:
|
|||||||
CArtifactInstance *storedArtifact;
|
CArtifactInstance *storedArtifact;
|
||||||
std::string message;
|
std::string message;
|
||||||
|
|
||||||
void onHeroVisit(const CGHeroInstance * h) const;
|
void onHeroVisit(const CGHeroInstance * h) const override;
|
||||||
void fightForArt(ui32 agreed, const CGHeroInstance *h) const;
|
void fightForArt(ui32 agreed, const CGHeroInstance *h) const;
|
||||||
void endBattle(BattleResult *result, const CGHeroInstance *h) const;
|
void endBattle(BattleResult *result, const CGHeroInstance *h) const;
|
||||||
void pick( const CGHeroInstance * h ) const;
|
void pick( const CGHeroInstance * h ) const;
|
||||||
void initObj();
|
void initObj() override;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
template <typename Handler> void serialize(Handler &h, const int version)
|
||||||
{
|
{
|
||||||
@ -902,9 +922,10 @@ public:
|
|||||||
ui32 amount; //0 if random
|
ui32 amount; //0 if random
|
||||||
std::string message;
|
std::string message;
|
||||||
|
|
||||||
void onHeroVisit(const CGHeroInstance * h) const;
|
void onHeroVisit(const CGHeroInstance * h) const override;
|
||||||
|
void initObj() override;
|
||||||
|
|
||||||
void collectRes(int player) const;
|
void collectRes(int player) const;
|
||||||
void initObj();
|
|
||||||
void fightForRes(ui32 agreed, const CGHeroInstance *h) const;
|
void fightForRes(ui32 agreed, const CGHeroInstance *h) const;
|
||||||
void endBattle(BattleResult *result, const CGHeroInstance *h) const;
|
void endBattle(BattleResult *result, const CGHeroInstance *h) const;
|
||||||
|
|
||||||
@ -920,8 +941,8 @@ class DLL_LINKAGE CGPickable : public CGObjectInstance //campfire, treasure ches
|
|||||||
public:
|
public:
|
||||||
ui32 type, val1, val2;
|
ui32 type, val1, val2;
|
||||||
|
|
||||||
void onHeroVisit(const CGHeroInstance * h) const;
|
void onHeroVisit(const CGHeroInstance * h) const override;
|
||||||
void initObj();
|
void initObj() override;
|
||||||
void chosen(int which, int heroID) const;
|
void chosen(int which, int heroID) const;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
template <typename Handler> void serialize(Handler &h, const int version)
|
||||||
@ -935,9 +956,9 @@ class DLL_LINKAGE CGShrine : public CPlayersVisited
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ui8 spell; //number of spell or 255 if random
|
ui8 spell; //number of spell or 255 if random
|
||||||
void onHeroVisit(const CGHeroInstance * h) const;
|
void onHeroVisit(const CGHeroInstance * h) const override;
|
||||||
void initObj();
|
void initObj() override;
|
||||||
const std::string & getHoverText() const;
|
const std::string & getHoverText() const override;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
template <typename Handler> void serialize(Handler &h, const int version)
|
||||||
{
|
{
|
||||||
@ -956,11 +977,11 @@ public:
|
|||||||
void endBattle(BattleResult *result, ui8 attackingPlayer) const;
|
void endBattle(BattleResult *result, ui8 attackingPlayer) const;
|
||||||
void fight(ui32 agreed, const CGHeroInstance *h) const;
|
void fight(ui32 agreed, const CGHeroInstance *h) const;
|
||||||
|
|
||||||
void onHeroVisit(const CGHeroInstance * h) const;
|
void onHeroVisit(const CGHeroInstance * h) const override;
|
||||||
|
|
||||||
void flagMine(ui8 player) const;
|
void flagMine(ui8 player) const;
|
||||||
void newTurn() const;
|
void newTurn() const override;
|
||||||
void initObj();
|
void initObj() override;
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
template <typename Handler> void serialize(Handler &h, const int version)
|
||||||
{
|
{
|
||||||
h & static_cast<CArmedInstance&>(*this);
|
h & static_cast<CArmedInstance&>(*this);
|
||||||
@ -974,16 +995,17 @@ class DLL_LINKAGE CGVisitableOPW : public CGObjectInstance //objects visitable O
|
|||||||
public:
|
public:
|
||||||
ui8 visited; //true if object has been visited this week
|
ui8 visited; //true if object has been visited this week
|
||||||
|
|
||||||
void setPropertyDer(ui8 what, ui32 val);//synchr
|
|
||||||
bool wasVisited(ui8 player) const;
|
bool wasVisited(ui8 player) const;
|
||||||
void onHeroVisit(const CGHeroInstance * h) const;
|
void onHeroVisit(const CGHeroInstance * h) const override;
|
||||||
void newTurn() const;
|
void newTurn() const override;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
template <typename Handler> void serialize(Handler &h, const int version)
|
||||||
{
|
{
|
||||||
h & static_cast<CGObjectInstance&>(*this);
|
h & static_cast<CGObjectInstance&>(*this);
|
||||||
h & visited;
|
h & visited;
|
||||||
}
|
}
|
||||||
|
protected:
|
||||||
|
void setPropertyDer(ui8 what, ui32 val) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class DLL_LINKAGE CGTeleport : public CGObjectInstance //teleports and subterranean gates
|
class DLL_LINKAGE CGTeleport : public CGObjectInstance //teleports and subterranean gates
|
||||||
@ -991,8 +1013,8 @@ class DLL_LINKAGE CGTeleport : public CGObjectInstance //teleports and subterran
|
|||||||
public:
|
public:
|
||||||
static std::map<int,std::map<int, std::vector<int> > > objs; //teleports: map[ID][subID] => vector of ids
|
static std::map<int,std::map<int, std::vector<int> > > objs; //teleports: map[ID][subID] => vector of ids
|
||||||
static std::vector<std::pair<int, int> > gates; //subterranean gates: pairs of ids
|
static std::vector<std::pair<int, int> > gates; //subterranean gates: pairs of ids
|
||||||
void onHeroVisit(const CGHeroInstance * h) const;
|
void onHeroVisit(const CGHeroInstance * h) const override;
|
||||||
void initObj();
|
void initObj() override;
|
||||||
static void postInit();
|
static void postInit();
|
||||||
static int getMatchingGate(int id); //receives id of one subterranean gate and returns id of the paired one, -1 if none
|
static int getMatchingGate(int id); //receives id of one subterranean gate and returns id of the paired one, -1 if none
|
||||||
|
|
||||||
@ -1006,9 +1028,9 @@ class DLL_LINKAGE CGBonusingObject : public CGObjectInstance //objects giving bo
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
bool wasVisited (const CGHeroInstance * h) const;
|
bool wasVisited (const CGHeroInstance * h) const;
|
||||||
void onHeroVisit(const CGHeroInstance * h) const;
|
void onHeroVisit(const CGHeroInstance * h) const override;
|
||||||
const std::string & getHoverText() const;
|
const std::string & getHoverText() const override;
|
||||||
void initObj();
|
void initObj() override;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
template <typename Handler> void serialize(Handler &h, const int version)
|
||||||
{
|
{
|
||||||
@ -1019,8 +1041,8 @@ public:
|
|||||||
class DLL_LINKAGE CGMagicSpring : public CGVisitableOPW
|
class DLL_LINKAGE CGMagicSpring : public CGVisitableOPW
|
||||||
{///unfortunatelly, this one is quite different than others
|
{///unfortunatelly, this one is quite different than others
|
||||||
public:
|
public:
|
||||||
void onHeroVisit(const CGHeroInstance * h) const;
|
void onHeroVisit(const CGHeroInstance * h) const override;
|
||||||
const std::string & getHoverText() const;
|
const std::string & getHoverText() const override;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
template <typename Handler> void serialize(Handler &h, const int version)
|
||||||
{
|
{
|
||||||
@ -1032,8 +1054,8 @@ public:
|
|||||||
class DLL_LINKAGE CGMagicWell : public CGObjectInstance //objects giving bonuses to luck/morale/movement
|
class DLL_LINKAGE CGMagicWell : public CGObjectInstance //objects giving bonuses to luck/morale/movement
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void onHeroVisit(const CGHeroInstance * h) const;
|
void onHeroVisit(const CGHeroInstance * h) const override;
|
||||||
const std::string & getHoverText() const;
|
const std::string & getHoverText() const override;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
template <typename Handler> void serialize(Handler &h, const int version)
|
||||||
{
|
{
|
||||||
@ -1044,9 +1066,9 @@ public:
|
|||||||
class DLL_LINKAGE CGSirens : public CGObjectInstance
|
class DLL_LINKAGE CGSirens : public CGObjectInstance
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void onHeroVisit(const CGHeroInstance * h) const;
|
void onHeroVisit(const CGHeroInstance * h) const override;
|
||||||
const std::string & getHoverText() const;
|
const std::string & getHoverText() const override;
|
||||||
void initObj();
|
void initObj() override;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
template <typename Handler> void serialize(Handler &h, const int version)
|
||||||
{
|
{
|
||||||
@ -1057,7 +1079,7 @@ public:
|
|||||||
class DLL_LINKAGE CGObservatory : public CGObjectInstance //Redwood observatory
|
class DLL_LINKAGE CGObservatory : public CGObjectInstance //Redwood observatory
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void onHeroVisit(const CGHeroInstance * h) const;
|
void onHeroVisit(const CGHeroInstance * h) const override;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
template <typename Handler> void serialize(Handler &h, const int version)
|
||||||
{
|
{
|
||||||
@ -1072,21 +1094,24 @@ public:
|
|||||||
static std::map <ui8, std::set <ui8> > playerKeyMap; //[players][keysowned]
|
static std::map <ui8, std::set <ui8> > playerKeyMap; //[players][keysowned]
|
||||||
//SubID 0 - lightblue, 1 - green, 2 - red, 3 - darkblue, 4 - brown, 5 - purple, 6 - white, 7 - black
|
//SubID 0 - lightblue, 1 - green, 2 - red, 3 - darkblue, 4 - brown, 5 - purple, 6 - white, 7 - black
|
||||||
|
|
||||||
void setPropertyDer (ui8 what, ui32 val);
|
|
||||||
const std::string getName() const; //depending on color
|
const std::string getName() const; //depending on color
|
||||||
bool wasMyColorVisited (int player) const;
|
bool wasMyColorVisited (int player) const;
|
||||||
|
|
||||||
|
const std::string & getHoverText() const override;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
template <typename Handler> void serialize(Handler &h, const int version)
|
||||||
{
|
{
|
||||||
h & static_cast<CGObjectInstance&>(*this);
|
h & static_cast<CGObjectInstance&>(*this);
|
||||||
}
|
}
|
||||||
|
protected:
|
||||||
|
void setPropertyDer(ui8 what, ui32 val) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class DLL_LINKAGE CGKeymasterTent : public CGKeys
|
class DLL_LINKAGE CGKeymasterTent : public CGKeys
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
bool wasVisited (ui8 player) const;
|
bool wasVisited (ui8 player) const;
|
||||||
void onHeroVisit(const CGHeroInstance * h) const;
|
void onHeroVisit(const CGHeroInstance * h) const override;
|
||||||
const std::string & getHoverText() const;
|
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
template <typename Handler> void serialize(Handler &h, const int version)
|
||||||
{
|
{
|
||||||
@ -1098,12 +1123,13 @@ class DLL_LINKAGE CGBorderGuard : public CGKeys, public IQuestObject
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CGBorderGuard() : IQuestObject(){};
|
CGBorderGuard() : IQuestObject(){};
|
||||||
void initObj();
|
void initObj() override;
|
||||||
const std::string & getHoverText() const;
|
void onHeroVisit(const CGHeroInstance * h) const override;
|
||||||
|
|
||||||
void getVisitText (MetaString &text, std::vector<Component> &components, bool isCustom, bool FirstVisit, const CGHeroInstance * h = NULL) const;
|
void getVisitText (MetaString &text, std::vector<Component> &components, bool isCustom, bool FirstVisit, const CGHeroInstance * h = NULL) const;
|
||||||
void getRolloverText (MetaString &text, bool onHover) const;
|
void getRolloverText (MetaString &text, bool onHover) const;
|
||||||
bool checkQuest (const CGHeroInstance * h) const;
|
bool checkQuest (const CGHeroInstance * h) const;
|
||||||
void onHeroVisit(const CGHeroInstance * h) const;
|
|
||||||
void openGate(const CGHeroInstance *h, ui32 accept) const;
|
void openGate(const CGHeroInstance *h, ui32 accept) const;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
template <typename Handler> void serialize(Handler &h, const int version)
|
||||||
@ -1118,8 +1144,9 @@ class DLL_LINKAGE CGBorderGate : public CGBorderGuard
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CGBorderGate() : CGBorderGuard(){};
|
CGBorderGate() : CGBorderGuard(){};
|
||||||
void onHeroVisit(const CGHeroInstance * h) const;
|
void onHeroVisit(const CGHeroInstance * h) const override;
|
||||||
ui8 getPassableness() const;
|
|
||||||
|
ui8 getPassableness() const override;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
template <typename Handler> void serialize(Handler &h, const int version)
|
||||||
{
|
{
|
||||||
@ -1133,7 +1160,7 @@ public:
|
|||||||
ui8 direction;
|
ui8 direction;
|
||||||
const CGHeroInstance *hero; //hero on board
|
const CGHeroInstance *hero; //hero on board
|
||||||
|
|
||||||
void initObj();
|
void initObj() override;
|
||||||
|
|
||||||
CGBoat()
|
CGBoat()
|
||||||
{
|
{
|
||||||
@ -1154,9 +1181,10 @@ public:
|
|||||||
ui32 bonusType, //id of res or artifact
|
ui32 bonusType, //id of res or artifact
|
||||||
bonusVal; //resource amount (or not used)
|
bonusVal; //resource amount (or not used)
|
||||||
|
|
||||||
void onHeroVisit(const CGHeroInstance * h) const;
|
void onHeroVisit(const CGHeroInstance * h) const override;
|
||||||
const std::string & getHoverText() const;
|
const std::string & getHoverText() const override;
|
||||||
void initObj();
|
void initObj() override;
|
||||||
|
|
||||||
void searchTomb(const CGHeroInstance *h, ui32 accept) const;
|
void searchTomb(const CGHeroInstance *h, ui32 accept) const;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
template <typename Handler> void serialize(Handler &h, const int version)
|
||||||
@ -1175,14 +1203,14 @@ class DLL_LINKAGE CBank : public CArmedInstance
|
|||||||
std::vector<ui32> artifacts; //fixed and deterministic
|
std::vector<ui32> artifacts; //fixed and deterministic
|
||||||
ui32 daycounter;
|
ui32 daycounter;
|
||||||
|
|
||||||
void initObj();
|
void initObj() override;
|
||||||
const std::string & getHoverText() const;
|
const std::string & getHoverText() const override;
|
||||||
void setPropertyDer (ui8 what, ui32 val);
|
|
||||||
void initialize() const;
|
void initialize() const;
|
||||||
void reset(ui16 var1);
|
void reset(ui16 var1);
|
||||||
void newTurn() const;
|
void newTurn() const override;
|
||||||
bool wasVisited (ui8 player) const;
|
bool wasVisited (ui8 player) const override;
|
||||||
virtual void onHeroVisit (const CGHeroInstance * h) const;
|
void onHeroVisit(const CGHeroInstance * h) const override;
|
||||||
|
|
||||||
virtual void fightGuards (const CGHeroInstance *h, ui32 accept) const;
|
virtual void fightGuards (const CGHeroInstance *h, ui32 accept) const;
|
||||||
virtual void endBattle (const CGHeroInstance *h, const BattleResult *result) const;
|
virtual void endBattle (const CGHeroInstance *h, const BattleResult *result) const;
|
||||||
|
|
||||||
@ -1191,17 +1219,20 @@ class DLL_LINKAGE CBank : public CArmedInstance
|
|||||||
h & static_cast<CArmedInstance&>(*this);
|
h & static_cast<CArmedInstance&>(*this);
|
||||||
h & index & multiplier & artifacts & daycounter & bc;
|
h & index & multiplier & artifacts & daycounter & bc;
|
||||||
}
|
}
|
||||||
|
protected:
|
||||||
|
void setPropertyDer(ui8 what, ui32 val) override;
|
||||||
};
|
};
|
||||||
class DLL_LINKAGE CGPyramid : public CBank
|
class DLL_LINKAGE CGPyramid : public CBank
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ui16 spell;
|
ui16 spell;
|
||||||
|
|
||||||
void initObj();
|
void initObj() override;
|
||||||
const std::string & getHoverText() const;
|
const std::string & getHoverText() const override;
|
||||||
void newTurn() const {}; //empty, no reset
|
void newTurn() const override {}; //empty, no reset
|
||||||
void onHeroVisit (const CGHeroInstance * h) const;
|
void onHeroVisit(const CGHeroInstance * h) const override;
|
||||||
void endBattle (const CGHeroInstance *h, const BattleResult *result) const;
|
|
||||||
|
void endBattle (const CGHeroInstance *h, const BattleResult *result) const override;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
template <typename Handler> void serialize(Handler &h, const int version)
|
||||||
{
|
{
|
||||||
@ -1215,7 +1246,7 @@ class CGShipyard : public CGObjectInstance, public IShipyard
|
|||||||
public:
|
public:
|
||||||
void getOutOffsets(std::vector<int3> &offsets) const; //offsets to obj pos when we boat can be placed
|
void getOutOffsets(std::vector<int3> &offsets) const; //offsets to obj pos when we boat can be placed
|
||||||
CGShipyard();
|
CGShipyard();
|
||||||
void onHeroVisit(const CGHeroInstance * h) const;
|
void onHeroVisit(const CGHeroInstance * h) const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class DLL_LINKAGE CGMagi : public CGObjectInstance
|
class DLL_LINKAGE CGMagi : public CGObjectInstance
|
||||||
@ -1223,8 +1254,8 @@ class DLL_LINKAGE CGMagi : public CGObjectInstance
|
|||||||
public:
|
public:
|
||||||
static std::map <si32, std::vector<si32> > eyelist; //[subID][id], supports multiple sets as in H5
|
static std::map <si32, std::vector<si32> > eyelist; //[subID][id], supports multiple sets as in H5
|
||||||
|
|
||||||
void initObj();
|
void initObj() override;
|
||||||
void onHeroVisit(const CGHeroInstance * h) const;
|
void onHeroVisit(const CGHeroInstance * h) const override;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
template <typename Handler> void serialize(Handler &h, const int version)
|
||||||
{
|
{
|
||||||
@ -1238,7 +1269,7 @@ class DLL_LINKAGE CCartographer : public CPlayersVisited
|
|||||||
{
|
{
|
||||||
///behaviour varies depending on surface and floor
|
///behaviour varies depending on surface and floor
|
||||||
public:
|
public:
|
||||||
void onHeroVisit( const CGHeroInstance * h ) const;
|
void onHeroVisit(const CGHeroInstance * h) const override;
|
||||||
void buyMap (const CGHeroInstance *h, ui32 accept) const;
|
void buyMap (const CGHeroInstance *h, ui32 accept) const;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
template <typename Handler> void serialize(Handler &h, const int version)
|
||||||
@ -1249,7 +1280,7 @@ public:
|
|||||||
|
|
||||||
class DLL_LINKAGE CGDenOfthieves : public CGObjectInstance
|
class DLL_LINKAGE CGDenOfthieves : public CGObjectInstance
|
||||||
{
|
{
|
||||||
void onHeroVisit (const CGHeroInstance * h) const;
|
void onHeroVisit(const CGHeroInstance * h) const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class DLL_LINKAGE CGObelisk : public CPlayersVisited
|
class DLL_LINKAGE CGObelisk : public CPlayersVisited
|
||||||
@ -1258,23 +1289,24 @@ public:
|
|||||||
static ui8 obeliskCount; //how many obelisks are on map
|
static ui8 obeliskCount; //how many obelisks are on map
|
||||||
static std::map<ui8, ui8> visited; //map: team_id => how many obelisks has been visited
|
static std::map<ui8, ui8> visited; //map: team_id => how many obelisks has been visited
|
||||||
|
|
||||||
void setPropertyDer (ui8 what, ui32 val);
|
void onHeroVisit(const CGHeroInstance * h) const override;
|
||||||
void onHeroVisit(const CGHeroInstance * h) const;
|
void initObj() override;
|
||||||
void initObj();
|
const std::string & getHoverText() const override;
|
||||||
const std::string & getHoverText() const;
|
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
template <typename Handler> void serialize(Handler &h, const int version)
|
||||||
{
|
{
|
||||||
h & static_cast<CPlayersVisited&>(*this);
|
h & static_cast<CPlayersVisited&>(*this);
|
||||||
}
|
}
|
||||||
|
protected:
|
||||||
|
void setPropertyDer(ui8 what, ui32 val) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class DLL_LINKAGE CGLighthouse : public CGObjectInstance
|
class DLL_LINKAGE CGLighthouse : public CGObjectInstance
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void onHeroVisit(const CGHeroInstance * h) const;
|
void onHeroVisit(const CGHeroInstance * h) const override;
|
||||||
void initObj();
|
void initObj() override;
|
||||||
const std::string & getHoverText() const;
|
const std::string & getHoverText() const override;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
template <typename Handler> void serialize(Handler &h, const int version)
|
||||||
{
|
{
|
||||||
@ -1287,12 +1319,14 @@ class DLL_LINKAGE CGMarket : public CGObjectInstance, public IMarket
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CGMarket();
|
CGMarket();
|
||||||
void onHeroVisit(const CGHeroInstance * h) const; //open trading window
|
///IObjectIntercae
|
||||||
|
void onHeroVisit(const CGHeroInstance * h) const override; //open trading window
|
||||||
|
|
||||||
int getMarketEfficiency() const;
|
///IMarket
|
||||||
bool allowsTrade(EMarketMode::EMarketMode mode) const;
|
int getMarketEfficiency() const override;
|
||||||
int availableUnits(EMarketMode::EMarketMode mode, int marketItemSerial) const; //-1 if unlimited
|
bool allowsTrade(EMarketMode::EMarketMode mode) const override;
|
||||||
std::vector<int> availableItemsIds(EMarketMode::EMarketMode mode) const;
|
int availableUnits(EMarketMode::EMarketMode mode, int marketItemSerial) const override; //-1 if unlimited
|
||||||
|
std::vector<int> availableItemsIds(EMarketMode::EMarketMode mode) const override;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
template <typename Handler> void serialize(Handler &h, const int version)
|
||||||
{
|
{
|
||||||
@ -1305,8 +1339,8 @@ class DLL_LINKAGE CGBlackMarket : public CGMarket
|
|||||||
public:
|
public:
|
||||||
std::vector<const CArtifact *> artifacts; //available artifacts
|
std::vector<const CArtifact *> artifacts; //available artifacts
|
||||||
|
|
||||||
void newTurn() const; //reset artifacts for black market every month
|
void newTurn() const override; //reset artifacts for black market every month
|
||||||
std::vector<int> availableItemsIds(EMarketMode::EMarketMode mode) const;
|
std::vector<int> availableItemsIds(EMarketMode::EMarketMode mode) const override;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
template <typename Handler> void serialize(Handler &h, const int version)
|
||||||
{
|
{
|
||||||
@ -1321,8 +1355,8 @@ public:
|
|||||||
std::vector<int> skills; //available skills
|
std::vector<int> skills; //available skills
|
||||||
|
|
||||||
std::vector<int> availableItemsIds(EMarketMode::EMarketMode mode) const;
|
std::vector<int> availableItemsIds(EMarketMode::EMarketMode mode) const;
|
||||||
void initObj();//set skills for trade
|
void initObj() override;//set skills for trade
|
||||||
void onHeroVisit(const CGHeroInstance * h) const; //open window
|
void onHeroVisit(const CGHeroInstance * h) const override; //open window
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
template <typename Handler> void serialize(Handler &h, const int version)
|
||||||
{
|
{
|
||||||
|
@ -993,7 +993,7 @@ void CMapLoaderH3M::readDefInfo()
|
|||||||
//add holes - they always can appear
|
//add holes - they always can appear
|
||||||
for(int i = 0; i < 8 ; ++i)
|
for(int i = 0; i < 8 ; ++i)
|
||||||
{
|
{
|
||||||
map->customDefs.push_back(VLC->dobjinfo->gobjs[124][i]);
|
map->customDefs.push_back(VLC->dobjinfo->gobjs[Obj::HOLE][i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user