-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtavern.html
More file actions
751 lines (695 loc) · 24.1 KB
/
Copy pathtavern.html
File metadata and controls
751 lines (695 loc) · 24.1 KB
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
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>The Pickled Piglet</title>
<link
href="https://fonts.googleapis.com/css2?family=Almendra&family=Cinzel:wght@400;700&display=swap"
rel="stylesheet"
>
<link rel="icon" href="favicon.ico" type="image/x-icon">
<style>
/* General Page Styling */
body {
margin: 0;
background: url('resources/tavern.png') no-repeat center center fixed;
background-size: cover;
color: #FAF4E0;
font-family: 'Almendra', serif;
text-align: center;
}
.container {
max-width: 800px;
margin: 2rem auto;
background: rgba(0, 0, 0, 0.7);
padding: 2rem;
border-radius: 10px;
}
h1, h2 {
font-family: 'Cinzel', serif;
}
.faction-section {
margin-bottom: 2rem;
border: 2px solid #660000;
border-radius: 8px;
padding: 1rem;
background: rgba(255, 255, 255, 0.1);
}
.faction-header {
display: flex;
flex-direction: column;
align-items: center;
margin-bottom: 1rem;
}
/* Vertical Banner */
.faction-banner {
width: 120px; /* vertical banner style */
height: auto;
border: 2px solid #8B0000;
border-radius: 4px;
margin-bottom: 1rem;
}
/* Removed the faction-portrait images per your request */
.faction-content {
text-align: left;
margin: 0.5rem 1rem;
}
table {
width: 100%;
border-collapse: collapse;
margin-top: 1rem;
background: rgba(255, 255, 255, 0.1);
border-radius: 10px;
}
th, td {
border: 1px solid #8B0000;
padding: 0.5rem;
text-align: center;
}
th {
background: #8B0000;
color: #FAF4E0;
font-family: 'Cinzel', serif;
}
.divider {
margin: 1rem auto;
font-size: 1.5rem;
}
.divider::after {
content: "✦ ✧ ✦";
color: #8B0000;
letter-spacing: 0.5rem;
}
/* Buttons */
.action-button {
background: #8B0000;
color: #FAF4E0;
border: 1px solid #660000;
padding: 0.3rem 0.6rem;
border-radius: 4px;
cursor: pointer;
font-family: 'Cinzel', serif;
margin: 0.2rem;
}
.action-button:hover {
background: #660000;
}
.home-button {
background: #8B0000;
color: #FAF4E0;
border: 1px solid #660000;
padding: 0.5rem 1rem;
border-radius: 5px;
cursor: pointer;
font-family: 'Cinzel', serif;
display: inline-block;
margin-top: 1rem;
text-decoration: none;
}
.home-button:hover {
background: #660000;
}
/* Modal Styling */
#modalOverlay {
display: none;
position: fixed;
z-index: 999;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: rgba(0,0,0,0.8); /* black overlay */
}
.modal-content {
background-color: #2a2a2a;
margin: 10% auto;
padding: 1rem;
border: 2px solid #660000;
max-width: 500px;
border-radius: 10px;
position: relative;
text-align: left;
}
.close-button {
background: #8B0000;
border: 1px solid #660000;
color: #FAF4E0;
padding: 0.3rem 0.6rem;
cursor: pointer;
font-family: 'Cinzel', serif;
position: absolute;
top: 1rem;
right: 1rem;
border-radius: 4px;
}
.close-button:hover {
background: #660000;
}
.modal-content label {
display: block;
margin-bottom: 0.5rem;
font-family: 'Cinzel', serif;
}
.modal-content input {
width: 100%;
padding: 0.4rem;
margin-bottom: 0.8rem;
box-sizing: border-box;
font-family: 'Almendra', serif;
}
@media (max-width: 600px) {
table {
font-size: 0.9rem;
}
th, td {
padding: 0.3rem;
}
}
</style>
</head>
<body>
<div class="container">
<h1>The Pickled Piglet</h1>
<p>Order a drink, chat up fellow patrons, or attempt more… discreet dealings.<br>
<br>
Or take a swig of "juice" from the jar and see what happens.
</p>
<div class="divider"></div>
<!-- Zhilan Triads -->
<div class="faction-section">
<div class="faction-header">
<img
src="resources/zhilantriadsbanner.png"
alt="Zhilan Triads Banner"
class="faction-banner"
>
<h2>Zhilan Triads</h2>
</div>
<div class="faction-content">
<p><strong>Notes:</strong> Mysterious, tradition-bound criminals from Little Zhi-La in Azure.</p>
</div>
<h3>Notable Patrons</h3>
<table>
<thead>
<tr>
<th>Name</th>
<th>Role</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<tr>
<td>Jin Hua</td>
<td>Matriarch of the Triads</td>
<td>
<button class="action-button" onclick="buyDrink('jinHua')">Buy Drink</button>
<button class="action-button" onclick="openBribeModal('jinHua')">Bribe</button>
<button class="action-button" onclick="attemptAudience('jinHua')">Request Audience</button>
</td>
</tr>
<tr>
<td>Han Mei</td>
<td>Crimson Lantern Enforcer</td>
<td>
<button class="action-button" onclick="buyDrink('hanMei')">Buy Drink</button>
<button class="action-button" onclick="openBribeModal('hanMei')">Bribe</button>
<button class="action-button" onclick="attemptAudience('hanMei')">Request Audience</button>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Xondaran Syndicate -->
<div class="faction-section">
<div class="faction-header">
<img
src="resources/xondaransyndicate.png"
alt="Xondaran Syndicate Banner"
class="faction-banner"
>
<h2>Xondaran Syndicate</h2>
</div>
<div class="faction-content">
<p><strong>Notes:</strong> Wealthy and influential Xondaran council members controlling Azure’s docks.</p>
</div>
<h3>Notable Patrons</h3>
<table>
<thead>
<tr>
<th>Name</th>
<th>Role</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<tr>
<td>Sayyid Kashim</td>
<td>Majlis Councilman</td>
<td>
<button class="action-button" onclick="buyDrink('sayyidKashim')">Buy Drink</button>
<button class="action-button" onclick="openBribeModal('sayyidKashim')">Bribe</button>
<button class="action-button" onclick="attemptAudience('sayyidKashim')">Request Audience</button>
</td>
</tr>
<tr>
<td>Basira Azzam</td>
<td>Rahib Overseer</td>
<td>
<button class="action-button" onclick="buyDrink('basiraAzzam')">Buy Drink</button>
<button class="action-button" onclick="openBribeModal('basiraAzzam')">Bribe</button>
<button class="action-button" onclick="attemptAudience('basiraAzzam')">Request Audience</button>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Blackjacks -->
<div class="faction-section">
<div class="faction-header">
<img
src="resources/blackjacks.png"
alt="Blackjacks Banner"
class="faction-banner"
>
<h2>The Blackjacks</h2>
</div>
<div class="faction-content">
<p><strong>Notes:</strong> Ragtag gang of ruffians and hustlers who rule the lower districts through swagger and intimidation.</p>
</div>
<h3>Notable Patrons</h3>
<table>
<thead>
<tr>
<th>Name</th>
<th>Role</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<tr>
<td>The Jack</td>
<td>Leader of the Blackjacks</td>
<td>
<button class="action-button" onclick="buyDrink('theJack')">Buy Drink</button>
<button class="action-button" onclick="openBribeModal('theJack')">Bribe</button>
<button class="action-button" onclick="attemptAudience('theJack')">Request Audience</button>
</td>
</tr>
<tr>
<td>Rosette Quickstep</td>
<td>Henchwoman</td>
<td>
<button class="action-button" onclick="buyDrink('rosette')">Buy Drink</button>
<button class="action-button" onclick="openBribeModal('rosette')">Bribe</button>
<button class="action-button" onclick="attemptAudience('rosette')">Request Audience</button>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Scarlet Swallows -->
<div class="faction-section">
<div class="faction-header">
<img
src="resources/scarletswallowsbanner.png"
alt="Scarlet Swallows Banner"
class="faction-banner"
>
<h2>The Scarlet Swallows</h2>
</div>
<div class="faction-content">
<p><strong>Notes:</strong> A tightly-run network of pleasure houses and intelligence gathering, ruled by the enigmatic Madame.</p>
</div>
<h3>Notable Patrons</h3>
<table>
<thead>
<tr>
<th>Name</th>
<th>Role</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<tr>
<td>The Madame</td>
<td>Leader of the Scarlet Swallows</td>
<td>
<button class="action-button" onclick="buyDrink('theMadame')">Buy Drink</button>
<button class="action-button" onclick="openBribeModal('theMadame')">Bribe</button>
<button class="action-button" onclick="attemptAudience('theMadame')">Request Audience</button>
</td>
</tr>
<tr>
<td>Karma Nightingale</td>
<td>Swallow Operative</td>
<td>
<button class="action-button" onclick="buyDrink('karma')">Buy Drink</button>
<button class="action-button" onclick="openBribeModal('karma')">Bribe</button>
<button class="action-button" onclick="attemptAudience('karma')">Request Audience</button>
</td>
</tr>
</tbody>
</table>
</div>
<!-- End of Factions -->
<!-- "End Day" button resets all drink-likes -->
<button class="action-button" onclick="endDay()">Call it a Night (Reset Day)</button>
<br>
<!-- HOME BUTTON AT THE BOTTOM -->
<a href="caldwell-repo.html" class="home-button">Home</a>
</div>
<!-- Modal Overlay -->
<div id="modalOverlay">
<div class="modal-content">
<button class="close-button" onclick="closeModal()">Close</button>
<h2 id="modalTitle"></h2>
<p id="modalDialogue"></p>
<!-- Bribe input only shows up if type === 'bribe' -->
<div id="bribeSection" style="display:none;">
<label for="bribeAmount">Bribe Amount (GP):</label>
<input type="number" id="bribeAmount" min="0" value="0" />
<p id="bribeResult"></p>
<button class="action-button" onclick="submitBribe()">Offer Bribe</button>
</div>
</div>
</div>
<script>
/*
Each representative has:
- name: Display name
- minBribe, maxBribe: random threshold range
- bribeSuccessChance: chance of success after crossing threshold
- audienceChance: chance the user gets an audience
- favorLines: random lines on bribe success
- drinkLines: random lines on "Buy Drink"
- like: how much they like you (resets each day)
- drinksCount: how many drinks have been bought for them (resets each day)
- drinksToLeave: random threshold that triggers them leaving after being plied with enough booze
*/
const REP_DATA = {
jinHua: {
name: "Jin Hua",
minBribe: 50,
maxBribe: 150,
bribeSuccessChance: 0.70,
audienceChance: 0.20,
favorLines: [
"She grants you a quiet introduction to the Jade Council.",
"The Crimson Lanterns look the other way when you pass.",
"Her soft-spoken word ensures a silent trade route in Little Zhi-La."
],
drinkLines: [
`"Ah, a gesture of respect? Very well. I shall drink to our mutual benefit."`,
`"Your generosity is noted. Perhaps you are wiser than the others who come seeking favours."`
],
like: 0,
drinksCount: 0,
drinksToLeave: getRandomInt(10, 20)
},
hanMei: {
name: "Han Mei",
minBribe: 30,
maxBribe: 80,
bribeSuccessChance: 0.80,
audienceChance: 0.33,
favorLines: [
"Han Mei arranges a discreet escort through Little Zhi-La's back alleys.",
"Your rival’s debt suddenly doubles overnight, courtesy of the Crimson Lanterns.",
"The collector’s hand stays on your coin purse—for now."
],
drinkLines: [
`"Hmph. You must be braver than most to buy me a drink. Fine. I'll hear you out."`,
`"You’ve found the quick route to my heart: good spirits and no questions."`
],
like: 0,
drinksCount: 0,
drinksToLeave: getRandomInt(10, 20)
},
sayyidKashim: {
name: "Sayyid Kashim",
minBribe: 40,
maxBribe: 120,
bribeSuccessChance: 0.75,
audienceChance: 0.25,
favorLines: [
"He arranges for your goods to pass the harbour uninspected.",
"A swift 'recommendation' puts you on the Majlis’s good side—for now.",
"Your name is quietly added to a private guest list at a lavish Xondaran feast."
],
drinkLines: [
`"A thousand blessings upon you for this kind offering. We shall drink to prosperity."`,
`"You know the ways of hospitality, friend. In Xondar, generosity is always repaid—somehow."`
],
like: 0,
drinksCount: 0,
drinksToLeave: getRandomInt(10, 20)
},
basiraAzzam: {
name: "Basira Azzam",
minBribe: 25,
maxBribe: 90,
bribeSuccessChance: 0.80,
audienceChance: 0.33,
favorLines: [
"She ensures the Al-Adwa give you a wide berth on the docks.",
"A valuable 'accident' befalls a competitor’s ship, courtesy of her oversight.",
"She whispers a name to the Rahib, halting an inconvenient investigation into your affairs."
],
drinkLines: [
`"So you know how to loosen tongues with a drink? Clever. Let us talk, friend."`,
`"I rarely accept freebies, but you seem sincere enough. Cheers to that."`
],
like: 0,
drinksCount: 0,
drinksToLeave: getRandomInt(10, 20)
},
theJack: {
name: "The Jack",
minBribe: 30,
maxBribe: 100,
bribeSuccessChance: 0.65,
audienceChance: 0.40,
favorLines: [
"The Jack's gang keeps a respectful distance from your business for a week.",
"A 'friendly brawl' claims the valuables of your rival in the next alley over.",
"He organizes a lively diversion while you slip away with your loot."
],
drinkLines: [
`"Ha! Another fool who thinks I'll dance for a drop of ale? Well, I'm listening..."`,
`"A free drink is the best kind. Keep 'em coming and I might start liking your face."`
],
like: 0,
drinksCount: 0,
drinksToLeave: getRandomInt(10, 20)
},
rosette: {
name: "Rosette Quickstep",
minBribe: 20,
maxBribe: 70,
bribeSuccessChance: 0.85,
audienceChance: 0.33,
favorLines: [
"She arranges a small team of pickpockets to 'liberate' your target’s purse.",
"A local tavern-keeper 'forgets' your bar tab in gratitude—on her instruction.",
"She ensures the city guard chases a decoy while you slip away."
],
drinkLines: [
`"You trying to butter me up, sugar? Fine, I'll sip to that."`,
`"A drink? I'd be a fool to say no. Let’s see how interesting you can be."`
],
like: 0,
drinksCount: 0,
drinksToLeave: getRandomInt(10, 20)
},
theMadame: {
name: "The Madame",
minBribe: 60,
maxBribe: 150,
bribeSuccessChance: 0.75,
audienceChance: 0.25,
favorLines: [
"She grants you the ear of a high-profile client in her parlour—worth its weight in gold.",
"A single whisper from her sees an inconvenient witness vanish from the city.",
"She dispatches one of her most trusted Swallows to handle 'delicate negotiations.'"
],
drinkLines: [
`"How bold, buying a drink for the likes of me. Take care you don't overstep, dear."`,
`"A calculated risk on your part, no doubt. Well, indulge me, and I might indulge you."`
],
like: 0,
drinksCount: 0,
drinksToLeave: getRandomInt(10, 20)
},
karma: {
name: "Karma Nightingale",
minBribe: 20,
maxBribe: 70,
bribeSuccessChance: 0.80,
audienceChance: 0.33,
favorLines: [
"Karma passes on a succulent rumour from a client’s pillow-talk.",
"Your rival’s private letters disappear, only to reappear in your hands.",
"She invites you to a Swallow soiree, where secrets flow as freely as wine."
],
drinkLines: [
`"A sweet gesture. My Mistress will be pleased to see us get along."`,
`"You’ve piqued my curiosity. Let’s make this drink worth our time, shall we?"`
],
like: 0,
drinksCount: 0,
drinksToLeave: getRandomInt(10, 20)
}
};
// Track the current modal type: 'drink', 'bribe', or 'audience' – plus the current repKey.
let currentRepKey = null;
let currentModalType = null;
// A small array of random items patrons can leave behind when they stagger away drunk
const RANDOM_ITEMS = [
"a tarnished locket",
"a ring with a curious crest",
"a mysterious key",
"a small pouch of curious herbs",
"a rolled-up, half-burnt map",
"an ornate quill pen with swirling etchings",
"a faded love letter"
];
/*************************************
* BUY DRINK LOGIC
*************************************/
function buyDrink(repKey) {
// First, check for the 5% fight chance
if (checkForFight(repKey)) {
return; // If a fight breaks out, we skip everything else
}
currentRepKey = repKey;
currentModalType = 'drink';
openModal("Drink Offer", getDrinkDialogue(repKey));
// Increase the person's "like" by 1
REP_DATA[repKey].like += 1;
// Increase drinksCount
REP_DATA[repKey].drinksCount += 1;
// If they've met or exceeded their drinksToLeave threshold, they leave and drop an item
if (REP_DATA[repKey].drinksCount >= REP_DATA[repKey].drinksToLeave) {
const randomItem = pickRandomLine(RANDOM_ITEMS);
setTimeout(() => {
alert(`${REP_DATA[repKey].name} is too drunk to carry on. They stagger out, leaving behind ${randomItem}!`);
}, 500);
// You might want to reset their drinksCount or otherwise note that they've left
// For now, let's just reset to 0 and set drinksToLeave very high so they won't leave again
REP_DATA[repKey].drinksCount = 0;
REP_DATA[repKey].drinksToLeave = 9999;
}
}
function getDrinkDialogue(repKey) {
const rep = REP_DATA[repKey];
const lines = rep.drinkLines;
const chosenLine = pickRandomLine(lines);
return `${rep.name} accepts your gesture. ${chosenLine}`;
}
/*************************************
* BRIBE LOGIC
*************************************/
function openBribeModal(repKey) {
// First, check for the 5% fight chance
if (checkForFight(repKey)) {
return; // If a fight breaks out, do not open the bribe modal
}
currentRepKey = repKey;
currentModalType = 'bribe';
openModal(`Bribe Attempt for ${REP_DATA[repKey].name}`, `"What is it you wish to offer?"`);
document.getElementById("bribeSection").style.display = "block";
document.getElementById("bribeAmount").value = 0;
document.getElementById("bribeResult").textContent = "";
}
function submitBribe() {
const rep = REP_DATA[currentRepKey];
const bribeValue = parseInt(document.getElementById("bribeAmount").value, 10) || 0;
const bribeResult = document.getElementById("bribeResult");
// Calculate a random threshold in [minBribe, maxBribe]
let threshold = getRandomInt(rep.minBribe, rep.maxBribe);
// Each "like" reduces threshold by 10% of its base range
let discount = 0.1 * rep.like;
threshold = Math.floor(threshold * (1 - discount));
if (bribeValue < threshold) {
bribeResult.textContent = `Your offer is too low. ${rep.name} scoffs at your meagre coin. (Secret threshold was ≥ ${threshold} GP.)`;
return;
}
// We made the threshold; there's still a chance to succeed
const roll = Math.random();
if (roll <= rep.bribeSuccessChance) {
// success
const randomFavor = pickRandomLine(rep.favorLines);
bribeResult.textContent = `Success! ${rep.name} accepts your bribe. Favour granted: ${randomFavor}`;
} else {
// fail
bribeResult.textContent = `${rep.name} pockets your coin but offers only a cold shoulder. No favours today.`;
}
}
/*************************************
* AUDIENCE LOGIC
*************************************/
function attemptAudience(repKey) {
const rep = REP_DATA[repKey];
const roll = Math.random();
// People who like you more might be more likely to grant an audience
let adjustedAudienceChance = rep.audienceChance + (0.05 * rep.like);
if (adjustedAudienceChance > 0.95) {
adjustedAudienceChance = 0.95;
}
if (roll <= adjustedAudienceChance) {
alert(`${rep.name} grants you an audience!`);
} else {
alert(`${rep.name} denies your request. No audience today.`);
}
}
/*************************************
* CHECK FOR FIGHT
*************************************/
function checkForFight(repKey) {
// 5% chance a fight breaks out
if (Math.random() < 0.05) {
alert(`A fight breaks out with ${REP_DATA[repKey].name}! Your approach ends in chaos!`);
return true;
}
return false;
}
/*************************************
* MODAL & GENERAL UTILITY
*************************************/
function openModal(title, dialogue) {
document.getElementById("modalTitle").textContent = title;
document.getElementById("modalDialogue").textContent = dialogue;
// Hide bribe section by default if not bribing
if (currentModalType !== 'bribe') {
document.getElementById("bribeSection").style.display = "none";
}
document.getElementById("modalOverlay").style.display = "block";
}
function closeModal() {
document.getElementById("modalOverlay").style.display = "none";
}
function pickRandomLine(arr) {
const idx = Math.floor(Math.random() * arr.length);
return arr[idx];
}
// Random int in [min, max]
function getRandomInt(min, max) {
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max - min + 1)) + min;
}
/*************************************
* END OF DAY (RESET LIKES & DRINKS)
*************************************/
function endDay() {
for (const key in REP_DATA) {
REP_DATA[key].like = 0;
REP_DATA[key].drinksCount = 0;
REP_DATA[key].drinksToLeave = getRandomInt(10, 20);
}
alert("A new day dawns at the Lucky Serpent. All drink-based goodwill is forgotten!");
}
</script>
</body>
</html>