[Scummvm-cvs-logs] SF.net SVN: scummvm: [23787] scummvm/trunk/engines/lure

dreammaster at users.sourceforge.net dreammaster at users.sourceforge.net
Sun Aug 27 13:48:55 CEST 2006


Revision: 23787
Author:   dreammaster
Date:     2006-08-27 04:48:41 -0700 (Sun, 27 Aug 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=23787&view=rev

Log Message:
-----------
In progress work on tell command handling

Modified Paths:
--------------
    scummvm/trunk/engines/lure/hotspots.cpp
    scummvm/trunk/engines/lure/hotspots.h
Modified: scummvm/trunk/engines/lure/hotspots.cpp
===================================================================
--- scummvm/trunk/engines/lure/hotspots.cpp	2006-08-27 11:47:03 UTC (rev 23786)
+++ scummvm/trunk/engines/lure/hotspots.cpp	2006-08-27 11:48:41 UTC (rev 23787)
@@ -79,6 +79,7 @@
 	_blockedOffset = 0;
 	_exitCtr = 0;
 	_walkFlag = true;
+	_startRoomNumber = 0;
 
 	if (_data->npcSchedule != 0) {
 		CharacterScheduleEntry *entry = resources.charSchedules().getEntry(_data->npcSchedule);
@@ -791,11 +792,12 @@
 	} else {
 		setActionCtr(1);
 		if ((hotspot->hotspotId >= FIRST_NONCHARACTER_ID) ||
-			((hotspot->v50 != _hotspotId) && (hotspot->characterMode == CHARMODE_4))) {
+			((hotspot->actionHotspotId != _hotspotId) && (hotspot->characterMode == CHARMODE_4))) {
 			// loc_880
 			if (characterWalkingCheck(hotspot))
 				return PC_INITIAL;
-		} else if (hotspot->v50 != _hotspotId) {
+
+		} else if (hotspot->actionHotspotId != _hotspotId) {
 			if (fields.getField(88) == 2) {
 				// loc_882
 				hotspot->v2b = 0x2A;
@@ -813,7 +815,7 @@
 	if (hotspot->hotspotId < FIRST_NONCHARACTER_ID) {
 		hotspot->characterMode = CHARMODE_8;
 		hotspot->delayCtr = 30;
-		hotspot->v50 = hotspot->hotspotId;
+		hotspot->actionHotspotId = hotspot->hotspotId;
 	}
 	return PC_EXECUTE;
 }
@@ -1287,7 +1289,38 @@
 }
 
 void Hotspot::doTell(HotspotData *hotspot) {
-	// TODO
+	Resources &res = Resources::getReference();
+	ValueTableData &fields = res.fieldList();
+	fields.setField(ACTIVE_HOTSPOT_ID, hotspot->hotspotId);
+	fields.setField(USE_HOTSPOT_ID, hotspot->hotspotId);
+	Hotspot *character = res.getActiveHotspot(hotspot->hotspotId);
+	assert(character);
+
+	HotspotPrecheckResult result = actionPrecheck(hotspot);
+	if (result == PC_INITIAL) return;
+	else if (result != PC_EXECUTE) {
+		endAction();
+		return;
+	}
+
+	converse(hotspot->hotspotId, 0x7C);
+
+	uint16 sequenceOffset = res.getHotspotAction(hotspot->actionsOffset, TELL);
+	if (sequenceOffset >= 0x8000) {
+		showMessage(sequenceOffset);
+	} else if (sequenceOffset != 0) {
+		uint16 result = Script::execute(sequenceOffset);
+
+		if (result == 0) {
+			character->setStartRoomNumber(character->roomNumber());
+			character->currentActions().clear();
+			
+			// Build up sequence of commands for character to follow
+			error("Tell command handling yet not yet implemented");
+		}
+	}
+
+	endAction();
 }
 
 void Hotspot::doLook(HotspotData *hotspot) {
@@ -1506,7 +1539,8 @@
 }
 
 void Hotspot::doReturn(HotspotData *hotspot) {
-	error("Not yet implemented");
+	currentActions().top().setRoomNumber(startRoomNumber());
+	endAction();
 }
 
 uint16 bribe_hotspot_list[] = {0x421, 0x879, 0x3E9, 0x8C7, 0x429, 0x8D1,
@@ -1548,7 +1582,7 @@
 		if (sequenceOffset != 0) return;
 	}
 
-	// TODO: handle character message display
+	showMessage(sequenceOffset);
 }
 
 void Hotspot::doExamine(HotspotData *hotspot) {
@@ -1944,12 +1978,11 @@
 			// TODO: Figure out what mode 6 is
 			h.updateMovement();
 			if (bumpedPlayer) return;
-
 		} else {
 			// All other character modes
 			if (h.delayCtr() > 0) {
 				// There is some countdown left to do
-				bool decrementFlag = true; //TODO: = HS[50h] == 0
+				bool decrementFlag = true; 
 
 				if (!decrementFlag) {
 					HotspotData *hotspot = res.getHotspot(0); // TODO: HS[50h]
@@ -1964,7 +1997,7 @@
 			}
 		}
 
-		// TODO: HS[50h]=0
+		h.resource()->actionHotspotId = 0;
 		CharacterMode currentMode = h.characterMode();
 		h.setCharacterMode(CHARMODE_NONE);
 		h.pathFinder().clear();
@@ -1975,7 +2008,7 @@
 		}
 		return;
 	}
