Showing preview only (5,138K chars total). Download the full file or copy to clipboard to get everything.
Repository: lowlighter/gracidea
Branch: main
Commit: 1dd01219b568
Files: 203
Total size: 4.9 MB
Directory structure:
gitextract_95rr8slf/
├── .devcontainer/
│ ├── Dockerfile
│ ├── devcontainer.json
│ ├── fluxbox/
│ │ ├── apps
│ │ ├── init
│ │ └── startup
│ ├── library-scripts/
│ │ └── desktop-lite-debian.sh
│ └── tiled/
│ └── default.tiled-session
├── .gitattributes
├── .github/
│ ├── ISSUE_TEMPLATE/
│ │ ├── config.yml
│ │ └── issue_report.yml
│ ├── config/
│ │ ├── codeql.yml
│ │ └── labeler.yml
│ ├── pull_request_template.md
│ └── workflows/
│ ├── build.yml
│ └── labeler.yml
├── .gitignore
├── .vscode/
│ └── settings.json
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── app/
│ ├── build/
│ │ ├── build.ts
│ │ ├── mod.ts
│ │ ├── steps/
│ │ │ ├── 00_clean.ts
│ │ │ ├── 10_data.ts
│ │ │ ├── 20_maps.ts
│ │ │ ├── 21_maps_diff.ts
│ │ │ ├── 22_maps_world.ts
│ │ │ ├── 30_textures.ts
│ │ │ ├── 31_textures_packer.ts
│ │ │ ├── 40_assets.ts
│ │ │ └── 41_assets_app.ts
│ │ └── util.ts
│ ├── client/
│ │ ├── css/
│ │ │ └── styles.css
│ │ ├── index.html
│ │ └── js/
│ │ ├── app/
│ │ │ ├── app.ts
│ │ │ ├── controls/
│ │ │ │ └── controller.ts
│ │ │ ├── maps/
│ │ │ │ ├── area.ts
│ │ │ │ ├── camera.ts
│ │ │ │ ├── npc.creature.ts
│ │ │ │ ├── npc.human.ts
│ │ │ │ ├── npc.ts
│ │ │ │ ├── region.ts
│ │ │ │ ├── section.ts
│ │ │ │ └── world.ts
│ │ │ ├── mod.ts
│ │ │ ├── rendering/
│ │ │ │ ├── render.ts
│ │ │ │ └── renderable.ts
│ │ │ └── types.ts
│ │ └── loader.js
│ └── tests/
│ └── integrity_test.ts
├── copyrighted/
│ ├── README.md
│ └── textures/
│ ├── all/
│ │ ├── worldmap.json
│ │ ├── worldmap.regions.json
│ │ ├── worldmap.regions.tps
│ │ ├── worldmap.tps
│ │ └── worldmap.tsx
│ └── rse/
│ ├── creatures.json
│ ├── creatures.tps
│ ├── npcs.json
│ ├── tileset.json
│ ├── tileset.tps
│ └── tileset.tsx
├── deno.json
├── maps/
│ ├── all/
│ │ └── worldmap.tmx
│ ├── gracidea.world
│ └── hoenn/
│ ├── anime-banana-slakoth-garden.tmx
│ ├── anime-crossgate-town.tmx
│ ├── anime-foothill-town.tmx
│ ├── anime-forbidden-forest.tmx
│ ├── anime-forina.tmx
│ ├── anime-lake-may.tmx
│ ├── anime-larousse-city.tmx
│ ├── anime-littleroot-port.tmx
│ ├── anime-mirage-kingdom.tmx
│ ├── anime-misty-village.tmx
│ ├── anime-mount-kirikiri.tmx
│ ├── anime-north-petalburg.tmx
│ ├── anime-oldale-ruins.tmx
│ ├── anime-rinshin-town.tmx
│ ├── anime-rubello-town.tmx
│ ├── anime-shroomish-forest.tmx
│ ├── anime-the-greenhouse.tmx
│ ├── anime-valley-of-steel.tmx
│ ├── anime-volley-town.tmx
│ ├── birth-island.tmx
│ ├── dewford-town.tmx
│ ├── ever-grande-city.tmx
│ ├── fallarbor-town.tmx
│ ├── faraway-island.tmx
│ ├── fill-002.tmx
│ ├── fill-003.tmx
│ ├── fill-004.tmx
│ ├── fill-005.tmx
│ ├── fill-006.tmx
│ ├── fill-007.tmx
│ ├── fill-010.tmx
│ ├── fill-011.tmx
│ ├── fill-012.tmx
│ ├── fill-013.tmx
│ ├── fill-014.tmx
│ ├── fill-015.tmx
│ ├── fill-016.tmx
│ ├── fill-017.tmx
│ ├── fill-018.tmx
│ ├── fill-019.tmx
│ ├── fill-020.tmx
│ ├── fill-021.tmx
│ ├── fill-022.tmx
│ ├── fill-023.tmx
│ ├── fill-024.tmx
│ ├── fill-025.tmx
│ ├── fill-026.tmx
│ ├── fill-027.tmx
│ ├── fill-028.tmx
│ ├── fill-029.tmx
│ ├── fill-030.tmx
│ ├── fill-031.tmx
│ ├── fill-032.tmx
│ ├── fill-033.tmx
│ ├── fill-034.tmx
│ ├── fill-035.tmx
│ ├── fill-036.tmx
│ ├── fill-037.tmx
│ ├── fill-038.tmx
│ ├── fill-039.tmx
│ ├── fill-040.tmx
│ ├── fill-041.tmx
│ ├── fill-042.tmx
│ ├── fill-043.tmx
│ ├── fill-044.tmx
│ ├── fill-045.tmx
│ ├── fill-046.tmx
│ ├── fill-047.tmx
│ ├── fill-048.tmx
│ ├── fill-049.tmx
│ ├── fill-050.tmx
│ ├── fill-051.tmx
│ ├── fill-052.tmx
│ ├── fill-053.tmx
│ ├── fill-054.tmx
│ ├── fill-055.tmx
│ ├── fill-056.tmx
│ ├── fill-057.tmx
│ ├── fill-058.tmx
│ ├── fill-059.tmx
│ ├── fill-060.tmx
│ ├── fortree-city.tmx
│ ├── hoenn-route-101.tmx
│ ├── hoenn-route-102.tmx
│ ├── hoenn-route-103.tmx
│ ├── hoenn-route-104.tmx
│ ├── hoenn-route-105.tmx
│ ├── hoenn-route-106.tmx
│ ├── hoenn-route-107.tmx
│ ├── hoenn-route-108.tmx
│ ├── hoenn-route-109.tmx
│ ├── hoenn-route-110.tmx
│ ├── hoenn-route-111.tmx
│ ├── hoenn-route-112.tmx
│ ├── hoenn-route-113.tmx
│ ├── hoenn-route-114.tmx
│ ├── hoenn-route-115.tmx
│ ├── hoenn-route-116.tmx
│ ├── hoenn-route-117.tmx
│ ├── hoenn-route-118.tmx
│ ├── hoenn-route-119.tmx
│ ├── hoenn-route-120.tmx
│ ├── hoenn-route-121.tmx
│ ├── hoenn-route-122.tmx
│ ├── hoenn-route-123.tmx
│ ├── hoenn-route-124.tmx
│ ├── hoenn-route-125.tmx
│ ├── hoenn-route-126.tmx
│ ├── hoenn-route-127.tmx
│ ├── hoenn-route-128.tmx
│ ├── hoenn-route-129.tmx
│ ├── hoenn-route-130.tmx
│ ├── hoenn-route-131.tmx
│ ├── hoenn-route-132.tmx
│ ├── hoenn-route-133.tmx
│ ├── hoenn-route-134.tmx
│ ├── hoenn-safari-zone-expansion-north.tmx
│ ├── hoenn-safari-zone-expansion-south.tmx
│ ├── hoenn-safari-zone-neacro-bike-area.tmx
│ ├── hoenn-safari-zone-nwmach-bike-area.tmx
│ ├── hoenn-safari-zone-se.tmx
│ ├── hoenn-safari-zone-sw.tmx
│ ├── lavaridge-town.tmx
│ ├── lilycove-city.tmx
│ ├── littleroot-town.tmx
│ ├── mauville-city.tmx
│ ├── mossdeep-city.tmx
│ ├── navel-rock.tmx
│ ├── oldale-town.tmx
│ ├── pacifidlog-town.tmx
│ ├── petalburg-city.tmx
│ ├── rustboro-city.tmx
│ ├── sky-pillar.tmx
│ ├── slateport-city.tmx
│ ├── southern-island.tmx
│ └── verdanturf-town.tmx
└── vercel.json
================================================
FILE CONTENTS
================================================
================================================
FILE: .devcontainer/Dockerfile
================================================
# OS
ARG VARIANT=bullseye
FROM --platform=linux/amd64 mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT}
# Deno install
ENV DENO_INSTALL=/deno
RUN mkdir -p /deno \
&& curl -fsSL https://deno.land/x/install/install.sh | sh \
&& chown -R vscode /deno
ENV PATH=${DENO_INSTALL}/bin:${PATH} \
DENO_DIR=${DENO_INSTALL}/.cache/deno
RUN deno install -qAn vr https://deno.land/x/velociraptor/cli.ts \
&& echo 'export PATH="$HOME/.deno/bin:$PATH"' >> ~/.bashrc
# Vercel install
RUN curl -fsSL https://deb.nodesource.com/setup_17.x | bash -\
&& apt-get update \
&& apt-get install -y nodejs build-essential \
&& npm i -g vercel
# Tiled install
COPY tiled/default.tiled-session /home/vscode/.local/share/tiled/
RUN wget -O /tmp/Tiled.AppImage https://github.com/mapeditor/tiled/releases/download/v1.7.2/Tiled-1.7.2-x86_64.AppImage \
&& chmod +x /tmp/Tiled.AppImage \
&& /tmp/Tiled.AppImage --appimage-extract \
&& mv squashfs-root /tiled \
&& chown -R vscode /tiled \
&& chmod +x /tiled/AppRun \
&& mkdir -p /home/vscode/.cache/tiled/sentry \
&& echo 1 > /home/vscode/.cache/tiled/sentry/user-consent
# Desktop lite
COPY library-scripts/desktop-lite-debian.sh /tmp/library-scripts/
COPY fluxbox /home/vscode/.fluxbox/
RUN apt-get update \
&& bash /tmp/library-scripts/desktop-lite-debian.sh \
&& chown -R vscode /home/vscode
ENV DBUS_SESSION_BUS_ADDRESS="autolaunch:" \
VNC_RESOLUTION="1440x768x16" \
VNC_DPI="96" \
VNC_PORT="5901" \
NOVNC_PORT="6080" \
DISPLAY=":1" \
LANG="en_US.UTF-8" \
LANGUAGE="en_US.UTF-8"
ENTRYPOINT ["/usr/local/share/desktop-init.sh"]
CMD ["sleep", "infinity"]
================================================
FILE: .devcontainer/devcontainer.json
================================================
{
"name": "Deno",
"build": {
"dockerfile": "Dockerfile",
"args": {
"VARIANT": "bullseye"
}
},
"settings": {
"deno.enable": true,
"deno.unstable": true,
"deno.lint": true,
"deno.importMap": "deno.json",
"deno.config": "deno.json",
"editor.defaultFormatter": "denoland.vscode-deno"
},
"extensions": [
"denoland.vscode-deno"
],
"remoteUser": "vscode",
"features": {
"desktop-lite": {
"password": "vscode",
"webPort": "6080",
"vncPort": "5901"
}
},
"runArgs": ["--init", "--shm-size=1g"],
"forwardPorts": [6080, 5901],
"overrideCommand": false,
"portsAttributes": {
"3000": {
"label": "VERCEL"
},
"4507": {
"label": "HTTP SERVER"
},
"5901": {
"label": "VNC"
},
"6080": {
"label": "WEB VNC"
}
}
}
================================================
FILE: .devcontainer/fluxbox/apps
================================================
[transient] (role=GtkFileChooserDialog)
[Dimensions] {70% 70%}
[Position] (CENTER) {0 0}
[end]
[app] (name=AppRun) (class=tiled)
[Fullscreen] {yes}
[end]
================================================
FILE: .devcontainer/fluxbox/init
================================================
session.screen0.tabs.usePixmap: true
session.screen0.tabs.maxOver: false
session.screen0.tabs.intitlebar: true
session.screen0.clientMenu.usePixmap: true
session.screen0.menu.alpha: 255
session.screen0.iconbar.usePixmap: true
session.screen0.iconbar.iconTextPadding: 10
session.screen0.iconbar.iconWidth: 128
session.screen0.iconbar.alignment: Relative
session.screen0.iconbar.mode: {static groups} (workspace)
session.screen0.tab.placement: TopLeft
session.screen0.tab.width: 64
session.screen0.window.focus.alpha: 255
session.screen0.window.unfocus.alpha: 255
session.screen0.slit.alpha: 255
session.screen0.slit.placement: RightBottom
session.screen0.slit.maxOver: false
session.screen0.slit.autoHide: false
session.screen0.slit.acceptKdeDockapps: true
session.screen0.slit.onhead: 0
session.screen0.slit.layer: Dock
session.screen0.titlebar.left: Stick
session.screen0.titlebar.right: Minimize Maximize Close
session.screen0.toolbar.widthPercent: 100
session.screen0.toolbar.onhead: 1
session.screen0.toolbar.placement: BottomCenter
session.screen0.toolbar.height: 0
session.screen0.toolbar.visible: false
session.screen0.toolbar.tools: RootMenu, clock, iconbar, systemtray
session.screen0.toolbar.alpha: 255
session.screen0.toolbar.maxOver: false
session.screen0.toolbar.autoHide: false
session.screen0.toolbar.layer: Dock
session.screen0.maxDisableMove: false
session.screen0.windowMenu: /home/vscode/.fluxbox/windowmenu
session.screen0.focusSameHead: false
session.screen0.clickRaises: true
session.screen0.opaqueMove: true
session.screen0.menuDelay: 200
session.screen0.workspaces: 1
session.screen0.noFocusWhileTypingDelay: 0
session.screen0.workspacewarping: false
session.screen0.maxDisableResize: false
session.screen0.rowPlacementDirection: LeftToRight
session.screen0.focusModel: ClickFocus
session.screen0.defaultDeco: NORMAL
session.screen0.fullMaximization: false
session.screen0.colPlacementDirection: TopToBottom
session.screen0.tabFocusModel: ClickToTabFocus
session.screen0.showwindowposition: false
session.screen0.edgeSnapThreshold: 10
session.screen0.tooltipDelay: 500
session.screen0.strftimeFormat: %a %l:%M %p
session.screen0.maxIgnoreIncrement: true
session.screen0.windowPlacement: RowMinOverlapPlacement
session.screen0.focusNewWindows: true
session.screen0.autoRaise: true
session.screen0.allowRemoteActions: false
session.screen0.workspaceNames: One,
session.styleOverlay: /home/vscode/.fluxbox/overlay
session.configVersion: 13
session.cacheMax: 200
session.tabsAttachArea: Window
session.slitlistFile: /home/vscode/.fluxbox/slitlist
session.forcePseudoTransparency: false
session.tabPadding: 0
session.colorsPerChannel: 4
session.menuFile: ~/.fluxbox/menu
session.autoRaiseDelay: 250
session.cacheLife: 5
session.appsFile: /home/vscode/.fluxbox/apps
session.ignoreBorder: false
session.keyFile: ~/.fluxbox/keys
session.doubleClickInterval: 250
session.styleFile: /usr/share/fluxbox/styles/qnx-photon
================================================
FILE: .devcontainer/fluxbox/startup
================================================
#!/bin/sh
xmodmap "/home/vscode/.Xmodmap"
# Start fbautostart
which fbautostart > /dev/null
if [ $? -eq 0 ]; then
fbautostart
fi
# Start fluxbox
fluxbox &
fbpid=$!
# Start tiled
sleep 1
{
/tiled/AppRun &
} &
wait $fbpid
================================================
FILE: .devcontainer/library-scripts/desktop-lite-debian.sh
================================================
#!/usr/bin/env bash
#-------------------------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
#-------------------------------------------------------------------------------------------------------------
#
# Docs: https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/desktop-lite.md
# Maintainer: The VS Code and Codespaces Teams
#
# Syntax: ./desktop-lite-debian.sh [non-root user] [Desktop password] [Install web client flag] [VNC port] [Web Port]
USERNAME=${1:-"automatic"}
VNC_PASSWORD=${2:-""}
INSTALL_NOVNC=${3:-"true"}
VNC_PORT="${4:-5901}"
NOVNC_PORT="${5:-6080}"
NOVNC_VERSION=1.2.0
WEBSOCKETIFY_VERSION=0.10.0
package_list="
tigervnc-standalone-server \
tigervnc-common \
fluxbox \
dbus-x11 \
x11-utils \
x11-xserver-utils \
xdg-utils \
fbautostart \
at-spi2-core \
xterm \
eterm \
nautilus\
mousepad \
seahorse \
gnome-icon-theme \
gnome-keyring \
libx11-dev \
libxkbfile-dev \
libsecret-1-dev \
libgbm-dev \
libnotify4 \
libnss3 \
libxss1 \
libasound2 \
xfonts-base \
xfonts-terminus \
fonts-noto \
fonts-wqy-microhei \
fonts-droid-fallback \
htop \
ncdu \
curl \
ca-certificates\
unzip \
nano \
locales"
set -e
if [ "$(id -u)" -ne 0 ]; then
echo -e 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.'
exit 1
fi
# Determine the appropriate non-root user
if [ "${USERNAME}" = "auto" ] || [ "${USERNAME}" = "automatic" ]; then
USERNAME=""
POSSIBLE_USERS=("vscode" "node" "codespace" "$(awk -v val=1000 -F ":" '$3==val{print $1}' /etc/passwd)")
for CURRENT_USER in ${POSSIBLE_USERS[@]}; do
if id -u ${CURRENT_USER} > /dev/null 2>&1; then
USERNAME=${CURRENT_USER}
break
fi
done
if [ "${USERNAME}" = "" ]; then
USERNAME=root
fi
elif [ "${USERNAME}" = "none" ] || ! id -u ${USERNAME} > /dev/null 2>&1; then
USERNAME=root
fi
# Add default Fluxbox config files if none are already present
fluxbox_apps="$(cat \
<< 'EOF'
[transient] (role=GtkFileChooserDialog)
[Dimensions] {70% 70%}
[Position] (CENTER) {0 0}
[end]
EOF
)"
fluxbox_init="$(cat \
<< 'EOF'
session.configVersion: 13
session.menuFile: ~/.fluxbox/menu
session.keyFile: ~/.fluxbox/keys
session.styleFile: /usr/share/fluxbox/styles/qnx-photon
session.screen0.workspaces: 1
session.screen0.workspacewarping: false
session.screen0.toolbar.widthPercent: 100
session.screen0.strftimeFormat: %a %l:%M %p
session.screen0.toolbar.tools: RootMenu, clock, iconbar, systemtray
session.screen0.workspaceNames: One,
EOF
)"
fluxbox_menu="$(cat \
<< 'EOF'
[begin] ( Application Menu )
[exec] (File Manager) { nautilus ~ } <>
[exec] (Text Editor) { mousepad } <>
[exec] (Terminal) { tilix -w ~ -e $(readlink -f /proc/$$/exe) -il } <>
[exec] (Web Browser) { x-www-browser --disable-dev-shm-usage } <>
[submenu] (System) {}
[exec] (Set Resolution) { tilix -t "Set Resolution" -e bash /usr/local/bin/set-resolution } <>
[exec] (Edit Application Menu) { mousepad ~/.fluxbox/menu } <>
[exec] (Passwords and Keys) { seahorse } <>
[exec] (Top Processes) { tilix -t "Top" -e htop } <>
[exec] (Disk Utilization) { tilix -t "Disk Utilization" -e ncdu / } <>
[exec] (Editres) {editres} <>
[exec] (Xfontsel) {xfontsel} <>
[exec] (Xkill) {xkill} <>
[exec] (Xrefresh) {xrefresh} <>
[end]
[config] (Configuration)
[workspaces] (Workspaces)
[end]
EOF
)"
# Copy config files if the don't already exist
copy_fluxbox_config() {
local target_dir="$1"
mkdir -p "${target_dir}/.fluxbox"
touch "${target_dir}/.Xmodmap"
if [ ! -e "${target_dir}/.fluxbox/apps" ]; then
echo "${fluxbox_apps}" > "${target_dir}/.fluxbox/apps"
fi
if [ ! -e "${target_dir}/.fluxbox/init" ]; then
echo "${fluxbox_init}" > "${target_dir}/.fluxbox/init"
fi
if [ ! -e "${target_dir}/.fluxbox/menu" ]; then
echo "${fluxbox_menu}" > "${target_dir}/.fluxbox/menu"
fi
}
# Function to run apt-get if needed
apt_get_update_if_needed()
{
if [ ! -d "/var/lib/apt/lists" ] || [ "$(ls /var/lib/apt/lists/ | wc -l)" = "0" ]; then
echo "Running apt-get update..."
apt-get update
else
echo "Skipping apt-get update."
fi
}
# Checks if packages are installed and installs them if not
check_packages() {
if ! dpkg -s "$@" > /dev/null 2>&1; then
apt_get_update_if_needed
apt-get -y install --no-install-recommends "$@"
fi
}
# Ensure apt is in non-interactive to avoid prompts
export DEBIAN_FRONTEND=noninteractive
apt_get_update_if_needed
# On older Ubuntu, Tilix is in a PPA. on Debian strech its in backports.
if [[ -z $(apt-cache --names-only search ^tilix$) ]]; then
. /etc/os-release
if [ "${ID}" = "ubuntu" ]; then
apt-get install -y --no-install-recommends apt-transport-https software-properties-common
add-apt-repository -y ppa:webupd8team/terminix
elif [ "${VERSION_CODENAME}" = "stretch" ]; then
echo "deb http://deb.debian.org/debian stretch-backports main" > /etc/apt/sources.list.d/stretch-backports.list
fi
apt-get update
if [[ -z $(apt-cache --names-only search ^tilix$) ]]; then
echo "(!) WARNING: Tilix not available on ${ID} ${VERSION_CODENAME} architecture $(uname -m). Skipping."
else
package_list="${package_list} tilix"
fi
else
package_list="${package_list} tilix"
fi
# Install X11, fluxbox and VS Code dependencies
check_packages ${package_list}
# Install Emoji font if available in distro - Available in Debian 10+, Ubuntu 18.04+
if dpkg-query -W fonts-noto-color-emoji > /dev/null 2>&1 && ! dpkg -s fonts-noto-color-emoji > /dev/null 2>&1; then
apt-get -y install --no-install-recommends fonts-noto-color-emoji
fi
# Check at least one locale exists
if ! grep -o -E '^\s*en_US.UTF-8\s+UTF-8' /etc/locale.gen > /dev/null; then
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
locale-gen
fi
# Install the Cascadia Code fonts - https://github.com/microsoft/cascadia-code
if [ ! -d "/usr/share/fonts/truetype/cascadia" ]; then
curl -sSL https://github.com/microsoft/cascadia-code/releases/download/v2008.25/CascadiaCode-2008.25.zip -o /tmp/cascadia-fonts.zip
unzip /tmp/cascadia-fonts.zip -d /tmp/cascadia-fonts
mkdir -p /usr/share/fonts/truetype/cascadia
mv /tmp/cascadia-fonts/ttf/* /usr/share/fonts/truetype/cascadia/
rm -rf /tmp/cascadia-fonts.zip /tmp/cascadia-fonts
fi
# Install noVNC
if [ "${INSTALL_NOVNC}" = "true" ] && [ ! -d "/usr/local/novnc" ]; then
mkdir -p /usr/local/novnc
curl -sSL https://github.com/novnc/noVNC/archive/v${NOVNC_VERSION}.zip -o /tmp/novnc-install.zip
unzip /tmp/novnc-install.zip -d /usr/local/novnc
cp /usr/local/novnc/noVNC-${NOVNC_VERSION}/vnc.html /usr/local/novnc/noVNC-${NOVNC_VERSION}/index.html
curl -sSL https://github.com/novnc/websockify/archive/v${WEBSOCKETIFY_VERSION}.zip -o /tmp/websockify-install.zip
unzip /tmp/websockify-install.zip -d /usr/local/novnc
ln -s /usr/local/novnc/websockify-${WEBSOCKETIFY_VERSION} /usr/local/novnc/noVNC-${NOVNC_VERSION}/utils/websockify
rm -f /tmp/websockify-install.zip /tmp/novnc-install.zip
# Install noVNC dependencies and use them.
if ! dpkg -s python3-minimal python3-numpy > /dev/null 2>&1; then
apt-get -y install --no-install-recommends python3-minimal python3-numpy
fi
sed -i -E 's/^python /python3 /' /usr/local/novnc/websockify-${WEBSOCKETIFY_VERSION}/run
fi
# Set up folders for scripts and init files
mkdir -p /var/run/dbus /usr/local/etc/vscode-dev-containers/
# Script to change resolution of desktop
cat << EOF > /usr/local/bin/set-resolution
#!/bin/bash
RESOLUTION=\${1:-\${VNC_RESOLUTION:-1920x1080}}
DPI=\${2:-\${VNC_DPI:-96}}
IGNORE_ERROR=\${3:-"false"}
if [ -z "\$1" ]; then
echo -e "**Current Settings **\n"
xrandr
echo -n -e "\nEnter new resolution (WIDTHxHEIGHT, blank for \${RESOLUTION}, Ctrl+C to abort).\n> "
read NEW_RES
if [ "\${NEW_RES}" != "" ]; then
RESOLUTION=\${NEW_RES}
fi
if ! echo "\${RESOLUTION}" | grep -E '[0-9]+x[0-9]+' > /dev/null; then
echo -e "\nInvalid resolution format!\n"
exit 1
fi
if [ -z "\$2" ]; then
echo -n -e "\nEnter new DPI (blank for \${DPI}, Ctrl+C to abort).\n> "
read NEW_DPI
if [ "\${NEW_DPI}" != "" ]; then
DPI=\${NEW_DPI}
fi
fi
fi
xrandr --fb \${RESOLUTION} --dpi \${DPI} > /dev/null 2>&1
if [ \$? -ne 0 ] && [ "\${IGNORE_ERROR}" != "true" ]; then
echo -e "\nFAILED TO SET RESOLUTION!\n"
exit 1
fi
echo -e "\nSuccess!\n"
EOF
# Container ENTRYPOINT script
cat << EOF > /usr/local/share/desktop-init.sh
#!/bin/bash
user_name="${USERNAME}"
group_name="$(id -gn ${USERNAME})"
LOG=/tmp/container-init.log
export DBUS_SESSION_BUS_ADDRESS="${DBUS_SESSION_BUS_ADDRESS:-"autolaunch:"}"
export DISPLAY="${DISPLAY:-:1}"
export VNC_RESOLUTION="${VNC_RESOLUTION:-1440x768x16}"
export LANG="${LANG:-"en_US.UTF-8"}"
export LANGUAGE="${LANGUAGE:-"en_US.UTF-8"}"
# Execute the command it not already running
startInBackgroundIfNotRunning()
{
log "Starting \$1."
echo -e "\n** \$(date) **" | sudoIf tee -a /tmp/\$1.log > /dev/null
if ! pidof \$1 > /dev/null; then
keepRunningInBackground "\$@"
while ! pidof \$1 > /dev/null; do
sleep 1
done
log "\$1 started."
else
echo "\$1 is already running." | sudoIf tee -a /tmp/\$1.log > /dev/null
log "\$1 is already running."
fi
}
# Keep command running in background
keepRunningInBackground()
{
(\$2 bash -c "while :; do echo [\\\$(date)] Process started.; \$3; echo [\\\$(date)] Process exited!; sleep 5; done 2>&1" | sudoIf tee -a /tmp/\$1.log > /dev/null & echo "\$!" | sudoIf tee /tmp/\$1.pid > /dev/null)
}
# Use sudo to run as root when required
sudoIf()
{
if [ "\$(id -u)" -ne 0 ]; then
sudo "\$@"
else
"\$@"
fi
}
# Use sudo to run as non-root user if not already running
sudoUserIf()
{
if [ "\$(id -u)" -eq 0 ] && [ "\${user_name}" != "root" ]; then
sudo -u \${user_name} "\$@"
else
"\$@"
fi
}
# Log messages
log()
{
echo -e "[\$(date)] \$@" | sudoIf tee -a \$LOG > /dev/null
}
log "** SCRIPT START **"
# Start dbus.
log 'Running "/etc/init.d/dbus start".'
if [ -f "/var/run/dbus/pid" ] && ! pidof dbus-daemon > /dev/null; then
sudoIf rm -f /var/run/dbus/pid
fi
sudoIf /etc/init.d/dbus start 2>&1 | sudoIf tee -a /tmp/dbus-daemon-system.log > /dev/null
while ! pidof dbus-daemon > /dev/null; do
sleep 1
done
# Startup tigervnc server and fluxbox
sudo rm -rf /tmp/.X11-unix /tmp/.X*-lock
mkdir -p /tmp/.X11-unix
sudoIf chmod 1777 /tmp/.X11-unix
sudoIf chown root:\${group_name} /tmp/.X11-unix
if [ "\$(echo "\${VNC_RESOLUTION}" | tr -cd 'x' | wc -c)" = "1" ]; then VNC_RESOLUTION=\${VNC_RESOLUTION}x16; fi
screen_geometry="\${VNC_RESOLUTION%*x*}"
screen_depth="\${VNC_RESOLUTION##*x}"
startInBackgroundIfNotRunning "Xtigervnc" sudoUserIf "tigervncserver \${DISPLAY} -geometry \${screen_geometry} -depth \${screen_depth} -rfbport ${VNC_PORT} -dpi \${VNC_DPI:-96} -localhost -desktop fluxbox -fg -passwd /usr/local/etc/vscode-dev-containers/vnc-passwd"
# Spin up noVNC if installed and not runnning.
if [ -d "/usr/local/novnc" ] && [ "\$(ps -ef | grep /usr/local/novnc/noVNC*/utils/launch.sh | grep -v grep)" = "" ]; then
keepRunningInBackground "noVNC" sudoIf "/usr/local/novnc/noVNC*/utils/launch.sh --listen ${NOVNC_PORT} --vnc localhost:${VNC_PORT}"
log "noVNC started."
else
log "noVNC is already running or not installed."
fi
# Run whatever was passed in
log "Executing \"\$@\"."
exec "\$@"
log "** SCRIPT EXIT **"
EOF
echo "${VNC_PASSWORD}" | vncpasswd -f > /usr/local/etc/vscode-dev-containers/vnc-passwd
chmod +x /usr/local/share/desktop-init.sh /usr/local/bin/set-resolution
# Set up fluxbox config
copy_fluxbox_config "/root"
if [ "${USERNAME}" != "root" ]; then
copy_fluxbox_config "/home/${USERNAME}"
chown -R ${USERNAME} /home/${USERNAME}/.Xmodmap /home/${USERNAME}/.fluxbox
fi
cat << EOF
You now have a working desktop! Connect to in one of the following ways:
- Forward port ${NOVNC_PORT} and use a web browser start the noVNC client (recommended)
- Forward port ${VNC_PORT} using VS Code client and connect using a VNC Viewer
In both cases, use the password "${VNC_PASSWORD}" when connecting
(*) Done!
EOF
================================================
FILE: .devcontainer/tiled/default.tiled-session
================================================
{
"activeFile": "/workspaces/gracidea/maps/hoenn/hoenn-route-101.tmx",
"expandedProjectPaths": [
],
"file.lastUsedOpenFilter": "All Files (*)",
"fileStates": {
"/workspaces/gracidea/maps/hoenn/hoenn-route-101.tmx": {
"scale": 1,
"selectedLayer": 0,
"viewCenter": {
"x": 160.0523046747303,
"y": 160.31382804838185
}
}
},
"loadedWorlds": [
"/workspaces/gracidea/maps/gracidea.world"
],
"openFiles": [
"/workspaces/gracidea/maps/hoenn/hoenn-route-101.tmx"
],
"project": "",
"recentFiles": [
"/workspaces/gracidea/maps/hoenn/hoenn-route-101.tmx"
]
}
================================================
FILE: .gitattributes
================================================
# Auto detect text files and perform LF normalization
* text=auto
# Linguist ignore
.github/* linguist-vendored
*.tps linguist-generated
*.tsx linguist-generated
*.tmx linguist-generated
*.json linguist-generated
*.js linguist-generated
*.js.map linguist-generated
================================================
FILE: .github/ISSUE_TEMPLATE/config.yml
================================================
blank_issues_enabled: false
contact_links:
- name: 💡 Suggest new features
url: https://github.com/lowlighter/gracidea/discussions/new?category=ideas
about: Submit ideas to help us improve
- name: 💬 Start a discussion
url: https://github.com/lowlighter/gracidea/discussions/new?category=general
about: Ask other questions related to this project here
================================================
FILE: .github/ISSUE_TEMPLATE/issue_report.yml
================================================
name: 📝 Issue report
description: Create a report to help us improve
body:
- type: markdown
attributes:
value: >
**Thank you for your interest in Gracidea project!**
> ⚠️ **Please note that [issues](https://github.com/lowlighter/gracidea/issues)
are exclusively reserved for bug and progress tracking.**
>
> Use [discussions](https://github.com/lowlighter/gracidea/discussions) for any
other request instead.
- type: textarea
attributes:
label: Summary
description: Explain the problem briefly below.
validations:
required: true
- type: dropdown
attributes:
label: Impacted components
description: Please select which component is impacted.
options:
- "📀 app: client"
- "🛠️ app: build"
- "🧪 app: tests"
- "🗺️ maps"
- "🎨 textures"
- "🗃️ repository"
validations:
required: true
- type: dropdown
attributes:
label: Impacted regions
description: Please select which regions is impacted (if applicable).
options:
- "1️⃣ region: kanto"
- "2️ region: johto"
- "3️ region: hoenn"
- "4️ region: sinnoh"
- "5️ region: unova"
- "6️ region: kalos"
- "7️ region: alola"
- "8️ region: galar"
- "*️⃣ region: other"
- type: checkboxes
attributes:
label: Community guidelines
description: Please review and accept to follow community guidelines
options:
- label: I am not duplicating an existing [issue](https://github.com/lowlighter/gracidea/issues), [pull request](https://github.com/lowlighter/gracidea/pulls) or [discussion](https://github.com/lowlighter/gracidea/discussions)
required: true
- label: I have read [contribution guidelines](https://github.com/lowlighter/gracidea/blob/main/CONTRIBUTING.md)
required: true
- label: I agree to follow the [Code of Conduct](https://github.com/lowlighter/gracidea/blob/main/CODE_OF_CONDUCT.md)
required: true
================================================
FILE: .github/config/codeql.yml
================================================
name: CodeQL config
queries:
- uses: security-and-quality
paths-ignore:
- copyrighted/**
- maps/**
================================================
FILE: .github/config/labeler.yml
================================================
🗃️ repository:
- .github/**
- .gitignore
- .gitattributes
- vercel.json
- README.md
- CONTRIBUTING.md
- CODE_OF_CONDUCT.md
- LICENSE
🗺️ maps:
- maps/**
🎨 textures:
- copyrighted/**
"🛠️ app: build":
- app/build/**
"📀 app: client":
- app/client/**
"💿 app: server":
- app/server/**
"🧪 app: tests":
- app/tests/**
"1️⃣ region: kanto":
- maps/kanto/**
"2️ region: johto":
- maps/johto/**
"3️ region: hoenn":
- maps/hoenn/**
"4️ region: sinnoh":
- maps/sinnoh/**
"5️ region: unova":
- maps/unova/**
"6️ region: kalos":
- maps/kalos/**
"7️ region: alola":
- maps/alola/**
"8️ region: galar":
- maps/galar/**
"*️⃣ region: other":
- maps/other/**
================================================
FILE: .github/pull_request_template.md
================================================
<!--
👋 Hi there!
Thanks for contributing to gracidea and helping us to improve!
Please:
- Read CONTRIBUTING.md first
- Check you're not duplicating another existing pull request
- Provide a clear and concise description
-->
================================================
FILE: .github/workflows/build.yml
================================================
name: 🌺
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
fmt-lint-test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 3
matrix:
job:
- vr fmt
- vr lint
- vr test
steps:
- uses: jurassiscripts/setup-velociraptor@v2
- run: ${{ matrix.job }}
analyze:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: github/codeql-action/init@v1
with:
languages: typescript
config-file: .github/config/codeql.yml
- uses: github/codeql-action/analyze@v1
================================================
FILE: .github/workflows/labeler.yml
================================================
name: 🏷️
on:
- pull_request_target
jobs:
label:
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v2
with:
configuration-path: .github/config/labeler.yml
repo-token: "${{ github.token }}"
================================================
FILE: .gitignore
================================================
.vercel
app/build/cache
app/public
================================================
FILE: .vscode/settings.json
================================================
{
"deno.enable": true,
"deno.unstable": true,
"deno.importMap": "deno.json",
"deno.config": "deno.json",
"deno.lint": true,
"deno.suggest.imports.hosts": {
"https://deno.land": false
}
}
================================================
FILE: CODE_OF_CONDUCT.md
================================================
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our
community include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community
Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
Community leaders will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Consequence**: Offending messages will be deleted at the discretion of the
community leaders.
### 2. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 3. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within
the community.
## Attribution
This Code of Conduct was inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity) and adapted
[Contributor Covenant version 2.0](https://www.contributor-covenant.org/version/2/0/code_of_conduct.html).
================================================
FILE: CONTRIBUTING.md
================================================
# 🌺 Contribution guide
> ⚠️ The guidelines of this project are voluntarily strict to avoid any drift, please read carefully to avoid any disappointment
> ⚠️ Keep in mind that *Gracidea* is **NOT A GAME PROJECT**, only an artistic project. All suggestions related to introduction of game mechanics (player, battles, captures, etc.) will be **systematically rejected**.
- Perform a search on this repository to ensure that:
- Nobody is working on it currently
- It has not been already suggested or [ruled out](https://github.com/lowlighter/gracidea/labels/%E2%9B%94%20wontdo)
- Open a [`discussion`](https://github.com/lowlighter/gracidea/discussions/new?category=ideas) before starting any changes
- Be respectful
- Wait for feedback from other people
- Wait for an approval by a maintainer (an associated issue will automatically be created)
- Perform editions and open [pull request](https://github.com/lowlighter/gracidea/pulls)
- Ensure that all builds are passing
- Preview you changes through the [Vercel](https://vercel.com) deployment link
- Wait for reviews
- Pull request will be merged if approved, thanks for contributing 🥳 !
> ℹ️ For easier maintaining, inactive issues and pull requests will automatically be closed after a certain amount of time
## 🗺️ For mappers
### 🤝 Accepted contributions
> ⚠️ Any change **must** be motivated through official supporting references, such as games, anime, manga or promotional artworks (in this prefered order).
>
> Not following this instruction may result in a pull request closure without notice
> ℹ️ Apart from first generations core games, other mapping sources will require a bit of creativity and adaption. The aim is to be faithful while making these custom maps integrate nicely. Most of the time, it means:
> - Making important building or features present
> - Respect more or less the map scale
> - Not bloating a map section with too much tiles
- ✔️ Fix maps and/or textures errors
- ✔️ Add or create new maps (in the following preference order):
- ✔️ From core games
- ✔️ From spin-offs game
- ✔️ From anime or manga
- ✔️ From promotional artworks
- ✔️ Custom fillers maps
- ✔️ Add or create new textures
- *⚠️ New textures styles are allowed provided they respect a given core game style*
### 📦 Requirements
- Mapping knowledge
- [Tiled map editor](https://doc.mapeditor.org/en/stable/) general knowledge
- Mapping environment
- [Tiled map editor](https://www.mapeditor.org)
- [TexturePacker](https://www.codeandweb.com/texturepacker)
- *⚠️ A license may be required to regenerate textures*
- Any image editing software
GitHub users having access to [GitHub codespaces](https://github.com/features/codespaces) may directly use the custom container with all dependencies installed (this also include [Tiled map editor](https://www.mapeditor.org) which is accessible through [NoVNC](https://novnc.com))
### 📚 How-to
#### Map editions
Open [Tiled map editor](https://www.mapeditor.org) and load [`maps/gracidea.world`](/maps/gracidea.world).
Start editing a new map file or an existing map file.
- Maps filenames **must** follow this convention:
- `${region}/${location-area}.tmx` for official maps, where `location-area` is defined in [pokeapi.co/api/v2/location-area](https://pokeapi.co/api/v2/location-area)
- `${region}/anime-${name}.tmx` for anime locations
- `${region}/manga-${name}.tmx` for manga locations
- `${region}/fill-${number}.tmx` for custom filler maps, where `number` is an unused number
- Maps layers **must** follow this convention and have:
- `creatures` object layer for area with wild encounters
- Create a new polygon having name set to an `encounter-method` defined in [pokeapi.co/api/v2/encounter-method](https://pokeapi.co/api/v2/encounter-method)
- *ℹ️ Encounter rates are auto-generated and do not need any further editions*
- `people` object layer for human NPCs
- Create a new polygon having name set to a [supported NPC texture](/copyrighted/textures/rse/npcs.json), and type set to a [supported NPC pattern](https://github.com/lowlighter/gracidea/blob/74505b775d2a4eace0e61e05dc263bff28a9afa7/app/client/js/app/maps/npc.human.ts#L99-L106)
- `${X}` tiles layer where `X` is a number between `1` and `4`
- Use the tileset to fill this map, with these guidelines:
- `1` Ground tiles
- `2` Secondary ground tiles (road paths, flowers, grass, etc.)
- `3` Objects (houses, trees, panels, etc.)
- `4` High objects (roof, tree top, etc.)
- Sea **must** not be mapped
> ℹ️ A world map must then be added to `gracidea.world` and saved
#### World map editions
Open [Tiled map editor](https://www.mapeditor.org) and load [`maps/all/worldmap.tmx`](/maps/all/worldmap.tmx).
Start editing file.
- World map layers **must** follow this convention:
- `links` object layer for location link
- Create a new polygon and set name to `${region}/${location-area}` where `location-area` is defined in [pokeapi.co/api/v2/location-area](https://pokeapi.co/api/v2/location-area)
- `interests.*` tiles layer is used for interests points
- `cities.*` tiles layer is used for cities and towns
- `roads.*` tiles layer is used for roads
- `${region}` image layer needs to reference a [supported region](/copyrighted/textures/all/regions)
- `roads.sea` tiles layer is used for sea roads which needs to appear below regions render
- `*.ext` layers are used to define locations from extended sources, such as spin-offs, anime, manga, etc.
- `*.core` layers are used to define locations from core games
#### Textures editions (specific style)
Open `copyrighted/textures/${style}/tileset.png` where `style` is a supported style (any folder except `all`).
Start editing file.
Create new tiles on "MissingNo" placeholders and try to group related tiles together.
> ⛔ Do not resize `tileset.png`, its dimensions are used internally for other applications
> ⚠️ Other files such as `creatures.{json,tps,webp}`, `npcs.{json,webp}` and `tileset.{json,tps,tsx,webp}` should not be edited directly. They are either generated automatically or rebuilt with [TexturePacker](https://www.codeandweb.com/texturepacker)
#### Texture editions (all)
Textures located in `copyrighted/textures/all` are handled differently than style texture packs.
For regular tilesets, edit the associated `.png` file and create new tiles on "MissingNo" placeholders and try to group related tiles together.
For world regions, create a new `.png` file in `copyrighted/textures/all/regions`.
## 👨💻 For developpers
### 🤝 Accepted contributions
> ⚠️ Please open a [`discussion`](https://github.com/lowlighter/gracidea/discussions/new?category=ideas) first and wait for feedback and approval before starting to code.
>
> Not following this instruction may result in a pull request closure without notice
- ✔️ Performance improvements
- ✔️ Features additions
- *⛔ All "gaming features" will systematically rejected*
- *⚠️ Complex features may be rejected, this is why it is required to open a [`discussion`](https://github.com/lowlighter/gracidea/discussions/new?category=ideas) first*
- ✔️ Data externalisation
- *⚠️ Any external source used must be trustworthy and be "established"*
- ✔️ Tests additions
- ❌ Build scripts refactoring
- ❌ Repository-level files editions (`LICENSE`, `CODE_OF_CONDUCT`, `.github`)
### 📦 Requirements
- Development knowledge
- [TypeScript](https://www.typescriptlang.org) fluency
- *⚠️ Including typing system, using `any` everywhere is not allowed!*
- [Vanilla JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript) general knowledge
- *⚠️ Including ESNext features and syntax, future is now!*
- *⛔ External libraries (except `pixi.js`) are not allowed to avoid bloating, as this app is already quite heavy*
- [PixiJS rendering engine](https://pixijs.com) general knowledge
- Development environment
- [Deno runtime](https://deno.land)
- [Velociraptor script manager](https://velociraptor.run)
- Basic tools (`git`, `npm`, `tar`, ...)
- *⚠️ [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl) is required for Windows users*
GitHub users having access to [GitHub codespaces](https://github.com/features/codespaces) may directly use the custom container with all dependencies installed (this also include [Tiled map editor](https://www.mapeditor.org) which is accessible through [NoVNC](https://novnc.com))
### 📚 How-to
Use `vr build` and then `vr start` to start a local instance.
> ⚠️ Note that by default, already generated data are not rebuilt if files are already present. Pass `--clean` flag to ensure that cache is fully reloaded
Changes should pass `vr fmt` and `vr lint`.
================================================
FILE: LICENSE
================================================
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. (https://fsf.org/)
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU Affero General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Gracidea is 2D web map displayer capable of rendering animated tiles and
characters.
Copyright (C) 2020-present lowlighter (Simon Lecoq)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program.
If not, see https://github.com/lowlighter/gracidea/blob/main/LICENSE.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
https://github.com/lowlighter/gracidea/blob/main/LICENSE.
================================================
FILE: README.md
================================================
#  Gracidea - *Pokémon* living web map


[](https://gracidea.lecoq.io)
**Gracidea** is a cartographic project which aims to map the whole known *Pokémon* world into a single 2D living web map.
##  Features
* **Faithful maps** based on games, anime, manga, artworks and custom map fillers
* **Animated tiles and characters** for a more liveful world
* **Wild areas** with accurate spawn rates (based on [PokeAPI data](https://github.com/PokeAPI/api-data)), including shiny encounters!
* **Ergonomic interface** to quickly navigate around the map
* *More features to come...*
##  Contributing
The *Pokémon* world is really huge, and so is the amount of work needed to map it.
Whether you want to complete the mapping, provide new sprites or improve code, please read our [contributions guideline](/CONTRIBUTING.md) and open a [pull request](https://github.com/lowlighter/gracidea/pulls)!
> ⚠️ Note that *Gracidea* is **NOT A GAME PROJECT**, only an artistic project. All suggestions related to introduction of game mechanics (player, battles, captures, etc.) will be **systematically rejected**.
##  License and copyright
This project is released under the GNU AGPL license, which means that you can reuse this project for other open-source projects, provided that you leave the original license untouched.
*Pokémon* trademark and its sprites are the intellectual property of The Pokémon Company and its affiliates ([legal informations](https://www.pokemon.com/us/legal/)).
The maintainers of this repository cannot be held responsible of the usage of it from other users.
##  Note from the cartographer
This artistic project will hopefully let you (re)discover this marvellous franchise!
A *Google maps* but for *Pokémon* games, with a bit of [Conway's Game of Life](https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life).
================================================
FILE: app/build/build.ts
================================================
//Imports
import clean from "app/build/steps/00_clean.ts";
import data from "app/build/steps/10_data.ts";
import maps from "app/build/steps/20_maps.ts";
import textures from "app/build/steps/30_textures.ts";
import texturesPacker from "app/build/steps/31_textures_packer.ts";
import assets from "app/build/steps/40_assets.ts";
import app from "app/build/steps/41_assets_app.ts";
import diff from "app/build/steps/21_maps_diff.ts";
import world from "app/build/steps/22_maps_world.ts";
import { log, requirements } from "app/build/util.ts";
import { parse as parseFlags } from "std/flags/mod.ts";
/** Flags */
const flags = parseFlags(Deno.args);
delete (flags as { _?: unknown })._;
if (!Object.keys(flags).length) {
flags.data ??= true;
flags.maps ??= true;
flags.world ??= true;
flags.diff ??= true;
flags.textures ??= true;
flags.assets ??= true;
flags.app ??= true;
}
/** Build utilities */
export const build = Object.assign(async function () {
const start = performance.now();
const { force = false } = flags;
log.info(`flags: ${Object.entries(flags).map(([flag, value]) => value ? flag : `no-${flag}`).join(", ") || "(none)"}`);
await requirements();
if (flags.clean ?? flags.all) {
await clean();
}
if (flags.data ?? flags.all) {
await data({ force });
}
if (flags.maps ?? flags.all) {
await maps({ force });
}
if (flags.diff ?? flags.all) {
await diff();
}
if (flags.world ?? flags.all) {
await world({ force });
}
if (flags.textures ?? flags.all) {
await textures({ force });
}
if (flags["texture-packer"] ?? flags.all) {
await texturesPacker();
}
if (flags.assets ?? flags.all) {
await assets();
}
if (flags.app ?? flags.all) {
await app();
}
log.step(`completed in ${((performance.now() - start) / 1000).toFixed(2)} s`);
});
================================================
FILE: app/build/mod.ts
================================================
//Imports
import { build } from "app/build/build.ts";
//Entry point
if (import.meta.main) {
await build();
}
================================================
FILE: app/build/steps/00_clean.ts
================================================
//Imports
import { clean, log } from "app/build/util.ts";
/** Clean environment */
export default async function () {
log.step("cleaning environment");
//Remove previous directories
for (const path of ["app/public", "app/build/cache"]) {
await clean({ path });
}
log.success();
}
================================================
FILE: app/build/steps/10_data.ts
================================================
//Imports
import { clone, exists, log, read, save } from "app/build/util.ts";
import { expandGlob } from "std/fs/mod.ts";
import { basename, dirname } from "std/path/mod.ts";
/** Data extraction */
export default async function ({ force = false } = {}) {
log.step("extracting data");
//Setup
await clone({ repo: "PokeAPI/api-data", dir: "app/build/cache/data" });
await clone({ repo: "msikma/pokesprite", dir: "app/build/cache/creatures" });
if ((!force) && (await exists("maps/data.json"))) {
log.debug("skipped: maps/data.json (already present)");
log.success();
return;
}
//Extract gender data
const genders = {} as {
[name: string]: {
male: number;
female: number;
genderless: number;
};
};
{
let files = 0;
for await (const { path, name: file } of expandGlob("app/build/cache/data/data/api/v2/gender/*/*.json")) {
log.progress(`processing: gender/${basename(dirname(path))}/${file}`);
const { name: gender, pokemon_species_details: details } = await read<gender>(path);
//Gender rate per species
for (const { pokemon_species: { name }, rate } of details) {
genders[name] ??= { male: 0, female: 0, genderless: 0 };
genders[name][gender] = Math.abs({ male: 1, female: 0, genderless: -1 - 1 / 8 }[gender] - rate / 8);
}
files++;
}
log.debug(`processed: ${files} files in gender/ (found ${Object.keys(genders).length} creatures)`);
}
//Extract encounters data
const encounters = {} as {
[area: string]: {
[method: string]: { [name: string]: number };
};
};
{
let files = 0;
for await (const { path, name: file } of expandGlob("app/build/cache/data/data/api/v2/location-area/*/*.json")) {
log.progress(`processing: location-area/${basename(dirname(path))}/${file}`);
const { name: area, pokemon_encounters: details } = await read<encounters>(path);
//Encounter rates per species
const rates = {} as { [method: string]: { [name: string]: number } };
for (const { pokemon: { name }, version_details: versions } of details) {
for (const { encounter_details: details } of versions) {
for (const { chance, method: { name: method } } of details) {
rates[method] ??= {};
rates[method][name] = Math.max(rates[method][name] ?? 0, chance);
}
}
}
//Normalized chance per species (taking in account eventual female sprite)
for (const chances of Object.values(rates)) {
const total = Object.values(chances).reduce((a, b) => a + b, 0);
for (const name in chances) {
chances[name] /= total;
const females = await Deno.lstat(`app/build/cache/creatures/pokemon-gen8/regular/female/${name}.png`).then(() => true).catch(() => false);
if (females) {
const chance = chances[name];
chances[name] *= genders[name].male;
chances[`female/${name}`] = chance * genders[name].female;
}
}
}
encounters[area] = rates;
files++;
}
log.debug(`processed: ${files} files in location-area/ (found ${Object.keys(encounters).length} areas)`);
}
//Extract locations data
const locations = {} as {
[id: string]: {
id: string;
region: string;
i18n: { [lang: string]: string };
encounters: typeof encounters[keyof encounters] | null;
};
};
{
let files = 0;
for await (const { path, name: file } of expandGlob("app/build/cache/data/data/api/v2/location/*/*.json")) {
log.progress(`processing: location/${basename(dirname(path))}/${file}`);
const { name: id, names, region: _region } = await read<location>(path);
//Region id, name and encounters rates
const region = _region?.name ?? "other";
const i18n = Object.fromEntries(
names.map((
{ language: { name: language }, name }: { language: { name: string }; name: string },
) => [language, name]),
);
locations[id] = { id, region, i18n, encounters: encounters[`${id}-area`] ?? null };
files++;
}
log.debug(`processed: ${files} files in location/ (found: ${Object.keys(locations).length} locations)`);
await save("maps/data.json", locations);
}
log.success();
}
/** Gender data */
type gender = {
name: "male" | "female" | "genderless";
pokemon_species_details: Array<{
pokemon_species: { name: string };
rate: number;
}>;
};
/** Encounters data */
type encounters = {
name: string;
pokemon_encounters: Array<{
pokemon: { name: string };
version_details: Array<{
encounter_details: Array<{
chance: number;
method: { name: string };
}>;
}>;
}>;
};
/** Location data */
type location = {
name: string;
names: Array<{
language: {
name: string;
};
name: string;
}>;
region: {
name: string;
} | null;
areas: Array<{
name: string;
}>;
};
================================================
FILE: app/build/steps/20_maps.ts
================================================
//Imports
import { calcArea, exists, log as logger, read, save, toArray } from "app/build/util.ts";
import { expandGlob } from "std/fs/mod.ts";
/** Data */
export default async function ({ preload = true, quiet = false, force = false } = {}) {
const log = quiet
? new Proxy({} as { [key: string]: () => void }, {
get(target, key) {
return Reflect.get(target, key) ?? (() => void 0);
},
})
: logger;
log.step("compute maps data");
const locations = {};
if (preload) {
Object.assign(locations, await read("app/public/data/maps/data.json"));
log.debug("loaded: maps/data.json");
}
//Regions
if ((!force) && (await exists("maps.json"))) {
log.debug("skipped: maps.json (already present)");
} else {
const ids = ["hoenn"];
const regions = [];
for (const id of ids) {
log.progress(`processing region: ${id}`);
const region = { x: { min: Infinity, max: -Infinity }, y: { min: Infinity, max: -Infinity } };
for (const { x, y, width, height } of (await load.sections({ region: id })).sections) {
region.x.min = Math.min(x, region.x.min);
region.y.min = Math.min(y, region.y.min);
region.x.max = Math.max(x + width, region.x.max);
region.y.max = Math.max(y + height, region.y.max);
}
regions.push({
id,
x: region.x.min,
y: region.y.min,
width: region.x.max - region.x.min,
height: region.y.max - region.y.min,
});
}
await save("maps.json", { regions });
log.debug(`processed regions: ${ids.length}`);
}
//Sections
{
const regions = { count: 0, skipped: 0 }, sections = { count: 0, skipped: 0 };
for await (const { name: region, isDirectory } of expandGlob("maps/*")) {
if ((!isDirectory) || (region === "all")) {
continue;
}
log.progress(`processing section: ${region}/*`);
if ((!force) && (await exists(`maps/${region}.json`))) {
regions.skipped++;
continue;
}
await save(`maps/${region}.json`, load.sections({ region }));
for await (const { name, isFile } of expandGlob(`maps/${region}/*.tmx`)) {
if (!isFile) {
continue;
}
const section = name.replace(".tmx", "");
log.progress(`processing section: ${region}/${section}`);
try {
if ((!force) && (await exists(`maps/${region}/${section}.json`))) {
sections.skipped++;
continue;
}
await save(`maps/${region}/${section}.json`, load.section({ region, section, locations }));
sections.count++;
} catch (error) {
if (/not properly referenced/.test(error.message)) {
log.warn(error.message);
continue;
}
throw error;
}
}
regions.count++;
}
log.debug(`processed sections: ${sections.count} (${sections.skipped} skipped) from ${regions.count} regions (${regions.skipped} skipped)`);
}
//Spawn points
{
let regions = 0, skipped = 0;
for await (const { name: region, isDirectory } of expandGlob("maps/*")) {
if ((!isDirectory) || (region === "all")) {
continue;
}
log.progress(`processing region spawns: ${region}`);
if ((!force) && (await exists(`maps/${region}.json`))) {
skipped++;
continue;
}
const data = await read(`app/public/data/maps/${region}.json`);
data.sections = await Promise.all(data.sections.map(async (section: { id: string }) => {
const { spawn } = await read(`app/public/data/maps/${section.id}.json`);
return Object.assign(section, { spawn });
}));
await save(`maps/${region}.json`, data);
regions++;
}
log.debug(`processed region spawns: from ${regions} regions (${skipped} skipped)`);
}
log.success();
}
const load = {
/** List region sections */
async sections({ region, filter = "" }: { region: string; filter?: string }) {
//Load world data
const { maps: raw } = await read("maps/gracidea.world");
//Formatted region sections data
const sections = await Promise.all(
raw
.filter(({ fileName = "" }) => fileName.startsWith(`${region}/`) && fileName.includes(filter))
.map(async ({ fileName = "", x = 0, y = 0, ...properties }) => {
const { map: raw } = await read(`maps/${fileName}`);
const { "@width": width = properties.width ?? 0, "@height": height = properties.height ?? 0 } = toArray(raw.layer)?.[0] ?? {};
return {
id: fileName.replace(".tmx", ""),
x: x / 16,
y: y / 16,
height,
width,
};
}),
);
return { sections };
},
/** Load region section */
async section({ region, section, locations }: { region: string; section: string; locations: { [key: string]: { [key: string]: unknown } | void } }) {
//Load section data
const { map: raw } = await read(`maps/${region}/${section}.tmx`);
const bounds = await load.sections({ region, filter: section }).then(({ sections: [p = null] }) => p ?? null);
if (!bounds) {
throw new TypeError(`${section} is not properly referenced in ${region}`);
}
const { x: X, y: Y } = bounds;
//Parse chunks data
const chunks = [] as Array<{ id: string; layer: string; x: number; y: number; tiles: number[] }>;
for (const { "@name": layer, ..._layer } of toArray(raw.layer)) {
const { "@width": width, "@height": height, data: { "#text": tiled = null, chunk: chunked = [] } } = _layer;
//Fixed-size map
if (tiled) {
//Extract and format data
const tiles = (tiled as string)
.split("\n")
.map((value) => value.trim())
.filter((value) => value.length)
.map((value) =>
value
.split(",")
.map((value) => value.trim())
.filter((value) => value.length)
);
//Padding for 16-sized chunks
const TY = tiles.length, TX = tiles[0].length;
for (let f = 0; f < 16 - (TY % 16); f++) {
tiles.push(new Array(TX).fill(0));
}
for (const row of tiles) {
row.push(...new Array(16 - (TX % 16)).fill(0));
}
//Generate chunked data
for (let x = 0; x < width; x += 16) {
for (let y = 0; y < height; y += 16) {
chunked.push({ "@x": x, "@y": y, "#text": tiles.slice(y, y + 16).map((row) => row.slice(x, x + 16).join(",")).join(",\n") });
}
}
}
//Chunked map
for (const chunk of toArray(chunked)) {
//Extract and format data
const { "@x": x, "@y": y, "#text": _tiles } = chunk;
const id = `${layer}/${X + x / 16};${Y + y / 16}`;
const tiles = (_tiles as string)
.split(",")
.map((value) => value.trim())
.filter((value) => value.length)
.map((value) => Math.max(Number(value) - 1, 0));
//Save chunk
if (tiles.reduce((a, b) => a + b, 0)) {
chunks.push({ id, layer, x, y, tiles });
}
}
}
//Search spawn point (tile id 6324)
let spawn = null;
for (const { x, y, tiles } of chunks) {
for (let i = 0; i < tiles.length; i++) {
if (tiles[i] === 6324) {
if (spawn) {
logger.warn(`spawn tile for ${section} was defined multiple time!`);
}
spawn = { x: X + x + i % 16, y: Y + y + Math.floor(i / 16) };
}
}
}
//Parse areas data
const areas = [] as Array<{ id: string; name: string; points: number[]; properties: { [key: string]: unknown } }>;
for (const { "@name": type, object: objects } of toArray(raw.objectgroup)) {
for (const object of toArray(objects)) {
//Extract and format data
const { "@id": id, "@name": name, "@type": mode, "@x": x, "@y": y, "@width": width, "@height": height, polygon, properties: _properties } = object;
const properties = Object.fromEntries(toArray(_properties?.property).map(({ "@name": name, "@value": value }) => [name, value]));
const points = (polygon?.["@points"].match(/-?\d+/g) ?? [0, 0, width, 0, width, height, 0, height])
.map((value: string) => Number(value))
.map((delta: number, index: number) => (delta + (index % 2 ? y : x)) / 16);
const area = { id, type, name, points, properties };
//Specific formatting by type
switch (type) {
case "creatures": {
const X = points.filter((_: number, i: number) => !(i % 2)), Y = points.filter((_: number, i: number) => i % 2);
area.properties.size = calcArea(X, Y);
break;
}
case "people": {
const directions = Object.entries(properties).filter(([key, value]) => (["left", "right", "up", "down"].includes(key)) && (value)).map(([key]) => key);
area.properties = { pattern: mode, directions };
break;
}
case "map": {
const { "@gid": tile } = object;
area.properties = { tile };
break;
}
}
//Save area
areas.push(area);
}
}
//Formatted section data
return { id: `${region}/${section}`, ...bounds, chunks, areas, spawn, ...locations?.[section] };
},
};
================================================
FILE: app/build/steps/21_maps_diff.ts
================================================
//Imports
import { ensureDir, expandGlob } from "std/fs/mod.ts";
import { copy } from "std/fs/copy.ts";
import { clone, log, read, save } from "app/build/util.ts";
import maps from "app/build/steps/20_maps.ts";
/** Compute diff */
export default async function () {
log.step("computing diff with previous state");
//Setup
await clone({ repo: "lowlighter/gracidea", dir: "app/build/cache/previous" });
//Generate previous maps data
if (await Deno.lstat(`app/build/cache/previous/app/public/data/maps`).then(() => true).catch(() => false)) {
log.debug(`built: previous maps data (already present)`);
} else {
log.progress(`building: previous maps data`);
await ensureDir("app/build/cache/previous/app/public/data/maps/");
await copy("app/public/data/maps/data.json", "app/build/cache/previous/app/public/data/maps/data.json", { overwrite: true });
const cwd = Deno.cwd();
Deno.chdir("app/build/cache/previous");
await maps({ preload: false, quiet: true });
Deno.chdir(cwd);
log.debug(`built: previous maps data`);
}
//Compute maps data diff
{
//List maps data
const ids = new Set();
for (const glob of ["app/public/data/maps/*/**/*.json", "app/build/cache/previous/app/public/data/maps/*/**/*.json"]) {
for await (const { path } of expandGlob(glob)) {
const id = path.replaceAll("\\", "/").replace(/^[\s\S]*app\/public\/data\/maps\//, "").replace(/\.json$/, "");
ids.add(id);
}
}
//Compute diff
const patches = [];
for (const id of ids) {
log.progress(`processing: ${id}`);
const A = await read(`app/build/cache/previous/app/public/data/maps/${id}.json`).catch(() => ({ chunks: [], areas: [] }));
const B = await read(`app/public/data/maps/${id}.json`).catch(() => ({ chunks: [], areas: [] }));
const diff = { tiles: {}, areas: {} } as {
tiles: { [chunk: string]: { [tile: number]: { d: "+" | "-" | "~"; a: number | null; b: number | null } } };
areas: { [area: number | string]: { d: "+" | "-" | "~"; a: unknown | null; b: unknown | null } };
};
//Chunks diff
{
const a = Object.fromEntries(A.chunks.map((chunk: { layer: number; x: number; y: number }) => [`${chunk.layer}/${chunk.x};${chunk.y}`, chunk]));
const b = Object.fromEntries(B.chunks.map((chunk: { layer: number; x: number; y: number }) => [`${chunk.layer}/${chunk.x};${chunk.y}`, chunk]));
for (const id of Object.keys(a).filter((id) => !Object.keys(b).includes(id))) {
b[id] = { ...a[id], tiles: new Array(a[id].tiles.length).fill(0) };
B.chunks.push(a[id]);
}
//Tiles diff
for (const id of Object.keys(b)) {
const d = diff.tiles[b[id]?.id] ??= {};
const tiles = Math.max(a[id]?.tiles.length ?? 0, b[id]?.tiles.length ?? 0);
for (let i = 0; i < tiles; i++) {
const t = { a: a[id]?.tiles[i] ?? 0, b: b[id]?.tiles[i] ?? 0 };
if ((!t.a) && (t.b)) {
d[i] = { d: "+", a: null, b: t.b };
} else if ((t.a) && (!t.b)) {
d[i] = { d: "-", a: t.a, b: null };
} else if (t.a !== t.b) {
d[i] = { d: "~", a: t.a, b: t.b };
}
}
if (!Object.keys(d).length) {
delete diff.tiles[b[id]?.id];
}
}
if (!Object.keys(diff.tiles).length) {
delete (diff as { tiles?: unknown }).tiles;
}
}
//Areas diff
{
const a = Object.fromEntries(A.areas.map((area: { id: string }) => [area.id, area]));
const b = Object.fromEntries(B.areas.map((area: { id: string }) => [area.id, area]));
for (const id of Object.keys(a).filter((id) => !Object.keys(b).includes(id))) {
b[id] = null;
B.areas.push(a[id]);
}
//Areas diff
const d = diff.areas ??= {};
for (const id of Object.keys(b)) {
const r = { a: a[id] ?? null, b: b[id] ?? null };
const i = id;
if ((!r.a) && (r.b)) {
d[i] = { d: "+", a: null, b: r.b };
} else if ((r.a) && (!r.b)) {
d[i] = { d: "-", a: r.a, b: null };
} else if ((r.a) && (r.b) && (JSON.stringify(r.a) !== JSON.stringify(r.b))) {
d[i] = { d: "~", a: r.a, b: r.b };
}
}
if (!Object.keys(diff.areas).length) {
delete (diff as { areas?: unknown }).areas;
}
}
//Report
if (Object.keys(diff).length) {
patches.push({
id,
x: B.x,
y: B.y,
tiles: Object.entries(diff.tiles ?? []).map(([chunk, tiles]) => ({
chunk,
added: Object.values(tiles).filter(({ d }) => d === "+").length,
deleted: Object.values(tiles).filter(({ d }) => d === "-").length,
changed: Object.values(tiles).filter(({ d }) => d === "~").length,
editions: tiles,
})),
areas: {
added: Object.entries(diff.areas ?? []).filter(([_, { d }]) => d === "+").flatMap(([k]) => B.areas.filter(({ id }: { id: string }) => `${k}` === `${id}`)),
deleted: Object.entries(diff.areas ?? []).filter(([_, { d }]) => d === "-").flatMap(([k]) => B.areas.filter(({ id }: { id: string }) => `${k}` === `${id}`)),
changed: Object.entries(diff.areas ?? []).filter(([_, { d }]) => d === "~").flatMap(([k]) => B.areas.filter(({ id }: { id: string }) => `${k}` === `${id}`)),
},
});
Object.assign(B, { diff });
}
await save(`maps/${id}.json`, B);
}
await save(`maps/patches.json`, patches);
log.debug(`processed: ${ids.size} files`);
}
//Search for linked pull request
{
const pr = await pullrequest();
if (pr) {
await save(`maps/patches.pr.json`, pr);
log.debug(`linked: pull request #${pr}`);
}
}
log.success();
}
//Search pull request number on GitHub
async function pullrequest() {
try {
const { data: { search: { nodes: [{ number: pr }] } } } = await fetch("https://api.github.com/graphql", {
method: "POST",
body: JSON.stringify({
query: `query {
search(query: "repo:lowlighter/gracidea is:pr is:open hash:${Deno.env.get("VERCEL_GIT_COMMIT_SHA")}", type: ISSUE, first: 1) {
nodes {
... on PullRequest {
number
}
}
}
}`,
}),
}).then((response) => response.json());
return pr;
} catch {
return null;
}
}
================================================
FILE: app/build/steps/22_maps_world.ts
================================================
//Imports
import { exists, log, read, save, toArray } from "app/build/util.ts";
/** Compute diff */
export default async function ({ force = false } = {}) {
log.step("compute world map data");
//Setup
if ((!force) && (await exists("maps.world.json"))) {
log.debug("skipped: maps.world.json (already present)");
log.success();
return;
}
const { map: raw } = await read("maps/all/worldmap.tmx");
const layers = toArray(raw.layer);
const { "@width": width = 0, "@height": height = 0 } = layers[0];
const map = { width, height, layers: [], images: [], links: [] } as worldmap;
//Tiles
for (const { "@name": layer, data: { "#text": tiled } } of layers) {
const tiles = (tiled as string)
.split("\n")
.map((value) => value.trim())
.filter((value) => value.length)
.flatMap((value) =>
value
.split(",")
.map((value) => value.trim())
.filter((value) => value.length)
.map((value) => Number(value))
);
map.layers.push({ layer, tiles });
}
//Region images
for (const { "@name": name, "@offsetx": x = 0, "@offsety": y = 0, image } of toArray(raw.imagelayer)) {
const { "@width": width = 0, "@height": height = 0 } = image;
map.images.push({ name, x, y, width, height });
}
//Links
for (const { "@name": name, object: objects } of toArray(raw.objectgroup)) {
switch (name) {
case "links": {
const cache = {} as { [section: string]: { x: number; y: number } };
for (const object of toArray(objects)) {
//Parse polygon
const { "@name": name, "@x": x, "@y": y, "@width": width, "@height": height, polygon } = object;
if (!name) {
continue;
}
const points = (polygon?.["@points"].match(/-?\d+/g) ?? [0, 0, width, 0, width, height, 0, height])
.map((value: string) => Number(value))
.map((delta: number, index: number) => (delta + (index % 2 ? y : x)) / 8);
//Load associated location
const [region] = name.split("/");
if (!cache[region]) {
cache[region] = { x: NaN, y: NaN };
const { sections } = await read(`app/public/data/maps/${region}.json`);
Object.assign(cache, Object.fromEntries(sections.map(({ id = "", x = 0, y = 0, width = 0, height = 0, spawn = null }) => [id, { x, y, width, height, spawn }])));
}
map.links.push({ name, points, location: cache[name] ?? null });
}
break;
}
}
}
await save("maps.world.json", map);
log.success();
}
/** World map */
type worldmap = {
width: number;
height: number;
layers: Array<{ layer: string; tiles: number[] }>;
images: Array<{ name: string; x: number; y: number; height: number; width: number }>;
links: Array<{ name: string; points: number[]; location: { x: number; y: number } | null }>;
};
================================================
FILE: app/build/steps/30_textures.ts
================================================
//Imports
import { clone, exists, log, read, save, toArray } from "app/build/util.ts";
import { expandGlob } from "std/fs/mod.ts";
import { basename, dirname } from "std/path/mod.ts";
/** Prepare textures */
export default async function ({ force = false } = {}) {
log.step("preparing textures");
//Setup
await clone({ repo: "PokeAPI/api-data", dir: "app/build/cache/data" });
//Tiles properties
{
let tilesets = 0, skipped = 0;
for await (const { path, name } of expandGlob("copyrighted/textures/*/*.tsx")) {
const style = basename(dirname(path));
const tileset = `${style}/${name.replace(".tsx", "")}`;
log.progress(`processing: ${tileset}`);
if ((!force) && (await exists(`textures/${tileset}.json`))) {
skipped++;
continue;
}
const { tileset: raw } = await read(`copyrighted/textures/${tileset}.tsx`);
const animated = {} as { [key: string]: { frames: string[]; speed: number } };
const zindex = {} as { [key: string]: number };
for (const { "@id": id, properties: _properties } of toArray(raw.tile)) {
const properties = Object.fromEntries(toArray(_properties?.property).map(({ "@name": name, "@value": value }) => [name, value]));
//Animated tiles
if ((properties.frames) && (properties.speed)) {
animated[`${id}`] = {
frames: new Array(properties.frames).fill(id).map((value, index) => `${value + index}`),
speed: properties.speed,
};
}
//Z-index tiles
if (properties.zindex) {
zindex[`${id}`] = Number(properties.zindex);
}
}
await save(`textures/${tileset}.json`, { id: tileset, animated, zindex });
tilesets++;
}
log.debug(`processed: ${tilesets} tilesets (skipped ${skipped})`);
}
//Textures effect
if ((!force) && (await exists("textures/effects.json"))) {
log.debug("skipped: textures/effects.json (already present)");
} else {
log.progress(`processing: texture effects`);
const effects = { creature: { name: {}, area: {} } } as {
creature: {
name: { [id: string]: string };
area: { [id: string]: string };
};
};
//Type related effects
for await (const { path, name: file } of expandGlob("app/build/cache/data/data/api/v2/type/*/*.json")) {
log.progress(`processing: location-area/${basename(dirname(path))}/${file}`);
const { name, pokemon: creatures } = await read<types>(path);
if (name === "flying") {
for (const { pokemon: { name: creature } } of creatures) {
effects.creature.name[creature] = "fly";
}
}
}
//Encounter methods related effects
for (const method of ["old-rod", "good-rod", "super-rod", "surf", "super-rod-spots", "surf-spots"]) {
effects.creature.area[method] = "swim";
}
log.debug(`processed: 2 texture effects`);
await save("textures/effects.json", effects);
}
log.success();
}
/** Types data */
type types = {
name: string;
pokemon: Array<{
pokemon: { name: string };
}>;
};
================================================
FILE: app/build/steps/31_textures_packer.ts
================================================
//Imports
import { crop, log } from "app/build/util.ts";
import { expandGlob } from "std/fs/mod.ts";
import { basename, dirname } from "std/path/mod.ts";
/** Prepare textures */
export default async function () {
log.step("packaging textures");
//Worldmap
{
log.progress("processing: worldmap");
await crop({ path: "copyrighted/textures/all/worldmap.png", tileset: "worldmap", padding: 0, tilesize: 8 });
log.debug("processed: worldmap");
}
//Tilesets
{
let tilesets = 0;
for await (const { path, name } of expandGlob("copyrighted/textures/*/*.tsx")) {
const style = basename(dirname(path));
if (style === "all") {
continue;
}
const tileset = `${style}/${name.replace(".tsx", "")}`;
log.progress(`processing: ${tileset}`);
await crop({ path: path.replace(".tsx", ".png"), tileset });
tilesets++;
}
log.debug(`processed: ${tilesets} tilesets`);
}
log.success();
}
================================================
FILE: app/build/steps/40_assets.ts
================================================
//Imports
import { log, read } from "app/build/util.ts";
import { expandGlob } from "std/fs/mod.ts";
import { copy } from "std/fs/copy.ts";
/** Public assets */
export default async function () {
log.step("creating public assets");
//Static assets
{
log.progress(`copying: static assets`);
await copy("app/client", "app/public", { overwrite: true });
await copy("copyrighted", "app/public", { overwrite: true });
const pending = [];
for (const glob of ["README.md", "animated_map.gif", "gracidea.webp", "js/app", "textures/**/*.{tsx,tps,png}"]) {
for await (const { path } of expandGlob(`app/public/${glob}`)) {
pending.push(Deno.remove(path, { recursive: true }));
}
}
await Promise.all(pending);
log.debug(`copied: static assets`);
}
//Index.html
{
let sha = "(head)";
try {
sha = Deno.env.get("VERCEL_GIT_COMMIT_SHA") || sha;
} catch {
//No-op
}
log.progress(`templating: index.html`);
let index = await read("app/client/index.html");
index = index.replaceAll("{{sha}}", sha.substring(0, 7));
await Deno.writeTextFile("app/public/index.html", index);
log.debug(`templated: index.html`);
}
log.success();
}
================================================
FILE: app/build/steps/41_assets_app.ts
================================================
//Imports
import { log, pack } from "app/build/util.ts";
import { ensureDir } from "std/fs/mod.ts";
/** Public assets */
export default async function () {
log.step("emitting bundled app");
//Setup
await pack({ pkg: "pixi.js", dir: "app/build/cache/pixi.js" });
//App.js
{
log.progress(`emitting: app.js`);
const { files } = await Deno.emit(new URL("../../client/js/app/mod.ts", import.meta.url).href, { bundle: "classic", importMapPath: "deno.json" });
await ensureDir("app/public/js");
await Deno.writeTextFile("app/public/js/app.js", files[`deno:///bundle.js`]);
log.debug(`emitted: app.js`);
}
log.success();
}
================================================
FILE: app/build/util.ts
================================================
//Imports
import argv from "y/string-argv@0.3.1";
import { bold, cyan, gray, green, italic, red, yellow } from "std/fmt/colors.ts";
import { Image } from "x/imagescript@1.2.9/mod.ts";
import { ensureDir } from "std/fs/mod.ts";
import { dirname, extname, isAbsolute, join, toFileUrl } from "std/path/mod.ts";
import { parse as parseXML } from "x/xml@2.0.3/parse.ts";
/** Encoder instance*/
const encoder = new TextEncoder();
/** Decoder instance */
const decoder = new TextDecoder();
/** Log wrapper */
export const log = {
get size() {
try {
return Deno.consoleSize(Deno.stdout.rid).columns;
} catch {
return 128;
}
},
step(text: string) {
return console.log(bold(`>>> ${text}`.padEnd(this.size)));
},
progress(text: string) {
Deno.stdout.write(encoder.encode(`${gray(text).padEnd(this.size)}\r`));
},
debug(text: string) {
return console.debug(gray(text.padEnd(this.size)));
},
info(text: string) {
return console.info(cyan(text.padEnd(this.size)));
},
warn(text: string) {
return console.warn(yellow(text.padEnd(this.size)));
},
error(text: string) {
return console.error(red(text.padEnd(this.size)));
},
success() {
return console.log(green("success!".padEnd(this.size)));
},
skipped() {
return console.log(gray(italic("skipped".padEnd(this.size))));
},
};
/** Requirements */
export async function requirements() {
if (Deno.build.os === "windows") {
try {
await exec("wsl exit", { compat: false });
} catch {
log.error("error: windows subsystem for linux is not available");
return false;
}
}
let success = true;
for (const bin of ["git", "npm", "tar"]) {
await exec(`which ${bin}`).catch((_) => (log.error(`error: ${bin} is not available`), success = false));
}
return success;
}
/** Execute a command */
export async function exec(command: string, { compat = true } = {}) {
if ((compat) && (Deno.build.os === "windows")) {
command = `wsl ${command}`;
}
log.progress(`executing: ${command}`);
const process = Deno.run({ cmd: argv(command), stdout: "piped", stderr: "piped" });
const [{ success, code }, ...stdio] = await Promise.all([process.status(), process.output(), process.stderrOutput()]);
const stdout = decoder.decode(stdio[0]).trim();
const stderr = decoder.decode(stdio[1]).trim();
if (!success) {
log.warn(stdout);
log.error(stderr);
throw new Error("failed to execute command");
}
return { success, code, stdout, stderr };
}
/** Clone a repository */
export async function clone({ repo, dir }: { repo: string; dir: string }) {
log.progress(`cloning: ${repo}`);
const exists = await Deno.lstat(dir).then(() => true).catch(() => false);
if (!exists) {
await exec(`git clone https://github.com/${repo}.git ${dir} --depth 1`);
}
log.debug(`cloned: ${repo}${exists ? " (already present)" : ""}`);
}
/** Download a npm dependency */
export async function pack({ pkg, dir }: { pkg: string; dir: string }) {
log.progress(`packing: ${pkg}`);
const exists = await Deno.lstat(dir).then(() => true).catch(() => false);
if (!exists) {
await ensureDir("app/build/cache");
const { stdout } = await exec(`npm pack ${pkg} --pack-destination app/build/cache`);
const archive = `app/build/cache/${stdout}`;
log.progress(`uncompressing: ${archive}`);
await ensureDir(dir);
await exec(`tar --extract --file ${archive} --directory ${dir}`);
await Deno.remove(archive);
}
const { version = "unknown" } = JSON.parse(await Deno.readTextFile(`${dir}/package/package.json`));
log.debug(`packed: ${pkg}@${version}${exists ? " (already present)" : ""}`);
}
/** Crop an image instance */
export async function crop({ path, tileset, padding = 2, tilesize = 16 }: { path: string; tileset: string; padding?: number; tilesize?: number }) {
log.progress(`processing: ${tileset}`);
const directory = `app/build/cache/tilesets/${tileset}`;
const image = await Image.decode(await Deno.readFile(path));
const X = (image.width - padding) / (tilesize + padding), Y = (image.height - padding) / (tilesize + padding);
await ensureDir(directory);
for (let y = 0; y < Y; y++) {
for (let x = 0; x < X; x++) {
const i = x + y * X, px = padding + x * (tilesize + padding), py = padding + y * (tilesize + padding);
await Deno.writeFile(`${directory}/${i}.png`, await image.clone().crop(px, py, tilesize, tilesize).encode());
log.progress(`processing: ${tileset} (${i}/${X * Y})`);
}
}
}
/** Clean folder */
export async function clean({ path }: { path: string }) {
if (!path) {
throw new RangeError("no path specified for cleaning!");
}
if (await Deno.lstat(path).then(() => true).catch(() => false)) {
await Deno.remove(path, { recursive: true });
}
log.debug(`cleaned: ${path}`);
}
/** Read and parse serialized data */
export async function read<T = parsed>(path: string): Promise<T> {
const ext = extname(path);
const url = isAbsolute(path) ? toFileUrl(path).href : toFileUrl(join(Deno.cwd(), path)).href;
try {
const content = await fetch(url).then((response) => response.text());
switch (ext) {
case ".world":
case ".json":
return JSON.parse(content);
case ".tmx":
case ".tsx":
return parseXML(content) as unknown as T;
}
return content as unknown as T;
} catch (error) {
log.error(`failed to fetched: ${path}`);
throw error;
}
}
/** Save data */
export async function save(path: string, data: unknown | Promise<unknown>) {
path = `app/public/data/${path}`;
await ensureDir(dirname(path));
await Deno.writeTextFile(path, JSON.stringify(await data));
}
/** Test data path */
export async function exists(path: string) {
path = `app/public/data/${path}`;
return await Deno.lstat(path).then(() => true).catch(() => false);
}
/** Send back a flattened array without falsy values */
export function toArray<T>(value: T | T[]) {
return [value].flat(Infinity).filter((value) => value);
}
/** Send back area value */
export function calcArea(X: number[], Y: number[]) {
let area = 0;
for (let i = 0, j = X.length - 1; i < X.length; j = i, i++) {
area += (X[j] + X[i]) * (Y[j] - Y[i]);
}
return Math.abs(area / 2);
}
/** At position */
export async function at({ x, y }: { x: number; y: number }) {
const matches = [];
const regions = (await read<{ regions: rectangle[] }>("app/public/data/maps.json")).regions.filter((region) => contains(region, { x, y }));
for (const { id: region } of regions) {
const sections = (await read<{ sections: rectangle[] }>(`app/public/data/maps/${region}.json`)).sections.filter((section) => contains(section, { x, y }));
for (const { id: section, x: X, y: Y } of sections) {
const rx = x - X, ry = y - Y;
const content = await read<{ chunks: rectangle[]; areas: polygon[] }>(`app/public/data/maps/${section}.json`);
//Tiles matching
const chunks = content.chunks.filter((chunk) => contains({ ...chunk, width: 16, height: 16 }, { x: rx, y: ry }));
for (const { layer, tiles } of chunks as unknown as Array<{ layer: string; tiles: number[] }>) {
matches.push({ region, section, layer, tile: tiles[rx * 16 + ry] });
}
//Areas matching
const areas = content.areas.filter((area) => contains(area, { x: rx + .5, y: ry + .5 }));
for (const { type, name, points } of areas as unknown as Array<{ type: string; name: string; points: number[] }>) {
matches.push({ region, section, type, name, points });
}
}
}
return matches;
}
/** Test whether a point is contained within a polygon */
function contains({ x = 0, y = 0, width = 0, height = 0, points = [] as number[] }, p: { x: number; y: number }) {
//Polygon
if (points.length) {
let inside = false;
const length = points.length / 2;
for (let i = 0, j = length - 1; i < length; j = i++) {
const xi = points[i * 2];
const yi = points[(i * 2) + 1];
const xj = points[j * 2];
const yj = points[(j * 2) + 1];
const intersect = ((yi > p.y) !== (yj > p.y)) && (p.x < ((xj - xi) * ((p.y - yi) / (yj - yi))) + xi);
if (intersect) {
inside = !inside;
}
}
return inside;
}
//Rectangle
if (width <= 0 || height < 0) {
return false;
}
return (p.x >= x && p.x < x + width) && (p.y >= y && p.y < y + height);
}
/** Rectangle */
type rectangle = { id: string; width: number; height: number; x: number; y: number };
/** Polygon */
type polygon = { id: string; points: number[] };
/** Parsed data accessor */
//deno-lint-ignore no-explicit-any
type parsed = any;
================================================
FILE: app/client/css/styles.css
================================================
body {
margin: 0;
padding: 0;
width: 100vw;
height: 100vh;
overflow: hidden;
font-family: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
background-color: #182850;
}
#sha {
font-size: 0.7rem;
font-family: monospace;
opacity: .7;
}
* {
user-select: none;
-moz-user-select: none;
-webkit-user-select: none;
}
/* Loader */
.loader {
position: fixed;
top: 0;
right: 0;
left: 0;
bottom: 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
color: white;
font-size: 1.25rem;
background-color: #182850;
z-index: 9999;
cursor: wait;
}
.loader .loaded {
display: flex;
flex-direction: column;
opacity: 0.8;
font-size: 0.8rem;
height: 4rem;
}
.loader .loaded > * {
opacity: 0.2;
}
.loader .loaded :nth-child(1) {
opacity: 1;
}
.loader .loaded .loading {
overflow: hidden;
display: inline-block;
vertical-align: top;
}
.loader .loaded .loading::after {
overflow: hidden;
display: inline-block;
content: "...";
animation: loading-dots-keyframes 1.2s steps(4, jump-none) infinite;
}
@keyframes loading-dots-keyframes {
0% { transform: translateX(-100%); }
}
/* Menu */
nav {
position: fixed;
top: .5rem;
left: .5rem;
margin-right: .5rem;
margin-bottom: .5rem;
padding: .5rem;
z-index: 8888;
color: white;
font-size: 1rem;
display: flex;
flex-direction: column;
overflow-x: auto;
max-width: 20rem;
width: 100%;
border-radius: 0.75rem;
box-shadow: 0 0 15px #000000A0;
backdrop-filter: blur(3px);
-webkit-backdrop-filter: blur(3px);
background-color: #000000B0;
transition: background-color 1s ease;
overflow: auto;
max-height: calc(100% - 2rem);
}
nav.collapsed {
background-color: transparent;
}
nav a, nav summary {
display: flex;
align-items: center;
flex-shrink: 0;
min-width: 10rem;
color: #6ca8ec;
cursor: pointer;
}
nav a, nav a:visited {
text-decoration: none;
}
nav a:hover {
text-decoration: underline;
}
nav a img, nav summary img {
height: 1rem;
width: 1rem;
margin-right: .25rem;
}
nav .app-name {
font-size: 1.5rem;
cursor: pointer;
}
nav .app-name img {
height: 1.5rem;
width: 1.5rem;
}
nav .app-name:hover {
color: #D2A8FF;
}
nav summary {
color: #D2A8FF;
}
nav > a {
margin-left: -.25rem;
color: #D2A8FF;
}
nav details summary {
margin-left: -1.25rem;
}
nav details {
padding-left: 1rem;
}
nav.collapsed > *:not(.app-name) {
display: none;
}
/* Labels and inputs */
label {
display: flex;
justify-content: space-between;
cursor: pointer;
border-radius: .25rem;
}
label:hover {
background-color: #FFFFFF20;
}
label input, label select {
max-width: 5rem;
background: transparent;
border: none;
text-align: right;
color: white;
}
/* Debug */
.debug {
display: flex;
flex-direction: column;
}
/* Patches */
.patches {
font-family: monospace;
}
.patches .patch .id {
color: #8250DF;
cursor: pointer;
font-weight: bold;
}
.patches .patch .id:hover {
color: #0969DA;
}
.patches .patch .record {
display: flex;
}
.patches .diff {
margin-left: 1rem;
margin-right: .5rem;
min-width: 2.5rem;
font-size: 0.8rem;
display: flex;
justify-content: flex-end;
align-items: center;
}
.patches .diff .added {
color: #116329;
}
.patches .diff .changed {
color: #D79533;
}
.patches .diff .deleted {
color: #82071E;
}
================================================
FILE: app/client/index.html
================================================
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<title>Gracidea | Pokémon Live Map</title>
<meta name="author" content="lowlighter">
<meta name="description" content="Gracidea, a Pokémon live map">
<meta property="og:image" content="/opengraph.png">
<link rel="icon" href="/favicon.ico">
<style>body{background-color:#182850;}.loader,nav{display: none;}</style>
</head>
<body>
<div class="loader">
<img src="/hello.png" alt="">
Gracidea is loading
<div class="loaded"></div>
</div>
<nav class="collapsed">
<div class="app-name">
<img src="/icons/gracidea.png" alt="🌺">
<span>Gracidea <sub id="sha">{{sha}}</sub></span>
</div>
<!--
<a href="#" id="share">
<img src="/icons/share.png" alt="💌"> Share position
</a>
-->
<details>
<summary><img src="/icons/map.png" alt="🗺️">World map</summary>
<div class="worldmap"></div>
</details>
<details>
<summary><img src="/icons/debug.png" alt="⚙️">Debug</summary>
<div class="debug"></div>
</details>
<details>
<summary><img src="/icons/patches.png" alt="🗂️">Patches</summary>
<div class="patches"></div>
</details>
<details>
<summary><img src="/icons/pokedoll.png" alt="🦑">Repository</summary>
<a href="https://github.com/lowlighter/gracidea" target="_blank">GitHub</a>
<a href="https://github.com/lowlighter/gracidea/issues/new?template=issue_report.yml" target="_blank">Report an issue</a>
<a href="https://github.com/lowlighter/gracidea/discussions" target="_blank">Start a discussion</a>
<a href="https://github.com/lowlighter/gracidea/blob/main/CONTRIBUTING.md" target="_blank">Contribute</a>
<a href="https://github.com/lowlighter/gracidea/blob/main/LICENSE" target="_blank">License</a>
</details>
</nav>
<script src="/js/loader.js"></script>
</body>
</html>
================================================
FILE: app/client/js/app/app.ts
================================================
//Imports
import type { friend } from "app/client/types.ts";
import { global } from "app/client/types.ts";
import { deferred } from "std/async/deferred.ts";
import { Render } from "app/client/rendering/render.ts";
import { World } from "app/client/maps/world.ts";
import { Controller } from "app/client/controls/controller.ts";
/** App */
export class App {
/** World */
static readonly world: World;
/** Controller */
static readonly controller: Controller;
/** App setup */
static async setup() {
//Setup
this.loaded("loaded /js/app.js", null, { update: true });
//Load patches
const patches = await fetch(`/data/maps/patches.json?sha=${this.sha}`).then((response) => response.json());
if (patches.length) {
this.config.patch = true;
this.loaded("loaded patches, switching in preview mode");
}
//Setup renderer, world and controller
await (Render as friend).setup({ app: this });
Object.assign(this, { world: new World() });
await this.world.ready;
Object.assign(this, { controller: new Controller({ target: this.world }) });
this.ready.resolve();
//User inputs
const { x = 5, y = -55 } = Object.fromEntries(new URLSearchParams(window.location.search).entries());
this.world.camera.place({ x: Number(x) || 0, y: Number(y) || 0 });
//Finalize loading
this.loaded("waiting for first rendering");
global.document.querySelector(".loader").remove();
return App;
}
/** App ready state */
static readonly ready = deferred();
/** Rendering instance */
static get rendering() {
return (Render as friend).instance;
}
/** Print a message to loading console */
static get loaded() {
return global.gracidea.loaded as (text: string, type?: string | null, options?: { update?: boolean }) => void;
}
/** Current commit sha */
static get sha() {
return global.gracidea.sha as string;
}
/** Config */
static config = {
//Texture settings
textures: {
//(for future usage) Textures styles
style: "rse",
//Toggle sea display
sea: true,
},
//People settings
people: {
//Toggle display
display: true,
},
//Creatures settings
creatures: {
//Toggle display
display: true,
//Shiny rate
shiny: 1 / 128,
},
//Debug settings
debug: {
//Toggle debug logs in console
logs: false,
//Toggle renderable bounds display
bounds: false,
},
//Patch settings (auto-enabled when patches.json is not empty)
patch: false,
};
}
================================================
FILE: app/client/js/app/controls/controller.ts
================================================
//Imports
import type { Renderable } from "app/client/rendering/renderable.ts";
import type { event } from "app/client/types.ts";
import { global } from "app/client/types.ts";
import { App } from "app/client/app.ts";
/**
* Controller
*/
export class Controller {
static instance = null as unknown as Controller;
/** Constructor */
constructor({ target }: { target: Renderable }) {
this.#scrollers();
this.target = target;
this.focus(target);
Controller.instance = this;
this.init();
}
/** Init */
async init() {
//World map
{
//Toggle world map
{
const label = dom.element("label", { text: "Display world map" });
label.append(dom.element("input", {
attributes: { id: "control-worldmap", type: "checkbox" },
listeners: {
click: ({ target: { checked: value } }) => {
App.world.map.visible = value;
this.focus(value ? { sprite: App.world.map.getChildByName("worldmap") } as Renderable : this.target);
},
},
}));
global.document.querySelector(".worldmap")?.append(label);
}
//Search location
{
const label = dom.element("label", { text: "Search location" });
label.append(dom.element("input", {
attributes: { list: "control-worldmap-search" },
listeners: {
change({ target: { value } }) {
const location = App.world.locations.filter(({ name }) => name === value)[0] ?? null;
if (location) {
App.world.camera.place(location);
global.document.querySelector("[list='control-worldmap-search']").value = "";
}
},
},
}));
const datalist = label.appendChild(dom.element("datalist", { attributes: { id: "control-worldmap-search" } }));
for (const value of App.world.locations.map(({ name }) => name)) {
datalist.append(dom.element("option", { attributes: { value } }));
}
global.document.querySelector(".worldmap")?.append(label);
}
}
//Patches
if (App.config.patch) {
const patches = await fetch("/data/maps/patches.json").then((response) => response.json());
for (const { id, x, y, tiles = [], areas = {} } of patches) {
//Sections
const patch = dom.element("div", { class: "patch" });
patch.append(dom.element("div", {
text: `@@ ${id} @@`,
class: "id",
listeners: {
click() {
App.world.camera.place({ x, y });
},
},
}));
//Tiles
for (const { chunk, added = 0, deleted = 0, changed = 0 } of tiles) {
const record = patch.appendChild(dom.element("div", { class: "record" }));
const diff = record.appendChild(dom.element("div", { class: "diff" }));
if (added) {
diff.append(dom.element("div", { text: `+${added}`, class: "added" }));
}
if (changed) {
diff.append(dom.element("div", { text: `~${changed}`, class: "changed" }));
}
if (deleted) {
diff.append(dom.element("div", { text: `-${deleted}`, class: "deleted" }));
}
record.append(dom.element("div", { text: chunk, class: "name" }));
}
//Areas
for (const [action, values] of Object.entries(areas)) {
for (const { id, type } of values as Array<{ id: string; type: string }>) {
const record = patch.appendChild(dom.element("div", { class: "record" }));
const diff = record.appendChild(dom.element("div", { class: "diff" }));
diff.append(dom.element("div", { text: { added: "+", changed: "~", deleted: "-" }[action]?.repeat(2), class: action }));
record.append(dom.element("div", { text: `${id} (${type})`, class: "name" }));
}
}
//Pull request number
const pr = await fetch("/data/maps/patches.pr.json").then((response) => response.json()).catch(() => null);
if (pr) {
const link = dom.element("a", { attributes: { href: `https://github.com/lowlighter/gracidea/pull/${pr}` }, text: `See pull request #${pr} on GitHub` });
global.document.querySelector(".debug")?.append(link);
}
global.document.querySelector(".patches")?.append(patch);
}
} else {
global.document.querySelector(".patches")?.parentNode?.remove();
}
//Debug options
{
//Patch mode
if (App.config.patch) {
const label = dom.element("label", { text: "patch" });
label.append(dom.element("input", { attributes: { type: "checkbox", checked: App.config.patch, disabled: true } }));
global.document.querySelector(".debug")?.append(label);
}
//Debug logs
{
const label = dom.element("label", { text: "debug.logs" });
label.append(dom.element("input", {
listeners: {
click({ target: { checked: value } }) {
App.config.debug.logs = value;
},
},
attributes: { type: "checkbox", checked: App.config.debug.logs },
}));
global.document.querySelector(".debug")?.append(label);
}
//Debug bounds
{
const label = dom.element("label", { text: "debug.bounds" });
label.append(dom.element("input", {
listeners: {
click({ target: { checked: value } }) {
App.config.debug.bounds = value;
},
},
attributes: { type: "checkbox", checked: App.config.debug.bounds },
}));
global.document.querySelector(".debug")?.append(label);
}
//Textures styles
{
const label = dom.element("label", { text: "textures.style" });
const select = label.appendChild(dom.element("select", {
listeners: {
change({ target: { value } }) {
App.config.textures.style = value;
},
},
attributes: { value: App.config.textures.style },
}));
for (const style of ["rse"]) {
select.append(dom.element("option", { text: style, attributes: { value: style } }));
}
global.document.querySelector(".debug")?.append(label);
}
//Textures sea
{
const label = dom.element("label", { text: "textures.sea" });
label.append(dom.element("input", {
listeners: {
click({ target: { checked: value } }) {
App.config.textures.sea = value;
},
},
attributes: { type: "checkbox", checked: App.config.textures.sea },
}));
global.document.querySelector(".debug")?.append(label);
}
//People display
{
const label = dom.element("label", { text: "people.display" });
label.append(dom.element("input", {
listeners: {
click({ target: { checked: value } }) {
App.config.people.display = value;
},
},
attributes: { type: "checkbox", checked: App.config.people.display },
}));
global.document.querySelector(".debug")?.append(label);
}
//Creatures display
{
const label = dom.element("label", { text: "creatures.display" });
label.append(dom.element("input", {
listeners: {
click({ target: { checked: value } }) {
App.config.creatures.display = value;
},
},
attributes: { type: "checkbox", checked: App.config.creatures.display },
}));
global.document.querySelector(".debug")?.append(label);
}
//Creatures shiny rate
{
const label = dom.element("label", { text: "creatures.shiny" });
label.append(dom.element("input", {
listeners: {
change({ target: { value } }) {
App.config.creatures.shiny = Number(value);
},
},
attributes: { type: "number", min: 0, max: 1, step: 0.125, value: App.config.creatures.shiny },
}));
global.document.querySelector(".debug")?.append(label);
}
}
//Menu
global.document.querySelector("nav .app-name").addEventListener("click", () => global.document.querySelector("nav").classList.toggle("collapsed"));
}
/** Focused element */
focus(element: Renderable | null) {
this.#focus = element;
}
/** Focused element */
#focus = null as Renderable | null;
/** Target element */
target: Renderable;
/** Scroll handlers */
#scrollers() {
let click = { x: 0, y: 0, active: false };
let touch = { x: 0, y: 0 };
App.rendering.view.addEventListener("touchstart", (event: event) => {
touch = { x: event.touches[0].pageX, y: event.touches[0].pageY };
});
App.rendering.view.addEventListener("mousedown", (event: event) => {
click = { x: event.pageX, y: event.pageY, active: true };
});
App.rendering.view.addEventListener("touchmove", (event: event) => {
const delta = { x: touch.x - event.touches[0].pageX, y: touch.y - event.touches[0].pageY };
touch = { x: event.touches[0].pageX, y: event.touches[0].pageY };
this.#update({ delta });
});
global.document.addEventListener("mousemove", (event: event) => {
if (click.active) {
if (event.buttons === 0) {
click.active = false;
return;
}
const delta = { x: click.x - event.pageX, y: click.y - event.pageY };
click = { x: event.pageX, y: event.pageY, active: true };
this.#update({ delta });
}
this.#cursor = { x: event.clientX, y: event.clientY };
});
App.rendering.view.addEventListener("wheel", (event: event) => {
event.preventDefault();
this.#update({ delta: { x: event.deltaX, y: event.deltaY } });
});
}
/** Update focused element position */
#update({ delta }: { delta?: { x: number; y: number } }) {
if (this.#focus) {
if (delta) {
this.#focus.sprite.position.set(
Math.round(this.#focus.sprite.position.x - delta.x),
Math.round(this.#focus.sprite.position.y - delta.y),
);
}
}
}
/** Camera position */
get camera() {
return {
x: Math.floor((-this.target.sprite.position.x + global.document.body.clientWidth / 2) / 16),
y: Math.floor((-this.target.sprite.position.y + global.document.body.clientHeight / 2) / 16),
};
}
/** Cursor position (internal) */
#cursor = { x: 0, y: 0 };
/** Cursor position */
get cursor() {
return {
x: Math.floor((-this.target.sprite.position.x + this.#cursor.x) / 16),
y: Math.floor((-this.target.sprite.position.y + this.#cursor.y) / 16),
};
}
/** Query selector */
qs(selector: string) {
return global.document.querySelector(selector);
}
}
/** Dom utilities */
const dom = {
/** Dom element helper */
element(tag: string, { class: classes = [] as string | string[], attributes = {} as { [key: string]: unknown }, listeners = {} as { [key: string]: (event: event) => void }, text = "" } = {}) {
const element = global.document.createElement(tag);
for (const [name, value] of Object.entries(attributes)) {
if ((tag === "input") && (name === "checked") && (!value)) {
continue;
}
element.setAttribute(name, value);
}
for (const [event, listener] of Object.entries(listeners)) {
element.addEventListener(event, listener);
}
for (const classname of [classes].flat()) {
element.classList.add(classname);
}
if (text) {
element.innerText = text;
}
return element;
},
};
================================================
FILE: app/client/js/app/maps/area.ts
================================================
//Imports
import { App } from "app/client/app.ts";
import { Render } from "app/client/rendering/render.ts";
import { Renderable } from "app/client/rendering/renderable.ts";
import type { Section } from "app/client/maps/section.ts";
import { Controller } from "app/client/controls/controller.ts";
import { NPC } from "app/client/maps/npc.ts";
import { Creature } from "app/client/maps/npc.creature.ts";
import { Human } from "app/client/maps/npc.human.ts";
import type { Graphics } from "app/client/rendering/render.ts";
/**
* Section area.
* It is used to display characters, creatures and others areas within a map section.
*/
export class Area extends Renderable {
/** Section */
readonly section: Section;
/** Data */
readonly data: Data;
/** Polygon */
readonly polygon: ReturnType<typeof Render.Polygon>;
/** Loaded NPCs */
readonly npcs = new Set<NPC>();
/** Constructor */
constructor({ section, data }: { section: Section; data: Data }) {
super({ id: data.name });
this.section = section;
this.data = data;
this.polygon = Render.Polygon(this.data.points);
this.section.debug.addChild(this.debug);
}
/** Destructor */
destructor() {
this.section.areas.delete(this);
this.npcs.forEach((npc) => npc.destructor());
return super.destructor();
}
/** Test if point is contained within area */
contains({ x, y }: { x: number; y: number }) {
return this.polygon.contains(x * 16, y * 16);
}
/** Encounter rates */
get encounters() {
return this.section.data.encounters?.[this.id] as { [name: string]: number } ?? null;
}
/** Update renderable */
async update({ debug = this.debug.visible, t, dt }: { t: number; dt: number; debug?: boolean }) {
if (this.data.type === "creatures") {
if ((App.config.creatures.display) && (this.npcs.size < 1 /*+ Number(this.data.properties.size)/10*/)) {
if (this.encounters) {
this.npcs.add(new Creature({ area: this }));
}
}
}
if (this.data.type === "people") {
if ((App.config.people.display) && (this.npcs.size < 1)) {
this.npcs.add(new Human({ area: this }));
}
}
if ((debug) && (this.dirty)) {
this.debug.bounds.removeChildren();
this.debug.bounds.addChild(Render.Graphics({
text: `${this.id}`,
polygon: this.polygon,
...Renderable.debug,
...(this.constructor as typeof Renderable).debug,
textPosition: { x: this.polygon.points[0] / 16, y: this.polygon.points[1] / 16 },
...(this.contains(Controller.instance.cursor) ? { stroke: [3, 0xFFFFFF, .5] } : {}),
}));
}
return super.update({ t, dt, debug: false });
}
/** Debug graphics properties */
protected static debug = {
stroke: [1, 0x85144B, .5],
fill: [0x85144B, .125],
textStyle: { align: "center", fontSize: 10, fill: "#85144B", fontFamily: "monospace" },
} as Partial<Graphics>;
}
/** Types */
export const enum Type {
people = "people",
creatures = "creatures",
map = "map",
}
/** Area data */
export type Data = {
id: number;
name: string;
type: Type;
points: number[];
properties: { [key: string]: unknown };
};
================================================
FILE: app/client/js/app/maps/camera.ts
================================================
//Imports
import { global } from "app/client/types.ts";
import { Render } from "app/client/rendering/render.ts";
import { Renderable } from "app/client/rendering/renderable.ts";
import type { World } from "app/client/maps/world.ts";
import type { Region } from "app/client/maps/region.ts";
/** Visible range */
const visible = { x: 7 * 16, y: 5 * 16 };
/** Loaded range */
const loaded = { x: 11 * 16, y: 9 * 16 };
/**
* Camera.
*/
export class Camera extends Renderable {
/** World */
readonly #world: World;
/** Constructor */
constructor({ world }: { world: World }) {
super({ id: "camera", visible: false });
this.#world = world;
this.#world.debug.addChild(this.debug);
this.#visible = Render.Rectangle([0, 0, visible.x / 16, visible.y / 16]);
this.#loaded = Render.Rectangle([0, 0, loaded.x / 16, loaded.y / 16]);
}
/** Visible areas */
readonly #visible: ReturnType<typeof Render.Rectangle>;
/** Loaded areas */
readonly #loaded: ReturnType<typeof Render.Rectangle>;
/** Update renderable */
async update({ debug = this.debug.visible, t, dt }: { t: number; dt: number; debug?: boolean }) {
//Update position and areas
const { x, y } = this;
this.#visible.x = Math.ceil(x - this.#visible.width / 2);
this.#visible.y = Math.ceil(y - this.#visible.height / 2);
this.#loaded.x = Math.ceil(x - this.#loaded.width / 2);
this.#loaded.y = Math.ceil(y - this.#loaded.height / 2);
//Dynamically load and unload sections
this.#world.regions.forEach((region: Region) => {
//Load sections in range
for (const [id, bounds] of region.loadable) {
if (this.intersects(bounds) > Intersection.NONE) {
region.load(id);
}
}
//Update sections display and clean out the ones that are too far away
for (const [_, section] of region.sections) {
const i = this.intersects(section.bounds);
if (i < Intersection.LOADED) {
section.destructor();
} else if (i < Intersection.VISIBLE) {
section.hide();
} else {
section.show();
}
}
});
//Debug sprite
if (debug) {
this.debug.bounds.removeChildren();
this.debug.bounds.addChild(Render.Graphics({
rect: [this.#loaded.x, this.#loaded.y, this.#loaded.width, this.#loaded.height],
fill: [0xAAAAAA, .125],
}));
this.debug.bounds.addChild(Render.Graphics({
text: [
`x: ${x}`,
`y: ${y}`,
`visible.x: ${this.#visible.x} to ${this.#visible.x + this.#visible.width}`,
`visible.y: ${this.#visible.y} to ${this.#visible.y + this.#visible.height}`,
`loaded.x: ${this.#loaded.x} to ${this.#loaded.x + this.#loaded.width}`,
`loaded.y: ${this.#loaded.y} to ${this.#loaded.y + this.#loaded.height}`,
`world.x: ${this.#world.sprite.position.x}px`,
`world.y: ${this.#world.sprite.position.y}px`,
].join("\n"),
textPosition: { x, y },
textAnchor: [.5, .5],
textStyle: { fontSize: 12, fontFamily: "monospace" },
rect: [this.#visible.x, this.#visible.y, this.#visible.width, this.#visible.height],
fill: [0xDDDDDD, .125],
}));
}
return super.update({ t, dt, debug: false });
}
/** Test in which camera area a rectangle is located */
private intersects(rectangle: ReturnType<typeof Render.engine.Rectangle>) {
if (!this.#loaded.intersects(rectangle)) {
return Intersection.NONE;
} else if (!this.#visible.intersects(rectangle)) {
return Intersection.LOADED;
}
return Intersection.VISIBLE;
}
/** Move camera to given position */
place({ x, y }: { x: number; y: number }) {
this.#world.sprite.position.set(-x * 16 + global.document.body.clientWidth / 2, -y * 16 + global.document.body.clientHeight / 2);
}
/** X coordinate */
get x() {
return Math.floor((-this.#world.sprite.position.x + global.document.body.clientWidth / 2) / 16);
}
/** Y coordinate */
get y() {
return Math.floor((-this.#world.sprite.position.y + global.document.body.clientHeight / 2) / 16);
}
}
/** Intersection with camera areas */
export const enum Intersection {
NONE = 0,
LOADED = 1,
VISIBLE = 2,
}
================================================
FILE: app/client/js/app/maps/npc.creature.ts
================================================
//Imports
import type { Area } from "app/client/maps/area.ts";
import { App } from "app/client/app.ts";
import { NPC } from "app/client/maps/npc.ts";
import { Render } from "app/client/rendering/render.ts";
/**
* NPC (Creature).
*/
export class Creature extends NPC {
/** Name */
protected readonly name = "" as string;
/** Constructor */
constructor({ area }: { area: Area }) {
super({ area });
let random = Math.random();
for (const name in this.area.encounters) {
const rate = this.area.encounters[name];
if (random <= rate) {
this.name = name;
break;
}
random -= rate;
}
this.sprite.alpha = 0;
this.#lifetime = Math.floor(100 + Math.random() * 200);
this.init({
frame: `${Math.random() < App.config.creatures.shiny ? "shiny" : "regular"}/${this.name}`,
random: true,
});
const effects = [];
if (this.area.data.name in Render.effects.creature.area) {
effects.push(Render.effects.creature.area[this.area.data.name]);
}
if (this.name in Render.effects.creature.name) {
effects.push(Render.effects.creature.name[this.name]);
}
if (effects.length) {
this.effects(...effects);
}
}
/** Lifetime */
#lifetime = Infinity;
/** Update tracker */
protected get tracker() {
return this.#lifetime;
}
/** Perform refresh */
protected refresh() {
this.#lifetime--;
if (this.#lifetime <= 0) {
if (this.sprite.alpha > 0.1) {
this.sprite.alpha *= 0.9;
} else {
return this.destructor();
}
} else if (this.sprite.alpha < 1) {
this.sprite.alpha = Math.min(App.config.patch ? 0.25 : 1, this.sprite.alpha * 1.2);
if (!this.sprite.alpha) {
this.sprite.alpha = 0.1;
}
}
return super.refresh();
}
/** Perform NPC action */
protected action() {
this.wander();
}
/** Update */
async update({ debug = this.debug.visible, t, dt }: { t: number; dt: number; debug?: boolean }) {
this.sprite.visible = App.config.creatures.display;
super.update({ debug, t, dt });
}
}
================================================
FILE: app/client/js/app/maps/npc.human.ts
================================================
//Imports
import type { Area } from "app/client/maps/area.ts";
import type { rw } from "app/client/types.ts";
import { NPC } from "app/client/maps/npc.ts";
import { App } from "app/client/app.ts";
/**
* NPC (Human).
*/
export class Human extends NPC {
/** Name */
protected readonly name = "" as string;
/** Constructor */
constructor({ area }: { area: Area }) {
super({ area });
this.name = this.area.data.name;
this.init();
}
/** Allowed directions */
readonly #directions = [] as string[];
/** Track points */
readonly #track = [] as number[];
/** Track index */
#index = 0;
/** Track pattern */
#pattern = Pattern.fixed;
/** Initialize renderable */
protected async init() {
//Allowed directions for lookaround
if (this.#pattern === Pattern.lookaround) {
this.#directions.push(...(this.area.data.properties.directions ?? []) as string[]);
}
//Compute track for loop and patrols
if ((this.#pattern === Pattern.loop) || (this.#pattern === Pattern.patrol)) {
const points = this.area.polygon.points.map((n: number) => n / 16);
points.push(points[0], points[1]);
this.#track.push(points[0], points[1]);
for (let i = 2; i < points.length; i += 2) {
let [x, y, nx, ny] = [points[i - 2], points[i - 1], points[i], points[i + 1]];
const dx = nx - x;
const dy = ny - y;
for (let j = 0; j < Math.abs(dx); j++) {
this.#track.push(x += Math.sign(dx), y);
}
for (let j = 0; j < Math.abs(dy); j++) {
this.#track.push(x, y += Math.sign(dy));
}
}
//Remove invalid cells
for (let i = 0; i < this.#track.length; i += 2) {
const [x, y] = [this.#track[i], this.#track[i + 1]];
if (!this.area.contains({ x, y })) {
this.#track[i] = this.#track[i + 1] = NaN;
}
}
(this as rw).#track = this.#track.filter(Number.isFinite);
//Push reversed track on patrol
if (this.#pattern === Pattern.patrol) {
const points = this.#track.slice();
for (let i = points.length - 4; i > 0; i -= 2) {
this.#track.push(points[i], points[i + 1]);
}
}
//Remove duplicated cell on loop
if ((this.#pattern === Pattern.loop) && (this.#track.at(0) === this.#track.at(-2)) && (this.#track.at(1) === this.#track.at(-1))) {
this.#track.pop();
this.#track.pop();
}
}
return super.init();
}
/** Update tracker */
protected get tracker() {
return this.#index;
}
/** Perform NPC action */
protected action() {
this.wander();
}
/** Update */
async update({ debug = this.debug.visible, t, dt }: { t: number; dt: number; debug?: boolean }) {
this.sprite.visible = App.config.people.display;
super.update({ debug, t, dt });
}
}
/** Patterns */
export const enum Pattern {
patrol = "patrol",
loop = "loop",
wander = "wander",
fixed = "fixed",
lookaround = "lookaround",
}
================================================
FILE: app/client/js/app/maps/npc.ts
================================================
//Imports
import type { Area } from "app/client/maps/area.ts";
import { Renderable } from "app/client/rendering/renderable.ts";
import { Render } from "app/client/rendering/render.ts";
import type { Graphics } from "app/client/rendering/render.ts";
import type { rw } from "app/client/types.ts";
/** Directions */
const enum Direction {
none = 0,
up = 1,
right = 2,
down = 3,
left = 4,
}
/**
* NPC.
*/
export class NPC extends Renderable {
/** Area */
readonly area: Area;
/** Name */
protected readonly name = "" as string;
/** Constructor */
constructor({ area }: { area: Area }) {
super({ id: "" });
this.area = area;
}
/** Destructor */
destructor() {
this.area.npcs.delete(this);
return super.destructor();
}
/** Initialize renderable */
protected async init({ frame, random = false }: { frame?: string; random?: boolean; parent?: Renderable } = {}) {
//Search initial spawn point
let [x, y] = this.area.data.points;
for (const dx of [1, 0, -1]) {
for (const dy of [1, 0, -1]) {
if ((!dx) && (!dy)) {
continue;
}
if (this.area.contains({ x: x + dx, y: y + dy })) {
x += dx;
y += dy;
break;
}
}
}
//Search random spawn point
if (random) {
let xm = Infinity, xM = -Infinity, ym = Infinity, yM = -Infinity;
this.area.data.points.forEach((v, i) => {
if (i % 2) {
ym = Math.min(ym, v);
yM = Math.max(yM, v);
} else {
xm = Math.min(xm, v);
xM = Math.max(xM, v);
}
});
for (let i = 0; i < 20; i++) {
const tx = Math.round(xm + xM * Math.random());
const ty = Math.round(ym + yM * Math.random());
if (this.area.contains({ x: tx, y: ty })) {
x = tx;
y = ty;
break;
}
}
}
//Save initial position
this.x = x;
this.y = y;
this.#tx = x;
this.#ty = y;
//Initialize main texture
this.area.section.sprite.addChild(this.sprite);
this.area.debug.addChild(this.debug);
this.#texture = this.sprite.addChild(Render.Sprite({ frame, anchor: [0.5, 1], y: 1 }));
//Initialize interactivity
this.sprite.interactive = true;
this.sprite.cursor = "pointer";
this.sprite.mouseover = () => {
if (!this.sprite.filters) {
this.sprite.filters = Render.ColorFilter({ brightness: 1.5 });
}
};
this.sprite.mouseout = () => this.sprite.filters = null;
//Patch
/*if (App.config.patch) {
Render.patch(this.sprite, this.area.section.data.diff?.areas?.[this.id] ?? "=");
if (type) {
sprite.tint = { "+": 0x116329, "-": 0x82071E, "~": 0x953800, "=": 0x222222 }[type];
sprite.alpha = type === "=" ? 0.25 : 0.75;
} else {
sprite.tint = 0xFFFFFF;
}
}*/
return super.init();
}
/** Update */
async update({ debug = this.debug.visible, t, dt }: { t: number; dt: number; debug?: boolean }) {
//Ignore if destroyed
if (this.destroyed) {
return;
}
this.refresh();
//Debug sprite
if ((debug) && (this.dirty)) {
this.debug.bounds.removeChildren();
this.debug.bounds.addChild(Render.Graphics({
text: (this as rw).tracker,
rect: [-.5, 0, 1, 1],
...(this.constructor as typeof Renderable).debug,
}));
this.debug.position.set(this.sprite.x, this.sprite.y);
}
return super.update({ debug: false, t, dt });
}
/** X coordinate */
set x(value: number) {
this.sprite.position.x = value * 16 + 8;
}
get x() {
return (this.sprite.position.x - 8) / 16;
}
/** Target X coordinate */
#tx = 0;
/** Y coordinate */
set y(value: number) {
this.sprite.position.y = value * 16;
}
get y() {
return this.sprite.position.y / 16;
}
/** Target Y coordinate */
#ty = 0;
/** Target tick wait */
#tt = 0;
/** Is moving */
get moving() {
return (this.#tx !== this.x) || (this.#ty !== this.y) || (this.#tt);
}
/** Perform refresh */
protected refresh() {
if (this.moving) {
this.move();
} else {
this.action();
}
}
/** Perform NPC action */
protected action() {
//No-op
}
/** Wander in a random direction */
protected wander() {
this.direction({
direction: [Direction.none, Direction.left, Direction.right, Direction.up, Direction.down, Direction.none][Math.floor(Math.random() * 6)],
move: true,
});
}
/** Move sprite */
private move({ delta = 1 / 2 ** 4 }: { delta?: number } = {}) {
switch (this.#direction) {
case Direction.none: {
if (this.#tt) {
this.#tt = Math.max(0, this.#tt - delta);
}
break;
}
case Direction.left: {
this.x -= delta;
this.#animate(this.#tx - this.x);
if (this.x <= this.#tx) {
this.x = this.#tx;
this.#direction = Direction.none;
}
break;
}
case Direction.right: {
this.x += delta;
this.#animate(this.#tx - this.x);
if (this.x >= this.#tx) {
this.x = this.#tx;
this.#direction = Direction.none;
}
break;
}
case Direction.up: {
this.y -= delta;
this.#animate(this.#ty - this.y);
if (this.y <= this.#ty) {
this.y = this.#ty;
this.#direction = Direction.none;
}
break;
}
case Direction.down: {
this.y += delta;
this.#animate(this.#ty - this.y);
if (this.y >= this.#ty) {
this.y = this.#ty;
this.#direction = Direction.none;
}
break;
}
}
}
/** Current direction */
#direction = Direction.none;
/** Change direction and optionally perform a step */
protected direction({ direction, move = false }: { direction: Direction; move?: boolean }) {
if (this.moving) {
return;
}
if (move) {
switch (direction) {
case Direction.none: {
this.#tt = 1;
break;
}
case Direction.left: {
if (this.area.contains({ x: this.x - 1.5, y: this.y })) {
this.texture({ suffix: "_left_0", fallback: +1 });
this.#tx = this.x - 1;
}
break;
}
case Direction.right: {
if (this.area.contains({ x: this.x + 1.5, y: this.y })) {
this.texture({ suffix: "_right_0", fallback: -1 });
this.#tx = this.x + 1;
}
break;
}
case Direction.up: {
if (this.area.contains({ x: this.x, y: this.y - 1.5 })) {
this.texture({ suffix: "_up_0" });
this.#ty = this.y - 1;
}
break;
}
case Direction.down: {
if (this.area.contains({ x: this.x, y: this.y + 1.5 })) {
this.texture({ suffix: "_down_0" });
this.#ty = this.y + 1;
}
break;
}
}
}
this.#direction = direction;
}
/** Main texture */
#texture: ReturnType<typeof Render.Sprite>;
/** Set texture frame and optionally fallback on mirroring */
private texture({ suffix = "", fallback = 0 }: { suffix?: string; fallback?: number } = {}) {
const frame = `${this.name}${suffix}`;
if (frame in Render.cache) {
this.#texture.texture = Render.Texture(frame);
} else if (fallback) {
this.#texture.scale.x = Math.sign(fallback);
}
}
/** Texture animation */
#animate(delta: number, { speed = 4, frames = 3 } = {}) {
if (this.#direction === Direction.none) {
return;
}
const i = Math.floor(Math.abs(delta) / (1 / speed)) % frames;
const d = { [Direction.up]: "up", [Direction.right]: "right", [Direction.down]: "down", [Direction.left]: "left" }[this.#direction];
this.texture({ suffix: `_${d}_${i}` });
}
/** Active effects */
#effects = {
fly: null as ReturnType<typeof Render.Sprite> | null,
swim: null as ReturnType<typeof Render.Sprite> | null,
};
/** Set texture effects */
protected effects(...effects: string[]) {
//Flying effect
if (effects.includes("fly")) {
this.#effects.fly = this.sprite.addChildAt(Render.Graphics({ fill: [0, 0.5], ellipse: [0, 0.5, 2 / 3, 2 / 4] }), 0);
this.#effects.fly.cacheAsBitmap = true;
this.#texture.position.y = 1.5;
} else if (this.#effects.fly) {
this.sprite.removeChild(this.#effects.fly);
this.#effects.fly.destroy({ children: true });
this.#effects.fly = null;
this.#texture.position.y = 1;
}
//Swimming effect
if (effects.includes("swim")) {
const mask = Render.Graphics({ rect: [-2, -2, 4, 2.4], fill: [0, 0] });
this.#effects.swim = mask;
this.#effects.swim.cacheAsBitmap = true;
this.sprite.addChild(mask);
this.#texture.mask = mask;
} else if (this.#effects.swim) {
this.sprite.removeChild(this.#effects.swim);
this.#effects.swim.destroy({ children: true });
this.#effects.swim = null;
this.#texture.mask = null;
}
}
/** Debug graphics properties */
protected static debug = {
fill: [0x001F3F, .25],
textPosition: { x: 0, y: 1 },
textStyle: { fill: "white", fontSize: 10, fontFamily: "monospace" },
} as Partial<Graphics>;
}
================================================
FILE: app/client/js/app/maps/region.ts
================================================
//Imports
import type { World } from "app/client/maps/world.ts";
import { Section } from "app/client/maps/section.ts";
import { Renderable } from "app/client/rendering/renderable.ts";
import { Render } from "app/client/rendering/render.ts";
/**
* Region.
*/
export class Region extends Renderable {
/** World */
readonly world: World;
/** Bounds */
readonly bounds = Render.Rectangle();
/** Loaded sections */
readonly sections = new Map<string, Section>();
/** Constructor */
constructor({ world, id, bounds }: { world: World; id: string; bounds: { x: number; y: number; width: number; height: number } }) {
super({ id });
Object.assign(this.bounds, bounds);
this.world = world;
this.init();
}
/** Destructor */
destructor() {
this.world.regions.delete(this.id);
return super.destructor();
}
/** Initialize renderable */
protected async init() {
const { sections } = await fetch(`/data/maps/${this.id}.json`).then((res) => res.json());
for (const { id = "", x = 0, y = 0, width = 0, height = 0 } of sections) {
this.loadable.set(id, Render.Rectangle([x / 16, y / 16, width / 16, height / 16]));
}
return super.init({ parent: this.world });
}
/** Loadable sections */
readonly loadable = new Map<string, ReturnType<typeof Render.Rectangle>>();
/** Load section */
async load(id: string) {
if (!this.sections.has(id)) {
this.sections.set(id, new Section({ region: this, id, bounds: this.loadable.get(id)! }));
}
}
/** Update */
async update({ t, dt }: { t: number; dt: number; debug?: boolean }) {
return super.update({ debug: false, t, dt });
}
}
================================================
FILE: app/client/js/app/maps/section.ts
================================================
//Imports
import { Render } from "app/client/rendering/render.ts";
import type { Region } from "app/client/maps/region.ts";
import { Renderable } from "app/client/rendering/renderable.ts";
import { Area } from "app/client/maps/area.ts";
import { App } from "app/client/app.ts";
/**
* Section.
*/
export class Section extends Renderable {
/** Region */
readonly region: Region;
/** Bounds */
readonly bounds = Render.Rectangle();
/** Loaded areas */
readonly areas = new Set<Area>();
/** Constructor */
constructor({ region, id, bounds }: { region: Region; id: string; bounds: { x: number; y: number; width: number; height: number } }) {
super({ id, visible: false });
const { x, y } = bounds;
this.region = region;
this.sprite.position.set(x * 16, y * 16);
this.sprite.sortableChildren = true;
Object.assign(this.bounds, bounds);
this.init();
}
/** Destructor */
destructor() {
this.region.sections.delete(this.id);
this.areas.forEach((area) => area.destructor());
return super.destructor();
}
/** Section data */
readonly data: data;
/** Initialize renderable */
protected async init() {
this.#placeholder = this.sprite.addChild(Render.Graphics({
stroke: [1, 0x284088, 1],
fill: [0x182850, 1],
rect: [0, 0, this.bounds.width, this.bounds.height],
text: `${this.id}\n(loading)`,
textStyle: { align: "center", fontSize: 16, fill: "white", fontFamily: "monospace" },
textPosition: { x: this.bounds.width / 2, y: this.bounds.height / 2 },
}));
return super.init({ parent: this.region });
}
/** Is loaded */
#loaded = false;
/** Placeholder */
#placeholder = null as null | ReturnType<typeof Render.Graphics>;
/** Load section */
async load() {
//Ensure this is not loaded multiple times and that initialization is complete
if (this.#loaded) {
return;
}
this.#loaded = true;
await this.ready;
Object.assign(this, { data: await fetch(`/data/maps/${this.id}.json`).then((res) => res.json()) });
const { chunks, areas } = this.data;
//Load chunks
for (const { id, layer, x: X, y: Y, tiles } of chunks) {
this.debug.addChild(
Render.Graphics({
text: id,
textStyle: { fontSize: 10, fontFamily: "monospace", fill: "white" },
textPosition: { x: X + .25, y: Y + .75 * (1 + layer) },
textAnchor: [0, 0],
stroke: [1, 0x2ECC40, .5],
rect: [X, Y, 16, 16],
}),
);
for (let i = 0; i < tiles.length; i++) {
const frames = [];
if (App.config.patch) {
const { d, a, b } = this.data.diff?.tiles?.[id]?.[i] ?? {};
switch (d) {
case "+":
frames.push({ frame: b, alpha: 0.8 }, { frame: 6327, alpha: 0.4 });
break;
case "~":
frames.push({ frame: b, alpha: 0.8 }, { frame: 6325, alpha: 0.4 });
break;
case "-":
frames.push({ frame: a, alpha: 0.8 }, { frame: 6326, alpha: 0.4 });
break;
default:
if (tiles[i]) {
frames.push({ frame: tiles[i], alpha: 0.2 });
}
break;
}
} else if ((tiles[i]) && (tiles[i] < 6215)) {
frames.push({ frame: tiles[i] });
}
if (frames.length) {
const x = X + i % 16, y = Y + Math.floor(i / 16);
for (const { frame, alpha = 1 } of frames) {
this.sprite.addChild(Render.Sprite({ frame, x, y, z: Render.tileset.zindex[`${frame}`] ?? 0, alpha }));
}
}
}
}
//Load areas
for (const area of areas) {
this.areas.add(new Area({ section: this, data: area }));
}
//Remove placeholder
if (this.#placeholder) {
this.sprite.removeChild(this.#placeholder)?.destroy({ children: true });
this.#placeholder = null;
}
if (App.config.debug.logs) {
console.debug(`loaded: ${this.constructor.name}#${this.id}`);
}
}
/** Show renderable */
show() {
this.load();
this.sprite.visible = true;
}
}
//deno-lint-ignore no-explicit-any
type data = any;
================================================
FILE: app/client/js/app/maps/world.ts
================================================
//Imports
import { App } from "app/client/app.ts";
import { Renderable } from "app/client/rendering/renderable.ts";
import { Region } from "app/client/maps/region.ts";
import { Camera } from "app/client/maps/camera.ts";
import type { Graphics } from "app/client/rendering/render.ts";
import { Render } from "app/client/rendering/render.ts";
/**
* World.
*/
export class World extends Renderable {
/** Loaded regions */
readonly regions = new Map<string, Region>();
/** Camera */
readonly camera: Camera;
/** World map */
readonly map: ReturnType<typeof Render.Container>;
/** World locations */
readonly locations = [] as Array<{ name: string; x: number; y: number; spawn: { x: number; y: number } | null; bounds: ReturnType<typeof Render.engine.Rectangle> }>;
/** Constructor */
constructor() {
super({ id: "gracidea" });
this.camera = new Camera({ world: this });
this.init();
}
/** Initialize renderable */
protected async init() {
await Promise.all([this.#regions(), this.#map(), this.#coordinates()]);
return super.init({ parent: App.rendering.stage });
}
/** Setup world regions */
async #regions() {
const { regions } = await fetch("/data/maps.json").then((res) => res.json());
for (const { id = "", ...bounds } of regions) {
this.regions.set(id, new Region({ world: this, id, bounds }));
}
this.#sea.sprite = this.sprite.addChild(Render.TilingSprite());
if (App.config.patch) {
this.#sea.sprite.alpha = 0.1;
}
}
/** Setup world map */
async #map() {
//Setup
const { width, height, layers, images, links } = await fetch("/data/maps.world.json").then((res) => res.json());
const container = App.rendering.stage.addChild(Render.Container({ z: 1 }));
container.addChild(Render.Graphics({ fill: [0x51BADA, 0.75], rect: [0, 0, 128, 128] }));
container.visible = false;
Object.assign(this, { map: container });
//Create world map
const map = container.addChild(Render.Container());
map.name = "worldmap";
map.scale.set(2);
for (const { layer, tiles } of layers) {
//Cities, roads and interests points
for (let i = 0; i < width * height; i++) {
const tile = tiles[i] - 1;
if (tile) {
const x = (i % width) / 2, y = Math.floor(i / width) / 2;
map.addChild(Render.Sprite({ frame: `worldmap/${tile}`, x, y }));
}
}
//After sea roads, display region background
if (layer === "roads.sea") {
for (const { name, x, y, width, height } of images) {
const sprite = map.addChild(Render.Sprite({ frame: `regions/${name}` }));
Object.assign(sprite, { x, y, width, height });
}
}
}
//Create links
for (const { name, points, location } of links) {
const sprite = map.addChild(Render.Graphics({ fill: [0xFFFFFF, 1], polygon: points.map((point: number) => point / 2) }));
sprite.interactive = true;
sprite.cursor = "pointer";
sprite.alpha = 0;
sprite.mouseover = () => sprite.alpha = 0.8;
sprite.mouseout = () => sprite.alpha = 0;
sprite.click = () => (this.camera.place(location.spawn ?? location), App.controller.qs("#control-worldmap").click());
sprite.tap = sprite.click;
this.locations.push({ name, ...location, bounds: new Render.engine.Rectangle(location.x, location.y, location.width, location.height) });
}
}
/** Setup coordinates handle */
async #coordinates() {
const handle = App.rendering.stage.addChild(Render.Sprite({ z: 2 }));
handle.name = "coordinates";
handle.position.set(4, App.rendering.view.height - 20);
handle.addChild(new Render.engine.Text("", { fontSize: 16, fill: "white", strokeThickness: 2, fontFamily: "monospace" }));
}
/** Sea texture */
readonly #sea = {
sprite: null as ReturnType<typeof Render.TilingSprite> | null,
frame: 0,
dt: 0,
resize: true,
};
/** Update renderable */
async update({ t, dt }: { t: number; dt: number; debug?: boolean }) {
//Sea update
if (this.#sea.sprite) {
this.#sea.sprite.visible = App.config.textures.sea;
if (this.#sea.sprite.visible) {
const { frames, speed } = Render.tileset.animated[2374];
this.#sea.dt += speed * dt;
if (this.#sea.dt > 2) {
this.#sea.frame = (this.#sea.frame + 1) % frames.length;
this.#sea.sprite.texture = Render.Texture(frames[this.#sea.frame]);
this.#sea.dt = 0;
}
if (this.#sea.resize) {
this.#sea.sprite.width = Math.round(2 + App.rendering.screen.width / 16) * 16;
this.#sea.sprite.height = Math.round(2 + App.rendering.screen.height / 16) * 16;
this.#sea.resize = false;
}
this.#sea.sprite.position.set(-Math.floor(1 + this.sprite.position.x / 16) * 16, -Math.floor(1 + this.sprite.position.y / 16) * 16);
}
}
//Coordinates update
if (App.controller) {
const { x, y } = App.controller.camera;
const { children: [coordinates] } = App.rendering.stage.getChildByName("coordinates");
coordinates.text = `${x};${y}`;
const location = this.locations.find(({ bounds }) => bounds.contains(x, y));
if (location) {
coordinates.text += ` — ${location.name}`;
}
}
return super.update({ t, dt, debug: true });
}
/** Debug graphics properties */
protected static debug = { text: "" } as Partial<Graphics>;
}
================================================
FILE: app/client/js/app/mod.ts
================================================
/**
* Copyright Simon Lecoq (@lowlighter)
* @license https://github.com/lowlighter/gracidea/blob/main/LICENSE
*/
//Imports
import { global } from "app/client/types.ts";
import { App } from "app/client/app.ts";
//Start app
global.gracidea.app = await App.setup();
================================================
FILE: app/client/js/app/rendering/render.ts
================================================
//Imports
import * as PIXI from "app/cache/pixi.js";
import { global } from "app/client/types.ts";
import type { App } from "app/client/app.ts";
import type { Renderable } from "app/client/rendering/renderable.ts";
/**
* Render engine.
* A wrapper around PIXI engine.
*/
export class Render {
/** Render engine */
static readonly engine: Engine;
/** Render application instance */
private static readonly instance: Application;
/** Render setup */
protected static async setup({ app }: { app: typeof App }) {
//Configure PIXI
Object.assign(this, { engine: PIXI, cache: PIXI.utils.TextureCache });
this.engine.settings.SCALE_MODE = this.engine.SCALE_MODES.NEAREST;
this.engine.settings.ROUND_PIXELS = true;
const pending = [];
//Load resources
const loader = Render.engine.Loader.shared;
for (const texture of ["tileset", "npcs", "creatures"]) {
loader.add(`/textures/${app.config.textures.style}/${texture}.json?sha=${app.sha}`);
}
for (const texture of ["worldmap", "worldmap.regions"]) {
loader.add(`/textures/all/${texture}.json?sha=${app.sha}`);
}
loader.onProgress.add((_: unknown, { url = "" }) => app.loaded(`loaded ${new URL(url, global.location).pathname}`));
loader.onComplete.add(() => app.loaded("all textures successfully loaded"));
pending.push(new Promise((solve) => loader.load(() => solve(null))));
//Load tileset properties
pending.push(
new Promise<void>(async (solve) => {
const tileset = await fetch(`/data/textures/${app.config.textures.style}/tileset.json?sha=${app.sha}`).then((response) => response.json());
app.loaded(`loaded tileset metadata`);
Object.assign(this, { tileset });
solve();
}),
);
//Load texture effects
pending.push(
new Promise<void>(async (solve) => {
const effects = await fetch(`/data/textures/effects.json?sha=${app.sha}`).then((response) => response.json());
app.loaded(`loaded textures effects`);
Object.assign(this, { effects });
solve();
}),
);
//Create application
Object.assign(this, {
instance: new Render.engine.Application({
width: global.document.body.clientWidth,
height: global.document.body.clientHeight,
backgroundAlpha: 0,
}),
});
this.instance.resizeTo = global.window;
this.instance.stage.sortableChildren = true;
global.document.querySelector("body").appendChild(this.instance.view);
//Wait for resources to be loaded
await Promise.all(pending);
app.loaded("render engine ready");
}
/** Registered renderable instances */
private static readonly registered = new WeakMap<Renderable>();
/** Register a new renderable */
static register(renderable: Renderable) {
this.registered.set(renderable, (dt: number) => renderable.update({ t: Date.now(), dt }));
Render.engine.Ticker.shared.add(this.registered.get(renderable));
return this;
}
/** Unregister an existing renderable */
static unregister(renderable: Renderable) {
Render.engine.Ticker.shared.remove(this.registered.get(renderable));
this.registered.delete(renderable);
return this;
}
/** Frames per second */
static get fps() {
return Render.engine.Ticker.shared.FPS;
}
/** Tileset tiles properties */
static readonly tileset: {
animated: { [key: string]: { frames: string[]; speed: number } };
zindex: { [key: string]: number };
};
/** Texture effects */
static readonly effects: {
creature: {
name: { [key: string]: string };
area: { [key: string]: string };
};
};
/** Texture cache */
static readonly cache: { [key: string]: ReturnType<typeof Render.engine.Texture> };
/** Load a texture */
static Texture(frame = null as frame) {
if (`${frame}` in Render.cache) {
return Render.engine.Texture.from(`${frame}`);
}
return Render.engine.Texture.EMPTY;
}
/** Color filter */
static ColorFilter({ brightness = NaN, saturate = NaN, tint = NaN } = {}) {
const filter = new Render.engine.filters.ColorMatrixFilter();
if (!Number.isNaN(brightness)) {
filter.brightness(brightness);
}
if (!Number.isNaN(saturate)) {
filter.saturate(saturate);
}
if (!Number.isNaN(tint)) {
filter.tint(tint);
}
return [filter];
}
/** Create a new polygon */
static Polygon(points = [] as number[]) {
return new Render.engine.Polygon(...points.map((n) => n * 16));
}
/** Create a new rectangle */
static Rectangle(points = [] as number[]) {
return new Render.engine.Rectangle(...points.map((n) => n * 16));
}
/** Create a new container */
static Container({ x = 0, y = 0, z = NaN, sorted = false, visible = true } = {}) {
const container = new Render.engine.Container();
if (sorted) {
container.sortableChildren = true;
}
container.position.set(x * 16, y * 16);
if (!Number.isNaN(z)) {
container.zIndex = z;
}
container.visible = visible;
return container;
}
/** Created a new tiling sprite */
static TilingSprite({ frame = null, x = 0, y = 0, z = NaN, width = 0, height = 0 }: TilingSprite = {}) {
const sprite = new Render.engine.TilingSprite(Render.Texture(frame), width * 16, height * 16);
sprite.position.set(x * 16, y * 16);
if (!Number.isNaN(z)) {
sprite.zIndex = z;
}
return sprite;
}
/** Create a new sprite */
static Sprite({ frame = null, x = 0, y = 0, z = NaN, alpha = NaN, anchor, scale }: Sprite = {}) {
let sprite;
if (`${frame}` in this.tileset.animated) {
const { frames, speed } = this.tileset.animated[frame];
sprite = new Render.engine.AnimatedSprite.fromFrames(frames);
sprite.animationSpeed = speed;
sprite.play();
} else {
sprite = new Render.engine.Sprite(Render.Texture(frame));
}
sprite.position.set(x * 16, y * 16);
if (anchor) {
sprite.anchor.set(...anchor);
}
if (scale) {
sprite.scale.set(...scale);
}
if (!Number.isNaN(alpha)) {
sprite.alpha = alpha;
}
if (!Number.isNaN(z)) {
sprite.zIndex = z;
}
return sprite;
}
/** Create a new graphics */
static Graphics({ z = NaN, stroke, fill, text, textStyle, textPosition, textAnchor = [0.5, 0.5], rect, circle, ellipse, polygon }: Graphics = {}) {
const graphics = new Render.engine.Graphics();
if (stroke) {
graphics.lineStyle(...stroke);
}
if (fill) {
graphics.beginFill(...fill);
}
if (rect) {
graphics.drawRect(...rect.map((n) => n * 16));
}
if (circle) {
graphics.drawCircle(...circle.map((n) => n * 16));
}
if (ellipse) {
graphics.drawEllipse(...ellipse.map((n) => n * 16));
}
if (polygon) {
if (polygon instanceof Render.engine.Polygon) {
graphics.drawPolygon(polygon);
} else {
graphics.drawPolygon(...polygon.map((n) => n * 16));
}
}
graphics.endFill();
if (text) {
const textSprite = graphics.addChild(new Render.engine.Text(text, textStyle));
textSprite.anchor.set(...textAnchor);
if (textPosition) {
textSprite.position.set(textPosition.x * 16, textPosition.y * 16);
}
}
if (!Number.isNaN(z)) {
graphics.zIndex = z;
}
return graphics;
}
}
/** Compute intersection between two rectangle (from @pixi/math) */
PIXI.Rectangle.prototype.intersects = function intersects(other: ReturnType<typeof Render.engine.Rectangle>) {
const x0 = this.x < other.x ? other.x : this.x;
const x1 = this.right > other.right ? other.right : this.right;
if (x1 <= x0) {
return false;
}
const y0 = this.y < other.y ? other.y : this.y;
const y1 = this.bottom > other.bottom ? other.bottom : this.bottom;
return y1 > y0;
};
/** Render engine */
//deno-lint-ignore no-explicit-any
export type Engine = any;
/** Render application */
//deno-lint-ignore no-explicit-any
export type Application = any;
/** Frame */
export type frame = null | string | number | typeof Render.engine.Texture.EMPTY;
/** TilingSprite constructor */
export type TilingSprite = {
frame?: frame;
x?: number;
y?: number;
z?: number;
width?: number;
height?: number;
};
/** Sprite constructor */
export type Sprite = {
frame?: frame;
x?: number;
y?: number;
z?: number;
alpha?: number;
anchor?: [number, number];
scale?: [number, number];
};
/** Graphics constructor */
export type Graphics = {
z?: number;
stroke?: [number, number, number];
fill?: [number, number];
text?: string;
textStyle?: { [key: string]: unknown };
textPosition?: { x: number; y: number };
textAnchor?: [number, number];
rect?: number[];
circle?: number[];
ellipse?: number[];
polygon?: number[];
};
================================================
FILE: app/client/js/app/rendering/renderable.ts
================================================
//Imports
import { Render } from "app/client/rendering/render.ts";
import { App } from "app/client/app.ts";
import type { Graphics } from "app/client/rendering/render.ts";
import { deferred } from "std/async/deferred.ts";
/**
* Renderable object.
* It contains additional methods that can be used for easier management and debugging.
*/
export abstract class Renderable {
/** Identifier */
readonly id: string;
/** Constructor */
constructor({ id, x = 0, y = 0, z = 0, visible = true }: { id: string; x?: number; y?: number; z?: number; visible?: boolean }) {
this.id = id;
this.sprite = Render.Container({ x, y, z, visible });
this.debug = Render.Container({ x, y, z });
Object.defineProperty(this.debug, "visible", {
get() {
return App.config.debug.bounds;
},
});
this.debug.bounds = this.debug.addChild(Render.Container());
Render.register(this);
}
/** Is destroyed */
protected readonly destroyed = false;
/** Destructor */
destructor() {
Render.unregister(this);
this.sprite.parent?.removeChild(this.sprite);
this.debug.parent?.removeChild(this.debug);
this.debug.bounds.parent?.removeChild(this.debug.bounds);
this.sprite.destroy({ children: true });
this.debug.destroy({ children: true });
this.debug.bounds.destroy({ children: true });
Object.assign(this, { destroyed: true });
if (App.config.debug.logs) {
console.debug(`destroyed: ${this.constructor.name}#${this.id}`);
}
}
/** Renderable initialized */
readonly ready = deferred();
/** Initialize renderable */
protected async init({ parent = null }: { parent?: null | Renderable | typeof App.rendering.stage } = {}) {
if (parent === App.rendering.stage) {
App.rendering.stage.addChild(this.sprite);
App.rendering.stage.addChild(this.debug);
} else if (parent) {
if ((this.destroyed) || (parent.destroyed)) {
if (App.config.debug.logs) {
console.debug(`creation aborted: ${this.constructor.name}#${this.id} (sprite already destroyed)`);
}
return this.destructor();
}
parent.sprite.addChild(this.sprite);
parent.debug.addChild(this.debug);
}
if (App.config.debug.logs) {
console.debug(`created: ${this.constructor.name}#${this.id}`);
}
this.ready.resolve();
}
/** Sprite */
readonly sprite: ReturnType<typeof Render.Container>;
/** Debug sprite */
readonly debug: ReturnType<typeof Render.Container> & { bounds: ReturnType<typeof Render.Container> };
/** Show renderable */
show() {
this.sprite.visible = true;
}
/** Hide renderable */
hide() {
this.sprite.visible = false;
}
/** Update renderable */
async update({ debug = this.debug.visible }: { t: number; dt: number; debug?: boolean }) {
if (this.destroyed) {
return;
}
if (debug) {
if (this.dirty) {
const { width, height } = this.sprite._bounds.getRectangle();
this.debug.bounds.removeChildren();
this.debug.bounds.addChild(Render.Graphics({
text: `${this.id}\n${Math.floor(this.sprite.x / 16)};${Math.floor(this.sprite.y / 16)} (${this.sprite.x};${this.sprite.y})`,
rect: [0, 0, width / 16, height / 16],
...Renderable.debug,
...(this.constructor as typeof Renderable).debug,
}));
}
this.debug.position.set(this.sprite.x, this.sprite.y);
}
}
/** Tell if bounds have changed since last update */
protected get dirty() {
if (this.destroyed) {
return false;
}
const { x, y, width, height } = this.sprite.getBounds(true);
const hash = `${x}/${y}/${width}/${height}`;
const dirty = (this.#dirty === hash);
this.#dirty = hash;
return dirty;
}
/** Dirty hash */
#dirty = "";
/** Debug graphics properties */
protected static debug = {
stroke: [1, 0x0000FF, .5],
fill: [0x00FF00, .125],
textStyle: { fontSize: 10, fill: "white", fontFamily: "monospace" },
textPosition: { x: .25, y: .25 },
textAnchor: [0, 0],
} as Partial<Graphics>;
}
================================================
FILE: app/client/js/app/types.ts
================================================
/** Window */
//deno-lint-ignore no-explicit-any
export const global = globalThis as any;
/** DOM event */
//deno-lint-ignore no-explicit-any
export type event = any;
/** Friend accessor */
//deno-lint-ignore no-explicit-any
export type friend = any;
/** Read-write accessor */
//deno-lint-ignore no-explicit-any
export type rw = any;
================================================
FILE: app/client/js/loader.js
================================================
(function () {
/** Create a new HTML element */
function tag(name, attributes) {
const element = document.createElement(name);
if (attributes.text) {
element.innerText = attributes.text;
delete attributes.text;
}
for (const [attribute, value] of Object.entries(attributes)) {
element.setAttribute(attribute, value);
}
return element;
}
//Loader
const loader = document.querySelector(".loader .loaded");
loader.addEventListener("gracidea.loaded", ({ data: { text, type, options: { update = false } } }) => {
const message = tag("span", { text });
message.append(tag("span", { class: "loading" }));
if (type) {
message.setAttribute("style", `color:${{ error: "red", warn: "orange", notice: "magenta" }[type]};`);
}
if (update) {
loader.querySelector(":first-child")?.remove();
}
loader.querySelectorAll(".loading").forEach((element) => element.remove());
loader.prepend(message);
}, false);
//Gracidea app global reference
const gracidea = {
sha: document.querySelector("#sha").innerHTML.trim(),
loaded(text = "", type = null, options = {}) {
loader.dispatchEvent(Object.assign(new Event("gracidea.loaded"), { data: { text, type, options } }));
},
};
globalThis.gracidea = gracidea;
console.log(`Gracidea ${gracidea.sha} - https://github.com/lowlighter/gracidea`);
console.log("All dreams are but another reality. Never forget…");
//Loading
globalThis.onload = async function () {
//URL params
const params = new URLSearchParams({ sha: gracidea.sha });
//Load stylesheet
const css = tag("link", { rel: "stylesheet", href: `/css/styles.css?${params}` });
document.querySelector("head").append(css);
await new Promise((solve) => css.onload = solve);
//Browser compatibility mode (for bad browsers)
const compat = (navigator.userAgent.includes("Safari")) && (!navigator.userAgent.includes("Chrome"));
if (compat) {
gracidea.loaded("browser compatibility mode enabled", "warn");
params.set("compat", 1);
}
//Debug mode
const debug = location.hostname === "localhost";
if (debug) {
console.warn("debug mode enabled (served from localhost)");
params.set("debug", 1);
}
//Load main script
gracidea.loaded("loading /js/app.js");
document.querySelector("body").append(tag("script", { type: "module", src: `/js/app.js?${params}` }));
};
//Errors display
globalThis.onerror = function (error) {
gracidea.loaded(error, "error");
};
})();
================================================
FILE: app/tests/integrity_test.ts
================================================
//Imports
import { expandGlob } from "https://deno.land/std@0.119.0/fs/mod.ts";
import { assert } from "https://deno.land/std@0.119.0/testing/asserts.ts";
import * as XML from "https://deno.land/x/xml@2.0.3/mod.ts";
import { extname } from "https://deno.land/std@0.119.0/path/mod.ts";
//Ensure files are parsable
for (const glob of ["{maps,copyrighted}/**/*.{tmx,tsx,tps,json}", "app/public/**/*.json"]) {
for await (const { path, isFile } of expandGlob(glob)) {
if (isFile) {
const file = path.replace(Deno.cwd(), "");
const ext = extname(path).substring(1);
Deno.test(file, async () =>
assert({
json: JSON,
tmx: XML,
tsx: XML,
tps: XML,
}[ext]?.parse(await Deno.readTextFile(path))));
}
}
}
================================================
FILE: copyrighted/README.md
================================================
This folder contains copyrighted materials.
See [pokemon.com/us/legal](https://www.pokemon.com/us/legal/) for more informations.
```
© 2021 Pokémon. © 1995–2021 Nintendo/Creatures Inc./GAME FREAK inc.
Pokémon and Pokémon character names are trademarks of Nintendo.
```
================================================
FILE: copyrighted/textures/all/worldmap.json
================================================
{"frames": {
"worldmap/0":
{
"frame": {"x":0,"y":0,"w":8,"h":8},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":8,"h":8},
"sourceSize": {"w":8,"h":8}
},
"worldmap/1":
{
"frame": {"x":8,"y":0,"w":8,"h":8},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":8,"h":8},
"sourceSize": {"w":8,"h":8}
},
"worldmap/2":
{
"frame": {"x":16,"y":0,"w":8,"h":8},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":8,"h":8},
"sourceSize": {"w":8,"h":8}
},
"worldmap/3":
{
"frame": {"x":24,"y":0,"w":8,"h":8},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":8,"h":8},
"sourceSize": {"w":8,"h":8}
},
"worldmap/4":
{
"frame": {"x":32,"y":0,"w":8,"h":8},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":8,"h":8},
"sourceSize": {"w":8,"h":8}
},
"worldmap/5":
{
"frame": {"x":40,"y":0,"w":8,"h":8},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":8,"h":8},
"sourceSize": {"w":8,"h":8}
},
"worldmap/6":
{
"frame": {"x":48,"y":0,"w":8,"h":8},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":8,"h":8},
"sourceSize": {"w":8,"h":8}
},
"worldmap/7":
{
"frame": {"x":56,"y":0,"w":8,"h":8},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":8,"h":8},
"sourceSize": {"w":8,"h":8}
},
"worldmap/8":
{
"frame": {"x":64,"y":0,"w":8,"h":8},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":8,"h":8},
"sourceSize": {"w":8,"h":8}
},
"worldmap/9":
{
"frame": {"x":72,"y":0,"w":8,"h":8},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":8,"h":8},
"sourceSize": {"w":8,"h":8}
},
"worldmap/10":
{
"frame": {"x":80,"y":0,"w":8,"h":8},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":8,"h":8},
"sourceSize": {"w":8,"h":8}
},
"worldmap/11":
{
"frame": {"x":88,"y":0,"w":8,"h":8},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":8,"h":8},
"sourceSize": {"w":8,"h":8}
},
"worldmap/12":
{
"frame": {"x":96,"y":0,"w":8,"h":8},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":8,"h":8},
"sourceSize": {"w":8,"h":8}
},
"worldmap/13":
{
"frame": {"x":104,"y":0,"w":8,"h":8},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":8,"h":8},
"sourceSize": {"w":8,"h":8}
},
"worldmap/14":
{
"frame": {"x":112,"y":0,"w":8,"h":8},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":8,"h":8},
"sourceSize": {"w":8,"h":8}
},
"worldmap/15":
{
"frame": {"x":120,"y":0,"w":8,"h":8},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":8,"h":8},
"sourceSize": {"w":8,"h":8}
},
"worldmap/16":
{
"frame": {"x":128,"y":0,"w":8,"h":8},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":8,"h":8},
"sourceSize": {"w":8,"h":8}
},
"worldmap/17":
{
"frame": {"x":136,"y":0,"w":8,"h":8},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":8,"h":8},
"sourceSize": {"w":8,"h":8}
},
"worldmap/18":
{
"frame": {"x":144,"y":0,"w":8,"h":8},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":8,"h":8},
"sourceSize": {"w":8,"h":8}
},
"worldmap/19":
{
"frame": {"x":152,"y":0,"w":8,"h":8},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":8,"h":8},
"sourceSize": {"w":8,"h":8}
},
"worldmap/20":
{
"frame": {"x":160,"y":0,"w":8,"h":8},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":8,"h":8},
"sourceSize": {"w":8,"h":8}
},
"worldmap/21":
{
"frame": {"x":168,"y":0,"w":8,"h":8},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":8,"h":8},
"sourceSize": {"w":8,"h":8}
},
"worldmap/22":
{
"frame": {"x":176,"y":0,"w":8,"h":8},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":8,"h":8},
"sourceSize": {"w":8,"h":8}
},
"worldmap/23":
{
"frame": {"x":184,"y":0,"w":8,"h":8},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":8,"h":8},
"sourceSize": {"w":8,"h":8}
},
"worldmap/24":
{
"frame": {"x":192,"y":0,"w":8,"h":8},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":8,"h":8},
"sourceSize": {"w":8,"h":8}
},
"worldmap/25":
{
"frame": {"x":200,"y":0,"w":8,"h":8},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":8,"h":8},
"sourceSize": {"w":8,"h":8}
},
"worldmap/26":
{
"frame": {"x":208,"y":0,"w":8,"h":8},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":8,"h":8},
"sourceSize": {"w":8,"h":8}
},
"worldmap/27":
{
"frame": {"x":216,"y":0,"w":8,"h":8},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":8,"h":8},
"sourceSize": {"w":8,"h":8}
},
"worldmap/28":
{
"frame": {"x":224,"y":0,"w":8,"h":8},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":8,"h":8},
"sourceSize": {"w":8,"h":8}
},
"worldmap/29":
{
"frame": {"x":232,"y":0,"w":8,"h":8},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":8,"h":8},
"sourceSize": {"w":8,"h":8}
},
"worldmap/30":
{
"frame": {"x":240,"y":0,"w":8,"h":8},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":8,"h":8},
"sourceSize": {"w":8,"h":8}
},
"worldmap/31":
{
"frame": {"x":248,"y":0,"w":8,"h":8},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":8,"h":8},
"sourceSize": {"w":8,"h":8}
},
"worldmap/32":
{
"frame": {"x":0,"y":8,"w":8,"h":8},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":8,"h":8},
"sourceSize": {"w":8,"h":8}
},
"worldmap/33":
{
"frame": {"x":8,"y":8,"w":8,"h":8},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":8,"h":8},
"sourceSize": {"w":8,"h":8}
},
"worldmap/34":
{
"frame": {"x":16,"y":8,"w":8,"h":8},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":8,"h":8},
"sourceSize": {"w":8,"h":8}
},
"worldmap/35":
{
"frame": {"x":24,"y":8,"w":8,"h":8},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":8,"h":8},
"sourceSize": {"w":8,"h":8}
},
"worldmap/36":
{
"frame": {"x":32,"y":8,"w":8,"h":8},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":8,"h":8},
"sourceSize": {"w":8,"h":8}
},
"worldmap/37":
{
"frame": {"x":40,"y":8,"w":8,"h":8},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":8,"h":8},
"sourceSize": {"w":8,"h":8}
},
"worldmap/38":
{
"frame": {"x":48,"y":8,"w":8,"h":8},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":8,"h":8},
"sourceSize": {"w":8,"h":8}
},
"worldmap/39":
{
"frame": {"x":56,"y":8,"w":8,"h":8},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":8,"h":8},
"sourceSize": {"w":8,"h":8}
},
"worldmap/40":
{
"frame": {"x":64,"y":8,"w":8,"h":8},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":8,"h":8},
"sourceSize": {"w":8,"h":8}
},
"worldmap/41":
{
"frame": {"x":72,"y":8,"w":8,"h":8},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":8,"h":8},
"sourceSize": {"w":8,"h":8}
},
"worldmap/42":
{
"frame": {"x":80,"y":8,"w":8,"h":8},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":8,"h":8},
"sourceSize": {"w":8,"h":8}
},
"worldmap/43":
{
"frame": {"x":88,"y":8,"w":8,"h":8},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":8,"h":8},
"sourceSize": {"w":8,"h":8}
},
"worldmap/44":
{
"frame": {"x":96,"y":8,"w":8,"h":8},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":8,"h":8},
"sourceSize": {"w":8,"h":8}
},
"worldmap/45":
{
"frame": {"x":104,"y":8,"w":8,"h":8},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":8,"h":8},
"sourceSize": {"w":8,"h":8}
},
"worldmap/46":
{
"frame": {"x":112,"y":8,"w":8,"h":8},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":8,"h":8},
"sourceSize": {"w":8,"h":8}
},
"worldmap/47":
{
"frame": {"x":120,"y":8,"w":8,"h":8},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":8,"h":8},
"sourceSize": {"w":8,"h":8}
},
"worldmap/48":
{
"frame": {"x":128,"y":8,"w":8,"h":8},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":8,"h":8},
"sourceSize": {"w":8,"h":8}
},
"
gitextract_95rr8slf/ ├── .devcontainer/ │ ├── Dockerfile │ ├── devcontainer.json │ ├── fluxbox/ │ │ ├── apps │ │ ├── init │ │ └── startup │ ├── library-scripts/ │ │ └── desktop-lite-debian.sh │ └── tiled/ │ └── default.tiled-session ├── .gitattributes ├── .github/ │ ├── ISSUE_TEMPLATE/ │ │ ├── config.yml │ │ └── issue_report.yml │ ├── config/ │ │ ├── codeql.yml │ │ └── labeler.yml │ ├── pull_request_template.md │ └── workflows/ │ ├── build.yml │ └── labeler.yml ├── .gitignore ├── .vscode/ │ └── settings.json ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── app/ │ ├── build/ │ │ ├── build.ts │ │ ├── mod.ts │ │ ├── steps/ │ │ │ ├── 00_clean.ts │ │ │ ├── 10_data.ts │ │ │ ├── 20_maps.ts │ │ │ ├── 21_maps_diff.ts │ │ │ ├── 22_maps_world.ts │ │ │ ├── 30_textures.ts │ │ │ ├── 31_textures_packer.ts │ │ │ ├── 40_assets.ts │ │ │ └── 41_assets_app.ts │ │ └── util.ts │ ├── client/ │ │ ├── css/ │ │ │ └── styles.css │ │ ├── index.html │ │ └── js/ │ │ ├── app/ │ │ │ ├── app.ts │ │ │ ├── controls/ │ │ │ │ └── controller.ts │ │ │ ├── maps/ │ │ │ │ ├── area.ts │ │ │ │ ├── camera.ts │ │ │ │ ├── npc.creature.ts │ │ │ │ ├── npc.human.ts │ │ │ │ ├── npc.ts │ │ │ │ ├── region.ts │ │ │ │ ├── section.ts │ │ │ │ └── world.ts │ │ │ ├── mod.ts │ │ │ ├── rendering/ │ │ │ │ ├── render.ts │ │ │ │ └── renderable.ts │ │ │ └── types.ts │ │ └── loader.js │ └── tests/ │ └── integrity_test.ts ├── copyrighted/ │ ├── README.md │ └── textures/ │ ├── all/ │ │ ├── worldmap.json │ │ ├── worldmap.regions.json │ │ ├── worldmap.regions.tps │ │ ├── worldmap.tps │ │ └── worldmap.tsx │ └── rse/ │ ├── creatures.json │ ├── creatures.tps │ ├── npcs.json │ ├── tileset.json │ ├── tileset.tps │ └── tileset.tsx ├── deno.json ├── maps/ │ ├── all/ │ │ └── worldmap.tmx │ ├── gracidea.world │ └── hoenn/ │ ├── anime-banana-slakoth-garden.tmx │ ├── anime-crossgate-town.tmx │ ├── anime-foothill-town.tmx │ ├── anime-forbidden-forest.tmx │ ├── anime-forina.tmx │ ├── anime-lake-may.tmx │ ├── anime-larousse-city.tmx │ ├── anime-littleroot-port.tmx │ ├── anime-mirage-kingdom.tmx │ ├── anime-misty-village.tmx │ ├── anime-mount-kirikiri.tmx │ ├── anime-north-petalburg.tmx │ ├── anime-oldale-ruins.tmx │ ├── anime-rinshin-town.tmx │ ├── anime-rubello-town.tmx │ ├── anime-shroomish-forest.tmx │ ├── anime-the-greenhouse.tmx │ ├── anime-valley-of-steel.tmx │ ├── anime-volley-town.tmx │ ├── birth-island.tmx │ ├── dewford-town.tmx │ ├── ever-grande-city.tmx │ ├── fallarbor-town.tmx │ ├── faraway-island.tmx │ ├── fill-002.tmx │ ├── fill-003.tmx │ ├── fill-004.tmx │ ├── fill-005.tmx │ ├── fill-006.tmx │ ├── fill-007.tmx │ ├── fill-010.tmx │ ├── fill-011.tmx │ ├── fill-012.tmx │ ├── fill-013.tmx │ ├── fill-014.tmx │ ├── fill-015.tmx │ ├── fill-016.tmx │ ├── fill-017.tmx │ ├── fill-018.tmx │ ├── fill-019.tmx │ ├── fill-020.tmx │ ├── fill-021.tmx │ ├── fill-022.tmx │ ├── fill-023.tmx │ ├── fill-024.tmx │ ├── fill-025.tmx │ ├── fill-026.tmx │ ├── fill-027.tmx │ ├── fill-028.tmx │ ├── fill-029.tmx │ ├── fill-030.tmx │ ├── fill-031.tmx │ ├── fill-032.tmx │ ├── fill-033.tmx │ ├── fill-034.tmx │ ├── fill-035.tmx │ ├── fill-036.tmx │ ├── fill-037.tmx │ ├── fill-038.tmx │ ├── fill-039.tmx │ ├── fill-040.tmx │ ├── fill-041.tmx │ ├── fill-042.tmx │ ├── fill-043.tmx │ ├── fill-044.tmx │ ├── fill-045.tmx │ ├── fill-046.tmx │ ├── fill-047.tmx │ ├── fill-048.tmx │ ├── fill-049.tmx │ ├── fill-050.tmx │ ├── fill-051.tmx │ ├── fill-052.tmx │ ├── fill-053.tmx │ ├── fill-054.tmx │ ├── fill-055.tmx │ ├── fill-056.tmx │ ├── fill-057.tmx │ ├── fill-058.tmx │ ├── fill-059.tmx │ ├── fill-060.tmx │ ├── fortree-city.tmx │ ├── hoenn-route-101.tmx │ ├── hoenn-route-102.tmx │ ├── hoenn-route-103.tmx │ ├── hoenn-route-104.tmx │ ├── hoenn-route-105.tmx │ ├── hoenn-route-106.tmx │ ├── hoenn-route-107.tmx │ ├── hoenn-route-108.tmx │ ├── hoenn-route-109.tmx │ ├── hoenn-route-110.tmx │ ├── hoenn-route-111.tmx │ ├── hoenn-route-112.tmx │ ├── hoenn-route-113.tmx │ ├── hoenn-route-114.tmx │ ├── hoenn-route-115.tmx │ ├── hoenn-route-116.tmx │ ├── hoenn-route-117.tmx │ ├── hoenn-route-118.tmx │ ├── hoenn-route-119.tmx │ ├── hoenn-route-120.tmx │ ├── hoenn-route-121.tmx │ ├── hoenn-route-122.tmx │ ├── hoenn-route-123.tmx │ ├── hoenn-route-124.tmx │ ├── hoenn-route-125.tmx │ ├── hoenn-route-126.tmx │ ├── hoenn-route-127.tmx │ ├── hoenn-route-128.tmx │ ├── hoenn-route-129.tmx │ ├── hoenn-route-130.tmx │ ├── hoenn-route-131.tmx │ ├── hoenn-route-132.tmx │ ├── hoenn-route-133.tmx │ ├── hoenn-route-134.tmx │ ├── hoenn-safari-zone-expansion-north.tmx │ ├── hoenn-safari-zone-expansion-south.tmx │ ├── hoenn-safari-zone-neacro-bike-area.tmx │ ├── hoenn-safari-zone-nwmach-bike-area.tmx │ ├── hoenn-safari-zone-se.tmx │ ├── hoenn-safari-zone-sw.tmx │ ├── lavaridge-town.tmx │ ├── lilycove-city.tmx │ ├── littleroot-town.tmx │ ├── mauville-city.tmx │ ├── mossdeep-city.tmx │ ├── navel-rock.tmx │ ├── oldale-town.tmx │ ├── pacifidlog-town.tmx │ ├── petalburg-city.tmx │ ├── rustboro-city.tmx │ ├── sky-pillar.tmx │ ├── slateport-city.tmx │ ├── southern-island.tmx │ └── verdanturf-town.tmx └── vercel.json
SYMBOL INDEX (148 symbols across 20 files)
FILE: app/build/steps/10_data.ts
type gender (line 121) | type gender = {
type encounters (line 130) | type encounters = {
type location (line 144) | type location = {
FILE: app/build/steps/20_maps.ts
method get (line 9) | get(target, key) {
method sections (line 115) | async sections({ region, filter = "" }: { region: string; filter?: strin...
method section (line 139) | async section({ region, section, locations }: { region: string; section:...
FILE: app/build/steps/21_maps_diff.ts
function pullrequest (line 147) | async function pullrequest() {
FILE: app/build/steps/22_maps_world.ts
type worldmap (line 74) | type worldmap = {
FILE: app/build/steps/30_textures.ts
type types (line 85) | type types = {
FILE: app/build/util.ts
method size (line 17) | get size() {
method step (line 24) | step(text: string) {
method progress (line 27) | progress(text: string) {
method debug (line 30) | debug(text: string) {
method info (line 33) | info(text: string) {
method warn (line 36) | warn(text: string) {
method error (line 39) | error(text: string) {
method success (line 42) | success() {
method skipped (line 45) | skipped() {
function requirements (line 51) | async function requirements() {
function exec (line 68) | async function exec(command: string, { compat = true } = {}) {
function clone (line 86) | async function clone({ repo, dir }: { repo: string; dir: string }) {
function pack (line 96) | async function pack({ pkg, dir }: { pkg: string; dir: string }) {
function crop (line 113) | async function crop({ path, tileset, padding = 2, tilesize = 16 }: { pat...
function clean (line 129) | async function clean({ path }: { path: string }) {
function read (line 140) | async function read<T = parsed>(path: string): Promise<T> {
function save (line 161) | async function save(path: string, data: unknown | Promise<unknown>) {
function exists (line 168) | async function exists(path: string) {
function toArray (line 174) | function toArray<T>(value: T | T[]) {
function calcArea (line 179) | function calcArea(X: number[], Y: number[]) {
function at (line 188) | async function at({ x, y }: { x: number; y: number }) {
function contains (line 214) | function contains({ x = 0, y = 0, width = 0, height = 0, points = [] as ...
type rectangle (line 239) | type rectangle = { id: string; width: number; height: number; x: number;...
type polygon (line 242) | type polygon = { id: string; points: number[] };
type parsed (line 246) | type parsed = any;
FILE: app/client/js/app/app.ts
class App (line 10) | class App {
method setup (line 18) | static async setup() {
method rendering (line 50) | static get rendering() {
method loaded (line 55) | static get loaded() {
method sha (line 60) | static get sha() {
FILE: app/client/js/app/controls/controller.ts
class Controller (line 10) | class Controller {
method constructor (line 14) | constructor({ target }: { target: Renderable }) {
method init (line 23) | async init() {
method focus (line 235) | focus(element: Renderable | null) {
method #scrollers (line 246) | #scrollers() {
method #update (line 279) | #update({ delta }: { delta?: { x: number; y: number } }) {
method camera (line 291) | get camera() {
method cursor (line 302) | get cursor() {
method qs (line 310) | qs(selector: string) {
method element (line 318) | element(tag: string, { class: classes = [] as string | string[], attribu...
FILE: app/client/js/app/maps/area.ts
class Area (line 16) | class Area extends Renderable {
method constructor (line 30) | constructor({ section, data }: { section: Section; data: Data }) {
method destructor (line 39) | destructor() {
method contains (line 46) | contains({ x, y }: { x: number; y: number }) {
method encounters (line 51) | get encounters() {
method update (line 56) | async update({ debug = this.debug.visible, t, dt }: { t: number; dt: n...
type Type (line 93) | const enum Type {
type Data (line 100) | type Data = {
FILE: app/client/js/app/maps/camera.ts
class Camera (line 17) | class Camera extends Renderable {
method constructor (line 22) | constructor({ world }: { world: World }) {
method update (line 37) | async update({ debug = this.debug.visible, t, dt }: { t: number; dt: n...
method intersects (line 95) | private intersects(rectangle: ReturnType<typeof Render.engine.Rectangl...
method place (line 105) | place({ x, y }: { x: number; y: number }) {
method x (line 110) | get x() {
method y (line 115) | get y() {
type Intersection (line 121) | const enum Intersection {
FILE: app/client/js/app/maps/npc.creature.ts
class Creature (line 10) | class Creature extends NPC {
method constructor (line 15) | constructor({ area }: { area: Area }) {
method tracker (line 48) | protected get tracker() {
method refresh (line 53) | protected refresh() {
method action (line 71) | protected action() {
method update (line 76) | async update({ debug = this.debug.visible, t, dt }: { t: number; dt: n...
FILE: app/client/js/app/maps/npc.human.ts
class Human (line 10) | class Human extends NPC {
method constructor (line 15) | constructor({ area }: { area: Area }) {
method init (line 34) | protected async init() {
method tracker (line 83) | protected get tracker() {
method action (line 88) | protected action() {
method update (line 93) | async update({ debug = this.debug.visible, t, dt }: { t: number; dt: n...
type Pattern (line 100) | const enum Pattern {
FILE: app/client/js/app/maps/npc.ts
type Direction (line 9) | const enum Direction {
class NPC (line 20) | class NPC extends Renderable {
method constructor (line 28) | constructor({ area }: { area: Area }) {
method destructor (line 34) | destructor() {
method init (line 40) | protected async init({ frame, random = false }: { frame?: string; rand...
method update (line 115) | async update({ debug = this.debug.visible, t, dt }: { t: number; dt: n...
method x (line 136) | set x(value: number) {
method x (line 139) | get x() {
method y (line 147) | set y(value: number) {
method y (line 150) | get y() {
method moving (line 161) | get moving() {
method refresh (line 166) | protected refresh() {
method action (line 175) | protected action() {
method wander (line 180) | protected wander() {
method move (line 188) | private move({ delta = 1 / 2 ** 4 }: { delta?: number } = {}) {
method direction (line 239) | protected direction({ direction, move = false }: { direction: Directio...
method texture (line 286) | private texture({ suffix = "", fallback = 0 }: { suffix?: string; fall...
method #animate (line 296) | #animate(delta: number, { speed = 4, frames = 3 } = {}) {
method effects (line 312) | protected effects(...effects: string[]) {
FILE: app/client/js/app/maps/region.ts
class Region (line 10) | class Region extends Renderable {
method constructor (line 21) | constructor({ world, id, bounds }: { world: World; id: string; bounds:...
method destructor (line 29) | destructor() {
method init (line 35) | protected async init() {
method load (line 47) | async load(id: string) {
method update (line 54) | async update({ t, dt }: { t: number; dt: number; debug?: boolean }) {
FILE: app/client/js/app/maps/section.ts
class Section (line 11) | class Section extends Renderable {
method constructor (line 22) | constructor({ region, id, bounds }: { region: Region; id: string; boun...
method destructor (line 33) | destructor() {
method init (line 43) | protected async init() {
method load (line 62) | async load() {
method show (line 132) | show() {
type data (line 139) | type data = any;
FILE: app/client/js/app/maps/world.ts
class World (line 12) | class World extends Renderable {
method constructor (line 26) | constructor() {
method init (line 33) | protected async init() {
method #regions (line 39) | async #regions() {
method #map (line 51) | async #map() {
method #coordinates (line 96) | async #coordinates() {
method update (line 112) | async update({ t, dt }: { t: number; dt: number; debug?: boolean }) {
FILE: app/client/js/app/rendering/render.ts
class Render (line 11) | class Render {
method setup (line 19) | protected static async setup({ app }: { app: typeof App }) {
method register (line 79) | static register(renderable: Renderable) {
method unregister (line 86) | static unregister(renderable: Renderable) {
method fps (line 93) | static get fps() {
method Texture (line 115) | static Texture(frame = null as frame) {
method ColorFilter (line 123) | static ColorFilter({ brightness = NaN, saturate = NaN, tint = NaN } = ...
method Polygon (line 138) | static Polygon(points = [] as number[]) {
method Rectangle (line 143) | static Rectangle(points = [] as number[]) {
method Container (line 148) | static Container({ x = 0, y = 0, z = NaN, sorted = false, visible = tr...
method TilingSprite (line 162) | static TilingSprite({ frame = null, x = 0, y = 0, z = NaN, width = 0, ...
method Sprite (line 172) | static Sprite({ frame = null, x = 0, y = 0, z = NaN, alpha = NaN, anch...
method Graphics (line 199) | static Graphics({ z = NaN, stroke, fill, text, textStyle, textPosition...
type Engine (line 252) | type Engine = any;
type Application (line 256) | type Application = any;
type frame (line 259) | type frame = null | string | number | typeof Render.engine.Texture.EMPTY;
type TilingSprite (line 262) | type TilingSprite = {
type Sprite (line 272) | type Sprite = {
type Graphics (line 283) | type Graphics = {
FILE: app/client/js/app/rendering/renderable.ts
method constructor (line 16) | constructor({ id, x = 0, y = 0, z = 0, visible = true }: { id: string; x...
method destructor (line 33) | destructor() {
method init (line 51) | protected async init({ parent = null }: { parent?: null | Renderable | t...
method show (line 78) | show() {
method hide (line 83) | hide() {
method update (line 88) | async update({ debug = this.debug.visible }: { t: number; dt: number; de...
method dirty (line 108) | protected get dirty() {
FILE: app/client/js/app/types.ts
type event (line 7) | type event = any;
type friend (line 11) | type friend = any;
type rw (line 15) | type rw = any;
FILE: app/client/js/loader.js
function tag (line 3) | function tag(name, attributes) {
method loaded (line 33) | loaded(text = "", type = null, options = {}) {
Condensed preview — 203 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (5,669K chars).
[
{
"path": ".devcontainer/Dockerfile",
"chars": 1679,
"preview": "# OS\nARG VARIANT=bullseye\nFROM --platform=linux/amd64 mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT}\n\n# Deno i"
},
{
"path": ".devcontainer/devcontainer.json",
"chars": 771,
"preview": "{\n\t\"name\": \"Deno\",\n \t\"build\": {\n\t\t\"dockerfile\": \"Dockerfile\",\n\t\t\"args\": {\n\t\t\t\"VARIANT\": \"bullseye\"\n\t\t}\n\t},\n\t\"settings\": "
},
{
"path": ".devcontainer/fluxbox/apps",
"chars": 171,
"preview": "[transient] (role=GtkFileChooserDialog)\n [Dimensions] {70% 70%}\n [Position] (CENTER) {0 0}\n[end]\n[app] (nam"
},
{
"path": ".devcontainer/fluxbox/init",
"chars": 2936,
"preview": "session.screen0.tabs.usePixmap:\ttrue\nsession.screen0.tabs.maxOver:\tfalse\nsession.screen0.tabs.intitlebar:\ttrue\nsession.s"
},
{
"path": ".devcontainer/fluxbox/startup",
"chars": 231,
"preview": "#!/bin/sh\nxmodmap \"/home/vscode/.Xmodmap\"\n\n# Start fbautostart \nwhich fbautostart > /dev/null\nif [ $? -eq 0 ]; then\n "
},
{
"path": ".devcontainer/library-scripts/desktop-lite-debian.sh",
"chars": 12853,
"preview": "#!/usr/bin/env bash\n#---------------------------------------------------------------------------------------------------"
},
{
"path": ".devcontainer/tiled/default.tiled-session",
"chars": 717,
"preview": "{\n \"activeFile\": \"/workspaces/gracidea/maps/hoenn/hoenn-route-101.tmx\",\n \"expandedProjectPaths\": [\n ],\n \"fil"
},
{
"path": ".gitattributes",
"chars": 265,
"preview": "# Auto detect text files and perform LF normalization\n* text=auto\n\n# Linguist ignore\n.github/* linguist-vendored\n*.tps l"
},
{
"path": ".github/ISSUE_TEMPLATE/config.yml",
"chars": 369,
"preview": "blank_issues_enabled: false\ncontact_links:\n - name: 💡 Suggest new features\n url: https://github.com/lowlighter/graci"
},
{
"path": ".github/ISSUE_TEMPLATE/issue_report.yml",
"chars": 2090,
"preview": "name: 📝 Issue report\ndescription: Create a report to help us improve\nbody:\n\n - type: markdown\n attributes:\n val"
},
{
"path": ".github/config/codeql.yml",
"chars": 104,
"preview": "name: CodeQL config\nqueries:\n - uses: security-and-quality\npaths-ignore:\n - copyrighted/**\n - maps/**"
},
{
"path": ".github/config/labeler.yml",
"chars": 686,
"preview": "🗃️ repository:\n - .github/**\n - .gitignore\n - .gitattributes\n - vercel.json\n - README.md\n - CONTRIBUTING.md\n - CO"
},
{
"path": ".github/pull_request_template.md",
"chars": 245,
"preview": "<!--\n\n 👋 Hi there!\n Thanks for contributing to gracidea and helping us to improve!\n\n Please:\n - Read CONTRIBUTING."
},
{
"path": ".github/workflows/build.yml",
"chars": 647,
"preview": "name: 🌺\non:\n push:\n branches:\n - main\n pull_request:\n branches:\n - main\njobs:\n\n fmt-lint-test:\n ru"
},
{
"path": ".github/workflows/labeler.yml",
"chars": 239,
"preview": "name: 🏷️\non:\n - pull_request_target\njobs:\n\n label:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/labeler"
},
{
"path": ".gitignore",
"chars": 34,
"preview": ".vercel\napp/build/cache\napp/public"
},
{
"path": ".vscode/settings.json",
"chars": 205,
"preview": "{\n \"deno.enable\": true,\n \"deno.unstable\": true,\n \"deno.importMap\": \"deno.json\",\n \"deno.config\": \"deno.json\",\n \"deno"
},
{
"path": "CODE_OF_CONDUCT.md",
"chars": 3502,
"preview": "# Contributor Covenant Code of Conduct\n\n## Our Pledge\n\nWe as members, contributors, and leaders pledge to make participa"
},
{
"path": "CONTRIBUTING.md",
"chars": 8765,
"preview": "# 🌺 Contribution guide\n\n> ⚠️ The guidelines of this project are voluntarily strict to avoid any drift, please read caref"
},
{
"path": "LICENSE",
"chars": 34586,
"preview": "GNU AFFERO GENERAL PUBLIC LICENSE\n Version 3, 19 November 2007\n\n Copyright (C) 2007 Free Software "
},
{
"path": "README.md",
"chars": 2215,
"preview": "#  Gracidea - *Pokémon* living web map\n\n\n\n![Build]"
},
{
"path": "app/build/build.ts",
"chars": 1835,
"preview": "//Imports\nimport clean from \"app/build/steps/00_clean.ts\";\nimport data from \"app/build/steps/10_data.ts\";\nimport maps fr"
},
{
"path": "app/build/mod.ts",
"chars": 112,
"preview": "//Imports\nimport { build } from \"app/build/build.ts\";\n\n//Entry point\nif (import.meta.main) {\n await build();\n}\n"
},
{
"path": "app/build/steps/00_clean.ts",
"chars": 297,
"preview": "//Imports\nimport { clean, log } from \"app/build/util.ts\";\n\n/** Clean environment */\nexport default async function () {\n "
},
{
"path": "app/build/steps/10_data.ts",
"chars": 4986,
"preview": "//Imports\nimport { clone, exists, log, read, save } from \"app/build/util.ts\";\nimport { expandGlob } from \"std/fs/mod.ts\""
},
{
"path": "app/build/steps/20_maps.ts",
"chars": 9394,
"preview": "//Imports\nimport { calcArea, exists, log as logger, read, save, toArray } from \"app/build/util.ts\";\nimport { expandGlob "
},
{
"path": "app/build/steps/21_maps_diff.ts",
"chars": 6573,
"preview": "//Imports\nimport { ensureDir, expandGlob } from \"std/fs/mod.ts\";\nimport { copy } from \"std/fs/copy.ts\";\nimport { clone, "
},
{
"path": "app/build/steps/22_maps_world.ts",
"chars": 2913,
"preview": "//Imports\nimport { exists, log, read, save, toArray } from \"app/build/util.ts\";\n\n/** Compute diff */\nexport default asyn"
},
{
"path": "app/build/steps/30_textures.ts",
"chars": 3100,
"preview": "//Imports\nimport { clone, exists, log, read, save, toArray } from \"app/build/util.ts\";\nimport { expandGlob } from \"std/f"
},
{
"path": "app/build/steps/31_textures_packer.ts",
"chars": 961,
"preview": "//Imports\nimport { crop, log } from \"app/build/util.ts\";\nimport { expandGlob } from \"std/fs/mod.ts\";\nimport { basename, "
},
{
"path": "app/build/steps/40_assets.ts",
"chars": 1229,
"preview": "//Imports\nimport { log, read } from \"app/build/util.ts\";\nimport { expandGlob } from \"std/fs/mod.ts\";\nimport { copy } fro"
},
{
"path": "app/build/steps/41_assets_app.ts",
"chars": 653,
"preview": "//Imports\nimport { log, pack } from \"app/build/util.ts\";\nimport { ensureDir } from \"std/fs/mod.ts\";\n\n/** Public assets *"
},
{
"path": "app/build/util.ts",
"chars": 8676,
"preview": "//Imports\nimport argv from \"y/string-argv@0.3.1\";\nimport { bold, cyan, gray, green, italic, red, yellow } from \"std/fmt/"
},
{
"path": "app/client/css/styles.css",
"chars": 3478,
"preview": "body {\n margin: 0;\n padding: 0;\n width: 100vw;\n height: 100vh;\n overflow: hidden;\n font-family: \"Lato\", -apple-sys"
},
{
"path": "app/client/index.html",
"chars": 2029,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-width, in"
},
{
"path": "app/client/js/app/app.ts",
"chars": 2580,
"preview": "//Imports\nimport type { friend } from \"app/client/types.ts\";\nimport { global } from \"app/client/types.ts\";\nimport { defe"
},
{
"path": "app/client/js/app/controls/controller.ts",
"chars": 11773,
"preview": "//Imports\nimport type { Renderable } from \"app/client/rendering/renderable.ts\";\nimport type { event } from \"app/client/t"
},
{
"path": "app/client/js/app/maps/area.ts",
"chars": 3194,
"preview": "//Imports\nimport { App } from \"app/client/app.ts\";\nimport { Render } from \"app/client/rendering/render.ts\";\nimport { Ren"
},
{
"path": "app/client/js/app/maps/camera.ts",
"chars": 4269,
"preview": "//Imports\nimport { global } from \"app/client/types.ts\";\nimport { Render } from \"app/client/rendering/render.ts\";\nimport "
},
{
"path": "app/client/js/app/maps/npc.creature.ts",
"chars": 2112,
"preview": "//Imports\nimport type { Area } from \"app/client/maps/area.ts\";\nimport { App } from \"app/client/app.ts\";\nimport { NPC } f"
},
{
"path": "app/client/js/app/maps/npc.human.ts",
"chars": 3001,
"preview": "//Imports\nimport type { Area } from \"app/client/maps/area.ts\";\nimport type { rw } from \"app/client/types.ts\";\nimport { N"
},
{
"path": "app/client/js/app/maps/npc.ts",
"chars": 9375,
"preview": "//Imports\nimport type { Area } from \"app/client/maps/area.ts\";\nimport { Renderable } from \"app/client/rendering/renderab"
},
{
"path": "app/client/js/app/maps/region.ts",
"chars": 1668,
"preview": "//Imports\nimport type { World } from \"app/client/maps/world.ts\";\nimport { Section } from \"app/client/maps/section.ts\";\ni"
},
{
"path": "app/client/js/app/maps/section.ts",
"chars": 4211,
"preview": "//Imports\nimport { Render } from \"app/client/rendering/render.ts\";\nimport type { Region } from \"app/client/maps/region.t"
},
{
"path": "app/client/js/app/maps/world.ts",
"chars": 5475,
"preview": "//Imports\nimport { App } from \"app/client/app.ts\";\nimport { Renderable } from \"app/client/rendering/renderable.ts\";\nimpo"
},
{
"path": "app/client/js/app/mod.ts",
"chars": 268,
"preview": "/**\n * Copyright Simon Lecoq (@lowlighter)\n * @license https://github.com/lowlighter/gracidea/blob/main/LICENSE\n */\n\n//I"
},
{
"path": "app/client/js/app/rendering/render.ts",
"chars": 8838,
"preview": "//Imports\nimport * as PIXI from \"app/cache/pixi.js\";\nimport { global } from \"app/client/types.ts\";\nimport type { App } f"
},
{
"path": "app/client/js/app/rendering/renderable.ts",
"chars": 4102,
"preview": "//Imports\nimport { Render } from \"app/client/rendering/render.ts\";\nimport { App } from \"app/client/app.ts\";\nimport type "
},
{
"path": "app/client/js/app/types.ts",
"chars": 338,
"preview": "/** Window */\n//deno-lint-ignore no-explicit-any\nexport const global = globalThis as any;\n\n/** DOM event */\n//deno-lint-"
},
{
"path": "app/client/js/loader.js",
"chars": 2570,
"preview": "(function () {\n /** Create a new HTML element */\n function tag(name, attributes) {\n const element = document.create"
},
{
"path": "app/tests/integrity_test.ts",
"chars": 780,
"preview": "//Imports\nimport { expandGlob } from \"https://deno.land/std@0.119.0/fs/mod.ts\";\nimport { assert } from \"https://deno.lan"
},
{
"path": "copyrighted/README.md",
"chars": 269,
"preview": "This folder contains copyrighted materials.\nSee [pokemon.com/us/legal](https://www.pokemon.com/us/legal/) for more infor"
},
{
"path": "copyrighted/textures/all/worldmap.json",
"chars": 180540,
"preview": "{\"frames\": {\n\n\"worldmap/0\":\n{\n\t\"frame\": {\"x\":0,\"y\":0,\"w\":8,\"h\":8},\n\t\"rotated\": false,\n\t\"trimmed\": false,\n\t\"spriteSourceS"
},
{
"path": "copyrighted/textures/all/worldmap.regions.json",
"chars": 727,
"preview": "{\"frames\": {\n\n\"regions/hoenn\":\n{\n\t\"frame\": {\"x\":1,\"y\":1,\"w\":494,\"h\":308},\n\t\"rotated\": false,\n\t\"trimmed\": false,\n\t\"sprite"
},
{
"path": "copyrighted/textures/all/worldmap.regions.tps",
"chars": 8331,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<data version=\"1.0\">\n <struct type=\"Settings\">\n <key>fileFormatVersion<"
},
{
"path": "copyrighted/textures/all/worldmap.tps",
"chars": 99761,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<data version=\"1.0\">\n <struct type=\"Settings\">\n <key>fileFormatVersion<"
},
{
"path": "copyrighted/textures/all/worldmap.tsx",
"chars": 227,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<tileset version=\"1.5\" tiledversion=\"1.7.2\" name=\"worldmap\" tilewidth=\"8\" tilehei"
},
{
"path": "copyrighted/textures/rse/creatures.json",
"chars": 501154,
"preview": "{\"frames\": {\n\n\"egg-manaphy\":\n{\n\t\"frame\": {\"x\":1948,\"y\":900,\"w\":14,\"h\":17},\n\t\"rotated\": true,\n\t\"trimmed\": true,\n\t\"spriteS"
},
{
"path": "copyrighted/textures/rse/creatures.tps",
"chars": 280713,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<data version=\"1.0\">\n <struct type=\"Settings\">\n <key>fileFormatVersion<"
},
{
"path": "copyrighted/textures/rse/npcs.json",
"chars": 131463,
"preview": "{\"frames\": {\n\n\"ace_trainer_down_0\":\n{\n\t\"frame\": {\"x\":256,\"y\":113,\"w\":14,\"h\":20},\n\t\"rotated\": true,\n\t\"trimmed\": false,\n\t\""
},
{
"path": "copyrighted/textures/rse/tileset.json",
"chars": 1108638,
"preview": "{\"frames\": {\n\n\"0\":\n{\n\t\"frame\": {\"x\":1,\"y\":1,\"w\":16,\"h\":16},\n\t\"rotated\": false,\n\t\"trimmed\": false,\n\t\"spriteSourceSize\": {"
},
{
"path": "copyrighted/textures/rse/tileset.tps",
"chars": 602356,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<data version=\"1.0\">\n <struct type=\"Settings\">\n <key>fileFormatVersion<"
},
{
"path": "copyrighted/textures/rse/tileset.tsx",
"chars": 1018,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<tileset version=\"1.5\" tiledversion=\"1.7.2\" name=\"overworld\" tilewidth=\"16\" tileh"
},
{
"path": "deno.json",
"chars": 2092,
"preview": "{\n \"meta\":{\n \"author\": \"lowlighter (Simon Lecoq)\",\n \"repository\":\"https://github.com/lowlighter/gracidea\",\n \"l"
},
{
"path": "maps/all/worldmap.tmx",
"chars": 145590,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/gracidea.world",
"chars": 23342,
"preview": "{\n \"maps\": [\n {\n \"fileName\": \"hoenn/hoenn-route-101.tmx\",\n \"height\": 512,\n \"w"
},
{
"path": "maps/hoenn/anime-banana-slakoth-garden.tmx",
"chars": 1087,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/anime-crossgate-town.tmx",
"chars": 24145,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/anime-foothill-town.tmx",
"chars": 3466,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/anime-forbidden-forest.tmx",
"chars": 11299,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/anime-forina.tmx",
"chars": 7468,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/anime-lake-may.tmx",
"chars": 8196,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/anime-larousse-city.tmx",
"chars": 2271,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/anime-littleroot-port.tmx",
"chars": 9740,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/anime-mirage-kingdom.tmx",
"chars": 30668,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/anime-misty-village.tmx",
"chars": 6204,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/anime-mount-kirikiri.tmx",
"chars": 3698,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/anime-north-petalburg.tmx",
"chars": 8348,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/anime-oldale-ruins.tmx",
"chars": 5934,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/anime-rinshin-town.tmx",
"chars": 12968,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/anime-rubello-town.tmx",
"chars": 10802,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/anime-shroomish-forest.tmx",
"chars": 4390,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/anime-the-greenhouse.tmx",
"chars": 6932,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/anime-valley-of-steel.tmx",
"chars": 15305,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/anime-volley-town.tmx",
"chars": 1812,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/birth-island.tmx",
"chars": 7284,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/dewford-town.tmx",
"chars": 4591,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/ever-grande-city.tmx",
"chars": 37805,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fallarbor-town.tmx",
"chars": 6637,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/faraway-island.tmx",
"chars": 14539,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-002.tmx",
"chars": 6572,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-003.tmx",
"chars": 1307,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-004.tmx",
"chars": 5979,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-005.tmx",
"chars": 20712,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-006.tmx",
"chars": 6280,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-007.tmx",
"chars": 2186,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-010.tmx",
"chars": 14283,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-011.tmx",
"chars": 5485,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-012.tmx",
"chars": 5375,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-013.tmx",
"chars": 3145,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-014.tmx",
"chars": 10464,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-015.tmx",
"chars": 8462,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-016.tmx",
"chars": 10197,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-017.tmx",
"chars": 9322,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-018.tmx",
"chars": 8654,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-019.tmx",
"chars": 13749,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-020.tmx",
"chars": 10172,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-021.tmx",
"chars": 4288,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-022.tmx",
"chars": 15742,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-023.tmx",
"chars": 18849,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-024.tmx",
"chars": 15457,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-025.tmx",
"chars": 7687,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-026.tmx",
"chars": 12829,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-027.tmx",
"chars": 16623,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-028.tmx",
"chars": 14849,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-029.tmx",
"chars": 5314,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-030.tmx",
"chars": 3892,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-031.tmx",
"chars": 14644,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-032.tmx",
"chars": 10079,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-033.tmx",
"chars": 7225,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-034.tmx",
"chars": 11786,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-035.tmx",
"chars": 861,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-036.tmx",
"chars": 4114,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-037.tmx",
"chars": 7431,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-038.tmx",
"chars": 7371,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-039.tmx",
"chars": 7813,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-040.tmx",
"chars": 11082,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-041.tmx",
"chars": 2237,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-042.tmx",
"chars": 2380,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-043.tmx",
"chars": 4430,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-044.tmx",
"chars": 1740,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-045.tmx",
"chars": 3732,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-046.tmx",
"chars": 3124,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-047.tmx",
"chars": 1483,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-048.tmx",
"chars": 3726,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-049.tmx",
"chars": 3092,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-050.tmx",
"chars": 2799,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-051.tmx",
"chars": 6402,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-052.tmx",
"chars": 3718,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-053.tmx",
"chars": 2583,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-054.tmx",
"chars": 5109,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-055.tmx",
"chars": 10546,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-056.tmx",
"chars": 3046,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-057.tmx",
"chars": 6714,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-058.tmx",
"chars": 4608,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-059.tmx",
"chars": 5178,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fill-060.tmx",
"chars": 3446,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/fortree-city.tmx",
"chars": 12571,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/hoenn-route-101.tmx",
"chars": 5584,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/hoenn-route-102.tmx",
"chars": 14158,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/hoenn-route-103.tmx",
"chars": 21099,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/hoenn-route-104.tmx",
"chars": 36650,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/hoenn-route-105.tmx",
"chars": 22406,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/hoenn-route-106.tmx",
"chars": 11812,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/hoenn-route-107.tmx",
"chars": 8825,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/hoenn-route-108.tmx",
"chars": 9114,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/hoenn-route-109.tmx",
"chars": 19330,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/hoenn-route-110.tmx",
"chars": 52991,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/hoenn-route-111.tmx",
"chars": 53197,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/hoenn-route-112.tmx",
"chars": 28576,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/hoenn-route-113.tmx",
"chars": 29152,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/hoenn-route-114.tmx",
"chars": 31991,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/hoenn-route-115.tmx",
"chars": 35256,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/hoenn-route-116.tmx",
"chars": 23126,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/hoenn-route-117.tmx",
"chars": 14852,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/hoenn-route-118.tmx",
"chars": 18346,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/hoenn-route-119.tmx",
"chars": 74668,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/hoenn-route-120.tmx",
"chars": 47812,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/hoenn-route-121.tmx",
"chars": 14910,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/hoenn-route-122.tmx",
"chars": 12192,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/hoenn-route-123.tmx",
"chars": 26256,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/hoenn-route-124.tmx",
"chars": 44068,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/hoenn-route-125.tmx",
"chars": 23642,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/hoenn-route-126.tmx",
"chars": 44181,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/hoenn-route-127.tmx",
"chars": 46521,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/hoenn-route-128.tmx",
"chars": 32795,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/hoenn-route-129.tmx",
"chars": 21036,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/hoenn-route-130.tmx",
"chars": 21030,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/hoenn-route-131.tmx",
"chars": 16830,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/hoenn-route-132.tmx",
"chars": 16265,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/hoenn-route-133.tmx",
"chars": 16629,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/hoenn-route-134.tmx",
"chars": 22858,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/hoenn-safari-zone-expansion-north.tmx",
"chars": 5907,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/hoenn-safari-zone-expansion-south.tmx",
"chars": 6599,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/hoenn-safari-zone-neacro-bike-area.tmx",
"chars": 3749,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/hoenn-safari-zone-nwmach-bike-area.tmx",
"chars": 5112,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/hoenn-safari-zone-se.tmx",
"chars": 5630,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/hoenn-safari-zone-sw.tmx",
"chars": 5771,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/lavaridge-town.tmx",
"chars": 4450,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/lilycove-city.tmx",
"chars": 35885,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/littleroot-town.tmx",
"chars": 5085,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/mauville-city.tmx",
"chars": 8551,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/mossdeep-city.tmx",
"chars": 34975,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/navel-rock.tmx",
"chars": 4524,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/oldale-town.tmx",
"chars": 6350,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/pacifidlog-town.tmx",
"chars": 6933,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/petalburg-city.tmx",
"chars": 12310,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/rustboro-city.tmx",
"chars": 37005,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/sky-pillar.tmx",
"chars": 6549,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
},
{
"path": "maps/hoenn/slateport-city.tmx",
"chars": 25150,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<map version=\"1.5\" tiledversion=\"1.7.2\" orientation=\"orthogonal\" renderorder=\"rig"
}
]
// ... and 3 more files (download for full content)
About this extraction
This page contains the full source code of the lowlighter/gracidea GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 203 files (4.9 MB), approximately 1.3M tokens, and a symbol index with 148 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.