https://github.com/facundoolano/rpg-cli Skip to content Sign up * Why GitHub? Features - + Mobile - + Actions - + Codespaces - + Packages - + Security - + Code review - + Project management - + Integrations - + GitHub Sponsors - + Customer stories- * Team * Enterprise * Explore + Explore GitHub - Learn and contribute + Topics - + Collections - + Trending - + Learning Lab - + Open source guides - Connect with others + The ReadME Project - + Events - + Community forum - + GitHub Education - + GitHub Stars program - * Marketplace * Pricing Plans - + Compare plans - + Contact Sales - + Education - [ ] [search-key] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} facundoolano / rpg-cli * Notifications * Star 541 * Fork 11 Your filesystem as a dungeon! MIT License 541 stars 11 forks Star Notifications * Code * Issues 6 * Pull requests 0 * Actions * Projects 0 * Wiki * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Wiki * Security * Insights main Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags 1 branch 2 tags Code Clone HTTPS GitHub CLI [https://github.com/f] Use Git or checkout with SVN using the web URL. [gh repo clone facund] Work fast with our official CLI. Learn more. * Open with GitHub Desktop * Download ZIP Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Go back Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Go back Launching Xcode If nothing happens, download Xcode and try again. Go back Launching Visual Studio Code Your codespace will open once ready. There was a problem preparing your codespace, please try again. Latest commit @jonathanmorley @facundoolano jonathanmorley and facundoolano Improve cd replacement docs (#28) ... 6e5d920 May 26, 2021 Improve cd replacement docs (#28) * Improve cd replacement docs Actually set the cd command in the example. Use `builtin` to prevent recursion * preserve both cd examples Co-authored-by: Facundo Olano 6e5d920 Git stats * 83 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time src sort printed items, fixes #15 May 26, 2021 .gitignore check in Cargo.lock, fixes #26 May 26, 2021 .travis.yml Add .travis.yml May 4, 2021 Cargo.lock check in Cargo.lock, fixes #26 May 26, 2021 Cargo.toml update version in toml May 24, 2021 LICENSE Initial commit Apr 23, 2021 README.md Improve cd replacement docs (#28) May 26, 2021 rpg-cli.png update image May 20, 2021 View code rpg-cli --your filesystem as a dungeon! Setup Installing from binary Installing with Cargo Use as a cd replacement (recommended) Troubleshooting Usage README.md rpg-cli --your filesystem as a dungeon! rpg-cli is a bare-bones JRPG-inspired terminal game written in Rust. It can work as an alternative to cd where you randomly encounter enemies as you change directories. [rpg-cli] Features: * Automatic turn-based combat. * 15+ enemy classes. * Character stats and leveling system. * Basic item and equipment support. * Permadeath with item recovering. * Run and bribe to escape battles. Setup Installing from binary Just download the binary for your platform (linux/macOS) from the GitHub releases page. Installing with Cargo Assuming you have Rust and Cargo installed: $ cargo install --git https://github.com/facundoolano/rpg-cli --branch main The binary should be available as rpg-cli (assuming you have ~/.cargo /bin in your $PATH). Use as a cd replacement (recommended) Once the binary is installed with one of the methods described above, it can be wrapped on a shell function or alias so the working directory is updated to track to the hero's progress. You can set that up by adding something like this to your .bashrc: rpg () { rpg-cli "$@" cd "$(rpg-cli --pwd)" } This assumes rpg-cli is in your path, update with the specific location if not. You can source ~/.bashrc to apply the change without opening a new shell. Or, if you want to go all the way and really use it in place of cd: cd () { rpg-cli "$@" builtin cd "$(rpg-cli --pwd)" } Troubleshooting * The program doesn't currently work in Windows (since I don't have a dev environment handy for that platform). If you have input on how to fix it, please comment here. Patches are very welcome as well. * The release binary for macOS is not signed. To open it for the first time, right click on the binary and select "Open" from the menu. Usage The first time you run the program, a new hero is created at the user's home directory. ~ $ rpg hero[1]@home hp:[xxxxxxxxxx] 25/25 xp:[----------] 0/30 att:10 def:0 spd:5 equip:{} item:{} 0g When running without parameters, as above, the hero status is printed (health points, accumulated experience, etc.). If you pass in a path as parameter, that will instruct the hero to move: ~ $ rpg dev/ ~/dev $ rpg hero[1]@~/dev hp:[xxxxxxxxxx] 25/25 xp:[----------] 0/30 att:10 def:0 spd:5 equip:{} item:{} 0g In this case, the hero moved to ~/dev/facundoolano. Sometimes enemies will appear as you move through the directories, and both characters will engage in battle: ~/dev $ rpg facundoolano/ snake[1][xxxx]@~/dev/facundoolano snake[1][x---] -12hp hero[1][xxxx] dodged! snake[1][----] -12hp hero[1][xxxx][xxxx]@~/dev/facundoolano +24xp +75g Each character attacks in turn (the frequency being determined by their speed stat). Whenever you win a fight, your hero gains experience points and eventually raises its level, along with their other stats. When you return to the home directory, the hero's health points are restored: ~/dev/facundoolano/rpg-cli $ rpg ~ hero[1][xxxx][xxxx]@home +20hp Also at the home directory, you can buy items and equipment: ~ $ rpg --shop sword[1] 500g shield[1] 500g potion[1] 200g escape 1000g funds: 275g ~ $ rpg --shop potion ~ $ rpg hero[3]@home hp:[xxxxxxxxxx] 37/37 xp:[xx--------] 19/155 att:13 def:0 spd:7 equip:{} item:{potion[1]x1} 75g The shortcut rpg -s p would also work above. The further from home you move the hero, the tougher the enemies will get. If you go to far or too long without restoring your health your hero is likely to die in battle, causing the game to restart. ~ $ rpg ~/dev/facundoolano/rpg-cli/target/debug/examples/ orc[1][xxxx]@~/dev/facundoolano/rpg-cli hero[1][x---] -20hp critical! orc[1][xxx-] -9hp hero[1][----] -16hp hero[1][----][----]@~/dev/facundoolano/rpg-cli Death is permanent: you can't save your progress and reload after dying, but if you take your new hero to the location of the previous one's death, you can recover gold, items and equipment: ~ $ rpg ~/dev/facundoolano/rpg-cli/ @~/dev/facundoolano/rpg-cli/ +potionx1 +75g Try rpg --help for more options. About Your filesystem as a dungeon! Resources Readme License MIT License Releases 2 0.2.0 Latest May 24, 2021 + 1 release Packages 0 No packages published Contributors 4 * @facundoolano facundoolano Facundo Olano * @arkie arkie Jon * @jonathanmorley jonathanmorley Jonathan Morley * @AristoChen AristoChen Aristo Chen Languages * Rust 100.0% * (c) 2021 GitHub, Inc. * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.