src/project-player.c
static void project_player_swap_stats(void)
{
    int max1, cur1, max2, cur2, ii, jj;

    msg("Your body starts to scramble...");

    /* Pick a pair of stats */
    ii = randint0(STAT_MAX);
    for (jj = ii; jj == ii; jj = randint0(STAT_MAX)) /* loop */;

    max1 = player->stat_max[ii];
    cur1 = player->stat_cur[ii];
    max2 = player->stat_max[jj];
    cur2 = player->stat_cur[jj];

    player->stat_max[ii] = max2;
    player->stat_cur[ii] = cur2;
    player->stat_max[jj] = max1;
    player->stat_cur[jj] = cur1;

    player->upkeep->update |= (PU_BONUS);

    return;
}
/**
 * Swap a random pair of stats
 */
Swap a random pair of stats
Swap a random pair of stats
static void project_player_swap_stats(void)
{
    int max1, cur1, max2, cur2, ii, jj;
    msg("Your body starts to scramble...");
    ii = randint0(STAT_MAX);
    for (jj = ii; jj == ii; jj = randint0(STAT_MAX)) ;
    max1 = player->stat_max[ii];
    cur1 = player->stat_cur[ii];
    max2 = player->stat_max[jj];
    cur2 = player->stat_cur[jj];
    player->stat_max[ii] = max2;
    player->stat_cur[ii] = cur2;
    player->stat_max[jj] = max1;
    player->stat_cur[jj] = cur1;
    player->upkeep->update |= (PU_BONUS);
    return;
}
static void project_player_swap_stats ( void ) { int max1 , cur1 , max2 , cur2 , ii , jj ; msg ( " " ) ; ii = randint0 ( STAT_MAX ) ; for ( jj = ii ; jj == ii ; jj = randint0 ( STAT_MAX ) ) ; max1 = player -> stat_max [ ii ] ; cur1 = player -> stat_cur [ ii ] ; max2 = player -> stat_max [ jj ] ; cur2 = player -> stat_cur [ jj ] ; player -> stat_max [ ii ] = max2 ; player -> stat_cur [ ii ] = cur2 ; player -> stat_max [ jj ] = max1 ; player -> stat_cur [ jj ] = cur1 ; player -> upkeep -> update |= ( PU_BONUS ) ; return ; }
Swap a random pair of stats
Swap a random pair of stats
/* Pick a pair of stats */ /* loop */