# revoltoftheatoms/riskofrogue architecture

> Architecture diagram of the GitHub repository revoltoftheatoms/riskofrogue, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/revoltoftheatoms/riskofrogue
- Repository: https://github.com/revoltoftheatoms/riskofrogue

## Overview

Risk of Rogue is a Deadzone: Rogue mod that adds Risk of Rain 2 items and a difficulty timer. The player encounters items through Deadzone’s item orbs, then uses them through its inventory and native item UI; the mod also displays RoR2 buff icons and a run timer. The Lua tree separates startup, game integration, item effects, UI, and state, but those implementations were not excerpted, so internal runtime links are omitted or marked unverified. README documents the player-facing capabilities; source excerpts show supporting item data and icon extraction.

Main entry points: [`mod/RiskOfRogue/Scripts/parts/engine_actions.lua`](https://github.com/revoltoftheatoms/riskofrogue/blob/main/mod/RiskOfRogue/Scripts/parts/engine_actions.lua) (Item Effects), [`sheets/inventory.json`](https://github.com/revoltoftheatoms/riskofrogue/blob/main/sheets/inventory.json) (Player Inventory), [`tools/extract_ror2_assets.py`](https://github.com/revoltoftheatoms/riskofrogue/blob/main/tools/extract_ror2_assets.py) (Icon Extractor), [`mod/RiskOfRogue/Scripts/parts/hud.lua`](https://github.com/revoltoftheatoms/riskofrogue/blob/main/mod/RiskOfRogue/Scripts/parts/hud.lua) (HUD)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Mod Runtime"]
  node_startup["Mod Startup<br/>[main.lua]"]
  node_game["Game Integration<br/>[game.lua]"]
  node_hooks["Game Hooks<br/>[hooks.lua]"]
  node_state["Run State<br/>[state.lua]"]
  node_clock["Difficulty Clock<br/>[clock.lua]"]
end

subgraph group_items["Items and Effects"]
  node_item_data["Item Definitions<br/>[data_gen.lua]"]
  node_orb_items["Orb Items<br/>[orbs.json]"]
  node_item_effects["Item Effects<br/>[engine_actions.lua]"]
  node_proc_engine["Proc Engine<br/>[engine_procs.lua]"]
  node_tick_engine["Effect Ticking<br/>[engine_tick.lua]"]
  node_inventory["Player Inventory<br/>[inventory.json]"]
end

subgraph group_presentation["Game Presentation"]
  node_hud["HUD<br/>[hud.lua]"]
  node_buff_icons["Buff Icons<br/>[buffs.json]"]
  node_item_text["Item Text<br/>[item_text.json]"]
end

subgraph group_assets["Icon Assets"]
  node_icon_tool["Icon Extractor"]
  node_icon_assets["Icon Asset Map<br/>[ror2_assets.json]"]
end

node_player(("Player"))
node_deadzone["Deadzone Game"]
node_ror2["Risk of Rain 2"]

node_player -->|"plays"| node_deadzone
node_deadzone -->|"loads mod"| node_startup
node_player -->|"receives items"| node_orb_items
node_orb_items -->|"adds items"| node_inventory
node_item_data -->|"defines stacking"| node_inventory
node_inventory -->|"shows items"| node_player
node_item_data -.->|"configures effects"| node_item_effects
node_item_effects -.->|"dispatches procs"| node_proc_engine
node_item_effects -.->|"runs timed effects"| node_tick_engine
node_startup -.->|"initializes"| node_game
node_game -.->|"registers hooks"| node_hooks
node_clock -->|"shows timer"| node_hud
node_buff_icons -->|"shows buff icons"| node_hud
node_item_text -->|"provides tooltips"| node_player
node_ror2 -->|"provides icon assets"| node_icon_tool
node_icon_assets -->|"selects textures"| node_icon_tool
node_icon_tool -->|"writes mod icons"| node_hud

click node_startup "https://github.com/revoltoftheatoms/riskofrogue/blob/main/mod/RiskOfRogue/Scripts/main.lua"
click node_game "https://github.com/revoltoftheatoms/riskofrogue/blob/main/mod/RiskOfRogue/Scripts/parts/game.lua"
click node_hooks "https://github.com/revoltoftheatoms/riskofrogue/blob/main/mod/RiskOfRogue/Scripts/parts/hooks.lua"
click node_state "https://github.com/revoltoftheatoms/riskofrogue/blob/main/mod/RiskOfRogue/Scripts/parts/state.lua"
click node_clock "https://github.com/revoltoftheatoms/riskofrogue/blob/main/mod/RiskOfRogue/Scripts/parts/clock.lua"
click node_item_data "https://github.com/revoltoftheatoms/riskofrogue/blob/main/mod/RiskOfRogue/Scripts/data_gen.lua"
click node_orb_items "https://github.com/revoltoftheatoms/riskofrogue/blob/main/sheets/orbs.json"
click node_item_effects "https://github.com/revoltoftheatoms/riskofrogue/blob/main/mod/RiskOfRogue/Scripts/parts/engine_actions.lua"
click node_proc_engine "https://github.com/revoltoftheatoms/riskofrogue/blob/main/mod/RiskOfRogue/Scripts/parts/engine_procs.lua"
click node_tick_engine "https://github.com/revoltoftheatoms/riskofrogue/blob/main/mod/RiskOfRogue/Scripts/parts/engine_tick.lua"
click node_inventory "https://github.com/revoltoftheatoms/riskofrogue/blob/main/sheets/inventory.json"
click node_hud "https://github.com/revoltoftheatoms/riskofrogue/blob/main/mod/RiskOfRogue/Scripts/parts/hud.lua"
click node_buff_icons "https://github.com/revoltoftheatoms/riskofrogue/blob/main/sheets/buffs.json"
click node_item_text "https://github.com/revoltoftheatoms/riskofrogue/blob/main/sheets/item_text.json"
click node_icon_tool "https://github.com/revoltoftheatoms/riskofrogue/blob/main/tools/extract_ror2_assets.py"
click node_icon_assets "https://github.com/revoltoftheatoms/riskofrogue/blob/main/tools/ror2_assets.json"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_startup,node_game,node_hooks,node_state,node_clock toneBlue
class node_item_data,node_orb_items,node_item_effects,node_proc_engine,node_tick_engine,node_inventory toneAmber
class node_hud,node_buff_icons,node_item_text toneMint
class node_icon_tool,node_icon_assets toneRose
class node_player,node_deadzone,node_ror2 toneIndigo
```

## Components

### Mod Runtime

- [Mod Startup](https://github.com/revoltoftheatoms/riskofrogue/blob/main/mod/RiskOfRogue/Scripts/main.lua): `mod/RiskOfRogue/Scripts/main.lua`
- [Game Integration](https://github.com/revoltoftheatoms/riskofrogue/blob/main/mod/RiskOfRogue/Scripts/parts/game.lua): `mod/RiskOfRogue/Scripts/parts/game.lua`
- [Game Hooks](https://github.com/revoltoftheatoms/riskofrogue/blob/main/mod/RiskOfRogue/Scripts/parts/hooks.lua): `mod/RiskOfRogue/Scripts/parts/hooks.lua`
- [Run State](https://github.com/revoltoftheatoms/riskofrogue/blob/main/mod/RiskOfRogue/Scripts/parts/state.lua): `mod/RiskOfRogue/Scripts/parts/state.lua`
- [Difficulty Clock](https://github.com/revoltoftheatoms/riskofrogue/blob/main/mod/RiskOfRogue/Scripts/parts/clock.lua): `mod/RiskOfRogue/Scripts/parts/clock.lua`

### Items and Effects

- [Item Definitions](https://github.com/revoltoftheatoms/riskofrogue/blob/main/mod/RiskOfRogue/Scripts/data_gen.lua): `mod/RiskOfRogue/Scripts/data_gen.lua`
- [Orb Items](https://github.com/revoltoftheatoms/riskofrogue/blob/main/sheets/orbs.json): `sheets/orbs.json`
- [Item Effects](https://github.com/revoltoftheatoms/riskofrogue/blob/main/mod/RiskOfRogue/Scripts/parts/engine_actions.lua): `mod/RiskOfRogue/Scripts/parts/engine_actions.lua`
- [Proc Engine](https://github.com/revoltoftheatoms/riskofrogue/blob/main/mod/RiskOfRogue/Scripts/parts/engine_procs.lua): `mod/RiskOfRogue/Scripts/parts/engine_procs.lua`
- [Effect Ticking](https://github.com/revoltoftheatoms/riskofrogue/blob/main/mod/RiskOfRogue/Scripts/parts/engine_tick.lua): `mod/RiskOfRogue/Scripts/parts/engine_tick.lua`
- [Player Inventory](https://github.com/revoltoftheatoms/riskofrogue/blob/main/sheets/inventory.json): `sheets/inventory.json`

### Game Presentation

- [HUD](https://github.com/revoltoftheatoms/riskofrogue/blob/main/mod/RiskOfRogue/Scripts/parts/hud.lua): `mod/RiskOfRogue/Scripts/parts/hud.lua`
- [Buff Icons](https://github.com/revoltoftheatoms/riskofrogue/blob/main/sheets/buffs.json): `sheets/buffs.json`
- [Item Text](https://github.com/revoltoftheatoms/riskofrogue/blob/main/sheets/item_text.json): `sheets/item_text.json`

### Icon Assets

- [Icon Extractor](https://github.com/revoltoftheatoms/riskofrogue/blob/main/tools/extract_ror2_assets.py): `tools/extract_ror2_assets.py`
- [Icon Asset Map](https://github.com/revoltoftheatoms/riskofrogue/blob/main/tools/ror2_assets.json): `tools/ror2_assets.json`

### Other components

- **Player**
- **Deadzone Game**
- **Risk of Rain 2**

## Connections

- Player → Deadzone Game: plays (evidence: `README.md`)
- Deadzone Game → Mod Startup: loads mod (evidence: `README.md`)
- Player → Orb Items: receives items (evidence: `README.md`)
- Orb Items → Player Inventory: adds items (evidence: `README.md`)
- Item Definitions → Player Inventory: defines stacking (evidence: `README.md`)
- Player Inventory → Player: shows items (evidence: `README.md`)
- Item Definitions → Item Effects: configures effects
- Item Effects → Proc Engine: dispatches procs
- Item Effects → Effect Ticking: runs timed effects
- Mod Startup → Game Integration: initializes
- Game Integration → Game Hooks: registers hooks
- Difficulty Clock → HUD: shows timer (evidence: `README.md`)
- Buff Icons → HUD: shows buff icons (evidence: `README.md`)
- Item Text → Player: provides tooltips (evidence: `README.md`)
- Risk of Rain 2 → Icon Extractor: provides icon assets (evidence: `tools/extract_ror2_assets.py`)
- Icon Asset Map → Icon Extractor: selects textures (evidence: `tools/extract_ror2_assets.py`)
- Icon Extractor → HUD: writes mod icons (evidence: `README.md`)
