diff --git a/src/board.c b/src/board.c index 3888827..529aa99 100644 --- a/src/board.c +++ b/src/board.c @@ -168,17 +168,18 @@ static int board_fail(unsigned int wdw) { p = pilot_get(player->target); /* Fail chance. */ - if(RNG(0, 100) > (int)(50. * - (10. + (double)p->ship->crew/10.+(double)player->ship->crew))) + if(RNGF() > (0.5 * + (10. + (double)p->ship->crew/10.+(double)player->ship->crew))) return 0; - if(RNG(0, 2)==0) { + if(RNGF() < 0.4) { /* 40% of instadeath! */ /* 33% of instant death. */ 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!"); + player_message("The ship's security system locks %s out!", + (player->ship->crew > 0) ? "your crew" : "you"); board_exit(wdw, NULL); return 1;