Пример #1
0
CALLSET_ENTRY (kickback, start_ball)
{
	if (kickback_enabled ())
	{
		kickback_enable ();
	}
	else
	{
		kickback_disable ();
	}
}
Пример #2
0
CALLSET_ENTRY (kickback, sw_kickback)
{
	if (kickback_enabled ())
	{
		sound_start (ST_SAMPLE, SND_WHISTLE, SL_2S, PRI_GAME_QUICK3);
		task_recreate_gid (GID_KICKBACK_FINISH, kickback_finish);
	}
	else
	{
		callset_invoke (sw_left_outlane);
	}
}
Пример #3
0
void determine_allowable_pitstop_awards(void) {
    memset(allowable_pitstop_awards, 1, sizeof (allowable_pitstop_awards));
    memset(selected_pitstop_awards, DISABLED_AWARD, sizeof(selected_pitstop_awards));

    if (in_live_game) {
        if (have_collected_all_cars()) {
            allowable_pitstop_awards[AWARD_CAR] = FALSE;
        }

        // TODO if bonus multiplier is already 8x disallow it
        // TODO if lock is already lit, disallow it.

        if (global_flag_test(GLOBAL_FLAG_DRAGRACE_ENABLED)) {
            allowable_pitstop_awards[AWARD_LITE_DRAGRACE] = FALSE;
        }

        if (!can_award_extra_ball()) {
            allowable_pitstop_awards[AWARD_EXTRA_BALL] = FALSE;
        }

        if (!zr1_mb_can_award_lite_lock()) {
            allowable_pitstop_awards[AWARD_LITE_LOCK] = FALSE;
        }

        if (kickback_enabled()) {
            allowable_pitstop_awards[AWARD_LITE_KICKBACK] = FALSE;
        }

        // TODO if we've still got more than PITSTOP_AWARD_ITEMS allowable then disable the last awarded thing
    }

#ifdef DEBUG_PITSTOP_AWARD
    for (pitstop_award = 0; pitstop_award < PITSTOP_AWARD_COUNT; pitstop_award++) {
        dbprintf("award: %s (%d) is %s\n",
                 pitstop_award_options_titles[pitstop_award],
                 pitstop_award,
                 allowable_pitstop_awards[pitstop_award] ? "ALLOWED" : "DISABLED"
                );
    }
#endif

    // select 4 random items from the list
    U8 pitstop_awards_selected;

#ifdef DEBUG_PITSTOP_AWARD
    dbprintf("choosing %d random items\n", PITSTOP_AWARD_ITEMS);
#endif

    for (pitstop_awards_selected = 0; pitstop_awards_selected < PITSTOP_AWARD_ITEMS; pitstop_awards_selected++) {
        do {
            pitstop_award = random_scaled(PITSTOP_AWARD_COUNT);
#ifdef DEBUG_PITSTOP_AWARD
            dbprintf("random (1): %d\n", pitstop_award);
#endif
        } while (allowable_pitstop_awards[pitstop_award] == FALSE || have_already_selected_possible_award(pitstop_award));
        selected_pitstop_awards[pitstop_awards_selected] = pitstop_award;
#ifdef DEBUG_PITSTOP_AWARD
        dbprintf("selected award: %s (%d)\n", pitstop_award_options_titles[pitstop_award], pitstop_award);
#endif
    }
}