-
Notifications
You must be signed in to change notification settings - Fork 208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add MTG Forge game #2640
Open
janAkali
wants to merge
1
commit into
Botspot:master
Choose a base branch
from
janAkali:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
add MTG Forge game #2640
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the goal here? if the program doesn't launch with java > 8 then why are you installing java 17?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the app itself does work with java version > 8, but iirc launch scripts for "adventure" mode doesn't have proper flags so it just fails.
Why not just install java 8? Because it doesn't work with java 8 😂. Forge needs a java fx library that's not available in free (as in freedom) builds of java 8, apparently it has support only for official oracle's build of java 8 and that's certainly harder to legally obtain.
Maybe it's possible to make it work with java 8 on linux, but with my limited knowledge of java - I couldn't. But all other versions of java should be supported, I chose java 17 because most software in pi-apps use that version, so good chances that it will be already installed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you link an upstream bug report for that issue (or PR to fix it if one is open). If it's just bad flags it would be better to have it corrected upstream.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's my issue from 1+ year ago - Card-Forge/forge#2221, it was marked as stale and closed. Note, that I was absolutely unfamiliar with git at that time.
Looking at it now, I could try to submit PR that fixes the issue and we will see if it gets somewhere 😅.