//we always start with these 3 lights on because those are the skillshots void combo_reset (void) { flag_on (FLAG_IS_COMBO_SIDERAMP_ACTIVATED); flag_on (FLAG_IS_COMBO_LEFTRAMP_ACTIVATED); flag_off (FLAG_IS_COMBO_RIGHTRAMP_ACTIVATED); flag_on (FLAG_IS_COMBO_UNDER_ACTIVATED); flag_off (FLAG_IS_COMBO_CENTERRAMP_ACTIVATED); flag_off (FLAG_IS_COMBO_LEFTORB_ACTIVATED); flag_off (FLAG_IS_COMBO_RIGHTORB_ACTIVATED); flag_on (FLAG_IS_COMBOS_RESTARTABLE); if (flag_test (FLAG_IS_COMPUTER_ACTIVATED) ) computer_light_on(); all_arrow_update(); // at arrow_handler.c }//end of function
void huxley_mode_init (void) { ball_search_monitor_stop (); task_kill_gid(GID_HUXLEY_REMINDER); flag_on (FLAG_IS_HUXLEY_RUNNING); huxley_mode_shots_made = 0; ++huxley_modes_achieved; score_zero(huxley_mode_score); score_zero(huxley_mode_last_score); score_zero(huxley_mode_next_score); score(HUXLEY_START_SCORE); score_add(huxley_mode_score, score_table[HUXLEY_START_SCORE]); score_add(huxley_mode_next_score, score_table[HUXLEY_MODE_HIT_SCORE]); huxley_goal += (HUXLEY_EASY_GOAL * 2); flag_off(FLAG_IS_HUXLEY_ENABLED); deff_start_sync (DEFF_HUXLEY_START_EFFECT);//under /kernel/deff.c ballsave_add_time (5); leff_start(LEFF_HUXLEY); sol_request_async (SOL_EJECT); //request to fire the eject sol task_sleep (TIME_300MS); flag_off(FLAG_KILL_NORMAL_EJECT); ball_search_monitor_start (); }//end of function
static void shot_slot_door (void) { flag_off (FLAG_SLOT_DOOR_LIT); flag_on (FLAG_PIANO_DOOR_LIT); callset_invoke (select_mode); callset_invoke (award_door_panel); }
CALLSET_ENTRY (lock_freeze_mbstart, start_ball) { multiball_light_off();//goto orbits.c to turn off light and flag if (NumBallsFrozen > (NumMBsDone % 4) ) { multiball_light_on();//goto orbits.c flag_on(FLAG_IS_MULTIBALL_ENABLED); } lamp_tristate_off (LM_FREEZE_1); lamp_tristate_off (LM_FREEZE_2); lamp_tristate_off (LM_FREEZE_3); lamp_tristate_off (LM_FREEZE_4); switch (NumBallsFrozen) { case 1: lamp_tristate_on (LM_FREEZE_1); break; case 2: lamp_tristate_on (LM_FREEZE_1); lamp_tristate_on (LM_FREEZE_2); break; case 3: lamp_tristate_on (LM_FREEZE_1); lamp_tristate_on (LM_FREEZE_2); lamp_tristate_on (LM_FREEZE_3); break; case 4: lamp_tristate_on (LM_FREEZE_1); lamp_tristate_on (LM_FREEZE_2); lamp_tristate_on (LM_FREEZE_3); lamp_tristate_on (LM_FREEZE_4); break; }//end of switch }
/** * Computes the intersection of a bitfield and multiple bitflags. * * The flags not specified in `...` are cleared in `flags`. The bitfeild size * is supplied in `size`. TRUE is returned when changes were made, FALSE * otherwise. * * WARNING: FLAG_END must be the final argument in the `...` list. */ bool flags_mask(bitflag *flags, const size_t size, ...) { int f; va_list args; bool delta = FALSE; bitflag *mask; /* Build the mask */ mask = C_ZNEW(size, bitflag); va_start(args, size); /* Process each flag in the va-args */ for (f = va_arg(args, int); f != FLAG_END; f = va_arg(args, int)) flag_on(mask, size, f); va_end(args); delta = flag_inter(flags, mask, size); /* Free the mask */ FREE(mask); return delta; }
void start_extraball(void) { if (in_game) { //do this since this can be called from computer award test in test menu flag_on(FLAG_IS_EXTRABALL_LIT); extraball_light_on (); task_create_gid1 (GID_EXTRA_BALL_REMINDER, extraball_reminder_task); }//end of if }//end of function
/**************************************************************************** * * body * ****************************************************************************/ void combo_init(void) { flag_off (FLAG_IS_COMBOS_KILLED); flag_on (FLAG_IS_COMBOS_RESTARTABLE); choose_random_flag_set(); all_arrow_update(); // at arrow_handler.c task_create_gid1 (GID_COMBO, combo_task); }//end of function
CALLSET_ENTRY (deadend, sw_dead_end) { // device_switch_can_follow (dead_end, slot, TIME_2S + TIME_500MS); // event_can_follow (dead_end, camera, TIME_2S); timer_restart_free (GID_DEADEND_TO_SLOT, TIME_4S); //event_can_follow (camera_or_piano, slot_prox, TIME_5S); if (lamp_test (LM_DEAD_END)) { leff_start (LEFF_RIGHT_LOOP); dead_end_count++; deff_start_sync (DEFF_DEAD_END); if (!flag_test (FLAG_SNAKE_READY) && single_ball_play ()) { flag_on (FLAG_SNAKE_READY); deff_start_sync (DEFF_SNAKE_READY); } switch (dead_end_count) { case 1: score (SC_250K); timed_game_extend (15); break; case 2: score (SC_500K); timed_game_extend (20); break; case 3: timed_game_extend (30); if (extra_ball_lit_from_deadend == FALSE && can_award_extra_ball ()) { score (SC_1M); light_easy_extra_ball (); extra_ball_lit_from_deadend = TRUE; } else { score (SC_10M); } dead_end_count = 0; break; default: score (SC_2M); timed_game_extend (30); break; } lamp_off (LM_DEAD_END); } else { deff_start (DEFF_INLANE_LIGHTS_DEAD_END); award_unlit_shot (SW_DEAD_END); score (SC_100K); sound_send (SND_TOWN_SQUARE_AWARD); timed_game_pause (TIME_3S); } }
errr grab_flag(bitflag *flags, const size_t size, const char **flag_table, const char *flag_name) { int flag = lookup_flag(flag_table, flag_name); if (flag == FLAG_END) return PARSE_ERROR_INVALID_FLAG; flag_on(flags, size, flag); return 0; }
void combo_task (void) { task_sleep_sec(COMBO_WAIT_TIME); //no combo made yet so flash active lamps flash_combos(); task_sleep_sec(COMBO_HURRY_TIME); //still no hits so turn off flags and lamps until something is hit flag_off (FLAG_IS_COMBO_SIDERAMP_ACTIVATED); flag_off (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_off (FLAG_IS_COMBO_LEFTORB_ACTIVATED); flag_off (FLAG_IS_COMBO_RIGHTORB_ACTIVATED); flag_on (FLAG_IS_COMBOS_KILLED); flag_on (FLAG_IS_COMBOS_RESTARTABLE); all_arrow_update(); task_exit(); }//end of function
CALLSET_ENTRY (hocus_pocus, sw_left_bank) { if (hocus_pocus_can_be_started ()) return; if (++hocus_pocus_count == hocus_pocus_goal) { flag_on (FLAG_HOCUS_POCUS_LIT); bounded_increment (hocus_pocus_goal, 5); } }
static void shot_slot_oddchange (void) { score (SC_5130); if (check_relight_slot_or_piano ()) { flag_on (FLAG_SLOT_DOOR_LIT); sound_send (SND_FEEL_LUCKY); } award_unlit_shot (SW_SLOT); callset_invoke (oddchange_collected); }
//this is for stacking void combo_rehit_check(void ) { //video mode if (combo_counter >= combo_vm_goal && !flag_test (FLAG_VIDEO_MODE_ENABLED) ) { combo_vm_goal += COMBO_EASY_GOAL_STEP; flag_on (FLAG_VIDEO_MODE_ENABLED); } //computer award else if (combo_counter >= combo_goal && !flag_test (FLAG_IS_COMPUTER_ACTIVATED) ) { combo_goal += COMBO_EASY_GOAL_STEP; computer_light_on(); //at underground.c } }//end of function
//this is a hard kill that prevents combos from restarting //we only use this during certain modes void kill_combos(void) { flag_off (FLAG_IS_COMBO_SIDERAMP_ACTIVATED); flag_off (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_off (FLAG_IS_COMBO_LEFTORB_ACTIVATED); flag_off (FLAG_IS_COMBO_RIGHTORB_ACTIVATED); flag_on (FLAG_IS_COMBOS_KILLED); flag_off (FLAG_IS_COMBOS_RESTARTABLE); all_arrow_update(); }//end of function
//called from computer award in underground.c void comp_award_light_arrows(void) { flag_off (FLAG_IS_COMBOS_KILLED); flag_on (FLAG_IS_COMBO_SIDERAMP_ACTIVATED); flag_on (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_on (FLAG_IS_COMBO_LEFTORB_ACTIVATED); flag_on (FLAG_IS_COMBO_RIGHTORB_ACTIVATED); all_arrow_update(); task_recreate_gid (GID_COMBO, combo_task); }//end of function
void skillshot_rollover_disable( void ) { if (!global_flag_test (GLOBAL_FLAG_SKILLSHOT_ROLLOVER_ENABLED)) { return; } global_flag_off ( GLOBAL_FLAG_SKILLSHOT_ROLLOVER_ENABLED ); lamp_tristate_off (LM_LEFT_ROLLOVER); lamp_tristate_off (LM_MIDDLE_ROLLOVER); lamp_tristate_off (LM_RIGHT_ROLLOVER); flag_on (FLAG_LOOP_GATE_OPENED); task_kill_gid (GID_SKILLSHOT_ROLLOVER_TIMER); }
/** * Wipes a bitfield, and then sets multiple bitflags. * * The flags specified in `...` are set in `flags`, while all other flags are * cleared. The bitfield size is supplied in `size`. * * WARNING: FLAG_END must be the final argument in the `...` list. */ void flags_init(bitflag *flags, const size_t size, ...) { int f; va_list args; flag_wipe(flags, size); va_start(args, size); /* Process each flag in the va-args */ for (f = va_arg(args, int); f != FLAG_END; f = va_arg(args, int)) flag_on(flags, size, f); va_end(args); }
void cryoprison_start(U8 num) { kill_combos(); // cryoprison_start_music = TRUE; //for to play the helicopter instead of the music task_create_gid1 (GID_CRYOPRISON_START_NOISE, cryoprison_start_sounds); flag_on(FLAG_IS_CRYOPRISON_MB_RUNNING); cryoprison_display_counter = 0; CRYO_TOGGLE = 0; snake_pos = 0; cryoprison_ballsave = TRUE; mb_mode_start(&cryoprison_mode); multiball_started();//reset all MB start criteria for next time score_add (cryoprison_score, score_table[CRYOPRISON_MB_SCORE]); score (CRYOPRISON_MB_SCORE); deff_start (DEFF_CRYOPRISON_START_EFFECT); diverter_stop();//defined in divhold2.ct task_kill_gid (GID_CR_LIGHTS); //LIGHTS lamp_tristate_flash(LM_CRYOPRISON_MULTIBALL); task_sleep (TIME_2S); lamp_tristate_on (LM_CRYOPRISON_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 cryoprison_SoundCounter; cryoprison_SoundCounter = random_scaled(2);//from kernal/random.c - pick number from 0 to 2 if (cryoprison_SoundCounter == 0) sound_start (ST_SPEECH, SPCH_SIMON_SAYS_SLY, SL_4S, PRI_GAME_QUICK5); else sound_start (ST_SPEECH, SPCH_PHOENIX_SHORT, SL_4S, PRI_GAME_QUICK5); task_sleep (TIME_3S); sound_start (ST_SPEECH, SPCH_SIMON_SAYS, SL_4S, PRI_GAME_QUICK5); cryoprison_start_music = FALSE; //for to kill the music //serve balls set_ball_count (5); task_create_gid1 (GID_CRYOPRISON_BALL_SAVE, cryoprison_ballsave_task); task_sleep (TIME_3S); set_all_jackpots(); //all 6 lit }//end of function
void car_chase_mode_init (void) { car_chase_mode_shots_made = 0; flag_on (FLAG_IS_CARCHASE_MODE_RUNNING); ballsave_add_time (10); ++car_chase_modes_achieved; diverter_stop();//defined in divhold2.ct task_kill_gid (GID_CR_LIGHTS); carchase_mode_on(); //at ramps.c serve_ball_auto(); //add one ball to the playfield - NOT a multiball since doesn't change global ball count sound_start (ST_SPEECH, SPCH_WUSS_SPARTAN, SL_4S, PRI_GAME_QUICK5); task_sleep_sec (2); sound_start (ST_SPEECH, SPCH_EXCUSE_ME, SL_4S, PRI_GAME_QUICK5); task_sleep_sec (1); sound_start (ST_SPEECH, SPCH_BETWEEN_YOU_N_ME, SL_4S, PRI_GAME_QUICK5); //flash lamp for a time score_zero(car_chase_mode_score); lamp_tristate_off (LM_CLAW_READY); }//end of function
/**************************************************************************** * initialize and exit ***************************************************************************/ CALLSET_ENTRY (huxley, start_player) { if (DM_IN_CAB_TEST) huxley_goal = 1; else huxley_goal = HUXLEY_EASY_GOAL; huxley_counter = 0; huxley_mode_shots_made = 0; score_zero(huxley_mode_score_total_score); task_kill_gid(GID_HUXLEY_REMINDER); #ifdef CONFIG_DIFFICULTY_LEVEL huxley_goal = system_config.num2huxley; #endif if (huxley_goal == 0) flag_on(FLAG_IS_HUXLEY_ENABLED); else flag_off(FLAG_IS_HUXLEY_ENABLED); //for testing // huxley_increment(); huxley_suspend = FALSE; }//end of function
void combo_hit(void ) { //video mode if (++combo_counter >= combo_vm_goal && !flag_test (FLAG_VIDEO_MODE_ENABLED) ) { if (IN_TEST) combo_vm_goal += 2; else { #ifdef CONFIG_DIFFICULTY_LEVEL if (system_config.difficulty == EASY) combo_vm_goal += COMBO_EASY_GOAL_STEP; else combo_vm_goal += COMBO_HARD_GOAL_STEP; #elif combo_vm_goal += COMBO_EASY_GOAL_STEP; #endif }//end of else flag_on (FLAG_VIDEO_MODE_ENABLED); deff_start (DEFF_VM_EFFECT); } //computer award else if (combo_counter >= combo_goal && !flag_test (FLAG_IS_COMPUTER_ACTIVATED) ) { if (IN_TEST) combo_goal += 2; else { #ifdef CONFIG_DIFFICULTY_LEVEL if (system_config.difficulty == EASY) combo_goal += COMBO_EASY_GOAL_STEP; else combo_goal += COMBO_HARD_GOAL_STEP; #elif combo_goal += COMBO_EASY_GOAL_STEP; #endif }//end of else computer_light_on(); //at underground.c deff_start (DEFF_COMBO_EFFECT); } //not at a goal yet else deff_start (DEFF_COMBO_EFFECT); // reset the task timer choose_random_flag_set(); all_arrow_update(); task_recreate_gid (GID_COMBO, combo_task); }//end of function
void check_multiball_requirements(void) { //if requirements met for next mb - light left loop shot to start mb //Fortress Multiball = 1 ball min needs to be frozen //Museum Multiball = 2 ball min needs to be frozen //Cryoprison Multiball = 3 ball min needs to be frozen //Wasteland Multiball = 4 ball min needs to be frozen if (NumBallsFrozen > (NumMBsDone % 4) ) { // % is modulus multiball_light_on();//goto orbits.c flag_on(FLAG_IS_MULTIBALL_ENABLED); if ( (lock_SoundCounter++ % 2) == 0 )//check if even sound_start (ST_SPEECH, SPCH_MULTIBALL_ACTIVATED, SL_4S, PRI_GAME_QUICK5); else sound_start (ST_SPEECH, SPCH_SHOOT_LEFT_LOOP, SL_4S, PRI_GAME_QUICK5); } //end of if (NumBallsFrozen > (NumMBsDone % 4) ) if (system_config.disable_shaker == NO) { if (system_config.extra_shaker == YES) shaker_start (SHAKER_HALF_ON, 2); else shaker_start (SHAKER_ONE_QUARTER_ON, 2); }//end of shaker call leff_start(LEFF_FREEZE); deff_start (DEFF_FREEZE_EFFECT); }//end of function
void spirit_ring_light (void) { flag_on (FLAG_SPIRIT_RING_LIT); deff_start (DEFF_SPIRIT_RING_LIT); }
void rnd_eb_award (void) { flag_on (FLAG_RANDOM_EB_GIVEN); light_easy_extra_ball (); }
/**************************************************************************** * * 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 rnd_light_hocus (void) { flag_on (FLAG_HOCUS_POCUS_LIT); }
void magna_goalie_light (void) { flag_on (FLAG_MAGNA_GOALIE_LIT); }
/**************************************************************************** * * body * ***************************************************************************/ void huxley_increment (void) { if (++huxley_counter >= huxley_goal) { flag_on(FLAG_IS_HUXLEY_ENABLED); task_create_gid1 (GID_HUXLEY_REMINDER, huxley_reminder_task); } }//end of function
void huxley_increment (void) { if (++huxley_counter >= huxley_goal) { flag_on(FLAG_IS_HUXLEY_ENABLED); } }//end of function
void huxley_increment_all (void) { flag_on(FLAG_IS_HUXLEY_ENABLED); }//end of function