rnd-20060110-1-src
authorHolger Schemel <info@artsoft.org>
Tue, 10 Jan 2006 01:06:07 +0000 (02:06 +0100)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:50:19 +0000 (10:50 +0200)
* added magic ball (element creator) from EMC engine to R'n'D engine

ChangeLog
src/conf_gfx.c
src/conftime.h
src/game.c
src/game_em/convert.c
src/init.c
src/main.h

index 921fa6ad4f4cf63a838b19dbf74b4c205cd20a34..0a04d73ca6e4086644ddd5c184fc07aa1e6a5d0c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2006-01-09
+       * added magic ball (element creator) from EMC engine to R'n'D engine
+
 2006-01-07
        * uploaded fixed pre-release version 3.2.0-6 binary and source code
 
index 1c5725b16994842eed61b08473e78f58b9678067..d288f54f2458ffcfcb24e06853d5f2b0e04f9c19 100644 (file)
@@ -3450,6 +3450,7 @@ struct ConfigInfo image_config[] =
   { "emc_android.xpos",                                "0"                     },
   { "emc_android.ypos",                                "8"                     },
   { "emc_android.frames",                      "8"                     },
+  { "emc_android.delay",                       "2"                     },
 
   { "emc_grass",                               "RocksEMC.pcx"          },
   { "emc_grass.xpos",                          "0"                     },
index 96bddd7f85e1a54a59c6b16b3ec64fd26be66692..8fdb179dd26b7a622835cb6e12391ac5adb52091 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "[2006-01-07 03:59]"
+#define COMPILE_DATE_STRING "[2006-01-09 23:43]"
index 1f4d8a01a378252d1d5e1b75f6d4edd756cc2668..c9eb9360017fc84207d7f1505fde9b40e53d86bd 100644 (file)
 
 /* forward declaration for internal use */
 
+static void CreateField(int, int, int);
+
 static void SetPlayerWaiting(struct PlayerInfo *, boolean);
 static void AdvanceFrameAndPlayerCounters(int);
 
@@ -261,7 +263,7 @@ static void TestIfElementHitsCustomElement(int, int, int);
 static void TestIfElementSmashesCustomElement(int, int, int);
 #endif
 
-static void ChangeElement(int, int, int);
+static void HandleElementChange(int, int, int);
 
 static boolean CheckTriggeredElementChangeExt(int, int, int, int, int,int,int);
 #define CheckTriggeredElementChange(x, y, e, ev)                       \
@@ -302,19 +304,22 @@ static struct GadgetInfo *game_gadget[NUM_GAME_BUTTONS];
 /* ------------------------------------------------------------------------- */
 
 /* forward declaration for changer functions */
-static void InitBuggyBase(int x, int y);
-static void WarnBuggyBase(int x, int y);
+static void InitBuggyBase(int, int);
+static void WarnBuggyBase(int, int);
+
+static void InitTrap(int, int);
+static void ActivateTrap(int, int);
+static void ChangeActiveTrap(int, int);
 
-static void InitTrap(int x, int y);
-static void ActivateTrap(int x, int y);
-static void ChangeActiveTrap(int x, int y);
+static void InitRobotWheel(int, int);
+static void RunRobotWheel(int, int);
+static void StopRobotWheel(int, int);
 
-static void InitRobotWheel(int x, int y);
-static void RunRobotWheel(int x, int y);
-static void StopRobotWheel(int x, int y);
+static void InitTimegateWheel(int, int);
+static void RunTimegateWheel(int, int);
 
-static void InitTimegateWheel(int x, int y);
-static void RunTimegateWheel(int x, int y);
+static void InitMagicBallDelay(int, int);
+static void ActivateMagicBall(int, int);
 
 struct ChangingElementInfo
 {
@@ -481,6 +486,14 @@ static struct ChangingElementInfo change_delay_list[] =
     RunTimegateWheel,
     NULL
   },
+  {
+    EL_EMC_MAGIC_BALL_ACTIVE,
+    EL_EMC_MAGIC_BALL_ACTIVE,
+    0,
+    InitMagicBallDelay,
+    NULL,
+    ActivateMagicBall
+  },
 
   {
     EL_UNDEFINED,
@@ -935,6 +948,16 @@ static void InitField(int x, int y, boolean init_game)
        game.light_time_left = level.time_light * FRAMES_PER_SECOND;
       break;
 
+    case EL_EMC_MAGIC_BALL:
+      if (game.ball_state)
+       Feld[x][y] = EL_EMC_MAGIC_BALL_ACTIVE;
+      break;
+
+    case EL_EMC_MAGIC_BALL_SWITCH:
+      if (game.ball_state)
+       Feld[x][y] = EL_EMC_MAGIC_BALL_SWITCH_ACTIVE;
+      break;
+
     default:
 #if 1
       if (IS_CUSTOM_ELEMENT(element))
@@ -1796,6 +1819,9 @@ void InitGame()
   game.lenses_time_left = 0;
   game.magnify_time_left = 0;
 
+  game.ball_state = level.ball_state_initial;
+  game.ball_content_nr = 0;
+
   game.envelope_active = FALSE;
 
   for (i = 0; i < NUM_BELTS; i++)
@@ -6580,6 +6606,46 @@ static void RunTimegateWheel(int x, int y)
   PlayLevelSound(x, y, SND_TIMEGATE_SWITCH_ACTIVE);
 }
 
