static void InitMagicBallDelay(int, int);
static void ActivateMagicBall(int, int);
-static void InitAndroid(int, int);
+static void InitDiagonalMovingElement(int, int);
struct ChangingElementInfo
{
NULL
},
{
- EL_EMC_ANDROID_SHRINKING,
+ EL_DIAGONAL_SHRINKING,
EL_EMPTY,
- 8,
+ 0,
NULL,
NULL,
NULL
},
{
- EL_EMC_ANDROID_GROWING,
- EL_EMC_ANDROID,
- 8,
+ EL_DIAGONAL_GROWING,
+ EL_EMPTY,
+ 0,
NULL,
NULL,
- InitAndroid
+ InitDiagonalMovingElement
},
{
for (i = 0; i < 3; i++)
{
- int pos_raw = start_pos + (i == 0 ? 0 : i == 1 ? 1 : -1) * check_order;
+ /* first check start_pos, then previous/next or (next/previous) pos */
+ int pos_raw = start_pos + (i < 2 ? i : -1) * check_order;
int pos = (pos_raw + 8) % 8;
int newx = x + check_xy[pos].dx;
int newy = y + check_xy[pos].dy;
if (MovDir[x][y] & MV_HORIZONTAL && MovDir[x][y] & MV_VERTICAL &&
ANDROID_CAN_ENTER_FIELD(element, newx, newy))
{
+ int diagonal_move_dir = MovDir[x][y];
+ int change_delay = 8;
+ int graphic;
+
/* android is moving diagonally */
- CreateField(x, y, EL_EMC_ANDROID_SHRINKING);
+ CreateField(x, y, EL_DIAGONAL_SHRINKING);
+
+ GfxElement[x][y] = EL_EMC_ANDROID;
+ GfxAction[x][y] = ACTION_SHRINKING;
+ GfxDir[x][y] = diagonal_move_dir;
+ ChangeDelay[x][y] = change_delay;
+
+ graphic = el_act_dir2img(GfxElement[x][y], GfxAction[x][y],
+ GfxDir[x][y]);
+
+ DrawLevelGraphicAnimation(x, y, graphic);
+ PlayLevelSoundAction(x, y, ACTION_SHRINKING);
#if 0
CheckTriggeredElementChangeBySide(x, y, element,
TestIfElementTouchesCustomElement(newx, newy);
#endif
- CreateField(newx, newy, EL_EMC_ANDROID_GROWING);
+ CreateField(newx, newy, EL_DIAGONAL_GROWING);
+
+ Store[newx][newy] = EL_EMC_ANDROID;
+ GfxElement[newx][newy] = EL_EMC_ANDROID;
+ GfxAction[newx][newy] = ACTION_GROWING;
+ GfxDir[newx][newy] = diagonal_move_dir;
+ ChangeDelay[newx][newy] = change_delay;
+
+ graphic = el_act_dir2img(GfxElement[newx][newy], GfxAction[newx][newy],
+ GfxDir[newx][newy]);
+
+ DrawLevelGraphicAnimation(newx, newy, graphic);
+ PlayLevelSoundAction(newx, newy, ACTION_GROWING);
return;
}
game.ball_content_nr = (game.ball_content_nr + 1) % level.num_ball_contents;
}
-static void InitAndroid(int x, int y)
+static void InitDiagonalMovingElement(int x, int y)
{
+#if 0
MovDelay[x][y] = level.android_move_time;
+#endif
}
void CheckExit(int x, int y)
{
target_element = GET_TARGET_ELEMENT(change->target_element, change);
+ if (element == EL_DIAGONAL_GROWING)
+ target_element = Store[x][y];
+
CreateElementFromChange(x, y, target_element);
PlayLevelSoundElementAction(x, y, element, ACTION_CHANGING);
CheckForDragon(x, y);
else if (element == EL_EXPLOSION)
; /* drawing of correct explosion animation is handled separately */
- else if (element == EL_ELEMENT_SNAPPING)
+ else if (element == EL_ELEMENT_SNAPPING ||
+ element == EL_DIAGONAL_SHRINKING ||
+ element == EL_DIAGONAL_GROWING)
{
#if 1
graphic = el_act_dir2img(GfxElement[x][y], GfxAction[x][y],GfxDir[x][y]);