# KarmaOne — Karma-1 Railgun for Lethal Company v73/v80
Standalone rebuild of the Karma-1 railgun from LeoLR's MoreItems mod,
updated for **LC v80** and **LethalLib 1.2.0**.

---

## Configuration
Config file is generated at first run inside your BepInEx config folder:
`BepInEx/config/karmaone.karma1.cfg`

| Section | Key | Default | Description |
|---|---|---|---|
| Shop | `Purchasable` | `true` | Adds the gun to the terminal shop |
| Shop | `Price` | `700` | Shop price in credits |
| Combat | `Damage` | `100` | Damage per shot (players have 100 HP, so 100 = one-shot) |
| Combat | `UsesPerCharge` | `2` | Full shots per battery charge |
| Combat | `ShotCooldown` | `5.0` | Seconds the gun must cool down after firing before it can be charged again |
| Charging | `ChargeTime` | `2.0` | Seconds to hold [Use] before the scope goes green and the gun can fire |
| Charging | `FireWindow` | `0.9` | Seconds the gun stays in the green fire window before overcharging (only relevant when OverchargeEnabled is true) |
| Overcharge | `OverchargeEnabled` | `true` | If true, holding past the fire window explodes: damages holder, drains battery, enters cooldown. If false, the fire window lasts indefinitely with no penalty |
| Battery | `RegenInterval` | `30.0` | Seconds between each passive battery regen tick. Set to 0 to disable passive regen entirely |
| Battery | `RegenAmount` | `10` | Percentage of battery restored per regen tick (1–100) |
| Physical | `WeightLbs` | `31.5` | Weight of the gun in lbs. Vanilla reference: Shotgun = 19 lbs, Jetpack = 52 lbs |

---

## Gameplay
- **Hold [Use]** to charge. Scope indicator colours:
  - Dark → ready
  - Bright green → in fire window, release now
  - Orange/red → danger zone, about to explode
- **Release** in the green window to fire a hitscan shot
- Overcharging past the red threshold triggers an explosion — damages you and drains the battery entirely
- Battery regens over time, or recharge instantly at the ship charger

---

## Changelog

### 2.0.2
- Fix: Item no longer detaches from hand vertically after TooManyEmotes emotes
- Fix: SMR bone nulling moved before base.Update() for robust transform-following
- Fix: LateUpdate re-parents to localItemHolder when model-swapped by emotes

### 2.0.1
- Fix: Gun no longer breaks after shooting modded monsters (shoot flag + try-catch)
- Fix: Friendly fire now works for host (always uses DamagePlayerFromOtherClientServerRpc)
- Fix: Incorrect playerThatHit parameter corrected

### 2.0.0
- Complete backend rework — fixed for reliable multiplayer support

### 1.0.0
- Initial release
