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.push_back({});
|
||||||
configuration.info.back().visitType = Rewardable::EEventType::EVENT_FIRST_VISIT;
|
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;
|
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)
|
void CGQuestGuard::serializeJsonOptions(JsonSerializeFormat & handler)
|
||||||
{
|
{
|
||||||
//quest only, do not call base class
|
//quest only, do not call base class
|
||||||
|
@@ -151,6 +151,9 @@ class DLL_LINKAGE CGQuestGuard : public CGSeerHut
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void init(CRandomGenerator & rand) override;
|
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)
|
template <typename Handler> void serialize(Handler &h, const int version)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user