rnd-20051214-1-src
authorHolger Schemel <info@artsoft.org>
Wed, 14 Dec 2005 01:27:52 +0000 (02:27 +0100)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:49:51 +0000 (10:49 +0200)
* added parameters to editor for "game of life" and "biomaze" elements

ChangeLog
src/conftime.h
src/editor.c
src/files.c
src/game.c
src/main.h

index e6e0dd629c3bbb78fee952303d1d98b57a1f2cd1..7034922c1adf1df56f4b911dd8d157bd92829df3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2005-12-13
+       * added parameters to editor for "game of life" and "biomaze" elements
+
 2005-12-12
        * added level file chunk "CONF" for generic level and element settings
 
index aba32efb5e915d178f662f81f786d5b013989281..51f3c558127625946fb62fcafb7697f38fa162e1 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "[2005-12-13 01:37]"
+#define COMPILE_DATE_STRING "[2005-12-14 02:22]"
index 8c68e5c1bb9353a11cb33be00534b0eb6d7c519d..020b1ca690c6ee10d31bcbc2f165ff01f3e1a943 100644 (file)
 #define GADGET_ID_ELEMENT_VALUE2_DOWN  (GADGET_ID_COUNTER_FIRST + 24)
 #define GADGET_ID_ELEMENT_VALUE2_TEXT  (GADGET_ID_COUNTER_FIRST + 25)
 #define GADGET_ID_ELEMENT_VALUE2_UP    (GADGET_ID_COUNTER_FIRST + 26)
