#!/usr/bin/env bash
# Author: chal55rus
# type: games
# name: Goose Goose Duck
# image: goosegooseduck
# info_en: A multiplayer social deduction game where players take on the roles of ducks or geese, trying to complete tasks and identify the "ducks" — the impostors among them. The game combines elements of strategy and communication, requiring players to coordinate and recognize deception.
# info_ru: Многопользовательская игра в жанре социальной дедукции, где игроки выступают в роли уток или гусей, пытаясь выполнить задания и выявить среди них "уток" — предателей. Игра сочетает в себе элементы стратегии и общения, требуя от игроков координации и способности распознавать обман.
########################################################################
VERSION="3.11.00"
export PW_PREFIX_NAME="GOOSE_GOOSE_DUCK"
export LAUNCH_PARAMETERS="/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-"
export PW_AUTOINSTALL_EXE="${PW_USER_TEMP}/Goose Goose Duck Installer $VERSION release.exe"
export PORTWINE_CREATE_SHORTCUT_NAME="Goose Goose Duck"

start_portwine
if try_download "https://firebasestorage.googleapis.com/v0/b/gaggle-staging.appspot.com/o/Builds%2FGGD%2FGoose%20Goose%20Duck%20Installer%20${VERSION}%20release.exe?alt=media&token=e6c29f8f-bfd8-4592-a740-821aa4cebe00" "${PW_AUTOINSTALL_EXE}" no_mirror
then
    pw_start_progress_bar_install_game "Goose Goose Duck."
    pw_run "${PW_AUTOINSTALL_EXE}"
    portwine_exe="$WINEPREFIX/drive_c/Program Files (x86)/Goose Goose Duck/GGDLauncher.exe"
    try_remove_file "${PW_AUTOINSTALL_EXE}"
    try_remove_file "${portwine_exe}.ppdb"
    kill_portwine
    pw_stop_progress_bar
    portwine_create_shortcut
fi
stop_portwine
