From: Holger Schemel Date: Sat, 7 Feb 2004 03:08:34 +0000 (+0100) Subject: rnd-20040207-1-src X-Git-Tag: 3.1.0^2~75 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=0ff3f484ffbb8e3404e1dc4536a292335369f2d2;p=rocksndiamonds.git rnd-20040207-1-src --- diff --git a/Makefile b/Makefile index 1ea92b07..481244f7 100644 --- a/Makefile +++ b/Makefile @@ -50,8 +50,8 @@ CROSS_PATH_WIN32=/usr/local/cross-tools/i386-mingw32msvc SRC_DIR = src MAKE_CMD = $(MAKE) -C $(SRC_DIR) -DEFAULT_TARGET = x11 -# DEFAULT_TARGET = sdl +# DEFAULT_TARGET = x11 +DEFAULT_TARGET = sdl # ----------------------------------------------------------------------------- diff --git a/src/Makefile b/src/Makefile index ef1f52af..f065f0b9 100644 --- a/src/Makefile +++ b/src/Makefile @@ -85,8 +85,7 @@ endif ifeq ($(TARGET),x11) SYS_CFLAGS = -DTARGET_X11 $(X11_INCL) -# SYS_LDFLAGS = $(X11_LIBS) -lX11 -SYS_LDFLAGS = $(XLIB_PATH)/libX11.a +SYS_LDFLAGS = $(X11_LIBS) -lX11 endif ifeq ($(TARGET),sdl) diff --git a/src/conftime.h b/src/conftime.h index c477c00c..6ea44636 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2004-02-06 15:14]" +#define COMPILE_DATE_STRING "[2004-02-07 04:07]" diff --git a/src/editor.c b/src/editor.c index 6ca13b17..9740597d 100644 --- a/src/editor.c +++ b/src/editor.c @@ -381,21 +381,27 @@ #define GADGET_ID_MOVE_DELAY_RND_DOWN (GADGET_ID_COUNTER_FIRST + 48) #define GADGET_ID_MOVE_DELAY_RND_TEXT (GADGET_ID_COUNTER_FIRST + 49) #define GADGET_ID_MOVE_DELAY_RND_UP (GADGET_ID_COUNTER_FIRST + 50) -#define GADGET_ID_CHANGE_DELAY_FIX_DOWN (GADGET_ID_COUNTER_FIRST + 51) -#define GADGET_ID_CHANGE_DELAY_FIX_TEXT (GADGET_ID_COUNTER_FIRST + 52) -#define GADGET_ID_CHANGE_DELAY_FIX_UP (GADGET_ID_COUNTER_FIRST + 53) -#define GADGET_ID_CHANGE_DELAY_RND_DOWN (GADGET_ID_COUNTER_FIRST + 54) -#define GADGET_ID_CHANGE_DELAY_RND_TEXT (GADGET_ID_COUNTER_FIRST + 55) -#define GADGET_ID_CHANGE_DELAY_RND_UP (GADGET_ID_COUNTER_FIRST + 56) -#define GADGET_ID_CHANGE_CONT_RND_DOWN (GADGET_ID_COUNTER_FIRST + 57) -#define GADGET_ID_CHANGE_CONT_RND_TEXT (GADGET_ID_COUNTER_FIRST + 58) -#define GADGET_ID_CHANGE_CONT_RND_UP (GADGET_ID_COUNTER_FIRST + 59) -#define GADGET_ID_GROUP_CONTENT_DOWN (GADGET_ID_COUNTER_FIRST + 60) -#define GADGET_ID_GROUP_CONTENT_TEXT (GADGET_ID_COUNTER_FIRST + 61) -#define GADGET_ID_GROUP_CONTENT_UP (GADGET_ID_COUNTER_FIRST + 62) +#define GADGET_ID_EXPLOSION_DELAY_DOWN (GADGET_ID_COUNTER_FIRST + 51) +#define GADGET_ID_EXPLOSION_DELAY_TEXT (GADGET_ID_COUNTER_FIRST + 52) +#define GADGET_ID_EXPLOSION_DELAY_UP (GADGET_ID_COUNTER_FIRST + 53) +#define GADGET_ID_IGNITION_DELAY_DOWN (GADGET_ID_COUNTER_FIRST + 54) +#define GADGET_ID_IGNITION_DELAY_TEXT (GADGET_ID_COUNTER_FIRST + 55) +#define GADGET_ID_IGNITION_DELAY_UP (GADGET_ID_COUNTER_FIRST + 56) +#define GADGET_ID_CHANGE_DELAY_FIX_DOWN (GADGET_ID_COUNTER_FIRST + 57) +#define GADGET_ID_CHANGE_DELAY_FIX_TEXT (GADGET_ID_COUNTER_FIRST + 58) +#define GADGET_ID_CHANGE_DELAY_FIX_UP (GADGET_ID_COUNTER_FIRST + 59) +#define GADGET_ID_CHANGE_DELAY_RND_DOWN (GADGET_ID_COUNTER_FIRST + 60) +#define GADGET_ID_CHANGE_DELAY_RND_TEXT (GADGET_ID_COUNTER_FIRST + 61) +#define GADGET_ID_CHANGE_DELAY_RND_UP (GADGET_ID_COUNTER_FIRST + 62) +#define GADGET_ID_CHANGE_CONT_RND_DOWN (GADGET_ID_COUNTER_FIRST + 63) +#define GADGET_ID_CHANGE_CONT_RND_TEXT (GADGET_ID_COUNTER_FIRST + 64) +#define GADGET_ID_CHANGE_CONT_RND_UP (GADGET_ID_COUNTER_FIRST + 65) +#define GADGET_ID_GROUP_CONTENT_DOWN (GADGET_ID_COUNTER_FIRST + 66) +#define GADGET_ID_GROUP_CONTENT_TEXT (GADGET_ID_COUNTER_FIRST + 67) +#define GADGET_ID_GROUP_CONTENT_UP (GADGET_ID_COUNTER_FIRST + 68) /* drawing area identifiers */ -#define GADGET_ID_DRAWING_AREA_FIRST (GADGET_ID_COUNTER_FIRST + 63) +#define GADGET_ID_DRAWING_AREA_FIRST (GADGET_ID_COUNTER_FIRST + 69) #define GADGET_ID_DRAWING_LEVEL (GADGET_ID_DRAWING_AREA_FIRST + 0) #define GADGET_ID_ELEMENT_CONTENT_0 (GADGET_ID_DRAWING_AREA_FIRST + 1) @@ -551,18 +557,24 @@ #define ED_COUNTER_ID_PUSH_DELAY_RND 14 #define ED_COUNTER_ID_MOVE_DELAY_FIX 15 #define ED_COUNTER_ID_MOVE_DELAY_RND 16 -#define ED_COUNTER_ID_GROUP_CONTENT 17 -#define ED_COUNTER_ID_CHANGE_DELAY_FIX 18 -#define ED_COUNTER_ID_CHANGE_DELAY_RND 19 -#define ED_COUNTER_ID_CHANGE_CONT_RND 20 +#define ED_COUNTER_ID_EXPLOSION_DELAY 17 +#define ED_COUNTER_ID_IGNITION_DELAY 18 +#define ED_COUNTER_ID_GROUP_CONTENT 19 +#define ED_COUNTER_ID_CHANGE_DELAY_FIX 20 +#define ED_COUNTER_ID_CHANGE_DELAY_RND 21 +#define ED_COUNTER_ID_CHANGE_CONT_RND 22 -#define ED_NUM_COUNTERBUTTONS 21 +#define ED_NUM_COUNTERBUTTONS 23 #define ED_COUNTER_ID_LEVEL_FIRST ED_COUNTER_ID_LEVEL_XSIZE #define ED_COUNTER_ID_LEVEL_LAST ED_COUNTER_ID_LEVEL_RANDOM -#define ED_COUNTER_ID_CUSTOM_FIRST ED_COUNTER_ID_CUSTOM_SCORE -#define ED_COUNTER_ID_CUSTOM_LAST ED_COUNTER_ID_MOVE_DELAY_RND +#define ED_COUNTER_ID_CUSTOM1_FIRST ED_COUNTER_ID_CUSTOM_SCORE +#define ED_COUNTER_ID_CUSTOM1_LAST ED_COUNTER_ID_MOVE_DELAY_RND +#define ED_COUNTER_ID_CUSTOM2_FIRST ED_COUNTER_ID_EXPLOSION_DELAY +#define ED_COUNTER_ID_CUSTOM2_LAST ED_COUNTER_ID_IGNITION_DELAY +#define ED_COUNTER_ID_CUSTOM_FIRST ED_COUNTER_ID_CUSTOM1_FIRST +#define ED_COUNTER_ID_CUSTOM_LAST ED_COUNTER_ID_CUSTOM2_LAST #define ED_COUNTER_ID_CHANGE_FIRST ED_COUNTER_ID_CHANGE_DELAY_FIX #define ED_COUNTER_ID_CHANGE_LAST ED_COUNTER_ID_CHANGE_CONT_RND @@ -635,6 +647,8 @@ #define ED_SELECTBOX_ID_CUSTOM1_LAST ED_SELECTBOX_ID_CUSTOM_SLIPPERY_TYPE #define ED_SELECTBOX_ID_CUSTOM2_FIRST ED_SELECTBOX_ID_CUSTOM_DEADLINESS #define ED_SELECTBOX_ID_CUSTOM2_LAST ED_SELECTBOX_ID_CUSTOM_CONSISTENCY +#define ED_SELECTBOX_ID_CUSTOM_FIRST ED_SELECTBOX_ID_CUSTOM1_FIRST +#define ED_SELECTBOX_ID_CUSTOM_LAST ED_SELECTBOX_ID_CUSTOM2_LAST #define ED_SELECTBOX_ID_CHANGE_FIRST ED_SELECTBOX_ID_CHANGE_TIME_UNITS #define ED_SELECTBOX_ID_CHANGE_LAST ED_SELECTBOX_ID_SELECT_CHANGE_PAGE @@ -705,6 +719,8 @@ #define ED_CHECKBUTTON_ID_CUSTOM1_LAST ED_CHECKBUTTON_ID_CUSTOM_SLIPPERY #define ED_CHECKBUTTON_ID_CUSTOM2_FIRST ED_CHECKBUTTON_ID_CUSTOM_DEADLY #define ED_CHECKBUTTON_ID_CUSTOM2_LAST ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_IMPACT +#define ED_CHECKBUTTON_ID_CUSTOM_FIRST ED_CHECKBUTTON_ID_CUSTOM1_FIRST +#define ED_CHECKBUTTON_ID_CUSTOM_LAST ED_CHECKBUTTON_ID_CUSTOM2_LAST #define ED_CHECKBUTTON_ID_CHANGE_FIRST ED_CHECKBUTTON_ID_CUSTOM_CAN_CHANGE #define ED_CHECKBUTTON_ID_CHANGE_LAST ED_CHECKBUTTON_ID_CHANGE_USE_RANDOM @@ -948,7 +964,7 @@ static struct NULL, " ", "height", }, - /* ---------- element settings: configure (custom elements) -------------- */ + /* ---------- element settings: configure 1 (custom elements) ------------ */ { ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(5), @@ -999,6 +1015,25 @@ static struct NULL, "+random", NULL }, + /* ---------- element settings: configure 2 (custom elements) ------------ */ + + { + ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(4), + 0, 255, + GADGET_ID_EXPLOSION_DELAY_DOWN, GADGET_ID_EXPLOSION_DELAY_UP, + GADGET_ID_EXPLOSION_DELAY_TEXT, GADGET_ID_NONE, + &custom_element.explosion_delay, + NULL, "explosion delay", NULL + }, + { + ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(5), + 0, 255, + GADGET_ID_IGNITION_DELAY_DOWN, GADGET_ID_IGNITION_DELAY_UP, + GADGET_ID_IGNITION_DELAY_TEXT, GADGET_ID_NONE, + &custom_element.ignition_delay, + NULL, "ignition delay", NULL + }, + /* ---------- element settings: configure (group elements) --------------- */ { @@ -6639,7 +6674,8 @@ static void DrawPropertiesConfig() MapCheckbuttonGadget(i); /* draw counter gadgets */ - for (i = ED_COUNTER_ID_CUSTOM_FIRST; i <= ED_COUNTER_ID_CUSTOM_LAST; i++) + for (i = ED_COUNTER_ID_CUSTOM1_FIRST; + i <= ED_COUNTER_ID_CUSTOM1_LAST; i++) MapCounterButtons(i); /* draw selectbox gadgets */ @@ -6665,6 +6701,11 @@ static void DrawPropertiesConfig() i <= ED_CHECKBUTTON_ID_CUSTOM2_LAST; i++) MapCheckbuttonGadget(i); + /* draw counter gadgets */ + for (i = ED_COUNTER_ID_CUSTOM2_FIRST; + i <= ED_COUNTER_ID_CUSTOM2_LAST; i++) + MapCounterButtons(i); + /* draw selectbox gadgets */ for (i = ED_SELECTBOX_ID_CUSTOM2_FIRST; i <= ED_SELECTBOX_ID_CUSTOM2_LAST; i++) @@ -7958,10 +7999,8 @@ static void HandleSelectboxGadgets(struct GadgetInfo *gi) DrawPropertiesWindow(); } - else if ((type_id >= ED_SELECTBOX_ID_CUSTOM1_FIRST && - type_id <= ED_SELECTBOX_ID_CUSTOM1_LAST) || - (type_id >= ED_SELECTBOX_ID_CUSTOM2_FIRST && - type_id <= ED_SELECTBOX_ID_CUSTOM2_LAST) || + else if ((type_id >= ED_SELECTBOX_ID_CUSTOM_FIRST && + type_id <= ED_SELECTBOX_ID_CUSTOM_LAST) || (type_id >= ED_SELECTBOX_ID_CHANGE_FIRST && type_id <= ED_SELECTBOX_ID_CHANGE_LAST) || (type_id == ED_SELECTBOX_ID_GROUP_CHOICE_MODE)) @@ -8056,10 +8095,8 @@ static void HandleCheckbuttons(struct GadgetInfo *gi) *checkbutton_info[type_id].value ^= TRUE; - if (((type_id >= ED_CHECKBUTTON_ID_CUSTOM1_FIRST && - type_id <= ED_CHECKBUTTON_ID_CUSTOM1_LAST) || - (type_id >= ED_CHECKBUTTON_ID_CUSTOM2_FIRST && - type_id <= ED_CHECKBUTTON_ID_CUSTOM2_LAST) || + if (((type_id >= ED_CHECKBUTTON_ID_CUSTOM_FIRST && + type_id <= ED_CHECKBUTTON_ID_CUSTOM_LAST) || (type_id >= ED_CHECKBUTTON_ID_CHANGE_FIRST && type_id <= ED_CHECKBUTTON_ID_CHANGE_LAST)) && type_id != ED_CHECKBUTTON_ID_CUSTOM_USE_TEMPLATE) diff --git a/src/files.c b/src/files.c index 59adf524..c93d1871 100644 --- a/src/files.c +++ b/src/files.c @@ -225,8 +225,8 @@ static void setLevelInfoToDefaults(struct LevelInfo *level) element_info[element].slippery_type = SLIPPERY_ANY_RANDOM; - element_info[element].explosion_delay = 0; - element_info[element].ignition_delay = 0; + element_info[element].explosion_delay = 18; + element_info[element].ignition_delay = 8; for (x = 0; x < 3; x++) for (y = 0; y < 3; y++) diff --git a/src/game.c b/src/game.c index 0efc0328..4bd3f46c 100644 --- a/src/game.c +++ b/src/game.c @@ -1385,6 +1385,7 @@ void InitGame() ChangeEvent[x][y] = CE_BITMASK_DEFAULT; ExplodePhase[x][y] = 0; + ExplodeDelay[x][y] = 0; ExplodeField[x][y] = EX_NO_EXPLOSION; RunnerVisit[x][y] = 0; @@ -1419,6 +1420,30 @@ void InitGame() emulate_sb ? EMU_SOKOBAN : emulate_sp ? EMU_SUPAPLEX : EMU_NONE); + /* initialize explosion and ignition delay */ + for (i = 0; i < MAX_NUM_ELEMENTS; i++) + { + if (!IS_CUSTOM_ELEMENT(i)) + { + 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; + + element_info[i].explosion_delay = last_phase; + element_info[i].ignition_delay = half_phase; + + if (i == EL_BLACK_ORB) + element_info[i].ignition_delay = 1; + } + + if (element_info[i].explosion_delay < 2) /* !!! check again !!! */ + element_info[i].explosion_delay = 2; + + if (element_info[i].ignition_delay < 1) /* !!! check again !!! */ + element_info[i].ignition_delay = 1; + } + /* correct non-moving belts to start moving left */ for (i = 0; i < 4; i++) if (game.belt_dir[i] == MV_NO_MOVING) @@ -2424,6 +2449,9 @@ void Explode(int ex, int ey, int phase, int mode) int last_phase = num_phase * delay; int half_phase = (num_phase / 2) * delay; int first_phase_after_start = EX_PHASE_START + 1; + int border_element; + + int last_phase_TEST = last_phase; if (game.explosions_delayed) { @@ -2458,6 +2486,10 @@ void Explode(int ex, int ey, int phase, int mode) Feld[ex][ey] = center_element; } +#if 1 + last_phase = element_info[center_element].explosion_delay; +#endif + for (y = ey - 1; y <= ey + 1; y++) for (x = ex - 1; x <= ex + 1; x++) { int xx = x - ex + 1; @@ -2628,6 +2660,9 @@ void Explode(int ex, int ey, int phase, int mode) #endif ExplodePhase[x][y] = 1; +#if 1 + ExplodeDelay[x][y] = last_phase; +#endif Stop[x][y] = TRUE; } @@ -2644,6 +2679,10 @@ void Explode(int ex, int ey, int phase, int mode) x = ex; y = ey; +#if 1 + last_phase = ExplodeDelay[x][y]; +#endif + ExplodePhase[x][y] = (phase < last_phase ? phase + 1 : 0); #ifdef DEBUG @@ -2664,6 +2703,127 @@ void Explode(int ex, int ey, int phase, int mode) } #endif +#if 1 + + border_element = Store2[x][y]; + if (IS_PLAYER(x, y)) + border_element = StorePlayer[x][y]; + + if (phase == element_info[border_element].ignition_delay || + phase == last_phase) + { + if (IS_PLAYER(x, y)) + { + if (phase == 2) + printf("::: IS_PLAYER\n"); + + KillHeroUnlessExplosionProtected(x, y); + return; + } + else if (CAN_EXPLODE_BY_FIRE(border_element)) + { + if (phase == 2) + printf("::: CAN_EXPLODE_BY_FIRE\n"); + + Feld[x][y] = Store2[x][y]; + Store2[x][y] = 0; + Bang(x, y); + return; + } + else if (border_element == EL_AMOEBA_TO_DIAMOND) + { + if (phase == 2) + printf("::: EL_AMOEBA_TO_DIAMOND\n"); + + AmoebeUmwandeln(x, y); + return; + } + } + + if (phase == last_phase) + { + int element; + + element = Feld[x][y] = Store[x][y]; + Store[x][y] = Store2[x][y] = 0; + GfxElement[x][y] = EL_UNDEFINED; + + /* player can escape from explosions and might therefore be still alive */ + if (element >= EL_PLAYER_IS_EXPLODING_1 && + element <= EL_PLAYER_IS_EXPLODING_4) + Feld[x][y] = (stored_player[element - EL_PLAYER_IS_EXPLODING_1].active ? + EL_EMPTY : + element == EL_PLAYER_IS_EXPLODING_1 ? EL_EMERALD_YELLOW : + element == EL_PLAYER_IS_EXPLODING_2 ? EL_EMERALD_RED : + element == EL_PLAYER_IS_EXPLODING_3 ? EL_EMERALD : + EL_EMERALD_PURPLE); + + /* restore probably existing indestructible background element */ + if (Back[x][y] && IS_INDESTRUCTIBLE(Back[x][y])) + element = Feld[x][y] = Back[x][y]; + Back[x][y] = 0; + + MovDir[x][y] = MovPos[x][y] = MovDelay[x][y] = 0; + GfxDir[x][y] = MV_NO_MOVING; + ChangeDelay[x][y] = 0; + ChangePage[x][y] = -1; + + InitField(x, y, FALSE); +#if 1 + /* !!! not needed !!! */ + if (CAN_MOVE(element)) + InitMovDir(x, y); +#endif + DrawLevelField(x, y); + + TestIfElementTouchesCustomElement(x, y); + + if (GFX_CRUMBLED(element)) + DrawLevelFieldCrumbledSandNeighbours(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 (IN_SCR_FIELD(SCREENX(x), SCREENY(y))) + { +#if 1 + int graphic = el_act2img(GfxElement[x][y], ACTION_EXPLODING); +#else + int stored = Store[x][y]; + int graphic = (game.emulation != EMU_SUPAPLEX ? IMG_EXPLOSION : + stored == EL_SP_INFOTRON ? IMG_SP_EXPLOSION_INFOTRON : + IMG_SP_EXPLOSION); +#endif + int frame = getGraphicAnimationFrame(graphic, phase - delay); + +#if 0 + printf("::: %d ['%s'] -> %d\n", GfxElement[x][y], + element_info[GfxElement[x][y]].token_name, + graphic); +#endif + + if (phase == delay) + DrawLevelFieldCrumbledSand(x, y); + + if (IS_WALKABLE_OVER(Back[x][y]) && Back[x][y] != EL_EMPTY) + { + DrawLevelElement(x, y, Back[x][y]); + DrawGraphicThruMask(SCREENX(x), SCREENY(y), graphic, frame); + } + else if (IS_WALKABLE_UNDER(Back[x][y])) + { + DrawGraphic(SCREENX(x), SCREENY(y), graphic, frame); + DrawLevelElementThruMask(x, y, Back[x][y]); + } + else if (!IS_WALKABLE_INSIDE(Back[x][y])) + DrawGraphic(SCREENX(x), SCREENY(y), graphic, frame); + } + +#else + if (phase == first_phase_after_start) { int element = Store2[x][y]; @@ -2772,6 +2932,7 @@ void Explode(int ex, int ey, int phase, int mode) else if (!IS_WALKABLE_INSIDE(Back[x][y])) DrawGraphic(SCREENX(x), SCREENY(y), graphic, frame); } +#endif } void DynaExplode(int ex, int ey) diff --git a/src/init.c b/src/init.c index 85358813..f8004d0b 100644 --- a/src/init.c +++ b/src/init.c @@ -1945,6 +1945,9 @@ void InitElementPropertiesStatic() EL_SP_DISK_YELLOW, EL_SP_SNIKSNAK, EL_SP_ELECTRON, +#if 1 + EL_BLACK_ORB, +#endif -1 }; @@ -3097,8 +3100,20 @@ void InitElementPropertiesEngine(int engine_version) else if (engine_version < VERSION_IDENT(2,2,0,0)) SET_PROPERTY(i, EP_EXPLOSION_PROOF, IS_INDESTRUCTIBLE(i)); else +#if 1 + SET_PROPERTY(i, EP_EXPLOSION_PROOF, (IS_INDESTRUCTIBLE(i) && + (!IS_WALKABLE(i) || + IS_PROTECTED(i)))); +#else +#if 1 + SET_PROPERTY(i, EP_EXPLOSION_PROOF, (IS_INDESTRUCTIBLE(i) && + !IS_WALKABLE_OVER(i) && + !IS_WALKABLE_UNDER(i))); +#else SET_PROPERTY(i, EP_EXPLOSION_PROOF, (IS_INDESTRUCTIBLE(i) && IS_PROTECTED(i))); +#endif +#endif if (IS_CUSTOM_ELEMENT(i)) { diff --git a/src/main.c b/src/main.c index 2fa12d6a..5e5e5f67 100644 --- a/src/main.c +++ b/src/main.c @@ -58,8 +58,9 @@ short WasJustFalling[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; short AmoebaNr[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; short AmoebaCnt[MAX_NUM_AMOEBA]; short AmoebaCnt2[MAX_NUM_AMOEBA]; -short ExplodePhase[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; short ExplodeField[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +short ExplodePhase[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +short ExplodeDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; int RunnerVisit[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; int PlayerVisit[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; diff --git a/src/main.h b/src/main.h index d09b3278..486f6f2a 100644 --- a/src/main.h +++ b/src/main.h @@ -399,6 +399,7 @@ #define SHIELD_ON(p) ((p)->shield_normal_time_left > 0) #if 1 + #define ENEMY_PROTECTED_FIELD(x,y) (IS_PROTECTED(Feld[x][y]) || \ IS_PROTECTED(Back[x][y])) #define EXPLOSION_PROTECTED_FIELD(x,y) (IS_EXPLOSION_PROOF(Feld[x][y])) @@ -406,10 +407,14 @@ ENEMY_PROTECTED_FIELD(x, y)) #define PLAYER_EXPLOSION_PROTECTED(x,y) (SHIELD_ON(PLAYERINFO(x, y)) || \ EXPLOSION_PROTECTED_FIELD(x, y)) + #else + #define PROTECTED_FIELD(x,y) (IS_ACCESSIBLE_INSIDE(Feld[x][y]) && \ IS_INDESTRUCTIBLE(Feld[x][y])) -#define PLAYER_PROTECTED(x,y) (SHIELD_ON(PLAYERINFO(x, y)) || \ +#define PLAYER_ENEMY_PROTECTED(x,y) (SHIELD_ON(PLAYERINFO(x, y)) || \ + PROTECTED_FIELD(x, y)) +#define PLAYER_EXPLOSION_PROTECTED(x,y) (SHIELD_ON(PLAYERINFO(x, y)) || \ PROTECTED_FIELD(x, y)) #endif @@ -1762,8 +1767,9 @@ extern short WasJustFalling[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; extern short AmoebaNr[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; extern short AmoebaCnt[MAX_NUM_AMOEBA]; extern short AmoebaCnt2[MAX_NUM_AMOEBA]; -extern short ExplodePhase[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; extern short ExplodeField[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +extern short ExplodePhase[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +extern short ExplodeDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; extern int RunnerVisit[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; extern int PlayerVisit[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; diff --git a/src/netserv.c b/src/netserv.c index 7343be62..08d16102 100644 --- a/src/netserv.c +++ b/src/netserv.c @@ -24,7 +24,7 @@ #include #include #include -#include /* apparently needed by OS/2 */ +#include /* apparently needed for OS/2 port */ #include "libgame/libgame.h"