added remaining MM/DF level properties to level editor and level files
authorHolger Schemel <info@artsoft.org>
Sat, 11 Mar 2017 15:26:04 +0000 (16:26 +0100)
committerHolger Schemel <info@artsoft.org>
Fri, 23 Mar 2018 22:21:10 +0000 (23:21 +0100)
src/editor.c
src/files.c
src/main.h

index 5a3d5cfa7f6a451ae55b54c8f5c5d0420284fae4..92d6fb13ebd3aee12e563e095f8af2b908978320 100644 (file)
 /* checkbuttons/radiobuttons for level/element properties */
 #define GADGET_ID_CHECKBUTTON_FIRST    (GADGET_ID_SCROLLING_LIST_FIRST + 3)
 
-#define GADGET_ID_RANDOM_PERCENTAGE    (GADGET_ID_CHECKBUTTON_FIRST + 0)
-#define GADGET_ID_RANDOM_QUANTITY      (GADGET_ID_CHECKBUTTON_FIRST + 1)
-#define GADGET_ID_RANDOM_RESTRICTED    (GADGET_ID_CHECKBUTTON_FIRST + 2)
-#define GADGET_ID_STICK_ELEMENT                (GADGET_ID_CHECKBUTTON_FIRST + 3)
-#define GADGET_ID_EM_SLIPPERY_GEMS     (GADGET_ID_CHECKBUTTON_FIRST + 4)
-#define GADGET_ID_EM_EXPLODES_BY_FIRE  (GADGET_ID_CHECKBUTTON_FIRST + 5)
-#define GADGET_ID_USE_SPRING_BUG       (GADGET_ID_CHECKBUTTON_FIRST + 6)
-#define GADGET_ID_USE_TIME_ORB_BUG     (GADGET_ID_CHECKBUTTON_FIRST + 7)
-#define GADGET_ID_RANDOM_BALL_CONTENT  (GADGET_ID_CHECKBUTTON_FIRST + 8)
-#define GADGET_ID_INITIAL_BALL_STATE   (GADGET_ID_CHECKBUTTON_FIRST + 9)
-#define GADGET_ID_GROW_INTO_DIGGABLE   (GADGET_ID_CHECKBUTTON_FIRST + 10)
-#define GADGET_ID_AUTO_EXIT_SOKOBAN    (GADGET_ID_CHECKBUTTON_FIRST + 11)
-#define GADGET_ID_CONTINUOUS_SNAPPING  (GADGET_ID_CHECKBUTTON_FIRST + 12)
-#define GADGET_ID_BLOCK_SNAP_FIELD     (GADGET_ID_CHECKBUTTON_FIRST + 13)
-#define GADGET_ID_BLOCK_LAST_FIELD     (GADGET_ID_CHECKBUTTON_FIRST + 14)
-#define GADGET_ID_SP_BLOCK_LAST_FIELD  (GADGET_ID_CHECKBUTTON_FIRST + 15)
-#define GADGET_ID_INSTANT_RELOCATION   (GADGET_ID_CHECKBUTTON_FIRST + 16)
-#define GADGET_ID_SHIFTED_RELOCATION   (GADGET_ID_CHECKBUTTON_FIRST + 17)
-#define GADGET_ID_LAZY_RELOCATION      (GADGET_ID_CHECKBUTTON_FIRST + 18)
-#define GADGET_ID_USE_START_ELEMENT    (GADGET_ID_CHECKBUTTON_FIRST + 19)
-#define GADGET_ID_USE_ARTWORK_ELEMENT  (GADGET_ID_CHECKBUTTON_FIRST + 20)
-#define GADGET_ID_USE_EXPLOSION_ELEMENT        (GADGET_ID_CHECKBUTTON_FIRST + 21)
-#define GADGET_ID_INITIAL_GRAVITY      (GADGET_ID_CHECKBUTTON_FIRST + 22)
-#define GADGET_ID_USE_INITIAL_INVENTORY        (GADGET_ID_CHECKBUTTON_FIRST + 23)
-#define GADGET_ID_CAN_PASS_TO_WALKABLE (GADGET_ID_CHECKBUTTON_FIRST + 24)
-#define GADGET_ID_CAN_FALL_INTO_ACID   (GADGET_ID_CHECKBUTTON_FIRST + 25)
-#define GADGET_ID_CAN_MOVE_INTO_ACID   (GADGET_ID_CHECKBUTTON_FIRST + 26)
-#define GADGET_ID_DONT_COLLIDE_WITH    (GADGET_ID_CHECKBUTTON_FIRST + 27)
-#define GADGET_ID_ENVELOPE_AUTOWRAP    (GADGET_ID_CHECKBUTTON_FIRST + 28)
-#define GADGET_ID_ENVELOPE_CENTERED    (GADGET_ID_CHECKBUTTON_FIRST + 29)
-#define GADGET_ID_CUSTOM_INDESTRUCTIBLE        (GADGET_ID_CHECKBUTTON_FIRST + 30)
-#define GADGET_ID_CUSTOM_CAN_EXPLODE   (GADGET_ID_CHECKBUTTON_FIRST + 31)
-#define GADGET_ID_CUSTOM_EXPLODE_FIRE  (GADGET_ID_CHECKBUTTON_FIRST + 32)
-#define GADGET_ID_CUSTOM_EXPLODE_SMASH (GADGET_ID_CHECKBUTTON_FIRST + 33)
-#define GADGET_ID_CUSTOM_EXPLODE_IMPACT        (GADGET_ID_CHECKBUTTON_FIRST + 34)
-#define GADGET_ID_CUSTOM_WALK_TO_OBJECT        (GADGET_ID_CHECKBUTTON_FIRST + 35)
-#define GADGET_ID_CUSTOM_DEADLY                (GADGET_ID_CHECKBUTTON_FIRST + 36)
-#define GADGET_ID_CUSTOM_CAN_MOVE      (GADGET_ID_CHECKBUTTON_FIRST + 37)
-#define GADGET_ID_CUSTOM_CAN_FALL      (GADGET_ID_CHECKBUTTON_FIRST + 38)
-#define GADGET_ID_CUSTOM_CAN_SMASH     (GADGET_ID_CHECKBUTTON_FIRST + 39)
-#define GADGET_ID_CUSTOM_SLIPPERY      (GADGET_ID_CHECKBUTTON_FIRST + 40)
-#define GADGET_ID_CUSTOM_ACCESSIBLE    (GADGET_ID_CHECKBUTTON_FIRST + 41)
-#define GADGET_ID_CUSTOM_GRAV_REACHABLE        (GADGET_ID_CHECKBUTTON_FIRST + 42)
-#define GADGET_ID_CUSTOM_USE_LAST_VALUE        (GADGET_ID_CHECKBUTTON_FIRST + 43)
-#define GADGET_ID_CUSTOM_USE_GRAPHIC   (GADGET_ID_CHECKBUTTON_FIRST + 44)
-#define GADGET_ID_CUSTOM_USE_TEMPLATE_1        (GADGET_ID_CHECKBUTTON_FIRST + 45)
-#define GADGET_ID_CUSTOM_USE_TEMPLATE_2        (GADGET_ID_CHECKBUTTON_FIRST + 46)
-#define GADGET_ID_CUSTOM_USE_TEMPLATE_3        (GADGET_ID_CHECKBUTTON_FIRST + 47)
-#define GADGET_ID_CUSTOM_CAN_CHANGE    (GADGET_ID_CHECKBUTTON_FIRST + 48)
-#define GADGET_ID_CHANGE_USE_CONTENT   (GADGET_ID_CHECKBUTTON_FIRST + 49)
-#define GADGET_ID_CHANGE_USE_EXPLOSION (GADGET_ID_CHECKBUTTON_FIRST + 50)
-#define GADGET_ID_CHANGE_ONLY_COMPLETE (GADGET_ID_CHECKBUTTON_FIRST + 51)
-#define GADGET_ID_CHANGE_USE_RANDOM    (GADGET_ID_CHECKBUTTON_FIRST + 52)
-#define GADGET_ID_CHANGE_HAS_ACTION    (GADGET_ID_CHECKBUTTON_FIRST + 53)
-#define GADGET_ID_CHANGE_DELAY         (GADGET_ID_CHECKBUTTON_FIRST + 54)
-#define GADGET_ID_CHANGE_BY_DIRECT_ACT (GADGET_ID_CHECKBUTTON_FIRST + 55)
-#define GADGET_ID_CHANGE_BY_OTHER_ACT  (GADGET_ID_CHECKBUTTON_FIRST + 56)
+#define GADGET_ID_AUTO_COUNT_GEMS      (GADGET_ID_CHECKBUTTON_FIRST + 0)
+#define GADGET_ID_RANDOM_PERCENTAGE    (GADGET_ID_CHECKBUTTON_FIRST + 1)
+#define GADGET_ID_RANDOM_QUANTITY      (GADGET_ID_CHECKBUTTON_FIRST + 2)
+#define GADGET_ID_RANDOM_RESTRICTED    (GADGET_ID_CHECKBUTTON_FIRST + 3)
+#define GADGET_ID_STICK_ELEMENT                (GADGET_ID_CHECKBUTTON_FIRST + 4)
+#define GADGET_ID_EM_SLIPPERY_GEMS     (GADGET_ID_CHECKBUTTON_FIRST + 5)
+#define GADGET_ID_EM_EXPLODES_BY_FIRE  (GADGET_ID_CHECKBUTTON_FIRST + 6)
+#define GADGET_ID_USE_SPRING_BUG       (GADGET_ID_CHECKBUTTON_FIRST + 7)
+#define GADGET_ID_USE_TIME_ORB_BUG     (GADGET_ID_CHECKBUTTON_FIRST + 8)
+#define GADGET_ID_RANDOM_BALL_CONTENT  (GADGET_ID_CHECKBUTTON_FIRST + 9)
+#define GADGET_ID_INITIAL_BALL_STATE   (GADGET_ID_CHECKBUTTON_FIRST + 10)
+#define GADGET_ID_GROW_INTO_DIGGABLE   (GADGET_ID_CHECKBUTTON_FIRST + 11)
+#define GADGET_ID_AUTO_EXIT_SOKOBAN    (GADGET_ID_CHECKBUTTON_FIRST + 12)
+#define GADGET_ID_CONTINUOUS_SNAPPING  (GADGET_ID_CHECKBUTTON_FIRST + 13)
+#define GADGET_ID_BLOCK_SNAP_FIELD     (GADGET_ID_CHECKBUTTON_FIRST + 14)
+#define GADGET_ID_BLOCK_LAST_FIELD     (GADGET_ID_CHECKBUTTON_FIRST + 15)
+#define GADGET_ID_SP_BLOCK_LAST_FIELD  (GADGET_ID_CHECKBUTTON_FIRST + 16)
+#define GADGET_ID_INSTANT_RELOCATION   (GADGET_ID_CHECKBUTTON_FIRST + 17)
+#define GADGET_ID_SHIFTED_RELOCATION   (GADGET_ID_CHECKBUTTON_FIRST + 18)
+#define GADGET_ID_LAZY_RELOCATION      (GADGET_ID_CHECKBUTTON_FIRST + 19)
+#define GADGET_ID_USE_START_ELEMENT    (GADGET_ID_CHECKBUTTON_FIRST + 20)
+#define GADGET_ID_USE_ARTWORK_ELEMENT  (GADGET_ID_CHECKBUTTON_FIRST + 21)
+#define GADGET_ID_USE_EXPLOSION_ELEMENT        (GADGET_ID_CHECKBUTTON_FIRST + 22)
+#define GADGET_ID_INITIAL_GRAVITY      (GADGET_ID_CHECKBUTTON_FIRST + 23)
+#define GADGET_ID_USE_INITIAL_INVENTORY        (GADGET_ID_CHECKBUTTON_FIRST + 24)
+#define GADGET_ID_CAN_PASS_TO_WALKABLE (GADGET_ID_CHECKBUTTON_FIRST + 25)
+#define GADGET_ID_CAN_FALL_INTO_ACID   (GADGET_ID_CHECKBUTTON_FIRST + 26)
+#define GADGET_ID_CAN_MOVE_INTO_ACID   (GADGET_ID_CHECKBUTTON_FIRST + 27)
+#define GADGET_ID_DONT_COLLIDE_WITH    (GADGET_ID_CHECKBUTTON_FIRST + 28)
+#define GADGET_ID_ENVELOPE_AUTOWRAP    (GADGET_ID_CHECKBUTTON_FIRST + 29)
+#define GADGET_ID_ENVELOPE_CENTERED    (GADGET_ID_CHECKBUTTON_FIRST + 30)
+#define GADGET_ID_MM_LASER_RED         (GADGET_ID_CHECKBUTTON_FIRST + 31)
+#define GADGET_ID_MM_LASER_GREEN       (GADGET_ID_CHECKBUTTON_FIRST + 32)
+#define GADGET_ID_MM_LASER_BLUE                (GADGET_ID_CHECKBUTTON_FIRST + 33)
+#define GADGET_ID_DF_LASER_RED         (GADGET_ID_CHECKBUTTON_FIRST + 34)
+#define GADGET_ID_DF_LASER_GREEN       (GADGET_ID_CHECKBUTTON_FIRST + 35)
+#define GADGET_ID_DF_LASER_BLUE                (GADGET_ID_CHECKBUTTON_FIRST + 36)
+#define GADGET_ID_CUSTOM_INDESTRUCTIBLE        (GADGET_ID_CHECKBUTTON_FIRST + 37)
+#define GADGET_ID_CUSTOM_CAN_EXPLODE   (GADGET_ID_CHECKBUTTON_FIRST + 38)
+#define GADGET_ID_CUSTOM_EXPLODE_FIRE  (GADGET_ID_CHECKBUTTON_FIRST + 39)
+#define GADGET_ID_CUSTOM_EXPLODE_SMASH (GADGET_ID_CHECKBUTTON_FIRST + 40)
+#define GADGET_ID_CUSTOM_EXPLODE_IMPACT        (GADGET_ID_CHECKBUTTON_FIRST + 41)
+#define GADGET_ID_CUSTOM_WALK_TO_OBJECT        (GADGET_ID_CHECKBUTTON_FIRST + 42)
+#define GADGET_ID_CUSTOM_DEADLY                (GADGET_ID_CHECKBUTTON_FIRST + 43)
+#define GADGET_ID_CUSTOM_CAN_MOVE      (GADGET_ID_CHECKBUTTON_FIRST + 44)
+#define GADGET_ID_CUSTOM_CAN_FALL      (GADGET_ID_CHECKBUTTON_FIRST + 45)
+#define GADGET_ID_CUSTOM_CAN_SMASH     (GADGET_ID_CHECKBUTTON_FIRST + 46)
+#define GADGET_ID_CUSTOM_SLIPPERY      (GADGET_ID_CHECKBUTTON_FIRST + 47)
+#define GADGET_ID_CUSTOM_ACCESSIBLE    (GADGET_ID_CHECKBUTTON_FIRST + 48)
+#define GADGET_ID_CUSTOM_GRAV_REACHABLE        (GADGET_ID_CHECKBUTTON_FIRST + 49)
+#define GADGET_ID_CUSTOM_USE_LAST_VALUE        (GADGET_ID_CHECKBUTTON_FIRST + 50)
+#define GADGET_ID_CUSTOM_USE_GRAPHIC   (GADGET_ID_CHECKBUTTON_FIRST + 51)
+#define GADGET_ID_CUSTOM_USE_TEMPLATE_1        (GADGET_ID_CHECKBUTTON_FIRST + 52)
+#define GADGET_ID_CUSTOM_USE_TEMPLATE_2        (GADGET_ID_CHECKBUTTON_FIRST + 53)
+#define GADGET_ID_CUSTOM_USE_TEMPLATE_3        (GADGET_ID_CHECKBUTTON_FIRST + 54)
+#define GADGET_ID_CUSTOM_CAN_CHANGE    (GADGET_ID_CHECKBUTTON_FIRST + 55)
+#define GADGET_ID_CHANGE_USE_CONTENT   (GADGET_ID_CHECKBUTTON_FIRST + 56)
+#define GADGET_ID_CHANGE_USE_EXPLOSION (GADGET_ID_CHECKBUTTON_FIRST + 57)
+#define GADGET_ID_CHANGE_ONLY_COMPLETE (GADGET_ID_CHECKBUTTON_FIRST + 58)
+#define GADGET_ID_CHANGE_USE_RANDOM    (GADGET_ID_CHECKBUTTON_FIRST + 59)
+#define GADGET_ID_CHANGE_HAS_ACTION    (GADGET_ID_CHECKBUTTON_FIRST + 60)
+#define GADGET_ID_CHANGE_DELAY         (GADGET_ID_CHECKBUTTON_FIRST + 61)
+#define GADGET_ID_CHANGE_BY_DIRECT_ACT (GADGET_ID_CHECKBUTTON_FIRST + 62)
+#define GADGET_ID_CHANGE_BY_OTHER_ACT  (GADGET_ID_CHECKBUTTON_FIRST + 63)
 
 /* gadgets for buttons in element list */
