aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/lure/hotspots.cpp38
-rw-r--r--engines/lure/hotspots.h6
-rw-r--r--engines/lure/res.cpp3
-rw-r--r--engines/lure/room.cpp4
-rw-r--r--engines/lure/scripts.cpp4
5 files changed, 31 insertions, 24 deletions
diff --git a/engines/lure/hotspots.cpp b/engines/lure/hotspots.cpp
index 1c82853e9b..7c085997da 100644
--- a/engines/lure/hotspots.cpp
+++ b/engines/lure/hotspots.cpp
@@ -736,7 +736,8 @@ void Hotspot::resetPosition() {
setDirection(direction());
}
-void Hotspot::converse(uint16 destCharacterId, uint16 messageId, bool standStill) {
+void Hotspot::converse(uint16 destCharacterId, uint16 messageId, bool srcStandStill,
+ bool destStandStill) {
assert(_data);
_data->talkDestCharacterId = destCharacterId;
_data->talkMessageId = messageId;
@@ -748,12 +749,13 @@ void Hotspot::converse(uint16 destCharacterId, uint16 messageId, bool standStill
HotspotData *hotspot = Resources::getReference().getHotspot(destCharacterId);
_data->talkCountdown += hotspot->talkCountdown;
- if (hotspot->talkCountdown == 0)
- hotspot->talkerId = _hotspotId ;
- hotspot->talkGate = 0;
+ if (destStandStill) {
+ hotspot->talkerId = _hotspotId;
+ hotspot->talkGate = 0;
+ }
}
- if (standStill) {
+ if (srcStandStill) {
setDelayCtr(_data->talkCountdown);
_data->characterMode = CHARMODE_CONVERSING;
}
@@ -862,7 +864,7 @@ void Hotspot::handleTalkDialog() {
// Talking is finish - stop talking and free voice animation
debugC(ERROR_DETAILED, kLureDebugAnimations, "Talk dialog close");
room.setTalkDialog(0, 0, 0, 0);
-
+/*
if ((_data->talkDestCharacterId != 0) && (_data->talkDestCharacterId != NOONE_ID)) {
HotspotData *destChar = res.getHotspot(_data->talkDestCharacterId);
destChar->talkerId = 0;
@@ -870,6 +872,7 @@ void Hotspot::handleTalkDialog() {
_data->talkerId = 0;
_data->talkGate = 0;
+*/
}
}
@@ -882,7 +885,7 @@ void Hotspot::startTalkDialog() {
if ((_data->talkDestCharacterId != 0) && (_data->talkDestCharacterId != NOONE_ID)) {
HotspotData *hotspot = Resources::getReference().getHotspot(_data->talkDestCharacterId);
- hotspot->talkerId = _hotspotId;
+// hotspot->talkerId = _hotspotId;
}
if (room.roomNumber() != roomNumber()) return;
@@ -960,7 +963,7 @@ HotspotPrecheckResult Hotspot::actionPrecheck(HotspotData *hotspot) {
}
hotspot->talkGate = GENERAL_MAGIC_ID;
- hotspot->talkDestCharacterId = _hotspotId;
+ hotspot->talkerId = _hotspotId;
return PC_WAIT;
}
}
@@ -970,7 +973,7 @@ HotspotPrecheckResult Hotspot::actionPrecheck(HotspotData *hotspot) {
if (hotspot->hotspotId < FIRST_NONCHARACTER_ID) {
hotspot->characterMode = CHARMODE_INTERACTING;
hotspot->delayCtr = 30;
- hotspot->actionHotspotId = hotspot->hotspotId;
+ hotspot->actionHotspotId = _hotspotId;
}
return PC_EXECUTE;
}
@@ -1560,7 +1563,7 @@ void Hotspot::doTell(HotspotData *hotspot) {
return;
}
- converse(hotspot->hotspotId, 0x7C, true);
+ converse(hotspot->hotspotId, 0x7C, true, false);
uint16 sequenceOffset = res.getHotspotAction(hotspot->actionsOffset, TELL);
if (sequenceOffset >= 0x8000) {
@@ -2122,8 +2125,9 @@ void Hotspot::startTalk(HotspotData *charHotspot, uint16 id) {
setTickProc(TALK_TICK_PROC_ID);
// Signal the character that they're being talked to
- charHotspot->talkDestCharacterId = _hotspotId;
+ charHotspot->talkerId = _hotspotId;
charHotspot->talkGate = 0;
+ charHotspot->talkDestCharacterId = _hotspotId;
_data->talkDestCharacterId = charHotspot->hotspotId;
_data->talkGate = 0;
@@ -2335,7 +2339,7 @@ void HotspotTickHandlers::standardCharacterAnimHandler(Hotspot &h) {
// If someone is talking to the character, this stops them from moving for the duration)
if (h.resource()->talkerId != 0) {
debugC(ERROR_DETAILED, kLureDebugAnimations, "Talker Id = %xh, talk_gate = %d",
- h.resource()->talkDestCharacterId, h.talkGate());
+ h.resource()->talkerId, h.talkGate());
if (h.talkGate() == GENERAL_MAGIC_ID) {
fields.setField(ACTIVE_HOTSPOT_ID, h.talkGate());
fields.setField(USE_HOTSPOT_ID, h.resource()->talkerId);
@@ -2430,7 +2434,7 @@ void HotspotTickHandlers::standardCharacterAnimHandler(Hotspot &h) {
if (!decrementFlag) {
HotspotData *hotspot = res.getHotspot(h.resource()->actionHotspotId);
assert(hotspot);
- decrementFlag = (hotspot->roomNumber != h.hotspotId()) ? false :
+ decrementFlag = (hotspot->roomNumber != h.roomNumber()) ? false :
Support::charactersIntersecting(hotspot, h.resource());
}
@@ -3286,7 +3290,7 @@ void HotspotTickHandlers::talkAnimHandler(Hotspot &h) {
// Make sure the dest character holds still while an option is selected
HotspotData *destHotspot = res.getHotspot(talkDestCharacter);
- destHotspot->talkerId = h.hotspotId();
+ //destHotspot->talkerId = h.hotspotId();
} else {
res.setTalkState(TALK_RESPOND);
res.setTalkSelection(1);
@@ -3339,7 +3343,7 @@ void HotspotTickHandlers::talkAnimHandler(Hotspot &h) {
// Get the response the destination character will say
if (descId != TALK_MAGIC_ID) {
// Set up to display the question and response in talk dialogs
- h.converse(talkDestCharacter, descId, false);
+ h.converse(talkDestCharacter, descId);
res.setTalkState(TALK_RESPOND_2);
} else {
res.setTalkState(TALK_RESPOND_3);
@@ -3425,7 +3429,11 @@ void HotspotTickHandlers::talkAnimHandler(Hotspot &h) {
// End the conversation
res.getActiveHotspot(PLAYER_ID)->setTickProc(PLAYER_TICK_PROC_ID);
if (charHotspot)
+ {
charHotspot->setUseHotspotId(0);
+ charHotspot->resource()->talkerId = 0;
+ charHotspot->setDelayCtr(24);
+ }
res.setTalkData(0);
res.setCurrentAction(NONE);
res.setTalkState(TALK_NONE);
diff --git a/engines/lure/hotspots.h b/engines/lure/hotspots.h
index 348f2454f6..a02df45313 100644
--- a/engines/lure/hotspots.h
+++ b/engines/lure/hotspots.h
@@ -540,10 +540,8 @@ public:
void setVoiceCtr(uint8 v) { _voiceCtr = v; }
// Miscellaneous
- void converse(uint16 destCharacterId, uint16 messageId, bool standStill);
- void converse(uint16 destCharacterId, uint16 messageId) {
- converse(destCharacterId, messageId, false);
- }
+ void converse(uint16 destCharacterId, uint16 messageId, bool srcStandStill = false,
+ bool destStandStill = false);
void showMessage(uint16 messageId, uint16 destCharacterId = NOONE_ID);
void scheduleConverse(uint16 destHotspot, uint16 messageId);
void handleTalkDialog();
diff --git a/engines/lure/res.cpp b/engines/lure/res.cpp
index c8ac511dcf..43c94a6618 100644
--- a/engines/lure/res.cpp
+++ b/engines/lure/res.cpp
@@ -487,12 +487,13 @@ void Resources::setTalkingCharacter(uint16 id) {
HotspotData *charHotspot = res.getHotspot(_talkingCharacter);
assert(charHotspot);
charHotspot->talkCountdown = 0;
-
+/*
if (charHotspot->talkDestCharacterId != 0) {
HotspotData *destHotspot = res.getHotspot(charHotspot->talkDestCharacterId);
if (destHotspot != NULL)
destHotspot->talkDestCharacterId = 0;
}
+*/
charHotspot->talkDestCharacterId = 0;
}
diff --git a/engines/lure/room.cpp b/engines/lure/room.cpp
index b16644e9cb..b74d3bf849 100644
--- a/engines/lure/room.cpp
+++ b/engines/lure/room.cpp
@@ -616,7 +616,7 @@ void Room::setTalkDialog(uint16 srcCharacterId, uint16 destCharacterId, uint16 u
delete _talkDialog;
_talkDialog = NULL;
}
-
+/*
if (res.getTalkingCharacter() != 0) {
// Signal to any talked to character that they're no longer being talked to
HotspotData *talkingChar = res.getHotspot(res.getTalkingCharacter());
@@ -626,7 +626,7 @@ void Room::setTalkDialog(uint16 srcCharacterId, uint16 destCharacterId, uint16 u
destChar->talkerId = 0;
}
}
-
+*/
res.setTalkingCharacter(srcCharacterId);
if (srcCharacterId == 0)
diff --git a/engines/lure/scripts.cpp b/engines/lure/scripts.cpp
index 8751ec181d..ab89b8a9b1 100644
--- a/engines/lure/scripts.cpp
+++ b/engines/lure/scripts.cpp
@@ -338,7 +338,7 @@ void Script::decrInventoryItems(uint16 v1, uint16 v2, uint16 v3) {
void Script::setTalking(uint16 characterId, uint16 destHotspot, uint16 messageId) {
Hotspot *hotspot = Resources::getReference().getActiveHotspot(characterId);
if (hotspot)
- hotspot->converse(destHotspot, messageId, false);
+ hotspot->converse(destHotspot, messageId, true, false);
}
// Sets the current action ctr value for the given hotspot
@@ -353,7 +353,7 @@ void Script::setActionCtr(uint16 hotspotId, uint16 value, uint16 v3) {
void Script::startSpeaking(uint16 characterId, uint16 destHotspot, uint16 messageId) {
Hotspot *hotspot = Resources::getReference().getActiveHotspot(characterId);
- hotspot->converse(destHotspot, messageId, false);
+ hotspot->converse(destHotspot, messageId, false, false);
}
// Disables the given hotspot from being highlighted by the cursor