# au-avengers/tou-mira architecture

> Architecture diagram of the GitHub repository au-avengers/tou-mira, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/au-avengers/tou-mira
- Repository: https://github.com/au-avengers/tou-mira

## Overview

Town of Us Mira is a multiplayer Among Us mod adding Town-of-Salem-inspired roles, modifiers, abilities, and alternate game modes. Players use role-specific HUD or meeting abilities during a match; game events and role logic implement their effects, with role assignment and options shaping the match. The README also documents vanilla-role support, balance options, revised visuals, localization, and MiraAPI-mod compatibility. Sampled source confirms the Engineer ability/event path and HUD support; wiring for other unsampled features is not asserted.

Main entry points: [`TownOfUs/Events`](https://github.com/au-avengers/tou-mira/tree/main/TownOfUs/Events) (Gameplay Events), [`TownOfUs/Buttons`](https://github.com/au-avengers/tou-mira/tree/main/TownOfUs/Buttons) (Role Abilities), [`TownOfUs/Patches/RoleManagerPatches.cs`](https://github.com/au-avengers/tou-mira/blob/main/TownOfUs/Patches/RoleManagerPatches.cs) (Role Assignment), [`TownOfUs/Modules/DraftMode/DraftEngine.cs`](https://github.com/au-avengers/tou-mira/blob/main/TownOfUs/Modules/DraftMode/DraftEngine.cs) (Role Draft)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_match["Match Setup"]
  node_assignment["Role Assignment"]
  node_draft["Role Draft<br/>[DraftEngine.cs]"]
  node_options["Role Options<br/>[EngineerOptions.cs]"]
end

subgraph group_gameplay["Role Gameplay"]
  node_roles["Roles"]
  node_abilities["Role Abilities"]
  node_meeting["Meeting Abilities"]
  node_modifiers["Modifiers"]
end

subgraph group_presentation["Player Interface"]
  node_hud["HUD"]
  node_chat["Chat UI"]
end

subgraph group_runtime["Game Runtime"]
  node_events["Gameplay Events"]
  node_modes["Game Modes"]
  node_state["Rewind State"]
  node_gameover["Game Outcomes"]
end

subgraph group_extensions["Mod Extensions"]
  node_compat["MiraAPI Compatibility"]
end

node_players(("Players"))
node_amongus["Among Us"]

node_players -->|"activate"| node_abilities
node_players -->|"activate"| node_meeting
node_amongus -->|"role setup"| node_assignment
node_assignment -->|"assigns roles"| node_roles
node_draft -->|"drafts roles"| node_assignment
node_options -->|"configures"| node_abilities
node_abilities -->|"invokes events"| node_events
node_events -->|"updates uses"| node_abilities
node_amongus -->|"game events"| node_events
node_amongus -->|"HUD updates"| node_hud
node_amongus -->|"chat updates"| node_chat
node_amongus -->|"runs mode"| node_modes
node_events -->|"records changes"| node_state
node_amongus -->|"game end"| node_gameover
node_compat -.->|"integrates"| node_amongus

click node_assignment "https://github.com/au-avengers/tou-mira/blob/main/TownOfUs/Patches/RoleManagerPatches.cs"
click node_draft "https://github.com/au-avengers/tou-mira/blob/main/TownOfUs/Modules/DraftMode/DraftEngine.cs"
click node_options "https://github.com/au-avengers/tou-mira/blob/main/TownOfUs/Options/Roles/Crewmate/EngineerOptions.cs"
click node_roles "https://github.com/au-avengers/tou-mira/tree/main/TownOfUs/Roles"
click node_abilities "https://github.com/au-avengers/tou-mira/tree/main/TownOfUs/Buttons"
click node_meeting "https://github.com/au-avengers/tou-mira/tree/main/TownOfUs/MeetingAbilities"
click node_modifiers "https://github.com/au-avengers/tou-mira/tree/main/TownOfUs/Modifiers"
click node_events "https://github.com/au-avengers/tou-mira/tree/main/TownOfUs/Events"
click node_modes "https://github.com/au-avengers/tou-mira/tree/main/TownOfUs/GameModes"
click node_state "https://github.com/au-avengers/tou-mira/blob/main/TownOfUs/Modules/TimeLord/TimeLordBodyManager.cs"
click node_hud "https://github.com/au-avengers/tou-mira/blob/main/TownOfUs/Modules/Components/HudManagerHelper.cs"
click node_chat "https://github.com/au-avengers/tou-mira/blob/main/TownOfUs/Patches/Roles/ChatControllerPatches.cs"
click node_gameover "https://github.com/au-avengers/tou-mira/tree/main/TownOfUs/GameOver"
click node_compat "https://github.com/au-avengers/tou-mira/blob/main/TownOfUs/Integrations/PerfectCommsIntegration.cs"

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_assignment,node_draft,node_options toneBlue
class node_roles,node_abilities,node_meeting,node_modifiers toneAmber
class node_hud,node_chat toneMint
class node_events,node_modes,node_state,node_gameover toneRose
class node_compat,node_players,node_amongus toneIndigo
```

## Components

### Match Setup

- [Role Assignment](https://github.com/au-avengers/tou-mira/blob/main/TownOfUs/Patches/RoleManagerPatches.cs): `TownOfUs/Patches/RoleManagerPatches.cs`
- [Role Draft](https://github.com/au-avengers/tou-mira/blob/main/TownOfUs/Modules/DraftMode/DraftEngine.cs): `TownOfUs/Modules/DraftMode/DraftEngine.cs`
- [Role Options](https://github.com/au-avengers/tou-mira/blob/main/TownOfUs/Options/Roles/Crewmate/EngineerOptions.cs): `TownOfUs/Options/Roles/Crewmate/EngineerOptions.cs`

### Role Gameplay

- [Roles](https://github.com/au-avengers/tou-mira/tree/main/TownOfUs/Roles): `TownOfUs/Roles`
- [Role Abilities](https://github.com/au-avengers/tou-mira/tree/main/TownOfUs/Buttons): `TownOfUs/Buttons`
- [Meeting Abilities](https://github.com/au-avengers/tou-mira/tree/main/TownOfUs/MeetingAbilities): `TownOfUs/MeetingAbilities`
- [Modifiers](https://github.com/au-avengers/tou-mira/tree/main/TownOfUs/Modifiers): `TownOfUs/Modifiers`

### Player Interface

- [HUD](https://github.com/au-avengers/tou-mira/blob/main/TownOfUs/Modules/Components/HudManagerHelper.cs): `TownOfUs/Modules/Components/HudManagerHelper.cs`
- [Chat UI](https://github.com/au-avengers/tou-mira/blob/main/TownOfUs/Patches/Roles/ChatControllerPatches.cs): `TownOfUs/Patches/Roles/ChatControllerPatches.cs`

### Game Runtime

- [Gameplay Events](https://github.com/au-avengers/tou-mira/tree/main/TownOfUs/Events): `TownOfUs/Events`
- [Game Modes](https://github.com/au-avengers/tou-mira/tree/main/TownOfUs/GameModes): `TownOfUs/GameModes`
- [Rewind State](https://github.com/au-avengers/tou-mira/blob/main/TownOfUs/Modules/TimeLord/TimeLordBodyManager.cs): `TownOfUs/Modules/TimeLord/TimeLordBodyManager.cs`
- [Game Outcomes](https://github.com/au-avengers/tou-mira/tree/main/TownOfUs/GameOver): `TownOfUs/GameOver`

### Mod Extensions

- [MiraAPI Compatibility](https://github.com/au-avengers/tou-mira/blob/main/TownOfUs/Integrations/PerfectCommsIntegration.cs): `TownOfUs/Integrations/PerfectCommsIntegration.cs`

### Other components

- **Players**
- **Among Us**

## Connections

- Players → Role Abilities: activate
- Players → Meeting Abilities: activate
- Among Us → Role Assignment: role setup
- Role Assignment → Roles: assigns roles
- Role Draft → Role Assignment: drafts roles
- Role Options → Role Abilities: configures
- Role Abilities → Gameplay Events: invokes events
- Gameplay Events → Role Abilities: updates uses
- Among Us → Gameplay Events: game events
- Among Us → HUD: HUD updates
- Among Us → Chat UI: chat updates
- Among Us → Game Modes: runs mode
- Gameplay Events → Rewind State: records changes
- Among Us → Game Outcomes: game end
- MiraAPI Compatibility → Among Us: integrates
