X-Git-Url: https://git.ctpug.org.za/?a=blobdiff_plain;f=naja%2Fgameboard.py;h=fcad070a8f9f2be711a607fc5661b61d76148c55;hb=459169d622e79330b224d6733ced0d3dc04b1679;hp=ad692e716e8ee414371c72152f04ea0672233403;hpb=d8ba5bc439430a1a009b776c4f08673d45253815;p=naja.git diff --git a/naja/gameboard.py b/naja/gameboard.py index ad692e7..fcad070 100644 --- a/naja/gameboard.py +++ b/naja/gameboard.py @@ -361,7 +361,11 @@ class LocationCard(object): if replacement_params is None: return None else: - return random.randint(replacement_params[0], replacement_params[1]) + if replacement_params['chance'] > random.random(): + return random.randint(replacement_params['min'], + replacement_params['max']) + else: + return None def timer_action(self, position, board): if self.replacement_time is not None: