Skip to content
Browse files

Finalizing questioning algorithm

  • Loading branch information...
1 parent d623c06 commit 170d4c54817556a0658ce6c2111a4fa40b3416a4 @fabiorodella committed
View
116 src/controller/Mystery.cpp
@@ -174,7 +174,7 @@ POI *Mystery::parsePOINode(xmlNode *node) {
return poi;
}
-void Mystery::registerEventFor(Character *target, Event event, Character *who, Character *whoElse, Room *where, POI *what) {
+void Mystery::registerEventFor(Character *target, Event event, Character *who, Character *whoElse, Room *where, POI *what, POI *whatInside) {
Memory *memory = new Memory();
memory->event = event;
@@ -182,13 +182,14 @@ void Mystery::registerEventFor(Character *target, Event event, Character *who, C
memory->whoElse = whoElse;
memory->where = where;
memory->what = what;
+ memory->whatInside = whatInside;
memory->when = time;
memory->suspicion = 1;
target->addMemory(memory);
}
-void Mystery::registerEventForAllInRoom(Event event, Character *who, Character *whoElse, Room *where, POI *what) {
+void Mystery::registerEventForAllInRoom(Event event, Character *who, Character *whoElse, Room *where, POI *what, POI *whatInside) {
std::vector<Character *>::iterator it;
for (it = characters.begin(); it < characters.end(); ++it) {
@@ -197,7 +198,7 @@ void Mystery::registerEventForAllInRoom(Event event, Character *who, Character *
if (character->currentRoom == where) {
- registerEventFor(character, event, who, whoElse, where, what);
+ registerEventFor(character, event, who, whoElse, where, what, whatInside);
}
}
}
@@ -271,16 +272,16 @@ Mystery::Mystery(const char *file, unsigned int seed, short *collisionData, int
room = rooms[idx];
std::vector<POI *> containers = room->getPointsOfInterest(InterestContainerVisible, false);
- std::vector<POI *> containers2 = room->getPointsOfInterest(InterestContainerConceiled, false);
- containers.insert(containers.end(), containers2.begin(), containers2.end());
-
-
- idx = rand() % containers.size();
-
- container = containers[idx];
+ if (containers.size() > 0) {
+
+ idx = rand() % containers.size();
+ container = containers[idx];
+ } else {
+ container = NULL;
+ }
- } while (container->contents != NULL);
+ } while (container == NULL || container->contents != NULL);
container->contents = weapon;
@@ -484,12 +485,27 @@ void Mystery::step() {
// if he/she already killed the target, he/she goes to a container
// to grab/hide the weapon
- interest = rand() % 2 == 0 ? InterestContainerVisible : InterestContainerConceiled;
+ if (character->carryingWeapon != NULL) {
+ interest = InterestContainerConceiled;
+ } else {
+ interest = InterestContainerVisible;
+ }
- // If he has not weapon, searches only the containers not
+ // If he has no weapon, searches only the containers not
// searched yet
notSearchedOnly = character->carryingWeapon == NULL;
+
+ } else {
+
+ // There's a chance the character wants to see a container
+ int chance = rand() % 100;
+
+ if (chance < 25) {
+ interest = InterestContainerVisible;
+ } else if (chance < 50) {
+ interest = InterestContainerConceiled;
+ }
}
do {
@@ -628,23 +644,57 @@ void Mystery::step() {
if (character->currentRoom != NULL) {
printf("%s left %s\n", character->name.c_str(), character->currentRoom->name.c_str());
- registerEventForAllInRoom(EventLeftRoom, character, NULL, character->currentRoom, NULL);
+ registerEventForAllInRoom(EventLeftRoom, character, NULL, character->currentRoom, NULL, NULL);
}
character->currentRoom = currentRoom;
if (character->currentRoom != NULL) {
printf("%s entered %s\n", character->name.c_str(), character->currentRoom->name.c_str());
- registerEventForAllInRoom(EventEnteredRoom, character, NULL, character->currentRoom, NULL);
+ registerEventForAllInRoom(EventEnteredRoom, character, NULL, character->currentRoom, NULL, NULL);
- // Register visible weapons the character saw in the room
+ if (character != murderer) {
+ // Register any weapons saw before but missing
+ std::vector<Memory *>::iterator it;
+ std::vector<Memory *> memories = character->getMemories();
+ std::vector<Memory *> considered;
+
+ for (it = memories.begin(); it < memories.end(); ++it) {
+
+ Memory *memory = (Memory *) *it;
+
+ if (memory->event == EventSawWeapon && memory->where == character->currentRoom && memory->when < time && !pointEqualsIntegral(memory->whatInside->position, memory->what->visualPosition)) {
+
+ std::vector<Memory *>::iterator itOther;
+
+ bool found = false;
+
+ for (itOther = considered.begin(); itOther < considered.end(); ++itOther) {
+
+ Memory *other = (Memory *) *itOther;
+
+ if (other->where == memory->where && other->whatInside == memory->whatInside) {
+ found = true;
+ break;
+ }
+ }
+
+ if (!found) {
+ registerEventFor(character, EventWeaponMissing, NULL, NULL, character->currentRoom, memory->what, memory->whatInside);
+ considered.push_back(memory);
+ }
+ }
+ }
+ }
+
+ // Register visible weapons the character sees in the room
std::vector<POI *>::iterator itPOI;
for (itPOI = character->currentRoom->pointsOfInterest.begin(); itPOI < character->currentRoom->pointsOfInterest.end(); ++itPOI) {
POI *poi = (POI *) *itPOI;
if (poi->interest == InterestContainerVisible && poi->contents != NULL && poi->contents->isWeapon()) {
- registerEventFor(character, EventSawWeapon, NULL, NULL, character->currentRoom, poi);
+ registerEventFor(character, EventSawWeapon, NULL, NULL, character->currentRoom, poi, poi->contents);
}
}
@@ -652,17 +702,19 @@ void Mystery::step() {
for (itOthers = characters.begin(); itOthers < characters.end(); ++itOthers) {
Character *other = (Character *) *itOthers;
- if (other != character) {
+ if (other != character && other->currentRoom == character->currentRoom) {
+
+ registerEventFor(character, EventWasInRoom, other, NULL, character->currentRoom, NULL, NULL);
// Register others having conversations
if (other->isHavingConversation()) {
Character *another = other->getCurrentStep()->conversationWith;
- registerEventFor(character, EventStartConversation, other, another, character->currentRoom, NULL);
+ registerEventFor(character, EventWasHavingConversation, other, another, character->currentRoom, NULL, NULL);
}
// Register others interacting with POIs
if (other->isInteractingWithPOI()) {
- registerEventFor(character, EventStartInteractPOI, other, NULL, character->currentRoom, other->currentTarget);
+ registerEventFor(character, EventWasInteractingPOI, other, NULL, character->currentRoom, other->currentTarget, NULL);
}
}
}
@@ -675,15 +727,15 @@ void Mystery::step() {
switch (character->getCurrentStep()->type) {
case StepTypeStartInteractPOI:
- registerEventForAllInRoom(EventStartInteractPOI, character, NULL, character->currentRoom, character->currentTarget);
+ registerEventForAllInRoom(EventStartInteractPOI, character, NULL, character->currentRoom, character->currentTarget, NULL);
break;
case StepTypeEndInteractPOI:
another = character->getCurrentStep()->conversationWith;
- registerEventForAllInRoom(EventEndInteractPOI, character, another, character->currentRoom, character->currentTarget);
+ registerEventForAllInRoom(EventEndInteractPOI, character, another, character->currentRoom, character->currentTarget, NULL);
break;
case StepTypeEndConversation:
another = character->getCurrentStep()->conversationWith;
- registerEventForAllInRoom(EventEndConversation, character, another, character->currentRoom, character->currentTarget);
+ registerEventForAllInRoom(EventEndConversation, character, another, character->currentRoom, NULL, NULL);
break;
default:
break;
@@ -716,6 +768,11 @@ void Mystery::step() {
corpseFoundTime = time;
corpseFoundRoom = character->currentRoom;
character->clearPath();
+
+ std::vector<Character *>::iterator itAll;
+ for (itAll = characters.begin(); itAll < characters.end(); ++itAll) {
+ registerEventFor(*itAll, EventFoundBody, character, NULL, corpseFoundRoom, NULL, NULL);
+ }
}
// Looks for:
@@ -771,8 +828,8 @@ void Mystery::step() {
character->conversationInterval = CONVERSATION_INTERVAL;
other->conversationInterval = CONVERSATION_INTERVAL;
- registerEventForAllInRoom(EventStartConversation, character, other, character->currentRoom, NULL);
- registerEventForAllInRoom(EventStartConversation, other, character, character->currentRoom, NULL);
+ registerEventForAllInRoom(EventStartConversation, character, other, character->currentRoom, NULL, NULL);
+ registerEventForAllInRoom(EventStartConversation, other, character, character->currentRoom, NULL, NULL);
printf("%s and %s are having a conversation\n", character->name.c_str(), other->name.c_str());
@@ -809,6 +866,7 @@ void Mystery::step() {
aloneInRoom) {
character->carryingWeapon = character->currentTarget->contents;
+ character->carryingWeapon->position = pointMake(-20, -20);
character->currentTarget->contents = NULL;
printf("*** %s got a %s! ***\n", character->name.c_str(), character->carryingWeapon->description.c_str());
@@ -832,6 +890,14 @@ void Mystery::step() {
crimeWeapon = character->carryingWeapon;
character->clearPath();
+
+ // Murderer will lie
+
+ int idx = rand() % character->currentRoom->pointsOfInterest.size();
+ POI *poi = character->currentRoom->pointsOfInterest[idx];
+
+ registerEventFor(character, EventStartInteractPOI, character, NULL, character->currentRoom, poi, NULL);
+ registerEventFor(character, EventEndInteractPOI, character, NULL, character->currentRoom, poi, NULL);
}
// Hides the weapon if:
View
4 src/controller/Mystery.h
@@ -38,8 +38,8 @@ class Mystery {
POI *parsePOINode(xmlNode *node);
Character *parseCharacterNode(xmlNode *node);
- void registerEventFor(Character *target, Event event, Character *who, Character *whoElse, Room *where, POI *what);
- void registerEventForAllInRoom(Event event, Character *who, Character *whoElse, Room *where, POI *what);
+ void registerEventFor(Character *target, Event event, Character *who, Character *whoElse, Room *where, POI *what, POI *whatInside);
+ void registerEventForAllInRoom(Event event, Character *who, Character *whoElse, Room *where, POI *what, POI *whatInside);
public:
View
280 src/model/Character.cpp
@@ -37,50 +37,31 @@ std::string Character::getMemory(std::vector<Memory *>::iterator &it, std::vecto
if (memory->who != NULL && memory->who == this) {
pronoum = "I";
- } else if (filter.who == NULL) {
+ } else if (memory->who != NULL && filter.who == NULL) {
pronoum = memory->who->name;
- } else if (memory->who->male) {
+ } else if (memory->who != NULL && memory->who->male) {
pronoum = "He";
- } else {
+ } else if (memory->who != NULL) {
pronoum = "She";
}
if (memory->event == EventEnteredRoom) {
- std::vector<Memory *>::iterator endIt = findEndMemory(it, interval);
+ ret.append(pronoum);
+ ret.append(" entered the ");
+ ret.append(memory->where->name);
+ ret.append(" around ");
+ ret.append(timeToString(memory->when + START_TIME, false));
+ ret.append(".");
+
+ } else if (memory->event == EventWasInRoom) {
- if (endIt != interval.end()) {
-
- Memory *endMemory = (Memory *) *endIt;
-
- ret.append(pronoum);
- ret.append(" was in the ");
- ret.append(memory->where->name);
- ret.append(" from around ");
- ret.append(timeToString(memory->when + START_TIME, false));
- ret.append(" to ");
- ret.append(timeToString(endMemory->when + START_TIME, false));
- ret.append(". ");
-
- ++it;
-
- while (it < endIt) {
- Memory *other = (Memory *) *it;
- if (other->where == memory->where) {
- ret.append(getMemory(it, interval, filter));
- }
- ++it;
- }
-
- } else {
-
- ret.append(pronoum);
- ret.append(" entered the ");
- ret.append(memory->where->name);
- ret.append(" around ");
- ret.append(timeToString(memory->when + START_TIME, false));
- ret.append(".");
- }
+ ret.append(pronoum);
+ ret.append(" was there when I entered the ");
+ ret.append(memory->where->name);
+ ret.append(" around ");
+ ret.append(timeToString(memory->when + START_TIME, false));
+ ret.append(".");
} else if (memory->event == EventLeftRoom) {
@@ -93,34 +74,25 @@ std::string Character::getMemory(std::vector<Memory *>::iterator &it, std::vecto
} else if (memory->event == EventStartInteractPOI) {
- std::vector<Memory *>::iterator endIt = findEndMemory(it, interval);
+ ret.append(pronoum);
+ ret.append(" started looking at the ");
+ ret.append(memory->what->description);
+ ret.append(" in the ");
+ ret.append(memory->where->name);
+ ret.append(" around ");
+ ret.append(timeToString(memory->when + START_TIME, false));
+ ret.append(". ");
+
+ } else if (memory->event == EventWasInteractingPOI) {
- if (endIt != interval.end()) {
-
- Memory *endMemory = (Memory *) *endIt;
-
- ret.append(pronoum);
- ret.append(" looked at the ");
- ret.append(memory->what->description);
- ret.append(" from around ");
- ret.append(timeToString(memory->when + START_TIME, false));
- ret.append(" to ");
- ret.append(timeToString(endMemory->when + START_TIME, false));
- ret.append(". ");
-
- it = endIt;
-
- } else {
-
- ret.append(pronoum);
- ret.append(" started looking at the ");
- ret.append(memory->what->description);
- ret.append(" in the ");
- ret.append(memory->where->name);
- ret.append(" around ");
- ret.append(timeToString(memory->when + START_TIME, false));
- ret.append(". ");
- }
+ ret.append(pronoum);
+ ret.append(" was looking at the ");
+ ret.append(memory->what->description);
+ ret.append(" when I entered the ");
+ ret.append(memory->where->name);
+ ret.append(" around ");
+ ret.append(timeToString(memory->when + START_TIME, false));
+ ret.append(". ");
} else if (memory->event == EventEndInteractPOI) {
@@ -135,37 +107,30 @@ std::string Character::getMemory(std::vector<Memory *>::iterator &it, std::vecto
} else if (memory->event == EventStartConversation) {
- std::vector<Memory *>::iterator endIt = findEndMemory(it, interval);
-
std::string otherName = memory->whoElse->name;
if (memory->whoElse == this) {
otherName = "me";
}
- if (endIt != interval.end()) {
-
- Memory *endMemory = (Memory *) *endIt;
-
- ret.append(pronoum);
- ret.append(" was talking to ");
- ret.append(otherName);
- ret.append(" from around ");
- ret.append(timeToString(memory->when + START_TIME, false));
- ret.append(" to ");
- ret.append(timeToString(endMemory->when + START_TIME, false));
- ret.append(". ");
-
- it = endIt;
-
- } else {
-
- ret.append(pronoum);
- ret.append(" started talking to ");
- ret.append(otherName);
- ret.append(" around ");
- ret.append(timeToString(memory->when + START_TIME, false));
- ret.append(". ");
- }
+ ret.append(pronoum);
+ ret.append(" started talking to ");
+ ret.append(otherName);
+ ret.append(" in the ");
+ ret.append(memory->where->name);
+ ret.append(" around ");
+ ret.append(timeToString(memory->when + START_TIME, false));
+ ret.append(". ");
+
+ } else if (memory->event == EventWasHavingConversation) {
+
+ ret.append(pronoum);
+ ret.append(" was talking to ");
+ ret.append(memory->whoElse->name);
+ ret.append(" when I entered the ");
+ ret.append(memory->where->name);
+ ret.append(" around ");
+ ret.append(timeToString(memory->when + START_TIME, false));
+ ret.append(". ");
} else if (memory->event == EventEndConversation) {
@@ -177,9 +142,55 @@ std::string Character::getMemory(std::vector<Memory *>::iterator &it, std::vecto
ret.append(pronoum);
ret.append(" finished talking to ");
ret.append(otherName);
+ ret.append(" in the ");
+ ret.append(memory->where->name);
+ ret.append(" around ");
+ ret.append(timeToString(memory->when + START_TIME, false));
+ ret.append(". ");
+
+ } else if (memory->event == EventSawWeapon) {
+
+ ret.append("I saw a ");
+ ret.append(memory->whatInside->description);
+ ret.append(" on the ");
+ ret.append(memory->what->description);
+ ret.append(" in the ");
+ ret.append(memory->where->name);
ret.append(" around ");
ret.append(timeToString(memory->when + START_TIME, false));
ret.append(". ");
+
+ } else if (memory->event == EventWeaponMissing) {
+
+ ret.append("I saw a ");
+ ret.append(memory->whatInside->description);
+ ret.append(" on the ");
+ ret.append(memory->what->description);
+ ret.append(" in the ");
+ ret.append(memory->where->name);
+ ret.append(" before, but it wasn't there around ");
+ ret.append(timeToString(memory->when + START_TIME, false));
+ ret.append(". ");
+
+ } else if (memory->event == EventFoundBody) {
+
+ if (memory->who == this) {
+
+ ret.append("I found a dead body in the ");
+ ret.append(memory->where->name);
+ ret.append(" around ");
+ ret.append(timeToString(memory->when + START_TIME, false));
+ ret.append(". ");
+
+ } else {
+
+ ret.append("I heard ");
+ ret.append(memory->who->name);
+ ret.append(" screaming from the ");
+ ret.append(memory->where->name);
+ ret.append(" about finding a dead body. ");
+
+ }
}
return ret;
@@ -200,11 +211,15 @@ std::vector<Memory *>::iterator Character::findEndMemory(std::vector<Memory *>::
}
++startIt;
-
+
while (startIt < interval.end()) {
Memory *cur = (Memory *) *startIt;
+ if (cur->where != first->where) {
+ return interval.end();
+ }
+
if (cur->event == endEvent && cur->what == first->what && cur->where == first->where && cur->who == first->who) {
break;
@@ -299,7 +314,11 @@ bool Character::isInteractingWithPOI() {
return false;
}
-std::vector<std::string> Character::getMemories(MemoryFilter filter) {
+std::vector<Memory *> Character::getMemories() {
+ return memories;
+}
+
+std::vector<std::string> Character::getFormattedMemories(MemoryFilter filter) {
std::vector<Memory *> interval;
std::vector<Memory *>::iterator it;
@@ -316,17 +335,94 @@ std::vector<std::string> Character::getMemories(MemoryFilter filter) {
if (memory->who == filter.who) {
shouldAdd = true;
+
+ if (filter.strange) {
+
+ if ((memory->what != NULL && memory->what->isContainer()) || memory->event == EventSawWeapon || memory->event == EventWeaponMissing || memory->event == EventFoundBody) {
+ shouldAdd = false;
+ }
+
+ }
}
}
if (filter.who == NULL) {
- if (memory->where == filter.where && (memory->event == EventEnteredRoom || memory->event == EventLeftRoom)) {
+
+ if (!filter.strange && memory->where == filter.where && (memory->event == EventEnteredRoom || memory->event == EventLeftRoom)) {
shouldAdd = true;
+
+ } else if (filter.strange) {
+
+ if ((memory->what != NULL && memory->what->isContainer()) || memory->event == EventSawWeapon || memory->event == EventWeaponMissing || memory->event == EventFoundBody) {
+ shouldAdd = true;
+ }
}
}
if (shouldAdd) {
interval.push_back(memory);
+
+ std::string log;
+ log.append(timeToString(memory->when, true));
+ log.append(" ");
+
+ switch (memory->event) {
+ case EventEnteredRoom:
+ log.append("EventEnteredRoom ");
+ break;
+ case EventWasInRoom:
+ log.append("EventWasInRoom ");
+ break;
+ case EventLeftRoom:
+ log.append("EventLeftRoom ");
+ break;
+ case EventStartInteractPOI:
+ log.append("EventStartInteractPOI ");
+ break;
+ case EventWasInteractingPOI:
+ log.append("EventWasInteractingPOI ");
+ break;
+ case EventEndInteractPOI:
+ log.append("EventEndInteractPOI ");
+ break;
+ case EventStartConversation:
+ log.append("EventStartConversation ");
+ break;
+ case EventWasHavingConversation:
+ log.append("EventWasHavingConversation ");
+ break;
+ case EventEndConversation:
+ log.append("EventEndConversation ");
+ break;
+ case EventSawWeapon:
+ log.append("EventSawWeapon ");
+ break;
+ case EventWeaponMissing:
+ log.append("EventWeaponMissing ");
+ break;
+ case EventFoundBody:
+ log.append("EventFoundBody ");
+ break;
+ default:
+ break;
+ }
+
+ log.append("\nWho: ");
+ log.append(memory->who != NULL ? memory->who->name : "NULL");
+
+ log.append("\nWho else: ");
+ log.append(memory->whoElse != NULL ? memory->whoElse->name : "NULL");
+
+ log.append("\nWhere: ");
+ log.append(memory->where != NULL ? memory->where->name : "NULL");
+
+ log.append("\nWhat: ");
+ log.append(memory->what != NULL ? memory->what->description : "NULL");
+
+ log.append("\nWhat inside: ");
+ log.append(memory->whatInside != NULL ? memory->whatInside->description : "NULL");
+
+ printf("%s\n\n", log.c_str());
}
}
}
View
5 src/model/Character.h
@@ -112,7 +112,10 @@ class Character {
bool isInteractingWithPOI();
- std::vector<std::string> getMemories(MemoryFilter filter);
+ std::vector<Memory *> getMemories();
+
+ std::vector<std::string> getFormattedMemories(MemoryFilter filter);
+
};
#endif
View
9 src/model/Memory.h
@@ -29,12 +29,17 @@ class POI;
typedef enum tEvent {
EventEnteredRoom,
+ EventWasInRoom,
EventLeftRoom,
EventStartInteractPOI,
+ EventWasInteractingPOI,
EventEndInteractPOI,
EventSawWeapon,
+ EventWeaponMissing,
EventStartConversation,
+ EventWasHavingConversation,
EventEndConversation,
+ EventFoundBody,
EventAll
} Event;
@@ -47,6 +52,8 @@ struct MemoryFilter {
Character *who;
Room *where;
+
+ bool strange;
};
class Memory {
@@ -67,6 +74,8 @@ class Memory {
POI *what;
+ POI *whatInside;
+
int suspicion;
};
View
4 src/model/POI.cpp
@@ -27,6 +27,10 @@ POI::~POI() {
delete contents;
}
+bool POI::isContainer() {
+ return interest == InterestContainerVisible || interest == InterestContainerConceiled;
+}
+
bool POI::isWeapon() {
return interest == InterestWeaponCutting || interest == InterestWeaponStrangling || interest == InterestWeaponBlunt;
}
View
2 src/model/POI.h
@@ -60,6 +60,8 @@ class POI {
~POI();
+ bool isContainer();
+
bool isWeapon();
};
View
38 src/view/InvestigationScene.cpp
@@ -650,6 +650,8 @@ void InvestigationScene::onButtonClicked(Button *sender) {
} else if (sender->getTag() > 100 && sender->getTag() < 200) {
+ currentFilter.strange = false;
+
switch (sender->getTag()) {
case 101:
questionWho();
@@ -658,6 +660,10 @@ void InvestigationScene::onButtonClicked(Button *sender) {
questionWhere();
break;
case 103:
+ currentFilter.strange = true;
+ questionWhen();
+ break;
+ case 104:
questionEnd();
confirmSuspect();
break;
@@ -828,22 +834,32 @@ void InvestigationScene::questionStart() {
button = new Button("Where was...", font, BTN_TXT_COLOR, "res/btn_action.png", "res/btn_action_pressed.png");
button->setZOrder(504);
button->setAnchorPoint(pointMake(0.5, 0.5));
- button->setPosition(pointMake(400, 300));
+ button->setPosition(pointMake(400, 260));
button->setTag(102);
button->setHandler(this);
addToDisplayList(button);
questionElements.push_back(button);
- button = new Button("You are the murderer!", font, BTN_TXT_COLOR, "res/btn_action.png", "res/btn_action_pressed.png");
+ button = new Button("Anything strange...", font, BTN_TXT_COLOR, "res/btn_action.png", "res/btn_action_pressed.png");
button->setZOrder(504);
button->setAnchorPoint(pointMake(0.5, 0.5));
- button->setPosition(pointMake(400, 400));
+ button->setPosition(pointMake(400, 320));
button->setTag(103);
button->setHandler(this);
addToDisplayList(button);
questionElements.push_back(button);
+
+ button = new Button("You are the murderer!", font, BTN_TXT_COLOR, "res/btn_action.png", "res/btn_action_pressed.png");
+ button->setZOrder(504);
+ button->setAnchorPoint(pointMake(0.5, 0.5));
+ button->setPosition(pointMake(400, 380));
+ button->setTag(104);
+ button->setHandler(this);
+
+ addToDisplayList(button);
+ questionElements.push_back(button);
}
void InvestigationScene::questionWho() {
@@ -932,7 +948,11 @@ void InvestigationScene::questionWhen() {
std::string question;
- if (currentFilter.where == NULL) {
+ if (currentFilter.strange) {
+
+ question = "Did anything strange happen";
+
+ } else if (currentFilter.where == NULL) {
question = "Where ";
@@ -1006,7 +1026,7 @@ void InvestigationScene::dialogueStart() {
speechLines.clear();
- std::vector<std::string> memories = activeCharacter->getMemories(currentFilter);
+ std::vector<std::string> memories = activeCharacter->getFormattedMemories(currentFilter);
if (memories.size() > 0) {
@@ -1015,7 +1035,13 @@ void InvestigationScene::dialogueStart() {
} else {
if (currentFilter.who == NULL) {
- speechLines.push_back(std::string("I don't remember seeing anyone there around that time."));
+
+ if (currentFilter.strange) {
+ speechLines.push_back(std::string("I don't remember anything strange happening there around that time."));
+ } else {
+ speechLines.push_back(std::string("I don't remember seeing anyone there around that time."));
+ }
+
} else if (currentFilter.where == NULL) {
std::string res = "I don't remember seeing ";

0 comments on commit 170d4c5

Please sign in to comment.
Something went wrong with that request. Please try again.