X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fmain.h;h=d09b3278e5eea8ba321998d87e74035acee18c83;hb=1c636a51bb573815d24a27dcc20b3283d89d1b8b;hp=4afa2703a56e800152eafe66d4e9ff56e8a44788;hpb=27d994c87645e3849ad0384a73100f1a800ab3a5;p=rocksndiamonds.git diff --git a/src/main.h b/src/main.h index 4afa2703..d09b3278 100644 --- a/src/main.h +++ b/src/main.h @@ -222,7 +222,7 @@ #define CP_HALF_DESTRUCTIVE 1 #define CP_FULL_DESTRUCTIVE 2 -/* values for special move patterns (bits 0-3: basic move directions) */ +/* values for custom 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 @@ -236,15 +236,12 @@ #define MV_BIT_TURNING_LEFT_RIGHT 14 #define MV_BIT_TURNING_RIGHT_LEFT 15 #define MV_BIT_TURNING_RANDOM 16 -#define MV_BIT_PREVIOUS 17 -/* values for special move patterns for custom elements */ +/* values for custom move patterns */ #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_RANDOM (MV_ALL_DIRECTIONS) -#define MV_AUTOMATIC (MV_NO_MOVING) #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) @@ -259,7 +256,18 @@ #define MV_TURNING_LEFT_RIGHT (1 << MV_BIT_TURNING_LEFT_RIGHT) #define MV_TURNING_RIGHT_LEFT (1 << MV_BIT_TURNING_RIGHT_LEFT) #define MV_TURNING_RANDOM (1 << MV_BIT_TURNING_RANDOM) -#define MV_PREVIOUS (1 << MV_BIT_PREVIOUS) + +/* values for initial move direction (bits 0 - 3: basic move directions) */ +#define MV_START_BIT_PREVIOUS 4 + +/* values for initial move direction */ +#define MV_START_AUTOMATIC (MV_NO_MOVING) +#define MV_START_LEFT (MV_LEFT) +#define MV_START_RIGHT (MV_RIGHT) +#define MV_START_UP (MV_UP) +#define MV_START_DOWN (MV_DOWN) +#define MV_START_RANDOM (MV_ALL_DIRECTIONS) +#define MV_START_PREVIOUS (1 << MV_START_BIT_PREVIOUS) /* values for elements left behind by custom elements */ #define LEAVE_TYPE_UNLIMITED 0 @@ -389,10 +397,21 @@ #define PLAYERINFO(x,y) (&stored_player[StorePlayer[x][y]-EL_PLAYER_1]) #define SHIELD_ON(p) ((p)->shield_normal_time_left > 0) + +#if 1 +#define ENEMY_PROTECTED_FIELD(x,y) (IS_PROTECTED(Feld[x][y]) || \ + IS_PROTECTED(Back[x][y])) +#define EXPLOSION_PROTECTED_FIELD(x,y) (IS_EXPLOSION_PROOF(Feld[x][y])) +#define PLAYER_ENEMY_PROTECTED(x,y) (SHIELD_ON(PLAYERINFO(x, y)) || \ + ENEMY_PROTECTED_FIELD(x, y)) +#define PLAYER_EXPLOSION_PROTECTED(x,y) (SHIELD_ON(PLAYERINFO(x, y)) || \ + EXPLOSION_PROTECTED_FIELD(x, y)) +#else #define PROTECTED_FIELD(x,y) (IS_ACCESSIBLE_INSIDE(Feld[x][y]) && \ IS_INDESTRUCTIBLE(Feld[x][y])) #define PLAYER_PROTECTED(x,y) (SHIELD_ON(PLAYERINFO(x, y)) || \ PROTECTED_FIELD(x, y)) +#endif #define PLAYER_SWITCHING(p,x,y) ((p)->is_switching && \ (p)->switch_x == (x) && (p)->switch_y == (y)) @@ -1555,6 +1574,9 @@ struct ElementInfo int content[3][3]; /* new elements after explosion */ + int explosion_delay; /* duration of explosion of this element */ + int ignition_delay; /* delay for explosion by other explosion */ + struct ElementChangeInfo *change_page; /* actual list of change pages */ struct ElementChangeInfo *change; /* pointer to current change page */