-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathzzESExport.php
More file actions
40 lines (36 loc) · 1.04 KB
/
zzESExport.php
File metadata and controls
40 lines (36 loc) · 1.04 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
<?php
include_once './SWUDeck/GeneratedCode/GeneratedCardDictionaries.php';
include_once "./AccountFiles/AccountSessionAPI.php";
$response = new stdClass();
$error = CheckLoggedInUserMod();
if($error !== "") {
$response->error = $error;
echo json_encode($response);
exit();
}
$allCards = GetAllCardIds();
$cardArr = [];
foreach ($allCards as $cardId) {
$card = new stdClass();
$card->id = $cardId;
$card->text = CardText($cardId);
$card->title = CardTitle($cardId);
$card->subtitle = CardSubtitle($cardId);
$card->cost = CardCost($cardId);
$card->hp = CardHp($cardId);
$card->power = CardPower($cardId);
$card->unique = CardUnique($cardId);
$card->upgradeHp = CardUpgradeHp($cardId);
$card->upgradePower = CardUpgradePower($cardId);
$card->aspect = CardAspect($cardId);
$card->trait = CardTrait($cardId);
$card->arena = CardArena($cardId);
$card->type = CardType($cardId);
$cardArr[] = $card;
}
$file = fopen('cards.json', 'w');
foreach ($cardArr as $card) {
fwrite($file, json_encode($card) . "\n");
}
fclose($file);
?>