# inertsteak/pokermon architecture

> Architecture diagram of the GitHub repository inertsteak/pokermon, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/inertsteak/pokermon
- Repository: https://github.com/inertsteak/pokermon

## Overview

##### Project type and purpose
- This is a full-content “mod” for the Balatro game engine.
- It extends Balatro by injecting new card types (“Pokérmon Jokers”), new UI, sounds, shaders, and game logic via Lua scripts and asset bundles.

##### File structure
- Top-level:
- pokermon.lua, setup.lua, config.lua – entry points and configuration
- assets/ – images, shaders, sounds
- functions/ – reusable Lua logic (animations, UI, game rules)
- poker­mon.json, pokesprites.lua, pokeui.lua – data definitions and UI glue
- dozens of feature directories (boosters/, blinds/, challenges/, consumables/, editions/, enhancements/, jokerdisplay/, localization/, pokemon/, seals/, sleeves/, stickers/, tags/, vouchers/) each containing one or more Lua modules that define content.
- Dependency hints:
- lovely.toml – configuration for Lovely Injector mod loader
- .gitignore / LICENSE – standard repo files

##### Key insights from README
- Requires Lovely Injector and Steamodded as “mod loaders” into the Balatro engine
- pokermon.lua is the main mod entry; setup.lua likely registers hooks into Balatro
- It is pure Lua + asset pack, no external service or DB

##### Detail
- Every top-level directory as a sub-component
- Flow: on game start, Lovely Injector loads pokermon.lua → setup() registers new cards and UI hooks → during gameplay, logic modules fire and reference assets

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Layers
    subgraph "Host Engine Layer"
        direction TB
        BE["Balatro Engine"]:::engine
        LI["Lovely Injector"]:::loader
        SS["Steamodded"]:::loader
    end

    subgraph "Pokermon Mod" 
        direction TB
        subgraph "Entry & Config"
            PM["pokermon.lua"]:::entry
            SU["setup.lua"]:::entry
            CF["config.lua"]:::entry
        end

        subgraph "Data Definitions"
            JD["Pokérmon.json"]:::data
            SP["pokesprites.lua"]:::data
        end

        subgraph "UI Modules"
            PU["pokeui.lua"]:::ui
            JDSP["jokerdisplay"]:::ui
        end

        subgraph "Logic Utilities"
            DF["debufffunctions.lua"]:::logic
            EF["energyfunctions.lua"]:::logic
            JF["jokerdisplayfunctions.lua"]:::logic
            PA["pokeanimations.lua"]:::logic
            PD["pokedraw.lua"]:::logic
            PF["pokefunctions.lua"]:::logic
            PUF["pokeutils.lua"]:::logic
            UIF["uifunctions.lua"]:::logic
        end

        subgraph "Gameplay Logic"
            BS["boosters/packs1.lua"]:::logic
            BL["blinds/pokebossblind.lua"]:::logic
            CH["challenges/pokechallenges.lua"]:::logic
            CM1["consumables/mart1.lua"]:::logic
            CM2["consumables/mart2.lua"]:::logic
            CM3["consumables/mart3.lua"]:::logic
            CZ["consumables/martz.lua"]:::logic
            CT["consumable types/type1.lua"]:::logic
            ED["editions/editions1.lua"]:::logic
            EN["enhancements/enhancement1.lua"]:::logic
            SE["seals/seals1.lua"]:::logic
            SL["sleeves/sleeve.lua"]:::logic
            ST["stickers/stickers.lua"]:::logic
            TG["tags/tags1.lua"]:::logic
            VU["vouchers/pokevouchers.lua"]:::logic
        end

        subgraph "Pokémon Card Definitions"
            PC["/pokemon directory"]:::content
        end

        CB["Card Backs (/backs/backs1.lua)"]:::content

        subgraph "Assets"
            A1["assets/1x"]:::asset
            A2["assets/2x"]:::asset
            SH1["booster.fs"]:::asset
            SH2["evolution.fs"]:::asset
            SH3["shiny.fs"]:::asset
            SH4["zorua.fs"]:::asset
            SO1["e_shiny.ogg"]:::asset
            SO2["pocket_music_high.ogg"]:::asset
            SO3["pocket_music_low.ogg"]:::asset
        end

        subgraph "Localization"
            LOC["/localization directory"]:::loc
        end
    end

    %% Connections
    BE --> LI
    LI --> SS
    SS --> PM
    PM --> SU
    PM --> CF
    PM --> JD
    PM --> SP
    PM --> PU
    PM --> JDSP
    PM --> DF
    PM --> BS
    PM --> PC
    DF --> A1
    DF --> A2
    DF --> SH1
    DF --> SH2
    DF --> SH3
    DF --> SH4
    DF --> SO1
    DF --> SO2
    DF --> SO3
    PU <-->|"text resources"| LOC
    PU --> SO1
    PU --> A1
    CH --> SO3

    %% Click Events
    click PM "https://github.com/inertsteak/pokermon/blob/main//pokermon.lua"
    click SU "https://github.com/inertsteak/pokermon/blob/main//setup.lua"
    click CF "https://github.com/inertsteak/pokermon/blob/main//config.lua"
    click JD "https://github.com/inertsteak/pokermon/blob/main//Pokermon.json"
    click SP "https://github.com/inertsteak/pokermon/blob/main//pokesprites.lua"
    click PU "https://github.com/inertsteak/pokermon/blob/main//pokeui.lua"
    click JDSP "https://github.com/inertsteak/pokermon/tree/main//jokerdisplay/"
    click A1 "https://github.com/inertsteak/pokermon/tree/main//assets/1x"
    click A2 "https://github.com/inertsteak/pokermon/tree/main//assets/2x"
    click SH1 "https://github.com/inertsteak/pokermon/blob/main//assets/shaders/booster.fs"
    click SH2 "https://github.com/inertsteak/pokermon/blob/main//assets/shaders/evolution.fs"
    click SH3 "https://github.com/inertsteak/pokermon/blob/main//assets/shaders/shiny.fs"
    click SH4 "https://github.com/inertsteak/pokermon/blob/main//assets/shaders/zorua.fs"
    click SO1 "https://github.com/inertsteak/pokermon/blob/main//assets/sounds/e_shiny.ogg"
    click SO2 "https://github.com/inertsteak/pokermon/blob/main//assets/sounds/pocket_music_high.ogg"
    click SO3 "https://github.com/inertsteak/pokermon/blob/main//assets/sounds/pocket_music_low.ogg"
    click DF "https://github.com/inertsteak/pokermon/blob/main//functions/debufffunctions.lua"
    click EF "https://github.com/inertsteak/pokermon/blob/main//functions/energyfunctions.lua"
    click JF "https://github.com/inertsteak/pokermon/blob/main//functions/jokerdisplayfunctions.lua"
    click PA "https://github.com/inertsteak/pokermon/blob/main//functions/pokeanimations.lua"
    click PD "https://github.com/inertsteak/pokermon/blob/main//functions/pokedraw.lua"
    click PF "https://github.com/inertsteak/pokermon/blob/main//functions/pokefunctions.lua"
    click PUF "https://github.com/inertsteak/pokermon/blob/main//functions/pokeutils.lua"
    click UIF "https://github.com/inertsteak/pokermon/blob/main//functions/uifunctions.lua"
    click BS "https://github.com/inertsteak/pokermon/blob/main//boosters/packs1.lua"
    click BL "https://github.com/inertsteak/pokermon/blob/main//blinds/pokebossblind.lua"
    click CH "https://github.com/inertsteak/pokermon/blob/main//challenges/pokechallenges.lua"
    click CM1 "https://github.com/inertsteak/pokermon/blob/main//consumables/mart1.lua"
    click CM2 "https://github.com/inertsteak/pokermon/blob/main//consumables/mart2.lua"
    click CM3 "https://github.com/inertsteak/pokermon/blob/main//consumables/mart3.lua"
    click CZ "https://github.com/inertsteak/pokermon/blob/main//consumables/martz.lua"
    click CT "https://github.com/inertsteak/pokermon/blob/main//consumable types/type1.lua"
    click ED "https://github.com/inertsteak/pokermon/blob/main//editions/editions1.lua"
    click EN "https://github.com/inertsteak/pokermon/blob/main//enhancements/enhancement1.lua"
    click SE "https://github.com/inertsteak/pokermon/blob/main//seals/seals1.lua"
    click SL "https://github.com/inertsteak/pokermon/blob/main//sleeves/sleeve.lua"
    click ST "https://github.com/inertsteak/pokermon/blob/main//stickers/stickers.lua"
    click TG "https://github.com/inertsteak/pokermon/blob/main//tags/tags1.lua"
    click VU "https://github.com/inertsteak/pokermon/blob/main//vouchers/pokevouchers.lua"

    %% Styles
    classDef engine fill:#D0E4F5,stroke:#0366D6;
    classDef loader fill:#B3DCE5,stroke:#028090;
    classDef entry fill:#C6EBC5,stroke:#2F8F2F;
    classDef data fill:#E8F1C6,stroke:#8FB339;
    classDef ui fill:#FCE6A4,stroke:#E09F3E;
    classDef logic fill:#FFD8B1,stroke:#FF8C42;
    classDef asset fill:#FFF2B5,stroke:#E0A800;
    classDef loc fill:#E3C4F3,stroke:#8A2BE2;
    classDef content fill:#F0E6F6,stroke:#7D3C98;
```
