diff --git a/src/board.c b/src/board.c index 9d9ada4..d8ec920 100644 --- a/src/board.c +++ b/src/board.c @@ -86,14 +86,18 @@ static void board_exit(char* str) { static void board_stealCreds(char* str) { (void)str; + Pilot* p; + + p = pilot_get(player_target); if(board_credits == 0) { + // Can't steal from the poor. ;) player_message("The ship has no SCreds left"); return; } - // Calculate success - TODO: make this based on crew. - if(RNG(0, 100) < 50) { + // Calculate success. + if(RNG(0, 100) < (int)(50. * (double)p->ship->crew/(double)player->ship->crew)) { board_fail(); return; } @@ -109,10 +113,12 @@ static void board_fail(void) { Pilot* p; if(RNG(0, 2)==0) { + // 33% of instant death. p = pilot_get(player_target); p->armour = -1; player_message("You have tripped the ship's self destruct mechanism!"); } else + // You just got locked out!! player_message("The ship's security system locks you out!"); board_exit(NULL);