[Scummvm-cvs-logs] scummvm master -> 75610e7119b415779380805912de40101e3be656

bluegr bluegr at gmail.com
Sun Jun 7 02:39:59 CEST 2015


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
75610e7119 SHERLOCK: Implement some more Rose Tattoo script opcodes


Commit: 75610e7119b415779380805912de40101e3be656
    https://github.com/scummvm/scummvm/commit/75610e7119b415779380805912de40101e3be656
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2015-06-07T03:38:51+03:00

Commit Message:
SHERLOCK: Implement some more Rose Tattoo script opcodes

These are cmdSetNPCInfoLine, cmdSetNPCVerb, cmdSetNPCVerbCAnimation,
cmdSetNPCVerbScript and cmdSetNPCVerbTarget

Changed paths:
    engines/sherlock/tattoo/tattoo_talk.cpp



diff --git a/engines/sherlock/tattoo/tattoo_talk.cpp b/engines/sherlock/tattoo/tattoo_talk.cpp
index 9d69d8f..4075450 100644
--- a/engines/sherlock/tattoo/tattoo_talk.cpp
+++ b/engines/sherlock/tattoo/tattoo_talk.cpp
@@ -216,7 +216,20 @@ OpcodeReturn TattooTalk::cmdPassword(const byte *&str) { error("TODO: script opc
 OpcodeReturn TattooTalk::cmdPlaySong(const byte *&str) { error("TODO: script opcode"); }
 OpcodeReturn TattooTalk::cmdRestorePeopleSequence(const byte *&str) { error("TODO: script opcode"); }
 OpcodeReturn TattooTalk::cmdSetNPCDescOnOff(const byte *&str) { error("TODO: script opcode"); }
-OpcodeReturn TattooTalk::cmdSetNPCInfoLine(const byte *&str) { error("TODO: script opcode"); }
+
+OpcodeReturn TattooTalk::cmdSetNPCInfoLine(const byte *&str) {
+	int npcNum = *++str;
+	int len = *++str;
+	People &people = *_vm->_people;
+	Person &person = people[npcNum];
+
+	for (int x = 0; x < len; x++)
+		person._description.setChar(str[x + 1], x);
+	person._description.setChar(0, len);
+	str += len;
+
+	return RET_SUCCESS;
+}
 
 OpcodeReturn TattooTalk::cmdSetNPCOff(const byte *&str) {
 	People &people = *_vm->_people;
@@ -240,17 +253,16 @@ OpcodeReturn TattooTalk::cmdSetNPCPathPauseTakingNotes(const byte *&str) { error
 OpcodeReturn TattooTalk::cmdSetNPCPathPauseLookingHolmes(const byte *&str) { error("TODO: script opcode"); }
 
 OpcodeReturn TattooTalk::cmdSetNPCPosition(const byte *&str) {
-	++str;
-	int npc = *str - 1;
+	int npcNum = *++str - 1;
 	++str;
 	People &people = *_vm->_people;
-	Person &person = people[npc];
+	Person &person = people[npcNum];
 	int32 posX = (str[0] - 1) * 256 + str[1] - 1;
 	if (posX > 16384)
 		posX = -1 * (posX - 16384);
 	int32 posY = (str[2] - 1) * 256 + str[3] - 1;
 	
-	people[npc]._position = Point32(posX * 1000, posY * 1000);
+	people[npcNum]._position = Point32(posX * 1000, posY * 1000);
 	if (person._seqTo && person._walkLoaded) {
 		person._walkSequences[person._sequenceNumber]._sequences[person._frameNumber] = person._seqTo;
 		person._seqTo = 0;
@@ -283,16 +295,98 @@ OpcodeReturn TattooTalk::cmdSetNPCPosition(const byte *&str) {
 }
 
 OpcodeReturn TattooTalk::cmdSetNPCTalkFile(const byte *&str) { error("TODO: script opcode"); }
-OpcodeReturn TattooTalk::cmdSetNPCVerb(const byte *&str) { error("TODO: script opcode"); }
-OpcodeReturn TattooTalk::cmdSetNPCVerbCAnimation(const byte *&str) { error("TODO: script opcode"); }
-OpcodeReturn TattooTalk::cmdSetNPCVerbScript(const byte *&str) { error("TODO: script opcode"); }
-OpcodeReturn TattooTalk::cmdSetNPCVerbTarget(const byte *&str) { error("TODO: script opcode"); }
+
+OpcodeReturn TattooTalk::cmdSetNPCVerb(const byte *&str) {
+	int npcNum = *++str;
+	int verbNum = *++str - 1;
+	People &people = *_vm->_people;
+	Common::String &verb = people[npcNum]._use[verbNum]._verb;
+
+	for (int x = 0; x < 12; x++) {
+		if (str[x + 1] != '~')
+			verb.setChar(str[x + 1], x);
+		else
+			verb.setChar(0, x);
+	}
+
+	verb.setChar(0, 11);
+
+	uint len = verb.size() - 1;
+	while (verb[len] == ' ' && len)
+		len--;
+	verb.setChar(0, len + 1);
+	if (verb != " ")
+		verb.clear();
+	str += 12;
+
+	return RET_SUCCESS;
+}
+
+OpcodeReturn TattooTalk::cmdSetNPCVerbCAnimation(const byte *&str) {
+	int npcNum = *++str;
+	int verbNum = *++str - 1;
+	People &people = *_vm->_people;
+	UseType &useType = people[npcNum]._use[verbNum];
+
+	useType._cAnimNum = (str[1] - 1) & 127;
+	useType._cAnimSpeed = 1 + 128 * (str[1] >= 128);
+	str++;
+
+	return RET_SUCCESS;
+}
+
+OpcodeReturn TattooTalk::cmdSetNPCVerbScript(const byte *&str) {
+	int npcNum = *++str;
+	int verbNum = *++str - 1;
+	People &people = *_vm->_people;
+	UseType &useType = people[npcNum]._use[verbNum];
+	Common::String &name = useType._names[0];
+	name.setChar('*', 0);
+	name.setChar('C', 1);
+
+	for (int x = 0; x < 8; x++) {
+		if (str[x + 1] != '~')
+			name.setChar(str[x + 1], x + 2);
+		else
+			name.setChar(0, x + 2);
+	}
+
+	name.setChar(0, 11);
+	useType._cAnimNum = 99;
+	useType._cAnimSpeed = 1;
+	str += 8;
+
+	return RET_SUCCESS;
+}
+
+OpcodeReturn TattooTalk::cmdSetNPCVerbTarget(const byte *&str) {
+	int npcNum = *++str;
+	int verbNum = *++str - 1;
+	People &people = *_vm->_people;
+	Common::String &target = people[npcNum]._use[verbNum]._target;
+
+	for (int x = 0; x < 12; x++) {
+		if (str[x + 1] != '~')
+			target.setChar(str[x + 1], x);
+		else
+			target.setChar(0, x);
+	}
+
+	target.setChar(0, 11);
+
+	uint len = target.size() - 1;
+	while (target[len] == ' ' && len)
+		len--;
+	target.setChar(0, len + 1);
+	str += 12;
+
+	return RET_SUCCESS;
+}
 
 OpcodeReturn TattooTalk::cmdSetNPCWalkGraphics(const byte *&str) {
-	++str;
-	int npc = *str - 1;
+	int npcNum = *++str - 1;
 	People &people = *_vm->_people;
-	Person &person = people[npc];
+	Person &person = people[npcNum];
 
 	// Build up walk library name for the given NPC
 	person._walkVGSName = "";






More information about the Scummvm-git-logs mailing list