Пример #1
0
static void jets_level_up (void)
{
	timer_restart_free (GID_JETS_LEVEL_UP, TIME_2S);
	jets_scored = 1;
	bounded_increment (jets_bonus_level, 50);
	if (jets_for_bonus <= 195)
		jets_for_bonus += 5;
	award_unlit_shot (SW_BOTTOM_JET);
	/* jetscore is used rather than score_deff_get 
	 * because it's likely another score woud of
	 * happened */
	if (jets_bonus_level < 3)
	{
		score (SC_1M);
		jetscore = 1;
	}
	else if (jets_bonus_level < 5)
	{
		score (SC_5M);
		jetscore = 5;
	}
	else if (jets_bonus_level < 7)
	{
		score (SC_10M);
		jetscore = 10;
	}
	if (!timer_find_gid (GID_HITCHHIKER))
		deff_start (DEFF_JETS_LEVEL_UP);
}
Пример #2
0
void lock_powerball_deff (void)
{
	sound_send (SND_TOO_HOT_TO_HANDLE);
	U16 fno;
	dmd_alloc_pair_clean ();
	timer_restart_free (GID_LOCK_POWERBALL, TIME_5S);
	while (task_find_gid (GID_LOCK_POWERBALL))
	{
		ball_search_timer_reset ();
		for (fno = IMG_POWERBALL_START; fno <= IMG_POWERBALL_END; fno += 2)
		{
			dmd_map_overlay ();
			dmd_clean_page_low ();
			font_render_string_center (&font_fireball, 64, 9, "LOCK BALL");
			font_render_string_left (&font_var5, 10, 24, "LEFT: NO");
			font_render_string_right (&font_var5, 118, 24, "RIGHT: YES");
			dmd_text_outline ();

			dmd_alloc_pair ();
			frame_draw (fno);
			dmd_overlay_outline ();
			dmd_show2 ();
			task_sleep (TIME_33MS);
		}
	}
	deff_exit ();
}
Пример #3
0
CALLSET_ENTRY (gumball, sw_gumball_popper)
{
	/* A right loop was completed, TODO Could be BUGGY */
	timer_restart_free (GID_GUMBALL, TIME_1S);
	if (task_kill_gid (GID_RIGHT_LOOP_ENTERED))
		task_create_anon (award_right_loop_task);
}
Пример #4
0
void tnf_deff (void)
{
	bool blink_on = TRUE;
	tnf_x = 0;
	tnf_y = 0;
	timer_restart_free (GID_TNF_TIMER, TIME_4S);
	while (tnf_buttons_pressed < 100 && task_find_gid (GID_TNF_TIMER))
	{
		dmd_alloc_pair_clean ();
		if (blink_on)
		{
			font_render_string_center (&font_mono5, 64, 4, "HIT FLIPPER BUTTONS");
			blink_on = FALSE;
		}
		else
			blink_on = TRUE;
		psprintf ("%d DOINK", "%d DOINKS", tnf_buttons_pressed);
		font_render_string_center (&font_term6, 60 + tnf_x, 12 + tnf_y, sprintf_buffer);
		dmd_copy_low_to_high ();
		callset_invoke (score_overlay);
		draw_progress_bar (&tnf_progress_bar);
		dmd_show2 ();
		task_sleep (TIME_66MS);
	}
	deff_exit ();
}
Пример #5
0
/** A task that manages the autolaunching of balls.
Upon entry, the autofire divertor solenoid is already pulsing
and a ball is being kicked from the trough. */
void autofire_monitor (void)
{
    /* Open the divertor to catch the ball.  Because it may be
    coming from either the trough or a ramp divert, the
    timings are variable. */
    if (shooter_div_delay_time)
        task_sleep_sec (shooter_div_delay_time);

    autofire_busy = TRUE;
    //if (autofire_full ()
    //	don't open to catch
    shooter_div_start ();
    /* TODO - If the autofire switch trips during the 'open
    time', we can abort this delay early and go ahead and
    close the divertor.  This is safe because only one
    ball can appear here at a time. */
    //task_sleep_sec (shooter_div_open_time);
    autofire_ball_catch_wait ();
    shooter_div_stop ();

    /* Wait a little longer for the ball to settle */
    task_sleep (TIME_200MS);

    /* If Right inlane -> Left ramp combo, start tnf mode */
    if (event_did_follow (left_ramp_exit, tnf) && single_ball_play ())
    {
        callset_invoke (tnf_start);
    }

    /* Wait until allowed to kickout */
    while (kickout_locks > 0)
        task_sleep (TIME_100MS);

    /* Open diverter again */
    shooter_div_start ();
    /* Wait for the diverter to fully open before firing */
    U8 timeout = 20;
    while (--timeout != 0)
        task_sleep (TIME_100MS);

    if (in_live_game && single_ball_play ())
    {
        sound_send (SND_EXPLOSION_1);
        leff_start (LEFF_STROBE_UP);
    }
    /* Say that the ball is heading into the right loop */
    timer_restart_free (GID_BALL_LAUNCH, TIME_3S);
    event_can_follow (autolaunch, right_loop, TIME_4S);
    /* Clear the magnet so we can fire a ball */
    magnet_disable_catch (MAG_RIGHT);
    /* Launch the ball */
    sol_request (SOL_AUTOFIRE);
    /* Wait for the ball to clear the divertor
     * before closing*/
    task_sleep (TIME_700MS);
    shooter_div_stop ();
    autofire_busy = FALSE;
    task_exit ();
}
Пример #6
0
CALLSET_ENTRY (tz, start_without_credits)
{
	if (!timer_find_gid (GID_START_NO_CREDITS_DEBOUNCE))
	{
		timer_restart_free (GID_START_NO_CREDITS_DEBOUNCE, TIME_5S);
		sound_send (SND_GREEEED);
	}
}
Пример #7
0
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);
	}
}
Пример #8
0
static inline void gangway_light (task_gid_t gid, task_gid_t other_gid)
{
	if (gangway_available_p ())
	{
		timer_kill_gid (other_gid);
		timer_restart_free (gid, TIME_5S);
		gangway_loop_lit ();
	}
}
Пример #9
0
/* The ball should be held at this point */
CALLSET_ENTRY (pb_lock, pb_lock_choose)
{

	timer_restart_free (GID_PB_LOCK_DEBOUNCE, TIME_1S);
	sound_send (SND_PIANO_ENTRY_TUNE);
	flipper_disable ();
	deff_start_sync (DEFF_LOCK_POWERBALL);
	task_create_anon (flipper_enable_task);
}
Пример #10
0
CALLSET_ENTRY (gumball, sw_gumball_geneva)
{
	dbprintf ("Geneva tripped.\n");
	/* Trigger on the second edge change */
	/* Don't trigger too early */
	if (timeout < 10)
		gumball_geneva_tripped = TRUE;
	timer_restart_free (GID_GENEVA_TRIPPED, TIME_4S);
}
Пример #11
0
CALLSET_ENTRY (outhole, sw_outhole)
{
	if (in_live_game)
	{
		if (ballsave_test_active ())
		{
			/* Start a timer so we grab the ball after its
			 * fired to help the player */
			timer_restart_free (GID_BALL_LAUNCH_DEATH, TIME_6S);
		}

		
		/* Start a timer to check if 3 balls drain quickly */
		if (!timer_find_gid (GID_MULTIDRAIN) && !ballsave_test_active ())
		{
			multidrain_count = 0;
			if (multi_ball_play ())
				timer_restart_free (GID_MULTIDRAIN, TIME_7S);
		}
	
		if (timer_find_gid (GID_MULTIDRAIN))
		{
			/* There are 6 balls installed normally */
			bounded_increment (multidrain_count, 6);
			if (multidrain_count >= 3)
				multidrain_awarded = TRUE;
		}
		
		/* Whoops, lost the powerball before getting it in the gumball */
		if (!multi_ball_play () &&
			 global_flag_test (GLOBAL_FLAG_POWERBALL_IN_PLAY) &&
			 !ballsave_test_active ())
		{
			sound_send (SND_NOOOOOOOO);
			powerball_death = TRUE;
			task_sleep (TIME_500MS);
		}
		deff_start (DEFF_BALL_EXPLODE);
		leff_start (LEFF_STROBE_UP);
	}
	
}
Пример #12
0
/* 'Dead End' Lane */
CALLSET_ENTRY (lanes, sw_right_inlane)
{
    event_can_follow (left_or_right_inlane, either_outlane, TIME_1S);
    lamp_on (LM_RIGHT_INLANE);
    check_rollover ();
    score (SC_1K);

    /* Light Dead end if not lit */
    lamp_on (LM_DEAD_END);
    timer_restart_free (GID_TNF_READY, TIME_4S);
    //event_can_follow (right_inlane, left_ramp, TIME_4S);
}
Пример #13
0
CALLSET_ENTRY (ballsave, sw_left_outlane, sw_right_outlane, sw_outhole)
{
	if (single_ball_play () && ballsave_test_active ())
	{
		/* Here, we start a separate hidden timer to indicate
		that ballsave should occur once the ball reaches the
		trough.  It should have a long expiry time just in case
		something goes wrong.  But the ballsave lamp should not
		be forced on during this period. */
		timer_restart_free (GID_BALLSAVE_EXTENDED, TIME_7S);
	}
}
Пример #14
0
inline static bool right_inlane_combo_check (void)
{
	if (!single_ball_play ())
		return FALSE;

	if (task_kill_gid (GID_TNF_READY))
	{
		//event_can_follow (left_ramp_exit, tnf, TIME_4S);
		timer_restart_free (GID_TNF_APPROACHING, TIME_4S);
		deff_start (DEFF_GET_READY_TO_DOINK);
		return TRUE;
	}
	else
		return FALSE;

}
Пример #15
0
void amode_score_page (void)
{
	dmd_alloc_low_clean ();
	scores_draw ();
	dmd_show_low ();

	/* Hold the scores up for a while longer than usual
	 * in tournament mode or when triggered by a right button hold */
	if (system_config.tournament_mode == YES || amode_show_scores_long)
	{
		/* Don't allow the player to skip past the scores for 10 seconds */
		timer_restart_free (GID_AMODE_BUTTON_DEBOUNCE, TIME_10S);
		amode_show_scores_long = FALSE;
		amode_page_end (120);
	}
	else
		amode_page_end (5);
}
Пример #16
0
CALLSET_ENTRY (skill, sw_shooter)
{
	/* Because the shooter switch is declared as an 'edge' switch,
	an event is generated on both transitions.  Check the current
	state of the switch to see which transition occurred. */
	if (!in_live_game)
		return;

	if (!switch_poll_logical (SW_SHOOTER))
	{
		sound_send (SND_SHOOTER_PULL);
		leff_restart (LEFF_STROBE_UP);
		timer_restart_free (GID_SHOOTER_SOUND_DEBOUNCE, TIME_3S);
	}
	else
	{
		leff_stop (LEFF_STROBE_UP);
	}
}
Пример #17
0
CALLSET_ENTRY (gumball, sw_gumball_exit)
{
//	if (!global_flag_test (GLOBAL_FLAG_MULTIBALL_RUNNING))
//		sound_send (SND_GUMBALL_LOADED);
	if (task_kill_gid (GID_GENEVA_TRIPPED) 
		|| event_did_follow (gumball_release, gumball_exit))
	{
		/* Start a timer to tell the slot where the ball came from */
		timer_restart_free (GID_GUMBALL_TO_SLOT, TIME_5S);
		/* Signal the release motor to stop */
		gumball_exit_tripped = TRUE;
		/* A ball successfully came out of the gumball machine.*/
		bounded_decrement (gumball_count, 0);
		if (feature_config.easy_lite_gumball == YES)
		{
			lamp_off (LM_GUM);
			lamp_off (LM_BALL);
		}
	}
}
Пример #18
0
void hitchhiker_deff (void)
{
	/* Start a timer so jets won't stop animation */
	timer_restart_free (GID_HITCHHIKER, TIME_3S);
	dmd_alloc_pair_clean ();
	U16 fno;
	for (fno = IMG_HITCHHIKER_START; fno <= IMG_HITCHHIKER_END; fno += 2)
	{
		dmd_map_overlay ();
		dmd_clean_page_low ();
			
		if (timed_mode_running_p (&hitch_mode))
		{
			sprintf("10 MILLION");
			font_render_string_center (&font_fireball, 64, 16, sprintf_buffer);
		}
		else
		{
			sprintf ("HITCHERS");
			font_render_string_center (&font_nayupixel10, 98, 5, sprintf_buffer);
			sprintf ("%d", hitch_count);
			font_render_string_center (&font_quadrit, 99, 24, sprintf_buffer);
		}	
	
		dmd_text_outline ();
		dmd_alloc_pair ();
		frame_draw (fno);
		dmd_overlay_outline ();
		dmd_show2 ();
		//task_sleep (TIME_33MS);
	}
	task_sleep  (TIME_500MS);
	/* Stop the timer so jets.c can show deffs again */
	timer_kill_gid (GID_HITCHHIKER);
	deff_exit ();
	
}
Пример #19
0
/* 'Special' outlane */
CALLSET_ENTRY (lanes, sw_right_outlane)
{
    timer_restart_free (GID_BALL_DRAIN_OUTLANE, TIME_5S);
    score (SC_10K);
    handle_outlane ();
}