Skip to content

gabriele-mastrapasqua/pokebattle

Repository files navigation

Poke Battle

A simple pokemon battle simulation using the nice pokeapi.co REST APIs data.

This simple CLI program will ask the user to select 2 pokemon to battle, it can show basic pokemon info fetched from pokeapi and simulate a battle between them. It will store cached result from the api calls in a redis for 1h max, and save in a sqlite the previous battle history informations.

Written in py3 using poetry for package management, pytest for tests and docker and docker-compose to spin up the program and dependencies easy.

TODO

  • add a new battle strategy to use moves and power level to calculate hp loss / stats decrease / increase based on the type of move
  • calculate hp loss using a simplified function like: ( (2 * poke level / 5) * power * Attack [poke1] / Defense [poke2] ) / 50 + 2 * modifier [type / special attack] - See this paper: https://web.stanford.edu/class/aa228/reports/2018/final151.pdf
  • the correct battle function should also use % probability of the move!
  • add more unit tests for the single components
  • use a TUI like Textual lib to better handle the CLI ui!
  • show the pokemon image in battle and in ID card info.
  • add a GH workflow to build and test automatically

Development

requirements:

  • py 3+
  • poetry

install project dependencies

poetry install

build

poetry build

run main program

poetry run main

run tests

poetry run pytest

Running the project using docker

start all services

docker-compose up

tear down

docker-compose down

Releases

No releases published

Packages

No packages published