From: Holger Schemel Date: Sat, 28 Jun 2003 08:33:16 +0000 (+0200) Subject: rnd-20030628-1-src X-Git-Tag: 3.0.0^2~38 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=95566a9d19e926d3fc4868efda00b2cabe6955d6;p=rocksndiamonds.git rnd-20030628-1-src --- diff --git a/src/conftime.h b/src/conftime.h index 2438837c..2eb3b39c 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2003-06-27 20:39]" +#define COMPILE_DATE_STRING "[2003-06-28 00:49]" diff --git a/src/editor.c b/src/editor.c index e56fa695..bfec772d 100644 --- a/src/editor.c +++ b/src/editor.c @@ -849,6 +849,8 @@ static struct ValueTextInfo options_move_pattern[] = { 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 } }; diff --git a/src/game.c b/src/game.c index f2905457..61baa07c 100644 --- a/src/game.c +++ b/src/game.c @@ -107,7 +107,7 @@ (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)) @@ -1239,7 +1239,9 @@ void InitMovDir(int x, int y) { 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); @@ -3045,12 +3047,18 @@ void TurnRound(int x, int y) } } } - 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); @@ -3471,7 +3479,9 @@ void StartMoving(int x, int y) 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); diff --git a/src/libgame/system.h b/src/libgame/system.h index bc025636..76a421bd 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -86,6 +86,8 @@ #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 @@ -112,6 +114,8 @@ #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