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); auto questInfo = QuestInfo(questObj->quest, destination.nodeObject, destination.coord);
QuestAction questAction(questInfo); 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; return false;
} }

View File

@ -431,6 +431,7 @@ void CGSeerHut::initObj(CRandomGenerator & rand)
quest->progress = CQuest::NOT_ACTIVE; quest->progress = CQuest::NOT_ACTIVE;
setObjToKill();
quest->defineQuestName(); quest->defineQuestName();
if(quest->empty() && quest->killTarget == -1) if(quest->empty() && quest->killTarget == -1)

View File

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