rnd-20030703-3-src
[rocksndiamonds.git] / src / main.h
index 8dd07973ad26d5f8f2a833535f325c44ced666a7..95f6da8efa83e981462ca15af4c62117ca31c46d 100644 (file)
 /* 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
@@ -1085,6 +1086,8 @@ struct LevelInfo
   boolean gravity;
   boolean em_slippery_gems;    /* EM style "gems slip from wall" behaviour */
 
+  boolean use_custom_template; /* use custom properties from template file */
+
   boolean no_level_file;
 };
 
@@ -1175,13 +1178,13 @@ struct ElementChangeInfo
 {
   unsigned long events;                /* bitfield for change events */
 
+  short target_element;                /* target element after change */
+
   int delay_fixed;             /* added frame delay before changed (fixed) */
   int delay_random;            /* added frame delay before changed (random) */
   int delay_frames;            /* either 1 (frames) or 50 (seconds; 50 fps) */
 
-  short trigger;               /* custom element triggering change */
-
-  short target_element;                /* target element after change */
+  short trigger_element;       /* custom element triggering change */
 
   int content[3][3];           /* new elements after extended change */
   boolean use_content;         /* use extended change content */
@@ -1205,8 +1208,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 ---------- */
 
@@ -1220,9 +1224,7 @@ struct ElementInfo
 
   /* ---------- special element property values ---------- */
 
-  boolean use_template;                /* use all properties from template file */
-
-  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 */
@@ -1240,6 +1242,22 @@ struct ElementInfo
   int content[3][3];           /* new elements after explosion */
 
   struct ElementChangeInfo change;
+
+  /* ---------- internal values used in level editor ---------- */
+
+  int access_type;             /* walkable or passable */
+  int access_layer;            /* accessible over/inside/under */
+  int walk_to_action;          /* diggable/collectible/pushable */
+  int smash_targets;           /* can smash player/enemies/everything */
+  int deadliness;              /* deadly when running/colliding/touching */
+  int consistency;             /* indestructible/can explode */
+  int change_player_action;    /* touched/pressed/pushed by player */
+  int change_collide_action;   /* collision/impact/smashed */
+  int change_other_action;     /* various change actions */
+
+  boolean can_explode_by_fire; /* element explodes by fire */
+  boolean can_explode_smashed; /* element explodes when smashed */
+  boolean can_explode_impact;  /* element explodes on impact */
 };
 
 struct FontInfo