From 67758fda340e825f188fc6a4caad03381bf031dc Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Wed, 30 Dec 1998 02:54:06 +0100 Subject: [PATCH] rnd-19981230-1 --- src/game.c | 81 ++++++++++++++++++++++++++++++++++++++++------------- src/init.c | 3 +- src/main.h | 37 +++++++++++++++--------- src/tools.c | 38 +++++++++++++++++++++---- 4 files changed, 119 insertions(+), 40 deletions(-) diff --git a/src/game.c b/src/game.c index b88998ef..dc992f25 100644 --- a/src/game.c +++ b/src/game.c @@ -95,6 +95,7 @@ #define EMU_NONE 0 #define EMU_BOULDERDASH 1 #define EMU_SOKOBAN 2 +#define EMU_SUPAPLEX 3 /* to control special behaviour of certain game elements */ int game_emulation = EMU_NONE; @@ -315,6 +316,7 @@ void InitGame() int i, j, x, y; boolean emulate_bd = TRUE; /* unless non-BOULDERDASH elements found */ boolean emulate_sb = TRUE; /* unless non-SOKOBAN elements found */ + boolean emulate_sp = TRUE; /* unless non-SUPAPLEX elements found */ /* don't play tapes over network */ network_playing = (options.network && !tape.playing); @@ -428,14 +430,19 @@ void InitGame() } } - for(y=0; yjx >= MIDPOSX-1) @@ -622,6 +630,7 @@ void InitMovDir(int x, int y) Feld[x][y] = EL_KAEFER; MovDir[x][y] = direction[0][element - EL_KAEFER_R]; break; + case EL_FLIEGER_R: case EL_FLIEGER_O: case EL_FLIEGER_L: @@ -629,6 +638,7 @@ void InitMovDir(int x, int y) Feld[x][y] = EL_FLIEGER; MovDir[x][y] = direction[0][element - EL_FLIEGER_R]; break; + case EL_BUTTERFLY_R: case EL_BUTTERFLY_O: case EL_BUTTERFLY_L: @@ -636,6 +646,7 @@ void InitMovDir(int x, int y) Feld[x][y] = EL_BUTTERFLY; MovDir[x][y] = direction[0][element - EL_BUTTERFLY_R]; break; + case EL_FIREFLY_R: case EL_FIREFLY_O: case EL_FIREFLY_L: @@ -643,6 +654,7 @@ void InitMovDir(int x, int y) Feld[x][y] = EL_FIREFLY; MovDir[x][y] = direction[0][element - EL_FIREFLY_R]; break; + case EL_PACMAN_R: case EL_PACMAN_O: case EL_PACMAN_L: @@ -650,14 +662,21 @@ void InitMovDir(int x, int y) Feld[x][y] = EL_PACMAN; MovDir[x][y] = direction[0][element - EL_PACMAN_R]; break; + + case EL_SP_SNIKSNAK: + MovDir[x][y] = MV_UP; + break; + + case EL_SP_ELECTRON: + MovDir[x][y] = MV_LEFT; + break; + default: MovDir[x][y] = 1 << RND(4); if (element != EL_KAEFER && element != EL_FLIEGER && element != EL_BUTTERFLY && - element != EL_FIREFLY && - element != EL_SP_SNIKSNAK && - element != EL_SP_ELECTRON) + element != EL_FIREFLY) break; for (i=0; i<4; i++) @@ -1043,6 +1062,9 @@ void Explode(int ex, int ey, int phase, int mode) Store[x][y] = EL_EDELSTEIN_GELB; break; } + + if (game_emulation == EMU_SUPAPLEX) + Store[x][y] = EL_LEERRAUM; } else if (center_element == EL_MAULWURF) Store[x][y] = EL_EDELSTEIN_ROT; @@ -1052,6 +1074,8 @@ void Explode(int ex, int ey, int phase, int mode) Store[x][y] = ((x == ex && y == ey) ? EL_DIAMANT : EL_EDELSTEIN); else if (center_element == EL_BUTTERFLY) Store[x][y] = EL_EDELSTEIN_BD; + else if (center_element == EL_SP_ELECTRON) + Store[x][y] = EL_SP_INFOTRON; else if (center_element == EL_MAMPFER) Store[x][y] = level.mampfer_inhalt[MampferNr][x-ex+1][y-ey+1]; else if (center_element == EL_AMOEBA2DIAM) @@ -1133,12 +1157,19 @@ void Explode(int ex, int ey, int phase, int mode) InitMovDir(x, y); DrawLevelField(x, y); } - else if (!(phase%delay) && IN_SCR_FIELD(SCREENX(x), SCREENY(y))) + else if (!(phase % delay) && IN_SCR_FIELD(SCREENX(x), SCREENY(y))) { + int graphic = GFX_EXPLOSION; + + if (game_emulation == EMU_SUPAPLEX) + graphic = (Store[x][y] == EL_SP_INFOTRON ? + GFX_SP_EXPLODE_INFOTRON : + GFX_SP_EXPLODE_EMPTY); + if (phase == delay) ErdreichAnbroeckeln(SCREENX(x), SCREENY(y)); - DrawGraphic(SCREENX(x), SCREENY(y), GFX_EXPLOSION+(phase/delay-1)); + DrawGraphic(SCREENX(x), SCREENY(y), graphic + (phase / delay - 1)); } } @@ -1349,7 +1380,7 @@ void Impact(int x, int y) return; } } - else if (element == EL_FELSBROCKEN) + else if (element == EL_FELSBROCKEN || element == EL_SP_ZONK) { if (IS_ENEMY(smashed) || smashed == EL_BOMBE || smashed == EL_SP_DISK_ORANGE || @@ -1995,8 +2026,8 @@ void StartMoving(int x, int y) { MovDelay[x][y]--; - if (element == EL_ROBOT || element == EL_MAMPFER || - element == EL_MAMPFER2) + if (element == EL_ROBOT || + element == EL_MAMPFER || element == EL_MAMPFER2) { int phase = MovDelay[x][y] % 8; @@ -2010,6 +2041,8 @@ void StartMoving(int x, int y) && MovDelay[x][y]%4 == 3) PlaySoundLevel(x, y, SND_NJAM); } + else if (element == EL_SP_ELECTRON) + DrawGraphicAnimation(x, y, GFX2_SP_ELECTRON, 8, 2, ANIM_NORMAL); else if (element == EL_DRACHE) { int i; @@ -2232,12 +2265,14 @@ void StartMoving(int x, int y) TurnRound(x, y); if (element == EL_KAEFER || element == EL_FLIEGER || - element == EL_SP_SNIKSNAK || element == EL_SP_ELECTRON) + element == EL_SP_SNIKSNAK) DrawLevelField(x, y); else if (element == EL_BUTTERFLY || element == EL_FIREFLY) DrawGraphicAnimation(x, y, el2gfx(element), 2, 4, ANIM_NORMAL); else if (element == EL_SONDE) DrawGraphicAnimation(x, y, GFX_SONDE_START, 8, 2, ANIM_NORMAL); + else if (element == EL_SP_ELECTRON) + DrawGraphicAnimation(x, y, GFX2_SP_ELECTRON, 8, 2, ANIM_NORMAL); return; } @@ -3460,6 +3495,10 @@ void GameActions() MauerAbleger(x, y); else if (element == EL_BURNING) CheckForDragon(x, y); + else if (element == EL_SP_TERMINAL) + DrawGraphicAnimation(x, y, GFX2_SP_TERMINAL, 7, 10, ANIM_NORMAL); + else if (element == EL_SP_TERMINAL_ACTIVE) + DrawGraphicAnimation(x, y, GFX2_SP_TERMINAL_ACTIVE, 7, 2, ANIM_NORMAL); if (SiebAktiv) { @@ -4211,12 +4250,16 @@ int DigField(struct PlayerInfo *player, int xx, yy; for (yy=0; yy= EL_SP_START && element <= EL_SP_END) - return GFX_START_ROCKSMORE + (element - EL_SP_START); + { + int nr_element = element - EL_SP_START; + int gfx_per_line = 8; + int nr_graphic = + (nr_element / gfx_per_line) * MORE_PER_LINE + + (nr_element % gfx_per_line); + + return GFX_START_ROCKSMORE + nr_graphic; + } else return -1; } -- 2.34.1