simplify_challenges.sh 882 B

12345678910111213141516171819202122232425262728
  1. #!/bin/bash
  2. # This script simplifies all challenges by removing any time
  3. # limit, position requirement, etc, and setting the number
  4. # of laps to 0. This is meant to quickly test the story
  5. # mode without having to fully play all challenges.
  6. for i in data/challenges/*.challenge; do
  7. echo "Simplifying $i"
  8. cat $i | sed 's/position="[0-9]*"/position="99"/' \
  9. | sed 's/laps="[0-9]*"/laps="0"/' \
  10. | sed 's/energy="[0-9]*"/energy="0"/' \
  11. | sed 's/time="[0-9]*"/time="9999"/' \
  12. > $i.new
  13. mv $i.new $i
  14. done
  15. for i in data/grandprix/*.grandprix; do
  16. echo "Simplyfing GP $i"
  17. cat $i | sed 's/laps="[0-9]*"/laps="0"/' > $i.new
  18. mv $i.new $i
  19. done
  20. echo
  21. echo "All challenges simplified."
  22. echo "PLEASE do not commit the changes back to our repository!"
  23. echo "========================================================"