Skip to content

Type chart

Full 18-type Gen 6 type chart including all immunities.

The module-level TYPE_CHART singleton is imported by the battle engine and models. Call TYPE_CHART.multiplier(attacking_type, defender_types) to get the combined damage multiplier for a move.

types

Type chart -- type effectiveness lookup.

TypeChart accepts a chart dict at construction time so each generation can supply its own matchup data. The module-level TYPE_CHART singleton uses the Gen 6 chart and is kept for backwards compatibility.

multiplier(attacking_type, defender_types) returns the combined effectiveness multiplier (e.g. 2.0, 0.5, 0.0, 4.0).

TypeChart

TypeChart(chart: dict[str, dict[str, float]] | None = None)

Type effectiveness lookup for a specific generation.

Accepts a chart dict at construction time. Each gen's BattleRules subclass passes its own chart so matchups are generation-accurate.

Source code in pokerena/engine/types.py
def __init__(self, chart: dict[str, dict[str, float]] | None = None) -> None:
    self._chart = chart if chart is not None else _CHART

multiplier

multiplier(
    attacking_type: str, defender_types: list[str]
) -> float

Return combined type effectiveness multiplier. Chains multipliers for each defender type independently.

Source code in pokerena/engine/types.py
def multiplier(self, attacking_type: str, defender_types: list[str]) -> float:
    """
    Return combined type effectiveness multiplier.
    Chains multipliers for each defender type independently.
    """
    row = self._chart.get(attacking_type, {})
    result = 1.0
    for def_type in defender_types:
        result *= row.get(def_type, 1.0)
    return result

is_immune

is_immune(
    attacking_type: str, defender_types: list[str]
) -> bool

Return True if the attacking type deals zero damage to the defender types.

Source code in pokerena/engine/types.py
def is_immune(self, attacking_type: str, defender_types: list[str]) -> bool:
    """Return True if the attacking type deals zero damage to the defender types."""
    return self.multiplier(attacking_type, defender_types) == 0.0