Created
October 11, 2016 15:10
-
-
Save dorkster/2dd11e8b0d071d494c128be7df938045 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Usage: run this script in the root of a Flare mod to update all keys pertaining to primary stats. | |
TITLE_STATS_IN=("physment" "physoff" "physdef" "mentoff" "mentdef" "offdef") | |
TITLE_STATS_OUT=("physical,mental" "physical,offense" "physical,defense" "mental,offense" "mental,defense" "offense,defense") | |
if [ -e "engine/titles.txt" ]; then | |
for i in "${!TITLE_STATS_IN[@]}"; do | |
sed -i -e "s/${TITLE_STATS_IN[i]}/${TITLE_STATS_OUT[i]}/g" "engine/titles.txt" | |
done | |
fi | |
PRIMARY_STATS=("physical" "mental" "offense" "defense") | |
FILENAMES=("engine/classes.txt" "engine/stats.txt" "menus/character.txt") | |
for i in "powers/trees/"*; do | |
FILENAMES+=("$i") | |
done | |
for filename in "${FILENAMES[@]}"; do | |
for i in "${PRIMARY_STATS[@]}"; do | |
if [ -e "$filename" ]; then | |
sed -i -e "s/${i}=/primary=${i},/g" "$filename" | |
fi | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment