-
Notifications
You must be signed in to change notification settings - Fork 0
/
oneca_test.txt
1326 lines (1163 loc) · 34.9 KB
/
oneca_test.txt
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
## id -> name
# Onecard Data and Event.
# Info
Info = { NUM_NUM = 13 SHA_NUM = 4 CARDNUM = 52 TOTAL_CARD_NUM = 54 PLAYER_NUM = 4 FIRST_CARD_NUM = 5
GAME_OVER_CARD_NUM = 15 ONE_CARD_FAIL_CARD_NUM = 5
} # cardnum - no count two joker card!
# Mode
Mode = { JUMP_MODE = 6 BACK_MODE = 7 MORE_ONE_MODE = 8 CHANGE_SHA_MODE = 3
GAME_END_MODE = 4 GAME_OVER_MODE = 5 ATTACK_MODE = 1 GENERAL_MODE = 0 }
# Turn
Turn = { dir = true start=1 end=4 n=4 now=4 } # �ʱ�ȭ Event ����
Event = {
# No
id = 1
# Action
$if = { $condition = { $EQ = { /Turn/dir true } }
$then = {
$assign = { /Turn/now value = { $add = { $modular = { /Turn/now /Turn/n } 1 } } }
}
}
$else = { # if else link problem - depth, depth max setting
$then = {
$assign = { /Turn/now value = { $add = { $modular = { $add = { /Turn/now $add = { /Turn/n -2 } } /Turn/n } 1 } } }
}
}
}
Event = {
#No
id = 200
#Action
$if = { $condition = { $EQ = { /Turn/dir true } }
$then = { $assign = { /Turn/dir value = { false } } }
}
$else = {
$then = { $assign = { /Turn/dir value = { true } } }
}
}
# Turn initial Event
Event = {
id = 201
$assign = { /Turn/dir value = { true } }
$assign = { /Turn/start value = { 1 } }
$assign = { /Turn/end value = { /Info/PLAYER_NUM } }
$assign = { /Turn/n value = { /Info/PLAYER_NUM } }
$assign = { /Turn/now value = { /Info/PLAYER_NUM } }
}
# Card
Event = { # just one!
id = 101
$parameter = { i } #
# Action cf) Card <--------------------
$if = { $condition = { $COMP< = { $parameter.i /Info/CARDNUM } }
$then = {
$if = { $condition = { $EQ = { $parameter.i 0 } }
$then = { $make = { /Card } }
}
$make = { data = { $concat_all = { /Card/ $parameter.i } } }
$insert2 = { dir = { $concat_all = { /Card/ $parameter.i } } value = { sha = $divide ={$parameter.i 13} num = $modular={$parameter.i 13} # no
isBlackJoker = no isColorJoker = no } }
$call = { id = 101 i = { $add = { $parameter.i 1 } } }
}
}
}
Event = { # just one!
id = 3
$call = { id = 101 i = 0 }
# insert two joker
$make = { dir = { $concat = { /Card $concat = { / /Info/CARDNUM } } } }
$make = { dir = { $concat = { /Card $concat = { / $add = { /Info/CARDNUM 1 } } } } }
$insert2 = { dir = { $concat = { /Card $concat = { / /Info/CARDNUM } } } value = {sha = -1 num = -1 isBlackJoker = yes isColorJoker = no } }
$insert2 = { dir = { $concat = { /Card $concat = { / $add = { /Info/CARDNUM 1 } } } } value = {sha = -2 num = -2 isBlackJoker = no isColorJoker = yes } }
}
Event = {
id = 103
$parameter = { card }
$return = { $divide = { $parameter.card 13 } }
}
Event = {
id = 104
$parameter = { card }
$return = { $modular = { $parameter.card 13 } }
}
# Card String Image
##"��","��","��","��", "��","��"
## 0 1 2 3 4 5
## K->A->.....->J->Q
## 0 1 11 12
CardStringImage =
{
num = { K A 2 3 4 5 6 7 8 9 10 J Q }
sha = {
sha_image = { A B C D } # check
sha_name = { spade dia heart clover }
}
blackJoker = { E } #
colorJoker = { F } #
}
Event =
{
# $name
id = 100
$parameter = { sha num isBlackJoker isColorJoker }
#Action
$if = { $condition = { $EQ = { yes $parameter.isBlackJoker } }
$then = { $print = { value = { /CardStringImage/blackJoker } } }
}
$if = { $condition = { $EQ = { yes $parameter.isColorJoker } }
$then = { $print = { value = { /CardStringImage/colorJoker } } }
}
$if = { $condition = { $COMP< = { -1 $parameter.num } }
$then = {
$print = { dir = { /CardStringImage/sha/sha_image } start = { $parameter.sha } last = { $parameter.sha } }
$print = { dir = { /CardStringImage/num } start = { $parameter.num } last = { $parameter.num } }
}
}
}
# CardList
Event = # just one!
{
id = 4
$parameter = { i }
$option = { REMOVE_IF_CALL_ANY_EVENT }
# Action
$if = { $condition = { $COMP< = { $parameter.i $add= { 2 /Info/CARDNUM } } }
$then = {
$if = { $condition = { $EQ = { $parameter.i 0 } }
$then = { $make = { /CardList } }
}
$insert2 = { dir = { /CardList } value = { $parameter.i } }
$print = { value = { $parameter.i } }
$print = { value = { \n } }
$call = { id = 4 i = { $add = { $parameter.i 1 } } }
}
}
}
Event =
{
id = 5
# Action
$call = { id = 4 i = 0 }
}
Event =
{
id = 6
$parameter = { n }
# Action
$if = { $condition = { $COMP> = { $parameter.n 0 } }
$then = {
$swap = { /CardList value = { $rand = { 0 $add={$parameter.n -1} } } value = { $add={$parameter.n -1} } }
$call = { id = 6 n = { $add = { $parameter.n -1 } } }
}
}
}
Event =
{
id = 7
# Action
$call = { id = 6 n = { $size = { /CardList } } } # cf) /info/cardNum
}
# First Card Distribution
Event =
{
id = 11
$call = { id = 12 i = 0 }
}
Event =
{
id = 12
$parameter = { i }
# Action
$if = { $condition = { $COMP< = { $parameter.i /Info/PLAYER_NUM } }
$then = {
$call = { id = 13 i = 0 j = { $parameter.i } }
$call = { id = 12 i = { $add={ $parameter.i 1 } } }
}
}
}
Event =
{
id = 13
$parameter = { i j }
#Action
$if = { $condition = { $COMP< = { $parameter.i /Info/FIRST_CARD_NUM } }
$then = {
$insert2 = { dir = { $concat_all = { /PlayerCardList/ $parameter.j } } value = { $pop_back = { /CardList } } }
# back ( item, not useType! )
$call = { id = 13 i = { $add = { $parameter.i 1 } } j = { $parameter.j } }
}
}
}
# Card AllReCall to CardList
# card to cardlist
# PutCard
PutCard = { cardId = NONE }
# assign
Event = {
id = 20
$parameter = { card_id }
$assign = { /PutCard/cardId value = { $parameter.card_id } }
}
# clear
Event = {
id = 21
$assign = { /PutCard/cardId value = { NONE } }
}
# PutCard, move to card list!
Event = {
id = 22
$insert2 = { dir = { /CardList } value = { /PutCard/cardId } }
$call = { id = 21 }
}
# Rule
#Onecard Fucntions No.
FunctionNo = { }
#build functionNo
Event = {
id = 1000
$parameter = { i }
$if = { $condition = { $COMP< = { $parameter.i /Info/TOTAL_CARD_NUM } }
$then = {
# $print = { value = { "start" } }
# $print = { value = { \n } }
$if = { $condition = { $EQ = { $get = { $concat = { $concat = { /Card $concat = { / $parameter.i } } /isBlackJoker } } yes } }
$then = {
$insert2 = { dir = { /FunctionNo } value = { 3 } }
# $print = { value = { "0" } }
# $call = { id = 1000 i = { $add = { $parameter.i 1 } } }
# $return = { }
}
}
$else = {
$then = {
$if = { $condition = { $EQ = { $get = { $concat = { $concat = { /Card $concat = { / $parameter.i } } /isColorJoker } } yes } }
$then = {
$insert2 = { dir = { /FunctionNo } value = { 4 } }
# $print = { value = { "1" } }
#$call = { id = 1000 i = { $add = { $parameter.i 1 } } }
#$return = { }
}
}
$else = {
$then = {
$if = { $condition = { $AND = { $EQ = { $get = { $concat = { $concat = { /Card $concat = { / $parameter.i } } /sha } } 0 }
$EQ = { $get = { $concat = { $concat = { /Card $concat = { / $parameter.i } } /num } } 1 } } }
$then = { $insert2 = { dir = { /FunctionNo } value = { 9 } }
# $print = { value = { "2" } }
# $call = { id = 1000 i = { $add = { $parameter.i 1 } } }
#$return = { }
}
}
$else = {
$then = {
$if = { $condition = { $EQ = { $get = { $concat = { $concat = { /Card $concat = { / $parameter.i } } /num } } 0 } }
$then = {
# $print = { value = { "3" } }
$insert2 = { dir = { /FunctionNo } value = { 8 } }
$call = { id = 1000 i = { $add = { $parameter.i 1 } } }
$return = { }
}
}
$if = { $condition = { $EQ = { $get = { $concat = { $concat = { /Card $concat = { / $parameter.i } } /num } } 1 } }
$then = {
# $print = { value = { "3" } }
$insert2 = { dir = { /FunctionNo } value = { 1 } }
$call = { id = 1000 i = { $add = { $parameter.i 1 } } }
$return = { }
}
}
$if = { $condition = { $EQ = { $get = { $concat = { $concat = { /Card $concat = { / $parameter.i } } /num } } 2 } }
$then = {
# $print = { value = { "3" } }
$insert2 = { dir = { /FunctionNo } value = { 2 } }
$call = { id = 1000 i = { $add = { $parameter.i 1 } } }
$return = { }
}
}
$if = { $condition = { $EQ = { $get = { $concat = { $concat = { /Card $concat = { / $parameter.i } } /num } } 7 } }
$then = {
# $print = { value = { "3" } }
$insert2 = { dir = { /FunctionNo } value = { 5 } }
$call = { id = 1000 i = { $add = { $parameter.i 1 } } }
$return = { }
}
}
$if = { $condition = { $EQ = { $get = { $concat = { $concat = { /Card $concat = { / $parameter.i } } /num } } 11 } }
$then = {
# $print = { value = { "3" } }
$insert2 = { dir = { /FunctionNo } value = { 6 } }
$call = { id = 1000 i = { $add = { $parameter.i 1 } } }
$return = { }
}
}
$if = { $condition = { $EQ = { $get = { $concat = { $concat = { /Card $concat = { / $parameter.i } } /num } } 12 } }
$then = {
# $print = { value = { "3" } }
$insert2 = { dir = { /FunctionNo } value = { 7 } }
$call = { id = 1000 i = { $add = { $parameter.i 1 } } }
$return = { }
}
}
# $if = { $condition = { FALSE }
# $then = { $print = { value = { "|" } } }
# }
# $if = { $condition = { TRUE }
# $then = { $print = { value = { "/" } } }
# }
$insert2 = { dir = { /FunctionNo } value = { 0 } }
# $print = { value = { "4" } }
}
}
}
}
}
}
# $print = { value = { \n } }
$call = { id = 1000 i = { $add = { $parameter.i 1 } } }
}
}
}
Event = {
id = 1001
$call = { id = 1000 i = 0 }
}
#Onecard main rule Event : CanPut
Event = {
id = 1005
$parameter = { Old_num New_num Old_sha New_sha Old New Mode }
$if = { $condition = { $EQ = { $parameter.Mode /Mode/ATTACK_MODE } }
$then = {
$if = { $condition = { $OR = { $EQ = { $parameter.Old 3 } $EQ = { $parameter.Old 4 } } }
$then ={
$if = { $condition = { $EQ = { $parameter.New 3 } }
$then = {
$return = { TRUE }
}
}
$if = { $condition = { $EQ = { $parameter.New 4 } }
$then = {
$return = { TRUE }
}
}
$if = { $condition = { $EQ = { $parameter.New 9 } }
$then = {
$return = { TRUE }
}
}
$return = { FALSE }
}
}
$if = { $condition = { $OR = { $EQ = { $parameter.Old 1 } $EQ = { $parameter.Old 9 } } }
$then = {
$if = { $condition = { $OR = { $EQ = { $parameter.New 1 } $EQ = { $parameter.New 9 } } }
$then = {
$return = { TRUE }
}
}
$if = { $condition = { $AND = { $EQ = { $parameter.Old_sha $parameter.New_sha }
$EQ = { $parameter.New 2 } } }
$then = {
$return = { TRUE }
}
}
$if = { $condition = { $EQ = { $parameter.New 3 } }
$then = {
$return = { TRUE }
}
}
$if = { $condition = { $EQ = { $parameter.New 4 } }
$then = {
$return = { TRUE }
}
}
$return = { FALSE }
}
}
$if = { $condition = { $EQ = { $parameter.Old 2 } }
$then = {
$if = { $condition = { $EQ = { $parameter.New 2 } }
$then = {
$return = { TRUE }
}
}
$if = { $condition = { $AND = { $EQ = { $parameter.Old_sha $parameter.New_sha }
$EQ = { $parameter.New 1 } } }
$then = {
$return = { TRUE }
}
}
$if = { $condition = { $AND = { $EQ = { $parameter.Old_sha $parameter.New_sha }
$EQ = { $parameter.New 9 } } }
$then = {
$return = { TRUE }
}
}
$if = { $condition = { $EQ = { $parameter.New 3 } }
$then = {
$return = { TRUE }
}
}
$if = { $condition = { $EQ = { $parameter.New 4 } }
$then = {
$return = { TRUE }
}
}
$return = { FALSE }
}
}
#$return = { FALSE }
}
}
$else = {
$then = {
$if = { $condition = { $EQ = { $parameter.New 3 } }
$then = {
$return = { TRUE }
}
}
$if = { $condition = { $EQ = { $parameter.New 4 } }
$then = {
$return = { TRUE }
}
}
$if = { $condition = { $OR =
{ $NOT = { $AND = {
$NOTEQ = { $parameter.Old_sha $parameter.New_sha }
$NOTEQ = { $parameter.Old_num $parameter.New_num } }
} $AND = { $NOTEQ = { $parameter.Mode /Mode/ATTACK_MODE }
$OR = { $EQ = { $parameter.Old 3 }
$EQ = { $parameter.Old 4 } }
}
}
}
$then = {
$return = { TRUE }
}
}
}
}
$return = { FALSE }
}
Event = {
id = 1006
$parameter = { put_card card mode }
$local = { Old_num New_num Old_sha New_sha Old New }
$call = { id = 103 card = { $parameter.put_card } }
$assign = { $local.Old_sha value = { $return_value = { } } }
$if = {
$condition = { $EQ = { $parameter.mode /Mode/CHANGE_SHA_MODE } }
$then = {
$assign = { $local.Old_sha value = { /ChangeSha/sha } }
}
}
$call = { id = 104 card = { $parameter.put_card } }
$assign = { $local.Old_num value = { $return_value = { } } }
$call = { id = 103 card = { $parameter.card } }
$assign = { $local.New_sha value = { $return_value = { } } }
$call = { id = 104 card = { $parameter.card } }
$assign = { $local.New_num value = { $return_value = { } } }
$assign = { $local.Old value = { $element = { /FunctionNo $parameter.put_card } } }
$assign = { $local.New value = { $element = { /FunctionNo $parameter.card } } }
$call = { id = 1005 Old_num = { $local.Old_num } New_num = { $local.New_num }
Old_sha = { $local.Old_sha } New_sha = { $local.New_sha }
Old = { $local.Old } New = { $local.New } Mode = { $parameter.mode }
}
$return = { $return_value = { } }
}
# Functions
Functions = {
}
Event = {
id = 1007
$local = { Attack_A1 KK1 Attack_A2 Attack_A3 Attack_A4 Attack_A5 Change_Sha1 Jump1 Back1 }
#NONE
$make = { /Functions/0 }
$insert2 = { dir = { /Functions/0 } value = { attack_point= 0 kk = no change_sha = no jump = no back = no } }
$assign = { $local.Attack_A2 value = { attack_point = 1 kk = no change_sha = no jump = no back = no } }
$make = { /Functions/1 }
$insert2 = { dir = { /Functions/1 } value = { $local.Attack_A2 } }
$assign = { $local.Attack_A3 value = { attack_point = 2 kk = no change_sha = no jump = no back = no } }
$make = { /Functions/2 }
$insert2 = { dir = { /Functions/2 } value = { $local.Attack_A3 } }
$assign = { $local.Attack_A4 value = { attack_point = 5 kk = no change_sha = no jump = no back = no } }
$make = { /Functions/3 }
$insert2 = { dir = { /Functions/3 } value = { $local.Attack_A4 } }
$assign = { $local.Attack_A5 value = { attack_point = 7 kk = no change_sha = no jump = no back = no } }
$make = { /Functions/4 }
$insert2 = { dir = { /Functions/4 } value = { $local.Attack_A5 } }
$assign = { $local.Change_Sha1 value = { attack_point = 0 kk = no change_sha = yes jump = no back = no } }
$make = { /Functions/5 }
$insert2 = { dir = { /Functions/5 } value = { $local.Change_Sha1 } }
$assign = { $local.Jump1 value = { attack_point = 0 kk = no change_sha = no jump = yes back = no } }
$make = { /Functions/6 }
$insert2 = { dir = { /Functions/6 } value = { $local.Jump1 } }
$assign = { $local.Back1 value = { attack_point = 0 kk = no change_sha = no jump = no back = yes } }
$make = { /Functions/7 }
$insert2 = { dir = { /Functions/7 } value = { $local.Back1 } }
$assign = { $local.KK1 value = { attack_point = 0 kk = yes change_sha = no jump = no back = no } }
$make = { /Functions/8 }
$insert2 = { dir = { /Functions/8 } value = { $local.KK1 } }
$assign = { $local.Attack_A1 value = { attack_point = 3 kk = no change_sha = no jump = no back = no } }
$make = { /Functions/9 }
$insert2 = { dir = { /Functions/9 } value = { $local.Attack_A1 } }
}
Event = {
id = 1008
$parameter = { card }
$local = { card_function_no function_dir }
#debug
$print = { value = { $parameter.card } }
# card -> card_function_no ( access table )
$assign = { $local.card_function_no value = { $element = { /FunctionNo $parameter.card } } }
# function_dir <= Functions/i/ # can $get
$assign = { $local.function_dir value = { $concat = { /Functions $concat = { / $local.card_function_no } } } }
$print = { vallue = { $local.function_dir } }
# / + $local.function_dir + attack_point > 0
$if = { $condition = { $COMP> = { $get = { $concat = { $local.function_dir $concat = { / attack_point } } } 0 } }
$then = {
$call = { id = 1010 point = { $get = { $concat = { $local.function_dir $concat = { / attack_point } } } } }
}
}
# + change_sha = yes
$if = { $condition = { $EQ = { $get = { $concat = { $local.function_dir $concat = { / change_sha } } } yes } }
$then = {
$call = { id = 1015 }
}
}
# + jump = yes
$if = { $condition = { $EQ = { $get = { $concat = { $local.function_dir $concat = { / jump } } } yes } }
$then = {
$call = { id = 1016 i = 0 }
}
}
# + back = yes
$if = { $condition = { $EQ = { $get = { $concat = { $local.function_dir $concat = { / back } } } yes } }
$then = {
$call = { id = 1017 }
}
}
## todo - kk
$if = {
$condition = { $EQ = { $get = { $concat = { $local.function_dir $concat = { / kk } } } yes } }
$then = {
$call = { id = 1017 }
$call = { id = 1016 i = 0 }
$call = { id = 1017 }
}
}
}
# change_sha
Event = {
id = 1015
# person - $input = { } # todo!
# computer - random!
$if = { $condition = { $EQ = { /Turn/now /State/person_stream } } # start at 1
$then = {
# todo - person play!
}
}
$else = {
$then = {
$assign = { /ChangeSha/sha value = { $rand = { 0 3 } } }
$assign = { /State/mode value = { /Mode/CHANGE_SHA_MODE } }
#debug..
$print = { value = { "change sha : " } }
$print = { value = { /ChangeSha/sha } }
$print = { value = { \n } }
}
}
}
# jump, next with gameover list.
Event = {
id = 1016
$parameter = { i }
# with PlayerGameOverList
$call = { id = 1 }
$if = {
$condition = { $EQ = { $element = { /PlayerGameOverList $add = { /Turn/now -1 } } no } }
$then = {
$return = { }
}
}
$else = {
$then = {
$call = { id = 1016 i = { $add = { $parameter.i 1 } } }
}
}
}
# back
Event = {
id = 1017
$call = { id = 200 }
}
# AttackPoint
AttackPoint = { total_point = 0 now_point = 0 }
# point incerase - id 1010
Event = {
id = 1010
$parameter = { point }
$assign = { /AttackPoint/now_point value = { $parameter.point } }
$assign = { /AttackPoint/total_point value = { $add = { /AttackPoint/total_point $parameter.point } } }
$assign = { /State/mode value = { /Mode/ATTACK_MODE } }
}
# point reset - id 1011
Event = {
id = 1011
$assign = { /AttackPoint/now_point value = { 0 } }
$assign = { /AttackPoint/total_point value = { 0 } }
}
# ChangeSha
ChangeSha = { sha = NONE }
# State
State = {
}
# init using insert2
Event =
{
id = 1100
$insert2 = { dir = { /State } value = { mode = /Mode/GENERAL_MODE } } ## why cf) mode = /Mode/GENEREAL_MODE
# add action_state = NONE EAT PUT
$insert2 = { dir = { /State } value = { action_state = NONE } }
$insert2 = { dir = { /State } value = { action_card = NONE } }
# add person_stream turn
$insert2 = { dir = { /State } value = { person_stream = -1 } }
}
# Person
# io
Person =
{
}
# Computer
# AI
Computer =
{
}
Event =
{
id = 1200
$parameter = { }
}
# Player(common)
# name list
# card list - done.
# game over : yes or no list
# next Turn
# back
PlayerNameList =
{
}
PlayerGameOverList =
{
}
Event = {
id = 3003
$call = { id = 3002 i = 0 }
}
Event = {
id = 3002
$parameter = { i }
$if = { $conditioin = { $COMP< = { $parameter.i /Info/PLAYER_NUM } }
$then = {
$insert2 = { dir = { /PlayerGameOverList } value = { no } }
$call = { id = 3002 i = { $add = { $parameter.i 1 } } }
}
}
}
Event = {
id = 3001
$call = { id = 3000 i = 0 j = 1 }
}
Event = {
id = 3000
$parameter = { i j }
$if = {
$condition = { $COMP< = { $parameter.i /Info/PLAYER_NUM } }
$then = {
$if = { $condition = { $NOTEQ = { $parameter.i /State/person_stream } }
$then = {
$insert2 = { dir = { /PlayerNameList } value = { $concat = { computer j } } }
$call = { id = 3000 i = { $add = { $parameter.i 1 } } j = { $add = { $parameter.j 1 } } }
}
}
$else = {
$then = {
$insert2 = { dir = { /PlayerNameList } value ={ person } }
$call = { id = 3000 i = { $add = { $parameter.i 1 } } j = { $parameter.j } }
}
}
}
}
}
Event =
{
id = 8
# inital playerCardList
$call = { id = 9 i = 0 }
}
Event =
{
id = 9
$parameter = { i }
$if = { condition = { $COMP< = { $parameter.i /Info/PLAYER_NUM } }
$then = {
$if = { $condition = { $EQ = { $parameter.i 0 } }
$then = { $make = { /PlayerCardList } }
}
$make = { data = { $concat_all = { /PlayerCardList/ $parameter.i } } }
$call = { id = 9 i = { $add = { $parameter.i 1 } } }
}
}
}
Event =
{
id = 52
$parameter = { card }
$call = {
id = 100
sha = { $get= {$concat = { $concat = { /Card $concat = { / $parameter.card } } /sha } } }
num = { $get= {$concat = { $concat = { /Card $concat = { / $parameter.card } } /num } } }
isBlackJoker = { $get= {$concat = { $concat = { /Card $concat = { / $parameter.card } } /isBlackJoker } } }
isColorJoker = { $get= {$concat = { $concat = { /Card $concat = { / $parameter.card } } /isColorJoker } } }
}
}
# Print Card
Event =
{
id = 51
$parameter = { i j }
$if = { $condition = { $COMP< = { $parameter.j $size = { $concat_all = { /PlayerCardList/ $parameter.i } } } }
$then = {
$call = {
id = 100
sha = { $get = {$concat = { $concat = { /Card $concat = { / $element = {
$concat_all = { /PlayerCardList/ $parameter.i } $parameter.j } } } /sha } } }
num = { $get = {$concat = { $concat = { /Card $concat = { / $element = {
$concat_all = { /PlayerCardList/ $parameter.i } $parameter.j } } } /num } } }
isBlackJoker = { $get = {$concat = { $concat = { /Card $concat = { / $element = { $concat_all = { /PlayerCardList/ $parameter.i } $parameter.j } } } /isBlackJoker } } }
isColorJoker = { $get = {$concat = { $concat = { /Card $concat = { / $element = { $concat_all = { /PlayerCardList/ $parameter.i } $parameter.j } } } /isColorJoker } } }
}
$print = { value = { "/" } }
$call = {
id = 51
i = { $parameter.i }
j = { $add = { $parameter.j 1 } }
}
}
}
}
# Print Card List
Event =
{
id = 50
$parameter = { i }
$if = { $condition = { $COMP< = { $parameter.i /Info/PLAYER_NUM } }
$then = {
$call = {
id = 51
i = { $parameter.i }
j = 0
}
$print = { value = { \n } }
$call = {
id = 50
i = { $add= { $parameter.i 1 } }
}
}
}
}
# Keyboard Input
#char
#int
#string
# $input = { } # cin >> string_type;
# $_getch = { } # _getch();
# Pause
# Total
Event =
{
id = 0
$local = { result }
#Action
$if = { $condition = { FALSE }
$then = { }
}
$else = {
$then = {
$call = { id = 201 } # init Turn.
$call = { id = 3 }
$call = { id = 5 }
$call = { id = 7 }
$call = { id = 8 }
$call = { id = 11 }
$call = { id = 21 }
#
$assign = { /PutCard/cardId value = { $pop_back = { /CardList } } }
$call = { id = 50 i = 0 } # debug test print!
# # test
$call = { id = 1001 }
$call = { id = 1006 put_card = 0 card = 0 mode = { /Mode/GENERAL_MODE } }
$assign = { $local.result value = { $return_value = { } } }
$print = { value = { $local.result } }
##~test
$call = { id = 1100 }
$call = { id = 1011 }
$call = { id = 3001 }
$call = { id = 3003 }
$call = { id = 1007 }
# # main call
$call = { id = 4001 }
}
}
$_getch = { }
}
Event = {
id = 4001
$option = { REMOVE_IF_CALL_ONESELF_EVENT }
$call = { id = 4000 }
$if = { $Condition = { $NOTEQ = { $return_value = { } /Mode/GAME_END_MODE } }
$then = {
$call = { id = 4001 }
}
}
}
Event = {
id = 4000
$local = { card idx }
#$clear_screen = { } # system( "cls" ); # in windows.
#$clear_screen = { }
# print turn
$print = { value = { /Turn/now } }
$print = { value = { \n } }
$print = { value = { /State/mode } }
$print = { value = { \n } }
# print player`s cards - $parameter = { id i n } # n==i
$call = { id = 50 i = 0 }
# print my card list
# print putCard
$call = { id = 52 card = { /PutCard/cardId } }
$print = { value = { \n } }
# print .
#$print = { value = { " : " } }
# input = �Դ´�. 0, �� 1~n
# input = $getch = { } #
# Card Put or Eat # <- state/action_state == PUT or EAT
$if = { # computer
$condition = {
$NOTEQ = { /Turn/now /State/person_stream }
}
$then = {
$assign = { /State/action_state value = { EAT } }
$call = { id = 4010 i = 0 n = 20 } # replace
#$print = { value = { $local.card } }
$if = {
$condition = { $EQ = { /State/action_state PUT } }
$then = {
$assign = { $local.card value = { $return_value = { } } }
$call = { id = 52 card = { $local.card } }
$print = { value = { \n } }
}
}
}
}
$else = { # person
$then = {
#
}
}
$print = { value = { /State/action_state } }
$if = {
$condition = { $EQ = { /State/action_state PUT } } # action_state initial event
$then = {
$assign = { /State/action_state value = { -1 } }
$call = { id = 1006 put_card = { /PutCard/cardId } card = { $local.card } mode = { /State/mode } }
$if = {
$condition = { $EQ = { FALSE $return_value = { } } }
$then = {
# for person!
$return = { /State/mode }
}
}
# one card chk
$if = {
$condition = { $EQ = { 2 $size = { $concat = { /PlayerCardList $concat = {