+Release Version 3.0.1 [?? ??? ????]
+-----------------------------------
+ - fixed bug with missing graphic for active red disk bomb
+ - added custom element property for dropping collected elements
+
Release Version 3.0.0 [05 AUG 2003]
-------------------------------------------
+-----------------------------------
- final version bumped to 3.0.0 due to the massive changes
- graphics and sounds now completely and dynamically customizable
- custom elements now have lots of configurable properties
+/***********************************************************
+* Rocks'n'Diamonds -- McDuffin Strikes Back! *
+*----------------------------------------------------------*
+* (c) 1995-2002 Artsoft Entertainment *
+* Holger Schemel *
+* Detmolder Strasse 189 *
+* 33604 Bielefeld *
+* Germany *
+* e-mail: info@artsoft.org *
+*----------------------------------------------------------*
+* conf_chr.c *
+***********************************************************/
/* ----- this file was automatically generated -- do not edit by hand ----- */
+/***********************************************************
+* Rocks'n'Diamonds -- McDuffin Strikes Back! *
+*----------------------------------------------------------*
+* (c) 1995-2002 Artsoft Entertainment *
+* Holger Schemel *
+* Detmolder Strasse 189 *
+* 33604 Bielefeld *
+* Germany *
+* e-mail: info@artsoft.org *
+*----------------------------------------------------------*
+* conf_chr.h *
+***********************************************************/
/* ----- this file was automatically generated -- do not edit by hand ----- */
+/***********************************************************
+* Rocks'n'Diamonds -- McDuffin Strikes Back! *
+*----------------------------------------------------------*
+* (c) 1995-2002 Artsoft Entertainment *
+* Holger Schemel *
+* Detmolder Strasse 189 *
+* 33604 Bielefeld *
+* Germany *
+* e-mail: info@artsoft.org *
+*----------------------------------------------------------*
+* conf_cus.c *
+***********************************************************/
/* ----- this file was automatically generated -- do not edit by hand ----- */
+/***********************************************************
+* Rocks'n'Diamonds -- McDuffin Strikes Back! *
+*----------------------------------------------------------*
+* (c) 1995-2002 Artsoft Entertainment *
+* Holger Schemel *
+* Detmolder Strasse 189 *
+* 33604 Bielefeld *
+* Germany *
+* e-mail: info@artsoft.org *
+*----------------------------------------------------------*
+* conf_cus.h *
+***********************************************************/
/* ----- this file was automatically generated -- do not edit by hand ----- */
+/***********************************************************
+* Rocks'n'Diamonds -- McDuffin Strikes Back! *
+*----------------------------------------------------------*
+* (c) 1995-2002 Artsoft Entertainment *
+* Holger Schemel *
+* Detmolder Strasse 189 *
+* 33604 Bielefeld *
+* Germany *
+* e-mail: info@artsoft.org *
+*----------------------------------------------------------*
+* conf_e2g.c *
+***********************************************************/
/* ----- this file was automatically generated -- do not edit by hand ----- */
+/***********************************************************
+* Rocks'n'Diamonds -- McDuffin Strikes Back! *
+*----------------------------------------------------------*
+* (c) 1995-2002 Artsoft Entertainment *
+* Holger Schemel *
+* Detmolder Strasse 189 *
+* 33604 Bielefeld *
+* Germany *
+* e-mail: info@artsoft.org *
+*----------------------------------------------------------*
+* conf_e2s.c *
+***********************************************************/
/* ----- this file was automatically generated -- do not edit by hand ----- */
+/***********************************************************
+* Rocks'n'Diamonds -- McDuffin Strikes Back! *
+*----------------------------------------------------------*
+* (c) 1995-2002 Artsoft Entertainment *
+* Holger Schemel *
+* Detmolder Strasse 189 *
+* 33604 Bielefeld *
+* Germany *
+* e-mail: info@artsoft.org *
+*----------------------------------------------------------*
+* conf_esg.c *
+***********************************************************/
/* ----- this file was automatically generated -- do not edit by hand ----- */
+/***********************************************************
+* Rocks'n'Diamonds -- McDuffin Strikes Back! *
+*----------------------------------------------------------*
+* (c) 1995-2002 Artsoft Entertainment *
+* Holger Schemel *
+* Detmolder Strasse 189 *
+* 33604 Bielefeld *
+* Germany *
+* e-mail: info@artsoft.org *
+*----------------------------------------------------------*
+* conf_fnt.c *
+***********************************************************/
/* ----- this file was automatically generated -- do not edit by hand ----- */
+/***********************************************************
+* Rocks'n'Diamonds -- McDuffin Strikes Back! *
+*----------------------------------------------------------*
+* (c) 1995-2002 Artsoft Entertainment *
+* Holger Schemel *
+* Detmolder Strasse 189 *
+* 33604 Bielefeld *
+* Germany *
+* e-mail: info@artsoft.org *
+*----------------------------------------------------------*
+* conf_gfx.h *
+***********************************************************/
/* ----- this file was automatically generated -- do not edit by hand ----- */
+/***********************************************************
+* Rocks'n'Diamonds -- McDuffin Strikes Back! *
+*----------------------------------------------------------*
+* (c) 1995-2002 Artsoft Entertainment *
+* Holger Schemel *
+* Detmolder Strasse 189 *
+* 33604 Bielefeld *
+* Germany *
+* e-mail: info@artsoft.org *
+*----------------------------------------------------------*
+* conf_snd.h *
+***********************************************************/
/* ----- this file was automatically generated -- do not edit by hand ----- */
-#define COMPILE_DATE_STRING "[2003-08-08 19:58]"
+#define COMPILE_DATE_STRING "[2003-08-09 01:35]"
static struct ValueTextInfo options_consistency[] =
{
- { EP_CAN_EXPLODE, "can explode" },
+ { EP_CAN_EXPLODE_3X3, "can explode 3x3" },
+ { EP_CAN_EXPLODE_1X1, "can explode 1x1" },
{ EP_INDESTRUCTIBLE, "indestructible" },
{ -1, NULL }
};
dst[x][y] = src[x][y];
}
+static int SetSelectboxValue(int selectbox_id, int new_value)
+{
+ int new_index_value = 0;
+ int i;
+
+ for(i=0; selectbox_info[selectbox_id].options[i].text != NULL; i++)
+ if (selectbox_info[selectbox_id].options[i].value == new_value)
+ new_index_value = i;
+
+ *selectbox_info[selectbox_id].value =
+ selectbox_info[selectbox_id].options[new_index_value].value;
+
+ return new_index_value;
+}
+
static void CopyCustomElementPropertiesToEditor(int element)
{
int i;
custom_element = element_info[element];
+ /* needed to initially set selectbox value variables to reliable defaults */
+ for (i=0; i < ED_NUM_SELECTBOX; i++)
+ SetSelectboxValue(i, *selectbox_info[i].value);
+
for (i=0; i < NUM_ELEMENT_PROPERTIES; i++)
custom_element_properties[i] = HAS_PROPERTY(element, i);
/* set consistency selectbox help value */
custom_element.consistency =
(IS_INDESTRUCTIBLE(element) ? EP_INDESTRUCTIBLE :
- CAN_EXPLODE(element) ? EP_CAN_EXPLODE :
+ CAN_EXPLODE_1X1(element) ? EP_CAN_EXPLODE_1X1 :
+ CAN_EXPLODE_3X3(element) ? EP_CAN_EXPLODE_3X3 :
custom_element.consistency);
custom_element_properties[EP_EXPLODE_RESULT] =
(IS_INDESTRUCTIBLE(element) ||
- CAN_EXPLODE(element));
+ CAN_EXPLODE_1X1(element) ||
+ CAN_EXPLODE_3X3(element));
/* special case: sub-settings dependent from main setting */
if (CAN_EXPLODE_BY_FIRE(element))
/* set consistency property from checkbox and selectbox */
custom_element_properties[EP_INDESTRUCTIBLE] = FALSE;
- custom_element_properties[EP_CAN_EXPLODE] = FALSE;
+ custom_element_properties[EP_CAN_EXPLODE_1X1] = FALSE;
+ custom_element_properties[EP_CAN_EXPLODE_3X3] = FALSE;
custom_element_properties[EP_CAN_EXPLODE_BY_FIRE] = FALSE;
custom_element_properties[EP_CAN_EXPLODE_SMASHED] = FALSE;
custom_element_properties[EP_CAN_EXPLODE_IMPACT] = FALSE;
custom_element_properties[EP_EXPLODE_RESULT];
/* special case: sub-settings dependent from main setting */
- if (custom_element_properties[EP_CAN_EXPLODE])
+ if (custom_element_properties[EP_CAN_EXPLODE_3X3] ||
+ custom_element_properties[EP_CAN_EXPLODE_1X1])
{
custom_element_properties[EP_CAN_EXPLODE_BY_FIRE] =
custom_element.can_explode_by_fire;
{
int gadget_id = selectbox_info[selectbox_id].gadget_id;
struct GadgetInfo *gi = level_editor_gadget[gadget_id];
- int new_index_value = 0;
- int i;
-
- for(i=0; selectbox_info[selectbox_id].options[i].text != NULL; i++)
- if (selectbox_info[selectbox_id].options[i].value == new_value)
- new_index_value = i;
-
- *selectbox_info[selectbox_id].value =
- selectbox_info[selectbox_id].options[new_index_value].value;
+ int new_index_value = SetSelectboxValue(selectbox_id, new_value);
ModifyGadget(gi, GDI_SELECTBOX_INDEX, new_index_value, GDI_END);
}
return belt_move_dir[belt_dir_nr];
}
-static void InitField(int x, int y, boolean init_game)
+static void InitPlayerField(int x, int y, int element, boolean init_game)
{
- int element = Feld[x][y];
-
- switch (element)
+ if (element == EL_SP_MURPHY)
{
- case EL_SP_MURPHY:
- if (init_game)
+ if (init_game)
+ {
+ if (stored_player[0].present)
{
- if (stored_player[0].present)
- {
- Feld[x][y] = EL_SP_MURPHY_CLONE;
- break;
- }
- else
- {
- stored_player[0].use_murphy_graphic = TRUE;
- }
+ Feld[x][y] = EL_SP_MURPHY_CLONE;
- Feld[x][y] = EL_PLAYER_1;
+ return;
}
- /* no break! */
- case EL_PLAYER_1:
- case EL_PLAYER_2:
- case EL_PLAYER_3:
- case EL_PLAYER_4:
- if (init_game)
+ else
{
- struct PlayerInfo *player = &stored_player[Feld[x][y] - EL_PLAYER_1];
- int jx = player->jx, jy = player->jy;
+ stored_player[0].use_murphy_graphic = TRUE;
+ }
- player->present = TRUE;
+ Feld[x][y] = EL_PLAYER_1;
+ }
+ }
- if (!options.network || player->connected)
- {
- player->active = TRUE;
+ if (init_game)
+ {
+ struct PlayerInfo *player = &stored_player[Feld[x][y] - EL_PLAYER_1];
+ int jx = player->jx, jy = player->jy;
- /* remove potentially duplicate players */
- if (StorePlayer[jx][jy] == Feld[x][y])
- StorePlayer[jx][jy] = 0;
+ player->present = TRUE;
- StorePlayer[x][y] = Feld[x][y];
+ if (!options.network || player->connected)
+ {
+ player->active = TRUE;
- if (options.debug)
- {
- printf("Player %d activated.\n", player->element_nr);
- printf("[Local player is %d and currently %s.]\n",
- local_player->element_nr,
- local_player->active ? "active" : "not active");
- }
- }
+ /* remove potentially duplicate players */
+ if (StorePlayer[jx][jy] == Feld[x][y])
+ StorePlayer[jx][jy] = 0;
- Feld[x][y] = EL_EMPTY;
- player->jx = player->last_jx = x;
- player->jy = player->last_jy = y;
+ StorePlayer[x][y] = Feld[x][y];
+
+ if (options.debug)
+ {
+ printf("Player %d activated.\n", player->element_nr);
+ printf("[Local player is %d and currently %s.]\n",
+ local_player->element_nr,
+ local_player->active ? "active" : "not active");
}
+ }
+
+ Feld[x][y] = EL_EMPTY;
+ player->jx = player->last_jx = x;
+ player->jy = player->last_jy = y;
+ }
+}
+
+static void InitField(int x, int y, boolean init_game)
+{
+ int element = Feld[x][y];
+
+ switch (element)
+ {
+ case EL_SP_MURPHY:
+ case EL_PLAYER_1:
+ case EL_PLAYER_2:
+ case EL_PLAYER_3:
+ case EL_PLAYER_4:
+ InitPlayerField(x, y, element, init_game);
break;
case EL_STONEBLOCK:
if (lev_fieldy + (SBY_Upper == -1 ? 2 : 0) <= SCR_FIELDY)
SBY_Upper = SBY_Lower = -1 * (SCR_FIELDY - lev_fieldy) / 2;
- scroll_x = SBX_Left;
- scroll_y = SBY_Upper;
- if (local_player->jx >= SBX_Left + MIDPOSX)
- scroll_x = (local_player->jx <= SBX_Right + MIDPOSX ?
- local_player->jx - MIDPOSX :
- SBX_Right);
- if (local_player->jy >= SBY_Upper + MIDPOSY)
- scroll_y = (local_player->jy <= SBY_Lower + MIDPOSY ?
- local_player->jy - MIDPOSY :
- SBY_Lower);
+ /* if local player not found, look for custom element that might create
+ the player (make some assumptions about the right custom element) */
+ if (!local_player->present)
+ {
+ int start_x = 0, start_y = 0;
+ int found_rating = 0;
+
+ for(y=0; y < lev_fieldy; y++)
+ {
+ for(x=0; x < lev_fieldx; x++)
+ {
+ int element = Feld[x][y];
+
+ if (IS_CUSTOM_ELEMENT(element))
+ {
+ int xx, yy;
+
+ for(yy=0; yy < 3; yy++)
+ {
+ for(xx=0; xx < 3; xx++)
+ {
+ int content;
+ boolean is_player;
+
+ content = element_info[element].content[xx][yy];
+ is_player = (ELEM_IS_PLAYER(content) || content == EL_SP_MURPHY);
+
+ if (is_player && found_rating < 2)
+ {
+ start_x = x + xx - 1;
+ start_y = y + yy - 1;
+
+ found_rating = 2;
+ }
+
+ content = element_info[element].change.content[xx][yy];
+ is_player = (ELEM_IS_PLAYER(content) || content == EL_SP_MURPHY);
+
+ if (is_player && found_rating < 1)
+ {
+ start_x = x + xx - 1;
+ start_y = y + yy - 1;
+
+ found_rating = 1;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ scroll_x = (start_x < SBX_Left + MIDPOSX ? SBX_Left :
+ start_x > SBX_Right + MIDPOSX ? SBX_Right :
+ start_x - MIDPOSX);
+
+ scroll_y = (start_y < SBY_Upper + MIDPOSY ? SBY_Upper :
+ start_y > SBY_Lower + MIDPOSY ? SBY_Lower :
+ start_y - MIDPOSY);
+ }
+ else
+ {
+#if 1
+ scroll_x = (local_player->jx < SBX_Left + MIDPOSX ? SBX_Left :
+ local_player->jx > SBX_Right + MIDPOSX ? SBX_Right :
+ local_player->jx - MIDPOSX);
+
+ scroll_y = (local_player->jy < SBY_Upper + MIDPOSY ? SBY_Upper :
+ local_player->jy > SBY_Lower + MIDPOSY ? SBY_Lower :
+ local_player->jy - MIDPOSY);
+#else
+ scroll_x = SBX_Left;
+ scroll_y = SBY_Upper;
+ if (local_player->jx >= SBX_Left + MIDPOSX)
+ scroll_x = (local_player->jx <= SBX_Right + MIDPOSX ?
+ local_player->jx - MIDPOSX :
+ SBX_Right);
+ if (local_player->jy >= SBY_Upper + MIDPOSY)
+ scroll_y = (local_player->jy <= SBY_Lower + MIDPOSY ?
+ local_player->jy - MIDPOSY :
+ SBY_Lower);
+#endif
+ }
CloseDoor(DOOR_CLOSE_1);
Bang(x, y);
}
+void RelocatePlayer(int x, int y, int element)
+{
+ struct PlayerInfo *player = &stored_player[element - EL_PLAYER_1];
+
+ if (player->present)
+ {
+ while (player->MovPos)
+ {
+ ScrollFigure(player, SCROLL_GO_ON);
+ ScrollScreen(NULL, SCROLL_GO_ON);
+ FrameCounter++;
+ DrawAllPlayers();
+ BackToFront();
+ }
+
+ RemoveField(player->jx, player->jy);
+ }
+
+ InitPlayerField(x, y, element, TRUE);
+
+ if (player == local_player)
+ {
+ scroll_x = (local_player->jx < SBX_Left + MIDPOSX ? SBX_Left :
+ local_player->jx > SBX_Right + MIDPOSX ? SBX_Right :
+ local_player->jx - MIDPOSX);
+
+ scroll_y = (local_player->jy < SBY_Upper + MIDPOSY ? SBY_Upper :
+ local_player->jy > SBY_Lower + MIDPOSY ? SBY_Lower :
+ local_player->jy - MIDPOSY);
+ }
+
+ DrawLevel();
+}
+
void Explode(int ex, int ey, int phase, int mode)
{
int x, y;
if (IS_PLAYER(x, y) && !PLAYERINFO(x,y)->present)
StorePlayer[x][y] = 0;
+
+ if (ELEM_IS_PLAYER(element))
+ RelocatePlayer(x, y, element);
}
else if (phase >= delay && IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
{
Explode(x, y, EX_PHASE_START, EX_CENTER);
break;
default:
- Explode(x, y, EX_PHASE_START, EX_NORMAL);
+ if (CAN_EXPLODE_1X1(element))
+ Explode(x, y, EX_PHASE_START, EX_CENTER);
+ else
+ Explode(x, y, EX_PHASE_START, EX_NORMAL);
break;
}
CAN_EXPLODE_SMASHED(i) ||
CAN_EXPLODE_IMPACT(i)));
+ /* ---------- CAN_EXPLODE_3X3 ------------------------------------------ */
+ SET_PROPERTY(i, EP_CAN_EXPLODE_3X3, !CAN_EXPLODE_1X1(i));
+
/* ---------- CAN_BE_CRUMBLED ------------------------------------------ */
SET_PROPERTY(i, EP_CAN_BE_CRUMBLED,
element_info[i].crumbled[ACTION_DEFAULT] != IMG_EMPTY);
#define EP_PASSABLE_INSIDE 20
#define EP_PASSABLE_UNDER 21
#define EP_DROPPABLE 22
-#define EP_UNUSED_23 23
+#define EP_CAN_EXPLODE_1X1 23
#define EP_PUSHABLE 24
/* values for special configurable properties (depending on level settings) */
#define EP_EXPLOSION_PROOF 68
#define EP_CAN_SMASH 69
#define EP_CAN_EXPLODE 70
+#define EP_CAN_EXPLODE_3X3 71
/* values for internal purpose only (level editor) */
-#define EP_EXPLODE_RESULT 71
-#define EP_WALK_TO_OBJECT 72
-#define EP_DEADLY 73
+#define EP_EXPLODE_RESULT 72
+#define EP_WALK_TO_OBJECT 73
+#define EP_DEADLY 74
-#define NUM_ELEMENT_PROPERTIES 74
+#define NUM_ELEMENT_PROPERTIES 75
#define NUM_EP_BITFIELDS ((NUM_ELEMENT_PROPERTIES + 31) / 32)
#define EP_BITFIELD_BASE 0
#define IS_PASSABLE_INSIDE(e) HAS_PROPERTY(e, EP_PASSABLE_INSIDE)
#define IS_PASSABLE_UNDER(e) HAS_PROPERTY(e, EP_PASSABLE_UNDER)
#define IS_DROPPABLE(e) HAS_PROPERTY(e, EP_DROPPABLE)
+#define CAN_EXPLODE_1X1(e) HAS_PROPERTY(e, EP_CAN_EXPLODE_1X1)
#define IS_PUSHABLE(e) HAS_PROPERTY(e, EP_PUSHABLE)
/* macros for special configurable properties */
#define IS_EXPLOSION_PROOF(e) HAS_PROPERTY(e, EP_EXPLOSION_PROOF)
#define CAN_SMASH(e) HAS_PROPERTY(e, EP_CAN_SMASH)
#define CAN_EXPLODE(e) HAS_PROPERTY(e, EP_CAN_EXPLODE)
+#define CAN_EXPLODE_3X3(e) HAS_PROPERTY(e, EP_CAN_EXPLODE_3X3)
/* special macros used in game engine */
#define IS_CUSTOM_ELEMENT(e) ((e) >= EL_CUSTOM_START && \