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

51 lines
1.8 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-05-02 16:24:20 -04:00
# Set up the pk3 and wad files
gameOption=(
"${doomPath}/TobyAccMod_V${tobyVersion}.pk3"
2024-05-02 16:24:20 -04:00
"${doomPath}/PB-Toby-Compatibility-Addon.pk3"
"${doomPath}/Toby-Universal-Pickup-Beacon-Prototype.pk3"
"${doomPath}/Toby-Demo-Level.wad"
2024-05-02 16:24:20 -04:00
"$(find /usr/share/games/ -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.
if [[ -e "${doomPath}/DoomMetalVol7.wad" ]]; then
2024-05-02 16:24:20 -04:00
gameOption+=("${doomPath}/DoomMetalVol7.wad")
elif [[ -e "${doomPath}/DoomMetalVol6.wad" ]]; then
2024-05-02 16:24:20 -04:00
gameOption+=("${doomPath}/DoomMetalVol6.wad")
fi
# Extend the search for new messages to be read.
2024-05-02 16:24:20 -04:00
grepStrings+=('-e' '^\*\*\* Brutality Bonus awarded!'
2024-04-16 04:39:07 -04:00
'-e' ' died.'
2024-05-02 16:24:20 -04:00
'-e' 'Ectoplasmic Surge!'
'-e' '^Game Saved.'
'-e' ' has been '
2024-05-02 16:24:20 -04:00
'-e' '^(Armor|Health) boosted!'
2024-04-16 03:23:59 -04:00
'-e' 'Lesser demon energy'
2024-05-02 16:24:20 -04:00
'-e' '^Found '
2024-04-16 03:23:59 -04:00
'-e' 'Got the '
2024-05-02 16:24:20 -04:00
'-e' ' killed (her|him|it)self(\.|!)'
'-e' 'Picked up '
'-e' '^(Mega|Soul)sphere$'
'-e' ' skeleton key secured!$'
'-e' ' (SPLATTERED|was) .*(\.|!)'
'-e' '^Took '
'-e' '^Vanguard of the gods!$'
2024-04-16 03:23:59 -04:00
'-e' "You've found "
2024-05-02 16:24:20 -04:00
'-e' 'You (collected|got|found|picked up) ')
antiGrepStrings+=('-e' 'key card'
'-e' ' was .*\?'
)
sedStrings+=('-e' 's/*\{3\}//g')
# 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