+static void InitMagicBallDelay(int x, int y)
+{
+  ChangeDelay[x][y] = level.ball_time * FRAMES_PER_SECOND;
+
+  if (ChangeDelay[x][y] == 0)
+    ChangeDelay[x][y] = 1;
+}
+
+static void ActivateMagicBall(int bx, int by)
+{
+  int x, y;
+
+  if (level.ball_random)
+  {
+    int pos_border = RND(8);   /* select one of the eight border elements */
+    int pos_content = (pos_border > 3 ? pos_border + 1 : pos_border);
+    int xx = pos_content % 3;
+    int yy = pos_content / 3;
+
+    x = bx - 1 + xx;
+    y = by - 1 + yy;
+
+    if (IN_LEV_FIELD(x, y) && Feld[x][y] == EL_EMPTY)
+      CreateField(x, y, level.ball_content[game.ball_content_nr].e[xx][yy]);
+  }
+  else
+  {
+    for (y = by - 1; y <= by + 1; y++) for (x = bx - 1; x <= bx + 1; x++)
+    {
+      int xx = x - bx + 1;
+      int yy = y - by + 1;
+
+      if (IN_LEV_FIELD(x, y) && Feld[x][y] == EL_EMPTY)
+       CreateField(x, y, level.ball_content[game.ball_content_nr].e[xx][yy]);
+    }
+  }
+
+  game.ball_content_nr = (game.ball_content_nr + 1) % level.num_ball_contents;
+}
+
 void CheckExit(int x, int y)
 {
   if (local_player->gems_still_needed > 0 ||
@@ -7353,8 +7419,7 @@ static void ExecuteCustomElementAction(int x, int y, int element, int page)
   }
 }
 
