-
Notifications
You must be signed in to change notification settings - Fork 1
/
states.inc.php
264 lines (233 loc) · 7.51 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
<?php
require_once 'modules/constants.inc.php';
// See Dokumentation.pptx for a flowchart about how the state-cycles
$machinestates = [
/*
* BGA framework initial state. Do not modify.
*/
ST_GAME_SETUP => [
'name' => 'gameSetup',
'description' => '',
'type' => 'manager',
'action' => 'stGameSetup',
'transitions' => [
'' => ST_PRE_CHOOSE_CHARACTER,
],
],
ST_PRE_CHOOSE_CHARACTER => [
'name' => 'preChooseCharacter',
'type' => 'game',
'action' => 'stPreChooseCharacter',
'transitions' => [
ST_CHOOSE_CHARACTER => ST_CHOOSE_CHARACTER,
ST_START_OF_TURN => ST_START_OF_TURN,
],
],
ST_CHOOSE_CHARACTER => [
'name' => 'chooseCharacter',
'description' => clienttranslate('Some players must still choose a character'),
'descriptionmyturn' => clienttranslate('${you} must choose a character'),
'type' => 'multipleactiveplayer',
'args' => 'argChooseCharacter',
'action' => 'stChooseCharacter',
'possibleactions' => ['actChooseCharacter'],
'transitions' => [
ST_CHARACTER_SETUP => ST_CHARACTER_SETUP,
],
],
ST_CHARACTER_SETUP => [
'name' => 'characterSetup',
'type' => 'game',
'action' => 'stCharacterSetup',
'transitions' => [
ST_START_OF_TURN => ST_START_OF_TURN,
],
],
/*
* Start of a turn : trigger cards such as Dynamite or Jail before moving on to appropriate state
*/
ST_START_OF_TURN => [
'name' => 'startOfTurn',
'type' => 'game',
'action' => 'stStartOfTurn',
'transitions' => [
'' => ST_RESOLVE_STACK,
],
],
/*
* Where the flow is resolved
*/
ST_RESOLVE_STACK => [
'name' => 'resolveStack',
'type' => 'game',
'action' => 'stResolveStack',
'transitions' => [],
],
ST_PRE_PHASE_ONE => [
'name' => 'prePhaseOne',
'type' => 'game',
'action' => 'stPrePhaseOne',
],
ST_PHASE_ONE_SETUP => [
'name' => 'phaseOneSetup',
'type' => 'game',
'action' => 'stPhaseOneSetup',
],
ST_PHASE_ONE_DRAW_CARDS => [
'name' => 'phaseOneDrawCards',
'type' => 'game',
'action' => 'stPhaseOneDrawCards',
],
ST_NEW_EVENT => [
'name' => 'newEvent',
'description' => '',
'type' => 'game',
'action' => 'stNewEvent',
],
ST_RESOLVE_EVENT_EFFECT => [
'name' => 'resolveEventEffect',
'description' => '',
'type' => 'game',
'action' => 'stResolveEventEffect',
],
ST_FLIP_CARD => [
'name' => 'flipCard',
'type' => 'game',
'action' => 'stFlipCard',
],
ST_RESOLVE_FLIPPED => [
'name' => 'resolveFlipped',
'type' => 'game',
'action' => 'stResolveFlipped',
],
ST_ACTIVE_DRAW_CARD => [
'name' => 'drawCard',
'description' => clienttranslate('${actplayer} must choose where to draw the first card from'),
'descriptionmyturn' => clienttranslate('${you} must choose where to draw the first card from'),
'type' => 'activeplayer',
'args' => 'argDrawCard',
'possibleactions' => ['actDraw'],
],
ST_PLAY_CARD => [
'name' => 'playCard',
'description' => clienttranslate('${actplayer} can play a card'),
'descriptionmyturn' => clienttranslate('${you} can play a card'),
'type' => 'activeplayer',
'args' => 'argPlayCards',
'action' => 'stPlayCard',
'possibleactions' => ['actPlayCard', 'actUseAbility', 'actEndTurn'],
],
ST_REACT => [
'name' => 'react',
'description' => clienttranslate('${actplayer} must react'),
'descriptionmyturn' => clienttranslate('${you} must react'),
'type' => 'activeplayer',
'args' => 'argReact',
'action' => 'stReact',
'possibleactions' => ['actReact', 'actPass', 'actUseAbility'],
],
ST_SELECT_CARD => [
'name' => 'selectCard',
'description' => clienttranslate('${actplayer} must select ${amountToPick} cards for the effect of ${src}'),
'descriptionmyturn' => clienttranslate('${you} must select ${amountToPick} cards for the effect of ${src}'),
'descriptionsingle' => clienttranslate('${actplayer} must select a card for the effect of ${src}'),
'descriptionsinglemyturn' => clienttranslate('${you} must select a card for the effect of ${src}'),
'type' => 'activeplayer',
'args' => 'argSelect',
'action' => 'stSelect',
'possibleactions' => ['actSelect'],
],
ST_REACT_BEER => [
'name' => 'reactBeer',
// TODO: Specify Sid Ketchum's ability here and in the case of The Reverend event it should reflect the options correctly
'description' => clienttranslate('${actplayer} may play ${n} beer to survive'),
'descriptionmyturn' => clienttranslate('${you} may play ${n} beer to survive'),
'type' => 'activeplayer',
'args' => 'argReactBeer',
'action' => 'stReact',
'possibleactions' => ['actReact', 'actPass', 'actUseAbility'],
],
ST_DISCARD_EXCESS => [
'name' => 'discardExcess',
'description' => clienttranslate('${actplayer} must discard ${amount} cards before ending its turn'),
'descriptionmyturn' => clienttranslate('${you} must discard ${amount} cards before ending your turn'),
'type' => 'activeplayer',
'action' => 'stDiscardExcess',
'args' => 'argDiscardExcess',
'possibleactions' => ['actCancelEndTurn', 'actDiscardExcess'],
],
ST_PRE_ELIMINATE_DISCARD => [
'name' => 'preEliminateDiscard',
'type' => 'game',
'action' => 'stPreEliminateDiscard',
],
ST_PRE_ELIMINATE => [
'name' => 'preEliminate',
'description' => clienttranslate('${actplayer} must discard all their cards'),
'descriptionmyturn' => clienttranslate('${you} must select the order in which you want to discard your cards'),
'type' => 'activeplayer',
'args' => 'argDiscardEliminate',
'possibleactions' => ['actDiscardEliminate', 'actDefautDiscardExcess'],
],
ST_ELIMINATE => [
'name' => 'eliminate',
'type' => 'game',
'action' => 'stEliminate',
'updateGameProgression' => true,
],
ST_VICE_PENALTY => [
'name' => 'vicePenalty',
'description' => clienttranslate('${actplayer} must discard all their cards (killing Vice penalty)'),
'descriptionmyturn' => clienttranslate(
'${you} must select the order in which you want to discard your cards (killing Vice penalty)'
),
'type' => 'activeplayer',
'args' => 'argDiscardEliminate',
'possibleactions' => ['actDiscardVicePenalty', 'actDefautDiscardVicePenalty'],
],
ST_TRIGGER_ABILITY => [
'name' => 'triggerAbility',
'type' => 'game',
'action' => 'stTriggerAbility',
],
ST_CHOOSE_AND_DISCARD_BLUE_CARD => [
'name' => 'chooseAndDiscardBlueCard',
'description' => clienttranslate('${actplayer} must discard one blue card in front of them'),
'descriptionmyturn' => clienttranslate('${you} must discard one blue card in front of you'),
'type' => 'activeplayer',
'args' => 'argChooseAndDiscardBlueCard',
'possibleactions' => ['actDiscardBlue'],
],
ST_DISCARD_BLUE_CARD => [
'name' => 'discardBlueCard',
'type' => 'game',
'action' => 'stDiscardBlueCard',
],
ST_END_OF_TURN => [
'name' => 'endOfTurn',
'type' => 'game',
'action' => 'stEndOfTurn',
'transitions' => [
'next' => ST_NEXT_PLAYER,
],
],
ST_NEXT_PLAYER => [
'name' => 'nextPlayer',
'type' => 'game',
'action' => 'stNextPlayer',
'transitions' => [
'start' => ST_START_OF_TURN,
],
'updateGameProgression' => true,
],
/*
* BGA framework final state. Do not modify.
*/
ST_GAME_END => [
'name' => 'gameEnd',
'description' => clienttranslate('End of game'),
'type' => 'manager',
'action' => 'stGameEnd',
'args' => 'argGameEnd',
],
];