From: Holger Schemel Date: Tue, 10 Jun 2003 22:53:43 +0000 (+0200) Subject: rnd-20030611-1-src X-Git-Tag: 3.0.0^2~53 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=76fcd443cdb6744e9113b9c648ca5fc2546da848;p=rocksndiamonds.git rnd-20030611-1-src --- diff --git a/src/conftime.h b/src/conftime.h index 76000455..f453ceee 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2003-06-10 02:16]" +#define COMPILE_DATE_STRING "[2003-06-10 23:15]" diff --git a/src/editor.c b/src/editor.c index 6e7edd10..afd0a884 100644 --- a/src/editor.c +++ b/src/editor.c @@ -884,9 +884,9 @@ static int value_deadliness = 0; static struct ValueTextInfo options_smash_targets[] = { - { EP_CAN_SMASH_FRIENDS, "friends" }, + { EP_CAN_SMASH_PLAYER, "player" }, { EP_CAN_SMASH_ENEMIES, "enemies" }, - { EP_CAN_SMASH_EXPLOSIVES, "explosives" }, + { EP_CAN_SMASH_EVERYTHING, "everything" }, { -1, NULL } }; static int value_smash_targets = 0; @@ -3447,14 +3447,14 @@ static void CopyCustomElementPropertiesToEditor(int element) /* set smash targets selectbox help value */ value_smash_targets = - (CAN_SMASH_EXPLOSIVES(element) ? EP_CAN_SMASH_EXPLOSIVES : + (CAN_SMASH_EVERYTHING(element) ? EP_CAN_SMASH_EVERYTHING : CAN_SMASH_ENEMIES(element) ? EP_CAN_SMASH_ENEMIES : - CAN_SMASH_FRIENDS(element) ? EP_CAN_SMASH_FRIENDS : - EP_CAN_SMASH_FRIENDS); + CAN_SMASH_PLAYER(element) ? EP_CAN_SMASH_PLAYER : + EP_CAN_SMASH_PLAYER); custom_element_properties[EP_CAN_SMASH] = - (CAN_SMASH_EXPLOSIVES(element) || + (CAN_SMASH_EVERYTHING(element) || CAN_SMASH_ENEMIES(element) || - CAN_SMASH_FRIENDS(element)); + CAN_SMASH_PLAYER(element)); /* set walkable layer selectbox help value */ value_walkable_layer = @@ -3501,9 +3501,9 @@ static void CopyCustomElementPropertiesToGame(int element) custom_element_properties[EP_DEADLY]; /* set smash property from checkbox and selectbox */ - custom_element_properties[EP_CAN_SMASH_FRIENDS] = FALSE; + custom_element_properties[EP_CAN_SMASH_PLAYER] = FALSE; custom_element_properties[EP_CAN_SMASH_ENEMIES] = FALSE; - custom_element_properties[EP_CAN_SMASH_EXPLOSIVES] = FALSE; + custom_element_properties[EP_CAN_SMASH_EVERYTHING] = FALSE; custom_element_properties[value_smash_targets] = custom_element_properties[EP_CAN_SMASH]; @@ -4253,9 +4253,9 @@ static void DrawPropertiesInfo() #if 0 { EP_CAN_SMASH, "- can smash" }, #endif - { EP_CAN_SMASH_FRIENDS, "- can smash player and friends" }, + { EP_CAN_SMASH_PLAYER, "- can smash player" }, { EP_CAN_SMASH_ENEMIES, "- can smash good and bad guys" }, - { EP_CAN_SMASH_EXPLOSIVES, "- can smash everything smashable" }, + { EP_CAN_SMASH_EVERYTHING, "- can smash everything smashable" }, { EP_CAN_EXPLODE, "- can explode" }, { EP_CAN_EXPLODE_BY_FIRE, " - by fire or explosions" }, { EP_CAN_EXPLODE_SMASHED, " - when smashed" }, diff --git a/src/game.c b/src/game.c index c4764283..abd3bd4b 100644 --- a/src/game.c +++ b/src/game.c @@ -2326,10 +2326,12 @@ void Impact(int x, int y) return; object_hit = (!IS_FREE(x, y+1) && (!IS_MOVING(x, y+1) || - MovDir[x][y+1] != MV_DOWN || - MovPos[x][y+1] <= TILEY / 2)); + MovDir[x][y+1] != MV_DOWN || + MovPos[x][y+1] <= TILEY / 2)); if (object_hit) smashed = MovingOrBlocked2Element(x, y+1); + + impact = (lastline || object_hit); } if (!lastline && smashed == EL_ACID) /* element falls into acid */ @@ -2379,7 +2381,11 @@ void Impact(int x, int y) return; } +#if 1 + if (object_hit) /* check which object was hit */ +#else if (!lastline && object_hit) /* check which object was hit */ +#endif { if (CAN_PASS_MAGIC_WALL(element) && (smashed == EL_MAGIC_WALL || @@ -2406,13 +2412,19 @@ void Impact(int x, int y) if (IS_PLAYER(x, y + 1)) { - KillHeroUnlessProtected(x, y+1); - return; + if (CAN_SMASH_PLAYER(element)) + { + KillHeroUnlessProtected(x, y+1); + return; + } } else if (smashed == EL_PENGUIN) { - Bang(x, y + 1); - return; + if (CAN_SMASH_PLAYER(element)) + { + Bang(x, y + 1); + return; + } } else if (element == EL_BD_DIAMOND) { @@ -2431,11 +2443,18 @@ void Impact(int x, int y) Bang(x, y + 1); return; } +#if 1 + else if (CAN_SMASH_EVERYTHING(element)) +#else else if (element == EL_ROCK || element == EL_SP_ZONK || element == EL_BD_ROCK) +#endif { if (IS_CLASSIC_ENEMY(smashed) || +#if 1 + CAN_EXPLODE_SMASHED(smashed)) +#else smashed == EL_BOMB || smashed == EL_SP_DISK_ORANGE || smashed == EL_DX_SUPABOMB || @@ -2443,6 +2462,7 @@ void Impact(int x, int y) smashed == EL_PIG || smashed == EL_DRAGON || smashed == EL_MOLE) +#endif { Bang(x, y + 1); return; diff --git a/src/init.c b/src/init.c index 11100842..a5b386bc 100644 --- a/src/init.c +++ b/src/init.c @@ -1383,7 +1383,7 @@ void InitElementPropertiesStatic() -1 }; - static int ep_can_smash_friends[] = + static int ep_can_smash_player[] = { EL_ROCK, EL_BD_ROCK, @@ -1416,7 +1416,7 @@ void InitElementPropertiesStatic() -1 }; - static int ep_can_smash_explosives[] = + static int ep_can_smash_everything[] = { EL_ROCK, EL_BD_ROCK, @@ -2310,9 +2310,9 @@ void InitElementPropertiesStatic() { ep_can_change, EP_CAN_CHANGE }, { ep_can_move, EP_CAN_MOVE }, { ep_can_fall, EP_CAN_FALL }, - { ep_can_smash_friends, EP_CAN_SMASH_FRIENDS }, + { ep_can_smash_player, EP_CAN_SMASH_PLAYER }, { ep_can_smash_enemies, EP_CAN_SMASH_ENEMIES }, - { ep_can_smash_explosives, EP_CAN_SMASH_EXPLOSIVES }, + { ep_can_smash_everything, EP_CAN_SMASH_EVERYTHING }, { ep_can_explode_by_fire, EP_CAN_EXPLODE_BY_FIRE }, { ep_can_explode_smashed, EP_CAN_EXPLODE_SMASHED }, { ep_can_explode_impact, EP_CAN_EXPLODE_IMPACT }, @@ -2450,9 +2450,9 @@ void InitElementPropertiesEngine(int engine_version) EP_DONT_COLLIDE_WITH, EP_CAN_MOVE, EP_CAN_FALL, - EP_CAN_SMASH_FRIENDS, + EP_CAN_SMASH_PLAYER, EP_CAN_SMASH_ENEMIES, - EP_CAN_SMASH_EXPLOSIVES, + EP_CAN_SMASH_EVERYTHING, EP_PUSHABLE, EP_CAN_BE_CRUMBLED, @@ -2562,17 +2562,17 @@ void InitElementPropertiesEngine(int engine_version) if (DONT_COLLIDE_WITH(i)) SET_PROPERTY(i, EP_DONT_RUN_INTO, TRUE); - /* ---------- CAN_SMASH_ENEMIES / CAN_SMASH_FRIENDS ------------------ */ - if (CAN_SMASH_EXPLOSIVES(i)) + /* ---------- CAN_SMASH_ENEMIES / CAN_SMASH_PLAYER ------------------- */ + if (CAN_SMASH_EVERYTHING(i)) SET_PROPERTY(i, EP_CAN_SMASH_ENEMIES, TRUE); if (CAN_SMASH_ENEMIES(i)) - SET_PROPERTY(i, EP_CAN_SMASH_FRIENDS, TRUE); + SET_PROPERTY(i, EP_CAN_SMASH_PLAYER, TRUE); } /* ---------- CAN_SMASH ------------------------------------------------ */ - SET_PROPERTY(i, EP_CAN_SMASH, (CAN_SMASH_FRIENDS(i) || + SET_PROPERTY(i, EP_CAN_SMASH, (CAN_SMASH_PLAYER(i) || CAN_SMASH_ENEMIES(i) || - CAN_SMASH_EXPLOSIVES(i))); + CAN_SMASH_EVERYTHING(i))); /* ---------- CAN_EXPLODE ---------------------------------------------- */ SET_PROPERTY(i, EP_CAN_EXPLODE, (CAN_EXPLODE_BY_FIRE(i) || diff --git a/src/main.h b/src/main.h index 239e6afb..ec1f8f6d 100644 --- a/src/main.h +++ b/src/main.h @@ -71,9 +71,9 @@ #define EP_CAN_CHANGE 7 #define EP_CAN_MOVE 8 #define EP_CAN_FALL 9 -#define EP_CAN_SMASH_FRIENDS 10 +#define EP_CAN_SMASH_PLAYER 10 #define EP_CAN_SMASH_ENEMIES 11 -#define EP_CAN_SMASH_EXPLOSIVES 12 +#define EP_CAN_SMASH_EVERYTHING 12 #define EP_CAN_EXPLODE_BY_FIRE 13 #define EP_CAN_EXPLODE_SMASHED 14 #define EP_CAN_EXPLODE_IMPACT 15 @@ -187,9 +187,9 @@ #define CAN_CHANGE(e) HAS_PROPERTY(e, EP_CAN_CHANGE) #define CAN_MOVE(e) HAS_PROPERTY(e, EP_CAN_MOVE) #define CAN_FALL(e) HAS_PROPERTY(e, EP_CAN_FALL) -#define CAN_SMASH_FRIENDS(e) HAS_PROPERTY(e, EP_CAN_SMASH_FRIENDS) +#define CAN_SMASH_PLAYER(e) HAS_PROPERTY(e, EP_CAN_SMASH_PLAYER) #define CAN_SMASH_ENEMIES(e) HAS_PROPERTY(e, EP_CAN_SMASH_ENEMIES) -#define CAN_SMASH_EXPLOSIVES(e) HAS_PROPERTY(e, EP_CAN_SMASH_EXPLOSIVES) +#define CAN_SMASH_EVERYTHING(e) HAS_PROPERTY(e, EP_CAN_SMASH_EVERYTHING) #define CAN_EXPLODE_BY_FIRE(e) HAS_PROPERTY(e, EP_CAN_EXPLODE_BY_FIRE) #define CAN_EXPLODE_SMASHED(e) HAS_PROPERTY(e, EP_CAN_EXPLODE_SMASHED) #define CAN_EXPLODE_IMPACT(e) HAS_PROPERTY(e, EP_CAN_EXPLODE_IMPACT)