facundoolano / rpg-cli Goto Github PK
View Code? Open in Web Editor NEWYour filesystem as a dungeon!
License: MIT License
Your filesystem as a dungeon!
License: MIT License
As well as being more usable as a cd replacement, this would allow users to more easily try to return to pick up their loot if they die.
$ rpg-cli.exe .
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src\location.rs:43:44
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
ls
should allow to see the monsters before being seen and:
cd
thereThe test run::check_run_cmd failed when creating a fedora package in copr.
https://download.copr.fedorainfracloud.org/results/remilauzier/rpg-cli/fedora-34-x86_64/02214878-rust-rpg-cli/builder-live.log.gz
The test must failed because there is no terminal in mock build.
Invalid game data file. If it was generated with a previous version please run reset --hard
to restart.
~ $ rpg-cli pwd
/home/~/.config/glib-2.0
~ $ rpg-cli cd ~
~ $ rpg-cli pwd
/home/~/.config
~ $ rpg-cli cd ~
~ $ rpg-cli cd ~
~ $ rpg-cli cd ~
~ $ rpg-cli cd ~
~ $ rpg-cli cd ~
rat[5][xxxx][----]@~/.config
rat[5][----] -201hp
warrior[21][xxxx] +0xp
warrior[21][xxxx][----][x---]@~/.config
~ $ rpg-cli cd ~
wolf[5][xxxx][----]@~/.dbus
wolf[5][----] -264hp
warrior[21][xxxx] +0xp
warrior[21][xxxx][----][x---]@~/.dbus
~ $ rpg-cli cd ~
~ $ rpg-cli cd ~
~ $ rpg-cli cd ~
~ $ rpg-cli cd ~
~ $ rpg-cli cd ~
Invalid game data file. If it was generated with a previous version please run `reset --hard` to restart.
~ $ rpg-cli cd ~
Invalid game data file. If it was generated with a previous version please run `reset --hard` to restart.
~ $ rpg-cli cd ~
Invalid game data file. If it was generated with a previous version please run `reset --hard` to restart.
~ $ rpg-cli cd ~
Invalid game data file. If it was generated with a previous version please run `reset --hard` to restart.
~ $ rpg-cli cd ~
Invalid game data file. If it was generated with a previous version please run `reset --hard` to restart.
~ $ rpg-cli cd ~
Invalid game data file. If it was generated with a previous version please run `reset --hard` to restart.
~ $
In the shell Doc you write
cd () {
rpg-cli cd "$@"
builtin cd "$(rpg-cli pwd)"
}
I think you meant
cd () {
rpg-cli "$@" <-- no cd
builtin cd "$(rpg-cli pwd)"
}
I have introduced this game at work, and a colleague and me have noticed that whenever "rpg ls" finds a treasure that contains gold the gold count of the hero doesn't increase. I attach the output from the terminal:
cmg in ❯ ~ ❯ rpg b
potion[1] 200g
remedy 400g
escape 1000g
funds: 797g
cmg in ❯ ~ ❯ rpg cd Downloads/
wolf[1][xxxx]@~/Downloads
wolf[1][xxxx] -30hp
hero[3][xxxx] +10xp +59g
hero[3][xxxx][xxx-]@~/Downloads
cmg in ❯ ~/Downloads ❯ rpg ls
cmg in ❯ ~/Downloads ❯ rpg cd Versions/
rat[3][xxxx]@~/Downloads/Versions
hero[3][xxxx] -2hp
rat[3][xxxx] -33hp
hero[3][xxxx] +33xp +38g
hero[3][xxxx][xxxx]@~/Downloads/Versions
cmg in ❯ ~/Downloads/Versions ❯ rpg ls
📦 +405g
cmg in ❯ ~/Downloads/Versions ❯ rpg
hero[3]@~/Downloads/Versions
hp:[xxxxxxxxxx] 41/43
xp:[xxxxxxxxx-] 125/155
att:27 def:8 spd:13
equip:{sword[1],shield[1]}
item:{potionx7}
894g
after leveling up a bit via
for f in `seq 1000` ; do clear ; rpg /tmp ;clear; rpg ~ ; done ; clear ; rpg
I seem to have broken the stats:
hero[160]@/home
hp:[xxxxxxxxxx] -2085599079/-2085599079
xp:[xxxxxxx---] 40302/60715
att:-1989316420 def:6 spd:697466
equip:{sword[1],shield[1]}
item:{escapex15}
5947886g
fights are pretty boring now, since they take forever
I downloaded the binary and ran it on macOS 10.15.7. I got a security warning. I was able to open the Security & Privacy prefpane and allow it to run. The next time I ran it, I got the security warning again, but I was able to proceed.
no puny young PCs with no experience could be allowed to invoke +wish+ I mean sudo.
Given that I use the full cd integration of rpg-cli, often my character will die while I am busy doing work. Because I don't always attend to my tombstones I can occasionally get tons of tombstones scattered everywhere. It isn't that tedious to go into my save file to see where my tombstones are but it does feel like it is not intended to open the save for this purpose. Is it worth adding an rpg-cli command to list the tombstone locations?
Also worth mentioning is the possibility of adding more gameplay to tombstones:
Curious of what the feeling is about what the scope of tombstones should be.
I feel like this function added to ~/.config/fish/config.fish
should be self-explanatory. Just throwing it out there in case it "helps" anyone:
function rpg
if string match -qr RPG (functions cd)
echo 'Setting cd to normal mode'
functions --erase cd
functions --copy cd_orig cd
else
echo 'Setting cd to RPG mode'
functions --erase cd_orig
functions --copy cd cd_orig
function cd --description 'Change directory, RPG-style'
cd_orig $argv
and rpg-cli $PWD
end
end
end
And then, of course, right after the function definition, you can silently enable rpg mode:
rpg >/dev/null
Hello there!
Am here to ask for the possibility of implementing a custom or a way to change the home path from "~" on the rpg-cli.
I work with longer file system paths now and would be nice to have a way to change it.
Thanks!
Hi there,
Great idea you got here. I like it howver i want to propose 2 changes:
cd
function to list directory right after changing location. This could lead to clutter in te terminal like:$ cd /usr/share/
rat[7][xxxx][----]@/usr/share
thief[2][xxx-] -17hp
rat[7][xxxx] dodged!
thief[2][x---] -13hp
rat[7][xxxx] dodged!
thief[2][----] -14hp
thief[2][----] 💀
abrt gnome-packagekit mobile-broadband-provider-info
accountsservice gnome-session ModemManager
aclocal gnome-settings-daemon mousetweaks
adobe gnome-shell mozilla
What if you introduce "slim output"? I dont know how it would be implemented right now but to show only enemy, if any, and then the outcome of the battle?
$ cd /usr/share/
rat[7][xxxx][----]@/usr/share
thief[2][xxx-] -17hp
rat[7][xxxx] dodged!
thief[2][x---] -13hp
rat[7][xxxx] dodged!
thief[2][----] -14hp
thief[2][----] 💀
---------------------------------------------------------------------------------------------
abrt gnome-packagekit mobile-broadband-provider-info
accountsservice gnome-session ModemManager
aclocal gnome-settings-daemon mousetweaks
adobe gnome-shell mozilla
Support for both top and/or bottom separator would be apprieciated.
it will make installation really easy on macOS
This helps with reproducibility, and is also the recommended way for rust programs.
The .gitignore
says it ignores it, because this program is a library, which just isn't true.
It would also stop distro maintainers from having to patch in the Cargo.lock, as seen here: https://github.com/NixOS/nixpkgs/pull/124539/files
Thanks!
I usually have a light background which makes white color not visible.
For now I patched that in the source but it would be nice to make colors aware of light or dark background or/and configure colors with config files.
It might also be nice to get environment CLICOLOR_FORCE documented if using pipes…
The last request :-)
Could you care for LC_CTYPE (or they like) for detecting if the display is capable of displaying UTF-8? And if not, substitute the nice icons. :-)
I'm trying to create reproduction steps, but I wanted to post in case I'm making assumptions that aren't true:
rings_left
(see jq
query below), it should be in either the active hero's inventory (my_rings
) or a tombstone (dead_rings
).I've written some scripts that take the active hero through randomly generated folders to optimize leveling up, finding loot, and dying to leave a trail of treasure.
After running the script for a while, the rings_left
list will only contain "Diamond", but there will only be 18 or fewer rings between dead_rings
and my_rings
.
After running the scripts for several thousand more tombstones, the rings are never found again. If this sounds like something that ought not to happen, I can start adding some debugging to my scripts to watch for actions that result in a lost ring, but if there are cases where rings should disappear from the game it'll change what I'm debugging for :D
alias rings_left="jq '.quests[][][2] | select(any(.type==\"FindAllRings\"; .)) | .to_find' ~/.rpg/data"
alias dead_rings="jq '.tombstones[].items[] | select(any(.type==\"Ring\";.))' ~/.rpg/data"
alias my_rings="jq '.inventory | keys[] | select(endswith(\"-rng\"))' ~/.rpg/data"
add in ~/.config/fish/config.fish
function rpg
rpg-cli $argv
cd (rpg-cli --pwd)
end
If you clone this repo and run cargo install --path path/to/rpg-cli
, then the binary will be installed to ~/.cargo/bin
, and you can skip the step of moving the binary from path/to/rpg-cli/target
to somewhere defined in $PATH
.
You can also use cargo install --git <URL>
to avoid manually cloning this repo.
Version: 0.2.0, OS/X binary
Hi! I saw this on Hacker News, it looks neat, and I wanted play around with it.
Something I wanted to offer feedback on is that I had trouble understanding the flow at first, because the app doesn't print anything when you don't change directories. Example:
$ rpg-cli rpg/
slime[1][xxxx]@~/tmp/rpg
slime[1][xxxx] -8hp
slime[1][xxxx] -8hp
[snip]
slime[1][----] -12hp
hero[3][xxxx][x---]@~/tmp/rpg +111xp ++level +114g
$ rpg-cli $HOME
hero[3][xxxx][x---]@home +8hp
$ rpg-cli $HOME
$
The second time I ran rpg-cli $HOME
, my character obviously didn't change directories, and while with the benefit of hindsight, I can understand why output wasn't printed, it still confused me when I first started playing this, and I thought I may have been doing something incorrectly.
Expected behavior from running rpg-cli $HOME
a second time (or for any directory, tbh) would be to print the here's location and stats.
Thanks for reading!
-- Doug
About 'shell mode' - just execute some aliases like
*start another shell session*
go/cd = rpg-cli <arg>
shop = rpg-cli -s
etc..
*exit from shell session for removing aliases and not breaking user's aliases*
good idea to make config where user set commands.
So, basicly it makes in script.
About stats - basicly i mean stats for stats check
About more interactions - basicly this #25 but let's say we want steal it instead and there comes hero's stats and stats check. User can chose way how to remove file - throw fight/steal, like that.
There is other actions:
edit txt = *speach check* (fail - refuse to edit file)
$ls = *perception check* (fail - don't show some files)
Could you make the game localized? For example, the words "remedy", "ether" and "escape" in buy display makes no sense for me…
Hi, I have an old install of rpg-cli 0.2.0. When updgrading to latest release 0.6.0, I get a segfault when trying to read the datafile. I assume that's because its format has changed.
Is there any way to update the data, or is my only choice to reset the game and lose my character?
I took some of your shell examples and combined/expanded them into a full zsh plugin. It might also be source-able from bash, but I have not tested it this way.
We could link it in the README as an additional example, if you were so inclined.
Thanks for making such a cool game!
When using the variant with cd -f, rpg does not recognice $HOME so no healing will be done anymore.
this is awesome; i love this project
i have long dreamed that something like this would exist!
it would be really cool to have a feature where you can start a battle that, if you win, results in the file being deleted!
On fedora compiling with this version of clap doesn’t work.
https://kojipkgs.fedoraproject.org//work/tasks/1906/79961906/build.log
error[E0432]: unresolved import clap::Clap
--> src/command.rs:10:5
|
10 | use clap::Clap;
| ^^^^^^^^^^ no Clap
in the root
error[E0432]: unresolved import clap::Clap
Items not always printed in the same order when print the character info. Would be nice if they did.
I'd love to have a switch for a "prompt" mode, so I can go around my business in terminal as usual while the action happens in the background, without printing lines of events
and just glancing occasionally at my shell prompt to see if I need to return to town to heal or buy more potions.
The output for actions can be redirected to /dev/null in the shell plugin itself, so no changes necessary, but adding a compact single-line output of current status, like hp percentage and a number of potions will really help make this.
I can do the actual implementation if the change is welcome.
rpg-cli stat potion
is returning:
error: Found argument 'potion' which wasn't expected, or isn't valid in this context
If you tried to supply `potion` as a PATTERN use `-- potion`
USAGE:
rpg-cli stat [FLAGS]
For more information try --help
These are the commands I type into the command line to try to go home to reset my characters HP but it never happens
[zoomiti@MastermindRogue ~]$ rpg-cli pwd
/home/zoomiti
[zoomiti@MastermindRogue ~]$ rpg-cli stat
mage[1]@home
hp:[xxxxx-----] 14/28
mp:[xxx-------] 3/12
xp:[xxxxxx----] 17/30
att:3 mag:33 def:0 spd:11
equip:{}
item:{}
46g
[zoomiti@MastermindRogue ~]$ rpg-cli cd ~
[zoomiti@MastermindRogue ~]$
For the record I am on 1.0.0
[zoomiti@MastermindRogue ~]$ rpg-cli -V
rpg-cli 1.0.0
Tried to update version 0.6.0 which I had previously installed in Ubuntu WSL and got the errors below. I verified apt shows the system is up to date.
error[E0658]: arbitrary expressions in key-value attributes are unstable
--> /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-3.0.0-beta.4/src/lib.rs:8:10
|
8 | #![doc = include_str!("../README.md")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: see issue #78835 <https://github.com/rust-lang/rust/issues/78835> for more information
error[E0658]: use of unstable library feature 'osstring_ascii'
--> /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-3.0.0-beta.4/src/parse/matches/matched_arg.rs:130:19
|
130 | v.eq_ignore_ascii_case(val)
| ^^^^^^^^^^^^^^^^^^^^
|
= note: see issue #70516 <https://github.com/rust-lang/rust/issues/70516> for more information
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0658`.
error: could not compile `clap`
To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: failed to compile `rpg-cli v1.0.0 (https://github.com/facundoolano/rpg-cli?tag=1.0.0#655bcf83)`, intermediate artifacts can be found at `/tmp/cargo-installxDwvN4`
Caused by:
build failed
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.