-#define GADGET_ID_YAMYAM_CONTENT_DOWN  (GADGET_ID_COUNTER_FIRST + 27)
-#define GADGET_ID_YAMYAM_CONTENT_TEXT  (GADGET_ID_COUNTER_FIRST + 28)
-#define GADGET_ID_YAMYAM_CONTENT_UP    (GADGET_ID_COUNTER_FIRST + 29)
-#define GADGET_ID_ENVELOPE_XSIZE_DOWN  (GADGET_ID_COUNTER_FIRST + 30)
-#define GADGET_ID_ENVELOPE_XSIZE_TEXT  (GADGET_ID_COUNTER_FIRST + 31)
-#define GADGET_ID_ENVELOPE_XSIZE_UP    (GADGET_ID_COUNTER_FIRST + 32)
-#define GADGET_ID_ENVELOPE_YSIZE_DOWN  (GADGET_ID_COUNTER_FIRST + 33)
-#define GADGET_ID_ENVELOPE_YSIZE_TEXT  (GADGET_ID_COUNTER_FIRST + 34)
-#define GADGET_ID_ENVELOPE_YSIZE_UP    (GADGET_ID_COUNTER_FIRST + 35)
-#define GADGET_ID_CUSTOM_SCORE_DOWN    (GADGET_ID_COUNTER_FIRST + 36)
-#define GADGET_ID_CUSTOM_SCORE_TEXT    (GADGET_ID_COUNTER_FIRST + 37)
-#define GADGET_ID_CUSTOM_SCORE_UP      (GADGET_ID_COUNTER_FIRST + 38)
-#define GADGET_ID_CUSTOM_GEMCOUNT_DOWN (GADGET_ID_COUNTER_FIRST + 39)
-#define GADGET_ID_CUSTOM_GEMCOUNT_TEXT (GADGET_ID_COUNTER_FIRST + 40)
-#define GADGET_ID_CUSTOM_GEMCOUNT_UP   (GADGET_ID_COUNTER_FIRST + 41)
-#define GADGET_ID_PUSH_DELAY_FIX_DOWN  (GADGET_ID_COUNTER_FIRST + 42)
-#define GADGET_ID_PUSH_DELAY_FIX_TEXT  (GADGET_ID_COUNTER_FIRST + 43)
-#define GADGET_ID_PUSH_DELAY_FIX_UP    (GADGET_ID_COUNTER_FIRST + 44)
-#define GADGET_ID_PUSH_DELAY_RND_DOWN  (GADGET_ID_COUNTER_FIRST + 45)
-#define GADGET_ID_PUSH_DELAY_RND_TEXT  (GADGET_ID_COUNTER_FIRST + 46)
-#define GADGET_ID_PUSH_DELAY_RND_UP    (GADGET_ID_COUNTER_FIRST + 47)
-#define GADGET_ID_DROP_DELAY_FIX_DOWN  (GADGET_ID_COUNTER_FIRST + 48)
-#define GADGET_ID_DROP_DELAY_FIX_TEXT  (GADGET_ID_COUNTER_FIRST + 49)
-#define GADGET_ID_DROP_DELAY_FIX_UP    (GADGET_ID_COUNTER_FIRST + 50)
-#define GADGET_ID_DROP_DELAY_RND_DOWN  (GADGET_ID_COUNTER_FIRST + 51)
-#define GADGET_ID_DROP_DELAY_RND_TEXT  (GADGET_ID_COUNTER_FIRST + 52)
-#define GADGET_ID_DROP_DELAY_RND_UP    (GADGET_ID_COUNTER_FIRST + 53)
-#define GADGET_ID_MOVE_DELAY_FIX_DOWN  (GADGET_ID_COUNTER_FIRST + 54)
-#define GADGET_ID_MOVE_DELAY_FIX_TEXT  (GADGET_ID_COUNTER_FIRST + 55)
-#define GADGET_ID_MOVE_DELAY_FIX_UP    (GADGET_ID_COUNTER_FIRST + 56)
-#define GADGET_ID_MOVE_DELAY_RND_DOWN  (GADGET_ID_COUNTER_FIRST + 57)
-#define GADGET_ID_MOVE_DELAY_RND_TEXT  (GADGET_ID_COUNTER_FIRST + 58)
-#define GADGET_ID_MOVE_DELAY_RND_UP    (GADGET_ID_COUNTER_FIRST + 59)
-#define GADGET_ID_EXPLOSION_DELAY_DOWN (GADGET_ID_COUNTER_FIRST + 60)
-#define GADGET_ID_EXPLOSION_DELAY_TEXT (GADGET_ID_COUNTER_FIRST + 61)
-#define GADGET_ID_EXPLOSION_DELAY_UP   (GADGET_ID_COUNTER_FIRST + 62)
-#define GADGET_ID_IGNITION_DELAY_DOWN  (GADGET_ID_COUNTER_FIRST + 63)
-#define GADGET_ID_IGNITION_DELAY_TEXT  (GADGET_ID_COUNTER_FIRST + 64)
-#define GADGET_ID_IGNITION_DELAY_UP    (GADGET_ID_COUNTER_FIRST + 65)
-#define GADGET_ID_CHANGE_DELAY_FIX_DOWN        (GADGET_ID_COUNTER_FIRST + 66)
-#define GADGET_ID_CHANGE_DELAY_FIX_TEXT        (GADGET_ID_COUNTER_FIRST + 67)
-#define GADGET_ID_CHANGE_DELAY_FIX_UP  (GADGET_ID_COUNTER_FIRST + 68)
-#define GADGET_ID_CHANGE_DELAY_RND_DOWN        (GADGET_ID_COUNTER_FIRST + 69)
-#define GADGET_ID_CHANGE_DELAY_RND_TEXT        (GADGET_ID_COUNTER_FIRST + 70)
-#define GADGET_ID_CHANGE_DELAY_RND_UP  (GADGET_ID_COUNTER_FIRST + 71)
-#define GADGET_ID_CHANGE_CONT_RND_DOWN (GADGET_ID_COUNTER_FIRST + 72)
-#define GADGET_ID_CHANGE_CONT_RND_TEXT (GADGET_ID_COUNTER_FIRST + 73)
-#define GADGET_ID_CHANGE_CONT_RND_UP   (GADGET_ID_COUNTER_FIRST + 74)
-#define GADGET_ID_GROUP_CONTENT_DOWN   (GADGET_ID_COUNTER_FIRST + 75)
-#define GADGET_ID_GROUP_CONTENT_TEXT   (GADGET_ID_COUNTER_FIRST + 76)
-#define GADGET_ID_GROUP_CONTENT_UP     (GADGET_ID_COUNTER_FIRST + 77)
+#define GADGET_ID_ELEMENT_VALUE3_DOWN  (GADGET_ID_COUNTER_FIRST + 27)
+#define GADGET_ID_ELEMENT_VALUE3_TEXT  (GADGET_ID_COUNTER_FIRST + 28)
+#define GADGET_ID_ELEMENT_VALUE3_UP    (GADGET_ID_COUNTER_FIRST + 29)
+#define GADGET_ID_ELEMENT_VALUE4_DOWN  (GADGET_ID_COUNTER_FIRST + 30)
+#define GADGET_ID_ELEMENT_VALUE4_TEXT  (GADGET_ID_COUNTER_FIRST + 31)
+#define GADGET_ID_ELEMENT_VALUE4_UP    (GADGET_ID_COUNTER_FIRST + 32)
+#define GADGET_ID_YAMYAM_CONTENT_DOWN  (GADGET_ID_COUNTER_FIRST + 33)
+#define GADGET_ID_YAMYAM_CONTENT_TEXT  (GADGET_ID_COUNTER_FIRST + 34)
+#define GADGET_ID_YAMYAM_CONTENT_UP    (GADGET_ID_COUNTER_FIRST + 35)
+#define GADGET_ID_ENVELOPE_XSIZE_DOWN  (GADGET_ID_COUNTER_FIRST + 36)
+#define GADGET_ID_ENVELOPE_XSIZE_TEXT  (GADGET_ID_COUNTER_FIRST + 37)
+#define GADGET_ID_ENVELOPE_XSIZE_UP    (GADGET_ID_COUNTER_FIRST + 38)
+#define GADGET_ID_ENVELOPE_YSIZE_DOWN  (GADGET_ID_COUNTER_FIRST + 39)
+#define GADGET_ID_ENVELOPE_YSIZE_TEXT  (GADGET_ID_COUNTER_FIRST + 40)
+#define GADGET_ID_ENVELOPE_YSIZE_UP    (GADGET_ID_COUNTER_FIRST + 41)
+#define GADGET_ID_CUSTOM_SCORE_DOWN    (GADGET_ID_COUNTER_FIRST + 42)
+#define GADGET_ID_CUSTOM_SCORE_TEXT    (GADGET_ID_COUNTER_FIRST + 43)
+#define GADGET_ID_CUSTOM_SCORE_UP      (GADGET_ID_COUNTER_FIRST + 44)
+#define GADGET_ID_CUSTOM_GEMCOUNT_DOWN (GADGET_ID_COUNTER_FIRST + 45)
+#define GADGET_ID_CUSTOM_GEMCOUNT_TEXT (GADGET_ID_COUNTER_FIRST + 46)
+#define GADGET_ID_CUSTOM_GEMCOUNT_UP   (GADGET_ID_COUNTER_FIRST + 47)
+#define GADGET_ID_PUSH_DELAY_FIX_DOWN  (GADGET_ID_COUNTER_FIRST + 48)
+#define GADGET_ID_PUSH_DELAY_FIX_TEXT  (GADGET_ID_COUNTER_FIRST + 49)
+#define GADGET_ID_PUSH_DELAY_FIX_UP    (GADGET_ID_COUNTER_FIRST + 50)
+#define GADGET_ID_PUSH_DELAY_RND_DOWN  (GADGET_ID_COUNTER_FIRST + 51)
+#define GADGET_ID_PUSH_DELAY_RND_TEXT  (GADGET_ID_COUNTER_FIRST + 52)
+#define GADGET_ID_PUSH_DELAY_RND_UP    (GADGET_ID_COUNTER_FIRST + 53)
+#define GADGET_ID_DROP_DELAY_FIX_DOWN  (GADGET_ID_COUNTER_FIRST + 54)
+#define GADGET_ID_DROP_DELAY_FIX_TEXT  (GADGET_ID_COUNTER_FIRST + 55)
+#define GADGET_ID_DROP_DELAY_FIX_UP    (GADGET_ID_COUNTER_FIRST + 56)
+#define GADGET_ID_DROP_DELAY_RND_DOWN  (GADGET_ID_COUNTER_FIRST + 57)
+#define GADGET_ID_DROP_DELAY_RND_TEXT  (GADGET_ID_COUNTER_FIRST + 58)
+#define GADGET_ID_DROP_DELAY_RND_UP    (GADGET_ID_COUNTER_FIRST + 59)
+#define GADGET_ID_MOVE_DELAY_FIX_DOWN  (GADGET_ID_COUNTER_FIRST + 60)
+#define GADGET_ID_MOVE_DELAY_FIX_TEXT  (GADGET_ID_COUNTER_FIRST + 61)
+#define GADGET_ID_MOVE_DELAY_FIX_UP    (GADGET_ID_COUNTER_FIRST + 62)
+#define GADGET_ID_MOVE_DELAY_RND_DOWN  (GADGET_ID_COUNTER_FIRST + 63)
+#define GADGET_ID_MOVE_DELAY_RND_TEXT  (GADGET_ID_COUNTER_FIRST + 64)
+#define GADGET_ID_MOVE_DELAY_RND_UP    (GADGET_ID_COUNTER_FIRST + 65)
+#define GADGET_ID_EXPLOSION_DELAY_DOWN (GADGET_ID_COUNTER_FIRST + 66)
+#define GADGET_ID_EXPLOSION_DELAY_TEXT (GADGET_ID_COUNTER_FIRST + 67)
+#define GADGET_ID_EXPLOSION_DELAY_UP   (GADGET_ID_COUNTER_FIRST + 68)
+#define GADGET_ID_IGNITION_DELAY_DOWN  (GADGET_ID_COUNTER_FIRST + 69)
+#define GADGET_ID_IGNITION_DELAY_TEXT  (GADGET_ID_COUNTER_FIRST + 70)
+#define GADGET_ID_IGNITION_DELAY_UP    (GADGET_ID_COUNTER_FIRST + 71)
+#define GADGET_ID_CHANGE_DELAY_FIX_DOWN        (GADGET_ID_COUNTER_FIRST + 72)
+#define GADGET_ID_CHANGE_DELAY_FIX_TEXT        (GADGET_ID_COUNTER_FIRST + 73)
+#define GADGET_ID_CHANGE_DELAY_FIX_UP  (GADGET_ID_COUNTER_FIRST + 74)
+#define GADGET_ID_CHANGE_DELAY_RND_DOWN        (GADGET_ID_COUNTER_FIRST + 75)
+#define GADGET_ID_CHANGE_DELAY_RND_TEXT        (GADGET_ID_COUNTER_FIRST + 76)
+#define GADGET_ID_CHANGE_DELAY_RND_UP  (GADGET_ID_COUNTER_FIRST + 77)
+#define GADGET_ID_CHANGE_CONT_RND_DOWN (GADGET_ID_COUNTER_FIRST + 78)
+#define GADGET_ID_CHANGE_CONT_RND_TEXT (GADGET_ID_COUNTER_FIRST + 79)
+#define GADGET_ID_CHANGE_CONT_RND_UP   (GADGET_ID_COUNTER_FIRST + 80)
+#define GADGET_ID_GROUP_CONTENT_DOWN   (GADGET_ID_COUNTER_FIRST + 81)
+#define GADGET_ID_GROUP_CONTENT_TEXT   (GADGET_ID_COUNTER_FIRST + 82)
+#define GADGET_ID_GROUP_CONTENT_UP     (GADGET_ID_COUNTER_FIRST + 83)
 
 /* drawing area identifiers */
