rnd-20040424-1-src
[rocksndiamonds.git] / src / init.c
index 6917ee0b1aabc04799fb382eff7feb95d0b7cdeb..04067389c78194fc1ec30a5e7419f2bbe761e157 100644 (file)
@@ -440,14 +440,15 @@ void InitElementGraphicInfo()
     int direction    = element_to_graphic[i].direction;
     boolean crumbled = element_to_graphic[i].crumbled;
     int graphic      = element_to_graphic[i].graphic;
+    int base_graphic = el2baseimg(element);
 
     if (graphic_info[graphic].bitmap == NULL)
       continue;
 
     if ((action > -1 || direction > -1 || crumbled == TRUE) &&
-       el2img(element) != -1)
+       base_graphic != -1)
     {
-      boolean base_redefined = getImageListEntry(el2img(element))->redefined;
+      boolean base_redefined = getImageListEntry(base_graphic)->redefined;
       boolean act_dir_redefined = getImageListEntry(graphic)->redefined;
 
       /* if the base graphic ("emerald", for example) has been redefined,
@@ -759,7 +760,8 @@ void InitElementSpecialGraphicInfo()
     int element = element_to_special_graphic[i].element;
     int special = element_to_special_graphic[i].special;
     int graphic = element_to_special_graphic[i].graphic;
-    boolean base_redefined = getImageListEntry(el2img(element))->redefined;
+    int base_graphic = el2baseimg(element);
+    boolean base_redefined = getImageListEntry(base_graphic)->redefined;
     boolean special_redefined = getImageListEntry(graphic)->redefined;
 
     /* if the base graphic ("emerald", for example) has been redefined,
@@ -1585,6 +1587,7 @@ static int get_special_property_bit(int element, int property_bit_nr)
     { EL_PLAYER_3,             0       },
     { EL_PLAYER_4,             0       },
     { EL_SP_MURPHY,            0       },
+    { EL_SOKOBAN_FIELD_PLAYER, 0       },
 
     /* all element that can move may be able to also move into acid */
     { EL_BUG,                  1       },
@@ -1733,6 +1736,7 @@ void InitElementPropertiesStatic()
     EL_INVISIBLE_SAND_ACTIVE,
 
     /* !!! currently not diggable, but handled by 'ep_dont_run_into' !!! */
+    /* (if amoeba can grow into anything diggable, maybe keep these out) */
 #if 0
     EL_LANDMINE,
     EL_TRAP_ACTIVE,
@@ -2254,6 +2258,11 @@ void InitElementPropertiesStatic()
     -1
   };
 
+  static int ep_throwable[] =
+  {
+    -1
+  };
+
   static int ep_player[] =
   {
     EL_PLAYER_1,
@@ -2261,6 +2270,8 @@ void InitElementPropertiesStatic()
     EL_PLAYER_3,
     EL_PLAYER_4,
     EL_SP_MURPHY,
+    EL_SOKOBAN_FIELD_PLAYER,
+    EL_TRIGGER_PLAYER,
     -1
   };
 
@@ -2322,6 +2333,9 @@ void InitElementPropertiesStatic()
     EL_EXIT_OPEN,
     EL_STEELWALL,
     EL_PLAYER_1,
+    EL_PLAYER_2,
+    EL_PLAYER_3,
+    EL_PLAYER_4,
     EL_BD_FIREFLY,
     EL_BD_FIREFLY_1,
     EL_BD_FIREFLY_2,
@@ -2405,11 +2419,23 @@ void InitElementPropertiesStatic()
     EL_SOKOBAN_OBJECT,
     EL_SOKOBAN_FIELD_EMPTY,
     EL_SOKOBAN_FIELD_FULL,
+    EL_SOKOBAN_FIELD_PLAYER,
     EL_PLAYER_1,
+    EL_PLAYER_2,
+    EL_PLAYER_3,
+    EL_PLAYER_4,
     EL_INVISIBLE_STEELWALL,
     -1
   };
 