-static void ChangeElementNowExt(struct ElementChangeInfo *change,
-                               int x, int y, int target_element)
+static void CreateField(int x, int y, int target_element)
 {
   int previous_move_direction = MovDir[x][y];
 #if USE_NEW_CUSTOM_VALUE
@@ -7369,6 +7434,7 @@ static void ChangeElementNowExt(struct ElementChangeInfo *change,
       IS_ACCESSIBLE(Feld[x][y]) && !IS_ACCESSIBLE(target_element))
   {
     Bang(x, y);
+
     return;
   }
 
@@ -7404,14 +7470,23 @@ static void ChangeElementNowExt(struct ElementChangeInfo *change,
   if (ELEM_IS_PLAYER(target_element))
     RelocatePlayer(x, y, target_element);
 
+#if 0
   ChangeCount[x][y]++;         /* count number of changes in the same frame */
+#endif
 
   TestIfBadThingTouchesPlayer(x, y);
   TestIfPlayerTouchesCustomElement(x, y);
   TestIfElementTouchesCustomElement(x, y);
 }
 
-static boolean ChangeElementNow(int x, int y, int element, int page)
+static void CreateElementFromChange(int x, int y, int element)
+{
+  CreateField(x, y, element);
+
+  ChangeCount[x][y]++;         /* count number of changes in the same frame */
+}
+
+static boolean ChangeElement(int x, int y, int element, int page)
 {
   struct ElementChangeInfo *change = &element_info[element].change_page[page];
   int target_element;
@@ -7534,7 +7609,7 @@ static boolean ChangeElementNow(int x, int y, int element, int page)
          content_element = change->target_content.e[xx][yy];
          target_element = GET_TARGET_ELEMENT(content_element, change);
 
-         ChangeElementNowExt(change, ex, ey, target_element);
+         CreateElementFromChange(ex, ey, target_element);
 
          something_has_changed = TRUE;
 
@@ -7555,7 +7630,7 @@ static boolean ChangeElementNow(int x, int y, int element, int page)
   {
     target_element = GET_TARGET_ELEMENT(change->target_element, change);
 
-    ChangeElementNowExt(change, x, y, target_element);
+    CreateElementFromChange(x, y, target_element);
 
     PlayLevelSoundElementAction(x, y, element, ACTION_CHANGING);
     PlayLevelSoundElementAction(x, y, element, ACTION_PAGE_1 + page);
@@ -7569,7 +7644,7 @@ static boolean ChangeElementNow(int x, int y, int element, int page)
 
 #if USE_NEW_DELAYED_ACTION
 
-static void ChangeElement(int x, int y, int page)
+static void HandleElementChange(int x, int y, int page)
 {
   int element = MovingOrBlocked2Element(x, y);
   struct ElementInfo *ei = &element_info[element];
@@ -7580,9 +7655,9 @@ static void ChangeElement(int x, int y, int page)
       !CAN_CHANGE_OR_HAS_ACTION(Back[x][y]))
   {
     printf("\n\n");
-    printf("ChangeElement(): %d,%d: element = %d ('%s')\n",
+    printf("HandleElementChange(): %d,%d: element = %d ('%s')\n",
           x, y, element, element_info[element].token_name);
-    printf("ChangeElement(): This should never happen!\n");
+    printf("HandleElementChange(): This should never happen!\n");
     printf("\n\n");
   }
 #endif
@@ -7647,7 +7722,7 @@ static void ChangeElement(int x, int y, int page)
 
     if (change->can_change)
     {
-      if (ChangeElementNow(x, y, element, page))
+      if (ChangeElement(x, y, element, page))
       {
        if (change->post_change_function)
          change->post_change_function(x, y);
@@ -7661,7 +7736,7 @@ static void ChangeElement(int x, int y, int page)
 
 #else
 
-static void ChangeElement(int x, int y, int page)
+static void HandleElementChange(int x, int y, int page)
 {
   int element = MovingOrBlocked2Element(x, y);
   struct ElementInfo *ei = &element_info[element];
@@ -7671,9 +7746,9 @@ static void ChangeElement(int x, int y, int page)
   if (!CAN_CHANGE(element) && !CAN_CHANGE(Back[x][y]))
   {
     printf("\n\n");
-    printf("ChangeElement(): %d,%d: element = %d ('%s')\n",
+    printf("HandleElementChange(): %d,%d: element = %d ('%s')\n",
           x, y, element, element_info[element].token_name);
-    printf("ChangeElement(): This should never happen!\n");
+    printf("HandleElementChange(): This should never happen!\n");
     printf("\n\n");
   }
 #endif
@@ -7730,7 +7805,7 @@ static void ChangeElement(int x, int y, int page)
       return;
     }
 
-    if (ChangeElementNow(x, y, element, page))
+    if (ChangeElement(x, y, element, page))
     {
       if (change->post_change_function)
        change->post_change_function(x, y);
@@ -7796,7 +7871,8 @@ static boolean CheckTriggeredElementChangeExt(int trigger_x, int trigger_y,
              {
                ChangeDelay[x][y] = 1;
                ChangeEvent[x][y] = trigger_event;
-               ChangeElement(x, y, p);
+
+               HandleElementChange(x, y, p);
              }
 #if USE_NEW_DELAYED_ACTION
              else if (change->has_action)
@@ -7898,7 +7974,8 @@ static boolean CheckElementChangeExt(int x, int y,
       {
        ChangeDelay[x][y] = 1;
        ChangeEvent[x][y] = trigger_event;
-       ChangeElement(x, y, p);
+
+       HandleElementChange(x, y, p);
 
        change_done = TRUE;
       }
@@ -8482,7 +8559,7 @@ void GameActions()
     {
       int page = element_info[element].event_page_nr[CE_DELAY];
 #if 0
-      ChangeElement(x, y, ChangePage[x][y] != -1 ? ChangePage[x][y] : page);
+      HandleElementChange(x, y, ChangePage[x][y] != -1 ? ChangePage[x][y] : page);
 #else
 
 #if 0
@@ -8495,10 +8572,10 @@ void GameActions()
 #endif
 
 #if 1
-      ChangeElement(x, y, page);
+      HandleElementChange(x, y, page);
 #else
       if (CAN_CHANGE(element))
-       ChangeElement(x, y, page);
+       HandleElementChange(x, y, page);
 
       if (HAS_ACTION(element))
        ExecuteCustomElementAction(x, y, element, page);
@@ -10642,6 +10719,37 @@ int DigField(struct PlayerInfo *player,
       ResetGfxAnimation(x, y);
       DrawLevelField(x, y);
     }
+    else if (element == EL_EMC_MAGIC_BALL_SWITCH ||
+            element == EL_EMC_MAGIC_BALL_SWITCH_ACTIVE)
+    {
+      int xx, yy;
+
+      game.ball_state = !game.ball_state;
+
+#if 1
+      SCAN_PLAYFIELD(xx, yy)
+#else
+      for (yy = 0; yy < lev_fieldy; yy++) for (xx = 0; xx < lev_fieldx; xx++)
+#endif
+      {
+       int e = Feld[xx][yy];
+
+       if (game.ball_state)
+       {
+         if (e == EL_EMC_MAGIC_BALL)
+           CreateField(xx, yy, EL_EMC_MAGIC_BALL_ACTIVE);
+         else if (e == EL_EMC_MAGIC_BALL_SWITCH)
+           CreateField(xx, yy, EL_EMC_MAGIC_BALL_SWITCH_ACTIVE);
+       }
+       else
+       {
+         if (e == EL_EMC_MAGIC_BALL_ACTIVE)
+           CreateField(xx, yy, EL_EMC_MAGIC_BALL);
+         else if (e == EL_EMC_MAGIC_BALL_SWITCH_ACTIVE)
+           CreateField(xx, yy, EL_EMC_MAGIC_BALL_SWITCH);
+       }
+      }
+    }
 
     CheckTriggeredElementChangeByPlayer(x, y, element, CE_SWITCH_OF_X,
                                        player->index_bit, dig_side);
index b119d0e16106c82ea8fe584bdab1afd72c134d97..3c714c6e26dab749f7f5a09e3c758fda9aaffd2e 100644 (file)
@@ -638,163 +638,173 @@ void convert_em_level(unsigned char *src, int file_version)
 
   if (temp & 1)
   {
-    lev.android_array[Xemerald] =
-      lev.android_array[Xemerald_pause] =
-      lev.android_array[Xemerald_fall] =
-      lev.android_array[Yemerald_sB] =
-      lev.android_array[Yemerald_eB] =
-      lev.android_array[Yemerald_wB] = Xemerald;
+    lev.android_array[Xemerald]                = Xemerald;
+    lev.android_array[Xemerald_pause]  = Xemerald;
+    lev.android_array[Xemerald_fall]   = Xemerald;
+    lev.android_array[Yemerald_sB]     = Xemerald;
+    lev.android_array[Yemerald_eB]     = Xemerald;
+    lev.android_array[Yemerald_wB]     = Xemerald;
   }
 
   if (temp & 2)
   {
-    lev.android_array[Xdiamond] =
-      lev.android_array[Xdiamond_pause] =
-      lev.android_array[Xdiamond_fall] =
-      lev.android_array[Ydiamond_sB] =
-      lev.android_array[Ydiamond_eB] =
-      lev.android_array[Ydiamond_wB] = Xdiamond;
+    lev.android_array[Xdiamond]                = Xdiamond;
+    lev.android_array[Xdiamond_pause]  = Xdiamond;
+    lev.android_array[Xdiamond_fall]   = Xdiamond;
+    lev.android_array[Ydiamond_sB]     = Xdiamond;
+    lev.android_array[Ydiamond_eB]     = Xdiamond;
+    lev.android_array[Ydiamond_wB]     = Xdiamond;
   }
 
   if (temp & 4)
   {
-    lev.android_array[Xstone] =
-      lev.android_array[Xstone_pause] =
-      lev.android_array[Xstone_fall] =
-      lev.android_array[Ystone_sB] =
-      lev.android_array[Ystone_eB] =
-      lev.android_array[Ystone_wB] = Xstone;
+    lev.android_array[Xstone]          = Xstone;
+    lev.android_array[Xstone_pause]    = Xstone;
+    lev.android_array[Xstone_fall]     = Xstone;
+    lev.android_array[Ystone_sB]       = Xstone;
+    lev.android_array[Ystone_eB]       = Xstone;
+    lev.android_array[Ystone_wB]       = Xstone;
   }
 
   if (temp & 8)
   {
-    lev.android_array[Xbomb] =
-      lev.android_array[Xbomb_pause] =
-      lev.android_array[Xbomb_fall] =
-      lev.android_array[Ybomb_sB] =
-      lev.android_array[Ybomb_eB] =
-      lev.android_array[Ybomb_wB] = Xbomb;
+    lev.android_array[Xbomb]           = Xbomb;
+    lev.android_array[Xbomb_pause]     = Xbomb;
+    lev.android_array[Xbomb_fall]      = Xbomb;
+    lev.android_array[Ybomb_sB]                = Xbomb;
+    lev.android_array[Ybomb_eB]                = Xbomb;
+    lev.android_array[Ybomb_wB]                = Xbomb;
   }
 
   if (temp & 16)
   {
-    lev.android_array[Xnut] =
-      lev.android_array[Xnut_pause] =
-      lev.android_array[Xnut_fall] =
-      lev.android_array[Ynut_sB] =
-      lev.android_array[Ynut_eB] =
-      lev.android_array[Ynut_wB] = Xnut;
+    lev.android_array[Xnut]            = Xnut;
+    lev.android_array[Xnut_pause]      = Xnut;
+    lev.android_array[Xnut_fall]       = Xnut;
+    lev.android_array[Ynut_sB]         = Xnut;
+    lev.android_array[Ynut_eB]         = Xnut;
+    lev.android_array[Ynut_wB]         = Xnut;
   }
 
   if (temp & 32)
   {
-    lev.android_array[Xtank_n] =
-      lev.android_array[Xtank_gon] =
-      lev.android_array[Ytank_nB] =
-      lev.android_array[Ytank_n_e] =
-      lev.android_array[Ytank_n_w] = Xtank_n;
-
-    lev.android_array[Xtank_e] =
-      lev.android_array[Xtank_goe] =
-      lev.android_array[Ytank_eB] =
-      lev.android_array[Ytank_e_s] =
-      lev.android_array[Ytank_e_n] = Xtank_e;
-
-    lev.android_array[Xtank_s] =
-      lev.android_array[Xtank_gos] =
-      lev.android_array[Ytank_sB] =
-      lev.android_array[Ytank_s_w] =
-      lev.android_array[Ytank_s_e] = Xtank_s;
-
-    lev.android_array[Xtank_w] =
-      lev.android_array[Xtank_gow] =
-      lev.android_array[Ytank_wB] =
-      lev.android_array[Ytank_w_n] =
-      lev.android_array[Ytank_w_s] = Xtank_w;
+    lev.android_array[Xtank_n]         = Xtank_n;
+    lev.android_array[Xtank_gon]       = Xtank_n;
+    lev.android_array[Ytank_nB]                = Xtank_n;
+    lev.android_array[Ytank_n_e]       = Xtank_n;
+    lev.android_array[Ytank_n_w]       = Xtank_n;
+
+    lev.android_array[Xtank_e]         = Xtank_e;
+    lev.android_array[Xtank_goe]       = Xtank_e;
+    lev.android_array[Ytank_eB]                = Xtank_e;
+    lev.android_array[Ytank_e_s]       = Xtank_e;
+    lev.android_array[Ytank_e_n]       = Xtank_e;
+
+    lev.android_array[Xtank_s]         = Xtank_s;
+    lev.android_array[Xtank_gos]       = Xtank_s;
+    lev.android_array[Ytank_sB]                = Xtank_s;
+    lev.android_array[Ytank_s_w]       = Xtank_s;
+    lev.android_array[Ytank_s_e]       = Xtank_s;
+
+    lev.android_array[Xtank_w]         = Xtank_w;
+    lev.android_array[Xtank_gow]       = Xtank_w;
+    lev.android_array[Ytank_wB]                = Xtank_w;
+    lev.android_array[Ytank_w_n]       = Xtank_w;
+    lev.android_array[Ytank_w_s]       = Xtank_w;
   }
 
   if (temp & 64)
   {
-    lev.android_array[Xeater_n] = lev.android_array[Yeater_nB] = Xeater_n;
-    lev.android_array[Xeater_e] = lev.android_array[Yeater_eB] = Xeater_e;
-    lev.android_array[Xeater_s] = lev.android_array[Yeater_sB] = Xeater_s;
-    lev.android_array[Xeater_w] = lev.android_array[Yeater_wB] = Xeater_w;
+    lev.android_array[Xeater_n]                = Xeater_n;
+    lev.android_array[Yeater_nB]       = Xeater_n;
+
+    lev.android_array[Xeater_e]                = Xeater_e;
+    lev.android_array[Yeater_eB]       = Xeater_e;
+
+    lev.android_array[Xeater_s]                = Xeater_s;
+    lev.android_array[Yeater_sB]       = Xeater_s;
+
+    lev.android_array[Xeater_w]                = Xeater_w;
+    lev.android_array[Yeater_wB]       = Xeater_w;
   }
 
   if (temp & 128)
   {
-    lev.android_array[Xbug_n] =
-      lev.android_array[Xbug_gon] =
-      lev.android_array[Ybug_nB] =
-      lev.android_array[Ybug_n_e] =
-      lev.android_array[Ybug_n_w] = Xbug_gon;
-
-    lev.android_array[Xbug_e] =
-      lev.android_array[Xbug_goe] =
-      lev.android_array[Ybug_eB] =
-      lev.android_array[Ybug_e_s] =
-      lev.android_array[Ybug_e_n] = Xbug_goe;
-
-    lev.android_array[Xbug_s] =
-      lev.android_array[Xbug_gos] =
-      lev.android_array[Ybug_sB] =
-      lev.android_array[Ybug_s_w] =
-      lev.android_array[Ybug_s_e] = Xbug_gos;
-
-    lev.android_array[Xbug_w] =
-      lev.android_array[Xbug_gow] =
-      lev.android_array[Ybug_wB] =
-      lev.android_array[Ybug_w_n] =
-      lev.android_array[Ybug_w_s] = Xbug_gow;
+    lev.android_array[Xbug_n]          = Xbug_gon;
+    lev.android_array[Xbug_gon]                = Xbug_gon;
+    lev.android_array[Ybug_nB]         = Xbug_gon;
+    lev.android_array[Ybug_n_e]                = Xbug_gon;
+    lev.android_array[Ybug_n_w]                = Xbug_gon;
+
+    lev.android_array[Xbug_e]          = Xbug_goe;
+    lev.android_array[Xbug_goe]                = Xbug_goe;
+    lev.android_array[Ybug_eB]         = Xbug_goe;
+    lev.android_array[Ybug_e_s]                = Xbug_goe;
+    lev.android_array[Ybug_e_n]                = Xbug_goe;
+
+    lev.android_array[Xbug_s]          = Xbug_gos;
+    lev.android_array[Xbug_gos]                = Xbug_gos;
+    lev.android_array[Ybug_sB]         = Xbug_gos;
+    lev.android_array[Ybug_s_w]                = Xbug_gos;
+    lev.android_array[Ybug_s_e]                = Xbug_gos;
+
+    lev.android_array[Xbug_w]          = Xbug_gow;
+    lev.android_array[Xbug_gow]                = Xbug_gow;
+    lev.android_array[Ybug_wB]         = Xbug_gow;
+    lev.android_array[Ybug_w_n]                = Xbug_gow;
+    lev.android_array[Ybug_w_s]                = Xbug_gow;
   }
 
   if (temp & 256)
   {
-    lev.android_array[Xalien] = lev.android_array[Xalien_pause] =
-      lev.android_array[Yalien_nB] = lev.android_array[Yalien_eB] =
-      lev.android_array[Yalien_sB] = lev.android_array[Yalien_wB] = Xalien;
+    lev.android_array[Xalien]          = Xalien;
+    lev.android_array[Xalien_pause]    = Xalien;
+    lev.android_array[Yalien_nB]       = Xalien;
+    lev.android_array[Yalien_eB]       = Xalien;
+    lev.android_array[Yalien_sB]       = Xalien;
+    lev.android_array[Yalien_wB]       = Xalien;
   }
 
   if (temp & 512)
   {
-    lev.android_array[Xspring] =
-      lev.android_array[Xspring_pause] =
-      lev.android_array[Xspring_e] =
-      lev.android_array[Yspring_eB] =
-      lev.android_array[Yspring_kill_eB] =
-      lev.android_array[Xspring_w] =
-      lev.android_array[Yspring_wB] =
-      lev.android_array[Yspring_kill_wB] =
-      lev.android_array[Xspring_fall] =
-      lev.android_array[Yspring_sB] = Xspring;
+    lev.android_array[Xspring]         = Xspring;
+    lev.android_array[Xspring_pause]   = Xspring;
+    lev.android_array[Xspring_e]       = Xspring;
+    lev.android_array[Yspring_eB]      = Xspring;
+    lev.android_array[Yspring_kill_eB] = Xspring;
+    lev.android_array[Xspring_w]       = Xspring;
+    lev.android_array[Yspring_wB]      = Xspring;
+    lev.android_array[Yspring_kill_wB] = Xspring;
+    lev.android_array[Xspring_fall]    = Xspring;
+    lev.android_array[Yspring_sB]      = Xspring;
   }
 
   if (temp & 1024)
   {
-    lev.android_array[Yballoon_nB] =
-      lev.android_array[Yballoon_eB] =
-      lev.android_array[Yballoon_sB] =
-      lev.android_array[Yballoon_wB] =
-      lev.android_array[Xballoon] = Xballoon;
+    lev.android_array[Yballoon_nB]     = Xballoon;
+    lev.android_array[Yballoon_eB]     = Xballoon;
+    lev.android_array[Yballoon_sB]     = Xballoon;
+    lev.android_array[Yballoon_wB]     = Xballoon;
+    lev.android_array[Xballoon]                = Xballoon;
   }
 
   if (temp & 2048)
   {
-    lev.android_array[Xdripper] =
-      lev.android_array[XdripperB] =
-      lev.android_array[Xamoeba_1] =
-      lev.android_array[Xamoeba_2] =
-      lev.android_array[Xamoeba_3] =
-      lev.android_array[Xamoeba_4] =
-      lev.android_array[Xamoeba_5] =
-      lev.android_array[Xamoeba_6] =
-      lev.android_array[Xamoeba_7] =
-      lev.android_array[Xamoeba_8] = Xdrip_eat;
+    lev.android_array[Xdripper]                = Xdrip_eat;
+    lev.android_array[XdripperB]       = Xdrip_eat;
+    lev.android_array[Xamoeba_1]       = Xdrip_eat;
+    lev.android_array[Xamoeba_2]       = Xdrip_eat;
+    lev.android_array[Xamoeba_3]       = Xdrip_eat;
+    lev.android_array[Xamoeba_4]       = Xdrip_eat;
+    lev.android_array[Xamoeba_5]       = Xdrip_eat;
+    lev.android_array[Xamoeba_6]       = Xdrip_eat;
+    lev.android_array[Xamoeba_7]       = Xdrip_eat;
+    lev.android_array[Xamoeba_8]       = Xdrip_eat;
   }
 
   if (temp & 4096)
   {
-    lev.android_array[Xdynamite] = Xdynamite;
+    lev.android_array[Xdynamite]       = Xdynamite;
   }
 
   for (temp = 1; temp < 2047; temp++)
index 6b00cb9077bd8a7b1119e36c58d3e2882bb0c381..eac7d298c4f0ce812cb954f21e3b08953040d569 100644 (file)
@@ -1809,6 +1809,7 @@ void InitElementPropertiesStatic()
     EL_SP_BUGGY_BASE_ACTIVE,
     EL_EMC_PLANT,
 #endif
+
     -1
   };
 
@@ -1851,6 +1852,7 @@ void InitElementPropertiesStatic()
     EL_SPEED_PILL,
     EL_EMC_LENSES,
     EL_EMC_MAGNIFIER,
+
     -1
   };
 
@@ -1881,6 +1883,7 @@ void InitElementPropertiesStatic()
     EL_SP_BUGGY_BASE_ACTIVE,
     EL_EMC_PLANT,
 #endif
+
     -1
   };
 
@@ -1899,6 +1902,7 @@ void InitElementPropertiesStatic()
     EL_PACMAN,
     EL_SP_SNIKSNAK,
     EL_SP_ELECTRON,
+
     -1
   };
 
@@ -1908,6 +1912,7 @@ void InitElementPropertiesStatic()
     EL_SPACESHIP,
     EL_BD_BUTTERFLY,
     EL_BD_FIREFLY,
+
     -1
   };
 
@@ -2028,6 +2033,7 @@ void InitElementPropertiesStatic()
     EL_TUBE_LEFT_DOWN,
     EL_TUBE_RIGHT_UP,
     EL_TUBE_RIGHT_DOWN,
+
     -1
   };
 
@@ -2069,6 +2075,9 @@ void InitElementPropertiesStatic()
     EL_EMC_WALL_SLIPPERY_2,
     EL_EMC_WALL_SLIPPERY_3,
     EL_EMC_WALL_SLIPPERY_4,
+    EL_EMC_MAGIC_BALL,
+    EL_EMC_MAGIC_BALL_ACTIVE,
+
     -1
   };
 
@@ -2098,6 +2107,7 @@ void InitElementPropertiesStatic()
     EL_BALLOON,
     EL_SPRING,
     EL_EMC_ANDROID,
+
     -1
   };
 
@@ -2126,6 +2136,7 @@ void InitElementPropertiesStatic()
     EL_CRYSTAL,
     EL_SPRING,
     EL_DX_SUPABOMB,
+
     -1
   };
 
@@ -2151,6 +2162,7 @@ void InitElementPropertiesStatic()
     EL_CRYSTAL,
     EL_SPRING,
     EL_DX_SUPABOMB,
+
     -1
   };
 
@@ -2159,6 +2171,7 @@ void InitElementPropertiesStatic()
     EL_ROCK,
     EL_BD_ROCK,
     EL_SP_ZONK,
+
     -1
   };
 
