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.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A Pokemon-themed CLI task manager and wellbeing tracker. Complete tasks to catch Pokemon, build your collection, and track your mental and physical wellbeing.
4
4
5
-
**Version:** 0.3.3 | **License:** MIT | **Python:** 3.10+
5
+
**Version:** 0.4.0 | **License:** MIT | **Python:** 3.10+
pokedo battle status <battle-id> -u myname -p mypass
310
+
311
+
# View battle history
312
+
pokedo battle history -u myname -p mypass
313
+
```
314
+
315
+
### Leaderboard
316
+
317
+
```bash
318
+
# Global leaderboard (sorted by ELO by default)
319
+
pokedo leaderboard show
320
+
321
+
# Sort by wins
322
+
pokedo leaderboard show --sort battle_wins
323
+
324
+
# Your own profile
325
+
pokedo leaderboard me -u myname
326
+
```
327
+
267
328
### Server Usage (Optional)
268
329
269
-
PokeDo is developing a FastAPI server to enable cloud synchronization and multi-user features. This system uses `requests` for client-side pushing and `bcrypt` for secure authentication.
330
+
PokeDo includes a FastAPI server for multiplayer battles, leaderboard tracking,
331
+
and cloud synchronization. The server uses PostgreSQL for persistent state and
332
+
the `lifespan` context manager pattern.
270
333
271
-
1.**Run the Server:**
334
+
1.**Start with Docker Compose (recommended):**
272
335
273
336
```bash
274
-
uvicorn pokedo.server:app --reload --port 8000
337
+
docker-compose up -d
275
338
```
276
339
277
-
(Ensure you have installed development dependencies: `pip install -e ".[dev]"`)
340
+
This starts both PostgreSQL and the PokeDo server.
See [MULTIPLAYER.md](docs/MULTIPLAYER.md) for the full battle flow.
367
+
299
368
## How It Works
300
369
301
370
### Catching Pokemon
@@ -376,10 +445,12 @@ Wellbeing actions also affect type encounters:
376
445
377
446
## Recent Fixes & Behavior Notes
378
447
379
-
- **EV/IV persistence**: Pokemon now persist their EV/IV dictionaries, so every completion permanently boosts the lead Pokémon’s stats (see `pokedo/data/database.py` and `pokedo/core/pokemon.py`).
380
-
- **Affinity-aware encounters**: The reward engine filters rarity pools by task/wellbeing affinities, backfills missing type data (`_ensure_pokedex_entry_types`), and consumes the best available ball (master/ultra/great) for each attempt (`pokedo/core/rewards.py`).
381
-
- **Pokedex tracking parity**: Every catch or evolution increments `pokedex_seen`/`pokedex_caught` (with first-caught timestamps and shiny flags), keeping trainer completion metrics in sync (`pokedo/cli/commands/tasks.py`, `pokedo/cli/commands/pokemon.py`).
382
-
- **Priority ordering & streak sync**: Task listings now sort using explicit numeric weights, and streak best counters update immediately on first-day or resumed streaks (`pokedo/data/database.py`, `pokedo/core/trainer.py`).
448
+
- **Multiplayer system**: Full async turn-based PvP battles with ELO-based leaderboard. FastAPI server backed by PostgreSQL, using the `lifespan` context manager (not deprecated `on_event`). Server-authoritative battle resolution with snapshot-based teams.
449
+
- **Battle engine**: Gen V+ damage formula, 18-type effectiveness chart, 25 natures, move priority system, status effects (burn/poison/paralysis/sleep/freeze/badly poisoned), drain/recoil mechanics, Protect, mutual KO draw support.
450
+
- **EV/IV persistence**: Pokemon now persist their EV/IV dictionaries, so every completion permanently boosts the lead Pokemon's stats.
451
+
- **Affinity-aware encounters**: The reward engine filters rarity pools by task/wellbeing affinities, backfills missing type data, and consumes the best available ball for each attempt.
452
+
- **Pokedex tracking parity**: Every catch or evolution increments `pokedex_seen`/`pokedex_caught` (with first-caught timestamps and shiny flags).
453
+
- **Priority ordering & streak sync**: Task listings sort using explicit numeric weights, and streak best counters update immediately on first-day or resumed streaks.
383
454
384
455
### EV/IV System
385
456
@@ -403,7 +474,6 @@ This system provides RPG mechanics for training your Pokemon's stats:
403
474
404
475
| Difficulty | EV Yield |
405
476
| ---------- | -------- |
406
-
|------------|----------|
407
477
| Easy | 1 EV |
408
478
| Medium | 2 EVs |
409
479
| Hard | 4 EVs |
@@ -419,25 +489,29 @@ All data is stored locally in `~/.pokedo/`:
419
489
420
490
## Development
421
491
422
-
The project includes a FastAPI server (`pokedo/server.py`) for future cloud synchronization and currently provides **user authentication (registration/login with JWT)**.
492
+
The project includes a FastAPI server (`pokedo/server.py`) formultiplayer battles, a global leaderboard, and cloud synchronization. The server uses PostgreSQL via SQLModel and JWT-based authentication.
- [Architecture Documentation](docs/ARCHITECTURE.md) - System design and code structure
514
+
- [Multiplayer Guide](docs/MULTIPLAYER.md) - PvP battles, leaderboard, and server API
441
515
- [Contributing Guide](docs/CONTRIBUTING.md) - How to contribute to PokeDo
442
516
- [API Reference](docs/API.md) - Internal API documentation
443
517
@@ -518,6 +592,18 @@ A: Yes. Each trainer profile is stored in the same local database. The CLI uses
518
592
**Q: Does wellbeing tracking affect gameplay?**
519
593
A: Yes! Good sleep improves catch rates, hydration goals boost Water-type encounters, and meditation increases Psychic/Fairy encounters.
520
594
595
+
**Q: How do I battle other players?**
596
+
A: Start the PokeDo server (see [Multiplayer Guide](docs/MULTIPLAYER.md)), register an account, and use the `pokedo battle` commands. Battles are async and turn-based -- you and your opponent submit actions independently, and the server resolves each turn.
597
+
598
+
**Q: Do I need a server to play?**
599
+
A: No. All single-player features (tasks, Pokemon, wellbeing) work fully offline with a local SQLite database. The server is only needed for PvP battles and the leaderboard.
600
+
601
+
**Q: What battle formats are available?**
602
+
A: Three formats: `singles_1v1` (1 Pokemon), `singles_3v3` (3 Pokemon, one active), and `singles_6v6` (full team, one active). Doubles and tournaments are planned for the future.
603
+
604
+
**Q: How does the ELO rating work?**
605
+
A: Starting rating is 1000 with K-factor 32. Winning against higher-rated opponents earns more points. Ranks range from Youngster (below 1100) to Pokemon Master (2100+).
606
+
521
607
**Q: How do I evolve Pokemon?**
522
608
A: Level up your Pokemon by completing tasks. When evolution requirements are met, use `pokedo pokemon evolve <id>`.
523
609
@@ -530,15 +616,16 @@ A: The CLI (Command Line Interface) uses typed commands like `pokedo task add`.
0 commit comments