LAMaglan / PokeFightSimulator

A (simple) fight simulator between any two Pokemon using FastAPI with Jinja frontend
0 stars 0 forks source link

Include type in fight logic #9

Closed LAMaglan closed 3 months ago

LAMaglan commented 4 months ago

Include it as some sort of multiplier. Will need to take into account when either pokemon have multiple types

LAMaglan commented 3 months ago

Would need to include a list "type" as a (class) attribute in the Pokemon class

LAMaglan commented 3 months ago

Will be fairly complicated, as there are many types: take into account type advantages, but also when there are multiple types for a given pokemon

LAMaglan commented 3 months ago

Could represent type advantages as a nested dict:

type_advantages = {
    "Normal": {
        "Normal": 1.0,
        "Fire": 1.0,
        "Water": 1.0,
        # ... other type matchups and their respective multipliers
    },
    "Fire": {
        "Normal": 1.0,
        "Fire": 0.5,
        "Water": 2.0,
        # ... other type matchups and their respective multipliers
        .....

Have in own file, types.py, which I then import to main.py etc

LAMaglan commented 3 months ago

Base nested dict on e.g. this chart: https://pokemondb.net/type

LAMaglan commented 3 months ago

Or, instead of nested dict, have a csv file that load into python with pandas. More readable?

LAMaglan commented 3 months ago

Starting here: https://github.com/LAMaglan/PokeFightSimulator/tree/types-in-fight-logic