rnd-20050129-1-src
authorHolger Schemel <info@artsoft.org>
Sat, 29 Jan 2005 00:37:37 +0000 (01:37 +0100)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:48:44 +0000 (10:48 +0200)
src/conf_e2g.c
src/conf_esg.c
src/conf_gfx.c
src/conf_gfx.h
src/conftime.h
src/editor.c
src/game.c
src/init.c
src/main.c
src/main.h
src/tools.c

index c9d7769dc50ec8bc58cc342e24f78ce2def31437..e98182ce520ce4d68c0e7ddb338bed4e63c76545 100644 (file)
@@ -2610,52 +2610,52 @@ element_to_graphic[] =
     IMG_TRIGGER_PLAYER
   },
   {
-    EL_EM_KEY_5,                       -1, -1, FALSE,
-    IMG_EM_KEY_5
+    EL_EMC_KEY_5,                      -1, -1, FALSE,
+    IMG_EMC_KEY_5
   },
   {
-    EL_EM_KEY_6,                       -1, -1, FALSE,
-    IMG_EM_KEY_6
+    EL_EMC_KEY_6,                      -1, -1, FALSE,
+    IMG_EMC_KEY_6
   },
   {
-    EL_EM_KEY_7,                       -1, -1, FALSE,
-    IMG_EM_KEY_7
+    EL_EMC_KEY_7,                      -1, -1, FALSE,
+    IMG_EMC_KEY_7
   },
   {
-    EL_EM_KEY_8,                       -1, -1, FALSE,
-    IMG_EM_KEY_8
+    EL_EMC_KEY_8,                      -1, -1, FALSE,
+    IMG_EMC_KEY_8
   },
   {
-    EL_EM_GATE_5,                      -1, -1, FALSE,
-    IMG_EM_GATE_5
+    EL_EMC_GATE_5,                     -1, -1, FALSE,
+    IMG_EMC_GATE_5
   },
   {
-    EL_EM_GATE_5_GRAY,                 -1, -1, FALSE,
-    IMG_EM_GATE_5_GRAY
+    EL_EMC_GATE_5_GRAY,                        -1, -1, FALSE,
+    IMG_EMC_GATE_5_GRAY
   },
   {
-    EL_EM_GATE_6,                      -1, -1, FALSE,
-    IMG_EM_GATE_6
+    EL_EMC_GATE_6,                     -1, -1, FALSE,
+    IMG_EMC_GATE_6
   },
   {
-    EL_EM_GATE_6_GRAY,                 -1, -1, FALSE,
-    IMG_EM_GATE_6_GRAY
+    EL_EMC_GATE_6_GRAY,                        -1, -1, FALSE,
+    IMG_EMC_GATE_6_GRAY
   },
   {
-    EL_EM_GATE_7,                      -1, -1, FALSE,
-    IMG_EM_GATE_7
+    EL_EMC_GATE_7,                     -1, -1, FALSE,
+    IMG_EMC_GATE_7
   },
   {
-    EL_EM_GATE_7_GRAY,                 -1, -1, FALSE,
-    IMG_EM_GATE_7_GRAY
+    EL_EMC_GATE_7_GRAY,                        -1, -1, FALSE,
+    IMG_EMC_GATE_7_GRAY
   },
   {
-    EL_EM_GATE_8,                      -1, -1, FALSE,
-    IMG_EM_GATE_8
+    EL_EMC_GATE_8,                     -1, -1, FALSE,
+    IMG_EMC_GATE_8
   },
   {
-    EL_EM_GATE_8_GRAY,                 -1, -1, FALSE,
-    IMG_EM_GATE_8_GRAY
+    EL_EMC_GATE_8_GRAY,                        -1, -1, FALSE,
+    IMG_EMC_GATE_8_GRAY
   },
   {
     EL_EMC_ANDROID,                    -1, -1, FALSE,
index 112de8810d5800b338acdeef785937ffb8659dbe..7ddf0510a8298f60f40d368254228eaea68551c7 100644 (file)
@@ -312,20 +312,20 @@ element_to_special_graphic[] =
     IMG_INVISIBLE_STEELWALL_VERTICAL_EDITOR
   },
   {
-    EL_EM_GATE_5_GRAY,                         GFX_SPECIAL_ARG_EDITOR,
-    IMG_EM_GATE_5_GRAY_EDITOR
+    EL_EMC_GATE_5_GRAY,                                GFX_SPECIAL_ARG_EDITOR,
+    IMG_EMC_GATE_5_GRAY_EDITOR
   },
   {
-    EL_EM_GATE_6_GRAY,                         GFX_SPECIAL_ARG_EDITOR,
-    IMG_EM_GATE_6_GRAY_EDITOR
+    EL_EMC_GATE_6_GRAY,                                GFX_SPECIAL_ARG_EDITOR,
+    IMG_EMC_GATE_6_GRAY_EDITOR
   },
   {
-    EL_EM_GATE_7_GRAY,                         GFX_SPECIAL_ARG_EDITOR,
-    IMG_EM_GATE_7_GRAY_EDITOR
+    EL_EMC_GATE_7_GRAY,                                GFX_SPECIAL_ARG_EDITOR,
+    IMG_EMC_GATE_7_GRAY_EDITOR
   },
   {
-    EL_EM_GATE_8_GRAY,                         GFX_SPECIAL_ARG_EDITOR,
-    IMG_EM_GATE_8_GRAY_EDITOR
+    EL_EMC_GATE_8_GRAY,                                GFX_SPECIAL_ARG_EDITOR,
+    IMG_EMC_GATE_8_GRAY_EDITOR
   },
   {
     EL_EMC_DRIPPER,                            GFX_SPECIAL_ARG_EDITOR,
index f02df8f744b7e23cfdaad661ec424cf9ebea3f95..244b2940e82b30990f4e9538b3c4450a86cd3498 100644 (file)
@@ -3283,71 +3283,71 @@ struct ConfigInfo image_config[] =
   { "trigger_player.ypos",                     "13"                    },
   { "trigger_player.frames",                   "1"                     },
 
-  { "em_key_5",                                        "RocksEMC.pcx"          },
-  { "em_key_5.xpos",                           "0"                     },
-  { "em_key_5.ypos",                           "5"                     },
-  { "em_key_5.frames",                         "1"                     },
-  { "em_key_6",                                        "RocksEMC.pcx"          },
-  { "em_key_6.xpos",                           "1"                     },
-  { "em_key_6.ypos",                           "5"                     },
-  { "em_key_6.frames",                         "1"                     },
-  { "em_key_7",                                        "RocksEMC.pcx"          },
-  { "em_key_7.xpos",                           "2"                     },
-  { "em_key_7.ypos",                           "5"                     },
-  { "em_key_7.frames",                         "1"                     },
-  { "em_key_8",                                        "RocksEMC.pcx"          },
-  { "em_key_8.xpos",                           "3"                     },
-  { "em_key_8.ypos",                           "5"                     },
-  { "em_key_8.frames",                         "1"                     },
-
-  { "em_gate_5",                               "RocksEMC.pcx"          },
-  { "em_gate_5.xpos",                          "0"                     },
-  { "em_gate_5.ypos",                          "6"                     },
-  { "em_gate_5.frames",                                "1"                     },
-  { "em_gate_5_gray",                          "RocksEMC.pcx"          },
-  { "em_gate_5_gray.xpos",                     "4"                     },
-  { "em_gate_5_gray.ypos",                     "7"                     },
-  { "em_gate_5_gray.frames",                   "1"                     },
-  { "em_gate_5_gray.EDITOR",                   "RocksEMC.pcx"          },
-  { "em_gate_5_gray.EDITOR.xpos",              "0"                     },
-  { "em_gate_5_gray.EDITOR.ypos",              "7"                     },
-  { "em_gate_5_gray.EDITOR.frames",            "1"                     },
-  { "em_gate_6",                               "RocksEMC.pcx"          },
-  { "em_gate_6.xpos",                          "1"                     },
-  { "em_gate_6.ypos",                          "6"                     },
-  { "em_gate_6.frames",                                "1"                     },
-  { "em_gate_6_gray",                          "RocksEMC.pcx"          },
-  { "em_gate_6_gray.xpos",                     "4"                     },
-  { "em_gate_6_gray.ypos",                     "7"                     },
-  { "em_gate_6_gray.frames",                   "1"                     },
-  { "em_gate_6_gray.EDITOR",                   "RocksEMC.pcx"          },
-  { "em_gate_6_gray.EDITOR.xpos",              "1"                     },
-  { "em_gate_6_gray.EDITOR.ypos",              "7"                     },
-  { "em_gate_6_gray.EDITOR.frames",            "1"                     },
-  { "em_gate_7",                               "RocksEMC.pcx"          },
-  { "em_gate_7.xpos",                          "2"                     },
-  { "em_gate_7.ypos",                          "6"                     },
-  { "em_gate_7.frames",                                "1"                     },
-  { "em_gate_7_gray",                          "RocksEMC.pcx"          },
-  { "em_gate_7_gray.xpos",                     "4"                     },
-  { "em_gate_7_gray.ypos",                     "7"                     },
-  { "em_gate_7_gray.frames",                   "1"                     },
-  { "em_gate_7_gray.EDITOR",                   "RocksEMC.pcx"          },
-  { "em_gate_7_gray.EDITOR.xpos",              "2"                     },
-  { "em_gate_7_gray.EDITOR.ypos",              "7"                     },
-  { "em_gate_7_gray.EDITOR.frames",            "1"                     },
-  { "em_gate_8",                               "RocksEMC.pcx"          },
-  { "em_gate_8.xpos",                          "3"                     },
-  { "em_gate_8.ypos",                          "6"                     },
-  { "em_gate_8.frames",                                "1"                     },
-  { "em_gate_8_gray",                          "RocksEMC.pcx"          },
-  { "em_gate_8_gray.xpos",                     "4"                     },
-  { "em_gate_8_gray.ypos",                     "7"                     },
-  { "em_gate_8_gray.frames",                   "1"                     },
-  { "em_gate_8_gray.EDITOR",                   "RocksEMC.pcx"          },
-  { "em_gate_8_gray.EDITOR.xpos",              "3"                     },
-  { "em_gate_8_gray.EDITOR.ypos",              "7"                     },
-  { "em_gate_8_gray.EDITOR.frames",            "1"                     },
+  { "emc_key_5",                               "RocksEMC.pcx"          },
+  { "emc_key_5.xpos",                          "0"                     },
+  { "emc_key_5.ypos",                          "5"                     },
+  { "emc_key_5.frames",                                "1"                     },
+  { "emc_key_6",                               "RocksEMC.pcx"          },
+  { "emc_key_6.xpos",                          "1"                     },
+  { "emc_key_6.ypos",                          "5"                     },
+  { "emc_key_6.frames",                                "1"                     },
+  { "emc_key_7",                               "RocksEMC.pcx"          },
+  { "emc_key_7.xpos",                          "2"                     },
+  { "emc_key_7.ypos",                          "5"                     },
+  { "emc_key_7.frames",                                "1"                     },
+  { "emc_key_8",                               "RocksEMC.pcx"          },
+  { "emc_key_8.xpos",                          "3"                     },
+  { "emc_key_8.ypos",                          "5"                     },
+  { "emc_key_8.frames",                                "1"                     },
+
+  { "emc_gate_5",                              "RocksEMC.pcx"          },
+  { "emc_gate_5.xpos",                         "0"                     },
+  { "emc_gate_5.ypos",                         "6"                     },
+  { "emc_gate_5.frames",                       "1"                     },
+  { "emc_gate_5_gray",                         "RocksEMC.pcx"          },
+  { "emc_gate_5_gray.xpos",                    "4"                     },
+  { "emc_gate_5_gray.ypos",                    "7"                     },
+  { "emc_gate_5_gray.frames",                  "1"                     },
+  { "emc_gate_5_gray.EDITOR",                  "RocksEMC.pcx"          },
+  { "emc_gate_5_gray.EDITOR.xpos",             "0"                     },
+  { "emc_gate_5_gray.EDITOR.ypos",             "7"                     },
+  { "emc_gate_5_gray.EDITOR.frames",           "1"                     },
+  { "emc_gate_6",                              "RocksEMC.pcx"          },
+  { "emc_gate_6.xpos",                         "1"                     },
+  { "emc_gate_6.ypos",                         "6"                     },
+  { "emc_gate_6.frames",                       "1"                     },
+  { "emc_gate_6_gray",                         "RocksEMC.pcx"          },
+  { "emc_gate_6_gray.xpos",                    "4"                     },
+  { "emc_gate_6_gray.ypos",                    "7"                     },
+  { "emc_gate_6_gray.frames",                  "1"                     },
+  { "emc_gate_6_gray.EDITOR",                  "RocksEMC.pcx"          },
+  { "emc_gate_6_gray.EDITOR.xpos",             "1"                     },
+  { "emc_gate_6_gray.EDITOR.ypos",             "7"                     },
+  { "emc_gate_6_gray.EDITOR.frames",           "1"                     },
+  { "emc_gate_7",                              "RocksEMC.pcx"          },
+  { "emc_gate_7.xpos",                         "2"                     },
+  { "emc_gate_7.ypos",                         "6"                     },
+  { "emc_gate_7.frames",                       "1"                     },
+  { "emc_gate_7_gray",                         "RocksEMC.pcx"          },
+  { "emc_gate_7_gray.xpos",                    "4"                     },
+  { "emc_gate_7_gray.ypos",                    "7"                     },
+  { "emc_gate_7_gray.frames",                  "1"                     },
+  { "emc_gate_7_gray.EDITOR",                  "RocksEMC.pcx"          },
+  { "emc_gate_7_gray.EDITOR.xpos",             "2"                     },
+  { "emc_gate_7_gray.EDITOR.ypos",             "7"                     },
+  { "emc_gate_7_gray.EDITOR.frames",           "1"                     },
+  { "emc_gate_8",                              "RocksEMC.pcx"          },
+  { "emc_gate_8.xpos",                         "3"                     },
+  { "emc_gate_8.ypos",                         "6"                     },
+  { "emc_gate_8.frames",                       "1"                     },
+  { "emc_gate_8_gray",                         "RocksEMC.pcx"          },
+  { "emc_gate_8_gray.xpos",                    "4"                     },
+  { "emc_gate_8_gray.ypos",                    "7"                     },
+  { "emc_gate_8_gray.frames",                  "1"                     },
+  { "emc_gate_8_gray.EDITOR",                  "RocksEMC.pcx"          },
+  { "emc_gate_8_gray.EDITOR.xpos",             "3"                     },
+  { "emc_gate_8_gray.EDITOR.ypos",             "7"                     },
+  { "emc_gate_8_gray.EDITOR.frames",           "1"                     },
 
   { "emc_android",                             "emc_object.pcx"        },
   { "emc_android.xpos",                                "7"                     },
index 5559ac7d763a124970baafa38a9c125aee0f453a..ca430f275284f10ca5e97ef0b2137e37a19c659a 100644 (file)
 #define IMG_UNKNOWN                                    663
 #define IMG_TRIGGER_ELEMENT                            664
 #define IMG_TRIGGER_PLAYER                             665
-#define IMG_EM_KEY_5                                   666
-#define IMG_EM_KEY_6                                   667
-#define IMG_EM_KEY_7                                   668
-#define IMG_EM_KEY_8                                   669
-#define IMG_EM_GATE_5                                  670
-#define IMG_EM_GATE_5_GRAY                             671
-#define IMG_EM_GATE_5_GRAY_EDITOR                      672
-#define IMG_EM_GATE_6                                  673
-#define IMG_EM_GATE_6_GRAY                             674
-#define IMG_EM_GATE_6_GRAY_EDITOR                      675
-#define IMG_EM_GATE_7                                  676
-#define IMG_EM_GATE_7_GRAY                             677
-#define IMG_EM_GATE_7_GRAY_EDITOR                      678
-#define IMG_EM_GATE_8                                  679
-#define IMG_EM_GATE_8_GRAY                             680
-#define IMG_EM_GATE_8_GRAY_EDITOR                      681
+#define IMG_EMC_KEY_5                                  666
+#define IMG_EMC_KEY_6                                  667
+#define IMG_EMC_KEY_7                                  668
+#define IMG_EMC_KEY_8                                  669
+#define IMG_EMC_GATE_5                                 670
+#define IMG_EMC_GATE_5_GRAY                            671
+#define IMG_EMC_GATE_5_GRAY_EDITOR                     672
+#define IMG_EMC_GATE_6                                 673
+#define IMG_EMC_GATE_6_GRAY                            674
+#define IMG_EMC_GATE_6_GRAY_EDITOR                     675
+#define IMG_EMC_GATE_7                                 676
+#define IMG_EMC_GATE_7_GRAY                            677
+#define IMG_EMC_GATE_7_GRAY_EDITOR                     678
+#define IMG_EMC_GATE_8                                 679
+#define IMG_EMC_GATE_8_GRAY                            680
+#define IMG_EMC_GATE_8_GRAY_EDITOR                     681
 #define IMG_EMC_ANDROID                                        682
 #define IMG_EMC_GRASS                                  683
 #define IMG_EMC_GRASS_CRUMBLED                         684
index ab86a087724bcb94bb6cae0f69d078e4dcd27c6c..ef86812f640c4faff87ba6a65a699f7a47c87c4a 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "[2005-01-22 18:19]"
+#define COMPILE_DATE_STRING "[2005-01-29 01:36]"
index c77076b0a3dcc688ff437ac931d9f1c309677268..fc8cc9b791df8d334c42f05e823938f8f21954b4 100644 (file)
@@ -2718,20 +2718,20 @@ static int editor_hl_emerald_mine_club[] =
 
 static int editor_el_emerald_mine_club[] =
 {
-  EL_EM_KEY_5,
-  EL_EM_KEY_6,
-  EL_EM_KEY_7,
-  EL_EM_KEY_8,
+  EL_EMC_KEY_5,
+  EL_EMC_KEY_6,
+  EL_EMC_KEY_7,
+  EL_EMC_KEY_8,
 
-  EL_EM_GATE_5,
-  EL_EM_GATE_6,
-  EL_EM_GATE_7,
-  EL_EM_GATE_8,
+  EL_EMC_GATE_5,
+  EL_EMC_GATE_6,
+  EL_EMC_GATE_7,
+  EL_EMC_GATE_8,
 
-  EL_EM_GATE_5_GRAY,
-  EL_EM_GATE_6_GRAY,
-  EL_EM_GATE_7_GRAY,
-  EL_EM_GATE_8_GRAY,
+  EL_EMC_GATE_5_GRAY,
+  EL_EMC_GATE_6_GRAY,
+  EL_EMC_GATE_7_GRAY,
+  EL_EMC_GATE_8_GRAY,
 
   EL_EMC_STEELWALL_1,
   EL_EMC_STEELWALL_2,
@@ -7279,10 +7279,10 @@ static struct
   { EL_EM_KEY_3_FILE,  &level.score[SC_KEY],           TEXT_COLLECTING },
   { EL_EM_KEY_4_FILE,  &level.score[SC_KEY],           TEXT_COLLECTING },
 #endif
-  { EL_EM_KEY_5,       &level.score[SC_KEY],           TEXT_COLLECTING },
-  { EL_EM_KEY_6,       &level.score[SC_KEY],           TEXT_COLLECTING },
-  { EL_EM_KEY_7,       &level.score[SC_KEY],           TEXT_COLLECTING },
-  { EL_EM_KEY_8,       &level.score[SC_KEY],           TEXT_COLLECTING },
+  { EL_EMC_KEY_5,      &level.score[SC_KEY],           TEXT_COLLECTING },
+  { EL_EMC_KEY_6,      &level.score[SC_KEY],           TEXT_COLLECTING },
+  { EL_EMC_KEY_7,      &level.score[SC_KEY],           TEXT_COLLECTING },
+  { EL_EMC_KEY_8,      &level.score[SC_KEY],           TEXT_COLLECTING },
   { EL_AMOEBA_WET,     &level.amoeba_speed,            TEXT_AMOEBA_SPEED },
   { EL_AMOEBA_DRY,     &level.amoeba_speed,            TEXT_AMOEBA_SPEED },
   { EL_AMOEBA_FULL,    &level.amoeba_speed,            TEXT_AMOEBA_SPEED },
index 6a467021f6a7a463baf46034c600f6a17690f293..b8bf5f055525182598bc33d36394da858c12fb10 100644 (file)
@@ -1062,11 +1062,12 @@ inline void DrawGameValue_Dynamite(int value)
   DrawText(DX_DYNAMITE, DY_DYNAMITE, int2str(value, 3), FONT_TEXT_2);
 }
 
-inline void DrawGameValue_Keys(int key[4])
+inline void DrawGameValue_Keys(int key[MAX_NUM_KEYS])
 {
   int i;
 
-  for (i = 0; i < MAX_KEYS; i++)
+  /* currently only 4 of 8 possible keys are displayed */
+  for (i = 0; i < STD_NUM_KEYS; i++)
     if (key[i])
       DrawMiniGraphicExt(drawto, DX_KEYS + i * MINI_TILEX, DY_KEYS,
                         el2edimg(EL_KEY_1 + i));
@@ -1112,10 +1113,10 @@ inline void DrawGameValue_Level(int value)
 void DrawAllGameValues(int emeralds, int dynamite, int score, int time,
                       int key_bits)
 {
-  int key[4];
+  int key[MAX_NUM_KEYS];
   int i;
 
-  for (i = 0; i < MAX_KEYS; i++)
+  for (i = 0; i < MAX_NUM_KEYS; i++)
     key[i] = key_bits & (1 << i);
 
   DrawGameValue_Level(level_nr);
@@ -1586,7 +1587,7 @@ void InitGame()
     player->lights_still_needed = 0;
     player->friends_still_needed = 0;
 
-    for (j = 0; j < MAX_KEYS; j++)
+    for (j = 0; j < MAX_NUM_KEYS; j++)
       player->key[j] = FALSE;
 
     player->dynabomb_count = 0;
@@ -11368,14 +11369,14 @@ int DigField(struct PlayerInfo *player,
          return MF_NO_ACTION;  /* player cannot walk here due to gravity */
 #endif
 
-       if (IS_GATE(element))
+       if (IS_RND_GATE(element))
        {
-         if (!player->key[element - EL_GATE_1])
+         if (!player->key[RND_GATE_NR(element)])
            return MF_NO_ACTION;
        }
-       else if (IS_GATE_GRAY(element))
+       else if (IS_RND_GATE_GRAY(element))
        {
-         if (!player->key[element - EL_GATE_1_GRAY])
+         if (!player->key[RND_GATE_GRAY_NR(element)])
            return MF_NO_ACTION;
        }
        else if (element == EL_EXIT_OPEN ||
@@ -11438,12 +11439,12 @@ int DigField(struct PlayerInfo *player,
 
        if (IS_EM_GATE(element))
        {
-         if (!player->key[element - EL_EM_GATE_1])
+         if (!player->key[EM_GATE_NR(element)])
            return MF_NO_ACTION;
        }
        else if (IS_EM_GATE_GRAY(element))
        {
-         if (!player->key[element - EL_EM_GATE_1_GRAY])
+         if (!player->key[EM_GATE_GRAY_NR(element)])
            return MF_NO_ACTION;
        }
        else if (IS_SP_PORT(element))
@@ -11554,13 +11555,9 @@ int DigField(struct PlayerInfo *player,
        {
          player->dynabomb_xl = TRUE;
        }
-       else if ((element >= EL_KEY_1 && element <= EL_KEY_4) ||
-                (element >= EL_EM_KEY_1 && element <= EL_EM_KEY_4))
+       else if (IS_KEY(element))
        {
-         int key_nr = (element >= EL_KEY_1 && element <= EL_KEY_4 ?
-                       element - EL_KEY_1 : element - EL_EM_KEY_1);
-
-         player->key[key_nr] = TRUE;
+         player->key[KEY_NR(element)] = TRUE;
 
          DrawGameValue_Keys(player->key);
 
@@ -12654,6 +12651,14 @@ void RaiseScoreElement(int element)
     case EL_KEY_2:
     case EL_KEY_3:
     case EL_KEY_4:
+    case EL_EM_KEY_1:
+    case EL_EM_KEY_2:
+    case EL_EM_KEY_3:
+    case EL_EM_KEY_4:
+    case EL_EMC_KEY_5:
+    case EL_EMC_KEY_6:
+    case EL_EMC_KEY_7:
+    case EL_EMC_KEY_8:
       RaiseScore(level.score[SC_KEY]);
       break;
     default:
index 094a225e21ba432b4c9c71e3f228dfce2458ac4c..8e8694ef73aef7e03a35b92ed4c16024b9359632 100644 (file)
@@ -2015,10 +2015,10 @@ void InitElementPropertiesStatic()
     EL_EM_KEY_2,
     EL_EM_KEY_3,
     EL_EM_KEY_4,
-    EL_EM_KEY_5,
-    EL_EM_KEY_6,
-    EL_EM_KEY_7,
-    EL_EM_KEY_8,
+    EL_EMC_KEY_5,
+    EL_EMC_KEY_6,
+    EL_EMC_KEY_7,
+    EL_EMC_KEY_8,
     EL_DYNAMITE,
     EL_DYNABOMB_INCREASE_NUMBER,
     EL_DYNABOMB_INCREASE_SIZE,
@@ -2168,6 +2168,14 @@ void InitElementPropertiesStatic()
     EL_EM_GATE_2_GRAY,
     EL_EM_GATE_3_GRAY,
     EL_EM_GATE_4_GRAY,
+    EL_EMC_GATE_5,
+    EL_EMC_GATE_6,
+    EL_EMC_GATE_7,
+    EL_EMC_GATE_8,
+    EL_EMC_GATE_5_GRAY,
+    EL_EMC_GATE_6_GRAY,
+    EL_EMC_GATE_7_GRAY,
+    EL_EMC_GATE_8_GRAY,
     EL_SWITCHGATE_OPEN,
     EL_SWITCHGATE_OPENING,
     EL_SWITCHGATE_CLOSED,
@@ -2445,18 +2453,18 @@ void InitElementPropertiesStatic()
     EL_EM_GATE_2,
     EL_EM_GATE_3,
     EL_EM_GATE_4,
-    EL_EM_GATE_5,
-    EL_EM_GATE_6,
-    EL_EM_GATE_7,
-    EL_EM_GATE_8,
     EL_EM_GATE_1_GRAY,
     EL_EM_GATE_2_GRAY,
     EL_EM_GATE_3_GRAY,
     EL_EM_GATE_4_GRAY,
-    EL_EM_GATE_5_GRAY,
-    EL_EM_GATE_6_GRAY,
-    EL_EM_GATE_7_GRAY,
-    EL_EM_GATE_8_GRAY,
+    EL_EMC_GATE_5,
+    EL_EMC_GATE_6,
+    EL_EMC_GATE_7,
+    EL_EMC_GATE_8,
+    EL_EMC_GATE_5_GRAY,
+    EL_EMC_GATE_6_GRAY,
+    EL_EMC_GATE_7_GRAY,
+    EL_EMC_GATE_8_GRAY,
     EL_SWITCHGATE_OPEN,
     EL_TIMEGATE_OPEN,
     -1
@@ -2546,18 +2554,18 @@ void InitElementPropertiesStatic()
     EL_EM_GATE_2,
     EL_EM_GATE_3,
     EL_EM_GATE_4,
-    EL_EM_GATE_5,
-    EL_EM_GATE_6,
-    EL_EM_GATE_7,
-    EL_EM_GATE_8,
     EL_EM_GATE_1_GRAY,
     EL_EM_GATE_2_GRAY,
     EL_EM_GATE_3_GRAY,
     EL_EM_GATE_4_GRAY,
-    EL_EM_GATE_5_GRAY,
-    EL_EM_GATE_6_GRAY,
-    EL_EM_GATE_7_GRAY,
-    EL_EM_GATE_8_GRAY,
+    EL_EMC_GATE_5,
+    EL_EMC_GATE_6,
+    EL_EMC_GATE_7,
+    EL_EMC_GATE_8,
+    EL_EMC_GATE_5_GRAY,
+    EL_EMC_GATE_6_GRAY,
+    EL_EMC_GATE_7_GRAY,
+    EL_EMC_GATE_8_GRAY,
     EL_SWITCHGATE_OPEN,
     EL_TIMEGATE_OPEN,
 
@@ -3219,18 +3227,18 @@ void InitElementPropertiesStatic()
     EL_EM_GATE_2,
     EL_EM_GATE_3,
     EL_EM_GATE_4,
-    EL_EM_GATE_5,
-    EL_EM_GATE_6,
-    EL_EM_GATE_7,
-    EL_EM_GATE_8,
     EL_EM_GATE_1_GRAY,
     EL_EM_GATE_2_GRAY,
     EL_EM_GATE_3_GRAY,
     EL_EM_GATE_4_GRAY,
-    EL_EM_GATE_5_GRAY,
-    EL_EM_GATE_6_GRAY,
-    EL_EM_GATE_7_GRAY,
-    EL_EM_GATE_8_GRAY,
+    EL_EMC_GATE_5,
+    EL_EMC_GATE_6,
+    EL_EMC_GATE_7,
+    EL_EMC_GATE_8,
+    EL_EMC_GATE_5_GRAY,
+    EL_EMC_GATE_6_GRAY,
+    EL_EMC_GATE_7_GRAY,
+    EL_EMC_GATE_8_GRAY,
     -1
   };
 
@@ -3312,10 +3320,10 @@ void InitElementPropertiesStatic()
     EL_EM_KEY_2,
     EL_EM_KEY_3,
     EL_EM_KEY_4,
-    EL_EM_KEY_5,
-    EL_EM_KEY_6,
-    EL_EM_KEY_7,
-    EL_EM_KEY_8,
+    EL_EMC_KEY_5,
+    EL_EMC_KEY_6,
+    EL_EMC_KEY_7,
+    EL_EMC_KEY_8,
     EL_GATE_1,
     EL_GATE_2,
     EL_GATE_3,
@@ -3328,18 +3336,18 @@ void InitElementPropertiesStatic()
     EL_EM_GATE_2,
     EL_EM_GATE_3,
     EL_EM_GATE_4,
-    EL_EM_GATE_5,
-    EL_EM_GATE_6,
-    EL_EM_GATE_7,
-    EL_EM_GATE_8,
     EL_EM_GATE_1_GRAY,
     EL_EM_GATE_2_GRAY,
     EL_EM_GATE_3_GRAY,
     EL_EM_GATE_4_GRAY,
-    EL_EM_GATE_5_GRAY,
-    EL_EM_GATE_6_GRAY,
-    EL_EM_GATE_7_GRAY,
-    EL_EM_GATE_8_GRAY,
+    EL_EMC_GATE_5,
+    EL_EMC_GATE_6,
+    EL_EMC_GATE_7,
+    EL_EMC_GATE_8,
+    EL_EMC_GATE_5_GRAY,
+    EL_EMC_GATE_6_GRAY,
+    EL_EMC_GATE_7_GRAY,
+    EL_EMC_GATE_8_GRAY,
     EL_DYNAMITE,
     EL_INVISIBLE_STEELWALL,
     EL_INVISIBLE_WALL,
index 7ab466ab1ff11efed36c537fc952aebcda0de077..e382071e68e5cb3517a782cd7f3fe69d969bde10 100644 (file)
@@ -3465,62 +3465,62 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] =
     "stop moving balloon"
   },
   {
-    "em_gate_5",
+    "emc_gate_5",
     "gate",
     "door 5 (EMC style)",
   },
   {
-    "em_gate_6",
+    "emc_gate_6",
     "gate",
     "door 6 (EMC style)",
   },
   {
-    "em_gate_7",
+    "emc_gate_7",
     "gate",
     "door 7 (EMC style)",
   },
   {
-    "em_gate_8",
+    "emc_gate_8",
     "gate",
     "door 8 (EMC style)",
   },
   {
-    "em_gate_5_gray",
+    "emc_gate_5_gray",
     "gate",
     "gray door (EMC style, key 5)",
   },
   {
-    "em_gate_6_gray",
+    "emc_gate_6_gray",
     "gate",
     "gray door (EMC style, key 6)",
   },
   {
-    "em_gate_7_gray",
+    "emc_gate_7_gray",
     "gate",
     "gray door (EMC style, key 7)",
   },
   {
-    "em_gate_8_gray",
+    "emc_gate_8_gray",
     "gate",
     "gray door (EMC style, key 8)",
   },
   {
-    "em_key_5",
+    "emc_key_5",
     "key",
     "key 5 (EMC style)",
   },
   {
-    "em_key_6",
+    "emc_key_6",
     "key",
     "key 6 (EMC style)",
   },
   {
-    "em_key_7",
+    "emc_key_7",
     "key",
     "key 7 (EMC style)",
   },
   {
-    "em_key_8",
+    "emc_key_8",
     "key",
     "key 8 (EMC style)",
   },
index 259256c8505fc698e9218f61c18fc3ee1f791b49..d6124be35ef2f7caa1c6497bda231dde00583f10 100644 (file)
 #define IS_ENVELOPE(e)         ((e) >= EL_ENVELOPE_1 &&                \
                                 (e) <= EL_ENVELOPE_4)
 
-#define IS_GATE(e)             ((e) >= EL_GATE_1 &&                    \
+#define IS_RND_KEY(e)          ((e) >= EL_KEY_1 &&                     \
+                                (e) <= EL_KEY_4)
+#define IS_EM_KEY(e)           ((e) >= EL_EM_KEY_1 &&                  \
+                                (e) <= EL_EM_KEY_4)
+#define IS_EMC_KEY(e)          ((e) >= EL_EMC_KEY_5 &&                 \
+                                (e) <= EL_EMC_KEY_8)
+#define IS_KEY(e)              (IS_RND_KEY(e) ||                       \
+                                IS_EM_KEY(e) ||                        \
+                                IS_EMC_KEY(e))
+#define RND_KEY_NR(e)          ((e) - EL_KEY_1)
+#define EM_KEY_NR(e)           ((e) - EL_EM_KEY_1)
+#define EMC_KEY_NR(e)          ((e) - EL_EMC_KEY_5 + 4)
+#define KEY_NR(e)              (IS_RND_KEY(e) ? RND_KEY_NR(e) :        \
+                                IS_EM_KEY(e) ?  EM_KEY_NR(e) :         \
+                                IS_EMC_KEY(e) ? EMC_KEY_NR(e) : 0)
+
+#define IS_RND_GATE(e)         ((e) >= EL_GATE_1 &&                    \
                                 (e) <= EL_GATE_4)
