Skip to content
This repository was archived by the owner on Aug 6, 2024. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions .github/workflows/close.yml

This file was deleted.

40 changes: 0 additions & 40 deletions .github/workflows/main.yml

This file was deleted.

17 changes: 0 additions & 17 deletions .github/workflows/open.yml

This file was deleted.

5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,5 @@ dmypy.json
# Ignore code-workspaces
*.code-workspace

# Pokémon PythonRed save files
# PPR save files
*/.ppr-save

# Windows dummy files to appease Pylance
app/getch.py
16 changes: 0 additions & 16 deletions .vscode/launch.json

This file was deleted.

13 changes: 8 additions & 5 deletions CONVENTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@ When contributing code to *Pokémon PythonRed*, please follow these conventions.

## File system

- Use `snake_case` for file names.
- Use `snake_case` for file names, except for the following:
- `app/locations/<filename>.py` uses `kebab-case`
- Files should be placed in the appropriate directory according to the following chart:

| Directory | Purpose |
| :-- | :-: |
| `app/data/base/` | JSON files not accessed by the program<br>and<br>Python files used to build JSON files for `app/data/` |
| `app/data/` | JSON files accessed directly by `app/main.py` |
| `app/` | Application code<br>and<br>The player's save file (`app/.ppr-save`) |
| `app/data/` | JSON files accessed directly by `app/main.py` |
| `app/data/base/` | JSON files not accessed by the program<br>and<br>Python files used to build JSON files for `app/data/` |
| `app/events/` | Python files to run when an event in triggered |
| `app/locations/` | Python files to run when a location is reached |

## Game mechanics

Expand All @@ -23,14 +26,14 @@ When contributing code to *Pokémon PythonRed*, please follow these conventions.
- Indent with tab characters, not spaces.
- Use `snake_case` for variable names and `PascalCase` for class names.
- Use single quotes for strings, and three single quotes for docstrings. Textual apostrophes should be backslash-escaped.
- Use the `#` character for comments. "Todo" comments should be formatted as `# TODO: <comment>`.
- Use the `#` character for comments. "Todo" comments should be formatted as `# \TODO: <comment>` without the backslash.

Example code:

```python
def return_a_string():
'''This is a docstring.'''
return 'Apostrophes (\') should be escaped.' # TODO: This is a todo comment.
return 'Apostrophes (\') should be escaped.' # \TODO: This is a todo comment.
```

## JSON
Expand Down
157 changes: 11 additions & 146 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@
<a href="https://github.com/Pokemon-PythonRed/Pokemon-PythonRed/releases"><img src="https://shields.io/github/downloads/Pokemon-PythonRed/Pokemon-PythonRed/total?color=inactive"></a> <!--Downloads-->
</p>

---

<h6><a href="https://github.com/Pokemon-PythonRed/Pokemon-PythonRed/discussions/59">Project Status Updates</a></h6>

</div>

