diff options
author | Paul Gilbert | 2007-04-30 07:56:45 +0000 |
---|---|---|
committer | Paul Gilbert | 2007-04-30 07:56:45 +0000 |
commit | 2cb3b5a9c65cf64a14a191acd572a98b4155ebda (patch) | |
tree | 60dba2825837b5a70f1026bc5a816c29696b3481 /engines | |
parent | 68175c713bc742fc5cbb12c9183211d4a6d8c657 (diff) | |
download | scummvm-rg350-2cb3b5a9c65cf64a14a191acd572a98b4155ebda.tar.gz scummvm-rg350-2cb3b5a9c65cf64a14a191acd572a98b4155ebda.tar.bz2 scummvm-rg350-2cb3b5a9c65cf64a14a191acd572a98b4155ebda.zip |
Added NPC to NPC talk action, and a bugfix for when remote viewing a room
svn-id: r26680
Diffstat (limited to 'engines')
-rw-r--r-- | engines/lure/hotspots.cpp | 37 | ||||
-rw-r--r-- | engines/lure/hotspots.h | 2 |
2 files changed, 35 insertions, 4 deletions
diff --git a/engines/lure/hotspots.cpp b/engines/lure/hotspots.cpp index 7dc3172663..dafeab1440 100644 --- a/engines/lure/hotspots.cpp +++ b/engines/lure/hotspots.cpp @@ -1101,7 +1101,7 @@ void Hotspot::doAction(Action action, HotspotData *hotspot) { &Hotspot::npcSetSupportOffset, &Hotspot::npcSupportOffsetConditional, &Hotspot::npcDispatchAction, - &Hotspot::npcUnknown3, + &Hotspot::npcTalkNpcToNpc, &Hotspot::npcPause, &Hotspot::npcStartTalking, &Hotspot::npcJumpAddress}; @@ -1903,8 +1903,38 @@ void Hotspot::npcDispatchAction(HotspotData *hotspot) { } } -void Hotspot::npcUnknown3(HotspotData *hotspot) { - warning("npcUnknown3: Not yet implemented"); +void Hotspot::npcTalkNpcToNpc(HotspotData *hotspot) { + Resources &res = Resources::getReference(); + ValueTableData &fields = res.fieldList(); + CharacterScheduleEntry &entry = _currentActions.top().supportData(); + fields.setField(ACTIVE_HOTSPOT_ID, hotspot->hotspotId); + fields.setField(USE_HOTSPOT_ID, hotspot->hotspotId); + + HotspotPrecheckResult result = actionPrecheck(hotspot); + if (result == PC_WAIT) return; + else if (result != PC_EXECUTE) { + endAction(); + return; + } + + // If dest is already talking, keep exiting until they're free + if (hotspot->talkCountdown != 0) + return; + + // Handle the source's talk message + if (entry.param(1) != 0) { + converse(hotspot->hotspotId, entry.param(1)); + resource()->talkCountdown = entry.param(2); + resource()->delayCtr = entry.param(2); + } + + // Handle the destination's response message + if (entry.param(3) != 0) { + Hotspot *destHotspot = res.getActiveHotspot(hotspot->hotspotId); + assert(destHotspot); + destHotspot->converse(this->hotspotId(), entry.param(3)); + } + endAction(); } @@ -2075,6 +2105,7 @@ void Hotspot::loadFromStream(Common::ReadStream *stream) { HandlerMethodPtr HotspotTickHandlers::getHandler(uint16 procOffset) { switch (procOffset) { + case 0: case 0x41BD: return defaultHandler; case STANDARD_CHARACTER_TICK_PROC: diff --git a/engines/lure/hotspots.h b/engines/lure/hotspots.h index 352c254d0d..91fa317c04 100644 --- a/engines/lure/hotspots.h +++ b/engines/lure/hotspots.h @@ -316,7 +316,7 @@ private: void npcSetSupportOffset(HotspotData *hotspot); void npcSupportOffsetConditional(HotspotData *hotspot); void npcDispatchAction(HotspotData *hotspot); - void npcUnknown3(HotspotData *hotspot); + void npcTalkNpcToNpc(HotspotData *hotspot); void npcPause(HotspotData *hotspot); void npcStartTalking(HotspotData *hotspot); void npcJumpAddress(HotspotData *hotspot); |