Пример #1
0
static void show_popups (void)
{
	/* We can't get our names on the playfield, but at least we can get our
	 * ugly mugs on the DMD :-)
	 */
	U8 p;
	/* 33% chance of happening */
	if (random_scaled (3) != 1)
		return;
	/* Scan through scores and do popups if qualified */
	for (p = 0; p < num_players; p++)
	{
		if (score_compare (score_table[SC_20M], scores[p]) == 1
			&& score_compare (scores[p], score_table[SC_10]) == 1)
		{
			show_bcd ();
			return;
		}
	}
	
	for (p = 0; p < num_players; p++)
	{
		if (score_compare (scores[p], score_table[SC_500M]) == 1)
		{
			show_sonny_jim ();
			return;
		}
	}

	//show_hydra();
}
Пример #2
0
CALLSET_ENTRY (jets, jet_hit)
{
//	task_recreate_gid (GID_JETS, jet_hit_task);
	//score_copy (temp_score, current_score);
	flasher_pulse (FLASH_RIGHT_HELMET);
	/* Make a sound, based on level */
	
	if (!free_timer_test (timer_jets_level_up))
		sound_send (jet_sounds[jets_level][jets_sound_index]);
	jets_sound_index++;
	if (jets_sound_index > 2)
		jets_sound_index = 0;
	
	if (timed_mode_running_p (&jets_frenzy_mode))
	{
		score (SC_500K);
	}
	else if (score_compare (total_jets_score, score_table[SC_500K]) >= 0)
	{
		timed_mode_begin (&jets_frenzy_mode);
		score (SC_500K);
		score_add (jets_frenzy_total, score_table[SC_500K]);

	}
	else
	{
		/* Score the hit, based on level */	
		score_add (total_jets_score, score_table[jets_hit_scores[jets_level]]);
		score_long (score_table[jets_hit_scores[jets_level]]);
		bounded_increment (jets_hit, 255);
		/* Level up if needed */
		if (jets_hit >= jets_needed[jets_level])
		{
			bounded_increment (jets_level, 4);
			score_long (score_table[jets_level_up_scores[jets_level]]);
			jets_hit = 0;
			free_timer_restart (timer_jets_level_up, TIME_2S);
			sound_send (SND_WHOOSH_UP_1);
		}
	
		if ((score_compare (total_jets_score, score_table[SC_250K]) >= 0) && !flag_test (FLAG_250K_JETS))
			callset_invoke (wheel_award_jets);
		deff_restart (DEFF_JET_HIT);
	}

}
Пример #3
0
CALLSET_ENTRY (jets, lamp_update)
{
	if (!timed_mode_running_p (&jets_frenzy_mode))
	{
		lamplist_apply (LAMPLIST_JETS_ENTER, lamp_off);
		
		if (score_compare (total_jets_score, score_table[SC_25K]) >= 0)
			lamp_on (LM_JETS_25K);
		if (score_compare (total_jets_score, score_table[SC_50K]) >= 0)
			lamp_on (LM_JETS_50K);
		if (score_compare (total_jets_score, score_table[SC_100K]) >= 0)
			lamp_on (LM_JETS_100K);
		if (score_compare (total_jets_score, score_table[SC_500K]) >= 0)
			lamp_on (LM_JETS_500K);
	}

}
Пример #4
0
long default_compare( int award, int p1, int p2 )
{
	long result;
	_score score_p1, score_p2;

	calculate_award_score( award, p1, &score_p1 );
	calculate_award_score( award, p2, &score_p2 );

	result = score_compare( score_p1, score_p2 );

	return result;
}
Пример #5
0
void award_output_awardname( int award )
{
	int p = player_index[ 0 ];
	_score final_award_score;
	_score current_highscore;

	calculate_award_score( AWARD_LIST[ award ].awardID, p, &final_award_score );
	get_highscore( AWARD_LIST[ award ].awardID, &current_highscore, global_highscores );

	if ( AWARD_LIST[ award ].keep_highscore ) {
		if ( score_compare( final_award_score, current_highscore ) > 0L ) {
			// there is a new highscore
			update_highscores( AWARD_LIST[ award ].awardID, p, final_award_score, global_highscores );
			sprintf( outbuf, HTML_AWARD_NAME_HIGHSCORE, AWARD_LIST[ award ].name );
		}
		else {
			sprintf( outbuf, HTML_AWARD_NAME, AWARD_LIST[ award ].name );
		}
	}
	else {
		sprintf( outbuf, HTML_AWARD_NAME, AWARD_LIST[ award ].name );
	}
	AS_OUT( OE_PLAIN, outbuf );
}
Пример #6
0
static int
score_compare_reverse (const void *a, const void *b)
{
  return score_compare (b, a);
}
Пример #7
0
void fixed_ladder_score_multiple (const struct fixed_ladder *ladder, U8 multiplier)
{
	score_long_multiple (ladder->current, multiplier);
	if (score_compare (ladder->current, ladder->max) == -1)
		score_add (ladder->current, ladder->increment);
}
Пример #8
0
void super_jackpot_value_deff (void)
{
	seg_alloc_clean ();
	seg_write_row_center (0, "SUPER JACKPOT");
	seg_write_row_center (1, "VALUE");
	seg_show ();
	task_sleep_sec (1);
	
	if (total_body_parts > 0)
	{
		score_zero (super_jackpot_calc);
		score_add (super_jackpot_calc, score_table[SC_50K]);
		score_mul (super_jackpot_calc, total_body_parts);

		seg_alloc_clean ();
		psprintf ("1 BODY PART", "%d BODY PARTS", total_body_parts);
		seg_write_row_center (0, sprintf_buffer);
		sprintf_score (super_jackpot_calc);
		seg_write_row_center (1, sprintf_buffer);
		seg_show ();
		task_sleep_sec (1);
	}

	score_zero (super_jackpot_calc);
	switch (mpf_level)
	{
		case 0:
			score_add (super_jackpot_calc, score_table[SC_100K]);
			break;
		case 1:
			score_add (super_jackpot_calc, score_table[SC_200K]);
			break;
		case 2:
			score_add (super_jackpot_calc, score_table[SC_300K]);
			break;
		case 3:
			score_add (super_jackpot_calc, score_table[SC_500K]);
			break;
		default:
			break;
	}
	seg_alloc_clean ();
	sprintf ("MPF LEVEL");
	seg_write_row_center (0, sprintf_buffer);
	sprintf_score (super_jackpot_calc);
	seg_write_row_center (1, sprintf_buffer);
	seg_show ();
	task_sleep_sec (1);
	


	score_zero (super_jackpot_calc);
	switch (rightramp_level)
	{
		case 0:
			score_add (super_jackpot_calc, score_table[SC_50K]);
			break;
		case 1:
			score_add (super_jackpot_calc, score_table[SC_100K]);
			break;
		case 2:
			score_add (super_jackpot_calc, score_table[SC_500K]);
			break;
		case 3:
			score_add (super_jackpot_calc, score_table[SC_1M]);
			break;
		default:
			break;
	}
	seg_alloc_clean ();
	sprintf ("RIGHT RAMP");
	seg_write_row_center (0, sprintf_buffer);
	sprintf_score (super_jackpot_calc);
	seg_write_row_center (1, sprintf_buffer);
	seg_show ();
	task_sleep_sec (1);
	
	score_zero (super_jackpot_calc);
	if (score_compare (total_jets_score, score_table[SC_500K]) >= 0)
		score_add (super_jackpot_calc, score_table[SC_500K]);
	else if (score_compare (total_jets_score, score_table[SC_100K]) >= 0)
		score_add (super_jackpot_calc, score_table[SC_100K]);
	else if (score_compare (total_jets_score, score_table[SC_50K]) >= 0)
		score_add (super_jackpot_calc, score_table[SC_50K]);
	else if (score_compare (total_jets_score, score_table[SC_25K]) >= 0)
		score_add (super_jackpot_calc, score_table[SC_25K]);
	
	seg_alloc_clean ();
	sprintf ("JETS");
	seg_write_row_center (0, sprintf_buffer);
	sprintf_score (super_jackpot_calc);
	seg_write_row_center (1, sprintf_buffer);
	seg_show ();
	task_sleep_sec (1);
	
	score_zero (super_jackpot_calc);
	switch (left_loop_level)
	{
		case 0:
			score_add (super_jackpot_calc, score_table[SC_25K]);
			break;
		case 1:
			score_add (super_jackpot_calc, score_table[SC_50K]);
			break;
		case 2:
			score_add (super_jackpot_calc, score_table[SC_100K]);
			break;
		case 3:
			score_add (super_jackpot_calc, score_table[SC_500K]);
			break;
		default:
			break;
	}
	
	seg_alloc_clean ();
	sprintf ("LEFT LOOP");
	seg_write_row_center (0, sprintf_buffer);
	sprintf_score (super_jackpot_calc);
	seg_write_row_center (1, sprintf_buffer);
	seg_show ();
	task_sleep_sec (1);
	
	score_zero (super_jackpot_calc);
	switch (right_loop_level)
	{
		case 0:
			score_add (super_jackpot_calc, score_table[SC_25K]);
			break;
		case 1:
			score_add (super_jackpot_calc, score_table[SC_50K]);
			break;
		case 2:
			score_add (super_jackpot_calc, score_table[SC_100K]);
			break;
		case 3:
			score_add (super_jackpot_calc, score_table[SC_500K]);
			break;
		default:
			break;
	}
	seg_alloc_clean ();
	sprintf ("RIGHT LOOP");
	seg_write_row_center (0, sprintf_buffer);
	sprintf_score (super_jackpot_calc);
	seg_write_row_center (1, sprintf_buffer);
	seg_show ();
	task_sleep_sec (1);
	
	deff_exit ();
}
Пример #9
0
static void calculate_super_jackpot_value (void)
{
	score_zero (super_jackpot_value);

	

	if (total_body_parts > 0)
	{
		score_add (super_jackpot_value, score_table[SC_50K]);
		score_mul (super_jackpot_value, total_body_parts);
	}

	switch (mpf_level)
	{
		case 0:
			score_add (super_jackpot_value, score_table[SC_100K]);
			break;
		case 1:
			score_add (super_jackpot_value, score_table[SC_200K]);
			break;
		case 2:
			score_add (super_jackpot_value, score_table[SC_300K]);
			break;
		case 3:
			score_add (super_jackpot_value, score_table[SC_500K]);
			break;
		default:
			break;
	}
	
	switch (rightramp_level)
	{
		case 0:
			score_add (super_jackpot_value, score_table[SC_50K]);
			break;
		case 1:
			score_add (super_jackpot_value, score_table[SC_100K]);
			break;
		case 2:
			score_add (super_jackpot_value, score_table[SC_500K]);
			break;
		case 3:
			score_add (super_jackpot_value, score_table[SC_1M]);
			break;
		default:
			break;
	}

	if (score_compare (total_jets_score, score_table[SC_500K]) >= 0)
		score_add (super_jackpot_value, score_table[SC_500K]);
	else if (score_compare (total_jets_score, score_table[SC_100K]) >= 0)
		score_add (super_jackpot_value, score_table[SC_100K]);
	else if (score_compare (total_jets_score, score_table[SC_50K]) >= 0)
		score_add (super_jackpot_value, score_table[SC_50K]);
	else if (score_compare (total_jets_score, score_table[SC_25K]) >= 0)
		score_add (super_jackpot_value, score_table[SC_25K]);
	
	switch (left_loop_level)
	{
		case 0:
			score_add (super_jackpot_value, score_table[SC_25K]);
			break;
		case 1:
			score_add (super_jackpot_value, score_table[SC_50K]);
			break;
		case 2:
			score_add (super_jackpot_value, score_table[SC_100K]);
			break;
		case 3:
			score_add (super_jackpot_value, score_table[SC_500K]);
			break;
		default:
			break;
	}

	switch (right_loop_level)
	{
		case 0:
			score_add (super_jackpot_value, score_table[SC_25K]);
			break;
		case 1:
			score_add (super_jackpot_value, score_table[SC_50K]);
			break;
		case 2:
			score_add (super_jackpot_value, score_table[SC_100K]);
			break;
		case 3:
			score_add (super_jackpot_value, score_table[SC_500K]);
			break;
		default:
			break;
	}


}
Пример #10
0
void hurryup_update (void)
{
	score_sub (hurryup_value, score_table[SC_17530]);
	if (score_compare (hurryup_value, score_table[SC_250K]) == -1)
		score_copy (hurryup_value, score_table[SC_250K]);
}