From: Holger Schemel Date: Sat, 29 Jan 2005 00:37:37 +0000 (+0100) Subject: rnd-20050129-1-src X-Git-Tag: 3.1.1^2~27 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=fa8a648dfc55b04e778c09b841b194099e1e5dfa;p=rocksndiamonds.git rnd-20050129-1-src --- diff --git a/src/conf_e2g.c b/src/conf_e2g.c index c9d7769d..e98182ce 100644 --- a/src/conf_e2g.c +++ b/src/conf_e2g.c @@ -2610,52 +2610,52 @@ element_to_graphic[] = IMG_TRIGGER_PLAYER }, { - EL_EM_KEY_5, -1, -1, FALSE, - IMG_EM_KEY_5 + EL_EMC_KEY_5, -1, -1, FALSE, + IMG_EMC_KEY_5 }, { - EL_EM_KEY_6, -1, -1, FALSE, - IMG_EM_KEY_6 + EL_EMC_KEY_6, -1, -1, FALSE, + IMG_EMC_KEY_6 }, { - EL_EM_KEY_7, -1, -1, FALSE, - IMG_EM_KEY_7 + EL_EMC_KEY_7, -1, -1, FALSE, + IMG_EMC_KEY_7 }, { - EL_EM_KEY_8, -1, -1, FALSE, - IMG_EM_KEY_8 + EL_EMC_KEY_8, -1, -1, FALSE, + IMG_EMC_KEY_8 }, { - EL_EM_GATE_5, -1, -1, FALSE, - IMG_EM_GATE_5 + EL_EMC_GATE_5, -1, -1, FALSE, + IMG_EMC_GATE_5 }, { - EL_EM_GATE_5_GRAY, -1, -1, FALSE, - IMG_EM_GATE_5_GRAY + EL_EMC_GATE_5_GRAY, -1, -1, FALSE, + IMG_EMC_GATE_5_GRAY }, { - EL_EM_GATE_6, -1, -1, FALSE, - IMG_EM_GATE_6 + EL_EMC_GATE_6, -1, -1, FALSE, + IMG_EMC_GATE_6 }, { - EL_EM_GATE_6_GRAY, -1, -1, FALSE, - IMG_EM_GATE_6_GRAY + EL_EMC_GATE_6_GRAY, -1, -1, FALSE, + IMG_EMC_GATE_6_GRAY }, { - EL_EM_GATE_7, -1, -1, FALSE, - IMG_EM_GATE_7 + EL_EMC_GATE_7, -1, -1, FALSE, + IMG_EMC_GATE_7 }, { - EL_EM_GATE_7_GRAY, -1, -1, FALSE, - IMG_EM_GATE_7_GRAY + EL_EMC_GATE_7_GRAY, -1, -1, FALSE, + IMG_EMC_GATE_7_GRAY }, { - EL_EM_GATE_8, -1, -1, FALSE, - IMG_EM_GATE_8 + EL_EMC_GATE_8, -1, -1, FALSE, + IMG_EMC_GATE_8 }, { - EL_EM_GATE_8_GRAY, -1, -1, FALSE, - IMG_EM_GATE_8_GRAY + EL_EMC_GATE_8_GRAY, -1, -1, FALSE, + IMG_EMC_GATE_8_GRAY }, { EL_EMC_ANDROID, -1, -1, FALSE, diff --git a/src/conf_esg.c b/src/conf_esg.c index 112de881..7ddf0510 100644 --- a/src/conf_esg.c +++ b/src/conf_esg.c @@ -312,20 +312,20 @@ element_to_special_graphic[] = IMG_INVISIBLE_STEELWALL_VERTICAL_EDITOR }, { - EL_EM_GATE_5_GRAY, GFX_SPECIAL_ARG_EDITOR, - IMG_EM_GATE_5_GRAY_EDITOR + EL_EMC_GATE_5_GRAY, GFX_SPECIAL_ARG_EDITOR, + IMG_EMC_GATE_5_GRAY_EDITOR }, { - EL_EM_GATE_6_GRAY, GFX_SPECIAL_ARG_EDITOR, - IMG_EM_GATE_6_GRAY_EDITOR + EL_EMC_GATE_6_GRAY, GFX_SPECIAL_ARG_EDITOR, + IMG_EMC_GATE_6_GRAY_EDITOR }, { - EL_EM_GATE_7_GRAY, GFX_SPECIAL_ARG_EDITOR, - IMG_EM_GATE_7_GRAY_EDITOR + EL_EMC_GATE_7_GRAY, GFX_SPECIAL_ARG_EDITOR, + IMG_EMC_GATE_7_GRAY_EDITOR }, { - EL_EM_GATE_8_GRAY, GFX_SPECIAL_ARG_EDITOR, - IMG_EM_GATE_8_GRAY_EDITOR + EL_EMC_GATE_8_GRAY, GFX_SPECIAL_ARG_EDITOR, + IMG_EMC_GATE_8_GRAY_EDITOR }, { EL_EMC_DRIPPER, GFX_SPECIAL_ARG_EDITOR, diff --git a/src/conf_gfx.c b/src/conf_gfx.c index f02df8f7..244b2940 100644 --- a/src/conf_gfx.c +++ b/src/conf_gfx.c @@ -3283,71 +3283,71 @@ struct ConfigInfo image_config[] = { "trigger_player.ypos", "13" }, { "trigger_player.frames", "1" }, - { "em_key_5", "RocksEMC.pcx" }, - { "em_key_5.xpos", "0" }, - { "em_key_5.ypos", "5" }, - { "em_key_5.frames", "1" }, - { "em_key_6", "RocksEMC.pcx" }, - { "em_key_6.xpos", "1" }, - { "em_key_6.ypos", "5" }, - { "em_key_6.frames", "1" }, - { "em_key_7", "RocksEMC.pcx" }, - { "em_key_7.xpos", "2" }, - { "em_key_7.ypos", "5" }, - { "em_key_7.frames", "1" }, - { "em_key_8", "RocksEMC.pcx" }, - { "em_key_8.xpos", "3" }, - { "em_key_8.ypos", "5" }, - { "em_key_8.frames", "1" }, - - { "em_gate_5", "RocksEMC.pcx" }, - { "em_gate_5.xpos", "0" }, - { "em_gate_5.ypos", "6" }, - { "em_gate_5.frames", "1" }, - { "em_gate_5_gray", "RocksEMC.pcx" }, - { "em_gate_5_gray.xpos", "4" }, - { "em_gate_5_gray.ypos", "7" }, - { "em_gate_5_gray.frames", "1" }, - { "em_gate_5_gray.EDITOR", "RocksEMC.pcx" }, - { "em_gate_5_gray.EDITOR.xpos", "0" }, - { "em_gate_5_gray.EDITOR.ypos", "7" }, - { "em_gate_5_gray.EDITOR.frames", "1" }, - { "em_gate_6", "RocksEMC.pcx" }, - { "em_gate_6.xpos", "1" }, - { "em_gate_6.ypos", "6" }, - { "em_gate_6.frames", "1" }, - { "em_gate_6_gray", "RocksEMC.pcx" }, - { "em_gate_6_gray.xpos", "4" }, - { "em_gate_6_gray.ypos", "7" }, - { "em_gate_6_gray.frames", "1" }, - { "em_gate_6_gray.EDITOR", "RocksEMC.pcx" }, - { "em_gate_6_gray.EDITOR.xpos", "1" }, - { "em_gate_6_gray.EDITOR.ypos", "7" }, - { "em_gate_6_gray.EDITOR.frames", "1" }, - { "em_gate_7", "RocksEMC.pcx" }, - { "em_gate_7.xpos", "2" }, - { "em_gate_7.ypos", "6" }, - { "em_gate_7.frames", "1" }, - { "em_gate_7_gray", "RocksEMC.pcx" }, - { "em_gate_7_gray.xpos", "4" }, - { "em_gate_7_gray.ypos", "7" }, - { "em_gate_7_gray.frames", "1" }, - { "em_gate_7_gray.EDITOR", "RocksEMC.pcx" }, - { "em_gate_7_gray.EDITOR.xpos", "2" }, - { "em_gate_7_gray.EDITOR.ypos", "7" }, - { "em_gate_7_gray.EDITOR.frames", "1" }, - { "em_gate_8", "RocksEMC.pcx" }, - { "em_gate_8.xpos", "3" }, - { "em_gate_8.ypos", "6" }, - { "em_gate_8.frames", "1" }, - { "em_gate_8_gray", "RocksEMC.pcx" }, - { "em_gate_8_gray.xpos", "4" }, - { "em_gate_8_gray.ypos", "7" }, - { "em_gate_8_gray.frames", "1" }, - { "em_gate_8_gray.EDITOR", "RocksEMC.pcx" }, - { "em_gate_8_gray.EDITOR.xpos", "3" }, - { "em_gate_8_gray.EDITOR.ypos", "7" }, - { "em_gate_8_gray.EDITOR.frames", "1" }, + { "emc_key_5", "RocksEMC.pcx" }, + { "emc_key_5.xpos", "0" }, + { "emc_key_5.ypos", "5" }, + { "emc_key_5.frames", "1" }, + { "emc_key_6", "RocksEMC.pcx" }, + { "emc_key_6.xpos", "1" }, + { "emc_key_6.ypos", "5" }, + { "emc_key_6.frames", "1" }, + { "emc_key_7", "RocksEMC.pcx" }, + { "emc_key_7.xpos", "2" }, + { "emc_key_7.ypos", "5" }, + { "emc_key_7.frames", "1" }, + { "emc_key_8", "RocksEMC.pcx" }, + { "emc_key_8.xpos", "3" }, + { "emc_key_8.ypos", "5" }, + { "emc_key_8.frames", "1" }, + + { "emc_gate_5", "RocksEMC.pcx" }, + { "emc_gate_5.xpos", "0" }, + { "emc_gate_5.ypos", "6" }, + { "emc_gate_5.frames", "1" }, + { "emc_gate_5_gray", "RocksEMC.pcx" }, + { "emc_gate_5_gray.xpos", "4" }, + { "emc_gate_5_gray.ypos", "7" }, + { "emc_gate_5_gray.frames", "1" }, + { "emc_gate_5_gray.EDITOR", "RocksEMC.pcx" }, + { "emc_gate_5_gray.EDITOR.xpos", "0" }, + { "emc_gate_5_gray.EDITOR.ypos", "7" }, + { "emc_gate_5_gray.EDITOR.frames", "1" }, + { "emc_gate_6", "RocksEMC.pcx" }, + { "emc_gate_6.xpos", "1" }, + { "emc_gate_6.ypos", "6" }, + { "emc_gate_6.frames", "1" }, + { "emc_gate_6_gray", "RocksEMC.pcx" }, + { "emc_gate_6_gray.xpos", "4" }, + { "emc_gate_6_gray.ypos", "7" }, + { "emc_gate_6_gray.frames", "1" }, + { "emc_gate_6_gray.EDITOR", "RocksEMC.pcx" }, + { "emc_gate_6_gray.EDITOR.xpos", "1" }, + { "emc_gate_6_gray.EDITOR.ypos", "7" }, + { "emc_gate_6_gray.EDITOR.frames", "1" }, + { "emc_gate_7", "RocksEMC.pcx" }, + { "emc_gate_7.xpos", "2" }, + { "emc_gate_7.ypos", "6" }, + { "emc_gate_7.frames", "1" }, + { "emc_gate_7_gray", "RocksEMC.pcx" }, + { "emc_gate_7_gray.xpos", "4" }, + { "emc_gate_7_gray.ypos", "7" }, + { "emc_gate_7_gray.frames", "1" }, + { "emc_gate_7_gray.EDITOR", "RocksEMC.pcx" }, + { "emc_gate_7_gray.EDITOR.xpos", "2" }, + { "emc_gate_7_gray.EDITOR.ypos", "7" }, + { "emc_gate_7_gray.EDITOR.frames", "1" }, + { "emc_gate_8", "RocksEMC.pcx" }, + { "emc_gate_8.xpos", "3" }, + { "emc_gate_8.ypos", "6" }, + { "emc_gate_8.frames", "1" }, + { "emc_gate_8_gray", "RocksEMC.pcx" }, + { "emc_gate_8_gray.xpos", "4" }, + { "emc_gate_8_gray.ypos", "7" }, + { "emc_gate_8_gray.frames", "1" }, + { "emc_gate_8_gray.EDITOR", "RocksEMC.pcx" }, + { "emc_gate_8_gray.EDITOR.xpos", "3" }, + { "emc_gate_8_gray.EDITOR.ypos", "7" }, + { "emc_gate_8_gray.EDITOR.frames", "1" }, { "emc_android", "emc_object.pcx" }, { "emc_android.xpos", "7" }, diff --git a/src/conf_gfx.h b/src/conf_gfx.h index 5559ac7d..ca430f27 100644 --- a/src/conf_gfx.h +++ b/src/conf_gfx.h @@ -684,22 +684,22 @@ #define IMG_UNKNOWN 663 #define IMG_TRIGGER_ELEMENT 664 #define IMG_TRIGGER_PLAYER 665 -#define IMG_EM_KEY_5 666 -#define IMG_EM_KEY_6 667 -#define IMG_EM_KEY_7 668 -#define IMG_EM_KEY_8 669 -#define IMG_EM_GATE_5 670 -#define IMG_EM_GATE_5_GRAY 671 -#define IMG_EM_GATE_5_GRAY_EDITOR 672 -#define IMG_EM_GATE_6 673 -#define IMG_EM_GATE_6_GRAY 674 -#define IMG_EM_GATE_6_GRAY_EDITOR 675 -#define IMG_EM_GATE_7 676 -#define IMG_EM_GATE_7_GRAY 677 -#define IMG_EM_GATE_7_GRAY_EDITOR 678 -#define IMG_EM_GATE_8 679 -#define IMG_EM_GATE_8_GRAY 680 -#define IMG_EM_GATE_8_GRAY_EDITOR 681 +#define IMG_EMC_KEY_5 666 +#define IMG_EMC_KEY_6 667 +#define IMG_EMC_KEY_7 668 +#define IMG_EMC_KEY_8 669 +#define IMG_EMC_GATE_5 670 +#define IMG_EMC_GATE_5_GRAY 671 +#define IMG_EMC_GATE_5_GRAY_EDITOR 672 +#define IMG_EMC_GATE_6 673 +#define IMG_EMC_GATE_6_GRAY 674 +#define IMG_EMC_GATE_6_GRAY_EDITOR 675 +#define IMG_EMC_GATE_7 676 +#define IMG_EMC_GATE_7_GRAY 677 +#define IMG_EMC_GATE_7_GRAY_EDITOR 678 +#define IMG_EMC_GATE_8 679 +#define IMG_EMC_GATE_8_GRAY 680 +#define IMG_EMC_GATE_8_GRAY_EDITOR 681 #define IMG_EMC_ANDROID 682 #define IMG_EMC_GRASS 683 #define IMG_EMC_GRASS_CRUMBLED 684 diff --git a/src/conftime.h b/src/conftime.h index ab86a087..ef86812f 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2005-01-22 18:19]" +#define COMPILE_DATE_STRING "[2005-01-29 01:36]" diff --git a/src/editor.c b/src/editor.c index c77076b0..fc8cc9b7 100644 --- a/src/editor.c +++ b/src/editor.c @@ -2718,20 +2718,20 @@ static int editor_hl_emerald_mine_club[] = static int editor_el_emerald_mine_club[] = { - EL_EM_KEY_5, - EL_EM_KEY_6, - EL_EM_KEY_7, - EL_EM_KEY_8, + EL_EMC_KEY_5, + EL_EMC_KEY_6, + EL_EMC_KEY_7, + EL_EMC_KEY_8, - EL_EM_GATE_5, - EL_EM_GATE_6, - EL_EM_GATE_7, - EL_EM_GATE_8, + EL_EMC_GATE_5, + EL_EMC_GATE_6, + EL_EMC_GATE_7, + EL_EMC_GATE_8, - EL_EM_GATE_5_GRAY, - EL_EM_GATE_6_GRAY, - EL_EM_GATE_7_GRAY, - EL_EM_GATE_8_GRAY, + EL_EMC_GATE_5_GRAY, + EL_EMC_GATE_6_GRAY, + EL_EMC_GATE_7_GRAY, + EL_EMC_GATE_8_GRAY, EL_EMC_STEELWALL_1, EL_EMC_STEELWALL_2, @@ -7279,10 +7279,10 @@ static struct { EL_EM_KEY_3_FILE, &level.score[SC_KEY], TEXT_COLLECTING }, { EL_EM_KEY_4_FILE, &level.score[SC_KEY], TEXT_COLLECTING }, #endif - { EL_EM_KEY_5, &level.score[SC_KEY], TEXT_COLLECTING }, - { EL_EM_KEY_6, &level.score[SC_KEY], TEXT_COLLECTING }, - { EL_EM_KEY_7, &level.score[SC_KEY], TEXT_COLLECTING }, - { EL_EM_KEY_8, &level.score[SC_KEY], TEXT_COLLECTING }, + { EL_EMC_KEY_5, &level.score[SC_KEY], TEXT_COLLECTING }, + { EL_EMC_KEY_6, &level.score[SC_KEY], TEXT_COLLECTING }, + { EL_EMC_KEY_7, &level.score[SC_KEY], TEXT_COLLECTING }, + { EL_EMC_KEY_8, &level.score[SC_KEY], TEXT_COLLECTING }, { EL_AMOEBA_WET, &level.amoeba_speed, TEXT_AMOEBA_SPEED }, { EL_AMOEBA_DRY, &level.amoeba_speed, TEXT_AMOEBA_SPEED }, { EL_AMOEBA_FULL, &level.amoeba_speed, TEXT_AMOEBA_SPEED }, diff --git a/src/game.c b/src/game.c index 6a467021..b8bf5f05 100644 --- a/src/game.c +++ b/src/game.c @@ -1062,11 +1062,12 @@ inline void DrawGameValue_Dynamite(int value) DrawText(DX_DYNAMITE, DY_DYNAMITE, int2str(value, 3), FONT_TEXT_2); } -inline void DrawGameValue_Keys(int key[4]) +inline void DrawGameValue_Keys(int key[MAX_NUM_KEYS]) { int i; - for (i = 0; i < MAX_KEYS; i++) + /* currently only 4 of 8 possible keys are displayed */ + for (i = 0; i < STD_NUM_KEYS; i++) if (key[i]) DrawMiniGraphicExt(drawto, DX_KEYS + i * MINI_TILEX, DY_KEYS, el2edimg(EL_KEY_1 + i)); @@ -1112,10 +1113,10 @@ inline void DrawGameValue_Level(int value) void DrawAllGameValues(int emeralds, int dynamite, int score, int time, int key_bits) { - int key[4]; + int key[MAX_NUM_KEYS]; int i; - for (i = 0; i < MAX_KEYS; i++) + for (i = 0; i < MAX_NUM_KEYS; i++) key[i] = key_bits & (1 << i); DrawGameValue_Level(level_nr); @@ -1586,7 +1587,7 @@ void InitGame() player->lights_still_needed = 0; player->friends_still_needed = 0; - for (j = 0; j < MAX_KEYS; j++) + for (j = 0; j < MAX_NUM_KEYS; j++) player->key[j] = FALSE; player->dynabomb_count = 0; @@ -11368,14 +11369,14 @@ int DigField(struct PlayerInfo *player, return MF_NO_ACTION; /* player cannot walk here due to gravity */ #endif - if (IS_GATE(element)) + if (IS_RND_GATE(element)) { - if (!player->key[element - EL_GATE_1]) + if (!player->key[RND_GATE_NR(element)]) return MF_NO_ACTION; } - else if (IS_GATE_GRAY(element)) + else if (IS_RND_GATE_GRAY(element)) { - if (!player->key[element - EL_GATE_1_GRAY]) + if (!player->key[RND_GATE_GRAY_NR(element)]) return MF_NO_ACTION; } else if (element == EL_EXIT_OPEN || @@ -11438,12 +11439,12 @@ int DigField(struct PlayerInfo *player, if (IS_EM_GATE(element)) { - if (!player->key[element - EL_EM_GATE_1]) + if (!player->key[EM_GATE_NR(element)]) return MF_NO_ACTION; } else if (IS_EM_GATE_GRAY(element)) { - if (!player->key[element - EL_EM_GATE_1_GRAY]) + if (!player->key[EM_GATE_GRAY_NR(element)]) return MF_NO_ACTION; } else if (IS_SP_PORT(element)) @@ -11554,13 +11555,9 @@ int DigField(struct PlayerInfo *player, { player->dynabomb_xl = TRUE; } - else if ((element >= EL_KEY_1 && element <= EL_KEY_4) || - (element >= EL_EM_KEY_1 && element <= EL_EM_KEY_4)) + else if (IS_KEY(element)) { - int key_nr = (element >= EL_KEY_1 && element <= EL_KEY_4 ? - element - EL_KEY_1 : element - EL_EM_KEY_1); - - player->key[key_nr] = TRUE; + player->key[KEY_NR(element)] = TRUE; DrawGameValue_Keys(player->key); @@ -12654,6 +12651,14 @@ void RaiseScoreElement(int element) case EL_KEY_2: case EL_KEY_3: case EL_KEY_4: + case EL_EM_KEY_1: + case EL_EM_KEY_2: + case EL_EM_KEY_3: + case EL_EM_KEY_4: + case EL_EMC_KEY_5: + case EL_EMC_KEY_6: + case EL_EMC_KEY_7: + case EL_EMC_KEY_8: RaiseScore(level.score[SC_KEY]); break; default: diff --git a/src/init.c b/src/init.c index 094a225e..8e8694ef 100644 --- a/src/init.c +++ b/src/init.c @@ -2015,10 +2015,10 @@ void InitElementPropertiesStatic() EL_EM_KEY_2, EL_EM_KEY_3, EL_EM_KEY_4, - EL_EM_KEY_5, - EL_EM_KEY_6, - EL_EM_KEY_7, - EL_EM_KEY_8, + EL_EMC_KEY_5, + EL_EMC_KEY_6, + EL_EMC_KEY_7, + EL_EMC_KEY_8, EL_DYNAMITE, EL_DYNABOMB_INCREASE_NUMBER, EL_DYNABOMB_INCREASE_SIZE, @@ -2168,6 +2168,14 @@ void InitElementPropertiesStatic() EL_EM_GATE_2_GRAY, EL_EM_GATE_3_GRAY, EL_EM_GATE_4_GRAY, + EL_EMC_GATE_5, + EL_EMC_GATE_6, + EL_EMC_GATE_7, + EL_EMC_GATE_8, + EL_EMC_GATE_5_GRAY, + EL_EMC_GATE_6_GRAY, + EL_EMC_GATE_7_GRAY, + EL_EMC_GATE_8_GRAY, EL_SWITCHGATE_OPEN, EL_SWITCHGATE_OPENING, EL_SWITCHGATE_CLOSED, @@ -2445,18 +2453,18 @@ void InitElementPropertiesStatic() EL_EM_GATE_2, EL_EM_GATE_3, EL_EM_GATE_4, - EL_EM_GATE_5, - EL_EM_GATE_6, - EL_EM_GATE_7, - EL_EM_GATE_8, EL_EM_GATE_1_GRAY, EL_EM_GATE_2_GRAY, EL_EM_GATE_3_GRAY, EL_EM_GATE_4_GRAY, - EL_EM_GATE_5_GRAY, - EL_EM_GATE_6_GRAY, - EL_EM_GATE_7_GRAY, - EL_EM_GATE_8_GRAY, + EL_EMC_GATE_5, + EL_EMC_GATE_6, + EL_EMC_GATE_7, + EL_EMC_GATE_8, + EL_EMC_GATE_5_GRAY, + EL_EMC_GATE_6_GRAY, + EL_EMC_GATE_7_GRAY, + EL_EMC_GATE_8_GRAY, EL_SWITCHGATE_OPEN, EL_TIMEGATE_OPEN, -1 @@ -2546,18 +2554,18 @@ void InitElementPropertiesStatic() EL_EM_GATE_2, EL_EM_GATE_3, EL_EM_GATE_4, - EL_EM_GATE_5, - EL_EM_GATE_6, - EL_EM_GATE_7, - EL_EM_GATE_8, EL_EM_GATE_1_GRAY, EL_EM_GATE_2_GRAY, EL_EM_GATE_3_GRAY, EL_EM_GATE_4_GRAY, - EL_EM_GATE_5_GRAY, - EL_EM_GATE_6_GRAY, - EL_EM_GATE_7_GRAY, - EL_EM_GATE_8_GRAY, + EL_EMC_GATE_5, + EL_EMC_GATE_6, + EL_EMC_GATE_7, + EL_EMC_GATE_8, + EL_EMC_GATE_5_GRAY, + EL_EMC_GATE_6_GRAY, + EL_EMC_GATE_7_GRAY, + EL_EMC_GATE_8_GRAY, EL_SWITCHGATE_OPEN, EL_TIMEGATE_OPEN, @@ -3219,18 +3227,18 @@ void InitElementPropertiesStatic() EL_EM_GATE_2, EL_EM_GATE_3, EL_EM_GATE_4, - EL_EM_GATE_5, - EL_EM_GATE_6, - EL_EM_GATE_7, - EL_EM_GATE_8, EL_EM_GATE_1_GRAY, EL_EM_GATE_2_GRAY, EL_EM_GATE_3_GRAY, EL_EM_GATE_4_GRAY, - EL_EM_GATE_5_GRAY, - EL_EM_GATE_6_GRAY, - EL_EM_GATE_7_GRAY, - EL_EM_GATE_8_GRAY, + EL_EMC_GATE_5, + EL_EMC_GATE_6, + EL_EMC_GATE_7, + EL_EMC_GATE_8, + EL_EMC_GATE_5_GRAY, + EL_EMC_GATE_6_GRAY, + EL_EMC_GATE_7_GRAY, + EL_EMC_GATE_8_GRAY, -1 }; @@ -3312,10 +3320,10 @@ void InitElementPropertiesStatic() EL_EM_KEY_2, EL_EM_KEY_3, EL_EM_KEY_4, - EL_EM_KEY_5, - EL_EM_KEY_6, - EL_EM_KEY_7, - EL_EM_KEY_8, + EL_EMC_KEY_5, + EL_EMC_KEY_6, + EL_EMC_KEY_7, + EL_EMC_KEY_8, EL_GATE_1, EL_GATE_2, EL_GATE_3, @@ -3328,18 +3336,18 @@ void InitElementPropertiesStatic() EL_EM_GATE_2, EL_EM_GATE_3, EL_EM_GATE_4, - EL_EM_GATE_5, - EL_EM_GATE_6, - EL_EM_GATE_7, - EL_EM_GATE_8, EL_EM_GATE_1_GRAY, EL_EM_GATE_2_GRAY, EL_EM_GATE_3_GRAY, EL_EM_GATE_4_GRAY, - EL_EM_GATE_5_GRAY, - EL_EM_GATE_6_GRAY, - EL_EM_GATE_7_GRAY, - EL_EM_GATE_8_GRAY, + EL_EMC_GATE_5, + EL_EMC_GATE_6, + EL_EMC_GATE_7, + EL_EMC_GATE_8, + EL_EMC_GATE_5_GRAY, + EL_EMC_GATE_6_GRAY, + EL_EMC_GATE_7_GRAY, + EL_EMC_GATE_8_GRAY, EL_DYNAMITE, EL_INVISIBLE_STEELWALL, EL_INVISIBLE_WALL, diff --git a/src/main.c b/src/main.c index 7ab466ab..e382071e 100644 --- a/src/main.c +++ b/src/main.c @@ -3465,62 +3465,62 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = "stop moving balloon" }, { - "em_gate_5", + "emc_gate_5", "gate", "door 5 (EMC style)", }, { - "em_gate_6", + "emc_gate_6", "gate", "door 6 (EMC style)", }, { - "em_gate_7", + "emc_gate_7", "gate", "door 7 (EMC style)", }, { - "em_gate_8", + "emc_gate_8", "gate", "door 8 (EMC style)", }, { - "em_gate_5_gray", + "emc_gate_5_gray", "gate", "gray door (EMC style, key 5)", }, { - "em_gate_6_gray", + "emc_gate_6_gray", "gate", "gray door (EMC style, key 6)", }, { - "em_gate_7_gray", + "emc_gate_7_gray", "gate", "gray door (EMC style, key 7)", }, { - "em_gate_8_gray", + "emc_gate_8_gray", "gate", "gray door (EMC style, key 8)", }, { - "em_key_5", + "emc_key_5", "key", "key 5 (EMC style)", }, { - "em_key_6", + "emc_key_6", "key", "key 6 (EMC style)", }, { - "em_key_7", + "emc_key_7", "key", "key 7 (EMC style)", }, { - "em_key_8", + "emc_key_8", "key", "key 8 (EMC style)", }, diff --git a/src/main.h b/src/main.h index 259256c8..d6124be3 100644 --- a/src/main.h +++ b/src/main.h @@ -418,17 +418,53 @@ #define IS_ENVELOPE(e) ((e) >= EL_ENVELOPE_1 && \ (e) <= EL_ENVELOPE_4) -#define IS_GATE(e) ((e) >= EL_GATE_1 && \ +#define IS_RND_KEY(e) ((e) >= EL_KEY_1 && \ + (e) <= EL_KEY_4) +#define IS_EM_KEY(e) ((e) >= EL_EM_KEY_1 && \ + (e) <= EL_EM_KEY_4) +#define IS_EMC_KEY(e) ((e) >= EL_EMC_KEY_5 && \ + (e) <= EL_EMC_KEY_8) +#define IS_KEY(e) (IS_RND_KEY(e) || \ + IS_EM_KEY(e) || \ + IS_EMC_KEY(e)) +#define RND_KEY_NR(e) ((e) - EL_KEY_1) +#define EM_KEY_NR(e) ((e) - EL_EM_KEY_1) +#define EMC_KEY_NR(e) ((e) - EL_EMC_KEY_5 + 4) +#define KEY_NR(e) (IS_RND_KEY(e) ? RND_KEY_NR(e) : \ + IS_EM_KEY(e) ? EM_KEY_NR(e) : \ + IS_EMC_KEY(e) ? EMC_KEY_NR(e) : 0) + +#define IS_RND_GATE(e) ((e) >= EL_GATE_1 && \ (e) <= EL_GATE_4) - -#define IS_GATE_GRAY(e) ((e) >= EL_GATE_1_GRAY && \ - (e) <= EL_GATE_4_GRAY) - #define IS_EM_GATE(e) ((e) >= EL_EM_GATE_1 && \ (e) <= EL_EM_GATE_4) - +#define IS_EMC_GATE(e) ((e) >= EL_EMC_GATE_5 && \ + (e) <= EL_EMC_GATE_8) +#define IS_GATE(e) (IS_RND_GATE(e) || \ + IS_EM_GATE(e) || \ + IS_EMC_GATE(e)) +#define RND_GATE_NR(e) ((e) - EL_GATE_1) +#define EM_GATE_NR(e) ((e) - EL_EM_GATE_1) +#define EMC_GATE_NR(e) ((e) - EL_EMC_GATE_5 + 4) +#define GATE_NR(e) (IS_RND_GATE(e) ? RND_GATE_NR(e) : \ + IS_EM_GATE(e) ? EM_GATE_NR(e) : \ + IS_EMC_GATE(e) ? EMC_GATE_NR(e) : 0) + +#define IS_RND_GATE_GRAY(e) ((e) >= EL_GATE_1_GRAY && \ + (e) <= EL_GATE_4_GRAY) #define IS_EM_GATE_GRAY(e) ((e) >= EL_EM_GATE_1_GRAY && \ (e) <= EL_EM_GATE_4_GRAY) +#define IS_EMC_GATE_GRAY(e) ((e) >= EL_EMC_GATE_5_GRAY && \ + (e) <= EL_EMC_GATE_8_GRAY) +#define IS_GATE_GRAY(e) (IS_RND_GATE_GRAY(e) || \ + IS_EM_GATE_GRAY(e) || \ + IS_EMC_GATE_GRAY(e)) +#define RND_GATE_GRAY_NR(e) ((e) - EL_GATE_1_GRAY) +#define EM_GATE_GRAY_NR(e) ((e) - EL_EM_GATE_1_GRAY) +#define EMC_GATE_GRAY_NR(e) ((e) - EL_EMC_GATE_5_GRAY + 4) +#define GATE_GRAY_NR(e) (IS_RND_GATE_GRAY(e) ? RND_GATE_GRAY_NR(e) : \ + IS_EM_GATE_GRAY(e) ? EM_GATE_GRAY_NR(e) : \ + IS_EMC_GATE_GRAY(e) ? EMC_GATE_GRAY_NR(e) : 0) #define GFX_ELEMENT(e) (element_info[e].use_gfx_element ? \ element_info[e].gfx_element : e) @@ -521,7 +557,8 @@ #define MAX_SCORE_ENTRIES 100 #define MAX_NUM_AMOEBA 100 #define MAX_INVENTORY_SIZE 1000 -#define MAX_KEYS 4 +#define STD_NUM_KEYS 4 +#define MAX_NUM_KEYS 8 #define NUM_BELTS 4 #define NUM_BELT_PARTS 3 #define MIN_ENVELOPE_XSIZE 1 @@ -966,18 +1003,18 @@ /* the following EMC style elements are currently not implemented in R'n'D */ #define EL_BALLOON_SWITCH_NONE 667 -#define EL_EM_GATE_5 668 -#define EL_EM_GATE_6 669 -#define EL_EM_GATE_7 670 -#define EL_EM_GATE_8 671 -#define EL_EM_GATE_5_GRAY 672 -#define EL_EM_GATE_6_GRAY 673 -#define EL_EM_GATE_7_GRAY 674 -#define EL_EM_GATE_8_GRAY 675 -#define EL_EM_KEY_5 676 -#define EL_EM_KEY_6 677 -#define EL_EM_KEY_7 678 -#define EL_EM_KEY_8 679 +#define EL_EMC_GATE_5 668 +#define EL_EMC_GATE_6 669 +#define EL_EMC_GATE_7 670 +#define EL_EMC_GATE_8 671 +#define EL_EMC_GATE_5_GRAY 672 +#define EL_EMC_GATE_6_GRAY 673 +#define EL_EMC_GATE_7_GRAY 674 +#define EL_EMC_GATE_8_GRAY 675 +#define EL_EMC_KEY_5 676 +#define EL_EMC_KEY_6 677 +#define EL_EMC_KEY_7 678 +#define EL_EMC_KEY_8 679 #define EL_EMC_ANDROID 680 #define EL_EMC_GRASS 681 #define EL_EMC_MAGIC_BALL 682 @@ -1523,7 +1560,7 @@ struct PlayerInfo int sokobanfields_still_needed; int lights_still_needed; int friends_still_needed; - int key[4]; + int key[MAX_NUM_KEYS]; int dynabomb_count, dynabomb_size, dynabombs_left, dynabomb_xl; int shield_normal_time_left; int shield_deadly_time_left; diff --git a/src/tools.c b/src/tools.c index 05a1293b..3e346c88 100644 --- a/src/tools.c +++ b/src/tools.c @@ -3975,19 +3975,19 @@ em_object_mapping_list[] = }, { Ykey_5_eat, FALSE, FALSE, - EL_EM_KEY_5, ACTION_COLLECTING, -1 + EL_EMC_KEY_5, ACTION_COLLECTING, -1 }, { Ykey_6_eat, FALSE, FALSE, - EL_EM_KEY_6, ACTION_COLLECTING, -1 + EL_EMC_KEY_6, ACTION_COLLECTING, -1 }, { Ykey_7_eat, FALSE, FALSE, - EL_EM_KEY_7, ACTION_COLLECTING, -1 + EL_EMC_KEY_7, ACTION_COLLECTING, -1 }, { Ykey_8_eat, FALSE, FALSE, - EL_EM_KEY_8, ACTION_COLLECTING, -1 + EL_EMC_KEY_8, ACTION_COLLECTING, -1 }, { Ylenses_eat, FALSE, FALSE, @@ -4079,19 +4079,19 @@ em_object_mapping_list[] = }, { Xdoor_5, TRUE, FALSE, - EL_EM_GATE_5, -1, -1 + EL_EMC_GATE_5, -1, -1 }, { Xdoor_6, TRUE, FALSE, - EL_EM_GATE_6, -1, -1 + EL_EMC_GATE_6, -1, -1 }, { Xdoor_7, TRUE, FALSE, - EL_EM_GATE_7, -1, -1 + EL_EMC_GATE_7, -1, -1 }, { Xdoor_8, TRUE, FALSE, - EL_EM_GATE_8, -1, -1 + EL_EMC_GATE_8, -1, -1 }, { Xkey_1, TRUE, FALSE, @@ -4111,19 +4111,19 @@ em_object_mapping_list[] = }, { Xkey_5, TRUE, FALSE, - EL_EM_KEY_5, -1, -1 + EL_EMC_KEY_5, -1, -1 }, { Xkey_6, TRUE, FALSE, - EL_EM_KEY_6, -1, -1 + EL_EMC_KEY_6, -1, -1 }, { Xkey_7, TRUE, FALSE, - EL_EM_KEY_7, -1, -1 + EL_EMC_KEY_7, -1, -1 }, { Xkey_8, TRUE, FALSE, - EL_EM_KEY_8, -1, -1 + EL_EMC_KEY_8, -1, -1 }, { Xwind_n, TRUE, FALSE, @@ -4335,19 +4335,19 @@ em_object_mapping_list[] = }, { Xfake_door_5, TRUE, FALSE, - EL_EM_GATE_5_GRAY, -1, -1 + EL_EMC_GATE_5_GRAY, -1, -1 }, { Xfake_door_6, TRUE, FALSE, - EL_EM_GATE_6_GRAY, -1, -1 + EL_EMC_GATE_6_GRAY, -1, -1 }, { Xfake_door_7, TRUE, FALSE, - EL_EM_GATE_7_GRAY, -1, -1 + EL_EMC_GATE_7_GRAY, -1, -1 }, { Xfake_door_8, TRUE, FALSE, - EL_EM_GATE_8_GRAY, -1, -1 + EL_EMC_GATE_8_GRAY, -1, -1 }, { Xfake_acid_1, TRUE, FALSE,