#!/bin/sh
# SPDX-License-Identifier: ACSL
# SPDX-FileCopyrightText: © 2024 Antoine Le Gonidec <vv221@dotslashplay.it>
set -o errexit

###
# BallisticNG expansions:
# - Neon Nights
# send your bug reports to vv221@dotslashplay.it
###

script_version=20260414.1

PLAYIT_COMPATIBILITY_LEVEL='2.35'

GAME_ID='ballisticng'
GAME_NAME='BallisticNG'

EXPANSION_ID_NEON='neon-nights'
EXPANSION_NAME_NEON='Neon Nights'

ARCHIVE_BASE_NEON_7_NAME='ballisticng_neon_nights_1_4_1_3_89966.sh'
ARCHIVE_BASE_NEON_7_MD5='75fdc44f845e855ccb5cc54bff8b2b13'
ARCHIVE_BASE_NEON_7_SIZE='100404'
ARCHIVE_BASE_NEON_7_VERSION='1.4.1.3-gog89966'
ARCHIVE_BASE_NEON_7_URL='https://www.gog.com/game/ballisticng_neon_nights'

ARCHIVE_BASE_NEON_6_NAME='ballisticng_neon_nights_1_4_1_2_89013.sh'
ARCHIVE_BASE_NEON_6_MD5='7abe3ec9dff17a204104d99e92070346'
ARCHIVE_BASE_NEON_6_SIZE='100096'
ARCHIVE_BASE_NEON_6_VERSION='1.4.1.2-gog89013'

ARCHIVE_BASE_NEON_5_NAME='ballisticng_neon_nights_1_4_1_1_87257.sh'
ARCHIVE_BASE_NEON_5_MD5='5402d684c341acf18943ceb5baa12eff'
ARCHIVE_BASE_NEON_5_SIZE='100096'
ARCHIVE_BASE_NEON_5_VERSION='1.4.1.1-gog87257'

ARCHIVE_BASE_NEON_4_NAME='ballisticng_neon_nights_1_4_1b_86951.sh'
ARCHIVE_BASE_NEON_4_MD5='0d8a35d1016d5c16e62ee1e6a7cafb84'
ARCHIVE_BASE_NEON_4_SIZE='100096'
ARCHIVE_BASE_NEON_4_VERSION='1.4.1b-gog86951'

ARCHIVE_BASE_NEON_3_NAME='ballisticng_neon_nights_1_4_1_86271.sh'
ARCHIVE_BASE_NEON_3_MD5='a7f2c3344970d5ccf6a7ec0757abee39'
ARCHIVE_BASE_NEON_3_SIZE='100096'
ARCHIVE_BASE_NEON_3_VERSION='1.4.1-gog86271'

ARCHIVE_BASE_NEON_2_NAME='ballisticng_neon_nights_1_4_0_1b_81954.sh'
ARCHIVE_BASE_NEON_2_MD5='5d2391186e508eda373e7caf24eba6f6'
ARCHIVE_BASE_NEON_2_SIZE='100096'
ARCHIVE_BASE_NEON_2_VERSION='1.4.0.1b-gog81954'

ARCHIVE_BASE_NEON_1_NAME='ballisticng_neon_nights_1_4_0_1_81860.sh'
ARCHIVE_BASE_NEON_1_MD5='10d999ef9faeded119f293c6ee8b6d7e'
ARCHIVE_BASE_NEON_1_SIZE='100096'
ARCHIVE_BASE_NEON_1_VERSION='1.4.0.1-gog81860'

ARCHIVE_BASE_NEON_0_NAME='ballisticng_neon_nights_1_3_3_1_69502.sh'
ARCHIVE_BASE_NEON_0_MD5='18897d4477a80a88afe3a05fa52cfee9'
ARCHIVE_BASE_NEON_0_SIZE='100101'
ARCHIVE_BASE_NEON_0_VERSION='1.3.3.1-gog69502'

CONTENT_PATH_DEFAULT='data/noarch/game'
CONTENT_GAME_MAIN_FILES='
DLC'

PKG_PARENT_ID="$GAME_ID"

PKG_MAIN_DEPENDENCIES_SIBLINGS='
PKG_PARENT'

# Load common functions.

if [ -z "$PLAYIT_LIB2" ]; then
	for playit_lib_dir in \
		"$PWD" \
		"${HOME}/.local/lib/play.it" \
		'/usr/local/lib/play.it' \
		'/usr/lib/play.it'
	do
		playit_lib_path="${playit_lib_dir}/libplayit.sh.2"
		if [ -e "$playit_lib_path" ]; then
			PLAYIT_LIB2="$playit_lib_path"
			break
		fi
	done
fi
if [ -z "$PLAYIT_LIB2" ]; then
	printf '\n\033[1;31mError:\033[0m\n'
	printf 'libplayit.sh.2 not found.\n'
	exit 1
fi
# shellcheck source=libplayit.sh.2
. "$PLAYIT_LIB2"

# Run default initialisation actions.

initialization_default "$@"

# Extract game data.

archive_extraction_default

# Include game data.

content_inclusion_default

# Build packages.

packages_generation
print_instructions

# Clean up.

working_directory_cleanup

exit 0
