X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame.c;h=a4940d9692de05210c2eb74ec6468f82e68477b9;hb=c67c3097b43d753268773d85261c02a9ded95129;hp=811d103aa769b3c0019421b88590531f9520f9a6;hpb=673c51c61ad415fbdb1a69148fa67dfbeb0afcae;p=rocksndiamonds.git diff --git a/src/game.c b/src/game.c index 811d103a..a4940d96 100644 --- a/src/game.c +++ b/src/game.c @@ -695,9 +695,9 @@ void InitGame() for (i=0; i= GAME_VERSION_2_0) - Elementeigenschaften1[ep_slippery[i]] |= EP_BIT_SLIPPERY; + Elementeigenschaften2[ep_slippery[i]] |= EP_BIT_SLIPPERY_GEMS; else - Elementeigenschaften1[ep_slippery[i]] &= ~EP_BIT_SLIPPERY; + Elementeigenschaften2[ep_slippery[i]] &= ~EP_BIT_SLIPPERY_GEMS; } } @@ -1278,7 +1278,7 @@ void CheckDynamite(int x, int y) void Explode(int ex, int ey, int phase, int mode) { int x, y; - int num_phase = 9, delay = 2; + int num_phase = 9, delay = (game.emulation == EMU_SUPAPLEX ? 3 : 2); int last_phase = num_phase * delay; int half_phase = (num_phase / 2) * delay; int first_phase_after_start = EX_PHASE_START + 1; @@ -1463,6 +1463,9 @@ void Explode(int ex, int ey, int phase, int mode) if (CAN_MOVE(element) || COULD_MOVE(element)) InitMovDir(x, y); DrawLevelField(x, y); + + if (IS_PLAYER(x, y) && !PLAYERINFO(x,y)->present) + StorePlayer[x][y] = 0; } else if (!(phase % delay) && IN_SCR_FIELD(SCREENX(x), SCREENY(y))) { @@ -1476,7 +1479,15 @@ void Explode(int ex, int ey, int phase, int mode) if (phase == delay) ErdreichAnbroeckeln(SCREENX(x), SCREENY(y)); - DrawGraphic(SCREENX(x), SCREENY(y), graphic + (phase / delay - 1)); + graphic += (phase / delay - 1); + + if (IS_PFORTE(Store[x][y])) + { + DrawLevelElement(x, y, Store[x][y]); + DrawGraphicThruMask(SCREENX(x), SCREENY(y), graphic); + } + else + DrawGraphic(SCREENX(x), SCREENY(y), graphic); } } @@ -1886,6 +1897,13 @@ void Impact(int x, int y) return; } } + else if ((element == EL_SP_INFOTRON || element == EL_SP_ZONK) && + (smashed == EL_SP_SNIKSNAK || smashed == EL_SP_ELECTRON || + smashed == EL_SP_DISK_ORANGE)) + { + Bang(x, y+1); + return; + } else if (element == EL_FELSBROCKEN || element == EL_SP_ZONK || element == EL_BD_ROCK) @@ -2585,9 +2603,10 @@ void StartMoving(int x, int y) element != EL_DX_SUPABOMB) #endif #else - else if (IS_SLIPPERY(Feld[x][y+1]) && + else if ((IS_SLIPPERY(Feld[x][y+1]) || + (IS_SLIPPERY_GEMS(Feld[x][y+1]) && IS_GEM(element))) && !IS_FALLING(x, y+1) && !JustStopped[x][y+1] && - element != EL_DX_SUPABOMB) + element != EL_DX_SUPABOMB && element != EL_SP_DISK_ORANGE) #endif { boolean left = (x>0 && IS_FREE(x-1, y) && @@ -3436,14 +3455,14 @@ void AmoebeAbleger(int ax, int ay) if (element != EL_AMOEBE_NASS || neway < ay || !IS_FREE(newax, neway) || (neway == lev_fieldy - 1 && newax != ax)) { - Feld[newax][neway] = EL_AMOEBING; + Feld[newax][neway] = EL_AMOEBING; /* simple growth of new amoeba tile */ Store[newax][neway] = element; } else if (neway == ay) - Feld[newax][neway] = EL_TROPFEN; + Feld[newax][neway] = EL_TROPFEN; /* drop left or right from amoeba */ else { - InitMovingField(ax, ay, MV_DOWN); + InitMovingField(ax, ay, MV_DOWN); /* drop dripping out of amoeba */ Feld[ax][ay] = EL_AMOEBA_DRIPPING; Store[ax][ay] = EL_TROPFEN; ContinueMoving(ax, ay); @@ -4231,6 +4250,8 @@ static void PlayerActions(struct PlayerInfo *player, byte player_action) SnapField(player, 0, 0); CheckGravityMovement(player); + player->last_move_dir = MV_NO_MOVING; + if (++player->frame_reset_delay > player->move_delay_value) player->Frame = 0; } @@ -4420,21 +4441,25 @@ void GameActions() { StartMoving(x, y); - if (IS_GEM(element)) + if (IS_GEM(element) || element == EL_SP_INFOTRON) EdelsteinFunkeln(x, y); } else if (IS_MOVING(x, y)) ContinueMoving(x, y); else if (IS_ACTIVE_BOMB(element)) CheckDynamite(x, y); +#if 0 else if (element == EL_EXPLODING && !game.explosions_delayed) Explode(x, y, Frame[x][y], EX_NORMAL); +#endif else if (element == EL_AMOEBING) AmoebeWaechst(x, y); else if (element == EL_DEAMOEBING) AmoebeSchrumpft(x, y); +#if 0 else if (IS_AMOEBALIVE(element)) AmoebeAbleger(x, y); +#endif else if (element == EL_LIFE || element == EL_LIFE_ASYNC) Life(x, y); else if (element == EL_ABLENK_EIN) @@ -4518,16 +4543,59 @@ void GameActions() } } +#if 1 + /* new experimental amoeba growth stuff*/ +#if 1 + if (!(FrameCounter % 8)) +#endif + { + static unsigned long random = 1684108901; + + for (i = 0; i < level.amoeba_speed * 28 / 8; i++) + { +#if 0 + x = (random >> 10) % lev_fieldx; + y = (random >> 20) % lev_fieldy; +#else + x = RND(lev_fieldx); + y = RND(lev_fieldy); +#endif + element = Feld[x][y]; + + if (!IS_PLAYER(x,y) && + (element == EL_LEERRAUM || + element == EL_ERDREICH || + element == EL_MORAST_LEER || + element == EL_BLURB_LEFT || + element == EL_BLURB_RIGHT)) + { + if ((IN_LEV_FIELD(x, y-1) && Feld[x][y-1] == EL_AMOEBE_NASS) || + (IN_LEV_FIELD(x-1, y) && Feld[x-1][y] == EL_AMOEBE_NASS) || + (IN_LEV_FIELD(x+1, y) && Feld[x+1][y] == EL_AMOEBE_NASS) || + (IN_LEV_FIELD(x, y+1) && Feld[x][y+1] == EL_AMOEBE_NASS)) + Feld[x][y] = EL_TROPFEN; + } + + random = random * 129 + 1; + } + } +#endif + +#if 0 if (game.explosions_delayed) +#endif { game.explosions_delayed = FALSE; for (y=0; yshield_active_time_left > 0) + if (Feld[badx][bady] == EL_ROBOT && player->last_move_dir) + ; /* robot does not kill player if he moves */ + else if (player->shield_active_time_left > 0) Bang(badx, bady); else if (!PLAYER_PROTECTED(killx, killy)) KillHero(player); @@ -5282,7 +5352,8 @@ void RemoveHero(struct PlayerInfo *player) player->present = FALSE; player->active = FALSE; - StorePlayer[jx][jy] = 0; + if (!ExplodeField[jx][jy]) + StorePlayer[jx][jy] = 0; for (i=0; i