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

athrxx at users.sourceforge.net athrxx at users.sourceforge.net
Mon May 18 03:39:59 CEST 2009


Revision: 40673
          http://scummvm.svn.sourceforge.net/scummvm/?rev=40673&view=rev
Author:   athrxx
Date:     2009-05-18 01:39:58 +0000 (Mon, 18 May 2009)

Log Message:
-----------
LOL: - implemented fog spell

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/gui_lol.cpp
    scummvm/trunk/engines/kyra/lol.cpp
    scummvm/trunk/engines/kyra/lol.h
    scummvm/trunk/engines/kyra/script_tim.cpp

Modified: scummvm/trunk/engines/kyra/gui_lol.cpp
===================================================================
--- scummvm/trunk/engines/kyra/gui_lol.cpp	2009-05-18 00:03:27 UTC (rev 40672)
+++ scummvm/trunk/engines/kyra/gui_lol.cpp	2009-05-18 01:39:58 UTC (rev 40673)
@@ -1308,7 +1308,7 @@
 
 	int p = 0;
 	for (int i = 0; i < len; i++) {
-		p = _screen->getPagePixel(_screen->_curPage, _mouseX + checkX[i], _mouseY + checkY[i]);
+		p = _screen->getPagePixel(_screen->_curPage, CLIP(_mouseX + checkX[i], 0, 320), CLIP(_mouseY + checkY[i], 0, 200));
 		if (p)
 			break;
 	}
@@ -2115,7 +2115,7 @@
 			buttonList->flags2 |= flags;
 
 			if (buttonList->buttonCallback) {
-				_vm->removeInputTop();
+				//_vm->removeInputTop();
 				if ((*buttonList->buttonCallback.get())(buttonList))
 					break;
 			}

Modified: scummvm/trunk/engines/kyra/lol.cpp
===================================================================
--- scummvm/trunk/engines/kyra/lol.cpp	2009-05-18 00:03:27 UTC (rev 40672)
+++ scummvm/trunk/engines/kyra/lol.cpp	2009-05-18 01:39:58 UTC (rev 40673)
@@ -2185,6 +2185,7 @@
 }
 
 int LoLEngine::castHandOfFate(ActiveSpell *a) {
+	processMagicHandOfFate(a->charNum, a->level);
 	return 1;
 }
 
@@ -2194,10 +2195,12 @@
 }
 
 int LoLEngine::castLightning(ActiveSpell *a) {
+	processMagicLightning(a->charNum, a->level);
 	return 1;
 }
 
 int LoLEngine::castFog(ActiveSpell *a) {
+	processMagicFog();
 	return 1;
 }
 
@@ -2211,6 +2214,7 @@
 }
 
 int LoLEngine::castGuardian(ActiveSpell *a) {
+	processMagicGuardian(a->charNum, a->level);
 	return 1;
 }
 
@@ -2330,7 +2334,6 @@
 		points = 10000;
 		healShpFrames = _healShapeFrames + 16;
 		healiShpFrames = _healShapeFrames + 64;
-
 	}
 
 	int ch = 0;
@@ -2377,7 +2380,7 @@
 
 			pts[charNum] &= 0xff;
 			pts[charNum] += ((diff[charNum] << 8) / 16);
-			increaseCharacterHitpoints(ch, pts[charNum] / 256, true);
+			increaseCharacterHitpoints(charNum, pts[charNum] / 256, true);
 			gui_drawCharPortraitWithStats(charNum);
 
 			_screen->drawShape(2, _healShapes[healShpFrames[i]], pX[charNum], pY, 0, 0x1000, _trueLightTable1, _trueLightTable2);
@@ -2446,10 +2449,54 @@
 
 }
 
+void LoLEngine::processMagicHandOfFate(int charNum, int spellLevel) {
+
+}
+
 void LoLEngine::processMagicMistOfDoom(int charNum, int spellLevel) {
 
 }
 
