forked from LostSavage/SecretHitlerCE
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcardsboard.ttslua
More file actions
647 lines (577 loc) · 18.2 KB
/
cardsboard.ttslua
File metadata and controls
647 lines (577 loc) · 18.2 KB
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
--Board cards
TOPTHREE_STRING = "The president examines\nthe top three cards."
PICKPRES_STRING = "The president picks\nthe next presidential\ncandidate."
INSPECT_STRING = "The president\ninvestigates a\nplayer\'s identity\ncard."
BULLET_STRING = "The president must\nkill a player."
TOPCARD_STRING = "The president examines\nthe top card."
IMPRISON_STRING = "The president must\nimprison a player."
PRESTAKESABOVE_STRING = "The president takes\nthe card above."
PRESTAKESBELOW_STRING = "The president takes\nthe card below."
PRESTAKESHIDDENABOVE_STRING = "The president takes\nthe hidden card above."
PRESTAKESHIDDENBELOW_STRING = "The president takes\nthe hidden card below."
PRESGIVESABOVE_STRING = "The president gives\nthe card above\nto another player."
PRESGIVESBELOW_STRING = "The president gives\nthe card below\nto another player."
PRESGIVESHIDDENABOVE_STRING = "The president gives\nthe card above\nto another player\nafter examining it."
PRESGIVESHIDDENBELOW_STRING = "The president gives\nthe card below\nto another player\nafter examining it."
DOESNOTHING_STRING = "The president\ndoes nothing."
VETO_STRING = "Veto power is\nunlocked."
CHANCELLOR_STRING = "The chancellor gets the power."
--Policy cards
LIBERALPOLICY_STRING = "Liberal Policy"
FASCISTPOLICY_STRING = "Fascist Policy"
GREYPOLICY_STRING = "Grey Policy"
NOTUSED_STRING = "Not Used"
function isBoardCard(objIn)
if objIn.tag == "Card" and
(objIn.getDescription() == TOPTHREE_STRING or
objIn.getDescription() == PICKPRES_STRING or
objIn.getDescription() == INSPECT_STRING or
objIn.getDescription() == BULLET_STRING or
objIn.getDescription() == TOPCARD_STRING or
objIn.getDescription() == IMPRISON_STRING or
objIn.getDescription() == PRESTAKESABOVE_STRING or
objIn.getDescription() == PRESTAKESBELOW_STRING or
objIn.getDescription() == PRESTAKESHIDDENABOVE_STRING or
objIn.getDescription() == PRESTAKESHIDDENBELOW_STRING or
objIn.getDescription() == PRESGIVESABOVE_STRING or
objIn.getDescription() == PRESGIVESBELOW_STRING or
objIn.getDescription() == PRESGIVESHIDDENABOVE_STRING or
objIn.getDescription() == PRESGIVESHIDDENBELOW_STRING or
objIn.getDescription() == DOESNOTHING_STRING or
objIn.getDescription() == VETO_STRING or
objIn.getDescription() == CHANCELLOR_STRING) then
return true
end
return false
end
function isSubBoardCard(objIn)
if objIn.tag == "Card" and
(objIn.getDescription() == VETO_STRING or
objIn.getDescription() == CHANCELLOR_STRING) then
return true
end
return false
end
function isBoardCardAboveAbility(objIn)
if objIn.tag == "Card" and
(objIn.getDescription() == PRESTAKESABOVE_STRING or
objIn.getDescription() == PRESGIVESABOVE_STRING) then
return true
end
return false
end
function isBoardCardAboveHiddenAbility(objIn)
if objIn.tag == "Card" and
(objIn.getDescription() == PRESTAKESHIDDENABOVE_STRING or
objIn.getDescription() == PRESGIVESHIDDENABOVE_STRING) then
return true
end
return false
end
function isBoardCardBelowAbility(objIn)
if objIn.tag == "Card" and
(objIn.getDescription() == PRESTAKESBELOW_STRING or
objIn.getDescription() == PRESGIVESBELOW_STRING) then
return true
end
return false
end
function isBoardCardBelowHiddenAbility(objIn)
if objIn.tag == "Card" and
(objIn.getDescription() == PRESTAKESHIDDENBELOW_STRING or
objIn.getDescription() == PRESGIVESHIDDENBELOW_STRING) then
return true
end
return false
end
function isBoardCardTopThree(objIn)
if objIn.tag == "Card" and objIn.getDescription() == TOPTHREE_STRING then
return true
end
return false
end
function isBoardCardPickPres(objIn)
if objIn.tag == "Card" and objIn.getDescription() == PICKPRES_STRING then
return true
end
return false
end
function isBoardCardInspect(objIn)
if objIn.tag == "Card" and objIn.getDescription() == INSPECT_STRING then
return true
end
return false
end
function isBoardCardBullet(objIn)
if objIn.tag == "Card" and objIn.getDescription() == BULLET_STRING then
return true
end
return false
end
function isBoardCardTopCard(objIn)
if objIn.tag == "Card" and objIn.getDescription() == TOPCARD_STRING then
return true
end
return false
end
function isBoardCardImprison(objIn)
if objIn.tag == "Card" and objIn.getDescription() == IMPRISON_STRING then
return true
end
return false
end
function isPolicyCard(objIn)
if objIn.tag == "Card" and (objIn.getDescription() == FASCISTPOLICY_STRING
or objIn.getDescription() == LIBERALPOLICY_STRING
or objIn.getDescription() == GREYPOLICY_STRING)
and not objIn.held_by_color then
return true
end
return false
end
function isFascistPolicyCard(objIn)
if objIn.tag == "Card" and objIn.getDescription() == FASCISTPOLICY_STRING
and not objIn.held_by_color then
return true
end
return false
end
function isLiberalPolicyCard(objIn)
if objIn.tag == "Card" and objIn.getDescription() == LIBERALPOLICY_STRING
and not objIn.held_by_color then
return true
end
return false
end
function isGreyPolicyCard(objIn)
if objIn.tag == "Card" and objIn.getDescription() == GREYPOLICY_STRING
and not objIn.held_by_color then
return true
end
return false
end
function isPolicyNotUsedCard(objIn)
if objIn.tag == "Card" and objIn.getDescription() == NOTUSED_STRING
and not objIn.held_by_color then
return true
end
return false
end
function refreshBoardCards()
if options.gameType == 2 then
deleteCustomBoardCards()
spawnCustomBoardCards()
-- Unlock board cards
testActionUsedPolicyZones(
function(p) return isBoardCard(p) or isPolicyNotUsedCard(p) end,
function(p) p.setLock(false) end,
boardCardWaitId)
else
--delete board cards
deleteCustomBoardCards()
testActionUsedPolicyZones(
function(p) return isBoardCard(p) or isPolicyNotUsedCard(p) end,
function(p) p.destruct() end,
nil)
spawnNotUsedFascist(getPositionByGUIDOffsetZ(fascist_zone_guids[1], 0.1))
spawnNotUsedLiberal(getPositionByGUIDOffsetZ(liberal_zone_guids[1], 0.1))
if #getSeatedPlayers() > 8 then
spawnInspectOrange(getPositionByGUIDOffsetZ(fascist_zone_guids[2], 0.1))
spawnInspectOrange(getPositionByGUIDOffsetZ(fascist_zone_guids[3], 0.1))
spawnPickPresOrange(getPositionByGUIDOffsetZ(fascist_zone_guids[4], 0.1))
elseif #getSeatedPlayers() > 6 then
spawnInspectOrange(getPositionByGUIDOffsetZ(fascist_zone_guids[3], 0.1))
spawnPickPresOrange(getPositionByGUIDOffsetZ(fascist_zone_guids[4], 0.1))
else
spawnTopThreeOrange(getPositionByGUIDOffsetZ(fascist_zone_guids[4], 0.1))
end
spawnBulletRed(getPositionByGUIDOffsetZ(fascist_zone_guids[5], 0.1))
spawnBulletRed(getPositionByGUIDOffsetZ(fascist_zone_guids[6], 0.1))
spawnVetoRed(getPositionByGUIDOffsetZ(fascist_zone_guids[6], -2))
if boardCardWaitId then
Wait.stop(boardCardWaitId)
end
boardCardWaitId = Wait.time(
function()
testReadyToLock(
function(p)
return isBoardCard(p) or isPolicyNotUsedCard(p)
end, boardCardWaitId)
end, 5, -1)
end
lastPlayerCt = #getSeatedPlayers()
end
function testActionUsedPolicyZones(testFunc, actionFunc, waitID)
local tmpZoneGuid
if waitID then
Wait.stop(waitID)
end
for _, tmpZoneGuid in ipairs(liberal_zone_guids) do
tmpZone = getObjectFromGUID(tmpZoneGuid)
if tmpZone then
inZone = tmpZone.getObjects()
for _, j in ipairs(inZone) do
if testFunc(j) then
actionFunc(j)
end
end
end
end
for _, tmpZoneGuid in ipairs(fascist_zone_guids) do
tmpZone = getObjectFromGUID(tmpZoneGuid)
if tmpZone then
inZone = tmpZone.getObjects()
for _, j in ipairs(inZone) do
if testFunc(j) then
actionFunc(j)
end
end
end
end
end
function testReadyToLock(testFunc, waitID)
local lock = true
--check if anything is loading
for _, j in pairs(getAllObjects()) do
if j.loading_custom and j.tag ~= "3D Text" then lock = false end
end
--check if resting
if lock then
for _, tmpZoneGuid in ipairs(liberal_zone_guids) do
tmpZone = getObjectFromGUID(tmpZoneGuid)
if tmpZone then
inZone = tmpZone.getObjects()
for _, j in ipairs(inZone) do
if testFunc(j) then
if not j.resting then lock = false end
end
end
end
end
end
if lock then
for _, tmpZoneGuid in ipairs(fascist_zone_guids) do
tmpZone = getObjectFromGUID(tmpZoneGuid)
if tmpZone then
inZone = tmpZone.getObjects()
for _, j in ipairs(inZone) do
if testFunc(j) then
if not j.resting then lock = false end
end
end
end
end
end
if lock then
-- lock board cards
testActionUsedPolicyZones(
function(p) return testFunc(p) end,
function(p) p.setLock(true) end,
waitID)
end
end
function deleteCustomBoardCards()
local tmpZoneGuid
local inUse = {}
for _, tmpZoneGuid in ipairs(liberal_zone_guids) do
tmpZone = getObjectFromGUID(tmpZoneGuid)
if tmpZone then
inZone = tmpZone.getObjects()
for _, j in ipairs(inZone) do
if isBoardCard(j) or isPolicyNotUsedCard(j) then
smartTableInsert(inUse, j.getGUID())
end
end
end
end
for _, tmpZoneGuid in ipairs(fascist_zone_guids) do
tmpZone = getObjectFromGUID(tmpZoneGuid)
if tmpZone then
inZone = tmpZone.getObjects()
for _, j in ipairs(inZone) do
if isBoardCard(j) or isPolicyNotUsedCard(j) then
smartTableInsert(inUse, j.getGUID())
end
end
end
end
for _, j in pairs(getAllObjects()) do
if (isBoardCard(j) or isPolicyNotUsedCard(j)) and not inTable(inUse, j.getGUID()) then
destroyObject(j);
end
end
end
function spawnCustomBoardCards()
spawnTopThreeOrange({-38, 2, 19})
spawnTopThreeRed({-38, 2, 15})
spawnTopThreeBlue({-38, 2, 11})
spawnInspectOrange({-34, 2, 19})
spawnInspectRed({-34, 2, 15})
spawnInspectBlue({-34, 2, 11})
spawnPickPresOrange({-30, 2, 19})
spawnPickPresRed({-30, 2, 15})
spawnPickPresBlue({-30, 2, 11})
spawnBulletOrange({-26, 2, 19})
spawnBulletRed({-26, 2, 15})
spawnBulletBlue({-26, 2, 11})
spawnVetoOrange({-36, 2, 8})
spawnVetoRed({-36, 2, 6})
spawnVetoBlue({-36, 2, 4})
spawnNotUsedFascist({-32, 2, 6})
spawnNotUsedLiberal({-28, 2, 6})
spawnTopCardOrange({-36, 2, 1})
spawnTopCardRed({-36, 2, -3})
spawnTopCardBlue({-36, 2, -7})
spawnImprisonOrange({-32, 2, 1})
spawnImprisonRed({-32, 2, -3})
spawnImprisonBlue({-32, 2, -7})
spawnDoesNothingOrange({-28, 2, 1})
spawnDoesNothingRed({-28, 2, -3})
spawnDoesNothingBlue({-28, 2, -7})
spawnPresTakesOrange({-38, 2, -11})
spawnPresTakesRed({-38, 2, -15})
spawnPresTakesBlue({-38, 2, -19})
spawnPresTakesHiddenOrange({-34, 2, -11})
spawnPresTakesHiddenRed({-34, 2, -15})
spawnPresTakesHiddenBlue({-34, 2, -19})
spawnPresGivesOrange({-30, 2, -11})
spawnPresGivesRed({-30, 2, -15})
spawnPresGivesBlue({-30, 2, -19})
spawnPresGivesHiddenOrange({-26, 2, -11})
spawnPresGivesHiddenRed({-26, 2, -15})
spawnPresGivesHiddenBlue({-26, 2, -19})
--spawnChancellorOrange({-36, 2, -22})
--spawnChancellorRed({-32, 2, -22})
--spawnChancellorBlue({-28, 2, -22})
end
function spawnTopThreeOrange(pos)
return spawnBoardCard("10000", TOPTHREE_STRING, pos)
end
function spawnTopThreeRed(pos)
return spawnBoardCard("10001", TOPTHREE_STRING, pos)
end
function spawnTopThreeBlue(pos)
return spawnBoardCard("10002", TOPTHREE_STRING, pos)
end
function spawnPickPresOrange(pos)
return spawnBoardCard("10003", PICKPRES_STRING, pos)
end
function spawnPickPresRed(pos)
return spawnBoardCard("10004", PICKPRES_STRING, pos)
end
function spawnPickPresBlue(pos)
return spawnBoardCard("10005", PICKPRES_STRING, pos)
end
function spawnInspectOrange(pos)
return spawnBoardCard("10006", INSPECT_STRING, pos)
end
function spawnInspectRed(pos)
return spawnBoardCard("10007", INSPECT_STRING, pos)
end
function spawnInspectBlue(pos)
return spawnBoardCard("10008", INSPECT_STRING, pos)
end
function spawnBulletOrange(pos)
return spawnBoardCard("10009", BULLET_STRING, pos)
end
function spawnBulletRed(pos)
return spawnBoardCard("10010", BULLET_STRING, pos)
end
function spawnBulletBlue(pos)
return spawnBoardCard("10011", BULLET_STRING, pos)
end
function spawnTopCardOrange(pos)
return spawnBoardCard("10012", TOPCARD_STRING, pos)
end
function spawnTopCardRed(pos)
return spawnBoardCard("10013", TOPCARD_STRING, pos)
end
function spawnTopCardBlue(pos)
return spawnBoardCard("10014", TOPCARD_STRING, pos)
end
function spawnImprisonOrange(pos)
return spawnBoardCard("10015", IMPRISON_STRING, pos)
end
function spawnImprisonRed(pos)
return spawnBoardCard("10016", IMPRISON_STRING, pos)
end
function spawnImprisonBlue(pos)
return spawnBoardCard("10017", IMPRISON_STRING, pos)
end
function spawnPresTakesOrange(pos)
return spawnBoardCard("10018", PRESTAKESABOVE_STRING, pos)
end
function spawnPresTakesRed(pos)
return spawnBoardCard("10019", PRESTAKESABOVE_STRING, pos)
end
function spawnPresTakesBlue(pos)
return spawnBoardCard("10020", PRESTAKESBELOW_STRING, pos)
end
function spawnPresTakesHiddenOrange(pos)
return spawnBoardCard("10021", PRESTAKESHIDDENABOVE_STRING, pos)
end
function spawnPresTakesHiddenRed(pos)
return spawnBoardCard("10022", PRESTAKESHIDDENABOVE_STRING, pos)
end
function spawnPresTakesHiddenBlue(pos)
return spawnBoardCard("10023", PRESTAKESHIDDENBELOW_STRING , pos)
end
function spawnPresGivesOrange(pos)
return spawnBoardCard("10024", PRESGIVESABOVE_STRING, pos)
end
function spawnPresGivesRed(pos)
return spawnBoardCard("10025", PRESGIVESABOVE_STRING, pos)
end
function spawnPresGivesBlue(pos)
return spawnBoardCard("10026", PRESGIVESBELOW_STRING, pos)
end
function spawnPresGivesHiddenOrange(pos)
return spawnBoardCard("10027", PRESGIVESHIDDENABOVE_STRING, pos)
end
function spawnPresGivesHiddenRed(pos)
return spawnBoardCard("10028", PRESGIVESHIDDENABOVE_STRING, pos)
end
function spawnPresGivesHiddenBlue(pos)
return spawnBoardCard("10029", PRESGIVESHIDDENBELOW_STRING, pos)
end
function spawnDoesNothingOrange(pos)
return spawnBoardCard("10030", DOESNOTHING_STRING, pos)
end
function spawnDoesNothingRed(pos)
return spawnBoardCard("10031", DOESNOTHING_STRING, pos)
end
function spawnDoesNothingBlue(pos)
return spawnBoardCard("10032", DOESNOTHING_STRING, pos)
end
function spawnBoardCard(cardID, desc, pos)
local params = {
json =
"{" ..
"\"Name\": \"Card\", " ..
"\"Transform\": {\"posX\": 0,\"posY\": 0,\"posZ\": 0,\"rotX\": 0,\"rotY\": 0,\"rotZ\": 0,\"scaleX\": 1,\"scaleY\": 1,\"scaleZ\": 1}, " ..
"\"CardID\": " .. cardID .. ", " ..
"\"CustomDeck\": {" ..
"\"" .. string.sub(cardID, 1, 3) .. "\": {" ..
"\"FaceURL\": \"http://cloud-3.steamusercontent.com/ugc/809997459545222830/36C579AD5879CA194D3142C7C1940E2AE19F888E/\", " ..
"\"BackURL\": \"http://cloud-3.steamusercontent.com/ugc/809997459545150312/0CAC8BEF72548FBBABB723081596771432C78476/\", " ..
"\"NumWidth\": 10, " ..
"\"NumHeight\": 7, " ..
"\"BackIsHidden\": false, " ..
"\"UniqueBack\": false " ..
"}" ..
"}" ..
"}",
position = pos,
rotation = FACE_UP_ROT,
scale = {x = 1, y = 1, z = 1},
sound = false
}
local card = spawnObjectJSON(params)
card.setDescription(desc)
card.use_grid = false
return card
end
function spawnVetoOrange(pos)
return spawnSubBoardCard("10100", VETO_STRING, pos)
end
function spawnVetoRed(pos)
return spawnSubBoardCard("10101", VETO_STRING, pos)
end
function spawnVetoBlue(pos)
return spawnSubBoardCard("10102", VETO_STRING, pos)
end
function spawnChancellorOrange(pos)
return spawnSubBoardCard("10103", CHANCELLOR_STRING, pos)
end
function spawnChancellorRed(pos)
return spawnSubBoardCard("10104", CHANCELLOR_STRING, pos)
end
function spawnChancellorBlue(pos)
return spawnSubBoardCard("10105", CHANCELLOR_STRING, pos)
end
function spawnSubBoardCard(cardID, desc, pos)
local params = {
json =
"{" ..
"\"Name\": \"Card\", " ..
"\"Transform\": {\"posX\": 0,\"posY\": 0,\"posZ\": 0,\"rotX\": 0,\"rotY\": 0,\"rotZ\": 0,\"scaleX\": 1,\"scaleY\": 1,\"scaleZ\": 1}, " ..
"\"CardID\": " .. cardID .. ", " ..
"\"CustomDeck\": {" ..
"\"" .. string.sub(cardID, 1, 3) .. "\": {" ..
"\"FaceURL\": \"http://cloud-3.steamusercontent.com/ugc/972100947052102628/F255D2E89C2A1D4FAA9C1AEC714802863A388D8C/\", " ..
"\"BackURL\": \"http://cloud-3.steamusercontent.com/ugc/972100947052102628/F255D2E89C2A1D4FAA9C1AEC714802863A388D8C/\", " ..
"\"NumWidth\": 3, " ..
"\"NumHeight\": 2, " ..
"\"BackIsHidden\": false, " ..
"\"UniqueBack\": true " ..
"}" ..
"}" ..
"}",
position = pos,
rotation = FACE_UP_ROT,
scale = {x = 0.3, y = 1, z = 0.3},
sound = false
}
local card = spawnObjectJSON(params)
card.setDescription(desc)
card.use_grid = false
return card
end
function spawnLiberalPolicy(pos, rot)
return spawnPolicyCard("10200", LIBERALPOLICY_STRING, pos, rot, true)
end
function spawnFascistPolicy(pos, rot)
return spawnPolicyCard("10201", FASCISTPOLICY_STRING, pos, rot, true)
end
function spawnGreyPolicy(pos, rot)
return spawnPolicyCard("10203", GREYPOLICY_STRING, pos, rot, true)
end
function spawnNotUsedLiberal(pos)
return spawnPolicyCard("10204", NOTUSED_STRING, pos, FACE_UP_ROT, false)
end
function spawnNotUsedFascist(pos)
return spawnPolicyCard("10205", NOTUSED_STRING, pos, FACE_UP_ROT, false)
end
function spawnPolicyCard(cardID, desc, pos, rot, luaBool)
local params = {
json =
"{" ..
"\"Name\": \"Card\", " ..
"\"Transform\": {\"posX\": 0,\"posY\": 0,\"posZ\": 0,\"rotX\": 0,\"rotY\": 0,\"rotZ\": 0,\"scaleX\": 1,\"scaleY\": 1,\"scaleZ\": 1}, " ..
"\"CardID\": " .. cardID .. ", " ..
"\"CustomDeck\": {" ..
"\"" .. string.sub(cardID, 1, 3) .. "\": {" ..
"\"FaceURL\": \"http://cloud-3.steamusercontent.com/ugc/968725783513761884/D20A41E646CE901CA81FC067E81072BBDA9313C4/\", " ..
"\"BackURL\": \"http://cloud-3.steamusercontent.com/ugc/486767005708571374/C5FBC566556E3FBE9A6C8ACCDB2472FA911A253A/\", " ..
"\"NumWidth\": 4, " ..
"\"NumHeight\": 2, " ..
"\"BackIsHidden\": false, " ..
"\"UniqueBack\": false " ..
"}" ..
"}" ..
"}",
position = pos,
rotation = rot,
scale = {x = 1.51, y = 1, z = 1.51},
sound = false
}
local card = spawnObjectJSON(params)
card.setDescription(desc)
card.use_grid = false
if luaBool then
card.setLuaScript(
'enabled = false -- workaround for rewind error\r\n' ..
'\r\n' ..
'function onDrop(playerColor)\r\n' ..
' enabled = true\r\n' ..
' Global.call(\'createPolicyCardWait\')\r\n' ..
'end\r\n' ..
'\r\n' ..
'function onCollisionEnter(collisionInfo)\r\n' ..
' if enabled then\r\n' ..
' Global.call(\'createPolicyCardWait\')\r\n' ..
' end\r\n' ..
'end\r\n')
end
return card
end