Repository navigation
Expand file tree
/
Copy pathdecks.js
More file actions
761 lines (732 loc) · 24.4 KB
/
Copy pathdecks.js
File metadata and controls
761 lines (732 loc) · 24.4 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
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
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
//GUIDE FOR CARD DEFINITIONS
//IMPORTANT IMPLEMENTATION NOTE:
//Do not alter card properties directly. Instead use the relevant modifier function. That way effects can stack, be undone, prevented, etc.
//REQUIRED properties:
/*
.title
.player
.cardType //entirely lowercase e.g. agenda
*/
//IMPLEMENTATION properties
/*
.cardLocation
.installOnlyOn //a function(card) that returns true for cards that can host this
.canHost //a function(card) that returns true for cards that can be hosted on this
.recurringCredits //automatically replenished when installed and at start of your turn
.canUseCredits //function(doing,card) which returns true if .credits can be spent (doing is "using","installing","removing tags","trace","rezzing","playing","advancing","trashing","paying trash costs")
.activeForOpponent //has an ability the opponent can use
*/
//COMMON properties:
/*
.requireHumanInput //set true if you want acknowledgement even when there's only one option
.imageFile //if using a GUI i.e. CardRenderer
.advancementRequirement
.canBeAdvanced //will be set true for all agendas if not defined
.agendaPoints
.installCost
.memoryCost
.memoryUnits //makes more available for runner (not to be confused with memoryCost or hostingMU)
.playCost
.rezCost
.strength
.subTypes[] //formatted as printed on card including capital letters and spaces
.trashCost
.unique //if true, any other cards with the same .title will be trashed when this is installed
.link //included in runner's link strength
*/
//DON'T FORGET any custom properties you want to reset (e.g. on trash or return to hand) should be placed in cardPropertyResets
//TODO maybe replace these with generic names
//TRIGGERED callbacks:
//Note that conveniently the globalTriggers phase will call Enumerate and Resolve in the context of the card (rather than context of triggerCallback)
//Each has (unless specified otherwise):
// .Resolve(params) //parameter object will contain all the necessary properties
//And optionally also:
// .Enumerate() //returns array where each element is a legal set of parameters for .Resolve(params), assumed valid if Enumerate omitted
// .text
// .automatic //set true to have this fire before the others i.e. not on the resolution order list (usually used for things that are not actual effects on card, just implementation)
// .availableWhenInactive //set true to have this fire even when not active
//To implement non-automatic trigger phases, use TriggeredResponsePhase. You can achieve automatic during these phases by including the code in Enumerate (be aware it will be called multiple times)
//Player chooses resolution order when multiple trigger simultaneously (e.g. multiple cards have 'when turn begins')
/*
.abilities[] //for operations and events the .Enumerate, .Resolve and .text are properties of the card itself not in abilities array
.subroutines[] //unlike the others here, these do not use Enumerate or params (for decisionmaking, implement a pseudophase) and have .visual with y (centre) and h (height)
For more callbacks, see trigger_standardising ods
*/
/**
* Create a card instance from definition.<br/>New card.location is not set.<br/>Nothing is logged.
*
* @method InstanceCard
* @param {int} setNumber index of the original definition to create instances from
* @returns {Card} newly created instance
*/
function InstanceCard(
setNumber,
backTextures,
glowTextures,
strengthTextures = { ice: null, ib: null, broken: null, rc: null, crc: null }
) {
var cardDefinition = cardSet[setNumber];
if (typeof cardDefinition == 'undefined') {
//maybe it is a tutorial
cardDefinition = tutorial[setNumber];
}
var player = cardDefinition.player;
cardDefinition.player = null; //unset to prevent recursion going nuts
var card = jQuery.extend(true, {}, cardDefinition);
cardDefinition.player = player; //restore now that recursion is done
card.isCard = true;
card.cardDefinition = cardDefinition; //save in case we need to compare against defaults later
card.player = player;
card.setNumber = setNumber;
//Do some special initialisations
if (card.cardType == "agenda" && typeof card.canBeAdvanced === "undefined")
card.canBeAdvanced = true; //agendas can be advanced by default
var costTexture = null;
if (card.player == runner) costTexture = strengthTextures.rc;
else if (
card.cardType == "ice" ||
card.cardType == "asset" ||
card.cardType == "upgrade"
)
costTexture = strengthTextures.crc;
var strengthInfo = { texture: null, num: 0, ice: false, cost: costTexture };
if (typeof (card.strength !== "undefined")) {
if (card.cardType == "ice")
strengthInfo = {
texture: strengthTextures.ice,
num: card.strength,
ice: true,
brokenTexture: strengthTextures.broken,
cost: costTexture,
};
if (card.cardType == "program")
strengthInfo = {
texture: strengthTextures.ib,
num: card.strength,
ice: false,
cost: costTexture,
};
}
//Create renderer object if relevant
if (
typeof card.imageFile !== "undefined" &&
typeof backTextures !== "undefined" &&
typeof glowTextures !== "undefined"
) {
if (typeof cardDefinition.frontTexture === "undefined")
cardDefinition.frontTexture = cardRenderer.LoadTexture(
"images/" + card.imageFile
);
card.renderer = cardRenderer.CreateCard(
card,
cardDefinition.frontTexture,
backTextures,
glowTextures,
strengthInfo
);
//create all the counters
for (var i = 0; i < counterList.length; i++) {
if (typeof card[counterList[i]] !== "undefined") card[counterList[i]] = 0;
var counter = cardRenderer.CreateCounter(
countersUI[counterList[i]].texture,
card,
counterList[i],
1,
true
);
counter.SetPosition(card.renderer.sprite.x, card.renderer.sprite.y);
card.renderer.sprite.addChild(counter.sprite);
card.renderer.sprite.addChild(counter.richText);
}
}
return card;
}
/**
* Create card instances from definition and push into an array. Returns an array of cards pushed.<br/>Nothing is logged.
*
* @method InstanceCardsPush
* @param {int} setNumber index of the original definition to create instances from
* @param {Card[]} destination array to push the Card instances into
* @param {int} num number of copies of the card to add
* @returns {Card[]} newly created instances
*/
function InstanceCardsPush(
setNumber,
destination,
num,
backTextures,
glowTextures,
strengthTextures = { ice: null, ib: null }
) {
var ret = [];
//push a deep copy num times
for (var i = 0; i < num; i++) {
var card = InstanceCard(
setNumber,
backTextures,
glowTextures,
strengthTextures
);
destination.push(card);
card.cardLocation = destination;
ret.push(card);
}
return ret;
}
/**
* Print the given array to the console in a human-readable format.<br/>Nothing is logged.
*
* @method PrintDeck
* @param {Card} identity for deck
* @param {Card[]} deck array to print
*/
function PrintDeck(identity, deck) {
//group cards
var sortedDeck = [];
for (var i = 0; i < deck.length; i++) {
var entryFound = -1;
for (var j = 0; j < sortedDeck.length; j++) {
if (sortedDeck[j].title == deck[i].title) {
entryFound = j;
break;
}
}
if (entryFound > -1) sortedDeck[entryFound].count++;
else sortedDeck.push({ title: deck[i].title, count: 1 });
}
//print
var ret = [identity.title];
for (var i = 0; i < sortedDeck.length; i++) {
ret.push(sortedDeck[i].count + " " + sortedDeck[i].title);
}
console.log(ret);
}
/**
* Set up Corp as a test field. Cards given as set indices in SystemGateway<br/>Nothing is logged.
*
* @method CorpTestField
* @param {int} identity Corp identity card
* @param {int[]} archivesCards cards in archives
* @param {int[]} rndCards cards in R&D (leave empty to use default/loaded R&D)
* @param {int[]} hqCards cards in HQ (leave empty to shuffle and draw five cards into HQ)
* @param {int[]} archivesInstalled cards installed in front of archives or in its root
* @param {int[]} rndInstalled cards installed in front of R&D or in its root
* @param {int[]} hqInstalled cards installed in front of HQ or in its root
* @param {int[][]} remotes remote servers, as cards installed in front or in root
* @param {int[]} scored cards in Corp's score area
*/
function CorpTestField(
identity,
archivesCards,
rndCards,
hqCards,
archivesInstalled,
rndInstalled,
hqInstalled,
remotes,
scored,
cardBackTexturesCorp,
glowTextures,
strengthTextures
) {
//hide an old identityCard if for some strange reason one exists (e.g. tutorial/testing)
if (corp.identityCard) corp.identityCard.renderer.destinationPosition = -1000;
//now make new one
corp.identityCard = InstanceCard(
identity,
cardBackTexturesCorp,
glowTextures,
strengthTextures
);
corp.identityCard.faceUp = true;
for (var i = 0; i < archivesCards.length; i++) {
InstanceCardsPush(
archivesCards[i],
corp.archives.cards,
1,
cardBackTexturesCorp,
glowTextures,
strengthTextures
);
}
if (rndCards.length > 0) {
while (corp.RnD.cards.length > 0) {
RemoveFromGame(corp.RnD.cards[0]);
}
for (var i = 0; i < rndCards.length; i++) {
InstanceCardsPush(
rndCards[i],
corp.RnD.cards,
1,
cardBackTexturesCorp,
glowTextures,
strengthTextures
);
}
}
if (hqCards.length > 0) {
for (var i = 0; i < hqCards.length; i++) {
InstanceCardsPush(
hqCards[i],
corp.HQ.cards,
1,
cardBackTexturesCorp,
glowTextures,
strengthTextures
);
}
skipShuffleAndDraw = true;
ChangePhase(phases.corpStartDraw);
}
for (var i = 0; i < archivesInstalled.length; i++) {
if (cardSet[archivesInstalled[i]].cardType == "ice")
InstanceCardsPush(
archivesInstalled[i],
corp.archives.ice,
1,
cardBackTexturesCorp,
glowTextures,
strengthTextures
);
else
InstanceCardsPush(
archivesInstalled[i],
corp.archives.root,
1,
cardBackTexturesCorp,
glowTextures,
strengthTextures
);
}
for (var i = 0; i < rndInstalled.length; i++) {
if (cardSet[rndInstalled[i]].cardType == "ice")
InstanceCardsPush(
rndInstalled[i],
corp.RnD.ice,
1,
cardBackTexturesCorp,
glowTextures,
strengthTextures
);
else
InstanceCardsPush(
rndInstalled[i],
corp.RnD.root,
1,
cardBackTexturesCorp,
glowTextures,
strengthTextures
);
}
for (var i = 0; i < hqInstalled.length; i++) {
if (cardSet[hqInstalled[i]].cardType == "ice")
InstanceCardsPush(
hqInstalled[i],
corp.HQ.ice,
1,
cardBackTexturesCorp,
glowTextures,
strengthTextures
);
else
InstanceCardsPush(
hqInstalled[i],
corp.HQ.root,
1,
cardBackTexturesCorp,
glowTextures,
strengthTextures
);
}
for (var j = 0; j < remotes.length; j++) {
var newServer = NewServer("Remote " + j, false);
corp.remoteServers.push(newServer);
for (var i = 0; i < remotes[j].length; i++) {
if (cardSet[remotes[j][i]].cardType == "ice")
InstanceCardsPush(
remotes[j][i],
newServer.ice,
1,
cardBackTexturesCorp,
glowTextures,
strengthTextures
);
else
InstanceCardsPush(
remotes[j][i],
newServer.root,
1,
cardBackTexturesCorp,
glowTextures,
strengthTextures
);
}
}
for (var i = 0; i < scored.length; i++) {
var newCard = InstanceCardsPush(
scored[i],
corp.scoreArea,
1,
cardBackTexturesCorp,
glowTextures,
strengthTextures
)[0];
newCard.faceUp = true;
}
}
/**
* Set up Runner as a test field. Cards given as set indices in SystemGateway<br/>Nothing is logged.
*
* @method RunnerTestField
* @param {int} identity Runner identity card
* @param {int[]} heapCards cards in heap
* @param {int[]} stackCards cards in stack (leave empty to use default/loaded stack)
* @param {int[]} gripCards cards in grip (leave empty to shuffle and draw five cards into grip)
* @param {int[]} installed cards installed
* @param {int[]} stolen cards in Runner's score area
*/
function RunnerTestField(
identity,
heapCards,
stackCards,
gripCards,
installed,
stolen,
cardBackTexturesRunner,
glowTextures,
strengthTextures
) {
if (runner.identityCard.title != "Tutorial") {
runner.identityCard = InstanceCard(
identity,
cardBackTexturesRunner,
glowTextures,
strengthTextures
);
runner.identityCard.faceUp = true;
}
for (var i = 0; i < heapCards.length; i++) {
var newCard = InstanceCardsPush(
heapCards[i],
runner.heap,
1,
cardBackTexturesRunner,
glowTextures,
strengthTextures
)[0];
newCard.faceUp = true;
}
if (stackCards.length > 0) {
while (runner.stack.length > 0) {
RemoveFromGame(runner.stack[0]);
}
for (var i = 0; i < stackCards.length; i++) {
InstanceCardsPush(
stackCards[i],
runner.stack,
1,
cardBackTexturesRunner,
glowTextures,
strengthTextures
);
}
}
if (gripCards.length > 0) {
for (var i = 0; i < gripCards.length; i++) {
InstanceCardsPush(
gripCards[i],
runner.grip,
1,
cardBackTexturesRunner,
glowTextures,
strengthTextures
);
}
skipShuffleAndDraw = true;
ChangePhase(phases.runnerStartResponse);
}
for (var i = 0; i < installed.length; i++) {
var dest = runner.rig.resources;
if (cardSet[installed[i]].cardType == "program")
dest = runner.rig.programs;
else if (cardSet[installed[i]].cardType == "hardware")
dest = runner.rig.hardware;
var newCard = InstanceCardsPush(
installed[i],
dest,
1,
cardBackTexturesRunner,
glowTextures,
strengthTextures
)[0];
newCard.faceUp = true;
}
for (var i = 0; i < stolen.length; i++) {
var newCard = InstanceCardsPush(
stolen[i],
runner.scoreArea,
1,
cardBackTexturesRunner,
glowTextures,
strengthTextures
)[0];
newCard.faceUp = true;
}
}
//DECKS
var cardBackTexturesCorp = {};
var cardBackTexturesRunner = {};
var glowTextures = {};
var strengthTextures = {};
var specifiedMentor = URIParameter("mentor");
function LoadDecks() {
//Special variables to store card back textures and strength and install cost textures
var knownTexture = cardRenderer.LoadTexture("images/known.png");
cardBackTexturesCorp = {
back: cardRenderer.LoadTexture("images/Corp_back.png"),
known: knownTexture,
};
cardBackTexturesRunner = {
back: cardRenderer.LoadTexture("images/Runner_back.png"),
known: knownTexture,
};
var strengthTextureIce = cardRenderer.LoadTexture("images/ice_strength.png");
var strengthTextureIcebreaker = cardRenderer.LoadTexture(
"images/ib_strength.png"
);
var subroutineBrokenTexture = cardRenderer.LoadTexture("images/broken.png");
var runnerCostTexture = cardRenderer.LoadTexture("images/runner_cost.png");
var corpRezCostTexture = cardRenderer.LoadTexture("images/corp_rez_cost.png");
strengthTextures = {
ice: strengthTextureIce,
ib: strengthTextureIcebreaker,
broken: subroutineBrokenTexture,
rc: runnerCostTexture,
crc: corpRezCostTexture,
};
//And glow texture
glowTextures = {
zoomed: cardRenderer.LoadTexture("images/glow_white.png"),
unzoomed: cardRenderer.LoadTexture("images/glow_white_cropped.png"),
ice: cardRenderer.LoadTexture("images/glow_white_ice.png"),
};
//run the intro tutorial, if specified
if (specifiedMentor != "") { //later, more options?
runner.identityCard = InstanceCard(
specifiedMentor,
cardBackTexturesRunner,
glowTextures,
strengthTextures
); //note that card.location is not set for identity cards
corp.identityCard = InstanceCard(
30077,
cardBackTexturesCorp,
glowTextures,
strengthTextures
); //note that card.location is not set for identity cards
//rewind is not available during tutorials
$('#rewind-select').hide();
return;
}
var deckJson = {};
var setStr = "";
if (URIParameter("sets") !== "") setStr = "sets="+URIParameter("sets")+"&";
$("#randomdeck").attr(
"onclick",
"window.location.href='decklauncher.php?"+setStr+(viewingPlayer==runner?"r":"c")+"=random';"
);
//*RUNNER*
//LOAD Runner deck, if specified (as an LZ compressed JSON object containing .identity= and .cards=[], with cards specified by number in the set)
var specifiedRunnerDeck = URIParameter("r");
if (specifiedRunnerDeck != "") {
deckJson = JSON.parse(
LZString.decompressFromEncodedURIComponent(specifiedRunnerDeck)
);
//support legacy (gateway) format by looping through .systemGateway and converting to 30000 + set number
if (typeof deckJson.systemGateway !== 'undefined') {
if (typeof deckJson.cards == 'undefined') deckJson.cards = [];
for (var i=0; i<deckJson.systemGateway.length; i++) {
deckJson.cards.push(30000+parseInt(deckJson.systemGateway[i]));
}
}
//also update the identity if it is legacy
if (parseInt(deckJson.identity) < 10001) deckJson.identity = parseInt(deckJson.identity) + 30000;
runner.identityCard = InstanceCard(
deckJson.identity,
cardBackTexturesRunner,
glowTextures,
strengthTextures
); //note that card.location is not set for identity cards
for (var i = 0; i < deckJson.cards.length; i++) {
InstanceCardsPush(
deckJson.cards[i],
runner.stack,
1,
cardBackTexturesRunner,
glowTextures,
strengthTextures
);
}
}
//RUNNER RANDOM System Gateway Deck
if (runner.stack.length == 0) {
var runnerIdentities = [];
for (var i=0; i<cardSet.length; i++) {
if (typeof cardSet[i] != 'undefined' && typeof cardSet[i].faction != 'undefined') {
if (cardSet[i].cardType == 'identity') {
if (cardSet[i].player == runner) runnerIdentities.push(i);
}
}
}
deckJson.identity =
runnerIdentities[RandomRange(0, runnerIdentities.length - 1)];
runner.identityCard = InstanceCard(
deckJson.identity,
cardBackTexturesRunner,
glowTextures,
strengthTextures
); //note that card.location is not set for identity cards
deckJson.cards = DeckBuild(
runner.identityCard,
runner.stack,
cardBackTexturesRunner,
glowTextures,
strengthTextures
);
}
//whichever way the deck is built, update the "Edit this deck" link if the player is viewing as the runner
if (viewingPlayer == runner) {
var compressedDeckString = LZString.compressToEncodedURIComponent(
JSON.stringify(deckJson)
);
var opponentDeckString = "";
if (URIParameter("c")) opponentDeckString = "c="+URIParameter("c")+"&";
$("#editdeck").attr(
"onclick",
"window.location.href='decklauncher.php?p=r&"+setStr+opponentDeckString+"r=" + compressedDeckString + "';"
);
}
PrintDeck(runner.identityCard, runner.stack);
//*CORP*
//LOAD Corp deck, if specified (as an LZ compressed JSON object containing .identity= and .cards=[], wth cards specified by number in the set)
deckJson = {};
var specifiedCorpDeck = URIParameter("c");
if (specifiedCorpDeck != "") {
deckJson = JSON.parse(
LZString.decompressFromEncodedURIComponent(specifiedCorpDeck)
);
//support legacy (gateway) format by looping through .systemGateway and converting to 30000 + set number
if (typeof deckJson.systemGateway !== 'undefined') {
if (typeof deckJson.cards == 'undefined') deckJson.cards = [];
for (var i=0; i<deckJson.systemGateway.length; i++) {
deckJson.cards.push(30000+parseInt(deckJson.systemGateway[i]));
}
}
//also update the identity if it is legacy
if (parseInt(deckJson.identity) < 10001) deckJson.identity = parseInt(deckJson.identity) + 30000;
corp.identityCard = InstanceCard(
deckJson.identity,
cardBackTexturesCorp,
glowTextures,
strengthTextures
); //note that card.location is not set for identity cards
for (var i = 0; i < deckJson.cards.length; i++) {
InstanceCardsPush(
deckJson.cards[i],
corp.RnD.cards,
1,
cardBackTexturesCorp,
glowTextures,
strengthTextures
);
}
}
//tutorial deck disables edit deck button
if (deckJson.identity == 30076 || deckJson.identity == 30077) {
$('#editdeck').prop('disabled', true);
$('#editdeck').prop('title', "Tutorial decks cannot be edited");
}
//CORP RANDOM System Gateway Deck
if (corp.RnD.cards.length == 0) {
var corpIdentities = [];
for (var i=0; i<cardSet.length; i++) {
if (typeof cardSet[i] != 'undefined' && typeof cardSet[i].faction != 'undefined') {
if (cardSet[i].cardType == 'identity') {
if (cardSet[i].player == corp) corpIdentities.push(i);
}
}
}
deckJson.identity =
corpIdentities[RandomRange(0, corpIdentities.length - 1)];
corp.identityCard = InstanceCard(
deckJson.identity,
cardBackTexturesCorp,
glowTextures,
strengthTextures
); //note that card.location is not set for identity cards
deckJson.cards = DeckBuild(
corp.identityCard,
corp.RnD.cards,
cardBackTexturesCorp,
glowTextures,
strengthTextures
);
}
//whichever way the deck is built, update the "Edit this deck" link if the player is viewing as the corp
if (viewingPlayer == corp) {
var compressedDeckString = LZString.compressToEncodedURIComponent(
JSON.stringify(deckJson)
);
var opponentDeckString = "";
if (URIParameter("r")) opponentDeckString = "r="+URIParameter("r")+"&";
$("#editdeck").attr(
"onclick",
"window.location.href='decklauncher.php?p=c&"+setStr+opponentDeckString+"c=" + compressedDeckString + "';"
);
}
PrintDeck(corp.identityCard, corp.RnD.cards);
//PASTE REPLICATION CODE HERE (and/or customise code below)
debugging = false; //set true to log extra details and pause execution on error
//mainLoopDelay = 50; //for speedy AI vs AI testing (any faster than this and funny things happen at end-of-game)
/*
RunnerTestField(31002, //identity
[30032], //heapCards
[31004,31004,31004,31004], //stackCards
[31037,31037,31037,31037,31037,31037,31037, 31037], //gripCards
[30014,31008], //installed
[], //stolen
cardBackTexturesRunner,glowTextures,strengthTextures);
CorpTestField(30035, //identity
[], //archivesCards
[30073,30072,30047,30073,30073,30039], //rndCards
[30065,31061,30039,30066,30071], //hqCards
[], //archivesInstalled
[31067], //rndInstalled
[31067], //hqInstalled
[[30047,30047]], //remotes (array of arrays)
[], //scored
cardBackTexturesCorp,glowTextures,strengthTextures);
*/
//corp.archives.ice[0].rezzed=true;
//corp.RnD.ice[0].rezzed=true;
//corp.HQ.ice[0].rezzed=true;
//corp.remoteServers[0].ice[0].rezzed=true;
//corp.remoteServers[0].ice[1].rezzed=true;
//corp.remoteServers[0].root[0].knownToRunner=true;
//corp.archives.ice[0].rezzed=true;
//corp.remoteServers[0].root[0].advancement=2;
//corp.remoteServers[1].root[0].advancement=2;
//GainCredits(runner,5);
//GainCredits(corp,11);
//ChangePhase(phases.runnerStartResponse);
//ChangePhase(phases.corpStartDraw);
//ChangePhase(phases.runnerEndOfTurn);
//AddTags(2);
//runner.clickTracker = 1;
//corp.clickTracker = 2;
//ChangePhase(phases.corpActionMain);
//ChangePhase(phases.corpDiscardStart);
//MakeRun(corp.remoteServers[0]);
//attackedServer = corp.RnD;
//ChangePhase(phases.runApproachServer); //i.e. skip all the ice
}