# sylpyuanw/trk-nine architecture

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

- Interactive diagram: https://gitdiagram.com/sylpyuanw/trk-nine
- Repository: https://github.com/sylpyuanw/trk-nine

## Overview

TRK-Nine is a RimWorld gameplay mod implemented as C# extensions plus game Defs and assets. Its central player-facing workflow is equipping the configurable Delivery Box, switching weapon forms, and using form-specific combat and abilities; the mod also adds the Death Bow, armor-set effects, and combat patches. The graph emphasizes runtime components. Evidence is limited to the README and sampled source: unsampled subsystems are included where their paths are clear, but uncertain wiring is omitted.

Main entry points: [`Source/ClassLibrary1/Weapon/Weapon_DeliveryBox.cs`](https://github.com/sylpyuanw/trk-nine/blob/main/Source/ClassLibrary1/Weapon/Weapon_DeliveryBox.cs) (Form Transformer), [`Source/ClassLibrary1/Abilities/Ability_DeliveryBoxHighPower.cs`](https://github.com/sylpyuanw/trk-nine/blob/main/Source/ClassLibrary1/Abilities/Ability_DeliveryBoxHighPower.cs) (High Power Ability), [`Source/ClassLibrary1/Weapon/BowOfDeath/CompEquippable_DeathBow.cs`](https://github.com/sylpyuanw/trk-nine/blob/main/Source/ClassLibrary1/Weapon/BowOfDeath/CompEquippable_DeathBow.cs) (Bow Equipment), [`Source/ClassLibrary1/Weapon/BowOfDeath/DeathBowDefOf.cs`](https://github.com/sylpyuanw/trk-nine/blob/main/Source/ClassLibrary1/Weapon/BowOfDeath/DeathBowDefOf.cs) (Bow Def References)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_delivery["Delivery Box"]
  node_boxform["Form Transformer"]
  node_boxdisplay["Form Display"]
  node_boxeffects["Form Effects"]
  node_boxstats["Melee Stat Patches"]
  node_highpower["High Power Ability"]
  node_highpowergizmo["High Power Gizmo"]
  node_breakthrough["Breakthrough Tool"]
end

subgraph group_bow["Death Bow"]
  node_bowcomponent["Bow Equipment"]
  node_bowdefs["Bow Def References<br/>[DeathBowDefOf.cs]"]
  node_bowprojectile["Arrow Projectile"]
  node_bowvfx["Aim Visual Effects"]
end

subgraph group_abilities["Abilities And Gear"]
  node_setpiece["Set Piece Counter<br/>[Comp_SetPiece.cs]"]
  node_liuset["Liu Set Effects<br/>[Hediff_LiuSet.cs]"]
  node_zwei["Zwei Aura<br/>[Hediff_ZweiAura.cs]"]
  node_equippedhediff["Equipped Hediff"]
end

subgraph group_combat["Combat Rules"]
  node_rangedodge["Ranged Dodge"]
end

node_player(("Player"))
node_rimworld["RimWorld Runtime"]

node_player -.->|"switches forms"| node_boxform
node_boxform -->|"provides form tools"| node_boxstats
node_boxform -->|"supplies mode"| node_boxeffects
node_boxform -.->|"manages ability"| node_highpower
node_boxform -.->|"adds skill gizmo"| node_breakthrough
node_highpower -->|"adds health effect"| node_rimworld
node_player -.->|"uses bow controls"| node_bowcomponent
node_bowcomponent -->|"references definitions"| node_bowdefs
node_bowprojectile -->|"reads arrow definition"| node_bowdefs
node_setpiece -->|"grants ability"| node_rimworld
node_rangedodge -->|"patches damage intake"| node_rimworld

click node_boxform "https://github.com/sylpyuanw/trk-nine/blob/main/Source/ClassLibrary1/Weapon/Weapon_DeliveryBox.cs"
click node_boxdisplay "https://github.com/sylpyuanw/trk-nine/blob/main/Source/ClassLibrary1/Weapon/Weapon_DeliveryBox_DisplayPatches.cs"
click node_boxeffects "https://github.com/sylpyuanw/trk-nine/blob/main/Source/ClassLibrary1/Weapon/Weapon_DeliveryBox_EffectPatches.cs"
click node_boxstats "https://github.com/sylpyuanw/trk-nine/blob/main/Source/ClassLibrary1/StatWorker_MeleeAveragePatches.cs"
click node_highpower "https://github.com/sylpyuanw/trk-nine/blob/main/Source/ClassLibrary1/Abilities/Ability_DeliveryBoxHighPower.cs"
click node_highpowergizmo "https://github.com/sylpyuanw/trk-nine/blob/main/Source/ClassLibrary1/Abilities/Gizmo_DeliveryBoxHighPower.cs"
click node_breakthrough "https://github.com/sylpyuanw/trk-nine/blob/main/Source/ClassLibrary1/Abilities/Ability_BreakthroughTool.cs"
click node_bowcomponent "https://github.com/sylpyuanw/trk-nine/blob/main/Source/ClassLibrary1/Weapon/BowOfDeath/CompEquippable_DeathBow.cs"
click node_bowdefs "https://github.com/sylpyuanw/trk-nine/blob/main/Source/ClassLibrary1/Weapon/BowOfDeath/DeathBowDefOf.cs"
click node_bowprojectile "https://github.com/sylpyuanw/trk-nine/blob/main/Source/ClassLibrary1/Weapon/BowOfDeath/Projectile_DeathBowArrow.cs"
click node_bowvfx "https://github.com/sylpyuanw/trk-nine/blob/main/Source/ClassLibrary1/Weapon/BowOfDeath/Mote_DeathBowAimVfx.cs"
click node_setpiece "https://github.com/sylpyuanw/trk-nine/blob/main/Source/ClassLibrary1/Hediff/Comp_SetPiece.cs"
click node_liuset "https://github.com/sylpyuanw/trk-nine/blob/main/Source/ClassLibrary1/Abilities/Hediff_LiuSet.cs"
click node_zwei "https://github.com/sylpyuanw/trk-nine/blob/main/Source/ClassLibrary1/Abilities/Hediff_ZweiAura.cs"
click node_equippedhediff "https://github.com/sylpyuanw/trk-nine/blob/main/Source/ClassLibrary1/Hediff/Comp_EquippedHediff.cs"
click node_rangedodge "https://github.com/sylpyuanw/trk-nine/blob/main/Source/ClassLibrary1/Combat/Patch_Pawn_PreApplyDamage_RangeDodge.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_boxform,node_boxdisplay,node_boxeffects,node_boxstats,node_highpower,node_highpowergizmo,node_breakthrough toneBlue
class node_bowcomponent,node_bowdefs,node_bowprojectile,node_bowvfx toneAmber
class node_setpiece,node_liuset,node_zwei,node_equippedhediff toneMint
class node_rangedodge toneRose
class node_player,node_rimworld toneIndigo
```

## Components

### Delivery Box

- [Form Transformer](https://github.com/sylpyuanw/trk-nine/blob/main/Source/ClassLibrary1/Weapon/Weapon_DeliveryBox.cs): `Source/ClassLibrary1/Weapon/Weapon_DeliveryBox.cs`
- [Form Display](https://github.com/sylpyuanw/trk-nine/blob/main/Source/ClassLibrary1/Weapon/Weapon_DeliveryBox_DisplayPatches.cs): `Source/ClassLibrary1/Weapon/Weapon_DeliveryBox_DisplayPatches.cs`
- [Form Effects](https://github.com/sylpyuanw/trk-nine/blob/main/Source/ClassLibrary1/Weapon/Weapon_DeliveryBox_EffectPatches.cs): `Source/ClassLibrary1/Weapon/Weapon_DeliveryBox_EffectPatches.cs`
- [Melee Stat Patches](https://github.com/sylpyuanw/trk-nine/blob/main/Source/ClassLibrary1/StatWorker_MeleeAveragePatches.cs): `Source/ClassLibrary1/StatWorker_MeleeAveragePatches.cs`
- [High Power Ability](https://github.com/sylpyuanw/trk-nine/blob/main/Source/ClassLibrary1/Abilities/Ability_DeliveryBoxHighPower.cs): `Source/ClassLibrary1/Abilities/Ability_DeliveryBoxHighPower.cs`
- [High Power Gizmo](https://github.com/sylpyuanw/trk-nine/blob/main/Source/ClassLibrary1/Abilities/Gizmo_DeliveryBoxHighPower.cs): `Source/ClassLibrary1/Abilities/Gizmo_DeliveryBoxHighPower.cs`
- [Breakthrough Tool](https://github.com/sylpyuanw/trk-nine/blob/main/Source/ClassLibrary1/Abilities/Ability_BreakthroughTool.cs): `Source/ClassLibrary1/Abilities/Ability_BreakthroughTool.cs`

### Death Bow

- [Bow Equipment](https://github.com/sylpyuanw/trk-nine/blob/main/Source/ClassLibrary1/Weapon/BowOfDeath/CompEquippable_DeathBow.cs): `Source/ClassLibrary1/Weapon/BowOfDeath/CompEquippable_DeathBow.cs`
- [Bow Def References](https://github.com/sylpyuanw/trk-nine/blob/main/Source/ClassLibrary1/Weapon/BowOfDeath/DeathBowDefOf.cs): `Source/ClassLibrary1/Weapon/BowOfDeath/DeathBowDefOf.cs`
- [Arrow Projectile](https://github.com/sylpyuanw/trk-nine/blob/main/Source/ClassLibrary1/Weapon/BowOfDeath/Projectile_DeathBowArrow.cs): `Source/ClassLibrary1/Weapon/BowOfDeath/Projectile_DeathBowArrow.cs`
- [Aim Visual Effects](https://github.com/sylpyuanw/trk-nine/blob/main/Source/ClassLibrary1/Weapon/BowOfDeath/Mote_DeathBowAimVfx.cs): `Source/ClassLibrary1/Weapon/BowOfDeath/Mote_DeathBowAimVfx.cs`

### Abilities And Gear

- [Set Piece Counter](https://github.com/sylpyuanw/trk-nine/blob/main/Source/ClassLibrary1/Hediff/Comp_SetPiece.cs): `Source/ClassLibrary1/Hediff/Comp_SetPiece.cs`
- [Liu Set Effects](https://github.com/sylpyuanw/trk-nine/blob/main/Source/ClassLibrary1/Abilities/Hediff_LiuSet.cs): `Source/ClassLibrary1/Abilities/Hediff_LiuSet.cs`
- [Zwei Aura](https://github.com/sylpyuanw/trk-nine/blob/main/Source/ClassLibrary1/Abilities/Hediff_ZweiAura.cs): `Source/ClassLibrary1/Abilities/Hediff_ZweiAura.cs`
- [Equipped Hediff](https://github.com/sylpyuanw/trk-nine/blob/main/Source/ClassLibrary1/Hediff/Comp_EquippedHediff.cs): `Source/ClassLibrary1/Hediff/Comp_EquippedHediff.cs`

### Combat Rules

- [Ranged Dodge](https://github.com/sylpyuanw/trk-nine/blob/main/Source/ClassLibrary1/Combat/Patch_Pawn_PreApplyDamage_RangeDodge.cs): `Source/ClassLibrary1/Combat/Patch_Pawn_PreApplyDamage_RangeDodge.cs`

### Other components

- **Player**
- **RimWorld Runtime**

## Connections

- Player → Form Transformer: switches forms
- Form Transformer → Melee Stat Patches: provides form tools (evidence: `Source/ClassLibrary1/StatWorker_MeleeAveragePatches.cs`)
- Form Transformer → Form Effects: supplies mode (evidence: `Source/ClassLibrary1/Weapon/Weapon_DeliveryBox_EffectPatches.cs`)
- Form Transformer → High Power Ability: manages ability
- Form Transformer → Breakthrough Tool: adds skill gizmo
- High Power Ability → RimWorld Runtime: adds health effect (evidence: `Source/ClassLibrary1/Abilities/Ability_DeliveryBoxHighPower.cs`)
- Player → Bow Equipment: uses bow controls
- Bow Equipment → Bow Def References: references definitions (evidence: `Source/ClassLibrary1/Weapon/BowOfDeath/CompEquippable_DeathBow.cs`)
- Arrow Projectile → Bow Def References: reads arrow definition (evidence: `Source/ClassLibrary1/Weapon/BowOfDeath/Projectile_DeathBowArrow.cs`)
- Set Piece Counter → RimWorld Runtime: grants ability (evidence: `Source/ClassLibrary1/Hediff/Comp_SetPiece.cs`)
- Ranged Dodge → RimWorld Runtime: patches damage intake (evidence: `Source/ClassLibrary1/Combat/Patch_Pawn_PreApplyDamage_RangeDodge.cs`)
