-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathstates.inc.php
695 lines (638 loc) · 35.3 KB
/
states.inc.php
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
<?php
/**
*------
* BGA framework: © Gregory Isabelli <gisabelli@boardgamearena.com> & Emmanuel Colin <ecolin@boardgamearena.com>
* SevenWondersDuel implementation : © Koen Heltzel <koenheltzel@gmail.com>
*
* This code has been produced on the BGA studio platform for use on http://boardgamearena.com.
* See http://en.boardgamearena.com/#!doc/Studio for more information.
* -----
*
* states.inc.php
*
* SevenWondersDuel game states description
*
*/
/*
Game state machine is a tool used to facilitate game developpement by doing common stuff that can be set up
in a very easy way from this configuration file.
Please check the BGA Studio presentation about game state to understand this, and associated documentation.
Summary:
States types:
_ activeplayer: in this type of state, we expect some action from the active player.
_ multipleactiveplayer: in this type of state, we expect some action from multiple players (the active players)
_ game: this is an intermediary state where we don't expect any actions from players. Your game logic must decide what is the next game state.
_ manager: special type for initial and final state
Arguments of game states:
_ name: the name of the GameState, in order you can recognize it on your own code.
_ description: the description of the current game state is always displayed in the action status bar on
the top of the game. Most of the time this is useless for game state with "game" type.
_ descriptionmyturn: the description of the current game state when it's your turn.
_ type: defines the type of game states (activeplayer / multipleactiveplayer / game / manager)
_ action: name of the method to call when this game state become the current game state. Usually, the
action method is prefixed by "st" (ex: "stMyGameStateName").
_ possibleactions: array that specify possible player actions on this step. It allows you to use "checkAction"
method on both client side (Javacript: this.checkAction) and server side (PHP: self::checkAction).
_ transitions: the transitions are the possible paths to go from a game state to another. You must name
transitions in order to use transition names in "nextState" PHP method, and use IDs to
specify the next game state for each transition.
_ args: name of the method to call to retrieve arguments for this gamestate. Arguments are sent to the
client side to be used on "onEnteringState" or to set arguments in the gamestate description.
_ updateGameProgression: when specified, the game progression is updated (=> call to your getGameProgression
method).
*/
// !! It is not a good idea to modify this file when a game is running !!
$midGameTransitions = [
// With Pantheon + Agora, the state machine transitions became unmanagable because of the exponential increase
// in possibilities, so we allow most transitions now during mid-game states. The rules enforcement is done by
// the code in the "possibleactions" implementations.
// Note that even before, when the transitions were defined more implicitly, there were many transitions
// for edge cases (so contextual transitions), so rules enforcement was never done through transition
// definitions (that would require to have a lot of game logic checks in this file, basically the
// "possibleactions" implementations).
SevenWondersDuel::STATE_WONDER_SELECTED_NAME => SevenWondersDuel::STATE_WONDER_SELECTED_ID,
SevenWondersDuel::STATE_SELECT_START_PLAYER_NAME => SevenWondersDuel::STATE_SELECT_START_PLAYER_ID,
SevenWondersDuel::STATE_START_PLAYER_SELECTED_NAME => SevenWondersDuel::STATE_START_PLAYER_SELECTED_ID,
SevenWondersDuel::STATE_PLAYER_TURN_NAME => SevenWondersDuel::STATE_PLAYER_TURN_ID,
SevenWondersDuel::STATE_CHOOSE_CONSPIRATOR_ACTION_NAME => SevenWondersDuel::STATE_CHOOSE_CONSPIRATOR_ACTION_ID,
SevenWondersDuel::STATE_CONSPIRE_NAME => SevenWondersDuel::STATE_CONSPIRE_ID,
SevenWondersDuel::STATE_CHOOSE_CONSPIRE_REMNANT_POSITION_NAME => SevenWondersDuel::STATE_CHOOSE_CONSPIRE_REMNANT_POSITION_ID,
SevenWondersDuel::STATE_SENATE_ACTIONS_NAME => SevenWondersDuel::STATE_SENATE_ACTIONS_ID,
SevenWondersDuel::STATE_PLACE_INFLUENCE_NAME => SevenWondersDuel::STATE_PLACE_INFLUENCE_ID,
SevenWondersDuel::STATE_MOVE_INFLUENCE_NAME => SevenWondersDuel::STATE_MOVE_INFLUENCE_ID,
SevenWondersDuel::STATE_REMOVE_INFLUENCE_NAME => SevenWondersDuel::STATE_REMOVE_INFLUENCE_ID,
SevenWondersDuel::STATE_TRIGGER_UNPREPARED_CONSPIRACY_NAME => SevenWondersDuel::STATE_TRIGGER_UNPREPARED_CONSPIRACY_ID,
SevenWondersDuel::STATE_CONSTRUCT_BUILDING_FROM_BOX_NAME => SevenWondersDuel::STATE_CONSTRUCT_BUILDING_FROM_BOX_ID,
SevenWondersDuel::STATE_CONSTRUCT_LAST_ROW_BUILDING_NAME => SevenWondersDuel::STATE_CONSTRUCT_LAST_ROW_BUILDING_ID,
SevenWondersDuel::STATE_DESTROY_CONSTRUCTED_WONDER_NAME => SevenWondersDuel::STATE_DESTROY_CONSTRUCTED_WONDER_ID,
SevenWondersDuel::STATE_DISCARD_AVAILABLE_CARD_NAME => SevenWondersDuel::STATE_DISCARD_AVAILABLE_CARD_ID,
SevenWondersDuel::STATE_LOCK_PROGRESS_TOKEN_NAME => SevenWondersDuel::STATE_LOCK_PROGRESS_TOKEN_ID,
SevenWondersDuel::STATE_MOVE_DECREE_NAME => SevenWondersDuel::STATE_MOVE_DECREE_ID,
SevenWondersDuel::STATE_SWAP_BUILDING_NAME => SevenWondersDuel::STATE_SWAP_BUILDING_ID,
SevenWondersDuel::STATE_TAKE_BUILDING_NAME => SevenWondersDuel::STATE_TAKE_BUILDING_ID,
SevenWondersDuel::STATE_TAKE_UNCONSTRUCTED_WONDER_NAME => SevenWondersDuel::STATE_TAKE_UNCONSTRUCTED_WONDER_ID,
SevenWondersDuel::STATE_PLAYER_SWITCH_NAME => SevenWondersDuel::STATE_PLAYER_SWITCH_ID,
SevenWondersDuel::STATE_CHOOSE_AND_PLACE_DIVINITY_NAME => SevenWondersDuel::STATE_CHOOSE_AND_PLACE_DIVINITY_ID,
SevenWondersDuel::STATE_DECONSTRUCT_WONDER_NAME => SevenWondersDuel::STATE_DECONSTRUCT_WONDER_ID,
SevenWondersDuel::STATE_CONSTRUCT_WONDER_WITH_DISCARDED_BUILDING_NAME => SevenWondersDuel::STATE_CONSTRUCT_WONDER_WITH_DISCARDED_BUILDING_ID,
SevenWondersDuel::STATE_CHOOSE_ENKI_PROGRESS_TOKEN_NAME => SevenWondersDuel::STATE_CHOOSE_ENKI_PROGRESS_TOKEN_ID,
SevenWondersDuel::STATE_PLACE_SNAKE_TOKEN_NAME => SevenWondersDuel::STATE_PLACE_SNAKE_TOKEN_ID,
SevenWondersDuel::STATE_DISCARD_AGE_CARD_NAME => SevenWondersDuel::STATE_DISCARD_AGE_CARD_ID,
SevenWondersDuel::STATE_PLACE_MINERVA_TOKEN_NAME => SevenWondersDuel::STATE_PLACE_MINERVA_TOKEN_ID,
SevenWondersDuel::STATE_DISCARD_MILITARY_TOKEN_NAME => SevenWondersDuel::STATE_DISCARD_MILITARY_TOKEN_ID,
SevenWondersDuel::STATE_APPLY_MILITARY_TOKEN_NAME => SevenWondersDuel::STATE_APPLY_MILITARY_TOKEN_ID,
SevenWondersDuel::STATE_CHOOSE_DIVINITY_FROM_TOP_CARDS_NAME => SevenWondersDuel::STATE_CHOOSE_DIVINITY_FROM_TOP_CARDS_ID,
SevenWondersDuel::STATE_CHOOSE_DIVINITY_DECK_NAME => SevenWondersDuel::STATE_CHOOSE_DIVINITY_DECK_ID,
SevenWondersDuel::STATE_CHOOSE_DIVINITY_FROM_DECK_NAME => SevenWondersDuel::STATE_CHOOSE_DIVINITY_FROM_DECK_ID,
SevenWondersDuel::STATE_CHOOSE_PROGRESS_TOKEN_NAME => SevenWondersDuel::STATE_CHOOSE_PROGRESS_TOKEN_ID,
SevenWondersDuel::STATE_CHOOSE_OPPONENT_BUILDING_NAME => SevenWondersDuel::STATE_CHOOSE_OPPONENT_BUILDING_ID,
SevenWondersDuel::STATE_CHOOSE_PROGRESS_TOKEN_FROM_BOX_NAME => SevenWondersDuel::STATE_CHOOSE_PROGRESS_TOKEN_FROM_BOX_ID,
SevenWondersDuel::STATE_CHOOSE_DISCARDED_BUILDING_NAME => SevenWondersDuel::STATE_CHOOSE_DISCARDED_BUILDING_ID,
SevenWondersDuel::STATE_NEXT_PLAYER_TURN_NAME => SevenWondersDuel::STATE_NEXT_PLAYER_TURN_ID,
SevenWondersDuel::STATE_GAME_END_DEBUG_NAME => SevenWondersDuel::STATE_GAME_END_DEBUG_ID,
SevenWondersDuel::ZOMBIE_PASS => SevenWondersDuel::STATE_NEXT_PLAYER_TURN_ID,
];
$machinestates = [
// The initial state. Please do not modify.
SevenWondersDuel::STATE_GAME_SETUP_ID => [
"name" => SevenWondersDuel::STATE_GAME_SETUP_NAME,
"description" => "",
"type" => "manager",
"action" => "enterStateGameSetup",
"transitions" => ["" => SevenWondersDuel::STATE_SELECT_WONDER_ID]
],
SevenWondersDuel::STATE_SELECT_WONDER_ID => [
"name" => SevenWondersDuel::STATE_SELECT_WONDER_NAME,
"description" => clienttranslate('${actplayer} must choose a wonder'),
"descriptionmyturn" => clienttranslate('${you} must choose a wonder'),
"type" => "activeplayer",
"action" => "enterStateSelectWonder",
"args" => "argSelectWonder",
"possibleactions" => [
"actionSelectWonder",
],
"transitions" => [
SevenWondersDuel::STATE_WONDER_SELECTED_NAME => SevenWondersDuel::STATE_WONDER_SELECTED_ID,
SevenWondersDuel::STATE_CONSPIRE_NAME => SevenWondersDuel::STATE_CONSPIRE_ID,
SevenWondersDuel::STATE_PLACE_INFLUENCE_NAME => SevenWondersDuel::STATE_PLACE_INFLUENCE_ID,
]
],
SevenWondersDuel::STATE_WONDER_SELECTED_ID => [
"name" => SevenWondersDuel::STATE_WONDER_SELECTED_NAME,
"description" => '',
"descriptionmyturn" => '',
"type" => "game",
"action" => "enterStateWonderSelected",
"updateGameProgression" => true,
"transitions" => [
SevenWondersDuel::STATE_SELECT_WONDER_NAME => SevenWondersDuel::STATE_SELECT_WONDER_ID,
SevenWondersDuel::STATE_NEXT_AGE_NAME => SevenWondersDuel::STATE_NEXT_AGE_ID
]
],
SevenWondersDuel::STATE_NEXT_AGE_ID => [
"name" => SevenWondersDuel::STATE_NEXT_AGE_NAME,
"description" => clienttranslate('Preparing Age ${ageRoman}...'),
"descriptionmyturn" => clienttranslate('Preparing Age ${ageRoman}...'),
"type" => "game",
"action" => "enterStateNextAge",
"args" => "argNextAge",
"transitions" => [
SevenWondersDuel::STATE_SELECT_START_PLAYER_NAME => SevenWondersDuel::STATE_SELECT_START_PLAYER_ID,
SevenWondersDuel::STATE_PLAYER_TURN_NAME => SevenWondersDuel::STATE_PLAYER_TURN_ID
]
],
SevenWondersDuel::STATE_SELECT_START_PLAYER_ID => [
"name" => SevenWondersDuel::STATE_SELECT_START_PLAYER_NAME,
"description" => clienttranslate('${actplayer} must choose who begins Age ${ageRoman}'),
"descriptionmyturn" => clienttranslate('${you} must choose who begins Age ${ageRoman}'),
"type" => "activeplayer",
"action" => "enterStateSelectStartPlayer",
"args" => "argSelectStartPlayer",
"possibleactions" => [
"actionSelectStartPlayer",
],
"transitions" => [
SevenWondersDuel::STATE_START_PLAYER_SELECTED_NAME => SevenWondersDuel::STATE_START_PLAYER_SELECTED_ID
]
],
SevenWondersDuel::STATE_START_PLAYER_SELECTED_ID => [
"name" => SevenWondersDuel::STATE_START_PLAYER_SELECTED_NAME,
"description" => '',
"descriptionmyturn" => '',
"type" => "game",
"action" => "enterStateStartPlayerSelected",
"transitions" => [
SevenWondersDuel::STATE_PLAYER_TURN_NAME => SevenWondersDuel::STATE_PLAYER_TURN_ID,
]
],
SevenWondersDuel::STATE_PLAYER_TURN_ID => [
"name" => SevenWondersDuel::STATE_PLAYER_TURN_NAME,
"description" => '', // Set in onEnterPlayerTurn
"descriptionmyturn" => '', // Set in onEnterPlayerTurn
"type" => "activeplayer",
"action" => "enterStatePlayerTurn",
"args" => "argPlayerTurn",
"possibleactions" => [
"actionTriggerConspiracy",
"actionConstructBuilding",
"actionDiscardBuilding",
"actionConstructWonder",
"actionActivateDivinity",
"actionPrepareConspiracy",
],
"transitions" => $midGameTransitions
],
SevenWondersDuel::STATE_CHOOSE_CONSPIRATOR_ACTION_ID => [
"name" => SevenWondersDuel::STATE_CHOOSE_CONSPIRATOR_ACTION_NAME,
"description" => clienttranslate('${actplayer} must choose to place an Influence cube or to Conspire'),
"descriptionmyturn" => clienttranslate('${you} must choose to place an Influence cube or to Conspire'),
"type" => "activeplayer",
"action" => "enterStateChooseConspiratorAction",
"args" => "argChooseConspiratorAction",
"possibleactions" => [
"actionChooseConspiratorActionPlaceInfluence",
"actionConspire",
],
"transitions" => $midGameTransitions
],
SevenWondersDuel::STATE_CONSPIRE_ID => [
"name" => SevenWondersDuel::STATE_CONSPIRE_NAME,
"description" => clienttranslate('${actplayer} must choose a Conspiracy'),
"descriptionmyturn" => clienttranslate('${you} must choose a Conspiracy'),
"type" => "activeplayer",
"action" => "enterStateConspire",
"args" => "argConspire",
"possibleactions" => [
"actionChooseConspiracy",
],
"transitions" => $midGameTransitions
],
SevenWondersDuel::STATE_CHOOSE_CONSPIRE_REMNANT_POSITION_ID => [
"name" => SevenWondersDuel::STATE_CHOOSE_CONSPIRE_REMNANT_POSITION_NAME,
"description" => clienttranslate('${actplayer} must choose to place the other Conspiracy card on the top or the bottom of the deck'),
"descriptionmyturn" => clienttranslate('${you} must choose to place the other Conspiracy card on the top or the bottom of the deck'),
"type" => "activeplayer",
"action" => "enterStateChooseConspireRemnantPosition",
"args" => "argChooseConspireRemnantPosition",
"possibleactions" => [
"actionChooseConspireRemnantPosition",
],
"transitions" => $midGameTransitions
],
SevenWondersDuel::STATE_SENATE_ACTIONS_ID => [
"name" => SevenWondersDuel::STATE_SENATE_ACTIONS_NAME,
"description" => clienttranslate('${actplayer} must choose a Senate action (${senateActionsLeft} left)'),
"descriptionmyturn" => clienttranslate('${you} must choose a Senate action (${senateActionsLeft} left)'),
"type" => "activeplayer",
"action" => "enterStateSenateActions",
"args" => "argSenateActions",
"possibleactions" => [
"actionPlaceInfluence",
"actionMoveInfluence",
"actionSkipMoveInfluence",
],
"transitions" => $midGameTransitions
],
SevenWondersDuel::STATE_PLACE_INFLUENCE_ID => [
"name" => SevenWondersDuel::STATE_PLACE_INFLUENCE_NAME,
"description" => clienttranslate('${actplayer} must choose a Senate chamber to add an Influence cube to'),
"descriptionmyturn" => clienttranslate('${you} must choose a Senate chamber to add an Influence cube to'),
"type" => "activeplayer",
"action" => "enterStatePlaceInfluence",
"args" => "argPlaceInfluence",
"possibleactions" => [
"actionPlaceInfluence",
],
"transitions" => $midGameTransitions
],
SevenWondersDuel::STATE_MOVE_INFLUENCE_ID => [
"name" => SevenWondersDuel::STATE_MOVE_INFLUENCE_NAME,
"description" => clienttranslate('${actplayer} may choose a Senate chamber to move an Influence cube from'),
"descriptionmyturn" => clienttranslate('${you} may choose a Senate chamber to move an Influence cube from'),
"type" => "activeplayer",
"action" => "enterStateMoveInfluence",
"args" => "argMoveInfluence",
"possibleactions" => [
"actionMoveInfluence",
"actionSkipMoveInfluence",
],
"transitions" => $midGameTransitions
],
SevenWondersDuel::STATE_REMOVE_INFLUENCE_ID => [
"name" => SevenWondersDuel::STATE_REMOVE_INFLUENCE_NAME,
"description" => clienttranslate('${actplayer} must choose one of the opponent\'s Influence cubes to remove'),
"descriptionmyturn" => clienttranslate('${you} must choose a Senate chamber to remove one of your opponent\'s Influence cubes from'),
"type" => "activeplayer",
"action" => "enterStateRemoveInfluence",
"args" => "argRemoveInfluence",
"possibleactions" => [
"actionRemoveInfluence",
],
"transitions" => $midGameTransitions
],
SevenWondersDuel::STATE_TRIGGER_UNPREPARED_CONSPIRACY_ID => [
"name" => SevenWondersDuel::STATE_TRIGGER_UNPREPARED_CONSPIRACY_NAME,
"description" => clienttranslate('${actplayer} may choose to trigger an unprepared Conspiracy'),
"descriptionmyturn" => clienttranslate('${you} may choose to trigger an unprepared Conspiracy'),
"type" => "activeplayer",
"action" => "enterStateTriggerUnpreparedConspiracy",
"args" => "argTriggerUnpreparedConspiracy",
"possibleactions" => [
"actionTriggerConspiracy",
"actionSkipTriggerUnpreparedConspiracy",
],
"transitions" => $midGameTransitions
],
SevenWondersDuel::STATE_CHOOSE_AND_PLACE_DIVINITY_ID => [
"name" => SevenWondersDuel::STATE_CHOOSE_AND_PLACE_DIVINITY_NAME,
"description" => clienttranslate('${actplayer} must choose a Divinity and place it face down in the Pantheon'),
"descriptionmyturn" => clienttranslate('${you} must choose a Divinity and place it face down in the Pantheon'),
"type" => "activeplayer",
"action" => "enterStateChooseAndPlaceDivinity",
"args" => "argChooseAndPlaceDivinity",
"possibleactions" => [
"actionChooseAndPlaceDivinity",
],
"transitions" => $midGameTransitions
],
SevenWondersDuel::STATE_DECONSTRUCT_WONDER_ID => [
"name" => SevenWondersDuel::STATE_DECONSTRUCT_WONDER_NAME,
"description" => clienttranslate('${actplayer} must choose a constructed Wonder to discard the Age card from'),
"descriptionmyturn" => clienttranslate('${you} must choose a constructed Wonder to discard the Age card from'),
"type" => "activeplayer",
"action" => "enterStateDeconstructWonder",
"args" => "argDeconstructWonder",
"possibleactions" => [
"actionDeconstructWonder",
],
"transitions" => $midGameTransitions
],
SevenWondersDuel::STATE_CONSTRUCT_WONDER_WITH_DISCARDED_BUILDING_ID => [
"name" => SevenWondersDuel::STATE_CONSTRUCT_WONDER_WITH_DISCARDED_BUILDING_NAME,
"description" => clienttranslate('${actplayer} must choose a discarded card and construct a Wonder for free using that card'),
"descriptionmyturn" => clienttranslate('${you} must choose a discarded card and construct a Wonder for free using that card'),
"type" => "activeplayer",
"action" => "enterStateConstructWonderWithDiscardedBuilding",
"args" => "argConstructWonderWithDiscardedBuilding",
"possibleactions" => [
"actionConstructWonder",
],
"transitions" => $midGameTransitions
],
SevenWondersDuel::STATE_CHOOSE_ENKI_PROGRESS_TOKEN_ID => [
"name" => SevenWondersDuel::STATE_CHOOSE_ENKI_PROGRESS_TOKEN_NAME,
"description" => clienttranslate('${actplayer} must choose one of the two Progress Tokens on Enki'),
"descriptionmyturn" => clienttranslate('${you} must choose one of the two Progress Tokens on Enki'),
"type" => "activeplayer",
"action" => "enterStateChooseEnkiProgressToken",
"args" => "argChooseEnkiProgressToken",
"possibleactions" => [
"actionChooseEnkiProgressToken",
],
"transitions" => $midGameTransitions
],
SevenWondersDuel::STATE_PLACE_SNAKE_TOKEN_ID => [
"name" => SevenWondersDuel::STATE_PLACE_SNAKE_TOKEN_NAME,
"description" => clienttranslate('${actplayer} must place the Snake token on an opponent\'s green card'),
"descriptionmyturn" => clienttranslate('${you} must place the Snake token on an opponent\'s green card'),
"type" => "activeplayer",
"action" => "enterStatePlaceSnakeToken",
"args" => "argPlaceSnakeToken",
"possibleactions" => [
"actionPlaceSnakeToken",
],
"transitions" => $midGameTransitions
],
SevenWondersDuel::STATE_DISCARD_AGE_CARD_ID => [
"name" => SevenWondersDuel::STATE_DISCARD_AGE_CARD_NAME,
"description" => clienttranslate('${actplayer} must discard a card (face up or down) from the structure'),
"descriptionmyturn" => clienttranslate('${you} must discard a card (face up or down) from the structure'),
"type" => "activeplayer",
"action" => "enterStateDiscardAgeCard",
"args" => "argDiscardAgeCard",
"possibleactions" => [
"actionDiscardAgeCard",
],
"transitions" => $midGameTransitions
],
SevenWondersDuel::STATE_PLACE_MINERVA_TOKEN_ID => [
"name" => SevenWondersDuel::STATE_PLACE_MINERVA_TOKEN_NAME,
"description" => clienttranslate('${actplayer} must place the Minerva pawn on any space of the Military Track'),
"descriptionmyturn" => clienttranslate('${you} must place the Minerva pawn on any space of the Military Track'),
"type" => "activeplayer",
"action" => "enterStatePlaceMinervaToken",
"args" => "argPlaceMinervaToken",
"possibleactions" => [
"actionPlaceMinervaToken",
],
"transitions" => $midGameTransitions
],
SevenWondersDuel::STATE_DISCARD_MILITARY_TOKEN_ID => [
"name" => SevenWondersDuel::STATE_DISCARD_MILITARY_TOKEN_NAME,
"description" => clienttranslate('${actplayer} must choose and discard a Military token without applying its effect'),
"descriptionmyturn" => clienttranslate('${you} must choose and discard a Military token without applying its effect'),
"type" => "activeplayer",
"action" => "enterStateDiscardMilitaryToken",
"args" => "argDiscardMilitaryToken",
"possibleactions" => [
"actionDiscardMilitaryToken",
],
"transitions" => $midGameTransitions
],
SevenWondersDuel::STATE_APPLY_MILITARY_TOKEN_ID => [
"name" => SevenWondersDuel::STATE_APPLY_MILITARY_TOKEN_NAME,
"description" => clienttranslate('${actplayer} must choose and apply the effect of another Military token, then discard it'),
"descriptionmyturn" => clienttranslate('${you} must choose and apply the effect of another Military token, then discard it'),
"type" => "activeplayer",
"action" => "enterStateApplyMilitaryToken",
"args" => "argApplyMilitaryToken",
"possibleactions" => [
"actionApplyMilitaryToken",
],
"transitions" => $midGameTransitions
],
SevenWondersDuel::STATE_CHOOSE_DIVINITY_FROM_TOP_CARDS_ID => [
"name" => SevenWondersDuel::STATE_CHOOSE_DIVINITY_FROM_TOP_CARDS_NAME,
"description" => clienttranslate('${actplayer} must choose a Divinity card and activate it for free'),
"descriptionmyturn" => clienttranslate('${you} must choose a Divinity card and activate it for free'),
"type" => "activeplayer",
"action" => "enterStateChooseDivinityFromTopCards",
"args" => "argChooseDivinityFromTopCards",
"possibleactions" => [
"actionChooseDivinityFromTopCards",
],
"transitions" => $midGameTransitions
],
SevenWondersDuel::STATE_CHOOSE_DIVINITY_DECK_ID => [
"name" => SevenWondersDuel::STATE_CHOOSE_DIVINITY_DECK_NAME,
"description" => clienttranslate('${actplayer} must choose a Divinity deck to reveal and choose a Divinity from'),
"descriptionmyturn" => clienttranslate('${you} must choose a Divinity deck to reveal and choose a Divinity from'),
"type" => "activeplayer",
"action" => "enterStateChooseDivinityDeck",
"args" => "argChooseDivinityDeck",
"possibleactions" => [
"actionChooseDivinityDeck",
],
"transitions" => [
SevenWondersDuel::STATE_CHOOSE_DIVINITY_FROM_DECK_NAME => SevenWondersDuel::STATE_CHOOSE_DIVINITY_FROM_DECK_ID,
SevenWondersDuel::ZOMBIE_PASS => SevenWondersDuel::STATE_NEXT_PLAYER_TURN_ID,
]
],
SevenWondersDuel::STATE_CHOOSE_DIVINITY_FROM_DECK_ID => [
"name" => SevenWondersDuel::STATE_CHOOSE_DIVINITY_FROM_DECK_NAME,
"description" => clienttranslate('${actplayer} must choose a Divinity from the ${mythologyType} Mythology deck and activate it for free'),
"descriptionmyturn" => clienttranslate('${you} must choose a Divinity from the ${mythologyType} Mythology deck and activate it for free'),
"type" => "activeplayer",
"action" => "enterStateChooseDivinityFromDeck",
"args" => "argChooseDivinityFromDeck",
"possibleactions" => [
"actionChooseDivinityFromDeck",
],
"transitions" => $midGameTransitions
],
SevenWondersDuel::STATE_CHOOSE_PROGRESS_TOKEN_ID => [
"name" => SevenWondersDuel::STATE_CHOOSE_PROGRESS_TOKEN_NAME,
"description" => clienttranslate('${actplayer} must choose a progress token'),
"descriptionmyturn" => clienttranslate('${you} must choose a progress token'),
"type" => "activeplayer",
"action" => "enterStateChooseProgressToken",
"args" => "argChooseProgressToken",
"possibleactions" => [
"actionChooseProgressToken",
],
"transitions" => $midGameTransitions
],
SevenWondersDuel::STATE_CHOOSE_OPPONENT_BUILDING_ID => [
"name" => SevenWondersDuel::STATE_CHOOSE_OPPONENT_BUILDING_NAME,
"description" => clienttranslate('${actplayer} must choose one of the opponent\'s ${buildingTypeTranslatable} cards to discard'),
"descriptionmyturn" => clienttranslate('${you} must choose one of the opponent\'s ${buildingTypeTranslatable} cards to discard'),
"type" => "activeplayer",
"action" => "enterStateChooseOpponentBuilding",
"args" => "argChooseOpponentBuilding",
"possibleactions" => [
"actionChooseOpponentBuilding",
// If there are no building to discard, this state will be skipped automatically, so no need to have NEXT_PLAYER_TURN as a possible action.
],
"transitions" => $midGameTransitions
],
SevenWondersDuel::STATE_CHOOSE_PROGRESS_TOKEN_FROM_BOX_ID => [
"name" => SevenWondersDuel::STATE_CHOOSE_PROGRESS_TOKEN_FROM_BOX_NAME,
"description" => clienttranslate('${actplayer} must choose a progress token from the box'),
"descriptionmyturn" => clienttranslate('${you} must choose a progress token from the box'),
"type" => "activeplayer",
"action" => "enterStateChooseProgressTokenFromBox",
"args" => "argChooseProgressTokenFromBox",
"possibleactions" => [
"actionChooseProgressTokenFromBox",
],
"transitions" => $midGameTransitions
],
SevenWondersDuel::STATE_CHOOSE_DISCARDED_BUILDING_ID => [
"name" => SevenWondersDuel::STATE_CHOOSE_DISCARDED_BUILDING_NAME,
"description" => clienttranslate('${actplayer} must choose a discarded building to construct'),
"descriptionmyturn" => clienttranslate('${you} must choose a discarded building to construct'),
"type" => "activeplayer",
"action" => "enterStateChooseDiscardedBuilding",
"args" => "argChooseDiscardedBuilding",
"possibleactions" => [
"actionChooseDiscardedBuilding",
// If there is no discarded building to construct, this state will be skipped automatically, so no need to have NEXT_PLAYER_TURN as a possible action.
],
"transitions" => $midGameTransitions
],
SevenWondersDuel::STATE_CONSTRUCT_BUILDING_FROM_BOX_ID => [
"name" => SevenWondersDuel::STATE_CONSTRUCT_BUILDING_FROM_BOX_NAME,
"description" => clienttranslate('${actplayer} must choose a Building removed from the game up to the current Age to play for free'),
"descriptionmyturn" => clienttranslate('${you} must choose a Building removed from the game up to the current Age to play for free'),
"type" => "activeplayer",
"action" => "enterStateConstructBuildingFromBox",
"args" => "argConstructBuildingFromBox",
"possibleactions" => [
"actionConstructBuildingFromBox",
],
"transitions" => $midGameTransitions
],
SevenWondersDuel::STATE_CONSTRUCT_LAST_ROW_BUILDING_ID => [
"name" => SevenWondersDuel::STATE_CONSTRUCT_LAST_ROW_BUILDING_NAME,
"description" => clienttranslate('${actplayer} must choose a Building from the last row of the Age structure (excluding Senators) and construct it for free'),
"descriptionmyturn" => clienttranslate('${you} must choose a Building from the last row of the Age structure (excluding Senators) and construct it for free'),
"type" => "activeplayer",
"action" => "enterStateConstructLastRowBuilding",
"args" => "argConstructLastRowBuilding",
"possibleactions" => [
"actionConstructBuilding",
],
"transitions" => $midGameTransitions
],
SevenWondersDuel::STATE_DESTROY_CONSTRUCTED_WONDER_ID => [
"name" => SevenWondersDuel::STATE_DESTROY_CONSTRUCTED_WONDER_NAME,
"description" => clienttranslate('${actplayer} must choose one of the opponent\'s constructed Wonders and return it to the box'),
"descriptionmyturn" => clienttranslate('${you} must choose one of the opponent\'s constructed Wonders and return it to the box'),
"type" => "activeplayer",
"action" => "enterStateDestroyConstructedWonder",
"args" => "argDestroyConstructedWonder",
"possibleactions" => [
"actionDestroyConstructedWonder",
],
"transitions" => $midGameTransitions
],
SevenWondersDuel::STATE_DISCARD_AVAILABLE_CARD_ID => [
"name" => SevenWondersDuel::STATE_DISCARD_AVAILABLE_CARD_NAME,
"description" => '', // Set in onEnterDiscardAvailableCard
"descriptionmyturn" => '', // Set in onEnterDiscardAvailableCard
"type" => "activeplayer",
"action" => "enterStateDiscardAvailableCard",
"args" => "argDiscardAvailableCard",
"possibleactions" => [
"actionDiscardAvailableCard",
"actionSkipDiscardAvailableCard",
],
"transitions" => $midGameTransitions
],
SevenWondersDuel::STATE_LOCK_PROGRESS_TOKEN_ID => [
"name" => SevenWondersDuel::STATE_LOCK_PROGRESS_TOKEN_NAME,
"description" => clienttranslate('${actplayer} must choose a Progress token from the board, his opponent or the box and lock it away for the rest of the game'),
"descriptionmyturn" => clienttranslate('${you} must choose a Progress token from the board, your opponent or the box and lock it away for the rest of the game'),
"type" => "activeplayer",
"action" => "enterStateLockProgressToken",
"args" => "argLockProgressToken",
"possibleactions" => [
"actionLockProgressToken",
],
"transitions" => $midGameTransitions
],
SevenWondersDuel::STATE_MOVE_DECREE_ID => [
"name" => SevenWondersDuel::STATE_MOVE_DECREE_NAME,
"description" => clienttranslate('${actplayer} must choose a Decree token to move to a Chamber of his choice, under the existing Decree'),
"descriptionmyturn" => clienttranslate('${you} must choose a Decree token to move to a Chamber of your choice, under the existing Decree'),
"type" => "activeplayer",
"action" => "enterStateMoveDecree",
"args" => "argMoveDecree",
"possibleactions" => [
"actionMoveDecree",
],
"transitions" => $midGameTransitions
],
SevenWondersDuel::STATE_SWAP_BUILDING_ID => [
"name" => SevenWondersDuel::STATE_SWAP_BUILDING_NAME,
"description" => clienttranslate('${actplayer} must choose 1 Blue or Green card of his opponent and in exchange give them 1 of his cards of the same color'),
"descriptionmyturn" => clienttranslate('${you} must choose 1 Blue or Green card of your opponent and in exchange give them 1 of your cards of the same color'),
"type" => "activeplayer",
"action" => "enterStateSwapBuilding",
"args" => "argSwapBuilding",
"possibleactions" => [
"actionSwapBuilding",
],
"transitions" => $midGameTransitions
],
SevenWondersDuel::STATE_TAKE_BUILDING_ID => [
"name" => SevenWondersDuel::STATE_TAKE_BUILDING_NAME,
"description" => clienttranslate('${actplayer} must choose 1 Brown or Grey card from his opponent and add it to his city'),
"descriptionmyturn" => clienttranslate('${you} must choose 1 Brown or Grey card from your opponent and add it to your city'),
"type" => "activeplayer",
"action" => "enterStateTakeBuilding",
"args" => "argTakeBuilding",
"possibleactions" => [
"actionTakeBuilding",
],
"transitions" => $midGameTransitions
],
SevenWondersDuel::STATE_TAKE_UNCONSTRUCTED_WONDER_ID => [
"name" => SevenWondersDuel::STATE_TAKE_UNCONSTRUCTED_WONDER_NAME,
"description" => clienttranslate('${actplayer} must take one of the opponent\'s unconstructed Wonders and add it to his city'),
"descriptionmyturn" => clienttranslate('${you} must take one of the opponent\'s unconstructed Wonders and add it to your city'),
"type" => "activeplayer",
"action" => "enterStateTakeUnconstructedWonder",
"args" => "argTakeUnconstructedWonder",
"possibleactions" => [
"actionTakeUnconstructedWonder",
],
"transitions" => $midGameTransitions
],
SevenWondersDuel::STATE_PLAYER_SWITCH_ID => [
"name" => SevenWondersDuel::STATE_PLAYER_SWITCH_NAME,
"description" => '',
"descriptionmyturn" => '',
"type" => "game",
"action" => "enterStatePlayerSwitch",
"transitions" => $midGameTransitions
],
SevenWondersDuel::STATE_NEXT_PLAYER_TURN_ID => [
"name" => SevenWondersDuel::STATE_NEXT_PLAYER_TURN_NAME,
"description" => clienttranslate('End of game victory points count...'),
"descriptionmyturn" => clienttranslate('End of game victory points count...'),
"type" => "game",
"action" => "enterStateNextPlayerTurn",
"updateGameProgression" => true,
"transitions" => [
SevenWondersDuel::STATE_PLAYER_TURN_NAME => SevenWondersDuel::STATE_PLAYER_TURN_ID,
SevenWondersDuel::STATE_NEXT_AGE_NAME => SevenWondersDuel::STATE_NEXT_AGE_ID,
SevenWondersDuel::STATE_GAME_END_DEBUG_NAME => SevenWondersDuel::STATE_GAME_END_DEBUG_ID,
SevenWondersDuel::STATE_GAME_END_NAME => SevenWondersDuel::STATE_GAME_END_ID
]
],
SevenWondersDuel::STATE_GAME_END_DEBUG_ID => [
"name" => SevenWondersDuel::STATE_GAME_END_DEBUG_NAME,
"description" => clienttranslate("Debug End of game"),
"descriptionmyturn" => clienttranslate('Debug End of game'),
"type" => "activeplayer",
"action" => "enterStateGameEndDebug",
"args" => "argGameEndDebug",
"possibleactions" => [
"dummyAction"
],
"transitions" => [
// Comment out the following line to prevent a Studio game from finishing.
SevenWondersDuel::STATE_GAME_END_NAME => SevenWondersDuel::STATE_GAME_END_ID
]
],
// Final state.
// Please do not modify (and do not overload action/args methods).
SevenWondersDuel::STATE_GAME_END_ID => [
"name" => SevenWondersDuel::STATE_GAME_END_NAME,
"description" => clienttranslate("End of game"),
"type" => "manager",
"action" => "stGameEnd",
"args" => "argGameEnd"
]
];