X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=main.c;h=233417e6d4802b25f623ed6a8877333256b8c8fc;hb=1e59d6b476a7f7f7b169a99e4918a4a2a1afb9cb;hp=b99eb22969bc27a929cceb3fdaaf5a8abcfb93e4;hpb=7a3f3ec7a6e28e8cb3e31d60893679922160e52c;p=open-adventure.git diff --git a/main.c b/main.c index b99eb22..233417e 100644 --- a/main.c +++ b/main.c @@ -1024,14 +1024,18 @@ L2600: L2607: game.foobar = (game.foobar > 0 ? -game.foobar : 0); ++game.turns; - if (game.turns == game.thresh) { - speak(turn_threshold_messages[game.trndex]); - game.trnluz = game.trnluz + TRNVAL[game.trndex] / 100000; - ++game.trndex; - game.thresh = -1; - if (game.trndex <= TRNVLS) - game.thresh = MOD(TRNVAL[game.trndex], 100000) + 1; - } + + /* If a turn threshold has been met, apply penalties and tell + * the player about it. */ + for (int i = turn_threshold_count; i >= 0; --i) + { + if (game.turns == turn_thresholds[i].threshold + 1) + { + game.trnluz += turn_thresholds[i].point_loss; + speak(turn_thresholds[i].message); + } + } + if (command.verb == SAY && WD2 > 0) command.verb = 0; if (command.verb == SAY) {