rnd-20030707-1-src
[rocksndiamonds.git] / src / main.h
index 255a6475adc66f2f3aa4786be75c8835394c871c..340f8bebd4dceae0b7dbdf22418ef38143b774a4 100644 (file)
 #define CP_HALF_DESTRUCTIVE    1
 #define CP_FULL_DESTRUCTIVE    2
 
+/* values for special move patterns (bits 0-3: basic move directions) */
+#define MV_BIT_TOWARDS_PLAYER  4
+#define MV_BIT_AWAY_FROM_PLAYER        5
+#define MV_BIT_ALONG_LEFT_SIDE 6
+#define MV_BIT_ALONG_RIGHT_SIDE        7
+#define MV_BIT_TURNING_LEFT    8
+#define MV_BIT_TURNING_RIGHT   9
+
+/* values for special move patterns for custom elements */
+#define MV_HORIZONTAL          (MV_LEFT | MV_RIGHT)
+#define MV_VERTICAL            (MV_UP | MV_DOWN)
+#define MV_ALL_DIRECTIONS      (MV_HORIZONTAL | MV_VERTICAL)
+#define MV_ANY_DIRECTION       (MV_ALL_DIRECTIONS)
+#define MV_TOWARDS_PLAYER      (1 << MV_BIT_TOWARDS_PLAYER)
+#define MV_AWAY_FROM_PLAYER    (1 << MV_BIT_AWAY_FROM_PLAYER)
+#define MV_ALONG_LEFT_SIDE     (1 << MV_BIT_ALONG_LEFT_SIDE)
+#define MV_ALONG_RIGHT_SIDE    (1 << MV_BIT_ALONG_RIGHT_SIDE)
+#define MV_TURNING_LEFT                (1 << MV_BIT_TURNING_LEFT)
+#define MV_TURNING_RIGHT       (1 << MV_BIT_TURNING_RIGHT)
+
+/* values for slippery property for custom elements */
+#define SLIPPERY_ANY_RANDOM    0
+#define SLIPPERY_ANY_LEFT_RIGHT        1
+#define SLIPPERY_ANY_RIGHT_LEFT        2
+#define SLIPPERY_ONLY_LEFT     3
+#define SLIPPERY_ONLY_RIGHT    4
 
 /* macros for configurable properties */
 #define IS_DIGGABLE(e)         HAS_PROPERTY(e, EP_DIGGABLE)
 /* boundaries of arrays etc. */
 #define MAX_LEVEL_NAME_LEN     32
 #define MAX_LEVEL_AUTHOR_LEN   32
+#define MAX_ELEMENT_NAME_LEN   32
 #define MAX_TAPELEN            (1000 * 50)     /* max. time * framerate */
 #define MAX_SCORE_ENTRIES      100
 #define MAX_NUM_AMOEBA         100
@@ -1207,8 +1234,9 @@ struct ElementInfo
 
   char *token_name;            /* element token used in config files */
   char *class_name;            /* element class used in config files */
-  char *editor_description;    /* short description for level editor */
-  char *custom_description;    /* custom description for level editor */
+  char *editor_description;    /* pre-defined description for level editor */
+  char *custom_description;    /* alternative description from config file */
+  char description[MAX_ELEMENT_NAME_LEN + 1];  /* for custom elements */
 
   /* ---------- graphic and sound definitions ---------- */
 
@@ -1222,7 +1250,7 @@ struct ElementInfo
 
   /* ---------- special element property values ---------- */
 
-  boolean use_gfx_element;
+  boolean use_gfx_element;     /* use custom graphic element */
   short gfx_element;           /* optional custom graphic element */
 
   int score;                   /* score value for collecting */
@@ -1237,6 +1265,8 @@ struct ElementInfo
   int move_direction_initial;  /* initial direction element moves to */
   int move_stepsize;           /* step size element moves with */
 
+  int slippery_type;           /* how/where other elements slip away */
+
   int content[3][3];           /* new elements after explosion */
 
   struct ElementChangeInfo change;