GADGET_ID_USE_TIME_ORB_BUG,
GADGET_ID_USE_LIFE_BUGS,
GADGET_ID_RANDOM_BALL_CONTENT,
- GADGET_ID_INITIAL_BALL_STATE,
+ GADGET_ID_INITIAL_BALL_ACTIVE,
GADGET_ID_GROW_INTO_DIGGABLE,
GADGET_ID_SB_FIELDS_NEEDED,
GADGET_ID_SB_OBJECTS_NEEDED,
ED_CHECKBUTTON_ID_USE_TIME_ORB_BUG,
ED_CHECKBUTTON_ID_USE_LIFE_BUGS,
ED_CHECKBUTTON_ID_RANDOM_BALL_CONTENT,
- ED_CHECKBUTTON_ID_INITIAL_BALL_STATE,
+ ED_CHECKBUTTON_ID_INITIAL_BALL_ACTIVE,
ED_CHECKBUTTON_ID_GROW_INTO_DIGGABLE,
ED_CHECKBUTTON_ID_SB_FIELDS_NEEDED,
ED_CHECKBUTTON_ID_SB_OBJECTS_NEEDED,
},
{
ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(1),
- GADGET_ID_INITIAL_BALL_STATE, GADGET_ID_NONE,
- &level.ball_state_initial,
+ GADGET_ID_INITIAL_BALL_ACTIVE, GADGET_ID_NONE,
+ &level.ball_active_initial,
NULL, NULL,
"magic ball initially activated", "activate magic ball after level start"
},
DrawMagicBallContentAreas();
MapCheckbuttonGadget(ED_CHECKBUTTON_ID_RANDOM_BALL_CONTENT);
- MapCheckbuttonGadget(ED_CHECKBUTTON_ID_INITIAL_BALL_STATE);
+ MapCheckbuttonGadget(ED_CHECKBUTTON_ID_INITIAL_BALL_ACTIVE);
}
else if (properties_element == EL_EMC_ANDROID)
DrawAndroidElementArea(properties_element);
{
EL_EMC_MAGIC_BALL, -1,
TYPE_BOOLEAN, CONF_VALUE_8_BIT(2),
- &li.ball_state_initial, FALSE
+ &li.ball_active_initial, FALSE
},
{
EL_EMC_MAGIC_BALL, -1,
cav->android_move_time = level->android_move_time;
cav->android_clone_time = level->android_clone_time;
cav->ball_random = level->ball_random;
- cav->ball_state = level->ball_state_initial;
+ cav->ball_active = level->ball_active_initial;
cav->ball_time = level->ball_time;
cav->num_ball_arrays = level->num_ball_contents;
cav->wind_direction =
map_direction_RND_to_EM(level->wind_direction_initial);
- cav->wind_cnt = (level->wind_direction_initial != MV_NONE ?
- cav->wind_time : 0);
for (i = 0; i < MAX_ELEMENT_CONTENTS; i++)
for (j = 0; j < 8; j++)
level->android_move_time = cav->android_move_time;
level->android_clone_time = cav->android_clone_time;
level->ball_random = cav->ball_random;
- level->ball_state_initial = cav->ball_state;
+ level->ball_active_initial = cav->ball_active;
level->ball_time = cav->ball_time;
level->num_ball_contents = cav->num_ball_arrays;
break;
case EL_EMC_MAGIC_BALL:
- if (game.ball_state)
+ if (game.ball_active)
Feld[x][y] = EL_EMC_MAGIC_BALL_ACTIVE;
break;
case EL_EMC_MAGIC_BALL_SWITCH:
- if (game.ball_state)
+ if (game.ball_active)
Feld[x][y] = EL_EMC_MAGIC_BALL_SWITCH_ACTIVE;
break;
(exit_closed ? EL_EXIT_CLOSED : EL_EXIT_OPEN);
game_panel_controls[GAME_PANEL_EMC_MAGIC_BALL].value =
- (game.ball_state ? EL_EMC_MAGIC_BALL_ACTIVE : EL_EMC_MAGIC_BALL);
+ (game.ball_active ? EL_EMC_MAGIC_BALL_ACTIVE : EL_EMC_MAGIC_BALL);
game_panel_controls[GAME_PANEL_EMC_MAGIC_BALL_SWITCH].value =
- (game.ball_state ? EL_EMC_MAGIC_BALL_SWITCH_ACTIVE :
+ (game.ball_active ? EL_EMC_MAGIC_BALL_SWITCH_ACTIVE :
EL_EMC_MAGIC_BALL_SWITCH);
game_panel_controls[GAME_PANEL_LIGHT_SWITCH].value =
game.lenses_time_left = 0;
game.magnify_time_left = 0;
- game.ball_state = level.ball_state_initial;
+ game.ball_active = level.ball_active_initial;
game.ball_content_nr = 0;
game.explosions_delayed = TRUE;
{
int xx, yy;
- game.ball_state = !game.ball_state;
+ game.ball_active = !game.ball_active;
SCAN_PLAYFIELD(xx, yy)
{
int e = Feld[xx][yy];
- if (game.ball_state)
+ if (game.ball_active)
{
if (e == EL_EMC_MAGIC_BALL)
CreateField(xx, yy, EL_EMC_MAGIC_BALL_ACTIVE);
// values for the new EMC elements
int lenses_time_left;
int magnify_time_left;
- boolean ball_state;
+ boolean ball_active;
int ball_content_nr;
// values for player idle animation (no effect on engine)
cav.amoeba_time = 0;
cav.wonderwall_time = 0;
cav.wheel_time = 0;
- cav.wheel_x = 1;
- cav.wheel_y = 1;
+ cav.wheel_x = 0;
+ cav.wheel_y = 0;
cav.lenses_time = 0;
cav.magnify_time = 0;
- cav.wind_time = 9999;
+ cav.wind_time = 0;
cav.wind_direction = 0;
- cav.ball_random = 0;
- cav.ball_state = 0;
- cav.wonderwall_state = 0;
- cav.wheel_cnt = 0;
- cav.lenses_cnt = 0;
- cav.magnify_cnt = 0;
- cav.wind_cnt = 0;
-
- cav.num_ball_arrays = 8;
-
- cav.testmode = FALSE;
- cav.teamwork = FALSE;
- cav.infinite = FALSE;
+ cav.num_ball_arrays = 8;
+
+ cav.testmode = FALSE;
+ cav.teamwork = FALSE;
+ cav.infinite = FALSE;
+ cav.ball_random = FALSE;
+ cav.ball_active = FALSE;
+ cav.wonderwall_active = FALSE;
+ cav.wheel_active = FALSE;
+ cav.lenses_active = FALSE;
+ cav.magnify_active = FALSE;
for (i = 0; i < 8; i++)
for (j = 0; j < 9; j++)
int width; /* cave width */
int height; /* cave height */
- int player_x[MAX_PLAYERS]; /* player x pos */
- int player_y[MAX_PLAYERS]; /* player y pos */
+ int player_x[MAX_PLAYERS]; /* player x position */
+ int player_y[MAX_PLAYERS]; /* player y position */
int time_seconds; /* available time (seconds) */
int gems_needed; /* emeralds needed */
int magnify_score; /* score for collecting magnifier */
int exit_score; /* score for entering exit */
- int android_move_time; /* android move reset time */
- int android_clone_time; /* android clone reset time */
- int ball_time; /* ball reset time */
- int amoeba_time; /* amoeba speed */
- int wonderwall_time; /* wonderwall time */
- int wheel_time; /* wheel reset time */
- int wheel_x; /* wheel x pos */
- int wheel_y; /* wheel y pos */
- int lenses_time; /* lenses reset time */
- int magnify_time; /* magnify reset time */
- int wind_time; /* wind reset time */
+ int android_move_time; /* reset time for android movement */
+ int android_clone_time; /* reset time for android cloning */
+ int ball_time; /* reset time for ball activity */
+ int amoeba_time; /* amoeba growth speed */
+ int wonderwall_time; /* reset time for wonderwall activity */
+ int wheel_time; /* reset time for wheel activity */
+ int wheel_x; /* wheel x position */
+ int wheel_y; /* wheel y position */
+ int lenses_time; /* reset time for lenses activity */
+ int magnify_time; /* reset time for magnifier activity */
+ int wind_time; /* reset time for wind activity */
int wind_direction; /* wind direction */
- int ball_random; /* ball is random flag */
- int ball_state; /* ball active flag */
- int wonderwall_state; /* wonderwall active flag */
- int wheel_cnt; /* wheel counter */
- int lenses_cnt; /* lenses counter */
- int magnify_cnt; /* magnify counter */
- int wind_cnt; /* wind time counter */
-
int num_ball_arrays; /* number of ball data arrays used */
- boolean testmode; /* test mode */
- boolean teamwork; /* two player mode */
- boolean infinite; /* cave is infinitely wide */
+ boolean testmode; /* flag for test mode */
+ boolean teamwork; /* flag for two player mode */
+ boolean infinite; /* flag for infinitely wide cave */
+ boolean ball_random; /* flag if ball is random */
+ boolean ball_active; /* flag if ball is already active */
+ boolean wonderwall_active; /* flag if wonderwall is already active */
+ boolean wheel_active; /* flag if wheel is already active */
+ boolean lenses_active; /* flag if lenses are already active */
+ boolean magnify_active; /* flag if magnifier is already active */
short eater_array[8][9]; /* eater data */
short ball_array[8][8]; /* ball data */
lev.ball_time = cav.ball_time;
lev.ball_cnt = cav.ball_time;
- lev.ball_state = cav.ball_state;
+ lev.ball_active = cav.ball_active;
lev.ball_random = cav.ball_random;
lev.ball_pos = 0;
lev.shine_cnt = 0;
lev.lenses_time = cav.lenses_time;
- lev.lenses_cnt = cav.lenses_cnt;
+ lev.lenses_cnt = cav.lenses_active ? cav.lenses_time : 0;
lev.magnify_time = cav.magnify_time;
- lev.magnify_cnt = cav.magnify_cnt;
+ lev.magnify_cnt = cav.magnify_active ? cav.magnify_time : 0;
lev.wheel_time = cav.wheel_time;
- lev.wheel_cnt = cav.wheel_cnt;
+ lev.wheel_cnt = cav.wheel_active ? cav.wheel_time : 0;
lev.wheel_x = cav.wheel_x;
lev.wheel_y = cav.wheel_y;
lev.wind_time = cav.wind_time;
- lev.wind_cnt = cav.wind_cnt;
+ lev.wind_cnt = cav.wind_time;
lev.wind_direction = cav.wind_direction;
- lev.wonderwall_time = cav.wonderwall_time;
- lev.wonderwall_state = cav.wonderwall_state;
+ lev.wonderwall_time = cav.wonderwall_time;
+ lev.wonderwall_active = cav.wonderwall_active;
lev.killed_out_of_time = FALSE;
int magnify_score; /* score for collecting magnifier */
int exit_score; /* score for entering exit */
- int android_move_time; /* android move reset time */
- int android_clone_time; /* android clone reset time */
- int ball_time; /* ball reset time */
- int amoeba_time; /* amoeba speed */
- int wonderwall_time; /* wonderwall time */
- int wheel_time; /* wheel reset time */
- int wheel_x; /* wheel x pos */
- int wheel_y; /* wheel y pos */
- int lenses_time; /* lenses reset time */
- int magnify_time; /* magnify reset time */
- int wind_time; /* wind reset time */
+ int android_move_time; /* reset time for android movement */
+ int android_clone_time; /* reset time for android cloning */
+ int ball_time; /* reset time for ball activity */
+ int amoeba_time; /* amoeba growth speed */
+ int wonderwall_time; /* reset time for wonderwall activity */
+ int wheel_time; /* reset time for wheel activity */
+ int wheel_x; /* wheel x position */
+ int wheel_y; /* wheel y position */
+ int lenses_time; /* reset time for lenses activity */
+ int magnify_time; /* reset time for magnifier activity */
+ int wind_time; /* reset time for wind activity */
int wind_direction; /* wind direction */
- int ball_random; /* ball is random flag */
- int ball_state; /* ball active flag */
- int wonderwall_state; /* wonderwall active flag */
- int wheel_cnt; /* wheel counter */
- int lenses_cnt; /* lenses counter */
- int magnify_cnt; /* magnify counter */
- int wind_cnt; /* wind time counter */
-
- int android_move_cnt; /* android move counter */
- int android_clone_cnt; /* android clone counter */
- int ball_cnt; /* ball counter */
- int ball_pos; /* ball array pos counter */
- int eater_pos; /* eater array pos */
- int shine_cnt; /* shine counter for emerald/diamond */
+ boolean ball_random; /* flag if ball is random */
+ boolean ball_active; /* flag if ball is already active */
+ boolean wonderwall_active; /* flag if wonderwall is already active */
+
+ int wheel_cnt; /* counter for wheel activity */
+ int lenses_cnt; /* counter for lenses activity */
+ int magnify_cnt; /* counter for magnifier activity */
+ int wind_cnt; /* counter for wind activity */
+ int android_move_cnt; /* counter for android movement */
+ int android_clone_cnt; /* counter for android cloning */
+ int ball_cnt; /* counter for ball activity */
+ int ball_pos; /* counter for ball array position */
+ int eater_pos; /* counter for eater array position */
+ int shine_cnt; /* counter for emerald/diamond shining */
int num_ball_arrays; /* number of ball data arrays used */
case Xswitch:
play_element_sound(x, y, SOUND_press, element);
lev.ball_cnt = lev.ball_time;
- lev.ball_state = !lev.ball_state;
+ lev.ball_active = !lev.ball_active;
break;
case Xplant:
return;
case Xwonderwall:
- if (lev.wonderwall_time)
+ if (lev.wonderwall_time > 0)
{
- lev.wonderwall_state = 1;
+ lev.wonderwall_active = TRUE;
cave[x][y] = Yemerald_sB;
next[x][y] = Xblank;
if (is_blank[cave[x][y+2]])
return;
case Xwonderwall:
- if (lev.wonderwall_time)
+ if (lev.wonderwall_time > 0)
{
- lev.wonderwall_state = 1;
+ lev.wonderwall_active = TRUE;
cave[x][y] = Ydiamond_sB;
next[x][y] = Xblank;
if (is_blank[cave[x][y+2]])
return;
case Xwonderwall:
- if (lev.wonderwall_time)
+ if (lev.wonderwall_time > 0)
{
- lev.wonderwall_state = 1;
+ lev.wonderwall_active = TRUE;
cave[x][y] = Ystone_sB;
next[x][y] = Xblank;
if (is_blank[cave[x][y+2]])
static void Lball_1(int x, int y)
{
- if (lev.ball_state == 0)
+ if (!lev.ball_active)
return;
cave[x][y] = Yball_1;
static void Lball_2(int x, int y)
{
- if (lev.ball_state == 0)
+ if (!lev.ball_active)
return;
cave[x][y] = Yball_2;
static void Lwonderwall(int x, int y)
{
- if (lev.wonderwall_time && lev.wonderwall_state)
+ if (lev.wonderwall_time > 0 && lev.wonderwall_active)
{
cave[x][y] = Ywonderwall;
play_element_sound(x, y, SOUND_wonder, Xwonderwall);
static void Lswitch(int x, int y)
{
- if (lev.ball_state)
+ if (lev.ball_active)
cave[x][y] = Yswitch;
}
lev.android_move_cnt = lev.android_move_time;
if (lev.android_clone_cnt-- == 0)
lev.android_clone_cnt = lev.android_clone_time;
- if (lev.ball_state)
+ if (lev.ball_active)
if (lev.ball_cnt-- == 0)
lev.ball_cnt = lev.ball_time;
if (lev.lenses_cnt)
lev.wheel_cnt--;
if (lev.wind_cnt)
lev.wind_cnt--;
- if (lev.wonderwall_time && lev.wonderwall_state)
+ if (lev.wonderwall_time > 0 && lev.wonderwall_active)
lev.wonderwall_time--;
if (lev.wheel_cnt)
/* common to all emc caves */
+ cav.width = 64;
+ cav.height = 32;
+
cav.time_seconds = MIN(GET_BE16(src[2110]), 9999);
cav.gems_needed = src[2095];
cav.infinite = TRUE;
cav.testmode = FALSE;
- cav.teamwork = (src[2150] & 128) ? TRUE : FALSE;
+ cav.teamwork = (src[2150] & 128) != 0;
/* scores */
cav.amoeba_time = MIN(GET_BE16(src[2100]) * 28, 9999);
cav.wonderwall_time = MIN(GET_BE16(src[2102]), 9999);
- cav.wind_cnt = src[2149] & 15 ? cav.wind_time : 0;
+ cav.wind_time = 9999;
temp = src[2149];
cav.wind_direction = (temp & 8 ? 0 :
temp & 1 ? 1 :
temp & 2 ? 2 :
- temp & 4 ? 3 : 0);
+ temp & 4 ? 3 : 4);
/* global flags */
- cav.ball_random = src[2162] & 1 ? 1 : 0;
- cav.ball_state = src[2162] & 128 ? 1 : 0;
+ cav.ball_random = (src[2162] & 1) != 0;
+ cav.ball_active = (src[2162] & 128) != 0;
+
+ cav.wonderwall_active = FALSE;
+ cav.wheel_active = FALSE;
+ cav.lenses_active = FALSE;
+ cav.magnify_active = FALSE;
for (temp = 1; temp < 2047; temp++)
{
switch (src[temp])
{
case 36: /* wonderwall */
- cav.wonderwall_state = 1;
+ cav.wonderwall_active = TRUE;
cav.wonderwall_time = 9999;
break;
case 40: /* wheel */
- cav.wheel_x = temp & 63;
- cav.wheel_y = temp >> 6;
- cav.wheel_cnt = cav.wheel_time;
+ cav.wheel_active = TRUE;
+ cav.wheel_x = temp % 64;
+ cav.wheel_y = temp / 64;
break;
case 163: /* fake blank */
- cav.lenses_cnt = 9999;
+ cav.lenses_active = TRUE;
break;
case 164: /* fake grass */
- cav.magnify_cnt = 9999;
+ cav.magnify_active = TRUE;
break;
}
}
int android_move_time;
int android_clone_time;
boolean ball_random;
- boolean ball_state_initial;
+ boolean ball_active_initial;
int ball_time;
int lenses_score;
int magnify_score;