From: Holger Schemel Date: Mon, 16 Jun 2003 23:00:40 +0000 (+0200) Subject: rnd-20030617-1-src X-Git-Tag: 3.0.0^2~47 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=3c83944be69b4f9e1c3dd0a615805e3ee4178324;p=rocksndiamonds.git rnd-20030617-1-src --- diff --git a/src/conftime.h b/src/conftime.h index 06b76cab..0a8f5d10 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2003-06-16 03:06]" +#define COMPILE_DATE_STRING "[2003-06-17 00:51]" diff --git a/src/game.c b/src/game.c index 99cbfbbd..770f34bc 100644 --- a/src/game.c +++ b/src/game.c @@ -302,8 +302,13 @@ static struct ChangingElementInfo changing_element_list[] = }; static struct ChangingElementInfo changing_element[MAX_NUM_ELEMENTS]; +static unsigned long trigger_events[MAX_NUM_ELEMENTS]; #define IS_AUTO_CHANGING(e) (changing_element[e].base_element != EL_UNDEFINED) +#define IS_JUST_CHANGING(x, y) (ChangeDelay[x][y] != 0) +#define IS_CHANGING(x, y) (IS_AUTO_CHANGING(Feld[x][y]) || \ + IS_JUST_CHANGING(x, y)) +#define TRIGGERS_BY_COLLECTING(e) (trigger_events[e] & CE_OTHER_COLLECTING) void GetPlayerConfig() @@ -684,6 +689,16 @@ static void InitGameEngine() changing_element[element].change_delay = (change->delay_fixed * change->delay_frames); } + + /* initialize trigger events information */ + for (i=0; igems_still_needed, 3), FONT_TEXT_2); PlaySoundLevelElementAction(x, y, element, ACTION_COLLECTING); + CheckTriggeredElementChange(element, CE_OTHER_COLLECTING); break; case EL_SPEED_PILL: RemoveField(x, y); player->move_delay_value = MOVE_DELAY_HIGH_SPEED; +#if 1 + PlaySoundLevelElementAction(x, y, element, ACTION_COLLECTING); +#else PlaySoundLevel(x, y, SND_SPEED_PILL_COLLECTING); +#endif + CheckTriggeredElementChange(element, CE_OTHER_COLLECTING); break; case EL_ENVELOPE: Feld[x][y] = EL_EMPTY; +#if 1 + PlaySoundLevelElementAction(x, y, element, ACTION_COLLECTING); +#else PlaySoundLevel(x, y, SND_ENVELOPE_COLLECTING); +#endif + CheckTriggeredElementChange(element, CE_OTHER_COLLECTING); break; case EL_EXTRA_TIME: @@ -6439,20 +6451,35 @@ int DigField(struct PlayerInfo *player, TimeLeft += 10; DrawText(DX_TIME, DY_TIME, int2str(TimeLeft, 3), FONT_TEXT_2); } +#if 1 + PlaySoundLevelElementAction(x, y, element, ACTION_COLLECTING); +#else PlaySoundStereo(SND_EXTRA_TIME_COLLECTING, SOUND_MIDDLE); +#endif + CheckTriggeredElementChange(element, CE_OTHER_COLLECTING); break; case EL_SHIELD_NORMAL: RemoveField(x, y); player->shield_normal_time_left += 10; +#if 1 + PlaySoundLevelElementAction(x, y, element, ACTION_COLLECTING); +#else PlaySoundLevel(x, y, SND_SHIELD_NORMAL_COLLECTING); +#endif + CheckTriggeredElementChange(element, CE_OTHER_COLLECTING); break; case EL_SHIELD_DEADLY: RemoveField(x, y); player->shield_normal_time_left += 10; player->shield_deadly_time_left += 10; +#if 1 + PlaySoundLevelElementAction(x, y, element, ACTION_COLLECTING); +#else PlaySoundLevel(x, y, SND_SHIELD_DEADLY_COLLECTING); +#endif + CheckTriggeredElementChange(element, CE_OTHER_COLLECTING); break; case EL_DYNAMITE: @@ -6464,6 +6491,7 @@ int DigField(struct PlayerInfo *player, DrawText(DX_DYNAMITE, DY_DYNAMITE, int2str(local_player->dynamite, 3), FONT_TEXT_2); PlaySoundLevelElementAction(x, y, element, ACTION_COLLECTING); + CheckTriggeredElementChange(element, CE_OTHER_COLLECTING); break; case EL_DYNABOMB_INCREASE_NUMBER: @@ -6471,21 +6499,36 @@ int DigField(struct PlayerInfo *player, player->dynabomb_count++; player->dynabombs_left++; RaiseScoreElement(EL_DYNAMITE); +#if 1 + PlaySoundLevelElementAction(x, y, element, ACTION_COLLECTING); +#else PlaySoundLevel(x, y, SND_DYNABOMB_INCREASE_NUMBER_COLLECTING); +#endif + CheckTriggeredElementChange(element, CE_OTHER_COLLECTING); break; case EL_DYNABOMB_INCREASE_SIZE: RemoveField(x, y); player->dynabomb_size++; RaiseScoreElement(EL_DYNAMITE); +#if 1 + PlaySoundLevelElementAction(x, y, element, ACTION_COLLECTING); +#else PlaySoundLevel(x, y, SND_DYNABOMB_INCREASE_SIZE_COLLECTING); +#endif + CheckTriggeredElementChange(element, CE_OTHER_COLLECTING); break; case EL_DYNABOMB_INCREASE_POWER: RemoveField(x, y); player->dynabomb_xl = TRUE; RaiseScoreElement(EL_DYNAMITE); +#if 1 + PlaySoundLevelElementAction(x, y, element, ACTION_COLLECTING); +#else PlaySoundLevel(x, y, SND_DYNABOMB_INCREASE_POWER_COLLECTING); +#endif + CheckTriggeredElementChange(element, CE_OTHER_COLLECTING); break; case EL_KEY_1: @@ -6503,7 +6546,12 @@ int DigField(struct PlayerInfo *player, graphic); DrawMiniGraphicExt(window, DX_KEYS + key_nr * MINI_TILEX, DY_KEYS, graphic); +#if 1 + PlaySoundLevelElementAction(x, y, element, ACTION_COLLECTING); +#else PlaySoundLevel(x, y, SND_CLASS_KEY_COLLECTING); +#endif + CheckTriggeredElementChange(element, CE_OTHER_COLLECTING); break; } @@ -6522,7 +6570,12 @@ int DigField(struct PlayerInfo *player, graphic); DrawMiniGraphicExt(window, DX_KEYS + key_nr * MINI_TILEX, DY_KEYS, graphic); +#if 1 + PlaySoundLevelElementAction(x, y, element, ACTION_COLLECTING); +#else PlaySoundLevel(x, y, SND_CLASS_KEY_COLLECTING); +#endif + CheckTriggeredElementChange(element, CE_OTHER_COLLECTING); break; } @@ -7019,6 +7072,8 @@ int DigField(struct PlayerInfo *player, #endif PlaySoundLevelElementAction(x, y, element, ACTION_COLLECTING); + CheckTriggeredElementChange(element, CE_OTHER_COLLECTING); + break; } else if (IS_PUSHABLE(element))