+void LoLEngine::processMagicLightning(int charNum, int spellLevel) {
+
+}
+
+void LoLEngine::processMagicFog() {
+	int cp = _screen->setCurPage(2);
+	_screen->copyPage(0, 12);
+
+	WSAMovie_v2 *mov = new WSAMovie_v2(this, _screen);
+	int numFrames = mov->open("fog.wsa", 0, 0);
+	if (!mov->opened())
+		error("Fog: Unable to load fog.wsa");
+
+	snd_playSoundEffect(145, -1);
+	
+	for (int curFrame = 0; curFrame < numFrames; curFrame++) {
+		_smoothScrollTimer = _system->getMillis() + 3 * _tickLength;
+		_screen->copyPage(12, 2);
+		mov->displayFrame(curFrame % 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(_smoothScrollTimer);
+	}
+	
+	mov->close();
+	delete mov;
+
+	_screen->copyPage(12, 2);
+	_screen->setCurPage(cp);
+	updateDrawPage2();
+
+	uint16 o = _levelBlockProperties[calcNewBlockPosition(_currentBlock, _currentDirection)].assignedObjects;
+	while (o & 0x8000) {
+		inflictMagicalDamage(o, -1, 15, 6, 0);
+		o = _monsters[o & 0x7fff].nextAssignedObject;
+	}
+
+	gui_drawScene(0);
+}
+
 void LoLEngine::processMagicSwarm(int charNum, int damage) {
 	int cp = _screen->setCurPage(2);
 	_screen->copyPage(0, 12);
@@ -2513,6 +2560,10 @@
 	delete mov;
 }
 
+void LoLEngine::processMagicGuardian(int charNum, int spellLevel) {
+
+}
+
 void LoLEngine::callbackProcessMagicSwarm(WSAMovie_v2 *mov, int x, int y) {
 	if (_swarmSpellStatus)
 		_screen->copyRegion(112, 0, 112, 0, 176, 120, 6, _screen->_curPage);

Modified: scummvm/trunk/engines/kyra/lol.h
===================================================================
--- scummvm/trunk/engines/kyra/lol.h	2009-05-18 00:03:27 UTC (rev 40672)
+++ scummvm/trunk/engines/kyra/lol.h	2009-05-18 01:39:58 UTC (rev 40673)
@@ -1254,8 +1254,12 @@
 	void processMagicHeal(int charNum, int spellLevel);
 	void processMagicIce(int charNum, int spellLevel);
 	void processMagicFireball(int charNum, int spellLevel);
+	void processMagicHandOfFate(int charNum, int spellLevel);
 	void processMagicMistOfDoom(int charNum, int spellLevel);
+	void processMagicLightning(int charNum, int spellLevel);
+	void processMagicFog();
 	void processMagicSwarm(int charNum, int damage);
+	void processMagicGuardian(int charNum, int spellLevel);
 
 	void callbackProcessMagicSwarm(WSAMovie_v2 *mov, int x, int y);
 

Modified: scummvm/trunk/engines/kyra/script_tim.cpp
===================================================================
--- scummvm/trunk/engines/kyra/script_tim.cpp	2009-05-18 00:03:27 UTC (rev 40672)
+++ scummvm/trunk/engines/kyra/script_tim.cpp	2009-05-18 01:39:58 UTC (rev 40673)
@@ -597,6 +597,7 @@
 	Animation &anim = _animations[param[0]];
 	const int frame = param[1];
 	int page = (anim.wsaCopyParams & 0x4000) != 0 ? 2 : _drawPage2;
+	// WORKAROUND for some bugged scripts that will try to display frames of non-existent animations
 	if (anim.wsa)
 		anim.wsa->displayFrame(frame, page, anim.x, anim.y, anim.wsaCopyParams & 0xF0FF, 0, 0);
 	if (!page)
@@ -945,6 +946,7 @@
 	anim->curFrame = p->firstFrame;
 	anim->cyclesCompleted = 0;
 
+	// WORKAROUND for some bugged scripts that will try to display frames of non-existent animations
 	if (anim->wsa)
 		anim->wsa->displayFrame(anim->curFrame - 1, 0, anim->x, anim->y, 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