From cd56ad175c592ea3047703d57c11d2f3a61f7f37 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Fri, 20 Nov 1998 03:08:08 +0100 Subject: [PATCH] rnd-19981120-2 --- src/game.c | 139 ++++++++++++++++++++++++++------------------------ src/game.h | 3 +- src/screens.c | 52 +++++++++++++++++-- 3 files changed, 123 insertions(+), 71 deletions(-) diff --git a/src/game.c b/src/game.c index a48ad78b..c5520d4a 100644 --- a/src/game.c +++ b/src/game.c @@ -29,7 +29,9 @@ static unsigned int getStateCheckSum(int counter) int x, y; unsigned int mult = 1; unsigned int checksum = 0; + /* static short lastFeld[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; + */ static boolean first_game = TRUE; for (y=0; yscore > highscore[k].Score) { - /* Spieler kommt in Highscore-Liste */ + /* player has made it to the hall of fame */ if (k < MAX_SCORE_ENTRIES - 1) { @@ -641,7 +643,7 @@ boolean NewHiScore() for (l=k; l=TILEX) /* Zielfeld erreicht */ + if (ABS(MovPos[x][y])>=TILEX) /* object reached its destination */ { Feld[x][y] = EL_LEERRAUM; Feld[newx][newy] = element; @@ -2148,7 +2151,7 @@ void ContinueMoving(int x, int y) Stop[newx][newy] = TRUE; JustHit[x][newy] = 3; - if (DONT_TOUCH(element)) /* Käfer oder Flieger */ + if (DONT_TOUCH(element)) /* object may be nasty to player or others */ { TestIfBadThingHitsHero(newx, newy); TestIfBadThingHitsFriend(newx, newy); @@ -2161,7 +2164,7 @@ void ContinueMoving(int x, int y) (newy == lev_fieldy-1 || !IS_FREE(x, newy+1))) Impact(x, newy); } - else /* noch in Bewegung */ + else /* still moving on */ DrawLevelField(x, y); } @@ -2305,7 +2308,7 @@ void AmoebeWaechst(int x, int y) static long sound_delay = 0; static int sound_delay_value = 0; - if (!MovDelay[x][y]) /* neue Phase / noch nicht gewartet */ + if (!MovDelay[x][y]) /* start new growing cycle */ { MovDelay[x][y] = 7; @@ -2316,7 +2319,7 @@ void AmoebeWaechst(int x, int y) } } - if (MovDelay[x][y]) /* neue Phase / in Wartezustand */ + if (MovDelay[x][y]) /* wait some time before growing bigger */ { MovDelay[x][y]--; if (MovDelay[x][y]/2 && IN_SCR_FIELD(SCREENX(x), SCREENY(y))) @@ -2351,17 +2354,17 @@ void AmoebeAbleger(int ax, int ay) return; } - if (!MovDelay[ax][ay]) /* neue Amoebe / noch nicht gewartet */ + if (!MovDelay[ax][ay]) /* start making new amoeba field */ MovDelay[ax][ay] = RND(FRAMES_PER_SECOND * 25/(1+level.tempo_amoebe)); - if (MovDelay[ax][ay]) /* neue Amoebe / in Wartezustand */ + if (MovDelay[ax][ay]) /* wait some time before making new amoeba */ { MovDelay[ax][ay]--; if (MovDelay[ax][ay]) return; } - if (element == EL_AMOEBE_NASS) /* tropfende Amöbe */ + if (element == EL_AMOEBE_NASS) /* object is an acid / amoeba drop */ { int start = RND(4); int x = ax+xy[start][0]; @@ -2380,7 +2383,7 @@ void AmoebeAbleger(int ax, int ay) if (newax == ax && neway == ay) return; } - else /* normale oder "gefüllte" Amöbe */ + else /* normal or "filled" amoeba */ { int start = RND(4); boolean waiting_for_player = FALSE; @@ -2413,7 +2416,7 @@ void AmoebeAbleger(int ax, int ay) DrawLevelField(ax, ay); AmoebaCnt[AmoebaNr[ax][ay]]--; - if (AmoebaCnt[AmoebaNr[ax][ay]]<=0) /* Amöbe vollständig tot */ + if (AmoebaCnt[AmoebaNr[ax][ay]]<=0) /* amoeba is completely dead */ { if (element == EL_AMOEBE_VOLL) AmoebeUmwandeln(ax, ay); @@ -2463,17 +2466,17 @@ void AmoebeAbleger(int ax, int ay) void Life(int ax, int ay) { int x1, y1, x2, y2; - static int life[4] = { 2, 3, 3, 3 }; /* "Life"-Parameter */ + static int life[4] = { 2, 3, 3, 3 }; /* parameters for "game of life" */ int life_time = 40; int element = Feld[ax][ay]; if (Stop[ax][ay]) return; - if (!MovDelay[ax][ay]) /* neue Phase / noch nicht gewartet */ + if (!MovDelay[ax][ay]) /* start new "game of life" cycle */ MovDelay[ax][ay] = life_time; - if (MovDelay[ax][ay]) /* neue Phase / in Wartezustand */ + if (MovDelay[ax][ay]) /* wait some time before next cycle */ { MovDelay[ax][ay]--; if (MovDelay[ax][ay]) @@ -2502,7 +2505,7 @@ void Life(int ax, int ay) nachbarn++; } - if (xx == ax && yy == ay) /* mittleres Feld mit Amoebe */ + if (xx == ax && yy == ay) /* field in the middle */ { if (nachbarnlife[1]) { @@ -2513,7 +2516,7 @@ void Life(int ax, int ay) } } else if (IS_FREE(xx, yy) || Feld[xx][yy] == EL_ERDREICH) - { /* Randfeld ohne Amoebe */ + { /* free border field */ if (nachbarn>=life[2] && nachbarn<=life[3]) { Feld[xx][yy] = element; @@ -2528,10 +2531,10 @@ void Life(int ax, int ay) void Ablenk(int x, int y) { - if (!MovDelay[x][y]) /* neue Phase / noch nicht gewartet */ + if (!MovDelay[x][y]) /* next animation frame */ MovDelay[x][y] = level.dauer_ablenk * FRAMES_PER_SECOND; - if (MovDelay[x][y]) /* neue Phase / in Wartezustand */ + if (MovDelay[x][y]) /* wait some time before next frame */ { MovDelay[x][y]--; if (MovDelay[x][y]) @@ -2552,10 +2555,10 @@ void Ablenk(int x, int y) void Birne(int x, int y) { - if (!MovDelay[x][y]) /* neue Phase / noch nicht gewartet */ + if (!MovDelay[x][y]) /* next animation frame */ MovDelay[x][y] = 800; - if (MovDelay[x][y]) /* neue Phase / in Wartezustand */ + if (MovDelay[x][y]) /* wait some time before next frame */ { MovDelay[x][y]--; if (MovDelay[x][y]) @@ -2589,10 +2592,10 @@ void Blubber(int x, int y) void NussKnacken(int x, int y) { - if (!MovDelay[x][y]) /* neue Phase / noch nicht gewartet */ + if (!MovDelay[x][y]) /* next animation frame */ MovDelay[x][y] = 7; - if (MovDelay[x][y]) /* neue Phase / in Wartezustand */ + 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))) @@ -2634,10 +2637,10 @@ void AusgangstuerOeffnen(int x, int y) { int delay = 6; - if (!MovDelay[x][y]) /* neue Phase / noch nicht gewartet */ + if (!MovDelay[x][y]) /* next animation frame */ MovDelay[x][y] = 5*delay; - if (MovDelay[x][y]) /* neue Phase / in Wartezustand */ + if (MovDelay[x][y]) /* wait some time before next frame */ { int tuer; @@ -2668,10 +2671,10 @@ void EdelsteinFunkeln(int x, int y) DrawGraphicAnimation(x, y, GFX_EDELSTEIN_BD, 4, 4, ANIM_REVERSE); else { - if (!MovDelay[x][y]) /* neue Phase / noch nicht gewartet */ + if (!MovDelay[x][y]) /* next animation frame */ MovDelay[x][y] = 11 * !SimpleRND(500); - if (MovDelay[x][y]) /* neue Phase / in Wartezustand */ + if (MovDelay[x][y]) /* wait some time before next frame */ { MovDelay[x][y]--; @@ -2709,10 +2712,10 @@ void MauerWaechst(int x, int y) { int delay = 6; - if (!MovDelay[x][y]) /* neue Phase / noch nicht gewartet */ + if (!MovDelay[x][y]) /* next animation frame */ MovDelay[x][y] = 3*delay; - if (MovDelay[x][y]) /* neue Phase / in Wartezustand */ + if (MovDelay[x][y]) /* wait some time before next frame */ { int phase; @@ -2764,10 +2767,10 @@ void MauerAbleger(int ax, int ay) boolean oben_massiv = FALSE, unten_massiv = FALSE; boolean links_massiv = FALSE, rechts_massiv = FALSE; - if (!MovDelay[ax][ay]) /* neue Mauer / noch nicht gewartet */ + if (!MovDelay[ax][ay]) /* start building new wall */ MovDelay[ax][ay] = 6; - if (MovDelay[ax][ay]) /* neue Mauer / in Wartezustand */ + if (MovDelay[ax][ay]) /* wait some time before building new wall */ { MovDelay[ax][ay]--; if (MovDelay[ax][ay]) @@ -3093,6 +3096,7 @@ void GameActions() #ifdef DEBUG + /* if (TimeFrames == 0 && !local_player->gone) { extern unsigned int last_RND(); @@ -3102,13 +3106,16 @@ void GameActions() last_RND(), getStateCheckSum(level.time - TimeLeft)); } + */ #endif #ifdef DEBUG + /* if (GameFrameDelay >= 500) printf("FrameCounter == %d\n", FrameCounter); + */ #endif @@ -3517,7 +3524,7 @@ boolean MoveFigure(struct PlayerInfo *player, int dx, int dy) else if (old_jx == jx && old_jy != jy) player->MovDir = (old_jy < jy ? MV_DOWN : MV_UP); - DrawLevelField(jx, jy); /* für "ErdreichAnbroeckeln()" */ + DrawLevelField(jx, jy); /* for "ErdreichAnbroeckeln()" */ player->last_move_dir = player->MovDir; } @@ -3970,7 +3977,7 @@ int DigField(struct PlayerInfo *player, case EL_AUSGANG_ZU: case EL_AUSGANG_ACT: - /* Tür ist (noch) nicht offen! */ + /* door is not (yet) open */ return MF_NO_ACTION; break; diff --git a/src/game.h b/src/game.h index 9db0ef6b..965d8f03 100644 --- a/src/game.h +++ b/src/game.h @@ -27,7 +27,8 @@ #define SCROLL_INIT 0 #define SCROLL_GO_ON 1 -/* explosion position marks */ +/* explosion position and phase marks */ +#define EX_PHASE_START 0 #define EX_NORMAL 0 #define EX_CENTER 1 #define EX_BORDER 2 diff --git a/src/screens.c b/src/screens.c index 1ff8bd1d..bd0f13a3 100644 --- a/src/screens.c +++ b/src/screens.c @@ -577,6 +577,45 @@ void DrawHelpScreenCreditsText() ClearWindow(); DrawHeadline(); + sprintf(text,"Credits:"); + DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+100, + text,FS_SMALL,FC_GREEN); + + sprintf(text,"DOS/Windows port of the game:"); + DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+0*ystep, + text,FS_SMALL,FC_YELLOW); + sprintf(text,"Guido Schulz"); + DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+1*ystep, + text,FS_SMALL,FC_RED); + + sprintf(text,"Additional toons:"); + DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+2*ystep, + text,FS_SMALL,FC_YELLOW); + sprintf(text,"Karl Hörnell"); + DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+3*ystep, + text,FS_SMALL,FC_RED); + + sprintf(text,"...and many thanks to all contributors"); + DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+5*ystep, + text,FS_SMALL,FC_YELLOW); + sprintf(text,"of new levels!"); + DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+ystart+6*ystep, + text,FS_SMALL,FC_YELLOW); + + sprintf(text,"Press any key or button for next page"); + DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+SYSIZE-20, + text,FS_SMALL,FC_BLUE); +} + +void DrawHelpScreenContactText() +{ + int ystart = 150, ystep = 30; + char text[FULL_SXSIZE/FONT2_XSIZE+10]; + + FadeSounds(); + ClearWindow(); + DrawHeadline(); + sprintf(text,"Program information:"); DrawText(SX+(SXSIZE-strlen(text)*FONT2_XSIZE)/2,SY+100, text,FS_SMALL,FC_GREEN); @@ -649,7 +688,7 @@ void HandleHelpScreen(int button) if (button_released) { - if (helpscreen_state