From: Holger Schemel Date: Tue, 5 Jan 1999 00:45:06 +0000 (+0100) Subject: rnd-19990105-1 X-Git-Tag: 1.3.0^2~37 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=f1beb2260f7ddd444f951b3f90f733707b196686;p=rocksndiamonds.git rnd-19990105-1 --- diff --git a/src/editor.c b/src/editor.c index d92e2778..6c137565 100644 --- a/src/editor.c +++ b/src/editor.c @@ -1671,7 +1671,9 @@ void LevelEd(int mx, int my, int button) for(y=0;y 0 && !(TimeLeft % 10)) RaiseScore(level.score[SC_ZEITBONUS]); if (TimeLeft > 100 && !(TimeLeft % 10)) TimeLeft -= 10; @@ -758,6 +759,29 @@ void GameWon() if (setup.sound_loops) StopSound(SND_SIRR); } + else if (level.time == 0) /* level without time limit */ + { + if (setup.sound_loops) + PlaySoundExt(SND_SIRR, PSND_MAX_VOLUME, PSND_MAX_RIGHT, PSND_LOOP); + + while(TimePlayed < 999) + { + if (!setup.sound_loops) + PlaySoundStereo(SND_SIRR, PSND_MAX_RIGHT); + if (TimePlayed < 999 && !(TimePlayed % 10)) + RaiseScore(level.score[SC_ZEITBONUS]); + if (TimePlayed < 900 && !(TimePlayed % 10)) + TimePlayed += 10; + else + TimePlayed++; + DrawText(DX_TIME, DY_TIME, int2str(TimePlayed, 3), FS_SMALL, FC_YELLOW); + BackToFront(); + Delay(10); + } + + if (setup.sound_loops) + StopSound(SND_SIRR); + } FadeSounds(); @@ -794,7 +818,7 @@ void GameWon() BackToFront(); } -boolean NewHiScore() +int NewHiScore() { int k, l; int position = -1; @@ -1218,7 +1242,10 @@ void Bang(int x, int y) { int element = Feld[x][y]; - PlaySoundLevel(x, y, SND_ROAAAR); + if (game_emulation == EMU_SUPAPLEX) + PlaySoundLevel(x, y, SND_SP_BOOOM); + else + PlaySoundLevel(x, y, SND_ROAAAR); if (IS_PLAYER(x, y)) /* remove objects that might cause smaller explosion */ element = EL_LEERRAUM; @@ -1434,6 +1461,7 @@ void Impact(int x, int y) case EL_EDELSTEIN_ROT: case EL_EDELSTEIN_LILA: case EL_DIAMANT: + case EL_SP_INFOTRON: sound = SND_PLING; break; case EL_KOKOSNUSS: @@ -1442,6 +1470,9 @@ void Impact(int x, int y) case EL_FELSBROCKEN: sound = SND_KLOPF; break; + case EL_SP_ZONK: + sound = SND_SP_ZONKDOWN; + break; case EL_SCHLUESSEL: case EL_SCHLUESSEL1: case EL_SCHLUESSEL2: @@ -3157,6 +3188,68 @@ void CheckForDragon(int x, int y) } } +static void CheckBuggyBase(int x, int y) +{ + int element = Feld[x][y]; + + if (element == EL_SP_BUG) + { + if (!MovDelay[x][y]) /* start activating buggy base */ + MovDelay[x][y] = 2 * FRAMES_PER_SECOND + RND(5 * FRAMES_PER_SECOND); + + if (MovDelay[x][y]) /* wait some time before activating base */ + { + MovDelay[x][y]--; + if (MovDelay[x][y] < 5 && IN_SCR_FIELD(SCREENX(x), SCREENY(y))) + DrawGraphic(SCREENX(x), SCREENY(y), GFX_SP_BUG_WARNING); + if (MovDelay[x][y]) + return; + + Feld[x][y] = EL_SP_BUG_ACTIVE; + } + } + else if (element == EL_SP_BUG_ACTIVE) + { + if (!MovDelay[x][y]) /* start activating buggy base */ + MovDelay[x][y] = 1 * FRAMES_PER_SECOND + RND(1 * FRAMES_PER_SECOND); + + if (MovDelay[x][y]) /* wait some time before activating base */ + { + MovDelay[x][y]--; + if (MovDelay[x][y]) + { + int i; + static int xy[4][2] = + { + { 0, -1 }, + { -1, 0 }, + { +1, 0 }, + { 0, +1 } + }; + + if (IN_SCR_FIELD(SCREENX(x), SCREENY(y))) + DrawGraphic(SCREENX(x),SCREENY(y), GFX_SP_BUG_ACTIVE + SimpleRND(4)); + + for (i=0; i<4; i++) + { + int xx = x + xy[i][0], yy = y + xy[i][1]; + + if (IS_PLAYER(xx, yy)) + { + PlaySoundLevel(x, y, SND_SP_BUG); + break; + } + } + + return; + } + + Feld[x][y] = EL_SP_BUG; + DrawLevelField(x, y); + } + } +} + static void PlayerActions(struct PlayerInfo *player, byte player_action) { static byte stored_player_action[MAX_PLAYERS]; @@ -3400,9 +3493,9 @@ void GameActions() extern unsigned int last_RND(); printf("DEBUG: %03d last RND was %d \t [state checksum is %d]\n", - level.time - TimeLeft, + TimePlayed, last_RND(), - getStateCheckSum(level.time - TimeLeft)); + getStateCheckSum(TimePlayed)); } */ #endif @@ -3495,6 +3588,8 @@ void GameActions() MauerAbleger(x, y); else if (element == EL_BURNING) CheckForDragon(x, y); + else if (element == EL_SP_BUG || element == EL_SP_BUG_ACTIVE) + CheckBuggyBase(x, y); else if (element == EL_SP_TERMINAL) DrawGraphicAnimation(x, y, GFX2_SP_TERMINAL, 7, 12, ANIM_NORMAL); else if (element == EL_SP_TERMINAL_ACTIVE) @@ -3557,22 +3652,29 @@ void GameActions() } } - if (TimeLeft > 0 && TimeFrames >= (1000 / GameFrameDelay) && !tape.pausing) + if (TimeFrames >= (1000 / GameFrameDelay) && !tape.pausing) { TimeFrames = 0; - TimeLeft--; + TimePlayed++; if (tape.recording || tape.playing) - DrawVideoDisplay(VIDEO_STATE_TIME_ON, level.time-TimeLeft); + DrawVideoDisplay(VIDEO_STATE_TIME_ON, TimePlayed); - if (TimeLeft<=10) - PlaySoundStereo(SND_GONG, PSND_MAX_RIGHT); + if (TimeLeft > 0) + { + TimeLeft--; - DrawText(DX_TIME, DY_TIME, int2str(TimeLeft, 3), FS_SMALL, FC_YELLOW); + if (TimeLeft <= 10) + PlaySoundStereo(SND_GONG, PSND_MAX_RIGHT); - if (!TimeLeft) - for (i=0; igems_still_needed, 3), FS_SMALL, FC_YELLOW); - PlaySoundLevel(x, y, SND_PONG); + if (element == EL_SP_INFOTRON) + PlaySoundLevel(x, y, SND_SP_INFOTRON); + else + PlaySoundLevel(x, y, SND_PONG); break; case EL_SPEED_PILL: @@ -4192,7 +4305,10 @@ int DigField(struct PlayerInfo *player, DrawText(DX_DYNAMITE, DY_DYNAMITE, int2str(local_player->dynamite, 3), FS_SMALL, FC_YELLOW); - PlaySoundLevel(x, y, SND_PONG); + if (element == EL_SP_DISK_RED) + PlaySoundLevel(x, y, SND_SP_INFOTRON); + else + PlaySoundLevel(x, y, SND_PONG); break; case EL_DYNABOMB_NR: @@ -4269,7 +4385,7 @@ int DigField(struct PlayerInfo *player, return MF_NO_ACTION; player->LevelSolved = player->GameOver = TRUE; - PlaySoundLevel(x, y, SND_BUING); + PlaySoundStereo(SND_SP_EXIT, PSND_MAX_RIGHT); break; case EL_FELSBROCKEN: @@ -4308,6 +4424,8 @@ int DigField(struct PlayerInfo *player, PlaySoundLevel(x+dx, y+dy, SND_PUSCH); else if (element == EL_KOKOSNUSS) PlaySoundLevel(x+dx, y+dy, SND_KNURK); + else if (IS_SP_ELEMENT(element)) + PlaySoundLevel(x+dx, y+dy, SND_SP_ZONKPUSH); else PlaySoundLevel(x+dx, y+dy, SND_KLOPF); break; @@ -4487,12 +4605,7 @@ int DigField(struct PlayerInfo *player, break; default: - if (IS_EATABLE(element)) /* other kinds of 'dirt' */ - Feld[x][y] = EL_LEERRAUM; - else - return MF_NO_ACTION; - - break; + return MF_NO_ACTION; } player->push_delay = 0; diff --git a/src/game.h b/src/game.h index 56ba8a31..6f698b64 100644 --- a/src/game.h +++ b/src/game.h @@ -21,7 +21,7 @@ void InitGame(void); void InitMovDir(int, int); void InitAmoebaNr(int, int); void GameWon(void); -boolean NewHiScore(void); +int NewHiScore(void); void InitMovingField(int, int, int); void Moving2Blocked(int, int, int *, int *); void Blocked2Moving(int, int, int *, int *); diff --git a/src/init.c b/src/init.c index dd7f94d4..dcc3e100 100644 --- a/src/init.c +++ b/src/init.c @@ -1136,7 +1136,7 @@ void InitElementProperties() EL_SALZSAEURE, EL_SP_SNIKSNAK, EL_SP_ELECTRON, - EL_SP_BUG + EL_SP_BUG_ACTIVE }; static int ep_dont_go_to_num = sizeof(ep_dont_go_to)/sizeof(int); diff --git a/src/main.c b/src/main.c index 68934fc9..688d0c00 100644 --- a/src/main.c +++ b/src/main.c @@ -95,7 +95,7 @@ int MoveSpeed = 8; int BX1 = 0, BY1 = 0, BX2 = SCR_FIELDX-1, BY2 = SCR_FIELDY-1; int ZX,ZY, ExitX,ExitY; int AllPlayersGone; -int FrameCounter, TimeFrames, TimeLeft; +int FrameCounter, TimeFrames, TimePlayed, TimeLeft; int MampferMax, MampferNr; boolean SiebAktiv; int SiebCount; @@ -167,7 +167,16 @@ char *sound_name[NUM_SOUNDS] = "voyager", "warnton", "whoosh", - "zisch" + "zisch", + "base", + "infotron", + "zonkdown", + "zonkpush", + "bug", + "boom", + "booom", + "exit", + "empty" }; /* background music */ diff --git a/src/main.h b/src/main.h index 8b20fb7a..cd8366f6 100644 --- a/src/main.h +++ b/src/main.h @@ -174,7 +174,6 @@ typedef unsigned char byte; EL_FELSBROCKEN) #define IS_DRAWABLE(e) ((e) < EL_BLOCKED) #define IS_NOT_DRAWABLE(e) ((e) >= EL_BLOCKED) -#define TIMESIZE (TimeLeft * 100 / level.time) #define TAPE_IS_EMPTY(x) ((x).length == 0) #define TAPE_IS_STOPPED(x) (!(x).recording && !(x).playing &&!(x).pausing) @@ -441,7 +440,7 @@ extern int MoveSpeed; extern int BX1,BY1, BX2,BY2; extern int ZX,ZY, ExitX,ExitY; extern int AllPlayersGone; -extern int FrameCounter, TimeFrames, TimeLeft; +extern int FrameCounter, TimeFrames, TimePlayed, TimeLeft; extern int MampferMax, MampferNr; extern boolean SiebAktiv; extern int SiebCount; @@ -775,6 +774,7 @@ extern int num_bg_loops; #define EL_SIEB2_TOT 305 #define EL_AUSGANG_ACT 306 #define EL_SP_TERMINAL_ACTIVE 307 +#define EL_SP_BUG_ACTIVE 308 /* "unreal" (and therefore not drawable) runtime elements */ #define EL_BLOCKED 400 @@ -1060,8 +1060,10 @@ extern int num_bg_loops; #define GFX_SP_CHIP_UPPER (GFX_START_ROCKSMORE + 4 * MORE_PER_LINE + 6) #define GFX_SP_CHIP_LOWER (GFX_START_ROCKSMORE + 4 * MORE_PER_LINE + 7) +#define GFX_SP_BUG_WARNING (GFX_START_ROCKSMORE + 2 * MORE_PER_LINE +15) #define GFX_SP_EXPLODE_EMPTY (GFX_START_ROCKSMORE + 3 * MORE_PER_LINE + 8) #define GFX_SP_EXPLODE_INFOTRON (GFX_START_ROCKSMORE + 4 * MORE_PER_LINE + 8) +#define GFX_SP_BUG_ACTIVE (GFX_START_ROCKSMORE + 6 * MORE_PER_LINE + 8) #define GFX_SP_SNIKSNAK_LEFT (GFX_START_ROCKSMORE + 8 * MORE_PER_LINE + 8) #define GFX_SP_SNIKSNAK_RIGHT (GFX_START_ROCKSMORE + 8 * MORE_PER_LINE +12) #define GFX_SP_SNIKSNAK_UP (GFX_START_ROCKSMORE + 9 * MORE_PER_LINE + 8) @@ -1156,8 +1158,17 @@ extern int num_bg_loops; #define SND_WARNTON 49 #define SND_WHOOSH 50 #define SND_ZISCH 51 - -#define NUM_SOUNDS 52 +#define SND_SP_BASE 52 +#define SND_SP_INFOTRON 53 +#define SND_SP_ZONKDOWN 54 +#define SND_SP_ZONKPUSH 55 +#define SND_SP_BUG 56 +#define SND_SP_BOOM 57 +#define SND_SP_BOOOM 58 +#define SND_SP_EXIT 59 +#define SND_EMPTY 60 + +#define NUM_SOUNDS 61 /* default input keys */ #define KEY_UNDEFINDED XK_VoidSymbol diff --git a/src/tape.c b/src/tape.c index 2cc0b399..7e388fae 100644 --- a/src/tape.c +++ b/src/tape.c @@ -199,7 +199,7 @@ boolean TapePlayDelay() DrawVideoDisplay(VIDEO_STATE_PBEND_OFF, VIDEO_DISPLAY_LABEL_ONLY); } - if (level.time-TimeLeft > tape.length_seconds - PAUSE_SECONDS_BEFORE_DEATH) + if (TimePlayed > tape.length_seconds - PAUSE_SECONDS_BEFORE_DEATH) { TapeTogglePause(); return(FALSE); diff --git a/src/tools.c b/src/tools.c index 824327cc..56b64fda 100644 --- a/src/tools.c +++ b/src/tools.c @@ -1953,6 +1953,7 @@ int el2gfx(int element) case EL_PFEIL_U: return GFX_PFEIL_U; case EL_SPEED_PILL: return GFX_SPEED_PILL; case EL_SP_TERMINAL_ACTIVE: return GFX_SP_TERMINAL; + case EL_SP_BUG_ACTIVE: return GFX_SP_BUG_ACTIVE; default: {