-
-#define IS_GATE_GRAY(e)                ((e) >= EL_GATE_1_GRAY &&               \
-                                (e) <= EL_GATE_4_GRAY)
-
 #define IS_EM_GATE(e)          ((e) >= EL_EM_GATE_1 &&                 \
                                 (e) <= EL_EM_GATE_4)
-
+#define IS_EMC_GATE(e)         ((e) >= EL_EMC_GATE_5 &&                \
+                                (e) <= EL_EMC_GATE_8)
+#define IS_GATE(e)             (IS_RND_GATE(e) ||                      \
+                                IS_EM_GATE(e) ||                       \
+                                IS_EMC_GATE(e))
+#define RND_GATE_NR(e)         ((e) - EL_GATE_1)
+#define EM_GATE_NR(e)          ((e) - EL_EM_GATE_1)
+#define EMC_GATE_NR(e)         ((e) - EL_EMC_GATE_5 + 4)
+#define GATE_NR(e)             (IS_RND_GATE(e) ? RND_GATE_NR(e) :      \
+                                IS_EM_GATE(e) ?  EM_GATE_NR(e) :       \
+                                IS_EMC_GATE(e) ? EMC_GATE_NR(e) : 0)
+
+#define IS_RND_GATE_GRAY(e)    ((e) >= EL_GATE_1_GRAY &&               \
+                                (e) <= EL_GATE_4_GRAY)
 #define IS_EM_GATE_GRAY(e)     ((e) >= EL_EM_GATE_1_GRAY &&            \
                                 (e) <= EL_EM_GATE_4_GRAY)
