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

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Fri Jul 23 02:12:52 CEST 2010


Revision: 51182
          http://scummvm.svn.sourceforge.net/scummvm/?rev=51182&view=rev
Author:   lordhoto
Date:     2010-07-23 00:12:52 +0000 (Fri, 23 Jul 2010)

Log Message:
-----------
KYRA: Implemented some missing timers for object creation.

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/kyra_lok.h
    scummvm/trunk/engines/kyra/timer_lok.cpp

Modified: scummvm/trunk/engines/kyra/kyra_lok.h
===================================================================
--- scummvm/trunk/engines/kyra/kyra_lok.h	2010-07-23 00:12:29 UTC (rev 51181)
+++ scummvm/trunk/engines/kyra/kyra_lok.h	2010-07-23 00:12:52 UTC (rev 51182)
@@ -375,10 +375,14 @@
 	void setupTimers();
 	void timerUpdateHeadAnims(int timerNum);
 	void timerTulipCreator(int timerNum);
+	void timerRubyCreator(int timerNum);
 	void timerAsInvisibleTimeout(int timerNum);
 	void timerAsWillowispTimeout(int timerNum);
 	void checkAmuletAnimFlags();
 	void timerRedrawAmulet(int timerNum);
+	void timerLavenderRoseCreator(int timerNum);
+	void timerAcornCreator(int timerNum);
+	void timerBlueberryCreator(int timerNum);
 	void timerFadeText(int timerNum);
 	void timerWillowispFrameTimer(int timerNum);
 	void timerInvisibleFrameTimer(int timerNum);

Modified: scummvm/trunk/engines/kyra/timer_lok.cpp
===================================================================
--- scummvm/trunk/engines/kyra/timer_lok.cpp	2010-07-23 00:12:29 UTC (rev 51181)
+++ scummvm/trunk/engines/kyra/timer_lok.cpp	2010-07-23 00:12:52 UTC (rev 51182)
@@ -51,16 +51,19 @@
 	_timer->addTimer(14, TimerV1(timerAsWillowispTimeout), 600, 1);
 	_timer->addTimer(15, TimerV1(timerUpdateHeadAnims), 11, 1);
 	_timer->addTimer(16, TimerV1(timerTulipCreator), 7200, 1);
-	_timer->addTimer(17, 0 /*sub_15120*/, 7200, 1);
+	_timer->addTimer(17, TimerV1(timerRubyCreator), 7200, 1);
 	_timer->addTimer(18, TimerV1(timerAsInvisibleTimeout), 600, 1);
 	_timer->addTimer(19, TimerV1(timerRedrawAmulet), 600, 1);
 
 	_timer->addTimer(20, 0, 7200, 1);
-	_timer->addTimer(21, 0/*sub_1517C*/, 18000, 1);
+	_timer->addTimer(21, TimerV1(timerLavenderRoseCreator), 18000, 1);
 	_timer->addTimer(22, 0, 7200, 1);
 
-	for (int i = 23; i <= 27; ++i)
-		_timer->addTimer(i, 0, 10800, 1);
+	_timer->addTimer(23, 0, 10800, 1);
+	_timer->addTimer(24, TimerV1(timerAcornCreator), 10800, 1);
+	_timer->addTimer(25, 0, 10800, 1);
+	_timer->addTimer(26, TimerV1(timerBlueberryCreator), 10800, 1);
+	_timer->addTimer(27, 0, 10800, 1);
 
 	_timer->addTimer(28, 0, 21600, 1);
 	_timer->addTimer(29, 0, 7200, 1);
@@ -107,6 +110,78 @@
 	}
 }
 
+void KyraEngine_LoK::timerRubyCreator(int timerNum) {
+	if (_currentCharacter->sceneId == 0x23)
+		return;
+
+	int rndNr = _rnd.getRandomNumberRng(0, 3);
+
+	for (int i = 0; i < 4; i++) {
+		if (!queryGameFlag(rndNr + 22)) {
+			setGameFlag(rndNr + 22);
+			break;
+		} else {
+			rndNr++;
+			if (rndNr > 3)
+				rndNr = 0;
+		}
+	}
+}
+
+void KyraEngine_LoK::timerLavenderRoseCreator(int timerNum) {
+	if (_currentCharacter->sceneId == 0x06)
+		return;
+
+	int rndNr = _rnd.getRandomNumberRng(0, 4);
+
+	for (int i = 0; i < 5; i++) {
+		if (!queryGameFlag(rndNr)) {
+			setGameFlag(rndNr);
+			break;
+		} else {
+			rndNr++;
+			if (rndNr > 4)
+				rndNr = 0;
+		}
+	}
+}
+
+void KyraEngine_LoK::timerAcornCreator(int timerNum) {
+	if (_currentCharacter->sceneId == 0x1F)
+		return;
+
+	int rndNr = _rnd.getRandomNumberRng(0, 5);
+
+	for (int i = 0; i < 6; i++) {
+		if (!queryGameFlag(rndNr + 72)) {
+			setGameFlag(rndNr + 72);
+			break;
+		} else {
+			rndNr++;
+			if (rndNr > 5)
+				rndNr = 0;
+		}
+	}
+}
+
+void KyraEngine_LoK::timerBlueberryCreator(int timerNum) {
+	if (_currentCharacter->sceneId == 0x28)
+		return;
+
+	int rndNr = _rnd.getRandomNumberRng(0, 7);
+
+	for (int i = 0; i < 8; i++) {
+		if (!queryGameFlag(rndNr + 26)) {
+			setGameFlag(rndNr + 26);
+			break;
+		} else {
+			rndNr++;
+			if (rndNr > 7)
+				rndNr = 0;
+		}
+	}
+}
+
 void KyraEngine_LoK::timerFadeText(int timerNum) {
 	_fadeText = true;
 }


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