void car_chase_hit_effect_deff(void) { U8 car_chase_SoundCounter; car_chase_SoundCounter = random_scaled(car_chase_TotalNumOfSounds);//from kernal/random.c dmd_clean_page_high ();// dmd_clean_page_low ();// //NOTE: skid sound is played on ramp enter at ramps.c //these sounds are on ramp exit sound_start (ST_SPEECH, car_chase_SoundsArray[car_chase_SoundCounter], SL_4S, PRI_GAME_QUICK2); sound_start (ST_EFFECT, CAR_GEAR_CHANGE, SL_2S, PRI_GAME_QUICK2); if (IN_TEST) { if (++carchase_MessageCounter > 8) carchase_MessageCounter = 0; } else carchase_MessageCounter = random_scaled(9); switch (carchase_MessageCounter) { default: case 0: car_chase_animation_display_effect (IMG_CARCHASE_B_START, IMG_CARCHASE_B_END); car_chase_animation_display_effect (IMG_CARCHASE_A_START, IMG_CARCHASE_A_END); break; case 1: car_chase_animation_display_effect (IMG_CARCHASE_C_START, IMG_CARCHASE_C_END); car_chase_animation_display_effect (IMG_CARCHASE_B_START, IMG_CARCHASE_B_END); break; case 2: car_chase_animation_display_effect (IMG_CARCHASE_D_START, IMG_CARCHASE_D_END); car_chase_animation_display_effect (IMG_CARCHASE_C_START, IMG_CARCHASE_C_END); break; case 3: car_chase_animation_display_effect (IMG_CARCHASE_H_START, IMG_CARCHASE_H_END); car_chase_animation_display_effect (IMG_CARCHASE_D_START, IMG_CARCHASE_D_END); break; case 4: car_chase_animation_display_effect (IMG_CARCHASE_F1_START, IMG_CARCHASE_F1_END); car_chase_animation_display_effect (IMG_CARCHASE_E_START, IMG_CARCHASE_E_END); break; case 5: car_chase_animation_display_effect (IMG_CARCHASE_F2_START, IMG_CARCHASE_F2_END); car_chase_animation_display_effect (IMG_CARCHASE_H_START, IMG_CARCHASE_H_END); break; case 6: car_chase_animation_display_effect (IMG_CARCHASE_F2_START, IMG_CARCHASE_F2_END); car_chase_animation_display_effect (IMG_CARCHASE_F1_START, IMG_CARCHASE_F1_END); break; case 7: car_chase_animation_display_effect (IMG_CARCHASE_A_START, IMG_CARCHASE_A_END); car_chase_animation_display_effect (IMG_CARCHASE_J_START, IMG_CARCHASE_J_END); break; case 8: car_chase_animation_display_effect (IMG_CARCHASE_J_START, IMG_CARCHASE_J_END); car_chase_animation_display_effect (IMG_CARCHASE_E_START, IMG_CARCHASE_E_END); break; }//end of switch task_sleep (TIME_100MS); deff_exit (); }//end of function
void fortress_jackpot_sounds_task(void) { U8 fortress_MessageCounter; if (system_config.swear_sounds == YES) { //this doubles the chance that a swear would occur fortress_MessageCounter = random_scaled(11); if (fortress_MessageCounter >= 8) fortress_MessageCounter -= 3; } else if (system_config.extra_sounds == YES) { fortress_MessageCounter = random_scaled(5); } else { fortress_MessageCounter = random_scaled(3); } sound_start (ST_EFFECT, GUNSHOT_MUFFLED, SL_1S, PRI_GAME_QUICK5); task_sleep (TIME_200MS); sound_start (ST_EFFECT, GUNSHOT_MUFFLED, SL_1S, PRI_GAME_QUICK5); task_sleep (TIME_200MS); sound_start (ST_EFFECT, RICOCHET, SL_2S, PRI_GAME_QUICK5); task_sleep (TIME_500MS); switch (fortress_MessageCounter) { case 0: sound_start (ST_SPEECH, SPCH_AHHHGGG, SL_2S, PRI_GAME_QUICK5); break; case 1: sound_start (ST_SPEECH, SPCH_JOHN_SCREAM, SL_2S, PRI_GAME_QUICK5); break; case 2: sound_start (ST_SPEECH, SPCH_UHHN, SL_2S, PRI_GAME_QUICK5); break; case 3: sound_start (ST_SPEECH, SPCH_LOVE_MULTIPLE_JACKPOTS_GIRL, SL_2S, PRI_GAME_QUICK5); break; case 4: sound_start (ST_SPEECH, SPCH_FEEL_LIKE_A_PINBALL_SLY, SL_2S, PRI_GAME_QUICK5); break; case 5: sound_start (ST_SPEECH, SPCH_VLGR_SHT_SANDWICH_SLY, SL_2S, PRI_GAME_QUICK5); break; case 6: sound_start (ST_SPEECH, SPCH_VLGR_KISS_MY_AS2_SLY, SL_2S, PRI_GAME_QUICK5); break; case 7: sound_start (ST_SPEECH, SPCH_VLGR_HOLY_SHT_SIMON, SL_2S, PRI_GAME_QUICK5); break; }//end of switch sound_start (ST_EFFECT, GUNSHOT_MUFFLED, SL_1S, PRI_GAME_QUICK5); task_sleep (TIME_200MS); sound_start (ST_EFFECT, GUNSHOT_MUFFLED, SL_1S, PRI_GAME_QUICK5); task_sleep (TIME_200MS); sound_start (ST_EFFECT, GUNSHOT_MUFFLED, SL_1S, PRI_GAME_QUICK5); task_sleep (TIME_200MS); sound_start (ST_EFFECT, RICOCHET, SL_2S, PRI_GAME_QUICK5); task_sleep (TIME_200MS); if (fortress_jackpot_shots_made % 2 == 0) { switch (fortress_MessageCounter) { case 0: sound_start (ST_SPEECH, SPCH_DOUBLE_JACKPOT_WES, SL_2S, PRI_GAME_QUICK5); break; case 1: sound_start (ST_SPEECH, SPCH_DOUBLE_JACKPOT_SLY, SL_2S, PRI_GAME_QUICK5); break; case 2: sound_start (ST_SPEECH, SPCH_DOUBLE, SL_2S, PRI_GAME_QUICK5); break; }//end of switch }//end of if task_exit(); }//end of mode_effect_deff
void clock_millions_hit_deff (void) { U16 fno; U16 img_start = 0; U16 img_end = 0; dmd_alloc_pair_clean (); switch (random_scaled (3)) { case 0: img_start = IMG_FLASH_START; img_end = IMG_FLASH_END; break; case 1: img_start = IMG_FLASHCENTRE_START; img_end = IMG_FLASHCENTRE_END; break; case 2: img_start = IMG_FLASHLEFT_START; img_end = IMG_FLASHLEFT_END; break; } for (fno = img_start; fno < img_end; fno += 2) { U8 x = random_scaled (4); U8 y = random_scaled (4); dmd_map_overlay (); dmd_clean_page_low (); psprintf ("CLOCK HIT %d TIME", "CLOCK HIT %d TIMES", clock_mode_hits); font_render_string_center (&font_fixed6, 64 + x, 10 + y, sprintf_buffer); sprintf_score (clock_mode_score); font_render_string_center (&font_var5, 64, 21, sprintf_buffer); dmd_text_outline (); dmd_alloc_pair (); frame_draw (fno); dmd_overlay_outline (); dmd_show2 (); task_sleep (TIME_33MS); } /* Redraw it so the 'HITS' text is centred */ dmd_clean_page_low (); dmd_clean_page_high (); dmd_alloc_low (); psprintf ("CLOCK HIT %d TIME", "CLOCK HIT %d TIMES", clock_mode_hits); font_render_string_center (&font_fixed6, 64, 10, sprintf_buffer); sprintf_score (clock_mode_score); font_render_string_center (&font_var5, 64, 21, sprintf_buffer); dmd_show_low (); task_sleep_sec (2); deff_exit (); }
/**************************************************************************** * * display effects * ****************************************************************************/ void extra_ball_effect_deff(void) { U8 eb_rnd_sound; U16 fno; dmd_alloc_pair_clean ();// Clean both pages if (system_config.swear_sounds == YES) { //this doubles the chance that a swear would occur eb_rnd_sound = random_scaled(5); if (eb_rnd_sound == 4) eb_rnd_sound = 3; } else if (system_config.extra_sounds == YES) eb_rnd_sound = random_scaled(3); else eb_rnd_sound = random_scaled(2); sound_start (ST_EFFECT, EXTRA_BALL_SOUND, SL_2S, SP_NORMAL); for (fno = IMG_FREEZER1_START; fno <= IMG_FREEZER1_END; fno += 2) { dmd_alloc_pair (); frame_draw(fno); dmd_show2 (); task_sleep (TIME_66MS); }//end of for loop for (fno = IMG_FREEZER2_START; fno <= IMG_FREEZER2_END; fno += 2) { dmd_alloc_pair (); frame_draw(fno); dmd_show2 (); task_sleep (TIME_66MS); }//end of for loop switch (eb_rnd_sound) { case 0: sound_start (ST_SPEECH, SPCH_EXTRABALL_WES, SL_4S, 3); break; case 1: sound_start (ST_SPEECH, SPCH_EXTRABALL_SLY, SL_4S, PRI_GAME_QUICK3); break; case 2: sound_start (ST_SPEECH, SPCH_LOVE_THOSE_EXTRA_BALLS_GIRL, SL_4S, PRI_GAME_QUICK3); break; case 3: sound_start (ST_SPEECH, SPCH_VLGR_REALLY_LICKED_AS_SNDRA, SL_4S, PRI_GAME_QUICK3); break; }//end of switch for (fno = IMG_FREEZER3_START; fno <= IMG_FREEZER3_END; fno += 2) { dmd_map_overlay (); dmd_clean_page_low (); font_render_string_center (&font_halobold12, DMD_MIDDLE_X - 15, DMD_BIG_CY_Top, "EXTRA"); font_render_string_center (&font_halobold12, DMD_MIDDLE_X - 15, DMD_BIG_CY_Bot, "BALL"); dmd_text_outline (); dmd_alloc_pair (); frame_draw(fno); dmd_overlay_outline (); dmd_show2 (); task_sleep (TIME_66MS); }//end of for loop deff_exit (); }//end of mode_effect_deff
void huxley_hit_effect_deff(void) { if (DM_IN_DMD_TEST) { if (++huxley_MessageCounter > 3) huxley_MessageCounter = 0; } else huxley_MessageCounter = random_scaled(4); dmd_clean_page_high ();// dmd_clean_page_low ();// task_create_gid1 (GID_HUXLEY_HIT_SOUND, huxley_hit_sounds_task); switch (huxley_MessageCounter) { default: case 0: // huxley_animation_display_effect (IMG_HUXLEY_A_START, IMG_HUXLEY_A_END); huxley_frame_with_words_display_fipps_effect (IMG_HUXLEY_A_END, DMD_MIDDLE_X, DMD_BIG_CY_Bot, "1 MILLION"); break; case 1: // huxley_animation_display_effect (IMG_HUXLEY_B1_START, IMG_HUXLEY_B1_END); huxley_frame_with_words_display_fipps_effect (IMG_HUXLEY_B1_END, DMD_MIDDLE_X, DMD_BIG_CY_Bot, "HUXLEY"); break; case 2: // huxley_animation_display_effect (IMG_HUXLEY_B2_START, IMG_HUXLEY_B2_END); huxley_frame_with_words_display_fipps_effect (IMG_HUXLEY_B2_END, DMD_MIDDLE_X, DMD_BIG_CY_Bot, "1 MILLION"); break; case 3: // huxley_animation_display_effect (IMG_HUXLEY_D_START, IMG_HUXLEY_D_END); huxley_frame_with_words_display_fipps_effect (IMG_HUXLEY_D_END, DMD_MIDDLE_X, DMD_BIG_CY_Bot, "HUXLEY"); break; }//end of switch task_sleep (TIME_500MS); deff_exit (); }//end of mode_effect_deff
static void show_popups (void) { /* We can't get our names on the playfield, but at least we can get our * ugly mugs on the DMD :-) */ U8 p; /* 33% chance of happening */ if (random_scaled (3) != 1) return; /* Scan through scores and do popups if qualified */ for (p = 0; p < num_players; p++) { if (score_compare (score_table[SC_20M], scores[p]) == 1 && score_compare (scores[p], score_table[SC_10]) == 1) { show_bcd (); return; } } for (p = 0; p < num_players; p++) { if (score_compare (scores[p], score_table[SC_500M]) == 1) { show_sonny_jim (); return; } } //show_hydra(); }
void cryoprison_jackpot_effect_deff(void) { // if (++cryoprison_jackpot_MessageCounter > 3) cryoprison_jackpot_MessageCounter = 0; cryoprison_jackpot_MessageCounter = random_scaled(4); dmd_clean_page_high ();// dmd_clean_page_low ();// task_create_gid1 (GID_CRYOPRISON_JACKPOT_SOUND, cryoprison_jackpot_sounds_task); switch (cryoprison_jackpot_MessageCounter) { default: case 0: cryoprison_animation_display_effect (IMG_CAPSIMON_C_START, IMG_CAPSIMON_C_END); cryoprison_frame_with_words_display_steel_effect (IMG_CAPSIMON_C_END, DMD_MIDDLE_X - 20, DMD_BIG_CY_Bot, "JACKPOT"); break; case 1: cryoprison_animation_display_effect (IMG_CRYOPRISON_E2_START, IMG_CRYOPRISON_E2_END); cryoprison_frame_with_words_display_steel_effect (IMG_CRYOPRISON_E2_END, DMD_MIDDLE_X - 20, DMD_BIG_CY_Bot, "JACKPOT"); break; case 2: cryoprison_animation_display_effect (IMG_CRYOPRISON_E1_START, IMG_CRYOPRISON_E1_END); cryoprison_frame_with_words_display_steel_effect (IMG_CRYOPRISON_E1_END, DMD_MIDDLE_X - 20, DMD_BIG_CY_Bot, "JACKPOT"); break; case 3: cryoprison_animation_display_effect (IMG_DR_COCTEAU_B_START, IMG_DR_COCTEAU_B_END); cryoprison_frame_with_words_display_steel_effect (IMG_DR_COCTEAU_B_END, DMD_MIDDLE_X - 20, DMD_BIG_CY_Bot, "JACKPOT"); break; }//end of switch task_sleep_sec (1); deff_exit (); }//end of mode_effect_deff
void cryoprison_jackpot_sounds_task(void) { U8 cryoprison_MessageCounter; cryoprison_MessageCounter = random_scaled(3); if (++cryoprison_jackpot_shots_made % 2 == 0) { switch (cryoprison_MessageCounter) { case 0: sound_start (ST_SPEECH, SPCH_DOUBLE_JACKPOT_WES, SL_2S, PRI_GAME_QUICK5); break; case 1: sound_start (ST_SPEECH, SPCH_DOUBLE_JACKPOT_SLY, SL_2S, PRI_GAME_QUICK5); break; case 2: sound_start (ST_SPEECH, SPCH_DOUBLE, SL_2S, PRI_GAME_QUICK5); break; }//end of switch }//end of if else { switch (cryoprison_MessageCounter) { case 0: sound_start (ST_SPEECH, SPCH_AHHHGGG, SL_2S, PRI_GAME_QUICK5); break; case 1: sound_start (ST_SPEECH, SPCH_JOHN_SCREAM, SL_2S, PRI_GAME_QUICK5); break; case 2: sound_start (ST_SPEECH, SPCH_UHHN, SL_2S, PRI_GAME_QUICK5); break; }//end of switch }//end of else task_sleep (TIME_500MS); sound_start (ST_EFFECT, FREEZE5, SL_1S, PRI_GAME_QUICK5); task_sleep (TIME_200MS); sound_start (ST_EFFECT, FREEZE5, SL_1S, PRI_GAME_QUICK5); task_sleep (TIME_200MS); sound_start (ST_EFFECT, FREEZE5, SL_1S, PRI_GAME_QUICK5); task_sleep (TIME_200MS); sound_start (ST_EFFECT, FREEZE5, SL_1S, PRI_GAME_QUICK5); task_sleep (TIME_200MS); sound_start (ST_EFFECT, EJECT, SL_2S, PRI_GAME_QUICK5); task_sleep (TIME_500MS); task_exit(); }//end of mode_effect_deff
void huxley_hit_effect_deff(void) { U8 huxley_MessageCounter; huxley_MessageCounter = random_scaled(5); dmd_clean_page_high ();// dmd_clean_page_low ();// task_create_gid1 (GID_HUXLEY_HIT_SOUND, huxley_hit_sounds_task); switch (huxley_MessageCounter) { default: case 0: huxley_animation_display_effect (IMG_HUXLEY_A_START, IMG_HUXLEY_A_END); huxley_frame_with_words_display_fipps_effect (IMG_HUXLEY_A_END, DMD_MIDDLE_X - 30, DMD_BIG_CY_Bot, "1 MILLION"); break; case 1: huxley_animation_display_effect (IMG_HUXLEY_B1_START, IMG_HUXLEY_B1_END); huxley_frame_with_words_display_fipps_effect (IMG_HUXLEY_B1_END, DMD_MIDDLE_X - 30, DMD_BIG_CY_Bot, "HUXLEY"); break; case 2: huxley_animation_display_effect (IMG_HUXLEY_B2_START, IMG_HUXLEY_B2_END); huxley_frame_with_words_display_fipps_effect (IMG_HUXLEY_B2_END, DMD_MIDDLE_X - 30, DMD_BIG_CY_Bot, "1 MILLION"); break; case 3: huxley_animation_display_effect (IMG_HUXLEY_D_START, IMG_HUXLEY_D_END); huxley_frame_with_words_display_fipps_effect (IMG_HUXLEY_D_END, DMD_MIDDLE_X + 30, DMD_BIG_CY_Bot, "HUXLEY"); break; case 4: huxley_animation_display_effect (IMG_HUXLEY_E_START, IMG_HUXLEY_E_END); huxley_frame_with_words_display_fipps_effect (IMG_HUXLEY_E_END, DMD_MIDDLE_X - 30, DMD_BIG_CY_Bot, "HUXLEY"); break; }//end of switch task_sleep_sec (1); deff_exit (); }//end of mode_effect_deff
CALLSET_ENTRY (superjets, sw_jet) { if (in_game && !in_tilt && timed_mode_running_p(&superjets_mode) ) { ++superjets_mode_shots_made; leff_start (LEFF_FLASH_UR_GI); //score higher if mode done more than once if (get_dm_mode(SJETS_COMPLETED)) { score (SUPERJETS_HIT_SCORE2); score_add (superjets_mode_score, score_table[SUPERJETS_HIT_SCORE2]); } else { score (SUPERJETS_HIT_SCORE1); score_add (superjets_mode_score, score_table[SUPERJETS_HIT_SCORE1]); } if (superjets_mode_shots_made >= superjets_goal) superjets_goal_award(); else { U8 superjets_SoundCounter; superjets_SoundCounter = random_scaled(3);//from kernal/random.c - pick number from 0 to 2 if ( (superjets_SoundCounter) == 0 ) sound_start (ST_SPEECH, SPCH_DULCH, SL_2S, PRI_GAME_QUICK2); else if ( (superjets_SoundCounter) == 1 ) sound_start (ST_SPEECH, SPCH_WOOH, SL_2S, PRI_GAME_QUICK2); else sound_start (ST_SPEECH, SPCH_WOW, SL_2S, PRI_GAME_QUICK2); } }//end of if }//end of function
void wasteland_jackpot_effect_deff(void) { U16 fno; if (DM_IN_DMD_TEST) { if (++wasteland_MessageCounter > 4) wasteland_MessageCounter = 0; } else wasteland_MessageCounter = random_scaled(5); dmd_alloc_pair_clean (); task_create_gid1 (GID_WASTELAND_JACKPOT_SOUND, wasteland_jackpot_sounds_task); switch (wasteland_MessageCounter) { case 0: wasteland_animation_display_effect (IMG_WASTELAND_A2_START, IMG_WASTELAND_A2_END); wasteland_frame_with_words_display_steel_effect (IMG_WASTELAND_A2_END, DMD_MIDDLE_X, DMD_BIG_CY_Bot, "JACKPOT"); break; case 1: wasteland_animation_display_effect (IMG_WASTELAND_A3_START, IMG_WASTELAND_A3_END); wasteland_frame_with_words_display_steel_effect (IMG_WASTELAND_A3_END, DMD_MIDDLE_X, DMD_BIG_CY_Bot, "JACKPOT"); break; case 2: wasteland_animation_display_effect (IMG_WASTELAND_A1_START, IMG_WASTELAND_A1_END); wasteland_frame_with_words_display_steel_effect (IMG_WASTELAND_A1_END, DMD_MIDDLE_X, DMD_BIG_CY_Bot, "JACKPOT"); break; default: case 3: //4 wasteland_animation_display_effect (IMG_JACKPOT_START, IMG_JACKPOT_END); for (fno = IMG_JACKPOT_END; fno >= IMG_JACKPOT_START; fno -= 2) { dmd_alloc_pair (); frame_draw(fno); dmd_show2 (); task_sleep (TIME_100MS); } break; }//end of switch deff_exit (); }//end of mode_effect_deff
CALLSET_ENTRY (tnf, sw_left_button, sw_right_button) { if (deff_get_active () == DEFF_TNF) { bounded_increment (tnf_buttons_pressed, 255); score_add (tnf_score, score_table[SC_100K + tnf_level]); tnf_x = random_scaled(10); tnf_y = random_scaled(3); task_recreate_gid (GID_TNF_SOUND, tnf_sound_task); if (tnf_buttons_pressed > tnf_target) { score_add (tnf_score, score_table[SC_5M]); task_kill_gid (GID_TNF_TIMER); } } }
void prison_break_start_effect_deff(void) { U8 prison_break_MessageCounter; prison_break_MessageCounter = random_scaled(2); dmd_clean_page_high ();// dmd_clean_page_low ();// switch (prison_break_MessageCounter) { default: case 0: prison_break_animation_display_effect (IMG_CHIEF_EARLE2_START, IMG_CHIEF_EARLE2_END); prison_break_frame_bitfade_fast(IMG_JAIL_BREAK_START); prison_break_animation_display_effect (IMG_JAIL_BREAK_START, IMG_JAIL_BREAK_END); prison_break_frame_bitfade_fast(IMG_ASSOC_BOB_START); prison_break_animation_display_effect (IMG_ASSOC_BOB_START, IMG_ASSOC_BOB_END); frame_with_words_display_v5prc_effect (IMG_ASSOC_BOB_END, DMD_MIDDLE_X, DMD_BIG_CY_Bot, "BREAKOUT"); break; case 1: prison_break_animation_display_effect (IMG_ASSOC_BOB_START, IMG_ASSOC_BOB_END); prison_break_frame_bitfade_fast(IMG_PRISON_BREAKOUT_B_START); prison_break_animation_display_effect (IMG_PRISON_BREAKOUT_B_START, IMG_PRISON_BREAKOUT_B_MID); prison_break_animation_display_effect (IMG_PRISON_BREAKOUT_B_MID, IMG_PRISON_BREAKOUT_B_END); prison_break_frame_bitfade_fast(IMG_CHIEF_EARLE2_START); prison_break_animation_display_effect (IMG_CHIEF_EARLE2_START, IMG_CHIEF_EARLE2_END); frame_with_words_display_v5prc_effect (IMG_CHIEF_EARLE2_END, DMD_MIDDLE_X, DMD_BIG_CY_Top, "PRISON"); frame_with_words_display_v5prc_effect (IMG_CHIEF_EARLE2_END, DMD_MIDDLE_X, DMD_BIG_CY_Bot, "BREAK"); break; }//end of switch task_sleep_sec (2); deff_exit (); }//end of mode_effect_deff
void wasteland_jackpot_sounds_task(void) { U8 wasteland_MessageCounter; if (system_config.swear_sounds == YES) { //this doubles the chance that a swear would occur wasteland_MessageCounter = random_scaled(9); if (wasteland_MessageCounter >= 6) wasteland_MessageCounter -= 3; } else { wasteland_MessageCounter = random_scaled(3); } if (++wasteland_jackpot_shots_made % 2 == 0) { switch (wasteland_MessageCounter) { case 0: sound_start (ST_SPEECH, SPCH_DOUBLE_JACKPOT_WES, SL_4S, PRI_GAME_QUICK2); break; case 1: sound_start (ST_SPEECH, SPCH_DOUBLE_JACKPOT_SLY, SL_4S, PRI_GAME_QUICK2); break; case 2: sound_start (ST_SPEECH, SPCH_DOUBLE, SL_4S, PRI_GAME_QUICK2); break; case 3: sound_start (ST_SPEECH, SPCH_VLGR_AS_DONT_BITE_SIMON, SL_4S, PRI_GAME_QUICK2); break; case 4: sound_start (ST_SPEECH, SPCH_VLGR_PEOPLES_RIGHT_TO_BE_ASHL_SIMON, SL_4S, PRI_GAME_QUICK2); break; case 5: sound_start (ST_SPEECH, SPCH_VLGR_KISS_MY_AS3_SLY, SL_4S, PRI_GAME_QUICK2); break; }//end of switch }//end of if else { switch (wasteland_MessageCounter) { case 0: sound_start (ST_SPEECH, SPCH_AHHHGGG, SL_4S, PRI_GAME_QUICK2); break; case 1: sound_start (ST_SPEECH, SPCH_JOHN_SCREAM, SL_4S, PRI_GAME_QUICK2); break; case 2: sound_start (ST_SPEECH, SPCH_UHHN, SL_4S, PRI_GAME_QUICK2); break; case 3: sound_start (ST_SPEECH, SPCH_VLGR_AS_DONT_BITE_SIMON, SL_4S, PRI_GAME_QUICK2); break; case 4: sound_start (ST_SPEECH, SPCH_VLGR_PEOPLES_RIGHT_TO_BE_ASHL_SIMON, SL_4S, PRI_GAME_QUICK2); break; case 5: sound_start (ST_SPEECH, SPCH_VLGR_KISS_MY_AS3_SLY, SL_4S, PRI_GAME_QUICK2); break; }//end of switch }//end of else task_sleep (TIME_500MS); sound_start (ST_EFFECT, MACHINE14_SHORT, SL_1S, PRI_GAME_QUICK2); task_sleep (TIME_200MS); sound_start (ST_EFFECT, MACHINE14_SHORT, SL_1S, PRI_GAME_QUICK2); task_sleep (TIME_200MS); sound_start (ST_EFFECT, MACHINE14_SHORT, SL_1S, PRI_GAME_QUICK2); task_sleep (TIME_200MS); sound_start (ST_EFFECT, MACHINE14_SHORT, SL_1S, PRI_GAME_QUICK2); task_sleep (TIME_200MS); sound_start (ST_EFFECT, MACHINE14_LONG, SL_2S, PRI_GAME_QUICK2); task_sleep (TIME_500MS); task_exit(); }//end of function
/** Runs the match sequence if necessary */ void match_start (void) { U8 match_flag; U8 score; U8 best_score = 0; U8 best_match_value = 0; /* Nothing to do if match has been disabled */ if (system_config.match_feature == 0) return; /* Randomly decide whether or not to award a match. * First, calculate a random number from 0 to 99. */ match_flag = random_scaled (100); /* Now, see whether that value is less than N*P, where N is the total number of players and P is the probability of a single match. */ if (match_flag < num_players * system_config.match_feature) { /* We will match at least one player */ match_flag = 1; } else { /* We will not match any player */ match_flag = 0; } /* Find a value for the match that meets our goal. Start with a random two-digit value. */ for (match_value = 0x00; match_value <= 0x90; match_value += 0x10) { score = match_value_score (match_flag, match_value); if ((score > best_score) || ((score == best_score) && random () > 128)) { best_score = score; best_match_value = match_value; } } match_value = best_match_value; dbprintf ("Chose match value %02X\n", best_match_value); /* See how many matches we are about to award. */ match_count = match_value_score (2, match_value); /* Start the match effect, then wait until it finishes. */ deff_start_sync (DEFF_MATCH); /* Award any credits */ while (match_count > 0) { match_count--; match_award (); } }
void fortress_start(U8 num) { computer_light_temp_off(); is_fortress_running = TRUE; task_create_gid1 (GID_FORTRESS_START_NOISE, fortress_start_sounds); fortress_display_counter = 0; FORT_TOGGLE = 0; fortress_ballsave = system_config.mb_ballsave; mb_mode_start(&fortress_mode); score_add (fortress_score, score_table[FORTRESS_MB_SCORE]); score (FORTRESS_MB_SCORE); if (!in_tilt) deff_start (DEFF_FORTRESS_START_EFFECT); multiball_started();//reset all MB start criteria for next time diverter_stop();//defined in divhold2.ct //LIGHTS if (!in_tilt) { leff_start (LEFF_MB_START); lamp_tristate_flash(LM_FORTRESS_MULTIBALL); task_sleep (TIME_2S); lamp_tristate_on (LM_FORTRESS_MULTIBALL); lamp_tristate_off (LM_FREEZE_1); lamp_tristate_off (LM_FREEZE_2); lamp_tristate_off (LM_FREEZE_3); lamp_tristate_off (LM_FREEZE_4); } //SOUNDS if (!in_tilt) { U8 fortress_SoundCounter; fortress_SoundCounter = random_scaled(2);//from kernal/random.c - pick number from 0 to 2 if (fortress_SoundCounter == 0) sound_start (ST_SPEECH, SPCH_SOMETHING_RIGHT_PREV_LIFE, SL_4S, PRI_GAME_QUICK3); else sound_start (ST_SPEECH, SPCH_SEND_MANIAC, SL_4S, PRI_GAME_QUICK3); task_sleep (TIME_3S); } //serve balls if (!in_tilt) { if (num + live_balls >= 5) set_ball_count (5); else set_ball_count (num + live_balls); //task_sleep (TIME_3S); set_all_jackpots(); //all 6 lit //start the ball save timer task_create_gid1 (GID_FORTRESS_BALLSAVE_TIMER, fortress_ballsave_task); //recount the trough every 5 secs - this is to handle situations //where too many drains in rapid succession cause the game to lose //count of live balls - this only happens during MB callset_invoke (mb_trough_recount_timer_start); } //just in case - make sure this is running ball_search_monitor_start (); set_dm_mode2(FORTRESS_COMPLETED); //for BONUS }//end of function
static void init_player_hand (void) { /* Pick 5 random cards */ /* TODO Check for 5 Aces etc */ U8 i; for (i = 0; i < 5; i++) { vpoker_hand[i] = vpoker_cards[random_scaled(NUM_CARDS)]; } }
/**************************************************************************** * * randomize flag chosen * * we are using a very stupid and in-elegant * way of randomness - basically, we have a number * of predefined sets of flags and we randomly * pick one of those sets ****************************************************************************/ void choose_random_flag_set(void) { U8 random_chooser; random_chooser = random_scaled(5); switch (random_chooser) { case 0: flag_on (FLAG_IS_COMBO_SIDERAMP_ACTIVATED); flag_on (FLAG_IS_COMBO_LEFTRAMP_ACTIVATED); flag_off (FLAG_IS_COMBO_RIGHTRAMP_ACTIVATED); flag_off (FLAG_IS_COMBO_UNDER_ACTIVATED); flag_on (FLAG_IS_COMBO_CENTERRAMP_ACTIVATED); flag_off (FLAG_IS_COMBO_LEFTORB_ACTIVATED); flag_on (FLAG_IS_COMBO_RIGHTORB_ACTIVATED); break; case 1: flag_on (FLAG_IS_COMBO_SIDERAMP_ACTIVATED); flag_on (FLAG_IS_COMBO_LEFTRAMP_ACTIVATED); flag_off (FLAG_IS_COMBO_RIGHTRAMP_ACTIVATED); flag_off (FLAG_IS_COMBO_UNDER_ACTIVATED); flag_off (FLAG_IS_COMBO_CENTERRAMP_ACTIVATED); flag_on (FLAG_IS_COMBO_LEFTORB_ACTIVATED); flag_off (FLAG_IS_COMBO_RIGHTORB_ACTIVATED); break; case 2: flag_off (FLAG_IS_COMBO_SIDERAMP_ACTIVATED); flag_off (FLAG_IS_COMBO_LEFTRAMP_ACTIVATED); flag_on (FLAG_IS_COMBO_RIGHTRAMP_ACTIVATED); flag_on (FLAG_IS_COMBO_UNDER_ACTIVATED); flag_on (FLAG_IS_COMBO_CENTERRAMP_ACTIVATED); flag_off (FLAG_IS_COMBO_LEFTORB_ACTIVATED); flag_on (FLAG_IS_COMBO_RIGHTORB_ACTIVATED); break; case 3: flag_off (FLAG_IS_COMBO_SIDERAMP_ACTIVATED); flag_off (FLAG_IS_COMBO_LEFTRAMP_ACTIVATED); flag_on (FLAG_IS_COMBO_RIGHTRAMP_ACTIVATED); flag_on (FLAG_IS_COMBO_UNDER_ACTIVATED); flag_off (FLAG_IS_COMBO_CENTERRAMP_ACTIVATED); flag_on (FLAG_IS_COMBO_LEFTORB_ACTIVATED); flag_off (FLAG_IS_COMBO_RIGHTORB_ACTIVATED); break; case 4: flag_on (FLAG_IS_COMBO_SIDERAMP_ACTIVATED); flag_off (FLAG_IS_COMBO_LEFTRAMP_ACTIVATED); flag_on (FLAG_IS_COMBO_RIGHTRAMP_ACTIVATED); flag_off (FLAG_IS_COMBO_UNDER_ACTIVATED); flag_off (FLAG_IS_COMBO_CENTERRAMP_ACTIVATED); flag_off (FLAG_IS_COMBO_LEFTORB_ACTIVATED); flag_on (FLAG_IS_COMBO_RIGHTORB_ACTIVATED); break; }//end of switch //if 1 or less shot away from computer award then do not light underground shot if ( flag_test(FLAG_IS_COMBO_UNDER_ACTIVATED) && (flag_test(FLAG_IS_COMPUTER_ACTIVATED) || combo_goal == combo_counter + 1) ) flag_off (FLAG_IS_COMBO_UNDER_ACTIVATED); }//end of function
void wasteland_start(U8 num) { // kill_combos(); computer_light_temp_off(); task_create_gid1 (GID_WASTELAND_START_NOISE, wasteland_start_sounds); is_wasteland_running = TRUE; mb_mode_start(&wasteland_mode); score_add (wasteland_score, score_table[WASTELAND_MB_SCORE]); score (WASTELAND_MB_SCORE); wasteland_display_counter = 0; WL_TOGGLE = 0; wasteland_ballsave = TRUE; multiball_started();//reset all MB start criteria for next time deff_start (DEFF_WASTELAND_START_EFFECT); diverter_stop();//defined in divhold2.ct //LIGHTS leff_start (LEFF_MB_START); lamp_tristate_flash(LM_WASTELAND_MULTIBALL); task_sleep (TIME_2S); lamp_tristate_on (LM_WASTELAND_MULTIBALL); lamp_tristate_off (LM_FREEZE_1); lamp_tristate_off (LM_FREEZE_2); lamp_tristate_off (LM_FREEZE_3); lamp_tristate_off (LM_FREEZE_4); //SOUNDS U8 wasteland_SoundCounter; wasteland_SoundCounter = random_scaled(2);//from kernal/random.c - pick number from 0 to 2 if (wasteland_SoundCounter == 0) sound_start (ST_SPEECH, SPCH_IN_THIS_CENTURY, SL_4S, PRI_GAME_QUICK2); else sound_start (ST_SPEECH, SPCH_FEEL_GOOD_TOO, SL_4S, PRI_GAME_QUICK2); task_sleep (TIME_3S); wasteland_start_music = FALSE; //for to kill the music //serve balls if (num + live_balls >= 5) set_ball_count (5); else set_ball_count (num + live_balls); task_create_gid1 (GID_WASTELAND_BALL_SAVE, wasteland_ballsave_task); //task_sleep (TIME_3S); set_all_jackpots(); //all 6 lit //recount the trough every 5 secs - this is to handle situations //where too many drains in rapid succession cause the game to lose //count of live balls - this only happens during MB callset_invoke (mb_trough_recount_timer_start); //just in case - make sure this is running ball_search_monitor_start (); set_dm_mode2(WASTELAND_COMPLETED); //for BONUS }//end of function
void sslot_award (void) { sslot_award_index_stored = sslot_award_index; task_kill_gid (GID_SSLOT_AWARD_ROTATE); /* Don't allow awarding the eb if we can't do so */ if (!can_award_extra_ball ()) { /* Pick another until it's not an EB */ while (sslot_award_index_stored == 0) { sslot_award_index_stored = random_scaled(5); } } switch (sslot_award_index_stored) { case 0: sound_send (SND_GET_THE_EXTRA_BALL); light_easy_extra_ball (); break; case 1: sound_send (SND_THIS_IS_NO_ORDINARY_GUMBALL); gumball_enable_count++; break; case 2: sound_send (SND_ARE_YOU_READY_TO_BATTLE); mpf_enable_count++; break; case 3: sound_send (SND_MOST_UNUSUAL_CAMERA); cameras_lit++; break; case 4: sound_send (SND_TEN_MILLION_POINTS); score (SC_10M); if (!lamp_test (LM_PANEL_10M)) { lamp_on (LM_PANEL_10M); door_panels_started++; } break; case 5: sound_send (SND_SEE_WHAT_GREED); score (SC_5M); break; default: score (SC_5M); } deff_start (DEFF_SSLOT_AWARD); sound_send (SND_SLOT_PAYOUT); lamp_tristate_off (LM_SLOT_MACHINE); }
/**************************************************************************** * * DMD display and sound effects * ****************************************************************************/ void fortress_super_jackpot_deff (void) { switch (random_scaled(3)) { case 0: sound_start (ST_SPEECH, SPCH_AHHHGGG, SL_2S, PRI_GAME_QUICK5); break; case 1: sound_start (ST_SPEECH, SPCH_HURRY_UP, SL_2S, PRI_GAME_QUICK5); break; case 2: sound_start (ST_SPEECH, SPCH_CLOSE_ENOUGH, SL_2S, PRI_GAME_QUICK5); break; } dmd_alloc_low_clean (); fortress_animation_display_effect (IMG_SJACKPOT_START, IMG_SJACKPOT_END); speech_start (SPCH_SUPER_JACKPOT, SL_1S); task_sleep (TIME_500MS); deff_exit (); }//end of function
void eliminate_pitstop_award(void) { do { pitstop_award = random_scaled(PITSTOP_AWARD_ITEMS); #ifdef DEBUG_PITSTOP_AWARD dbprintf("random (2): %d\n", pitstop_award); #endif } while (selected_pitstop_awards[pitstop_award] == DISABLED_AWARD); #ifdef DEBUG_PITSTOP_AWARD dbprintf("eliminated award: %s (%d)\n", pitstop_award_options_titles[pitstop_award], pitstop_award); #endif selected_pitstop_awards[pitstop_award] = DISABLED_AWARD; }
static void challenge_pick_two_new_targets (void) { /* Store the old shots */ old_challenge_shot_1 = challenge_shot_1; old_challenge_shot_2 = challenge_shot_2; /* Pick 2 new ones */ challenge_shot_1 = random_scaled (NUM_CHALLENGE_SHOTS); challenge_shot_2 = random_scaled (NUM_CHALLENGE_SHOTS); /* Make sure we pick two brand new shots */ while (challenge_shot_1 == (old_challenge_shot_1 || old_challenge_shot_2)) challenge_shot_1 = random_scaled (NUM_CHALLENGE_SHOTS); /* Make sure we don't light the same shot twice */ while (challenge_shot_2 == (old_challenge_shot_2 || old_challenge_shot_1 || challenge_shot_1)) challenge_shot_2 = random_scaled (NUM_CHALLENGE_SHOTS); challenge_shot_1_active = TRUE; challenge_shot_2_active = TRUE; timed_game_extend (10); challenge_lamp_update (); }
/** * Randomly pulse all flashers for the given duration, with the given delay * in between each pulse. */ void flasher_randomize (task_ticks_t delay, U16 duration) { U8 id; duration *= TIME_1S; while (duration > 0) { do { id = random_scaled (SOL_COUNT); } while (!MACHINE_SOL_FLASHERP (id)); flasher_pulse (id); task_sleep (delay); duration -= delay; } }
/** The display effect that runs to show the match. * This is a default effect that could be overriden with something * more flashy. */ void match_deff (void) { U8 value; U8 n; U8 last_value = 0xFF; #if (MACHINE_DMD == 1) match_draw_scores (); #endif for (n=0; n < 20; n++) { if (n == 19) value = match_value; else { do { value = random_scaled (10) * 0x10; } while (value == last_value); } last_value = value; #ifdef MACHINE_TZ if (n == 19 && match_count) sound_send (SND_JET_BUMPER_ADDED); else sound_send (SND_HITCHHIKER_COUNT); #endif dmd_alloc_low_clean (); #if (MACHINE_DMD == 1) dmd_overlay (); #else match_draw_scores (); #endif sprintf ("%02X", value); font_render_string_right (&font_fixed6, 126, 22, sprintf_buffer); dmd_show_low (); task_sleep (TIME_100MS); } if (match_count) { callset_invoke (match_awarded); } task_sleep_sec (2); deff_exit (); }
void show_random_factoid (void) { dmd_map_overlay (); dmd_clean_page_high (); dmd_clean_page_low (); font_render_string_center (&font_bitoutline, 64, 8, "RANDOM"); font_render_string_center (&font_bitoutline, 64, 20, "FACTOID"); show_text_on_stars (); dmd_alloc_low_clean (); factoid_msg(random_scaled(NUM_FACTOIDS)); dmd_show_low (); amode_sleep_sec (6); }
CALLSET_ENTRY (gumball, sw_gumball_enter) { /* Ball has entered the gumball machine. */ dbprintf ("Gumball entered.\n"); gumball_enable_from_trough = FALSE; gumball_count++; if (in_live_game) { if (!multi_ball_play ()) leff_start (LEFF_GUMBALL_STROBE); gumball_running = TRUE; gumball_collected_count++; award_gumball_score (); gumball_release (); if (powerball_loaded_into_gumball == TRUE) { powerball_loaded_into_gumball = FALSE; leff_start (LEFF_FLASH_GI2); callset_invoke (mball_start); callset_invoke (mball_start_3_ball); callset_invoke (powerball_in_gumball); /* Do a dodgy multiball combo */ global_flag_on (GLOBAL_FLAG_SUPER_MB_RUNNING); ballsave_add_time (5); if (!global_flag_test (GLOBAL_FLAG_CHAOSMB_RUNNING) && !global_flag_test (GLOBAL_FLAG_SSSMB_RUNNING)) { /* random_scaled (N) returns from 0 - N-1 */ switch (random_scaled (2)) { case 0: callset_invoke (sssmb_start); break; case 1: callset_invoke (chaosmb_start); break; } } } else { bounded_decrement (gumball_enable_count, 0); } if (!global_flag_test (GLOBAL_FLAG_SUPER_MB_RUNNING)) deff_start (DEFF_GUMBALL); } }
void sw_jet_sound (void) { if (!in_live_game) return; jet_sound_index = random_scaled(3); if (timed_mode_running_p (&tsm_mode)) sound_send (super_jet_sounds[jet_sound_index]); else sound_send (jet_sounds[jet_sound_index]); /* Hack to stop slings and clock target from flashing jets */ if (!noflash) flasher_pulse (FLASH_JETS); noflash = FALSE; task_exit (); }
void jets_hit_deff (void) { U8 i = 0; do { U8 x = random_scaled (4); U8 y = random_scaled (4); dmd_alloc_low_clean (); psprintf ("1 HIT", "%d HITS", jets_scored); font_render_string_center (&font_fixed6, 62 + x, 7 + y, sprintf_buffer); sprintf ("%d FOR NEXT LEVEL", (jets_for_bonus - jets_scored)); font_render_string_center (&font_mono5, 64, 20, sprintf_buffer); dmd_show_low (); task_sleep (TIME_33MS); } while (i++ < 8); /* Redraw it so the 'HITS' text is centred */ dmd_alloc_low_clean (); psprintf ("1 HIT", "%d HITS", jets_scored); font_render_string_center (&font_fixed6, 64, 9, sprintf_buffer); sprintf ("%d FOR NEXT LEVEL", (jets_for_bonus - jets_scored)); font_render_string_center (&font_mono5, 64, 20, sprintf_buffer); dmd_show_low (); task_sleep (TIME_200MS); deff_exit (); }
void choose_single_jackpot(void) { U8 random_chooser; random_chooser = random_scaled(6); // choose random # from 0 to 6 U8 mask = 1;//make a 1 bit flag so that only 1 jackpot is lit mask <<= random_chooser;//slide the bit over a random # of times - could be 0 //turn on the appropriate jackpot //TODO: handle jackpots already picked if (lramp_mask & mask) lramp_jackpot_light_on(); if (rramp_mask & mask) rramp_jackpot_light_on(); if (sramp_mask & mask) sramp_jackpot_light_on(); if (cramp_mask & mask) cramp_jackpot_light_on(); if (lloop_mask & mask) ll_jackpot_light_on(); if (rloop_mask & mask) rl_jackpot_light_on(); if (ugrnd_mask & mask) underground_jackpot_light_on(); }//end of function