示例#1
0
CALLSET_ENTRY (slot, dev_slot_enter)
{
	if (event_did_follow (dead_end, slot)
	 	|| event_did_follow (gumball_exit, slot)
		|| event_did_follow (piano, slot)
		|| event_did_follow (camera, slot))
	{
		/* dead end was recently hit, so ignore slot */
		/* piano was recently hit, so ignore slot */
		/* camera was recently hit, so ignore slot */
	}
	else if (event_did_follow (skill_shot, slot))
	{
		/* skill shot has been missed */
		callset_invoke (skill_missed);
	}
	else if (timed_mode_running_p (&sslot_mode))
	{
		sslot_award ();
		score (SC_10M);
		timed_mode_end (&sslot_mode);
	}
	else
	{
		score (SC_50K);
		/* Tell door.c that the slot machine was hit */
		//callset_invoke (shot_slot_machine);
		task_create_anon (shot_slot_task);
		task_sleep (TIME_500MS);
	}
}
示例#2
0
/* Called by the right loop magnet to see if we should divert the ball */
void sw_gumball_right_loop_entered (void)
{
	/* Open the divertor if trying to load the gumball*/
	if (gumball_enable_from_trough && event_did_follow (autolaunch, right_loop))
	{
		magnet_disable_catch (MAG_RIGHT);
		gumball_divertor_open ();
	}
	/* Don't open if autofired into play or dropped from the lock*/
	else if (event_did_follow (autolaunch, right_loop)
		|| timer_find_gid (GID_LOCK_KICKED))
	{
	}
	/* Don't open if the magnet is about to grab the ball
	 * but remembering that it will always let the powerball through */
	else if ((magnet_enabled (MAG_RIGHT) || magnet_busy (MAG_RIGHT))
		&& !global_flag_test (GLOBAL_FLAG_POWERBALL_IN_PLAY))
	{
	}
	else if (gumball_load_is_enabled ())
	{
		gumball_divertor_open ();
		if (in_live_game && !multi_ball_play ())
		{
			sound_send (SND_GUMBALL_ENTER);
		}
	}
}
示例#3
0
文件: loop.c 项目: hydra/freewpc
CALLSET_ENTRY (loop, sw_right_loop_bottom)
{
	if (event_did_follow (right_loop_top, right_loop_bottom))
	{
		award_right_loop ();
	}
	else if (event_did_follow (right_loop_bottom, right_loop_bottom))
	{
		/* Ball came out the bottom, no loop */
	}
	event_should_follow (right_loop_bottom, right_loop_top, TIME_2S);
	event_can_follow (right_loop_bottom, right_loop_bottom, TIME_2S);
}
示例#4
0
文件: deffs2.c 项目: SonnyJim/freewpc
void shoot_camera_deff (void)
{
	if (timed_mode_running_p (&hitch_mode))
			sprintf ("SHOOT HITCH");
		else
			sprintf ("SHOOT CAMERA");

	if (event_did_follow (loop, ball_grab))
	{
		dmd_alloc_pair_clean ();
		U16 fno;
		for (fno = IMG_LOOP_START; fno < IMG_LOOP_END; fno += 2)
		{
			dmd_map_overlay ();
			dmd_clean_page_low ();
			font_render_string_center (&font_bitoutline, 64, 16, sprintf_buffer);
			dmd_text_outline ();
			dmd_alloc_pair ();
			frame_draw (fno);
			dmd_overlay_outline ();
			dmd_show2 ();
			task_sleep (TIME_66MS);
		}
		/* Get rid of the last dirty frame */
		dmd_alloc_pair_clean ();
		font_render_string_center (&font_bitoutline, 64, 16, sprintf_buffer);
		dmd_copy_low_to_high ();
		dmd_show2 ();
		flash_and_exit_deff2 (10, TIME_66MS);
	}
	else
	{
		flash_and_exit_deff2 (15, TIME_66MS);
	}
}
示例#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
文件: loop.c 项目: hydra/freewpc
CALLSET_ENTRY (loop, sw_right_loop_top)
{
	if (event_did_follow (right_loop_bottom, right_loop_top))
	{
		/* Ball came in from the bottom 
		 * score differently? */
		award_right_loop ();
	}
	event_should_follow (right_loop_top, right_loop_bottom, TIME_2S);
}
示例#7
0
CALLSET_ENTRY (leftramp, sw_left_ramp_enter)
{
	if (!event_did_follow (left_ramp, left_ramp_fail))
	{
		sound_send (SND_SHUTTLE_LAUNCH);
		deff_start (DEFF_SHUTTLE_LAUNCH);
		head_divert_to_mpf ();
	}
	else
	{
		sound_send (SND_ABORT_ABORT);
	}
	event_can_follow (left_ramp, left_ramp_fail, TIME_2S);
}
示例#8
0
文件: slot.c 项目: SonnyJim/freewpc
CALLSET_ENTRY (slot, dev_slot_enter)
{
	if (task_kill_gid (GID_CAMERA_SLOT_PROX_DETECT)
		 || task_kill_gid (GID_PIANO_SLOT_PROX_DETECT))
	{
		/* Proximity sensor did not trip ; must be the powerball */
		pb_detect_event (PF_PB_DETECTED);
		pb_announce ();
	}

	if (!in_live_game)
		return;
	else if (task_find_or_kill_gid (GID_DEADEND_TO_SLOT)
	 	|| task_find_or_kill_gid (GID_GUMBALL_TO_SLOT)
		|| task_find_or_kill_gid (GID_PIANO_TO_SLOT)
		|| task_find_or_kill_gid (GID_CAMERA_TO_SLOT))
	{
		/* dead end was recently hit, so ignore slot */
		/* piano was recently hit, so ignore slot */
		/* camera was recently hit, so ignore slot */
	}
	else if (event_did_follow (skill_shot, slot)
		|| skill_shot_enabled
		|| global_flag_test (GLOBAL_FLAG_SSSMB_RUNNING))
	{
		/* TODO, this may be buggy during sssmb */
		/* skill shot has been missed or ball landed in plunger lane*/
		if (timer_kill_gid (GID_SDSS_APPROACHING)) 
			callset_invoke (sdss_ready);
		callset_invoke (skill_missed);
	}
	else if (timed_mode_running_p (&sslot_mode))
	{
		//TODO If shot from lite slot lane, allow player to choose award
		shot_sslot ();
	}
	else if (can_award_door_panel () && flag_test (FLAG_SLOT_DOOR_LIT))
	{
		shot_slot_door ();
	}
	else 
	{
		shot_slot_oddchange ();
	}
	/* Sleep so the deffs can get a chance to start and stop it
	 * kicking out too early */
	task_sleep (TIME_400MS);
	
}
示例#9
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);
		}
	}
}