[Scummvm-cvs-logs] SF.net SVN: scummvm:[41074] scummvm/trunk/engines/kyra

athrxx at users.sourceforge.net athrxx at users.sourceforge.net
Sun May 31 17:42:26 CEST 2009


Revision: 41074
          http://scummvm.svn.sourceforge.net/scummvm/?rev=41074&view=rev
Author:   athrxx
Date:     2009-05-31 15:42:26 +0000 (Sun, 31 May 2009)

Log Message:
-----------
LOL: implemented magic viper attack (used by wraiths in white tower level 3)

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/lol.cpp
    scummvm/trunk/engines/kyra/lol.h
    scummvm/trunk/engines/kyra/scene_lol.cpp
    scummvm/trunk/engines/kyra/sprites_lol.cpp

Modified: scummvm/trunk/engines/kyra/lol.cpp
===================================================================
--- scummvm/trunk/engines/kyra/lol.cpp	2009-05-31 15:34:23 UTC (rev 41073)
+++ scummvm/trunk/engines/kyra/lol.cpp	2009-05-31 15:42:26 UTC (rev 41074)
@@ -3294,6 +3294,61 @@
 }
 
 void LoLEngine::launchMagicViper() {
+	_partyAwake = true;
+
+	int d = 0;	
+	for (uint16 b = _currentBlock; d < 3; d++) {
+		uint16 o = _levelBlockProperties[b].assignedObjects;
+		if (o & 0x8000)
+			break;
+		b = calcNewBlockPosition(b, _currentDirection);
+		if (_wllWallFlags[_levelBlockProperties[b].walls[_currentDirection ^ 2]] & 7)
+			break;
+	}
+
+	_screen->copyPage(0, 12);
+	snd_playSoundEffect(148, -1);
+
+	WSAMovie_v2 *mov = new WSAMovie_v2(this, _screen);
+	int numFrames = mov->open("viper.wsa", 1, 0);
+	if (!mov->opened())
+		error("Viper: Unable to load viper.wsa");
+	
+	static const uint8 viperAnimData[] = { 15, 25, 20, 10, 25, 20, 5, 25, 20, 0, 25, 20 };
+	const uint8 *v = &viperAnimData[d * 3];
+	int frm = v[0];
+	
+	for (bool running = true; running;) {
+		uint32 etime = _system->getMillis() + 5 * _tickLength;
+		_screen->copyPage(12, 2);
+		
+		if (frm == v[2])
+			snd_playSoundEffect(172, -1);
+
+		mov->displayFrame(frm++ % numFrames, 2, 112, 0, 0x5000, _trueLightTable1, _trueLightTable2);
+		_screen->copyRegion(112, 0, 112, 0, 176, 120, 2, 0, Screen::CR_NO_P_CHECK);
+		_screen->updateScreen();
+		delayUntil(etime);
+
+		if (frm > v[1])
+			running = false;
+	}
+	
+	mov->close();
+	delete mov;
+
+	_screen->copyPage(12, 0);
+	_screen->copyPage(12, 2);
+
+	int t = _rnd.getRandomNumberRng(1, 4);
+
+	for (int i = 0; i < 4; i++) {
+		if (!(_characters[i].flags & 1)) {
+			t = t % 4;
+			continue;
+		}
+		inflictDamage(t, _currentLevel + 10, 0x8000, 2, 0x86);
+	}
 }
 
 void LoLEngine::breakIceWall(uint8 *pal1, uint8 *pal2) {

Modified: scummvm/trunk/engines/kyra/lol.h
===================================================================
--- scummvm/trunk/engines/kyra/lol.h	2009-05-31 15:34:23 UTC (rev 41073)
+++ scummvm/trunk/engines/kyra/lol.h	2009-05-31 15:42:26 UTC (rev 41074)
@@ -1211,7 +1211,7 @@
 	void removeDrawObjectFromBlock(LevelBlockProperty *l, int id);
 	void assignMonsterToBlock(uint16 *assignedBlockObjects, int id);
 	void giveItemToMonster(MonsterInPlay *monster, uint16 item);
-	int checkBlockBeforeObjectPlacement(int x, int y, int objectWidth, int testFlag, int wallFlag);
+	int checkBlockBeforeObjectPlacement(uint16 x, uint16 y, uint16 objectWidth, uint16 testFlag, uint16 wallFlag);
 	int checkBlockForWallsAndSufficientSpace(int block, int x, int y, int objectWidth, int testFlag, int wallFlag);
 	int calcMonsterSkillLevel(int id, int a);
 	int checkBlockOccupiedByParty(int x, int y, int testFlag);

Modified: scummvm/trunk/engines/kyra/scene_lol.cpp
===================================================================
--- scummvm/trunk/engines/kyra/scene_lol.cpp	2009-05-31 15:34:23 UTC (rev 41073)
+++ scummvm/trunk/engines/kyra/scene_lol.cpp	2009-05-31 15:42:26 UTC (rev 41074)
@@ -700,7 +700,7 @@
 }
 
 uint16 LoLEngine::calcBlockIndex(uint16 x, uint16 y) {
-	return ((y & 0xff00) >> 3) | (x >> 8);
+	return (((y & 0xff00) >> 3) | (x >> 8)) & 0x3ff;
 }
 
 void LoLEngine::calcCoordinates(uint16 &x, uint16 &y, int block, uint16 xOffs, uint16 yOffs) {

Modified: scummvm/trunk/engines/kyra/sprites_lol.cpp
===================================================================
--- scummvm/trunk/engines/kyra/sprites_lol.cpp	2009-05-31 15:34:23 UTC (rev 41073)
+++ scummvm/trunk/engines/kyra/sprites_lol.cpp	2009-05-31 15:42:26 UTC (rev 41074)
@@ -384,10 +384,10 @@
 	*assignedBlockObjects = id;
 }
 
-int LoLEngine::checkBlockBeforeObjectPlacement(int x, int y, int objectWidth, int testFlag, int wallFlag) {
+int LoLEngine::checkBlockBeforeObjectPlacement(uint16 x, uint16 y, uint16 objectWidth, uint16 testFlag, uint16 wallFlag) {
 	_objectLastDirection = 0;
-	int x2 = 0;
-	int y2 = 0;
+	uint16 x2 = 0;
+	uint16 y2 = 0;
 	int xOffs = 0;
 	int yOffs = 0;
 	int flag = 0;


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