X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame.c;h=b135360d0d5722578f9c1315a02298caab80fc55;hb=3fd727f8ab7628eaab0be7de31658d7d468d6c8d;hp=eb11ae1dd3ab48305474d6dde21e2371cf31b088;hpb=234748b5eb0bc4fe29a36fd25a1d25658f53858a;p=rocksndiamonds.git diff --git a/src/game.c b/src/game.c index eb11ae1d..b135360d 100644 --- a/src/game.c +++ b/src/game.c @@ -100,6 +100,7 @@ #define NUM_GAME_BUTTONS 6 /* forward declaration for internal use */ +static void InitBeltMovement(void); static void CloseAllOpenTimegates(void); static void CheckGravityMovement(struct PlayerInfo *); static void KillHeroUnlessProtected(int, int); @@ -292,6 +293,8 @@ static void InitField(int x, int y, boolean init_game) Feld[x][y] = EL_SP_MURPHY_CLONE; break; } + + Feld[x][y] = EL_PLAYER1; } /* no break! */ case EL_PLAYER1: @@ -485,7 +488,7 @@ void DrawGameDoorValues() for (j=0; j<4; j++) if (stored_player[i].key[j]) DrawMiniGraphicExt(drawto, DX_KEYS + j * MINI_TILEX, DY_KEYS, - GFX_SCHLUESSEL1 + j); + IMG_KEY1 + j); DrawText(DX + XX_EMERALDS, DY + YY_EMERALDS, int2str(local_player->gems_still_needed, 3), FS_SMALL, FC_YELLOW); @@ -818,6 +821,8 @@ void InitGame() } } + InitBeltMovement(); + game.emulation = (emulate_bd ? EMU_BOULDERDASH : emulate_sb ? EMU_SOKOBAN : emulate_sp ? EMU_SUPAPLEX : EMU_NONE); @@ -969,7 +974,7 @@ void InitGame() redraw_mask |= REDRAW_FROM_BACKBUFFER; /* copy default game door content to main double buffer */ - BlitBitmap(pix[PIX_DOOR], drawto, + BlitBitmap(new_graphic_info[IMG_MENU_DOOR].bitmap, drawto, DOOR_GFX_PAGEX5, DOOR_GFX_PAGEY1, DXSIZE, DYSIZE, DX, DY); if (level_nr < 100) @@ -996,7 +1001,7 @@ void InitGame() MapTapeButtons(); /* copy actual game door content to door double buffer for OpenDoor() */ - BlitBitmap(drawto, pix[PIX_DB_DOOR], + BlitBitmap(drawto, bitmap_db_door, DX, DY, DXSIZE, DYSIZE, DOOR_GFX_PAGEX1, DOOR_GFX_PAGEY1); OpenDoor(DOOR_OPEN_ALL); @@ -1152,6 +1157,9 @@ void GameWon() if (local_player->MovPos) return; + if (tape.playing && tape.auto_play) + tape.auto_play_level_solved = TRUE; + local_player->LevelSolved = FALSE; PlaySoundStereo(SND_GAME_WINNING, SOUND_MAX_RIGHT); @@ -1325,6 +1333,7 @@ int NewHiScore() void InitMovingField(int x, int y, int direction) { + int element = Feld[x][y]; int newx = x + (direction == MV_LEFT ? -1 : direction == MV_RIGHT ? +1 : 0); int newy = y + (direction == MV_UP ? -1 : direction == MV_DOWN ? +1 : 0); @@ -1334,7 +1343,10 @@ void InitMovingField(int x, int y, int direction) if (Feld[newx][newy] == EL_EMPTY) Feld[newx][newy] = EL_BLOCKED; - GfxAction[x][y] = GFX_ACTION_MOVING; + if (direction == MV_DOWN && CAN_FALL(element)) + GfxAction[x][y] = GFX_ACTION_FALLING; + else + GfxAction[x][y] = GFX_ACTION_MOVING; } void Moving2Blocked(int x, int y, int *goes_to_x, int *goes_to_y) @@ -1700,15 +1712,13 @@ void Explode(int ex, int ey, int phase, int mode) if (IS_PLAYER(x, y) && !PLAYERINFO(x,y)->present) StorePlayer[x][y] = 0; } - else if (!(phase % delay) && IN_SCR_FIELD(SCREENX(x), SCREENY(y))) + else if (phase >= delay && IN_SCR_FIELD(SCREENX(x), SCREENY(y))) { - int graphic = IMG_EXPLOSION; - int frame = (phase / delay - 1); - - if (game.emulation == EMU_SUPAPLEX) - graphic = (Store[x][y] == EL_SP_INFOTRON ? - IMG_SP_EXPLOSION_INFOTRON : - IMG_SP_EXPLOSION); + int stored = Store[x][y]; + int graphic = (game.emulation != EMU_SUPAPLEX ? IMG_EXPLOSION : + stored == EL_SP_INFOTRON ? IMG_SP_EXPLOSION_INFOTRON : + IMG_SP_EXPLOSION); + int frame = getGraphicAnimationFrame(graphic, phase - delay); if (phase == delay) DrawCrumbledSand(SCREENX(x), SCREENY(y)); @@ -1875,6 +1885,67 @@ void Blurb(int x, int y) } } +static void InitBeltMovement() +{ + static int belt_base_element[4] = + { + EL_CONVEYOR_BELT1_LEFT, + EL_CONVEYOR_BELT2_LEFT, + EL_CONVEYOR_BELT3_LEFT, + EL_CONVEYOR_BELT4_LEFT + }; + static int belt_base_active_element[4] = + { + EL_CONVEYOR_BELT1_LEFT_ACTIVE, + EL_CONVEYOR_BELT2_LEFT_ACTIVE, + EL_CONVEYOR_BELT3_LEFT_ACTIVE, + EL_CONVEYOR_BELT4_LEFT_ACTIVE + }; + + int x, y, i, j; + + /* set frame order for belt animation graphic according to belt direction */ + for (i=0; i<4; i++) + { + int belt_nr = i; + + for (j=0; j<3; j++) + { + int element = belt_base_active_element[belt_nr] + j; + int graphic = el2img(element); + + if (game.belt_dir[i] == MV_LEFT) + new_graphic_info[graphic].anim_mode &= ~ANIM_REVERSE; + else + new_graphic_info[graphic].anim_mode |= ANIM_REVERSE; + } + } + + for(y=0; y0 && IS_PLAYER(x-1, y)) || (x %d\n", MovDir[x][y]); +#endif TurnRound(x, y); - +#if 0 + if (element == EL_SPRING) + printf("2--> %d\n", MovDir[x][y]); +#endif if (MovDelay[x][y] && (element == EL_BUG || element == EL_SPACESHIP || element == EL_SP_SNIKSNAK || @@ -2962,7 +3090,7 @@ void StartMoving(int x, int y) } } else if (element == EL_SP_ELECTRON) - DrawGraphicAnimation(x, y, IMG_SP_ELECTRON); + DrawGraphicAnimation(SCREENX(x), SCREENY(y), IMG_SP_ELECTRON); else if (element == EL_DRAGON) { int i; @@ -3220,11 +3348,11 @@ void StartMoving(int x, int y) element == EL_SP_SNIKSNAK || element == EL_MOLE) DrawLevelField(x, y); else if (element == EL_BD_BUTTERFLY || element == EL_BD_FIREFLY) - DrawGraphicAnimation(x, y, el2img(element)); + DrawGraphicAnimation(SCREENX(x), SCREENY(y), el2img(element)); else if (element == EL_SATELLITE) - DrawGraphicAnimation(x, y, IMG_SATELLITE); + DrawGraphicAnimation(SCREENX(x), SCREENY(y), IMG_SATELLITE); else if (element == EL_SP_ELECTRON) - DrawGraphicAnimation(x, y, IMG_SP_ELECTRON); + DrawGraphicAnimation(SCREENX(x), SCREENY(y), IMG_SP_ELECTRON); if (DONT_TOUCH(element)) TestIfBadThingTouchesHero(x, y); @@ -3249,7 +3377,7 @@ void ContinueMoving(int x, int y) int direction = MovDir[x][y]; int dx = (direction == MV_LEFT ? -1 : direction == MV_RIGHT ? +1 : 0); int dy = (direction == MV_UP ? -1 : direction == MV_DOWN ? +1 : 0); - int horiz_move = (dx!=0); + int horiz_move = (dx != 0); int newx = x + dx, newy = y + dy; int step = (horiz_move ? dx : dy) * TILEX / 8; @@ -3266,8 +3394,8 @@ void ContinueMoving(int x, int y) else if (CAN_FALL(element) && horiz_move && y < lev_fieldy-1 && IS_BELT_ACTIVE(Feld[x][y+1])) step /= 2; - else if (element == EL_SPRING_MOVING) - step*=2; + else if (element == EL_SPRING && horiz_move) + step *= 2; #if OLD_GAME_BEHAVIOUR else if (CAN_FALL(element) && horiz_move && !IS_SP_ELEMENT(element)) @@ -3362,8 +3490,19 @@ void ContinueMoving(int x, int y) GfxAction[newx][newy] = GfxAction[x][y]; /* keep action one frame */ GfxAction[x][y] = GFX_ACTION_DEFAULT; +#if 0 if (!CAN_MOVE(element)) MovDir[newx][newy] = 0; +#else + /* + if (CAN_FALL(element) && MovDir[newx][newy] == MV_DOWN) + MovDir[newx][newy] = 0; + */ + + if (!CAN_MOVE(element) || + (element == EL_SPRING && MovDir[newx][newy] == MV_DOWN)) + MovDir[newx][newy] = 0; +#endif DrawLevelField(x, y); DrawLevelField(newx, newy); @@ -3386,8 +3525,14 @@ void ContinueMoving(int x, int y) } else /* still moving on */ { +#if 0 if (GfxAction[x][y] == GFX_ACTION_DEFAULT) + { + printf("reset GfxAction...\n"); + GfxAction[x][y] = GFX_ACTION_MOVING; + } +#endif DrawLevelField(x, y); } @@ -3882,14 +4027,15 @@ void RobotWheel(int x, int y) DrawGraphic(SCREENX(x), SCREENY(y), IMG_ROBOT_WHEEL_ACTIVE, frame); } - if (!(MovDelay[x][y]%4)) - PlaySoundLevel(x, y, SND_ROBOT_WHEEL_ACTIVE); + PlaySoundLevel(x, y, SND_ROBOT_WHEEL_ACTIVE); + return; } } Feld[x][y] = EL_ROBOT_WHEEL; DrawLevelField(x, y); + if (ZX == x && ZY == y) ZX = ZY = -1; } @@ -3911,23 +4057,20 @@ void TimegateWheel(int x, int y) DrawGraphic(SCREENX(x), SCREENY(y), IMG_TIMEGATE_SWITCH_ACTIVE, frame); } - if (!(MovDelay[x][y]%4)) - PlaySoundLevel(x, y, SND_TIMEGATE_SWITCH_ACTIVE); + PlaySoundLevel(x, y, SND_TIMEGATE_SWITCH_ACTIVE); + return; } } Feld[x][y] = EL_TIMEGATE_SWITCH; DrawLevelField(x, y); + + /* !!! THIS LOOKS WRONG !!! */ if (ZX == x && ZY == y) ZX = ZY = -1; } -void Blubber(int x, int y) -{ - DrawGraphicAnimation(x, y, IMG_ACID); -} - void NussKnacken(int x, int y) { if (!MovDelay[x][y]) /* next animation frame */ @@ -3936,20 +4079,22 @@ void NussKnacken(int x, int y) if (MovDelay[x][y]) /* wait some time before next frame */ { MovDelay[x][y]--; - if (MovDelay[x][y]/2 && IN_SCR_FIELD(SCREENX(x), SCREENY(y))) + if (MovDelay[x][y]) { - int frame = getGraphicAnimationFrame(IMG_NUT_CRACKING, - 6 - MovDelay[x][y]); + if (IN_SCR_FIELD(SCREENX(x), SCREENY(y))) + { + int frame = getGraphicAnimationFrame(IMG_NUT_CRACKING, + 6 - MovDelay[x][y]); - DrawGraphic(SCREENX(x), SCREENY(y), IMG_NUT_CRACKING, frame); - } + DrawGraphic(SCREENX(x), SCREENY(y), IMG_NUT_CRACKING, frame); + } - if (!MovDelay[x][y]) - { - Feld[x][y] = EL_EMERALD; - DrawLevelField(x, y); + return; } } + + Feld[x][y] = EL_EMERALD; + DrawLevelField(x, y); } void BreakingPearl(int x, int y) @@ -3960,27 +4105,29 @@ void BreakingPearl(int x, int y) if (MovDelay[x][y]) /* wait some time before next frame */ { MovDelay[x][y]--; - if (MovDelay[x][y]/2 && IN_SCR_FIELD(SCREENX(x), SCREENY(y))) + if (MovDelay[x][y]) { - int frame = getGraphicAnimationFrame(IMG_PEARL_BREAKING, - 8 - MovDelay[x][y]); + if (IN_SCR_FIELD(SCREENX(x), SCREENY(y))) + { + int frame = getGraphicAnimationFrame(IMG_PEARL_BREAKING, + 8 - MovDelay[x][y]); - DrawGraphic(SCREENX(x), SCREENY(y), IMG_PEARL_BREAKING, frame); - } + DrawGraphic(SCREENX(x), SCREENY(y), IMG_PEARL_BREAKING, frame); + } - if (!MovDelay[x][y]) - { - Feld[x][y] = EL_EMPTY; - DrawLevelField(x, y); + return; } } + + Feld[x][y] = EL_EMPTY; + DrawLevelField(x, y); } void SiebAktivieren(int x, int y, int type) { int graphic = (type == 1 ? IMG_MAGIC_WALL_FULL : IMG_BD_MAGIC_WALL_FULL); - DrawGraphicAnimation(x, y, graphic); + DrawGraphicAnimation(SCREENX(x), SCREENY(y), graphic); } void AusgangstuerPruefen(int x, int y) @@ -4025,26 +4172,25 @@ void AusgangstuerOeffnen(int x, int y) int tuer; MovDelay[x][y]--; - tuer = MovDelay[x][y]/delay; - if (!(MovDelay[x][y]%delay) && IN_SCR_FIELD(SCREENX(x), SCREENY(y))) + tuer = MovDelay[x][y] / delay; + + if (!(MovDelay[x][y] % delay)) { - int frame = getGraphicAnimationFrame(IMG_EXIT_OPENING, - 29 - MovDelay[x][y]); + if (IN_SCR_FIELD(SCREENX(x), SCREENY(y))) + { + int frame = getGraphicAnimationFrame(IMG_EXIT_OPENING, + 29 - MovDelay[x][y]); - DrawGraphic(SCREENX(x), SCREENY(y), IMG_EXIT_OPENING, frame); + DrawGraphic(SCREENX(x), SCREENY(y), IMG_EXIT_OPENING, frame); + } } - if (!MovDelay[x][y]) - { - Feld[x][y] = EL_EXIT_OPEN; - DrawLevelField(x, y); - } + if (MovDelay[x][y]) + return; } -} -void AusgangstuerBlinken(int x, int y) -{ - DrawGraphicAnimation(x, y, IMG_EXIT_OPEN); + Feld[x][y] = EL_EXIT_OPEN; + DrawLevelField(x, y); } void OpenSwitchgate(int x, int y) @@ -4058,20 +4204,23 @@ void OpenSwitchgate(int x, int y) { MovDelay[x][y]--; - if (!(MovDelay[x][y] % delay) && IN_SCR_FIELD(SCREENX(x), SCREENY(y))) + if (!(MovDelay[x][y] % delay)) { - int frame = getGraphicAnimationFrame(IMG_SWITCHGATE_OPENING, - 29 - MovDelay[x][y]); + if (IN_SCR_FIELD(SCREENX(x), SCREENY(y))) + { + int frame = getGraphicAnimationFrame(IMG_SWITCHGATE_OPENING, + 29 - MovDelay[x][y]); - DrawGraphic(SCREENX(x), SCREENY(y), IMG_SWITCHGATE_OPENING, frame); + DrawGraphic(SCREENX(x), SCREENY(y), IMG_SWITCHGATE_OPENING, frame); + } } - if (!MovDelay[x][y]) - { - Feld[x][y] = EL_SWITCHGATE_OPEN; - DrawLevelField(x, y); - } + if (MovDelay[x][y]) + return; } + + Feld[x][y] = EL_SWITCHGATE_OPEN; + DrawLevelField(x, y); } void CloseSwitchgate(int x, int y) @@ -4085,20 +4234,23 @@ void CloseSwitchgate(int x, int y) { MovDelay[x][y]--; - if (!(MovDelay[x][y] % delay) && IN_SCR_FIELD(SCREENX(x), SCREENY(y))) + if (!(MovDelay[x][y] % delay)) { - int frame = getGraphicAnimationFrame(IMG_SWITCHGATE_CLOSING, - 29 - MovDelay[x][y]); + if (IN_SCR_FIELD(SCREENX(x), SCREENY(y))) + { + int frame = getGraphicAnimationFrame(IMG_SWITCHGATE_CLOSING, + 29 - MovDelay[x][y]); - DrawGraphic(SCREENX(x), SCREENY(y), IMG_SWITCHGATE_CLOSING, frame); + DrawGraphic(SCREENX(x), SCREENY(y), IMG_SWITCHGATE_CLOSING, frame); + } } - if (!MovDelay[x][y]) - { - Feld[x][y] = EL_SWITCHGATE_CLOSED; - DrawLevelField(x, y); - } + if (MovDelay[x][y]) + return; } + + Feld[x][y] = EL_SWITCHGATE_CLOSED; + DrawLevelField(x, y); } void OpenTimegate(int x, int y) @@ -4112,20 +4264,23 @@ void OpenTimegate(int x, int y) { MovDelay[x][y]--; - if (!(MovDelay[x][y] % delay) && IN_SCR_FIELD(SCREENX(x), SCREENY(y))) + if (!(MovDelay[x][y] % delay)) { - int frame = getGraphicAnimationFrame(IMG_TIMEGATE_OPENING, - 29 - MovDelay[x][y]); + if (IN_SCR_FIELD(SCREENX(x), SCREENY(y))) + { + int frame = getGraphicAnimationFrame(IMG_TIMEGATE_OPENING, + 29 - MovDelay[x][y]); - DrawGraphic(SCREENX(x), SCREENY(y), IMG_TIMEGATE_OPENING, frame); + DrawGraphic(SCREENX(x), SCREENY(y), IMG_TIMEGATE_OPENING, frame); + } } - if (!MovDelay[x][y]) - { - Feld[x][y] = EL_TIMEGATE_OPEN; - DrawLevelField(x, y); - } + if (MovDelay[x][y]) + return; } + + Feld[x][y] = EL_TIMEGATE_OPEN; + DrawLevelField(x, y); } void CloseTimegate(int x, int y) @@ -4139,20 +4294,23 @@ void CloseTimegate(int x, int y) { MovDelay[x][y]--; - if (!(MovDelay[x][y] % delay) && IN_SCR_FIELD(SCREENX(x), SCREENY(y))) + if (!(MovDelay[x][y] % delay)) { - int frame = getGraphicAnimationFrame(IMG_TIMEGATE_CLOSING, - 29 - MovDelay[x][y]); + if (IN_SCR_FIELD(SCREENX(x), SCREENY(y))) + { + int frame = getGraphicAnimationFrame(IMG_TIMEGATE_CLOSING, + 29 - MovDelay[x][y]); - DrawGraphic(SCREENX(x), SCREENY(y), IMG_TIMEGATE_CLOSING, frame); + DrawGraphic(SCREENX(x), SCREENY(y), IMG_TIMEGATE_CLOSING, frame); + } } - if (!MovDelay[x][y]) - { - Feld[x][y] = EL_TIMEGATE_CLOSED; - DrawLevelField(x, y); - } + if (MovDelay[x][y]) + return; } + + Feld[x][y] = EL_TIMEGATE_CLOSED; + DrawLevelField(x, y); } static void CloseAllOpenTimegates() @@ -4180,7 +4338,7 @@ void EdelsteinFunkeln(int x, int y) return; if (Feld[x][y] == EL_BD_DIAMOND) - DrawGraphicAnimation(x, y, IMG_BD_DIAMOND); + DrawGraphicAnimation(SCREENX(x), SCREENY(y), IMG_BD_DIAMOND); else { if (!MovDelay[x][y]) /* next animation frame */ @@ -4193,7 +4351,11 @@ void EdelsteinFunkeln(int x, int y) if (setup.direct_draw && MovDelay[x][y]) SetDrawtoField(DRAW_BUFFERED); +#if 0 DrawGraphic(SCREENX(x), SCREENY(y), el2img(Feld[x][y]), 0); +#else + DrawGraphicAnimation(SCREENX(x), SCREENY(y), el2img(Feld[x][y])); +#endif if (MovDelay[x][y]) { @@ -4547,7 +4709,7 @@ static void DrawBeltAnimation(int x, int y, int element) { int graphic = el2img(element); - DrawGraphicAnimation(x, y, graphic); + DrawGraphicAnimation(SCREENX(x), SCREENY(y), graphic); if (!(FrameCounter % 2)) PlaySoundLevel(x, y, SND_CONVEYOR_BELT_ACTIVE); @@ -4700,7 +4862,7 @@ void GameActions() static unsigned long action_delay = 0; unsigned long action_delay_value; int sieb_x = 0, sieb_y = 0; - int i, x, y, element; + int i, x, y, element, graphic; byte *recorded_player_action; byte summarized_player_action = 0; @@ -4804,8 +4966,6 @@ void GameActions() #endif #endif - - FrameCounter++; TimeFrames++; @@ -4835,17 +4995,47 @@ void GameActions() for (y=0; y 1) + DrawGraphicAnimation(SCREENX(x), SCREENY(y), graphic); +#endif + continue; + } if (!IS_MOVING(x, y) && (CAN_FALL(element) || CAN_MOVE(element))) { StartMoving(x, y); +#if 1 + if (Feld[x][y] == EL_EMERALD && + new_graphic_info[graphic].anim_frames > 1 && + !IS_MOVING(x, y)) + DrawGraphicAnimation(SCREENX(x), SCREENY(y), graphic); +#endif + if (IS_GEM(element) || element == EL_SP_INFOTRON) EdelsteinFunkeln(x, y); } + +#if 1 + else if ((element == EL_ACID || + element == EL_EXIT_OPEN || + element == EL_SP_EXIT_OPEN || + element == EL_SP_TERMINAL || + element == EL_SP_TERMINAL_ACTIVE || + element == EL_EXTRA_TIME || + element == EL_SHIELD_NORMAL || + element == EL_SHIELD_DEADLY) && + new_graphic_info[graphic].anim_frames > 1) + DrawGraphicAnimation(SCREENX(x), SCREENY(y), graphic); +#endif + else if (IS_MOVING(x, y)) ContinueMoving(x, y); else if (IS_ACTIVE_BOMB(element)) @@ -4870,8 +5060,6 @@ void GameActions() RobotWheel(x, y); else if (element == EL_TIMEGATE_SWITCH_ACTIVE) TimegateWheel(x, y); - else if (element == EL_ACID) - Blubber(x, y); else if (element == EL_ACID_SPLASH_LEFT || element == EL_ACID_SPLASH_RIGHT) Blurb(x, y); @@ -4885,10 +5073,6 @@ void GameActions() AusgangstuerPruefen_SP(x, y); else if (element == EL_EXIT_OPENING) AusgangstuerOeffnen(x, y); - else if (element == EL_EXIT_OPEN) - AusgangstuerBlinken(x, y); - else if (element == EL_SP_EXIT_OPEN) - ; /* !!! ADD SOME (OPTIONAL) ANIMATIONS HERE !!! */ else if (element == EL_WALL_GROWING_ACTIVE) MauerWaechst(x, y); else if (element == EL_WALL_GROWING || @@ -4902,17 +5086,6 @@ void GameActions() CheckBuggyBase(x, y); else if (element == EL_TRAP || element == EL_TRAP_ACTIVE) CheckTrap(x, y); - else if (element == EL_SP_TERMINAL) - DrawGraphicAnimation(x, y, IMG_SP_TERMINAL); - else if (element == EL_SP_TERMINAL_ACTIVE) - { - DrawGraphicAnimation(x, y, IMG_SP_TERMINAL_ACTIVE); - -#if 0 - if (!(FrameCounter % 4)) - PlaySoundLevel(x, y, SND_SP_TERMINAL_ACTIVE); -#endif - } else if (IS_BELT_ACTIVE(element)) DrawBeltAnimation(x, y, element); else if (element == EL_SWITCHGATE_OPENING) @@ -4923,26 +5096,11 @@ void GameActions() OpenTimegate(x, y); else if (element == EL_TIMEGATE_CLOSING) CloseTimegate(x, y); - else if (element == EL_EXTRA_TIME) - DrawGraphicAnimation(x, y, IMG_EXTRA_TIME); - else if (element == EL_SHIELD_NORMAL) - { - DrawGraphicAnimation(x, y, IMG_SHIELD_NORMAL); - -#if 0 - if (!(FrameCounter % 4)) - PlaySoundLevel(x, y, SND_SHIELD_PASSIVE_ACTIVATED); -#endif - } - else if (element == EL_SHIELD_DEADLY) - { - DrawGraphicAnimation(x, y, IMG_SHIELD_DEADLY); -#if 0 - if (!(FrameCounter % 4)) - PlaySoundLevel(x, y, SND_SHIELD_DEADLY_ACTIVE); +#if 1 + else if (new_graphic_info[graphic].anim_frames > 1) + DrawGraphicAnimation(SCREENX(x), SCREENY(y), graphic); #endif - } if (game.magic_wall_active) { @@ -5354,7 +5512,8 @@ boolean MoveFigure(struct PlayerInfo *player, int dx, int dy) int original_move_delay_value = player->move_delay_value; #if DEBUG - printf("THIS SHOULD ONLY HAPPEN WITH PRE-1.2 LEVEL TAPES.\n"); + printf("THIS SHOULD ONLY HAPPEN WITH PRE-1.2 LEVEL TAPES. [%ld]\n", + tape.counter); #endif /* scroll remaining steps with finest movement resolution */ @@ -6044,9 +6203,9 @@ int DigField(struct PlayerInfo *player, player->key[key_nr] = TRUE; RaiseScoreElement(element); DrawMiniGraphicExt(drawto, DX_KEYS + key_nr * MINI_TILEX, DY_KEYS, - GFX_SCHLUESSEL1 + key_nr); + IMG_KEY1 + key_nr); DrawMiniGraphicExt(window, DX_KEYS + key_nr * MINI_TILEX, DY_KEYS, - GFX_SCHLUESSEL1 + key_nr); + IMG_KEY1 + key_nr); PlaySoundLevel(x, y, SND_KEY_COLLECTING); break; } @@ -6062,9 +6221,9 @@ int DigField(struct PlayerInfo *player, player->key[key_nr] = TRUE; RaiseScoreElement(element); DrawMiniGraphicExt(drawto, DX_KEYS + key_nr * MINI_TILEX, DY_KEYS, - GFX_SCHLUESSEL1 + key_nr); + IMG_KEY1 + key_nr); DrawMiniGraphicExt(window, DX_KEYS + key_nr * MINI_TILEX, DY_KEYS, - GFX_SCHLUESSEL1 + key_nr); + IMG_KEY1 + key_nr); PlaySoundLevel(x, y, SND_KEY_COLLECTING); break; } @@ -6218,13 +6377,13 @@ int DigField(struct PlayerInfo *player, else { RemoveField(x, y); - Feld[x+dx][y+dy] = element; + Feld[x + dx][y + dy] = element; } if (element == EL_SPRING) { - Feld[x+dx][y+dy] = EL_SPRING_MOVING; - MovDir[x+dx][y+dy] = move_direction; + Feld[x + dx][y + dy] = EL_SPRING; + MovDir[x + dx][y + dy] = move_direction; } player->push_delay_value = (element == EL_SPRING ? 0 : 2 + RND(8)); @@ -6810,7 +6969,7 @@ void CreateGameButtons() for (i=0; i