-#define GADGET_ID_DRAWING_AREA_FIRST   (GADGET_ID_COUNTER_FIRST + 78)
+#define GADGET_ID_DRAWING_AREA_FIRST   (GADGET_ID_COUNTER_FIRST + 84)
 
 #define GADGET_ID_DRAWING_LEVEL                (GADGET_ID_DRAWING_AREA_FIRST + 0)
 #define GADGET_ID_YAMYAM_CONTENT_0     (GADGET_ID_DRAWING_AREA_FIRST + 1)
 #define ED_COUNTER_ID_LEVEL_RANDOM     6
 #define ED_COUNTER_ID_ELEMENT_VALUE1   7
 #define ED_COUNTER_ID_ELEMENT_VALUE2   8
-#define ED_COUNTER_ID_YAMYAM_CONTENT   9
-#define ED_COUNTER_ID_ENVELOPE_XSIZE   10
-#define ED_COUNTER_ID_ENVELOPE_YSIZE   11
-#define ED_COUNTER_ID_CUSTOM_SCORE     12
-#define ED_COUNTER_ID_CUSTOM_GEMCOUNT  13
-#define ED_COUNTER_ID_PUSH_DELAY_FIX   14
-#define ED_COUNTER_ID_PUSH_DELAY_RND   15
-#define ED_COUNTER_ID_DROP_DELAY_FIX   16
-#define ED_COUNTER_ID_DROP_DELAY_RND   17
-#define ED_COUNTER_ID_MOVE_DELAY_FIX   18
-#define ED_COUNTER_ID_MOVE_DELAY_RND   19
-#define ED_COUNTER_ID_EXPLOSION_DELAY  20
-#define ED_COUNTER_ID_IGNITION_DELAY   21
-#define ED_COUNTER_ID_GROUP_CONTENT    22
-#define ED_COUNTER_ID_CHANGE_DELAY_FIX 23
-#define ED_COUNTER_ID_CHANGE_DELAY_RND 24
-#define ED_COUNTER_ID_CHANGE_CONT_RND  25
-
-#define ED_NUM_COUNTERBUTTONS          26
+#define ED_COUNTER_ID_ELEMENT_VALUE3   9
+#define ED_COUNTER_ID_ELEMENT_VALUE4   10
+#define ED_COUNTER_ID_YAMYAM_CONTENT   11
+#define ED_COUNTER_ID_ENVELOPE_XSIZE   12
+#define ED_COUNTER_ID_ENVELOPE_YSIZE   13
+#define ED_COUNTER_ID_CUSTOM_SCORE     14
+#define ED_COUNTER_ID_CUSTOM_GEMCOUNT  15
+#define ED_COUNTER_ID_PUSH_DELAY_FIX   16
+#define ED_COUNTER_ID_PUSH_DELAY_RND   17
+#define ED_COUNTER_ID_DROP_DELAY_FIX   18
+#define ED_COUNTER_ID_DROP_DELAY_RND   19
+#define ED_COUNTER_ID_MOVE_DELAY_FIX   20
+#define ED_COUNTER_ID_MOVE_DELAY_RND   21
+#define ED_COUNTER_ID_EXPLOSION_DELAY  22
+#define ED_COUNTER_ID_IGNITION_DELAY   23
+#define ED_COUNTER_ID_GROUP_CONTENT    24
+#define ED_COUNTER_ID_CHANGE_DELAY_FIX 25
+#define ED_COUNTER_ID_CHANGE_DELAY_RND 26
+#define ED_COUNTER_ID_CHANGE_CONT_RND  27
+
+#define ED_NUM_COUNTERBUTTONS          28
 
 #define ED_COUNTER_ID_LEVEL_FIRST      ED_COUNTER_ID_LEVEL_XSIZE
 #define ED_COUNTER_ID_LEVEL_LAST       ED_COUNTER_ID_LEVEL_RANDOM
