From: Holger Schemel Date: Tue, 21 Nov 1995 19:48:46 +0000 (+0100) Subject: rocks_n_diamonds-0.9b2 X-Git-Tag: 1.2.0^2~102 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=046d80f9a1b3fad9d4d3d3aa92dcb3689849aebf;p=rocksndiamonds.git rocks_n_diamonds-0.9b2 --- diff --git a/src/editor.c b/src/editor.c index 454fb74e..7c497689 100644 --- a/src/editor.c +++ b/src/editor.c @@ -36,13 +36,18 @@ int editor_element[] = EL_BETON, EL_MAUERWERK, + EL_MAUER_LEBT, EL_FELSBODEN, + EL_SIEB_LEER, + EL_SIEB2_LEER, + EL_KOKOSNUSS, + EL_BOMBE, EL_EDELSTEIN, EL_DIAMANT, - EL_KOKOSNUSS, - EL_BOMBE, + EL_EDELSTEIN2, + EL_EDELSTEIN3, EL_MORAST_LEER, EL_MORAST_VOLL, @@ -52,12 +57,12 @@ int editor_element[] = EL_KAEFER, EL_FLIEGER, EL_MAMPFER, - EL_ZOMBIE, + EL_MAMPFER2, + EL_ZOMBIE, EL_PACMAN, EL_DYNAMIT_AUS, EL_DYNAMIT, - EL_ABLENK_AUS, EL_BADEWANNE1, EL_SALZSAEURE, @@ -75,19 +80,25 @@ int editor_element[] = EL_AMOEBE_NORM, EL_AMOEBE_VOLL, - -/* EL_LIFE, -*/ EL_LIFE_ASYNC, + EL_ABLENK_AUS, EL_ERZ_EDEL, EL_ERZ_DIAM, + EL_ERZ_EDEL2, + EL_ERZ_EDEL3, EL_ZEIT_VOLL, EL_ZEIT_LEER, + + EL_DYNABOMB_NR, + EL_DYNABOMB_SZ, + +/* EL_BIRNE_AUS, EL_BIRNE_EIN, +*/ EL_SCHLUESSEL1, EL_SCHLUESSEL2, diff --git a/src/files.c b/src/files.c index e349c062..1efc0a1a 100644 --- a/src/files.c +++ b/src/files.c @@ -155,9 +155,9 @@ void LoadLevel(int level_nr) level.edelsteine = (fgetc(file)<<8) | fgetc(file); for(i=0;i=TILEX) /* Zielfeld erreicht */ { - Feld[x][y]=EL_LEERRAUM; - Feld[newx][newy]=element; + Feld[x][y] = EL_LEERRAUM; + Feld[newx][newy] = element; if (Store[x][y]==EL_MORAST_VOLL) { @@ -1225,6 +1322,17 @@ void ContinueMoving(int x, int y) Store[x][y] = Store2[x][y] = 0; Feld[x][y] = EL_SIEB_LEER; } + else if (Store[x][y]==EL_SIEB2_VOLL) + { + Store[x][y] = 0; + Feld[newx][newy] = EL_SIEB2_VOLL; + element = EL_SIEB2_VOLL; + } + else if (Store[x][y]==EL_SIEB2_LEER) + { + Store[x][y] = Store2[x][y] = 0; + Feld[x][y] = EL_SIEB2_LEER; + } else if (Store[x][y]==EL_SALZSAEURE) { Store[x][y] = 0; @@ -1245,8 +1353,9 @@ void ContinueMoving(int x, int y) DrawLevelField(x,y); DrawLevelField(newx,newy); - Stop[newx][newy]=TRUE; - CheckMoving=TRUE; + Stop[newx][newy] = TRUE; + JustHit[x][newy] = 3; + CheckMoving = TRUE; if (DONT_TOUCH(element)) /* Käfer oder Flieger */ { @@ -1261,7 +1370,7 @@ void ContinueMoving(int x, int y) else /* noch in Bewegung */ { DrawLevelField(x,y); - CheckMoving=TRUE; + CheckMoving = TRUE; } } @@ -1376,7 +1485,7 @@ void AmoebeWaechst(int x, int y) static long sound_delay = 0; static int sound_delay_value = 0; - CheckExploding=TRUE; + CheckExploding = TRUE; if (!MovDelay[x][y]) /* neue Phase / noch nicht gewartet */ { @@ -1417,7 +1526,7 @@ void AmoebeAbleger(int ax, int ay) 0,+1 }; - CheckExploding=TRUE; + CheckExploding = TRUE; if (!level.tempo_amoebe) { @@ -1529,7 +1638,7 @@ void Life(int ax, int ay) int life_time = 20; int element = Feld[ax][ay]; - CheckExploding=TRUE; + CheckExploding = TRUE; if (Stop[ax][ay]) return; @@ -1591,7 +1700,7 @@ void Life(int ax, int ay) void Ablenk(int x, int y) { - CheckExploding=TRUE; + CheckExploding = TRUE; if (!MovDelay[x][y]) /* neue Phase / noch nicht gewartet */ MovDelay[x][y] = 33*(level.dauer_ablenk/10); @@ -1616,7 +1725,7 @@ void Ablenk(int x, int y) void Birne(int x, int y) { - CheckExploding=TRUE; + CheckExploding = TRUE; if (!MovDelay[x][y]) /* neue Phase / noch nicht gewartet */ MovDelay[x][y] = 400; @@ -1647,7 +1756,7 @@ void Birne(int x, int y) void Blubber(int x, int y) { - CheckExploding=TRUE; + CheckExploding = TRUE; if (!MovDelay[x][y]) /* neue Phase / noch nicht gewartet */ MovDelay[x][y] = 20; @@ -1665,7 +1774,7 @@ void Blubber(int x, int y) void NussKnacken(int x, int y) { - CheckExploding=TRUE; + CheckExploding = TRUE; if (!MovDelay[x][y]) /* neue Phase / noch nicht gewartet */ MovDelay[x][y] = 4; @@ -1684,14 +1793,15 @@ void NussKnacken(int x, int y) } } -void SiebAktivieren(int x, int y) +void SiebAktivieren(int x, int y, int typ) { - CheckExploding=TRUE; + CheckExploding = TRUE; if (SiebAktiv>1) { if (SiebAktiv%2 && IN_SCR_FIELD(SCROLLX(x),SCROLLY(y))) - DrawGraphic(SCROLLX(x),SCROLLY(y),GFX_SIEB_VOLL+3-(SiebAktiv%8)/2); + DrawGraphic(SCROLLX(x),SCROLLY(y), + (typ==1 ? GFX_SIEB_VOLL : GFX_SIEB2_VOLL)+3-(SiebAktiv%8)/2); /* if (!(SiebAktiv%4)) @@ -1701,34 +1811,39 @@ void SiebAktivieren(int x, int y) } else { - Feld[x][y] = EL_SIEB_TOT; + Feld[x][y] = (typ==1 ? EL_SIEB_TOT : EL_SIEB2_TOT); DrawLevelField(x,y); } } void AusgangstuerPruefen(int x, int y) { - CheckExploding=TRUE; + CheckExploding = TRUE; if (!Gems) + { Feld[x][y] = EL_AUSGANG_ACT; + PlaySoundLevel(x,y,SND_OEFFNEN); + } } void AusgangstuerOeffnen(int x, int y) { - CheckExploding=TRUE; + int speed = 3; + + CheckExploding = TRUE; if (!MovDelay[x][y]) /* neue Phase / noch nicht gewartet */ - MovDelay[x][y] = 20; + MovDelay[x][y] = 5*speed; if (MovDelay[x][y]) /* neue Phase / in Wartezustand */ { int tuer; MovDelay[x][y]--; - tuer = MovDelay[x][y]/5; - if (!(MovDelay[x][y]%5) && IN_SCR_FIELD(SCROLLX(x),SCROLLY(y))) - DrawGraphic(SCROLLX(x),SCROLLY(y),GFX_AUSGANG_ZU+3-tuer); + tuer = MovDelay[x][y]/speed; + if (!(MovDelay[x][y]%speed) && IN_SCR_FIELD(SCROLLX(x),SCROLLY(y))) + DrawGraphic(SCROLLX(x),SCROLLY(y),GFX_AUSGANG_AUF-tuer); if (!MovDelay[x][y]) { @@ -1738,6 +1853,137 @@ void AusgangstuerOeffnen(int x, int y) } } +void AusgangstuerBlinken(int x, int y) +{ + CheckExploding = TRUE; + + if (!MovDelay[x][y]) /* neue Phase / noch nicht gewartet */ + MovDelay[x][y] = 16; + + if (MovDelay[x][y]) /* neue Phase / in Wartezustand */ + { + int phase; + + MovDelay[x][y]--; + phase = (MovDelay[x][y] % 16)/2; + if (phase>3) + phase = 7-phase; + if (!(MovDelay[x][y]%2) && IN_SCR_FIELD(SCROLLX(x),SCROLLY(y))) + DrawGraphic(SCROLLX(x),SCROLLY(y),GFX_AUSGANG_AUF+phase); + } +} + +void EdelsteinFunkeln(int x, int y) +{ + int speed = 2; + + CheckExploding = TRUE; + + if (IS_MOVING(x,y)) + return; + + if (!MovDelay[x][y]) /* neue Phase / noch nicht gewartet */ + MovDelay[x][y] = 4*speed; + + if (MovDelay[x][y]) /* neue Phase / in Wartezustand */ + { + int phase; + + MovDelay[x][y]--; + phase = MovDelay[x][y]/speed; + if (!(MovDelay[x][y]%speed) && IN_SCR_FIELD(SCROLLX(x),SCROLLY(y))) + DrawGraphic(SCROLLX(x),SCROLLY(y),GFX_EDELSTEIN2-phase); + } +} + +void MauerWaechst(int x, int y) +{ + int speed = 3; + + CheckExploding = TRUE; + + if (!MovDelay[x][y]) /* neue Phase / noch nicht gewartet */ + MovDelay[x][y] = 3*speed; + + if (MovDelay[x][y]) /* neue Phase / in Wartezustand */ + { + int phase; + + MovDelay[x][y]--; + phase = 2-MovDelay[x][y]/speed; + if (!(MovDelay[x][y]%speed) && IN_SCR_FIELD(SCROLLX(x),SCROLLY(y))) + DrawGraphic(SCROLLX(x),SCROLLY(y), + (Store[x][y]==MV_LEFT ? GFX_MAUER_L1 : GFX_MAUER_R1)+phase); + + if (!MovDelay[x][y]) + { + if (Store[x][y]==MV_LEFT) + { + if (IN_LEV_FIELD(x-1,y) && IS_MAUER(Feld[x-1][y])) + DrawLevelField(x-1,y); + } + else + { + if (IN_LEV_FIELD(x+1,y) && IS_MAUER(Feld[x+1][y])) + DrawLevelField(x+1,y); + } + + Feld[x][y] = EL_MAUER_LEBT; + Store[x][y] = 0; + DrawLevelField(x,y); + } + } +} + +void MauerAbleger(int ax, int ay) +{ + BOOL links_frei = FALSE, rechts_frei = FALSE; + BOOL links_massiv = FALSE, rechts_massiv = FALSE; + + CheckExploding = TRUE; + + if (!MovDelay[ax][ay]) /* neue Mauer / noch nicht gewartet */ + MovDelay[ax][ay] = 3; + + if (MovDelay[ax][ay]) /* neue Mauer / in Wartezustand */ + { + MovDelay[ax][ay]--; + if (MovDelay[ax][ay]) + return; + } + + if (IN_LEV_FIELD(ax-1,ay) && IS_FREE(ax-1,ay)) + links_frei = TRUE; + if (IN_LEV_FIELD(ax+1,ay) && IS_FREE(ax+1,ay)) + rechts_frei = TRUE; + + if (links_frei) + { + Feld[ax-1][ay] = EL_MAUERND; + Store[ax-1][ay] = MV_LEFT; + if (IN_SCR_FIELD(SCROLLX(ax-1),SCROLLY(ay))) + DrawGraphic(SCROLLX(ax-1),SCROLLY(ay),GFX_MAUER_L1); + } + if (rechts_frei) + { + Feld[ax+1][ay] = EL_MAUERND; + Store[ax+1][ay] = MV_RIGHT; + if (IN_SCR_FIELD(SCROLLX(ax+1),SCROLLY(ay))) + DrawGraphic(SCROLLX(ax+1),SCROLLY(ay),GFX_MAUER_R1); + } + + if (links_frei || rechts_frei) + DrawLevelField(ax,ay); + + if (!IN_LEV_FIELD(ax-1,ay) || IS_MAUER(Feld[ax-1][ay])) + links_massiv = TRUE; + if (!IN_LEV_FIELD(ax+1,ay) || IS_MAUER(Feld[ax+1][ay])) + rechts_massiv = TRUE; + + if (links_massiv && rechts_massiv) + Feld[ax][ay] = EL_MAUERWERK; +} + int GameActions(int mx, int my, int button) { static long time_delay=0, action_delay=0; @@ -1777,7 +2023,11 @@ int GameActions(int mx, int my, int button) CheckMoving = CheckExploding = FALSE; for(y=0;y0) + JustHit[x][y]--; + } for(y=0;y0) Gems--; RaiseScore(level.score[SC_EDELSTEIN]); @@ -2093,8 +2360,8 @@ int DigField(int x, int y, int mode) PlaySoundLevel(x,y,SND_PONG); break; case EL_DIAMANT: - Feld[x][y]=EL_LEERRAUM; - CheckMoving=TRUE; + Feld[x][y] = EL_LEERRAUM; + CheckMoving = TRUE; Gems -= 3; if (Gems<0) Gems=0; @@ -2103,13 +2370,28 @@ int DigField(int x, int y, int mode) PlaySoundLevel(x,y,SND_PONG); break; case EL_DYNAMIT_AUS: - Feld[x][y]=EL_LEERRAUM; - CheckMoving=TRUE; + Feld[x][y] = EL_LEERRAUM; + CheckMoving = TRUE; Dynamite++; RaiseScore(level.score[SC_DYNAMIT]); DrawText(DX_DYNAMITE,DY_DYNAMITE,int2str(Dynamite,3),FS_SMALL,FC_YELLOW); PlaySoundLevel(x,y,SND_PONG); break; + case EL_DYNABOMB_NR: + Feld[x][y] = EL_LEERRAUM; + CheckMoving = TRUE; + DynaBombCount++; + DynaBombsLeft++; + RaiseScore(level.score[SC_DYNAMIT]); + PlaySoundLevel(x,y,SND_PONG); + break; + case EL_DYNABOMB_SZ: + Feld[x][y] = EL_LEERRAUM; + CheckMoving = TRUE; + DynaBombSize++; + RaiseScore(level.score[SC_DYNAMIT]); + PlaySoundLevel(x,y,SND_PONG); + break; case EL_SCHLUESSEL1: case EL_SCHLUESSEL2: case EL_SCHLUESSEL3: @@ -2132,7 +2414,7 @@ int DigField(int x, int y, int mode) } case EL_ABLENK_AUS: Feld[x][y] = EL_ABLENK_EIN; - CheckExploding=TRUE; + CheckExploding = TRUE; ZX=x; ZY=y; DrawLevelField(x,y); @@ -2184,8 +2466,12 @@ int DigField(int x, int y, int mode) return(MF_NO_ACTION); break; case EL_AUSGANG_AUF: +/* if (mode==DF_SNAP || Gems>0) return(MF_NO_ACTION); +*/ + if (mode==DF_SNAP) + return(MF_NO_ACTION); LevelSolved = GameOver = TRUE; PlaySoundLevel(x,y,SND_BUING); break; @@ -2238,16 +2524,32 @@ BOOL SnapField(int dx, int dy) BOOL PlaceBomb(void) { - if (Dynamite==0 || Feld[JX][JY]==EL_DYNAMIT) + if ((Dynamite==0 && DynaBombsLeft==0) || + Feld[JX][JY]==EL_DYNAMIT || Feld[JX][JY]==EL_DYNABOMB) return(FALSE); if (Feld[JX][JY]!=EL_LEERRAUM) Store[JX][JY] = Feld[JX][JY]; - Feld[JX][JY] = EL_DYNAMIT; - MovDelay[JX][JY] = 48; - Dynamite--; - DrawText(DX_DYNAMITE,DY_DYNAMITE,int2str(Dynamite,3),FS_SMALL,FC_YELLOW); - DrawGraphicThruMask(SCROLLX(JX),SCROLLY(JY),GFX_DYNAMIT); + + if (Dynamite) + { + Feld[JX][JY] = EL_DYNAMIT; + MovDelay[JX][JY] = 48; + Dynamite--; + DrawText(DX_DYNAMITE,DY_DYNAMITE,int2str(Dynamite,3),FS_SMALL,FC_YELLOW); + DrawGraphicThruMask(SCROLLX(JX),SCROLLY(JY),GFX_DYNAMIT); + } + else + { + Feld[JX][JY] = EL_DYNABOMB; + MovDelay[JX][JY] = 48; + DynaBombsLeft--; + + /* ändern, wenn Maske für DYNABOMB vorliegt! */ + + DrawGraphicThruMask(SCROLLX(JX),SCROLLY(JY),GFX_DYNAMIT); + } + CheckExploding = TRUE; return(TRUE); } diff --git a/src/game.h b/src/game.h index e7150b6b..56be763c 100644 --- a/src/game.h +++ b/src/game.h @@ -25,6 +25,10 @@ #define MF_MOVING 1 #define MF_ACTION 2 +#define EX_NORMAL 0 +#define EX_CENTER 1 +#define EX_BORDER 2 + void GetPlayerConfig(void); void InitGame(void); void InitMovDir(int, int); @@ -38,7 +42,8 @@ int MovingOrBlocked2Element(int, int); void RemoveMovingField(int, int); void DrawDynamite(int, int); void CheckDynamite(int, int); -void Explode(int, int, int); +void Explode(int, int, int, int); +void DynaExplode(int, int, int); void Bang(int, int); void Blurb(int, int); void Impact(int, int); @@ -53,9 +58,13 @@ void Life(int, int); void Ablenk(int, int); void Blubber(int, int); void NussKnacken(int, int); -void SiebAktivieren(int x, int y); -void AusgangstuerPruefen(int x, int y); -void AusgangstuerOeffnen(int x, int y); +void SiebAktivieren(int, int, int); +void AusgangstuerPruefen(int, int); +void AusgangstuerOeffnen(int, int); +void AusgangstuerBlinken(int, int); +void EdelsteinFunkeln(int, int); +void MauerWaechst(int, int); +void MauerAbleger(int, int); int GameActions(int, int, int); void ScrollLevel(int, int); BOOL MoveFigure(int, int); diff --git a/src/init.c b/src/init.c index 8032ffb3..251d32d6 100644 --- a/src/init.c +++ b/src/init.c @@ -490,6 +490,7 @@ void InitElementProperties() { EL_BETON, EL_MAUERWERK, + EL_MAUER_LEBT, EL_FELSBODEN, EL_AUSGANG_ZU, EL_AUSGANG_ACT, @@ -502,6 +503,10 @@ void InitElementProperties() EL_MORAST_LEER, EL_SIEB_VOLL, EL_SIEB_LEER, + EL_SIEB_TOT, + EL_SIEB2_VOLL, + EL_SIEB2_LEER, + EL_SIEB2_TOT, EL_LIFE, EL_LIFE_ASYNC, EL_BADEWANNE1, @@ -537,6 +542,8 @@ void InitElementProperties() EL_FELSBODEN, EL_FELSBROCKEN, EL_EDELSTEIN, + EL_EDELSTEIN2, + EL_EDELSTEIN3, EL_DIAMANT, EL_BOMBE, EL_KOKOSNUSS, @@ -556,21 +563,46 @@ void InitElementProperties() EL_KAEFER, EL_FLIEGER, EL_MAMPFER, + EL_MAMPFER2, EL_ZOMBIE, EL_PACMAN }; static int ep_enemy_num = sizeof(ep_enemy)/sizeof(int); + static int ep_mauer[] = + { + EL_BETON, + EL_PFORTE1, + EL_PFORTE2, + EL_PFORTE3, + EL_PFORTE4, + EL_PFORTE1X, + EL_PFORTE2X, + EL_PFORTE3X, + EL_PFORTE4X, + EL_AUSGANG_ZU, + EL_AUSGANG_ACT, + EL_AUSGANG_AUF, + EL_MAUERWERK, + EL_FELSBODEN, + EL_MAUER_LEBT, + EL_MAUERND + }; + static int ep_mauer_num = sizeof(ep_mauer)/sizeof(int); + static int ep_can_fall[] = { EL_FELSBROCKEN, EL_EDELSTEIN, + EL_EDELSTEIN2, + EL_EDELSTEIN3, EL_DIAMANT, EL_BOMBE, EL_KOKOSNUSS, EL_TROPFEN, EL_MORAST_VOLL, EL_SIEB_VOLL, + EL_SIEB2_VOLL, EL_ZEIT_VOLL, EL_ZEIT_LEER }; @@ -580,6 +612,8 @@ void InitElementProperties() { EL_FELSBROCKEN, EL_EDELSTEIN, + EL_EDELSTEIN2, + EL_EDELSTEIN3, EL_DIAMANT, EL_SCHLUESSEL1, EL_SCHLUESSEL2, @@ -597,6 +631,8 @@ void InitElementProperties() { EL_FELSBROCKEN, EL_EDELSTEIN, + EL_EDELSTEIN2, + EL_EDELSTEIN3, EL_DIAMANT }; static int ep_can_change_num = sizeof(ep_can_change)/sizeof(int); @@ -606,6 +642,7 @@ void InitElementProperties() EL_KAEFER, EL_FLIEGER, EL_MAMPFER, + EL_MAMPFER2, EL_ZOMBIE, EL_PACMAN }; @@ -640,6 +677,7 @@ void InitElementProperties() EL_KAEFER, EL_FLIEGER, EL_MAMPFER, + EL_MAMPFER2, EL_ZOMBIE, EL_PACMAN, EL_TROPFEN, @@ -647,6 +685,26 @@ void InitElementProperties() }; static int ep_dont_go_to_num = sizeof(ep_dont_go_to)/sizeof(int); + static int ep_mampf2[] = + { + EL_ERDREICH, + EL_KAEFER, + EL_FLIEGER, + EL_MAMPFER, + EL_ZOMBIE, + EL_PACMAN, + EL_TROPFEN, + EL_AMOEBE_TOT, + EL_AMOEBE_NASS, + EL_AMOEBE_NORM, + EL_AMOEBE_VOLL, + EL_EDELSTEIN, + EL_EDELSTEIN2, + EL_EDELSTEIN3, + EL_DIAMANT + }; + static int ep_mampf2_num = sizeof(ep_mampf2)/sizeof(int); + static long ep_bit[] = { EP_BIT_AMOEBALIVE, @@ -658,13 +716,15 @@ void InitElementProperties() EP_BIT_MASSIV, EP_BIT_SLIPPERY, EP_BIT_ENEMY, + EP_BIT_MAUER, EP_BIT_CAN_FALL, EP_BIT_CAN_SMASH, EP_BIT_CAN_CHANGE, EP_BIT_CAN_MOVE, EP_BIT_COULD_MOVE, EP_BIT_DONT_TOUCH, - EP_BIT_DONT_GO_TO + EP_BIT_DONT_GO_TO, + EP_BIT_MAMPF2 }; static int *ep_array[] = { @@ -677,13 +737,15 @@ void InitElementProperties() ep_massiv, ep_slippery, ep_enemy, + ep_mauer, ep_can_fall, ep_can_smash, ep_can_change, ep_can_move, ep_could_move, ep_dont_touch, - ep_dont_go_to + ep_dont_go_to, + ep_mampf2 }; static int *ep_num[] = { @@ -696,13 +758,15 @@ void InitElementProperties() &ep_massiv_num, &ep_slippery_num, &ep_enemy_num, + &ep_mauer_num, &ep_can_fall_num, &ep_can_smash_num, &ep_can_change_num, &ep_can_move_num, &ep_could_move_num, &ep_dont_touch_num, - &ep_dont_go_to_num + &ep_dont_go_to_num, + &ep_mampf2_num }; static int num_properties = sizeof(ep_num)/sizeof(int *); diff --git a/src/main.c b/src/main.c index 0e3f612b..573ea9cb 100644 --- a/src/main.c +++ b/src/main.c @@ -64,6 +64,7 @@ int Store[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; int Store2[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; int Frame[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; int Stop[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +int JustHit[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; int AmoebaNr[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; int AmoebaCnt[MAX_NUM_AMOEBA]; long Elementeigenschaften[MAX_ELEMENTS]; @@ -73,6 +74,7 @@ int lev_fieldx,lev_fieldy, scroll_x,scroll_y; int LevelSolved,GameOver, JX,JY, ZX,ZY; int Gems,Dynamite,Key[4],TimeLeft,Score,MampferNr; +int DynaBombCount, DynaBombSize, DynaBombsLeft; int CheckMoving,CheckExploding, SiebAktiv; struct LevelDirInfo leveldir[MAX_LEVDIR_ENTRIES]; diff --git a/src/main.h b/src/main.h index 905688b3..7d92afb4 100644 --- a/src/main.h +++ b/src/main.h @@ -24,7 +24,11 @@ #include #include +#ifdef XPM_INCLUDE_FILE #include XPM_INCLUDE_FILE +#else +#include "YOU HAVE TO SET 'XPM_INCLUDE_FILE' IN THE 'Makefile'!!!" +#endif #include #include @@ -67,40 +71,6 @@ typedef int BOOL; #define IS_MOVING(x,y) (MovPos[x][y]!=0) #define IS_BLOCKED(x,y) (Feld[x][y]==EL_BLOCKED) -/* - -#define IS_AMOEBALIVE(e) ((e)==EL_AMOEBE_NASS || (e)==EL_AMOEBE_NORM || (e)==EL_AMOEBE_VOLL) -#define IS_AMOEBOID(e) ((e)==EL_AMOEBE_TOT || IS_AMOEBALIVE(e)) -#define IS_BADEWANNOID(e) ((e)>=EL_BADEWANNE1 && (e)<=EL_BADEWANNE5) -#define IS_SCHLUESSEL(e) ((e)>=EL_SCHLUESSEL1 && (e)<=EL_SCHLUESSEL4) -#define IS_PFORTE(e) ((e)>=EL_PFORTE1 && (e)<=EL_PFORTE4X) - -#define IS_SOLID(e) ((e)==EL_BETON || (e)==EL_MAUERWERK || (e)==EL_FELSBODEN || (e)==EL_AUSGANG_ZU || (e)==EL_AUSGANG_ACT || (e)==EL_AUSGANG_AUF || IS_AMOEBOID(e) || (e)==EL_MORAST_VOLL || (e)==EL_MORAST_LEER || (e)==EL_SIEB_VOLL || (e)==EL_SIEB_LEER || (e)==EL_LIFE || (e)==EL_LIFE_ASYNC || IS_BADEWANNOID(e)) - -#define IS_MASSIV(e) ((e)==EL_BETON || (e)==EL_SALZSAEURE || IS_BADEWANNOID(e) || IS_PFORTE(e)) - -#define IS_SLIPPERY(e) ((e)==EL_FELSBODEN || (e)==EL_FELSBROCKEN || (e)==EL_EDELSTEIN || (e)==EL_DIAMANT || (e)==EL_BOMBE || (e)==EL_KOKOSNUSS || (e)==EL_ABLENK_EIN || (e)==EL_ABLENK_AUS || (e)==EL_ZEIT_VOLL || (e)==EL_ZEIT_LEER || (e)==EL_BIRNE_EIN || (e)==EL_BIRNE_AUS || (e)==EL_BADEWANNE1 || (e)==EL_BADEWANNE2) - -#define IS_ENEMY(e) ((e)==EL_KAEFER || (e)==EL_FLIEGER || (e)==EL_MAMPFER || (e)==EL_ZOMBIE || (e)==EL_PACMAN) - -#define CAN_FALL(e) ((e)==EL_FELSBROCKEN || (e)==EL_EDELSTEIN || (e)==EL_DIAMANT || (e)==EL_BOMBE || (e)==EL_KOKOSNUSS || (e)==EL_TROPFEN || (e)==EL_MORAST_VOLL || (e)==EL_SIEB_VOLL || (e)==EL_ZEIT_VOLL || (e)==EL_ZEIT_LEER) - -#define CAN_SMASH(e) ((e)==EL_FELSBROCKEN || (e)==EL_EDELSTEIN || (e)==EL_DIAMANT || IS_SCHLUESSEL(e) || (e)==EL_BOMBE || (e)==EL_KOKOSNUSS || (e)==EL_TROPFEN || (e)==EL_ZEIT_VOLL || (e)==EL_ZEIT_LEER) - -#define CAN_CHANGE(e) ((e)==EL_FELSBROCKEN || (e)==EL_EDELSTEIN || (e)==EL_DIAMANT) - -#define CAN_MOVE(e) ((e)==EL_KAEFER || (e)==EL_FLIEGER || (e)==EL_MAMPFER || (e)==EL_ZOMBIE || (e)==EL_PACMAN) - -#define COULD_MOVE(e) (((e)>=EL_KAEFER_R && (e)<=EL_KAEFER_U) || ((e)>=EL_FLIEGER_R && (e)<=EL_FLIEGER_U) || ((e)>=EL_PACMAN_R && (e)==EL_PACMAN_U)) - -#define DONT_TOUCH(e) ((e)==EL_KAEFER || (e)==EL_FLIEGER) -#define DONT_GO_TO(e) (IS_ENEMY(e) || (e)==EL_TROPFEN || (e)==EL_SALZSAEURE) - -#define IS_CHAR(e) ((e)>=EL_CHAR_START && (e)<=EL_CHAR_END) - -*/ - - #define EP_BIT_AMOEBALIVE (1<<0) #define EP_BIT_AMOEBOID (1<<1) #define EP_BIT_BADEWANNOID (1<<2) @@ -110,14 +80,16 @@ typedef int BOOL; #define EP_BIT_MASSIV (1<<6) #define EP_BIT_SLIPPERY (1<<7) #define EP_BIT_ENEMY (1<<8) -#define EP_BIT_CAN_FALL (1<<9) -#define EP_BIT_CAN_SMASH (1<<10) -#define EP_BIT_CAN_CHANGE (1<<11) -#define EP_BIT_CAN_MOVE (1<<12) -#define EP_BIT_COULD_MOVE (1<<13) -#define EP_BIT_DONT_TOUCH (1<<14) -#define EP_BIT_DONT_GO_TO (1<<15) -#define EP_BIT_CHAR (1<<16) +#define EP_BIT_MAUER (1<<9) +#define EP_BIT_CAN_FALL (1<<10) +#define EP_BIT_CAN_SMASH (1<<11) +#define EP_BIT_CAN_CHANGE (1<<12) +#define EP_BIT_CAN_MOVE (1<<13) +#define EP_BIT_COULD_MOVE (1<<14) +#define EP_BIT_DONT_TOUCH (1<<15) +#define EP_BIT_DONT_GO_TO (1<<16) +#define EP_BIT_MAMPF2 (1<<17) +#define EP_BIT_CHAR (1<<18) #define IS_AMOEBALIVE(e) (Elementeigenschaften[e] & EP_BIT_AMOEBALIVE) #define IS_AMOEBOID(e) (Elementeigenschaften[e] & EP_BIT_AMOEBOID) @@ -128,6 +100,7 @@ typedef int BOOL; #define IS_MASSIV(e) (Elementeigenschaften[e] & EP_BIT_MASSIV) #define IS_SLIPPERY(e) (Elementeigenschaften[e] & EP_BIT_SLIPPERY) #define IS_ENEMY(e) (Elementeigenschaften[e] & EP_BIT_ENEMY) +#define IS_MAUER(e) (Elementeigenschaften[e] & EP_BIT_MAUER) #define CAN_FALL(e) (Elementeigenschaften[e] & EP_BIT_CAN_FALL) #define CAN_SMASH(e) (Elementeigenschaften[e] & EP_BIT_CAN_SMASH) #define CAN_CHANGE(e) (Elementeigenschaften[e] & EP_BIT_CAN_CHANGE) @@ -135,10 +108,15 @@ typedef int BOOL; #define COULD_MOVE(e) (Elementeigenschaften[e] & EP_BIT_COULD_MOVE) #define DONT_TOUCH(e) (Elementeigenschaften[e] & EP_BIT_DONT_TOUCH) #define DONT_GO_TO(e) (Elementeigenschaften[e] & EP_BIT_DONT_GO_TO) +#define IS_MAMPF2(e) (Elementeigenschaften[e] & EP_BIT_MAMPF2) #define IS_CHAR(e) (Elementeigenschaften[e] & EP_BIT_CHAR) #define EL_CHANGED(e) ((e)==EL_FELSBROCKEN ? EL_EDELSTEIN : \ (e)==EL_EDELSTEIN ? EL_DIAMANT : \ + (e)==EL_EDELSTEIN2 ? EL_DIAMANT : \ + (e)==EL_EDELSTEIN3 ? EL_DIAMANT : \ + EL_FELSBROCKEN) +#define EL_CHANGED2(e) ((e)==EL_FELSBROCKEN ? EL_EDELSTEIN2 : \ EL_FELSBROCKEN) #define IS_DRAWABLE(e) ((e)=EL_BLOCKED) @@ -164,7 +142,8 @@ typedef int BOOL; #define MAX_NAMELEN (10+1) #define MAX_LEVNAMLEN 32 -#define MAX_SC_ENTRIES 15 +#define MAX_LEVSCORE_ENTRIES 16 +#define NUM_FREE_LVHD_BYTES 18 #define MAX_TAPELEN 10000 #define MAX_LEVDIR_FILENAME (64+1) @@ -204,12 +183,12 @@ struct LevelInfo int time; int edelsteine; char name[MAX_LEVNAMLEN]; - int score[MAX_SC_ENTRIES]; - int amoebe_inhalt; + int score[MAX_LEVSCORE_ENTRIES]; int mampfer_inhalt[4][3][3]; int tempo_amoebe; int dauer_sieb; int dauer_ablenk; + int amoebe_inhalt; }; struct LevelDirInfo @@ -288,6 +267,7 @@ extern int Store[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; extern int Store2[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; extern int Frame[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; extern int Stop[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +extern int JustHit[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; extern int AmoebaNr[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; extern int AmoebaCnt[MAX_NUM_AMOEBA]; extern long Elementeigenschaften[MAX_ELEMENTS]; @@ -297,6 +277,7 @@ extern int lev_fieldx,lev_fieldy, scroll_x,scroll_y; extern int LevelSolved,GameOver, JX,JY, ZX,ZY; extern int Gems,Dynamite,Key[4],TimeLeft,Score,MampferNr; +extern int DynaBombCount, DynaBombSize, DynaBombsLeft; extern int CheckMoving,CheckExploding, SiebAktiv; extern struct LevelDirInfo leveldir[]; @@ -354,9 +335,9 @@ extern char *progname; #define GFX_STARTX SX #define GFX_STARTY SY #define MINI_GFX_STARTX SX -#define MINI_GFX_STARTY 432 +#define MINI_GFX_STARTY 424 #define MICRO_GFX_STARTX SX -#define MICRO_GFX_STARTY 528 +#define MICRO_GFX_STARTY 536 #define GFX_PER_LINE 16 #define MINI_GFX_PER_LINE 32 #define MICRO_GFX_PER_LINE 128 @@ -423,6 +404,17 @@ extern char *progname; #define EL_AMOEBA2DIAM 52 #define EL_ZEIT_VOLL 53 #define EL_ZEIT_LEER 54 +#define EL_MAUER_LEBT 55 +#define EL_EDELSTEIN2 56 +#define EL_EDELSTEIN3 57 +#define EL_ERZ_EDEL2 58 +#define EL_ERZ_EDEL3 59 +#define EL_MAMPFER2 60 +#define EL_SIEB2_LEER 61 +#define EL_SIEB2_VOLL 62 +#define EL_DYNABOMB 63 +#define EL_DYNABOMB_NR 64 +#define EL_DYNABOMB_SZ 65 #define EL_SPIELER1 80 #define EL_SPIELER2 81 @@ -449,6 +441,7 @@ extern char *progname; #define EL_SIEB_TOT 105 #define EL_AUSGANG_ACT 106 #define EL_AUSGANG_AUF 107 +#define EL_SIEB2_TOT 108 #define EL_CHAR_START 120 #define EL_CHAR_ASCII0 (EL_CHAR_START-32) @@ -488,6 +481,7 @@ extern char *progname; #define EL_BLURB_LEFT 303 #define EL_BLURB_RIGHT 304 #define EL_AMOEBING 305 +#define EL_MAUERND 306 /* names for the graphic objects */ /* Zeile 0 (0) */ @@ -499,7 +493,8 @@ extern char *progname; #define GFX_BETON 4 #define GFX_MAUERWERK 5 #define GFX_FELSBODEN 6 -#define GFX_BOMBE_MM 7 +#define GFX_DYNABOMB 7 +#define GFX_DYNABOMB_NR GFX_DYNABOMB #define GFX_EDELSTEIN 8 #define GFX_DIAMANT 10 #define GFX_FELSBROCKEN 12 @@ -531,9 +526,6 @@ extern char *progname; #define GFX_PFORTE2X 41 #define GFX_PFORTE3X 42 #define GFX_PFORTE4X 43 -#define GFX_AUSGANG_ZU 44 -#define GFX_AUSGANG_ACT 44 -#define GFX_AUSGANG_AUF 47 /* Zeile 3 (48) */ #define GFX_DYNAMIT_AUS 48 #define GFX_DYNAMIT 49 @@ -568,6 +560,8 @@ extern char *progname; #define GFX_AMOEBE_NORM GFX_AMOEBE_LEBT #define GFX_AMOEBE_TOT 108 #define GFX_AMOEBA2DIAM GFX_AMOEBE_TOT +#define GFX_BIRNE_AUS 112 +#define GFX_BIRNE_EIN 113 #define GFX_ZEIT_VOLL 114 #define GFX_ZEIT_LEER 115 /* Zeile 7 (112) */ @@ -578,15 +572,33 @@ extern char *progname; #define GFX_SIEB_TOT GFX_SIEB_LEER #define GFX_ERZ_EDEL 132 #define GFX_ERZ_DIAM 133 -#define GFX_BIRNE_AUS 134 -#define GFX_BIRNE_EIN 135 +#define GFX_ERZ_EDEL2 134 +#define GFX_ERZ_EDEL3 135 #define GFX_AMOEBE_VOLL 136 #define GFX_KUGEL_ROT 140 #define GFX_KUGEL_BLAU 141 #define GFX_KUGEL_GELB 142 +#define GFX_KUGEL_GRAU 143 +#define GFX_DYNABOMB_SZ GFX_KUGEL_GRAU /* Zeile 9 (144) */ #define GFX_BLURB_LEFT 144 #define GFX_BLURB_RIGHT 148 +#define GFX_EDELSTEIN3 152 +/* Zeile 10 (160) */ +#define GFX_EDELSTEIN2 163 +#define GFX_MAUER_R1 165 +#define GFX_MAUER_R 167 +#define GFX_MAUER_L1 168 +#define GFX_MAUER_L 170 +#define GFX_MAUER_LEBT 171 +#define GFX_SIEB2_LEER 172 +#define GFX_SIEB2_VOLL GFX_SIEB2_LEER +#define GFX_SIEB2_TOT GFX_SIEB2_LEER +/* Zeile 11 (176) */ +#define GFX_AUSGANG_ZU 176 +#define GFX_AUSGANG_ACT 177 +#define GFX_AUSGANG_AUF 180 +#define GFX_MAMPFER2 184 #define GFX_SCHLUESSEL GFX_SCHLUESSEL1 diff --git a/src/screens.c b/src/screens.c index 5246fa82..f26a200b 100644 --- a/src/screens.c +++ b/src/screens.c @@ -118,15 +118,18 @@ void HandleMainMenu(int mx, int my, int dx, int dy, int button) { static long level_delay = 0; int step = (button==1 ? 1 : button==2 ? 5 : 10); + int new_level_nr, old_level_nr = level_nr; - if (!DelayReached(&level_delay,20)) + new_level_nr = level_nr + (x==11 ? -step : +step); + if (new_level_nr<0) + new_level_nr = 0; + if (new_level_nr>LEVELDIR_SIZE(leveldir[leveldir_nr])-1) + new_level_nr = LEVELDIR_SIZE(leveldir[leveldir_nr])-1; + + if (old_level_nr==new_level_nr || !DelayReached(&level_delay,20)) goto out; - level_nr += (x==11 ? -step : +step); - if (level_nr<0) - level_nr = 0; - if (level_nr>LEVELDIR_SIZE(leveldir[leveldir_nr])-1) - level_nr = LEVELDIR_SIZE(leveldir[leveldir_nr])-1; + level_nr = new_level_nr; if (level_nr>player.handicap && level_nr