-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmaterial.inc.php
407 lines (386 loc) · 18.1 KB
/
material.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
<?php
/**
*------
* BGA framework: © Gregory Isabelli <[email protected]> & Emmanuel Colin <[email protected]>
* P.I. implementation: © Fabian Neumann <[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.
* -----
*
* material.inc.php
*
* pi game material description
*
* Here, you can describe the material of your game with PHP variables.
*
* This file is loaded in your game logic class constructor, ie these variables
* are available everywhere in your game logic code.
*
*/
$this->constants = array(
"EVIDENCE_DECK_SIZE" => 36,
"EVIDENCE_DISPLAY_SIZE" => 9,
"MINIGAMES" => 3,
"DISCS_PER_PLAYER" => 3,
"CUBES_PER_PLAYER" => 10,
"PIS_PER_PLAYER" => 5,
"BOARD_H" => 740,
"BOARD_W" => 980,
"CASETYPES" => array(
'crime' => clienttranslate('crime'),
'location' => clienttranslate('location'),
'suspect' => clienttranslate('suspect')
),
// Map standard player colors to token 'string colors'
"HEX2COLORNAME" => array(
"0000ff" => 'blue',
"008000" => 'green',
"ff0000" => 'red',
"ff00ff" => 'purple',
"ffa500" => 'yellow',
),
"AVG_LOCATION_NEIGHBORS" => 58.0/14, // ~4.14; all location together have 58 neighbors / number of locations
);
/**
* THE LOCATIONS
*
* Backend and frontend data.
*
* `sid`: string id, for easier overview here
*
* `coords`: The (top, left, rotation) coords (in percent) of the location slot
* (middle); the crime and suspect slot locations can be calculated from this.
*
* `neighbors`: ids of adjacent locations
*
* slots: 1 => crime, 2 => suspect
*/
if (!defined('LOC_LAKESIDE')) { // guard since this included multiple times
define("LOC_LAKESIDE", 1);
define("LOC_FORESTPARK", 2);
define('LOC_LITTLEITALY', 3);
define('LOC_TROCADERO', 4);
define('LOC_OCEANDRIVE', 5);
define('LOC_CHINATOWN', 6);
define('LOC_CENTRALSTATION', 7);
define('LOC_MAINSTREET', 8);
define('LOC_ROADHOUSE', 9);
define('LOC_UNIONSQUARE', 10);
define('LOC_DOWNTOWN', 11);
define('LOC_RICKSCAFE', 12);
define('LOC_WATERFRONT', 13);
define('LOC_SKIDROW', 14);
}
$this->locations = array(
LOC_LAKESIDE => array(
'name' => clienttranslate('Lakeside'),
'neighbors' => array(LOC_FORESTPARK, LOC_TROCADERO, LOC_LITTLEITALY),
'coords' => array(4.2, 27.8, 0),
),
LOC_FORESTPARK => array(
'name' => clienttranslate('Forest Park'),
'neighbors' => array(LOC_OCEANDRIVE, LOC_TROCADERO, LOC_LAKESIDE),
'coords' => array(3.8, 51.9, 2.5),
),
LOC_LITTLEITALY => array(
'name' => clienttranslate('Little Italy'),
'neighbors' => array(LOC_LAKESIDE, LOC_TROCADERO, LOC_CENTRALSTATION, LOC_CHINATOWN),
'coords' => array(23.5, 15.0, 2.0),
),
LOC_TROCADERO => array(
'name' => clienttranslate('Trocadero'),
'neighbors' => array(LOC_LAKESIDE, LOC_FORESTPARK, LOC_OCEANDRIVE, LOC_MAINSTREET, LOC_CENTRALSTATION, LOC_LITTLEITALY),
'coords' => array(23.2, 39.7, 0),
),
LOC_OCEANDRIVE => array(
'name' => clienttranslate('Ocean Drive'),
'neighbors' => array(LOC_FORESTPARK, LOC_ROADHOUSE, LOC_MAINSTREET, LOC_TROCADERO),
'coords' => array(23.9, 64.2, 1.3),
),
LOC_CHINATOWN => array(
'name' => clienttranslate('China Town'),
'neighbors' => array(LOC_LITTLEITALY, LOC_CENTRALSTATION, LOC_UNIONSQUARE),
'coords' => array(43.2, 2.8, 0),
),
LOC_CENTRALSTATION => array(
'name' => clienttranslate('Central Station'),
'neighbors' => array(LOC_LITTLEITALY, LOC_TROCADERO, LOC_MAINSTREET, LOC_DOWNTOWN, LOC_UNIONSQUARE, LOC_CHINATOWN),
'coords' => array(43.2, 27.5, 1.15),
),
LOC_MAINSTREET => array(
'name' => clienttranslate('Main Street'),
'neighbors' => array(LOC_TROCADERO, LOC_OCEANDRIVE, LOC_ROADHOUSE, LOC_RICKSCAFE, LOC_DOWNTOWN, LOC_CENTRALSTATION),
'coords' => array(42.5, 51.8, 0),
),
LOC_ROADHOUSE => array(
'name' => clienttranslate('Road House'),
'neighbors' => array(LOC_OCEANDRIVE, LOC_RICKSCAFE, LOC_MAINSTREET),
'coords' => array(43.4, 76.2, 1.7),
),
LOC_UNIONSQUARE => array(
'name' => clienttranslate('Union Square'),
'neighbors' => array(LOC_CHINATOWN, LOC_CENTRALSTATION, LOC_DOWNTOWN, LOC_WATERFRONT),
'coords' => array(63.0, 15.3, -1.5),
),
LOC_DOWNTOWN => array(
'name' => clienttranslate('Downtown'),
'neighbors' => array(LOC_CENTRALSTATION, LOC_MAINSTREET, LOC_RICKSCAFE, LOC_SKIDROW, LOC_WATERFRONT, LOC_UNIONSQUARE),
'coords' => array(63.1, 39.4, 0),
),
LOC_RICKSCAFE => array(
'name' => clienttranslate('Rick’s Café'),
'neighbors' => array(LOC_MAINSTREET, LOC_ROADHOUSE, LOC_SKIDROW, LOC_DOWNTOWN),
'coords' => array(63.1, 64.1, 0),
),
LOC_WATERFRONT => array(
'name' => clienttranslate('Waterfront'),
'neighbors' => array(LOC_UNIONSQUARE, LOC_DOWNTOWN, LOC_SKIDROW),
'coords' => array(82.3, 27.4, 1.5),
),
LOC_SKIDROW => array(
'name' => clienttranslate('Skid Row'),
'neighbors' => array(LOC_DOWNTOWN, LOC_RICKSCAFE, LOC_WATERFRONT),
'coords' => array(82.5, 51.7, 0),
),
);
// For each location create 3 slots; in the UI these will be anchors to orient
// our tiles on.
foreach ($this->locations as $loc_id => $loc) {
$this->locations[$loc_id]['slots'] = array(
'crime' => array('id' => $loc_id * 100 + 1),
'location' => array('id' => $loc_id * 100 + 2),
'suspect' => array('id' => $loc_id * 100 + 3),
);
}
// We use this as the basis to create all cards, evidence and base cards, but
// not all of the info is used in each deck. But as there is a 1:1 relation
// between cases and evidences, let's don't repeat ourselves.
$this->cardBasis = array(
1 => array('name' => clienttranslate('Murder'),
'nametr' => self::_('Murder'),
'casetype' => 'crime',
),
2 => array('name' => clienttranslate('Shorty'),
'nametr' => self::_('Shorty'),
'casetype' => 'suspect',
),
3 => array('name' => clienttranslate('Doc'),
'nametr' => self::_('Doc'),
'casetype' => 'suspect',
),
4 => array('name' => clienttranslate('Rusty'),
'nametr' => self::_('Rusty'),
'casetype' => 'suspect',
),
5 => array('name' => clienttranslate('Bubbles'),
'nametr' => self::_('Bubbles'),
'casetype' => 'suspect',
),
6 => array('name' => clienttranslate('Frenchy'),
'nametr' => self::_('Frenchy'),
'casetype' => 'suspect',
),
7 => array('name' => clienttranslate('Maurice'),
'nametr' => self::_('Maurice'),
'casetype' => 'suspect',
),
8 => array('name' => clienttranslate('Main Street'),
'nametr' => self::_('Main Street'),
'casetype' => 'location',
),
9 => array('name' => clienttranslate('Waterfront'),
'nametr' => self::_('Waterfront'),
'casetype' => 'location',
),
10 => array('name' => clienttranslate('Mob Killing'),
'nametr' => self::_('Mob Killing'),
'casetype' => 'crime',
),
11 => array('name' => clienttranslate('Pop'),
'nametr' => self::_('Pop'),
'casetype' => 'suspect',
),
12 => array('name' => clienttranslate('Dutch'),
'nametr' => self::_('Dutch'),
'casetype' => 'suspect',
),
13 => array('name' => clienttranslate('Knuckles'),
'nametr' => self::_('Knuckles'),
'casetype' => 'suspect',
),
14 => array('name' => clienttranslate('Pinky'),
'nametr' => self::_('Pinky'),
'casetype' => 'suspect',
),
15 => array('name' => clienttranslate('Queenie'),
'nametr' => self::_('Queenie'),
'casetype' => 'suspect',
),
16 => array('name' => clienttranslate('Earl'),
'nametr' => self::_('Earl'),
'casetype' => 'suspect',
),
17 => array('name' => clienttranslate('Ocean Drive'),
'nametr' => self::_('Ocean Drive'),
'casetype' => 'location',
),
18 => array('name' => clienttranslate('Union Square'),
'nametr' => self::_('Union Square'),
'casetype' => 'location',
),
19 => array('name' => clienttranslate('Little Italy'),
'nametr' => self::_('Little Italy'),
'casetype' => 'location',
),
20 => array('name' => clienttranslate('Bank Job'),
'nametr' => self::_('Bank Job'),
'casetype' => 'crime',
),
21 => array('name' => clienttranslate('Blackmail'),
'nametr' => self::_('Blackmail'),
'casetype' => 'crime',
),
22 => array('name' => clienttranslate('Police Corruption'),
'nametr' => self::_('Police Corruption'),
'casetype' => 'crime',
),
23 => array('name' => clienttranslate('Forgery'),
'nametr' => self::_('Forgery'),
'casetype' => 'crime',
),
24 => array('name' => clienttranslate('Downtown'),
'nametr' => self::_('Downtown'),
'casetype' => 'location',
),
25 => array('name' => clienttranslate('China Town'),
'nametr' => self::_('China Town'),
'casetype' => 'location',
),
26 => array('name' => clienttranslate('Forest Park'),
'nametr' => self::_('Forest Park'),
'casetype' => 'location',
),
27 => array('name' => clienttranslate('Central Station'),
'nametr' => self::_('Central Station'),
'casetype' => 'location',
),
28 => array('name' => clienttranslate('Rick’s Café'),
'nametr' => self::_('Rick’s Café'),
'casetype' => 'location',
),
29 => array('name' => clienttranslate('Kidnapping'),
'nametr' => self::_('Kidnapping'),
'casetype' => 'crime',
),
30 => array('name' => clienttranslate('Jewellery Heist'),
'nametr' => self::_('Jewellery Heist'),
'casetype' => 'crime',
),
31 => array('name' => clienttranslate('Smuggling'),
'nametr' => self::_('Smuggling'),
'casetype' => 'crime',
),
32 => array('name' => clienttranslate('Protection Racket'),
'nametr' => self::_('Protection Racket'),
'casetype' => 'crime',
),
33 => array('name' => clienttranslate('Road House'),
'nametr' => self::_('Road House'),
'casetype' => 'location',
),
34 => array('name' => clienttranslate('Trocadero'),
'nametr' => self::_('Trocadero'),
'casetype' => 'location',
),
35 => array('name' => clienttranslate('Skid Row'),
'nametr' => self::_('Skid Row'),
'casetype' => 'location',
),
36 => array('name' => clienttranslate('Lakeside'),
'nametr' => self::_('Lakeside'),
'casetype' => 'location',
),
);
// The case cards; data-wise a copy of the evidence cards
for ($i=1; $i<=36; $i++) {
$this->cardBasis[36 + $i] = $this->cardBasis[$i];
}
$this->tiles = array(
1 => array('name' => clienttranslate('NO CRIME'), 'nametr' => self::_('NO CRIME'), 'tiletype' => 'crime'),
2 => array('name' => clienttranslate('NO CRIME'), 'nametr' => self::_('NO CRIME'), 'tiletype' => 'crime'),
3 => array('name' => clienttranslate('NO CRIME'), 'nametr' => self::_('NO CRIME'), 'tiletype' => 'crime'),
4 => array('name' => clienttranslate('NO CRIME'), 'nametr' => self::_('NO CRIME'), 'tiletype' => 'crime'),
5 => array('name' => clienttranslate('NO SUSPECT'), 'nametr' => self::_('NO SUSPECT'), 'tiletype' => 'suspect'),
6 => array('name' => clienttranslate('NO SUSPECT'), 'nametr' => self::_('NO SUSPECT'), 'tiletype' => 'suspect'),
7 => array('name' => clienttranslate('Forgery'), 'nametr' => self::_('Forgery'), 'tiletype' => 'crime'),
8 => array('name' => clienttranslate('Jewellery Heist'), 'nametr' => self::_('Jewellery Heist'), 'tiletype' => 'crime'),
9 => array('name' => clienttranslate('Kidnapping'), 'nametr' => self::_('Kidnapping'), 'tiletype' => 'crime'),
10 => array('name' => clienttranslate('Police Corruption'), 'nametr' => self::_('Police Corruption'), 'tiletype' => 'crime'),
11 => array('name' => clienttranslate('Mob Killing'), 'nametr' => self::_('Mob Killing'), 'tiletype' => 'crime'),
12 => array('name' => clienttranslate('Protection Racket'), 'nametr' => self::_('Protection Racket'), 'tiletype' => 'crime'),
13 => array('name' => clienttranslate('Murder'), 'nametr' => self::_('Murder'), 'tiletype' => 'crime'),
14 => array('name' => clienttranslate('Blackmail'), 'nametr' => self::_('Blackmail'), 'tiletype' => 'crime'),
15 => array('name' => clienttranslate('Smuggling'), 'nametr' => self::_('Smuggling'), 'tiletype' => 'crime'),
16 => array('name' => clienttranslate('Bank Job'), 'nametr' => self::_('Bank Job'), 'tiletype' => 'crime'),
17 => array('name' => clienttranslate('Rusty'), 'nametr' => self::_('Rusty'), 'tiletype' => 'suspect'),
18 => array('name' => clienttranslate('Dutch'), 'nametr' => self::_('Dutch'), 'tiletype' => 'suspect'),
19 => array('name' => clienttranslate('Doc'), 'nametr' => self::_('Doc'), 'tiletype' => 'suspect'),
20 => array('name' => clienttranslate('Earl'), 'nametr' => self::_('Earl'), 'tiletype' => 'suspect'),
21 => array('name' => clienttranslate('Pop'), 'nametr' => self::_('Pop'), 'tiletype' => 'suspect'),
22 => array('name' => clienttranslate('Knuckles'), 'nametr' => self::_('Knuckles'), 'tiletype' => 'suspect'),
23 => array('name' => clienttranslate('Queenie'), 'nametr' => self::_('Queenie'), 'tiletype' => 'suspect'),
24 => array('name' => clienttranslate('Bubbles'), 'nametr' => self::_('Bubbles'), 'tiletype' => 'suspect'),
25 => array('name' => clienttranslate('Maurice'), 'nametr' => self::_('Maurice'), 'tiletype' => 'suspect'),
26 => array('name' => clienttranslate('Pinky'), 'nametr' => self::_('Pinky'), 'tiletype' => 'suspect'),
27 => array('name' => clienttranslate('Frenchy'), 'nametr' => self::_('Frenchy'), 'tiletype' => 'suspect'),
28 => array('name' => clienttranslate('Shorty'), 'nametr' => self::_('Shorty'), 'tiletype' => 'suspect'),
// FAKE TILES for the fixed on-board locations. But having them being handled
// the same way as normal tiles makes it easier for us. In the UI these will
// be invisible DIVs for the most part, except when highlighted for the Case
// solving action.
29 => array('name' => $this->locations[LOC_LAKESIDE]['name'], 'nametr' => self::_('Lakeside'), 'tiletype' => 'location'),
30 => array('name' => $this->locations[LOC_FORESTPARK]['name'], 'nametr' => self::_('Forest Park'), 'tiletype' => 'location'),
31 => array('name' => $this->locations[LOC_LITTLEITALY]['name'], 'nametr' => self::_('Little Italy'), 'tiletype' => 'location'),
32 => array('name' => $this->locations[LOC_TROCADERO]['name'], 'nametr' => self::_('Trocadero'), 'tiletype' => 'location'),
33 => array('name' => $this->locations[LOC_OCEANDRIVE]['name'], 'nametr' => self::_('Ocean Drive'), 'tiletype' => 'location'),
34 => array('name' => $this->locations[LOC_CHINATOWN]['name'], 'nametr' => self::_('China Town'), 'tiletype' => 'location'),
35 => array('name' => $this->locations[LOC_CENTRALSTATION]['name'], 'nametr' => self::_('Central Station'), 'tiletype' => 'location'),
36 => array('name' => $this->locations[LOC_MAINSTREET]['name'], 'nametr' => self::_('Main Street'), 'tiletype' => 'location'),
37 => array('name' => $this->locations[LOC_ROADHOUSE]['name'], 'nametr' => self::_('Road House'), 'tiletype' => 'location'),
38 => array('name' => $this->locations[LOC_UNIONSQUARE]['name'], 'nametr' => self::_('Union Square'), 'tiletype' => 'location'),
39 => array('name' => $this->locations[LOC_DOWNTOWN]['name'], 'nametr' => self::_('Downtown'), 'tiletype' => 'location'),
40 => array('name' => $this->locations[LOC_RICKSCAFE]['name'], 'nametr' => self::_('Rick’s Café'), 'tiletype' => 'location'),
41 => array('name' => $this->locations[LOC_WATERFRONT]['name'], 'nametr' => self::_('Waterfront'), 'tiletype' => 'location'),
42 => array('name' => $this->locations[LOC_SKIDROW]['name'], 'nametr' => self::_('Skid Row'), 'tiletype' => 'location'),
);
$this->tokeninfos = array(
array('key' => 'cube_blue_{INDEX}', 'nbr' => $this->constants["CUBES_PER_PLAYER"]),
array('key' => 'cube_green_{INDEX}', 'nbr' => $this->constants["CUBES_PER_PLAYER"]),
array('key' => 'cube_purple_{INDEX}', 'nbr' => $this->constants["CUBES_PER_PLAYER"]),
array('key' => 'cube_red_{INDEX}', 'nbr' => $this->constants["CUBES_PER_PLAYER"]),
array('key' => 'cube_yellow_{INDEX}', 'nbr' => $this->constants["CUBES_PER_PLAYER"]),
array('key' => 'disc_blue_{INDEX}', 'nbr' => $this->constants["DISCS_PER_PLAYER"]),
array('key' => 'disc_green_{INDEX}', 'nbr' => $this->constants["DISCS_PER_PLAYER"]),
array('key' => 'disc_purple_{INDEX}', 'nbr' => $this->constants["DISCS_PER_PLAYER"]),
array('key' => 'disc_red_{INDEX}', 'nbr' => $this->constants["DISCS_PER_PLAYER"]),
array('key' => 'disc_yellow_{INDEX}', 'nbr' => $this->constants["DISCS_PER_PLAYER"]),
// The 'private investigators'
array('key' => 'pi_blue_{INDEX}', 'nbr' => $this->constants["PIS_PER_PLAYER"]),
array('key' => 'pi_green_{INDEX}', 'nbr' => $this->constants["PIS_PER_PLAYER"]),
array('key' => 'pi_purple_{INDEX}', 'nbr' => $this->constants["PIS_PER_PLAYER"]),
array('key' => 'pi_red_{INDEX}', 'nbr' => $this->constants["PIS_PER_PLAYER"]),
array('key' => 'pi_yellow_{INDEX}', 'nbr' => $this->constants["PIS_PER_PLAYER"]),
// The VP markers (1st case, 2nd case, 3rd case; but indexed 0, 1, 2!)
array('key' => 'vp_blue_{INDEX}', 'nbr' => 3),
array('key' => 'vp_green_{INDEX}', 'nbr' => 3),
array('key' => 'vp_purple_{INDEX}', 'nbr' => 3),
array('key' => 'vp_red_{INDEX}', 'nbr' => 3),
array('key' => 'vp_yellow_{INDEX}', 'nbr' => 3),
// The penalty tokens
array('key' => 'penalty_red'),
array('key' => 'penalty_blue'),
array('key' => 'penalty_yellow'),
array('key' => 'penalty_green'),
array('key' => 'penalty_purple'),
);