@@ -2167,6 +2180,7 @@ void InitElementPropertiesStatic()
     EL_ROCK,
     EL_BD_ROCK,
     EL_SP_ZONK,
+
     -1
   };
 
@@ -2203,6 +2217,7 @@ void InitElementPropertiesStatic()
 #if 0
     EL_BLACK_ORB,
 #endif
+
     -1
   };
 
@@ -2218,6 +2233,7 @@ void InitElementPropertiesStatic()
     EL_PIG,
     EL_DRAGON,
     EL_MOLE,
+
     -1
   };
 
@@ -2226,6 +2242,7 @@ void InitElementPropertiesStatic()
     EL_BOMB,
     EL_SP_DISK_ORANGE,
     EL_DX_SUPABOMB,
+
     -1
   };
 
@@ -2252,6 +2269,7 @@ void InitElementPropertiesStatic()
     EL_PENGUIN,
     EL_PIG,
     EL_DRAGON,
+
     -1
   };
 
@@ -2268,6 +2286,7 @@ void InitElementPropertiesStatic()
     EL_TUBE_LEFT_DOWN,
     EL_TUBE_RIGHT_UP,
     EL_TUBE_RIGHT_DOWN,
+
     -1
   };
 
@@ -2304,6 +2323,7 @@ void InitElementPropertiesStatic()
     EL_EMC_GATE_8_GRAY_ACTIVE,
     EL_SWITCHGATE_OPEN,
     EL_TIMEGATE_OPEN,
