-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstats.inc.php
501 lines (466 loc) · 16.2 KB
/
stats.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
<?php
/**
*------
* BGA framework: © Gregory Isabelli <[email protected]> & Emmanuel Colin <[email protected]>
* LetterTycoon implementation : © Jeff Raymakers <[email protected]>
*
* 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.
* -----
*/
/*
In this file, you are describing game statistics, that will be displayed at the end of the
game.
!! After modifying this file, you must use "Reload statistics configuration" in BGA Studio backoffice
("Control Panel" / "Manage Game" / "Your Game")
There are 2 types of statistics:
_ table statistics, that are not associated to a specific player (ie: 1 value for each game).
_ player statistics, that are associated to each players (ie: 1 value for each player in the game).
Statistics types can be "int" for integer, "float" for floating point values, and "bool" for boolean
Once you defined your statistics there, you can start using "initStat", "setStat" and "incStat" method
in your game logic, using statistics names defined below.
!! It is not a good idea to modify this file when a game is running !!
If your game is already public on BGA, please read the following before any change:
http://en.doc.boardgamearena.com/Post-release_phase#Changes_that_breaks_the_games_in_progress
Notes:
* Statistic index is the reference used in setStat/incStat/initStat PHP method
* Statistic index must contains alphanumerical characters and no space. Example: 'turn_played'
* Statistics IDs must be >=10
* Two table statistics can't share the same ID, two player statistics can't share the same ID
* A table statistic can have the same ID than a player statistics
* Statistics ID is the reference used by BGA website. If you change the ID, you lost all historical statistic data. Do NOT re-use an ID of a deleted statistic
* Statistic name is the English description of the statistic as shown to players
*/
$stats_type = array(
// Statistics global to table
'table' => array(
'turns_number' => array(
'id'=> 10,
'name' => totranslate('Number of turns'),
'type' => 'int'
),
// number of cards drawn to community
'cards_drawn_to_community' => array(
'id'=> 25,
'name' => totranslate('Cards drawn to community pool'),
'type' => 'int'
),
),
// Statistics existing for each player
'player' => array(
// GENERAL
'turns_number' => array(
'id'=> 10,
'name' => totranslate('Number of turns'),
'type' => 'int'
),
// CARDS
// number of cards played from hand
'cards_played_from_hand' => array(
'id'=> 20,
'name' => totranslate('Cards played from hand'),
'type' => 'int'
),
// number of cards played from community
'cards_played_from_community' => array(
'id'=> 21,
'name' => totranslate('Cards played from community pool'),
'type' => 'int'
),
// number of cards discarded from hand
'cards_discarded_from_hand' => array(
'id'=> 22,
'name' => totranslate('Cards discarded from hand'),
'type' => 'int'
),
// number of cards discarded from hand
'cards_discarded_from_community' => array(
'id'=> 23,
'name' => totranslate('Cards discarded from community pool'),
'type' => 'int'
),
// number of cards drawn to hand
'cards_drawn_to_hand' => array(
'id'=> 24,
'name' => totranslate('Cards drawn to hand'),
'type' => 'int'
),
// MONEY AND STOCK
// money received from words
'money_received_from_words' => array(
'id'=> 30,
'name' => totranslate('Money received from words'),
'type' => 'int'
),
// money received from royalties
'money_received_from_royalties' => array(
'id'=> 31,
'name' => totranslate('Money received from royalties'),
'type' => 'int'
),
// money received from challenges
'money_received_from_challenges' => array(
'id'=> 32,
'name' => totranslate('Money received from challenges'),
'type' => 'int'
),
// money paid for patents
'money_paid_for_patents' => array(
'id'=> 33,
'name' => totranslate('Money paid for patents'),
'type' => 'int'
),
// money paid for challenges
'money_paid_for_challenges' => array(
'id'=> 34,
'name' => totranslate('Money paid for challenges'),
'type' => 'int'
),
// stock received
'stock_received' => array(
'id'=> 35,
'name' => totranslate('Stock received'),
'type' => 'int'
),
// PATENTS
// number of times Q doubling ability used
'q_doubling_used' => array(
'id'=> 40,
'name' => totranslate('‘Q’ doubling ability used'),
'type' => 'int'
),
// number of times Y played as vowel
'y_played_as_vowel' => array(
'id'=> 41,
'name' => totranslate('‘Y’ played as vowel'),
'type' => 'int'
),
// number of times Y played as consonant
'y_played_as_consonant' => array(
'id'=> 42,
'name' => totranslate('‘Y’ played as consonant'),
'type' => 'int'
),
// number of times B patent ability used
'b_patent_ability_used' => array(
'id'=> 43,
'name' => totranslate('‘B’ patent ability used'),
'type' => 'int'
),
// number of times J patent ability used
'j_patent_ability_used' => array(
'id'=> 44,
'name' => totranslate('‘J’ patent ability used'),
'type' => 'int'
),
// number of times K patent ability used
'k_patent_ability_used' => array(
'id'=> 45,
'name' => totranslate('‘K’ patent ability used'),
'type' => 'int'
),
// number of times Q patent ability used
'q_patent_ability_used' => array(
'id'=> 46,
'name' => totranslate('‘Q’ patent ability used'),
'type' => 'int'
),
// number of times V patent ability used
'v_patent_ability_used' => array(
'id'=> 47,
'name' => totranslate('‘V’ patent ability used'),
'type' => 'int'
),
// number of times X patent ability used
'x_patent_ability_used' => array(
'id'=> 48,
'name' => totranslate('‘X’ patent ability used'),
'type' => 'int'
),
// number of times Z patent ability used
'z_patent_ability_used' => array(
'id'=> 49,
'name' => totranslate('‘Z’ patent ability used'),
'type' => 'int'
),
// WORDS
// number of 3 letter words
'words_played_length_3' => array(
'id'=> 103,
'name' => totranslate('3 letter words played'),
'type' => 'int'
),
// number of 4 letter words
'words_played_length_4' => array(
'id'=> 104,
'name' => totranslate('4 letter words played'),
'type' => 'int'
),
// number of 5 letter words
'words_played_length_5' => array(
'id'=> 105,
'name' => totranslate('5 letter words played'),
'type' => 'int'
),
// number of 6 letter words
'words_played_length_6' => array(
'id'=> 106,
'name' => totranslate('6 letter words played'),
'type' => 'int'
),
// number of 7 letter words
'words_played_length_7' => array(
'id'=> 107,
'name' => totranslate('7 letter words played'),
'type' => 'int'
),
// number of 8 letter words
'words_played_length_8' => array(
'id'=> 108,
'name' => totranslate('8 letter words played'),
'type' => 'int'
),
// number of 9 letter words
'words_played_length_9' => array(
'id'=> 109,
'name' => totranslate('9 letter words played'),
'type' => 'int'
),
// number of 10 letter words
'words_played_length_10' => array(
'id'=> 110,
'name' => totranslate('10 letter words played'),
'type' => 'int'
),
// number of 11 letter words
'words_played_length_11' => array(
'id'=> 111,
'name' => totranslate('11 letter words played'),
'type' => 'int'
),
// number of 12 letter words
'words_played_length_12' => array(
'id'=> 112,
'name' => totranslate('12 letter words played'),
'type' => 'int'
),
// total number of letters played
'letters_played_total' => array(
'id'=> 120,
'name' => totranslate('Total letters played'),
'type' => 'int'
),
// total number of words played
'words_played_total' => array(
'id'=> 121,
'name' => totranslate('Total words played'),
'type' => 'int'
),
// average word length (float)
'word_length_average' => array(
'id'=> 122,
'name' => totranslate('Average word length'),
'type' => 'float'
),
// LETTERS
// number of A's played
'letters_played_A' => array(
'id'=> 200,
'name' => totranslate('‘A’s played'),
'type' => 'int'
),
// number of B's played
'letters_played_B' => array(
'id'=> 201,
'name' => totranslate('‘B’s played'),
'type' => 'int'
),
// number of C's played
'letters_played_C' => array(
'id'=> 202,
'name' => totranslate('‘C’s played'),
'type' => 'int'
),
// number of D's played
'letters_played_D' => array(
'id'=> 203,
'name' => totranslate('‘D’s played'),
'type' => 'int'
),
// number of E's played
'letters_played_E' => array(
'id'=> 204,
'name' => totranslate('‘E’s played'),
'type' => 'int'
),
// number of F's played
'letters_played_F' => array(
'id'=> 205,
'name' => totranslate('‘F’s played'),
'type' => 'int'
),
// number of G's played
'letters_played_G' => array(
'id'=> 206,
'name' => totranslate('‘G’s played'),
'type' => 'int'
),
// number of H's played
'letters_played_H' => array(
'id'=> 207,
'name' => totranslate('‘H’s played'),
'type' => 'int'
),
// number of I's played
'letters_played_I' => array(
'id'=> 208,
'name' => totranslate('‘I’s played'),
'type' => 'int'
),
// number of J's played
'letters_played_J' => array(
'id'=> 209,
'name' => totranslate('‘J’s played'),
'type' => 'int'
),
// number of K's played
'letters_played_K' => array(
'id'=> 210,
'name' => totranslate('‘K’s played'),
'type' => 'int'
),
// number of L's played
'letters_played_L' => array(
'id'=> 211,
'name' => totranslate('‘L’s played'),
'type' => 'int'
),
// number of M's played
'letters_played_M' => array(
'id'=> 212,
'name' => totranslate('‘M’s played'),
'type' => 'int'
),
// number of N's played
'letters_played_N' => array(
'id'=> 213,
'name' => totranslate('‘N’s played'),
'type' => 'int'
),
// number of O's played
'letters_played_O' => array(
'id'=> 214,
'name' => totranslate('‘O’s played'),
'type' => 'int'
),
// number of P's played
'letters_played_P' => array(
'id'=> 215,
'name' => totranslate('‘P’s played'),
'type' => 'int'
),
// number of Q's played
'letters_played_Q' => array(
'id'=> 216,
'name' => totranslate('‘Q’s played'),
'type' => 'int'
),
// number of R's played
'letters_played_R' => array(
'id'=> 217,
'name' => totranslate('‘R’s played'),
'type' => 'int'
),
// number of S's played
'letters_played_S' => array(
'id'=> 218,
'name' => totranslate('‘S’s played'),
'type' => 'int'
),
// number of T's played
'letters_played_T' => array(
'id'=> 219,
'name' => totranslate('‘T’s played'),
'type' => 'int'
),
// number of U's played
'letters_played_U' => array(
'id'=> 220,
'name' => totranslate('‘U’s played'),
'type' => 'int'
),
// number of V's played
'letters_played_V' => array(
'id'=> 221,
'name' => totranslate('‘V’s played'),
'type' => 'int'
),
// number of W's played
'letters_played_W' => array(
'id'=> 222,
'name' => totranslate('‘W’s played'),
'type' => 'int'
),
// number of X's played
'letters_played_X' => array(
'id'=> 223,
'name' => totranslate('‘X’s played'),
'type' => 'int'
),
// number of Y's played
'letters_played_Y' => array(
'id'=> 224,
'name' => totranslate('‘Y’s played'),
'type' => 'int'
),
// number of Z's played
'letters_played_Z' => array(
'id'=> 225,
'name' => totranslate('‘Z’s played'),
'type' => 'int'
),
// CHALLENGES
// number of successful challenges made
'successful_challenges_initiated' => array(
'id'=> 300,
'name' => totranslate('Successful challenges initiated'),
'type' => 'int'
),
// number of failed challenges made
'failed_challenges_initiated' => array(
'id'=> 301,
'name' => totranslate('Failed challenges initiated'),
'type' => 'int'
),
// number of times challenged correctly by another player
'correct_challenges_received' => array(
'id'=> 302,
'name' => totranslate('Correct challenges received (by other players)'),
'type' => 'int'
),
// number of times challenged incorrectly by another player
'incorrect_challenges_received' => array(
'id'=> 303,
'name' => totranslate('Incorrect challenges received (by other players)'),
'type' => 'int'
),
// number of times a word was rejected by automatic challenge
'words_rejected_by_automatic_challenge' => array(
'id'=> 310,
'name' => totranslate('Words rejected by automatic challenge'),
'type' => 'int'
),
// number of retries used
'retries_used' => array(
'id'=> 311,
'name' => totranslate('Retries used'),
'type' => 'int'
),
// number of times player ran out of retries
'ran_out_of_retries' => array(
'id'=> 312,
'name' => totranslate('Ran out of retries'),
'type' => 'int'
),
)
);