+  static int ep_sp_buggy_base[] =
+  {
+    EL_SP_BUGGY_BASE,
+    EL_SP_BUGGY_BASE_ACTIVATING,
+    EL_SP_BUGGY_BASE_ACTIVE,
+    -1
+  };
+
   static int ep_gem[] =
   {
     EL_BD_DIAMOND,
@@ -2832,7 +2858,19 @@ void InitElementPropertiesStatic()
 
   static int ep_can_turn_each_move[] =
   {
-    /* !!! do something !!! */
+    /* !!! do something with this one !!! */
+    -1
+  };
+
+  static int ep_can_grow[] =
+  {
+    EL_BD_AMOEBA,
+    EL_AMOEBA_DROP,
+    EL_AMOEBA_WET,
+    EL_AMOEBA_DRY,
+    EL_AMOEBA_FULL,
+    EL_GAME_OF_LIFE,
+    EL_BIOMAZE,
     -1
   };
 
@@ -3034,6 +3072,7 @@ void InitElementPropertiesStatic()
     { ep_pushable,             EP_PUSHABLE             },
     { ep_can_explode_cross,    EP_CAN_EXPLODE_CROSS    },
     { ep_protected,            EP_PROTECTED            },
+    { ep_throwable,            EP_THROWABLE            },
 
     { ep_player,               EP_PLAYER               },
     { ep_can_pass_magic_wall,  EP_CAN_PASS_MAGIC_WALL  },
@@ -3041,6 +3080,7 @@ void InitElementPropertiesStatic()
     { ep_bd_element,           EP_BD_ELEMENT           },
     { ep_sp_element,           EP_SP_ELEMENT           },
     { ep_sb_element,           EP_SB_ELEMENT           },
+    { ep_sp_buggy_base,                EP_SP_BUGGY_BASE        },
     { ep_gem,                  EP_GEM                  },
     { ep_food_dark_yamyam,     EP_FOOD_DARK_YAMYAM     },
     { ep_food_penguin,         EP_FOOD_PENGUIN         },
@@ -3057,6 +3097,7 @@ void InitElementPropertiesStatic()
     { ep_amoebalive,           EP_AMOEBALIVE           },
     { ep_has_content,          EP_HAS_CONTENT          },
     { ep_can_turn_each_move,   EP_CAN_TURN_EACH_MOVE   },
+    { ep_can_grow,             EP_CAN_GROW             },
     { ep_active_bomb,          EP_ACTIVE_BOMB          },
     { ep_inactive,             EP_INACTIVE             },
 
@@ -3235,7 +3276,8 @@ void InitElementPropertiesEngine(int engine_version)
 
     /* ---------- COLLECTIBLE ---------------------------------------------- */
     SET_PROPERTY(i, EP_COLLECTIBLE, (IS_COLLECTIBLE_ONLY(i) ||
-                                    IS_DROPPABLE(i)));
+                                    IS_DROPPABLE(i) ||
+                                    IS_THROWABLE(i)));
 
     /* ---------- SNAPPABLE ------------------------------------------------ */
     SET_PROPERTY(i, EP_SNAPPABLE, (IS_DIGGABLE(i) ||
@@ -3325,9 +3367,14 @@ void InitElementPropertiesEngine(int engine_version)
                                     CAN_EXPLODE_IMPACT(i)));
 
     /* ---------- CAN_EXPLODE_3X3 ------------------------------------------ */
+#if 0
+    SET_PROPERTY(i, EP_CAN_EXPLODE_3X3, (!CAN_EXPLODE_1X1(i) &&
+                                        !CAN_EXPLODE_CROSS(i)));
+#else
     SET_PROPERTY(i, EP_CAN_EXPLODE_3X3, (CAN_EXPLODE(i) &&
                                         !CAN_EXPLODE_1X1(i) &&
                                         !CAN_EXPLODE_CROSS(i)));
+#endif
 
     /* ---------- CAN_EXPLODE_BY_DRAGONFIRE -------------------------------- */
     SET_PROPERTY(i, EP_CAN_EXPLODE_BY_DRAGONFIRE, CAN_EXPLODE_BY_FIRE(i));
@@ -3345,6 +3392,10 @@ void InitElementPropertiesEngine(int engine_version)
     SET_PROPERTY(i, EP_MAYBE_DONT_COLLIDE_WITH, (i == EL_SP_SNIKSNAK ||
                                                 i == EL_SP_ELECTRON));
 
+    /* ---------- DIGGABLE_WITH_GRAVITY ------------------------------------ */
+    SET_PROPERTY(i, EP_DIGGABLE_WITH_GRAVITY, (IS_DIGGABLE(i) &&
+                                              !IS_SP_BUGGY_BASE(i)));
+
     /* ---------- CAN_MOVE_INTO_ACID --------------------------------------- */
     if (COULD_MOVE_INTO_ACID(i) && !IS_CUSTOM_ELEMENT(i))
       SET_PROPERTY(i, EP_CAN_MOVE_INTO_ACID,