+#define IS_EMC_GATE_GRAY(e)    ((e) >= EL_EMC_GATE_5_GRAY &&           \
+                                (e) <= EL_EMC_GATE_8_GRAY)
+#define IS_GATE_GRAY(e)                (IS_RND_GATE_GRAY(e) ||                 \
+                                IS_EM_GATE_GRAY(e) ||                  \
+                                IS_EMC_GATE_GRAY(e))
+#define RND_GATE_GRAY_NR(e)    ((e) - EL_GATE_1_GRAY)
+#define EM_GATE_GRAY_NR(e)     ((e) - EL_EM_GATE_1_GRAY)
+#define EMC_GATE_GRAY_NR(e)    ((e) - EL_EMC_GATE_5_GRAY + 4)
+#define GATE_GRAY_NR(e)                (IS_RND_GATE_GRAY(e) ? RND_GATE_GRAY_NR(e) :  \
+                                IS_EM_GATE_GRAY(e) ?  EM_GATE_GRAY_NR(e) :   \
+                                IS_EMC_GATE_GRAY(e) ? EMC_GATE_GRAY_NR(e) : 0)
 
 #define GFX_ELEMENT(e)         (element_info[e].use_gfx_element ?      \
                                 element_info[e].gfx_element : e)
 #define MAX_SCORE_ENTRIES      100
 #define MAX_NUM_AMOEBA         100
 #define MAX_INVENTORY_SIZE     1000