-#define GADGET_ID_ELEMENTLIST_FIRST    (GADGET_ID_CHECKBUTTON_FIRST + 57)
+#define GADGET_ID_ELEMENTLIST_FIRST    (GADGET_ID_CHECKBUTTON_FIRST + 64)
 #define GADGET_ID_ELEMENTLIST_LAST     (GADGET_ID_ELEMENTLIST_FIRST +  \
                                        ED_NUM_ELEMENTLIST_BUTTONS - 1)
 
 #define ED_GRAPHICBUTTON_ID_CHANGE_LAST   ED_GRAPHICBUTTON_ID_PASTE_CHANGE_PAGE
 
 /* values for checkbutton gadgets */
-#define ED_CHECKBUTTON_ID_RANDOM_RESTRICTED    0
-#define ED_CHECKBUTTON_ID_CUSTOM_USE_TEMPLATE_3        1
-#define ED_CHECKBUTTON_ID_CUSTOM_USE_TEMPLATE_2        2
-#define ED_CHECKBUTTON_ID_STICK_ELEMENT                3
-#define ED_CHECKBUTTON_ID_EM_SLIPPERY_GEMS     4
-#define ED_CHECKBUTTON_ID_EM_EXPLODES_BY_FIRE  5
-#define ED_CHECKBUTTON_ID_USE_SPRING_BUG       6
-#define ED_CHECKBUTTON_ID_USE_TIME_ORB_BUG     7
-#define ED_CHECKBUTTON_ID_RANDOM_BALL_CONTENT  8
-#define ED_CHECKBUTTON_ID_INITIAL_BALL_STATE   9
-#define ED_CHECKBUTTON_ID_GROW_INTO_DIGGABLE   10
-#define ED_CHECKBUTTON_ID_AUTO_EXIT_SOKOBAN    11
-#define ED_CHECKBUTTON_ID_CONTINUOUS_SNAPPING  12
-#define ED_CHECKBUTTON_ID_BLOCK_SNAP_FIELD     13
-#define ED_CHECKBUTTON_ID_BLOCK_LAST_FIELD     14
-#define ED_CHECKBUTTON_ID_SP_BLOCK_LAST_FIELD  15
-#define ED_CHECKBUTTON_ID_INSTANT_RELOCATION   16
-#define ED_CHECKBUTTON_ID_SHIFTED_RELOCATION   17
-#define ED_CHECKBUTTON_ID_LAZY_RELOCATION      18
-#define ED_CHECKBUTTON_ID_USE_START_ELEMENT    19
-#define ED_CHECKBUTTON_ID_USE_ARTWORK_ELEMENT  20
-#define ED_CHECKBUTTON_ID_USE_EXPLOSION_ELEMENT        21
-#define ED_CHECKBUTTON_ID_INITIAL_GRAVITY      22
-#define ED_CHECKBUTTON_ID_USE_INITIAL_INVENTORY        23
-#define ED_CHECKBUTTON_ID_CAN_PASS_TO_WALKABLE 24
-#define ED_CHECKBUTTON_ID_CAN_FALL_INTO_ACID   25
-#define ED_CHECKBUTTON_ID_CAN_MOVE_INTO_ACID   26
-#define ED_CHECKBUTTON_ID_DONT_COLLIDE_WITH    27
-#define ED_CHECKBUTTON_ID_ENVELOPE_AUTOWRAP    28
-#define ED_CHECKBUTTON_ID_ENVELOPE_CENTERED    29
-#define ED_CHECKBUTTON_ID_CUSTOM_USE_GRAPHIC   30
-#define ED_CHECKBUTTON_ID_CUSTOM_USE_TEMPLATE_1        31
-#define ED_CHECKBUTTON_ID_CUSTOM_ACCESSIBLE    32
-#define ED_CHECKBUTTON_ID_CUSTOM_GRAV_REACHABLE        33
-#define ED_CHECKBUTTON_ID_CUSTOM_USE_LAST_VALUE        34
-#define ED_CHECKBUTTON_ID_CUSTOM_WALK_TO_OBJECT        35
-#define ED_CHECKBUTTON_ID_CUSTOM_INDESTRUCTIBLE        36
-#define ED_CHECKBUTTON_ID_CUSTOM_CAN_MOVE      37
-#define ED_CHECKBUTTON_ID_CUSTOM_CAN_FALL      38
-#define ED_CHECKBUTTON_ID_CUSTOM_CAN_SMASH     39
-#define ED_CHECKBUTTON_ID_CUSTOM_SLIPPERY      40
-#define ED_CHECKBUTTON_ID_CUSTOM_DEADLY                41
-#define ED_CHECKBUTTON_ID_CUSTOM_CAN_EXPLODE   42
-#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_FIRE  43
-#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_SMASH 44
-#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_IMPACT        45
-#define ED_CHECKBUTTON_ID_CUSTOM_CAN_CHANGE    46
-#define ED_CHECKBUTTON_ID_CHANGE_DELAY         47
-#define ED_CHECKBUTTON_ID_CHANGE_BY_DIRECT_ACT 48
-#define ED_CHECKBUTTON_ID_CHANGE_BY_OTHER_ACT  49
-#define ED_CHECKBUTTON_ID_CHANGE_USE_EXPLOSION 50
-#define ED_CHECKBUTTON_ID_CHANGE_USE_CONTENT   51
-#define ED_CHECKBUTTON_ID_CHANGE_ONLY_COMPLETE 52
-#define ED_CHECKBUTTON_ID_CHANGE_USE_RANDOM    53
-#define ED_CHECKBUTTON_ID_CHANGE_HAS_ACTION    54
-
-#define ED_NUM_CHECKBUTTONS                    55
+#define ED_CHECKBUTTON_ID_AUTO_COUNT_GEMS      0
+#define ED_CHECKBUTTON_ID_RANDOM_RESTRICTED    1
+#define ED_CHECKBUTTON_ID_CUSTOM_USE_TEMPLATE_3        2
+#define ED_CHECKBUTTON_ID_CUSTOM_USE_TEMPLATE_2        3
+#define ED_CHECKBUTTON_ID_STICK_ELEMENT                4
+#define ED_CHECKBUTTON_ID_EM_SLIPPERY_GEMS     5
+#define ED_CHECKBUTTON_ID_EM_EXPLODES_BY_FIRE  6
+#define ED_CHECKBUTTON_ID_USE_SPRING_BUG       7
+#define ED_CHECKBUTTON_ID_USE_TIME_ORB_BUG     8
+#define ED_CHECKBUTTON_ID_RANDOM_BALL_CONTENT  9
+#define ED_CHECKBUTTON_ID_INITIAL_BALL_STATE   10
+#define ED_CHECKBUTTON_ID_GROW_INTO_DIGGABLE   11
+#define ED_CHECKBUTTON_ID_AUTO_EXIT_SOKOBAN    12
+#define ED_CHECKBUTTON_ID_CONTINUOUS_SNAPPING  13
+#define ED_CHECKBUTTON_ID_BLOCK_SNAP_FIELD     14
+#define ED_CHECKBUTTON_ID_BLOCK_LAST_FIELD     15
+#define ED_CHECKBUTTON_ID_SP_BLOCK_LAST_FIELD  16
+#define ED_CHECKBUTTON_ID_INSTANT_RELOCATION   17
+#define ED_CHECKBUTTON_ID_SHIFTED_RELOCATION   18
+#define ED_CHECKBUTTON_ID_LAZY_RELOCATION      19
+#define ED_CHECKBUTTON_ID_USE_START_ELEMENT    20
+#define ED_CHECKBUTTON_ID_USE_ARTWORK_ELEMENT  21
+#define ED_CHECKBUTTON_ID_USE_EXPLOSION_ELEMENT        22
+#define ED_CHECKBUTTON_ID_INITIAL_GRAVITY      23
+#define ED_CHECKBUTTON_ID_USE_INITIAL_INVENTORY        24
+#define ED_CHECKBUTTON_ID_CAN_PASS_TO_WALKABLE 25
+#define ED_CHECKBUTTON_ID_CAN_FALL_INTO_ACID   26
+#define ED_CHECKBUTTON_ID_CAN_MOVE_INTO_ACID   27
+#define ED_CHECKBUTTON_ID_DONT_COLLIDE_WITH    28
+#define ED_CHECKBUTTON_ID_ENVELOPE_AUTOWRAP    29
+#define ED_CHECKBUTTON_ID_ENVELOPE_CENTERED    30
+#define ED_CHECKBUTTON_ID_MM_LASER_RED         31
+#define ED_CHECKBUTTON_ID_MM_LASER_GREEN       32
+#define ED_CHECKBUTTON_ID_MM_LASER_BLUE                33
+#define ED_CHECKBUTTON_ID_DF_LASER_RED         34
+#define ED_CHECKBUTTON_ID_DF_LASER_GREEN       35
+#define ED_CHECKBUTTON_ID_DF_LASER_BLUE                36
+#define ED_CHECKBUTTON_ID_CUSTOM_USE_GRAPHIC   37
+#define ED_CHECKBUTTON_ID_CUSTOM_USE_TEMPLATE_1        38
+#define ED_CHECKBUTTON_ID_CUSTOM_ACCESSIBLE    39
+#define ED_CHECKBUTTON_ID_CUSTOM_GRAV_REACHABLE        40
+#define ED_CHECKBUTTON_ID_CUSTOM_USE_LAST_VALUE        41
+#define ED_CHECKBUTTON_ID_CUSTOM_WALK_TO_OBJECT        42
+#define ED_CHECKBUTTON_ID_CUSTOM_INDESTRUCTIBLE        43
+#define ED_CHECKBUTTON_ID_CUSTOM_CAN_MOVE      44
+#define ED_CHECKBUTTON_ID_CUSTOM_CAN_FALL      45
+#define ED_CHECKBUTTON_ID_CUSTOM_CAN_SMASH     46
+#define ED_CHECKBUTTON_ID_CUSTOM_SLIPPERY      47
+#define ED_CHECKBUTTON_ID_CUSTOM_DEADLY                48
+#define ED_CHECKBUTTON_ID_CUSTOM_CAN_EXPLODE   49
+#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_FIRE  50
+#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_SMASH 51
+#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_IMPACT        52
+#define ED_CHECKBUTTON_ID_CUSTOM_CAN_CHANGE    53
+#define ED_CHECKBUTTON_ID_CHANGE_DELAY         54
+#define ED_CHECKBUTTON_ID_CHANGE_BY_DIRECT_ACT 55
+#define ED_CHECKBUTTON_ID_CHANGE_BY_OTHER_ACT  56
+#define ED_CHECKBUTTON_ID_CHANGE_USE_EXPLOSION 57
+#define ED_CHECKBUTTON_ID_CHANGE_USE_CONTENT   58
+#define ED_CHECKBUTTON_ID_CHANGE_ONLY_COMPLETE 59
+#define ED_CHECKBUTTON_ID_CHANGE_USE_RANDOM    60
+#define ED_CHECKBUTTON_ID_CHANGE_HAS_ACTION    61
+
+#define ED_NUM_CHECKBUTTONS                    62
+
+#define ED_CHECKBUTTON_ID_LEVEL_FIRST  ED_CHECKBUTTON_ID_AUTO_COUNT_GEMS
+#define ED_CHECKBUTTON_ID_LEVEL_LAST   ED_CHECKBUTTON_ID_AUTO_COUNT_GEMS
 
 #define ED_CHECKBUTTON_ID_EDITOR_FIRST ED_CHECKBUTTON_ID_RANDOM_RESTRICTED
 #define ED_CHECKBUTTON_ID_EDITOR_LAST  ED_CHECKBUTTON_ID_CUSTOM_USE_TEMPLATE_2
