コード例 #1
0
 def probe(self, character, difficulty):
     """
     Character try to use a skill.
     """
     attribute = getattr(character, self.attribute)
     dice_roll = d20()
     total_result = attribute() + dice_roll
     return total_result >= difficulty
コード例 #2
0
 def probe(self, character, difficulty):
     """
     Character try to use a skill.
     """
     attribute = getattr(character, self.attribute)
     dice_roll = d20()
     total_result = attribute() + dice_roll
     return total_result >= difficulty
コード例 #3
0
 def test_d20(self):
     for _ in range(0, 100):
         r = d20()
         self.assertTrue(r <= 20)
         self.assertTrue(r >= 1)
コード例 #4
0
 def test_d20(self):
     for _ in range(0, 100):
         r = d20()
         self.assertTrue(r <= 20)
         self.assertTrue(r >= 1)