-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
104 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
|
||
webVer=$(get_release card-forge/forge) | ||
|
||
source $GITHUB_WORKSPACE/.github/workflows/update_github_script.sh |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Script created by ArcharGelod |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Forge is a "Rules Engine" for the most popular card game Magic: the Gathering. | ||
|
||
Forge creates a unique experience by combining an enormous card library with some RPG elements in Quest mode (comparable to the 'Shandalar', the late 90's PC Game) and Planar Conquest on the mobile version. | ||
Forge also includes a Graphical Map Based game mode called "Adventure Mode", which is more akin to 'Shandalar.' (Only in Mobile UI version) | ||
|
||
Start Forge with Desktop UI: Menu -> Games -> MTG Forge | ||
Start Forge with Mobile UI: Menu -> Games -> MTG Forge Adventure | ||
Start with Desktop UI in terminal: ~/.local/share/mtg-forge/forge.sh | ||
Start with Mobile UI in terminal: ~/.local/share/mtg-forge/forge-mobile.sh | ||
Start Simulation mode in terminal: ~/.local/share/mtg-forge/forge.sh sim | ||
|
||
Forge is open source software released under the GNU Public License and not related in any way with Wizards of the Coast. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
#!/bin/bash | ||
version=forge-1.6.64 | ||
subversion=${version/forge-} # remove "forge-" from string | ||
|
||
game_folder="$HOME/.local/share/mtg-forge" | ||
repo_url="https://github.com/card-forge/forge/releases/download/${version}" | ||
archive_name="forge-gui-desktop-${subversion}.tar.bz2" | ||
|
||
#cleanup | ||
trap "rm -f /tmp/$archive_name; exit" EXIT | ||
|
||
status "Installing Java 17" | ||
case "$__os_id" in | ||
# Raspbian is not reported as a derivative of Debian (no /etc/upstream-release/lsb-release file) | ||
Raspbian | Debian | Kali) | ||
adoptium_installer || exit 1 | ||
install_packages temurin-17-jre || exit 1 | ||
;; | ||
Ubuntu) | ||
install_packages openjdk-17-jre || exit 1 | ||
;; | ||
*) | ||
error "$__os_id appears to be an unsupported OS" | ||
;; | ||
esac | ||
|
||
status "Downloading snapshot archive." | ||
[[ -f "/tmp/$archive_name" ]] && rm -f "/tmp/$archive_name" | ||
wget "$repo_url/$archive_name" --directory-prefix /tmp || error 'Failed to download latest release!' | ||
|
||
# check if folder already exists | ||
if [[ -d "$game_folder" ]]; then | ||
warning "Found existing Forge directory in $game_folder !!!" && echo "It will be moved to /tmp/mtg-forge-old !!!" | ||
mv "$game_folder" /tmp/MTG-Forge-old || error "Failed to move $game_folder directory to /tmp/ !!! Please, move or delete it yourself and then try installing again." | ||
fi | ||
|
||
mkdir "$game_folder" | ||
|
||
status "Extracting the game archive." | ||
tar -xvf "/tmp/forge-gui-desktop-${subversion}.tar.bz2" --directory="$game_folder" || error 'Failed to extract the game archive!' | ||
|
||
# problem: forge-adventure doesn't launch with java versions > 8 | ||
# workaround: create `forge-mobile.sh` script that's a modified copy of `forge.sh` script | ||
status "Creating workaround for adventure shell script." | ||
jarname="$(find "$game_folder" -name 'forge-gui-mobile*.jar' | xargs basename)" | ||
cp "$game_folder/forge.sh" "$game_folder/forge-mobile.sh" | ||
sed -i "s|forge-gui-desktop-.*-jar-with-dependencies.jar|$jarname|" "$game_folder/forge-mobile.sh" | ||
|
||
# create desktop menu entries | ||
echo "[Desktop Entry] | ||
Type=Application | ||
Name=MTG Forge | ||
GenericName=Forge | ||
Comment=Rules Engine for MTG card game. | ||
Path=$game_folder | ||
Exec=$game_folder/forge.sh | ||
Icon=$game_folder/res/skins/default/hd_logo.png | ||
Terminal=false | ||
Categories=Game;Java; | ||
Keywords=MTG;Forge;Adventure;Card;Game;Magic | ||
StartupNotify=true" > "$HOME/.local/share/applications/Forge.desktop" | ||
|
||
echo "[Desktop Entry] | ||
Type=Application | ||
Name=MTG Forge Adventure | ||
GenericName=Forge-mobile | ||
Comment=Mobile UI version of Forge with the Adventure mode. | ||
Path=$game_folder | ||
Exec=$game_folder/forge-mobile.sh | ||
Icon=$game_folder/res/skins/default/adv_logo.png | ||
Terminal=false | ||
Categories=Game;Java; | ||
Keywords=MTG;Forge;Adventure;Card;Game;Magic | ||
StartupNotify=true" > "$HOME/.local/share/applications/Forge-Adventure.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
purge_packages || exit 1 | ||
remove_repofile_if_unused /etc/apt/sources.list.d/adoptium.list | ||
|
||
#remove game folder | ||
rm -rf "$HOME/.local/share/mtg-forge" | ||
|
||
#remove desktop menu entries | ||
rm -f "$HOME/.local/share/applications/Forge.desktop" | ||
rm -f "$HOME/.local/share/applications/Forge-Adventure.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
https://github.com/Card-Forge/forge/wiki |