-#define MAX_KEYS               4
+#define STD_NUM_KEYS           4
+#define MAX_NUM_KEYS           8
 #define NUM_BELTS              4
 #define NUM_BELT_PARTS         3
 #define MIN_ENVELOPE_XSIZE     1
 
 /* the following EMC style elements are currently not implemented in R'n'D */
 #define EL_BALLOON_SWITCH_NONE         667
-#define EL_EM_GATE_5                   668
-#define EL_EM_GATE_6                   669
-#define EL_EM_GATE_7                   670
-#define EL_EM_GATE_8                   671
-#define EL_EM_GATE_5_GRAY              672
-#define EL_EM_GATE_6_GRAY              673
-#define EL_EM_GATE_7_GRAY              674
-#define EL_EM_GATE_8_GRAY              675
-#define EL_EM_KEY_5                    676
-#define EL_EM_KEY_6                    677
-#define EL_EM_KEY_7                    678
-#define EL_EM_KEY_8                    679
+#define EL_EMC_GATE_5                  668
+#define EL_EMC_GATE_6                  669
+#define EL_EMC_GATE_7                  670
+#define EL_EMC_GATE_8                  671
+#define EL_EMC_GATE_5_GRAY             672
+#define EL_EMC_GATE_6_GRAY             673
+#define EL_EMC_GATE_7_GRAY             674
+#define EL_EMC_GATE_8_GRAY             675
+#define EL_EMC_KEY_5                   676
+#define EL_EMC_KEY_6                   677
+#define EL_EMC_KEY_7                   678
+#define EL_EMC_KEY_8                   679
 #define EL_EMC_ANDROID                 680
 #define EL_EMC_GRASS                   681
 #define EL_EMC_MAGIC_BALL              682
