Example #1
0
static bool rollover_completed (void)
{
    if (lamp_test (LM_LEFT_INLANE1)
            && lamp_test (LM_LEFT_INLANE2)
            && lamp_test (LM_RIGHT_INLANE))
        return TRUE;
    else
        return FALSE;
}
Example #2
0
CALLSET_ENTRY (magic_spell, sw_ramp_targets)
{
	score (SC_5K);
	if (magic_relight_ramp_count > 0)
	{
		if (--magic_relight_ramp_count == 0)
		{
			if (!lamp_test (LM_CENTER_MAGIC))
				lamp_on (LM_CENTER_MAGIC);
			else if (!lamp_test (LM_RIGHT_MAGIC))
				lamp_on (LM_RIGHT_MAGIC);
		}
	}
}
Example #3
0
/** Task that performs a switch lamp pulse.
 * Some switches are inherently tied to a lamp.  When the switch
 * triggers, the lamp can be automatically flickered.  This is
 * implemented as a pseudo-lamp effect, so the true state of the
 * lamp is not disturbed. */
void switch_lamp_pulse (void)
{
	lamp_pulse_data_t * const cdata = task_current_class_data (lamp_pulse_data_t);
	/* Although not a true leff, this fools the lamp draw to doing
	 * the right thing. */
	cdata->leffdata.flags = L_SHARED;

	/* If the lamp is already allocated by another lamp effect,
	then don't bother trying to do the pulse. */
	if (lamp_leff2_test_and_allocate (cdata->swinfo->lamp))
	{
		/* Change the state of the lamp */
		if (lamp_test (cdata->swinfo->lamp))
			leff_off (cdata->swinfo->lamp);
		else
			leff_on (cdata->swinfo->lamp);
		task_sleep (TIME_200MS);

		/* Change it back */
		leff_toggle (cdata->swinfo->lamp);
		task_sleep (TIME_200MS);

		/* Free the lamp */
		lamp_leff2_free (cdata->swinfo->lamp);
	}
	task_exit ();
}
Example #4
0
void martian_spell (bool on)
{
	const char text[] = "MARTIAN";
	const char *s;
	U8 x = 16;
	U8 i;
	char c[2];

	s = text;
	i = 0;
	while (*s)
	{
		bool b = lamp_test (lamplist_index (LAMPLIST_MARTIANS, i));
		if (!on)
			b = !b;
		if (b)
		{
			c[0] = *s;
			c[1] = '\0';
			font_render_string_center (&font_fixed10, x, 11, c);
		}
		x += 16;
		s++;
		i++;
	}
}
Example #5
0
CALLSET_ENTRY (magic_spell, right_ramp_shot)
{
	if (lamp_test (LM_RIGHT_MAGIC))
	{
		magic_spell_advance ();
	}
}
Example #6
0
CALLSET_ENTRY (magic_spell, center_ramp_shot)
{
	if (lamp_test (LM_CENTER_MAGIC))
	{
		magic_spell_advance ();
	}
}
Example #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);
	}
}
Example #8
0
int cmd_self_test(FILE * f, int argc, char ** argv)
{
	if (argc > 1)
		return SHELL_ERR_EXTRA_ARGS;

	lamp_test();

	return 0;
}
Example #9
0
/* 'Light Slot Machine' Lane */
CALLSET_ENTRY (lanes, sw_left_inlane_2)
{
    if (!lamp_test (LM_LEFT_INLANE2) && spiralaward_set_completed == FALSE)
    {
        callset_invoke(start_spiralaward_timer);
    }
    lamp_on (LM_LEFT_INLANE2);
    check_rollover ();
    score (SC_1K);
    event_can_follow (left_inlane_2, right_loop, TIME_3S);
}
Example #10
0
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);
}
Example #11
0
void common_outlane (void)
{
	score (SC_50K);
	rudy_look_straight ();
	if (!flag_test (FLAG_STEPS_OPEN))
		sample_start (SND_OUTLANE, SL_500MS);
	if (lamp_test (LM_SPECIALS))
	{
		lamp_off (LM_SPECIALS);
		flag_off (FLAG_OUTLANES_LIT);
		special_award ();
	}
}
Example #12
0
/* 'Light Spiral' Lane */
CALLSET_ENTRY (lanes, sw_left_inlane_1)
{
    event_can_follow (left_or_right_inlane, either_outlane, TIME_1S);
    /* Start the spiralaward timer only if the lane has
     * just been lit */
    if (!lamp_test (LM_LEFT_INLANE1) && spiralaward_set_completed == FALSE)
    {
        callset_invoke (start_spiralaward_timer);
    }
    lamp_on (LM_LEFT_INLANE1);
    check_rollover ();
    score (SC_1K);
    event_can_follow (left_inlane_1, right_loop, TIME_3S);
}
Example #13
0
void bonusx_lane (U8 lamp)
{
	if (lamp_test (lamp))
	{
		score (SC_10K);
	}
	else
	{
		score (SC_50K);
		lamp_on (lamp);

		if (lamp_test (LM_ROLLOVER_1) && lamp_test (LM_ROLLOVER_2))
		{
			bonusx_add (1);
			lamplist_apply (LAMPLIST_ROLLOVERS, lamp_off);
			sound_send (SND_TADA);
			deff_data_init ();
			deff_data_push (bonusx);
			deff_start (DEFF_BONUSX);
			leff_start (LEFF_BONUSX);
		}
	}
}
Example #14
0
static inline void award_rollover_completed (void)
{
    bounded_increment (rollover_count, 99);
    score (SC_1M);
    /* Hack as I can't be bothered to fix the sw_right_inlane on my table */
    if (!lamp_test (LM_DEAD_END))
        lamp_on (LM_DEAD_END);
    /* Increment cameras_lit every 4 rollovers */
    if (rollover_count % 4 == 0)
        bounded_increment (cameras_lit, 99);
    /* Show animation */
    deff_start (DEFF_ROLLOVER_COMPLETED);
    /* Turn off inlane lamps */
    lamplist_apply (LAMPLIST_INLANES, lamp_off);
    lamplist_apply (LAMPLIST_INLANES, lamp_flash_on);
    task_sleep_sec (1);
    lamplist_apply (LAMPLIST_INLANES, lamp_flash_off);
}
Example #15
0
static inline bool kickback_enabled (void)
{
	return lamp_test (LM_KICKBACK_LOWER);
}