[Scummvm-git-logs] scummvm master -> 8afe79e536a0549fdca09613b3ec3074e3e9ba98
neuromancer
noreply at scummvm.org
Fri Jun 3 11:04:47 UTC 2022
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
cff10e543d HYPNO: tweak message showing score in wet demos
8afe79e536 HYPNO: extra lives when reaching certain scores in wet
Commit: cff10e543d6a76190677ef4028af30b8d85b535e
https://github.com/scummvm/scummvm/commit/cff10e543d6a76190677ef4028af30b8d85b535e
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-06-03T13:03:27+02:00
Commit Message:
HYPNO: tweak message showing score in wet demos
Changed paths:
engines/hypno/wet/hard.cpp
diff --git a/engines/hypno/wet/hard.cpp b/engines/hypno/wet/hard.cpp
index d39866995bf..562e0a7256d 100644
--- a/engines/hypno/wet/hard.cpp
+++ b/engines/hypno/wet/hard.cpp
@@ -283,7 +283,7 @@ void WetEngine::runMainMenu(Code *code) {
}
void WetEngine::showDemoScore() {
- Common::String fmessage = "You finished the demo with an accuracy of %d%% and a score of %d points";
+ Common::String fmessage = "You finished this demo level with an accuracy of %d%% and a score of %d points";
Common::String message = Common::String::format(fmessage.c_str(), accuracyRatio(), _score);
GUI::MessageDialog dialog(message);
dialog.runModal();
Commit: 8afe79e536a0549fdca09613b3ec3074e3e9ba98
https://github.com/scummvm/scummvm/commit/8afe79e536a0549fdca09613b3ec3074e3e9ba98
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-06-03T13:03:27+02:00
Commit Message:
HYPNO: extra lives when reaching certain scores in wet
Changed paths:
engines/hypno/hypno.h
engines/hypno/wet/arcade.cpp
engines/hypno/wet/hard.cpp
engines/hypno/wet/wet.cpp
diff --git a/engines/hypno/hypno.h b/engines/hypno/hypno.h
index ca43f685c0b..8162d1f70eb 100644
--- a/engines/hypno/hypno.h
+++ b/engines/hypno/hypno.h
@@ -438,6 +438,11 @@ private:
void showDemoScore();
uint32 findPaletteIndexZones(uint32 id);
+ Common::List<int> _scoreMilestones;
+ void restoreScoreMilestones(int score);
+ bool checkScoreMilestones(int score);
+
+
Frames _c33PlayerCursor;
Common::Point _c33PlayerPosition;
Common::List<PlayerPosition> _c33PlayerDirection;
diff --git a/engines/hypno/wet/arcade.cpp b/engines/hypno/wet/arcade.cpp
index befa31d9260..531e43150bc 100644
--- a/engines/hypno/wet/arcade.cpp
+++ b/engines/hypno/wet/arcade.cpp
@@ -397,6 +397,7 @@ void WetEngine::runAfterArcade(ArcadeShooting *arc) {
uint32 c = kHypnoColorGreen; // green
int bonusCounter = 0;
int scoreCounter = _score - _bonus;
+ bool extraLife = false;
assert(scoreCounter >= 0);
bool skip = false;
Common::Event event;
@@ -438,6 +439,11 @@ void WetEngine::runAfterArcade(ArcadeShooting *arc) {
drawString("scifi08.fgx", Common::String::format("%-20s = %3d pts", "SCORE", scoreCounter), 60, 126, 0, c);
}
+ extraLife |= checkScoreMilestones(scoreCounter); // This increase the number of lives, if necessary
+ if (extraLife) {
+ drawString("scifi08.fgx", "EXTRA LIFE", 164, 140, 0, kHypnoColorRed);
+ }
+
drawScreen();
g_system->delayMillis(25);
}
@@ -451,6 +457,33 @@ void WetEngine::runAfterArcade(ArcadeShooting *arc) {
runIntro(video);
}
}
+void WetEngine::restoreScoreMilestones(int score) {
+ if (score == 0) {
+ _scoreMilestones.clear();
+ _scoreMilestones.push_back(10000);
+ _scoreMilestones.push_back(25000);
+ _scoreMilestones.push_back(50000);
+ _scoreMilestones.push_back(100000);
+ } else {
+ while (true) {
+ if (_scoreMilestones.empty() || score < *_scoreMilestones.begin())
+ break;
+ _scoreMilestones.pop_front();
+ }
+ }
+}
+
+bool WetEngine::checkScoreMilestones(int score) {
+ bool extraLife = false;
+ while (true) {
+ if (_scoreMilestones.empty() || score < *_scoreMilestones.begin())
+ break;
+ _scoreMilestones.pop_front();
+ _lives = _lives + 1;
+ extraLife = true;
+ }
+ return extraLife;
+}
uint32 WetEngine::findPaletteIndexZones(uint32 id) {
switch (id) {
diff --git a/engines/hypno/wet/hard.cpp b/engines/hypno/wet/hard.cpp
index 562e0a7256d..7231186dcf7 100644
--- a/engines/hypno/wet/hard.cpp
+++ b/engines/hypno/wet/hard.cpp
@@ -53,6 +53,7 @@ void WetEngine::runCheckLives(Code *code) {
_nextLevel = "<game_over>";
_score = 0;
_lives = 2;
+ restoreScoreMilestones(_score);
saveProfile(_name, _lastLevel);
} else
_nextLevel = _checkpoint;
diff --git a/engines/hypno/wet/wet.cpp b/engines/hypno/wet/wet.cpp
index dc220f8b582..306b05797cc 100644
--- a/engines/hypno/wet/wet.cpp
+++ b/engines/hypno/wet/wet.cpp
@@ -492,6 +492,7 @@ void WetEngine::loadAssetsFullGame() {
loadLib("", "c_misc/fonts.lib", true);
loadFonts();
loadLib("sound/", "c_misc/sound.lib", true);
+ restoreScoreMilestones(0);
_nextLevel = "<start>";
}
@@ -642,6 +643,7 @@ Common::Error WetEngine::loadGameStream(Common::SeekableReadStream *stream) {
else
_nextLevel = "<level_menu>";
+ restoreScoreMilestones(_score);
return Common::kNoError;
}
More information about the Scummvm-git-logs
mailing list