diff --git a/override/linux32/wbmgt b/override/linux32/wbmgt old mode 100644 new mode 100755 diff --git a/override/linux32/wimgt b/override/linux32/wimgt old mode 100644 new mode 100755 diff --git a/override/linux32/wit b/override/linux32/wit old mode 100644 new mode 100755 diff --git a/override/linux32/wstrt b/override/linux32/wstrt old mode 100644 new mode 100755 diff --git a/override/linux32/wszst b/override/linux32/wszst old mode 100644 new mode 100755 diff --git a/override/linux64/wbmgt b/override/linux64/wbmgt old mode 100644 new mode 100755 diff --git a/override/linux64/wimgt b/override/linux64/wimgt old mode 100644 new mode 100755 diff --git a/override/linux64/wit b/override/linux64/wit old mode 100644 new mode 100755 diff --git a/override/linux64/wstrt b/override/linux64/wstrt old mode 100644 new mode 100755 diff --git a/override/linux64/wszst b/override/linux64/wszst old mode 100644 new mode 100755 diff --git a/patchimage.sh b/patchimage.sh index 868d26b..9a85f59 100755 --- a/patchimage.sh +++ b/patchimage.sh @@ -168,18 +168,14 @@ case ${GAME_TYPE} in TMD_OPTS="--tt-id=K" fi - echo "*** 10) rebuild game" - ${WIT} cp -q -B ${WORKDIR} ${GAMEID}.wbfs --disc-id=${GAMEID} ${TMD_OPTS} --name "${GAMENAME}" || exit 51 - - if [[ -d ${PATCHIMAGE_GAME_DIR} && ${PATCHIMAGE_GAME_DIR} != ${PWD} ]]; then - echo "*** 11) store game" - mv ${GAMEID}.wbfs "${PATCHIMAGE_GAME_DIR}"/ - fi + echo "*** 10) rebuild and store game" + ${WIT} cp -o -q -B ${WORKDIR} -DEST "${PATCHIMAGE_GAME_DIR}"/${GAMEID}.wbfs \ + --disc-id=${GAMEID} ${TMD_OPTS} --name "${GAMENAME}" || exit 51 echo "*** 12) remove workdir" rm -rf ${WORKDIR} - echo -e "\n >>> ${GAMENAME} saved as: ${PATCHIMAGE_WBFS_DIR}/${GAMEID}.wbfs\n" + echo -e "\n >>> ${GAMENAME} saved as: ${PATCHIMAGE_GAME_DIR}/${GAMEID}.wbfs\n" if [[ ${PATCHIMAGE_COVER_DOWNLOAD} == TRUE ]]; then echo -e "\n*** Z) download_covers" diff --git a/script.d/kirbywii.sh b/script.d/kirbywii.sh index e123fa0..88b03b8 100644 --- a/script.d/kirbywii.sh +++ b/script.d/kirbywii.sh @@ -17,6 +17,34 @@ Supported Versions: EUR, JAP, USA PATH_HERO="files/g3d/step/chara/hero/" +exchange_kirby () { + + cp workdir/${PATH_HERO}/kirby/base/${1}.brres.cmp{,_tmp} + cp workdir/${PATH_HERO}/kirby/base/Pink.brres.cmp \ + workdir/${PATH_HERO}/kirby/base/${1}.brres.cmp + mv workdir/${PATH_HERO}/kirby/base/${1}.brres.cmp_tmp \ + workdir/${PATH_HERO}/kirby/base/Pink.brres.cmp + +} + +exchange_hero () { + + cp workdir/${PATH_HERO}/${1}/base/Default.brres.cmp \ + workdir/${PATH_HERO}/kirby/base/Pink.brres.cmp_temp + cp workdir/${PATH_HERO}/kirby/base/Pink.brres.cmp \ + workdir/${PATH_HERO}/${1}/base/Default.brres.cmp + mv workdir/${PATH_HERO}/kirby/base/Pink.brres.cmp{_temp,} + for brres in workdir/${PATH_HERO}/${1}/normal/*.cmp ; do + xfile=${brres##*/} + xpath=${brres%/*} + cp ${brres} workdir/${PATH_HERO}/kirby/normal/${xfile}_temp + cp workdir/${PATH_HERO}/kirby/normal/${xfile} \ + workdir/${PATH_HERO}/${1}/normal/ + mv workdir/${PATH_HERO}/kirby/normal/${xfile}{_temp,} + done + +} + pi_action () { check_input_image_kirby @@ -41,15 +69,15 @@ read ID rm -rf workdir - echo -e "\n*** 3) extracting images" + echo -e "\n*** 3) extracting image" ${WIT} extract ${IMAGE} --psel=data -d workdir -q || exit 51 if [[ ! -d "${PATCHIMAGE_RIIVOLUTION_DIR}"/hero/ ]]; then - echo -e "\n*** 4) this is the first run, so backing up all characters + echo "*** 4) this is the first run, so backing up all characters (in ${PATCHIMAGE_RIIVOLUTION_DIR}) for future customizations" cp -r workdir/${PATH_HERO}/ "${PATCHIMAGE_RIIVOLUTION_DIR}" else - echo -e "\n*** 4) restoring original characters" + echo "*** 4) restoring original characters" cp -r "${PATCHIMAGE_RIIVOLUTION_DIR}"/hero/* workdir/${PATH_HERO}/ fi @@ -63,47 +91,17 @@ read ID [[ ${ID} != 7 ]] && echo "*** 5) exchanging characters" case ${ID} in - 1) cp workdir/${PATH_HERO}/kirby/base/Blue.brres.cmp{,_tmp} - cp workdir/${PATH_HERO}/kirby/base/{Pink,Blue}.brres.cmp - mv workdir/${PATH_HERO}/kirby/base/{Blue.brres.cmp_tmp,Pink.brres.cmp} - ;; - - 2) cp workdir/${PATH_HERO}/kirby/base/Yellow.brres.cmp{,_tmp} - cp workdir/${PATH_HERO}/kirby/base/{Pink,Yellow}.brres.cmp - mv workdir/${PATH_HERO}/kirby/base/{Yellow.brres.cmp_tmp,Pink.brres.cmp} - ;; - - 3) cp workdir/${PATH_HERO}/kirby/base/Green.brres.cmp{,_tmp} - cp workdir/${PATH_HERO}/kirby/base/{Pink,Green}.brres.cmp - mv workdir/${PATH_HERO}/kirby/base/{Green.brres.cmp_tmp,Pink.brres.cmp} - ;; - - 4) cp workdir/${PATH_HERO}/dedede/base/Default.brres.cmp \ - workdir/${PATH_HERO}/kirby/base/Pink.brres.cmp - cp workdir/${PATH_HERO}/dedede/normal/*.cmp \ - workdir/${PATH_HERO}/kirby/normal/ - ;; - - 5) cp workdir/${PATH_HERO}/meta/base/Default.brres.cmp \ - workdir/${PATH_HERO}/kirby/base/Pink.brres.cmp - cp workdir/${PATH_HERO}/meta/normal/*.cmp \ - workdir/${PATH_HERO}/kirby/normal/ - ;; - - 6) cp workdir/${PATH_HERO}/de/base/Default.brres.cmp \ - workdir/${PATH_HERO}/kirby/base/Pink.brres.cmp - cp workdir/${PATH_HERO}/dee/normal/*.cmp \ - workdir/${PATH_HERO}/kirby/normal/ - ;; + 1) exchange_kirby Blue ;; + 2) exchange_kirby Yellow ;; + 3) exchange_kirby Green ;; + 4) exchange_hero dedede ;; + 5) exchange_hero meta ;; + 6) exchange_hero dee ;; esac - echo "*** 6) rebuilding the game" - ${WIT} cp -q -B workdir SUK${REG}01.wbfs || exit 51 - - if [[ -d ${PATCHIMAGE_GAME_DIR} && ${PATCHIMAGE_GAME_DIR} != ${PWD} ]]; then - echo "*** 7) storing game in ${PATCHIMAGE_GAME_DIR}" - mv SUK${REG}01.wbfs "${PATCHIMAGE_GAME_DIR}"/ - fi + echo "*** 6) rebuilding the game " + echo " (storing game in ${PATCHIMAGE_GAME_DIR}/SUK${REG}01.wbfs)" + ${WIT} cp -o -q -B workdir ${PATCHIMAGE_GAME_DIR}/SUK${REG}01.wbfs || exit 51 rm -rf workdir diff --git a/script.d/mkwiimm.sh b/script.d/mkwiimm.sh index 7a7c017..a5da7ec 100644 --- a/script.d/mkwiimm.sh +++ b/script.d/mkwiimm.sh @@ -89,7 +89,7 @@ PRIV_SAVEGAME=${MKWIIMM_OWN_SAVE}" > ${PWD}/config.def echo "patching >${DIST}< to use custom server..." ${WIT} cp ${PWD}/RMC${REG}${ID}.wbfs --DEST \ ${PATCHIMAGE_GAME_DIR}/RMC${REG}${ID}.wbfs \ - --update --psel=data --wiimmfi >/dev/null + --update --psel=data --wiimmfi -q -o echo "cleaning up workdir..." cd .. diff --git a/script.d/wiimmfi_generic.sh b/script.d/wiimmfi_generic.sh index ec5c6e6..3ea4659 100644 --- a/script.d/wiimmfi_generic.sh +++ b/script.d/wiimmfi_generic.sh @@ -48,8 +48,7 @@ patch_wiimm () { fi cp -v ${GAMEDIR}/${ID} . 2>/dev/null - ${WIT} cp ${ID} --DEST wiimmfi-images/ --update --psel=data --wiimmfi >/dev/null - mv -v ./wiimmfi-images/${ID} "${PATCHIMAGE_GAME_DIR}"/ + ${WIT} cp -o ${ID} --DEST "${PATCHIMAGE_GAME_DIR}"/${ID} --update --psel=data --wiimmfi >/dev/null rm -f ${ID} if [[ ${PATCHIMAGE_COVER_DOWNLOAD} == TRUE ]]; then @@ -57,6 +56,4 @@ patch_wiimm () { download_covers ${ID/.*} fi - rmdir wiimmfi-images/ - }