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

###
# Endzone: A World Apart expansions:
# - Halloween
# send your bug reports to bugs@dotslashplay.it
###

script_version=20260331.1

PLAYIT_COMPATIBILITY_LEVEL='2.35'

GAME_ID='endzone-1'
GAME_NAME='Endzone: A World Apart'

EXPANSION_ID_HALLOWEEN='halloween'
EXPANSION_NAME_HALLOWEEN='Halloween'

# Halloween

ARCHIVE_BASE_HALLOWEEN_FR_0_NAME='setup_endzone_-_a_world_apart_happy_halloween_1.2.8630.30586_(french_64bit)_(66949).exe'
ARCHIVE_BASE_HALLOWEEN_FR_0_MD5='f50c8540bc740a57d4b430c92d608160'
ARCHIVE_BASE_HALLOWEEN_FR_0_TYPE='innosetup'
ARCHIVE_BASE_HALLOWEEN_FR_0_SIZE='26268'
ARCHIVE_BASE_HALLOWEEN_FR_0_VERSION='1.2.8630.30586-gog66949'
ARCHIVE_BASE_HALLOWEEN_FR_0_URL='https://www.gog.com/game/endzone_a_world_apart_halloween'

ARCHIVE_BASE_HALLOWEEN_EN_0_NAME='setup_endzone_-_a_world_apart_happy_halloween_1.2.8630.30586_(64bit)_(66949).exe'
ARCHIVE_BASE_HALLOWEEN_EN_0_MD5='377587121fed6ba7f8a2d914cdbfdbf7'
ARCHIVE_BASE_HALLOWEEN_EN_0_TYPE='innosetup'
ARCHIVE_BASE_HALLOWEEN_EN_0_SIZE='26268'
ARCHIVE_BASE_HALLOWEEN_EN_0_VERSION='1.2.8630.30586-gog66949'
ARCHIVE_BASE_HALLOWEEN_EN_0_URL='https://www.gog.com/game/endzone_a_world_apart_halloween'

CONTENT_PATH_DEFAULT='.'
CONTENT_GAME_MAIN_FILES='
Mods'

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
