Question: we have to use python 3. Lucky Feat In many tabletop role playing games, dice are used to determine the outcome of situations that include

we have to use pythonwe have to use python 3. Lucky Feat In many tabletop role

3. Lucky Feat In many tabletop role playing games, dice are used to determine the outcome of situations that include a certain degree of randomness. For example, in Dungeons and Dragons a 20 sided die, also known as a D20, is typically used to check if a player's character succeeded in some action they are trying to perform, such as jumping a gap, playing an instrument, or trying to hide from an opponent. The dungeon master, or DM, who runs the game will set a difficulty check value, or DC value, which the player's roll (plus/minus certain modifier values) must equal or exceed for the player's character to succeed. Additionally, if the player rolls a 20, this is considered a critical success, whereas if the player rolls a 1, this is considered critical failure. Such special situations may result in further benefits or penalties being applied to the result of the action. For this lab, we consider the case of a player whose character is searching for a hidden door in a room by performing a perception check. The DM's DC value is 12, and the player adds +2 modifier to the value of their die roll due to how proficient their character is at searching. To help determine the outcome of this action, write a program named die Roll.py which should: Import the random module by entering import random", without quotes, at the beginning of the program Generate a random integer in the range of 1 to 20, inclusively, to represent the rolled die's value and store it in an appropriately named variable Using appropriately connected if, elif, else statements, determine the outcome of the action in the following way: o If the die's value is 20, the player rolled a critical success. An appropriate message should be output that the player's character found the hidden door and a pouch with 5 gold pieces inside Else if the die's value plus the modifier is greater than or equal to 12, the player succeeded. An appropriate message should be output that the player's character found the hidden door Else if the die's value plus the modifier is less than 12, the player failed. An appropriate message should be output that the player's character did not find the hidden door o Else if the die's value is 1, the player rolled a critical failure. An appropriate message should be output that the player's character did not find the hidden door and accidentally alerted the guards Make sure you save your die Roll.py as you will be submitting this file for Lab 03

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!