@@ -1024,6 +1032,22 @@ static struct
     NULL,                              /* will be set when used */
     NULL,                              NULL, NULL
   },
+  {
+    ED_ELEMENT_SETTINGS_XPOS(0),       ED_ELEMENT_SETTINGS_YPOS(2),
+    MIN_SCORE,                         MAX_SCORE,
+    GADGET_ID_ELEMENT_VALUE3_DOWN,     GADGET_ID_ELEMENT_VALUE3_UP,
+    GADGET_ID_ELEMENT_VALUE3_TEXT,     GADGET_ID_NONE,
+    NULL,                              /* will be set when used */
+    NULL,                              NULL, NULL
+  },
+  {
+    ED_ELEMENT_SETTINGS_XPOS(0),       ED_ELEMENT_SETTINGS_YPOS(3),
+    MIN_SCORE,                         MAX_SCORE,
+    GADGET_ID_ELEMENT_VALUE4_DOWN,     GADGET_ID_ELEMENT_VALUE4_UP,
+    GADGET_ID_ELEMENT_VALUE4_TEXT,     GADGET_ID_NONE,
+    NULL,                              /* will be set when used */
+    NULL,                              NULL, NULL
+  },
   {
     ED_ELEMENT_SETTINGS_XPOS(0),       ED_ELEMENT_SETTINGS_YPOS(3),
     MIN_ELEMENT_CONTENTS,              MAX_ELEMENT_CONTENTS,
@@ -5261,9 +5285,9 @@ static void MapCounterButtons(int id)
   int x = gi_down->x;
   int y;       /* set after gadget position was modified */
 
-  /* set position for "value1/value2" counter gadgets (score in most cases) */
-  if (id == ED_COUNTER_ID_ELEMENT_VALUE1 ||
-      id == ED_COUNTER_ID_ELEMENT_VALUE2)
+  /* set position for "value[1,2,3,4]" counter gadgets (score in most cases) */
+  if (id >= ED_COUNTER_ID_ELEMENT_VALUE1 &&
+      id <= ED_COUNTER_ID_ELEMENT_VALUE4)
   {
     ModifyGadget(gi_down, GDI_Y, SY + counterbutton_info[id].y, GDI_END);
     ModifyGadget(gi_text, GDI_Y, SY + counterbutton_info[id].y, GDI_END);
@@ -5282,7 +5306,8 @@ static void MapCounterButtons(int id)
     DrawText(x_right, y, counterbutton_info[id].text_right, FONT_TEXT_1);
 
   ModifyEditorCounter(id, *counterbutton_info[id].value);
-
+  ModifyEditorCounterLimits(id, counterbutton_info[id].min_value,
+                           counterbutton_info[id].max_value);
   MapGadget(gi_down);
   MapGadget(gi_text);
   MapGadget(gi_up);
@@ -6851,6 +6876,10 @@ static void DrawPropertiesInfo()
 #define TEXT_BALL_DELAY                "Element generation delay"
 #define TEXT_MOVE_SPEED                "Speed of android moving"
 #define TEXT_CLONE_SPEED       "Speed of android cloning"
+#define TEXT_GAME_OF_LIFE_1    "Min neighbours to survive"
+#define TEXT_GAME_OF_LIFE_2    "Max neighbours to survive"
+#define TEXT_GAME_OF_LIFE_3    "Min neighbours to create"
+#define TEXT_GAME_OF_LIFE_4    "Max neighbours to create"
 
 static struct
 {
@@ -6925,6 +6954,17 @@ static struct
   { EL_MAGIC_WALL,     &level.time_magic_wall,         TEXT_DURATION   },
   { EL_ROBOT_WHEEL,    &level.time_wheel,              TEXT_DURATION   },
 
+#if 1
+  { EL_GAME_OF_LIFE,   &level.game_of_life[0],         TEXT_GAME_OF_LIFE_1 },
+  { EL_GAME_OF_LIFE,   &level.game_of_life[1],         TEXT_GAME_OF_LIFE_2 },
+  { EL_GAME_OF_LIFE,   &level.game_of_life[2],         TEXT_GAME_OF_LIFE_3 },
+  { EL_GAME_OF_LIFE,   &level.game_of_life[3],         TEXT_GAME_OF_LIFE_4 },
+  { EL_BIOMAZE,                &level.biomaze[0],              TEXT_GAME_OF_LIFE_1 },
+  { EL_BIOMAZE,                &level.biomaze[1],              TEXT_GAME_OF_LIFE_2 },
+  { EL_BIOMAZE,                &level.biomaze[2],              TEXT_GAME_OF_LIFE_3 },
+  { EL_BIOMAZE,                &level.biomaze[3],              TEXT_GAME_OF_LIFE_4 },
+#endif
+
 #if 1
   { EL_EMC_ANDROID,    &level.android_move_time,       TEXT_MOVE_SPEED },
   { EL_EMC_ANDROID,    &level.android_clone_time,      TEXT_CLONE_SPEED },
@@ -6963,7 +7003,7 @@ static boolean checkPropertiesConfig(int element)
 
 static void DrawPropertiesConfig()
 {
-  int max_num_element_counters = 2;
+  int max_num_element_counters = 4;
   int num_element_counters = 0;
   int i;
 
@@ -6991,9 +7031,18 @@ static void DrawPropertiesConfig()
       counterbutton_info[counter_id].value = elements_with_counter[i].value;
       counterbutton_info[counter_id].text_right= elements_with_counter[i].text;
 
-      /* !!! CHANGE THIS FOR CERTAIN ELEMENTS !!! */
-      counterbutton_info[counter_id].min_value = MIN_SCORE;
-      counterbutton_info[counter_id].max_value = MAX_SCORE;
+      if (properties_element == EL_GAME_OF_LIFE ||
+         properties_element == EL_BIOMAZE)
+      {
+       counterbutton_info[counter_id].min_value = 0;   /* min neighbours */
+       counterbutton_info[counter_id].max_value = 8;   /* max neighbours */
+      }
+      else
+      {
+       /* !!! CHANGE THIS FOR CERTAIN ELEMENTS !!! */
+       counterbutton_info[counter_id].min_value = MIN_SCORE;
+       counterbutton_info[counter_id].max_value = MAX_SCORE;
+      }
 
       MapCounterButtons(counter_id);
 
index 95268e5f5178963289297aa80551b8ac35be4302..447ebc71cfde81ee1330868e84fa262a4f9623e4 100644 (file)
 
 #define CONF_LAST_ENTRY                (CONF_MASK_1_BYTE | 0)
 
-#define CONF_VALUE_SCORE_1     (CONF_MASK_1_BYTE | 1)
-#define CONF_VALUE_SCORE_2     (CONF_MASK_1_BYTE | 2)
-#define CONF_VALUE_SCORE_3     (CONF_MASK_1_BYTE | 3)
-#define CONF_VALUE_SCORE_4     (CONF_MASK_1_BYTE | 4)
-#define CONF_VALUE_TIME_1      (CONF_MASK_1_BYTE | 5)
-#define CONF_VALUE_TIME_2      (CONF_MASK_1_BYTE | 6)
-#define CONF_VALUE_TIME_3      (CONF_MASK_1_BYTE | 7)
-#define CONF_VALUE_TIME_4      (CONF_MASK_1_BYTE | 8)
-#define CONF_VALUE_SWITCH_1    (CONF_MASK_1_BYTE | 9)
-#define CONF_VALUE_SWITCH_2    (CONF_MASK_1_BYTE | 10)
-#define CONF_VALUE_SWITCH_3    (CONF_MASK_1_BYTE | 11)
-#define CONF_VALUE_SWITCH_4    (CONF_MASK_1_BYTE | 12)
-#define CONF_VALUE_USE_BUG_1   (CONF_MASK_1_BYTE | 13)
-#define CONF_VALUE_USE_BUG_2   (CONF_MASK_1_BYTE | 14)
-#define CONF_VALUE_USE_BUG_3   (CONF_MASK_1_BYTE | 15)
-#define CONF_VALUE_USE_BUG_4   (CONF_MASK_1_BYTE | 16)
+#define CONF_VALUE_INTEGER_1   (CONF_MASK_1_BYTE | 1)
+#define CONF_VALUE_INTEGER_2   (CONF_MASK_1_BYTE | 2)
+#define CONF_VALUE_INTEGER_3   (CONF_MASK_1_BYTE | 3)
+#define CONF_VALUE_INTEGER_4   (CONF_MASK_1_BYTE | 4)
+#define CONF_VALUE_BOOLEAN_1   (CONF_MASK_1_BYTE | 5)
+#define CONF_VALUE_BOOLEAN_2   (CONF_MASK_1_BYTE | 6)
+#define CONF_VALUE_BOOLEAN_3   (CONF_MASK_1_BYTE | 7)
+#define CONF_VALUE_BOOLEAN_4   (CONF_MASK_1_BYTE | 8)
 
 #define CONF_VALUE_ELEMENT_1   (CONF_MASK_2_BYTE | 1)
 #define CONF_VALUE_ELEMENT_2   (CONF_MASK_2_BYTE | 2)
+#define CONF_VALUE_ELEMENT_3   (CONF_MASK_2_BYTE | 3)
+#define CONF_VALUE_ELEMENT_4   (CONF_MASK_2_BYTE | 4)
 
 #define CONF_VALUE_CONTENT_1   (CONF_MASK_MULTI_BYTES | 1)
 #define CONF_VALUE_CONTENT_8   (CONF_MASK_MULTI_BYTES | 2)
 
-#define CONF_VALUE_BOOLEAN(x)  ((x) >= CONF_VALUE_SWITCH_1 &&          \
-                                (x) <= CONF_VALUE_USE_BUG_4)
+#define CONF_VALUE_INTEGER(x)  ((x) >= CONF_VALUE_INTEGER_1 &&         \
+                                (x) <= CONF_VALUE_INTEGER_4)
+
+#define CONF_VALUE_BOOLEAN(x)  ((x) >= CONF_VALUE_BOOLEAN_1 &&         \
+                                (x) <= CONF_VALUE_BOOLEAN_4)
 
 #define CONF_VALUE_NUM_BYTES(x)        ((x) == CONF_MASK_1_BYTE ? 1 :          \
                                 (x) == CONF_MASK_2_BYTE ? 2 :          \
@@ -109,14 +106,22 @@ static struct
 } element_conf[] =
 {
   /* 1-byte values */
-  { EL_EMC_ANDROID,    CONF_VALUE_TIME_1,      &li.android_move_time   },
-  { EL_EMC_ANDROID,    CONF_VALUE_TIME_2,      &li.android_clone_time  },
-  { EL_EMC_MAGIC_BALL, CONF_VALUE_TIME_1,      &li.ball_time           },
-  { EL_EMC_LENSES,     CONF_VALUE_SCORE_1,     &li.lenses_score        },
-  { EL_EMC_LENSES,     CONF_VALUE_TIME_1,      &li.lenses_time         },
-  { EL_EMC_MAGNIFIER,  CONF_VALUE_SCORE_1,     &li.magnify_score       },
-  { EL_EMC_MAGNIFIER,  CONF_VALUE_TIME_1,      &li.magnify_time        },
-  { EL_ROBOT,          CONF_VALUE_SCORE_2,     &li.slurp_score         },
+  { EL_EMC_ANDROID,    CONF_VALUE_INTEGER_1,   &li.android_move_time   },
+  { EL_EMC_ANDROID,    CONF_VALUE_INTEGER_2,   &li.android_clone_time  },
+  { EL_EMC_MAGIC_BALL, CONF_VALUE_INTEGER_1,   &li.ball_time           },
+  { EL_EMC_LENSES,     CONF_VALUE_INTEGER_1,   &li.lenses_score        },
+  { EL_EMC_LENSES,     CONF_VALUE_INTEGER_2,   &li.lenses_time         },
+  { EL_EMC_MAGNIFIER,  CONF_VALUE_INTEGER_1,   &li.magnify_score       },
+  { EL_EMC_MAGNIFIER,  CONF_VALUE_INTEGER_2,   &li.magnify_time        },
+  { EL_ROBOT,          CONF_VALUE_INTEGER_1,   &li.slurp_score         },
+  { EL_GAME_OF_LIFE,   CONF_VALUE_INTEGER_1,   &li.game_of_life[0]     },
+  { EL_GAME_OF_LIFE,   CONF_VALUE_INTEGER_2,   &li.game_of_life[1]     },
+  { EL_GAME_OF_LIFE,   CONF_VALUE_INTEGER_3,   &li.game_of_life[2]     },
+  { EL_GAME_OF_LIFE,   CONF_VALUE_INTEGER_4,   &li.game_of_life[3]     },
+  { EL_BIOMAZE,                CONF_VALUE_INTEGER_1,   &li.biomaze[0]          },
+  { EL_BIOMAZE,                CONF_VALUE_INTEGER_2,   &li.biomaze[1]          },
+  { EL_BIOMAZE,                CONF_VALUE_INTEGER_3,   &li.biomaze[2]          },
+  { EL_BIOMAZE,                CONF_VALUE_INTEGER_4,   &li.biomaze[3]          },
 
   /* multi-byte values */
   { EL_EMC_MAGIC_BALL, CONF_VALUE_CONTENT_8,   &li.ball_content        },
@@ -243,6 +248,16 @@ static void setLevelInfoToDefaults(struct LevelInfo *level)
 
   level->amoeba_content = EL_DIAMOND;
 
+  level->game_of_life[0] = 2;
+  level->game_of_life[1] = 3;
+  level->game_of_life[2] = 3;
+  level->game_of_life[3] = 3;
+
+  level->biomaze[0] = 2;
+  level->biomaze[1] = 3;
+  level->biomaze[2] = 3;
+  level->biomaze[3] = 3;
+
   level->double_speed = FALSE;
   level->initial_gravity = FALSE;
   level->em_slippery_gems = FALSE;
index 4a3f9d39c8feb62bcd728cfe9e7b2ca2acb309cb..7f6186c4f58130a519c16626ca5306ae9dc338b8 100644 (file)
@@ -6030,10 +6030,14 @@ void AmoebeAbleger(int ax, int ay)
 void Life(int ax, int ay)
 {
   int x1, y1, x2, y2;
+#if 0
   static int life[4] = { 2, 3, 3, 3 }; /* parameters for "game of life" */
+#endif
   int life_time = 40;
   int element = Feld[ax][ay];
   int graphic = el2img(element);
+  int *life_parameter = (element == EL_GAME_OF_LIFE ? level.game_of_life :
+                        level.biomaze);
   boolean changed = FALSE;
 
   if (IS_ANIMATED(graphic))
@@ -6076,7 +6080,8 @@ void Life(int ax, int ay)
 
     if (xx == ax && yy == ay)          /* field in the middle */
     {
-      if (nachbarn < life[0] || nachbarn > life[1])
+      if (nachbarn < life_parameter[0] ||
+         nachbarn > life_parameter[1])
       {
        Feld[xx][yy] = EL_EMPTY;
        if (!Stop[xx][yy])
@@ -6087,7 +6092,8 @@ void Life(int ax, int ay)
     }
     else if (IS_FREE(xx, yy) || CAN_GROW_INTO(Feld[xx][yy]))
     {                                  /* free border field */
-      if (nachbarn >= life[2] && nachbarn <= life[3])
+      if (nachbarn >= life_parameter[2] &&
+         nachbarn <= life_parameter[3])
       {
        Feld[xx][yy] = element;
        MovDelay[xx][yy] = (element == EL_GAME_OF_LIFE ? 0 : life_time-1);
index 6e3a8293a7ac1ba942359dbe3a976a39f79f1aaa..1d5ad46b4fd29679409bdadc9e7344a5f5369856 100644 (file)
@@ -1732,6 +1732,9 @@ struct LevelInfo
   int amoeba_speed;
   int amoeba_content;
 
+  int game_of_life[4];
+  int biomaze[4];
+
   int time_magic_wall;
   int time_wheel;
   int time_light;