#!/bin/bash
# ============================================================
# doom.sh — Chocolate Doom + Freedoom game data
# ============================================================
# Installs a faithful Doom port and free game data so the
# classic first-person shooter can be played out of the box
# without commercial game files.
#
#   chocolate-doom : a vanilla-accurate source port that
#                    reproduces the original Doom engine
#                    behaviour as closely as possible, including
#                    the original renderer, bugs, and limits.
#
#   freedoom       : free/libre replacement game data (IWAD)
#                    for both Doom 1 (freedoom1.wad) and Doom 2
#                    (freedoom2.wad).  Required to run Chocolate
#                    Doom without owning the commercial IWADs.
#
# Users who own the original Doom IWADs (doom.wad, doom2.wad)
# can use those instead of or alongside freedoom.
#
# This is an optional gaming module; it is not installed by
# default because not all users want games on their system.
# ============================================================

set -euo pipefail
# Load shared logging helpers from the dotfiles lib
source "$(dirname "${BASH_SOURCE[0]}")/../../lib/logging.sh"

# chocolate-doom: faithful vanilla Doom port; freedoom: free game data (playable without IWADs).
# Both are AUR-only (not in the official repos), so install via the AUR helper —
# `pacman -S chocolate-doom freedoom` fails with "target not found".
log "Installing Chocolate Doom and Freedoom data (AUR)..."
yay -S --answerdiff None --answerclean All --noconfirm --needed chocolate-doom freedoom

log "Doom installed."
