}
break;
- case EL_DYNAMIT:
+ case EL_DYNAMITE_ACTIVE:
MovDelay[x][y] = 96;
break;
player->dynamite = 0;
player->dynabomb_count = 0;
- player->dynabomb_size = 0;
+ player->dynabomb_size = 1;
player->dynabombs_left = 0;
player->dynabomb_xl = FALSE;
if (Store[x][y])
DrawGraphic(sx, sy, el2gfx(Store[x][y]));
- if (Feld[x][y] == EL_DYNAMIT)
+ if (Feld[x][y] == EL_DYNAMITE_ACTIVE)
{
if ((phase = (96 - MovDelay[x][y]) / 12) > 6)
phase = 6;
if (!(MovDelay[x][y] % 12))
PlaySoundLevel(x, y, SND_ZISCH);
- if (Feld[x][y] == EL_DYNAMIT && !(MovDelay[x][y] % 12))
- DrawDynamite(x, y);
- else if (Feld[x][y] == EL_DYNABOMB && !(MovDelay[x][y] % 6))
- DrawDynamite(x, y);
+ if (IS_ACTIVE_BOMB(Feld[x][y]))
+ {
+ int delay = (Feld[x][y] == EL_DYNAMITE_ACTIVE ? 12 : 6);
+
+ if (!(MovDelay[x][y] % delay))
+ DrawDynamite(x, y);
+ }
return;
}
if (!IN_LEV_FIELD(x, y) || IS_MASSIVE(element) || element == EL_BURNING)
continue;
- if ((mode!=EX_NORMAL || center_element == EL_AMOEBA2DIAM) &&
- (x!=ex || y!=ey))
+ if ((mode != EX_NORMAL || center_element == EL_AMOEBA2DIAM) &&
+ (x != ex || y != ey))
continue;
if (element == EL_EXPLODING)
void DynaExplode(int ex, int ey)
{
int i, j;
- struct PlayerInfo *player = &stored_player[Store2[ex][ey] - EL_SPIELER1];
+ int dynabomb_size = 1;
+ boolean dynabomb_xl = FALSE;
+ struct PlayerInfo *player;
static int xy[4][2] =
{
{ 0, -1 },
{ 0, +1 }
};
- Store2[ex][ey] = 0; /* delete player information */
+ if (IS_ACTIVE_BOMB(Feld[ex][ey]))
+ {
+ player = &stored_player[Feld[ex][ey] - EL_DYNABOMB_ACTIVE_1];
+ dynabomb_size = player->dynabomb_size;
+ dynabomb_xl = player->dynabomb_xl;
+ player->dynabombs_left++;
+ }
Explode(ex, ey, EX_PHASE_START, EX_CENTER);
for (i=0; i<4; i++)
{
- for (j=1; j<=player->dynabomb_size; j++)
+ for (j=1; j<=dynabomb_size; j++)
{
- int x = ex+j*xy[i%4][0];
- int y = ey+j*xy[i%4][1];
+ int x = ex + j * xy[i % 4][0];
+ int y = ey + j * xy[i % 4][1];
int element;
if (!IN_LEV_FIELD(x, y) || IS_MASSIVE(Feld[x][y]))
if (element != EL_LEERRAUM &&
element != EL_ERDREICH &&
element != EL_EXPLODING &&
- !player->dynabomb_xl)
+ !dynabomb_xl)
break;
}
}
-
- player->dynabombs_left++;
}
void Bang(int x, int y)
RaiseScoreElement(element);
Explode(x, y, EX_PHASE_START, EX_NORMAL);
break;
- case EL_DYNABOMB:
+ case EL_DYNABOMB_ACTIVE_1:
+ case EL_DYNABOMB_ACTIVE_2:
+ case EL_DYNABOMB_ACTIVE_3:
+ case EL_DYNABOMB_ACTIVE_4:
case EL_DYNABOMB_NR:
case EL_DYNABOMB_SZ:
case EL_DYNABOMB_XL:
}
else if (IS_MOVING(x, y))
ContinueMoving(x, y);
- else if (element == EL_DYNAMIT || element == EL_DYNABOMB)
+ else if (IS_ACTIVE_BOMB(element))
CheckDynamite(x, y);
else if (element == EL_EXPLODING)
Explode(x, y, Frame[x][y], EX_NORMAL);
PlaySoundLevel(x, y, SND_PONG);
break;
- case EL_DYNAMIT_AUS:
+ case EL_DYNAMITE_INACTIVE:
case EL_SP_DISK_RED:
RemoveField(x, y);
player->dynamite++;
- RaiseScoreElement(EL_DYNAMIT);
+ RaiseScoreElement(EL_DYNAMITE_INACTIVE);
DrawText(DX_DYNAMITE, DY_DYNAMITE,
int2str(local_player->dynamite, 3),
FS_SMALL, FC_YELLOW);
RemoveField(x, y);
player->dynabomb_count++;
player->dynabombs_left++;
- RaiseScoreElement(EL_DYNAMIT);
+ RaiseScoreElement(EL_DYNAMITE_INACTIVE);
PlaySoundLevel(x, y, SND_PONG);
break;
case EL_DYNABOMB_SZ:
RemoveField(x, y);
player->dynabomb_size++;
- RaiseScoreElement(EL_DYNAMIT);
+ RaiseScoreElement(EL_DYNAMITE_INACTIVE);
PlaySoundLevel(x, y, SND_PONG);
break;
case EL_DYNABOMB_XL:
RemoveField(x, y);
player->dynabomb_xl = TRUE;
- RaiseScoreElement(EL_DYNAMIT);
+ RaiseScoreElement(EL_DYNAMITE_INACTIVE);
PlaySoundLevel(x, y, SND_PONG);
break;
element = Feld[jx][jy];
if ((player->dynamite == 0 && player->dynabombs_left == 0) ||
- element == EL_DYNAMIT || element == EL_DYNABOMB ||
- element == EL_EXPLODING)
+ IS_ACTIVE_BOMB(element) || element == EL_EXPLODING)
return FALSE;
if (element != EL_LEERRAUM)
if (player->dynamite)
{
- Feld[jx][jy] = EL_DYNAMIT;
+ Feld[jx][jy] = EL_DYNAMITE_ACTIVE;
MovDelay[jx][jy] = 96;
player->dynamite--;
DrawText(DX_DYNAMITE, DY_DYNAMITE, int2str(local_player->dynamite, 3),
}
else
{
- Feld[jx][jy] = EL_DYNABOMB;
- Store2[jx][jy] = player->element_nr; /* for DynaExplode() */
+ Feld[jx][jy] = EL_DYNABOMB_ACTIVE_1 + (player->element_nr - EL_SPIELER1);
MovDelay[jx][jy] = 96;
player->dynabombs_left--;
if (IN_SCR_FIELD(SCREENX(jx), SCREENY(jy)))
case EL_KOKOSNUSS:
RaiseScore(level.score[SC_KOKOSNUSS]);
break;
- case EL_DYNAMIT:
+ case EL_DYNAMITE_INACTIVE:
RaiseScore(level.score[SC_DYNAMIT]);
break;
case EL_SCHLUESSEL:
#define EP_BIT_SP_ELEMENT (1 << 28)
#define EP_BIT_QUICK_GATE (1 << 29)
#define EP_BIT_OVER_PLAYER (1 << 30)
+#define EP_BIT_ACTIVE_BOMB (1 << 31)
#define IS_AMOEBALIVE(e) (Elementeigenschaften[e] & EP_BIT_AMOEBALIVE)
#define IS_AMOEBOID(e) (Elementeigenschaften[e] & EP_BIT_AMOEBOID)
#define IS_SP_ELEMENT(e) (Elementeigenschaften[e] & EP_BIT_SP_ELEMENT)
#define IS_QUICK_GATE(e) (Elementeigenschaften[e] & EP_BIT_QUICK_GATE)
#define IS_OVER_PLAYER(e) (Elementeigenschaften[e] & EP_BIT_OVER_PLAYER)
+#define IS_ACTIVE_BOMB(e) (Elementeigenschaften[e] & EP_BIT_ACTIVE_BOMB)
#define IS_PLAYER(x,y) (ELEM_IS_PLAYER(StorePlayer[x][y]))
#define EL_KOKOSNUSS 25
#define EL_LIFE 26
#define EL_LIFE_ASYNC 27
-#define EL_DYNAMIT 28
+#define EL_DYNAMITE_ACTIVE 28
#define EL_BADEWANNE 29
#define EL_ABLENK_AUS 30
#define EL_ABLENK_EIN 31
#define EL_PFORTE2X 41
#define EL_PFORTE3X 42
#define EL_PFORTE4X 43
-#define EL_DYNAMIT_AUS 44
+#define EL_DYNAMITE_INACTIVE 44
#define EL_PACMAN 45
#define EL_UNSICHTBAR 46
#define EL_BIRNE_AUS 47
#define EL_MAMPFER2 60
#define EL_SIEB2_INAKTIV 61
#define EL_INVISIBLE_STEEL 62
-#define EL_DYNABOMB 63
+
+#define EL_UNUSED_63 63
+
#define EL_DYNABOMB_NR 64
#define EL_DYNABOMB_SZ 65
#define EL_DYNABOMB_XL 66
#define EL_EM_KEY_2 310
#define EL_EM_KEY_3 311
#define EL_EM_KEY_4 312
+#define EL_DYNABOMB_ACTIVE_1 313
+#define EL_DYNABOMB_ACTIVE_2 314
+#define EL_DYNABOMB_ACTIVE_3 315
+#define EL_DYNABOMB_ACTIVE_4 316
/* "unreal" (and therefore not drawable) runtime elements */
#define EL_BLOCKED 400
DrawLevelElement(last_jx, last_jy, Store[last_jx][last_jy]);
DrawLevelFieldThruMask(last_jx, last_jy);
}
- else if (last_element == EL_DYNAMIT)
+ else if (last_element == EL_DYNAMITE_ACTIVE)
DrawDynamite(last_jx, last_jy);
else
DrawLevelField(last_jx, last_jy);
if (Store[jx][jy])
DrawLevelElement(jx, jy, Store[jx][jy]);
- else if (element != EL_DYNAMIT && element != EL_DYNABOMB)
+ else if (!IS_ACTIVE_BOMB(element))
DrawLevelField(jx, jy);
/* draw player himself */
}
}
- /* draw things in front of player (EL_DYNAMIT or EL_DYNABOMB) */
+ /* draw things in front of player (active dynamite or dynabombs) */
- if (element == EL_DYNAMIT || element == EL_DYNABOMB)
+ if (IS_ACTIVE_BOMB(element))
{
graphic = el2gfx(element);
- if (element == EL_DYNAMIT)
+ if (element == EL_DYNAMITE_ACTIVE)
{
if ((phase = (96 - MovDelay[jx][jy]) / 12) > 6)
phase = 6;
case EL_KOKOSNUSS: return GFX_KOKOSNUSS;
case EL_LIFE: return GFX_LIFE;
case EL_LIFE_ASYNC: return GFX_LIFE_ASYNC;
- case EL_DYNAMIT: return GFX_DYNAMIT;
+ case EL_DYNAMITE_ACTIVE: return GFX_DYNAMIT;
case EL_BADEWANNE: return GFX_BADEWANNE;
case EL_BADEWANNE1: return GFX_BADEWANNE1;
case EL_BADEWANNE2: return GFX_BADEWANNE2;
case EL_PFORTE2X: return GFX_PFORTE2X;
case EL_PFORTE3X: return GFX_PFORTE3X;
case EL_PFORTE4X: return GFX_PFORTE4X;
- case EL_DYNAMIT_AUS: return GFX_DYNAMIT_AUS;
+ case EL_DYNAMITE_INACTIVE: return GFX_DYNAMIT_AUS;
case EL_PACMAN: return GFX_PACMAN;
case EL_PACMAN_R: return GFX_PACMAN_R;
case EL_PACMAN_O: return GFX_PACMAN_O;
case EL_SIEB2_LEER: return GFX_SIEB2_LEER;
case EL_SIEB2_VOLL: return GFX_SIEB2_VOLL;
case EL_SIEB2_TOT: return GFX_SIEB2_TOT;
- case EL_DYNABOMB: return GFX_DYNABOMB;
+ case EL_DYNABOMB_ACTIVE_1: return GFX_DYNABOMB;
+ case EL_DYNABOMB_ACTIVE_2: return GFX_DYNABOMB;
+ case EL_DYNABOMB_ACTIVE_3: return GFX_DYNABOMB;
+ case EL_DYNABOMB_ACTIVE_4: return GFX_DYNABOMB;
case EL_DYNABOMB_NR: return GFX_DYNABOMB_NR;
case EL_DYNABOMB_SZ: return GFX_DYNABOMB_SZ;
case EL_DYNABOMB_XL: return GFX_DYNABOMB_XL;