mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-26 03:52:01 +02:00
Fixed #1378.
This commit is contained in:
parent
4ec9faa789
commit
b1a569910b
@ -4400,10 +4400,10 @@ void CQuest::getVisitText (MetaString &iwText, std::vector<Component> &component
|
|||||||
switch (missionType)
|
switch (missionType)
|
||||||
{
|
{
|
||||||
case MISSION_LEVEL:
|
case MISSION_LEVEL:
|
||||||
components.push_back(Component (Component::EXPERIENCE, 1, m13489val, 0));
|
components.push_back(Component (Component::EXPERIENCE, 1, m13489val, 0));
|
||||||
if (!isCustom)
|
if (!isCustom)
|
||||||
iwText.addReplacement(m13489val);
|
iwText.addReplacement(m13489val);
|
||||||
break;
|
break;
|
||||||
case MISSION_PRIMARY_STAT:
|
case MISSION_PRIMARY_STAT:
|
||||||
{
|
{
|
||||||
MetaString loot;
|
MetaString loot;
|
||||||
@ -4666,10 +4666,16 @@ void CGSeerHut::setObjToKill()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGSeerHut::initObj()
|
void CGSeerHut::init()
|
||||||
{
|
{
|
||||||
seerName = VLC->generaltexth->seerNames[ran()%VLC->generaltexth->seerNames.size()];
|
seerName = VLC->generaltexth->seerNames[ran()%VLC->generaltexth->seerNames.size()];
|
||||||
quest->textOption = ran()%3;
|
quest->textOption = ran() % 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CGSeerHut::initObj()
|
||||||
|
{
|
||||||
|
init();
|
||||||
|
|
||||||
quest->progress = CQuest::NOT_ACTIVE;
|
quest->progress = CQuest::NOT_ACTIVE;
|
||||||
if (quest->missionType)
|
if (quest->missionType)
|
||||||
{
|
{
|
||||||
@ -4986,22 +4992,10 @@ void CGSeerHut::blockingDialogAnswered(const CGHeroInstance *hero, ui32 answer)
|
|||||||
finishQuest(hero, answer);
|
finishQuest(hero, answer);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGQuestGuard::initObj()
|
void CGQuestGuard::init()
|
||||||
{
|
{
|
||||||
blockVisit = true;
|
blockVisit = true;
|
||||||
quest->progress = CQuest::NOT_ACTIVE;
|
quest->textOption = (ran() % 3) + 3; //3-5
|
||||||
quest->textOption = ran()%3 + 3; //3-5
|
|
||||||
if (quest->missionType)
|
|
||||||
{
|
|
||||||
if (!quest->isCustomFirst)
|
|
||||||
quest->firstVisitText = VLC->generaltexth->quests[quest->missionType-1][0][quest->textOption];
|
|
||||||
if (!quest->isCustomNext)
|
|
||||||
quest->nextVisitText = VLC->generaltexth->quests[quest->missionType-1][1][quest->textOption];
|
|
||||||
if (!quest->isCustomComplete)
|
|
||||||
quest->completedText = VLC->generaltexth->quests[quest->missionType-1][2][quest->textOption];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
quest->firstVisitText = VLC->generaltexth->seerEmpty[quest->textOption];
|
|
||||||
}
|
}
|
||||||
void CGQuestGuard::completeQuest(const CGHeroInstance *h) const
|
void CGQuestGuard::completeQuest(const CGHeroInstance *h) const
|
||||||
{
|
{
|
||||||
|
@ -837,6 +837,7 @@ public:
|
|||||||
void onHeroVisit(const CGHeroInstance * h) const override;
|
void onHeroVisit(const CGHeroInstance * h) const override;
|
||||||
void blockingDialogAnswered(const CGHeroInstance *hero, ui32 answer) const override;
|
void blockingDialogAnswered(const CGHeroInstance *hero, ui32 answer) const override;
|
||||||
|
|
||||||
|
virtual void init();
|
||||||
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
|
||||||
const CGHeroInstance *getHeroToKill(bool allowNull = false) const;
|
const CGHeroInstance *getHeroToKill(bool allowNull = false) const;
|
||||||
@ -844,7 +845,7 @@ public:
|
|||||||
void getRolloverText (MetaString &text, bool onHover) const;
|
void getRolloverText (MetaString &text, bool onHover) const;
|
||||||
void getCompletionText(MetaString &text, std::vector<Component> &components, bool isCustom, const CGHeroInstance * h = nullptr) const;
|
void getCompletionText(MetaString &text, std::vector<Component> &components, bool isCustom, const CGHeroInstance * h = nullptr) const;
|
||||||
void finishQuest (const CGHeroInstance * h, ui32 accept) const; //common for both objects
|
void finishQuest (const CGHeroInstance * h, ui32 accept) const; //common for both objects
|
||||||
void completeQuest (const CGHeroInstance * h) const;
|
virtual 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)
|
||||||
{
|
{
|
||||||
@ -859,8 +860,8 @@ class DLL_LINKAGE CGQuestGuard : public CGSeerHut
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CGQuestGuard() : CGSeerHut(){};
|
CGQuestGuard() : CGSeerHut(){};
|
||||||
void initObj() override;
|
void init() override;
|
||||||
void completeQuest (const CGHeroInstance * h) const;
|
void completeQuest (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)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user