/** Like above, but the global score multiplier is in effect and an additional multiplier can be specified too. */ void score_long_multiple (const score_t score, U8 multiplier) { score_copy (last_score, score); last_multiplier = multiplier; score_mul (last_score, multiplier); score_mul (last_score, global_score_multiplier); score_award (last_score); }
/** Multiply a score (in place) by the given integer. * Zero is not supported, as it should never be called this * way. */ void score_mul (score_t s, U8 multiplier) { /* If multiplier is 1, nothing needs to be done. */ if (multiplier > 1) { /* Otherwise, we need to perform 'multiplier-1' * additions of the value into itself. This is * not the most elegant way, but multiplications * are not common, and the multipliers are often * going to be small. */ score_t copy; score_copy (copy, s); do { score_add (s, copy); } while (--multiplier > 1); } }
void fixed_ladder_reset (const struct fixed_ladder *ladder) { score_copy (ladder->current, ladder->base); }
/** Called by the display effect module when starting an effect which wants to display the last score (it has the D_SCORE flag). The score is saved to separate storage so that future scores do not clobber it. */ void score_deff_set (void) { score_copy (deff_score, last_score); deff_multiplier = last_multiplier; }
/** The first of three general scoring APIs. score_long_multiplied adds to the current player's score without applying *any* multipliers. */ void score_long_unmultiplied (const score_t score) { score_copy (last_score, score); last_multiplier = 1; score_award (last_score); }
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]); }