rnd-19981229-1
authorHolger Schemel <info@artsoft.org>
Mon, 28 Dec 1998 23:44:37 +0000 (00:44 +0100)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:32:43 +0000 (10:32 +0200)
src/editor.c
src/game.c
src/init.c
src/main.h

index 2d20b09ebf49008d94b0cb4a0641dd49a3de3c1c..7c453d92dd8f8090959ce9e4f4e85fe5fba48336 100644 (file)
@@ -384,6 +384,71 @@ int editor_element[] =
   EL_SOKOBAN_FELD_VOLL,
   EL_BETON,
 
+  EL_LEERRAUM,
+  EL_LEERRAUM,
+  EL_LEERRAUM,
+  EL_LEERRAUM,
+
+  EL_CHAR('S'),
+  EL_CHAR('U'),
+  EL_CHAR('P'),
+  EL_CHAR('A'),
+
+  EL_CHAR('P'),
+  EL_CHAR('L'),
+  EL_CHAR('E'),
+  EL_CHAR('X'),
+
+  EL_SP_EMPTY,
+  EL_SP_ZONK,
+  EL_SP_BASE,
+  EL_SP_MURPHY,
+
+  EL_SP_INFOTRON,
+  EL_SP_CHIP_SINGLE,
+  EL_SP_HARD_GRAY,
+  EL_SP_EXIT,
+
+  EL_SP_DISK_ORANGE,
+  EL_SP_PORT1_RIGHT,
+  EL_SP_PORT1_DOWN,
+  EL_SP_PORT1_LEFT,
+
+  EL_SP_PORT1_UP,
+  EL_SP_PORT2_RIGHT,
+  EL_SP_PORT2_DOWN,
+  EL_SP_PORT2_LEFT,
+
+  EL_SP_PORT2_UP,
+  EL_SP_SNIKSNAK,
+  EL_SP_DISK_YELLOW,
+  EL_SP_TERMINAL,
+
+  EL_SP_DISK_RED,
+  EL_SP_PORT_Y,
+  EL_SP_PORT_X,
+  EL_SP_PORT_XY,
+
+  EL_SP_ELECTRON,
+  EL_SP_BUG,
+  EL_SP_CHIP_LEFT,
+  EL_SP_CHIP_RIGHT,
+
+  EL_SP_HARD_BASE1,
+  EL_SP_HARD_GREEN,
+  EL_SP_HARD_BLUE,
+  EL_SP_HARD_RED,
+
+  EL_SP_HARD_YELLOW,
+  EL_SP_HARD_BASE2,
+  EL_SP_HARD_BASE3,
+  EL_SP_HARD_BASE4,
+
+  EL_SP_HARD_BASE5,
+  EL_SP_HARD_BASE6,
+  EL_SP_CHIP_UPPER,
+  EL_SP_CHIP_LOWER,
+
 /*
   EL_CHAR_A + ('D' - 'A'),
   EL_CHAR_A + ('Y' - 'A'),
@@ -479,62 +544,7 @@ int editor_element[] =
   EL_CHAR_OE,
   EL_CHAR_UE,
   EL_CHAR_COPY,
-  EL_LEERRAUM,
-
-  EL_LEERRAUM,
-  EL_LEERRAUM,
-  EL_LEERRAUM,
-  EL_LEERRAUM,
-
-  EL_LEERRAUM,
-  EL_SP_ZONK,
-  EL_SP_BASE,
-  EL_SP_MURPHY,
-
-  EL_SP_INFOTRON,
-  EL_SP_CHIP_SINGLE,
-  EL_SP_HARD_GRAY,
-  EL_SP_EXIT,
-
-  EL_SP_DISK_ORANGE,
-  EL_SP_PORT1_RIGHT,
-  EL_SP_PORT1_DOWN,
-  EL_SP_PORT1_LEFT,
-
-  EL_SP_PORT1_UP,
-  EL_SP_PORT2_RIGHT,
-  EL_SP_PORT2_DOWN,
-  EL_SP_PORT2_LEFT,
-
-  EL_SP_PORT2_UP,
-  EL_SP_SNIKSNAK,
-  EL_SP_DISK_YELLOW,
-  EL_SP_TERMINAL,
-
-  EL_SP_DISK_RED,
-  EL_SP_PORT_Y,
-  EL_SP_PORT_X,
-  EL_SP_PORT_XY,
-
-  EL_SP_ELECTRON,
-  EL_SP_BUG,
-  EL_SP_CHIP_LEFT,
-  EL_SP_CHIP_RIGHT,
-
-  EL_SP_HARD_BASE1,
-  EL_SP_HARD_GREEN,
-  EL_SP_HARD_BLUE,
-  EL_SP_HARD_RED,
-
-  EL_SP_HARD_YELLOW,
-  EL_SP_HARD_BASE2,
-  EL_SP_HARD_BASE3,
-  EL_SP_HARD_BASE4,
-
-  EL_SP_HARD_BASE5,
-  EL_SP_HARD_BASE6,
-  EL_SP_CHIP_UPPER,
-  EL_SP_CHIP_LOWER
+  EL_LEERRAUM
 };
 int elements_in_list = sizeof(editor_element)/sizeof(int);
 
index e1977faf19ecae71ff9d8d5944e2cfc9686cb0c6..a250fc9da64528bed70d668aaee52d0c6a6f046f 100644 (file)
@@ -261,6 +261,8 @@ static void InitField(int x, int y, boolean init_game)
     case EL_MAMPFER2:
     case EL_ROBOT:
     case EL_PACMAN:
+    case EL_SP_SNIKSNAK:
+    case EL_SP_ELECTRON:
       InitMovDir(x, y);
       break;
 
@@ -653,7 +655,9 @@ void InitMovDir(int x, int y)
       if (element != EL_KAEFER &&
          element != EL_FLIEGER &&
          element != EL_BUTTERFLY &&
-         element != EL_FIREFLY)
+         element != EL_FIREFLY &&
+         element != EL_SP_SNIKSNAK &&
+         element != EL_SP_ELECTRON)
        break;
 
       for (i=0; i<4; i++)
@@ -668,7 +672,8 @@ void InitMovDir(int x, int y)
            MovDir[x][y] = direction[0][i];
            break;
          }
-         else if (element == EL_FLIEGER || element == EL_FIREFLY)
+         else if (element == EL_FLIEGER || element == EL_FIREFLY ||
+                  element == EL_SP_SNIKSNAK || element == EL_SP_ELECTRON)
          {
            MovDir[x][y] = direction[1][i];
            break;
@@ -1285,7 +1290,8 @@ void Impact(int x, int y)
     return;
   }
 
-  if (element == EL_BOMBE && (lastline || object_hit)) /* element is bomb */
+  if ((element == EL_BOMBE || element == EL_SP_DISK_ORANGE) &&
+      (lastline || object_hit))        /* element is bomb */
   {
     Bang(x, y);
     return;
@@ -1345,8 +1351,9 @@ void Impact(int x, int y)
     }
     else if (element == EL_FELSBROCKEN)
     {
-      if (IS_ENEMY(smashed) || smashed == EL_BOMBE || smashed == EL_SONDE ||
-         smashed == EL_SCHWEIN || smashed == EL_DRACHE)
+      if (IS_ENEMY(smashed) ||
+         smashed == EL_BOMBE || smashed == EL_SP_DISK_ORANGE ||
+         smashed == EL_SONDE || smashed == EL_SCHWEIN || smashed == EL_DRACHE)
       {
        Bang(x, y+1);
        return;
@@ -1485,7 +1492,8 @@ void TurnRound(int x, int y)
     else if (element == EL_BUTTERFLY)  /* && MovDir[x][y] == left_dir) */
       MovDelay[x][y] = 1;
   }
-  else if (element == EL_FLIEGER || element == EL_FIREFLY)
+  else if (element == EL_FLIEGER || element == EL_FIREFLY ||
+          element == EL_SP_SNIKSNAK || element == EL_SP_ELECTRON)
   {
     TestIfBadThingHitsOtherBadThing(x, y);
 
@@ -1496,7 +1504,9 @@ void TurnRound(int x, int y)
             !IS_FREE_OR_PLAYER(move_x, move_y))
       MovDir[x][y] = right_dir;
 
-    if (element == EL_FLIEGER && MovDir[x][y] != old_move_dir)
+    if ((element == EL_FLIEGER ||
+        element == EL_SP_SNIKSNAK || element == EL_SP_ELECTRON)
+       && MovDir[x][y] != old_move_dir)
       MovDelay[x][y] = 9;
     else if (element == EL_FIREFLY)    /* && MovDir[x][y] == right_dir) */
       MovDelay[x][y] = 1;
@@ -1974,7 +1984,9 @@ void StartMoving(int x, int y)
       if (element!=EL_MAMPFER && element!=EL_MAMPFER2 && element!=EL_PACMAN)
       {
        TurnRound(x, y);
-       if (MovDelay[x][y] && (element == EL_KAEFER || element == EL_FLIEGER))
+       if (MovDelay[x][y] && (element == EL_KAEFER || element == EL_FLIEGER ||
+                              element == EL_SP_SNIKSNAK ||
+                              element == EL_SP_ELECTRON))
          DrawLevelField(x, y);
       }
     }
