mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-20 20:23:03 +02:00
Merge pull request #4556 from IvanSavenko/town_building_visit
Implemented explicitly visitable town buildings, e.g. hota mana vortex
This commit is contained in:
commit
6179521364
@ -217,12 +217,12 @@ bool CCallback::buildBuilding(const CGTownInstance *town, BuildingID buildingID)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CCallback::triggerTownSpecialBuildingAction(const CGTownInstance *town, BuildingSubID::EBuildingSubID subBuildingID)
|
bool CCallback::visitTownBuilding(const CGTownInstance *town, BuildingID buildingID)
|
||||||
{
|
{
|
||||||
if(town->tempOwner!=player)
|
if(town->tempOwner!=player)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
TriggerTownSpecialBuildingAction pack(town->id, subBuildingID);
|
VisitTownBuilding pack(town->id, buildingID);
|
||||||
sendRequest(&pack);
|
sendRequest(&pack);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,7 @@ public:
|
|||||||
//town
|
//town
|
||||||
virtual void recruitHero(const CGObjectInstance *townOrTavern, const CGHeroInstance *hero, const HeroTypeID & nextHero=HeroTypeID::NONE)=0;
|
virtual void recruitHero(const CGObjectInstance *townOrTavern, const CGHeroInstance *hero, const HeroTypeID & nextHero=HeroTypeID::NONE)=0;
|
||||||
virtual bool buildBuilding(const CGTownInstance *town, BuildingID buildingID)=0;
|
virtual bool buildBuilding(const CGTownInstance *town, BuildingID buildingID)=0;
|
||||||
virtual bool triggerTownSpecialBuildingAction(const CGTownInstance *town, BuildingSubID::EBuildingSubID subBuildingID)=0;
|
virtual bool visitTownBuilding(const CGTownInstance *town, BuildingID buildingID)=0;
|
||||||
virtual void recruitCreatures(const CGDwelling *obj, const CArmedInstance * dst, CreatureID ID, ui32 amount, si32 level=-1)=0;
|
virtual void recruitCreatures(const CGDwelling *obj, const CArmedInstance * dst, CreatureID ID, ui32 amount, si32 level=-1)=0;
|
||||||
virtual bool upgradeCreature(const CArmedInstance *obj, SlotID stackPos, CreatureID newID=CreatureID::NONE)=0; //if newID==-1 then best possible upgrade will be made
|
virtual bool upgradeCreature(const CArmedInstance *obj, SlotID stackPos, CreatureID newID=CreatureID::NONE)=0; //if newID==-1 then best possible upgrade will be made
|
||||||
virtual void swapGarrisonHero(const CGTownInstance *town)=0;
|
virtual void swapGarrisonHero(const CGTownInstance *town)=0;
|
||||||
@ -182,7 +182,7 @@ public:
|
|||||||
void manageHeroCostume(ObjectInstanceID hero, size_t costumeIdx, bool saveCostume) override;
|
void manageHeroCostume(ObjectInstanceID hero, size_t costumeIdx, bool saveCostume) override;
|
||||||
void eraseArtifactByClient(const ArtifactLocation & al) override;
|
void eraseArtifactByClient(const ArtifactLocation & al) override;
|
||||||
bool buildBuilding(const CGTownInstance *town, BuildingID buildingID) override;
|
bool buildBuilding(const CGTownInstance *town, BuildingID buildingID) override;
|
||||||
bool triggerTownSpecialBuildingAction(const CGTownInstance *town, BuildingSubID::EBuildingSubID subBuildingID) override;
|
bool visitTownBuilding(const CGTownInstance *town, BuildingID buildingID) override;
|
||||||
void recruitCreatures(const CGDwelling * obj, const CArmedInstance * dst, CreatureID ID, ui32 amount, si32 level=-1) override;
|
void recruitCreatures(const CGDwelling * obj, const CArmedInstance * dst, CreatureID ID, ui32 amount, si32 level=-1) override;
|
||||||
bool dismissCreature(const CArmedInstance *obj, SlotID stackPos) override;
|
bool dismissCreature(const CArmedInstance *obj, SlotID stackPos) override;
|
||||||
bool upgradeCreature(const CArmedInstance *obj, SlotID stackPos, CreatureID newID=CreatureID::NONE) override;
|
bool upgradeCreature(const CArmedInstance *obj, SlotID stackPos, CreatureID newID=CreatureID::NONE) override;
|
||||||
|
@ -51,7 +51,6 @@
|
|||||||
#include <boost/uuid/uuid.hpp>
|
#include <boost/uuid/uuid.hpp>
|
||||||
#include <boost/uuid/uuid_io.hpp>
|
#include <boost/uuid/uuid_io.hpp>
|
||||||
#include <boost/uuid/uuid_generators.hpp>
|
#include <boost/uuid/uuid_generators.hpp>
|
||||||
#include "../lib/serializer/Cast.h"
|
|
||||||
#include "LobbyClientNetPackVisitors.h"
|
#include "LobbyClientNetPackVisitors.h"
|
||||||
|
|
||||||
#include <vcmi/events/EventBus.h>
|
#include <vcmi/events/EventBus.h>
|
||||||
|
@ -164,7 +164,7 @@ public:
|
|||||||
void changePrimSkill(const CGHeroInstance * hero, PrimarySkill which, si64 val, bool abs = false) override {};
|
void changePrimSkill(const CGHeroInstance * hero, PrimarySkill which, si64 val, bool abs = false) override {};
|
||||||
void changeSecSkill(const CGHeroInstance * hero, SecondarySkill which, int val, bool abs = false) override {};
|
void changeSecSkill(const CGHeroInstance * hero, SecondarySkill which, int val, bool abs = false) override {};
|
||||||
|
|
||||||
void showBlockingDialog(BlockingDialog * iw) override {};
|
void showBlockingDialog(const IObjectInterface * caller, BlockingDialog * iw) override {};
|
||||||
void showGarrisonDialog(ObjectInstanceID upobj, ObjectInstanceID hid, bool removableUnits) override {};
|
void showGarrisonDialog(ObjectInstanceID upobj, ObjectInstanceID hid, bool removableUnits) override {};
|
||||||
void showTeleportDialog(TeleportDialog * iw) override {};
|
void showTeleportDialog(TeleportDialog * iw) override {};
|
||||||
void showObjectWindow(const CGObjectInstance * object, EOpenWindowMode window, const CGHeroInstance * visitor, bool addQuery) override {};
|
void showObjectWindow(const CGObjectInstance * object, EOpenWindowMode window, const CGHeroInstance * visitor, bool addQuery) override {};
|
||||||
|
@ -743,6 +743,12 @@ bool CCastleBuildings::buildingTryActivateCustomUI(BuildingID buildingToTest, Bu
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (town->rewardableBuildings.count(buildingToTest) && town->town->buildings.at(buildingToTest)->manualHeroVisit)
|
||||||
|
{
|
||||||
|
enterRewardable(buildingToTest);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (buildingToTest >= BuildingID::DWELL_FIRST)
|
if (buildingToTest >= BuildingID::DWELL_FIRST)
|
||||||
{
|
{
|
||||||
enterDwelling((BuildingID::getLevelFromDwelling(buildingToTest)));
|
enterDwelling((BuildingID::getLevelFromDwelling(buildingToTest)));
|
||||||
@ -820,7 +826,7 @@ bool CCastleBuildings::buildingTryActivateCustomUI(BuildingID buildingToTest, Bu
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
case BuildingSubID::BANK:
|
case BuildingSubID::BANK:
|
||||||
enterBank();
|
enterBank(buildingTarget);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -837,6 +843,11 @@ bool CCastleBuildings::buildingTryActivateCustomUI(BuildingID buildingToTest, Bu
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CCastleBuildings::enterRewardable(BuildingID building)
|
||||||
|
{
|
||||||
|
LOCPLINT->cb->visitTownBuilding(town, building);
|
||||||
|
}
|
||||||
|
|
||||||
void CCastleBuildings::enterBlacksmith(BuildingID building, ArtifactID artifactID)
|
void CCastleBuildings::enterBlacksmith(BuildingID building, ArtifactID artifactID)
|
||||||
{
|
{
|
||||||
const CGHeroInstance *hero = town->visitingHero;
|
const CGHeroInstance *hero = town->visitingHero;
|
||||||
@ -1053,7 +1064,7 @@ void CCastleBuildings::enterAnyThievesGuild()
|
|||||||
LOCPLINT->showInfoDialog(CGI->generaltexth->translate("vcmi.adventureMap.noTownWithTavern"));
|
LOCPLINT->showInfoDialog(CGI->generaltexth->translate("vcmi.adventureMap.noTownWithTavern"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCastleBuildings::enterBank()
|
void CCastleBuildings::enterBank(BuildingID building)
|
||||||
{
|
{
|
||||||
std::vector<std::shared_ptr<CComponent>> components;
|
std::vector<std::shared_ptr<CComponent>> components;
|
||||||
if(town->bonusValue.second > 0)
|
if(town->bonusValue.second > 0)
|
||||||
@ -1064,7 +1075,7 @@ void CCastleBuildings::enterBank()
|
|||||||
else{
|
else{
|
||||||
|
|
||||||
components.push_back(std::make_shared<CComponent>(ComponentType::RESOURCE, GameResID(GameResID::GOLD), 2500));
|
components.push_back(std::make_shared<CComponent>(ComponentType::RESOURCE, GameResID(GameResID::GOLD), 2500));
|
||||||
LOCPLINT->showYesNoDialog(CGI->generaltexth->translate("vcmi.townStructure.bank.borrow"), [this](){ LOCPLINT->cb->triggerTownSpecialBuildingAction(town, BuildingSubID::BANK); }, nullptr, components);
|
LOCPLINT->showYesNoDialog(CGI->generaltexth->translate("vcmi.townStructure.bank.borrow"), [this, building](){ LOCPLINT->cb->visitTownBuilding(town, building); }, nullptr, components);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -167,10 +167,11 @@ public:
|
|||||||
|
|
||||||
void enterDwelling(int level);
|
void enterDwelling(int level);
|
||||||
void enterTownHall();
|
void enterTownHall();
|
||||||
|
void enterRewardable(BuildingID building);
|
||||||
void enterMagesGuild();
|
void enterMagesGuild();
|
||||||
void enterAnyMarket();
|
void enterAnyMarket();
|
||||||
void enterAnyThievesGuild();
|
void enterAnyThievesGuild();
|
||||||
void enterBank();
|
void enterBank(BuildingID building);
|
||||||
void enterToTheQuickRecruitmentWindow();
|
void enterToTheQuickRecruitmentWindow();
|
||||||
|
|
||||||
bool buildingTryActivateCustomUI(BuildingID buildingToTest, BuildingID buildingTarget);
|
bool buildingTryActivateCustomUI(BuildingID buildingToTest, BuildingID buildingTarget);
|
||||||
|
@ -179,7 +179,7 @@
|
|||||||
"period" : 7,
|
"period" : 7,
|
||||||
"visitors" : true
|
"visitors" : true
|
||||||
},
|
},
|
||||||
"visitMode" : "hero", // Should be 'once' to match (somewhat buggy) H3 logic
|
"visitMode" : "once",
|
||||||
"rewards" : [
|
"rewards" : [
|
||||||
{
|
{
|
||||||
"limiter" : {
|
"limiter" : {
|
||||||
|
@ -61,11 +61,15 @@
|
|||||||
"description" : "If set to true, this building will replace all bonuses from base building, leaving only bonuses defined by this building",
|
"description" : "If set to true, this building will replace all bonuses from base building, leaving only bonuses defined by this building",
|
||||||
"type" : "boolean"
|
"type" : "boolean"
|
||||||
},
|
},
|
||||||
|
"manualHeroVisit" : {
|
||||||
|
"description" : "If set to true, this building will not automatically activate on new day or on entering town and needs to be activated manually on click",
|
||||||
|
"type" : "boolean"
|
||||||
|
},
|
||||||
"configuration" : {
|
"configuration" : {
|
||||||
"description" : "Optional, configuration of building that can be activated by visiting hero",
|
"description" : "Optional, configuration of building that can be activated by visiting hero",
|
||||||
"$ref" : "rewardable.json"
|
"$ref" : "rewardable.json"
|
||||||
},
|
},
|
||||||
"firtufications" : {
|
"fortifications" : {
|
||||||
"type" : "object",
|
"type" : "object",
|
||||||
"additionalProperties" : false,
|
"additionalProperties" : false,
|
||||||
"description" : "Fortifications provided by this buildings, if any",
|
"description" : "Fortifications provided by this buildings, if any",
|
||||||
|
@ -196,8 +196,12 @@ These are just a couple of examples of what can be done in VCMI. See vcmi config
|
|||||||
// Bonuses provided by this special building if this building or any of its upgrades are constructed in town
|
// Bonuses provided by this special building if this building or any of its upgrades are constructed in town
|
||||||
"bonuses" : [ BONUS_FORMAT ]
|
"bonuses" : [ BONUS_FORMAT ]
|
||||||
|
|
||||||
// If set to true, this building will replace all bonuses from base building, leaving only bonuses defined by this building"
|
// If set to true, this building will not automatically activate on new day or on entering town and needs to be activated manually on click
|
||||||
"upgradeReplacesBonuses" : false,
|
"manualHeroVisit" : false,
|
||||||
|
|
||||||
|
// Bonuses provided by this special building if this building or any of its upgrades are constructed in town
|
||||||
|
"bonuses" : [ BONUS_FORMAT ]
|
||||||
|
|
||||||
|
|
||||||
// If the building is a market, it requires market mode.
|
// If the building is a market, it requires market mode.
|
||||||
"marketModes" : [ "resource-resource", "resource-player" ],
|
"marketModes" : [ "resource-resource", "resource-player" ],
|
||||||
|
@ -620,7 +620,6 @@ set(lib_MAIN_HEADERS
|
|||||||
serializer/JsonSerializeFormat.h
|
serializer/JsonSerializeFormat.h
|
||||||
serializer/JsonSerializer.h
|
serializer/JsonSerializer.h
|
||||||
serializer/JsonUpdater.h
|
serializer/JsonUpdater.h
|
||||||
serializer/Cast.h
|
|
||||||
serializer/ESerializationVersion.h
|
serializer/ESerializationVersion.h
|
||||||
serializer/RegisterTypes.h
|
serializer/RegisterTypes.h
|
||||||
serializer/Serializeable.h
|
serializer/Serializeable.h
|
||||||
|
@ -33,6 +33,7 @@ class CStackBasicDescriptor;
|
|||||||
class CGCreature;
|
class CGCreature;
|
||||||
class CSaveFile;
|
class CSaveFile;
|
||||||
class CLoadFile;
|
class CLoadFile;
|
||||||
|
class IObjectInterface;
|
||||||
enum class EOpenWindowMode : uint8_t;
|
enum class EOpenWindowMode : uint8_t;
|
||||||
|
|
||||||
namespace spells
|
namespace spells
|
||||||
@ -98,7 +99,7 @@ public:
|
|||||||
virtual void giveExperience(const CGHeroInstance * hero, TExpType val) =0;
|
virtual void giveExperience(const CGHeroInstance * hero, TExpType val) =0;
|
||||||
virtual void changePrimSkill(const CGHeroInstance * hero, PrimarySkill which, si64 val, bool abs=false)=0;
|
virtual void changePrimSkill(const CGHeroInstance * hero, PrimarySkill which, si64 val, bool abs=false)=0;
|
||||||
virtual void changeSecSkill(const CGHeroInstance * hero, SecondarySkill which, int val, bool abs=false)=0;
|
virtual void changeSecSkill(const CGHeroInstance * hero, SecondarySkill which, int val, bool abs=false)=0;
|
||||||
virtual void showBlockingDialog(BlockingDialog *iw) =0;
|
virtual void showBlockingDialog(const IObjectInterface * caller, BlockingDialog *iw) =0;
|
||||||
virtual void showGarrisonDialog(ObjectInstanceID upobj, ObjectInstanceID hid, bool removableUnits) =0; //cb will be called when player closes garrison window
|
virtual void showGarrisonDialog(ObjectInstanceID upobj, ObjectInstanceID hid, bool removableUnits) =0; //cb will be called when player closes garrison window
|
||||||
virtual void showTeleportDialog(TeleportDialog *iw) =0;
|
virtual void showTeleportDialog(TeleportDialog *iw) =0;
|
||||||
virtual void showObjectWindow(const CGObjectInstance * object, EOpenWindowMode window, const CGHeroInstance * visitor, bool addQuery) = 0;
|
virtual void showObjectWindow(const CGObjectInstance * object, EOpenWindowMode window, const CGHeroInstance * visitor, bool addQuery) = 0;
|
||||||
|
@ -44,6 +44,7 @@ public:
|
|||||||
BuildingID upgrade; /// indicates that building "upgrade" can be improved by this, -1 = empty
|
BuildingID upgrade; /// indicates that building "upgrade" can be improved by this, -1 = empty
|
||||||
BuildingSubID::EBuildingSubID subId; /// subtype for special buildings, -1 = the building is not special
|
BuildingSubID::EBuildingSubID subId; /// subtype for special buildings, -1 = the building is not special
|
||||||
bool upgradeReplacesBonuses = false;
|
bool upgradeReplacesBonuses = false;
|
||||||
|
bool manualHeroVisit = false;
|
||||||
BonusList buildingBonuses;
|
BonusList buildingBonuses;
|
||||||
|
|
||||||
Rewardable::Info rewardableObjectInfo; ///configurable rewards for special buildings
|
Rewardable::Info rewardableObjectInfo; ///configurable rewards for special buildings
|
||||||
|
@ -299,6 +299,9 @@ void CTownHandler::loadBuilding(CTown * town, const std::string & stringID, cons
|
|||||||
ret->resources = TResources(source["cost"]);
|
ret->resources = TResources(source["cost"]);
|
||||||
ret->produce = TResources(source["produce"]);
|
ret->produce = TResources(source["produce"]);
|
||||||
|
|
||||||
|
ret->manualHeroVisit = source["manualHeroVisit"].Bool();
|
||||||
|
ret->upgradeReplacesBonuses = source["upgradeReplacesBonuses"].Bool();
|
||||||
|
|
||||||
const JsonNode & fortifications = source["fortifications"];
|
const JsonNode & fortifications = source["fortifications"];
|
||||||
if (!fortifications.isNull())
|
if (!fortifications.isNull())
|
||||||
{
|
{
|
||||||
|
@ -178,7 +178,7 @@ void CBank::onHeroVisit(const CGHeroInstance * h) const
|
|||||||
if (banktext == 32)
|
if (banktext == 32)
|
||||||
bd.text.replaceRawString(getObjectName());
|
bd.text.replaceRawString(getObjectName());
|
||||||
|
|
||||||
cb->showBlockingDialog(&bd);
|
cb->showBlockingDialog(this, &bd);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CBank::doVisit(const CGHeroInstance * hero) const
|
void CBank::doVisit(const CGHeroInstance * hero) const
|
||||||
|
@ -164,7 +164,7 @@ void CGCreature::onHeroVisit( const CGHeroInstance * h ) const
|
|||||||
ynd.player = h->tempOwner;
|
ynd.player = h->tempOwner;
|
||||||
ynd.text.appendLocalString(EMetaText::ADVOB_TXT, 86);
|
ynd.text.appendLocalString(EMetaText::ADVOB_TXT, 86);
|
||||||
ynd.text.replaceName(getCreature(), getStackCount(SlotID(0)));
|
ynd.text.replaceName(getCreature(), getStackCount(SlotID(0)));
|
||||||
cb->showBlockingDialog(&ynd);
|
cb->showBlockingDialog(this, &ynd);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: //join for gold
|
default: //join for gold
|
||||||
@ -180,7 +180,7 @@ void CGCreature::onHeroVisit( const CGHeroInstance * h ) const
|
|||||||
boost::algorithm::replace_first(tmp, "%d", std::to_string(action));
|
boost::algorithm::replace_first(tmp, "%d", std::to_string(action));
|
||||||
boost::algorithm::replace_first(tmp,"%s",VLC->creatures()->getById(getCreature())->getNamePluralTranslated());
|
boost::algorithm::replace_first(tmp,"%s",VLC->creatures()->getById(getCreature())->getNamePluralTranslated());
|
||||||
ynd.text.appendRawString(tmp);
|
ynd.text.appendRawString(tmp);
|
||||||
cb->showBlockingDialog(&ynd);
|
cb->showBlockingDialog(this, &ynd);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -475,7 +475,7 @@ void CGCreature::flee( const CGHeroInstance * h ) const
|
|||||||
ynd.player = h->tempOwner;
|
ynd.player = h->tempOwner;
|
||||||
ynd.text.appendLocalString(EMetaText::ADVOB_TXT,91);
|
ynd.text.appendLocalString(EMetaText::ADVOB_TXT,91);
|
||||||
ynd.text.replaceName(getCreature(), getStackCount(SlotID(0)));
|
ynd.text.replaceName(getCreature(), getStackCount(SlotID(0)));
|
||||||
cb->showBlockingDialog(&ynd);
|
cb->showBlockingDialog(this, &ynd);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGCreature::battleFinished(const CGHeroInstance *hero, const BattleResult &result) const
|
void CGCreature::battleFinished(const CGHeroInstance *hero, const BattleResult &result) const
|
||||||
|
@ -244,7 +244,7 @@ void CGDwelling::onHeroVisit( const CGHeroInstance * h ) const
|
|||||||
else
|
else
|
||||||
bd.text.replaceLocalString(EMetaText::ARRAY_TXT, 173 + (int)Slots().begin()->second->getQuantityID()*3);
|
bd.text.replaceLocalString(EMetaText::ARRAY_TXT, 173 + (int)Slots().begin()->second->getQuantityID()*3);
|
||||||
bd.text.replaceName(*Slots().begin()->second);
|
bd.text.replaceName(*Slots().begin()->second);
|
||||||
cb->showBlockingDialog(&bd);
|
cb->showBlockingDialog(this, &bd);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -280,7 +280,7 @@ void CGDwelling::onHeroVisit( const CGHeroInstance * h ) const
|
|||||||
bd.flags |= BlockingDialog::SAFE_TO_AUTOACCEPT;
|
bd.flags |= BlockingDialog::SAFE_TO_AUTOACCEPT;
|
||||||
}
|
}
|
||||||
|
|
||||||
cb->showBlockingDialog(&bd);
|
cb->showBlockingDialog(this, &bd);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGDwelling::newTurn(vstd::RNG & rand) const
|
void CGDwelling::newTurn(vstd::RNG & rand) const
|
||||||
|
@ -175,7 +175,7 @@ void CGPandoraBox::onHeroVisit(const CGHeroInstance * h) const
|
|||||||
BlockingDialog bd (true, false);
|
BlockingDialog bd (true, false);
|
||||||
bd.player = h->getOwner();
|
bd.player = h->getOwner();
|
||||||
bd.text.appendLocalString(EMetaText::ADVOB_TXT, 14);
|
bd.text.appendLocalString(EMetaText::ADVOB_TXT, 14);
|
||||||
cb->showBlockingDialog(&bd);
|
cb->showBlockingDialog(this, &bd);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGPandoraBox::battleFinished(const CGHeroInstance *hero, const BattleResult &result) const
|
void CGPandoraBox::battleFinished(const CGHeroInstance *hero, const BattleResult &result) const
|
||||||
|
@ -301,12 +301,6 @@ void CGTownInstance::setOwner(const PlayerColor & player) const
|
|||||||
cb->setOwner(this, player);
|
cb->setOwner(this, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGTownInstance::blockingDialogAnswered(const CGHeroInstance *hero, int32_t answer) const
|
|
||||||
{
|
|
||||||
for (auto building : rewardableBuildings)
|
|
||||||
building.second->blockingDialogAnswered(hero, answer); // FIXME: why call for every building?
|
|
||||||
}
|
|
||||||
|
|
||||||
void CGTownInstance::onHeroVisit(const CGHeroInstance * h) const
|
void CGTownInstance::onHeroVisit(const CGHeroInstance * h) const
|
||||||
{
|
{
|
||||||
if(cb->gameState()->getPlayerRelations( getOwner(), h->getOwner() ) == PlayerRelations::ENEMIES)
|
if(cb->gameState()->getPlayerRelations( getOwner(), h->getOwner() ) == PlayerRelations::ENEMIES)
|
||||||
|
@ -239,7 +239,6 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
void setPropertyDer(ObjProperty what, ObjPropertyID identifier) override;
|
void setPropertyDer(ObjProperty what, ObjPropertyID identifier) override;
|
||||||
void serializeJsonOptions(JsonSerializeFormat & handler) override;
|
void serializeJsonOptions(JsonSerializeFormat & handler) override;
|
||||||
void blockingDialogAnswered(const CGHeroInstance *hero, int32_t answer) const override;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
FactionID randomizeFaction(vstd::RNG & rand);
|
FactionID randomizeFaction(vstd::RNG & rand);
|
||||||
|
@ -851,7 +851,7 @@ void CGBorderGuard::onHeroVisit(const CGHeroInstance * h) const
|
|||||||
BlockingDialog bd (true, false);
|
BlockingDialog bd (true, false);
|
||||||
bd.player = h->getOwner();
|
bd.player = h->getOwner();
|
||||||
bd.text.appendLocalString (EMetaText::ADVOB_TXT, 17);
|
bd.text.appendLocalString (EMetaText::ADVOB_TXT, 17);
|
||||||
cb->showBlockingDialog (&bd);
|
cb->showBlockingDialog (this, &bd);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -52,7 +52,7 @@ void CRewardableObject::selectRewardWithMessage(const CGHeroInstance * contextHe
|
|||||||
sd.player = contextHero->tempOwner;
|
sd.player = contextHero->tempOwner;
|
||||||
sd.text = dialog;
|
sd.text = dialog;
|
||||||
sd.components = loadComponents(contextHero, rewardIndices);
|
sd.components = loadComponents(contextHero, rewardIndices);
|
||||||
cb->showBlockingDialog(&sd);
|
cb->showBlockingDialog(this, &sd);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ void CGMine::onHeroVisit( const CGHeroInstance * h ) const
|
|||||||
BlockingDialog ynd(true,false);
|
BlockingDialog ynd(true,false);
|
||||||
ynd.player = h->tempOwner;
|
ynd.player = h->tempOwner;
|
||||||
ynd.text.appendLocalString(EMetaText::ADVOB_TXT, isAbandoned() ? 84 : 187);
|
ynd.text.appendLocalString(EMetaText::ADVOB_TXT, isAbandoned() ? 84 : 187);
|
||||||
cb->showBlockingDialog(&ynd);
|
cb->showBlockingDialog(this, &ynd);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -310,7 +310,7 @@ void CGResource::onHeroVisit( const CGHeroInstance * h ) const
|
|||||||
BlockingDialog ynd(true,false);
|
BlockingDialog ynd(true,false);
|
||||||
ynd.player = h->getOwner();
|
ynd.player = h->getOwner();
|
||||||
ynd.text = message;
|
ynd.text = message;
|
||||||
cb->showBlockingDialog(&ynd);
|
cb->showBlockingDialog(this, &ynd);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -879,7 +879,7 @@ void CGArtifact::onHeroVisit(const CGHeroInstance * h) const
|
|||||||
ynd.text.replaceRawString(getArmyDescription());
|
ynd.text.replaceRawString(getArmyDescription());
|
||||||
ynd.text.replaceLocalString(EMetaText::GENERAL_TXT, 43); // creatures
|
ynd.text.replaceLocalString(EMetaText::GENERAL_TXT, 43); // creatures
|
||||||
}
|
}
|
||||||
cb->showBlockingDialog(&ynd);
|
cb->showBlockingDialog(this, &ynd);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Obj::SPELL_SCROLL:
|
case Obj::SPELL_SCROLL:
|
||||||
@ -889,7 +889,7 @@ void CGArtifact::onHeroVisit(const CGHeroInstance * h) const
|
|||||||
BlockingDialog ynd(true,false);
|
BlockingDialog ynd(true,false);
|
||||||
ynd.player = h->getOwner();
|
ynd.player = h->getOwner();
|
||||||
ynd.text = message;
|
ynd.text = message;
|
||||||
cb->showBlockingDialog(&ynd);
|
cb->showBlockingDialog(this, &ynd);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
blockingDialogAnswered(h, true);
|
blockingDialogAnswered(h, true);
|
||||||
|
@ -221,7 +221,7 @@ void TownRewardableBuildingInstance::onHeroVisit(const CGHeroInstance *h) const
|
|||||||
if (rewards.size() == 1)
|
if (rewards.size() == 1)
|
||||||
configuration.info.at(rewards.front()).reward.loadComponents(sd.components, h);
|
configuration.info.at(rewards.front()).reward.loadComponents(sd.components, h);
|
||||||
|
|
||||||
cb->showBlockingDialog(&sd);
|
cb->showBlockingDialog(this, &sd);
|
||||||
};
|
};
|
||||||
|
|
||||||
if(!town->hasBuilt(getBuildingType()))
|
if(!town->hasBuilt(getBuildingType()))
|
||||||
|
@ -126,7 +126,7 @@ public:
|
|||||||
virtual void visitBulkSmartSplitStack(BulkSmartSplitStack & pack) {}
|
virtual void visitBulkSmartSplitStack(BulkSmartSplitStack & pack) {}
|
||||||
virtual void visitDisbandCreature(DisbandCreature & pack) {}
|
virtual void visitDisbandCreature(DisbandCreature & pack) {}
|
||||||
virtual void visitBuildStructure(BuildStructure & pack) {}
|
virtual void visitBuildStructure(BuildStructure & pack) {}
|
||||||
virtual void visitTriggerTownSpecialBuildingAction(TriggerTownSpecialBuildingAction & pack) {}
|
virtual void visitVisitTownBuilding(VisitTownBuilding & pack) {}
|
||||||
virtual void visitRazeStructure(RazeStructure & pack) {}
|
virtual void visitRazeStructure(RazeStructure & pack) {}
|
||||||
virtual void visitRecruitCreatures(RecruitCreatures & pack) {}
|
virtual void visitRecruitCreatures(RecruitCreatures & pack) {}
|
||||||
virtual void visitUpgradeCreature(UpgradeCreature & pack) {}
|
virtual void visitUpgradeCreature(UpgradeCreature & pack) {}
|
||||||
|
@ -582,9 +582,9 @@ void BuildStructure::visitTyped(ICPackVisitor & visitor)
|
|||||||
visitor.visitBuildStructure(*this);
|
visitor.visitBuildStructure(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TriggerTownSpecialBuildingAction::visitTyped(ICPackVisitor & visitor)
|
void VisitTownBuilding::visitTyped(ICPackVisitor & visitor)
|
||||||
{
|
{
|
||||||
visitor.visitTriggerTownSpecialBuildingAction(*this);
|
visitor.visitVisitTownBuilding(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RazeStructure::visitTyped(ICPackVisitor & visitor)
|
void RazeStructure::visitTyped(ICPackVisitor & visitor)
|
||||||
|
@ -280,16 +280,16 @@ struct DLL_LINKAGE BuildStructure : public CPackForServer
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct DLL_LINKAGE TriggerTownSpecialBuildingAction : public CPackForServer
|
struct DLL_LINKAGE VisitTownBuilding : public CPackForServer
|
||||||
{
|
{
|
||||||
TriggerTownSpecialBuildingAction() = default;
|
VisitTownBuilding() = default;
|
||||||
TriggerTownSpecialBuildingAction(const ObjectInstanceID & TID, const BuildingSubID::EBuildingSubID SID)
|
VisitTownBuilding(const ObjectInstanceID & TID, const BuildingID BID)
|
||||||
: tid(TID)
|
: tid(TID)
|
||||||
, sid(SID)
|
, bid(BID)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
ObjectInstanceID tid;
|
ObjectInstanceID tid;
|
||||||
BuildingSubID::EBuildingSubID sid;
|
BuildingID bid;
|
||||||
|
|
||||||
void visitTyped(ICPackVisitor & visitor) override;
|
void visitTyped(ICPackVisitor & visitor) override;
|
||||||
|
|
||||||
@ -297,7 +297,7 @@ struct DLL_LINKAGE TriggerTownSpecialBuildingAction : public CPackForServer
|
|||||||
{
|
{
|
||||||
h & static_cast<CPackForServer &>(*this);
|
h & static_cast<CPackForServer &>(*this);
|
||||||
h & tid;
|
h & tid;
|
||||||
h & sid;
|
h & bid;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,26 +0,0 @@
|
|||||||
/*
|
|
||||||
* Cast.h, part of VCMI engine
|
|
||||||
*
|
|
||||||
* Authors: listed in file AUTHORS in main folder
|
|
||||||
*
|
|
||||||
* License: GNU General Public License v2.0 or later
|
|
||||||
* Full text of license available in license.txt file, in main folder
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
VCMI_LIB_NAMESPACE_BEGIN
|
|
||||||
|
|
||||||
template<class T, class F>
|
|
||||||
inline const T * dynamic_ptr_cast(const F * ptr)
|
|
||||||
{
|
|
||||||
return dynamic_cast<const T *>(ptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
template<class T, class F>
|
|
||||||
inline T * dynamic_ptr_cast(F * ptr)
|
|
||||||
{
|
|
||||||
return dynamic_cast<T *>(ptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
VCMI_LIB_NAMESPACE_END
|
|
@ -239,7 +239,7 @@ void registerTypes(Serializer &s)
|
|||||||
s.template registerType<ArrangeStacks>(183);
|
s.template registerType<ArrangeStacks>(183);
|
||||||
s.template registerType<DisbandCreature>(184);
|
s.template registerType<DisbandCreature>(184);
|
||||||
s.template registerType<BuildStructure>(185);
|
s.template registerType<BuildStructure>(185);
|
||||||
s.template registerType<TriggerTownSpecialBuildingAction>(186);
|
s.template registerType<VisitTownBuilding>(186);
|
||||||
s.template registerType<RecruitCreatures>(187);
|
s.template registerType<RecruitCreatures>(187);
|
||||||
s.template registerType<UpgradeCreature>(188);
|
s.template registerType<UpgradeCreature>(188);
|
||||||
s.template registerType<GarrisonHeroSwap>(189);
|
s.template registerType<GarrisonHeroSwap>(189);
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#include "processors/TurnOrderProcessor.h"
|
#include "processors/TurnOrderProcessor.h"
|
||||||
#include "queries/QueriesProcessor.h"
|
#include "queries/QueriesProcessor.h"
|
||||||
#include "queries/MapQueries.h"
|
#include "queries/MapQueries.h"
|
||||||
|
#include "queries/VisitQueries.h"
|
||||||
|
|
||||||
#include "../lib/ArtifactUtils.h"
|
#include "../lib/ArtifactUtils.h"
|
||||||
#include "../lib/CArtHandler.h"
|
#include "../lib/CArtHandler.h"
|
||||||
@ -1077,9 +1078,9 @@ void CGameHandler::setOwner(const CGObjectInstance * obj, const PlayerColor owne
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGameHandler::showBlockingDialog(BlockingDialog *iw)
|
void CGameHandler::showBlockingDialog(const IObjectInterface * caller, BlockingDialog *iw)
|
||||||
{
|
{
|
||||||
auto dialogQuery = std::make_shared<CBlockingDialogQuery>(this, *iw);
|
auto dialogQuery = std::make_shared<CBlockingDialogQuery>(this, caller, *iw);
|
||||||
queries->addQuery(dialogQuery);
|
queries->addQuery(dialogQuery);
|
||||||
iw->queryID = dialogQuery->queryID;
|
iw->queryID = dialogQuery->queryID;
|
||||||
sendToAllClients(iw);
|
sendToAllClients(iw);
|
||||||
@ -1181,7 +1182,10 @@ void CGameHandler::heroVisitCastle(const CGTownInstance * obj, const CGHeroInsta
|
|||||||
void CGameHandler::visitCastleObjects(const CGTownInstance * t, const CGHeroInstance * h)
|
void CGameHandler::visitCastleObjects(const CGTownInstance * t, const CGHeroInstance * h)
|
||||||
{
|
{
|
||||||
for (auto & building : t->rewardableBuildings)
|
for (auto & building : t->rewardableBuildings)
|
||||||
|
{
|
||||||
|
if (!t->town->buildings.at(building.first)->manualHeroVisit)
|
||||||
building.second->onHeroVisit(h);
|
building.second->onHeroVisit(h);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGameHandler::stopHeroVisitCastle(const CGTownInstance * obj, const CGHeroInstance * hero)
|
void CGameHandler::stopHeroVisitCastle(const CGTownInstance * obj, const CGHeroInstance * hero)
|
||||||
@ -2148,20 +2152,38 @@ bool CGameHandler::buildStructure(ObjectInstanceID tid, BuildingID requestedID,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CGameHandler::triggerTownSpecialBuildingAction(ObjectInstanceID tid, BuildingSubID::EBuildingSubID sid)
|
bool CGameHandler::visitTownBuilding(ObjectInstanceID tid, BuildingID bid)
|
||||||
{
|
{
|
||||||
const CGTownInstance * t = getTown(tid);
|
const CGTownInstance * t = getTown(tid);
|
||||||
|
|
||||||
if(t->town->getBuildingType(sid) == BuildingID::NONE)
|
if(!t->hasBuilt(bid))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if(sid == BuildingSubID::EBuildingSubID::BANK)
|
auto subID = t->town->buildings.at(bid)->subId;
|
||||||
|
|
||||||
|
if(subID == BuildingSubID::EBuildingSubID::BANK)
|
||||||
{
|
{
|
||||||
TResources res;
|
TResources res;
|
||||||
res[EGameResID::GOLD] = 2500;
|
res[EGameResID::GOLD] = 2500;
|
||||||
giveResources(t->getOwner(), res);
|
giveResources(t->getOwner(), res);
|
||||||
|
|
||||||
setObjPropertyValue(t->id, ObjProperty::BONUS_VALUE_SECOND, 2500);
|
setObjPropertyValue(t->id, ObjProperty::BONUS_VALUE_SECOND, 2500);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (t->rewardableBuildings.count(bid))
|
||||||
|
{
|
||||||
|
auto & hero = t->garrisonHero ? t->garrisonHero : t->visitingHero;
|
||||||
|
auto * building = t->rewardableBuildings.at(bid);
|
||||||
|
|
||||||
|
if (hero && t->town->buildings.at(bid)->manualHeroVisit)
|
||||||
|
{
|
||||||
|
auto visitQuery = std::make_shared<TownBuildingVisitQuery>(this, t, hero, bid);
|
||||||
|
queries->addQuery(visitQuery);
|
||||||
|
building->onHeroVisit(hero);
|
||||||
|
queries->popIfTop(visitQuery);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -3185,7 +3207,7 @@ void CGameHandler::objectVisited(const CGObjectInstance * obj, const CGHeroInsta
|
|||||||
throw std::runtime_error("Can not visit object that is being visited");
|
throw std::runtime_error("Can not visit object that is being visited");
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<CObjectVisitQuery> visitQuery;
|
std::shared_ptr<MapObjectVisitQuery> visitQuery;
|
||||||
|
|
||||||
auto startVisit = [&](ObjectVisitStarted & event)
|
auto startVisit = [&](ObjectVisitStarted & event)
|
||||||
{
|
{
|
||||||
@ -3204,7 +3226,7 @@ void CGameHandler::objectVisited(const CGObjectInstance * obj, const CGHeroInsta
|
|||||||
visitedObject = visitedTown;
|
visitedObject = visitedTown;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
visitQuery = std::make_shared<CObjectVisitQuery>(this, visitedObject, h, visitedObject->visitablePos());
|
visitQuery = std::make_shared<MapObjectVisitQuery>(this, visitedObject, h);
|
||||||
queries->addQuery(visitQuery); //TODO real visit pos
|
queries->addQuery(visitQuery); //TODO real visit pos
|
||||||
|
|
||||||
HeroVisit hv;
|
HeroVisit hv;
|
||||||
@ -3223,11 +3245,11 @@ void CGameHandler::objectVisited(const CGObjectInstance * obj, const CGHeroInsta
|
|||||||
queries->popIfTop(visitQuery); //visit ends here if no queries were created
|
queries->popIfTop(visitQuery); //visit ends here if no queries were created
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGameHandler::objectVisitEnded(const CObjectVisitQuery & query)
|
void CGameHandler::objectVisitEnded(const CGHeroInstance *h, PlayerColor player)
|
||||||
{
|
{
|
||||||
using events::ObjectVisitEnded;
|
using events::ObjectVisitEnded;
|
||||||
|
|
||||||
logGlobal->debug("%s visit ends.\n", query.visitingHero->nodeName());
|
logGlobal->debug("%s visit ends.\n", h->nodeName());
|
||||||
|
|
||||||
auto endVisit = [&](ObjectVisitEnded & event)
|
auto endVisit = [&](ObjectVisitEnded & event)
|
||||||
{
|
{
|
||||||
@ -3240,7 +3262,7 @@ void CGameHandler::objectVisitEnded(const CObjectVisitQuery & query)
|
|||||||
|
|
||||||
//TODO: ObjectVisitEnded should also have id of visited object,
|
//TODO: ObjectVisitEnded should also have id of visited object,
|
||||||
//but this requires object being deleted only by `removeAfterVisit()` but not `removeObject()`
|
//but this requires object being deleted only by `removeAfterVisit()` but not `removeObject()`
|
||||||
ObjectVisitEnded::defaultExecute(serverEventBus.get(), endVisit, query.players.front(), query.visitingHero->id);
|
ObjectVisitEnded::defaultExecute(serverEventBus.get(), endVisit, player, h->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CGameHandler::buildBoat(ObjectInstanceID objid, PlayerColor playerID)
|
bool CGameHandler::buildBoat(ObjectInstanceID objid, PlayerColor playerID)
|
||||||
@ -3837,7 +3859,7 @@ bool CGameHandler::isValidObject(const CGObjectInstance *obj) const
|
|||||||
|
|
||||||
bool CGameHandler::isBlockedByQueries(const CPack *pack, PlayerColor player)
|
bool CGameHandler::isBlockedByQueries(const CPack *pack, PlayerColor player)
|
||||||
{
|
{
|
||||||
if (!strcmp(typeid(*pack).name(), typeid(PlayerMessage).name()))
|
if (dynamic_cast<const PlayerMessage *>(pack) != nullptr)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
auto query = queries->topQuery(player);
|
auto query = queries->topQuery(player);
|
||||||
@ -3859,7 +3881,7 @@ void CGameHandler::removeAfterVisit(const CGObjectInstance *object)
|
|||||||
//If the object is being visited, there must be a matching query
|
//If the object is being visited, there must be a matching query
|
||||||
for (const auto &query : queries->allQueries())
|
for (const auto &query : queries->allQueries())
|
||||||
{
|
{
|
||||||
if (auto someVistQuery = std::dynamic_pointer_cast<CObjectVisitQuery>(query))
|
if (auto someVistQuery = std::dynamic_pointer_cast<MapObjectVisitQuery>(query))
|
||||||
{
|
{
|
||||||
if (someVistQuery->visitedObject == object)
|
if (someVistQuery->visitedObject == object)
|
||||||
{
|
{
|
||||||
@ -3923,7 +3945,7 @@ const CGHeroInstance * CGameHandler::getVisitingHero(const CGObjectInstance *obj
|
|||||||
|
|
||||||
for(const auto & query : queries->allQueries())
|
for(const auto & query : queries->allQueries())
|
||||||
{
|
{
|
||||||
auto visit = std::dynamic_pointer_cast<const CObjectVisitQuery>(query);
|
auto visit = std::dynamic_pointer_cast<const VisitQuery>(query);
|
||||||
if (visit && visit->visitedObject == obj)
|
if (visit && visit->visitedObject == obj)
|
||||||
return visit->visitingHero;
|
return visit->visitingHero;
|
||||||
}
|
}
|
||||||
@ -3936,7 +3958,7 @@ const CGObjectInstance * CGameHandler::getVisitingObject(const CGHeroInstance *h
|
|||||||
|
|
||||||
for(const auto & query : queries->allQueries())
|
for(const auto & query : queries->allQueries())
|
||||||
{
|
{
|
||||||
auto visit = std::dynamic_pointer_cast<const CObjectVisitQuery>(query);
|
auto visit = std::dynamic_pointer_cast<const VisitQuery>(query);
|
||||||
if (visit && visit->visitingHero == hero)
|
if (visit && visit->visitingHero == hero)
|
||||||
return visit->visitedObject;
|
return visit->visitedObject;
|
||||||
}
|
}
|
||||||
@ -3953,7 +3975,7 @@ bool CGameHandler::isVisitCoveredByAnotherQuery(const CGObjectInstance *obj, con
|
|||||||
// visitation query is covered by other query that must be answered first
|
// visitation query is covered by other query that must be answered first
|
||||||
|
|
||||||
if (auto topQuery = queries->topQuery(hero->getOwner()))
|
if (auto topQuery = queries->topQuery(hero->getOwner()))
|
||||||
if (auto visit = std::dynamic_pointer_cast<const CObjectVisitQuery>(topQuery))
|
if (auto visit = std::dynamic_pointer_cast<const VisitQuery>(topQuery))
|
||||||
return !(visit->visitedObject == obj && visit->visitingHero == hero);
|
return !(visit->visitedObject == obj && visit->visitingHero == hero);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -113,7 +113,7 @@ public:
|
|||||||
void changePrimSkill(const CGHeroInstance * hero, PrimarySkill which, si64 val, bool abs=false) override;
|
void changePrimSkill(const CGHeroInstance * hero, PrimarySkill which, si64 val, bool abs=false) override;
|
||||||
void changeSecSkill(const CGHeroInstance * hero, SecondarySkill which, int val, bool abs=false) override;
|
void changeSecSkill(const CGHeroInstance * hero, SecondarySkill which, int val, bool abs=false) override;
|
||||||
|
|
||||||
void showBlockingDialog(BlockingDialog *iw) override;
|
void showBlockingDialog(const IObjectInterface * caller, BlockingDialog *iw) override;
|
||||||
void showTeleportDialog(TeleportDialog *iw) override;
|
void showTeleportDialog(TeleportDialog *iw) override;
|
||||||
void showGarrisonDialog(ObjectInstanceID upobj, ObjectInstanceID hid, bool removableUnits) override;
|
void showGarrisonDialog(ObjectInstanceID upobj, ObjectInstanceID hid, bool removableUnits) override;
|
||||||
void showObjectWindow(const CGObjectInstance * object, EOpenWindowMode window, const CGHeroInstance * visitor, bool addQuery) override;
|
void showObjectWindow(const CGObjectInstance * object, EOpenWindowMode window, const CGHeroInstance * visitor, bool addQuery) override;
|
||||||
@ -216,7 +216,7 @@ public:
|
|||||||
bool upgradeCreature( ObjectInstanceID objid, SlotID pos, CreatureID upgID );
|
bool upgradeCreature( ObjectInstanceID objid, SlotID pos, CreatureID upgID );
|
||||||
bool recruitCreatures(ObjectInstanceID objid, ObjectInstanceID dst, CreatureID crid, ui32 cram, si32 level, PlayerColor player);
|
bool recruitCreatures(ObjectInstanceID objid, ObjectInstanceID dst, CreatureID crid, ui32 cram, si32 level, PlayerColor player);
|
||||||
bool buildStructure(ObjectInstanceID tid, BuildingID bid, bool force=false);//force - for events: no cost, no checkings
|
bool buildStructure(ObjectInstanceID tid, BuildingID bid, bool force=false);//force - for events: no cost, no checkings
|
||||||
bool triggerTownSpecialBuildingAction(ObjectInstanceID tid, BuildingSubID::EBuildingSubID sid);
|
bool visitTownBuilding(ObjectInstanceID tid, BuildingID bid);
|
||||||
bool razeStructure(ObjectInstanceID tid, BuildingID bid);
|
bool razeStructure(ObjectInstanceID tid, BuildingID bid);
|
||||||
bool disbandCreature( ObjectInstanceID id, SlotID pos );
|
bool disbandCreature( ObjectInstanceID id, SlotID pos );
|
||||||
bool arrangeStacks( ObjectInstanceID id1, ObjectInstanceID id2, ui8 what, SlotID p1, SlotID p2, si32 val, PlayerColor player);
|
bool arrangeStacks( ObjectInstanceID id1, ObjectInstanceID id2, ui8 what, SlotID p1, SlotID p2, si32 val, PlayerColor player);
|
||||||
@ -234,7 +234,7 @@ public:
|
|||||||
|
|
||||||
bool complain(const std::string &problem); //sends message to all clients, prints on the logs and return true
|
bool complain(const std::string &problem); //sends message to all clients, prints on the logs and return true
|
||||||
void objectVisited( const CGObjectInstance * obj, const CGHeroInstance * h );
|
void objectVisited( const CGObjectInstance * obj, const CGHeroInstance * h );
|
||||||
void objectVisitEnded(const CObjectVisitQuery &query);
|
void objectVisitEnded(const CGHeroInstance *h, PlayerColor player);
|
||||||
bool dig(const CGHeroInstance *h);
|
bool dig(const CGHeroInstance *h);
|
||||||
void moveArmy(const CArmedInstance *src, const CArmedInstance *dst, bool allowMerging);
|
void moveArmy(const CArmedInstance *src, const CArmedInstance *dst, bool allowMerging);
|
||||||
|
|
||||||
|
@ -9,6 +9,7 @@ set(vcmiservercommon_SRCS
|
|||||||
queries/BattleQueries.cpp
|
queries/BattleQueries.cpp
|
||||||
queries/CQuery.cpp
|
queries/CQuery.cpp
|
||||||
queries/MapQueries.cpp
|
queries/MapQueries.cpp
|
||||||
|
queries/VisitQueries.cpp
|
||||||
queries/QueriesProcessor.cpp
|
queries/QueriesProcessor.cpp
|
||||||
|
|
||||||
processors/HeroPoolProcessor.cpp
|
processors/HeroPoolProcessor.cpp
|
||||||
@ -36,6 +37,7 @@ set(vcmiservercommon_HEADERS
|
|||||||
queries/BattleQueries.h
|
queries/BattleQueries.h
|
||||||
queries/CQuery.h
|
queries/CQuery.h
|
||||||
queries/MapQueries.h
|
queries/MapQueries.h
|
||||||
|
queries/VisitQueries.h
|
||||||
queries/QueriesProcessor.h
|
queries/QueriesProcessor.h
|
||||||
|
|
||||||
processors/HeroPoolProcessor.h
|
processors/HeroPoolProcessor.h
|
||||||
|
@ -27,7 +27,6 @@
|
|||||||
#include "../lib/battle/Unit.h"
|
#include "../lib/battle/Unit.h"
|
||||||
#include "../lib/spells/CSpellHandler.h"
|
#include "../lib/spells/CSpellHandler.h"
|
||||||
#include "../lib/spells/ISpellMechanics.h"
|
#include "../lib/spells/ISpellMechanics.h"
|
||||||
#include "../lib/serializer/Cast.h"
|
|
||||||
|
|
||||||
void ApplyGhNetPackVisitor::visitSaveGame(SaveGame & pack)
|
void ApplyGhNetPackVisitor::visitSaveGame(SaveGame & pack)
|
||||||
{
|
{
|
||||||
@ -139,12 +138,12 @@ void ApplyGhNetPackVisitor::visitBuildStructure(BuildStructure & pack)
|
|||||||
result = gh.buildStructure(pack.tid, pack.bid);
|
result = gh.buildStructure(pack.tid, pack.bid);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ApplyGhNetPackVisitor::visitTriggerTownSpecialBuildingAction(TriggerTownSpecialBuildingAction & pack)
|
void ApplyGhNetPackVisitor::visitVisitTownBuilding(VisitTownBuilding & pack)
|
||||||
{
|
{
|
||||||
gh.throwIfWrongOwner(&pack, pack.tid);
|
gh.throwIfWrongOwner(&pack, pack.tid);
|
||||||
gh.throwIfPlayerNotActive(&pack);
|
gh.throwIfPlayerNotActive(&pack);
|
||||||
|
|
||||||
result = gh.triggerTownSpecialBuildingAction(pack.tid, pack.sid);
|
result = gh.visitTownBuilding(pack.tid, pack.bid);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ApplyGhNetPackVisitor::visitRecruitCreatures(RecruitCreatures & pack)
|
void ApplyGhNetPackVisitor::visitRecruitCreatures(RecruitCreatures & pack)
|
||||||
|
@ -41,7 +41,7 @@ public:
|
|||||||
void visitBulkSmartSplitStack(BulkSmartSplitStack & pack) override;
|
void visitBulkSmartSplitStack(BulkSmartSplitStack & pack) override;
|
||||||
void visitDisbandCreature(DisbandCreature & pack) override;
|
void visitDisbandCreature(DisbandCreature & pack) override;
|
||||||
void visitBuildStructure(BuildStructure & pack) override;
|
void visitBuildStructure(BuildStructure & pack) override;
|
||||||
void visitTriggerTownSpecialBuildingAction(TriggerTownSpecialBuildingAction & pack) override;
|
void visitVisitTownBuilding(VisitTownBuilding & pack) override;
|
||||||
void visitRecruitCreatures(RecruitCreatures & pack) override;
|
void visitRecruitCreatures(RecruitCreatures & pack) override;
|
||||||
void visitUpgradeCreature(UpgradeCreature & pack) override;
|
void visitUpgradeCreature(UpgradeCreature & pack) override;
|
||||||
void visitGarrisonHeroSwap(GarrisonHeroSwap & pack) override;
|
void visitGarrisonHeroSwap(GarrisonHeroSwap & pack) override;
|
||||||
|
@ -27,7 +27,6 @@
|
|||||||
#include "../../lib/mapObjects/CGTownInstance.h"
|
#include "../../lib/mapObjects/CGTownInstance.h"
|
||||||
#include "../../lib/networkPacks/PacksForClientBattle.h"
|
#include "../../lib/networkPacks/PacksForClientBattle.h"
|
||||||
#include "../../lib/networkPacks/PacksForClient.h"
|
#include "../../lib/networkPacks/PacksForClient.h"
|
||||||
#include "../../lib/serializer/Cast.h"
|
|
||||||
#include "../../lib/spells/CSpellHandler.h"
|
#include "../../lib/spells/CSpellHandler.h"
|
||||||
|
|
||||||
#include <vstd/RNG.h>
|
#include <vstd/RNG.h>
|
||||||
@ -81,7 +80,7 @@ CasualtiesAfterBattle::CasualtiesAfterBattle(const CBattleInfoCallback & battle,
|
|||||||
else if(warMachine != ArtifactID::CATAPULT && st->getCount() <= 0)
|
else if(warMachine != ArtifactID::CATAPULT && st->getCount() <= 0)
|
||||||
{
|
{
|
||||||
logGlobal->debug("War machine has been destroyed");
|
logGlobal->debug("War machine has been destroyed");
|
||||||
auto hero = dynamic_ptr_cast<CGHeroInstance> (army);
|
auto hero = dynamic_cast<const CGHeroInstance*> (army);
|
||||||
if (hero)
|
if (hero)
|
||||||
removedWarMachines.push_back (ArtifactLocation(hero->id, hero->getArtPos(warMachine, true)));
|
removedWarMachines.push_back (ArtifactLocation(hero->id, hero->getArtPos(warMachine, true)));
|
||||||
else
|
else
|
||||||
|
@ -21,14 +21,13 @@
|
|||||||
#include "../../lib/mapObjects/CGObjectInstance.h"
|
#include "../../lib/mapObjects/CGObjectInstance.h"
|
||||||
#include "../../lib/mapObjects/CGTownInstance.h"
|
#include "../../lib/mapObjects/CGTownInstance.h"
|
||||||
#include "../../lib/networkPacks/PacksForServer.h"
|
#include "../../lib/networkPacks/PacksForServer.h"
|
||||||
#include "../../lib/serializer/Cast.h"
|
|
||||||
|
|
||||||
void CBattleQuery::notifyObjectAboutRemoval(const CObjectVisitQuery & objectVisit) const
|
void CBattleQuery::notifyObjectAboutRemoval(const CGObjectInstance * visitedObject, const CGHeroInstance * visitingHero) const
|
||||||
{
|
{
|
||||||
assert(result);
|
assert(result);
|
||||||
|
|
||||||
if(result)
|
if(result)
|
||||||
objectVisit.visitedObject->battleFinished(objectVisit.visitingHero, *result);
|
visitedObject->battleFinished(visitingHero, *result);
|
||||||
}
|
}
|
||||||
|
|
||||||
CBattleQuery::CBattleQuery(CGameHandler * owner, const IBattleInfo * bi):
|
CBattleQuery::CBattleQuery(CGameHandler * owner, const IBattleInfo * bi):
|
||||||
@ -51,10 +50,10 @@ CBattleQuery::CBattleQuery(CGameHandler * owner):
|
|||||||
|
|
||||||
bool CBattleQuery::blocksPack(const CPack * pack) const
|
bool CBattleQuery::blocksPack(const CPack * pack) const
|
||||||
{
|
{
|
||||||
if(dynamic_ptr_cast<MakeAction>(pack) != nullptr)
|
if(dynamic_cast<const MakeAction*>(pack) != nullptr)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if(dynamic_ptr_cast<GamePause>(pack) != nullptr)
|
if(dynamic_cast<const GamePause*>(pack) != nullptr)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -29,7 +29,7 @@ public:
|
|||||||
|
|
||||||
CBattleQuery(CGameHandler * owner);
|
CBattleQuery(CGameHandler * owner);
|
||||||
CBattleQuery(CGameHandler * owner, const IBattleInfo * Bi); //TODO
|
CBattleQuery(CGameHandler * owner, const IBattleInfo * Bi); //TODO
|
||||||
void notifyObjectAboutRemoval(const CObjectVisitQuery &objectVisit) const override;
|
void notifyObjectAboutRemoval(const CGObjectInstance * visitedObject, const CGHeroInstance * visitingHero) const override;
|
||||||
bool blocksPack(const CPack *pack) const override;
|
bool blocksPack(const CPack *pack) const override;
|
||||||
void onRemoval(PlayerColor color) override;
|
void onRemoval(PlayerColor color) override;
|
||||||
void onExposure(QueryPtr topQuery) override;
|
void onExposure(QueryPtr topQuery) override;
|
||||||
|
@ -14,7 +14,6 @@
|
|||||||
|
|
||||||
#include "../CGameHandler.h"
|
#include "../CGameHandler.h"
|
||||||
|
|
||||||
#include "../../lib/serializer/Cast.h"
|
|
||||||
#include "../../lib/networkPacks/PacksForServer.h"
|
#include "../../lib/networkPacks/PacksForServer.h"
|
||||||
|
|
||||||
std::ostream & operator<<(std::ostream & out, const CQuery & query)
|
std::ostream & operator<<(std::ostream & out, const CQuery & query)
|
||||||
@ -87,7 +86,7 @@ bool CQuery::blocksPack(const CPack * pack) const
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CQuery::notifyObjectAboutRemoval(const CObjectVisitQuery & objectVisit) const
|
void CQuery::notifyObjectAboutRemoval(const CGObjectInstance * visitedObject, const CGHeroInstance * visitingHero) const
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -116,7 +115,7 @@ void CQuery::setReply(std::optional<int32_t> reply)
|
|||||||
bool CQuery::blockAllButReply(const CPack * pack) const
|
bool CQuery::blockAllButReply(const CPack * pack) const
|
||||||
{
|
{
|
||||||
//We accept only query replies from correct player
|
//We accept only query replies from correct player
|
||||||
if(auto reply = dynamic_ptr_cast<QueryReply>(pack))
|
if(auto reply = dynamic_cast<const QueryReply*>(pack))
|
||||||
return !vstd::contains(players, reply->player);
|
return !vstd::contains(players, reply->player);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -14,6 +14,8 @@
|
|||||||
VCMI_LIB_NAMESPACE_BEGIN
|
VCMI_LIB_NAMESPACE_BEGIN
|
||||||
|
|
||||||
struct CPack;
|
struct CPack;
|
||||||
|
class CGObjectInstance;
|
||||||
|
class CGHeroInstance;
|
||||||
|
|
||||||
VCMI_LIB_NAMESPACE_END
|
VCMI_LIB_NAMESPACE_END
|
||||||
|
|
||||||
@ -40,18 +42,29 @@ public:
|
|||||||
|
|
||||||
CQuery(CGameHandler * gh);
|
CQuery(CGameHandler * gh);
|
||||||
|
|
||||||
virtual bool blocksPack(const CPack *pack) const; //query can block attempting actions by player. Eg. he can't move hero during the battle.
|
/// query can block attempting actions by player. Eg. he can't move hero during the battle.
|
||||||
|
virtual bool blocksPack(const CPack *pack) const;
|
||||||
|
|
||||||
virtual bool endsByPlayerAnswer() const; //query is removed after player gives answer (like dialogs)
|
/// query is removed after player gives answer (like dialogs)
|
||||||
virtual void onAdding(PlayerColor color); //called just before query is pushed on stack
|
virtual bool endsByPlayerAnswer() const;
|
||||||
virtual void onAdded(PlayerColor color); //called right after query is pushed on stack
|
|
||||||
virtual void onRemoval(PlayerColor color); //called after query is removed from stack
|
|
||||||
virtual void onExposure(QueryPtr topQuery);//called when query immediately above is removed and this is exposed (becomes top)
|
|
||||||
virtual std::string toString() const;
|
|
||||||
|
|
||||||
virtual void notifyObjectAboutRemoval(const CObjectVisitQuery &objectVisit) const;
|
/// called just before query is pushed on stack
|
||||||
|
virtual void onAdding(PlayerColor color);
|
||||||
|
|
||||||
|
/// called right after query is pushed on stack
|
||||||
|
virtual void onAdded(PlayerColor color);
|
||||||
|
|
||||||
|
/// called after query is removed from stack
|
||||||
|
virtual void onRemoval(PlayerColor color);
|
||||||
|
|
||||||
|
/// called when query immediately above is removed and this is exposed (becomes top)
|
||||||
|
virtual void onExposure(QueryPtr topQuery);
|
||||||
|
|
||||||
|
/// called when this query is being removed and must report its result to currently visited object
|
||||||
|
virtual void notifyObjectAboutRemoval(const CGObjectInstance * visitedObject, const CGHeroInstance * visitingHero) const;
|
||||||
|
|
||||||
virtual void setReply(std::optional<int32_t> reply);
|
virtual void setReply(std::optional<int32_t> reply);
|
||||||
|
virtual std::string toString() const;
|
||||||
|
|
||||||
virtual ~CQuery();
|
virtual ~CQuery();
|
||||||
protected:
|
protected:
|
||||||
|
@ -13,10 +13,9 @@
|
|||||||
#include "QueriesProcessor.h"
|
#include "QueriesProcessor.h"
|
||||||
#include "../CGameHandler.h"
|
#include "../CGameHandler.h"
|
||||||
#include "../TurnTimerHandler.h"
|
#include "../TurnTimerHandler.h"
|
||||||
#include "../../lib/mapObjects/MiscObjects.h"
|
|
||||||
#include "../../lib/mapObjects/CGHeroInstance.h"
|
#include "../../lib/mapObjects/CGHeroInstance.h"
|
||||||
|
#include "../../lib/mapObjects/MiscObjects.h"
|
||||||
#include "../../lib/networkPacks/PacksForServer.h"
|
#include "../../lib/networkPacks/PacksForServer.h"
|
||||||
#include "../../lib/serializer/Cast.h"
|
|
||||||
|
|
||||||
TimerPauseQuery::TimerPauseQuery(CGameHandler * owner, PlayerColor player):
|
TimerPauseQuery::TimerPauseQuery(CGameHandler * owner, PlayerColor player):
|
||||||
CQuery(owner)
|
CQuery(owner)
|
||||||
@ -44,41 +43,9 @@ bool TimerPauseQuery::endsByPlayerAnswer() const
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
CObjectVisitQuery::CObjectVisitQuery(CGameHandler * owner, const CGObjectInstance * Obj, const CGHeroInstance * Hero, int3 Tile):
|
void CGarrisonDialogQuery::notifyObjectAboutRemoval(const CGObjectInstance * visitedObject, const CGHeroInstance * visitingHero) const
|
||||||
CQuery(owner), visitedObject(Obj), visitingHero(Hero), tile(Tile), removeObjectAfterVisit(false)
|
|
||||||
{
|
{
|
||||||
addPlayer(Hero->tempOwner);
|
visitedObject->garrisonDialogClosed(visitingHero);
|
||||||
}
|
|
||||||
|
|
||||||
bool CObjectVisitQuery::blocksPack(const CPack *pack) const
|
|
||||||
{
|
|
||||||
//During the visit itself ALL actions are blocked.
|
|
||||||
//(However, the visit may trigger a query above that'll pass some.)
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CObjectVisitQuery::onRemoval(PlayerColor color)
|
|
||||||
{
|
|
||||||
gh->objectVisitEnded(*this);
|
|
||||||
|
|
||||||
//TODO or should it be destructor?
|
|
||||||
//Can object visit affect 2 players and what would be desired behavior?
|
|
||||||
if(removeObjectAfterVisit)
|
|
||||||
gh->removeObject(visitedObject, color);
|
|
||||||
}
|
|
||||||
|
|
||||||
void CObjectVisitQuery::onExposure(QueryPtr topQuery)
|
|
||||||
{
|
|
||||||
//Object may have been removed and deleted.
|
|
||||||
if(gh->isValidObject(visitedObject))
|
|
||||||
topQuery->notifyObjectAboutRemoval(*this);
|
|
||||||
|
|
||||||
owner->popIfTop(*this);
|
|
||||||
}
|
|
||||||
|
|
||||||
void CGarrisonDialogQuery::notifyObjectAboutRemoval(const CObjectVisitQuery & objectVisit) const
|
|
||||||
{
|
|
||||||
objectVisit.visitedObject->garrisonDialogClosed(objectVisit.visitingHero);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CGarrisonDialogQuery::CGarrisonDialogQuery(CGameHandler * owner, const CArmedInstance * up, const CArmedInstance * down):
|
CGarrisonDialogQuery::CGarrisonDialogQuery(CGameHandler * owner, const CArmedInstance * up, const CArmedInstance * down):
|
||||||
@ -97,22 +64,22 @@ bool CGarrisonDialogQuery::blocksPack(const CPack * pack) const
|
|||||||
ourIds.insert(this->exchangingArmies[0]->id);
|
ourIds.insert(this->exchangingArmies[0]->id);
|
||||||
ourIds.insert(this->exchangingArmies[1]->id);
|
ourIds.insert(this->exchangingArmies[1]->id);
|
||||||
|
|
||||||
if(auto stacks = dynamic_ptr_cast<ArrangeStacks>(pack))
|
if(auto stacks = dynamic_cast<const ArrangeStacks*>(pack))
|
||||||
return !vstd::contains(ourIds, stacks->id1) || !vstd::contains(ourIds, stacks->id2);
|
return !vstd::contains(ourIds, stacks->id1) || !vstd::contains(ourIds, stacks->id2);
|
||||||
|
|
||||||
if(auto stacks = dynamic_ptr_cast<BulkSplitStack>(pack))
|
if(auto stacks = dynamic_cast<const BulkSplitStack*>(pack))
|
||||||
return !vstd::contains(ourIds, stacks->srcOwner);
|
return !vstd::contains(ourIds, stacks->srcOwner);
|
||||||
|
|
||||||
if(auto stacks = dynamic_ptr_cast<BulkMergeStacks>(pack))
|
if(auto stacks = dynamic_cast<const BulkMergeStacks*>(pack))
|
||||||
return !vstd::contains(ourIds, stacks->srcOwner);
|
return !vstd::contains(ourIds, stacks->srcOwner);
|
||||||
|
|
||||||
if(auto stacks = dynamic_ptr_cast<BulkSmartSplitStack>(pack))
|
if(auto stacks = dynamic_cast<const BulkSmartSplitStack*>(pack))
|
||||||
return !vstd::contains(ourIds, stacks->srcOwner);
|
return !vstd::contains(ourIds, stacks->srcOwner);
|
||||||
|
|
||||||
if(auto stacks = dynamic_ptr_cast<BulkMoveArmy>(pack))
|
if(auto stacks = dynamic_cast<const BulkMoveArmy*>(pack))
|
||||||
return !vstd::contains(ourIds, stacks->srcArmy) || !vstd::contains(ourIds, stacks->destArmy);
|
return !vstd::contains(ourIds, stacks->srcArmy) || !vstd::contains(ourIds, stacks->destArmy);
|
||||||
|
|
||||||
if(auto arts = dynamic_ptr_cast<ExchangeArtifacts>(pack))
|
if(auto arts = dynamic_cast<const ExchangeArtifacts*>(pack))
|
||||||
{
|
{
|
||||||
if(auto id1 = arts->src.artHolder)
|
if(auto id1 = arts->src.artHolder)
|
||||||
if(!vstd::contains(ourIds, id1))
|
if(!vstd::contains(ourIds, id1))
|
||||||
@ -123,41 +90,42 @@ bool CGarrisonDialogQuery::blocksPack(const CPack * pack) const
|
|||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if(auto dismiss = dynamic_ptr_cast<DisbandCreature>(pack))
|
if(auto dismiss = dynamic_cast<const DisbandCreature*>(pack))
|
||||||
return !vstd::contains(ourIds, dismiss->id);
|
return !vstd::contains(ourIds, dismiss->id);
|
||||||
|
|
||||||
if(auto arts = dynamic_ptr_cast<BulkExchangeArtifacts>(pack))
|
if(auto arts = dynamic_cast<const BulkExchangeArtifacts*>(pack))
|
||||||
return !vstd::contains(ourIds, arts->srcHero) || !vstd::contains(ourIds, arts->dstHero);
|
return !vstd::contains(ourIds, arts->srcHero) || !vstd::contains(ourIds, arts->dstHero);
|
||||||
|
|
||||||
if(auto arts = dynamic_ptr_cast<ManageBackpackArtifacts>(pack))
|
if(auto arts = dynamic_cast<const ManageBackpackArtifacts*>(pack))
|
||||||
return !vstd::contains(ourIds, arts->artHolder);
|
return !vstd::contains(ourIds, arts->artHolder);
|
||||||
|
|
||||||
if(auto art = dynamic_ptr_cast<EraseArtifactByClient>(pack))
|
if(auto art = dynamic_cast<const EraseArtifactByClient*>(pack))
|
||||||
{
|
{
|
||||||
if(auto id = art->al.artHolder)
|
if(auto id = art->al.artHolder)
|
||||||
return !vstd::contains(ourIds, id);
|
return !vstd::contains(ourIds, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(auto dismiss = dynamic_ptr_cast<AssembleArtifacts>(pack))
|
if(auto dismiss = dynamic_cast<const AssembleArtifacts*>(pack))
|
||||||
return !vstd::contains(ourIds, dismiss->heroID);
|
return !vstd::contains(ourIds, dismiss->heroID);
|
||||||
|
|
||||||
if(auto upgrade = dynamic_ptr_cast<UpgradeCreature>(pack))
|
if(auto upgrade = dynamic_cast<const UpgradeCreature*>(pack))
|
||||||
return !vstd::contains(ourIds, upgrade->id);
|
return !vstd::contains(ourIds, upgrade->id);
|
||||||
|
|
||||||
if(auto formation = dynamic_ptr_cast<SetFormation>(pack))
|
if(auto formation = dynamic_cast<const SetFormation*>(pack))
|
||||||
return !vstd::contains(ourIds, formation->hid);
|
return !vstd::contains(ourIds, formation->hid);
|
||||||
|
|
||||||
return CDialogQuery::blocksPack(pack);
|
return CDialogQuery::blocksPack(pack);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CBlockingDialogQuery::notifyObjectAboutRemoval(const CObjectVisitQuery & objectVisit) const
|
void CBlockingDialogQuery::notifyObjectAboutRemoval(const CGObjectInstance * visitedObject, const CGHeroInstance * visitingHero) const
|
||||||
{
|
{
|
||||||
assert(answer);
|
assert(answer);
|
||||||
objectVisit.visitedObject->blockingDialogAnswered(objectVisit.visitingHero, *answer);
|
caller->blockingDialogAnswered(visitingHero, *answer);
|
||||||
}
|
}
|
||||||
|
|
||||||
CBlockingDialogQuery::CBlockingDialogQuery(CGameHandler * owner, const BlockingDialog & bd):
|
CBlockingDialogQuery::CBlockingDialogQuery(CGameHandler * owner, const IObjectInterface * caller, const BlockingDialog & bd):
|
||||||
CDialogQuery(owner)
|
CDialogQuery(owner),
|
||||||
|
caller(caller)
|
||||||
{
|
{
|
||||||
this->bd = bd;
|
this->bd = bd;
|
||||||
addPlayer(bd.player);
|
addPlayer(bd.player);
|
||||||
@ -179,56 +147,55 @@ bool OpenWindowQuery::blocksPack(const CPack *pack) const
|
|||||||
{
|
{
|
||||||
if (mode == EOpenWindowMode::RECRUITMENT_FIRST || mode == EOpenWindowMode::RECRUITMENT_ALL)
|
if (mode == EOpenWindowMode::RECRUITMENT_FIRST || mode == EOpenWindowMode::RECRUITMENT_ALL)
|
||||||
{
|
{
|
||||||
if(dynamic_ptr_cast<RecruitCreatures>(pack) != nullptr)
|
if(dynamic_cast<const RecruitCreatures*>(pack) != nullptr)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// If hero has no free slots, he might get some stacks merged automatically
|
// If hero has no free slots, he might get some stacks merged automatically
|
||||||
if(dynamic_ptr_cast<ArrangeStacks>(pack) != nullptr)
|
if(dynamic_cast<const ArrangeStacks*>(pack) != nullptr)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mode == EOpenWindowMode::TAVERN_WINDOW)
|
if (mode == EOpenWindowMode::TAVERN_WINDOW)
|
||||||
{
|
{
|
||||||
if(dynamic_ptr_cast<HireHero>(pack) != nullptr)
|
if(dynamic_cast<const HireHero*>(pack) != nullptr)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mode == EOpenWindowMode::UNIVERSITY_WINDOW)
|
if (mode == EOpenWindowMode::UNIVERSITY_WINDOW)
|
||||||
{
|
{
|
||||||
if(dynamic_ptr_cast<TradeOnMarketplace>(pack) != nullptr)
|
if(dynamic_cast<const TradeOnMarketplace*>(pack) != nullptr)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mode == EOpenWindowMode::MARKET_WINDOW)
|
if (mode == EOpenWindowMode::MARKET_WINDOW)
|
||||||
{
|
{
|
||||||
if(dynamic_ptr_cast<ExchangeArtifacts>(pack) != nullptr)
|
if(dynamic_cast<const ExchangeArtifacts*>(pack) != nullptr)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if(dynamic_ptr_cast<BulkExchangeArtifacts>(pack) != nullptr)
|
if(dynamic_cast<const BulkExchangeArtifacts*>(pack) != nullptr)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if(dynamic_ptr_cast<ManageBackpackArtifacts>(pack) != nullptr)
|
if(dynamic_cast<const ManageBackpackArtifacts*>(pack) != nullptr)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if(dynamic_ptr_cast<AssembleArtifacts>(pack))
|
if(dynamic_cast<const AssembleArtifacts*>(pack))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if(dynamic_ptr_cast<EraseArtifactByClient>(pack))
|
if(dynamic_cast<const EraseArtifactByClient*>(pack))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if(dynamic_ptr_cast<TradeOnMarketplace>(pack) != nullptr)
|
if(dynamic_cast<const TradeOnMarketplace*>(pack) != nullptr)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return CDialogQuery::blocksPack(pack);
|
return CDialogQuery::blocksPack(pack);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CTeleportDialogQuery::notifyObjectAboutRemoval(const CObjectVisitQuery & objectVisit) const
|
void CTeleportDialogQuery::notifyObjectAboutRemoval(const CGObjectInstance * visitedObject, const CGHeroInstance * visitingHero) const
|
||||||
{
|
{
|
||||||
// do not change to dynamic_ptr_cast - SIGSEGV!
|
auto obj = dynamic_cast<const CGTeleport*>(visitedObject);
|
||||||
auto obj = dynamic_cast<const CGTeleport*>(objectVisit.visitedObject);
|
|
||||||
if(obj)
|
if(obj)
|
||||||
obj->teleportDialogAnswered(objectVisit.visitingHero, *answer, td.exits);
|
obj->teleportDialogAnswered(visitingHero, *answer, td.exits);
|
||||||
else
|
else
|
||||||
logGlobal->error("Invalid instance in teleport query");
|
logGlobal->error("Invalid instance in teleport query");
|
||||||
}
|
}
|
||||||
@ -254,9 +221,9 @@ void CHeroLevelUpDialogQuery::onRemoval(PlayerColor color)
|
|||||||
gh->levelUpHero(hero, hlu.skills[*answer]);
|
gh->levelUpHero(hero, hlu.skills[*answer]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHeroLevelUpDialogQuery::notifyObjectAboutRemoval(const CObjectVisitQuery & objectVisit) const
|
void CHeroLevelUpDialogQuery::notifyObjectAboutRemoval(const CGObjectInstance * visitedObject, const CGHeroInstance * visitingHero) const
|
||||||
{
|
{
|
||||||
objectVisit.visitedObject->heroLevelUpDone(objectVisit.visitingHero);
|
visitedObject->heroLevelUpDone(visitingHero);
|
||||||
}
|
}
|
||||||
|
|
||||||
CCommanderLevelUpDialogQuery::CCommanderLevelUpDialogQuery(CGameHandler * owner, const CommanderLevelUp & Clu, const CGHeroInstance * Hero):
|
CCommanderLevelUpDialogQuery::CCommanderLevelUpDialogQuery(CGameHandler * owner, const CommanderLevelUp & Clu, const CGHeroInstance * Hero):
|
||||||
@ -273,9 +240,9 @@ void CCommanderLevelUpDialogQuery::onRemoval(PlayerColor color)
|
|||||||
gh->levelUpCommander(hero->commander, clu.skills[*answer]);
|
gh->levelUpCommander(hero->commander, clu.skills[*answer]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCommanderLevelUpDialogQuery::notifyObjectAboutRemoval(const CObjectVisitQuery & objectVisit) const
|
void CCommanderLevelUpDialogQuery::notifyObjectAboutRemoval(const CGObjectInstance * visitedObject, const CGHeroInstance * visitingHero) const
|
||||||
{
|
{
|
||||||
objectVisit.visitedObject->heroLevelUpDone(objectVisit.visitingHero);
|
visitedObject->heroLevelUpDone(visitingHero);
|
||||||
}
|
}
|
||||||
|
|
||||||
CHeroMovementQuery::CHeroMovementQuery(CGameHandler * owner, const TryMoveHero & Tmh, const CGHeroInstance * Hero, bool VisitDestAfterVictory):
|
CHeroMovementQuery::CHeroMovementQuery(CGameHandler * owner, const TryMoveHero & Tmh, const CGHeroInstance * Hero, bool VisitDestAfterVictory):
|
||||||
|
@ -15,12 +15,9 @@
|
|||||||
VCMI_LIB_NAMESPACE_BEGIN
|
VCMI_LIB_NAMESPACE_BEGIN
|
||||||
class CGHeroInstance;
|
class CGHeroInstance;
|
||||||
class CGObjectInstance;
|
class CGObjectInstance;
|
||||||
class int3;
|
class IObjectInterface;
|
||||||
VCMI_LIB_NAMESPACE_END
|
VCMI_LIB_NAMESPACE_END
|
||||||
|
|
||||||
|
|
||||||
class TurnTimerHandler;
|
|
||||||
|
|
||||||
//Created when player starts turn or when player puts game on [ause
|
//Created when player starts turn or when player puts game on [ause
|
||||||
//Removed when player accepts a turn or continur play
|
//Removed when player accepts a turn or continur play
|
||||||
class TimerPauseQuery : public CQuery
|
class TimerPauseQuery : public CQuery
|
||||||
@ -34,23 +31,6 @@ public:
|
|||||||
bool endsByPlayerAnswer() const override;
|
bool endsByPlayerAnswer() const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
//Created when hero visits object.
|
|
||||||
//Removed when query above is resolved (or immediately after visit if no queries were created)
|
|
||||||
class CObjectVisitQuery : public CQuery
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
const CGObjectInstance *visitedObject;
|
|
||||||
const CGHeroInstance *visitingHero;
|
|
||||||
int3 tile; //may be different than hero pos -> eg. visit via teleport
|
|
||||||
bool removeObjectAfterVisit;
|
|
||||||
|
|
||||||
CObjectVisitQuery(CGameHandler * owner, const CGObjectInstance *Obj, const CGHeroInstance *Hero, int3 Tile);
|
|
||||||
|
|
||||||
bool blocksPack(const CPack *pack) const override;
|
|
||||||
void onRemoval(PlayerColor color) override;
|
|
||||||
void onExposure(QueryPtr topQuery) override;
|
|
||||||
};
|
|
||||||
|
|
||||||
//Created when hero attempts move and something happens
|
//Created when hero attempts move and something happens
|
||||||
//(not necessarily position change, could be just an object interaction).
|
//(not necessarily position change, could be just an object interaction).
|
||||||
class CHeroMovementQuery : public CQuery
|
class CHeroMovementQuery : public CQuery
|
||||||
@ -73,7 +53,7 @@ public:
|
|||||||
std::array<const CArmedInstance *,2> exchangingArmies;
|
std::array<const CArmedInstance *,2> exchangingArmies;
|
||||||
|
|
||||||
CGarrisonDialogQuery(CGameHandler * owner, const CArmedInstance *up, const CArmedInstance *down);
|
CGarrisonDialogQuery(CGameHandler * owner, const CArmedInstance *up, const CArmedInstance *down);
|
||||||
void notifyObjectAboutRemoval(const CObjectVisitQuery &objectVisit) const override;
|
void notifyObjectAboutRemoval(const CGObjectInstance * visitedObject, const CGHeroInstance * visitingHero) const override;
|
||||||
bool blocksPack(const CPack *pack) const override;
|
bool blocksPack(const CPack *pack) const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -81,11 +61,12 @@ public:
|
|||||||
class CBlockingDialogQuery : public CDialogQuery
|
class CBlockingDialogQuery : public CDialogQuery
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
const IObjectInterface * caller;
|
||||||
BlockingDialog bd; //copy of pack... debug purposes
|
BlockingDialog bd; //copy of pack... debug purposes
|
||||||
|
|
||||||
CBlockingDialogQuery(CGameHandler * owner, const BlockingDialog &bd);
|
CBlockingDialogQuery(CGameHandler * owner, const IObjectInterface * caller, const BlockingDialog &bd);
|
||||||
|
|
||||||
void notifyObjectAboutRemoval(const CObjectVisitQuery &objectVisit) const override;
|
void notifyObjectAboutRemoval(const CGObjectInstance * visitedObject, const CGHeroInstance * visitingHero) const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class OpenWindowQuery : public CDialogQuery
|
class OpenWindowQuery : public CDialogQuery
|
||||||
@ -105,7 +86,7 @@ public:
|
|||||||
|
|
||||||
CTeleportDialogQuery(CGameHandler * owner, const TeleportDialog &td);
|
CTeleportDialogQuery(CGameHandler * owner, const TeleportDialog &td);
|
||||||
|
|
||||||
void notifyObjectAboutRemoval(const CObjectVisitQuery &objectVisit) const override;
|
void notifyObjectAboutRemoval(const CGObjectInstance * visitedObject, const CGHeroInstance * visitingHero) const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CHeroLevelUpDialogQuery : public CDialogQuery
|
class CHeroLevelUpDialogQuery : public CDialogQuery
|
||||||
@ -114,7 +95,7 @@ public:
|
|||||||
CHeroLevelUpDialogQuery(CGameHandler * owner, const HeroLevelUp &Hlu, const CGHeroInstance * Hero);
|
CHeroLevelUpDialogQuery(CGameHandler * owner, const HeroLevelUp &Hlu, const CGHeroInstance * Hero);
|
||||||
|
|
||||||
void onRemoval(PlayerColor color) override;
|
void onRemoval(PlayerColor color) override;
|
||||||
void notifyObjectAboutRemoval(const CObjectVisitQuery &objectVisit) const override;
|
void notifyObjectAboutRemoval(const CGObjectInstance * visitedObject, const CGHeroInstance * visitingHero) const override;
|
||||||
|
|
||||||
HeroLevelUp hlu;
|
HeroLevelUp hlu;
|
||||||
const CGHeroInstance * hero;
|
const CGHeroInstance * hero;
|
||||||
@ -126,7 +107,7 @@ public:
|
|||||||
CCommanderLevelUpDialogQuery(CGameHandler * owner, const CommanderLevelUp &Clu, const CGHeroInstance * Hero);
|
CCommanderLevelUpDialogQuery(CGameHandler * owner, const CommanderLevelUp &Clu, const CGHeroInstance * Hero);
|
||||||
|
|
||||||
void onRemoval(PlayerColor color) override;
|
void onRemoval(PlayerColor color) override;
|
||||||
void notifyObjectAboutRemoval(const CObjectVisitQuery &objectVisit) const override;
|
void notifyObjectAboutRemoval(const CGObjectInstance * visitedObject, const CGHeroInstance * visitingHero) const override;
|
||||||
|
|
||||||
CommanderLevelUp clu;
|
CommanderLevelUp clu;
|
||||||
const CGHeroInstance * hero;
|
const CGHeroInstance * hero;
|
||||||
|
66
server/queries/VisitQueries.cpp
Normal file
66
server/queries/VisitQueries.cpp
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
/*
|
||||||
|
* VisitQueries.cpp, part of VCMI engine
|
||||||
|
*
|
||||||
|
* Authors: listed in file AUTHORS in main folder
|
||||||
|
*
|
||||||
|
* License: GNU General Public License v2.0 or later
|
||||||
|
* Full text of license available in license.txt file, in main folder
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#include "StdInc.h"
|
||||||
|
#include "VisitQueries.h"
|
||||||
|
|
||||||
|
#include "../../lib/mapObjects/CGHeroInstance.h"
|
||||||
|
#include "../CGameHandler.h"
|
||||||
|
#include "QueriesProcessor.h"
|
||||||
|
|
||||||
|
VisitQuery::VisitQuery(CGameHandler * owner, const CGObjectInstance * Obj, const CGHeroInstance * Hero)
|
||||||
|
: CQuery(owner)
|
||||||
|
, visitedObject(Obj)
|
||||||
|
, visitingHero(Hero)
|
||||||
|
{
|
||||||
|
addPlayer(Hero->tempOwner);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool VisitQuery::blocksPack(const CPack * pack) const
|
||||||
|
{
|
||||||
|
//During the visit itself ALL actions are blocked.
|
||||||
|
//(However, the visit may trigger a query above that'll pass some.)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void VisitQuery::onExposure(QueryPtr topQuery)
|
||||||
|
{
|
||||||
|
//Object may have been removed and deleted.
|
||||||
|
if(gh->isValidObject(visitedObject))
|
||||||
|
topQuery->notifyObjectAboutRemoval(visitedObject, visitingHero);
|
||||||
|
|
||||||
|
owner->popIfTop(*this);
|
||||||
|
}
|
||||||
|
|
||||||
|
MapObjectVisitQuery::MapObjectVisitQuery(CGameHandler * owner, const CGObjectInstance * Obj, const CGHeroInstance * Hero)
|
||||||
|
: VisitQuery(owner, Obj, Hero)
|
||||||
|
, removeObjectAfterVisit(false)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void MapObjectVisitQuery::onRemoval(PlayerColor color)
|
||||||
|
{
|
||||||
|
gh->objectVisitEnded(visitingHero, players.front());
|
||||||
|
|
||||||
|
//TODO or should it be destructor?
|
||||||
|
//Can object visit affect 2 players and what would be desired behavior?
|
||||||
|
if(removeObjectAfterVisit)
|
||||||
|
gh->removeObject(visitedObject, color);
|
||||||
|
}
|
||||||
|
|
||||||
|
TownBuildingVisitQuery::TownBuildingVisitQuery(CGameHandler * owner, const CGObjectInstance * Obj, const CGHeroInstance * Hero, BuildingID buildingToVisit)
|
||||||
|
: VisitQuery(owner, Obj, Hero)
|
||||||
|
, visitedBuilding(buildingToVisit)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void TownBuildingVisitQuery::onRemoval(PlayerColor color)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
47
server/queries/VisitQueries.h
Normal file
47
server/queries/VisitQueries.h
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
/*
|
||||||
|
* VisitQueries.h, part of VCMI engine
|
||||||
|
*
|
||||||
|
* Authors: listed in file AUTHORS in main folder
|
||||||
|
*
|
||||||
|
* License: GNU General Public License v2.0 or later
|
||||||
|
* Full text of license available in license.txt file, in main folder
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "CQuery.h"
|
||||||
|
|
||||||
|
//Created when hero visits object.
|
||||||
|
//Removed when query above is resolved (or immediately after visit if no queries were created)
|
||||||
|
class VisitQuery : public CQuery
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
VisitQuery(CGameHandler * owner, const CGObjectInstance *Obj, const CGHeroInstance *Hero);
|
||||||
|
|
||||||
|
public:
|
||||||
|
const CGObjectInstance *visitedObject;
|
||||||
|
const CGHeroInstance *visitingHero;
|
||||||
|
|
||||||
|
bool blocksPack(const CPack *pack) const final;
|
||||||
|
void onExposure(QueryPtr topQuery) final;
|
||||||
|
};
|
||||||
|
|
||||||
|
class MapObjectVisitQuery final : public VisitQuery
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
bool removeObjectAfterVisit;
|
||||||
|
|
||||||
|
MapObjectVisitQuery(CGameHandler * owner, const CGObjectInstance *Obj, const CGHeroInstance *Hero);
|
||||||
|
|
||||||
|
void onRemoval(PlayerColor color) final;
|
||||||
|
};
|
||||||
|
|
||||||
|
class TownBuildingVisitQuery final : public VisitQuery
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
BuildingID visitedBuilding;
|
||||||
|
|
||||||
|
TownBuildingVisitQuery(CGameHandler * owner, const CGObjectInstance *Obj, const CGHeroInstance *Hero, BuildingID buildingToVisit);
|
||||||
|
|
||||||
|
void onRemoval(PlayerColor color) final;
|
||||||
|
};
|
@ -50,7 +50,7 @@ public:
|
|||||||
void giveExperience(const CGHeroInstance * hero, TExpType val) override {}
|
void giveExperience(const CGHeroInstance * hero, TExpType val) override {}
|
||||||
void changePrimSkill(const CGHeroInstance * hero, PrimarySkill which, si64 val, bool abs=false) override {}
|
void changePrimSkill(const CGHeroInstance * hero, PrimarySkill which, si64 val, bool abs=false) override {}
|
||||||
void changeSecSkill(const CGHeroInstance * hero, SecondarySkill which, int val, bool abs=false) override {}
|
void changeSecSkill(const CGHeroInstance * hero, SecondarySkill which, int val, bool abs=false) override {}
|
||||||
void showBlockingDialog(BlockingDialog *iw) override {}
|
void showBlockingDialog(const IObjectInterface * caller, BlockingDialog *iw) override {}
|
||||||
void showGarrisonDialog(ObjectInstanceID upobj, ObjectInstanceID hid, bool removableUnits) override {} //cb will be called when player closes garrison window
|
void showGarrisonDialog(ObjectInstanceID upobj, ObjectInstanceID hid, bool removableUnits) override {} //cb will be called when player closes garrison window
|
||||||
void showTeleportDialog(TeleportDialog *iw) override {}
|
void showTeleportDialog(TeleportDialog *iw) override {}
|
||||||
void showObjectWindow(const CGObjectInstance * object, EOpenWindowMode window, const CGHeroInstance * visitor, bool addQuery) override {};
|
void showObjectWindow(const CGObjectInstance * object, EOpenWindowMode window, const CGHeroInstance * visitor, bool addQuery) override {};
|
||||||
|
Loading…
Reference in New Issue
Block a user