+
     -1
   };
 
@@ -2328,6 +2348,7 @@ void InitElementPropertiesStatic()
     EL_SP_GRAVITY_OFF_PORT_RIGHT,
     EL_SP_GRAVITY_OFF_PORT_UP,
     EL_SP_GRAVITY_OFF_PORT_DOWN,
+
     -1
   };
 
@@ -2363,6 +2384,7 @@ void InitElementPropertiesStatic()
     EL_SP_DISK_YELLOW,
     EL_BALLOON,
     EL_EMC_ANDROID,
+
     -1
   };
 
@@ -2434,6 +2456,7 @@ void InitElementPropertiesStatic()
     EL_SP_GRAVITY_OFF_PORT_RIGHT,
     EL_SP_GRAVITY_OFF_PORT_UP,
     EL_SP_GRAVITY_OFF_PORT_DOWN,
+
     -1
   };
 
@@ -2475,6 +2498,7 @@ void InitElementPropertiesStatic()
 
     /* elements that can explode only by explosion */
     EL_BLACK_ORB,
+
     -1
   };
 
@@ -2505,6 +2529,7 @@ void InitElementPropertiesStatic()
     EL_SP_GRAVITY_OFF_PORT_UP,
     EL_SP_GRAVITY_OFF_PORT_DOWN,
     EL_EMC_GRASS,
