linux-game-manager/.scripts/TobyCustom/Project_Brutality_Toby_Demo.sh

32 lines
1.3 KiB
Bash
Raw Normal View History

#!/usr/bin/env bash
# Set the current path to the Doom path required by some OS.
pushd "${doomPath}"
2024-07-31 17:48:58 -04:00
gamePath=~/.local/games/doom
2024-05-02 16:24:20 -04:00
# Set up the pk3 and wad files
gameOption=(
2024-07-31 17:48:58 -04:00
"${gamePath}/TobyAccMod_V${tobyVersion}.pk3"
"$gamePath/Addons/MENU/TobyV${tobyVersion%%-*}_"*
2024-07-31 17:48:58 -04:00
"${gamePath}/Toby-Demo-Level.wad"
2024-08-13 18:24:06 -04:00
"$(find ~/.local/games/doom -name 'PB-Toby-Compatibility-Addon.pk3')"
2024-05-02 16:24:20 -04:00
"$(find /usr/share/games/ -name 'Project_Brutality-master.pk3')"
2024-07-31 17:48:58 -04:00
"$(find ~/.local/games/doom -name 'Project_Brutality-master.pk3')"
)
2024-05-02 16:24:20 -04:00
# Check for and include if present a wad. Some people may not have it.
2024-07-31 17:48:58 -04:00
if [[ -e "${gamePath}/DoomMetalVol7.wad" ]]; then
gameOption+=("${gamePath}/DoomMetalVol7.wad")
elif [[ -e "${gamePath}/DoomMetalVol6.wad" ]]; then
gameOption+=("${gamePath}/DoomMetalVol6.wad")
fi
# Source common variable extensions.
pbrc="$(find "${0%/*}/" -type f -name '.projectbrutalityrc')"
source "${pbrc}"
# Launch the game and pipe things to be spoken through speech-dispatcher.
# This also leaves the console output intact for people who may want to read it.
exec stdbuf -oL ${gzdoom} ${gameOption[@]} | while IFS= read -r l ; do echo "$l" | { grep "${grepStrings[@]}" | grep "${antiGrepStrings[@]}" | sed "${sedStrings[@]}" | spd-say -e ${spd_module} ${spd_pitch} ${spd_rate} ${spd_voice} ${spd_volume} -- > /dev/null 2>&1; }; echo "$l";done