[Scummvm-git-logs] scummvm master -> 74516dc9143f2fe5d00c75b925a8f762b1591a93
neuromancer
noreply at scummvm.org
Fri Mar 4 11:59:31 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:
5377fc02d5 HYPNO: play specific enemy sound, if available
74516dc914 HYPNO: completable c40 level prototype in wet
Commit: 5377fc02d5529c5bd55164fe7179aae295b55f99
https://github.com/scummvm/scummvm/commit/5377fc02d5529c5bd55164fe7179aae295b55f99
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-03-04T12:59:27+01:00
Commit Message:
HYPNO: play specific enemy sound, if available
Changed paths:
engines/hypno/arcade.cpp
engines/hypno/grammar.h
engines/hypno/grammar_arc.cpp
engines/hypno/grammar_arc.y
diff --git a/engines/hypno/arcade.cpp b/engines/hypno/arcade.cpp
index e53b007ec57..62fdffd06de 100644
--- a/engines/hypno/arcade.cpp
+++ b/engines/hypno/arcade.cpp
@@ -410,8 +410,13 @@ void HypnoEngine::runArcade(ArcadeShooting *arc) {
s.lastFrame = s.bodyFrames[s.bodyFrames.size() - 1].lastFrame();
loadPalette(s.video->decoder->getPalette() + 3*s.paletteOffset, s.paletteOffset, s.paletteSize);
_shoots.push_back(s);
- if (!s.noEnemySound)
- playSound(_soundPath + arc->enemySound, 1);
+
+ if (!s.noEnemySound) {
+ if (!s.enemySound.empty())
+ playSound(_soundPath + s.enemySound, 1);
+ else if (!arc->enemySound.empty())
+ playSound(_soundPath + arc->enemySound, 1);
+ }
}
}
}
diff --git a/engines/hypno/grammar.h b/engines/hypno/grammar.h
index ed165519cfa..d30aa729f19 100644
--- a/engines/hypno/grammar.h
+++ b/engines/hypno/grammar.h
@@ -403,6 +403,7 @@ public:
uint32 paletteSize;
// Sounds
+ Filename enemySound;
Filename deathSound;
Filename hitSound;
diff --git a/engines/hypno/grammar_arc.cpp b/engines/hypno/grammar_arc.cpp
index d113b1128ea..c70677e0fa1 100644
--- a/engines/hypno/grammar_arc.cpp
+++ b/engines/hypno/grammar_arc.cpp
@@ -583,8 +583,8 @@ static const yytype_int16 yyrline[] =
261, 264, 265, 266, 269, 277, 282, 287, 291, 295,
299, 303, 307, 311, 315, 319, 323, 327, 331, 335,
339, 343, 347, 351, 355, 358, 362, 367, 371, 376,
- 381, 385, 391, 395, 398, 399, 402, 406, 409, 416,
- 419
+ 381, 385, 391, 395, 398, 399, 402, 406, 409, 418,
+ 421
};
#endif
@@ -1899,36 +1899,38 @@ yyreduce:
case 78: /* bline: SNTOK FILENAME enc */
#line 409 "engines/hypno/grammar_arc.y"
{
- if (Common::String("S1") == (yyvsp[-2].s))
+ if (Common::String("S0") == (yyvsp[-2].s))
+ shoot->enemySound = (yyvsp[-1].s);
+ else if (Common::String("S1") == (yyvsp[-2].s))
shoot->deathSound = (yyvsp[-1].s);
else if (Common::String("S2") == (yyvsp[-2].s))
shoot->hitSound = (yyvsp[-1].s);
debugC(1, kHypnoDebugParser, "SN %s", (yyvsp[-1].s)); }
-#line 1909 "engines/hypno/grammar_arc.cpp"
+#line 1911 "engines/hypno/grammar_arc.cpp"
break;
case 79: /* bline: NTOK */
-#line 416 "engines/hypno/grammar_arc.y"
+#line 418 "engines/hypno/grammar_arc.y"
{
shoot->noEnemySound = true;
debugC(1, kHypnoDebugParser, "N"); }
-#line 1917 "engines/hypno/grammar_arc.cpp"
+#line 1919 "engines/hypno/grammar_arc.cpp"
break;
case 80: /* bline: ZTOK */
-#line 419 "engines/hypno/grammar_arc.y"
+#line 421 "engines/hypno/grammar_arc.y"
{
g_parsedArc->shoots.push_back(*shoot);
//delete shoot;
//shoot = nullptr;
debugC(1, kHypnoDebugParser, "Z");
}
-#line 1928 "engines/hypno/grammar_arc.cpp"
+#line 1930 "engines/hypno/grammar_arc.cpp"
break;
-#line 1932 "engines/hypno/grammar_arc.cpp"
+#line 1934 "engines/hypno/grammar_arc.cpp"
default: break;
}
diff --git a/engines/hypno/grammar_arc.y b/engines/hypno/grammar_arc.y
index b21362b6ce7..71f3792a0fd 100644
--- a/engines/hypno/grammar_arc.y
+++ b/engines/hypno/grammar_arc.y
@@ -407,7 +407,9 @@ bline: FNTOK FILENAME {
debugC(1, kHypnoDebugParser, "L %d %d", $2, $3);
}
| SNTOK FILENAME enc {
- if (Common::String("S1") == $1)
+ if (Common::String("S0") == $1)
+ shoot->enemySound = $2;
+ else if (Common::String("S1") == $1)
shoot->deathSound = $2;
else if (Common::String("S2") == $1)
shoot->hitSound = $2;
Commit: 74516dc9143f2fe5d00c75b925a8f762b1591a93
https://github.com/scummvm/scummvm/commit/74516dc9143f2fe5d00c75b925a8f762b1591a93
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-03-04T12:59:27+01:00
Commit Message:
HYPNO: completable c40 level prototype in wet
Changed paths:
engines/hypno/hypno.h
engines/hypno/wet/arcade.cpp
engines/hypno/wet/wet.cpp
diff --git a/engines/hypno/hypno.h b/engines/hypno/hypno.h
index 5519e2f8f86..843c92b0e9f 100644
--- a/engines/hypno/hypno.h
+++ b/engines/hypno/hypno.h
@@ -323,6 +323,10 @@ private:
Common::BitArray _font05;
Common::BitArray _font08;
+ Common::Array<uint32> _c40SegmentPath;
+ Common::Array<uint32> _c40SegmentNext;
+ int _c40SegmentIdx;
+ int _c40lastTurn;
};
class SpiderEngine : public HypnoEngine {
diff --git a/engines/hypno/wet/arcade.cpp b/engines/hypno/wet/arcade.cpp
index 1da792cc9af..171475521ec 100644
--- a/engines/hypno/wet/arcade.cpp
+++ b/engines/hypno/wet/arcade.cpp
@@ -37,6 +37,23 @@ void WetEngine::initSegment(ArcadeShooting *arc) {
} else if (_arcadeMode == "Y5") {
_segmentShootSequenceOffset = 1;
_segmentShootSequenceMax = 9;
+ } else if (_arcadeMode == "Y4") {
+ _c40SegmentNext.clear();
+ _c40SegmentNext.push_back(2);
+ _c40SegmentPath.push_back(5);
+
+ _c40SegmentNext.push_back(6);
+ _c40SegmentPath.push_back(8);
+
+ _c40SegmentNext.push_back(15);
+ _c40SegmentPath.push_back(16);
+
+ _c40SegmentNext.push_back(26);
+ _c40SegmentIdx = 0;
+ _c40lastTurn = -1;
+
+ _segmentShootSequenceOffset = 0;
+ _segmentShootSequenceMax = 3;
} else {
_segmentShootSequenceOffset = 0;
_segmentShootSequenceMax = 0;
@@ -75,6 +92,8 @@ void WetEngine::findNextSegment(ArcadeShooting *arc) {
_segmentIdx = _segmentIdx + 1;
else
_segmentIdx = _segmentIdx + 5;
+ } else if (_arcadeMode == "Y4") {
+ _segmentIdx = _c40SegmentNext[_c40SegmentIdx];
} else if (_arcadeMode == "Y5") {
int r = _rnd->getRandomNumber(4);
if (r == 0)
@@ -107,7 +126,7 @@ void WetEngine::findNextSegment(ArcadeShooting *arc) {
_segmentIdx = _segmentIdx + 3;
else
_segmentIdx = _segmentIdx + 2;
- } else if (_arcadeMode == "Y5") {
+ } else if (_arcadeMode == "Y5" || _arcadeMode == "Y4") {
if (mousePos.x <= 100)
_segmentIdx = _segmentIdx + 2;
else if (mousePos.x >= 300)
@@ -115,7 +134,7 @@ void WetEngine::findNextSegment(ArcadeShooting *arc) {
else
_segmentIdx = _segmentIdx + 1;
} else
- error("Invalid segment type for mode: %s", _arcadeMode.c_str());
+ error("Invalid segment type for mode: %s at the end of segment %x", _arcadeMode.c_str(), segments[_segmentIdx].type);
} else if (segments[_segmentIdx].type == 0xc2) {
if (mousePos.x <= 160)
@@ -132,6 +151,11 @@ void WetEngine::findNextSegment(ArcadeShooting *arc) {
_segmentIdx = _segmentIdx + 2;
else
_segmentIdx = _segmentIdx + 1;
+
+ } else if (segments[_segmentIdx].type == 'a') {
+ _segmentIdx = 1;
+ } else if (segments[_segmentIdx].type == 's') {
+ _segmentIdx = 11;
} else {
// Objective checking
@@ -151,15 +175,35 @@ void WetEngine::findNextSegment(ArcadeShooting *arc) {
}
}
if (segments[_segmentIdx].type == 0xc9) {
- _segmentOffset = _segmentIdx + 1;
- _segmentShootSequenceOffset = 8;
- _segmentShootSequenceMax = 7;
+ if (_arcadeMode == "Y3") {
+ _segmentOffset = _segmentIdx + 1;
+ _segmentShootSequenceOffset = 8;
+ _segmentShootSequenceMax = 7;
+ } else if (_arcadeMode == "Y4") {
+ _segmentOffset = 13;
+ _segmentShootSequenceOffset = 1; // TODO
+ _segmentShootSequenceMax = 1; // TODO
+ } else
+ error("Invalid segment type for mode: %s at the end of segment %x", _arcadeMode.c_str(), segments[_segmentIdx].type);
} else if (segments[_segmentIdx].type == 0xbb) {
_segmentOffset = 0;
_segmentShootSequenceOffset = 0;
_segmentShootSequenceMax = 7;
}
+ if (_arcadeMode == "Y4") {
+ if (_c40SegmentPath[_c40SegmentIdx] == _segmentIdx) {
+ _c40SegmentIdx++;
+ } else {
+ if (_c40lastTurn == int(_segmentIdx))
+ _health = 0;
+ else {
+ // TODO: this should also add a barrier near the end
+ _c40lastTurn = int(_segmentIdx);
+ }
+ }
+ }
+
_segmentIdx = _segmentOffset;
// select a new shoot sequence
uint32 randomSegmentShootSequence = _segmentShootSequenceOffset + _rnd->getRandomNumber(_segmentShootSequenceMax);
diff --git a/engines/hypno/wet/wet.cpp b/engines/hypno/wet/wet.cpp
index 994b7d0f2e7..605fa258300 100644
--- a/engines/hypno/wet/wet.cpp
+++ b/engines/hypno/wet/wet.cpp
@@ -42,7 +42,7 @@ static const chapterEntry rawChapterTable[] = {
{42, {70, 160}, {180, 160}, {220, 185}}, // c42
{43, {70, 160}, {180, 160}, {220, 185}}, // c43
{44, {70, 160}, {180, 160}, {220, 185}}, // c44
- {40, {70, 160}, {180, 160}, {220, 185}}, // c40
+ {40, {19, 3}, {246, 3}, {246, 11}}, // c40
{51, {60, 167}, {190, 167}, {135, 187}}, // c51
{52, {60, 167}, {190, 167}, {135, 187}}, // c52
{50, {19, 3}, {246, 3}, {246, 11}}, // c50 (fixed)
@@ -56,6 +56,9 @@ WetEngine::WetEngine(OSystem *syst, const ADGameDescription *gd) : HypnoEngine(s
_screenH = 200;
_lives = 2;
+ _c40SegmentIdx = -1;
+ _c40lastTurn = -1;
+
const chapterEntry *entry = rawChapterTable;
while (entry->id) {
_chapterTable[entry->id] = entry;
More information about the Scummvm-git-logs
mailing list