+
     -1
   };
 
@@ -2517,6 +2542,7 @@ void InitElementPropertiesStatic()
     EL_SP_MURPHY,
     EL_SOKOBAN_FIELD_PLAYER,
     EL_TRIGGER_PLAYER,
+
     -1
   };
 
@@ -2530,6 +2556,7 @@ void InitElementPropertiesStatic()
     EL_EMERALD_RED,
     EL_EMERALD_PURPLE,
     EL_DIAMOND,
+
     -1
   };
 
@@ -2563,6 +2590,8 @@ void InitElementPropertiesStatic()
     EL_LAMP,
     EL_TIME_ORB_FULL,
     EL_EMC_MAGIC_BALL_SWITCH,
+    EL_EMC_MAGIC_BALL_SWITCH_ACTIVE,
+
     -1
   };
 
@@ -2596,6 +2625,7 @@ void InitElementPropertiesStatic()
     EL_BD_AMOEBA,
     EL_CHAR_QUESTION,
     EL_UNKNOWN,
+
     -1
   };
 
@@ -2670,6 +2700,7 @@ void InitElementPropertiesStatic()
     EL_SP_BUGGY_BASE_ACTIVE,
     EL_SP_EXIT_OPENING,
     EL_SP_EXIT_CLOSING,
+
     -1
   };
 
