1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Quests mostly work

This commit is contained in:
nordsoft 2023-10-10 01:53:25 +02:00
parent d2d64dbddd
commit 5eeda3cd25
3 changed files with 6 additions and 2 deletions

View File

@ -130,7 +130,7 @@ namespace AIPathfinding
auto questInfo = QuestInfo(questObj->quest, destination.nodeObject, destination.coord);
QuestAction questAction(questInfo);
if(destination.nodeObject->ID == Obj::QUEST_GUARD && questObj->quest->questName == CQuest::missionName(0))
if(destination.nodeObject->ID == Obj::QUEST_GUARD && questObj->quest->empty() && questObj->quest->killTarget == -1)
{
return false;
}

View File

@ -431,6 +431,7 @@ void CGSeerHut::initObj(CRandomGenerator & rand)
quest->progress = CQuest::NOT_ACTIVE;
setObjToKill();
quest->defineQuestName();
if(quest->empty() && quest->killTarget == -1)
@ -447,7 +448,7 @@ void CGSeerHut::initObj(CRandomGenerator & rand)
if(!quest->isCustomNext)
quest->nextVisitText.appendTextID(TextIdentifier("core", "seerhut", "quest", quest->questName, quest->missionState(1), quest->textOption).get());
if(!quest->isCustomComplete)
quest->completedText.appendTextID(TextIdentifier("core", "seerhut", "quest", quest->questName, quest->missionState(2), quest->textOption).get());
quest->completedText.appendTextID(TextIdentifier("core", "seerhut", "quest", quest-> questName, quest->missionState(2), quest->textOption).get());
}
}

View File

@ -402,6 +402,7 @@ void Inspector::updateProperties(CGSeerHut * o)
addProperty("Next visit text", o->quest->nextVisitText, new MessageDelegate, false);
addProperty("Completed text", o->quest->completedText, new MessageDelegate, false);
addProperty("Repeat quest", o->quest->repeatedQuest, false);
addProperty("Time limit", o->quest->lastDay, false);
{ //Quest
auto * delegate = new QuestDelegate(controller, *o->quest);
@ -676,6 +677,8 @@ void Inspector::setProperty(CGSeerHut * o, const QString & key, const QVariant &
TextIdentifier("quest", o->instanceName, "completed"), value.toString().toStdString()));
if(key == "Repeat quest")
o->quest->repeatedQuest = value.toBool();
if(key == "Time limit")
o->quest->lastDay = value.toString().toInt();
}