summaryrefslogtreecommitdiff
path: root/db/areas.php
diff options
context:
space:
mode:
Diffstat (limited to 'db/areas.php')
-rw-r--r--db/areas.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/db/areas.php b/db/areas.php
index 55b2177..185589e 100644
--- a/db/areas.php
+++ b/db/areas.php
@@ -9,9 +9,22 @@ foreach (scandir(__DIR__ . '/areas') as $file) {
$area = json_decode(file_get_contents($filePath), true);
$encounters = json_decode(@file_get_contents(dirname(__DIR__) . "/modules/tuxemon/mods/tuxemon/db/encounter/$area[encounter_slug].json") ?? '', true);
$environment = json_decode(file_get_contents(dirname(__DIR__) . "/modules/tuxemon/mods/tuxemon/db/environment/$area[environment_slug].json"), true);
+ $map = @file_get_contents(__DIR__ . "/maps/$fileName.svg");
array_push($area['encounters'], ...$encounters['monsters'] ?? []);
$area['environment'] = $environment;
+ $area['map'] = $map;
+
+ foreach ($area['connections'] as $areaSlug => $connection) {
+ $area['connections'][$areaSlug]['name'] = json_decode(file_get_contents(__DIR__ . "/areas/$areaSlug.json"), true)['name'];
+ }
+
+ foreach ($area['locations'] ?? [] as $locationId => $location) {
+ if ($location['type'] == 'shop') {
+ $scoop = json_decode(file_get_contents(dirname(__DIR__) . "/modules/tuxemon/mods/tuxemon/db/economy/$location[economy].json"), true);
+ array_unshift($area['locations'][$locationId]['items'], ...$scoop['items']);
+ }
+ }
file_put_contents(__DIR__ . "/_generated/areas/$fileName.json", json_encode($area));
}