@@ -2686,6 +2717,7 @@ void InitElementPropertiesStatic()
     EL_PLAYER_3,
     EL_PLAYER_4,
     EL_INVISIBLE_STEELWALL,
+
     -1
   };
 
@@ -2697,6 +2729,7 @@ void InitElementPropertiesStatic()
     EL_EMERALD_RED,
     EL_EMERALD_PURPLE,
     EL_DIAMOND,
+
     -1
   };
 
@@ -2724,6 +2757,7 @@ void InitElementPropertiesStatic()
     EL_DIAMOND,
     EL_PEARL,
     EL_CRYSTAL,
+
     -1
   };
 
@@ -2737,6 +2771,7 @@ void InitElementPropertiesStatic()
     EL_DIAMOND,
     EL_PEARL,
     EL_CRYSTAL,
+
     -1
   };
 
@@ -2748,6 +2783,7 @@ void InitElementPropertiesStatic()
     EL_EMERALD_RED,
     EL_EMERALD_PURPLE,
     EL_DIAMOND,
+
     -1
   };
 
@@ -2826,6 +2862,7 @@ void InitElementPropertiesStatic()
     EL_EMC_WALL_6,
     EL_EMC_WALL_7,
     EL_EMC_WALL_8,
+
     -1
   };
 
@@ -2989,6 +3026,7 @@ void InitElementPropertiesStatic()
     EL_TUBE_LEFT_DOWN,
     EL_TUBE_RIGHT_UP,
     EL_TUBE_RIGHT_DOWN,
