Esempio n. 1
0
 def test_set_illness(self):
     turn_state = TurnState()
     turn_state.injured = True
     self.assertTrue(turn_state.injured)
     turn_state.injured = False
     self.assertFalse(turn_state.injured)
Esempio n. 2
0
        inventory.zeroize_negative_values()

        # Resolve health issues from the previous turn
        if turn.illness or turn.injured:
            inventory.spend(20)
            if inventory.money < 0:
                print("YOU CAN'T AFFORD A DOCTOR")
                if turn.illness:
                    print("YOU DIED OF PNEUMONIA")
                elif turn.injured:
                    print("YOU DIED OF INJURIES")
                dying()
            else:
                print("DOCTOR'S BILL IS $20")
                turn.illness = False
                turn.injured = False

        # Show inventory status and mileage
        inventory.print_warnings()
        tracker.print_mileage()

        # Ask for turn options
        inventory.print_inventory()
        turn_response = ask_numeric("DO YOU WANT TO (1) STOP AT THE NEXT FORT, (2) HUNT, \nOR (3) CONTINUE", 1, 3)
        if turn_response == 1:
            next_fort(inventory, tracker)
        elif turn_response == 2:
            hunt(inventory, tracker)

        # Eating
        if inventory.food.value < 13: