#!/usr/bin/env bash
# Author: chal55rus (Sergey P.)
# type: games
# name: Blood and Soul
# image: bloodandsoul
# info_en: A multiplayer role-playing game featuring a rich combat system and vibrant graphics, inspired by Eastern mythology. Players can choose from various classes, explore unique locations, and battle powerful foes.
# info_ru: Многопользовательская ролевая игра с богатой системой боя и яркой графикой, вдохновленная восточной мифологией. Игроки могут выбирать из различных классов, исследовать уникальные локации и сражаться с могущественными врагами.
########################################################################
export PW_PREFIX_NAME="BLOOD_AND_SOUL"
export LAUNCH_PARAMETERS="/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-"
export PW_AUTOINSTALL_EXE="${PORT_WINE_TMP_PATH}/bs-install.exe"
export PORTWINE_CREATE_SHORTCUT_NAME="Blood and Soul"

start_portproton
if try_download "https://bsclassic.com/files/bs-install.exe" "${PW_AUTOINSTALL_EXE}" no_mirror
then
    pw_run "${PW_AUTOINSTALL_EXE}"
    PW_EXE_FILE="$WINEPREFIX/drive_c/Program Files (x86)/Blood and Soul Classic/launcher.exe"
    pw_create_unique_exe
    try_remove_file "${PW_AUTOINSTALL_EXE}"
    try_remove_file "${PW_EXE_FILE}.ppdb"
    kill_portwine

    portwine_create_shortcut
fi
stop_portproton
