#!/bin/sh
# Spellstorm 1.0.8-alpha: a single-computer match against bots, all in one
# process (no separate server). Extra arguments replace the default match flags;
# `--menu` opens the normal menu instead (pick arena, class, level, bots there).
# Telemetry account, stream and run label live in ../Resources/.local/parseable.env.
cd "$(dirname "$0")/../Resources" || exit 1
mkdir -p "$HOME/.spellstorm"
LOG="$HOME/.spellstorm/last-run.log"
if [ "${1:-}" = "--menu" ]; then
  shift
elif [ "$#" -eq 0 ]; then
  set -- --quickstart --map keep --class wizard --level 25
fi
if [ -t 1 ]; then
  ../MacOS/spellstorm-client "$@" 2>&1 | tee "$LOG"
else
  exec ../MacOS/spellstorm-client "$@" >"$LOG" 2>&1
fi
