-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.rpy
486 lines (392 loc) · 15.8 KB
/
script.rpy
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
define turn = 0
define bet = 0
define T = Character("Teacher", image="teacher")
define S = Character("Student",image="student")
image Class = "Classroom.jpg"
label start:
show Class
pause
"On a Sunny Wednesday Afternoon, an AP Statistics class is faced with a formidable task …"
T sigh " Alright settle down class, as promised we'll be going over your new assignment for this unit!"
S three "Ooh, sir, will this be weighed the same as the test?"
T talk "Ah if you perform well, I might consider it..."
T talk "Anyhow, let me introduce you to (insert name of game show)"
S one "Finally, this looks really interesting!"
T talk "However, to enter the games, you must pay an upfront fee of 5 percent of your cumulative mark!"
S three "What!"
"I knew this game had more to do than just marks, there's gotta be a twist here..."
T talk "Keep in mind class, all these games revolve around probability, so if you play your odds right, you can end up with a higher mark!"
T talk "Assuming luck is on your side of course..."
scene Class
with fade
"The very next day …"
T talk "Welcome back class, I hope you all are ready for the first round of our very first (insert game show name)"
T talk "Our first game is one you all probably have heard of, Blackjack"
T talk "Blackjack in simple terms is a game where the objective is to receive a combination of playing cards that totals to 21"
T talk "A dealer will provide the players with cards, who have the option of requesting another randomly-drawn card (hit) or keeping their current cards(stand). Remember the players aren't competing against each other, but rather against the dealer"
T talk "Cards with numbers will have values of their number respectively. Face cards are all worth 10, and the Ace is worth either 1 or 11 depending on which favors you"
T talk "Now that the game has been explained, we can begin playing!"
T talk "Now of course, keep in mind class gambling is indeed illegal, so instead I will provide you with a fair chance of increasing your mark IF you win. If you lose, the opposite may occur."
"I wonder if that chance really is fair…"
S three "But sir! What if we get really unlucky! Won't that hurt our marks?"
T talk "You're right, perhaps I should have explained that better."
T talk "The way we will be playing Blackjack will be in groups of 4, with 5 different rounds"
T talk "To bet marks, you will be allowed to bet up to 3 marks per round, if you win, that mark will be added to your game total (how many marks you earned that game). If you lose, that same amount will be deducted from your game total"
T talk "For simplicity sake, I will be the dealer in each game."
T talk "Are you all ready to play? Keep in mind that you want to take the fundamental concepts of this unit in mind. If you have any questions feel free to ask me."
S three "Let's do this!"
scene Class
with fade
label round_1:
$ deck = [2,3,4,5,6,7,8,9,10,2,3,4,5,6,7,8,9,10,2,3,4,5,6,7,8,9,10,2,3,4,5,6,7,8,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10]
$ playerHand = []
$ dealerHand = []
$ earnings = 0
$ cardAmount=0
$ playerHand.append(renpy.random.choice(deck))
$ dealerHand.append(renpy.random.choice(deck))
$ dealerHand.append(renpy.random.choice(deck))
$ deck.remove(dealerHand[0])
$ deck.remove(dealerHand[1])
$ deck.remove(playerHand[0])
$ playerTotal = 0
$ playerTotal += playerHand[0]
$ cardAmount += 1
$ dealerTotal = 0
$ dealerTotal += dealerHand[0]
$ dealerTotal += dealerHand[1]
T talk "Before we begin playing, place your bet!"
menu:
"1":
$ bet += 1
"2":
$ bet +=2
"3":
$ bet +=3
T talk "Alright, let's begin, I'll start by dealing cards."
"Dealer has [dealerHand[0]] and X."
"You have [playerHand[0]]."
T talk "Would you like to Stay or Hit?"
menu:
"Hit":
$ playerHand.append(renpy.random.choice(deck))
$ playerTotal += playerHand[1]
$ cardAmount += 1
"Stay":
"your current card is [playerHand[0]]"
jump reveal_hand1
if playerTotal<21:
"Would you like to..."
menu:
"Hit":
$ value = renpy.random.choice(deck)
$ playerHand.append(value)
$ playerTotal += value
$ cardAmount += 1
"You got a [value]"
"Stay":
"Your total is [playerTotal]"
jump reveal_hand1
else:
jump reveal_hand1
label reveal_hand1:
T talk "Time to reveal the hands..."
"Dealer had [dealerHand[0]] and [dealerHand[1]]"
if cardAmount == 1:
"You have [playerHand[0]]."
elif cardAmount == 2:
"You have [playerHand[0]] and [playerHand[1]]."
elif cardAmount == 3:
"You have [playerHand[0]] and [playerHand[1]] and [playerHand[2]]."
elif cardAmount == 4:
"You have [playerHand[0]] and [playerHand[1]] and [playerHand[2]] and [playerHand[3]]."
if playerTotal > 21:
"You bust! The dealer won."
"You lost [bet]"
$ earnings -= bet
"Your winnings/losses so far is [earnings]"
jump round_2
elif playerTotal == 21:
"BlackJack! You Won!"
"You won [bet]"
$ earnings += bet
"Your winnings/losses so far is [earnings]"
jump round_2
if dealerTotal>playerTotal:
"The dealer won!"
"You lost [bet]"
$ earnings -= bet
"Your winnings/losses so far is [earnings]"
jump round_2
else:
"You won!"
$ bet *= 2
"You won [bet]"
$ earnings += bet
"Your winnings/losses so far is [earnings]"
jump round_2
label round_2:
$ playerHand2 = []
$ dealerHand2 = []
$ cardAmount2=0
$ playerHand2.append(renpy.random.choice(deck))
$ dealerHand2.append(renpy.random.choice(deck))
$ dealerHand2.append(renpy.random.choice(deck))
$ deck.remove(dealerHand2[0])
$ deck.remove(dealerHand2[1])
$ deck.remove(playerHand2[0])
$ playerTotal2 = 0
$ playerTotal2 += playerHand2[0]
$ cardAmount2 += 1
$ dealerTotal2 = 0
$ bet2 = 0
$ dealerTotal2 += dealerHand2[0]
$ dealerTotal2 += dealerHand2[1]
T talk "Let's begin round 2, place your bet!"
menu:
"1":
$ bet2 += 1
"2":
$ bet2 +=2
"3":
$ bet2 +=3
T talk "Alright, let's begin, I'll start by dealing cards."
"Dealer has [dealerHand2[0]] and X."
"You have [playerHand2[0]]."
T talk "Would you like to Stay or Hit?"
menu:
"Hit":
$ playerHand2.append(renpy.random.choice(deck))
$ playerTotal2 += playerHand2[1]
$ cardAmount2 += 1
"Stay":
"your current card is [playerHand2[0]]"
jump reveal_hand2
if playerTotal2<21:
"Would you like to..."
menu:
"Hit":
$ value2 = renpy.random.choice(deck)
$ playerHand2.append(value2)
$ playerTotal2 += value2
$ cardAmount2 += 1
"You got a [value2]"
"Stay":
"Your total is [playerTotal2]"
jump reveal_hand2
else:
jump reveal_hand2
label reveal_hand2:
T talk "Time to reveal the hands..."
"Dealer had [dealerHand2[0]] and [dealerHand2[1]]"
if cardAmount2 == 1:
"You have [playerHand2[0]]."
elif cardAmount2 == 2:
"You have [playerHand2[0]] and [playerHand2[1]]."
elif cardAmount2 == 3:
"You have [playerHand2[0]] and [playerHand2[1]] and [playerHand2[2]]."
elif cardAmount2 == 4:
"You have [playerHand2[0]] and [playerHand2[1]] and [playerHand2[2]] and [playerHand2[3]]."
if playerTotal2 > 21:
"You bust! The dealer won."
"You lost [bet2]"
$ earnings -= bet2
"Your winnings/losses so far is [earnings]"
jump round_2
elif playerTotal2 == 21:
"BlackJack! You Won!"
"You won [bet2]"
$ earnings += bet2
"Your winnings/losses so far is [earnings]"
jump round_3
if dealerTotal2>playerTotal2:
"The dealer won!"
"You lost [bet2]"
$ earnings -= bet2
"Your winnings/losses so far is [earnings]"
jump round_3
else:
"You won!"
$ bet *= 2
"You won [bet2]"
$ earnings += bet2
"Your winnings/losses so far is [earnings]"
jump round_3
label round_3:
$ playerHand3 = []
$ dealerHand3 = []
$ cardAmount3=0
$ playerHand3.append(renpy.random.choice(deck))
$ dealerHand3.append(renpy.random.choice(deck))
$ dealerHand3.append(renpy.random.choice(deck))
$ deck.remove(dealerHand3[0])
$ deck.remove(dealerHand3[1])
$ deck.remove(playerHand3[0])
$ playerTotal3 = 0
$ playerTotal3 += playerHand3[0]
$ cardAmount3 += 1
$ dealerTotal3 = 0
$ bet3 = 0
$ dealerTotal3 += dealerHand3[0]
$ dealerTotal3 += dealerHand3[1]
T talk "Let's begin the final round, place your bet!"
menu:
"1":
$ bet3 += 1
"2":
$ bet3 +=2
"3":
$ bet3 +=3
T talk "Alright, let's begin, I'll start by dealing cards."
"Dealer has [dealerHand3[0]] and X."
"You have [playerHand3[0]]."
T talk "Would you like to Stay or Hit?"
menu:
"Hit":
$ playerHand3.append(renpy.random.choice(deck))
$ playerTotal3 += playerHand3[1]
$ cardAmount3 += 1
"Stay":
"your current card is [playerHand3[0]]"
jump reveal_hand3
if playerTotal3<21:
"Would you like to..."
menu:
"Hit":
$ value3 = renpy.random.choice(deck)
$ playerHand3.append(value3)
$ playerTotal3 += value3
$ cardAmount3 += 1
"You got a [value3]"
"Stay":
"Your total is [playerTotal3]"
jump reveal_hand3
else:
jump reveal_hand3
label reveal_hand3:
T talk "Time to reveal the hands..."
"Dealer had [dealerHand3[0]] and [dealerHand3[1]]"
if cardAmount3 == 1:
"You have [playerHand3[0]]."
elif cardAmount3 == 2:
"You have [playerHand3[0]] and [playerHand3[1]]."
elif cardAmount3 == 3:
"You have [playerHand3[0]] and [playerHand3[1]] and [playerHand3[2]]."
elif cardAmount3 == 4:
"You have [playerHand3[0]] and [playerHand3[1]] and [playerHand3[2]] and [playerHand3[3]]."
if playerTotal3 > 21:
"You bust! The dealer won."
"You lost [bet3]"
$ earnings -= bet3
"Your winnings/losses so far is [earnings]"
jump transition1
elif playerTotal3 == 21:
"BlackJack! You Won!"
"You won [bet3]"
$ earnings += bet3
"Your winnings/losses so far is [earnings]"
jump transition1
if dealerTotal3>playerTotal3:
"The dealer won!"
"You lost [bet3]"
$ earnings -= bet3
"Your winnings/losses so far is [earnings]"
jump transition1
else:
"You won!"
$ bet3 *= 2
"You won [bet3]"
$ earnings += bet3
"Your winnings/losses so far is [earnings]"
jump transition1
label transition1:
jump rps_game1
label rps_game1:
scene Class
with fade
T talk "Alright class let's begin our second game, Rock, Paper, Scissors!"
T talk "I'm sure most of you are familiar with this game, so I will only briefly explain the rules"
T talk "In a best of 3, you challenge an opponent to a battle where you both display either rock, paper or scissors."
T talk "Rock beats scissors, scissors beats paper, and paper beats rock."
T talk "Like the last game I want to ensure that you all are using your probability mindset when playing, so you will bet in each round."
T talk "Without further ado, let's begin"
scene Class
with fade
$ rps = ['rock','paper','scissor']
$ beta = 0
$ count = 3
$ playerCount = 0
$ opponentCount = 0
T talk "Let's begin the first round, place your bet!"
menu:
"1":
$ beta +=1
"2":
$ beta +=2
"3":
$ beta +=3
T talk "I'll be your opponent for now. Let's go"
"You choose ..."
while count > 0:
if playerCount == 2:
jump rps_trans1
if opponentCount == 2:
jump rps_trans1
menu:
"Rock":
$ choice1 = renpy.random.choice(rps)
"Rock Paper Scissors shoot!"
"You choose Rock, while your opponent choose [choice1]."
if choice1 == 'scissor':
$ playerCount += 1
"Nice! You won this round"
"The score is [playerCount] for you and [opponentCount] for your opponent"
$ count -= 1
if choice1 == 'paper':
$ opponentCount += 1
"Oh no! You lost..."
"The score is [playerCount] for you and [opponentCount] for your opponent"
$ count -= 1
if choice1 == 'rock':
"That's awkward... It's a tie."
"The score is [playerCount] for you and [opponentCount] for your opponent"
"Paper":
$ choice2 = renpy.random.choice(rps)
"Rock Paper Scissors shoot!"
"You choose Paper, while your opponent choose [choice2]."
if choice2 == 'rock':
$ playerCount += 1
"Nice! You won this round"
"The score is [playerCount] for you and [opponentCount] for your opponent"
$ count -= 1
if choice2 == 'scissor':
$ opponentCount += 1
"Oh no! You lost..."
"The score is [playerCount] for you and [opponentCount] for your opponent"
$ count -= 1
if choice2 == 'paper':
"That's awkward... It's a tie."
"The score is [playerCount] for you and [opponentCount] for your opponent"
"Scissors":
$ choice3 = renpy.random.choice(rps)
"Rock Paper Scissors shoot!"
"You choose Scissors, while your opponent choose [choice3]."
if choice3 == 'paper':
$ playerCount += 1
"Nice! You won this round"
"The score is [playerCount] for you and [opponentCount] for your opponent"
$ count -= 1
if choice3 == 'rock':
$ opponentCount += 1
"Oh no! You lost..."
"The score is [playerCount] for you and [opponentCount] for your opponent"
$ count -= 1
if choice3 == 'scissor':
"That's awkward... It's a tie."
"The score is [playerCount] for you and [opponentCount] for your opponent"
jump rps_trans1
label rps_trans1:
"done"
#while loop?
return