1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Support hota quest gates

This commit is contained in:
nordsoft
2023-10-11 23:15:24 +02:00
parent 7ccd4cdcb2
commit 14b030d2eb
2 changed files with 17 additions and 1 deletions

View File

@@ -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