mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-13 19:54:17 +02:00
Support hota quest gates
This commit is contained in:
@@ -710,10 +710,23 @@ void CGQuestGuard::init(CRandomGenerator & rand)
|
||||
|
||||
configuration.info.push_back({});
|
||||
configuration.info.back().visitType = Rewardable::EEventType::EVENT_FIRST_VISIT;
|
||||
configuration.info.back().reward.removeObject = true;
|
||||
configuration.info.back().reward.removeObject = subID == 0 ? true : false;
|
||||
configuration.canRefuse = true;
|
||||
}
|
||||
|
||||
void CGQuestGuard::onHeroVisit(const CGHeroInstance * h) const
|
||||
{
|
||||
if(!quest->isCompleted)
|
||||
CGSeerHut::onHeroVisit(h);
|
||||
else
|
||||
cb->setObjProperty(id, CGSeerHut::SEERHUT_COMPLETE, false);
|
||||
}
|
||||
|
||||
bool CGQuestGuard::passableFor(PlayerColor color) const
|
||||
{
|
||||
return quest->isCompleted;
|
||||
}
|
||||
|
||||
void CGQuestGuard::serializeJsonOptions(JsonSerializeFormat & handler)
|
||||
{
|
||||
//quest only, do not call base class
|
||||
|
@@ -152,6 +152,9 @@ class DLL_LINKAGE CGQuestGuard : public CGSeerHut
|
||||
public:
|
||||
void init(CRandomGenerator & rand) override;
|
||||
|
||||
void onHeroVisit(const CGHeroInstance * h) const override;
|
||||
bool passableFor(PlayerColor color) const override;
|
||||
|
||||
template <typename Handler> void serialize(Handler &h, const int version)
|
||||
{
|
||||
h & static_cast<CGSeerHut&>(*this);
|
||||
|
Reference in New Issue
Block a user