@@ -1299,7 +1316,7 @@ static struct
     NULL,                              "number of gems to collect:", NULL
   },
   {
-    ED_LEVEL_SETTINGS_XPOS(0),         ED_LEVEL_SETTINGS_YPOS(7),
+    ED_LEVEL_SETTINGS_XPOS(0),         ED_LEVEL_SETTINGS_YPOS(8),
     0,                                 9999,
     GADGET_ID_LEVEL_TIMELIMIT_DOWN,    GADGET_ID_LEVEL_TIMELIMIT_UP,
     GADGET_ID_LEVEL_TIMELIMIT_TEXT,    GADGET_ID_NONE,
@@ -1307,7 +1324,7 @@ static struct
     "time or step limit to solve level:", NULL, NULL
   },
   {
-    ED_LEVEL_SETTINGS_XPOS(0),         ED_LEVEL_SETTINGS_YPOS(9),
+    ED_LEVEL_SETTINGS_XPOS(0),         ED_LEVEL_SETTINGS_YPOS(10),
     0,                                 999,
     GADGET_ID_LEVEL_TIMESCORE_DOWN,    GADGET_ID_LEVEL_TIMESCORE_UP,
     GADGET_ID_LEVEL_TIMESCORE_TEXT,    GADGET_ID_NONE,
@@ -1315,7 +1332,7 @@ static struct
     "score for each second/step left:",        NULL, NULL
   },
   {
-    ED_LEVEL_SETTINGS_XPOS(0),         ED_LEVEL_SETTINGS_YPOS(12),
+    ED_LEVEL_SETTINGS_XPOS(0),         ED_LEVEL_SETTINGS_YPOS(13),
     0,                                 9999,
     GADGET_ID_LEVEL_RANDOM_SEED_DOWN,  GADGET_ID_LEVEL_RANDOM_SEED_UP,
     GADGET_ID_LEVEL_RANDOM_SEED_TEXT,  GADGET_ID_NONE,
@@ -2322,7 +2339,7 @@ static struct
   /* ---------- level and editor settings ---------------------------------- */
 
   {
-    -1,                                        ED_LEVEL_SETTINGS_YPOS(7),
+    -1,                                        ED_LEVEL_SETTINGS_YPOS(8),
     GADGET_ID_TIME_OR_STEPS,           GADGET_ID_LEVEL_TIMELIMIT_UP,
     -1,
     options_time_or_steps,
@@ -2330,7 +2347,7 @@ static struct
     NULL, "(0 => no limit)",           "time or step limit"
   },
   {
-    ED_LEVEL_SETTINGS_XPOS(0),         ED_LEVEL_SETTINGS_YPOS(11),
+    ED_LEVEL_SETTINGS_XPOS(0),         ED_LEVEL_SETTINGS_YPOS(12),
     GADGET_ID_GAME_ENGINE_TYPE,                GADGET_ID_NONE,
     -1,
     options_game_engine_type,
@@ -2338,7 +2355,7 @@ static struct
     "game engine:", NULL,              "game engine"
   },
   {
-    ED_LEVEL_SETTINGS_XPOS(0),         ED_LEVEL_SETTINGS_YPOS(10),
+    ED_LEVEL_SETTINGS_XPOS(0),         ED_LEVEL_SETTINGS_YPOS(11),
     GADGET_ID_WIND_DIRECTION,          GADGET_ID_NONE,
     -1,
     options_wind_direction,
@@ -2818,6 +2835,13 @@ static struct
 {
   /* ---------- level and editor settings ---------------------------------- */
 
+  {
+    ED_LEVEL_SETTINGS_XPOS(0),         ED_LEVEL_SETTINGS_YPOS(6),
+    GADGET_ID_AUTO_COUNT_GEMS,         GADGET_ID_NONE,
+    &level.auto_count_gems,
+    NULL, NULL,
+    "automatically count gems needed", "set counter to number of gems"
+  },
   {
     ED_LEVEL_SETTINGS_XPOS(0),         ED_LEVEL_SETTINGS_YPOS(1),
     GADGET_ID_RANDOM_RESTRICTED,       GADGET_ID_NONE,
@@ -3031,6 +3055,48 @@ static struct
     NULL, " ",
     "centered",                                "automatically center envelope text"
   },
+  {
+    ED_ELEMENT_SETTINGS_XPOS(0),       ED_ELEMENT_SETTINGS_YPOS(1),
+    GADGET_ID_MM_LASER_RED,            GADGET_ID_NONE,
+    &level.mm_laser_red,
+    "choose color components for laser:", NULL,
+    "red",                             "use red color components in laser"
+  },
+  {
+    ED_ELEMENT_SETTINGS_XPOS(0),       ED_ELEMENT_SETTINGS_YPOS(2),
+    GADGET_ID_MM_LASER_GREEN,          GADGET_ID_NONE,
+    &level.mm_laser_green,
+    NULL, NULL,
+    "green",                           "use green color components in laser"
+  },
+  {
+    ED_ELEMENT_SETTINGS_XPOS(0),       ED_ELEMENT_SETTINGS_YPOS(3),
+    GADGET_ID_MM_LASER_BLUE,           GADGET_ID_NONE,
+    &level.mm_laser_blue,
+    NULL, NULL,
+    "blue",                            "use blue color components in laser"
+  },
+  {
+    ED_ELEMENT_SETTINGS_XPOS(0),       ED_ELEMENT_SETTINGS_YPOS(1),
+    GADGET_ID_DF_LASER_RED,            GADGET_ID_NONE,
+    &level.df_laser_red,
+    "choose color components for laser:", NULL,
+    "red",                             "use red color components in laser"
+  },
+  {
+    ED_ELEMENT_SETTINGS_XPOS(0),       ED_ELEMENT_SETTINGS_YPOS(2),
+    GADGET_ID_DF_LASER_GREEN,          GADGET_ID_NONE,
+    &level.df_laser_green,
+    NULL, NULL,
+    "green",                           "use green color components in laser"
+  },
+  {
+    ED_ELEMENT_SETTINGS_XPOS(0),       ED_ELEMENT_SETTINGS_YPOS(3),
+    GADGET_ID_DF_LASER_BLUE,           GADGET_ID_NONE,
+    &level.df_laser_blue,
+    NULL, NULL,
+    "blue",                            "use blue color components in laser"
+  },
 
   /* ---------- element settings: configure 1 (custom elements) ----------- */
 
@@ -3576,6 +3642,7 @@ static void DrawPropertiesWindow();
 static void DrawPaletteWindow();
 static void UpdateCustomElementGraphicGadgets();
 static boolean checkPropertiesConfig(int);
+static void SetAutomaticNumberOfGemsNeeded();
 static void CopyLevelToUndoBuffer(int);
 static void HandleDrawingAreas(struct GadgetInfo *);
 static void HandleCounterButtons(struct GadgetInfo *);
@@ -8584,6 +8651,10 @@ static void DrawLevelInfoLevel()
   for (i = ED_COUNTER_ID_LEVEL_FIRST; i <= ED_COUNTER_ID_LEVEL_LAST; i++)
     MapCounterButtons(i);
 
+  /* draw checkbutton gadgets */
+  for (i = ED_CHECKBUTTON_ID_LEVEL_FIRST; i<= ED_CHECKBUTTON_ID_LEVEL_LAST; i++)
+    MapCheckbuttonGadget(i);
+
   /* draw selectbox gadgets */
   for (i = ED_SELECTBOX_ID_LEVEL_FIRST; i <= ED_SELECTBOX_ID_LEVEL_LAST; i++)
     MapSelectboxGadget(i);
@@ -8626,6 +8697,8 @@ static void DrawLevelInfoWindow()
 
   stick_element_properties_window = FALSE;
 
+  SetAutomaticNumberOfGemsNeeded();
+
   UnmapLevelEditorFieldGadgets();
 
   SetMainBackgroundImage(IMG_BACKGROUND_EDITOR);
@@ -9148,6 +9221,10 @@ static struct
   { EL_SPRING,         &level.slurp_score,             TEXT_SLURPING   },
   { EL_EMC_LENSES,     &level.lenses_time,             TEXT_DURATION   },
   { EL_EMC_MAGNIFIER,  &level.magnify_time,            TEXT_DURATION   },
+#if 0
+  /* defined, but currently not used in MM engine */
+  { EL_MM_FUSE_ACTIVE, &level.mm_time_fuse,            TEXT_DURATION   },
+#endif
 
   { -1,                        NULL,                           NULL            }
 };
@@ -9160,6 +9237,8 @@ static boolean checkPropertiesConfig(int element)
       IS_CUSTOM_ELEMENT(element) ||
       IS_GROUP_ELEMENT(element) ||
       IS_ENVELOPE(element) ||
+      IS_MM_MCDUFFIN(element) ||
+      IS_DF_LASER(element) ||
       ELEM_IS_PLAYER(element) ||
       HAS_EDITOR_CONTENT(element) ||
       CAN_GROW(element) ||
@@ -9177,6 +9256,31 @@ static boolean checkPropertiesConfig(int element)
   return FALSE;
 }
 
+static void SetAutomaticNumberOfGemsNeeded()
+{
+  int x, y;
+
+  if (!level.auto_count_gems)
+    return;
+
+  level.gems_needed = 0;
+
+  for (x = 0; x < lev_fieldx; x++)
+  {
+    for (y = 0; y < lev_fieldy; y++)
+    {
+      int element = Feld[x][y];
+
+      if (IS_GEM(element) ||
+         element == EL_MM_KETTLE ||
+         element == EL_DF_CELL)
+       level.gems_needed++;
+    }
+  }
+
+  ModifyEditorCounterValue(ED_COUNTER_ID_LEVEL_GEMSLIMIT, level.gems_needed);
+}
+
 static void DrawPropertiesConfig()
 {
   boolean draw_footer_line = FALSE;
@@ -9397,6 +9501,20 @@ static void DrawPropertiesConfig()
     DrawEnvelopeTextArea(envelope_nr);
   }
 
+  if (IS_MM_MCDUFFIN(properties_element))
+  {
+    MapCheckbuttonGadget(ED_CHECKBUTTON_ID_MM_LASER_RED);
+    MapCheckbuttonGadget(ED_CHECKBUTTON_ID_MM_LASER_GREEN);
+    MapCheckbuttonGadget(ED_CHECKBUTTON_ID_MM_LASER_BLUE);
+  }
+
+  if (IS_DF_LASER(properties_element))
+  {
+    MapCheckbuttonGadget(ED_CHECKBUTTON_ID_DF_LASER_RED);
+    MapCheckbuttonGadget(ED_CHECKBUTTON_ID_DF_LASER_GREEN);
+    MapCheckbuttonGadget(ED_CHECKBUTTON_ID_DF_LASER_BLUE);
+  }
+
   if (IS_CUSTOM_ELEMENT(properties_element))
   {
     /* draw stickybutton gadget */
@@ -12157,6 +12275,10 @@ static void HandleCheckbuttons(struct GadgetInfo *gi)
     ResetUndoBuffer();
     DrawEditModeWindow();
   }
+  else if (type_id == ED_CHECKBUTTON_ID_AUTO_COUNT_GEMS)
+  {
+    SetAutomaticNumberOfGemsNeeded();
+  }
 
   /* do not mark level as modified for certain non-level-changing gadgets */
   if ((type_id >= ED_CHECKBUTTON_ID_EDITOR_FIRST &&
@@ -12544,6 +12666,8 @@ static void HandleControlButtons(struct GadgetInfo *gi)
        if (leveldir_former->readonly)
          ModifyLevelInfoForSavingIntoPersonalLevelSet(leveldir_former->name);
 
+       SetAutomaticNumberOfGemsNeeded();
+
        CopyPlayfield(Feld, level.field);
        SaveLevel(level_nr);
 
index c60e08b45e80f88a623775853928bd937adbcd45..2ba8e9e6126e867d8f5c7edc6b92479707e1711f 100644 (file)
@@ -244,6 +244,12 @@ static struct LevelFileConfigInfo chunk_config_INFO[] =
     &li.auto_exit_sokoban,             FALSE
   },
 
+  {
+    -1,                                        -1,
+    TYPE_BOOLEAN,                      CONF_VALUE_8_BIT(10),
+    &li.auto_count_gems,               FALSE
+  },
+
   {
     -1,                                        -1,
     -1,                                        -1,
@@ -800,6 +806,44 @@ static struct LevelFileConfigInfo chunk_config_ELEM[] =
     &li.num_ball_contents,             4, MAX_ELEMENT_CONTENTS
   },
 
+  {
+    EL_MM_MCDUFFIN,                    -1,
+    TYPE_BOOLEAN,                      CONF_VALUE_8_BIT(1),
+    &li.mm_laser_red,                  FALSE
+  },
+  {
+    EL_MM_MCDUFFIN,                    -1,
+    TYPE_BOOLEAN,                      CONF_VALUE_8_BIT(2),
+    &li.mm_laser_green,                        FALSE
+  },
+  {
+    EL_MM_MCDUFFIN,                    -1,
+    TYPE_BOOLEAN,                      CONF_VALUE_8_BIT(3),
+    &li.mm_laser_blue,                 TRUE
+  },
+
+  {
+    EL_DF_LASER,                       -1,
+    TYPE_BOOLEAN,                      CONF_VALUE_8_BIT(1),
+    &li.df_laser_red,                  TRUE
+  },
+  {
+    EL_DF_LASER,                       -1,
+    TYPE_BOOLEAN,                      CONF_VALUE_8_BIT(2),
+    &li.df_laser_green,                        TRUE
+  },
+  {
+    EL_DF_LASER,                       -1,
+    TYPE_BOOLEAN,                      CONF_VALUE_8_BIT(3),
+    &li.df_laser_blue,                 FALSE
+  },
+
+  {
+    EL_MM_FUSE,                                -1,
+    TYPE_INTEGER,                      CONF_VALUE_16_BIT(1),
+    &li.mm_time_fuse,                  0
+  },
+
   /* ---------- unused values ----------------------------------------------- */
 
   {
@@ -3941,10 +3985,11 @@ void CopyNativeLevel_RND_to_MM(struct LevelInfo *level)
 
   level_mm->time = level->time;
   level_mm->kettles_needed = level->gems_needed;
-  level_mm->auto_count_kettles = FALSE;
-  level_mm->laser_red = FALSE;
-  level_mm->laser_green = FALSE;
-  level_mm->laser_blue = TRUE;
+  level_mm->auto_count_kettles = level->auto_count_gems;
+
+  level_mm->laser_red = level->mm_laser_red;
+  level_mm->laser_green = level->mm_laser_green;
+  level_mm->laser_blue = level->mm_laser_blue;
 
   strcpy(level_mm->name, level->name);
   strcpy(level_mm->author, level->author);
@@ -3954,7 +3999,7 @@ void CopyNativeLevel_RND_to_MM(struct LevelInfo *level)
   level_mm->score[SC_TIME_BONUS] = level->score[SC_TIME_BONUS];
 
   level_mm->amoeba_speed = level->amoeba_speed;
-  level_mm->time_fuse = 0;
+  level_mm->time_fuse = level->mm_time_fuse;
 
   for (x = 0; x < level->fieldx; x++)
     for (y = 0; y < level->fieldy; y++)
@@ -3976,6 +4021,11 @@ void CopyNativeLevel_MM_to_RND(struct LevelInfo *level)
 
   level->time = level_mm->time;
   level->gems_needed = level_mm->kettles_needed;
+  level->auto_count_gems = level_mm->auto_count_kettles;
+
+  level->mm_laser_red = level_mm->laser_red;
+  level->mm_laser_green = level_mm->laser_green;
+  level->mm_laser_blue = level_mm->laser_blue;
 
   strcpy(level->name, level_mm->name);
 
@@ -3988,21 +4038,11 @@ void CopyNativeLevel_MM_to_RND(struct LevelInfo *level)
   level->score[SC_TIME_BONUS] = level_mm->score[SC_TIME_BONUS];
 
   level->amoeba_speed = level_mm->amoeba_speed;
+  level->mm_time_fuse = level_mm->time_fuse;
 
   for (x = 0; x < level->fieldx; x++)
     for (y = 0; y < level->fieldy; y++)
       level->field[x][y] = map_element_MM_to_RND(level_mm->field[x][y]);
-
-  if (level_mm->auto_count_kettles)
-  {
-    level->gems_needed = 0;
-
-    for (x = 0; x < level->fieldx; x++)
-      for (y = 0; y < level->fieldy; y++)
-       if (level->field[x][y] == EL_MM_KETTLE ||
-           level->field[x][y] == EL_DF_CELL)
-         level->gems_needed++;
-  }
 }
 
 
index 70a94900afef51d746e7bb7d36797d83c13b3a99..f44d1e30e37d2fafe41e07ad5f71eb888c2342d4 100644 (file)
 #define IS_DF_ELEMENT(e)       ((e) >= EL_DF_START &&                  \
                                 (e) <= EL_DF_END)
 
+#define IS_MM_MCDUFFIN(e)      ((e) >= EL_MM_MCDUFFIN_START &&         \
+                                (e) <= EL_MM_MCDUFFIN_END)
+
+#define IS_DF_LASER(e)         ((e) >= EL_DF_LASER_START &&            \
+                                (e) <= EL_DF_LASER_END)
+
 #define IS_MM_WALL(e)          (((e) >= EL_MM_WALL_START &&            \
                                  (e) <= EL_MM_WALL_END) ||             \
                                 ((e) >= EL_DF_WALL_START &&            \
@@ -2949,6 +2955,7 @@ struct LevelInfo
 
   int time;                            /* available time (seconds) */
   int gems_needed;
+  boolean auto_count_gems;
 
   char name[MAX_LEVEL_NAME_LEN + 1];
   char author[MAX_LEVEL_AUTHOR_LEN + 1];
@@ -3035,6 +3042,11 @@ struct LevelInfo
   boolean block_last_field;    /* player blocks previous field while moving */
   boolean sp_block_last_field; /* player blocks previous field while moving */
 
+  /* values for MM/DF elements */
+  boolean mm_laser_red, mm_laser_green, mm_laser_blue;
+  boolean df_laser_red, df_laser_green, df_laser_blue;
+  int mm_time_fuse;
+
   /* ('int' instead of 'boolean' because used as selectbox value in editor) */
   int use_step_counter;                /* count steps instead of seconds for level */