From: Holger Schemel Date: Wed, 16 Apr 2003 16:37:19 +0000 (+0200) Subject: rnd-20030416-1-src X-Git-Tag: 3.0.0^2~99 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=5ae04ac2ef54f6f164a797c16c9782042cc2ce67;p=rocksndiamonds.git rnd-20030416-1-src --- diff --git a/src/conftime.h b/src/conftime.h index 07345deb..6338934d 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2003-04-13 19:16]" +#define COMPILE_DATE_STRING "[2003-04-15 23:44]" diff --git a/src/editor.c b/src/editor.c index 66a09d7b..df3db706 100644 --- a/src/editor.c +++ b/src/editor.c @@ -530,19 +530,7 @@ static int random_placement_method = RANDOM_USE_QUANTITY; static int random_placement_background_element = EL_SAND; static boolean random_placement_background_restricted = FALSE; static boolean stick_element_properties_window = FALSE; - -#if 1 -boolean custom_element_properties[NUM_ELEMENT_PROPERTIES]; -#else -static struct -{ - boolean indestructible; - boolean can_fall; - boolean can_smash; - boolean pushable; - boolean slippery; -} custom_element_properties[NUM_CUSTOM_ELEMENTS]; -#endif +static boolean custom_element_properties[NUM_ELEMENT_PROPERTIES]; static struct { @@ -607,7 +595,7 @@ static struct 0, 255, GADGET_ID_LEVEL_TIMESCORE_DOWN, GADGET_ID_LEVEL_TIMESCORE_UP, GADGET_ID_LEVEL_TIMESCORE_TEXT, - &level.score[SC_ZEITBONUS], + &level.score[SC_TIME_BONUS], "score for each 10 seconds left", NULL }, { @@ -2812,13 +2800,12 @@ static void CopyPlayfield(short src[MAX_LEV_FIELDX][MAX_LEV_FIELDY], dst[x][y] = src[x][y]; } -#if 1 static void CopyCustomElementPropertiesToEditor(int element) { int i; for (i=0; i < NUM_ELEMENT_PROPERTIES; i++) - custom_element_properties[i] = PROPERTY_VALUE(element, i); + custom_element_properties[i] = HAS_PROPERTY(element, i); } static void CopyCustomElementPropertiesToGame(int element) @@ -2829,72 +2816,6 @@ static void CopyCustomElementPropertiesToGame(int element) SET_PROPERTY(element, i, custom_element_properties[i]); } -#else - -static void CopyCustomElementPropertiesToEditor() -{ - int i; - - for (i=0; i < NUM_CUSTOM_ELEMENTS; i++) - { - int element = EL_CUSTOM_START + i; - int properties = Properties1[element]; - - custom_element_properties[i].indestructible = - ((properties & EP_BIT_INDESTRUCTIBLE) != 0 ? TRUE : FALSE); - - 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].pushable = - ((properties & EP_BIT_PUSHABLE) != 0 ? TRUE : FALSE); - - custom_element_properties[i].slippery = - ((properties & EP_BIT_SLIPPERY) != 0 ? TRUE : FALSE); - } -} - -static void CopyCustomElementPropertiesToGame() -{ - int i; - - for (i=0; i < NUM_CUSTOM_ELEMENTS; i++) - { - int element = EL_CUSTOM_START + i; - - Properties1[element] = EP_BITMASK_DEFAULT; - - if (custom_element_properties[i].indestructible) - Properties1[element] |= EP_BIT_INDESTRUCTIBLE; - else - Properties1[element] &= ~EP_BIT_INDESTRUCTIBLE; - - if (custom_element_properties[i].can_fall) - Properties1[element] |= EP_BIT_CAN_FALL; - 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].pushable) - Properties1[element] |= EP_BIT_PUSHABLE; - else - Properties1[element] &= ~EP_BIT_PUSHABLE; - - if (custom_element_properties[i].slippery) - Properties1[element] |= EP_BIT_SLIPPERY; - else - Properties1[element] &= ~EP_BIT_SLIPPERY; - } -} -#endif - void DrawLevelEd() { CloseDoor(DOOR_CLOSE_ALL); @@ -3375,45 +3296,45 @@ static struct char *text; } elements_with_counter[] = { - { EL_EMERALD, &level.score[SC_EDELSTEIN], TEXT_COLLECTING }, - { EL_BD_DIAMOND, &level.score[SC_EDELSTEIN], TEXT_COLLECTING }, - { EL_EMERALD_YELLOW, &level.score[SC_EDELSTEIN], TEXT_COLLECTING }, - { EL_EMERALD_RED, &level.score[SC_EDELSTEIN], TEXT_COLLECTING }, - { EL_EMERALD_PURPLE, &level.score[SC_EDELSTEIN], TEXT_COLLECTING }, - { EL_DIAMOND, &level.score[SC_DIAMANT], TEXT_COLLECTING }, - { EL_BUG_RIGHT, &level.score[SC_KAEFER], TEXT_SMASHING }, - { EL_BUG_UP, &level.score[SC_KAEFER], TEXT_SMASHING }, - { EL_BUG_LEFT, &level.score[SC_KAEFER], TEXT_SMASHING }, - { EL_BUG_DOWN, &level.score[SC_KAEFER], TEXT_SMASHING }, - { EL_BD_BUTTERFLY_RIGHT,&level.score[SC_KAEFER], TEXT_SMASHING }, - { EL_BD_BUTTERFLY_UP, &level.score[SC_KAEFER], TEXT_SMASHING }, - { EL_BD_BUTTERFLY_LEFT, &level.score[SC_KAEFER], TEXT_SMASHING }, - { EL_BD_BUTTERFLY_DOWN, &level.score[SC_KAEFER], TEXT_SMASHING }, - { EL_SPACESHIP_RIGHT, &level.score[SC_FLIEGER], TEXT_SMASHING }, - { EL_SPACESHIP_UP, &level.score[SC_FLIEGER], TEXT_SMASHING }, - { EL_SPACESHIP_LEFT, &level.score[SC_FLIEGER], TEXT_SMASHING }, - { EL_SPACESHIP_DOWN, &level.score[SC_FLIEGER], TEXT_SMASHING }, - { EL_BD_FIREFLY_RIGHT,&level.score[SC_FLIEGER], TEXT_SMASHING }, - { EL_BD_FIREFLY_UP, &level.score[SC_FLIEGER], TEXT_SMASHING }, - { EL_BD_FIREFLY_LEFT, &level.score[SC_FLIEGER], TEXT_SMASHING }, - { EL_BD_FIREFLY_DOWN, &level.score[SC_FLIEGER], TEXT_SMASHING }, - { EL_YAMYAM, &level.score[SC_MAMPFER], TEXT_SMASHING }, - { EL_DARK_YAMYAM, &level.score[SC_MAMPFER], TEXT_SMASHING }, + { EL_EMERALD, &level.score[SC_EMERALD], TEXT_COLLECTING }, + { EL_BD_DIAMOND, &level.score[SC_EMERALD], TEXT_COLLECTING }, + { EL_EMERALD_YELLOW, &level.score[SC_EMERALD], TEXT_COLLECTING }, + { EL_EMERALD_RED, &level.score[SC_EMERALD], TEXT_COLLECTING }, + { EL_EMERALD_PURPLE, &level.score[SC_EMERALD], TEXT_COLLECTING }, + { EL_DIAMOND, &level.score[SC_DIAMOND], TEXT_COLLECTING }, + { EL_BUG_RIGHT, &level.score[SC_BUG], TEXT_SMASHING }, + { EL_BUG_UP, &level.score[SC_BUG], TEXT_SMASHING }, + { EL_BUG_LEFT, &level.score[SC_BUG], TEXT_SMASHING }, + { EL_BUG_DOWN, &level.score[SC_BUG], TEXT_SMASHING }, + { EL_BD_BUTTERFLY_RIGHT,&level.score[SC_BUG], TEXT_SMASHING }, + { EL_BD_BUTTERFLY_UP, &level.score[SC_BUG], TEXT_SMASHING }, + { EL_BD_BUTTERFLY_LEFT, &level.score[SC_BUG], TEXT_SMASHING }, + { EL_BD_BUTTERFLY_DOWN, &level.score[SC_BUG], TEXT_SMASHING }, + { EL_SPACESHIP_RIGHT, &level.score[SC_SPACESHIP], TEXT_SMASHING }, + { EL_SPACESHIP_UP, &level.score[SC_SPACESHIP], TEXT_SMASHING }, + { EL_SPACESHIP_LEFT, &level.score[SC_SPACESHIP], TEXT_SMASHING }, + { EL_SPACESHIP_DOWN, &level.score[SC_SPACESHIP], TEXT_SMASHING }, + { EL_BD_FIREFLY_RIGHT,&level.score[SC_SPACESHIP], TEXT_SMASHING }, + { EL_BD_FIREFLY_UP, &level.score[SC_SPACESHIP], TEXT_SMASHING }, + { EL_BD_FIREFLY_LEFT, &level.score[SC_SPACESHIP], TEXT_SMASHING }, + { EL_BD_FIREFLY_DOWN, &level.score[SC_SPACESHIP], TEXT_SMASHING }, + { EL_YAMYAM, &level.score[SC_YAMYAM], TEXT_SMASHING }, + { EL_DARK_YAMYAM, &level.score[SC_YAMYAM], TEXT_SMASHING }, { EL_ROBOT, &level.score[SC_ROBOT], TEXT_SMASHING }, { EL_PACMAN_RIGHT, &level.score[SC_PACMAN], TEXT_SMASHING }, { EL_PACMAN_UP, &level.score[SC_PACMAN], TEXT_SMASHING }, { EL_PACMAN_LEFT, &level.score[SC_PACMAN], TEXT_SMASHING }, { EL_PACMAN_DOWN, &level.score[SC_PACMAN], TEXT_SMASHING }, - { EL_NUT, &level.score[SC_KOKOSNUSS], TEXT_CRACKING }, - { EL_DYNAMITE, &level.score[SC_DYNAMIT], TEXT_COLLECTING }, - { EL_KEY_1, &level.score[SC_SCHLUESSEL], TEXT_COLLECTING }, - { EL_KEY_2, &level.score[SC_SCHLUESSEL], TEXT_COLLECTING }, - { EL_KEY_3, &level.score[SC_SCHLUESSEL], TEXT_COLLECTING }, - { EL_KEY_4, &level.score[SC_SCHLUESSEL], TEXT_COLLECTING }, - { EL_EM_KEY_1_FILE, &level.score[SC_SCHLUESSEL], TEXT_COLLECTING }, - { EL_EM_KEY_2_FILE, &level.score[SC_SCHLUESSEL], TEXT_COLLECTING }, - { EL_EM_KEY_3_FILE, &level.score[SC_SCHLUESSEL], TEXT_COLLECTING }, - { EL_EM_KEY_4_FILE, &level.score[SC_SCHLUESSEL], TEXT_COLLECTING }, + { EL_NUT, &level.score[SC_NUT], TEXT_CRACKING }, + { EL_DYNAMITE, &level.score[SC_DYNAMITE], TEXT_COLLECTING }, + { EL_KEY_1, &level.score[SC_KEY], TEXT_COLLECTING }, + { EL_KEY_2, &level.score[SC_KEY], TEXT_COLLECTING }, + { EL_KEY_3, &level.score[SC_KEY], TEXT_COLLECTING }, + { EL_KEY_4, &level.score[SC_KEY], TEXT_COLLECTING }, + { EL_EM_KEY_1_FILE, &level.score[SC_KEY], TEXT_COLLECTING }, + { EL_EM_KEY_2_FILE, &level.score[SC_KEY], TEXT_COLLECTING }, + { EL_EM_KEY_3_FILE, &level.score[SC_KEY], TEXT_COLLECTING }, + { EL_EM_KEY_4_FILE, &level.score[SC_KEY], TEXT_COLLECTING }, { EL_AMOEBA_WET, &level.amoeba_speed, TEXT_SPEED }, { EL_AMOEBA_DRY, &level.amoeba_speed, TEXT_SPEED }, { EL_AMOEBA_FULL, &level.amoeba_speed, TEXT_SPEED }, @@ -3504,81 +3425,20 @@ static void DrawPropertiesConfig() if (IS_CUSTOM_ELEMENT(properties_element)) { -#if 0 - int nr = properties_element - EL_CUSTOM_START; -#endif - CopyCustomElementPropertiesToEditor(properties_element); - /* draw checkbutton gadget */ - i = ED_CHECKBUTTON_ID_CUSTOM_INDESTRUCTIBLE; - x = checkbutton_info[i].x + xoffset_right2; - y = checkbutton_info[i].y + yoffset_right2; - -#if 0 - checkbutton_info[i].value = &custom_element_properties[nr].indestructible; -#endif - - DrawTextF(x, y, FONT_TEXT_1, 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_CAN_FALL; - x = checkbutton_info[i].x + xoffset_right2; - y = checkbutton_info[i].y + yoffset_right2; - -#if 0 - checkbutton_info[i].value = &custom_element_properties[nr].can_fall; -#endif - - DrawTextF(x, y, FONT_TEXT_1, 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_CAN_SMASH; - x = checkbutton_info[i].x + xoffset_right2; - y = checkbutton_info[i].y + yoffset_right2; - -#if 0 - checkbutton_info[i].value = &custom_element_properties[nr].can_smash; -#endif - - DrawTextF(x, y, FONT_TEXT_1, 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_PUSHABLE; - x = checkbutton_info[i].x + xoffset_right2; - y = checkbutton_info[i].y + yoffset_right2; - -#if 0 - checkbutton_info[i].value = &custom_element_properties[nr].pushable; -#endif - - DrawTextF(x, y, FONT_TEXT_1, 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; - y = checkbutton_info[i].y + yoffset_right2; - -#if 0 - checkbutton_info[i].value = &custom_element_properties[nr].slippery; -#endif - - DrawTextF(x, y, FONT_TEXT_1, checkbutton_info[i].text); - ModifyGadget(level_editor_gadget[checkbutton_info[i].gadget_id], - GDI_CHECKED, *checkbutton_info[i].value, GDI_END); - MapCheckbuttonGadget(i); + for (i = ED_CHECKBUTTON_ID_CUSTOM_INDESTRUCTIBLE; + i <= ED_CHECKBUTTON_ID_CUSTOM_SLIPPERY; i++) + { + /* draw checkbutton gadget */ + x = checkbutton_info[i].x + xoffset_right2; + y = checkbutton_info[i].y + yoffset_right2; + + DrawTextF(x, y, FONT_TEXT_1, checkbutton_info[i].text); + ModifyGadget(level_editor_gadget[checkbutton_info[i].gadget_id], + GDI_CHECKED, *checkbutton_info[i].value, GDI_END); + MapCheckbuttonGadget(i); + } /* draw selectbox gadget */ i = ED_SELECTBOX_ID_CUSTOM_CHANGE_CAUSE; @@ -3812,11 +3672,65 @@ static void DrawPropertiesTabulatorGadgets() static void DrawPropertiesInfo() { + static struct + { + int value; + char *text; + } + properties[] = + { + { EP_AMOEBALIVE, "- living amoeba" }, + { EP_AMOEBOID, "- amoeboid" }, + { EP_PFORTE, "- pforte" }, + { EP_SOLID, "- solid" }, + { EP_INDESTRUCTIBLE, "- undestructible" }, + { EP_SLIPPERY, "- slippery" }, + { EP_ENEMY, "- enemy" }, + { EP_MAUER, "- mauer" }, + { EP_CAN_FALL, "- can fall" }, + { EP_CAN_SMASH, "- can smash" }, + { EP_CAN_CHANGE, "- can change" }, + { EP_CAN_MOVE, "- can move" }, + { EP_COULD_MOVE, "- could move" }, + { EP_DONT_TOUCH, "- don't touch" }, + { EP_DONT_GO_TO, "- don't go to" }, + { EP_FOOD_DARK_YAMYAM, "- food for dark yamyam" }, + { EP_BD_ELEMENT, "- BD style" }, + { EP_SB_ELEMENT, "- SB style" }, + { EP_GEM, "- gem" }, + { EP_INACTIVE, "- inactive" }, + { EP_EXPLOSIVE, "- explosive" }, + { EP_FOOD_PENGUIN, "- food for penguin" }, + { EP_PUSHABLE, "- pushable" }, + { EP_PLAYER, "- player" }, + { EP_HAS_CONTENT, "- has content" }, + { EP_DIGGABLE, "- diggable" }, + { EP_SP_ELEMENT, "- SB style" }, + { EP_WALKABLE_THROUGH, "- walkable through" }, + { EP_OVER_PLAYER, "- over player" }, + { EP_ACTIVE_BOMB, "- active bomb" }, + { EP_BELT, "- belt" }, + { EP_BELT_ACTIVE, "- active belt" }, + { EP_BELT_SWITCH, "- belt switch" }, + { EP_WALKABLE_UNDER, "- walkable under" }, + { EP_EM_SLIPPERY_WALL, "- EM style slippery wall" }, + { EP_CAN_BE_CRUMBLED, "- can be crumbled" }, + { -1, NULL } + }; char *filename = getElementDescriptionFilename(properties_element); - int num_elements_in_level; + char *percentage_text = "In this level:"; + char *properties_text = "Standard properties:"; float percentage; + int num_elements_in_level; + int num_standard_properties = 0; + int font1_nr = FONT_TEXT_1; + int font2_nr = FONT_TEXT_2; + int font1_width = getFontWidth(font1_nr); + int font2_height = getFontHeight(font2_nr); + int pad_x = ED_SETTINGS_XPOS; + int pad_y = 5 * TILEY; int screen_line = 2; - int x, y; + int i, x, y; num_elements_in_level = 0; for (y=0; y 0) + { + DrawTextF(pad_x, pad_y + screen_line * font2_height, font1_nr, + properties_text); + screen_line++; + + for (i=0; properties[i].value != -1; i++) + { + if (!HAS_PROPERTY(properties_element, properties[i].value)) + continue; + + DrawTextF(pad_x, pad_y + screen_line * font2_height, font2_nr, + properties[i].text); + screen_line++; + } + + screen_line++; + } PrintInfoText("Description:", FONT_TEXT_1, screen_line); if (PrintElementDescriptionFromFile(filename, screen_line + 1) == 0) diff --git a/src/game.c b/src/game.c index bdd3059e..338e670b 100644 --- a/src/game.c +++ b/src/game.c @@ -533,32 +533,15 @@ static void InitGameEngine() }; static int ep_em_slippery_wall_num = SIZEOF_ARRAY_INT(ep_em_slippery_wall); + /* special EM style gems behaviour */ for (i=0; i VERSION_IDENT(2,0,1))); -#else - if (level.em_slippery_gems && game.engine_version > VERSION_IDENT(2,0,1)) - Properties2[EL_EXPANDABLE_WALL_GROWING] |= EP_BIT_EM_SLIPPERY_WALL; - else - Properties2[EL_EXPANDABLE_WALL_GROWING] &=~EP_BIT_EM_SLIPPERY_WALL; -#endif } /* initialize changing elements information */ @@ -1123,7 +1106,7 @@ void GameWon() if (!tape.playing && !setup.sound_loops) PlaySoundStereo(SND_GAME_LEVELTIME_BONUS, SOUND_MIDDLE); if (TimeLeft > 0 && !(TimeLeft % 10)) - RaiseScore(level.score[SC_ZEITBONUS]); + RaiseScore(level.score[SC_TIME_BONUS]); if (TimeLeft > 100 && !(TimeLeft % 10)) TimeLeft -= 10; else @@ -1149,7 +1132,7 @@ void GameWon() if (!tape.playing && !setup.sound_loops) PlaySoundStereo(SND_GAME_LEVELTIME_BONUS, SOUND_MIDDLE); if (TimePlayed < 999 && !(TimePlayed % 10)) - RaiseScore(level.score[SC_ZEITBONUS]); + RaiseScore(level.score[SC_TIME_BONUS]); if (TimePlayed < 900 && !(TimePlayed % 10)) TimePlayed += 10; else @@ -2446,11 +2429,11 @@ void TurnRound(int x, int y) if (IN_LEV_FIELD(left_x, left_y) && (IS_FREE_OR_PLAYER(left_x, left_y) || - IS_MAMPF2(Feld[left_x][left_y]))) + IS_FOOD_DARK_YAMYAM(Feld[left_x][left_y]))) can_turn_left = TRUE; if (IN_LEV_FIELD(right_x, right_y) && (IS_FREE_OR_PLAYER(right_x, right_y) || - IS_MAMPF2(Feld[right_x][right_y]))) + IS_FOOD_DARK_YAMYAM(Feld[right_x][right_y]))) can_turn_right = TRUE; if (can_turn_left && can_turn_right) @@ -2737,7 +2720,7 @@ void TurnRound(int x, int y) Feld[newx][newy] == EL_ACID || (element == EL_PENGUIN && (Feld[newx][newy] == EL_EXIT_OPEN || - IS_MAMPF3(Feld[newx][newy]))))) + IS_FOOD_PENGUIN(Feld[newx][newy]))))) return; MovDir[x][y] = @@ -2749,7 +2732,7 @@ void TurnRound(int x, int y) Feld[newx][newy] == EL_ACID || (element == EL_PENGUIN && (Feld[newx][newy] == EL_EXIT_OPEN || - IS_MAMPF3(Feld[newx][newy]))))) + IS_FOOD_PENGUIN(Feld[newx][newy]))))) return; MovDir[x][y] = old_move_dir; @@ -3039,8 +3022,8 @@ void StartMoving(int x, int y) if (!MovDelay[x][y]) /* start new movement phase */ { - /* all objects that can change their move direction after each step */ - /* (MAMPFER, MAMPFER2 and PACMAN go straight until they hit a wall */ + /* all objects that can change their move direction after each step + (YAMYAM, DARK_YAMYAM and PACMAN go straight until they hit a wall */ if (element != EL_YAMYAM && element != EL_DARK_YAMYAM && @@ -3167,7 +3150,7 @@ void StartMoving(int x, int y) return; } - else if (IS_MAMPF3(Feld[newx][newy])) + else if (IS_FOOD_PENGUIN(Feld[newx][newy])) { if (DigField(local_player, newx, newy, 0, 0, DF_DIG) == MF_MOVING) DrawLevelField(newx, newy); @@ -3262,7 +3245,7 @@ void StartMoving(int x, int y) PlaySoundLevel(x, y, SND_YAMYAM_DIGGING); } else if (element == EL_DARK_YAMYAM && IN_LEV_FIELD(newx, newy) && - IS_MAMPF2(Feld[newx][newy])) + IS_FOOD_DARK_YAMYAM(Feld[newx][newy])) { if (AmoebaNr[newx][newy]) { @@ -5047,11 +5030,18 @@ static void CheckGravityMovement(struct PlayerInfo *player) if (field_under_player_is_free && !player_is_moving_to_valid_field && - !IS_TUBE(Feld[jx][jy])) + !IS_WALKABLE_UNDER(Feld[jx][jy])) player->programmed_action = MV_DOWN; } } +/* + MoveFigureOneStep() + ----------------------------------------------------------------------------- + dx, dy: direction (non-diagonal) to try to move the player to + real_dx, real_dy: direction as read from input device (can be diagonal) +*/ + boolean MoveFigureOneStep(struct PlayerInfo *player, int dx, int dy, int real_dx, int real_dy) { @@ -5326,7 +5316,7 @@ void ScrollFigure(struct PlayerInfo *player, int mode) if (player->MovPos == 0) { - if (IS_QUICK_GATE(Feld[last_jx][last_jy])) + if (IS_WALKABLE_THROUGH(Feld[last_jx][last_jy])) { /* continue with normal speed after quickly moving through gate */ HALVE_PLAYER_SPEED(player); @@ -5667,6 +5657,25 @@ void RemoveHero(struct PlayerInfo *player) ExitY = ZY = jy; } +#if 0 +/* + checkDiagonalPushing() + ----------------------------------------------------------------------------- + check if diagonal input device direction results in pushing of object +*/ + +static boolean checkDiagonalPushing(int x, int y, int real_dx, int real_dy) +{ +} +#endif + +/* + DigField() + ----------------------------------------------------------------------------- + x, y: field next to player (non-diagonal) to try to dig to + real_dx, real_dy: direction as read from input device (can be diagonal) +*/ + int DigField(struct PlayerInfo *player, int x, int y, int real_dx, int real_dy, int mode) { @@ -5697,7 +5706,7 @@ int DigField(struct PlayerInfo *player, if (IS_MOVING(x, y) || IS_PLAYER(x, y)) return MF_NO_ACTION; - if (IS_TUBE(Feld[jx][jy])) + if (IS_WALKABLE_UNDER(Feld[jx][jy])) { int i = 0; int tube_leave_directions[][2] = @@ -6115,16 +6124,16 @@ int DigField(struct PlayerInfo *player, break; case EL_SP_PORT_LEFT: - case EL_SP_GRAVITY_PORT_LEFT: case EL_SP_PORT_RIGHT: - case EL_SP_GRAVITY_PORT_RIGHT: case EL_SP_PORT_UP: - case EL_SP_GRAVITY_PORT_UP: case EL_SP_PORT_DOWN: - case EL_SP_GRAVITY_PORT_DOWN: case EL_SP_PORT_HORIZONTAL: case EL_SP_PORT_VERTICAL: case EL_SP_PORT_ANY: + case EL_SP_GRAVITY_PORT_LEFT: + case EL_SP_GRAVITY_PORT_RIGHT: + case EL_SP_GRAVITY_PORT_UP: + case EL_SP_GRAVITY_PORT_DOWN: if ((dx == -1 && element != EL_SP_PORT_LEFT && element != EL_SP_GRAVITY_PORT_LEFT && @@ -6628,22 +6637,22 @@ void RaiseScoreElement(int element) case EL_EMERALD_YELLOW: case EL_EMERALD_RED: case EL_EMERALD_PURPLE: - RaiseScore(level.score[SC_EDELSTEIN]); + RaiseScore(level.score[SC_EMERALD]); break; case EL_DIAMOND: - RaiseScore(level.score[SC_DIAMANT]); + RaiseScore(level.score[SC_DIAMOND]); break; case EL_BUG: case EL_BD_BUTTERFLY: - RaiseScore(level.score[SC_KAEFER]); + RaiseScore(level.score[SC_BUG]); break; case EL_SPACESHIP: case EL_BD_FIREFLY: - RaiseScore(level.score[SC_FLIEGER]); + RaiseScore(level.score[SC_SPACESHIP]); break; case EL_YAMYAM: case EL_DARK_YAMYAM: - RaiseScore(level.score[SC_MAMPFER]); + RaiseScore(level.score[SC_YAMYAM]); break; case EL_ROBOT: RaiseScore(level.score[SC_ROBOT]); @@ -6652,16 +6661,16 @@ void RaiseScoreElement(int element) RaiseScore(level.score[SC_PACMAN]); break; case EL_NUT: - RaiseScore(level.score[SC_KOKOSNUSS]); + RaiseScore(level.score[SC_NUT]); break; case EL_DYNAMITE: - RaiseScore(level.score[SC_DYNAMIT]); + RaiseScore(level.score[SC_DYNAMITE]); break; case EL_KEY_1: case EL_KEY_2: case EL_KEY_3: case EL_KEY_4: - RaiseScore(level.score[SC_SCHLUESSEL]); + RaiseScore(level.score[SC_KEY]); break; default: break; diff --git a/src/game.h b/src/game.h index ffacbddd..edbddd4d 100644 --- a/src/game.h +++ b/src/game.h @@ -17,17 +17,17 @@ #include "main.h" /* score for elements (also used by editor.c) */ -#define SC_EDELSTEIN 0 -#define SC_DIAMANT 1 -#define SC_KAEFER 2 -#define SC_FLIEGER 3 -#define SC_MAMPFER 4 +#define SC_EMERALD 0 +#define SC_DIAMOND 1 +#define SC_BUG 2 +#define SC_SPACESHIP 3 +#define SC_YAMYAM 4 #define SC_ROBOT 5 #define SC_PACMAN 6 -#define SC_KOKOSNUSS 7 -#define SC_DYNAMIT 8 -#define SC_SCHLUESSEL 9 -#define SC_ZEITBONUS 10 +#define SC_NUT 7 +#define SC_DYNAMITE 8 +#define SC_KEY 9 +#define SC_TIME_BONUS 10 void GetPlayerConfig(void); void DrawGameDoorValues(void); diff --git a/src/init.c b/src/init.c index 7af34951..508a50af 100644 --- a/src/init.c +++ b/src/init.c @@ -1101,16 +1101,12 @@ void InitElementProperties() -1 }; - static int ep_schluessel[] = + static int ep_can_be_crumbled[] = { - EL_KEY_1, - EL_KEY_2, - EL_KEY_3, - EL_KEY_4, - EL_EM_KEY_1, - EL_EM_KEY_2, - EL_EM_KEY_3, - EL_EM_KEY_4, + EL_SAND, + EL_LANDMINE, + EL_TRAP, + EL_TRAP_ACTIVE, -1 }; @@ -1665,7 +1661,7 @@ void InitElementProperties() -1 }; - static int ep_mampf2[] = + static int ep_food_dark_yamyam[] = { EL_SAND, EL_BUG, @@ -1908,7 +1904,7 @@ void InitElementProperties() -1 }; - static int ep_mampf3[] = + static int ep_food_penguin[] = { EL_EMERALD, EL_BD_DIAMOND, @@ -1949,17 +1945,19 @@ void InitElementProperties() -1 }; - static int ep_has_content[] = + static int ep_walkable_over[] = { - EL_YAMYAM, - EL_AMOEBA_WET, - EL_AMOEBA_DRY, - EL_AMOEBA_FULL, - EL_BD_AMOEBA, + EL_EMPTY_SPACE, + EL_SP_EMPTY_SPACE, + /* !!! EL_GATE_[1-4], EL_GATE_[1-4]_GRAY !!! */ + /* !!! EL_EM_GATE_[1-4], EL_EM_GATE_[1-4]_GRAY !!! */ + EL_SOKOBAN_FIELD_EMPTY, + EL_EXIT_OPEN, + EL_SP_EXIT_OPEN, -1 }; - static int ep_eatable[] = + static int ep_diggable[] = { EL_SAND, EL_SP_BASE, @@ -1968,60 +1966,47 @@ void InitElementProperties() EL_TRAP, EL_INVISIBLE_SAND, EL_INVISIBLE_SAND_ACTIVE, +#if 0 + EL_LANDMINE, + EL_SP_BUGGY_BASE_ACTIVE, +#endif -1 }; - static int ep_sp_element[] = + static int ep_collectible[] = { - EL_SP_EMPTY, - EL_SP_ZONK, - EL_SP_BASE, - EL_SP_MURPHY, + EL_BD_DIAMOND, + EL_EMERALD, + EL_DIAMOND, + EL_EMERALD_YELLOW, + EL_EMERALD_RED, + EL_EMERALD_PURPLE, + EL_KEY_1, + EL_KEY_2, + EL_KEY_3, + EL_KEY_4, + EL_EM_KEY_1, + EL_EM_KEY_2, + EL_EM_KEY_3, + EL_EM_KEY_4, + EL_DYNAMITE, + EL_DYNABOMB_INCREASE_NUMBER, + EL_DYNABOMB_INCREASE_SIZE, + EL_DYNABOMB_INCREASE_POWER, EL_SP_INFOTRON, - EL_SP_CHIP_SINGLE, - EL_SP_HARDWARE_GRAY, - EL_SP_EXIT_CLOSED, - EL_SP_EXIT_OPEN, - EL_SP_DISK_ORANGE, - EL_SP_PORT_RIGHT, - EL_SP_PORT_DOWN, - EL_SP_PORT_LEFT, - EL_SP_PORT_UP, - EL_SP_GRAVITY_PORT_RIGHT, - EL_SP_GRAVITY_PORT_DOWN, - EL_SP_GRAVITY_PORT_LEFT, - EL_SP_GRAVITY_PORT_UP, - EL_SP_SNIKSNAK, - EL_SP_DISK_YELLOW, - EL_SP_TERMINAL, EL_SP_DISK_RED, - EL_SP_PORT_VERTICAL, - EL_SP_PORT_HORIZONTAL, - EL_SP_PORT_ANY, - EL_SP_ELECTRON, - EL_SP_BUGGY_BASE, - EL_SP_CHIP_LEFT, - EL_SP_CHIP_RIGHT, - EL_SP_HARDWARE_BASE_1, - EL_SP_HARDWARE_GREEN, - EL_SP_HARDWARE_BLUE, - EL_SP_HARDWARE_RED, - EL_SP_HARDWARE_YELLOW, - EL_SP_HARDWARE_BASE_2, - EL_SP_HARDWARE_BASE_3, - EL_SP_HARDWARE_BASE_4, - EL_SP_HARDWARE_BASE_5, - EL_SP_HARDWARE_BASE_6, - EL_SP_CHIP_TOP, - EL_SP_CHIP_BOTTOM, - /* additional elements that appeared in newer Supaplex levels */ - EL_INVISIBLE_WALL, - /* more than one murphy in a level results in an inactive clone */ - EL_SP_MURPHY_CLONE, + EL_PEARL, + EL_CRYSTAL, + EL_KEY_WHITE, + EL_SHIELD_NORMAL, + EL_SHIELD_DEADLY, + EL_EXTRA_TIME, + EL_ENVELOPE, + EL_SPEED_PILL, -1 }; - static int ep_quick_gate[] = + static int ep_walkable_through[] = { EL_EM_GATE_1, EL_EM_GATE_2, @@ -2035,13 +2020,13 @@ void InitElementProperties() EL_SP_PORT_RIGHT, EL_SP_PORT_UP, EL_SP_PORT_DOWN, + EL_SP_PORT_HORIZONTAL, + EL_SP_PORT_VERTICAL, + EL_SP_PORT_ANY, EL_SP_GRAVITY_PORT_LEFT, EL_SP_GRAVITY_PORT_RIGHT, EL_SP_GRAVITY_PORT_UP, EL_SP_GRAVITY_PORT_DOWN, - EL_SP_PORT_HORIZONTAL, - EL_SP_PORT_VERTICAL, - EL_SP_PORT_ANY, EL_SWITCHGATE_OPEN, EL_TIMEGATE_OPEN, -1 @@ -2136,7 +2121,7 @@ void InitElementProperties() -1 }; - static int ep_tube[] = + static int ep_walkable_under[] = { EL_TUBE_ANY, EL_TUBE_VERTICAL, @@ -2152,12 +2137,68 @@ void InitElementProperties() -1 }; - static int ep_can_be_crumbled[] = + static int ep_sp_element[] = + { + EL_SP_EMPTY, + EL_SP_ZONK, + EL_SP_BASE, + EL_SP_MURPHY, + EL_SP_INFOTRON, + EL_SP_CHIP_SINGLE, + EL_SP_HARDWARE_GRAY, + EL_SP_EXIT_CLOSED, + EL_SP_EXIT_OPEN, + EL_SP_DISK_ORANGE, + EL_SP_PORT_RIGHT, + EL_SP_PORT_DOWN, + EL_SP_PORT_LEFT, + EL_SP_PORT_UP, + EL_SP_GRAVITY_PORT_RIGHT, + EL_SP_GRAVITY_PORT_DOWN, + EL_SP_GRAVITY_PORT_LEFT, + EL_SP_GRAVITY_PORT_UP, + EL_SP_SNIKSNAK, + EL_SP_DISK_YELLOW, + EL_SP_TERMINAL, + EL_SP_DISK_RED, + EL_SP_PORT_VERTICAL, + EL_SP_PORT_HORIZONTAL, + EL_SP_PORT_ANY, + EL_SP_ELECTRON, + EL_SP_BUGGY_BASE, + EL_SP_CHIP_LEFT, + EL_SP_CHIP_RIGHT, + EL_SP_HARDWARE_BASE_1, + EL_SP_HARDWARE_GREEN, + EL_SP_HARDWARE_BLUE, + EL_SP_HARDWARE_RED, + EL_SP_HARDWARE_YELLOW, + EL_SP_HARDWARE_BASE_2, + EL_SP_HARDWARE_BASE_3, + EL_SP_HARDWARE_BASE_4, + EL_SP_HARDWARE_BASE_5, + EL_SP_HARDWARE_BASE_6, + EL_SP_CHIP_TOP, + EL_SP_CHIP_BOTTOM, + /* additional elements that appeared in newer Supaplex levels */ + EL_INVISIBLE_WALL, + /* more than one murphy in a level results in an inactive clone */ + EL_SP_MURPHY_CLONE, + -1 + }; + + static int ep_has_content[] = + { + EL_YAMYAM, + EL_AMOEBA_WET, + EL_AMOEBA_DRY, + EL_AMOEBA_FULL, + EL_BD_AMOEBA, + -1 + }; + + static int ep_solid_new[] = { - EL_SAND, - EL_LANDMINE, - EL_TRAP, - EL_TRAP_ACTIVE, -1 }; @@ -2169,7 +2210,7 @@ void InitElementProperties() { { ep_amoebalive, EP_AMOEBALIVE }, { ep_amoeboid, EP_AMOEBOID }, - { ep_schluessel, EP_SCHLUESSEL }, + { ep_can_be_crumbled, EP_CAN_BE_CRUMBLED }, { ep_pforte, EP_PFORTE }, { ep_solid, EP_SOLID }, { ep_indestructible, EP_INDESTRUCTIBLE }, @@ -2183,29 +2224,66 @@ void InitElementProperties() { ep_could_move, EP_COULD_MOVE }, { ep_dont_touch, EP_DONT_TOUCH }, { ep_dont_go_to, EP_DONT_GO_TO }, - { ep_mampf2, EP_MAMPF2 }, + { ep_food_dark_yamyam, EP_FOOD_DARK_YAMYAM }, { ep_bd_element, EP_BD_ELEMENT }, { ep_sb_element, EP_SB_ELEMENT }, { ep_gem, EP_GEM }, { ep_inactive, EP_INACTIVE }, { ep_explosive, EP_EXPLOSIVE }, - { ep_mampf3, EP_MAMPF3 }, + { ep_food_penguin, EP_FOOD_PENGUIN }, { ep_pushable, EP_PUSHABLE }, { ep_player, EP_PLAYER }, - { ep_has_content, EP_HAS_CONTENT }, - { ep_eatable, EP_EATABLE }, - { ep_sp_element, EP_SP_ELEMENT }, - { ep_quick_gate, EP_QUICK_GATE }, + { ep_walkable_over, EP_WALKABLE_OVER }, + { ep_diggable, EP_DIGGABLE }, + { ep_collectible, EP_COLLECTIBLE }, + { ep_walkable_through, EP_WALKABLE_THROUGH }, { ep_over_player, EP_OVER_PLAYER }, { ep_active_bomb, EP_ACTIVE_BOMB }, { ep_belt, EP_BELT }, { ep_belt_active, EP_BELT_ACTIVE }, { ep_belt_switch, EP_BELT_SWITCH }, - { ep_tube, EP_TUBE }, - { ep_can_be_crumbled, EP_CAN_BE_CRUMBLED }, + { ep_walkable_under, EP_WALKABLE_UNDER }, + { ep_sp_element, EP_SP_ELEMENT }, + { ep_has_content, EP_HAS_CONTENT }, + { ep_solid_new, EP_SOLID_NEW }, { NULL, -1 } }; +#if 0 + static int active_properties[] = + { + EP_AMOEBALIVE, + EP_AMOEBOID, + EP_PFORTE, + EP_SOLID, + EP_ENEMY, + EP_MAUER, + EP_CAN_FALL, + EP_CAN_SMASH, + EP_CAN_CHANGE, + EP_CAN_MOVE, + EP_COULD_MOVE, + EP_DONT_TOUCH, + EP_DONT_GO_TO, + EP_GEM, + EP_EXPLOSIVE, + EP_PUSHABLE, + EP_PLAYER, + EP_HAS_CONTENT, + EP_DIGGABLE, + EP_WALKABLE_THROUGH, + EP_OVER_PLAYER, + EP_ACTIVE_BOMB, + + EP_BELT, + EP_BELT_ACTIVE, + EP_BELT_SWITCH, + EP_WALKABLE_UNDER, + EP_EM_SLIPPERY_WALL, + EP_CAN_BE_CRUMBLED, + }; +#endif + /* always start with reliable default values (no properties) */ for (i=0; i= 0; j++) + for (j=0; (element_properties[i].elements)[j] != -1; j++) SET_PROPERTY((element_properties[i].elements)[j], element_properties[i].property, TRUE); /* set properties of character elements */ for (i=EL_CHAR_START; i<=EL_CHAR_END; i++) - { - SET_PROPERTY(i, EP_CHAR, TRUE); SET_PROPERTY(i, EP_INACTIVE, TRUE); + +#if 0 + /* determine inactive elements (used for engine main loop optimization) */ + for (i=0; i < MAX_NUM_ELEMENTS; i++) + { + boolean active = FALSE; + + for (j=0; i < NUM_ELEMENT_PROPERTIES; j++) + { + if (HAS_PROPERTY(i, j)) + active = TRUE; + } + +#if 0 + if (!active) + SET_PROPERTY(i, EP_INACTIVE, TRUE); +#endif + } +#endif + +#if 0 + for (i=0; i < MAX_NUM_ELEMENTS; i++) + { + boolean element_is_solid = TRUE; + + if (IS_DIGGABLE(i) || + IS_COLLECTIBLE(i) || + CAN_FALL(i) || + CAN_MOVE(i) || + IS_PUSHABLE(i)) + element_is_solid = FALSE; + + if (IS_INDESTRUCTIBLE(i)) + element_is_solid = TRUE; + + if (element_is_solid != HAS_PROPERTY(i, EP_SOLID)) + printf("::: '%s' should %s solid\n", element_info[i].token_name, + (HAS_PROPERTY(i, EP_SOLID) ? "NOT be" : "be")); } +#endif } static void InitGlobal() diff --git a/src/libgame/sound.c b/src/libgame/sound.c index 7ded74fb..02995212 100644 --- a/src/libgame/sound.c +++ b/src/libgame/sound.c @@ -299,7 +299,7 @@ void UnixCloseAudio(void) if (audio.device_fd) close(audio.device_fd); - if (IS_PARENT_PROCESS()) + if (IS_PARENT_PROCESS() && HAS_CHILD_PROCESS()) kill(audio.mixer_pid, SIGTERM); } diff --git a/src/libgame/system.h b/src/libgame/system.h index 930cc113..50b82f3a 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -234,9 +234,11 @@ #if defined(PLATFORM_UNIX) #define IS_PARENT_PROCESS() (audio.mixer_pid != getpid()) #define IS_CHILD_PROCESS() (audio.mixer_pid == getpid()) +#define HAS_CHILD_PROCESS() (audio.mixer_pid > 0) #else #define IS_PARENT_PROCESS() TRUE #define IS_CHILD_PROCESS() FALSE +#define HAS_CHILD_PROCESS() FALSE #endif /* type definitions */ diff --git a/src/main.h b/src/main.h index d92af3dc..6e46f348 100644 --- a/src/main.h +++ b/src/main.h @@ -63,7 +63,7 @@ /* property values */ #define EP_AMOEBALIVE 0 #define EP_AMOEBOID 1 -#define EP_SCHLUESSEL 2 +#define EP_CAN_BE_CRUMBLED 2 #define EP_PFORTE 3 #define EP_SOLID 4 #define EP_INDESTRUCTIBLE 5 @@ -77,38 +77,39 @@ #define EP_COULD_MOVE 13 #define EP_DONT_TOUCH 14 #define EP_DONT_GO_TO 15 -#define EP_MAMPF2 16 -#define EP_CHAR 17 +#define EP_FOOD_DARK_YAMYAM 16 +#define EP_EM_SLIPPERY_WALL 17 #define EP_BD_ELEMENT 18 #define EP_SB_ELEMENT 19 #define EP_GEM 20 #define EP_INACTIVE 21 #define EP_EXPLOSIVE 22 -#define EP_MAMPF3 23 +#define EP_FOOD_PENGUIN 23 #define EP_PUSHABLE 24 #define EP_PLAYER 25 -#define EP_HAS_CONTENT 26 -#define EP_EATABLE 27 -#define EP_SP_ELEMENT 28 -#define EP_QUICK_GATE 29 +#define EP_WALKABLE_OVER 26 +#define EP_DIGGABLE 27 +#define EP_COLLECTIBLE 28 +#define EP_WALKABLE_THROUGH 29 #define EP_OVER_PLAYER 30 #define EP_ACTIVE_BOMB 31 #define EP_BELT 32 #define EP_BELT_ACTIVE 33 #define EP_BELT_SWITCH 34 -#define EP_TUBE 35 -#define EP_EM_SLIPPERY_WALL 36 -#define EP_CAN_BE_CRUMBLED 37 +#define EP_WALKABLE_UNDER 35 +#define EP_SP_ELEMENT 36 +#define EP_HAS_CONTENT 37 +#define EP_SOLID_NEW 38 -#define NUM_ELEMENT_PROPERTIES 38 +#define NUM_ELEMENT_PROPERTIES 39 #define NUM_EP_BITFIELDS ((NUM_ELEMENT_PROPERTIES + 31) / 32) #define EP_BITFIELD_BASE 0 #define PROPERTY_BIT(p) (1 << ((p) % 32)) #define PROPERTY_VAR(e, p) (Properties[e][(p) / 32]) -#define PROPERTY_VALUE(e, p) (PROPERTY_VAR(e, p) & PROPERTY_BIT(p)) +#define HAS_PROPERTY(e, p) ((PROPERTY_VAR(e, p) & PROPERTY_BIT(p)) != 0) #define SET_PROPERTY(e, p, v) ((v) ? \ (PROPERTY_VAR(e,p) |= PROPERTY_BIT(p)) : \ (PROPERTY_VAR(e,p) &= ~PROPERTY_BIT(p))) @@ -116,7 +117,7 @@ /* property bit masks */ #define EP_BIT_AMOEBALIVE PROPERTY_BIT(EP_AMOEBALIVE) #define EP_BIT_AMOEBOID PROPERTY_BIT(EP_AMOEBOID) -#define EP_BIT_SCHLUESSEL PROPERTY_BIT(EP_SCHLUESSEL) +#define EP_BIT_CAN_BE_CRUMBLED PROPERTY_BIT(EP_CAN_BE_CRUMBLED) #define EP_BIT_PFORTE PROPERTY_BIT(EP_PFORTE) #define EP_BIT_SOLID PROPERTY_BIT(EP_SOLID) #define EP_BIT_INDESTRUCTIBLE PROPERTY_BIT(EP_INDESTRUCTIBLE) @@ -130,74 +131,75 @@ #define EP_BIT_COULD_MOVE PROPERTY_BIT(EP_COULD_MOVE) #define EP_BIT_DONT_TOUCH PROPERTY_BIT(EP_DONT_TOUCH) #define EP_BIT_DONT_GO_TO PROPERTY_BIT(EP_DONT_GO_TO) -#define EP_BIT_MAMPF2 PROPERTY_BIT(EP_MAMPF2) -#define EP_BIT_CHAR PROPERTY_BIT(EP_CHAR) +#define EP_BIT_FOOD_DARK_YAMYAM PROPERTY_BIT(EP_FOOD_DARK_YAMYAM) +#define EP_BIT_EM_SLIPPERY_WALL PROPERTY_BIT(EP_EM_SLIPPERY_WALL) #define EP_BIT_BD_ELEMENT PROPERTY_BIT(EP_BD_ELEMENT) #define EP_BIT_SB_ELEMENT PROPERTY_BIT(EP_SB_ELEMENT) #define EP_BIT_GEM PROPERTY_BIT(EP_GEM) #define EP_BIT_INACTIVE PROPERTY_BIT(EP_INACTIVE) #define EP_BIT_EXPLOSIVE PROPERTY_BIT(EP_EXPLOSIVE) -#define EP_BIT_MAMPF3 PROPERTY_BIT(EP_MAMPF3) +#define EP_BIT_FOOD_PENGUIN PROPERTY_BIT(EP_FOOD_PENGUIN) #define EP_BIT_PUSHABLE PROPERTY_BIT(EP_PUSHABLE) #define EP_BIT_PLAYER PROPERTY_BIT(EP_PLAYER) -#define EP_BIT_HAS_CONTENT PROPERTY_BIT(EP_HAS_CONTENT) -#define EP_BIT_EATABLE PROPERTY_BIT(EP_EATABLE) -#define EP_BIT_SP_ELEMENT PROPERTY_BIT(EP_SP_ELEMENT) -#define EP_BIT_QUICK_GATE PROPERTY_BIT(EP_QUICK_GATE) +#define EP_BIT_WALKABLE_OVER PROPERTY_BIT(EP_WALKABLE_OVER) +#define EP_BIT_DIGGABLE PROPERTY_BIT(EP_DIGGABLE) +#define EP_BIT_COLLECTIBLE PROPERTY_BIT(EP_COLLECTIBLE) +#define EP_BIT_WALKABLE_THROUGH PROPERTY_BIT(EP_WALKABLE_THROUGH) #define EP_BIT_OVER_PLAYER PROPERTY_BIT(EP_OVER_PLAYER) #define EP_BIT_ACTIVE_BOMB PROPERTY_BIT(EP_ACTIVE_BOMB) -/* values for 'Properties2' */ #define EP_BIT_BELT PROPERTY_BIT(EP_BELT) #define EP_BIT_BELT_ACTIVE PROPERTY_BIT(EP_BELT_ACTIVE) #define EP_BIT_BELT_SWITCH PROPERTY_BIT(EP_BELT_SWITCH) -#define EP_BIT_TUBE PROPERTY_BIT(EP_TUBE) -#define EP_BIT_EM_SLIPPERY_WALL PROPERTY_BIT(EP_EM_SLIPPERY_WALL) -#define EP_BIT_CAN_BE_CRUMBLED PROPERTY_BIT(EP_CAN_BE_CRUMBLED) +#define EP_BIT_WALKABLE_UNDER PROPERTY_BIT(EP_WALKABLE_UNDER) +#define EP_BIT_SP_ELEMENT PROPERTY_BIT(EP_SP_ELEMENT) +#define EP_BIT_HAS_CONTENT PROPERTY_BIT(EP_HAS_CONTENT) +#define EP_BIT_SOLID_NEW PROPERTY_BIT(EP_SOLID_NEW) #define EP_BITMASK_DEFAULT 0 /* property macros */ -#define IS_AMOEBALIVE(e) PROPERTY_VALUE(e, EP_AMOEBALIVE) -#define IS_AMOEBOID(e) PROPERTY_VALUE(e, EP_AMOEBOID) -#define IS_SCHLUESSEL(e) PROPERTY_VALUE(e, EP_SCHLUESSEL) -#define IS_PFORTE(e) PROPERTY_VALUE(e, EP_PFORTE) -#define IS_SOLID(e) PROPERTY_VALUE(e, EP_SOLID) -#define IS_INDESTRUCTIBLE(e) PROPERTY_VALUE(e, EP_INDESTRUCTIBLE) -#define IS_SLIPPERY(e) PROPERTY_VALUE(e, EP_SLIPPERY) -#define IS_ENEMY(e) PROPERTY_VALUE(e, EP_ENEMY) -#define IS_MAUER(e) PROPERTY_VALUE(e, EP_MAUER) -#define CAN_FALL(e) PROPERTY_VALUE(e, EP_CAN_FALL) -#define CAN_SMASH(e) PROPERTY_VALUE(e, EP_CAN_SMASH) -#define CAN_CHANGE(e) PROPERTY_VALUE(e, EP_CAN_CHANGE) -#define CAN_MOVE(e) PROPERTY_VALUE(e, EP_CAN_MOVE) -#define COULD_MOVE(e) PROPERTY_VALUE(e, EP_COULD_MOVE) -#define DONT_TOUCH(e) PROPERTY_VALUE(e, EP_DONT_TOUCH) -#define DONT_GO_TO(e) PROPERTY_VALUE(e, EP_DONT_GO_TO) -#define IS_MAMPF2(e) PROPERTY_VALUE(e, EP_MAMPF2) -#define IS_CHAR(e) PROPERTY_VALUE(e, EP_CHAR) -#define IS_BD_ELEMENT(e) PROPERTY_VALUE(e, EP_BD_ELEMENT) -#define IS_SB_ELEMENT(e) PROPERTY_VALUE(e, EP_SB_ELEMENT) -#define IS_GEM(e) PROPERTY_VALUE(e, EP_GEM) -#define IS_INACTIVE(e) PROPERTY_VALUE(e, EP_INACTIVE) -#define IS_EXPLOSIVE(e) PROPERTY_VALUE(e, EP_EXPLOSIVE) -#define IS_MAMPF3(e) PROPERTY_VALUE(e, EP_MAMPF3) -#define IS_PUSHABLE(e) PROPERTY_VALUE(e, EP_PUSHABLE) -#define ELEM_IS_PLAYER(e) PROPERTY_VALUE(e, EP_PLAYER) -#define HAS_CONTENT(e) PROPERTY_VALUE(e, EP_HAS_CONTENT) -#define IS_EATABLE(e) PROPERTY_VALUE(e, EP_EATABLE) -#define IS_SP_ELEMENT(e) PROPERTY_VALUE(e, EP_SP_ELEMENT) -#define IS_QUICK_GATE(e) PROPERTY_VALUE(e, EP_QUICK_GATE) -#define IS_OVER_PLAYER(e) PROPERTY_VALUE(e, EP_OVER_PLAYER) -#define IS_ACTIVE_BOMB(e) PROPERTY_VALUE(e, EP_ACTIVE_BOMB) - -#define IS_BELT(e) PROPERTY_VALUE(e, EP_BELT) -#define IS_BELT_ACTIVE(e) PROPERTY_VALUE(e, EP_BELT_ACTIVE) -#define IS_BELT_SWITCH(e) PROPERTY_VALUE(e, EP_BELT_SWITCH) -#define IS_TUBE(e) PROPERTY_VALUE(e, EP_TUBE) -#define IS_EM_SLIPPERY_WALL(e) PROPERTY_VALUE(e, EP_EM_SLIPPERY_WALL) -#define CAN_BE_CRUMBLED(e) PROPERTY_VALUE(e, EP_CAN_BE_CRUMBLED) +#define IS_AMOEBALIVE(e) HAS_PROPERTY(e, EP_AMOEBALIVE) +#define IS_AMOEBOID(e) HAS_PROPERTY(e, EP_AMOEBOID) +#define CAN_BE_CRUMBLED(e) HAS_PROPERTY(e, EP_CAN_BE_CRUMBLED) +#define IS_PFORTE(e) HAS_PROPERTY(e, EP_PFORTE) +#define IS_SOLID(e) HAS_PROPERTY(e, EP_SOLID) +#define IS_INDESTRUCTIBLE(e) HAS_PROPERTY(e, EP_INDESTRUCTIBLE) +#define IS_SLIPPERY(e) HAS_PROPERTY(e, EP_SLIPPERY) +#define IS_ENEMY(e) HAS_PROPERTY(e, EP_ENEMY) +#define IS_MAUER(e) HAS_PROPERTY(e, EP_MAUER) +#define CAN_FALL(e) HAS_PROPERTY(e, EP_CAN_FALL) +#define CAN_SMASH(e) HAS_PROPERTY(e, EP_CAN_SMASH) +#define CAN_CHANGE(e) HAS_PROPERTY(e, EP_CAN_CHANGE) +#define CAN_MOVE(e) HAS_PROPERTY(e, EP_CAN_MOVE) +#define COULD_MOVE(e) HAS_PROPERTY(e, EP_COULD_MOVE) +#define DONT_TOUCH(e) HAS_PROPERTY(e, EP_DONT_TOUCH) +#define DONT_GO_TO(e) HAS_PROPERTY(e, EP_DONT_GO_TO) +#define IS_FOOD_DARK_YAMYAM(e) HAS_PROPERTY(e, EP_FOOD_DARK_YAMYAM) +#define IS_EM_SLIPPERY_WALL(e) HAS_PROPERTY(e, EP_EM_SLIPPERY_WALL) +#define IS_BD_ELEMENT(e) HAS_PROPERTY(e, EP_BD_ELEMENT) +#define IS_SB_ELEMENT(e) HAS_PROPERTY(e, EP_SB_ELEMENT) +#define IS_GEM(e) HAS_PROPERTY(e, EP_GEM) +#define IS_INACTIVE(e) HAS_PROPERTY(e, EP_INACTIVE) +#define IS_EXPLOSIVE(e) HAS_PROPERTY(e, EP_EXPLOSIVE) +#define IS_FOOD_PENGUIN(e) HAS_PROPERTY(e, EP_FOOD_PENGUIN) +#define IS_PUSHABLE(e) HAS_PROPERTY(e, EP_PUSHABLE) +#define ELEM_IS_PLAYER(e) HAS_PROPERTY(e, EP_PLAYER) +#define IS_WALKABLE_OVER(e) HAS_PROPERTY(e, EP_WALKABLE_OVER) +#define IS_DIGGABLE(e) HAS_PROPERTY(e, EP_DIGGABLE) +#define IS_COLLECTIBLE(e) HAS_PROPERTY(e, EP_COLLECTIBLE) +#define IS_WALKABLE_THROUGH(e) HAS_PROPERTY(e, EP_WALKABLE_THROUGH) +#define IS_OVER_PLAYER(e) HAS_PROPERTY(e, EP_OVER_PLAYER) +#define IS_ACTIVE_BOMB(e) HAS_PROPERTY(e, EP_ACTIVE_BOMB) + +#define IS_BELT(e) HAS_PROPERTY(e, EP_BELT) +#define IS_BELT_ACTIVE(e) HAS_PROPERTY(e, EP_BELT_ACTIVE) +#define IS_BELT_SWITCH(e) HAS_PROPERTY(e, EP_BELT_SWITCH) +#define IS_WALKABLE_UNDER(e) HAS_PROPERTY(e, EP_WALKABLE_UNDER) +#define IS_SP_ELEMENT(e) HAS_PROPERTY(e, EP_SP_ELEMENT) +#define HAS_CONTENT(e) HAS_PROPERTY(e, EP_HAS_CONTENT) +#define IS_SOLID_NEW(e) HAS_PROPERTY(e, EP_SOLID_NEW) #define IS_CUSTOM_ELEMENT(e) ((e) >= EL_CUSTOM_START && \ (e) <= EL_CUSTOM_END) @@ -228,7 +230,8 @@ #define PLAYERINFO(x,y) (&stored_player[StorePlayer[x][y]-EL_PLAYER_1]) #define SHIELD_ON(p) ((p)->shield_normal_time_left > 0) -#define PROTECTED_FIELD(x,y) (IS_TUBE(Feld[x][y])) +#define PROTECTED_FIELD(x,y) (IS_WALKABLE_UNDER(Feld[x][y]) && \ + IS_INDESTRUCTIBLE(Feld[x][y])) #define PLAYER_PROTECTED(x,y) (SHIELD_ON(PLAYERINFO(x, y)) || \ PROTECTED_FIELD(x, y)) diff --git a/src/screens.c b/src/screens.c index e9bd5dda..06260aeb 100644 --- a/src/screens.c +++ b/src/screens.c @@ -491,116 +491,6 @@ void HandleMainMenu(int mx, int my, int dx, int dy, int button) static long helpscreen_state; static int helpscreen_step[MAX_HELPSCREEN_ELS]; static int helpscreen_frame[MAX_HELPSCREEN_ELS]; -#if 0 -static int OLD_helpscreen_action[] = -{ - GFX_SPIELER1_DOWN,4,2, - GFX_SPIELER1_UP,4,2, - GFX_SPIELER1_LEFT,4,2, - GFX_SPIELER1_RIGHT,4,2, - GFX_SPIELER1_PUSH_LEFT,4,2, - GFX_SPIELER1_PUSH_RIGHT,4,2, HA_NEXT, - GFX_ERDREICH,1,100, HA_NEXT, - GFX_LEERRAUM,1,100, HA_NEXT, - GFX_MORAST_LEER,1,100, HA_NEXT, - GFX_BETON,1,100, HA_NEXT, - GFX_MAUERWERK,1,100, HA_NEXT, - GFX_MAUER_L1, 3,4, GFX_MAUERWERK,1,20, GFX_LEERRAUM,1,10, - GFX_MAUER_R1, 3,4, GFX_MAUERWERK,1,20, GFX_LEERRAUM,1,10, - GFX_MAUER_UP, 3,4, GFX_MAUERWERK,1,20, GFX_LEERRAUM,1,10, - GFX_MAUER_DOWN,3,4, GFX_MAUERWERK,1,20, GFX_LEERRAUM,1,10, HA_NEXT, - GFX_UNSICHTBAR,1,100, HA_NEXT, - GFX_FELSBODEN,1,100, HA_NEXT, - GFX_CHAR_A,30,4, GFX_CHAR_AUSRUF,32,4, HA_NEXT, - GFX_EDELSTEIN,2,5, HA_NEXT, - GFX_DIAMANT,2,5, HA_NEXT, - GFX_EDELSTEIN_BD,2,5, HA_NEXT, - GFX_EDELSTEIN_GELB,2,5, GFX_EDELSTEIN_ROT,2,5, - GFX_EDELSTEIN_LILA,2,5, HA_NEXT, - GFX_FELSBROCKEN,4,5, HA_NEXT, - GFX_BOMBE,1,50, GFX_EXPLOSION,8,1, GFX_LEERRAUM,1,10, HA_NEXT, - GFX_KOKOSNUSS,1,50, GFX_CRACKINGNUT,3,1, GFX_EDELSTEIN,1,10, HA_NEXT, - GFX_ERZ_EDEL,1,50, GFX_EXPLOSION,8,1, GFX_EDELSTEIN,1,10, HA_NEXT, - GFX_ERZ_DIAM,1,50, GFX_EXPLOSION,8,1, GFX_DIAMANT,1,10, HA_NEXT, - GFX_ERZ_EDEL_BD,1,50, GFX_EXPLOSION,8,1,GFX_EDELSTEIN_BD,1,10,HA_NEXT, - GFX_ERZ_EDEL_GELB,1,50, GFX_EXPLOSION,8,1, - GFX_EDELSTEIN_GELB,1,10, GFX_ERZ_EDEL_ROT,1,50, - GFX_EXPLOSION,8,1, GFX_EDELSTEIN_ROT,1,10, - GFX_ERZ_EDEL_LILA,1,50, GFX_EXPLOSION,8,1, - GFX_EDELSTEIN_LILA,1,10, HA_NEXT, - GFX_GEBLUBBER,4,4, HA_NEXT, - GFX_SCHLUESSEL1,4,25, HA_NEXT, - GFX_PFORTE1,4,25, HA_NEXT, - GFX_PFORTE1X,4,25, HA_NEXT, - GFX_DYNAMIT_AUS,1,100, HA_NEXT, - GFX_DYNAMIT,7,6, GFX_EXPLOSION,8,1, GFX_LEERRAUM,1,10, HA_NEXT, - GFX_DYNABOMB+0,4,3, GFX_DYNABOMB+3,1,3, GFX_DYNABOMB+2,1,3, - GFX_DYNABOMB+1,1,3, GFX_DYNABOMB+0,1,3, GFX_EXPLOSION,8,1, - GFX_LEERRAUM,1,10, HA_NEXT, - GFX_DYNABOMB_NR,1,100, HA_NEXT, - GFX_DYNABOMB_SZ,1,100, HA_NEXT, - GFX_FLIEGER+4,1,3, GFX_FLIEGER+0,1,3, GFX_FLIEGER+4,1,3, - GFX_FLIEGER+5,1,3, GFX_FLIEGER+1,1,3, GFX_FLIEGER+5,1,3, - GFX_FLIEGER+6,1,3, GFX_FLIEGER+2,1,3, GFX_FLIEGER+6,1,3, - GFX_FLIEGER+7,1,3, GFX_FLIEGER+3,1,3, GFX_FLIEGER+7,1,3, HA_NEXT, - GFX_KAEFER+4,1,1, GFX_KAEFER+0,1,1, GFX_KAEFER+4,1,1, - GFX_KAEFER+5,1,1, GFX_KAEFER+1,1,1, GFX_KAEFER+5,1,1, - GFX_KAEFER+6,1,1, GFX_KAEFER+2,1,1, GFX_KAEFER+6,1,1, - GFX_KAEFER+7,1,1, GFX_KAEFER+3,1,1, GFX_KAEFER+7,1,1, HA_NEXT, - GFX_BUTTERFLY,2,2, HA_NEXT, - GFX_FIREFLY,2,2, HA_NEXT, - GFX_PACMAN+0,1,3, GFX_PACMAN+4,1,2, GFX_PACMAN+0,1,3, - GFX_PACMAN+1,1,3, GFX_PACMAN+5,1,2, GFX_PACMAN+1,1,3, - GFX_PACMAN+2,1,3, GFX_PACMAN+6,1,2, GFX_PACMAN+2,1,3, - GFX_PACMAN+3,1,3, GFX_PACMAN+7,1,2, GFX_PACMAN+3,1,3, HA_NEXT, - GFX_MAMPFER+0,4,1, GFX_MAMPFER+3,1,1, GFX_MAMPFER+2,1,1, - GFX_MAMPFER+1,1,1, GFX_MAMPFER+0,1,1, HA_NEXT, - GFX_MAMPFER2+0,4,1, GFX_MAMPFER2+3,1,1, GFX_MAMPFER2+2,1,1, - GFX_MAMPFER2+1,1,1, GFX_MAMPFER2+0,1,1, HA_NEXT, - GFX_ROBOT+0,4,1, GFX_ROBOT+3,1,1, GFX_ROBOT+2,1,1, - GFX_ROBOT+1,1,1, GFX_ROBOT+0,1,1, HA_NEXT, - GFX_MOLE_DOWN,4,2, - GFX_MOLE_UP,4,2, - GFX_MOLE_LEFT,4,2, - GFX_MOLE_RIGHT,4,2, HA_NEXT, - GFX_PINGUIN_DOWN,4,2, - GFX_PINGUIN_UP,4,2, - GFX_PINGUIN_LEFT,4,2, - GFX_PINGUIN_RIGHT,4,2, HA_NEXT, - GFX_SCHWEIN_DOWN,4,2, - GFX_SCHWEIN_UP,4,2, - GFX_SCHWEIN_LEFT,4,2, - GFX_SCHWEIN_RIGHT,4,2, HA_NEXT, - GFX_DRACHE_DOWN,4,2, - GFX_DRACHE_UP,4,2, - GFX_DRACHE_LEFT,4,2, - GFX_DRACHE_RIGHT,4,2, HA_NEXT, - GFX_SONDE_START,8,1, HA_NEXT, - GFX_ABLENK,4,1, HA_NEXT, - GFX_BIRNE_AUS,1,25, GFX_BIRNE_EIN,1,25, HA_NEXT, - GFX_ZEIT_VOLL,1,25, GFX_ZEIT_LEER,1,25, HA_NEXT, - GFX_TROPFEN,1,25, GFX_AMOEBING,4,1, GFX_AMOEBE_LEBT,1,10, HA_NEXT, - GFX_AMOEBE_TOT+2,2,50, GFX_AMOEBE_TOT,2,50, HA_NEXT, - GFX_AMOEBE_LEBT,4,40, HA_NEXT, - GFX_AMOEBE_LEBT,1,10, GFX_AMOEBING,4,2, HA_NEXT, - GFX_AMOEBE_LEBT,1,25, GFX_AMOEBE_TOT,1,25, GFX_EXPLOSION,8,1, - GFX_DIAMANT,1,10, HA_NEXT, - GFX_LIFE,1,100, HA_NEXT, - GFX_LIFE_ASYNC,1,100, HA_NEXT, - GFX_MAGIC_WALL_OFF,4,2, HA_NEXT, - GFX_MAGIC_WALL_BD_OFF,4,2, HA_NEXT, - GFX_AUSGANG_ZU,1,100, GFX_AUSGANG_ACT,4,2, - GFX_AUSGANG_AUF+0,4,2, GFX_AUSGANG_AUF+3,1,2, - GFX_AUSGANG_AUF+2,1,2, GFX_AUSGANG_AUF+1,1,2, HA_NEXT, - GFX_AUSGANG_AUF+0,4,2, GFX_AUSGANG_AUF+3,1,2, - GFX_AUSGANG_AUF+2,1,2, GFX_AUSGANG_AUF+1,1,2, HA_NEXT, - GFX_SOKOBAN_OBJEKT,1,100, HA_NEXT, - GFX_SOKOBAN_FELD_LEER,1,100, HA_NEXT, - GFX_SOKOBAN_FELD_VOLL,1,100, HA_NEXT, - GFX_SPEED_PILL,1,100, HA_NEXT, - HA_END -}; -#endif static int helpscreen_action[] = {