Advertisement
PhysixCat

prboomplus_launcher

Aug 27th, 2019
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.18 KB | None | 0 0
  1. #!/bin/bash
  2. # PRBoom+ launching script
  3. # Author: PhysixCat
  4.  
  5. # Ask user for desired map
  6. printf '\e[1m%s\e[0m\n' "PRBoom+ launching script"
  7. printf '\n'
  8. read -r -p 'wad?'$'\n> ' map
  9.  
  10. case $map in
  11.     doomu|tnt|plutonia)
  12.         iwad="$map"
  13.         ;;
  14.     sigil)
  15.         iwad='doomu'
  16.         postpatch='sigil_compat'
  17.         ;;
  18.     '')
  19.         printf '%s\n' "DOOM 2"
  20.         ;;
  21. esac
  22.  
  23. [[ "$iwad" == "$map" ]] && unset map
  24. [[ "$iwad" == 'doomu' ]] && prepatch='d1_sprite_fix19' || prepatch='d2_sprite_fix19'
  25. [[ "$iwad" == 'plutonia' ]] && musicaddon='plutmidi'
  26.  
  27. # Report on assigned map, add postpatches
  28. case $map in
  29.     ayy|ayylmao|aaliens)
  30.         map='aaliens'
  31.         postpatch='d2_sprite_fix_aaliens'
  32.         printf '%s\n' "Ancient Aliens by skillsaw (Paul DeBruyne)"
  33.         ;;
  34. esac
  35.  
  36. extra=( 'doomsfx' 'dssecret' )
  37. printf '\n'
  38.  
  39. # Ask user for cvars
  40. read -r -p 'map# & cvars?'$'\n> ' -a cvars_raw
  41. [[ -n "${cvars_raw[*]}" ]] && cvars=( '-warp' "${cvars_raw[*]}" )
  42.  
  43. # Start PRBoom+ with the selected variables
  44. if [[ -z "$iwad" ]]; then
  45.     prb_arguments=( '-file' "$prepatch" "$map" "$postpatch" "${extra[@]}" "$musicaddon" "${cvars[@]}" )
  46. else
  47.     prb_arguments=( '-iwad' "$iwad" '-file' "$prepatch" "$map" "$postpatch" "${extra[@]}" "$musicaddon" "${cvars[@]}" )
  48. fi
  49. #printf '\n%s' "iwad=[$iwad]" "prepatch=[$prepatch]" "map=[$map]" "postpatch=[$postpatch]" "extra=[${extra[*]}]" "musicaddon=[$musicaddon]" "cvars=[${cvars[*]}]"
  50. printf '\n'
  51. printf '\e[1m%s\e[0m' "here we go..."
  52. printf '\n%s\n\n' "prboom-plus ${prb_arguments[*]}" | tr -s ' '
  53. $(printf '%s' "prboom-plus ${prb_arguments[*]}" | tr -s ' ')
  54.  
  55. # Copyright 2019 PhysixCat
  56.  
  57. # Licensed under the Apache License, Version 2.0 (the "License");
  58. # you may not use this file except in compliance with the License.
  59. # You may obtain a copy of the License at
  60.  
  61. # http://www.apache.org/licenses/LICENSE-2.0
  62.  
  63. # Unless required by applicable law or agreed to in writing, software
  64. # distributed under the License is distributed on an "AS IS" BASIS,
  65. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  66. # See the License for the specific language governing permissions and
  67. # limitations under the License.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement