forked from Python3-Training/PyTrek
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathQuips.py
123 lines (110 loc) · 3.36 KB
/
Quips.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
import random
DAMAGE_PREFIX = [
"The main ",
"That @#$#@& ",
"Our cheap ",
"Darn-it captain, that ",
"Yikes, the ",
]
DAMAGE_SUFFIX = [
" has died. We're on it!",
" is out. We're working on it!",
" is almost repaired!",
" is dead.",
" is fried. Working as fast as we can!",
" is toast. Working as fast as I can!",
" is being replaced.",
" is dead. Please leave a message.",
]
DEFEAT_PREFIX = [
"A defeated ",
"The vengeful ",
"An angry ",
"The ejecting ",
"A confused ",
"Another ",
"Yet another ",
]
DEFEAT_SUFFIX = [
" says: `I'll be back!`",
" cries: ... 'a lucky shot!'",
" sighs bitterly.",
" dies.",
" is rescued.",
" is history.",
" is no more.",
" is recycled.",
" is eliminated.",
" was aborted. Few lives, matter?",
" ejects.",
" crew is rescued.",
" crew is spaced.",
" crew is recycled.",
" crew is recovered.",
" yells: 'thy mother mates poorly!'",
" snarls: 'lucky shot.'",
" laughs: 'you'll not do THAT again!'",
" says nothing.",
" screams: 'thy father is a Targ!'",
" yells: 'thine family eats bats!'",
" snarls: 'thine people eat vermin!'",
" curses: 'thy fathers spreadeth pox!'",
" yells: 'thy mother is progressive!'",
]
MISTAKES = [
"... the crew was not impressed ...",
"... that's going to leave a mark ...",
"... next time carry the 1?",
"... math lives matter ...",
"... its coming out of your pay ...",
"... this is not a bumper car ...",
"... life can be tough that way ...",
"... who ordered THAT take-out?",
"... random is, what random does ...",
"... you've got their attention ...",
"... next time, just text them?",
"... how rude!",
"... yes, karma CAN hurt ...",
"... life is but a dream!",
"... game over.",
"... starfleet will talk about this for years.",
"... who is going to pay for that?",
"... galactic insurance premiums skyrocket ...",
"... captain goes down with the starship ...",
"... we'll notify your next-of-kin.",
"... that was not in the script ...",
"... you never did THAT in the simulator ...",
]
QUITS = [
"-Let's call it a draw?",
"-You call yourself a 'Trekkie?",
"Kobayashi Maru. Python for you?",
"(Spock shakes his head)",
"(Duras, stop laughing!)",
"(... and the Klingons rejoice)",
"(... and our enemies, rejoice)",
"Kobayashi Maru... Got Python?",
"(Kirk shakes his head)",
]
class Quips():
@staticmethod
def jibe(noun, prefix, suffix):
prand = random.randrange(0, len(prefix))
srand = random.randrange(0, len(suffix))
return prefix[prand] + noun + suffix[srand]
@staticmethod
def jibe_quit():
return QUITS[random.randrange(0, len(QUITS))]
@staticmethod
def jibe_damage(noun):
if random.randrange(0, 100) > 25:
return f"{noun.capitalize()} damaged. Repairs are underway."
return Quips.jibe(noun, DAMAGE_PREFIX, DAMAGE_SUFFIX)
@staticmethod
def jibe_defeat(noun):
if random.randrange(0, 100) > 25:
return f"Another {noun.lower()} defeated."
return Quips.jibe(noun, DEFEAT_PREFIX, DEFEAT_SUFFIX)
@staticmethod
def jibe_fatal_mistake():
return MISTAKES[random.randrange(0, len(MISTAKES))]