---
Expand All @@ -43,7 +39,7 @@
- This project ([@Pokemon-PythonRed](https://github.com/Pokemon-PythonRed "Pokémon PythonRed Homepage") and anything found within) is not endorsed by Nintendo, GAME FREAK, Creatures Inc., or The Pokémon Company. This is an independent, fan-made game.
- This game's plot is a work of fiction! Any references to real people or events are completely coincidental.
- Pokémon PythonRed is a work-in-progress and is intended to be a long-term project. The owners feel no rush to meet community deadlines or expectations. Please be considerate.
- Any problems with the game can be reported in [issues](https://github.com/Pokemon-PythonRed/Pokemon-PythonRed/issues "Pokémon PythonRed Issues").
- Any problems with the game can be reported as [issues](https://github.com/Pokemon-PythonRed/Pokemon-PythonRed/issues "Pokémon PythonRed Issues").

---

Expand All @@ -62,12 +58,9 @@ For more information on various topics regarding this project, please visit the
- [Code Of Conduct](https://github.com/Pokemon-PythonRed/Pokemon-PythonRed/blob/master/CODE_OF_CONDUCT.md "Pokémon PythonRed Code Of Conduct")
- [Contributing Guidelines](https://github.com/Pokemon-PythonRed/Pokemon-PythonRed/blob/master/CONTRIBUTING.md "Pokémon PythonRed Contributing Guidelines")
- [Contributors List](https://github.com/Pokemon-PythonRed/Pokemon-PythonRed#contributors "Pokémon PythonRed Contributors")
- ~~[Current Tasks](https://github.com/orgs/Pokemon-PythonRed/projects/1 "Pokémon PythonRed Current Tasks")~~ (closed)
- [Discussions](https://github.com/orgs/Pokemon-PythonRed/discussions "Pokémon PythonRed Discussions")
- [Installation Guide](https://github.com/Pokemon-PythonRed/Pokemon-PythonRed#installation "Pokémon PythonRed Installation")
- [Issue Management](https://github.com/orgs/Pokemon-PythonRed/projects/2 "Pokémon PythonRed Issue Management")
- [License](https://github.com/Pokemon-PythonRed/Pokemon-PythonRed/blob/master/LICENSE "Pokémon PythonRed License")
- [Project Status Updates](https://github.com/Pokemon-PythonRed/Pokemon-PythonRed/discussions/59)
- [Installation Guide](https://github.com/Pokemon-PythonRed/Pokemon-PythonRed#installation "Pokémon PythonRed Installation Guide")
- [License (`MIT`)](https://github.com/Pokemon-PythonRed/Pokemon-PythonRed/blob/master/LICENSE "Pokémon PythonRed License (MIT)")
- [Security Policy](https://github.com/Pokemon-PythonRed/Pokemon-PythonRed/blob/master/SECURITY.md "Pokémon PythonRed Security Policy")

---
Expand Down Expand Up @@ -137,21 +130,20 @@ Bot command template:
- Windows or Linux OS
- Python 3 (aka CPython 3.x)
- Follow [this link](https://github.com/Pokemon-PythonRed/Pokemon-PythonRed/archive/refs/heads/master.zip) to download a `.zip` file of this repository. Once it downloads, unzip and open it.
- You will need to open a command line in the folder, then run the following command to install dependencies:
- From the folder, run these commands:

```sh
python -m pip install -r requirements.txt
$ python -m pip install -r requirements.txt
$ python app/main.py
```

- Finally, open `main.py` in the `app` folder.

- If you encounter any problems when opening the game, feel free to [create an issue](https://github.com/Pokemon-PythonRed/Pokemon-PythonRed/issues/new "Pokémon PythonRed Issues").

- If you want to contribute to the project, please see [the Contributing Guidelines](https://github.com/Pokemon-PythonRed/Pokemon-PythonRed/blob/master/CONTRIBUTING.md).

### Controls

- When `>` is shown, press <kbd>⏎ Enter</kbd> to continue. You may need to input text first.
- When `>` is shown, press a key to continue.
- When text bullets are shown, you need to enter the character next to the option you choose.
- In the overworld, navigation bullets are <kbd>WASD</kbd> for directional movement, then lettered for interactions. Other commands might also be available.
- Enter the <kbd>M</kbd> command from the overworld to open the menu.
Expand All @@ -160,15 +152,13 @@ python -m pip install -r requirements.txt

#### Examples

No text needed, just press <kbd>⏎ Enter</kbd>:
Press any key:

```console
Press Enter to continue.

>_
Press any key to continue._
```

Type text from a bullet point (e.g. <kbd>1</kbd> or <kbd>2</kbd>), then press <kbd>⏎ Enter</kbd>:
Press a key corresponding to a bullet point (e.g. <kbd>1</kbd> or <kbd>2</kbd>):

```console
Choose an option.
Expand All @@ -179,137 +169,12 @@ Choose an option.
>_
```

Type any variant of `yes`, `y`, `no`, or `n`, then press <kbd>⏎ Enter</kbd>:
Press <kbd>Y</kbd> or <kbd>N</kbd>:

```console
Would you like to save? Y/N

>_
```

Press any key:

```console
OAK: Hello there! Welcome to the world of POKéMON!
_
```

---

## Extras

Here's some extra information that isn't required to play the game, but might still be interesting.

<details><summary>Technicalities</summary>

---

### Technicalities

Since this is a Python game, some elements will have to be changed from the original version. Here are some examples of challenging changes.

#### Save data and saving

The game has to keep track of the many variables that make up a Save File. These include:

- Trainer info
- Party / Box info
- If a place has been visited, for Fly locations (each city separately)
- If cutscenes have been triggered
- Event flags
- Pokédex
- Game mechanic settings for accessibility

These are stored in a Python `dictionary` variable, which is then saved to the external file `.ppr-save` via Python's `json` module.

#### Game data

Not to be confused with save data, game data is composed of the numbers and calculations that the game uses. These include:

- Pokémon info
- Trainer battle info
- Save file templates

Large sets of data may be stored as `.json` files in the project folder. This is done to keep the program files concise. These files may be added, removed, or changed at any time.

Save file templates contain all the things the game must keep track of between sessions. On each save or load, the player's file is automatically updated with the latest data, in case an update was performed. This means that when the game is updated, the player can copy their `.ppr-save` file into the new version, and the save file will automatically be updated with the latest data.

#### Menus

Pokémon Red is full of menus that look like the following:

```
Would you like to save your progress?
> Save
Don't Save
```

This has been changed to be more suitable for a text-adventure game:

```console
Would you like to save your progress? Y/N

>_
```

This is done with code similar to the following:

```python
import json
save = {
# Save Data
}
print('Would you like to save your progress? Y/N')
saveOption = ' '
while saveOption.lower()[0] not in ['y', 'n']:
saveOption = input('>') + ' '
if saveOption.lower()[0] in ['y']:
open('.ppr-save', 'w').write(json.dumps(save))
print('Game saved successfully!')
```

#### Save management

The user can use multiple save files by moving or backing up their `.ppr-save` file to a different directory on their device. This has been implemented in the interest of user-friendliness and safety. Save files can easily be backed up, reset, or shared.

---

</details>

<details><summary>Mystery Gifts</summary>

---

### Mystery Gifts

Pokémon games use Mystery Gifts to bring communities together and incentivise players to take part in events, and Pokémon PythonRed is no different. Codes can be given out in planned giveaway events to specific people, left online to be found by anyone, or even given in-person to specific people. Most of them are online, so you should try looking in places [@TurnipGuy30](https://github.com/TurnipGuy30) has been.

#### Technical information

As of the time of writing, Mystery Gifts have not yet been implemented into the game. The base game will have to be completed first. For now, keep track of any codes you find.

#### Formatting

Pokémon PythonRed Mystery Gift codes are easy to identify because they will always be given in the following format:

```
Pokémon PythonRed Mystery Gift #20: "POKEMONPYTHONRED"
```

(Yes, this is a valid code. Consider it a free trial. You're welcome.)

#### Possible rewards

Redeemed codes will reward a player with in-game items or Pokémon.

#### Recipient responsibilities

Any person or group who finds or receives a code has no responsibility to keep it to themselves unless otherwise stated by the giver of the code.

#### Summary

Mystery Gifts are meant to unite the community and provide a fun way to interact with the game.

---

</details>
6 changes: 6 additions & 0 deletions app/abort_early.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from sys import exit

# abort function to be used before functions that require libraries
def abort_early() -> None:
input('\nIt appears that you are using an unsupported operating system. Please use Windows or Linux.\n\nPress Enter to exit.')
exit()
3 changes: 3 additions & 0 deletions app/data/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# `app/data/`

TODO: write this file
5 changes: 5 additions & 0 deletions app/data/base/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# `app/data/base/`

The formatting of these files isn't moderated the same way as everything else because they're taken directly from online sources and compiled into files the game can use.

In other words, this folder is not accessed by anything outside of it and may be removed at a later point.
File renamed without changes.
Loading