HYPNO: show total score when you finish the arcade level of the spider demo

This commit is contained in:
neuromancer
2022-04-15 12:07:14 +02:00
parent 957c7ecb5a
commit e7fd575e79
2 changed files with 11 additions and 2 deletions
+8
View File
@@ -63,6 +63,14 @@ void SpiderEngine::runAfterArcade(ArcadeShooting *arc) {
assert(_score >= _bonus);
_score -= _bonus;
}
if (isDemo() && _restoredContentEnabled) {
if (_health == 0)
showScore("Spider-man was defeated!");
else
showScore("Spider-Man saved the day!");
_score = 0;
}
}
void SpiderEngine::initSegment(ArcadeShooting *arc) {
+3 -2
View File
@@ -1088,8 +1088,9 @@ void SpiderEngine::runGiveUp() {
}
void SpiderEngine::showScore(const Common::String prefix) {
Common::String message = Common::String::format("%s\n\
You finished the game with a score of %d points", prefix.c_str(), _score);
Common::String fmessage = "%s\nYou finished the ";
fmessage = fmessage + (isDemo() ? "demo" : "game") + " with a score of %d points";
Common::String message = Common::String::format(fmessage.c_str(), prefix.c_str(), _score);
GUI::MessageDialog dialog(message);
dialog.runModal();
}