-
Notifications
You must be signed in to change notification settings - Fork 0
/
Skill_roll.py
42 lines (32 loc) · 1.5 KB
/
Skill_roll.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#skill test
def skillroll():
import random
n = int(input("Enter your skill value: "))
a = int(input("Enter the number of actions: "))
crit_msg = ("Gods turned their attention away for a moment...",
"You almost had it...almost",
"Always look on the bright side of...warp",
"Bring out yer dead!",
"Do you have spare characted sheet ready?",
"Dice do not like you I guess...",
"Try to bargain with Game Master...",
"Chaos gods unleashed their fury!")
for i in range(1, a+1):
roll = random.randint(01, 100)
if roll in range(96, 101) and n < roll:
print(
f"{i}. You rolled: {roll}. Critical failure! Test failed by: {roll - n}.That is {roll // n} of your skill. Voice of oracle: {random.sample(crit_msg, 1)}")
elif roll in range(1, 6) and n > roll:
print(
f"{i}. You rolled: {roll}. Wow! Critical success! Test beaten by {n - roll}. That is {n // roll} of your "
f"skill.")
elif roll <= n:
print(f"{i}. You rolled: {roll}. Sucess! Test beaten by {n - roll}. That is {n // roll} of your skill.")
elif roll > n:
print(f"{i}. You rolled: {roll}. Test failed by: {roll - n}. That is {roll // n} of your skill.")
again = input("Again? 'y' to continue ")
if again == "y":
skillroll()
else:
print("May the Sigmar guide you")
skillroll()