{ MV_AWAY_FROM_PLAYER, "away from player" },
{ MV_ALONG_LEFT_SIDE, "along left side" },
{ MV_ALONG_RIGHT_SIDE, "along right side" },
+ { MV_TURNING_LEFT, "turning left" },
+ { MV_TURNING_RIGHT, "turning right" },
{ -1, NULL }
};
(condition)))
#define ELEMENT_CAN_ENTER_FIELD(e, x, y) \
- ELEMENT_CAN_ENTER_FIELD_GENERIC(e, x, y, 1)
+ ELEMENT_CAN_ENTER_FIELD_GENERIC(e, x, y, 0)
#define ELEMENT_CAN_ENTER_FIELD_OR_ACID(e, x, y) \
ELEMENT_CAN_ENTER_FIELD_GENERIC(e, x, y, (Feld[x][y] == EL_ACID))
{
if (element_info[element].move_direction_initial != MV_NO_MOVING)
MovDir[x][y] = element_info[element].move_direction_initial;
- else if (element_info[element].move_pattern == MV_ALL_DIRECTIONS)
+ else if (element_info[element].move_pattern == MV_ALL_DIRECTIONS ||
+ element_info[element].move_pattern == MV_TURNING_LEFT ||
+ element_info[element].move_pattern == MV_TURNING_RIGHT)
MovDir[x][y] = 1 << RND(4);
else if (element_info[element].move_pattern == MV_HORIZONTAL)
MovDir[x][y] = (RND(2) ? MV_LEFT : MV_RIGHT);
}
}
}
- else if (element_info[element].move_pattern == MV_ALL_DIRECTIONS)
+ else if (element_info[element].move_pattern == MV_ALL_DIRECTIONS ||
+ element_info[element].move_pattern == MV_TURNING_LEFT ||
+ element_info[element].move_pattern == MV_TURNING_RIGHT)
{
boolean can_turn_left = ELEMENT_CAN_ENTER_FIELD(element, left_x, left_y);
boolean can_turn_right = ELEMENT_CAN_ENTER_FIELD(element, right_x,right_y);
- if (can_turn_left && can_turn_right)
+ if (element_info[element].move_pattern == MV_TURNING_LEFT)
+ MovDir[x][y] = left_dir;
+ else if (element_info[element].move_pattern == MV_TURNING_RIGHT)
+ MovDir[x][y] = right_dir;
+ else if (can_turn_left && can_turn_right)
MovDir[x][y] = (RND(3) ? (RND(2) ? left_dir : right_dir) : back_dir);
else if (can_turn_left)
MovDir[x][y] = (RND(2) ? left_dir : back_dir);
if (element != EL_YAMYAM &&
element != EL_DARK_YAMYAM &&
element != EL_PACMAN &&
- !(element_info[element].move_pattern & MV_ANY_DIRECTION))
+ !(element_info[element].move_pattern & MV_ANY_DIRECTION) &&
+ element_info[element].move_pattern != MV_TURNING_LEFT &&
+ element_info[element].move_pattern != MV_TURNING_RIGHT)
{
TurnRound(x, y);
#define MV_BIT_AWAY_FROM_PLAYER 7
#define MV_BIT_ALONG_LEFT_SIDE 8
#define MV_BIT_ALONG_RIGHT_SIDE 9
+#define MV_BIT_TURNING_LEFT 10
+#define MV_BIT_TURNING_RIGHT 11
/* values for move direction/pattern and special "button" key bitmasks */
#define MV_NO_MOVING 0
#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 button status */
#define MB_NOT_PRESSED FALSE