From ddcffe00ce77278eeb312fa6155822faa6c06451 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Sun, 9 Feb 2003 23:23:01 +0100 Subject: [PATCH] rnd-20030209-1-src --- src/conftime.h | 2 +- src/editor.c | 40 +++++++++++++++++++++++++++++++++++----- src/game.c | 4 ++++ src/init.c | 8 -------- 4 files changed, 40 insertions(+), 14 deletions(-) diff --git a/src/conftime.h b/src/conftime.h index a95a19e7..71df4b09 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2003-02-08 18:58]" +#define COMPILE_DATE_STRING "[2003-02-09 21:58]" diff --git a/src/editor.c b/src/editor.c index ed78feab..407d3107 100644 --- a/src/editor.c +++ b/src/editor.c @@ -292,11 +292,13 @@ #define GADGET_ID_EM_SLIPPERY_GEMS 77 #define GADGET_ID_CUSTOM_INDESTRUCTIBLE 78 #define GADGET_ID_CUSTOM_CAN_FALL 79 -#define GADGET_ID_CUSTOM_SLIPPERY 80 +#define GADGET_ID_CUSTOM_CAN_SMASH 80 +#define GADGET_ID_CUSTOM_SLIPPERY 81 /* gadgets for buttons in element list */ -#define GADGET_ID_ELEMENTLIST_FIRST 81 -#define GADGET_ID_ELEMENTLIST_LAST (81 + ED_NUM_ELEMENTLIST_BUTTONS - 1) +#define GADGET_ID_ELEMENTLIST_FIRST 82 +#define GADGET_ID_ELEMENTLIST_LAST (GADGET_ID_ELEMENTLIST_FIRST + \ + ED_NUM_ELEMENTLIST_BUTTONS - 1) #define NUM_EDITOR_GADGETS (GADGET_ID_ELEMENTLIST_LAST + 1) @@ -361,9 +363,10 @@ #define ED_CHECKBUTTON_ID_EM_SLIPPERY_GEMS 4 #define ED_CHECKBUTTON_ID_CUSTOM_INDESTRUCTIBLE 5 #define ED_CHECKBUTTON_ID_CUSTOM_CAN_FALL 6 -#define ED_CHECKBUTTON_ID_CUSTOM_SLIPPERY 7 +#define ED_CHECKBUTTON_ID_CUSTOM_CAN_SMASH 7 +#define ED_CHECKBUTTON_ID_CUSTOM_SLIPPERY 8 -#define ED_NUM_CHECKBUTTONS 8 +#define ED_NUM_CHECKBUTTONS 9 #define ED_CHECKBUTTON_ID_LEVEL_FIRST ED_CHECKBUTTON_ID_DOUBLE_SPEED #define ED_CHECKBUTTON_ID_LEVEL_LAST ED_CHECKBUTTON_ID_RANDOM_RESTRICTED @@ -435,6 +438,7 @@ static struct { boolean indestructible; boolean can_fall; + boolean can_smash; boolean slippery; } custom_element_properties[NUM_CUSTOM_ELEMENTS]; @@ -707,6 +711,12 @@ static struct }, { ED_SETTINGS_XPOS, ED_COUNTER_YPOS(6), + GADGET_ID_CUSTOM_CAN_SMASH, + &custom_element_properties[0].can_smash, + "can smash", "element can smash other elements" + }, + { + ED_SETTINGS_XPOS, ED_COUNTER_YPOS(7), GADGET_ID_CUSTOM_SLIPPERY, &custom_element_properties[0].slippery, "slippery", "other elements can fall down from it" @@ -2477,6 +2487,9 @@ static void CopyCustomElementPropertiesToEditor() custom_element_properties[i].can_fall = ((properties & EP_BIT_CAN_FALL) != 0 ? TRUE : FALSE); + custom_element_properties[i].can_smash = + ((properties & EP_BIT_CAN_SMASH) != 0 ? TRUE : FALSE); + custom_element_properties[i].slippery = ((properties & EP_BIT_SLIPPERY) != 0 ? TRUE : FALSE); } @@ -2502,6 +2515,11 @@ static void CopyCustomElementPropertiesToGame() else Properties1[element] &= ~EP_BIT_CAN_FALL; + if (custom_element_properties[i].can_smash) + Properties1[element] |= EP_BIT_CAN_SMASH; + else + Properties1[element] &= ~EP_BIT_CAN_SMASH; + if (custom_element_properties[i].slippery) Properties1[element] |= EP_BIT_SLIPPERY; else @@ -3143,6 +3161,18 @@ static void DrawPropertiesWindow() GDI_CHECKED, *checkbutton_info[i].value, GDI_END); MapCheckbuttonGadget(i); + /* draw checkbutton gadget */ + i = ED_CHECKBUTTON_ID_CUSTOM_CAN_SMASH; + x = checkbutton_info[i].x + xoffset_right2; + y = checkbutton_info[i].y + yoffset_right2; + + checkbutton_info[i].value = &custom_element_properties[nr].can_smash; + + DrawTextF(x, y, font_color, checkbutton_info[i].text); + ModifyGadget(level_editor_gadget[checkbutton_info[i].gadget_id], + GDI_CHECKED, *checkbutton_info[i].value, GDI_END); + MapCheckbuttonGadget(i); + /* draw checkbutton gadget */ i = ED_CHECKBUTTON_ID_CUSTOM_SLIPPERY; x = checkbutton_info[i].x + xoffset_right2; diff --git a/src/game.c b/src/game.c index 48ec5427..4a297314 100644 --- a/src/game.c +++ b/src/game.c @@ -2900,7 +2900,11 @@ void StartMoving(int x, int y) EL_BD_MAGIC_WALL_FILLING); Store[x][y] = element; } +#if 0 else if (CAN_SMASH(element) && Feld[x][y+1] == EL_ACID) +#else + else if (CAN_FALL(element) && Feld[x][y+1] == EL_ACID) +#endif { SplashAcid(x, y); diff --git a/src/init.c b/src/init.c index 0e208dbb..60f6febb 100644 --- a/src/init.c +++ b/src/init.c @@ -1695,14 +1695,6 @@ void InitElementProperties() EL_EMERALD_RED, EL_EMERALD_PURPLE, EL_DIAMOND, - EL_KEY1, - EL_KEY2, - EL_KEY3, - EL_KEY4, - EL_EM_KEY1, - EL_EM_KEY2, - EL_EM_KEY3, - EL_EM_KEY4, EL_BOMB, EL_NUT, EL_AMOEBA_DROP, -- 2.34.1