@@ -1523,7 +1560,7 @@ struct PlayerInfo
   int sokobanfields_still_needed;
   int lights_still_needed;
   int friends_still_needed;
-  int key[4];
+  int key[MAX_NUM_KEYS];
   int dynabomb_count, dynabomb_size, dynabombs_left, dynabomb_xl;
   int shield_normal_time_left;
   int shield_deadly_time_left;
index 05a1293bd789a04e2e5858cbd15175f181b3a362..3e346c882c4e4c8d231d57e3ecad6ea162dabd11 100644 (file)
@@ -3975,19 +3975,19 @@ em_object_mapping_list[] =
   },
   {
     Ykey_5_eat,                                FALSE,  FALSE,
-    EL_EM_KEY_5,                       ACTION_COLLECTING, -1
+    EL_EMC_KEY_5,                      ACTION_COLLECTING, -1
   },
   {
     Ykey_6_eat,                                FALSE,  FALSE,
-    EL_EM_KEY_6,                       ACTION_COLLECTING, -1
+    EL_EMC_KEY_6,                      ACTION_COLLECTING, -1
   },
   {
     Ykey_7_eat,                                FALSE,  FALSE,
-    EL_EM_KEY_7,                       ACTION_COLLECTING, -1
+    EL_EMC_KEY_7,                      ACTION_COLLECTING, -1
   },
   {
     Ykey_8_eat,                                FALSE,  FALSE,
-    EL_EM_KEY_8,                       ACTION_COLLECTING, -1
+    EL_EMC_KEY_8,                      ACTION_COLLECTING, -1
   },
   {
     Ylenses_eat,                       FALSE,  FALSE,
@@ -4079,19 +4079,19 @@ em_object_mapping_list[] =
   },
   {
     Xdoor_5,                           TRUE,   FALSE,
-    EL_EM_GATE_5,                      -1, -1
+    EL_EMC_GATE_5,                     -1, -1
   },
   {
     Xdoor_6,                           TRUE,   FALSE,
-    EL_EM_GATE_6,                      -1, -1
+    EL_EMC_GATE_6,                     -1, -1
   },
   {
     Xdoor_7,                           TRUE,   FALSE,
-    EL_EM_GATE_7,                      -1, -1
+    EL_EMC_GATE_7,                     -1, -1
   },
   {
     Xdoor_8,                           TRUE,   FALSE,
-    EL_EM_GATE_8,                      -1, -1
+    EL_EMC_GATE_8,                     -1, -1
   },
   {
     Xkey_1,                            TRUE,   FALSE,
@@ -4111,19 +4111,19 @@ em_object_mapping_list[] =
   },
   {
     Xkey_5,                            TRUE,   FALSE,
-    EL_EM_KEY_5,                       -1, -1
+    EL_EMC_KEY_5,                      -1, -1
   },
   {
     Xkey_6,                            TRUE,   FALSE,
-    EL_EM_KEY_6,                       -1, -1
+    EL_EMC_KEY_6,                      -1, -1
   },
   {
     Xkey_7,                            TRUE,   FALSE,
-    EL_EM_KEY_7,                       -1, -1
+    EL_EMC_KEY_7,                      -1, -1
   },
   {
     Xkey_8,                            TRUE,   FALSE,
-    EL_EM_KEY_8,                       -1, -1
+    EL_EMC_KEY_8,                      -1, -1
   },
   {
     Xwind_n,                           TRUE,   FALSE,
@@ -4335,19 +4335,19 @@ em_object_mapping_list[] =
   },
   {
     Xfake_door_5,                      TRUE,   FALSE,
-    EL_EM_GATE_5_GRAY,                 -1, -1
+    EL_EMC_GATE_5_GRAY,                        -1, -1
   },
   {
     Xfake_door_6,                      TRUE,   FALSE,
-    EL_EM_GATE_6_GRAY,                 -1, -1
+    EL_EMC_GATE_6_GRAY,                        -1, -1
   },
   {
     Xfake_door_7,                      TRUE,   FALSE,
-    EL_EM_GATE_7_GRAY,                 -1, -1
+    EL_EMC_GATE_7_GRAY,                        -1, -1
   },
   {
     Xfake_door_8,                      TRUE,   FALSE,
-    EL_EM_GATE_8_GRAY,                 -1, -1
+    EL_EMC_GATE_8_GRAY,                        -1, -1
   },
   {
     Xfake_acid_1,                      TRUE,   FALSE,