forked from elonafoobar/elonafoobar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcasino.cpp
1295 lines (1281 loc) · 34 KB
/
casino.cpp
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
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#include "casino.hpp"
#include "ability.hpp"
#include "audio.hpp"
#include "calc.hpp"
#include "casino_card.hpp"
#include "character.hpp"
#include "character_status.hpp"
#include "config.hpp"
#include "dmgheal.hpp"
#include "elona.hpp"
#include "i18n.hpp"
#include "input.hpp"
#include "item.hpp"
#include "itemgen.hpp"
#include "macro.hpp"
#include "menu.hpp"
#include "random.hpp"
#include "ui.hpp"
#include "variables.hpp"
namespace elona
{
elona_vector1<int> atxpic;
int atxap;
int txtadvmsgfix;
elona_vector1<int> mattile;
void casino_dealer()
{
begintempinv();
atxthrough = 0;
atxpic = 0;
snd(39);
mode = 9;
atxbg = u8"bg13"s;
atxbgbk = "";
SDIM3(atxinfon, 80, 5);
if (atxid == 2)
{
casino_random_site();
return;
}
if (atxid == 1)
{
txt(lang(u8"ディーラーに話しかけた。"s, u8"You talk to the dealer."s));
play_music(77);
casino_wrapper();
return;
}
if (atxid == 4)
{
play_music(77);
casino_wrapper();
return;
}
casino_acquire_items();
return;
}
void casino_choose_card()
{
label_18671_internal:
screenupdate = -1;
update_screen();
if (atxid >= 2)
{
txtadvmsgfix = 136;
}
for (int cnt = 0, cnt_end = (noteinfo()); cnt < cnt_end; ++cnt)
{
noteget(s, cnt);
if (strmid(s, 0, 1) == u8"@"s)
{
s(1) = strmid(s, 1, 2);
s = strmid(s, 3, s(0).size() - 3);
font(16 - en * 2);
color(250, 240, 230);
if (s(1) == u8"BL"s)
{
color(130, 130, 250);
}
if (s(1) == u8"GR"s)
{
color(130, 250, 130);
}
if (s(1) == u8"QM"s)
{
color(0, 100, 0);
}
}
else
{
font(16 - en * 2);
color(250, 240, 230);
}
pos(170, cnt * 20 + 120 + txtadvmsgfix);
mes(s);
color(0, 0, 0);
}
cs_bk = -1;
pagemax = (listmax - 1) / pagesize;
if (page < 0)
{
page = pagemax;
}
else if (page > pagemax)
{
page = 0;
}
gsel(2);
gmode(0);
pos(0, 0);
gcopy(0, 0, 0, windoww, windowh);
gsel(0);
gmode(2);
keyrange = 0;
for (int cnt = 0, cnt_end = (pagesize); cnt < cnt_end; ++cnt)
{
p = pagesize * page + cnt;
if (p >= listmax)
{
break;
}
key_list(cnt) = key_select(cnt);
++keyrange;
}
label_1870();
label_1868_internal:
x(0) = 170;
x(1) = 400;
y(0) = noteinfo() * 20 + 120 + txtadvmsgfix + 16;
y(1) = 20 * listmax;
gmode(0);
pos(x, y);
gcopy(2, x, y, x(1), y(1));
gmode(2);
font(14 - en * 2);
cs_listbk();
for (int cnt = 0, cnt_end = (pagesize); cnt < cnt_end; ++cnt)
{
p = pagesize * page + cnt;
if (p >= listmax)
{
break;
}
i = list(0, p);
display_key(
170, noteinfo() * 20 + 120 + txtadvmsgfix + 16 + cnt * 20, cnt);
s = listn(0, p);
cs_list(
cs == cnt,
s,
200,
noteinfo() * 20 + 120 + txtadvmsgfix + 16 + cnt * 20,
0,
2);
}
if (keyrange != 0)
{
cs_bk = cs;
}
redraw();
await(config::instance().wait1);
key_check();
cursor_check();
ELONA_GET_SELECTED_ITEM(rtval, snd(40));
if (chatesc != -1)
{
if (key == key_cancel)
{
snd(40);
rtval = chatesc;
}
}
if (rtval != -1)
{
label_1871();
atxpic = 0;
return;
}
if (key == key_pageup)
{
if (pagemax != 0)
{
snd(1);
++page;
goto label_18671_internal;
}
}
if (key == key_pagedown)
{
if (pagemax != 0)
{
snd(1);
--page;
goto label_18671_internal;
}
}
goto label_1868_internal;
}
void label_1870()
{
label_1872();
if (mattile != -1)
{
mattile = rnd(mattile(2)) + mattile(1);
}
for (int cnt = 0; cnt < 12; ++cnt)
{
x(0) = 170;
x(1) = 300;
y(0) = noteinfo() * 20 + 120 + txtadvmsgfix + 16;
y(1) = 20 * listmax;
gmode(0);
pos(x - 50, y - 50);
gcopy(2, x - 50, y - 50, 100 + x(1), y(1) + 100);
if (cnt == 11)
{
break;
}
gmode(4, x(1), y(1), cnt * 25);
pos(x + x(1) / 2 - 10 + cnt, y + y(1) / 2);
grotate(2, 0, 0, 0, x(1), y(1));
if (atxpic != 0)
{
x(0) = 345;
x(1) = atxpic(2) + 120;
y(0) = 170;
y(1) = atxpic(3);
gmode(0);
pos(x - atxpic(2) / 2, y - atxpic(3) / 2);
gcopy(2, x - atxpic(2) / 2, y - atxpic(3) / 2, x(1), y(1));
pos(x, y);
gmode(2, inf_tiles, inf_tiles);
double p_double;
if (cnt == 10)
{
p_double = 0;
}
else
{
p_double = 0.6222 * cnt;
}
p(1) = 1;
if (atxpic == 2)
{
p(1) = 5;
}
grotate(
p(1),
atxpic(1) % 33 * 32,
atxpic(1) / 33 * 32,
p_double,
cnt * (atxpic(2) / 10),
cnt * (atxpic(3) / 10));
}
if (mattile != -1)
{
int cnt2 = cnt;
for (int cnt = 0; cnt < 2; ++cnt)
{
x(0) = cnt * 250 + 170;
x(1) = 96;
y(0) = 120;
y(1) = 96;
gmode(0);
pos(x, y);
gcopy(2, x, y, x(1), y(1));
pos(x + x(1) / 2, y + y(1) / 2);
gmode(2, inf_tiles, inf_tiles);
grotate(
1,
mattile % 33 * 32,
mattile / 33 * 32,
0,
cnt2 * 9,
cnt2 * 9);
}
}
await(20);
redraw();
}
gmode(2);
atxpic = 0;
return;
}
void label_1871()
{
label_1872();
for (int cnt = 0; cnt < 11; ++cnt)
{
x = 170;
y(0) = noteinfo() * 20 + 120 + txtadvmsgfix + 16;
y(1) = 20 * listmax;
gmode(0);
pos(x - 50, y - 50);
gcopy(2, x - 50, y - 50, 100 + x(1), y(1) + 100);
gmode(4, x(1), y(1), 250 - cnt * 25);
pos(x + x(1) / 2 - 2 * cnt, y + y(1) / 2);
grotate(2, 0, 0, 0, x(1), y(1));
await(15);
redraw();
}
return;
}
void label_1872()
{
x(1) = 300;
cs = -1;
boxf(
170,
noteinfo() * 20 + 120 + txtadvmsgfix + 16,
170 + x(1),
noteinfo() * 20 + 120 + txtadvmsgfix + 16 + 20 * listmax);
font(14 - en * 2);
cs_listbk();
for (int cnt = 0, cnt_end = (pagesize); cnt < cnt_end; ++cnt)
{
p = pagesize * page + cnt;
if (p >= listmax)
{
break;
}
i = list(0, p);
display_key(
170, noteinfo() * 20 + 120 + txtadvmsgfix + 16 + cnt * 20, cnt);
s = listn(0, p);
gmode(2);
cs_list(
cs == cnt,
s,
200,
noteinfo() * 20 + 120 + txtadvmsgfix + 16 + cnt * 20,
0,
2);
}
if (keyrange != 0)
{
cs_bk = cs;
}
gsel(2);
gmode(0);
pos(0, 0);
gcopy(
0, 170, noteinfo() * 20 + 120 + txtadvmsgfix + 16, x(1), 20 * listmax);
gsel(0);
gmode(2);
cs = 0;
return;
}
void casino_acquire_items()
{
mtilefilecur = -1;
label_1746();
f = 0;
for (const auto& cnt : items(-1))
{
if (inv[cnt].number != 0)
{
f = 1;
}
}
if (f == 1)
{
if (cdata[0].hp >= 0)
{
txt(lang(
u8"幾つかの戦利品がある。"s,
u8"There're some items you can acquire."s));
screenupdate = -1;
update_screen();
invsubroutine = 1;
invctrl(0) = 22;
invctrl(1) = 0;
ctrl_inventory();
}
}
mode = 0;
atxid = 0;
exittempinv();
await(100);
snd(39);
play_music();
return;
}
void casino_random_site()
{
int atxrefval1 = 0;
atxap = 10;
atxspot = 19;
atxinfon(0) = u8"ランダムサイト"s;
atxinit();
atxthrough = 1;
if (atxid(1) == 0)
{
atxid(1) = 3;
atxlv = gdata_current_dungeon_level;
if (mdata(6) == 20)
{
atxid(1) = 1;
}
if (mdata(6) == 21)
{
atxid(1) = 4;
}
if (mdata(6) == 22)
{
atxid(1) = 2;
}
if (mdata(6) == 23)
{
atxid(1) = 4;
}
if (mdata(6) == 1)
{
atxlv = cdata[0].level;
if (4 <= gdata(62) && gdata(62) < 9)
{
atxid(1) = 2;
}
if (264 <= gdata(62) && gdata(62) < 363)
{
atxid(1) = 3;
}
if (9 <= gdata(62) && gdata(62) < 13)
{
atxid(1) = 2;
}
if (13 <= gdata(62) && gdata(62) < 17)
{
atxid(1) = 3;
}
}
}
if (atxid(1) == 8)
{
atxbg = u8"bg21"s;
mattile(0) = 0;
mattile(1) = 495;
mattile(2) = 3;
atxspot = 16;
noteadd(u8"この辺りは残骸やら遺品やらでごちゃごちゃだ。"s);
}
if (atxid(1) == 7)
{
atxbg = u8"bg20"s;
mattile(0) = 0;
mattile(1) = 495;
mattile(2) = 3;
atxspot = 15;
noteadd(u8"この辺りには見たこともない植物がたくさんある。"s);
}
if (atxid(1) == 6)
{
atxbg = u8"bg19"s;
mattile(0) = 0;
mattile(1) = 495;
mattile(2) = 3;
atxspot = 14;
noteadd(u8"天然の鉱石の宝庫だ。"s);
}
if (atxid(1) == 5)
{
atxbg = u8"bg18"s;
mattile(0) = 0;
mattile(1) = 495;
mattile(2) = 3;
atxspot = 13;
noteadd(u8"綺麗な泉がある。"s);
}
if (atxid(1) == 1)
{
atxbg = u8"bg13"s;
mattile(0) = 0;
mattile(1) = 495;
mattile(2) = 3;
atxspot = 9;
}
if (atxid(1) == 4)
{
atxbg = u8"bg17"s;
mattile(0) = 0;
mattile(1) = 495;
mattile(2) = 3;
atxspot = 12;
}
if (atxid(1) == 2)
{
atxbg = u8"bg15"s;
mattile(0) = 0;
mattile(1) = 495;
mattile(2) = 3;
atxspot = 10;
}
if (atxid(1) == 3)
{
atxbg = u8"bg16"s;
mattile(0) = 0;
mattile(1) = 495;
mattile(2) = 3;
atxspot = 11;
}
label_1875:
if (atxap <= 0 || cdata[0].hp < 0)
{
label_1877();
return;
}
atxinit();
noteadd(u8"何をしよう?"s);
list(0, listmax) = 1;
listn(0, listmax) = u8"探索"s;
++listmax;
list(0, listmax) = 3;
listn(0, listmax) = u8"去る"s;
++listmax;
atxinfon(1) = u8"行動回数残り "s + atxap + u8"回\n"s;
chatesc = 3;
txtadvmsgfix = 0;
txtadvscreenupdate = 1;
casino_choose_card();
if (rtval == 1)
{
goto label_1876_internal;
return;
}
if (rtval == 2)
{
goto label_1876_internal;
return;
}
if (rtval == 3)
{
label_1877();
return;
}
goto label_1875;
label_1876_internal:
--atxap;
atxinit();
if (rnd(1) == 0)
{
atxrefval1 = -1;
if (atxid(1) == 7)
{
atxpic(0) = 1;
atxpic(1) = 171;
atxpic(2) = 96;
atxpic(3) = 96;
noteadd(u8"茂みを見つけた。"s);
list(0, listmax) = 1;
listn(0, listmax) = u8"調べる"s;
++listmax;
list(0, listmax) = 2;
listn(0, listmax) = u8"採取する("s
+ i18n::_(u8"ability", std::to_string(180), u8"name") + u8": "s
+ sdata(180, 0) + u8")"s;
++listmax;
atxrefval1 = 7;
}
if (atxid(1) == 6)
{
atxpic(0) = 1;
atxpic(1) = 219;
atxpic(2) = 96;
atxpic(3) = 96;
noteadd(u8"鉱石の岩がある。"s);
list(0, listmax) = 1;
listn(0, listmax) = u8"調べる"s;
++listmax;
list(0, listmax) = 2;
listn(0, listmax) = u8"掘る("s
+ i18n::_(u8"ability", std::to_string(163), u8"name") + u8": "s
+ sdata(163, 0) + u8")"s;
++listmax;
atxrefval1 = 7;
}
if (atxid(1) == 5)
{
atxpic(0) = 1;
atxpic(1) = 439;
atxpic(2) = 96;
atxpic(3) = 96;
noteadd(u8"泉がある。"s);
list(0, listmax) = 1;
listn(0, listmax) = u8"飲む"s;
++listmax;
list(0, listmax) = 2;
listn(0, listmax) = u8"釣る("s
+ i18n::_(u8"ability", std::to_string(185), u8"name") + u8": "s
+ sdata(185, 0) + u8")"s;
++listmax;
atxrefval1 = 7;
}
if (atxid(1) == 8)
{
atxpic(0) = 1;
atxpic(1) = 199;
atxpic(2) = 96;
atxpic(3) = 96;
noteadd(u8"残骸を見つけた。"s);
list(0, listmax) = 1;
listn(0, listmax) = u8"あさる"s;
++listmax;
list(0, listmax) = 2;
listn(0, listmax) = u8"解剖する("s
+ i18n::_(u8"ability", std::to_string(161), u8"name") + u8": "s
+ sdata(161, 0) + u8")"s;
++listmax;
atxrefval1 = 7;
}
if (atxrefval1 == -1)
{
noteadd(u8"壁に何やら怪しいひび割れがある…"s);
list(0, listmax) = 1;
listn(0, listmax) = u8"叩く(筋力)"s;
++listmax;
list(0, listmax) = 2;
listn(0, listmax) = u8"調べる(感知)"s;
++listmax;
}
atxinfon(1) = u8"行動回数残り "s + atxap + u8"回\n"s;
chatesc = 1;
txtadvmsgfix = 0;
txtadvscreenupdate = 1;
casino_choose_card();
atxinit();
if (rtval == 1)
{
for (int cnt = 0; cnt < 3; ++cnt)
{
p = random_material(atxlv);
atxpic(0) = 1;
atxpic(1) = matref(2, p);
atxpic(2) = 96;
atxpic(3) = 96;
snd(41);
mat(p) += 1;
noteadd(lang(
u8"@BL"s + matname(p) + u8"を"s + 1
+ u8"個手に入れた!(所持数:"s + mat(p) + u8"個)"s,
u8"@BLYou get "s + 1 + u8" "s + matname(p)
+ u8"(s)! (Total:"s + mat(p) + u8")"s));
}
atxthrough = 1;
goto label_1875;
}
if (rtval == 2)
{
atxthrough = 1;
goto label_1875;
}
}
if (rnd(8) == 0)
{
if (rnd(4) == 0)
{
noteadd(u8"あれ…?"s);
noteadd(u8"道に迷った! (行動回数-2)"s);
atxap -= 2;
atxthrough = 1;
goto label_1875;
}
if (rnd(2) == 0)
{
atxpic(0) = 2;
atxpic(1) = 205;
atxpic(2) = 96;
atxpic(3) = 96;
noteadd(u8"幽霊に脅かされた! (行動回数-1)"s);
snd(70);
atxap -= 1;
atxthrough = 1;
goto label_1875;
}
if (rnd(2) == 0)
{
atxpic(0) = 1;
atxpic(1) = 424;
atxpic(2) = 96;
atxpic(3) = 96;
noteadd(u8"小石につまづいてころんでしまった! (行動回数-1)"s);
snd(70);
atxap -= 1;
atxthrough = 1;
goto label_1875;
}
}
if (rnd(8) == 0)
{
if (rnd(4) == 0)
{
atxpic(0) = 1;
atxpic(1) = 200;
atxpic(2) = 96;
atxpic(3) = 96;
noteadd(u8"ふかふかの藁を見つけた。"s);
noteadd(u8"ふかふかして気持ちいい。(行動回数+3)"s);
atxap += 2;
atxthrough = 1;
goto label_1875;
}
if (rnd(2) == 0)
{
atxpic(0) = 1;
atxpic(1) = 294;
atxpic(2) = 96;
atxpic(3) = 96;
noteadd(u8"切り株がある。"s);
noteadd(u8"腰を下ろして疲れを癒した。(行動回数+2)"s);
atxap += 2;
atxthrough = 1;
goto label_1875;
}
if (rnd(2) == 0)
{
atxpic(0) = 1;
atxpic(1) = 127;
atxpic(2) = 96;
atxpic(3) = 96;
noteadd(u8"綺麗な花を見つけた。"s);
noteadd(u8"心がなごんだ…(行動回数+2)"s);
atxap += 2;
atxthrough = 1;
goto label_1875;
}
}
if (rnd(7) == 0)
{
if (rnd(3))
{
atxpic(0) = 2;
atxpic(1) = 210;
atxpic(2) = 96;
atxpic(3) = 96;
noteadd(u8"痛っ!蚊に刺された。"s);
snd(2);
dmghp(0, cdata[0].max_hp * 5 / 100, -10);
}
else
{
atxpic(0) = 2;
atxpic(1) = 216;
atxpic(2) = 96;
atxpic(3) = 96;
noteadd(u8"うっ!ヘビに噛まれた。"s);
snd(2);
dmghp(0, cdata[0].max_hp * 10 / 100, -10);
}
atxthrough = 1;
goto label_1875;
}
if (rnd(3) == 0)
{
if (rnd(3))
{
atxpic(0) = 2;
atxpic(1) = 210;
atxpic(2) = 96;
atxpic(3) = 96;
noteadd(u8"痛っ!蚊に刺された。"s);
snd(2);
dmghp(0, cdata[0].max_hp * 5 / 100, -10);
}
else
{
atxpic(0) = 2;
atxpic(1) = 216;
atxpic(2) = 96;
atxpic(3) = 96;
noteadd(u8"うっ!ヘビに噛まれた。"s);
snd(2);
dmghp(0, cdata[0].max_hp * 10 / 100, -10);
}
atxthrough = 1;
goto label_1875;
}
if (rnd(2) == 0)
{
atxpic(0) = 1;
atxpic(1) = 220;
atxpic(2) = 96;
atxpic(3) = 96;
noteadd(u8"宝箱がある。"s);
list(0, listmax) = 1;
listn(0, listmax) = u8"錠を解体する("s
+ i18n::_(u8"ability", std::to_string(158), u8"name") + u8": "s
+ sdata(158, 0) + u8")"s;
++listmax;
list(0, listmax) = 3;
listn(0, listmax) = u8"叩き割る(筋力: "s + sdata(10, 0) + u8")"s;
++listmax;
atxinfon(1) = u8"行動回数残り "s + atxap + u8"回\n"s;
chatesc = 1;
txtadvmsgfix = 0;
txtadvscreenupdate = 1;
casino_choose_card();
atxinit();
goto label_1875;
}
if (rnd(2) == 0)
{
p = random_material(atxlv);
atxpic(0) = 1;
atxpic(1) = matref(2, p);
atxpic(2) = 96;
atxpic(3) = 96;
snd(41);
mat(p) += 1;
noteadd(lang(
u8"@BL"s + matname(p) + u8"を"s + 1 + u8"個手に入れた!(所持数:"s
+ mat(p) + u8"個)"s,
u8"@BLYou get "s + 1 + u8" "s + matname(p) + u8"(s)! (Total:"s
+ mat(p) + u8")"s));
atxthrough = 1;
goto label_1875;
}
if (rnd(3) == 0)
{
noteadd(u8"何も見つからなかった…"s);
atxthrough = 1;
goto label_1875;
}
noteadd(u8"何も見つからなかった…"s);
atxthrough = 1;
goto label_1875;
}
void label_1877()
{
atxinit();
if (cdata[0].hp >= 0)
{
noteadd(u8"探索を終えた。"s);
list(0, listmax) = 0;
listn(0, listmax) = u8"戻る"s;
++listmax;
}
else
{
noteadd(u8"ぐふ…"s);
list(0, listmax) = 0;
listn(0, listmax) = u8"(断末魔の叫び)"s;
++listmax;
}
atxinfon(1) = u8"行動回数残り "s + atxap + u8"回\n"s;
chatesc = 0;
txtadvmsgfix = 0;
txtadvscreenupdate = 1;
casino_choose_card();
casino_acquire_items();
return;
}
void casino_wrapper()
{
bool finished = false;
while (!finished)
{
finished = casino_start();
}
}
bool casino_start()
{
bool finished = false;
atxbg = u8"bg14"s;
mattile = -1;
atxinfon(0) = lang(
u8"カジノ《フォーチュンクッキー》"s, u8"Casino <<Fortune Cookie>>"s);
atxinit();
noteadd(lang(
u8"カジノ《フォーチュンクッキー》へようこそ。"s,
u8"Welcome to the casino, Fortune cookie!"s));
noteadd(lang(
u8"チップマテリアルと引き換えにゲームをすることができます。"s,
u8"You can bet the casino chips you have and play some games."s));
noteadd(lang(u8"ごゆっくりお楽しみ下さい。"s, u8"Enjoy your stay."s));
if (gdata_used_casino_once == 0)
{
noteadd(""s);
noteadd(lang(
u8"お客様は初めてのご利用のようですね。"s,
u8"Looks like you play for the first time, sir."s));
noteadd(lang(
u8"当店からチップマテリアルを10枚進呈します。"s,
u8"We're offering you 10 free casino chips to try our games."s));
gdata_used_casino_once = 1;
snd(41);
mat(1) += 10;
noteadd(lang(
u8"@BL"s + matname(1) + u8"を"s + 10 + u8"個手に入れた!(所持数:"s
+ mat(1) + u8"個)"s,
u8"@BLYou get "s + 10 + u8" "s + matname(1) + u8"(s)! (Total:"s
+ mat(1) + u8")"s));
}
atxinfon(1) = lang(
u8"カジノチップ残り "s + mat(1) + u8"枚\n"s,
u8"Casino chips left: "s + mat(1) + u8"\n"s);
atxinfon(2) = "";
list(0, listmax) = 0;
listn(0, listmax) = lang(u8"店を出る"s, u8"Later."s);
++listmax;
list(0, listmax) = 1;
listn(0, listmax) =
lang(u8"ブラックジャック"s, u8"I want to play Blackjack."s);
++listmax;
chatesc = 0;
txtadvmsgfix = 0;
txtadvscreenupdate = 1;
casino_choose_card();
if (rtval == 0)
{
casino_acquire_items();
return true;
}
else if (rtval == 1)
{
while (!finished)
{
finished = casino_blackjack();
}
return false;
}
return true;
}
bool casino_blackjack()
{
int stake = 0;
int winrow = 0;
int cardround = 0;
int winner = 0;
atxinit();
noteadd(lang(
u8"ブラックジャックは、カードの合計を21に近づけるゲームです。"s,
u8"In Blackjack, the hand with the highest total wins as long as it"s));
noteadd(lang(
u8"J,Q,Kは10に、Aは1または11に数えられます。21を越えると負けです。"s,
u8"doesn't exceed 21. J,Q,K are counted as 10 and A is counted as 1 or 11."s));
noteadd(lang(
u8"では、賭けるチップを宣言してください。"s,
u8"More bets means better rewards."s));
noteadd(lang(
u8"チップが多いほど、景品の質があがります。"s,
u8"How many tips would you like to bet?"s));
atxinfon(1) = lang(
u8"カジノチップ残り "s + mat(1) + u8"枚\n"s,
u8"Casino chips left: "s + mat(1) + u8"\n"s);
atxinfon(2) = "";
if (mat(1) <= 0)
{
noteadd(""s);
noteadd(lang(
u8"お客様はチップをもっていません。"s,
u8"Sorry sir, you don't seem to have casino chips."s));
}
list(0, listmax) = 0;
listn(0, listmax) = lang(u8"やめる"s, u8"I quit."s);
++listmax;
if (mat(1) >= 1)
{
list(0, listmax) = 1;
listn(0, listmax) =
lang(""s + 1 + u8"枚賭ける"s, u8"Bet "s + 1 + u8" chips."s);
++listmax;
}
if (mat(1) >= 5)
{
list(0, listmax) = 5;
listn(0, listmax) =
lang(""s + 5 + u8"枚賭ける"s, u8"Bet "s + 5 + u8" chips."s);
++listmax;
}
if (mat(1) >= 20)
{
list(0, listmax) = 20;
listn(0, listmax) =
lang(""s + 20 + u8"枚賭ける"s, u8"Bet "s + 20 + u8" chips."s);
++listmax;
}
chatesc = 0;
txtadvmsgfix = 0;
txtadvscreenupdate = 1;
casino_choose_card();
if (rtval == 0)
{
return true;
}
stake = rtval;
winrow = 0;
cardround = 0;
autosave = 1 * (gdata_current_map != 35);
for (int cnt = 0;; ++cnt)