-
Notifications
You must be signed in to change notification settings - Fork 4
/
main.vb
executable file
·7540 lines (6954 loc) · 468 KB
/
main.vb
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
'
'
' main.vb This code is licenced under "Creative Commons Attribution Non Commercial 4.0 International"
' See: https://creativecommons.org/licenses/by-nc/4.0/legalcode
'
' This file is the main code for WinInnovation on the main.vb[Design] winform
' Conditional compile directives
#Const VERBOSE = True ' FK adding debugging Frame work via c compiler like if defs should be DEBUG but not sure about interference
#Const VERBOSE2 = False ' For too 2 much info tmi
Option Strict Off
Option Explicit On
Imports VB = Microsoft.VisualBasic
Imports Microsoft.VisualBasic.PowerPacks
Imports Microsoft.VisualBasic.Compatibility 'FK doesn't seem to do anything, but documenting anyway
Imports System.Collections.Generic
' Compiler/Build directives
#Disable Warning IDE1006 'Inherited code with variable names this suppresses: These words must begin with upper case characters
#Disable Warning IDE0054 'Inherited code with assignments (60) this suppresses: Use compound assignment x += 5 vs x = x + 5
#Disable Warning IDE0044 'Make field readonly warning messages are suppressed
#Disable Warning BC40000 'VB compatibility warning messages are suppressed
''''''''''''''''''''''''
'
' Main_Renamed - THe main code "container"
'
''''''''''''''''''''''''
Friend Class Main_Renamed
Inherits System.Windows.Forms.Form
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Integer, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Integer) As Integer
'Dim current_score, original_score As Object
Dim current_score, original_score As Integer
Dim original_ai_mode As Short
Dim already_returned(40) As Short
Dim found(110) As Object
Dim alert_found As Short
Dim splay_direction As String
Dim splay_options(5) As Short
Dim fake_deck(10, 20) As Object
Dim fake_hand(4, 100) As Short
Dim ai_cheat_level As Short
' FK Consts added for code readbility
' https://www.dotnetheaven.com/article/vb.net-const-and-read-only-member
' was using readonly but switched to const
Const AGECOUNT As Short = 9 ' FK Ages are 1-10 IRL, code uses 0-9
Const ICONCOUNT As Short = 6 ' FK Icons are 1-6 IRL Leaf. Castle, Lightbulb, Crown, Factory ,Clock, Code has an extra placeholder X
Const COLORCOUNT As Short = 4 ' FK Colors are 5 Yellow, Red, Purple, Blue, Green
Const MAXPLAYERS As Short = 3 ' FK 4 players max
Const TOTACHIEVE As Short = 13 ' FK 0-8 + 5 special achievements = 13
'Images
Dim color_images(10) As System.Drawing.Image
Dim icon_images(10) As System.Drawing.Image
Dim achievement_images(15) As System.Drawing.Image
Dim title_image As System.Drawing.Image
'Background colors
Public Dim background_colors = New Dictionary(Of String, Color) From {
{"Yellow", System.Drawing.Color.FromArgb(227, 224, 145)},
{"Red", System.Drawing.Color.FromArgb(216, 146, 144)},
{"Purple", System.Drawing.Color.FromArgb(161, 117, 180)},
{"Blue", System.Drawing.Color.FromArgb(132, 173, 217)},
{"Green", System.Drawing.Color.FromArgb(129, 187, 126)}
}
''''''''''''''''''''''''
'
' Menu Handlers
'
''''''''''''''''''''''''
' File-->Load menu
Private Sub LoadGameToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LoadGameToolStripMenuItem.Click
End Sub
' File-->Save menu
Private Sub SaveGameToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveGameToolStripMenuItem.Click
save_game()
End Sub
' File-->RestartNewGame menu
Private Sub RestartNewGameToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RestartNewGameToolStripMenuItem.Click
' fk nope Main_Load()
Application.Restart()
End Sub
' File-->exit menu
Private Sub MenuItem4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem.Click
Me.Close()
End Sub
' Help-->Rules menu
Private Sub AboutToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AboutToolStripMenuItem.Click
'ShowHelp()
End Sub
' Help-->Shortcuts menu
Private Sub ShortCutsToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ShortCutsToolStripMenuItem.Click
'ShowShortcuts()
End Sub
' Help-->About menu
Private Sub MenuItem3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AboutToolStripMenuItem1.Click
Dim frmAbout As New AboutBox
frmAbout.ShowDialog(Me)
'ShowAbout()
End Sub
''''''''''''''''''''''''
'
' Main Form "handler"
'
''''''''''''''''''''''''
Private Sub Main_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load
#If VERBOSE Then
Call append_simple("In Main_Load() -----------------------------")
#End If
alert_found = 0
num_players = 4
Call initialize_card_data()
Call initialize_images()
Call initialize_game()
Call start_new_game()
Call update_display()
End Sub
''''''''''''''''''''''''
'
' Main keybord keys "handler"
' Implemented keys:
' c - Continue
' n - new game
' r - restart game
' x - exit
'
''''''''''''''''''''''''
Private Sub Main_KeyDown(ByVal eventSender As System.Object, ByVal eventArgs As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
#If VERBOSE Then
Call append_simple("In Main_KeyDown +++ ")
#End If
Dim KeyCode As Short = eventArgs.KeyCode
Dim Shift As Short = eventArgs.KeyData \ &H10000
If KeyCode = System.Windows.Forms.Keys.R Then
Call load_game()
Call ready_for_action()
' Clear some random buttons
cmd2Players.Visible = False
cmd3Players.Visible = False
cmd4Players.Visible = False
cmbCheatLevel.Visible = False
lblCheatLevel.Visible = False
lblOtherApps.Visible = False
imgLarge.SendToBack()
Line1.BringToFront()
ElseIf KeyCode = System.Windows.Forms.Keys.N Then
phase = "new_game"
Call start_new_game()
ElseIf KeyCode = System.Windows.Forms.Keys.X Then
Me.Close()
ElseIf KeyCode = System.Windows.Forms.Keys.C Then
Call cmdNext_Click(cmdNext, New System.EventArgs())
End If
End Sub
''''''''''''''''''''''''
'
' debugging handler - not functioning
'
''''''''''''''''''''''''
Private Sub set_debug_values()
#If VERBOSE Then
Call append_simple("In set_debug_values() ++++++")
#End If
Dim card_name As String
card_name = "Sanitation"
test_card = -1
Exit Sub
'UPGRADE_WARNING: Couldn't resolve default property of object get_id_by_name(). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
test_card = get_id_by_name(card_name)
'UPGRADE_WARNING: Couldn't resolve default property of object get_id_by_name(). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
Call meld(3, get_id_by_name("Societies"))
'UPGRADE_WARNING: Couldn't resolve default property of object get_id_by_name(). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
Call meld(0, get_id_by_name("Evolution"))
'UPGRADE_WARNING: Couldn't resolve default property of object get_id_by_name(). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
Call meld(0, get_id_by_name("Medicine"))
'UPGRADE_WARNING: Couldn't resolve default property of object get_id_by_name(). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
Call meld(0, get_id_by_name("Medicine"))
'UPGRADE_WARNING: Couldn't resolve default property of object get_id_by_name(). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
Call meld(0, get_id_by_name("Clothing"))
'UPGRADE_WARNING: Couldn't resolve default property of object get_id_by_name(). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
Call meld(1, get_id_by_name("A.I."))
'Call meld(0, get_id_by_name("Canning"))
'UPGRADE_WARNING: Couldn't resolve default property of object get_id_by_name(). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
Call meld(2, get_id_by_name("Fermenting"))
'UPGRADE_WARNING: Couldn't resolve default property of object get_id_by_name(). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
Call meld(1, get_id_by_name("Machine Tools"))
'UPGRADE_WARNING: Couldn't resolve default property of object get_id_by_name(). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
Call meld(1, get_id_by_name("Masonry"))
'UPGRADE_WARNING: Couldn't resolve default property of object get_id_by_name(). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
Call meld(0, get_id_by_name("Gunpowder"))
'UPGRADE_WARNING: Couldn't resolve default property of object get_id_by_name(). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
Call meld(0, get_id_by_name("Coal"))
'Call meld(0, get_id_by_name("Software"))
' Meld the card we are testing
'Call meld(0, test_card)
Call meld(0, test_card)
Call meld(1, test_card)
hand(1, 0) = test_card
vps(2) = 1
'splayed(0, 1) = "Up"
Call Push2(score_pile, 0, get_id_by_name("Machine Tools"))
Call Push2(score_pile, 0, get_id_by_name("Machine Tools"))
Call Push2(score_pile, 0, get_id_by_name("Machine Tools"))
Call Push2(score_pile, 0, get_id_by_name("Machine Tools"))
'Call Push2(score_pile, 0, get_id_by_name("Alchemy"))
'Call Push2(score_pile, 0, get_id_by_name("Monotheism"))
'Call Push2(hand, 0, get_id_by_name("Engineering"))
'Call Push2(hand, 1, get_id_by_name("Engineering"))
'Call Push2(hand, 1, get_id_by_name("Engineering"))
'Call Push2(hand, 1, get_id_by_name("Engineering"))
'Call Push2(hand, 1, get_id_by_name("Engineering"))
Call Push2(score_pile, 1, get_id_by_name("Oars"))
Call Push2(score_pile, 0, get_id_by_name("Alchemy"))
Call Push2(score_pile, 1, get_id_by_name("Monotheism"))
Call Push2(score_pile, 2, get_id_by_name("Philosophy"))
Call Push2(score_pile, 2, get_id_by_name("Compass"))
Call Push2(score_pile, 3, get_id_by_name("Philosophy"))
Call Push2(score_pile, 3, get_id_by_name("Compass"))
'Call Push2(hand, 0, get_id_by_name("A.I."))
'Call Push2(hand, 0, get_id_by_name("A.I."))
'Call Push2(hand, 0, get_id_by_name("A.I."))
'Call Push2(hand, 0, get_id_by_name("A.I."))
Call Push2(hand, 1, get_id_by_name("Oars"))
Call Push2(hand, 1, get_id_by_name("Oars"))
Call Push2(hand, 1, get_id_by_name("A.I."))
End Sub
Private Function get_id_by_name(ByVal str_Renamed As String) As Object
Dim i As Short
For i = 0 To num_cards - 1
'MsgBox "comparing -" & title(i) & "- to -" & str & "-"
#If VERBOSE Then
Call append(0, "In get_id_by_name() ------ comparing - " & title(i) & " - to - " & str_Renamed & " - ")
#End If
If title(i) = str_Renamed Then
'UPGRADE_WARNING: Couldn't resolve default property of object get_id_by_name. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
get_id_by_name = i
Exit Function
End If
Next i
'UPGRADE_WARNING: Couldn't resolve default property of object get_id_by_name. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
get_id_by_name = -1
End Function
Private Sub cmbCards_SelectedIndexChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmbCards.SelectedIndexChanged
Dim i As Short
Dim txt As String
txt = cmbCards.SelectedItem.ToString()
For i = 0 To num_cards - 1
If txt = title(i) Then
Call load_picture(i)
End If
Next i
End Sub
Public Sub cmdCancel_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdCancel.Click
#If VERBOSE Then
Call append_simple("In cmdCancel_Click() -----------------------------")
#End If
Dim i, player As Short
player = 0
If phase = "pottery" Then
If human_data > 0 Then
Call draw_and_score(player, human_data)
End If
ElseIf phase = "currency" Then
For i = 0 To AGECOUNT
If already_returned(i) = 1 Then Call draw_and_score(player, 2)
Next i
ElseIf phase = "democracy" Then
If human_data >= democracy_minimum Then
Call draw_and_score(player, 8)
'UPGRADE_WARNING: Couldn't resolve default property of object dogma_copied. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
If player <> active_player Then dogma_copied = 1
democracy_minimum = human_data + 1
End If
ElseIf phase = "evolution" Then
If score_pile(player, 0) = -1 Then
Call draw_num(player, 1)
Else
'UPGRADE_WARNING: Couldn't resolve default property of object size2(). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
Call draw_num(player, age(score_pile(player, size2(score_pile, player) - 1)) + 1)
End If
ElseIf phase = "lighting" Then
For i = 0 To 9
If already_returned(i) = 1 Then Call draw_and_score(player, 7)
Next i
ElseIf phase = "antibiotics" Then
For i = 0 To AGECOUNT
If already_returned(i) = 1 Then
Call draw_num(player, 8)
Call draw_num(player, 8)
End If
Next i
ElseIf phase = "collaboration" Then
'UPGRADE_WARNING: Couldn't resolve default property of object find_card(). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
Call meld_from_hand(human_data, find_card(human_data, already_returned(0)))
'UPGRADE_WARNING: Couldn't resolve default property of object find_card(). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
Call transfer_card_in_hand(human_data, active_player, find_card(human_data, already_returned(1)))
'UPGRADE_WARNING: Couldn't resolve default property of object find_card(). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
Call meld_from_hand(active_player, find_card(active_player, already_returned(1)))
ElseIf phase = "suburbia" Then
For i = 1 To human_data
Call draw_and_score(player, 1)
Next i
End If
Call resume_dogma()
End Sub
Private Sub resume_dogma()
cmdCancel.Visible = False
cmdYes.Visible = False
cmdYes.Text = "Yes"
cmdOther.Visible = False
'MsgBox "changing player from " & dogma_player & " to " & dogma_player + 1
#If VERBOSE Then
Call append_simple("In resume_dogma() -----------------------------")
Call append(0, "In resume_dogma() -----changing player from " & dogma_player & " to " & dogma_player + 1)
#End If
'UPGRADE_WARNING: Couldn't resolve default property of object dogma_player. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
dogma_player = dogma_player + 1
phase = "playing game"
' If we are doing a normal dogma, proceed with that.
' Otherwise if we are solo-activating one, do that
'UPGRADE_WARNING: Couldn't resolve default property of object solo_dogma_id. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
If solo_dogma_id > -1 Then
'alert "resuming solo"
'UPGRADE_WARNING: Couldn't resolve default property of object solo_dogma_id. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
'UPGRADE_WARNING: Couldn't resolve default property of object solo_dogma_player. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
Call perform_solo_dogma_effect(solo_dogma_player, solo_dogma_id)
Else
'alert "resuming normal"
Call perform_dogma_effect_by_level(dogma_id)
End If
End Sub
Private Sub cmdDogma_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdDogma.Click
Dim index As Short = cmdDogma.GetIndex(eventSender)
Dim id As Short
id = board(0, index, 0)
Call perform_dogma_effect(id)
End Sub
Private Sub cmdNext_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdNext.Click
If cmdNext.Visible = True Then
cmdNext.Visible = False
Call play_game()
End If
End Sub
Private Sub cmdOddball_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdOddball.Click
#If VERBOSE Then
Call append_simple("In cmdOddball_Click() -----------------------------")
#End If
Dim index As Short = cmdOddball.GetIndex(eventSender)
Dim player, id As Object
Dim i As Short
'UPGRADE_WARNING: Couldn't resolve default property of object player. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
player = 0
If phase = "empiricism" Then
human_data = human_data - 1
cmdOddball(index).Visible = False
If human_data = 0 Then
'UPGRADE_WARNING: Couldn't resolve default property of object draw_num(). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
id = draw_num(player, 9)
If cmdOddball(color(id)).Visible = False Then
'UPGRADE_WARNING: Couldn't resolve default property of object find_card(). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
Call meld_from_hand(player, find_card(player, id))
For i = 0 To 4
cmdOddball(i).Visible = False
Next i
human_data = color(id)
Call show_prompt("empiricism2", "You may splay " & color_lookup(color(id)) & " Up.", 2)
Else
For i = 0 To 4
cmdOddball(i).Visible = False
Next i
Call resume_dogma()
End If
End If
ElseIf phase = "massMedia" Then
Call return_from_all_score_piles(index + 1)
For i = 0 To AGECOUNT
cmdOddball(i).Visible = False
Next i
Call resume_dogma()
End If
End Sub
Private Sub cmdScore_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdScore.Click
Call showArray.load_pictures(0, 0, "score")
End Sub
Private Sub cmdStack_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdStack.Click
#If VERBOSE Then
Call append_simple("In cmdStack_Click() -----------------------------")
#End If
Dim index As Short = cmdStack.GetIndex(eventSender)
Call showArray.load_pictures(0, index, "board")
End Sub
Private Sub cmdYes_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdYes.Click
#If VERBOSE Then
Call append_simple("In cmdYes_Click() -----------------------------")
#End If
'Dim player As Object
Dim i, player As Short
player = 0
If phase = "codeOfLawsA" Then
Call splay(0, human_data, "Left")
ElseIf phase = "canalBuilding" Then
Call exchange_canal_building(player)
ElseIf phase = "engineering" Then
'UPGRADE_WARNING: Couldn't resolve default property of object dogma_copied. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
If can_splay(player, 1) And active_player <> player Then dogma_copied = 1
Call splay(player, 1, "Left")
ElseIf phase = "feudalism" Then
'UPGRADE_WARNING: Couldn't resolve default property of object dogma_copied. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
If can_splay(player, 0) And active_player <> player Then dogma_copied = 1
Call splay(player, 0, "Left")
ElseIf phase = "machinery1" Then
'UPGRADE_WARNING: Couldn't resolve default property of object dogma_copied. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
If can_splay(player, 1) And active_player <> player Then dogma_copied = 1
Call splay(player, 1, "Left")
ElseIf phase = "paper" Then
'UPGRADE_WARNING: Couldn't resolve default property of object dogma_copied. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
If can_splay(player, 4) And active_player <> player Then dogma_copied = 1
Call splay(player, 4, "Left")
ElseIf phase = "enterprise" Or phase = "banking2" Then
'UPGRADE_WARNING: Couldn't resolve default property of object dogma_copied. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
If can_splay(player, 4) And active_player <> player Then dogma_copied = 1
'UPGRADE_WARNING: Couldn't resolve default property of object player. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
Call splay(player, 4, "Right")
ElseIf phase = "printingPress2" Or phase = "chemistry" Or phase = "atomicTheory" Then
'UPGRADE_WARNING: Couldn't resolve default property of object dogma_copied. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
If can_splay(player, 3) And active_player <> player Then dogma_copied = 1
Call splay(player, 3, "Right")
ElseIf phase = "reformation" Then
'UPGRADE_WARNING: Couldn't resolve default property of object dogma_copied. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
If can_splay(player, 0) And active_player <> player Then dogma_copied = 1
Call splay(player, 0, "Right")
ElseIf phase = "coal2" Then
'UPGRADE_WARNING: Couldn't resolve default property of object dogma_copied. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
If can_splay(player, 1) And active_player <> player Then dogma_copied = 1
Call splay(player, 1, "Right")
ElseIf phase = "statistics2" Or phase = "canning2" Then
'UPGRADE_WARNING: Couldn't resolve default property of object dogma_copied. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
If can_splay(player, 0) And active_player <> player Then dogma_copied = 1
Call splay(player, 0, "Right")
ElseIf phase = "canning" Then
Call draw_and_tuck(player, 6)
For i = 0 To 4
If board(player, i, 0) > -1 Then
If Not card_has_symbol(board(player, i, 0), 5) Then
Call score_top_card(player, i)
End If
End If
Next i
ElseIf phase = "emancipation2" Or phase = "industrialization2" Then
'UPGRADE_WARNING: Couldn't resolve default property of object dogma_copied. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
If can_splay(player, 1) And active_player <> player Then dogma_copied = 1
Call splay(player, 1, "Right")
ElseIf phase = "metricSystem2" Then
'UPGRADE_WARNING: Couldn't resolve default property of object dogma_copied. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
If can_splay(player, 4) And active_player <> player Then dogma_copied = 1
Call splay(player, 4, "Right")
ElseIf phase = "bicycle" Then
Call exchange_bicycle(player)
ElseIf phase = "evolution" Then
Call draw_and_score(player, 8)
lblPrompt.Text = "Choose a card in your score pile to return."
phase = "evolution2"
cmdCancel.Visible = False
cmdYes.Visible = False
Exit Sub
ElseIf phase = "publications2" Then
'UPGRADE_WARNING: Couldn't resolve default property of object dogma_copied. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
If can_splay(player, 0) And active_player <> player Then dogma_copied = 1
Call splay(player, 0, "Up")
ElseIf phase = "empiricism2" Then
'UPGRADE_WARNING: Couldn't resolve default property of object dogma_copied. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
If can_splay(player, human_data) And active_player <> player Then dogma_copied = 1
Call splay(player, human_data, "Up")
ElseIf phase = "flight2" Then
'UPGRADE_WARNING: Couldn't resolve default property of object dogma_copied. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
If can_splay(player, 1) And active_player <> player Then dogma_copied = 1
Call splay(player, 1, "Up")
ElseIf phase = "massMedia2" Or phase = "satellites2" Then
'UPGRADE_WARNING: Couldn't resolve default property of object dogma_copied. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
If can_splay(player, 2) And active_player <> player Then dogma_copied = 1
Call splay(player, 2, "Up")
ElseIf phase = "collaboration" Then
'UPGRADE_WARNING: Couldn't resolve default property of object find_card(). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
Call meld_from_hand(human_data, find_card(human_data, already_returned(1)))
'UPGRADE_WARNING: Couldn't resolve default property of object find_card(). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
Call transfer_card_in_hand(human_data, active_player, find_card(human_data, already_returned(0)))
'UPGRADE_WARNING: Couldn't resolve default property of object find_card(). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
Call meld_from_hand(active_player, find_card(active_player, already_returned(0)))
ElseIf phase = "computers" Then
'UPGRADE_WARNING: Couldn't resolve default property of object dogma_copied. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
If can_splay(player, 1) And active_player <> player Then dogma_copied = 1
Call splay(player, 1, "Up")
ElseIf phase = "specialization2" Then
'UPGRADE_WARNING: Couldn't resolve default property of object dogma_copied. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
If can_splay(player, 0) And active_player <> player Then dogma_copied = 1
Call splay(player, 0, "Up")
ElseIf phase = "stemCells" Then
'UPGRADE_WARNING: Couldn't resolve default property of object dogma_copied. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
If active_player <> player Then dogma_copied = 1
'UPGRADE_WARNING: Couldn't resolve default property of object size2(hand, player). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
For i = size2(hand, player) - 1 To 0 Step -1
Call score_from_hand(player, 0)
Next i
ElseIf phase = "theInternet" Then
'UPGRADE_WARNING: Couldn't resolve default property of object dogma_copied. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
If can_splay(player, 4) And active_player <> player Then dogma_copied = 1
Call splay(player, 4, "Up")
End If
Call resume_dogma()
End Sub
Private Sub cmdOther_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdOther.Click
#If VERBOSE Then
Call append_simple("In cmdOther_Click() -----------------------------")
#End If
Dim player As Short
player = 0
If phase = "feudalism" Then
'UPGRADE_WARNING: Couldn't resolve default property of object dogma_copied. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
If can_splay(player, 2) And active_player <> player Then dogma_copied = 1
Call splay(player, 2, "Left")
ElseIf phase = "paper" Then
'UPGRADE_WARNING: Couldn't resolve default property of object dogma_copied. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
If can_splay(player, 3) And active_player <> player Then dogma_copied = 1
Call splay(player, 3, "Left")
ElseIf phase = "reformation" Or phase = "emancipation2" Or phase = "industrialization2" Then
'UPGRADE_WARNING: Couldn't resolve default property of object dogma_copied. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
If can_splay(player, 2) And active_player <> player Then dogma_copied = 1
Call splay(player, 2, "Right")
ElseIf phase = "publications2" Then
'UPGRADE_WARNING: Couldn't resolve default property of object dogma_copied. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
If can_splay(player, 3) And active_player <> player Then dogma_copied = 1
Call splay(player, 3, "Up")
ElseIf phase = "computers" Then
'UPGRADE_WARNING: Couldn't resolve default property of object dogma_copied. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
If can_splay(player, 4) And active_player <> player Then dogma_copied = 1
Call splay(player, 4, "Up")
ElseIf phase = "specialization2" Then
'UPGRADE_WARNING: Couldn't resolve default property of object dogma_copied. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
If can_splay(player, 3) And active_player <> player Then dogma_copied = 1
Call splay(player, 3, "Up")
End If
Call resume_dogma()
End Sub
Public Sub play_game()
#If VERBOSE Then
Call append(0, "In play_game() -- before phase = " & phase & " ai_mode = " & ai_mode & " break_dogma_loop = " & break_dogma_loop)
#End If
Dim i, gss_count As Short
'MsgBox "before" & phase & " " & ai_mode & " " & break_dogma_loop
'UPGRADE_WARNING: Couldn't resolve default property of object break_dogma_loop. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
If phase = "new_game" Or ai_mode = 1 Or break_dogma_loop = 1 Then Exit Sub
'MsgBox "after"
' If there are no actions remaining, move on to the next player
Call update_display()
If actions_remaining = 0 Then
'alert ("out of actions")
For i = 0 To num_players - 1
winners(i) = 0
'UPGRADE_WARNING: Couldn't resolve default property of object scored_this_turn(i). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
scored_this_turn(i) = 0
tucked_this_turn(i) = 0
Next i
gss_count = 1
'For i = 0 To 2
' lblPlayerDetail(i) = score_game_individual(i + 1)
'Next i
cmdNext.Visible = True
cmdNext.Focus()
current_turn = current_turn + 1
active_player = (active_player + 1) Mod num_players
actions_remaining = 2
If current_turn = 2 And num_players = 4 Then actions_remaining = 1
#If VERBOSE Then
Call append_simple("In play_game?() -----------------------------")
#Else
Call append_simple("-----------------------------")
#End If
If active_player = 0 Then Call save_game()
End If
If active_player = 0 Then
Call ready_for_action()
Else
Call wait_for_next_action()
Call perform_AI_action()
End If
End Sub
Private Sub perform_AI_action()
If actions_remaining = 1 Then
#If VERBOSE Then
Call append_simple("In perform_AI_action() -----------------------------")
#Else
Call append_simple("-----------------------------")
#End If
End If
Dim choices(9) As Object
'Dim cheat As Object
Dim cheat, num As Short
ai_mode = 1
'UPGRADE_WARNING: Couldn't resolve default property of object gss_count. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
gss_count = 0
'UPGRADE_WARNING: Couldn't resolve default property of object gs_count. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
gs_count = 1
'MsgBox "looking to pick a move"
#If VERBOSE Then
Call append_simple("perform_AI_action() looking to pick a move ----")
#End If
' Fake data depending on cheat level
cheat = 1
num = Int(100 * Rnd())
If num >= (30 + 14 * ai_cheat_level) Then
cheat = 0
'MsgBox "not cheating " & num & " vs " & 30 + 14 * ai_cheat_level
#If VERBOSE Then
Call append(0, "perform_AI_action() Not cheating " & num & " vs " & 30 + 14 * ai_cheat_level)
#End If
Call fake_data(active_player)
Else
'MsgBox "cheating " & num & " vs " & 30 + 14 * ai_cheat_level
#If VERBOSE Then
Call append(0, "In perform_AI_action() cheating " & num & " vs " & 30 + 14 * ai_cheat_level)
#End If
End If
Call pick_ai_move(active_player, choices, 0)
ai_mode = 0
'If choices(0) > 0 Then MsgBox "choice: " & choices(0)
'MsgBox "picked " & choices(0) & " and " & choices(1) & " ai_mode = " & ai_mode
#If VERBOSE Then
Call append(0, "In perform_AI_action() picked " & choices(0) & " and " & choices(1) & " ai_mode = " & ai_mode)
#End If
' Unfake data
If cheat = 0 Then
Call unfake_data(active_player)
End If
Call make_ai_move(active_player, choices, 0)
'MsgBox "Made move " & choices(0) & " ai_mode = " & ai_mode
#If VERBOSE Then
Call append(0, "In perform_AI_action() Made move " & choices(0) & " ai_mode = " & ai_mode)
#End If
' Automatically continue the game if a non-dogma action was taken, or
' if the human player is next
'If (actions_remaining > 0 And choices(0) <> 2) Or (actions_remaining = 0 And active_player = num_players - 1) Then Call play_game
'Call wait_for_next_action
End Sub
Private Sub ready_for_action()
#If VERBOSE Then
Call append_simple("In ready_for_action() ++++++")
#End If
Dim i As Short
phase = "waiting for action"
lblActionsRemaining.Text = "Actions Remaining: " & actions_remaining
lblActionsRemaining.Visible = True
lblPrompt.Visible = True
lblPrompt.Text = "Please choose an action. To Achieve, click on the unclaimed achievement you would like to claim."
cmdDraw.Visible = True
'UPGRADE_WARNING: Couldn't resolve default property of object find_next_draw(). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
cmdDraw.Text = "Draw a " & find_next_draw(0)
cmdNext.Visible = False
For i = 0 To COLORCOUNT
'UPGRADE_WARNING: Couldn't resolve default property of object size3(board, 0, i). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
If size3(board, 0, i) > 0 Then cmdDogma(i).Visible = True
Next i
End Sub
Private Sub disable_actions()
Dim i As Short
lblPrompt.Visible = True
lblActionsRemaining.Visible = False
cmdDraw.Visible = False
For i = 0 To 4
cmdDogma(i).Visible = False
Next i
End Sub
Private Sub cmd2Players_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmd2Players.Click
Call launch_game(2)
End Sub
Private Sub cmd3Players_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmd3Players.Click
Call launch_game(3)
End Sub
Private Sub cmd4Players_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmd4Players.Click
Call launch_game(4)
End Sub
Private Sub cmdDraw_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdDraw.Click
draw((0))
'MsgBox "pre actions remaining: " & actions_remaining
#If VERBOSE Then
Call append(0, "In cmdDraw_Click() ++++ pre actions remaining: " & actions_remaining)
#End If
actions_remaining = actions_remaining - 1
Call play_game()
End Sub
Private Sub launch_game(ByRef players As Object)
' FK below is an extra initialize game?? nope removing first one
' Call initialize_game()
#If VERBOSE Then
Call append_simple("In launch_game() ++++++")
#End If
' Clear some random buttons
ai_cheat_level = cmbCheatLevel.SelectedIndex
cmd2Players.Visible = False
cmd3Players.Visible = False
cmd4Players.Visible = False
lblOtherApps.Visible = False
cmbCheatLevel.Visible = False
lblCheatLevel.Visible = False
imgLarge.SendToBack()
Line1.BringToFront()
'UPGRADE_WARNING: Couldn't resolve default property of object players. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
num_players = players
'Dim i As Object FK
Dim i, j As Short
' Hide all information for players not playing the game
For i = 1 To num_players - 1
lblPlayer(i).Visible = True
lblPlayerDetail(i - 1).Visible = True
For j = 0 To 5
lblIcon(i + j * 4).Visible = True
Next j
lblVP(i).Visible = True
lblScore(i).Visible = True
Next i
For i = num_players To 3
lblPlayer(i).Visible = False
lblPlayerDetail(i - 1).Visible = False
For j = 0 To 5
lblIcon(i + j * 4).Visible = False
Next j
lblVP(i).Visible = False
lblScore(i).Visible = False
Next i
' Remove the top card from each deck 1-9 IRL these are cards are used for scoring
For i = 0 To 8
deck(i, size2(deck, i) - 1) = -1
Next i
' Give every player 2 cards
For i = 0 To num_players - 1
Call draw_num(i, 1)
Call draw_num(i, 1)
Next i
' Read the debug file and update the board state accordingly
'UPGRADE_NOTE: str was upgraded to str_Renamed. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"'
Dim filename As Object
Dim str_Renamed = ""
#If VERBOSE Then
Call append_simple("In launch_game() ++++++ Read the debug file and update the board state accordingly /testing.txt")
#End If
Dim id, pos As Short
'UPGRADE_WARNING: Couldn't resolve default property of object filename. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
filename = My.Application.Info.DirectoryPath & "/testing.txt"
'UPGRADE_WARNING: Couldn't resolve default property of object filename. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
'UPGRADE_WARNING: Dir has a new behavior. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="9B7D5ADD-D8FE-4819-A36C-6DEDAF088CC7"'
If Dir(filename) <> "" Then
'UPGRADE_WARNING: Couldn't resolve default property of object filename. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
FileOpen(1, filename, OpenMode.Input)
#If VERBOSE Then
Call append_simple("In BROKEN launch_game() found /testing.txt ++++++")
#End If
While Not EOF(1)
Input(1, str_Renamed)
If Mid(str_Renamed, 1, 1) <> "'" Then
pos = InStr(str_Renamed, ":")
If pos > 0 Then
'MsgBox Mid(str, 1, pos - 1)
'UPGRADE_WARNING: Couldn't resolve default property of object get_id_by_name(). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
id = get_id_by_name(Mid(str_Renamed, 1, pos - 1))
pos = InStr(str_Renamed, "hand")
If pos > 0 Then
i = Val(Mid(str_Renamed, pos + 4, 1)) - 1
Call Push2(hand, i, id)
End If
pos = InStr(str_Renamed, "score")
If pos > 0 Then
i = Val(Mid(str_Renamed, pos + 5, 1)) - 1
Call Push2(score_pile, i, id)
End If
pos = InStr(str_Renamed, "topcard")
If pos > 0 Then
i = Val(Mid(str_Renamed, pos + 7, 1)) - 1
Call Unshift3(board, i, color(id), id)
End If
pos = InStr(str_Renamed, "tuck")
If pos > 0 Then
i = Val(Mid(str_Renamed, pos + 4, 1)) - 1
Call Push3(board, i, color(id), id)
End If
End If
End If
End While
FileClose(1)
Else
Call append_simple(" ") ' FK not sure if this required don't want blank endif ifdef isn't there?
#If VERBOSE Then
Call append_simple("In launch_game() /testing.txt ++++++ NOT FOUND")
#End If
End If
Call update_icon_total()
phase = "initial_meld"
lblPrompt.Text = "Choose a card to meld by clicking on a card in your hand. The person melding the lowest card alphabetically will play first."
Call load_picture(hand(0, 0))
Call set_debug_values()
#If VERBOSE Then
Call append_simple("In launch_game() set_debug_values() DISABLED ")
' this call below was being used all the time but not much was being done
' Call set_debug_values()
#End If
' Update the display
Call update_display()
End Sub
Private Sub start_new_game()
' Choose the number of players
#If VERBOSE Then
Call append_simple("In start_new_game() ++++++ Choose the number of players")
#End If
lblPrompt.Text = "Welcome to WinInnovation AI. How many AI players would you like in this game?"
lblActionsRemaining.Visible = False
cmd2Players.Visible = True
cmd3Players.Visible = True
cmd4Players.Visible = True
lblOtherApps.Visible = True
'FK stoping from displaying doesn't seem to do anything leaving code in for now
'cmbCheatLevel.Visible = True
'lblCheatLevel.Visible = True
cmbCheatLevel.Visible = False
lblCheatLevel.Visible = False
cmdNext.Visible = False
cmdDraw.Visible = False
imgLarge.Image = title_image
imgLarge.BringToFront()
phase = "new_game"
'UPGRADE_WARNING: Couldn't resolve default property of object break_dogma_loop. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
break_dogma_loop = 1
End Sub
Private Sub initialize_game()
#If VERBOSE Then
Call append_simple("In initialize_game() ++++++")
#End If
Dim i, j As Short
' Set all scores to 0
For i = 0 To MAXPLAYERS
'UPGRADE_WARNING: Couldn't resolve default property of object scores(i). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
scores(i) = 0
vps(i) = 0
Next i
' Empty hands, score piles, and boards
For i = 0 To MAXPLAYERS
hand(i, 0) = -1
score_pile(i, 0) = -1
For j = 0 To 4
board(i, j, 0) = -1
splayed(i, j) = ""
Next j
Next i
' Create new decks and shuffle them
' FK Why 11 decks? is he using 0 as an index??
For i = 0 To 10
deck(i, 0) = -1
Next i
'For i = 0 To num_cards - 1
For i = num_cards - 1 To 0 Step -1
Call Push2(deck, age(i) - 1, i)
Next i
For i = 0 To AGECOUNT
Call randomize_array2(deck, i)
Next i
' FK not sure what line is doing below but it "empties" textbox1 ????
' txtLog.Text = ""
' Unclaim all achievements
For i = 0 To TOTACHIEVE
achievements_scored(i) = 0
lblAchievement(i).Visible = True
Next i
Call update_display()
End Sub
Private Sub fake_data(ByVal player As Short)
#If VERBOSE Then
Call append_simple("In fake_data() ++++++")
#End If
' FK converted
' Dim j, i, r As Object
Dim j, i, r, yes As Short
' Fake the decks
For i = 0 To AGECOUNT
Call copy_array2(deck, fake_deck, i)
Call randomize_array2(deck, i)
Next i
' Fake player hands
For i = 0 To num_players - 1
If i <> player Then
Call copy_array2(hand, fake_hand, i)
'UPGRADE_WARNING: Couldn't resolve default property of object size2(hand, i). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
For j = 0 To size2(hand, i) - 1
yes = 1
While (yes)
r = Int(num_cards * Rnd())
If age(r) = age(hand(i, j)) Then
hand(i, j) = r
yes = 0
End If
End While
Next j
End If
Next i
End Sub
Private Sub unfake_data(ByVal player As Short)
#If VERBOSE Then
Call append_simple("In unfake_data() -----------------------------")
#End If
Dim i As Short
' UnFake the decks
For i = 0 To AGECOUNT