Git Product home page Git Product logo

rpg-cli's People

Contributors

aitet avatar aristochen avatar arkie avatar darthgandalf avatar dna avatar facundoolano avatar felixonmars avatar gumnos avatar jjoshm avatar jonathanmorley avatar legendofmiracles avatar orhun avatar pakoito avatar pehuen-rodriguez avatar silcet avatar uzaaft avatar zoomiti avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rpg-cli's Issues

Panics with `.` as argument in Windows

$ 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

please run `reset --hard` to restart.

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.
~ $

Full cd override shell script fix

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)"
}

Hero doesn't pick up gold from treasures

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

overflow

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

macOS binary is unsigned, requiring Sec&Privacy adjustment

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.

Listing Tombstones

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:

  • Multiple tombstones in a location become a graveyard
    • Special events/encounters at graveyards?
  • Having too many tombstones increase the chance of a special "Haunting" event / special ghost encounters

Curious of what the feeling is about what the scope of tombstones should be.

Probably overkill example for fish shell

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

[Feature Request] Implement custom/changeable home path

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!

disable shop items

image

as per screenshot, I cannot upgrade sword, but it still shows as a viable purchase. maybe gray-out the name and replace the pric with "owned" ?

Condensed output if rpg-cli is shared with other commands (and separators)

Hi there,

Great idea you got here. I like it howver i want to propose 2 changes:

  1. Condense output for us who want to use this neat game while doing our stuff on the system. I am using, for example, 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?

  1. My second proposal is in direct relation to the 1st: add separators to be added after battle. Something 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

Support for both top and/or bottom separator would be apprieciated.

Check in Cargo.lock

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!

Colors for light background

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…

Non-UTF-8 display

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. :-)

Overflow

After using this for awhile I noticed this

image

I was able to buy sword and shield of 175 level which is cool, but fights not happen pretty slowly

A little note on the game-play balance

  • We gain just a little too much gold in late games (3150360g on this 1h game).
  • Are lvl-stone effects skipped for achievements? Is an +event raised when a stone is used?
  • We maybe should use a seed-based RNG based on the path to knowing if we must generate a new boss, it is easy to just go to the same 3/4 paths to fight something and gain XP without endangeringyourself.

Rings Disappear

I'm trying to create reproduction steps, but I wanted to post in case I'm making assumptions that aren't true:

  1. When a hero dies, a tombstone should be created at their working directory containing all of their items
  2. When a hero searches in a directory with a tombstone, all items from that tombstone should be added to their inventory
  3. If a ring is not listed in rings_left (see jq query below), it should be in either the active hero's inventory (my_rings) or a tombstone (dead_rings).

Context:

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"

Alternate installation method

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.

No output printed when not changing directories

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

Would be cool to have 'shell mod' + more stats + more interaction

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)

Localizing

Could you make the game localized? For example, the words "remedy", "ether" and "escape" in buy display makes no sense for me…

Datafile upgrade

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?

Expanded Shell Integration Example

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!

Sorting of items

Items not always printed in the same order when print the character info. Would be nice if they did.

Shell prompt plugin

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.

stat command doesn't work with items

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

Going to $HOME with --force flag doesn't reset character stats or apply ring/status effects

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

failed to build

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.