[Scummvm-git-logs] scummvm master -> e4530e1b5553f647881e6785bd82d6e177d2e1f9

neuromancer noreply at scummvm.org
Sun Jan 2 10:09:34 UTC 2022


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:
e4530e1b55 HYPNO: implemented bus puzzle in hard mode


Commit: e4530e1b5553f647881e6785bd82d6e177d2e1f9
    https://github.com/scummvm/scummvm/commit/e4530e1b5553f647881e6785bd82d6e177d2e1f9
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-01-02T11:08:47+01:00

Commit Message:
HYPNO: implemented bus puzzle in hard mode

Changed paths:
    engines/hypno/actions.cpp
    engines/hypno/grammar_mis.cpp
    engines/hypno/grammar_mis.y
    engines/hypno/hypno.h
    engines/hypno/lexer_mis.cpp
    engines/hypno/spider/hard.cpp
    engines/hypno/spider/spider.cpp
    engines/hypno/tokens_mis.h


diff --git a/engines/hypno/actions.cpp b/engines/hypno/actions.cpp
index d9e18716591..9b8600f06d6 100644
--- a/engines/hypno/actions.cpp
+++ b/engines/hypno/actions.cpp
@@ -106,7 +106,7 @@ void HypnoEngine::runCutscene(Cutscene *a) {
 }
 
 bool HypnoEngine::runGlobal(Global *a) {
-	debugC(1, kHypnoDebugScene, "Runing global with command %s and variable %s", a->command.c_str(), a->variable.c_str());
+	debugC(1, kHypnoDebugScene, "Runing global with command '%s' and variable '%s'", a->command.c_str(), a->variable.c_str());
 	if (a->command == "TURNON")
 		_sceneState[a->variable] = 1;
 	else if (a->command == "TURNOFF")
@@ -121,6 +121,9 @@ bool HypnoEngine::runGlobal(Global *a) {
 		if (_sceneState[a->variable]) // Clear any video to play
 			_nextSequentialVideoToPlay.clear();
 		return !_sceneState[a->variable];
+	} else if (a->command == "CLEAR") {
+		resetSceneState();
+		return true;
 	} else
 		error("Invalid command %s", a->command.c_str());
 	return true;
diff --git a/engines/hypno/grammar_mis.cpp b/engines/hypno/grammar_mis.cpp
index e13002066a1..879ef374a01 100644
--- a/engines/hypno/grammar_mis.cpp
+++ b/engines/hypno/grammar_mis.cpp
@@ -71,7 +71,7 @@
 #define yychar          HYPNO_MIS_char
 
 /* Copy the first part of user declarations.  */
-#line 28 "engines/hypno/grammar_mis.y" /* yacc.c:339  */
+#line 27 "engines/hypno/grammar_mis.y" /* yacc.c:339  */
 
 
 #include "common/array.h"
@@ -199,7 +199,7 @@ extern int HYPNO_MIS_debug;
 
 union HYPNO_MIS_STYPE
 {
-#line 57 "engines/hypno/grammar_mis.y" /* yacc.c:355  */
+#line 56 "engines/hypno/grammar_mis.y" /* yacc.c:355  */
 
 	char *s; /* string value */
 	int i;	 /* integer value */
@@ -523,12 +523,12 @@ static const yytype_uint8 yytranslate[] =
   /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
 static const yytype_uint16 yyrline[] =
 {
-       0,    74,    74,    77,    84,    85,    89,   101,   107,   122,
-     128,   129,   130,   137,   144,   150,   156,   162,   169,   176,
-     183,   190,   196,   202,   205,   211,   217,   220,   221,   224,
-     231,   234,   235,   239,   242,   245,   249,   253,   258,   264,
-     265,   271,   277,   283,   290,   297,   303,   308,   309,   312,
-     313,   316,   317,   320,   321
+       0,    73,    73,    76,    83,    84,    88,   100,   106,   121,
+     127,   128,   129,   136,   143,   149,   155,   161,   168,   175,
+     182,   189,   195,   201,   204,   210,   216,   219,   220,   223,
+     230,   233,   234,   238,   241,   244,   248,   252,   257,   263,
+     264,   270,   276,   282,   289,   296,   302,   307,   308,   311,
+     312,   315,   316,   319,   320
 };
 #endif
 
@@ -1381,7 +1381,7 @@ yyreduce:
   switch (yyn)
     {
         case 3:
-#line 77 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
+#line 76 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
     { 
 	smenu_idx = new Common::Array<uint32>();
 	smenu_idx->push_back(-1);
@@ -1392,7 +1392,7 @@ yyreduce:
     break;
 
   case 6:
-#line 89 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
+#line 88 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
     {
 		Hotspot *hot = new Hotspot(MakeMenu, (yyvsp[-2].s)); 
 		debugC(1, kHypnoDebugParser, "MENU %s %s", (yyvsp[-2].s), (yyvsp[-1].s));
@@ -1409,7 +1409,7 @@ yyreduce:
     break;
 
   case 7:
-#line 101 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
+#line 100 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
     {  
 		Hotspot *hot = new Hotspot(MakeHotspot, "", Common::Rect((yyvsp[-3].i), (yyvsp[-2].i), (yyvsp[-1].i), (yyvsp[0].i))); 
 		debugC(1, kHypnoDebugParser, "HOTS %d.", hot->type);
@@ -1420,7 +1420,7 @@ yyreduce:
     break;
 
   case 8:
-#line 107 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
+#line 106 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
     { 
 		// This should always point to a hotspot
 		int idx = smenu_idx->back();
@@ -1434,13 +1434,13 @@ yyreduce:
 		smenu_idx->push_back(-1);
 		hot->smenu = new Hotspots();
 		stack->push_back(hot->smenu);
-		debugC(1, kHypnoDebugParser, "SUBMENU"); 
+		debugC(1, kHypnoDebugParser, "SUBMENU");
 	}
 #line 1440 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646  */
     break;
 
   case 9:
-#line 122 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
+#line 121 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
     {
 		Escape *a = new Escape();
 		Hotspots *cur = stack->back();
@@ -1451,19 +1451,19 @@ yyreduce:
     break;
 
   case 10:
-#line 128 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
+#line 127 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
     { debugC(1, kHypnoDebugParser, "TIME %d", (yyvsp[-1].i)); }
 #line 1457 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646  */
     break;
 
   case 11:
-#line 129 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
+#line 128 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
     { debugC(1, kHypnoDebugParser, "SWPT %d", (yyvsp[0].i)); }
 #line 1463 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646  */
     break;
 
   case 12:
-#line 130 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
+#line 129 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
     {
 		Background *a = new Background((yyvsp[-5].s), Common::Point((yyvsp[-4].i), (yyvsp[-3].i)), (yyvsp[-2].s), (yyvsp[-1].s), (yyvsp[0].s));
 		Hotspots *cur = stack->back();
@@ -1475,7 +1475,7 @@ yyreduce:
     break;
 
   case 13:
-#line 137 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
+#line 136 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
     { 
 		Global *a = new Global((yyvsp[-1].s), (yyvsp[0].s));
 		Hotspots *cur = stack->back();
@@ -1487,7 +1487,7 @@ yyreduce:
     break;
 
   case 14:
-#line 144 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
+#line 143 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
     { 
 		Ambient *a = new Ambient((yyvsp[-3].s), Common::Point((yyvsp[-2].i), (yyvsp[-1].i)), (yyvsp[0].s));
 		Hotspots *cur = stack->back();
@@ -1498,7 +1498,7 @@ yyreduce:
     break;
 
   case 15:
-#line 150 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
+#line 149 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
     { 
 		Play *a = new Play((yyvsp[-4].s), Common::Point((yyvsp[-3].i), (yyvsp[-2].i)), (yyvsp[-1].s), (yyvsp[0].s));
 		Hotspots *cur = stack->back();
@@ -1509,7 +1509,7 @@ yyreduce:
     break;
 
   case 16:
-#line 156 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
+#line 155 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
     { 
 		Overlay *a = new Overlay((yyvsp[-3].s), Common::Point((yyvsp[-2].i), (yyvsp[-1].i)), (yyvsp[0].s));
 		Hotspots *cur = stack->back();
@@ -1520,7 +1520,7 @@ yyreduce:
     break;
 
   case 17:
-#line 162 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
+#line 161 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
     {
 		Palette *a = new Palette((yyvsp[0].s));
 		Hotspots *cur = stack->back();
@@ -1532,7 +1532,7 @@ yyreduce:
     break;
 
   case 18:
-#line 169 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
+#line 168 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
     { 
 		Cutscene *a = new Cutscene(Common::String("cine/") + (yyvsp[-2].s));
 		Hotspots *cur = stack->back();
@@ -1544,7 +1544,7 @@ yyreduce:
     break;
 
   case 19:
-#line 176 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
+#line 175 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
     { 
 		Cutscene *a = new Cutscene(Common::String("cine/") + (yyvsp[0].s));
 		Hotspots *cur = stack->back();
@@ -1556,7 +1556,7 @@ yyreduce:
     break;
 
   case 20:
-#line 183 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
+#line 182 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
     { 
 		Cutscene *a = new Cutscene((yyvsp[0].s));
 		Hotspots *cur = stack->back();
@@ -1568,7 +1568,7 @@ yyreduce:
     break;
 
   case 21:
-#line 190 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
+#line 189 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
     { 
 		WalN *a = new WalN((yyvsp[-5].s), (yyvsp[-4].s), Common::Point((yyvsp[-3].i), (yyvsp[-2].i)), (yyvsp[-1].s), (yyvsp[0].s));
 		Hotspots *cur = stack->back();
@@ -1579,7 +1579,7 @@ yyreduce:
     break;
 
   case 22:
-#line 196 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
+#line 195 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
     {
 		Mice *a = new Mice((yyvsp[-1].s), (yyvsp[0].i)-1);
 		Hotspots *cur = stack->back();
@@ -1590,7 +1590,7 @@ yyreduce:
     break;
 
   case 23:
-#line 202 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
+#line 201 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
     {
 		debugC(1, kHypnoDebugParser, "MPTR %s %d %d %d %d %d", (yyvsp[-5].s), (yyvsp[-4].i), (yyvsp[-3].i), (yyvsp[-2].i), (yyvsp[-1].i), (yyvsp[0].i));
 	}
@@ -1598,7 +1598,7 @@ yyreduce:
     break;
 
   case 24:
-#line 205 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
+#line 204 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
     { 
 		Hotspots *cur = stack->back();
 		Hotspot *hot = &cur->back();
@@ -1609,7 +1609,7 @@ yyreduce:
     break;
 
   case 25:
-#line 211 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
+#line 210 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
     { 
 		debugC(1, kHypnoDebugParser, "explicit END");
 		g_parsedHots = stack->back();
@@ -1620,13 +1620,13 @@ yyreduce:
     break;
 
   case 26:
-#line 217 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
+#line 216 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
     { debugC(1, kHypnoDebugParser, "implicit END"); }
 #line 1626 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646  */
     break;
 
   case 29:
-#line 224 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
+#line 223 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
     { 
 	assert(talk_action == nullptr);
 	talk_action = new Talk();
@@ -1637,7 +1637,7 @@ yyreduce:
     break;
 
   case 30:
-#line 231 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
+#line 230 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
     {
 		talk_action->active = false; 
 		debugC(1, kHypnoDebugParser, "inactive"); }
@@ -1645,13 +1645,13 @@ yyreduce:
     break;
 
   case 31:
-#line 234 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
+#line 233 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
     { debugC(1, kHypnoDebugParser, "inactive"); }
 #line 1651 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646  */
     break;
 
   case 32:
-#line 235 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
+#line 234 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
     { 
 		talk_action->background = (yyvsp[-4].s);
 		talk_action->backgroundPos = Common::Point((yyvsp[-3].i), (yyvsp[-2].i));
@@ -1660,7 +1660,7 @@ yyreduce:
     break;
 
   case 33:
-#line 239 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
+#line 238 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
     {
 		talk_action->boxPos = Common::Point((yyvsp[-1].i), (yyvsp[0].i)); 
 		debugC(1, kHypnoDebugParser, "BOXX %d %d", (yyvsp[-1].i), (yyvsp[0].i)); }
@@ -1668,7 +1668,7 @@ yyreduce:
     break;
 
   case 34:
-#line 242 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
+#line 241 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
     {
 		talk_action->escape = true; 
 		debugC(1, kHypnoDebugParser, "ESCAPE"); }
@@ -1676,7 +1676,7 @@ yyreduce:
     break;
 
   case 35:
-#line 245 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
+#line 244 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
     {
 		talk_action->second = (yyvsp[-3].s);
 		talk_action->secondPos = Common::Point((yyvsp[-2].i), (yyvsp[-1].i)); 
@@ -1685,7 +1685,7 @@ yyreduce:
     break;
 
   case 36:
-#line 249 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
+#line 248 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
     { 
 		talk_action->intro = (yyvsp[-2].s);
 		talk_action->introPos = Common::Point((yyvsp[-1].i), (yyvsp[0].i));
@@ -1694,7 +1694,7 @@ yyreduce:
     break;
 
   case 37:
-#line 253 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
+#line 252 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
     { 
 		// Unsure how this is different from second
 		talk_action->second = (yyvsp[-2].s);
@@ -1704,7 +1704,7 @@ yyreduce:
     break;
 
   case 38:
-#line 258 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
+#line 257 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
     { 
 		TalkCommand talk_cmd;
 		talk_cmd.command = "G";
@@ -1715,13 +1715,13 @@ yyreduce:
     break;
 
   case 39:
-#line 264 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
+#line 263 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
     { debugC(1, kHypnoDebugParser, "%s", (yyvsp[-1].s)); }
 #line 1721 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646  */
     break;
 
   case 40:
-#line 265 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
+#line 264 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
     { 
 		TalkCommand talk_cmd;
 		talk_cmd.command = "F";
@@ -1732,7 +1732,7 @@ yyreduce:
     break;
 
   case 41:
-#line 271 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
+#line 270 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
     { 
 		TalkCommand talk_cmd;
 		talk_cmd.command = "A";
@@ -1743,7 +1743,7 @@ yyreduce:
     break;
 
   case 42:
-#line 277 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
+#line 276 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
     { 
 		TalkCommand talk_cmd;
 		talk_cmd.command = "D";
@@ -1754,7 +1754,7 @@ yyreduce:
     break;
 
   case 43:
-#line 283 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
+#line 282 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
     { 
 		TalkCommand talk_cmd;
 		talk_cmd.command = "P";
@@ -1766,7 +1766,7 @@ yyreduce:
     break;
 
   case 44:
-#line 290 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
+#line 289 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
     { 
 		TalkCommand talk_cmd;
 		talk_cmd.command = "I";
@@ -1778,7 +1778,7 @@ yyreduce:
     break;
 
   case 45:
-#line 297 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
+#line 296 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
     { 
 		TalkCommand talk_cmd;
 		talk_cmd.command = "S";
@@ -1789,7 +1789,7 @@ yyreduce:
     break;
 
   case 46:
-#line 303 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
+#line 302 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
     { 
 		TalkCommand talk_cmd;
 		talk_cmd.command = "L";
@@ -1799,43 +1799,43 @@ yyreduce:
     break;
 
   case 47:
-#line 308 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
+#line 307 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
     { debugC(1, kHypnoDebugParser, "|E"); }
 #line 1805 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646  */
     break;
 
   case 49:
-#line 312 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
+#line 311 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
     { (yyval.s) = (yyvsp[0].s); }
 #line 1811 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646  */
     break;
 
   case 50:
-#line 313 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
+#line 312 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
     { (yyval.s) = scumm_strdup(""); }
 #line 1817 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646  */
     break;
 
   case 51:
-#line 316 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
+#line 315 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
     { (yyval.s) = (yyvsp[0].s); debugC(1, kHypnoDebugParser, "flag: %s", (yyvsp[0].s)); }
 #line 1823 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646  */
     break;
 
   case 52:
-#line 317 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
+#line 316 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
     { (yyval.s) = scumm_strdup(""); }
 #line 1829 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646  */
     break;
 
   case 53:
-#line 320 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
+#line 319 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
     { (yyval.s) = (yyvsp[0].s); debugC(1, kHypnoDebugParser, "switch %s", (yyvsp[0].s)); }
 #line 1835 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646  */
     break;
 
   case 54:
-#line 321 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
+#line 320 "engines/hypno/grammar_mis.y" /* yacc.c:1646  */
     { (yyval.s) = scumm_strdup(""); }
 #line 1841 "engines/hypno/grammar_mis.cpp" /* yacc.c:1646  */
     break;
diff --git a/engines/hypno/grammar_mis.y b/engines/hypno/grammar_mis.y
index 631d634dfac..62e65c9cbdb 100644
--- a/engines/hypno/grammar_mis.y
+++ b/engines/hypno/grammar_mis.y
@@ -116,7 +116,7 @@ line: MENUTOK mflag mflag mflag {
 		smenu_idx->push_back(-1);
 		hot->smenu = new Hotspots();
 		stack->push_back(hot->smenu);
-		debugC(1, kHypnoDebugParser, "SUBMENU"); 
+		debugC(1, kHypnoDebugParser, "SUBMENU");
 	}
 	|  ESCPTOK  {
 		Escape *a = new Escape();
diff --git a/engines/hypno/hypno.h b/engines/hypno/hypno.h
index fb08beb0b69..f8e9b01903f 100644
--- a/engines/hypno/hypno.h
+++ b/engines/hypno/hypno.h
@@ -247,10 +247,10 @@ public:
 };
 
 struct chapterEntry {
-        int id;
-        int energyPos[2];
-		int scorePos[2];
-		int objectivesPos[2];
+	int id;
+	int energyPos[2];
+	int scorePos[2];
+	int objectivesPos[2];
 };
 
 class WetEngine : public HypnoEngine {
@@ -298,6 +298,8 @@ public:
 
 private:
 	void runMatrix(Code *code);
+	void addIngredient(Code *code);
+	void checkMixture(Code *code);
 	void runNote(Code *code);
 	void runFusePanel(Code *code);
 	void runRecept(Code *code);
@@ -308,6 +310,7 @@ private:
 
 	bool isFuseRust = true;
 	bool isFuseUnreadable = false;
+	bool ingredients[7] = {};
 };
 
 class BoyzEngine : public HypnoEngine {
diff --git a/engines/hypno/lexer_mis.cpp b/engines/hypno/lexer_mis.cpp
index 804a40af58a..ffde5dc99ff 100644
--- a/engines/hypno/lexer_mis.cpp
+++ b/engines/hypno/lexer_mis.cpp
@@ -873,7 +873,7 @@ char *yytext;
  *
  */
 #define YY_NO_INPUT 1
-#line 33 "engines/hypno/lexer_mis.l"
+#line 32 "engines/hypno/lexer_mis.l"
 #define YY_NO_UNISTD_H
 #define FORBIDDEN_SYMBOL_ALLOW_ALL
 
@@ -881,8 +881,8 @@ char *yytext;
 #include "hypno/grammar.h"
 #include "hypno/tokens_mis.h"
 
+#line 885 "engines/hypno/lexer_mis.cpp"
 #line 886 "engines/hypno/lexer_mis.cpp"
-#line 887 "engines/hypno/lexer_mis.cpp"
 
 #define INITIAL 0
 
@@ -1097,9 +1097,9 @@ YY_DECL
 		}
 
 	{
-#line 42 "engines/hypno/lexer_mis.l"
+#line 41 "engines/hypno/lexer_mis.l"
 
-#line 1104 "engines/hypno/lexer_mis.cpp"
+#line 1103 "engines/hypno/lexer_mis.cpp"
 
 	while ( /*CONSTCOND*/1 )		/* loops until end-of-file is reached */
 		{
@@ -1164,246 +1164,246 @@ do_action:	/* This label is used only to access EOF actions. */
 
 case 1:
 YY_RULE_SETUP
-#line 43 "engines/hypno/lexer_mis.l"
+#line 42 "engines/hypno/lexer_mis.l"
 /* return COMMENT; */
 	YY_BREAK
 case 2:
 YY_RULE_SETUP
-#line 44 "engines/hypno/lexer_mis.l"
+#line 43 "engines/hypno/lexer_mis.l"
 /* return COMMENT; */
 	YY_BREAK
 case 3:
 YY_RULE_SETUP
-#line 45 "engines/hypno/lexer_mis.l"
+#line 44 "engines/hypno/lexer_mis.l"
 return MENUTOK;
 	YY_BREAK
 case 4:
 YY_RULE_SETUP
-#line 46 "engines/hypno/lexer_mis.l"
+#line 45 "engines/hypno/lexer_mis.l"
 return AMBITOK;
 	YY_BREAK
 case 5:
 YY_RULE_SETUP
-#line 47 "engines/hypno/lexer_mis.l"
+#line 46 "engines/hypno/lexer_mis.l"
 return BACKTOK;
 	YY_BREAK
 case 6:
 YY_RULE_SETUP
-#line 48 "engines/hypno/lexer_mis.l"
+#line 47 "engines/hypno/lexer_mis.l"
 return CUTSTOK;
 	YY_BREAK
 case 7:
 YY_RULE_SETUP
-#line 49 "engines/hypno/lexer_mis.l"
+#line 48 "engines/hypno/lexer_mis.l"
 return GLOBTOK;
 	YY_BREAK
 case 8:
 YY_RULE_SETUP
-#line 50 "engines/hypno/lexer_mis.l"
+#line 49 "engines/hypno/lexer_mis.l"
 return PALETOK;
 	YY_BREAK
 case 9:
 YY_RULE_SETUP
-#line 51 "engines/hypno/lexer_mis.l"
+#line 50 "engines/hypno/lexer_mis.l"
 return HOTSTOK;
 	YY_BREAK
 case 10:
 YY_RULE_SETUP
-#line 52 "engines/hypno/lexer_mis.l"
+#line 51 "engines/hypno/lexer_mis.l"
 return MICETOK;
 	YY_BREAK
 case 11:
 YY_RULE_SETUP
-#line 53 "engines/hypno/lexer_mis.l"
+#line 52 "engines/hypno/lexer_mis.l"
 return ENDTOK;
 	YY_BREAK
 case 12:
 YY_RULE_SETUP
-#line 54 "engines/hypno/lexer_mis.l"
+#line 53 "engines/hypno/lexer_mis.l"
 return TIMETOK;
 	YY_BREAK
 case 13:
 YY_RULE_SETUP
-#line 55 "engines/hypno/lexer_mis.l"
+#line 54 "engines/hypno/lexer_mis.l"
 return OVERTOK;
 	YY_BREAK
 case 14:
 YY_RULE_SETUP
-#line 56 "engines/hypno/lexer_mis.l"
+#line 55 "engines/hypno/lexer_mis.l"
 return SMENTOK;
 	YY_BREAK
 case 15:
 YY_RULE_SETUP
-#line 57 "engines/hypno/lexer_mis.l"
+#line 56 "engines/hypno/lexer_mis.l"
 return ESCPTOK;
 	YY_BREAK
 case 16:
 YY_RULE_SETUP
-#line 58 "engines/hypno/lexer_mis.l"
+#line 57 "engines/hypno/lexer_mis.l"
 return PLAYTOK;
 	YY_BREAK
 case 17:
 YY_RULE_SETUP
-#line 59 "engines/hypno/lexer_mis.l"
+#line 58 "engines/hypno/lexer_mis.l"
 return TALKTOK;
 	YY_BREAK
 case 18:
 YY_RULE_SETUP
-#line 60 "engines/hypno/lexer_mis.l"
+#line 59 "engines/hypno/lexer_mis.l"
 return INACTOK;
 	YY_BREAK
 case 19:
 YY_RULE_SETUP
-#line 61 "engines/hypno/lexer_mis.l"
+#line 60 "engines/hypno/lexer_mis.l"
 return FDTOK;
 	YY_BREAK
 case 20:
 YY_RULE_SETUP
-#line 62 "engines/hypno/lexer_mis.l"
+#line 61 "engines/hypno/lexer_mis.l"
 return BOXXTOK;
 	YY_BREAK
 case 21:
 YY_RULE_SETUP
-#line 63 "engines/hypno/lexer_mis.l"
+#line 62 "engines/hypno/lexer_mis.l"
 return MPTRTOK;
 	YY_BREAK
 case 22:
 YY_RULE_SETUP
-#line 64 "engines/hypno/lexer_mis.l"
+#line 63 "engines/hypno/lexer_mis.l"
 return ESCAPETOK;
 	YY_BREAK
 case 23:
 YY_RULE_SETUP
-#line 65 "engines/hypno/lexer_mis.l"
+#line 64 "engines/hypno/lexer_mis.l"
 return SECONDTOK;
 	YY_BREAK
 case 24:
 YY_RULE_SETUP
-#line 66 "engines/hypno/lexer_mis.l"
+#line 65 "engines/hypno/lexer_mis.l"
 return INTROTOK;
 	YY_BREAK
 case 25:
 YY_RULE_SETUP
-#line 67 "engines/hypno/lexer_mis.l"
+#line 66 "engines/hypno/lexer_mis.l"
 return INTRTOK;
 	YY_BREAK
 case 26:
 YY_RULE_SETUP
-#line 68 "engines/hypno/lexer_mis.l"
+#line 67 "engines/hypno/lexer_mis.l"
 return SWPTTOK;
 	YY_BREAK
 case 27:
 YY_RULE_SETUP
-#line 69 "engines/hypno/lexer_mis.l"
+#line 68 "engines/hypno/lexer_mis.l"
 return DEFAULTTOK;
 	YY_BREAK
 case 28:
 YY_RULE_SETUP
-#line 70 "engines/hypno/lexer_mis.l"
+#line 69 "engines/hypno/lexer_mis.l"
 HYPNO_MIS_lval.s = scumm_strdup(HYPNO_MIS_text); return WALNTOK;
 	YY_BREAK
 case 29:
 YY_RULE_SETUP
-#line 71 "engines/hypno/lexer_mis.l"
+#line 70 "engines/hypno/lexer_mis.l"
 HYPNO_MIS_lval.s = scumm_strdup(HYPNO_MIS_text); return PS;
 	YY_BREAK
 case 30:
 YY_RULE_SETUP
-#line 72 "engines/hypno/lexer_mis.l"
+#line 71 "engines/hypno/lexer_mis.l"
 HYPNO_MIS_lval.s = scumm_strdup(HYPNO_MIS_text); return PG;
 	YY_BREAK
 case 31:
 YY_RULE_SETUP
-#line 73 "engines/hypno/lexer_mis.l"
+#line 72 "engines/hypno/lexer_mis.l"
 HYPNO_MIS_lval.s = scumm_strdup(HYPNO_MIS_text); return PP;
 	YY_BREAK
 case 32:
 YY_RULE_SETUP
-#line 74 "engines/hypno/lexer_mis.l"
+#line 73 "engines/hypno/lexer_mis.l"
 HYPNO_MIS_lval.s = scumm_strdup(HYPNO_MIS_text); return PI;
 	YY_BREAK
 case 33:
 YY_RULE_SETUP
-#line 75 "engines/hypno/lexer_mis.l"
+#line 74 "engines/hypno/lexer_mis.l"
 HYPNO_MIS_lval.s = scumm_strdup(HYPNO_MIS_text); return PH;
 	YY_BREAK
 case 34:
 YY_RULE_SETUP
-#line 76 "engines/hypno/lexer_mis.l"
+#line 75 "engines/hypno/lexer_mis.l"
 HYPNO_MIS_lval.s = scumm_strdup(HYPNO_MIS_text); return PA;
 	YY_BREAK
 case 35:
 YY_RULE_SETUP
-#line 77 "engines/hypno/lexer_mis.l"
+#line 76 "engines/hypno/lexer_mis.l"
 HYPNO_MIS_lval.s = scumm_strdup(HYPNO_MIS_text); return PD;
 	YY_BREAK
 case 36:
 YY_RULE_SETUP
-#line 78 "engines/hypno/lexer_mis.l"
+#line 77 "engines/hypno/lexer_mis.l"
 HYPNO_MIS_lval.s = scumm_strdup(HYPNO_MIS_text); return PF;
 	YY_BREAK
 case 37:
 YY_RULE_SETUP
-#line 79 "engines/hypno/lexer_mis.l"
+#line 78 "engines/hypno/lexer_mis.l"
 return PE;
 	YY_BREAK
 case 38:
 YY_RULE_SETUP
-#line 80 "engines/hypno/lexer_mis.l"
+#line 79 "engines/hypno/lexer_mis.l"
 return PL;
 	YY_BREAK
 case 39:
 YY_RULE_SETUP
-#line 81 "engines/hypno/lexer_mis.l"
+#line 80 "engines/hypno/lexer_mis.l"
 HYPNO_MIS_lval.s = scumm_strdup(HYPNO_MIS_text); return GSSWITCH;
 	YY_BREAK
 case 40:
 YY_RULE_SETUP
-#line 82 "engines/hypno/lexer_mis.l"
+#line 81 "engines/hypno/lexer_mis.l"
 return BBOXTOK;
 	YY_BREAK
 case 41:
 YY_RULE_SETUP
-#line 83 "engines/hypno/lexer_mis.l"
+#line 82 "engines/hypno/lexer_mis.l"
 HYPNO_MIS_lval.s = scumm_strdup(HYPNO_MIS_text); return FLAG;
 	YY_BREAK
 case 42:
 YY_RULE_SETUP
-#line 84 "engines/hypno/lexer_mis.l"
+#line 83 "engines/hypno/lexer_mis.l"
 HYPNO_MIS_lval.s = scumm_strdup(HYPNO_MIS_text); return NAME;
 	YY_BREAK
 case 43:
 YY_RULE_SETUP
-#line 85 "engines/hypno/lexer_mis.l"
+#line 84 "engines/hypno/lexer_mis.l"
 HYPNO_MIS_lval.s = scumm_strdup(HYPNO_MIS_text); return FILENAME;
 	YY_BREAK
 case 44:
 YY_RULE_SETUP
-#line 86 "engines/hypno/lexer_mis.l"
+#line 85 "engines/hypno/lexer_mis.l"
 HYPNO_MIS_lval.i = atoi(HYPNO_MIS_text); return NUM;
 	YY_BREAK
 case 45:
 /* rule 45 can match eol */
 YY_RULE_SETUP
-#line 87 "engines/hypno/lexer_mis.l"
+#line 86 "engines/hypno/lexer_mis.l"
 return RETTOK;
 	YY_BREAK
 case 46:
 YY_RULE_SETUP
-#line 88 "engines/hypno/lexer_mis.l"
+#line 87 "engines/hypno/lexer_mis.l"
 /* ignore whitespace */;
 	YY_BREAK
 case 47:
 YY_RULE_SETUP
-#line 89 "engines/hypno/lexer_mis.l"
+#line 88 "engines/hypno/lexer_mis.l"
 debugC(1, Hypno::kHypnoDebugParser, "<no match: %c>", *yytext); return *yytext;
 	YY_BREAK
 case 48:
 YY_RULE_SETUP
-#line 90 "engines/hypno/lexer_mis.l"
+#line 89 "engines/hypno/lexer_mis.l"
 ECHO;
 	YY_BREAK
-#line 1408 "engines/hypno/lexer_mis.cpp"
+#line 1407 "engines/hypno/lexer_mis.cpp"
 case YY_STATE_EOF(INITIAL):
 	yyterminate();
 
@@ -2380,7 +2380,7 @@ void yyfree (void * ptr )
 
 #define YYTABLES_NAME "yytables"
 
-#line 90 "engines/hypno/lexer_mis.l"
+#line 89 "engines/hypno/lexer_mis.l"
 
 
 namespace Hypno {
diff --git a/engines/hypno/spider/hard.cpp b/engines/hypno/spider/hard.cpp
index e4d5aca352d..f12f8a0e8cd 100644
--- a/engines/hypno/spider/hard.cpp
+++ b/engines/hypno/spider/hard.cpp
@@ -28,6 +28,10 @@ namespace Hypno {
 void SpiderEngine::runCode(Code *code) {
 	if (code->name == "<puz_matr>")
 		runMatrix(code);
+	else if (code->name == "<add_ingredient>")
+		addIngredient(code);
+	else if (code->name == "<check_mixture>")
+		checkMixture(code);
 	else if (code->name == "<note>")
 		runNote(code);
 	else if (code->name == "<fuse_panel>")
@@ -147,6 +151,56 @@ void SpiderEngine::runMatrix(Code *code) {
 	}
 }
 
+void SpiderEngine::addIngredient(Code *code) {
+	if (_sceneState["GS_SWITCH0"]) { // wrong ingredient
+		ingredients[0] = true;
+	} else if (_sceneState["GS_SWITCH1"]) {
+		ingredients[1] = true;
+	} else if (_sceneState["GS_SWITCH2"]) {
+		ingredients[2] = true;
+	} else if (_sceneState["GS_SWITCH3"]) {
+		ingredients[3] = true;
+	} else if (_sceneState["GS_SWITCH4"]) {
+		ingredients[4] = true;
+	} else if (_sceneState["GS_SWITCH5"]) {
+		ingredients[5] = true;
+	} else if (_sceneState["GS_SWITCH6"]) {
+		ingredients[6] = true;
+	}
+	resetSceneState();
+	_nextLevel = "bushard2.mi_";
+}
+
+void SpiderEngine::checkMixture(Code *code) {
+	_nextLevel = "bushard2.mi_";
+	if (ingredients[0]) {
+		MVideo video("spider/cine/blcs005s.smk", Common::Point(0, 0), false, true, false);
+		runIntro(video);
+		memset(ingredients, 0, 7);
+		return;
+	}
+
+	bool nothing = true;
+	for (int i = 1; i < 7; i++) {
+		if (ingredients[i])
+			nothing = false;
+	}
+
+	if (nothing)
+		return;
+
+	for (int i = 1; i < 7; i++) {
+		if (!ingredients[i]) {
+			MVideo video("spider/cine/blcs005s.smk", Common::Point(0, 0), false, true, false);
+			runIntro(video);
+			memset(ingredients, 0, 7);
+			return;
+		}
+	}
+	_nextLevel = "<after_bus_hard>";
+}
+
+
 void SpiderEngine::runNote(Code *code) {
 	const char alphaES[] = "abcdefghijklmnopqrstuvwxyz~";
 	const char alphaEN[] = "abcdefghijklmnopqrstuvwxyz";
diff --git a/engines/hypno/spider/spider.cpp b/engines/hypno/spider/spider.cpp
index 0b8296026e3..b8815f4e28e 100644
--- a/engines/hypno/spider/spider.cpp
+++ b/engines/hypno/spider/spider.cpp
@@ -243,33 +243,119 @@ void SpiderEngine::loadAssetsFullGame() {
 
 	// Transitions
 	Transition *trans_apt_1 = new Transition("busint.mi_");
-	trans_apt_1->frameImage = "spider/cine/blcs00.smk";
-	trans_apt_1->frameNumber = 0;
 	trans_apt_1->intros.push_back("spider/cine/ross004s.smk");
 	trans_apt_1->intros.push_back("spider/cine/apts002s.smk");
+	trans_apt_1->intros.push_back("spider/cine/blcs00.smk");
 	_levels["<trans_apt_1>"] = trans_apt_1;
 
 	Transition *trans_apt_2 = new Transition("busint.mi_");
-	trans_apt_2->frameImage = "spider/cine/blcs00.smk";
-	trans_apt_2->frameNumber = 0;
 	trans_apt_2->intros.push_back("spider/cine/dia002s.smk");
 	trans_apt_2->intros.push_back("spider/cine/apts004s.smk");
+	trans_apt_1->intros.push_back("spider/cine/blcs00.smk");
 	_levels["<trans_apt_2>"] = trans_apt_2;
 
-	loadSceneLevel("busint.mi_", "busintro.mi_", prefix);
-	loadSceneLevel("busintro.mi_", "<bus_selector>", prefix);
+	loadSceneLevel("busint.mi_", "<bus_selector>", prefix);
+	loadSceneLevel("busintro.mi_", "buspuz.mi_", prefix);
+	_levels["busintro.mi_"]->intros.push_back("cine/blcs00a.smk");
 	_levels["busintro.mi_"]->intros.push_back("cine/blcs001s.smk");
 
-	Transition *bus_selector = new Transition("buspuz.mi_", "bushard1.mi_");
+	Transition *bus_selector = new Transition("busintro.mi_", "<bus_hard_intro>");
 	_levels["<bus_selector>"] = bus_selector;
 
-	loadSceneLevel("bushard1.mi_", "bushard1.mi_", prefix);
-	loadSceneLevel("bushard2.mi_", "<after_bus_selector>", prefix);
+	Transition *bus_hard_intro = new Transition("bushard2.mi_");
+	bus_hard_intro->intros.push_back("spider/cine/blcs00a.smk");
+	bus_hard_intro->intros.push_back("spider/cine/blcs001s.smk");
+	bus_hard_intro->intros.push_back("spider/cine/ppv001s.smk");
+	_levels["<bus_hard_intro>"] = bus_hard_intro;
 
-	loadSceneLevel("buspuz.mi_", "<after_bus_selector>", prefix);
+	Code *add_ingredient = new Code();
+	add_ingredient->name = "<add_ingredient>";
+	_levels["<add_ingredient>"] = add_ingredient;
 
-	Transition *after_bus_selector = new Transition("<after_bus_easy>", "<after_bus_hard>");
-	_levels["<after_bus_selector>"] = after_bus_selector;
+	Code *check_mixture = new Code();
+	check_mixture->name = "<check_mixture>";
+	_levels["<check_mixture>"] = check_mixture;
+
+	loadSceneLevel("bushard2.mi_", "", prefix);
+	sc = (Scene *) _levels["bushard2.mi_"];
+	Escape *escape = new Escape();
+
+	Hotspots *hs = sc->hots[1].smenu;
+	(*hs)[1].actions.push_back(escape);
+
+	cl = new ChangeLevel("<check_mixture>");
+	sc->hots[2].actions.push_back(cl);
+
+	cl = new ChangeLevel("<add_ingredient>");
+	sc->hots[3].actions.push_back(cl);
+
+	gl = new Global("", "CLEAR"); 
+	sc->hots[4].actions.push_back(gl);
+
+	gl = new Global("GS_SWITCH1", "TURNON"); // hairspray
+	sc->hots[4].actions.push_back(gl);
+
+	gl = new Global("", "CLEAR");
+	sc->hots[5].actions.push_back(gl);
+
+	gl = new Global("GS_SWITCH2", "TURNON"); // spot remover
+	sc->hots[5].actions.push_back(gl);
+
+	gl = new Global("", "CLEAR");
+	sc->hots[6].actions.push_back(gl);
+
+	gl = new Global("GS_SWITCH3", "TURNON"); // rubbing alcohol
+	sc->hots[6].actions.push_back(gl);
+
+	gl = new Global("", "CLEAR");
+	sc->hots[7].actions.push_back(gl);
+
+	gl = new Global("GS_SWITCH4", "TURNON"); // turpentine
+	sc->hots[7].actions.push_back(gl);
+
+	gl = new Global("", "CLEAR");
+	sc->hots[8].actions.push_back(gl);
+
+	gl = new Global("GS_SWITCH5", "TURNON"); // spray paint
+	sc->hots[8].actions.push_back(gl);
+
+	gl = new Global("", "CLEAR");
+	sc->hots[9].actions.push_back(gl);
+
+	gl = new Global("GS_SWITCH0", "TURNON"); // other
+	sc->hots[9].actions.push_back(gl);
+
+	gl = new Global("", "CLEAR");
+	sc->hots[10].actions.push_back(gl);
+
+	gl = new Global("GS_SWITCH0", "TURNON"); // other
+	sc->hots[10].actions.push_back(gl);
+
+	gl = new Global("", "CLEAR");
+	sc->hots[11].actions.push_back(gl);
+
+	gl = new Global("GS_SWITCH0", "TURNON"); // other
+	sc->hots[11].actions.push_back(gl);
+
+	gl = new Global("", "CLEAR");
+	sc->hots[12].actions.push_back(gl);
+
+	gl = new Global("GS_SWITCH6", "TURNON"); // fingernail polish
+	sc->hots[12].actions.push_back(gl);
+
+	gl = new Global("", "CLEAR");
+	sc->hots[13].actions.push_back(gl);
+
+	gl = new Global("GS_SWITCH0", "TURNON"); // other
+	sc->hots[13].actions.push_back(gl);
+
+	gl = new Global("", "CLEAR");
+	sc->hots[14].actions.push_back(gl);
+
+	gl = new Global("GS_SWITCH0", "TURNON"); // other
+	sc->hots[14].actions.push_back(gl);
+
+	loadSceneLevel("buspuz.mi_", "<after_bus_easy>", prefix);
 
 	Transition *after_bus_easy = new Transition("decide3.mi_");
 	after_bus_easy->intros.push_back("spider/cine/blcs003s.smk");
diff --git a/engines/hypno/tokens_mis.h b/engines/hypno/tokens_mis.h
index 61417f36dec..51b999bc603 100644
--- a/engines/hypno/tokens_mis.h
+++ b/engines/hypno/tokens_mis.h
@@ -109,7 +109,7 @@ extern int HYPNO_MIS_debug;
 
 union HYPNO_MIS_STYPE
 {
-#line 57 "engines/hypno/grammar_mis.y" /* yacc.c:1909  */
+#line 56 "engines/hypno/grammar_mis.y" /* yacc.c:1909  */
 
 	char *s; /* string value */
 	int i;	 /* integer value */




More information about the Scummvm-git-logs mailing list