2024-04-15 20:33:58 -04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2024-04-16 02:07:35 -04:00
|
|
|
# Set the current path to the Doom path required by some OS.
|
|
|
|
pushd "${doomPath}"
|
|
|
|
|
2024-04-15 20:33:58 -04:00
|
|
|
# Add all the TobyDoom stuff we need, exclude things we do not.
|
|
|
|
mapfile -t addons < <(find "${doomPath}/Addons/" -type f -iname "TobyV${tobyVersion%%-*}_*" \
|
|
|
|
-not -iname "TobyV${tobyVersion%%-*}_Decorations.pk3" \
|
2024-04-16 02:07:35 -04:00
|
|
|
-not -iname "TobyV${tobyVersion%%-*}_Monsters.pk3"
|
2024-04-15 20:33:58 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
# Set up the pk3 and wad files
|
|
|
|
gameOption=(
|
|
|
|
"$(find /usr/share/games/ -name 'Project_Brutality-master.pk3')"
|
|
|
|
"${doomPath}/TobyAccMod_V${tobyVersion}.pk3"
|
|
|
|
${addons[@]}
|
|
|
|
"${doomPath}/Toby-Demo-Level.wad"
|
|
|
|
)
|
|
|
|
|
|
|
|
# Check for and include if present a wad. Some people may not have it.
|
2024-04-18 16:26:42 -04:00
|
|
|
if [[ -e "${doomPath}/DoomMetalVol7.wad" ]]; then
|
|
|
|
gameOption+=" DoomMetalVol7.wad"
|
|
|
|
elif [[ -e "${doomPath}/DoomMetalVol6.wad" ]]; then
|
|
|
|
gameOption+=" DoomMetalVol6.wad"
|
2024-04-15 20:33:58 -04:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Extend the search for new messages to be read.
|
2024-04-16 03:23:59 -04:00
|
|
|
grepStrings+=('-e' 'New PDA Entry:'
|
2024-04-16 04:39:07 -04:00
|
|
|
'-e' ' died.'
|
2024-04-17 03:27:42 -04:00
|
|
|
'-e' ' has been '
|
2024-04-16 03:23:59 -04:00
|
|
|
'-e' 'Lesser demon energy'
|
|
|
|
'-e' 'Got the '
|
2024-04-18 11:42:35 -04:00
|
|
|
'-e' '^\([^?]*\)\(was\)\([^?]*\)$'
|
2024-04-16 03:23:59 -04:00
|
|
|
'-e' "You've found "
|
|
|
|
'-e' 'Slot ')
|
2024-04-15 20:33:58 -04:00
|
|
|
|
|
|
|
# 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
|