@@ -2219,7 +2231,8 @@ void StartMoving(int x, int y)
 
       TurnRound(x, y);
 
-      if (element == EL_KAEFER || element == EL_FLIEGER)
+      if (element == EL_KAEFER || element == EL_FLIEGER ||
+         element == EL_SP_SNIKSNAK || element == EL_SP_ELECTRON)
        DrawLevelField(x, y);
       else if (element == EL_BUTTERFLY || element == EL_FIREFLY)
        DrawGraphicAnimation(x, y, el2gfx(element), 2, 4, ANIM_NORMAL);
@@ -2249,7 +2262,7 @@ void ContinueMoving(int x, int y)
   int newx = x + dx, newy = y + dy;
   int step = (horiz_move ? dx : dy) * TILEX/8;
 
-  if (CAN_FALL(element) && horiz_move)
+  if (CAN_FALL(element) && horiz_move && !IS_SP_ELEMENT(element))
     step*=2;
   else if (element == EL_TROPFEN)
     step/=2;
@@ -2612,7 +2625,7 @@ void AmoebeAbleger(int ax, int ay)
 
     if (newax == ax && neway == ay)            /* amoeba cannot grow */
     {
-      if (i == 4 && !waiting_for_player)
+      if (i == 4 && (!waiting_for_player || game_emulation == EMU_BOULDERDASH))
       {
        Feld[ax][ay] = EL_AMOEBE_TOT;
        DrawLevelField(ax, ay);
@@ -4133,6 +4146,7 @@ int DigField(struct PlayerInfo *player,
       break;
 
     case EL_DYNAMIT_AUS:
+    case EL_SP_DISK_RED:
       RemoveField(x, y);
       player->dynamite++;
       RaiseScoreElement(EL_DYNAMIT);
index ad4cad8b19f267e4453df40b9ce6f37387506bdd..813412453badfcb820fd1f30a14ae591f397ab23 100644 (file)
@@ -1379,6 +1379,51 @@ void InitElementProperties()
   };
   static int ep_eatable_num = sizeof(ep_eatable)/sizeof(int);
 
+  static int ep_sp_element[] =
+  {
+    EL_SP_EMPTY,
+    EL_SP_ZONK,
+    EL_SP_BASE,
+    EL_SP_MURPHY,
+    EL_SP_INFOTRON,
+    EL_SP_CHIP_SINGLE,
+    EL_SP_HARD_GRAY,
+    EL_SP_EXIT,
+    EL_SP_DISK_ORANGE,
+    EL_SP_PORT1_RIGHT,
+    EL_SP_PORT1_DOWN,
+    EL_SP_PORT1_LEFT,
+    EL_SP_PORT1_UP,
+    EL_SP_PORT2_RIGHT,
+    EL_SP_PORT2_DOWN,
+    EL_SP_PORT2_LEFT,
+    EL_SP_PORT2_UP,
+    EL_SP_SNIKSNAK,
+    EL_SP_DISK_YELLOW,
+    EL_SP_TERMINAL,
+    EL_SP_DISK_RED,
+    EL_SP_PORT_Y,
+    EL_SP_PORT_X,
+    EL_SP_PORT_XY,
+    EL_SP_ELECTRON,
+    EL_SP_BUG,
+    EL_SP_CHIP_LEFT,
+    EL_SP_CHIP_RIGHT,
+    EL_SP_HARD_BASE1,
+    EL_SP_HARD_GREEN,
+    EL_SP_HARD_BLUE,
+    EL_SP_HARD_RED,
+    EL_SP_HARD_YELLOW,
+    EL_SP_HARD_BASE2,
+    EL_SP_HARD_BASE3,
+    EL_SP_HARD_BASE4,
+    EL_SP_HARD_BASE5,
+    EL_SP_HARD_BASE6,
+    EL_SP_CHIP_UPPER,
+    EL_SP_CHIP_LOWER
+  };
+  static int ep_sp_element_num = sizeof(ep_sp_element)/sizeof(int);
+
   static long ep_bit[] =
   {
     EP_BIT_AMOEBALIVE,
@@ -1407,7 +1452,8 @@ void InitElementProperties()
     EP_BIT_PUSHABLE,
     EP_BIT_PLAYER,
     EP_BIT_HAS_CONTENT,
-    EP_BIT_EATABLE
+    EP_BIT_EATABLE,
+    EP_BIT_SP_ELEMENT
   };
   static int *ep_array[] =
   {
@@ -1437,7 +1483,8 @@ void InitElementProperties()
     ep_pushable,
     ep_player,
     ep_has_content,
-    ep_eatable
+    ep_eatable,
+    ep_sp_element
   };
   static int *ep_num[] =
   {
@@ -1467,7 +1514,8 @@ void InitElementProperties()
     &ep_pushable_num,
     &ep_player_num,
     &ep_has_content_num,
-    &ep_eatable_num
+    &ep_eatable_num,
+    &ep_sp_element_num
   };
   static int num_properties = sizeof(ep_num)/sizeof(int *);
 
index 892c7899a93b77d140feaf70f3b9dcfff113a7ae..dca91e2e668500794923b773bf5bb903c4619215 100644 (file)
@@ -124,6 +124,7 @@ typedef unsigned char byte;
 #define EP_BIT_PLAYER          (1 << 25)
 #define EP_BIT_HAS_CONTENT     (1 << 26)
 #define EP_BIT_EATABLE         (1 << 27)
+#define EP_BIT_SP_ELEMENT      (1 << 28)
 
 #define IS_AMOEBALIVE(e)       (Elementeigenschaften[e] & EP_BIT_AMOEBALIVE)
 #define IS_AMOEBOID(e)         (Elementeigenschaften[e] & EP_BIT_AMOEBOID)
@@ -153,6 +154,7 @@ typedef unsigned char byte;
 #define ELEM_IS_PLAYER(e)      (Elementeigenschaften[e] & EP_BIT_PLAYER)
 #define HAS_CONTENT(e)         (Elementeigenschaften[e] & EP_BIT_HAS_CONTENT)
 #define IS_EATABLE(e)          (Elementeigenschaften[e] & EP_BIT_EATABLE)
+#define IS_SP_ELEMENT(e)       (Elementeigenschaften[e] & EP_BIT_SP_ELEMENT)
 
 #define IS_PLAYER(x,y)         (ELEM_IS_PLAYER(StorePlayer[x][y]))
 
@@ -698,6 +700,8 @@ extern int          num_bg_loops;
 #define EL_CHAR_COPY           (EL_CHAR_ASCII0+94)
 #define EL_CHAR_END            (EL_CHAR_START+79)
 
+#define EL_CHAR(x)             (EL_CHAR_A + x - 'A')
+
 #define EL_MAUER_X             200
 #define EL_MAUER_Y             201
 #define EL_MAUER_XY            202