#define NUM_GAME_BUTTONS 6
/* forward declaration for internal use */
+static void InitBeltMovement(void);
static void CloseAllOpenTimegates(void);
static void CheckGravityMovement(struct PlayerInfo *);
static void KillHeroUnlessProtected(int, int);
#define SND_ACTION_IMPACT 6
#define SND_ACTION_PUSHING 7
#define SND_ACTION_ACTIVATING 8
-#define SND_ACTION_BURNING 9
+#define SND_ACTION_ACTIVE 9
#define NUM_SND_ACTIONS 10
/* insert _all_ loop sound actions here */
{ ".waiting", SND_ACTION_WAITING, TRUE },
{ ".moving", SND_ACTION_MOVING, TRUE }, /* continuos moving */
- { ".running", SND_ACTION_UNKNOWN, TRUE },
- { ".burning", SND_ACTION_BURNING, TRUE },
+ { ".active", SND_ACTION_ACTIVE, TRUE },
{ ".growing", SND_ACTION_UNKNOWN, TRUE },
{ ".attacking", SND_ACTION_UNKNOWN, TRUE },
- { ".activated", SND_ACTION_UNKNOWN, TRUE },
/* other (non-loop) sound actions are optional */
{ ".stepping", SND_ACTION_MOVING, FALSE }, /* discrete moving */
{ ".activating", SND_ACTION_ACTIVATING, FALSE },
{ NULL, 0, 0 },
};
-static int element_action_sound[NUM_LEVEL_ELEMENTS][NUM_SND_ACTIONS];
+static int element_action_sound[MAX_NUM_ELEMENTS][NUM_SND_ACTIONS];
static boolean is_loop_sound[NUM_SOUND_FILES];
#define IS_LOOP_SOUND(x) (is_loop_sound[x])
InitJoysticks();
}
-static int getBeltNrFromElement(int element)
+static int getBeltNrFromBeltElement(int element)
{
- return (element < EL_BELT2_LEFT ? 0 :
- element < EL_BELT3_LEFT ? 1 :
- element < EL_BELT4_LEFT ? 2 : 3);
+ return (element < EL_CONVEYOR_BELT2_LEFT ? 0 :
+ element < EL_CONVEYOR_BELT3_LEFT ? 1 :
+ element < EL_CONVEYOR_BELT4_LEFT ? 2 : 3);
}
-static int getBeltNrFromSwitchElement(int element)
+static int getBeltNrFromBeltActiveElement(int element)
{
- return (element < EL_BELT2_SWITCH_LEFT ? 0 :
- element < EL_BELT3_SWITCH_LEFT ? 1 :
- element < EL_BELT4_SWITCH_LEFT ? 2 : 3);
+ return (element < EL_CONVEYOR_BELT2_LEFT_ACTIVE ? 0 :
+ element < EL_CONVEYOR_BELT3_LEFT_ACTIVE ? 1 :
+ element < EL_CONVEYOR_BELT4_LEFT_ACTIVE ? 2 : 3);
}
-static int getBeltDirNrFromSwitchElement(int element)
+static int getBeltNrFromBeltSwitchElement(int element)
+{
+ return (element < EL_CONVEYOR_BELT2_SWITCH_LEFT ? 0 :
+ element < EL_CONVEYOR_BELT3_SWITCH_LEFT ? 1 :
+ element < EL_CONVEYOR_BELT4_SWITCH_LEFT ? 2 : 3);
+}
+
+static int getBeltDirNrFromBeltSwitchElement(int element)
{
static int belt_base_element[4] =
{
- EL_BELT1_SWITCH_LEFT,
- EL_BELT2_SWITCH_LEFT,
- EL_BELT3_SWITCH_LEFT,
- EL_BELT4_SWITCH_LEFT
+ EL_CONVEYOR_BELT1_SWITCH_LEFT,
+ EL_CONVEYOR_BELT2_SWITCH_LEFT,
+ EL_CONVEYOR_BELT3_SWITCH_LEFT,
+ EL_CONVEYOR_BELT4_SWITCH_LEFT
};
- int belt_nr = getBeltNrFromSwitchElement(element);
+ int belt_nr = getBeltNrFromBeltSwitchElement(element);
int belt_dir_nr = element - belt_base_element[belt_nr];
return (belt_dir_nr % 3);
}
-static int getBeltDirFromSwitchElement(int element)
+static int getBeltDirFromBeltSwitchElement(int element)
{
static int belt_move_dir[3] =
{
MV_RIGHT
};
- int belt_dir_nr = getBeltDirNrFromSwitchElement(element);
+ int belt_dir_nr = getBeltDirNrFromBeltSwitchElement(element);
return belt_move_dir[belt_dir_nr];
}
Feld[x][y] = EL_SP_MURPHY_CLONE;
break;
}
+
+ Feld[x][y] = EL_PLAYER1;
}
/* no break! */
- case EL_SPIELFIGUR:
- if (init_game)
- Feld[x][y] = EL_SPIELER1;
- /* no break! */
- case EL_SPIELER1:
- case EL_SPIELER2:
- case EL_SPIELER3:
- case EL_SPIELER4:
+ case EL_PLAYER1:
+ case EL_PLAYER2:
+ case EL_PLAYER3:
+ case EL_PLAYER4:
if (init_game)
{
- struct PlayerInfo *player = &stored_player[Feld[x][y] - EL_SPIELER1];
+ struct PlayerInfo *player = &stored_player[Feld[x][y] - EL_PLAYER1];
int jx = player->jx, jy = player->jy;
player->present = TRUE;
}
}
- Feld[x][y] = EL_LEERRAUM;
+ Feld[x][y] = EL_EMPTY;
player->jx = player->last_jx = x;
player->jy = player->last_jy = y;
}
break;
- case EL_BADEWANNE:
- if (x < lev_fieldx-1 && Feld[x+1][y] == EL_SALZSAEURE)
- Feld[x][y] = EL_BADEWANNE1;
- else if (x > 0 && Feld[x-1][y] == EL_SALZSAEURE)
- Feld[x][y] = EL_BADEWANNE2;
- else if (y > 0 && Feld[x][y-1] == EL_BADEWANNE1)
- Feld[x][y] = EL_BADEWANNE3;
- else if (y > 0 && Feld[x][y-1] == EL_SALZSAEURE)
- Feld[x][y] = EL_BADEWANNE4;
- else if (y > 0 && Feld[x][y-1] == EL_BADEWANNE2)
- Feld[x][y] = EL_BADEWANNE5;
+ case EL_STONEBLOCK:
+ if (x < lev_fieldx-1 && Feld[x+1][y] == EL_ACID)
+ Feld[x][y] = EL_ACIDPOOL_TOPLEFT;
+ else if (x > 0 && Feld[x-1][y] == EL_ACID)
+ Feld[x][y] = EL_ACIDPOOL_TOPRIGHT;
+ else if (y > 0 && Feld[x][y-1] == EL_ACIDPOOL_TOPLEFT)
+ Feld[x][y] = EL_ACIDPOOL_BOTTOMLEFT;
+ else if (y > 0 && Feld[x][y-1] == EL_ACID)
+ Feld[x][y] = EL_ACIDPOOL_BOTTOM;
+ else if (y > 0 && Feld[x][y-1] == EL_ACIDPOOL_TOPRIGHT)
+ Feld[x][y] = EL_ACIDPOOL_BOTTOMRIGHT;
break;
- case EL_KAEFER_RIGHT:
- case EL_KAEFER_UP:
- case EL_KAEFER_LEFT:
- case EL_KAEFER_DOWN:
- case EL_KAEFER:
- case EL_FLIEGER_RIGHT:
- case EL_FLIEGER_UP:
- case EL_FLIEGER_LEFT:
- case EL_FLIEGER_DOWN:
- case EL_FLIEGER:
- case EL_BUTTERFLY_RIGHT:
- case EL_BUTTERFLY_UP:
- case EL_BUTTERFLY_LEFT:
- case EL_BUTTERFLY_DOWN:
- case EL_BUTTERFLY:
- case EL_FIREFLY_RIGHT:
- case EL_FIREFLY_UP:
- case EL_FIREFLY_LEFT:
- case EL_FIREFLY_DOWN:
- case EL_FIREFLY:
+ case EL_BUG_RIGHT:
+ case EL_BUG_UP:
+ case EL_BUG_LEFT:
+ case EL_BUG_DOWN:
+ case EL_BUG:
+ case EL_SPACESHIP_RIGHT:
+ case EL_SPACESHIP_UP:
+ case EL_SPACESHIP_LEFT:
+ case EL_SPACESHIP_DOWN:
+ case EL_SPACESHIP:
+ case EL_BD_BUTTERFLY_RIGHT:
+ case EL_BD_BUTTERFLY_UP:
+ case EL_BD_BUTTERFLY_LEFT:
+ case EL_BD_BUTTERFLY_DOWN:
+ case EL_BD_BUTTERFLY:
+ case EL_BD_FIREFLY_RIGHT:
+ case EL_BD_FIREFLY_UP:
+ case EL_BD_FIREFLY_LEFT:
+ case EL_BD_FIREFLY_DOWN:
+ case EL_BD_FIREFLY:
case EL_PACMAN_RIGHT:
case EL_PACMAN_UP:
case EL_PACMAN_LEFT:
case EL_PACMAN_DOWN:
- case EL_MAMPFER:
- case EL_MAMPFER2:
+ case EL_YAMYAM:
+ case EL_DARK_YAMYAM:
case EL_ROBOT:
case EL_PACMAN:
case EL_SP_SNIKSNAK:
InitMovDir(x, y);
break;
- case EL_AMOEBE_VOLL:
- case EL_AMOEBE_BD:
+ case EL_AMOEBA_FULL:
+ case EL_BD_AMOEBA:
InitAmoebaNr(x, y);
break;
- case EL_TROPFEN:
+ case EL_AMOEBA_DROP:
if (y == lev_fieldy - 1)
{
- Feld[x][y] = EL_AMOEBING;
- Store[x][y] = EL_AMOEBE_NASS;
+ Feld[x][y] = EL_AMOEBA_CREATING;
+ Store[x][y] = EL_AMOEBA_WET;
}
break;
MovDelay[x][y] = 96;
break;
- case EL_BIRNE_AUS:
+ case EL_LAMP:
local_player->lights_still_needed++;
break;
- case EL_SOKOBAN_FELD_LEER:
+ case EL_SOKOBAN_FIELD_EMPTY:
local_player->sokobanfields_still_needed++;
break;
- case EL_PINGUIN:
+ case EL_PENGUIN:
local_player->friends_still_needed++;
break;
- case EL_SCHWEIN:
- case EL_DRACHE:
+ case EL_PIG:
+ case EL_DRAGON:
MovDir[x][y] = 1 << RND(4);
break;
case EL_SP_EMPTY:
- Feld[x][y] = EL_LEERRAUM;
+ Feld[x][y] = EL_EMPTY;
break;
- case EL_EM_KEY_1_FILE:
- Feld[x][y] = EL_EM_KEY_1;
+ case EL_EM_KEY1_FILE:
+ Feld[x][y] = EL_EM_KEY1;
break;
- case EL_EM_KEY_2_FILE:
- Feld[x][y] = EL_EM_KEY_2;
+ case EL_EM_KEY2_FILE:
+ Feld[x][y] = EL_EM_KEY2;
break;
- case EL_EM_KEY_3_FILE:
- Feld[x][y] = EL_EM_KEY_3;
+ case EL_EM_KEY3_FILE:
+ Feld[x][y] = EL_EM_KEY3;
break;
- case EL_EM_KEY_4_FILE:
- Feld[x][y] = EL_EM_KEY_4;
+ case EL_EM_KEY4_FILE:
+ Feld[x][y] = EL_EM_KEY4;
break;
- case EL_BELT1_SWITCH_LEFT:
- case EL_BELT1_SWITCH_MIDDLE:
- case EL_BELT1_SWITCH_RIGHT:
- case EL_BELT2_SWITCH_LEFT:
- case EL_BELT2_SWITCH_MIDDLE:
- case EL_BELT2_SWITCH_RIGHT:
- case EL_BELT3_SWITCH_LEFT:
- case EL_BELT3_SWITCH_MIDDLE:
- case EL_BELT3_SWITCH_RIGHT:
- case EL_BELT4_SWITCH_LEFT:
- case EL_BELT4_SWITCH_MIDDLE:
- case EL_BELT4_SWITCH_RIGHT:
+ case EL_CONVEYOR_BELT1_SWITCH_LEFT:
+ case EL_CONVEYOR_BELT1_SWITCH_MIDDLE:
+ case EL_CONVEYOR_BELT1_SWITCH_RIGHT:
+ case EL_CONVEYOR_BELT2_SWITCH_LEFT:
+ case EL_CONVEYOR_BELT2_SWITCH_MIDDLE:
+ case EL_CONVEYOR_BELT2_SWITCH_RIGHT:
+ case EL_CONVEYOR_BELT3_SWITCH_LEFT:
+ case EL_CONVEYOR_BELT3_SWITCH_MIDDLE:
+ case EL_CONVEYOR_BELT3_SWITCH_RIGHT:
+ case EL_CONVEYOR_BELT4_SWITCH_LEFT:
+ case EL_CONVEYOR_BELT4_SWITCH_MIDDLE:
+ case EL_CONVEYOR_BELT4_SWITCH_RIGHT:
if (init_game)
{
- int belt_nr = getBeltNrFromSwitchElement(Feld[x][y]);
- int belt_dir = getBeltDirFromSwitchElement(Feld[x][y]);
- int belt_dir_nr = getBeltDirNrFromSwitchElement(Feld[x][y]);
+ int belt_nr = getBeltNrFromBeltSwitchElement(Feld[x][y]);
+ int belt_dir = getBeltDirFromBeltSwitchElement(Feld[x][y]);
+ int belt_dir_nr = getBeltDirNrFromBeltSwitchElement(Feld[x][y]);
if (game.belt_dir_nr[belt_nr] == 3) /* initial value */
{
}
break;
- case EL_SWITCHGATE_SWITCH_2: /* always start with same switch pos */
+ case EL_SWITCHGATE_SWITCH_DOWN: /* always start with same switch pos */
if (init_game)
- Feld[x][y] = EL_SWITCHGATE_SWITCH_1;
+ Feld[x][y] = EL_SWITCHGATE_SWITCH_UP;
break;
- case EL_LIGHT_SWITCH_ON:
+ case EL_LIGHT_SWITCH_ACTIVE:
if (init_game)
game.light_time_left = level.time_light * FRAMES_PER_SECOND;
break;
for (j=0; j<4; j++)
if (stored_player[i].key[j])
DrawMiniGraphicExt(drawto, DX_KEYS + j * MINI_TILEX, DY_KEYS,
- GFX_SCHLUESSEL1 + j);
+ IMG_KEY1 + j);
DrawText(DX + XX_EMERALDS, DY + YY_EMERALDS,
int2str(local_player->gems_still_needed, 3), FS_SMALL, FC_YELLOW);
debug_print_timestamp(0, NULL);
#endif
- for (i=0; i<NUM_SND_ACTIONS; i++)
- for (j=0; j<NUM_LEVEL_ELEMENTS; j++)
- element_action_sound[j][i] = -1;
+ for (i=0; i<MAX_NUM_ELEMENTS; i++)
+ for (j=0; j<NUM_SND_ACTIONS; j++)
+ element_action_sound[i][j] = -1;
for (i=0; i<NUM_SOUND_FILES; i++)
{
/* associate elements and some selected sound actions */
- for (j=0; j<NUM_LEVEL_ELEMENTS; j++)
+ for (j=0; j<MAX_NUM_ELEMENTS; j++)
{
if (element_info[j].sound_class_name)
{
#if 0
/* TEST ONLY */
{
- int element = EL_ERDREICH;
+ int element = EL_SAND;
int sound_action = SND_ACTION_DIGGING;
int j = 0;
{
static int ep_em_slippery_wall[] =
{
- EL_BETON,
- EL_MAUERWERK,
- EL_MAUER_LEBT,
- EL_MAUER_X,
- EL_MAUER_Y,
- EL_MAUER_XY
+ EL_STEELWALL,
+ EL_WALL,
+ EL_WALL_GROWING,
+ EL_WALL_GROWING_X,
+ EL_WALL_GROWING_Y,
+ EL_WALL_GROWING_XY
};
static int ep_em_slippery_wall_num = SIZEOF_ARRAY_INT(ep_em_slippery_wall);
~EP_BIT_EM_SLIPPERY_WALL;
}
- /* "EL_MAUERND" was not slippery for EM gems in version 2.0.1 */
+ /* "EL_WALL_GROWING_ACTIVE" wasn't slippery for EM gems in version 2.0.1 */
if (level.em_slippery_gems && game.engine_version > VERSION_IDENT(2,0,1))
- Elementeigenschaften2[EL_MAUERND] |= EP_BIT_EM_SLIPPERY_WALL;
+ Elementeigenschaften2[EL_WALL_GROWING_ACTIVE] |= EP_BIT_EM_SLIPPERY_WALL;
else
- Elementeigenschaften2[EL_MAUERND] &= ~EP_BIT_EM_SLIPPERY_WALL;
+ Elementeigenschaften2[EL_WALL_GROWING_ACTIVE] &=~EP_BIT_EM_SLIPPERY_WALL;
}
}
InitGameEngine();
+#if 0
#if DEBUG
#if USE_NEW_AMOEBA_CODE
printf("Using new amoeba code.\n");
#else
printf("Using old amoeba code.\n");
#endif
+#endif
#endif
/* don't play tapes over network */
struct PlayerInfo *player = &stored_player[i];
player->index_nr = i;
- player->element_nr = EL_SPIELER1 + i;
+ player->element_nr = EL_PLAYER1 + i;
player->present = FALSE;
player->active = FALSE;
player->last_jx = player->last_jy = 0;
player->jx = player->jy = 0;
- player->shield_passive_time_left = 0;
- player->shield_active_time_left = 0;
+ player->shield_normal_time_left = 0;
+ player->shield_deadly_time_left = 0;
DigField(player, 0, 0, 0, 0, DF_NO_PUSH);
SnapField(player, 0, 0);
MovPos[x][y] = MovDir[x][y] = MovDelay[x][y] = 0;
Store[x][y] = Store2[x][y] = StorePlayer[x][y] = 0;
Frame[x][y] = 0;
+ GfxAction[x][y] = GFX_ACTION_DEFAULT;
AmoebaNr[x][y] = 0;
JustStopped[x][y] = 0;
Stop[x][y] = FALSE;
}
}
+ InitBeltMovement();
+
game.emulation = (emulate_bd ? EMU_BOULDERDASH :
emulate_sb ? EMU_SOKOBAN :
emulate_sp ? EMU_SUPAPLEX : EMU_NONE);
player->active = FALSE;
StorePlayer[jx][jy] = 0;
- Feld[jx][jy] = EL_LEERRAUM;
+ Feld[jx][jy] = EL_EMPTY;
}
}
}
player->active = FALSE;
StorePlayer[jx][jy] = 0;
- Feld[jx][jy] = EL_LEERRAUM;
+ Feld[jx][jy] = EL_EMPTY;
}
}
}
}
}
- if (BorderElement == EL_LEERRAUM)
+ if (BorderElement == EL_EMPTY)
{
SBX_Left = 0;
SBX_Right = lev_fieldx - SCR_FIELDX;
redraw_mask |= REDRAW_FROM_BACKBUFFER;
/* copy default game door content to main double buffer */
- BlitBitmap(pix[PIX_DOOR], drawto,
+ BlitBitmap(new_graphic_info[IMG_MENU_DOOR].bitmap, drawto,
DOOR_GFX_PAGEX5, DOOR_GFX_PAGEY1, DXSIZE, DYSIZE, DX, DY);
if (level_nr < 100)
MapTapeButtons();
/* copy actual game door content to door double buffer for OpenDoor() */
- BlitBitmap(drawto, pix[PIX_DB_DOOR],
+ BlitBitmap(drawto, bitmap_db_door,
DX, DY, DXSIZE, DYSIZE, DOOR_GFX_PAGEX1, DOOR_GFX_PAGEY1);
OpenDoor(DOOR_OPEN_ALL);
switch(element)
{
- case EL_KAEFER_RIGHT:
- case EL_KAEFER_UP:
- case EL_KAEFER_LEFT:
- case EL_KAEFER_DOWN:
- Feld[x][y] = EL_KAEFER;
- MovDir[x][y] = direction[0][element - EL_KAEFER_RIGHT];
+ case EL_BUG_RIGHT:
+ case EL_BUG_UP:
+ case EL_BUG_LEFT:
+ case EL_BUG_DOWN:
+ Feld[x][y] = EL_BUG;
+ MovDir[x][y] = direction[0][element - EL_BUG_RIGHT];
break;
- case EL_FLIEGER_RIGHT:
- case EL_FLIEGER_UP:
- case EL_FLIEGER_LEFT:
- case EL_FLIEGER_DOWN:
- Feld[x][y] = EL_FLIEGER;
- MovDir[x][y] = direction[0][element - EL_FLIEGER_RIGHT];
+ case EL_SPACESHIP_RIGHT:
+ case EL_SPACESHIP_UP:
+ case EL_SPACESHIP_LEFT:
+ case EL_SPACESHIP_DOWN:
+ Feld[x][y] = EL_SPACESHIP;
+ MovDir[x][y] = direction[0][element - EL_SPACESHIP_RIGHT];
break;
- case EL_BUTTERFLY_RIGHT:
- case EL_BUTTERFLY_UP:
- case EL_BUTTERFLY_LEFT:
- case EL_BUTTERFLY_DOWN:
- Feld[x][y] = EL_BUTTERFLY;
- MovDir[x][y] = direction[0][element - EL_BUTTERFLY_RIGHT];
+ case EL_BD_BUTTERFLY_RIGHT:
+ case EL_BD_BUTTERFLY_UP:
+ case EL_BD_BUTTERFLY_LEFT:
+ case EL_BD_BUTTERFLY_DOWN:
+ Feld[x][y] = EL_BD_BUTTERFLY;
+ MovDir[x][y] = direction[0][element - EL_BD_BUTTERFLY_RIGHT];
break;
- case EL_FIREFLY_RIGHT:
- case EL_FIREFLY_UP:
- case EL_FIREFLY_LEFT:
- case EL_FIREFLY_DOWN:
- Feld[x][y] = EL_FIREFLY;
- MovDir[x][y] = direction[0][element - EL_FIREFLY_RIGHT];
+ case EL_BD_FIREFLY_RIGHT:
+ case EL_BD_FIREFLY_UP:
+ case EL_BD_FIREFLY_LEFT:
+ case EL_BD_FIREFLY_DOWN:
+ Feld[x][y] = EL_BD_FIREFLY;
+ MovDir[x][y] = direction[0][element - EL_BD_FIREFLY_RIGHT];
break;
case EL_PACMAN_RIGHT:
default:
MovDir[x][y] = 1 << RND(4);
- if (element != EL_KAEFER &&
- element != EL_FLIEGER &&
- element != EL_BUTTERFLY &&
- element != EL_FIREFLY)
+ if (element != EL_BUG &&
+ element != EL_SPACESHIP &&
+ element != EL_BD_BUTTERFLY &&
+ element != EL_BD_FIREFLY)
break;
for (i=0; i<4; i++)
if (!IN_LEV_FIELD(x1, y1) || !IS_FREE(x1, y1))
{
- if (element == EL_KAEFER || element == EL_BUTTERFLY)
+ if (element == EL_BUG || element == EL_BD_BUTTERFLY)
{
MovDir[x][y] = direction[0][i];
break;
}
- else if (element == EL_FLIEGER || element == EL_FIREFLY ||
+ else if (element == EL_SPACESHIP || element == EL_BD_FIREFLY ||
element == EL_SP_SNIKSNAK || element == EL_SP_ELECTRON)
{
MovDir[x][y] = direction[1][i];
if (local_player->MovPos)
return;
+ if (tape.playing && tape.auto_play)
+ tape.auto_play_level_solved = TRUE;
+
local_player->LevelSolved = FALSE;
PlaySoundStereo(SND_GAME_WINNING, SOUND_MAX_RIGHT);
void InitMovingField(int x, int y, int direction)
{
+ int element = Feld[x][y];
int newx = x + (direction == MV_LEFT ? -1 : direction == MV_RIGHT ? +1 : 0);
int newy = y + (direction == MV_UP ? -1 : direction == MV_DOWN ? +1 : 0);
MovDir[x][y] = direction;
MovDir[newx][newy] = direction;
- if (Feld[newx][newy] == EL_LEERRAUM)
+
+ if (Feld[newx][newy] == EL_EMPTY)
Feld[newx][newy] = EL_BLOCKED;
+
+ if (direction == MV_DOWN && CAN_FALL(element))
+ GfxAction[x][y] = GFX_ACTION_FALLING;
+ else
+ GfxAction[x][y] = GFX_ACTION_MOVING;
}
void Moving2Blocked(int x, int y, int *goes_to_x, int *goes_to_y)
static void RemoveField(int x, int y)
{
- Feld[x][y] = EL_LEERRAUM;
+ Feld[x][y] = EL_EMPTY;
MovPos[x][y] = 0;
MovDir[x][y] = 0;
MovDelay[x][y] = 0;
if (Feld[x][y] == EL_BLOCKED &&
(Feld[oldx][oldy] == EL_QUICKSAND_EMPTYING ||
Feld[oldx][oldy] == EL_MAGIC_WALL_EMPTYING ||
- Feld[oldx][oldy] == EL_MAGIC_WALL_BD_EMPTYING ||
+ Feld[oldx][oldy] == EL_BD_MAGIC_WALL_EMPTYING ||
Feld[oldx][oldy] == EL_AMOEBA_DRIPPING))
Feld[oldx][oldy] = get_next_element(Feld[oldx][oldy]);
else
- Feld[oldx][oldy] = EL_LEERRAUM;
+ Feld[oldx][oldy] = EL_EMPTY;
Store[oldx][oldy] = Store2[oldx][oldy] = 0;
- Feld[newx][newy] = EL_LEERRAUM;
+ Feld[newx][newy] = EL_EMPTY;
MovPos[oldx][oldy] = MovDir[oldx][oldy] = MovDelay[oldx][oldy] = 0;
MovPos[newx][newy] = MovDir[newx][newy] = MovDelay[newx][newy] = 0;
+ GfxAction[oldx][oldy] = GfxAction[newx][newy] = GFX_ACTION_DEFAULT;
DrawLevelField(oldx, oldy);
DrawLevelField(newx, newy);
void DrawDynamite(int x, int y)
{
int sx = SCREENX(x), sy = SCREENY(y);
- int graphic = el2gfx(Feld[x][y]);
- int phase;
+ int graphic = el2img(Feld[x][y]);
+ int frame;
if (!IN_SCR_FIELD(sx, sy) || IS_PLAYER(x, y))
return;
if (Store[x][y])
- DrawGraphic(sx, sy, el2gfx(Store[x][y]));
+ DrawGraphic(sx, sy, el2img(Store[x][y]), 0);
- if (Feld[x][y] == EL_DYNAMITE_ACTIVE)
- {
- if ((phase = (96 - MovDelay[x][y]) / 12) > 6)
- phase = 6;
- }
- else
- {
- if ((phase = ((96 - MovDelay[x][y]) / 6) % 8) > 3)
- phase = 7 - phase;
- }
+ frame = getGraphicAnimationFrame(graphic, 96 - MovDelay[x][y]);
+
+ /*
+ printf("-> %d: %d [%d]\n", graphic, frame, MovDelay[x][y]);
+ */
if (game.emulation == EMU_SUPAPLEX)
- DrawGraphic(sx, sy, GFX_SP_DISK_RED);
+ DrawGraphic(sx, sy, IMG_SP_DISK_RED, 0);
else if (Store[x][y])
- DrawGraphicThruMask(sx, sy, graphic + phase);
+ DrawGraphicThruMask(sx, sy, graphic, frame);
else
- DrawGraphic(sx, sy, graphic + phase);
+ DrawGraphic(sx, sy, graphic, frame);
}
void CheckDynamite(int x, int y)
if (MovDelay[x][y])
{
if (!(MovDelay[x][y] % 6))
- PlaySoundLevelAction(x, y, SND_ACTION_BURNING);
+ PlaySoundLevelAction(x, y, SND_ACTION_ACTIVE);
if (IS_ACTIVE_BOMB(Feld[x][y]))
{
}
if (Feld[x][y] == EL_DYNAMITE_ACTIVE)
- StopSound(SND_DYNAMITE_BURNING);
+ StopSound(SND_DYNAMITE_ACTIVE);
else
- StopSound(SND_DYNABOMB_BURNING);
+ StopSound(SND_DYNABOMB_ACTIVE);
Bang(x, y);
}
void Explode(int ex, int ey, int phase, int mode)
{
int x, y;
- int num_phase = 9, delay = (game.emulation == EMU_SUPAPLEX ? 3 : 2);
+ int num_phase = 9;
+ int delay = (game.emulation == EMU_SUPAPLEX ? 3 : 2);
int last_phase = num_phase * delay;
int half_phase = (num_phase / 2) * delay;
int first_phase_after_start = EX_PHASE_START + 1;
int element;
if (!IN_LEV_FIELD(x, y) ||
- ((mode != EX_NORMAL || center_element == EL_AMOEBA2DIAM) &&
+ ((mode != EX_NORMAL || center_element == EL_AMOEBA_TO_DIAMOND) &&
(x != ex || y != ey)))
continue;
RemoveMovingField(x, y);
}
- if (IS_MASSIVE(element) || element == EL_BURNING)
+ if (IS_MASSIVE(element) || element == EL_FLAMES)
continue;
if (IS_PLAYER(x, y) && SHIELD_ON(PLAYERINFO(x, y)))
if (IS_ACTIVE_BOMB(element))
{
/* re-activate things under the bomb like gate or penguin */
- Feld[x][y] = (Store[x][y] ? Store[x][y] : EL_LEERRAUM);
+ Feld[x][y] = (Store[x][y] ? Store[x][y] : EL_EMPTY);
Store[x][y] = 0;
}
continue;
}
- if (element == EL_EXPLODING)
+ if (element == EL_EXPLOSION)
element = Store2[x][y];
if (IS_PLAYER(ex, ey) && !PLAYER_PROTECTED(ex, ey))
{
switch(StorePlayer[ex][ey])
{
- case EL_SPIELER2:
- Store[x][y] = EL_EDELSTEIN_ROT;
+ case EL_PLAYER2:
+ Store[x][y] = EL_EMERALD_RED;
break;
- case EL_SPIELER3:
- Store[x][y] = EL_EDELSTEIN;
+ case EL_PLAYER3:
+ Store[x][y] = EL_EMERALD;
break;
- case EL_SPIELER4:
- Store[x][y] = EL_EDELSTEIN_LILA;
+ case EL_PLAYER4:
+ Store[x][y] = EL_EMERALD_PURPLE;
break;
- case EL_SPIELER1:
+ case EL_PLAYER1:
default:
- Store[x][y] = EL_EDELSTEIN_GELB;
+ Store[x][y] = EL_EMERALD_YELLOW;
break;
}
if (game.emulation == EMU_SUPAPLEX)
- Store[x][y] = EL_LEERRAUM;
+ Store[x][y] = EL_EMPTY;
}
else if (center_element == EL_MOLE)
- Store[x][y] = EL_EDELSTEIN_ROT;
- else if (center_element == EL_PINGUIN)
- Store[x][y] = EL_EDELSTEIN_LILA;
- else if (center_element == EL_KAEFER)
- Store[x][y] = ((x == ex && y == ey) ? EL_DIAMANT : EL_EDELSTEIN);
- else if (center_element == EL_BUTTERFLY)
- Store[x][y] = EL_EDELSTEIN_BD;
+ Store[x][y] = EL_EMERALD_RED;
+ else if (center_element == EL_PENGUIN)
+ Store[x][y] = EL_EMERALD_PURPLE;
+ else if (center_element == EL_BUG)
+ Store[x][y] = ((x == ex && y == ey) ? EL_DIAMOND : EL_EMERALD);
+ else if (center_element == EL_BD_BUTTERFLY)
+ Store[x][y] = EL_BD_DIAMOND;
else if (center_element == EL_SP_ELECTRON)
Store[x][y] = EL_SP_INFOTRON;
- else if (center_element == EL_MAMPFER)
+ else if (center_element == EL_YAMYAM)
Store[x][y] = level.yam_content[game.yam_content_nr][x-ex+1][y-ey+1];
- else if (center_element == EL_AMOEBA2DIAM)
+ else if (center_element == EL_AMOEBA_TO_DIAMOND)
Store[x][y] = level.amoeba_content;
- else if (element == EL_ERZ_EDEL)
- Store[x][y] = EL_EDELSTEIN;
- else if (element == EL_ERZ_DIAM)
- Store[x][y] = EL_DIAMANT;
- else if (element == EL_ERZ_EDEL_BD)
- Store[x][y] = EL_EDELSTEIN_BD;
- else if (element == EL_ERZ_EDEL_GELB)
- Store[x][y] = EL_EDELSTEIN_GELB;
- else if (element == EL_ERZ_EDEL_ROT)
- Store[x][y] = EL_EDELSTEIN_ROT;
- else if (element == EL_ERZ_EDEL_LILA)
- Store[x][y] = EL_EDELSTEIN_LILA;
+ else if (element == EL_WALL_EMERALD)
+ Store[x][y] = EL_EMERALD;
+ else if (element == EL_WALL_DIAMOND)
+ Store[x][y] = EL_DIAMOND;
+ else if (element == EL_WALL_BD_DIAMOND)
+ Store[x][y] = EL_BD_DIAMOND;
+ else if (element == EL_WALL_EMERALD_YELLOW)
+ Store[x][y] = EL_EMERALD_YELLOW;
+ else if (element == EL_WALL_EMERALD_RED)
+ Store[x][y] = EL_EMERALD_RED;
+ else if (element == EL_WALL_EMERALD_PURPLE)
+ Store[x][y] = EL_EMERALD_PURPLE;
else if (element == EL_WALL_PEARL)
Store[x][y] = EL_PEARL;
else if (element == EL_WALL_CRYSTAL)
Store[x][y] = EL_CRYSTAL;
else if (!IS_PFORTE(Store[x][y]))
- Store[x][y] = EL_LEERRAUM;
+ Store[x][y] = EL_EMPTY;
if (x != ex || y != ey ||
- center_element == EL_AMOEBA2DIAM || mode == EX_BORDER)
+ center_element == EL_AMOEBA_TO_DIAMOND || mode == EX_BORDER)
Store2[x][y] = element;
if (AmoebaNr[x][y] &&
- (element == EL_AMOEBE_VOLL ||
- element == EL_AMOEBE_BD ||
- element == EL_AMOEBING))
+ (element == EL_AMOEBA_FULL ||
+ element == EL_BD_AMOEBA ||
+ element == EL_AMOEBA_CREATING))
{
AmoebaCnt[AmoebaNr[x][y]]--;
AmoebaCnt2[AmoebaNr[x][y]]--;
}
- Feld[x][y] = EL_EXPLODING;
+ Feld[x][y] = EL_EXPLOSION;
MovDir[x][y] = MovPos[x][y] = 0;
AmoebaNr[x][y] = 0;
Frame[x][y] = 1;
Stop[x][y] = TRUE;
}
- if (center_element == EL_MAMPFER)
+ if (center_element == EL_YAMYAM)
game.yam_content_nr = (game.yam_content_nr + 1) % level.num_yam_contents;
return;
Store2[x][y] = 0;
Bang(x, y);
}
- else if (element == EL_AMOEBA2DIAM)
+ else if (element == EL_AMOEBA_TO_DIAMOND)
AmoebeUmwandeln(x, y);
}
if (IS_PLAYER(x, y) && !PLAYERINFO(x,y)->present)
StorePlayer[x][y] = 0;
}
- else if (!(phase % delay) && IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
+ else if (phase >= delay && IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
{
- int graphic = GFX_EXPLOSION;
-
- if (game.emulation == EMU_SUPAPLEX)
- graphic = (Store[x][y] == EL_SP_INFOTRON ?
- GFX_SP_EXPLODE_INFOTRON :
- GFX_SP_EXPLODE_EMPTY);
+ int stored = Store[x][y];
+ int graphic = (game.emulation != EMU_SUPAPLEX ? IMG_EXPLOSION :
+ stored == EL_SP_INFOTRON ? IMG_SP_EXPLOSION_INFOTRON :
+ IMG_SP_EXPLOSION);
+ int frame = getGraphicAnimationFrame(graphic, phase - delay);
if (phase == delay)
- ErdreichAnbroeckeln(SCREENX(x), SCREENY(y));
-
- graphic += (phase / delay - 1);
+ DrawCrumbledSand(SCREENX(x), SCREENY(y));
if (IS_PFORTE(Store[x][y]))
{
DrawLevelElement(x, y, Store[x][y]);
- DrawGraphicThruMask(SCREENX(x), SCREENY(y), graphic);
+ DrawGraphicThruMask(SCREENX(x), SCREENY(y), graphic, frame);
}
else
- DrawGraphic(SCREENX(x), SCREENY(y), graphic);
+ DrawGraphic(SCREENX(x), SCREENY(y), graphic, frame);
}
}
if (IS_ACTIVE_BOMB(Feld[ex][ey]))
{
- player = &stored_player[Feld[ex][ey] - EL_DYNABOMB_ACTIVE_1];
+ player = &stored_player[Feld[ex][ey] - EL_DYNABOMB_PLAYER1_ACTIVE];
dynabomb_size = player->dynabomb_size;
dynabomb_xl = player->dynabomb_xl;
player->dynabombs_left++;
element = Feld[x][y];
/* do not restart explosions of fields with active bombs */
- if (element == EL_EXPLODING && IS_ACTIVE_BOMB(Store2[x][y]))
+ if (element == EL_EXPLOSION && IS_ACTIVE_BOMB(Store2[x][y]))
continue;
Explode(x, y, EX_PHASE_START, EX_BORDER);
- if (element != EL_LEERRAUM &&
- element != EL_ERDREICH &&
- element != EL_EXPLODING &&
+ if (element != EL_EMPTY &&
+ element != EL_SAND &&
+ element != EL_EXPLOSION &&
!dynabomb_xl)
break;
}
#if 0
if (IS_PLAYER(x, y)) /* remove objects that might cause smaller explosion */
- element = EL_LEERRAUM;
+ element = EL_EMPTY;
#endif
switch(element)
{
- case EL_KAEFER:
- case EL_FLIEGER:
- case EL_BUTTERFLY:
- case EL_FIREFLY:
- case EL_MAMPFER:
- case EL_MAMPFER2:
+ case EL_BUG:
+ case EL_SPACESHIP:
+ case EL_BD_BUTTERFLY:
+ case EL_BD_FIREFLY:
+ case EL_YAMYAM:
+ case EL_DARK_YAMYAM:
case EL_ROBOT:
case EL_PACMAN:
case EL_MOLE:
RaiseScoreElement(element);
Explode(x, y, EX_PHASE_START, EX_NORMAL);
break;
- case EL_DYNABOMB_ACTIVE_1:
- case EL_DYNABOMB_ACTIVE_2:
- case EL_DYNABOMB_ACTIVE_3:
- case EL_DYNABOMB_ACTIVE_4:
+ case EL_DYNABOMB_PLAYER1_ACTIVE:
+ case EL_DYNABOMB_PLAYER2_ACTIVE:
+ case EL_DYNABOMB_PLAYER3_ACTIVE:
+ case EL_DYNABOMB_PLAYER4_ACTIVE:
case EL_DYNABOMB_NR:
case EL_DYNABOMB_SZ:
case EL_DYNABOMB_XL:
DynaExplode(x, y);
break;
- case EL_PINGUIN:
- case EL_BIRNE_AUS:
- case EL_BIRNE_EIN:
+ case EL_PENGUIN:
+ case EL_LAMP:
+ case EL_LAMP_ACTIVE:
if (IS_PLAYER(x, y))
Explode(x, y, EX_PHASE_START, EX_NORMAL);
else
{
int element = Feld[x][y];
- if (element != EL_BLURB_LEFT && element != EL_BLURB_RIGHT) /* start */
+ if (element != EL_ACID_SPLASH_LEFT &&
+ element != EL_ACID_SPLASH_RIGHT) /* start */
{
PlaySoundLevel(x, y, SND_ACID_SPLASHING);
if (IN_LEV_FIELD(x-1, y) && IS_FREE(x-1, y) &&
(!IN_LEV_FIELD(x-1, y-1) ||
!CAN_FALL(MovingOrBlocked2Element(x-1, y-1))))
{
- Feld[x-1][y] = EL_BLURB_LEFT;
+ Feld[x-1][y] = EL_ACID_SPLASH_LEFT;
}
if (IN_LEV_FIELD(x+1, y) && IS_FREE(x+1, y) &&
(!IN_LEV_FIELD(x+1, y-1) ||
!CAN_FALL(MovingOrBlocked2Element(x+1, y-1))))
{
- Feld[x+1][y] = EL_BLURB_RIGHT;
+ Feld[x+1][y] = EL_ACID_SPLASH_RIGHT;
}
}
else /* go on */
{
- int graphic = (element==EL_BLURB_LEFT ? GFX_BLURB_LEFT : GFX_BLURB_RIGHT);
+ int graphic = (element == EL_ACID_SPLASH_LEFT ?
+ IMG_ACID_SPLASH_LEFT :
+ IMG_ACID_SPLASH_RIGHT);
if (!MovDelay[x][y]) /* initialize animation counter */
MovDelay[x][y] = 9;
{
MovDelay[x][y]--;
if (MovDelay[x][y]/2 && IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
- DrawGraphic(SCREENX(x), SCREENY(y), graphic+4-MovDelay[x][y]/2);
+ {
+ int frame = getGraphicAnimationFrame(graphic, 8 - MovDelay[x][y]);
+
+ DrawGraphic(SCREENX(x), SCREENY(y), graphic, frame);
+ }
if (!MovDelay[x][y])
{
- Feld[x][y] = EL_LEERRAUM;
+ Feld[x][y] = EL_EMPTY;
DrawLevelField(x, y);
}
}
}
}
+static void InitBeltMovement()
+{
+ static int belt_base_element[4] =
+ {
+ EL_CONVEYOR_BELT1_LEFT,
+ EL_CONVEYOR_BELT2_LEFT,
+ EL_CONVEYOR_BELT3_LEFT,
+ EL_CONVEYOR_BELT4_LEFT
+ };
+ static int belt_base_active_element[4] =
+ {
+ EL_CONVEYOR_BELT1_LEFT_ACTIVE,
+ EL_CONVEYOR_BELT2_LEFT_ACTIVE,
+ EL_CONVEYOR_BELT3_LEFT_ACTIVE,
+ EL_CONVEYOR_BELT4_LEFT_ACTIVE
+ };
+
+ int x, y, i, j;
+
+ /* set frame order for belt animation graphic according to belt direction */
+ for (i=0; i<4; i++)
+ {
+ int belt_nr = i;
+
+ for (j=0; j<3; j++)
+ {
+ int element = belt_base_active_element[belt_nr] + j;
+ int graphic = el2img(element);
+
+ if (game.belt_dir[i] == MV_LEFT)
+ new_graphic_info[graphic].anim_mode &= ~ANIM_REVERSE;
+ else
+ new_graphic_info[graphic].anim_mode |= ANIM_REVERSE;
+ }
+ }
+
+ for(y=0; y<lev_fieldy; y++)
+ {
+ for(x=0; x<lev_fieldx; x++)
+ {
+ int element = Feld[x][y];
+
+ for (i=0; i<4; i++)
+ {
+ if (IS_BELT(element) && game.belt_dir[i] != MV_NO_MOVING)
+ {
+ int e_belt_nr = getBeltNrFromBeltElement(element);
+ int belt_nr = i;
+
+ if (e_belt_nr == belt_nr)
+ {
+ int belt_part = Feld[x][y] - belt_base_element[belt_nr];
+
+ Feld[x][y] = belt_base_active_element[belt_nr] + belt_part;
+ }
+ }
+ }
+ }
+ }
+}
+
static void ToggleBeltSwitch(int x, int y)
{
static int belt_base_element[4] =
{
- EL_BELT1_SWITCH_LEFT,
- EL_BELT2_SWITCH_LEFT,
- EL_BELT3_SWITCH_LEFT,
- EL_BELT4_SWITCH_LEFT
+ EL_CONVEYOR_BELT1_LEFT,
+ EL_CONVEYOR_BELT2_LEFT,
+ EL_CONVEYOR_BELT3_LEFT,
+ EL_CONVEYOR_BELT4_LEFT
+ };
+ static int belt_base_active_element[4] =
+ {
+ EL_CONVEYOR_BELT1_LEFT_ACTIVE,
+ EL_CONVEYOR_BELT2_LEFT_ACTIVE,
+ EL_CONVEYOR_BELT3_LEFT_ACTIVE,
+ EL_CONVEYOR_BELT4_LEFT_ACTIVE
+ };
+ static int belt_base_switch_element[4] =
+ {
+ EL_CONVEYOR_BELT1_SWITCH_LEFT,
+ EL_CONVEYOR_BELT2_SWITCH_LEFT,
+ EL_CONVEYOR_BELT3_SWITCH_LEFT,
+ EL_CONVEYOR_BELT4_SWITCH_LEFT
};
static int belt_move_dir[4] =
{
};
int element = Feld[x][y];
- int belt_nr = getBeltNrFromSwitchElement(element);
+ int belt_nr = getBeltNrFromBeltSwitchElement(element);
int belt_dir_nr = (game.belt_dir_nr[belt_nr] + 1) % 4;
int belt_dir = belt_move_dir[belt_dir_nr];
- int xx, yy;
+ int xx, yy, i;
if (!IS_BELT_SWITCH(element))
return;
if (belt_dir_nr == 3)
belt_dir_nr = 1;
+ /* set frame order for belt animation graphic according to belt direction */
+ for (i=0; i<3; i++)
+ {
+ int element = belt_base_active_element[belt_nr] + i;
+ int graphic = el2img(element);
+
+ if (belt_dir == MV_LEFT)
+ new_graphic_info[graphic].anim_mode &= ~ANIM_REVERSE;
+ else
+ new_graphic_info[graphic].anim_mode |= ANIM_REVERSE;
+ }
+
for (yy=0; yy<lev_fieldy; yy++)
{
for (xx=0; xx<lev_fieldx; xx++)
if (IS_BELT_SWITCH(element))
{
- int e_belt_nr = getBeltNrFromSwitchElement(element);
+ int e_belt_nr = getBeltNrFromBeltSwitchElement(element);
if (e_belt_nr == belt_nr)
{
- Feld[xx][yy] = belt_base_element[belt_nr] + belt_dir_nr;
+ Feld[xx][yy] = belt_base_switch_element[belt_nr] + belt_dir_nr;
DrawLevelField(xx, yy);
}
}
- else if (belt_dir == MV_NO_MOVING && IS_BELT(element))
+ else if (IS_BELT(element) && belt_dir != MV_NO_MOVING)
{
- int e_belt_nr = getBeltNrFromElement(element);
+ int e_belt_nr = getBeltNrFromBeltElement(element);
if (e_belt_nr == belt_nr)
- DrawLevelField(xx, yy); /* set belt to parking position */
+ {
+ int belt_part = Feld[xx][yy] - belt_base_element[belt_nr];
+
+ Feld[xx][yy] = belt_base_active_element[belt_nr] + belt_part;
+ DrawLevelField(xx, yy);
+ }
+ }
+ else if (IS_BELT_ACTIVE(element) && belt_dir == MV_NO_MOVING)
+ {
+ int e_belt_nr = getBeltNrFromBeltActiveElement(element);
+
+ if (e_belt_nr == belt_nr)
+ {
+ int belt_part = Feld[xx][yy] - belt_base_active_element[belt_nr];
+
+ Feld[xx][yy] = belt_base_element[belt_nr] + belt_part;
+ DrawLevelField(xx, yy);
+ }
}
}
}
{
int element = Feld[xx][yy];
- if (element == EL_SWITCHGATE_SWITCH_1 ||
- element == EL_SWITCHGATE_SWITCH_2)
+ if (element == EL_SWITCHGATE_SWITCH_UP ||
+ element == EL_SWITCHGATE_SWITCH_DOWN)
{
- Feld[xx][yy] = EL_SWITCHGATE_SWITCH_1 + game.switchgate_pos;
+ Feld[xx][yy] = EL_SWITCHGATE_SWITCH_UP + game.switchgate_pos;
DrawLevelField(xx, yy);
}
else if (element == EL_SWITCHGATE_OPEN ||
}
}
+static int getInvisibleActiveFromInvisibleElement(int element)
+{
+ return (element == EL_INVISIBLE_STEELWALL ? EL_INVISIBLE_STEELWALL_ACTIVE :
+ element == EL_INVISIBLE_WALL ? EL_INVISIBLE_WALL_ACTIVE :
+ EL_INVISIBLE_SAND_ACTIVE);
+}
+
+static int getInvisibleFromInvisibleActiveElement(int element)
+{
+ return (element == EL_INVISIBLE_STEELWALL_ACTIVE ? EL_INVISIBLE_STEELWALL :
+ element == EL_INVISIBLE_WALL_ACTIVE ? EL_INVISIBLE_WALL :
+ EL_INVISIBLE_SAND);
+}
+
static void RedrawAllLightSwitchesAndInvisibleElements()
{
int x, y;
{
int element = Feld[x][y];
- if (element == EL_LIGHT_SWITCH_OFF &&
+ if (element == EL_LIGHT_SWITCH &&
game.light_time_left > 0)
{
- Feld[x][y] = EL_LIGHT_SWITCH_ON;
+ Feld[x][y] = EL_LIGHT_SWITCH_ACTIVE;
DrawLevelField(x, y);
}
- else if (element == EL_LIGHT_SWITCH_ON &&
+ else if (element == EL_LIGHT_SWITCH_ACTIVE &&
game.light_time_left == 0)
{
- Feld[x][y] = EL_LIGHT_SWITCH_OFF;
+ Feld[x][y] = EL_LIGHT_SWITCH;
DrawLevelField(x, y);
}
+ else if (element == EL_INVISIBLE_STEELWALL ||
+ element == EL_INVISIBLE_WALL ||
+ element == EL_INVISIBLE_SAND)
+ {
+ if (game.light_time_left > 0)
+ Feld[x][y] = getInvisibleActiveFromInvisibleElement(element);
- if (element == EL_INVISIBLE_STEEL ||
- element == EL_UNSICHTBAR ||
- element == EL_SAND_INVISIBLE)
DrawLevelField(x, y);
+ }
+ else if (element == EL_INVISIBLE_STEELWALL_ACTIVE ||
+ element == EL_INVISIBLE_WALL_ACTIVE ||
+ element == EL_INVISIBLE_SAND_ACTIVE)
+ {
+ if (game.light_time_left == 0)
+ Feld[x][y] = getInvisibleFromInvisibleActiveElement(element);
+
+ DrawLevelField(x, y);
+ }
}
}
}
int element = Feld[x][y];
game.light_time_left =
- (element == EL_LIGHT_SWITCH_OFF ?
+ (element == EL_LIGHT_SWITCH ?
level.time_light * FRAMES_PER_SECOND : 0);
RedrawAllLightSwitchesAndInvisibleElements();
}
/*
- else if (element == EL_TIMEGATE_SWITCH_ON)
+ else if (element == EL_TIMEGATE_SWITCH_ACTIVE)
{
- Feld[xx][yy] = EL_TIMEGATE_SWITCH_OFF;
+ Feld[xx][yy] = EL_TIMEGATE_SWITCH;
DrawLevelField(xx, yy);
}
*/
}
}
- Feld[x][y] = EL_TIMEGATE_SWITCH_ON;
+ Feld[x][y] = EL_TIMEGATE_SWITCH_ACTIVE;
}
void Impact(int x, int y)
smashed = MovingOrBlocked2Element(x, y+1);
}
- if (!lastline && smashed == EL_SALZSAEURE) /* element falls into acid */
+ if (!lastline && smashed == EL_ACID) /* element falls into acid */
{
Blurb(x, y);
return;
}
- if ((element == EL_BOMBE ||
+ if ((element == EL_BOMB ||
element == EL_SP_DISK_ORANGE ||
element == EL_DX_SUPABOMB) &&
(lastline || object_hit)) /* element is bomb */
return;
}
- if (element == EL_TROPFEN && (lastline || object_hit)) /* acid drop */
+ if (element == EL_AMOEBA_DROP && (lastline || object_hit))
{
if (object_hit && IS_PLAYER(x, y+1))
KillHeroUnlessProtected(x, y+1);
- else if (object_hit && smashed == EL_PINGUIN)
+ else if (object_hit && smashed == EL_PENGUIN)
Bang(x, y+1);
else
{
- Feld[x][y] = EL_AMOEBING;
- Store[x][y] = EL_AMOEBE_NASS;
+ Feld[x][y] = EL_AMOEBA_CREATING;
+ Store[x][y] = EL_AMOEBA_WET;
}
return;
}
if (!lastline && object_hit) /* check which object was hit */
{
if (CAN_CHANGE(element) &&
- (smashed == EL_MAGIC_WALL_OFF || smashed == EL_MAGIC_WALL_BD_OFF))
+ (smashed == EL_MAGIC_WALL || smashed == EL_BD_MAGIC_WALL))
{
int xx, yy;
int activated_magic_wall =
- (smashed == EL_MAGIC_WALL_OFF ? EL_MAGIC_WALL_EMPTY :
- EL_MAGIC_WALL_BD_EMPTY);
+ (smashed == EL_MAGIC_WALL ? EL_MAGIC_WALL_ACTIVE :
+ EL_BD_MAGIC_WALL_ACTIVE);
/* activate magic wall / mill */
for (yy=0; yy<lev_fieldy; yy++)
game.magic_wall_time_left = level.time_magic_wall * FRAMES_PER_SECOND;
game.magic_wall_active = TRUE;
- PlaySoundLevel(x, y, (smashed == EL_MAGIC_WALL_OFF ?
+ PlaySoundLevel(x, y, (smashed == EL_MAGIC_WALL ?
SND_MAGIC_WALL_ACTIVATING :
SND_BD_MAGIC_WALL_ACTIVATING));
}
KillHeroUnlessProtected(x, y+1);
return;
}
- else if (smashed == EL_PINGUIN)
+ else if (smashed == EL_PENGUIN)
{
Bang(x, y+1);
return;
}
- else if (element == EL_EDELSTEIN_BD)
+ else if (element == EL_BD_DIAMOND)
{
if (IS_ENEMY(smashed) && IS_BD_ELEMENT(smashed))
{
Bang(x, y+1);
return;
}
- else if (element == EL_FELSBROCKEN ||
+ else if (element == EL_ROCK ||
element == EL_SP_ZONK ||
element == EL_BD_ROCK)
{
if (IS_ENEMY(smashed) ||
- smashed == EL_BOMBE || smashed == EL_SP_DISK_ORANGE ||
+ smashed == EL_BOMB || smashed == EL_SP_DISK_ORANGE ||
smashed == EL_DX_SUPABOMB ||
- smashed == EL_SONDE || smashed == EL_SCHWEIN ||
- smashed == EL_DRACHE || smashed == EL_MOLE)
+ smashed == EL_SATELLITE || smashed == EL_PIG ||
+ smashed == EL_DRAGON || smashed == EL_MOLE)
{
Bang(x, y+1);
return;
}
else if (!IS_MOVING(x, y+1))
{
- if (smashed == EL_BIRNE_AUS || smashed == EL_BIRNE_EIN)
+ if (smashed == EL_LAMP || smashed == EL_LAMP_ACTIVE)
{
Bang(x, y+1);
return;
}
- else if (smashed == EL_KOKOSNUSS)
+ else if (smashed == EL_NUT)
{
- Feld[x][y+1] = EL_CRACKINGNUT;
+ Feld[x][y+1] = EL_NUT_CRACKING;
PlaySoundLevel(x, y, SND_NUT_CRACKING);
- RaiseScoreElement(EL_KOKOSNUSS);
+ RaiseScoreElement(EL_NUT);
return;
}
else if (smashed == EL_PEARL)
PlaySoundLevel(x, y, SND_PEARL_BREAKING);
return;
}
- else if (smashed == EL_DIAMANT)
+ else if (smashed == EL_DIAMOND)
{
- Feld[x][y+1] = EL_LEERRAUM;
+ Feld[x][y+1] = EL_EMPTY;
PlaySoundLevel(x, y, SND_DIAMOND_BREAKING);
return;
}
{
ToggleBeltSwitch(x, y+1);
}
- else if (smashed == EL_SWITCHGATE_SWITCH_1 ||
- smashed == EL_SWITCHGATE_SWITCH_2)
+ else if (smashed == EL_SWITCHGATE_SWITCH_UP ||
+ smashed == EL_SWITCHGATE_SWITCH_DOWN)
{
ToggleSwitchgateSwitch(x, y+1);
}
- else if (smashed == EL_LIGHT_SWITCH_OFF ||
- smashed == EL_LIGHT_SWITCH_ON)
+ else if (smashed == EL_LIGHT_SWITCH ||
+ smashed == EL_LIGHT_SWITCH_ACTIVE)
{
ToggleLightSwitch(x, y+1);
}
/* play sound of magic wall / mill */
if (!lastline &&
- (Feld[x][y+1] == EL_MAGIC_WALL_EMPTY ||
- Feld[x][y+1] == EL_MAGIC_WALL_BD_EMPTY))
+ (Feld[x][y+1] == EL_MAGIC_WALL_ACTIVE ||
+ Feld[x][y+1] == EL_BD_MAGIC_WALL_ACTIVE))
{
- if (Feld[x][y+1] == EL_MAGIC_WALL_EMPTY)
+ if (Feld[x][y+1] == EL_MAGIC_WALL_ACTIVE)
PlaySoundLevel(x, y, SND_MAGIC_WALL_CHANGING);
- else if (Feld[x][y+1] == EL_MAGIC_WALL_BD_EMPTY)
+ else if (Feld[x][y+1] == EL_BD_MAGIC_WALL_ACTIVE)
PlaySoundLevel(x, y, SND_BD_MAGIC_WALL_CHANGING);
return;
int element = Feld[x][y];
int old_move_dir = MovDir[x][y];
- int left_dir = turn[old_move_dir].left;
+ int left_dir = turn[old_move_dir].left;
int right_dir = turn[old_move_dir].right;
- int back_dir = turn[old_move_dir].back;
+ int back_dir = turn[old_move_dir].back;
- int left_dx = move_xy[left_dir].x, left_dy = move_xy[left_dir].y;
- int right_dx = move_xy[right_dir].x, right_dy = move_xy[right_dir].y;
- int move_dx = move_xy[old_move_dir].x, move_dy = move_xy[old_move_dir].y;
- int back_dx = move_xy[back_dir].x, back_dy = move_xy[back_dir].y;
+ int left_dx = move_xy[left_dir].x, left_dy = move_xy[left_dir].y;
+ int right_dx = move_xy[right_dir].x, right_dy = move_xy[right_dir].y;
+ int move_dx = move_xy[old_move_dir].x, move_dy = move_xy[old_move_dir].y;
+ int back_dx = move_xy[back_dir].x, back_dy = move_xy[back_dir].y;
- int left_x = x+left_dx, left_y = y+left_dy;
- int right_x = x+right_dx, right_y = y+right_dy;
- int move_x = x+move_dx, move_y = y+move_dy;
+ int left_x = x + left_dx, left_y = y + left_dy;
+ int right_x = x + right_dx, right_y = y + right_dy;
+ int move_x = x + move_dx, move_y = y + move_dy;
- if (element == EL_KAEFER || element == EL_BUTTERFLY)
+ if (element == EL_BUG || element == EL_BD_BUTTERFLY)
{
TestIfBadThingTouchesOtherBadThing(x, y);
!IS_FREE(move_x, move_y))
MovDir[x][y] = left_dir;
- if (element == EL_KAEFER && MovDir[x][y] != old_move_dir)
+ if (element == EL_BUG && MovDir[x][y] != old_move_dir)
MovDelay[x][y] = 9;
- else if (element == EL_BUTTERFLY) /* && MovDir[x][y] == left_dir) */
+ else if (element == EL_BD_BUTTERFLY) /* && MovDir[x][y] == left_dir) */
MovDelay[x][y] = 1;
}
- else if (element == EL_FLIEGER || element == EL_FIREFLY ||
+ else if (element == EL_SPACESHIP || element == EL_BD_FIREFLY ||
element == EL_SP_SNIKSNAK || element == EL_SP_ELECTRON)
{
TestIfBadThingTouchesOtherBadThing(x, y);
!IS_FREE(move_x, move_y))
MovDir[x][y] = right_dir;
- if ((element == EL_FLIEGER ||
+ if ((element == EL_SPACESHIP ||
element == EL_SP_SNIKSNAK || element == EL_SP_ELECTRON)
&& MovDir[x][y] != old_move_dir)
MovDelay[x][y] = 9;
- else if (element == EL_FIREFLY) /* && MovDir[x][y] == right_dir) */
+ else if (element == EL_BD_FIREFLY) /* && MovDir[x][y] == right_dir) */
MovDelay[x][y] = 1;
}
- else if (element == EL_MAMPFER)
+ else if (element == EL_YAMYAM)
{
boolean can_turn_left = FALSE, can_turn_right = FALSE;
if (IN_LEV_FIELD(left_x, left_y) &&
(IS_FREE_OR_PLAYER(left_x, left_y) ||
- Feld[left_x][left_y] == EL_DIAMANT))
+ Feld[left_x][left_y] == EL_DIAMOND))
can_turn_left = TRUE;
if (IN_LEV_FIELD(right_x, right_y) &&
(IS_FREE_OR_PLAYER(right_x, right_y) ||
- Feld[right_x][right_y] == EL_DIAMANT))
+ Feld[right_x][right_y] == EL_DIAMOND))
can_turn_right = TRUE;
if (can_turn_left && can_turn_right)
MovDelay[x][y] = 16+16*RND(3);
}
- else if (element == EL_MAMPFER2)
+ else if (element == EL_DARK_YAMYAM)
{
boolean can_turn_left = FALSE, can_turn_right = FALSE;
MovDelay[x][y] = 6+RND(40);
}
- else if (element == EL_SCHWEIN)
+ else if (element == EL_PIG)
{
boolean can_turn_left = FALSE, can_turn_right = FALSE, can_move_on = FALSE;
boolean should_turn_left = FALSE, should_turn_right = FALSE;
MovDelay[x][y] = 0;
}
- else if (element == EL_DRACHE)
+ else if (element == EL_DRAGON)
{
boolean can_turn_left = FALSE, can_turn_right = FALSE, can_move_on = FALSE;
int rnd_value = 24;
if (IN_LEV_FIELD(move_x, move_y) &&
(IS_FREE(move_x, move_y) || IS_AMOEBOID(Feld[move_x][move_y]) ||
- Feld[move_x][move_y] == EL_DEAMOEBING))
+ Feld[move_x][move_y] == EL_AMOEBA_SHRINKING))
can_move_on = TRUE;
if (!can_move_on)
MovDir[x][y] = game.balloon_dir;
MovDelay[x][y] = 0;
}
- else if (element == EL_SPRING_MOVING)
+ else if (element == EL_SPRING)
{
- 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;
+ if ((MovDir[x][y] == MV_LEFT || MovDir[x][y] == MV_RIGHT) &&
+ (!IN_LEV_FIELD(move_x, move_y) || !IS_FREE(move_x, move_y) ||
+ (IN_LEV_FIELD(x, y + 1) && IS_FREE(x, y + 1))))
MovDir[x][y] = MV_NO_MOVING;
- }
+
MovDelay[x][y] = 0;
}
- else if (element == EL_ROBOT || element == EL_SONDE || element == EL_PINGUIN)
+ else if (element == EL_ROBOT ||
+ element == EL_SATELLITE ||
+ element == EL_PENGUIN)
{
int attr_x = -1, attr_y = -1;
attr_y = ZY;
}
- if (element == EL_PINGUIN)
+ if (element == EL_PENGUIN)
{
int i;
static int xy[4][2] =
int ex = x + xy[i%4][0];
int ey = y + xy[i%4][1];
- if (IN_LEV_FIELD(ex, ey) && Feld[ex][ey] == EL_AUSGANG_AUF)
+ if (IN_LEV_FIELD(ex, ey) && Feld[ex][ey] == EL_EXIT_OPEN)
{
attr_x = ex;
attr_y = ey;
if (IN_LEV_FIELD(newx, newy) &&
(IS_FREE(newx, newy) ||
- Feld[newx][newy] == EL_SALZSAEURE ||
- (element == EL_PINGUIN &&
- (Feld[newx][newy] == EL_AUSGANG_AUF ||
+ Feld[newx][newy] == EL_ACID ||
+ (element == EL_PENGUIN &&
+ (Feld[newx][newy] == EL_EXIT_OPEN ||
IS_MAMPF3(Feld[newx][newy])))))
return;
if (IN_LEV_FIELD(newx, newy) &&
(IS_FREE(newx, newy) ||
- Feld[newx][newy] == EL_SALZSAEURE ||
- (element == EL_PINGUIN &&
- (Feld[newx][newy] == EL_AUSGANG_AUF ||
+ Feld[newx][newy] == EL_ACID ||
+ (element == EL_PENGUIN &&
+ (Feld[newx][newy] == EL_EXIT_OPEN ||
IS_MAMPF3(Feld[newx][newy])))))
return;
if (Stop[x][y])
return;
+ GfxAction[x][y] = GFX_ACTION_DEFAULT;
+
if (CAN_FALL(element) && y<lev_fieldy-1)
{
if ((x>0 && IS_PLAYER(x-1, y)) || (x<lev_fieldx-1 && IS_PLAYER(x+1, y)))
if (JustBeingPushed(x, y))
return;
- if (element == EL_MORAST_VOLL)
+ if (element == EL_QUICKSAND_FULL)
{
if (IS_FREE(x, y+1))
{
InitMovingField(x, y, MV_DOWN);
Feld[x][y] = EL_QUICKSAND_EMPTYING;
- Store[x][y] = EL_FELSBROCKEN;
+ Store[x][y] = EL_ROCK;
PlaySoundLevel(x, y, SND_QUICKSAND_EMPTYING);
}
- else if (Feld[x][y+1] == EL_MORAST_LEER)
+ else if (Feld[x][y+1] == EL_QUICKSAND_EMPTY)
{
if (!MovDelay[x][y])
MovDelay[x][y] = TILEY + 1;
return;
}
- Feld[x][y] = EL_MORAST_LEER;
- Feld[x][y+1] = EL_MORAST_VOLL;
+ Feld[x][y] = EL_QUICKSAND_EMPTY;
+ Feld[x][y+1] = EL_QUICKSAND_FULL;
Store[x][y+1] = Store[x][y];
Store[x][y] = 0;
- PlaySoundLevel(x, y, SND_QUICKSAND_SLIPPING_THROUGH);
+ PlaySoundLevel(x, y, SND_QUICKSAND_SLIPPING);
}
}
- else if ((element == EL_FELSBROCKEN || element == EL_BD_ROCK) &&
- Feld[x][y+1] == EL_MORAST_LEER)
+ else if ((element == EL_ROCK || element == EL_BD_ROCK) &&
+ Feld[x][y+1] == EL_QUICKSAND_EMPTY)
{
InitMovingField(x, y, MV_DOWN);
Feld[x][y] = EL_QUICKSAND_FILLING;
Feld[x][y] = EL_MAGIC_WALL_EMPTYING;
Store[x][y] = EL_CHANGED(Store[x][y]);
}
- else if (Feld[x][y+1] == EL_MAGIC_WALL_EMPTY)
+ else if (Feld[x][y+1] == EL_MAGIC_WALL_ACTIVE)
{
if (!MovDelay[x][y])
MovDelay[x][y] = TILEY/4 + 1;
return;
}
- Feld[x][y] = EL_MAGIC_WALL_EMPTY;
+ Feld[x][y] = EL_MAGIC_WALL_ACTIVE;
Feld[x][y+1] = EL_MAGIC_WALL_FULL;
Store[x][y+1] = EL_CHANGED(Store[x][y]);
Store[x][y] = 0;
}
}
- else if (element == EL_MAGIC_WALL_BD_FULL)
+ else if (element == EL_BD_MAGIC_WALL_FULL)
{
if (IS_FREE(x, y+1))
{
InitMovingField(x, y, MV_DOWN);
- Feld[x][y] = EL_MAGIC_WALL_BD_EMPTYING;
+ Feld[x][y] = EL_BD_MAGIC_WALL_EMPTYING;
Store[x][y] = EL_CHANGED2(Store[x][y]);
}
- else if (Feld[x][y+1] == EL_MAGIC_WALL_BD_EMPTY)
+ else if (Feld[x][y+1] == EL_BD_MAGIC_WALL_ACTIVE)
{
if (!MovDelay[x][y])
MovDelay[x][y] = TILEY/4 + 1;
return;
}
- Feld[x][y] = EL_MAGIC_WALL_BD_EMPTY;
- Feld[x][y+1] = EL_MAGIC_WALL_BD_FULL;
+ Feld[x][y] = EL_BD_MAGIC_WALL_ACTIVE;
+ Feld[x][y+1] = EL_BD_MAGIC_WALL_FULL;
Store[x][y+1] = EL_CHANGED2(Store[x][y]);
Store[x][y] = 0;
}
}
else if (CAN_CHANGE(element) &&
- (Feld[x][y+1] == EL_MAGIC_WALL_EMPTY ||
- Feld[x][y+1] == EL_MAGIC_WALL_BD_EMPTY))
+ (Feld[x][y+1] == EL_MAGIC_WALL_ACTIVE ||
+ Feld[x][y+1] == EL_BD_MAGIC_WALL_ACTIVE))
{
InitMovingField(x, y, MV_DOWN);
Feld[x][y] =
- (Feld[x][y+1] == EL_MAGIC_WALL_EMPTY ? EL_MAGIC_WALL_FILLING :
- EL_MAGIC_WALL_BD_FILLING);
+ (Feld[x][y+1] == EL_MAGIC_WALL_ACTIVE ? EL_MAGIC_WALL_FILLING :
+ EL_BD_MAGIC_WALL_FILLING);
Store[x][y] = element;
}
- else if (CAN_SMASH(element) && Feld[x][y+1] == EL_SALZSAEURE)
+ else if (CAN_SMASH(element) && Feld[x][y+1] == EL_ACID)
{
Blurb(x, y);
InitMovingField(x, y, MV_DOWN);
- Store[x][y] = EL_SALZSAEURE;
+ Store[x][y] = EL_ACID;
}
else if (CAN_SMASH(element) && Feld[x][y+1] == EL_BLOCKED &&
JustStopped[x][y])
{
InitMovingField(x, y, MV_DOWN);
}
- else if (element == EL_TROPFEN)
+ else if (element == EL_AMOEBA_DROP)
{
- Feld[x][y] = EL_AMOEBING;
- Store[x][y] = EL_AMOEBE_NASS;
+ Feld[x][y] = EL_AMOEBA_CREATING;
+ Store[x][y] = EL_AMOEBA_WET;
}
/* Store[x][y+1] must be zero, because:
- (EL_MORAST_VOLL -> EL_FELSBROCKEN): Store[x][y+1] == EL_MORAST_LEER
+ (EL_QUICKSAND_FULL -> EL_ROCK): Store[x][y+1] == EL_QUICKSAND_EMPTY
*/
#if 0
#if OLD_GAME_BEHAVIOUR
#endif
{
boolean left = (x>0 && IS_FREE(x-1, y) &&
- (IS_FREE(x-1, y+1) || Feld[x-1][y+1] == EL_SALZSAEURE));
+ (IS_FREE(x-1, y+1) || Feld[x-1][y+1] == EL_ACID));
boolean right = (x<lev_fieldx-1 && IS_FREE(x+1, y) &&
- (IS_FREE(x+1, y+1) || Feld[x+1][y+1] == EL_SALZSAEURE));
+ (IS_FREE(x+1, y+1) || Feld[x+1][y+1] == EL_ACID));
if (left || right)
{
if (left && right &&
(game.emulation != EMU_BOULDERDASH &&
- element != EL_BD_ROCK && element != EL_EDELSTEIN_BD))
+ element != EL_BD_ROCK && element != EL_BD_DIAMOND))
left = !(right = RND(2));
InitMovingField(x, y, left ? MV_LEFT : MV_RIGHT);
}
}
- else if (IS_BELT(Feld[x][y+1]))
+ else if (IS_BELT_ACTIVE(Feld[x][y+1]))
{
boolean left_is_free = (x>0 && IS_FREE(x-1, y));
boolean right_is_free = (x<lev_fieldx-1 && IS_FREE(x+1, y));
- int belt_nr = getBeltNrFromElement(Feld[x][y+1]);
+ int belt_nr = getBeltNrFromBeltActiveElement(Feld[x][y+1]);
int belt_dir = game.belt_dir[belt_nr];
if ((belt_dir == MV_LEFT && left_is_free) ||
(belt_dir == MV_RIGHT && right_is_free))
+ {
InitMovingField(x, y, belt_dir);
+ GfxAction[x][y] = GFX_ACTION_DEFAULT;
+ }
}
}
- else if (CAN_MOVE(element))
+
+ if (CAN_MOVE(element)) /* not "else if" because of EL_SPRING */
{
int newx, newy;
- if ((element == EL_SONDE || element == EL_BALLOON ||
- element == EL_SPRING_MOVING)
+ if ((element == EL_SATELLITE ||
+ element == EL_BALLOON ||
+ element == EL_SPRING)
&& JustBeingPushed(x, y))
return;
+ if (element == EL_SPRING && MovDir[x][y] == MV_DOWN)
+ Feld[x][y + 1] = EL_EMPTY; /* was set to EL_BLOCKED above */
+
if (!MovDelay[x][y]) /* start new movement phase */
{
/* all objects that can change their move direction after each step */
/* (MAMPFER, MAMPFER2 and PACMAN go straight until they hit a wall */
- if (element!=EL_MAMPFER && element!=EL_MAMPFER2 && element!=EL_PACMAN)
+ if (element != EL_YAMYAM &&
+ element != EL_DARK_YAMYAM &&
+ element != EL_PACMAN)
{
+#if 0
+ if (element == EL_SPRING)
+ printf("1--> %d\n", MovDir[x][y]);
+#endif
TurnRound(x, y);
-
- if (MovDelay[x][y] && (element == EL_KAEFER ||
- element == EL_FLIEGER ||
+#if 0
+ if (element == EL_SPRING)
+ printf("2--> %d\n", MovDir[x][y]);
+#endif
+ if (MovDelay[x][y] && (element == EL_BUG ||
+ element == EL_SPACESHIP ||
element == EL_SP_SNIKSNAK ||
element == EL_SP_ELECTRON ||
element == EL_MOLE))
MovDelay[x][y]--;
if (element == EL_ROBOT ||
- element == EL_MAMPFER || element == EL_MAMPFER2)
+ element == EL_YAMYAM || element == EL_DARK_YAMYAM)
{
- int phase = MovDelay[x][y] % 8;
-
- if (phase > 3)
- phase = 7 - phase;
-
if (IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
- DrawGraphic(SCREENX(x), SCREENY(y), el2gfx(element) + phase);
+ {
+ int graphic = el2img(element);
+ int frame = getGraphicAnimationFrame(graphic, MovDelay[x][y] % 8);
+
+ DrawGraphic(SCREENX(x), SCREENY(y), graphic, frame);
+ }
if (MovDelay[x][y] % 4 == 3)
{
- if (element == EL_MAMPFER)
+ if (element == EL_YAMYAM)
PlaySoundLevel(x, y, SND_YAMYAM_WAITING);
- else if (element == EL_MAMPFER2)
+ else if (element == EL_DARK_YAMYAM)
PlaySoundLevel(x, y, SND_DARK_YAMYAM_WAITING);
}
}
else if (element == EL_SP_ELECTRON)
- DrawGraphicAnimation(x, y, GFX2_SP_ELECTRON, 8, 2, ANIM_NORMAL);
- else if (element == EL_DRACHE)
+ DrawGraphicAnimation(SCREENX(x), SCREENY(y), IMG_SP_ELECTRON);
+ else if (element == EL_DRAGON)
{
int i;
int dir = MovDir[x][y];
int dx = (dir == MV_LEFT ? -1 : dir == MV_RIGHT ? +1 : 0);
int dy = (dir == MV_UP ? -1 : dir == MV_DOWN ? +1 : 0);
- int graphic = (dir == MV_LEFT ? GFX_FLAMMEN_LEFT :
- dir == MV_RIGHT ? GFX_FLAMMEN_RIGHT :
- dir == MV_UP ? GFX_FLAMMEN_UP :
- dir == MV_DOWN ? GFX_FLAMMEN_DOWN : GFX_LEERRAUM);
- int phase = FrameCounter % 2;
+ int graphic = (dir == MV_LEFT ? IMG_FLAMES_LEFT1 :
+ dir == MV_RIGHT ? IMG_FLAMES_RIGHT1 :
+ dir == MV_UP ? IMG_FLAMES_UP1 :
+ dir == MV_DOWN ? IMG_FLAMES_DOWN1 : IMG_EMPTY);
+ int frame = getGraphicAnimationFrame(graphic, -1);
for (i=1; i<=3; i++)
{
int xx = x + i*dx, yy = y + i*dy;
int sx = SCREENX(xx), sy = SCREENY(yy);
+ int flame_graphic = graphic + (i - 1);
if (!IN_LEV_FIELD(xx, yy) ||
- IS_SOLID(Feld[xx][yy]) || Feld[xx][yy] == EL_EXPLODING)
+ IS_SOLID(Feld[xx][yy]) || Feld[xx][yy] == EL_EXPLOSION)
break;
if (MovDelay[x][y])
else
RemoveMovingField(xx, yy);
- Feld[xx][yy] = EL_BURNING;
+ Feld[xx][yy] = EL_FLAMES;
if (IN_SCR_FIELD(sx, sy))
- DrawGraphic(sx, sy, graphic + phase*3 + i-1);
+ DrawGraphic(sx, sy, flame_graphic, frame);
}
else
{
- if (Feld[xx][yy] == EL_BURNING)
- Feld[xx][yy] = EL_LEERRAUM;
+ if (Feld[xx][yy] == EL_FLAMES)
+ Feld[xx][yy] = EL_EMPTY;
DrawLevelField(xx, yy);
}
}
#endif
}
- else if ((element == EL_PINGUIN || element == EL_ROBOT ||
- element == EL_SONDE || element == EL_BALLOON) &&
+ else if ((element == EL_PENGUIN || element == EL_ROBOT ||
+ element == EL_SATELLITE || element == EL_BALLOON) &&
IN_LEV_FIELD(newx, newy) &&
- MovDir[x][y] == MV_DOWN && Feld[newx][newy] == EL_SALZSAEURE)
+ MovDir[x][y] == MV_DOWN && Feld[newx][newy] == EL_ACID)
{
Blurb(x, y);
- Store[x][y] = EL_SALZSAEURE;
+ Store[x][y] = EL_ACID;
}
- else if (element == EL_PINGUIN && IN_LEV_FIELD(newx, newy))
+ else if (element == EL_PENGUIN && IN_LEV_FIELD(newx, newy))
{
- if (Feld[newx][newy] == EL_AUSGANG_AUF)
+ if (Feld[newx][newy] == EL_EXIT_OPEN)
{
- Feld[x][y] = EL_LEERRAUM;
+ Feld[x][y] = EL_EMPTY;
DrawLevelField(x, y);
- PlaySoundLevel(newx, newy, SND_PENGUIN_ENTERING_EXIT);
+ PlaySoundLevel(newx, newy, SND_PENGUIN_PASSING_EXIT);
if (IN_SCR_FIELD(SCREENX(newx), SCREENY(newy)))
- DrawGraphicThruMask(SCREENX(newx), SCREENY(newy), el2gfx(element));
+ DrawGraphicThruMask(SCREENX(newx),SCREENY(newy), el2img(element), 0);
local_player->friends_still_needed--;
if (!local_player->friends_still_needed &&
return;
}
}
- else if (element == EL_SCHWEIN && IN_LEV_FIELD(newx, newy))
+ else if (element == EL_PIG && IN_LEV_FIELD(newx, newy))
{
if (IS_GEM(Feld[newx][newy]))
{
RemoveMovingField(newx, newy);
else
{
- Feld[newx][newy] = EL_LEERRAUM;
+ Feld[newx][newy] = EL_EMPTY;
DrawLevelField(newx, newy);
}
- PlaySoundLevel(x, y, SND_PIG_EATING_GEM);
+ PlaySoundLevel(x, y, SND_PIG_EATING);
}
else if (!IS_FREE(newx, newy))
{
return;
}
}
- else if (element == EL_DRACHE && IN_LEV_FIELD(newx, newy))
+ else if (element == EL_DRAGON && IN_LEV_FIELD(newx, newy))
{
if (!IS_FREE(newx, newy))
{
int newx1 = newx+1*dx, newy1 = newy+1*dy;
int newx2 = newx+2*dx, newy2 = newy+2*dy;
int element1 = (IN_LEV_FIELD(newx1, newy1) ?
- MovingOrBlocked2Element(newx1, newy1) : EL_BETON);
+ MovingOrBlocked2Element(newx1, newy1) : EL_STEELWALL);
int element2 = (IN_LEV_FIELD(newx2, newy2) ?
- MovingOrBlocked2Element(newx2, newy2) : EL_BETON);
+ MovingOrBlocked2Element(newx2, newy2) : EL_STEELWALL);
if ((wanna_flame || IS_ENEMY(element1) || IS_ENEMY(element2)) &&
- element1 != EL_DRACHE && element2 != EL_DRACHE &&
- element1 != EL_BURNING && element2 != EL_BURNING)
+ element1 != EL_DRAGON && element2 != EL_DRAGON &&
+ element1 != EL_FLAMES && element2 != EL_FLAMES)
{
if (IS_PLAYER(x, y))
DrawPlayerField(x, y);
PlaySoundLevel(x, y, SND_DRAGON_ATTACKING);
MovDelay[x][y] = 50;
- Feld[newx][newy] = EL_BURNING;
- if (IN_LEV_FIELD(newx1, newy1) && Feld[newx1][newy1] == EL_LEERRAUM)
- Feld[newx1][newy1] = EL_BURNING;
- if (IN_LEV_FIELD(newx2, newy2) && Feld[newx2][newy2] == EL_LEERRAUM)
- Feld[newx2][newy2] = EL_BURNING;
+ Feld[newx][newy] = EL_FLAMES;
+ if (IN_LEV_FIELD(newx1, newy1) && Feld[newx1][newy1] == EL_EMPTY)
+ Feld[newx1][newy1] = EL_FLAMES;
+ if (IN_LEV_FIELD(newx2, newy2) && Feld[newx2][newy2] == EL_EMPTY)
+ Feld[newx2][newy2] = EL_FLAMES;
return;
}
}
}
- else if (element == EL_MAMPFER && IN_LEV_FIELD(newx, newy) &&
- Feld[newx][newy] == EL_DIAMANT)
+ else if (element == EL_YAMYAM && IN_LEV_FIELD(newx, newy) &&
+ Feld[newx][newy] == EL_DIAMOND)
{
if (IS_MOVING(newx, newy))
RemoveMovingField(newx, newy);
else
{
- Feld[newx][newy] = EL_LEERRAUM;
+ Feld[newx][newy] = EL_EMPTY;
DrawLevelField(newx, newy);
}
- PlaySoundLevel(x, y, SND_YAMYAM_EATING_DIAMOND);
+ PlaySoundLevel(x, y, SND_YAMYAM_EATING);
}
- else if (element == EL_MAMPFER2 && IN_LEV_FIELD(newx, newy) &&
+ else if (element == EL_DARK_YAMYAM && IN_LEV_FIELD(newx, newy) &&
IS_MAMPF2(Feld[newx][newy]))
{
if (AmoebaNr[newx][newy])
{
AmoebaCnt2[AmoebaNr[newx][newy]]--;
- if (Feld[newx][newy] == EL_AMOEBE_VOLL ||
- Feld[newx][newy] == EL_AMOEBE_BD)
+ if (Feld[newx][newy] == EL_AMOEBA_FULL ||
+ Feld[newx][newy] == EL_BD_AMOEBA)
AmoebaCnt[AmoebaNr[newx][newy]]--;
}
RemoveMovingField(newx, newy);
else
{
- Feld[newx][newy] = EL_LEERRAUM;
+ Feld[newx][newy] = EL_EMPTY;
DrawLevelField(newx, newy);
}
- PlaySoundLevel(x, y, SND_DARK_YAMYAM_EATING_ANY);
+ PlaySoundLevel(x, y, SND_DARK_YAMYAM_EATING);
}
else if ((element == EL_PACMAN || element == EL_MOLE)
&& IN_LEV_FIELD(newx, newy) && IS_AMOEBOID(Feld[newx][newy]))
if (AmoebaNr[newx][newy])
{
AmoebaCnt2[AmoebaNr[newx][newy]]--;
- if (Feld[newx][newy] == EL_AMOEBE_VOLL ||
- Feld[newx][newy] == EL_AMOEBE_BD)
+ if (Feld[newx][newy] == EL_AMOEBA_FULL ||
+ Feld[newx][newy] == EL_BD_AMOEBA)
AmoebaCnt[AmoebaNr[newx][newy]]--;
}
if (element == EL_MOLE)
{
- Feld[newx][newy] = EL_DEAMOEBING;
- PlaySoundLevel(x, y, SND_MOLE_EATING_AMOEBA);
+ Feld[newx][newy] = EL_AMOEBA_SHRINKING;
+ PlaySoundLevel(x, y, SND_MOLE_EATING);
MovDelay[newx][newy] = 0; /* start amoeba shrinking delay */
return; /* wait for shrinking amoeba */
}
else /* element == EL_PACMAN */
{
- Feld[newx][newy] = EL_LEERRAUM;
+ Feld[newx][newy] = EL_EMPTY;
DrawLevelField(newx, newy);
- PlaySoundLevel(x, y, SND_PACMAN_EATING_AMOEBA);
+ PlaySoundLevel(x, y, SND_PACMAN_EATING);
}
}
else if (element == EL_MOLE && IN_LEV_FIELD(newx, newy) &&
- (Feld[newx][newy] == EL_DEAMOEBING ||
- (Feld[newx][newy] == EL_LEERRAUM && Stop[newx][newy])))
+ (Feld[newx][newy] == EL_AMOEBA_SHRINKING ||
+ (Feld[newx][newy] == EL_EMPTY && Stop[newx][newy])))
{
/* wait for shrinking amoeba to completely disappear */
return;
TurnRound(x, y);
- if (element == EL_KAEFER || element == EL_FLIEGER ||
- element == EL_SP_SNIKSNAK || element == EL_MOLE)
+ if (element == EL_BUG || element == EL_SPACESHIP ||
+ element == EL_SP_SNIKSNAK)
DrawLevelField(x, y);
- else if (element == EL_BUTTERFLY || element == EL_FIREFLY)
- DrawGraphicAnimation(x, y, el2gfx(element), 2, 4, ANIM_NORMAL);
- else if (element == EL_SONDE)
-#if 0
- DrawGraphicAnimation(x, y, GFX_SONDE_START, 8, 2, ANIM_NORMAL);
-#else
- DrawNewGraphicAnimation(x, y, IMG_SATELLITE_MOVING);
-#endif
+ else if (element == EL_BUG || element == EL_SPACESHIP ||
+ element == EL_SP_SNIKSNAK || element == EL_MOLE)
+ DrawLevelField(x, y);
+ else if (element == EL_BD_BUTTERFLY || element == EL_BD_FIREFLY)
+ DrawGraphicAnimation(SCREENX(x), SCREENY(y), el2img(element));
+ else if (element == EL_SATELLITE)
+ DrawGraphicAnimation(SCREENX(x), SCREENY(y), IMG_SATELLITE);
else if (element == EL_SP_ELECTRON)
- DrawGraphicAnimation(x, y, GFX2_SP_ELECTRON, 8, 2, ANIM_NORMAL);
+ DrawGraphicAnimation(SCREENX(x), SCREENY(y), IMG_SP_ELECTRON);
if (DONT_TOUCH(element))
TestIfBadThingTouchesHero(x, y);
int direction = MovDir[x][y];
int dx = (direction == MV_LEFT ? -1 : direction == MV_RIGHT ? +1 : 0);
int dy = (direction == MV_UP ? -1 : direction == MV_DOWN ? +1 : 0);
- int horiz_move = (dx!=0);
+ int horiz_move = (dx != 0);
int newx = x + dx, newy = y + dy;
int step = (horiz_move ? dx : dy) * TILEX / 8;
- if (element == EL_TROPFEN || element == EL_AMOEBA_DRIPPING)
+ if (element == EL_AMOEBA_DROP || element == EL_AMOEBA_DRIPPING)
step /= 2;
else if (element == EL_QUICKSAND_FILLING ||
element == EL_QUICKSAND_EMPTYING)
step /= 4;
else if (element == EL_MAGIC_WALL_FILLING ||
- element == EL_MAGIC_WALL_BD_FILLING ||
+ element == EL_BD_MAGIC_WALL_FILLING ||
element == EL_MAGIC_WALL_EMPTYING ||
- element == EL_MAGIC_WALL_BD_EMPTYING)
+ element == EL_BD_MAGIC_WALL_EMPTYING)
step /= 2;
else if (CAN_FALL(element) && horiz_move &&
- y < lev_fieldy-1 && IS_BELT(Feld[x][y+1]))
+ y < lev_fieldy-1 && IS_BELT_ACTIVE(Feld[x][y+1]))
step /= 2;
- else if (element == EL_SPRING_MOVING)
- step*=2;
+ else if (element == EL_SPRING && horiz_move)
+ step *= 2;
#if OLD_GAME_BEHAVIOUR
else if (CAN_FALL(element) && horiz_move && !IS_SP_ELEMENT(element))
if (ABS(MovPos[x][y]) >= TILEX) /* object reached its destination */
{
- Feld[x][y] = EL_LEERRAUM;
+ Feld[x][y] = EL_EMPTY;
Feld[newx][newy] = element;
if (element == EL_MOLE)
{ 0, +1 }
};
- Feld[x][y] = EL_ERDREICH;
+ Feld[x][y] = EL_SAND;
DrawLevelField(x, y);
for(i=0; i<4; i++)
xx = x + xy[i][0];
yy = y + xy[i][1];
- if (IN_LEV_FIELD(xx, yy) && Feld[xx][yy] == EL_ERDREICH)
- DrawLevelField(xx, yy); /* for "ErdreichAnbroeckeln()" */
+ if (IN_LEV_FIELD(xx, yy) && Feld[xx][yy] == EL_SAND)
+ DrawLevelField(xx, yy); /* for "DrawCrumbledSand()" */
}
}
Feld[x][y] = EL_MAGIC_WALL_DEAD;
element = Feld[newx][newy] = Store[x][y];
}
- else if (element == EL_MAGIC_WALL_BD_FILLING)
+ else if (element == EL_BD_MAGIC_WALL_FILLING)
{
element = Feld[newx][newy] = get_next_element(element);
if (!game.magic_wall_active)
- element = Feld[newx][newy] = EL_MAGIC_WALL_BD_DEAD;
+ element = Feld[newx][newy] = EL_BD_MAGIC_WALL_DEAD;
Store[newx][newy] = Store[x][y];
}
- else if (element == EL_MAGIC_WALL_BD_EMPTYING)
+ else if (element == EL_BD_MAGIC_WALL_EMPTYING)
{
Feld[x][y] = get_next_element(element);
if (!game.magic_wall_active)
- Feld[x][y] = EL_MAGIC_WALL_BD_DEAD;
+ Feld[x][y] = EL_BD_MAGIC_WALL_DEAD;
element = Feld[newx][newy] = Store[x][y];
}
else if (element == EL_AMOEBA_DRIPPING)
Feld[x][y] = get_next_element(element);
element = Feld[newx][newy] = Store[x][y];
}
- else if (Store[x][y] == EL_SALZSAEURE)
+ else if (Store[x][y] == EL_ACID)
{
- element = Feld[newx][newy] = EL_SALZSAEURE;
+ element = Feld[newx][newy] = EL_ACID;
}
Store[x][y] = 0;
MovPos[x][y] = MovDir[x][y] = MovDelay[x][y] = 0;
MovDelay[newx][newy] = 0;
+ GfxAction[newx][newy] = GfxAction[x][y]; /* keep action one frame */
+ GfxAction[x][y] = GFX_ACTION_DEFAULT;
+
+#if 0
if (!CAN_MOVE(element))
MovDir[newx][newy] = 0;
+#else
+ /*
+ if (CAN_FALL(element) && MovDir[newx][newy] == MV_DOWN)
+ MovDir[newx][newy] = 0;
+ */
+
+ if (!CAN_MOVE(element) ||
+ (element == EL_SPRING && MovDir[newx][newy] == MV_DOWN))
+ MovDir[newx][newy] = 0;
+#endif
DrawLevelField(x, y);
DrawLevelField(newx, newy);
TestIfBadThingTouchesFriend(newx, newy);
TestIfBadThingTouchesOtherBadThing(newx, newy);
}
- else if (element == EL_PINGUIN)
+ else if (element == EL_PENGUIN)
TestIfFriendTouchesBadThing(newx, newy);
if (CAN_SMASH(element) && direction == MV_DOWN &&
Impact(x, newy);
}
else /* still moving on */
+ {
+#if 0
+ if (GfxAction[x][y] == GFX_ACTION_DEFAULT)
+ {
+ printf("reset GfxAction...\n");
+
+ GfxAction[x][y] = GFX_ACTION_MOVING;
+ }
+#endif
+
DrawLevelField(x, y);
+ }
}
int AmoebeNachbarNr(int ax, int ay)
if (!IN_LEV_FIELD(x, y))
continue;
- if ((Feld[x][y] == EL_AMOEBE_VOLL ||
- Feld[x][y] == EL_AMOEBE_BD ||
- Feld[x][y] == EL_AMOEBE_TOT) &&
+ if ((Feld[x][y] == EL_AMOEBA_FULL ||
+ Feld[x][y] == EL_BD_AMOEBA ||
+ Feld[x][y] == EL_AMOEBA_DEAD) &&
AmoebaNr[x][y] != new_group_nr)
{
int old_group_nr = AmoebaNr[x][y];
{
int i, x, y;
- if (Feld[ax][ay] == EL_AMOEBE_TOT)
+ if (Feld[ax][ay] == EL_AMOEBA_DEAD)
{
int group_nr = AmoebaNr[ax][ay];
{
for (x=0; x<lev_fieldx; x++)
{
- if (Feld[x][y] == EL_AMOEBE_TOT && AmoebaNr[x][y] == group_nr)
+ if (Feld[x][y] == EL_AMOEBA_DEAD && AmoebaNr[x][y] == group_nr)
{
AmoebaNr[x][y] = 0;
- Feld[x][y] = EL_AMOEBA2DIAM;
+ Feld[x][y] = EL_AMOEBA_TO_DIAMOND;
}
}
}
if (!IN_LEV_FIELD(x, y))
continue;
- if (Feld[x][y] == EL_AMOEBA2DIAM)
+ if (Feld[x][y] == EL_AMOEBA_TO_DIAMOND)
{
PlaySoundLevel(x, y, (IS_GEM(level.amoeba_content) ?
SND_AMOEBA_TURNING_TO_GEM :
for (x=0; x<lev_fieldx; x++)
{
if (AmoebaNr[x][y] == group_nr &&
- (Feld[x][y] == EL_AMOEBE_TOT ||
- Feld[x][y] == EL_AMOEBE_BD ||
- Feld[x][y] == EL_AMOEBING))
+ (Feld[x][y] == EL_AMOEBA_DEAD ||
+ Feld[x][y] == EL_BD_AMOEBA ||
+ Feld[x][y] == EL_AMOEBA_CREATING))
{
AmoebaNr[x][y] = 0;
Feld[x][y] = new_element;
if (DelayReached(&sound_delay, sound_delay_value))
{
- if (Store[x][y] == EL_AMOEBE_BD)
+ if (Store[x][y] == EL_BD_AMOEBA)
PlaySoundLevel(x, y, SND_BD_AMOEBA_CREATING);
else
PlaySoundLevel(x, y, SND_AMOEBA_CREATING);
{
MovDelay[x][y]--;
if (MovDelay[x][y]/2 && IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
- DrawGraphic(SCREENX(x), SCREENY(y), GFX_AMOEBING + 3 - MovDelay[x][y]/2);
+ {
+ int frame = getGraphicAnimationFrame(IMG_AMOEBA_CREATING,
+ 6 - MovDelay[x][y]);
+
+ DrawGraphic(SCREENX(x), SCREENY(y), IMG_AMOEBA_CREATING, frame);
+ }
if (!MovDelay[x][y])
{
{
MovDelay[x][y]--;
if (MovDelay[x][y]/2 && IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
- DrawGraphic(SCREENX(x), SCREENY(y), GFX_AMOEBING + MovDelay[x][y]/2);
+ {
+ int frame = getGraphicAnimationFrame(IMG_AMOEBA_SHRINKING,
+ 6 - MovDelay[x][y]);
+
+ DrawGraphic(SCREENX(x), SCREENY(y), IMG_AMOEBA_SHRINKING, frame);
+ }
if (!MovDelay[x][y])
{
- Feld[x][y] = EL_LEERRAUM;
+ Feld[x][y] = EL_EMPTY;
DrawLevelField(x, y);
/* don't let mole enter this field in this cycle;
if (!level.amoeba_speed)
{
- Feld[ax][ay] = EL_AMOEBE_TOT;
+ Feld[ax][ay] = EL_AMOEBA_DEAD;
DrawLevelField(ax, ay);
return;
}
return;
}
- if (element == EL_AMOEBE_NASS) /* object is an acid / amoeba drop */
+ if (element == EL_AMOEBA_WET) /* object is an acid / amoeba drop */
{
int start = RND(4);
int x = ax + xy[start][0];
return;
if (IS_FREE(x, y) ||
- Feld[x][y] == EL_ERDREICH || Feld[x][y] == EL_MORAST_LEER)
+ Feld[x][y] == EL_SAND || Feld[x][y] == EL_QUICKSAND_EMPTY)
{
newax = x;
neway = y;
continue;
if (IS_FREE(x, y) ||
- Feld[x][y] == EL_ERDREICH || Feld[x][y] == EL_MORAST_LEER)
+ Feld[x][y] == EL_SAND || Feld[x][y] == EL_QUICKSAND_EMPTY)
{
newax = x;
neway = y;
{
if (i == 4 && (!waiting_for_player || game.emulation == EMU_BOULDERDASH))
{
- Feld[ax][ay] = EL_AMOEBE_TOT;
+ Feld[ax][ay] = EL_AMOEBA_DEAD;
DrawLevelField(ax, ay);
AmoebaCnt[AmoebaNr[ax][ay]]--;
if (AmoebaCnt[AmoebaNr[ax][ay]] <= 0) /* amoeba is completely dead */
{
- if (element == EL_AMOEBE_VOLL)
+ if (element == EL_AMOEBA_FULL)
AmoebeUmwandeln(ax, ay);
- else if (element == EL_AMOEBE_BD)
+ else if (element == EL_BD_AMOEBA)
AmoebeUmwandelnBD(ax, ay, level.amoeba_content);
}
}
return;
}
- else if (element == EL_AMOEBE_VOLL || element == EL_AMOEBE_BD)
+ else if (element == EL_AMOEBA_FULL || element == EL_BD_AMOEBA)
{
/* amoeba gets larger by growing in some direction */
/* if amoeba touches other amoeba(s) after growing, unify them */
AmoebenVereinigen(newax, neway);
- if (element == EL_AMOEBE_BD && AmoebaCnt2[new_group_nr] >= 200)
+ if (element == EL_BD_AMOEBA && AmoebaCnt2[new_group_nr] >= 200)
{
AmoebeUmwandelnBD(newax, neway, EL_BD_ROCK);
return;
}
}
- if (element != EL_AMOEBE_NASS || neway < ay || !IS_FREE(newax, neway) ||
+ if (element != EL_AMOEBA_WET || neway < ay || !IS_FREE(newax, neway) ||
(neway == lev_fieldy - 1 && newax != ax))
{
- Feld[newax][neway] = EL_AMOEBING; /* simple growth of new amoeba tile */
+ Feld[newax][neway] = EL_AMOEBA_CREATING; /* creation of new amoeba */
Store[newax][neway] = element;
}
else if (neway == ay)
{
- Feld[newax][neway] = EL_TROPFEN; /* drop left or right from amoeba */
- PlaySoundLevel(newax, neway, SND_AMOEBA_DROPPING);
+ Feld[newax][neway] = EL_AMOEBA_DROP; /* drop left/right of amoeba */
+ PlaySoundLevel(newax, neway, SND_AMOEBA_DROP_CREATING);
}
else
{
- InitMovingField(ax, ay, MV_DOWN); /* drop dripping out of amoeba */
+ InitMovingField(ax, ay, MV_DOWN); /* drop dripping from amoeba */
Feld[ax][ay] = EL_AMOEBA_DRIPPING;
- Store[ax][ay] = EL_TROPFEN;
+ Store[ax][ay] = EL_AMOEBA_DROP;
ContinueMoving(ax, ay);
return;
}
continue;
if (((Feld[x][y] == element ||
- (element == EL_LIFE && IS_PLAYER(x, y))) &&
+ (element == EL_GAMEOFLIFE && IS_PLAYER(x, y))) &&
!Stop[x][y]) ||
(IS_FREE(x, y) && Stop[x][y]))
nachbarn++;
{
if (nachbarn < life[0] || nachbarn > life[1])
{
- Feld[xx][yy] = EL_LEERRAUM;
+ Feld[xx][yy] = EL_EMPTY;
if (!Stop[xx][yy])
DrawLevelField(xx, yy);
Stop[xx][yy] = TRUE;
changed = TRUE;
}
}
- else if (IS_FREE(xx, yy) || Feld[xx][yy] == EL_ERDREICH)
+ else if (IS_FREE(xx, yy) || Feld[xx][yy] == EL_SAND)
{ /* free border field */
if (nachbarn >= life[2] && nachbarn <= life[3])
{
Feld[xx][yy] = element;
- MovDelay[xx][yy] = (element == EL_LIFE ? 0 : life_time-1);
+ MovDelay[xx][yy] = (element == EL_GAMEOFLIFE ? 0 : life_time-1);
if (!Stop[xx][yy])
DrawLevelField(xx, yy);
Stop[xx][yy] = TRUE;
}
if (changed)
- PlaySoundLevel(ax, ay, element == EL_LIFE ? SND_GAMEOFLIFE_CREATING :
+ PlaySoundLevel(ax, ay, element == EL_GAMEOFLIFE ? SND_GAMEOFLIFE_CREATING :
SND_BIOMAZE_CREATING);
}
if (MovDelay[x][y])
{
if (IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
- DrawGraphic(SCREENX(x), SCREENY(y), GFX_ABLENK+MovDelay[x][y]%4);
- if (!(MovDelay[x][y]%4))
- PlaySoundLevel(x, y, SND_ROBOT_WHEEL_RUNNING);
+ {
+ int frame = getGraphicAnimationFrame(IMG_ROBOT_WHEEL_ACTIVE, -1);
+
+ DrawGraphic(SCREENX(x), SCREENY(y), IMG_ROBOT_WHEEL_ACTIVE, frame);
+ }
+
+ PlaySoundLevel(x, y, SND_ROBOT_WHEEL_ACTIVE);
+
return;
}
}
- Feld[x][y] = EL_ABLENK_AUS;
+ Feld[x][y] = EL_ROBOT_WHEEL;
DrawLevelField(x, y);
+
if (ZX == x && ZY == y)
ZX = ZY = -1;
}
if (MovDelay[x][y])
{
if (IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
- DrawGraphic(SCREENX(x), SCREENY(y),
- GFX_TIMEGATE_SWITCH + MovDelay[x][y]%4);
- if (!(MovDelay[x][y]%4))
- PlaySoundLevel(x, y, SND_TIMEGATE_WHEEL_RUNNING);
+ {
+ int frame = getGraphicAnimationFrame(IMG_TIMEGATE_SWITCH_ACTIVE, -1);
+
+ DrawGraphic(SCREENX(x), SCREENY(y), IMG_TIMEGATE_SWITCH_ACTIVE, frame);
+ }
+
+ PlaySoundLevel(x, y, SND_TIMEGATE_SWITCH_ACTIVE);
+
return;
}
}
- Feld[x][y] = EL_TIMEGATE_SWITCH_OFF;
+ Feld[x][y] = EL_TIMEGATE_SWITCH;
DrawLevelField(x, y);
+
+ /* !!! THIS LOOKS WRONG !!! */
if (ZX == x && ZY == y)
ZX = ZY = -1;
}
-void Birne(int x, int y)
+void NussKnacken(int x, int y)
{
if (!MovDelay[x][y]) /* next animation frame */
- MovDelay[x][y] = 800;
+ MovDelay[x][y] = 7;
if (MovDelay[x][y]) /* wait some time before next frame */
{
MovDelay[x][y]--;
if (MovDelay[x][y])
{
- if (!(MovDelay[x][y]%5))
+ if (IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
{
- if (!(MovDelay[x][y]%10))
- Feld[x][y]=EL_ABLENK_EIN;
- else
- Feld[x][y]=EL_ABLENK_AUS;
- DrawLevelField(x, y);
- Feld[x][y]=EL_ABLENK_EIN;
+ int frame = getGraphicAnimationFrame(IMG_NUT_CRACKING,
+ 6 - MovDelay[x][y]);
+
+ DrawGraphic(SCREENX(x), SCREENY(y), IMG_NUT_CRACKING, frame);
}
+
return;
}
}
- Feld[x][y]=EL_ABLENK_AUS;
+ Feld[x][y] = EL_EMERALD;
DrawLevelField(x, y);
- if (ZX == x && ZY == y)
- ZX=ZY=-1;
-}
-
-void Blubber(int x, int y)
-{
- if (y > 0 && IS_MOVING(x, y-1) && MovDir[x][y-1] == MV_DOWN)
- DrawLevelField(x, y-1);
- else
- DrawGraphicAnimation(x, y, GFX_GEBLUBBER, 4, 10, ANIM_NORMAL);
}
-void NussKnacken(int x, int y)
+void BreakingPearl(int x, int y)
{
if (!MovDelay[x][y]) /* next animation frame */
- MovDelay[x][y] = 7;
+ MovDelay[x][y] = 9;
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)))
- DrawGraphic(SCREENX(x), SCREENY(y),
- GFX_CRACKINGNUT + 3 - MovDelay[x][y]/2);
-
- if (!MovDelay[x][y])
+ if (MovDelay[x][y])
{
- Feld[x][y] = EL_EDELSTEIN;
- DrawLevelField(x, y);
+ if (IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
+ {
+ int frame = getGraphicAnimationFrame(IMG_PEARL_BREAKING,
+ 8 - MovDelay[x][y]);
+
+ DrawGraphic(SCREENX(x), SCREENY(y), IMG_PEARL_BREAKING, frame);
+ }
+
+ return;
}
}
+
+ Feld[x][y] = EL_EMPTY;
+ DrawLevelField(x, y);
}
-void BreakingPearl(int x, int y)
+void SiebAktivieren(int x, int y, int type)
{
- if (!MovDelay[x][y]) /* next animation frame */
- MovDelay[x][y] = 9;
-
- 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)))
- DrawGraphic(SCREENX(x), SCREENY(y),
- GFX_PEARL_BREAKING + 4 - MovDelay[x][y]/2);
+ int graphic = (type == 1 ? IMG_MAGIC_WALL_FULL : IMG_BD_MAGIC_WALL_FULL);
- if (!MovDelay[x][y])
- {
- Feld[x][y] = EL_LEERRAUM;
- DrawLevelField(x, y);
- }
- }
+ DrawGraphicAnimation(SCREENX(x), SCREENY(y), graphic);
}
-void SiebAktivieren(int x, int y, int typ)
+void AusgangstuerPruefen(int x, int y)
{
- int graphic = (typ == 1 ? GFX_MAGIC_WALL_FULL : GFX_MAGIC_WALL_BD_FULL) + 3;
+ if (local_player->gems_still_needed > 0 ||
+ local_player->sokobanfields_still_needed > 0 ||
+ local_player->lights_still_needed > 0)
+ return;
+
+ Feld[x][y] = EL_EXIT_OPENING;
- DrawGraphicAnimation(x, y, graphic, 4, 4, ANIM_REVERSE);
+ PlaySoundLevel(x < LEVELX(BX1) ? LEVELX(BX1) :
+ (x > LEVELX(BX2) ? LEVELX(BX2) : x),
+ y < LEVELY(BY1) ? LEVELY(BY1) :
+ (y > LEVELY(BY2) ? LEVELY(BY2) : y),
+ SND_EXIT_OPENING);
}
-void AusgangstuerPruefen(int x, int y)
+void AusgangstuerPruefen_SP(int x, int y)
{
- if (!local_player->gems_still_needed &&
- !local_player->sokobanfields_still_needed &&
- !local_player->lights_still_needed)
- {
- Feld[x][y] = EL_AUSGANG_ACT;
+ if (local_player->gems_still_needed > 0)
+ return;
- PlaySoundLevel(x < LEVELX(BX1) ? LEVELX(BX1) :
- (x > LEVELX(BX2) ? LEVELX(BX2) : x),
- y < LEVELY(BY1) ? LEVELY(BY1) :
- (y > LEVELY(BY2) ? LEVELY(BY2) : y),
- SND_EXIT_OPENING);
- }
+ Feld[x][y] = EL_SP_EXIT_OPEN;
+
+ PlaySoundLevel(x < LEVELX(BX1) ? LEVELX(BX1) :
+ (x > LEVELX(BX2) ? LEVELX(BX2) : x),
+ y < LEVELY(BY1) ? LEVELY(BY1) :
+ (y > LEVELY(BY2) ? LEVELY(BY2) : y),
+ SND_SP_EXIT_OPENING);
}
void AusgangstuerOeffnen(int x, int y)
int delay = 6;
if (!MovDelay[x][y]) /* next animation frame */
- MovDelay[x][y] = 5*delay;
+ MovDelay[x][y] = 5 * delay;
if (MovDelay[x][y]) /* wait some time before next frame */
{
int tuer;
MovDelay[x][y]--;
- tuer = MovDelay[x][y]/delay;
- if (!(MovDelay[x][y]%delay) && IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
- DrawGraphic(SCREENX(x), SCREENY(y), GFX_AUSGANG_AUF-tuer);
+ tuer = MovDelay[x][y] / delay;
- if (!MovDelay[x][y])
+ if (!(MovDelay[x][y] % delay))
{
- Feld[x][y] = EL_AUSGANG_AUF;
- DrawLevelField(x, y);
+ if (IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
+ {
+ int frame = getGraphicAnimationFrame(IMG_EXIT_OPENING,
+ 29 - MovDelay[x][y]);
+
+ DrawGraphic(SCREENX(x), SCREENY(y), IMG_EXIT_OPENING, frame);
+ }
}
+
+ if (MovDelay[x][y])
+ return;
}
-}
-void AusgangstuerBlinken(int x, int y)
-{
- DrawGraphicAnimation(x, y, GFX_AUSGANG_AUF, 4, 4, ANIM_PINGPONG);
+ Feld[x][y] = EL_EXIT_OPEN;
+ DrawLevelField(x, y);
}
void OpenSwitchgate(int x, int y)
if (MovDelay[x][y]) /* wait some time before next frame */
{
- int phase;
-
MovDelay[x][y]--;
- phase = MovDelay[x][y] / delay;
- if (!(MovDelay[x][y] % delay) && IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
- DrawGraphic(SCREENX(x), SCREENY(y), GFX_SWITCHGATE_OPEN - phase);
- if (!MovDelay[x][y])
+ if (!(MovDelay[x][y] % delay))
{
- Feld[x][y] = EL_SWITCHGATE_OPEN;
- DrawLevelField(x, y);
+ if (IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
+ {
+ int frame = getGraphicAnimationFrame(IMG_SWITCHGATE_OPENING,
+ 29 - MovDelay[x][y]);
+
+ DrawGraphic(SCREENX(x), SCREENY(y), IMG_SWITCHGATE_OPENING, frame);
+ }
}
+
+ if (MovDelay[x][y])
+ return;
}
+
+ Feld[x][y] = EL_SWITCHGATE_OPEN;
+ DrawLevelField(x, y);
}
void CloseSwitchgate(int x, int y)
if (MovDelay[x][y]) /* wait some time before next frame */
{
- int phase;
-
MovDelay[x][y]--;
- phase = MovDelay[x][y] / delay;
- if (!(MovDelay[x][y] % delay) && IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
- DrawGraphic(SCREENX(x), SCREENY(y), GFX_SWITCHGATE_CLOSED + phase);
- if (!MovDelay[x][y])
+ if (!(MovDelay[x][y] % delay))
{
- Feld[x][y] = EL_SWITCHGATE_CLOSED;
- DrawLevelField(x, y);
+ if (IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
+ {
+ int frame = getGraphicAnimationFrame(IMG_SWITCHGATE_CLOSING,
+ 29 - MovDelay[x][y]);
+
+ DrawGraphic(SCREENX(x), SCREENY(y), IMG_SWITCHGATE_CLOSING, frame);
+ }
}
+
+ if (MovDelay[x][y])
+ return;
}
+
+ Feld[x][y] = EL_SWITCHGATE_CLOSED;
+ DrawLevelField(x, y);
}
void OpenTimegate(int x, int y)
if (MovDelay[x][y]) /* wait some time before next frame */
{
- int phase;
-
MovDelay[x][y]--;
- phase = MovDelay[x][y] / delay;
- if (!(MovDelay[x][y] % delay) && IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
- DrawGraphic(SCREENX(x), SCREENY(y), GFX_TIMEGATE_OPEN - phase);
- if (!MovDelay[x][y])
+ if (!(MovDelay[x][y] % delay))
{
- Feld[x][y] = EL_TIMEGATE_OPEN;
- DrawLevelField(x, y);
+ if (IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
+ {
+ int frame = getGraphicAnimationFrame(IMG_TIMEGATE_OPENING,
+ 29 - MovDelay[x][y]);
+
+ DrawGraphic(SCREENX(x), SCREENY(y), IMG_TIMEGATE_OPENING, frame);
+ }
}
+
+ if (MovDelay[x][y])
+ return;
}
+
+ Feld[x][y] = EL_TIMEGATE_OPEN;
+ DrawLevelField(x, y);
}
void CloseTimegate(int x, int y)
if (MovDelay[x][y]) /* wait some time before next frame */
{
- int phase;
-
MovDelay[x][y]--;
- phase = MovDelay[x][y] / delay;
- if (!(MovDelay[x][y] % delay) && IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
- DrawGraphic(SCREENX(x), SCREENY(y), GFX_TIMEGATE_CLOSED + phase);
- if (!MovDelay[x][y])
+ if (!(MovDelay[x][y] % delay))
{
- Feld[x][y] = EL_TIMEGATE_CLOSED;
- DrawLevelField(x, y);
+ if (IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
+ {
+ int frame = getGraphicAnimationFrame(IMG_TIMEGATE_CLOSING,
+ 29 - MovDelay[x][y]);
+
+ DrawGraphic(SCREENX(x), SCREENY(y), IMG_TIMEGATE_CLOSING, frame);
+ }
}
+
+ if (MovDelay[x][y])
+ return;
}
+
+ Feld[x][y] = EL_TIMEGATE_CLOSED;
+ DrawLevelField(x, y);
}
static void CloseAllOpenTimegates()
if (!IN_SCR_FIELD(SCREENX(x), SCREENY(y)) || IS_MOVING(x, y))
return;
- if (Feld[x][y] == EL_EDELSTEIN_BD)
- DrawGraphicAnimation(x, y, GFX_EDELSTEIN_BD, 4, 4, ANIM_REVERSE);
+ if (Feld[x][y] == EL_BD_DIAMOND)
+ DrawGraphicAnimation(SCREENX(x), SCREENY(y), IMG_BD_DIAMOND);
else
{
if (!MovDelay[x][y]) /* next animation frame */
if (setup.direct_draw && MovDelay[x][y])
SetDrawtoField(DRAW_BUFFERED);
- DrawGraphic(SCREENX(x), SCREENY(y), el2gfx(Feld[x][y]));
+#if 0
+ DrawGraphic(SCREENX(x), SCREENY(y), el2img(Feld[x][y]), 0);
+#else
+ DrawGraphicAnimation(SCREENX(x), SCREENY(y), el2img(Feld[x][y]));
+#endif
if (MovDelay[x][y])
{
- int phase = (MovDelay[x][y]-1)/2;
+ int frame = getGraphicAnimationFrame(IMG_TWINKLE_WHITE,
+ 10 - MovDelay[x][y]);
- if (phase > 2)
- phase = 4-phase;
-
- DrawGraphicThruMask(SCREENX(x), SCREENY(y), GFX_FUNKELN_WEISS + phase);
+ DrawGraphicThruMask(SCREENX(x), SCREENY(y), IMG_TWINKLE_WHITE, frame);
if (setup.direct_draw)
{
int dest_x, dest_y;
- dest_x = FX + SCREENX(x)*TILEX;
- dest_y = FY + SCREENY(y)*TILEY;
+ dest_x = FX + SCREENX(x) * TILEX;
+ dest_y = FY + SCREENY(y) * TILEY;
BlitBitmap(drawto_field, window,
dest_x, dest_y, TILEX, TILEY, dest_x, dest_y);
int delay = 6;
if (!MovDelay[x][y]) /* next animation frame */
- MovDelay[x][y] = 3*delay;
+ MovDelay[x][y] = 3 * delay;
if (MovDelay[x][y]) /* wait some time before next frame */
{
- int phase;
-
MovDelay[x][y]--;
- phase = 2-MovDelay[x][y]/delay;
- if (!(MovDelay[x][y]%delay) && IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
- DrawGraphic(SCREENX(x), SCREENY(y),
- (MovDir[x][y] == MV_LEFT ? GFX_MAUER_LEFT :
- MovDir[x][y] == MV_RIGHT ? GFX_MAUER_RIGHT :
- MovDir[x][y] == MV_UP ? GFX_MAUER_UP :
- GFX_MAUER_DOWN ) + phase);
+
+ if (IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
+ {
+ int graphic = el_dir2img(Feld[x][y], MovDir[x][y]);
+ int frame = getGraphicAnimationFrame(graphic, 17 - MovDelay[x][y]);
+
+ DrawGraphic(SCREENX(x), SCREENY(y), graphic, frame);
+ }
if (!MovDelay[x][y])
{
if (MovDir[x][y] == MV_LEFT)
{
- if (IN_LEV_FIELD(x-1, y) && IS_MAUER(Feld[x-1][y]))
- DrawLevelField(x-1, y);
+ if (IN_LEV_FIELD(x - 1, y) && IS_MAUER(Feld[x - 1][y]))
+ DrawLevelField(x - 1, y);
}
else if (MovDir[x][y] == MV_RIGHT)
{
- if (IN_LEV_FIELD(x+1, y) && IS_MAUER(Feld[x+1][y]))
- DrawLevelField(x+1, y);
+ if (IN_LEV_FIELD(x + 1, y) && IS_MAUER(Feld[x + 1][y]))
+ DrawLevelField(x + 1, y);
}
else if (MovDir[x][y] == MV_UP)
{
- if (IN_LEV_FIELD(x, y-1) && IS_MAUER(Feld[x][y-1]))
- DrawLevelField(x, y-1);
+ if (IN_LEV_FIELD(x, y - 1) && IS_MAUER(Feld[x][y - 1]))
+ DrawLevelField(x, y - 1);
}
else
{
- if (IN_LEV_FIELD(x, y+1) && IS_MAUER(Feld[x][y+1]))
- DrawLevelField(x, y+1);
+ if (IN_LEV_FIELD(x, y + 1) && IS_MAUER(Feld[x][y + 1]))
+ DrawLevelField(x, y + 1);
}
Feld[x][y] = Store[x][y];
if (IN_LEV_FIELD(ax+1, ay) && IS_FREE(ax+1, ay))
rechts_frei = TRUE;
- if (element == EL_MAUER_Y || element == EL_MAUER_XY)
+ if (element == EL_WALL_GROWING_Y || element == EL_WALL_GROWING_XY)
{
if (oben_frei)
{
- Feld[ax][ay-1] = EL_MAUERND;
+ Feld[ax][ay-1] = EL_WALL_GROWING_ACTIVE;
Store[ax][ay-1] = element;
MovDir[ax][ay-1] = MV_UP;
if (IN_SCR_FIELD(SCREENX(ax), SCREENY(ay-1)))
- DrawGraphic(SCREENX(ax), SCREENY(ay-1), GFX_MAUER_UP);
+ DrawGraphic(SCREENX(ax), SCREENY(ay - 1),
+ IMG_WALL_GROWING_ACTIVE_UP, 0);
new_wall = TRUE;
}
if (unten_frei)
{
- Feld[ax][ay+1] = EL_MAUERND;
+ Feld[ax][ay+1] = EL_WALL_GROWING_ACTIVE;
Store[ax][ay+1] = element;
MovDir[ax][ay+1] = MV_DOWN;
if (IN_SCR_FIELD(SCREENX(ax), SCREENY(ay+1)))
- DrawGraphic(SCREENX(ax), SCREENY(ay+1), GFX_MAUER_DOWN);
+ DrawGraphic(SCREENX(ax), SCREENY(ay + 1),
+ IMG_WALL_GROWING_ACTIVE_DOWN, 0);
new_wall = TRUE;
}
}
- if (element == EL_MAUER_X || element == EL_MAUER_XY ||
- element == EL_MAUER_LEBT)
+ if (element == EL_WALL_GROWING_X || element == EL_WALL_GROWING_XY ||
+ element == EL_WALL_GROWING)
{
if (links_frei)
{
- Feld[ax-1][ay] = EL_MAUERND;
+ Feld[ax-1][ay] = EL_WALL_GROWING_ACTIVE;
Store[ax-1][ay] = element;
MovDir[ax-1][ay] = MV_LEFT;
if (IN_SCR_FIELD(SCREENX(ax-1), SCREENY(ay)))
- DrawGraphic(SCREENX(ax-1), SCREENY(ay), GFX_MAUER_LEFT);
+ DrawGraphic(SCREENX(ax - 1), SCREENY(ay),
+ IMG_WALL_GROWING_ACTIVE_LEFT, 0);
new_wall = TRUE;
}
if (rechts_frei)
{
- Feld[ax+1][ay] = EL_MAUERND;
+ Feld[ax+1][ay] = EL_WALL_GROWING_ACTIVE;
Store[ax+1][ay] = element;
MovDir[ax+1][ay] = MV_RIGHT;
if (IN_SCR_FIELD(SCREENX(ax+1), SCREENY(ay)))
- DrawGraphic(SCREENX(ax+1), SCREENY(ay), GFX_MAUER_RIGHT);
+ DrawGraphic(SCREENX(ax + 1), SCREENY(ay),
+ IMG_WALL_GROWING_ACTIVE_RIGHT, 0);
new_wall = TRUE;
}
}
- if (element == EL_MAUER_LEBT && (links_frei || rechts_frei))
+ if (element == EL_WALL_GROWING && (links_frei || rechts_frei))
DrawLevelField(ax, ay);
if (!IN_LEV_FIELD(ax, ay-1) || IS_MAUER(Feld[ax][ay-1]))
rechts_massiv = TRUE;
if (((oben_massiv && unten_massiv) ||
- element == EL_MAUER_X || element == EL_MAUER_LEBT) &&
+ element == EL_WALL_GROWING_X || element == EL_WALL_GROWING) &&
((links_massiv && rechts_massiv) ||
- element == EL_MAUER_Y))
- Feld[ax][ay] = EL_MAUERWERK;
+ element == EL_WALL_GROWING_Y))
+ Feld[ax][ay] = EL_WALL;
if (new_wall)
PlaySoundLevel(ax, ay, SND_WALL_GROWING);
int xx = x + j*xy[i][0], yy = y + j*xy[i][1];
if (IN_LEV_FIELD(xx, yy) &&
- (Feld[xx][yy] == EL_BURNING || Feld[xx][yy] == EL_DRACHE))
+ (Feld[xx][yy] == EL_FLAMES || Feld[xx][yy] == EL_DRAGON))
{
- if (Feld[xx][yy] == EL_DRACHE)
+ if (Feld[xx][yy] == EL_DRAGON)
dragon_found = TRUE;
}
else
{
int xx = x + j*xy[i][0], yy = y + j*xy[i][1];
- if (IN_LEV_FIELD(xx, yy) && Feld[xx][yy] == EL_BURNING)
+ if (IN_LEV_FIELD(xx, yy) && Feld[xx][yy] == EL_FLAMES)
{
- Feld[xx][yy] = EL_LEERRAUM;
+ Feld[xx][yy] = EL_EMPTY;
DrawLevelField(xx, yy);
}
else
{
int element = Feld[x][y];
- if (element == EL_SP_BUG)
+ if (element == EL_SP_BUGGY_BASE)
{
if (!MovDelay[x][y]) /* wait some time before activating base */
MovDelay[x][y] = 2 * FRAMES_PER_SECOND + RND(5 * FRAMES_PER_SECOND);
{
MovDelay[x][y]--;
if (MovDelay[x][y] < 5 && IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
- DrawGraphic(SCREENX(x), SCREENY(y), GFX_SP_BUG_WARNING);
+ DrawGraphic(SCREENX(x), SCREENY(y), IMG_SP_BUGGY_BASE, 0);
if (MovDelay[x][y])
return;
- Feld[x][y] = EL_SP_BUG_ACTIVE;
+ Feld[x][y] = EL_SP_BUGGY_BASE_ACTIVE;
}
}
- else if (element == EL_SP_BUG_ACTIVE)
+ else if (element == EL_SP_BUGGY_BASE_ACTIVE)
{
if (!MovDelay[x][y]) /* start activating buggy base */
MovDelay[x][y] = 1 * FRAMES_PER_SECOND + RND(1 * FRAMES_PER_SECOND);
};
if (IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
- DrawGraphic(SCREENX(x),SCREENY(y), GFX_SP_BUG_ACTIVE + SimpleRND(4));
+ {
+ int graphic = IMG_SP_BUGGY_BASE_ACTIVE;
+ int frame = getGraphicAnimationFrame(graphic, SimpleRND(100));
+
+ DrawGraphic(SCREENX(x), SCREENY(y), graphic, frame);
+ }
for (i=0; i<4; i++)
{
if (IS_PLAYER(xx, yy))
{
- PlaySoundLevel(x, y, SND_SP_BUGGY_BASE_ACTIVATING);
+ PlaySoundLevel(x, y, SND_SP_BUGGY_BASE_ACTIVE);
break;
}
}
return;
}
- Feld[x][y] = EL_SP_BUG;
+ Feld[x][y] = EL_SP_BUGGY_BASE;
DrawLevelField(x, y);
}
}
{
int element = Feld[x][y];
- if (element == EL_TRAP_INACTIVE)
+ if (element == EL_TRAP)
{
if (!MovDelay[x][y]) /* wait some time before activating trap */
MovDelay[x][y] = 2 * FRAMES_PER_SECOND + RND(5 * FRAMES_PER_SECOND);
{
if (!(MovDelay[x][y] % delay))
{
- int phase = MovDelay[x][y]/delay;
-
- if (phase >= num_frames/2)
- phase = num_frames - phase;
-
if (IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
{
- DrawGraphic(SCREENX(x),SCREENY(y), GFX_TRAP_INACTIVE + phase - 1);
- ErdreichAnbroeckeln(SCREENX(x), SCREENY(y));
+ int graphic = IMG_TRAP_ACTIVE;
+ int frame = getGraphicAnimationFrame(graphic, 31 - MovDelay[x][y]);
+
+ DrawGraphic(SCREENX(x),SCREENY(y), graphic, frame);
+ DrawCrumbledSand(SCREENX(x), SCREENY(y));
}
}
return;
}
- Feld[x][y] = EL_TRAP_INACTIVE;
+ Feld[x][y] = EL_TRAP;
DrawLevelField(x, y);
}
}
static void DrawBeltAnimation(int x, int y, int element)
{
- int belt_nr = getBeltNrFromElement(element);
+ int belt_nr = getBeltNrFromBeltActiveElement(element);
int belt_dir = game.belt_dir[belt_nr];
if (belt_dir != MV_NO_MOVING)
{
- int delay = 2;
- int mode = (belt_dir == MV_LEFT ? ANIM_NORMAL : ANIM_REVERSE);
- int graphic = el2gfx(element) + (belt_dir == MV_LEFT ? 0 : 7);
+ int graphic = el2img(element);
- DrawGraphicAnimation(x, y, graphic, 8, delay, mode);
+ DrawGraphicAnimation(SCREENX(x), SCREENY(y), graphic);
if (!(FrameCounter % 2))
- PlaySoundLevel(x, y, SND_CONVEYOR_BELT_RUNNING);
+ PlaySoundLevel(x, y, SND_CONVEYOR_BELT_ACTIVE);
}
}
*/
#endif
+ /* if the player does not move for some time, reset animation to start */
if (++player->frame_reset_delay > player->move_delay_value)
player->Frame = 0;
}
if (IN_LEV_FIELD(jx+dx, jy) && IS_PUSHABLE(Feld[jx+dx][jy]))
{
int el = Feld[jx+dx][jy];
- int push_delay = (IS_SB_ELEMENT(el) || el == EL_SONDE ? 2 :
+ int push_delay = (IS_SB_ELEMENT(el) || el == EL_SATELLITE ? 2 :
(el == EL_BALLOON || el == EL_SPRING) ? 0 : 10);
if (tape.delay_played + push_delay >= tape.pos[tape.counter].delay)
static unsigned long action_delay = 0;
unsigned long action_delay_value;
int sieb_x = 0, sieb_y = 0;
- int i, x, y, element;
+ int i, x, y, element, graphic;
byte *recorded_player_action;
byte summarized_player_action = 0;
for (y=0; y<lev_fieldy; y++) for (x=0; x<lev_fieldx; x++)
{
element = Feld[x][y];
+ graphic = el2img(element);
if (IS_INACTIVE(element))
+ {
+
+#if 1
+ if (new_graphic_info[graphic].anim_frames > 1)
+ DrawGraphicAnimation(SCREENX(x), SCREENY(y), graphic);
+#endif
+
continue;
+ }
if (!IS_MOVING(x, y) && (CAN_FALL(element) || CAN_MOVE(element)))
{
StartMoving(x, y);
+#if 1
+ if (Feld[x][y] == EL_EMERALD &&
+ new_graphic_info[graphic].anim_frames > 1 &&
+ !IS_MOVING(x, y))
+ DrawGraphicAnimation(SCREENX(x), SCREENY(y), graphic);
+#endif
+
if (IS_GEM(element) || element == EL_SP_INFOTRON)
EdelsteinFunkeln(x, y);
}
+
+#if 1
+ else if ((element == EL_ACID ||
+ element == EL_EXIT_OPEN ||
+ element == EL_SP_EXIT_OPEN ||
+ element == EL_SP_TERMINAL ||
+ element == EL_SP_TERMINAL_ACTIVE ||
+ element == EL_EXTRA_TIME ||
+ element == EL_SHIELD_NORMAL ||
+ element == EL_SHIELD_DEADLY) &&
+ new_graphic_info[graphic].anim_frames > 1)
+ DrawGraphicAnimation(SCREENX(x), SCREENY(y), graphic);
+#endif
+
else if (IS_MOVING(x, y))
ContinueMoving(x, y);
else if (IS_ACTIVE_BOMB(element))
CheckDynamite(x, y);
#if 0
- else if (element == EL_EXPLODING && !game.explosions_delayed)
+ else if (element == EL_EXPLOSION && !game.explosions_delayed)
Explode(x, y, Frame[x][y], EX_NORMAL);
#endif
- else if (element == EL_AMOEBING)
+ else if (element == EL_AMOEBA_CREATING)
AmoebeWaechst(x, y);
- else if (element == EL_DEAMOEBING)
+ else if (element == EL_AMOEBA_SHRINKING)
AmoebaDisappearing(x, y);
#if !USE_NEW_AMOEBA_CODE
AmoebeAbleger(x, y);
#endif
- else if (element == EL_LIFE || element == EL_LIFE_ASYNC)
+ else if (element == EL_GAMEOFLIFE || element == EL_BIOMAZE)
Life(x, y);
- else if (element == EL_ABLENK_EIN)
+ else if (element == EL_ROBOT_WHEEL_ACTIVE)
RobotWheel(x, y);
- else if (element == EL_TIMEGATE_SWITCH_ON)
+ else if (element == EL_TIMEGATE_SWITCH_ACTIVE)
TimegateWheel(x, y);
- else if (element == EL_SALZSAEURE)
- Blubber(x, y);
- else if (element == EL_BLURB_LEFT || element == EL_BLURB_RIGHT)
+ else if (element == EL_ACID_SPLASH_LEFT ||
+ element == EL_ACID_SPLASH_RIGHT)
Blurb(x, y);
- else if (element == EL_CRACKINGNUT)
+ else if (element == EL_NUT_CRACKING)
NussKnacken(x, y);
else if (element == EL_PEARL_BREAKING)
BreakingPearl(x, y);
- else if (element == EL_AUSGANG_ZU)
+ else if (element == EL_EXIT_CLOSED)
AusgangstuerPruefen(x, y);
- else if (element == EL_AUSGANG_ACT)
+ else if (element == EL_SP_EXIT_CLOSED)
+ AusgangstuerPruefen_SP(x, y);
+ else if (element == EL_EXIT_OPENING)
AusgangstuerOeffnen(x, y);
- else if (element == EL_AUSGANG_AUF)
- AusgangstuerBlinken(x, y);
- else if (element == EL_MAUERND)
+ else if (element == EL_WALL_GROWING_ACTIVE)
MauerWaechst(x, y);
- else if (element == EL_MAUER_LEBT ||
- element == EL_MAUER_X ||
- element == EL_MAUER_Y ||
- element == EL_MAUER_XY)
+ else if (element == EL_WALL_GROWING ||
+ element == EL_WALL_GROWING_X ||
+ element == EL_WALL_GROWING_Y ||
+ element == EL_WALL_GROWING_XY)
MauerAbleger(x, y);
- else if (element == EL_BURNING)
+ else if (element == EL_FLAMES)
CheckForDragon(x, y);
- else if (element == EL_SP_BUG || element == EL_SP_BUG_ACTIVE)
+ else if (element == EL_SP_BUGGY_BASE || element == EL_SP_BUGGY_BASE_ACTIVE)
CheckBuggyBase(x, y);
- else if (element == EL_TRAP_INACTIVE || element == EL_TRAP_ACTIVE)
+ else if (element == EL_TRAP || element == EL_TRAP_ACTIVE)
CheckTrap(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)
- DrawGraphicAnimation(x, y, GFX2_SP_TERMINAL_ACTIVE, 7, 4, ANIM_NORMAL);
- else if (IS_BELT(element))
+ else if (IS_BELT_ACTIVE(element))
DrawBeltAnimation(x, y, element);
else if (element == EL_SWITCHGATE_OPENING)
OpenSwitchgate(x, y);
OpenTimegate(x, y);
else if (element == EL_TIMEGATE_CLOSING)
CloseTimegate(x, y);
- else if (element == EL_EXTRA_TIME)
- DrawGraphicAnimation(x, y, GFX_EXTRA_TIME, 6, 4, ANIM_NORMAL);
- else if (element == EL_SHIELD_PASSIVE)
- {
- DrawGraphicAnimation(x, y, GFX_SHIELD_PASSIVE, 6, 4, ANIM_NORMAL);
-#if 0
- if (!(FrameCounter % 4))
- PlaySoundLevel(x, y, SND_SHIELD_PASSIVE_ACTIVATED);
-#endif
- }
- else if (element == EL_SHIELD_ACTIVE)
- {
- DrawGraphicAnimation(x, y, GFX_SHIELD_ACTIVE, 6, 4, ANIM_NORMAL);
-#if 0
- if (!(FrameCounter % 4))
- PlaySoundLevel(x, y, SND_SHIELD_ACTIVE_ACTIVATED);
+
+#if 1
+ else if (new_graphic_info[graphic].anim_frames > 1)
+ DrawGraphicAnimation(SCREENX(x), SCREENY(y), graphic);
#endif
- }
if (game.magic_wall_active)
{
int jx = local_player->jx, jy = local_player->jy;
if (element == EL_MAGIC_WALL_FULL ||
- element == EL_MAGIC_WALL_EMPTY ||
+ element == EL_MAGIC_WALL_ACTIVE ||
element == EL_MAGIC_WALL_EMPTYING)
{
SiebAktivieren(x, y, 1);
sieb = TRUE;
}
- else if (element == EL_MAGIC_WALL_BD_FULL ||
- element == EL_MAGIC_WALL_BD_EMPTY ||
- element == EL_MAGIC_WALL_BD_EMPTYING)
+ else if (element == EL_BD_MAGIC_WALL_FULL ||
+ element == EL_BD_MAGIC_WALL_ACTIVE ||
+ element == EL_BD_MAGIC_WALL_EMPTYING)
{
SiebAktivieren(x, y, 2);
sieb = TRUE;
element = Feld[x][y];
if (!IS_PLAYER(x,y) &&
- (element == EL_LEERRAUM ||
- element == EL_ERDREICH ||
- element == EL_MORAST_LEER ||
- element == EL_BLURB_LEFT ||
- element == EL_BLURB_RIGHT))
+ (element == EL_EMPTY ||
+ element == EL_SAND ||
+ element == EL_QUICKSAND_EMPTY ||
+ element == EL_ACID_SPLASH_LEFT ||
+ element == EL_ACID_SPLASH_RIGHT))
{
- if ((IN_LEV_FIELD(x, y-1) && Feld[x][y-1] == EL_AMOEBE_NASS) ||
- (IN_LEV_FIELD(x-1, y) && Feld[x-1][y] == EL_AMOEBE_NASS) ||
- (IN_LEV_FIELD(x+1, y) && Feld[x+1][y] == EL_AMOEBE_NASS) ||
- (IN_LEV_FIELD(x, y+1) && Feld[x][y+1] == EL_AMOEBE_NASS))
- Feld[x][y] = EL_TROPFEN;
+ if ((IN_LEV_FIELD(x, y-1) && Feld[x][y-1] == EL_AMOEBA_WET) ||
+ (IN_LEV_FIELD(x-1, y) && Feld[x-1][y] == EL_AMOEBA_WET) ||
+ (IN_LEV_FIELD(x+1, y) && Feld[x+1][y] == EL_AMOEBA_WET) ||
+ (IN_LEV_FIELD(x, y+1) && Feld[x][y+1] == EL_AMOEBA_WET))
+ Feld[x][y] = EL_AMOEBA_DROP;
}
random = random * 129 + 1;
if (ExplodeField[x][y])
Explode(x, y, EX_PHASE_START, ExplodeField[x][y]);
- else if (element == EL_EXPLODING)
+ else if (element == EL_EXPLOSION)
Explode(x, y, Frame[x][y], EX_NORMAL);
ExplodeField[x][y] = EX_NO_EXPLOSION;
{
int element = Feld[sieb_x][sieb_y];
- if (element == EL_MAGIC_WALL_BD_FULL ||
- element == EL_MAGIC_WALL_BD_EMPTY ||
- element == EL_MAGIC_WALL_BD_EMPTYING)
- PlaySoundLevel(sieb_x, sieb_y, SND_BD_MAGIC_WALL_RUNNING);
+ if (element == EL_BD_MAGIC_WALL_FULL ||
+ element == EL_BD_MAGIC_WALL_ACTIVE ||
+ element == EL_BD_MAGIC_WALL_EMPTYING)
+ PlaySoundLevel(sieb_x, sieb_y, SND_BD_MAGIC_WALL_ACTIVE);
else
- PlaySoundLevel(sieb_x, sieb_y, SND_MAGIC_WALL_RUNNING);
+ PlaySoundLevel(sieb_x, sieb_y, SND_MAGIC_WALL_ACTIVE);
}
if (game.magic_wall_time_left > 0)
{
element = Feld[x][y];
- if (element == EL_MAGIC_WALL_EMPTY ||
+ if (element == EL_MAGIC_WALL_ACTIVE ||
element == EL_MAGIC_WALL_FULL)
{
Feld[x][y] = EL_MAGIC_WALL_DEAD;
DrawLevelField(x, y);
}
- else if (element == EL_MAGIC_WALL_BD_EMPTY ||
- element == EL_MAGIC_WALL_BD_FULL)
+ else if (element == EL_BD_MAGIC_WALL_ACTIVE ||
+ element == EL_BD_MAGIC_WALL_FULL)
{
- Feld[x][y] = EL_MAGIC_WALL_BD_DEAD;
+ Feld[x][y] = EL_BD_MAGIC_WALL_DEAD;
DrawLevelField(x, y);
}
}
game.light_time_left--;
if (game.light_time_left == 0)
- {
- for (y=0; y<lev_fieldy; y++) for (x=0; x<lev_fieldx; x++)
- {
- element = Feld[x][y];
-
- if (element == EL_LIGHT_SWITCH_ON)
- {
- Feld[x][y] = EL_LIGHT_SWITCH_OFF;
- DrawLevelField(x, y);
- }
- else if (element == EL_INVISIBLE_STEEL ||
- element == EL_UNSICHTBAR ||
- element == EL_SAND_INVISIBLE)
- DrawLevelField(x, y);
- }
- }
+ RedrawAllLightSwitchesAndInvisibleElements();
}
if (game.timegate_time_left > 0)
if (SHIELD_ON(player))
{
- if (player->shield_active_time_left)
- PlaySoundLevel(player->jx, player->jy, SND_SHIELD_ACTIVE_ACTIVATED);
- else if (player->shield_passive_time_left)
- PlaySoundLevel(player->jx, player->jy, SND_SHIELD_PASSIVE_ACTIVATED);
+ if (player->shield_deadly_time_left)
+ PlaySoundLevel(player->jx, player->jy, SND_SHIELD_DEADLY_ACTIVE);
+ else if (player->shield_normal_time_left)
+ PlaySoundLevel(player->jx, player->jy, SND_SHIELD_NORMAL_ACTIVE);
}
}
if (SHIELD_ON(player))
{
- player->shield_passive_time_left--;
+ player->shield_normal_time_left--;
- if (player->shield_active_time_left > 0)
- player->shield_active_time_left--;
+ if (player->shield_deadly_time_left > 0)
+ player->shield_deadly_time_left--;
}
}
for (y=BY1; y<=BY2; y++)
DrawScreenField(x, y);
}
+
if (dy)
{
y = (dy == 1 ? BY1 : BY2);
boolean player_is_moving_to_valid_field =
(IN_LEV_FIELD(new_jx, new_jy) &&
(Feld[new_jx][new_jy] == EL_SP_BASE ||
- Feld[new_jx][new_jy] == EL_ERDREICH));
+ Feld[new_jx][new_jy] == EL_SAND));
if (field_under_player_is_free &&
!player_is_moving_to_valid_field &&
if (DONT_GO_TO(element))
{
- if (element == EL_SALZSAEURE && dx == 0 && dy == 1)
+ if (element == EL_ACID && dx == 0 && dy == 1)
{
Blurb(jx, jy);
- Feld[jx][jy] = EL_SPIELFIGUR;
+ Feld[jx][jy] = EL_PLAYER1;
InitMovingField(jx, jy, MV_DOWN);
- Store[jx][jy] = EL_SALZSAEURE;
+ Store[jx][jy] = EL_ACID;
ContinueMoving(jx, jy);
BuryHero(player);
}
if (!(moved & MF_MOVING) && !player->Pushing)
player->Frame = 0;
else
+#if 0
player->Frame = (player->Frame + 1) % 4;
+#else
+ player->Frame += 1 * 0;
+#endif
if (moved & MF_MOVING)
{
else if (old_jx == jx && old_jy != jy)
player->MovDir = (old_jy < jy ? MV_DOWN : MV_UP);
- DrawLevelField(jx, jy); /* for "ErdreichAnbroeckeln()" */
+ DrawLevelField(jx, jy); /* for "DrawCrumbledSand()" */
player->last_move_dir = player->MovDir;
player->is_moving = TRUE;
{
player->actual_frame_counter = FrameCounter;
player->GfxPos = move_stepsize * (player->MovPos / move_stepsize);
+ if (player->Frame)
+ player->Frame += 1;
- if (Feld[last_jx][last_jy] == EL_LEERRAUM)
+ if (Feld[last_jx][last_jy] == EL_EMPTY)
Feld[last_jx][last_jy] = EL_PLAYER_IS_LEAVING;
DrawPlayer(player);
player->MovPos += (player->MovPos > 0 ? -1 : 1) * move_stepsize;
player->GfxPos = move_stepsize * (player->MovPos / move_stepsize);
+ player->Frame += 1;
if (Feld[last_jx][last_jy] == EL_PLAYER_IS_LEAVING)
- Feld[last_jx][last_jy] = EL_LEERRAUM;
+ Feld[last_jx][last_jy] = EL_EMPTY;
/* before DrawPlayer() to draw correct player graphic for this case */
if (player->MovPos == 0)
player->last_jx = jx;
player->last_jy = jy;
- if (Feld[jx][jy] == EL_AUSGANG_AUF)
+ if (Feld[jx][jy] == EL_EXIT_OPEN ||
+ Feld[jx][jy] == EL_SP_EXIT_OPEN)
{
RemoveHero(player);
- if (!local_player->friends_still_needed)
+ if (local_player->friends_still_needed == 0 ||
+ Feld[jx][jy] == EL_SP_EXIT_OPEN)
player->LevelSolved = player->GameOver = TRUE;
}
{
struct PlayerInfo *player = PLAYERINFO(good_x, good_y);
- if (player->shield_active_time_left > 0)
+ if (player->shield_deadly_time_left > 0)
Bang(kill_x, kill_y);
else if (!PLAYER_PROTECTED(good_x, good_y))
KillHero(player);
MV_DOWN
};
- if (bad_element == EL_EXPLODING) /* skip just exploding bad things */
+ if (bad_element == EL_EXPLOSION) /* skip just exploding bad things */
return;
for (i=0; i<4; i++)
kill_y = test_y;
break;
}
- else if (test_element == EL_PINGUIN)
+ else if (test_element == EL_PENGUIN)
{
kill_x = test_x;
kill_y = test_y;
;
#endif
- if (player->shield_active_time_left > 0)
+ if (player->shield_deadly_time_left > 0)
Bang(bad_x, bad_y);
else if (!PLAYER_PROTECTED(kill_x, kill_y))
KillHero(player);
continue;
element = Feld[x][y];
- if (IS_AMOEBOID(element) || element == EL_LIFE ||
- element == EL_AMOEBING || element == EL_TROPFEN)
+ if (IS_AMOEBOID(element) || element == EL_GAMEOFLIFE ||
+ element == EL_AMOEBA_CREATING || element == EL_AMOEBA_DROP)
{
kill_x = x;
kill_y = y;
return;
if (IS_PFORTE(Feld[jx][jy]))
- Feld[jx][jy] = EL_LEERRAUM;
+ Feld[jx][jy] = EL_EMPTY;
/* deactivate shield (else Bang()/Explode() would not work right) */
- player->shield_passive_time_left = 0;
- player->shield_active_time_left = 0;
+ player->shield_normal_time_left = 0;
+ player->shield_deadly_time_left = 0;
Bang(jx, jy);
BuryHero(player);
int i = 0;
int tube_leave_directions[][2] =
{
- { EL_TUBE_CROSS, MV_LEFT | MV_RIGHT | MV_UP | MV_DOWN },
- { EL_TUBE_VERTICAL, MV_UP | MV_DOWN },
- { EL_TUBE_HORIZONTAL, MV_LEFT | MV_RIGHT },
- { EL_TUBE_VERT_LEFT, MV_LEFT | MV_UP | MV_DOWN },
- { EL_TUBE_VERT_RIGHT, MV_RIGHT | MV_UP | MV_DOWN },
- { EL_TUBE_HORIZ_UP, MV_LEFT | MV_RIGHT | MV_UP },
- { EL_TUBE_HORIZ_DOWN, MV_LEFT | MV_RIGHT | MV_DOWN },
- { EL_TUBE_LEFT_UP, MV_LEFT | MV_UP },
- { EL_TUBE_LEFT_DOWN, MV_LEFT | MV_DOWN },
- { EL_TUBE_RIGHT_UP, MV_RIGHT | MV_UP },
- { EL_TUBE_RIGHT_DOWN, MV_RIGHT | MV_DOWN },
- { -1, MV_LEFT | MV_RIGHT | MV_UP | MV_DOWN }
+ { EL_TUBE_ALL, MV_LEFT | MV_RIGHT | MV_UP | MV_DOWN },
+ { EL_TUBE_VERTICAL, MV_UP | MV_DOWN },
+ { EL_TUBE_HORIZONTAL, MV_LEFT | MV_RIGHT },
+ { EL_TUBE_VERTICAL_LEFT, MV_LEFT | MV_UP | MV_DOWN },
+ { EL_TUBE_VERTICAL_RIGHT, MV_RIGHT | MV_UP | MV_DOWN },
+ { EL_TUBE_HORIZONTAL_UP, MV_LEFT | MV_RIGHT | MV_UP },
+ { EL_TUBE_HORIZONTAL_DOWN, MV_LEFT | MV_RIGHT | MV_DOWN },
+ { EL_TUBE_LEFT_UP, MV_LEFT | MV_UP },
+ { EL_TUBE_LEFT_DOWN, MV_LEFT | MV_DOWN },
+ { EL_TUBE_RIGHT_UP, MV_RIGHT | MV_UP },
+ { EL_TUBE_RIGHT_DOWN, MV_RIGHT | MV_DOWN },
+ { -1, MV_LEFT | MV_RIGHT | MV_UP | MV_DOWN }
};
while (tube_leave_directions[i][0] != Feld[jx][jy])
switch (element)
{
- case EL_LEERRAUM:
- case EL_ERDREICH:
- case EL_SAND_INVISIBLE:
- case EL_TRAP_INACTIVE:
+ case EL_EMPTY:
+ case EL_SAND:
+ case EL_INVISIBLE_SAND:
+ case EL_INVISIBLE_SAND_ACTIVE:
+ case EL_TRAP:
case EL_SP_BASE:
- case EL_SP_BUG:
+ case EL_SP_BUGGY_BASE:
RemoveField(x, y);
PlaySoundLevelElementAction(x, y, element, SND_ACTION_DIGGING);
break;
- case EL_EDELSTEIN:
- case EL_EDELSTEIN_BD:
- case EL_EDELSTEIN_GELB:
- case EL_EDELSTEIN_ROT:
- case EL_EDELSTEIN_LILA:
- case EL_DIAMANT:
+ case EL_EMERALD:
+ case EL_BD_DIAMOND:
+ case EL_EMERALD_YELLOW:
+ case EL_EMERALD_RED:
+ case EL_EMERALD_PURPLE:
+ case EL_DIAMOND:
case EL_SP_INFOTRON:
case EL_PEARL:
case EL_CRYSTAL:
RemoveField(x, y);
- local_player->gems_still_needed -= (element == EL_DIAMANT ? 3 :
+ local_player->gems_still_needed -= (element == EL_DIAMOND ? 3 :
element == EL_PEARL ? 5 :
element == EL_CRYSTAL ? 8 : 1);
if (local_player->gems_still_needed < 0)
break;
case EL_ENVELOPE:
- Feld[x][y] = EL_LEERRAUM;
+ Feld[x][y] = EL_EMPTY;
PlaySoundLevel(x, y, SND_ENVELOPE_COLLECTING);
break;
PlaySoundStereo(SND_EXTRA_TIME_COLLECTING, SOUND_MAX_RIGHT);
break;
- case EL_SHIELD_PASSIVE:
+ case EL_SHIELD_NORMAL:
RemoveField(x, y);
- player->shield_passive_time_left += 10;
- PlaySoundLevel(x, y, SND_SHIELD_PASSIVE_COLLECTING);
+ player->shield_normal_time_left += 10;
+ PlaySoundLevel(x, y, SND_SHIELD_NORMAL_COLLECTING);
break;
- case EL_SHIELD_ACTIVE:
+ case EL_SHIELD_DEADLY:
RemoveField(x, y);
- player->shield_passive_time_left += 10;
- player->shield_active_time_left += 10;
- PlaySoundLevel(x, y, SND_SHIELD_ACTIVE_COLLECTING);
+ player->shield_normal_time_left += 10;
+ player->shield_deadly_time_left += 10;
+ PlaySoundLevel(x, y, SND_SHIELD_DEADLY_COLLECTING);
break;
- case EL_DYNAMITE_INACTIVE:
+ case EL_DYNAMITE:
case EL_SP_DISK_RED:
RemoveField(x, y);
player->dynamite++;
- RaiseScoreElement(EL_DYNAMITE_INACTIVE);
+ RaiseScoreElement(EL_DYNAMITE);
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_DYNAMITE_INACTIVE);
+ RaiseScoreElement(EL_DYNAMITE);
PlaySoundLevel(x, y, SND_DYNABOMB_NR_COLLECTING);
break;
case EL_DYNABOMB_SZ:
RemoveField(x, y);
player->dynabomb_size++;
- RaiseScoreElement(EL_DYNAMITE_INACTIVE);
+ RaiseScoreElement(EL_DYNAMITE);
PlaySoundLevel(x, y, SND_DYNABOMB_SZ_COLLECTING);
break;
case EL_DYNABOMB_XL:
RemoveField(x, y);
player->dynabomb_xl = TRUE;
- RaiseScoreElement(EL_DYNAMITE_INACTIVE);
+ RaiseScoreElement(EL_DYNAMITE);
PlaySoundLevel(x, y, SND_DYNABOMB_XL_COLLECTING);
break;
- case EL_SCHLUESSEL1:
- case EL_SCHLUESSEL2:
- case EL_SCHLUESSEL3:
- case EL_SCHLUESSEL4:
+ case EL_KEY1:
+ case EL_KEY2:
+ case EL_KEY3:
+ case EL_KEY4:
{
- int key_nr = element - EL_SCHLUESSEL1;
+ int key_nr = element - EL_KEY1;
RemoveField(x, y);
player->key[key_nr] = TRUE;
- RaiseScoreElement(EL_SCHLUESSEL);
+ RaiseScoreElement(element);
DrawMiniGraphicExt(drawto, DX_KEYS + key_nr * MINI_TILEX, DY_KEYS,
- GFX_SCHLUESSEL1 + key_nr);
+ IMG_KEY1 + key_nr);
DrawMiniGraphicExt(window, DX_KEYS + key_nr * MINI_TILEX, DY_KEYS,
- GFX_SCHLUESSEL1 + key_nr);
+ IMG_KEY1 + key_nr);
PlaySoundLevel(x, y, SND_KEY_COLLECTING);
break;
}
- case EL_EM_KEY_1:
- case EL_EM_KEY_2:
- case EL_EM_KEY_3:
- case EL_EM_KEY_4:
+ case EL_EM_KEY1:
+ case EL_EM_KEY2:
+ case EL_EM_KEY3:
+ case EL_EM_KEY4:
{
- int key_nr = element - EL_EM_KEY_1;
+ int key_nr = element - EL_EM_KEY1;
RemoveField(x, y);
player->key[key_nr] = TRUE;
- RaiseScoreElement(EL_SCHLUESSEL);
+ RaiseScoreElement(element);
DrawMiniGraphicExt(drawto, DX_KEYS + key_nr * MINI_TILEX, DY_KEYS,
- GFX_SCHLUESSEL1 + key_nr);
+ IMG_KEY1 + key_nr);
DrawMiniGraphicExt(window, DX_KEYS + key_nr * MINI_TILEX, DY_KEYS,
- GFX_SCHLUESSEL1 + key_nr);
+ IMG_KEY1 + key_nr);
PlaySoundLevel(x, y, SND_KEY_COLLECTING);
break;
}
- case EL_ABLENK_AUS:
- Feld[x][y] = EL_ABLENK_EIN;
+ case EL_ROBOT_WHEEL:
+ Feld[x][y] = EL_ROBOT_WHEEL_ACTIVE;
ZX = x;
ZY = y;
DrawLevelField(x, y);
}
break;
- case EL_BELT1_SWITCH_LEFT:
- case EL_BELT1_SWITCH_MIDDLE:
- case EL_BELT1_SWITCH_RIGHT:
- case EL_BELT2_SWITCH_LEFT:
- case EL_BELT2_SWITCH_MIDDLE:
- case EL_BELT2_SWITCH_RIGHT:
- case EL_BELT3_SWITCH_LEFT:
- case EL_BELT3_SWITCH_MIDDLE:
- case EL_BELT3_SWITCH_RIGHT:
- case EL_BELT4_SWITCH_LEFT:
- case EL_BELT4_SWITCH_MIDDLE:
- case EL_BELT4_SWITCH_RIGHT:
+ case EL_CONVEYOR_BELT1_SWITCH_LEFT:
+ case EL_CONVEYOR_BELT1_SWITCH_MIDDLE:
+ case EL_CONVEYOR_BELT1_SWITCH_RIGHT:
+ case EL_CONVEYOR_BELT2_SWITCH_LEFT:
+ case EL_CONVEYOR_BELT2_SWITCH_MIDDLE:
+ case EL_CONVEYOR_BELT2_SWITCH_RIGHT:
+ case EL_CONVEYOR_BELT3_SWITCH_LEFT:
+ case EL_CONVEYOR_BELT3_SWITCH_MIDDLE:
+ case EL_CONVEYOR_BELT3_SWITCH_RIGHT:
+ case EL_CONVEYOR_BELT4_SWITCH_LEFT:
+ case EL_CONVEYOR_BELT4_SWITCH_MIDDLE:
+ case EL_CONVEYOR_BELT4_SWITCH_RIGHT:
if (!player->Switching)
{
player->Switching = TRUE;
return MF_ACTION;
break;
- case EL_SWITCHGATE_SWITCH_1:
- case EL_SWITCHGATE_SWITCH_2:
+ case EL_SWITCHGATE_SWITCH_UP:
+ case EL_SWITCHGATE_SWITCH_DOWN:
if (!player->Switching)
{
player->Switching = TRUE;
return MF_ACTION;
break;
- case EL_LIGHT_SWITCH_OFF:
- case EL_LIGHT_SWITCH_ON:
+ case EL_LIGHT_SWITCH:
+ case EL_LIGHT_SWITCH_ACTIVE:
if (!player->Switching)
{
player->Switching = TRUE;
ToggleLightSwitch(x, y);
- PlaySoundLevel(x, y, element == EL_LIGHT_SWITCH_OFF ?
+ PlaySoundLevel(x, y, element == EL_LIGHT_SWITCH ?
SND_LIGHT_SWITCH_ACTIVATING :
SND_LIGHT_SWITCH_DEACTIVATING);
}
return MF_ACTION;
break;
- case EL_TIMEGATE_SWITCH_OFF:
+ case EL_TIMEGATE_SWITCH:
ActivateTimegateSwitch(x, y);
- PlaySoundLevel(x, y, SND_TIMEGATE_WHEEL_ACTIVATING);
+ PlaySoundLevel(x, y, SND_TIMEGATE_SWITCH_ACTIVATING);
return MF_ACTION;
break;
case EL_BALLOON_SEND_RIGHT:
case EL_BALLOON_SEND_UP:
case EL_BALLOON_SEND_DOWN:
- case EL_BALLOON_SEND_ANY:
- if (element == EL_BALLOON_SEND_ANY)
+ case EL_BALLOON_SEND_ANY_DIRECTION:
+ if (element == EL_BALLOON_SEND_ANY_DIRECTION)
game.balloon_dir = move_direction;
else
game.balloon_dir = (element == EL_BALLOON_SEND_LEFT ? MV_LEFT :
return MF_ACTION;
break;
- case EL_SP_EXIT:
- if (local_player->gems_still_needed > 0)
- return MF_NO_ACTION;
-
- player->LevelSolved = player->GameOver = TRUE;
- PlaySoundStereo(SND_SP_EXIT_ENTERING, SOUND_MAX_RIGHT);
- break;
-
/* the following elements cannot be pushed by "snapping" */
- case EL_FELSBROCKEN:
- case EL_BOMBE:
+ case EL_ROCK:
+ case EL_BOMB:
case EL_DX_SUPABOMB:
- case EL_KOKOSNUSS:
- case EL_ZEIT_LEER:
+ case EL_NUT:
+ case EL_TIME_ORB_EMPTY:
case EL_SP_ZONK:
case EL_SP_DISK_ORANGE:
case EL_SPRING:
else
{
RemoveField(x, y);
- Feld[x+dx][y+dy] = element;
+ Feld[x + dx][y + dy] = element;
}
if (element == EL_SPRING)
{
- Feld[x+dx][y+dy] = EL_SPRING_MOVING;
- MovDir[x+dx][y+dy] = move_direction;
+ Feld[x + dx][y + dy] = EL_SPRING;
+ MovDir[x + dx][y + dy] = move_direction;
}
player->push_delay_value = (element == EL_SPRING ? 0 : 2 + RND(8));
- DrawLevelField(x+dx, y+dy);
+ DrawLevelField(x + dx, y + dy);
PlaySoundLevelElementAction(x, y, element, SND_ACTION_PUSHING);
break;
- case EL_PFORTE1:
- case EL_PFORTE2:
- case EL_PFORTE3:
- case EL_PFORTE4:
- if (!player->key[element - EL_PFORTE1])
+ case EL_GATE1:
+ case EL_GATE2:
+ case EL_GATE3:
+ case EL_GATE4:
+ if (!player->key[element - EL_GATE1])
return MF_NO_ACTION;
break;
- case EL_PFORTE1X:
- case EL_PFORTE2X:
- case EL_PFORTE3X:
- case EL_PFORTE4X:
- if (!player->key[element - EL_PFORTE1X])
+ case EL_GATE1_GRAY:
+ case EL_GATE2_GRAY:
+ case EL_GATE3_GRAY:
+ case EL_GATE4_GRAY:
+ if (!player->key[element - EL_GATE1_GRAY])
return MF_NO_ACTION;
break;
- case EL_EM_GATE_1:
- case EL_EM_GATE_2:
- case EL_EM_GATE_3:
- case EL_EM_GATE_4:
- if (!player->key[element - EL_EM_GATE_1])
+ case EL_EM_GATE1:
+ case EL_EM_GATE2:
+ case EL_EM_GATE3:
+ case EL_EM_GATE4:
+ if (!player->key[element - EL_EM_GATE1])
return MF_NO_ACTION;
if (!IN_LEV_FIELD(x + dx, y + dy) || !IS_FREE(x + dx, y + dy))
return MF_NO_ACTION;
PlaySoundLevel(x, y, SND_GATE_PASSING);
break;
- case EL_EM_GATE_1X:
- case EL_EM_GATE_2X:
- case EL_EM_GATE_3X:
- case EL_EM_GATE_4X:
- if (!player->key[element - EL_EM_GATE_1X])
+ case EL_EM_GATE1_GRAY:
+ case EL_EM_GATE2_GRAY:
+ case EL_EM_GATE3_GRAY:
+ case EL_EM_GATE4_GRAY:
+ if (!player->key[element - EL_EM_GATE1_GRAY])
return MF_NO_ACTION;
if (!IN_LEV_FIELD(x + dx, y + dy) || !IS_FREE(x + dx, y + dy))
return MF_NO_ACTION;
PlaySoundLevel(x, y, SND_SP_PORT_PASSING);
break;
- case EL_TUBE_CROSS:
+ case EL_TUBE_ALL:
case EL_TUBE_VERTICAL:
case EL_TUBE_HORIZONTAL:
- case EL_TUBE_VERT_LEFT:
- case EL_TUBE_VERT_RIGHT:
- case EL_TUBE_HORIZ_UP:
- case EL_TUBE_HORIZ_DOWN:
+ case EL_TUBE_VERTICAL_LEFT:
+ case EL_TUBE_VERTICAL_RIGHT:
+ case EL_TUBE_HORIZONTAL_UP:
+ case EL_TUBE_HORIZONTAL_DOWN:
case EL_TUBE_LEFT_UP:
case EL_TUBE_LEFT_DOWN:
case EL_TUBE_RIGHT_UP:
int i = 0;
int tube_enter_directions[][2] =
{
- { EL_TUBE_CROSS, MV_LEFT | MV_RIGHT | MV_UP | MV_DOWN },
- { EL_TUBE_VERTICAL, MV_UP | MV_DOWN },
- { EL_TUBE_HORIZONTAL, MV_LEFT | MV_RIGHT },
- { EL_TUBE_VERT_LEFT, MV_RIGHT | MV_UP | MV_DOWN },
- { EL_TUBE_VERT_RIGHT, MV_LEFT | MV_UP | MV_DOWN },
- { EL_TUBE_HORIZ_UP, MV_LEFT | MV_RIGHT | MV_DOWN },
- { EL_TUBE_HORIZ_DOWN, MV_LEFT | MV_RIGHT | MV_UP },
- { EL_TUBE_LEFT_UP, MV_RIGHT | MV_DOWN },
- { EL_TUBE_LEFT_DOWN, MV_RIGHT | MV_UP },
- { EL_TUBE_RIGHT_UP, MV_LEFT | MV_DOWN },
- { EL_TUBE_RIGHT_DOWN, MV_LEFT | MV_UP },
- { -1, MV_NO_MOVING }
+ { EL_TUBE_ALL, MV_LEFT | MV_RIGHT | MV_UP | MV_DOWN },
+ { EL_TUBE_VERTICAL, MV_UP | MV_DOWN },
+ { EL_TUBE_HORIZONTAL, MV_LEFT | MV_RIGHT },
+ { EL_TUBE_VERTICAL_LEFT, MV_RIGHT | MV_UP | MV_DOWN },
+ { EL_TUBE_VERTICAL_RIGHT, MV_LEFT | MV_UP | MV_DOWN },
+ { EL_TUBE_HORIZONTAL_UP, MV_LEFT | MV_RIGHT | MV_DOWN },
+ { EL_TUBE_HORIZONTAL_DOWN, MV_LEFT | MV_RIGHT | MV_UP },
+ { EL_TUBE_LEFT_UP, MV_RIGHT | MV_DOWN },
+ { EL_TUBE_LEFT_DOWN, MV_RIGHT | MV_UP },
+ { EL_TUBE_RIGHT_UP, MV_LEFT | MV_DOWN },
+ { EL_TUBE_RIGHT_DOWN, MV_LEFT | MV_UP },
+ { -1, MV_NO_MOVING }
};
while (tube_enter_directions[i][0] != element)
}
break;
- case EL_AUSGANG_ZU:
- case EL_AUSGANG_ACT:
- /* door is not (yet) open */
+ case EL_EXIT_CLOSED:
+ case EL_SP_EXIT_CLOSED:
+ case EL_EXIT_OPENING:
return MF_NO_ACTION;
break;
- case EL_AUSGANG_AUF:
+ case EL_EXIT_OPEN:
+ case EL_SP_EXIT_OPEN:
if (mode == DF_SNAP)
return MF_NO_ACTION;
- PlaySoundLevel(x, y, SND_EXIT_ENTERING);
+ if (element == EL_EXIT_OPEN)
+ PlaySoundLevel(x, y, SND_EXIT_PASSING);
+ else
+ PlaySoundLevel(x, y, SND_SP_EXIT_PASSING);
break;
- case EL_BIRNE_AUS:
- Feld[x][y] = EL_BIRNE_EIN;
+ case EL_LAMP:
+ Feld[x][y] = EL_LAMP_ACTIVE;
local_player->lights_still_needed--;
DrawLevelField(x, y);
PlaySoundLevel(x, y, SND_LAMP_ACTIVATING);
return MF_ACTION;
break;
- case EL_ZEIT_VOLL:
- Feld[x][y] = EL_ZEIT_LEER;
+ case EL_TIME_ORB_FULL:
+ Feld[x][y] = EL_TIME_ORB_EMPTY;
TimeLeft += 10;
DrawText(DX_TIME, DY_TIME, int2str(TimeLeft, 3), FS_SMALL, FC_YELLOW);
DrawLevelField(x, y);
return MF_ACTION;
break;
- case EL_SOKOBAN_FELD_LEER:
+ case EL_SOKOBAN_FIELD_EMPTY:
break;
- case EL_SOKOBAN_OBJEKT:
- case EL_SOKOBAN_FELD_VOLL:
- case EL_SONDE:
+ case EL_SOKOBAN_OBJECT:
+ case EL_SOKOBAN_FIELD_FULL:
+ case EL_SATELLITE:
case EL_SP_DISK_YELLOW:
case EL_BALLOON:
if (mode == DF_SNAP)
if (!IN_LEV_FIELD(x+dx, y+dy)
|| (!IS_FREE(x+dx, y+dy)
- && (Feld[x+dx][y+dy] != EL_SOKOBAN_FELD_LEER
+ && (Feld[x+dx][y+dy] != EL_SOKOBAN_FIELD_EMPTY
|| !IS_SB_ELEMENT(element))))
return MF_NO_ACTION;
if (IS_SB_ELEMENT(element))
{
- if (element == EL_SOKOBAN_FELD_VOLL)
+ if (element == EL_SOKOBAN_FIELD_FULL)
{
- Feld[x][y] = EL_SOKOBAN_FELD_LEER;
+ Feld[x][y] = EL_SOKOBAN_FIELD_EMPTY;
local_player->sokobanfields_still_needed++;
}
else
RemoveField(x, y);
- if (Feld[x+dx][y+dy] == EL_SOKOBAN_FELD_LEER)
+ if (Feld[x+dx][y+dy] == EL_SOKOBAN_FIELD_EMPTY)
{
- Feld[x+dx][y+dy] = EL_SOKOBAN_FELD_VOLL;
+ Feld[x+dx][y+dy] = EL_SOKOBAN_FIELD_FULL;
local_player->sokobanfields_still_needed--;
- if (element == EL_SOKOBAN_OBJEKT)
+ if (element == EL_SOKOBAN_OBJECT)
PlaySoundLevel(x, y, SND_SOKOBAN_FIELD_FILLING);
else
PlaySoundLevel(x, y, SND_SOKOBAN_OBJECT_PUSHING);
}
else
{
- Feld[x+dx][y+dy] = EL_SOKOBAN_OBJEKT;
- if (element == EL_SOKOBAN_FELD_VOLL)
- PlaySoundLevel(x, y, SND_SOKOBAN_FIELD_CLEARING);
+ Feld[x+dx][y+dy] = EL_SOKOBAN_OBJECT;
+ if (element == EL_SOKOBAN_FIELD_FULL)
+ PlaySoundLevel(x, y, SND_SOKOBAN_FIELD_EMPTYING);
else
PlaySoundLevel(x, y, SND_SOKOBAN_OBJECT_PUSHING);
}
player->push_delay_value = (element == EL_BALLOON ? 0 : 2);
DrawLevelField(x, y);
- DrawLevelField(x+dx, y+dy);
+ DrawLevelField(x + dx, y + dy);
if (IS_SB_ELEMENT(element) &&
local_player->sokobanfields_still_needed == 0 &&
break;
- case EL_PINGUIN:
- case EL_SCHWEIN:
- case EL_DRACHE:
+ case EL_PENGUIN:
+ case EL_PIG:
+ case EL_DRAGON:
break;
default:
element = Feld[jx][jy];
if ((player->dynamite == 0 && player->dynabombs_left == 0) ||
- IS_ACTIVE_BOMB(element) || element == EL_EXPLODING)
+ IS_ACTIVE_BOMB(element) || element == EL_EXPLOSION)
return FALSE;
- if (element != EL_LEERRAUM)
+ if (element != EL_EMPTY)
Store[jx][jy] = element;
if (player->dynamite)
if (IN_SCR_FIELD(SCREENX(jx), SCREENY(jy)))
{
if (game.emulation == EMU_SUPAPLEX)
- DrawGraphic(SCREENX(jx), SCREENY(jy), GFX_SP_DISK_RED);
+ DrawGraphic(SCREENX(jx), SCREENY(jy), IMG_SP_DISK_RED, 0);
else
- DrawGraphicThruMask(SCREENX(jx), SCREENY(jy), GFX_DYNAMIT);
+ DrawGraphicThruMask(SCREENX(jx), SCREENY(jy), IMG_DYNAMITE_ACTIVE, 0);
}
- PlaySoundLevel(jx, jy, SND_DYNAMITE_PLACING);
+ PlaySoundLevel(jx, jy, SND_DYNAMITE_DROPPING);
}
else
{
- Feld[jx][jy] = EL_DYNABOMB_ACTIVE_1 + (player->element_nr - EL_SPIELER1);
+ Feld[jx][jy] =
+ EL_DYNABOMB_PLAYER1_ACTIVE + (player->element_nr - EL_PLAYER1);
MovDelay[jx][jy] = 96;
player->dynabombs_left--;
if (IN_SCR_FIELD(SCREENX(jx), SCREENY(jy)))
- DrawGraphicThruMask(SCREENX(jx), SCREENY(jy), GFX_DYNABOMB);
+ DrawGraphicThruMask(SCREENX(jx), SCREENY(jy), el2img(Feld[jx][jy]), 0);
- PlaySoundLevel(jx, jy, SND_DYNABOMB_PLACING);
+ PlaySoundLevel(jx, jy, SND_DYNABOMB_DROPPING);
}
return TRUE;
{
switch(element)
{
- case EL_EDELSTEIN:
- case EL_EDELSTEIN_BD:
- case EL_EDELSTEIN_GELB:
- case EL_EDELSTEIN_ROT:
- case EL_EDELSTEIN_LILA:
+ case EL_EMERALD:
+ case EL_BD_DIAMOND:
+ case EL_EMERALD_YELLOW:
+ case EL_EMERALD_RED:
+ case EL_EMERALD_PURPLE:
RaiseScore(level.score[SC_EDELSTEIN]);
break;
- case EL_DIAMANT:
+ case EL_DIAMOND:
RaiseScore(level.score[SC_DIAMANT]);
break;
- case EL_KAEFER:
- case EL_BUTTERFLY:
+ case EL_BUG:
+ case EL_BD_BUTTERFLY:
RaiseScore(level.score[SC_KAEFER]);
break;
- case EL_FLIEGER:
- case EL_FIREFLY:
+ case EL_SPACESHIP:
+ case EL_BD_FIREFLY:
RaiseScore(level.score[SC_FLIEGER]);
break;
- case EL_MAMPFER:
- case EL_MAMPFER2:
+ case EL_YAMYAM:
+ case EL_DARK_YAMYAM:
RaiseScore(level.score[SC_MAMPFER]);
break;
case EL_ROBOT:
case EL_PACMAN:
RaiseScore(level.score[SC_PACMAN]);
break;
- case EL_KOKOSNUSS:
+ case EL_NUT:
RaiseScore(level.score[SC_KOKOSNUSS]);
break;
- case EL_DYNAMITE_INACTIVE:
+ case EL_DYNAMITE:
RaiseScore(level.score[SC_DYNAMIT]);
break;
- case EL_SCHLUESSEL:
+ case EL_KEY1:
+ case EL_KEY2:
+ case EL_KEY3:
+ case EL_KEY4:
RaiseScore(level.score[SC_SCHLUESSEL]);
break;
default:
for (i=0; i<NUM_GAME_BUTTONS; i++)
{
- Bitmap *gd_bitmap = pix[PIX_DOOR];
+ Bitmap *gd_bitmap = new_graphic_info[IMG_MENU_DOOR].bitmap;
struct GadgetInfo *gi;
int button_type;
boolean checked;