-
+//loc_1040
 	debugC(ERROR_DETAILED, kLureDebugAnimations, "Hotspot standard character point 6");
 	CurrentAction action = actions.action();
 
@@ -2301,7 +2334,7 @@
 		hotspot = NULL;
 		if (actions.top().hasSupportData()) {
 			hsAction = actions.top().supportData().action();
-			
+
 			if (actions.top().supportData().numParams() > 0) {
 				hotspotId = actions.top().supportData().param(0);
 				hotspot = res.getHotspot(hotspotId);
@@ -2822,11 +2855,11 @@
 		h.setExitCtr(0);
 		if (h.currentActions().size() > 1) {
 			// Pending items on stack
-			// TODO: Check on HS[4Eh]
-			if (h.currentActions().top().supportData().id() != RETURN_SUPPORT_ID) {
-				h.currentActions().top().supportData().setDetails(RETURN, 0);
+			if (h.startRoomNumber() != 0) {
+				if (h.currentActions().top().supportData().id() != RETURN_SUPPORT_ID) {
+					h.currentActions().top().supportData().setDetails(RETURN, 0);
+				}
 			}
-
 			h.currentActions().top().setRoomNumber(h.roomNumber());
 
 		} else if (h.blockedOffset() != 0) {

Modified: scummvm/trunk/engines/lure/hotspots.h
===================================================================
--- scummvm/trunk/engines/lure/hotspots.h	2006-08-27 11:47:03 UTC (rev 23786)
+++ scummvm/trunk/engines/lure/hotspots.h	2006-08-27 11:48:41 UTC (rev 23787)
@@ -232,6 +232,7 @@
 	bool _frameStartsUsed;
 	uint16 _frameStarts[MAX_NUM_FRAMES];
 
+	// Runtime fields
 	uint16 _frameCtr;
 	uint8 _voiceCtr;
 	int16 _destX, _destY;
@@ -239,6 +240,7 @@
 	uint16 _blockedOffset;
 	uint8 _exitCtr;
 	bool _walkFlag;
+	uint16 _startRoomNumber;
 
 	// Support methods
 	uint16 getTalkId(HotspotData *charHotspot);
@@ -315,6 +317,7 @@
 	uint16 blockedOffset() { return _blockedOffset; }
 	uint8 exitCtr() { return _exitCtr; }
 	bool walkFlag() { return _walkFlag; }
+	uint16 startRoomNumber() { return _startRoomNumber; }
 	uint16 width() { return _width; }
 	uint16 height() { return _height; }
 	uint16 widthCopy() { return _widthCopy; }
@@ -349,6 +352,7 @@
 		_data->blockedState = newState; 
 	}
 	void setWalkFlag(bool value) { _walkFlag = value; }
+	void setStartRoomNumber(uint16 value) { _startRoomNumber = value; }
 	void setSize(uint16 newWidth, uint16 newHeight);
 	void setScript(uint16 offset) {
 		assert(_data != NULL);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.





More information about the Scummvm-git-logs mailing list