[Scummvm-cvs-logs] scummvm master -> 647679b925e2548f0d15d4e27a3aa2c908151c5a

urukgit urukgit at users.noreply.github.com
Sun Apr 6 19:43:14 CEST 2014


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:
647679b925 AVALANCHE: Remove some leftovers of the mini-games.


Commit: 647679b925e2548f0d15d4e27a3aa2c908151c5a
    https://github.com/scummvm/scummvm/commit/647679b925e2548f0d15d4e27a3aa2c908151c5a
Author: uruk (koppirnyo at gmail.com)
Date: 2014-04-06T19:42:46+02:00

Commit Message:
AVALANCHE: Remove some leftovers of the mini-games.

Changed paths:
    engines/avalanche/parser.cpp
    engines/avalanche/shootemup.cpp
    engines/avalanche/shootemup.h
    engines/avalanche/timer.cpp
    engines/avalanche/timer.h



diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 7db0d14..da365fe 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -2021,8 +2021,7 @@ void Parser::doThat() {
 				break;
 			case 55:
 				if (_vm->_room == kRoomArgentPub)
-					// play_nim();
-					warning("STUB: Parser::doThat() - case kVerbCodeplay - play_nim()");
+					_vm->_nim->playNim();
 				else
 					_vm->_dialogs->displayText(kWhat);
 				break;
diff --git a/engines/avalanche/shootemup.cpp b/engines/avalanche/shootemup.cpp
index 8d61316..cabd19d 100644
--- a/engines/avalanche/shootemup.cpp
+++ b/engines/avalanche/shootemup.cpp
@@ -95,7 +95,7 @@ ShootEmUp::ShootEmUp(AvalancheEngine *vm) {
 	_gotOut = false;
 }
 
-void ShootEmUp::run() {
+uint16 ShootEmUp::run() {
 	CursorMan.showMouse(false);
 	_vm->_graphics->saveScreen();
 	_vm->fadeOut();
@@ -142,12 +142,14 @@ void ShootEmUp::run() {
 		if (delay <= 55)
 			_vm->_system->delayMillis(55 - delay); // Replaces slowdown(); 55 comes from 18.2 Hz (B Flight).
 	};
-
+	
 	_vm->fadeOut();
 	_vm->_graphics->restoreScreen();
 	_vm->_graphics->removeBackup();
 	_vm->fadeIn();
 	CursorMan.showMouse(true);
+
+	return _score;
 }
 
 bool ShootEmUp::overlap(uint16 a1x, uint16 a1y, uint16 a2x, uint16 a2y, uint16 b1x, uint16 b1y, uint16 b2x, uint16 b2y) {
diff --git a/engines/avalanche/shootemup.h b/engines/avalanche/shootemup.h
index 4c010aa..3cdcc1d 100644
--- a/engines/avalanche/shootemup.h
+++ b/engines/avalanche/shootemup.h
@@ -35,7 +35,7 @@ class ShootEmUp {
 public:
 	ShootEmUp(AvalancheEngine *vm);
 
-	void run();
+	uint16 run();
 
 private:
 	struct Sprite {
diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp
index 7b6e1ee..8a7ef9a 100644
--- a/engines/avalanche/timer.cpp
+++ b/engines/avalanche/timer.cpp
@@ -333,12 +333,11 @@ void Timer::hangAround2() {
 
 	// We don't need the ShootEmUp during the whole game, it's only playable once.
 	ShootEmUp *shootemup = new ShootEmUp(_vm);
-	shootemup->run();
+	_shootEmUpScore = shootemup->run();
 	delete shootemup;
 }
 
 void Timer::afterTheShootemup() {
-	// Only placed this here to replace the minigame. TODO: Remove it when the shoot em' up is implemented!
 	_vm->flipRoom(_vm->_room, 1);
 
 	_vm->_animation->_sprites[0]->init(0, true); // Avalot.
@@ -347,27 +346,17 @@ void Timer::afterTheShootemup() {
 	_vm->_objects[kObjectCrossbow - 1] = true;
 	_vm->refreshObjectList();
 
-	// Same as the added line above: TODO: Remove it later!!!
-	_vm->_dialogs->displayText(Common::String("P.S.: There should have been the mini-game called \"shoot em' up\", " \
-		"but I haven't implemented it yet: you get the crossbow automatically.") + kControlNewLine + kControlNewLine + "Peter (uruk)");
+	byte gain = (_shootEmUpScore + 5) / 10; // Rounding up.
 
-#if 0
-	byte shootscore, gain;
-
-	shootscore = mem[storage_seg * storage_ofs];
-	gain = (shootscore + 5) / 10; // Rounding up.
-
-	display(string("\6Your score was ") + strf(shootscore) + '.' + "\r\rYou gain (" +
-		strf(shootscore) + " 0xF6 10) = " + strf(gain) + " points.");
+	_vm->_dialogs->displayText(kControlItalic + Common::String("Your score was ") + Common::String::format("%d", _shootEmUpScore) + '.' + kControlNewLine + kControlNewLine + "You gain (" +
+		Common::String::format("%d", _shootEmUpScore) + " " + 0xF6 + " 10) = " + Common::String::format("%d", gain) + " points.");
 
 	if (gain > 20) {
-		display("But we won't let you have more than 20 points!");
-		points(20);
+		_vm->_dialogs->displayText("But we won't let you have more than 20 points!");
+		_vm->incScore(20);
 	} else
-		points(gain);
-#endif
+		_vm->incScore(gain);
 
-	warning("STUB: Timer::after_the_shootemup()");
 
 	_vm->_dialogs->displayScrollChain('Q', 70);
 }
@@ -712,6 +701,8 @@ void Timer::resetVariables() {
 		_times[i]._action = 0;
 		_times[i]._reason = 0;
 	}
+
+	_shootEmUpScore = 0;
 }
 
 } // End of namespace Avalanche.
diff --git a/engines/avalanche/timer.h b/engines/avalanche/timer.h
index fd51544..ad6ac0e 100644
--- a/engines/avalanche/timer.h
+++ b/engines/avalanche/timer.h
@@ -170,7 +170,7 @@ public:
 
 private:
 	AvalancheEngine *_vm;
-
+	byte _shootEmUpScore;
 };
 
 } // End of namespace Avalanche.






More information about the Scummvm-git-logs mailing list