EL_ERDREICH,
EL_BETON,
- EL_FELSBODEN,
+ EL_BD_WALL,
EL_SIEB2_INAKTIV,
EL_AUSGANG_ZU,
EL_AUSGANG_AUF,
EL_EDELSTEIN_BD,
EL_BUTTERFLY_UP,
EL_FIREFLY_UP,
- EL_FELSBROCKEN,
+ EL_BD_ROCK,
EL_BUTTERFLY_LEFT,
EL_FIREFLY_LEFT,
EL_TUBE_LEFT_UP,
EL_TRAP_INACTIVE,
- EL_LEERRAUM,
+ EL_DX_SUPABOMB,
EL_LEERRAUM,
EL_LEERRAUM,
}
}
+static int checkLevelElement(int element)
+{
+ if (element >= EL_FIRST_RUNTIME_EL)
+ {
+ Error(ERR_WARN, "invalid level element %d", element);
+ element = EL_CHAR_FRAGE;
+ }
+
+ return element;
+}
+
void LoadLevel(int level_nr)
{
int i, x, y;
for(x=0; x<3; x++)
{
if (i < STD_ELEMENT_CONTENTS)
- level.yam_content[i][x][y] = fgetc(file);
+ level.yam_content[i][x][y] = checkLevelElement(fgetc(file));
else
level.yam_content[i][x][y] = EL_LEERRAUM;
}
level.amoeba_speed = fgetc(file);
level.time_magic_wall = fgetc(file);
level.time_wheel = fgetc(file);
- level.amoeba_content = fgetc(file);
+ level.amoeba_content = checkLevelElement(fgetc(file));
level.double_speed = (fgetc(file) == 1 ? TRUE : FALSE);
level.gravity = (fgetc(file) == 1 ? TRUE : FALSE);
for(y=0; y<3; y++)
for(x=0; x<3; x++)
level.yam_content[i][x][y] =
- (encoding_16bit ?
- getFile16BitInteger(file, BYTE_ORDER_BIG_ENDIAN) :
- fgetc(file));
+ checkLevelElement(encoding_16bit ?
+ getFile16BitInteger(file,
+ BYTE_ORDER_BIG_ENDIAN) :
+ fgetc(file));
getFileChunk(file, chunk, &chunk_length, BYTE_ORDER_BIG_ENDIAN);
}
for(y=0; y<lev_fieldy; y++)
for(x=0; x<lev_fieldx; x++)
Feld[x][y] = Ur[x][y] =
- (encoding_16bit ?
- getFile16BitInteger(file, BYTE_ORDER_BIG_ENDIAN) :
- fgetc(file));
+ checkLevelElement(encoding_16bit ?
+ getFile16BitInteger(file, BYTE_ORDER_BIG_ENDIAN) :
+ fgetc(file));
fclose(file);
return;
}
- if ((element == EL_BOMBE || element == EL_SP_DISK_ORANGE) &&
+ if ((element == EL_BOMBE ||
+ element == EL_SP_DISK_ORANGE ||
+ element == EL_DX_SUPABOMB) &&
(lastline || object_hit)) /* element is bomb */
{
Bang(x, y);
return;
}
}
- else if (element == EL_FELSBROCKEN || element == EL_SP_ZONK)
+ else if (element == EL_FELSBROCKEN ||
+ element == EL_SP_ZONK ||
+ element == EL_BD_ROCK)
{
if (IS_ENEMY(smashed) ||
smashed == EL_BOMBE || smashed == EL_SP_DISK_ORANGE ||
+ smashed == EL_DX_SUPABOMB ||
smashed == EL_SONDE || smashed == EL_SCHWEIN ||
smashed == EL_DRACHE || smashed == EL_MOLE)
{
sound = SND_KLUMPF;
break;
case EL_FELSBROCKEN:
+ case EL_BD_ROCK:
sound = SND_KLOPF;
break;
case EL_SP_ZONK:
MovDir[x][y] = game.balloon_dir;
MovDelay[x][y] = 0;
}
+ else if (element == EL_SPRING_MOVING)
+ {
+ if (!IN_LEV_FIELD(move_x, move_y) || !IS_FREE(move_x, move_y) ||
+ (IN_LEV_FIELD(x, y+1) && IS_FREE(x, y+1)))
+ {
+ Feld[x][y] = EL_SPRING;
+ MovDir[x][y] = MV_NO_MOVING;
+ }
+ MovDelay[x][y] = 0;
+ }
else if (element == EL_ROBOT || element == EL_SONDE || element == EL_PINGUIN)
{
int attr_x = -1, attr_y = -1;
Feld[x][y+1] = EL_MORAST_VOLL;
}
}
- else if (element == EL_FELSBROCKEN && Feld[x][y+1] == EL_MORAST_LEER)
+ else if ((element == EL_FELSBROCKEN || element == EL_BD_ROCK) &&
+ Feld[x][y+1] == EL_MORAST_LEER)
{
InitMovingField(x, y, MV_DOWN);
Store[x][y] = EL_MORAST_VOLL;
else if (IS_SLIPPERY(Feld[x][y+1]) && !Store[x][y+1])
#else
else if (IS_SLIPPERY(Feld[x][y+1]) && !Store[x][y+1] &&
- !IS_FALLING(x, y+1) && !JustStopped[x][y+1])
+ !IS_FALLING(x, y+1) && !JustStopped[x][y+1] &&
+ element != EL_DX_SUPABOMB)
#endif
{
boolean left = (x>0 && IS_FREE(x-1, y) &&
if (left || right)
{
- if (left && right && game.emulation != EMU_BOULDERDASH)
+ if (left && right &&
+ (game.emulation != EMU_BOULDERDASH &&
+ element != EL_BD_ROCK && element != EL_EDELSTEIN_BD))
left = !(right = RND(2));
InitMovingField(x, y, left ? MV_LEFT : MV_RIGHT);
{
int newx, newy;
- if ((element == EL_SONDE || element == EL_BALLOON)
+ if ((element == EL_SONDE || element == EL_BALLOON ||
+ element == EL_SPRING_MOVING)
&& JustBeingPushed(x, y))
return;
else if (CAN_FALL(element) && horiz_move &&
y < lev_fieldy-1 && IS_BELT(Feld[x][y+1]))
step /= 2;
+ else if (element == EL_SPRING_MOVING)
+ step*=2;
#if OLD_GAME_BEHAVIOUR
else if (CAN_FALL(element) && horiz_move && !IS_SP_ELEMENT(element))
if (done)
PlaySoundLevel(ax, ay,
- (new_element == EL_FELSBROCKEN ? SND_KLOPF : SND_PLING));
+ (new_element == EL_BD_ROCK ? SND_KLOPF : SND_PLING));
}
void AmoebeWaechst(int x, int y)
if (element == EL_AMOEBE_BD && AmoebaCnt2[new_group_nr] >= 200)
{
- AmoebeUmwandelnBD(newax, neway, EL_FELSBROCKEN);
+ AmoebeUmwandelnBD(newax, neway, EL_BD_ROCK);
return;
}
}
{
int el = Feld[jx+dx][jy];
int push_delay = (IS_SB_ELEMENT(el) || el == EL_SONDE ? 2 :
- el == EL_BALLOON ? 0 : 10);
+ (el == EL_BALLOON || el == EL_SPRING) ? 0 : 10);
if (tape.delay_played + push_delay >= tape.pos[tape.counter].delay)
{
break;
case EL_FELSBROCKEN:
+ case EL_BD_ROCK:
case EL_BOMBE:
+ case EL_DX_SUPABOMB:
case EL_KOKOSNUSS:
case EL_ZEIT_LEER:
case EL_SP_ZONK:
case EL_SP_DISK_ORANGE:
+ case EL_SPRING:
if (dy || mode == DF_SNAP)
return MF_NO_ACTION;
if (player->push_delay == 0)
player->push_delay = FrameCounter;
if (!FrameReached(&player->push_delay, player->push_delay_value) &&
- !tape.playing)
+ !tape.playing && element != EL_SPRING)
return MF_NO_ACTION;
RemoveField(x, y);
Feld[x+dx][y+dy] = element;
- player->push_delay_value = 2+RND(8);
+ if (element == EL_SPRING)
+ {
+ Feld[x+dx][y+dy] = EL_SPRING_MOVING;
+ MovDir[x+dx][y+dy] = move_direction;
+ }
+
+ player->push_delay_value = (element == EL_SPRING ? 0 : 2 + RND(8));
DrawLevelField(x+dx, y+dy);
- if (element == EL_FELSBROCKEN)
+ if (element == EL_FELSBROCKEN || element == EL_BD_ROCK)
PlaySoundLevel(x+dx, y+dy, SND_PUSCH);
else if (element == EL_KOKOSNUSS)
PlaySoundLevel(x+dx, y+dy, SND_KNURK);
case EL_SONDE:
case EL_SP_DISK_YELLOW:
case EL_BALLOON:
- case EL_SPRING:
if (mode == DF_SNAP)
return MF_NO_ACTION;
EL_MAUER_X,
EL_MAUER_Y,
EL_MAUER_XY,
+ EL_BD_WALL,
EL_FELSBODEN,
EL_AUSGANG_ZU,
EL_AUSGANG_ACT,
static int ep_slippery[] =
{
EL_FELSBODEN,
+ EL_BD_WALL,
EL_FELSBROCKEN,
+ EL_BD_ROCK,
EL_EDELSTEIN,
EL_EDELSTEIN_BD,
EL_EDELSTEIN_GELB,
EL_MAUER_Y,
EL_MAUER_XY,
EL_MAUERND,
+ EL_BD_WALL,
EL_SP_CHIP_SINGLE,
EL_SP_CHIP_LEFT,
EL_SP_CHIP_RIGHT,
static int ep_can_fall[] =
{
EL_FELSBROCKEN,
+ EL_BD_ROCK,
EL_EDELSTEIN,
EL_EDELSTEIN_BD,
EL_EDELSTEIN_GELB,
EL_SP_DISK_ORANGE,
EL_PEARL,
EL_CRYSTAL,
- EL_SPRING
+ EL_SPRING,
+ EL_DX_SUPABOMB
};
static int ep_can_fall_num = sizeof(ep_can_fall)/sizeof(int);
static int ep_can_smash[] =
{
EL_FELSBROCKEN,
+ EL_BD_ROCK,
EL_EDELSTEIN,
EL_EDELSTEIN_BD,
EL_EDELSTEIN_GELB,
EL_SP_INFOTRON,
EL_SP_DISK_ORANGE,
EL_PEARL,
- EL_CRYSTAL
+ EL_CRYSTAL,
+ EL_SPRING,
+ EL_DX_SUPABOMB
};
static int ep_can_smash_num = sizeof(ep_can_smash)/sizeof(int);
static int ep_can_change[] =
{
EL_FELSBROCKEN,
+ EL_BD_ROCK,
EL_EDELSTEIN,
EL_EDELSTEIN_BD,
EL_EDELSTEIN_GELB,
EL_SONDE,
EL_SP_SNIKSNAK,
EL_SP_ELECTRON,
- EL_BALLOON
+ EL_BALLOON,
+ EL_SPRING_MOVING
};
static int ep_can_move_num = sizeof(ep_can_move)/sizeof(int);
EL_LEERRAUM,
EL_ERDREICH,
EL_FELSBODEN,
+ EL_BD_WALL,
EL_FELSBROCKEN,
+ EL_BD_ROCK,
EL_EDELSTEIN_BD,
EL_SIEB2_INAKTIV,
EL_AUSGANG_ZU,
EL_LEERRAUM,
EL_ERDREICH,
EL_MAUERWERK,
+ EL_BD_WALL,
EL_FELSBODEN,
EL_SCHLUESSEL,
EL_BETON,
EL_SP_DISK_ORANGE,
EL_SP_DISK_YELLOW,
EL_SP_SNIKSNAK,
- EL_SP_ELECTRON
+ EL_SP_ELECTRON,
+ EL_DX_SUPABOMB
};
static int ep_explosive_num = sizeof(ep_explosive)/sizeof(int);
static int ep_pushable[] =
{
EL_FELSBROCKEN,
+ EL_BD_ROCK,
EL_BOMBE,
EL_KOKOSNUSS,
EL_ZEIT_LEER,
EL_SP_DISK_ORANGE,
EL_SP_DISK_YELLOW,
EL_BALLOON,
- EL_SPRING
+ EL_SPRING,
+ EL_DX_SUPABOMB
};
static int ep_pushable_num = sizeof(ep_pushable)/sizeof(int);
"dark yam yam", /* 60 */
"magic wall (BD style)",
"invisible steel wall",
- "dynabomb",
+ "-",
"increases number of bombs",
"increases explosion size",
"increases power of explosion",
"unknown",
"unknown",
"unknown",
- "unknown",
- "unknown",
+ "normal wall (BD style)",
+ "rock (BD style)",
"open exit",
"unknown",
"amoeba",
"tube (right & down)",
"spring",
"trap",
+ "stable bomb (DX style)",
"-"
/*
#define IS_BLOCKED(x,y) (Feld[x][y] == EL_BLOCKED)
#define EL_CHANGED(e) ((e) == EL_FELSBROCKEN ? EL_EDELSTEIN : \
+ (e) == EL_BD_ROCK ? EL_EDELSTEIN_BD : \
(e) == EL_EDELSTEIN ? EL_DIAMANT : \
(e) == EL_EDELSTEIN_GELB ? EL_DIAMANT : \
(e) == EL_EDELSTEIN_ROT ? EL_DIAMANT : \
(e) == EL_EDELSTEIN_LILA ? EL_DIAMANT : \
EL_FELSBROCKEN)
#define EL_CHANGED2(e) ((e) == EL_FELSBROCKEN ? EL_EDELSTEIN_BD : \
- EL_FELSBROCKEN)
+ (e) == EL_BD_ROCK ? EL_EDELSTEIN_BD : \
+ EL_BD_ROCK)
#define IS_DRAWABLE(e) ((e) < EL_BLOCKED)
#define IS_NOT_DRAWABLE(e) ((e) >= EL_BLOCKED)
#define TAPE_IS_EMPTY(x) ((x).length == 0)
#define EL_BADEWANNE3 102
#define EL_BADEWANNE4 103
#define EL_BADEWANNE5 104
-
-#define EL_UNUSED_105 105
-#define EL_UNUSED_106 106
-
+#define EL_BD_WALL 105
+#define EL_BD_ROCK 106
#define EL_AUSGANG_AUF 107
-
#define EL_BLACK_ORB 108
-
#define EL_AMOEBA2DIAM 109
#define EL_MOLE 110
#define EL_PINGUIN 111
#define EL_TUBE_RIGHT_DOWN 354
#define EL_SPRING 355
#define EL_TRAP_INACTIVE 356
+#define EL_DX_SUPABOMB 357
/* "real" (and therefore drawable) runtime elements */
#define EL_FIRST_RUNTIME_EL 500
#define EL_TIMEGATE_CLOSING 520
#define EL_PEARL_BREAKING 521
#define EL_TRAP_ACTIVE 522
+#define EL_SPRING_MOVING 523
/* "unreal" (and therefore not drawable) runtime elements */
#define EL_BLOCKED 600
#define GFX_TRAP_INACTIVE (GFX_START_ROCKSMORE + 0 * MORE_PER_LINE + 4)
#define GFX_TRAP_ACTIVE (GFX_START_ROCKSMORE + 0 * MORE_PER_LINE + 7)
+#define GFX_BD_WALL (GFX_START_ROCKSMORE + 1 * MORE_PER_LINE + 4)
+#define GFX_BD_ROCK (GFX_START_ROCKSMORE + 2 * MORE_PER_LINE + 4)
+#define GFX_DX_SUPABOMB (GFX_START_ROCKSMORE + 1 * MORE_PER_LINE + 7)
/* graphics from "RocksFont" */
#define GFX_CHAR_START (GFX_START_ROCKSFONT)
int element = Feld[next_jx][next_jy];
int graphic = el2gfx(element);
- if ((element == EL_FELSBROCKEN || element == EL_SP_ZONK) && sxx)
+ if ((element == EL_FELSBROCKEN ||
+ element == EL_SP_ZONK ||
+ element == EL_BD_ROCK) && sxx)
{
int phase = (player->GfxPos / (TILEX / 4));
{
graphic += phase4;
}
- else if ((element == EL_FELSBROCKEN || element == EL_SP_ZONK ||
+ else if ((element == EL_FELSBROCKEN ||
+ element == EL_SP_ZONK ||
+ element == EL_BD_ROCK ||
IS_GEM(element)) && !cut_mode)
{
if (uy >= lev_fieldy-1 || !IS_BELT(Feld[ux][uy+1]))
{
- if (element == EL_FELSBROCKEN || element == EL_SP_ZONK)
+ if (element == EL_FELSBROCKEN ||
+ element == EL_SP_ZONK ||
+ element == EL_BD_ROCK)
{
if (dir == MV_LEFT)
graphic += (4 - phase4) % 4;
case EL_TUBE_RIGHT_UP: return GFX_TUBE_RIGHT_UP;
case EL_TUBE_RIGHT_DOWN: return GFX_TUBE_RIGHT_DOWN;
case EL_SPRING: return GFX_SPRING;
+ case EL_SPRING_MOVING: return GFX_SPRING;
case EL_TRAP_INACTIVE: return GFX_TRAP_INACTIVE;
case EL_TRAP_ACTIVE: return GFX_TRAP_ACTIVE;
+ case EL_BD_WALL: return GFX_BD_WALL;
+ case EL_BD_ROCK: return GFX_BD_ROCK;
+ case EL_DX_SUPABOMB: return GFX_DX_SUPABOMB;
default:
{