+
     -1
   };
 
@@ -3005,6 +3043,7 @@ void InitElementPropertiesStatic()
     EL_PACMAN,
     EL_SP_SNIKSNAK,
     EL_SP_ELECTRON,
+
     -1
   };
 
@@ -3022,6 +3061,7 @@ void InitElementPropertiesStatic()
     EL_CONVEYOR_BELT_4_LEFT,
     EL_CONVEYOR_BELT_4_MIDDLE,
     EL_CONVEYOR_BELT_4_RIGHT,
+
     -1
   };
 
@@ -3039,6 +3079,7 @@ void InitElementPropertiesStatic()
     EL_CONVEYOR_BELT_4_LEFT_ACTIVE,
     EL_CONVEYOR_BELT_4_MIDDLE_ACTIVE,
     EL_CONVEYOR_BELT_4_RIGHT_ACTIVE,
+
     -1
   };
 
@@ -3056,6 +3097,7 @@ void InitElementPropertiesStatic()
     EL_CONVEYOR_BELT_4_SWITCH_LEFT,
     EL_CONVEYOR_BELT_4_SWITCH_MIDDLE,
     EL_CONVEYOR_BELT_4_SWITCH_RIGHT,
+
     -1
   };
 
@@ -3072,6 +3114,7 @@ void InitElementPropertiesStatic()
     EL_TUBE_VERTICAL_LEFT,
     EL_TUBE_VERTICAL_RIGHT,
     EL_TUBE_ANY,
+
     -1
   };
 
@@ -3113,6 +3156,7 @@ void InitElementPropertiesStatic()
     EL_EMC_GATE_6_GRAY_ACTIVE,
     EL_EMC_GATE_7_GRAY_ACTIVE,
     EL_EMC_GATE_8_GRAY_ACTIVE,
+
     -1
   };
 
@@ -3123,6 +3167,7 @@ void InitElementPropertiesStatic()
     EL_AMOEBA_DRY,
     EL_AMOEBA_FULL,
     EL_BD_AMOEBA,
+
     -1
   };
 
@@ -3132,6 +3177,7 @@ void InitElementPropertiesStatic()
     EL_AMOEBA_DRY,
     EL_AMOEBA_FULL,
     EL_BD_AMOEBA,
+
     -1
   };
 
@@ -3148,6 +3194,7 @@ void InitElementPropertiesStatic()
     EL_AMOEBA_FULL,
     EL_BD_AMOEBA,
     EL_EMC_MAGIC_BALL,
+
     -1
   };
 
@@ -3166,6 +3213,7 @@ void InitElementPropertiesStatic()
     EL_AMOEBA_FULL,
     EL_GAME_OF_LIFE,
     EL_BIOMAZE,
+
     -1
   };
 
@@ -3177,6 +3225,7 @@ void InitElementPropertiesStatic()
     EL_DYNABOMB_PLAYER_3_ACTIVE,
     EL_DYNABOMB_PLAYER_4_ACTIVE,
     EL_SP_DISK_RED_ACTIVE,
+
     -1
   };
 
@@ -3361,6 +3410,7 @@ void InitElementPropertiesStatic()
     EL_EMC_WALL_14,
     EL_EMC_WALL_15,
     EL_EMC_WALL_16,
+
     -1
   };
 
@@ -3375,6 +3425,7 @@ void InitElementPropertiesStatic()
     EL_LANDMINE,
     EL_TRAP,
     EL_TRAP_ACTIVE,
+
     -1
   };
 
@@ -3394,6 +3445,7 @@ void InitElementPropertiesStatic()
     EL_INTERNAL_CASCADE_USER_ACTIVE,
     EL_INTERNAL_CASCADE_GENERIC_ACTIVE,
     EL_INTERNAL_CASCADE_DYNAMIC_ACTIVE,
+
     -1
   };
 
@@ -3413,6 +3465,7 @@ void InitElementPropertiesStatic()
     EL_INTERNAL_CASCADE_USER,
     EL_INTERNAL_CASCADE_GENERIC,
     EL_INTERNAL_CASCADE_DYNAMIC,
+
     -1
   };
 
index 833f32ddd1a14a1f728980ce493c2866cfabf138..c723314da1beff2bd100566104d0fe042d6c01f1 100644 (file)
@@ -2015,6 +2015,8 @@ struct GameInfo
   /* values for the new EMC elements */
   int lenses_time_left;
   int magnify_time_left;
+  boolean ball_state;
+  int ball_content_nr;
 #endif
 
   /* values for player idle animation (no effect on engine) */