From 11a3f138113947c5b93e981a152fe3669704955a Mon Sep 17 00:00:00 2001 From: hentai-chan <70948244+hentai-chan@users.noreply.github.com> Date: Mon, 7 Jun 2021 13:25:46 +0200 Subject: [PATCH 1/8] Remove git logic from script and deactivate venv at the end --- easy_install.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/easy_install.sh b/easy_install.sh index 3f6e25b..c6d92aa 100644 --- a/easy_install.sh +++ b/easy_install.sh @@ -25,7 +25,6 @@ fi python3 gen_data.py --verbose make --id $id1 $id2 python3 gen_data.py manifest -echo "Updating submodules . . ." -git submodule update --init --recursive - echo "Done!" + +deactivate # virtual environment From f93ab6a1e5da39f5367f5bb02cdbf34b278917bb Mon Sep 17 00:00:00 2001 From: hentai-chan <70948244+hentai-chan@users.noreply.github.com> Date: Mon, 7 Jun 2021 13:26:05 +0200 Subject: [PATCH 2/8] Add PS script for Windows users --- EasyInstall.ps1 | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 EasyInstall.ps1 diff --git a/EasyInstall.ps1 b/EasyInstall.ps1 new file mode 100644 index 0000000..5ab8e97 --- /dev/null +++ b/EasyInstall.ps1 @@ -0,0 +1,28 @@ +Write-Host -ForegroundColor Yellow "+++ PKMN Asset Builder +++" + +Write-Host "`nAccording to the National Pok\u00e9mon Index, the first 151 entries served in Generation I." +Write-Host "You may use any of these numbers to create new asset files to play this game.`n" + +$ID1 = Read-Host "Pokemon ID #1" +$ID2 = Read-Host "Pokemon ID #2" + +if ( -not (Test-Path -Path "venv" -PathType Container) ) +{ + Write-Host -ForegroundColor Yellow "Creating a new virtual environment . . ." + python -m venv venv/ + .\venv\Scripts\Activate.ps1 + Write-Host "Installing dependencies . . ." + python -m pip install --upgrade pip + python -m pip install -r requirements.txt --only-binary all +} +else +{ + .\venv\Scripts\Activate.ps1 +} + +python gen_data.py --verbose make --id $ID1 $ID2 +python gen_data.py manifest + +Write-Host -ForegroundColor Yellow "Done!" + +deactivate # virtual environment \ No newline at end of file From 0b7341f9e7bdedf9024157adc3add6c24bbb21d8 Mon Sep 17 00:00:00 2001 From: hentai-chan <70948244+hentai-chan@users.noreply.github.com> Date: Mon, 7 Jun 2021 13:26:41 +0200 Subject: [PATCH 3/8] Add instructions for non-devs --- README.md | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index e5b79d8..5d331e1 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,20 @@
-## Build & Debug +## For Users: Playing the Game + +Go to [Releases](https://github.com/cpp-gamedev/pkmn/releases) and download the +latest version of `pkmn-x64-linux-windows-v1.0.0-*.zip`. Unzip this directory, then + +- run `easy_install.sh` (Linux) +- run `EasyInstall.ps1` (Windows) + +to configure the game. This process may take a minute or two depending on your +internet connection. After that, run the `pkmn` binary (`pkmn.exe` on Windows) +to start the game. The game takes up quite a bit of vertical space, so you may +want to adjust the size of your terminal. + +## For Developers: Build & Debug the Game Initialize and update all submodules after you have cloned this repository: @@ -34,12 +47,6 @@ environments on Linux. ### Generating new Pokemon ---- - -*Note: You can also use the `./easy_install.sh` script to skip this section.* - ---- - If this is your first time using a python script, use ```bash From bfcdfe1150ba8867351d90c6ed4373298d805cfa Mon Sep 17 00:00:00 2001 From: hentai-chan <70948244+hentai-chan@users.noreply.github.com> Date: Mon, 7 Jun 2021 13:29:40 +0200 Subject: [PATCH 4/8] Rename slow_print to delayed_print and flush each cout therein. --- src/utils.cpp | 6 +++--- src/utils.hpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/utils.cpp b/src/utils.cpp index 7185630..f0c5b54 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -18,11 +18,11 @@ void sleep(std::chrono::milliseconds ms) std::this_thread::sleep_for(ms); } -void slow_print(const std::string& str, std::chrono::milliseconds ms) +void delayed_print(std::string_view msg, std::chrono::milliseconds ms) { - for (char c : str) + for (char c : msg) { - std::cout << c; + std::cout << c << std::flush; sleep(ms); } diff --git a/src/utils.hpp b/src/utils.hpp index d31bd85..b68098a 100644 --- a/src/utils.hpp +++ b/src/utils.hpp @@ -76,7 +76,7 @@ void clear_screen(); void sleep(std::chrono::milliseconds ms); -void slow_print(const std::string& str, std::chrono::milliseconds ms); +void delayed_print(std::string_view msg, std::chrono::milliseconds ms); enum class Color { From 58b1049ce45f7a51f70318d0ed994e69ca47563e Mon Sep 17 00:00:00 2001 From: hentai-chan <70948244+hentai-chan@users.noreply.github.com> Date: Mon, 7 Jun 2021 13:31:18 +0200 Subject: [PATCH 5/8] Use gender-neutral language in game and decrease accuracy of attack moves --- src/models.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/models.cpp b/src/models.cpp index 17b3fe0..60606cc 100644 --- a/src/models.cpp +++ b/src/models.cpp @@ -30,6 +30,7 @@ void Pokemon::configure_move_set() if (move.power > 0 && move.accuracy > 0) { move.type = MoveType::ATTACK; + move.accuracy = utils::random_range