48 lines
1.7 KiB
Bash
Executable File
48 lines
1.7 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# Set the current path to the Doom path required by some OS.
|
|
pushd "${doomPath}"
|
|
|
|
# Set up the pk3 and wad files
|
|
gameOption=(
|
|
"$(find /usr/share/games/ -name 'Project_Brutality-master.pk3')"
|
|
"${doomPath}/TobyAccMod_V${tobyVersion}.pk3"
|
|
"${doomPath}/PB-Toby-Compatibility-Addon.pk3"
|
|
"${doomPath}/Toby-Universal-Pickup-Beacon-Prototype.pk3"
|
|
"${doomPath}/OpMDK.wad"
|
|
)
|
|
|
|
# Check for and include if present a wad. Some people may not have it.
|
|
if [[ -e "${doomPath}/DoomMetalVol7.wad" ]]; then
|
|
gameOption+=("${doomPath}/DoomMetalVol7.wad")
|
|
elif [[ -e "${doomPath}/DoomMetalVol6.wad" ]]; then
|
|
gameOption+=("${doomPath}/DoomMetalVol6.wad")
|
|
fi
|
|
|
|
# Extend the search for new messages to be read.
|
|
grepStrings+=('-e' 'New PDA Entry:'
|
|
'-e' '^\*\*\* Brutality Bonus awarded!'
|
|
'-e' ' died.'
|
|
'-e' 'Ectoplasmic Surge!'
|
|
'-e' '^Game Saved.'
|
|
'-e' ' has been '
|
|
'-e' '^(Armor|Health) boosted!'
|
|
'-e' 'Lesser demon energy'
|
|
'-e' '^Found '
|
|
'-e' 'Got the '
|
|
'-e' 'Picked up '
|
|
'-e' '^(Mega|Soul)sphere$'
|
|
'-e' '^Took '
|
|
'-e' ' (SPLATTERED|was) .*(\.|!)'
|
|
'-e' '^Vanguard of the gods!$'
|
|
'-e' "You've found "
|
|
'-e' 'You (collected|got|found|picked up) ')
|
|
|
|
antiGrepStrings+=('-e' 'key card'
|
|
'-e' ' was .*\?'
|
|
)
|
|
|
|
# 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
|