# Afterlife Arcade

Dead? Don't just stare at someone else's flashlight. **Afterlife Arcade** gives dead players small multiplayer games to play while they spectate. They show up in an overlay on top of the normal spectate view, and the dead already share their own voice channel in vanilla, so you can trash-talk too.

**Every player in the lobby needs this mod, and everyone needs the same version.** Players without it see and break nothing. They just aren't in the arcade. (One harmless exception: if the **host** has LethalNetworkAPI but not this mod, the host's log shows one LethalNetworkAPI error each time a modded player says hello, at most twice per player per game. Nothing else is affected.)

## Games

| Game | Players | How it works |
|---|---|---|
| **Tile Fall** | 2-8 | You're on a 10x10 board. A tile cracks under you and falls 0.6 s after you step on it, so keep moving. The last player standing wins. After 45 s, random tiles start to crack as well. |
| **Reaction Duel** | 2-8 | A key appears in the box: press it as fast as you can. If you press before the prompt, press under ~120 ms, or press the wrong key, you lose the round. Best of 5. Your reaction is timed on your own PC, so ping doesn't matter, and frame rate only within about a frame. |
| **Solo practice** | 1 | Five rounds of the reaction test against the clock. It is always available, even while you wait for the next match, and it keeps your personal best. |

How a lobby works:
1. When you die, you join the arcade lobby. The overlay opens after 3 seconds (you can change this).
2. Once 2 or more dead players have the overlay open, everyone votes on the game, a 3 s countdown starts, and you play.
3. If you die mid-match, you watch it and play in the next one.
4. When the ship leaves, everyone with the mod (alive players too) sees a short **scoreboard** of the day.
5. If you're revived, the ship leaves, everyone dies or you get fired, the arcade simply closes.

The scoreboard is for bragging rights only. Nothing touches credits, loot or the game itself.

## Ghost Bingo

When you die you get a bingo card. Its squares are things that can happen in this round:
- deaths, by cause and by monster ("Fall to death", "Killed by a Bracken", "Left behind", "Teamkill", "Double kill");
- map events (a mine goes off, a turret goes berserk, the apparatus is pulled, lights out, a teleporter, a fire exit, the
  Cruiser destroyed, a meteor shower, the vote to leave early);
- end-of-round results (the haul reaches the round's target, no bodies recovered).

Only squares the round can actually produce are dealt: no mine square without mines, no "Drowned" unless the moon is
flooded, no Company squares on a moon. Everything that happened before you died already counts, so a new card can
arrive half marked. The first player to complete a line (row, column or diagonal) wins the round's bingo; players who
complete a line on the same event share it. The card is 4x4 by default, 5x5 (free centre) as a host option, and 3x3 on
Company days, which have their own squares (sales, quota met).

Above the card you see how you died: "Killed by: Bracken (approx.)". The game only tells the cause of death, so for some
causes the killer is a guess from what was near you; those say "approx.". If the Coroner mod is installed, its answer
is used instead.

If you get revived you keep your card, and the next death brings back the same card. You never get a new deal.

## Spectator Betting

The dead can bet **Ecto**, the arcade's cosmetic points, on how the round goes:

| Market | What you bet on |
|---|---|
| **Next to die** | which living player dies next (deaths within 1.5 s of each other all count) |
| **X makes it back** | whether a living player is alive when the ship leaves |
| **Haul over/under** | whether the team's haul beats the line (the median of earlier hauls in this lobby) |
| **Will it happen** | one round event per round, e.g. "Will a mine go off?" |

- **Payout:** pari-mutuel. The winners share the whole pool, so the odds you see ("3.1x") come from the other bets.
- **Rules:** stakes are 10, 25 or 50, one bet per market, and no bets on yourself.
- **Fair play:** bets placed in the last 5 seconds before their outcome are refunded. If you get revived, your open
  bets are refunded too. Bets close when the ship starts leaving.
- **Ecto:** everyone starts with 100. Minigame wins (+20, second place +10) and bingo lines (+25 for the round's first
  line, +10 for each further line, +100 for a full card) pay into the same balance. Anyone below 10 is topped up to 20
  at the start of a round. Ecto is kept for the host's lobby and follows your Steam account if you rejoin. It never
  touches credits.

When the round ends, everyone with the mod sees a results card: the **Ghost of the Day** (the most Ecto earned that
round), the bingo winners and your own result. If you survived and the dead bet on you, you also get one line about
it, e.g. "The dead bet 50 Ecto that you wouldn't make it back. You did."

While you are dead, a small bingo card and your open bets also sit at the right edge of the screen, even with the
overlay closed. In the overlay, switch between **Games | Bingo | Bets** with Left/Right (A/D, the arrow keys or the
D-pad) on any screen where those keys don't drive a game.

## Controls

| Action | Keyboard | Gamepad |
|---|---|---|
| Open / close the arcade | **M** | unbound by default (Select is vanilla's free camera) |
| Move / choose | **WASD** or arrow keys | D-pad or left stick |
| Select / "Action" key in the duel | **Space** (Enter also works without InputUtils) | **A / Cross** |
| Switch Games / Bingo / Bets | **A / D** or Left / Right (not while a game uses them) | D-pad or stick left / right |

If [InputUtils](https://thunderstore.io/c/lethal-company/p/Rune580/LethalCompany_InputUtils/) is installed, all of these can be rebound in its keybind menu under *AfterlifeArcade*. **Gamepad players: bind "Toggle Afterlife Arcade" there**, otherwise a hidden overlay only comes back after your next death (the overlay reminds you). Without InputUtils, you can pick a pad button in the config (`Input / PadToggleWithoutInputUtils`). The key hints follow the device you last used.

While the overlay is open, your clicks and mouse movement don't change the spectated player or the camera. Close the overlay and spectating works exactly as in vanilla. A closed overlay counts as AFK, so you won't be put into new matches. The overlay also ignores your keys while you're typing in chat, and it hides while the pause menu is open.

## Config (`BepInEx/config/dev.davesco.AfterlifeArcade.cfg`)

| Section | Key | Default | |
|---|---|---|---|
| General | Enabled | true | Turns the mod off for you |
| General | AutoOpenOnDeath / AutoOpenDelaySeconds | true / 3 | |
| Host | MinPlayers | 2 | Ready dead players needed to start (host only) |
| Host | EnableTileFall / EnableReactionDuel | true / true | Host only |
| Host | VoteSeconds / TileFallMaxSeconds | 10 / 90 | Host only |
| UI | OverlayOpacity / DimSpectateView / SoundVolume | 0.92 / false / 0.6 | |
| UI | MiniHud | true | The small bingo card and bet ticker while dead |
| Bets | Enabled / Stakes | true / 10,25,50 | Host only |
| Bets | LateWindowSeconds / TogetherWindowSeconds / PropMarkets | 5 / 1.5 / 1 | Host only |
| Bets | DisableIfEnhancedSpectator | true | EnhancedSpectator has its own betting |
| Bets | LineForTheLiving | true | Your end-of-round line when you survived |
| Ecto | StartBalance / Floor / TopUp | 100 / 10 / 20 | Host only |
| Bingo | Enabled / CardSize / CountMode | true / 4 / WholeRound | Host only (CardSize 4 or 5; CountMode WholeRound or FromDeath) |
| Bingo | CompanyPool / UseCoroner | true / true | Host only |
| Bingo | DeathRecap | true | "Killed by: ..." above your card |
| Input | PadToggleWithoutInputUtils | None | Only used when InputUtils is missing |
| Debug | VerboseLogging | false | |

With LethalConfig installed you can usually edit these settings in-game too.

## Compatibility

- **Required:** [LethalNetworkAPI](https://thunderstore.io/c/lethal-company/p/xilophor/LethalNetworkAPI/) 3.4.2. **Recommended:** InputUtils.
- Revive mods (UltimateRevive, MirageRevive, ...) work. A revived player leaves the arcade automatically, and the host also removes anyone it sees alive.
- The overlay doesn't touch the spectate camera, so it gets along with camera mods. Other spectator mods that change the same inputs (Poltergeist, EnhancedSpectator, SpectateEnemies, DeadAndBored) have **not been tested**.
- **Optional:** [Coroner](https://thunderstore.io/c/lethal-company/p/EliteMasterEric/Coroner/) makes the death recap and the bingo death squares exact. Without it the arcade guesses (and says "approx.").
- **EnhancedSpectator** has its own audience betting: with it installed, our bets switch off (`Bets / DisableIfEnhancedSpectator`).
- The host runs the games, alive or dead. If the host leaves, the lobby ends anyway. If the host turns the arcade off, everyone in the lobby is told, and they rejoin automatically when it is turned back on.

## Known limitations

- No LobbyCompatibility integration yet, so make sure everyone runs the same modpack. 0.3.0 does not play with 0.2.0.
- Some killers can only be guessed (several monsters kill the same way); those show "approx.".
- Ecto lives as long as the host's lobby; it is not saved between game sessions yet.
- If the host doesn't have the mod, players who have it get solo practice only.
- More games (Dodge) are planned.

## Magyarul

Halott játékosoknak szóló minijátékok, amelyek a spectate nézet fölötti overlay-ben futnak. Mindenkinél fent kell lennie a modnak, ugyanabban a verzióban. Akinél nincs fent, az egyszerűen kimarad, hibát nem okoz.

- **Tile Fall:** 10x10-es pálya, a lépés után 0,6 másodperccel leszakad a csempe. Az nyer, aki utolsóként marad állva.
- **Reaction Duel:** nyomd meg a megjelenő gombot minél gyorsabban. A korai (kb. 120 ms alatti) vagy rossz gombnyomás elveszíti a kört. Öt körös, best of 5. Az időt a saját gépeden méri, így a ping nem számít, a képkockasebesség is legfeljebb egy képkockányit.
- **Gyakorlás:** egyedül is elérhető, a legjobb idődet megjegyzi.
- **Irányítás:** **M** nyitja és zárja az overlay-t, **WASD**/nyilak/D-pad a mozgás, **Space**/A a választás. Kontrollerhez az InputUtils menüjében érdemes beállítani a megnyitó gombot.
- Amikor a hajó elindul, a nap eredménytáblája minden modos játékosnál megjelenik. Ez csak dicsőség, kreditet nem ad.
- Ha a hostnál LethalNetworkAPI van, de ez a mod nincs, a host logjában játékosonként legfeljebb két ártalmatlan LethalNetworkAPI-hibaüzenet jelenhet meg. Más hatása nincs.
- **Ghost Bingo:** halálodkor bingókártyát kapsz. A mezők a kör eseményei (halálok ok és szörny szerint, akna, torony, apparatus, áramszünet, teleporter, vészkijárat, Cruiser, időjárás, zsákmány), és csak olyan mező kerül rá, ami ebben a körben megtörténhet. Az első teljes sor, oszlop vagy átló nyer. Alapból 4x4-es, a host beállíthat 5x5-öt, a Company napján 3x3-as.
- **Halál-összegzés:** „Killed by: Bracken (approx.)” a kártya fölött. Ahol a gyilkos csak becsülhető, ott „approx.” áll mellette. Ha a Coroner mod fent van, az ő válasza számít.
- **Spectator Betting:** a halottak **Ecto**-ban fogadnak (kozmetikai pont, kreditet nem érint): ki hal meg következőnek, hazaér-e valaki, a zsákmány a vonal fölött vagy alatt lesz-e, és körönként egy „megtörténik-e” piac. A nyertesek a teljes kasszán osztoznak. Tét 10/25/50, piaconként egy fogadás, magadra nem fogadhatsz. Az eredmény előtti utolsó 5 másodpercben tett fogadást és a feltámadt játékos fogadásait visszakapod.
- **Ecto:** 100-ról indul; a minijáték-győzelem (+20, második +10) és a bingó (+25 az első sor, +10 minden további, +100 a teli kártya) is ide fizet. A kör végén mindenki látja a nap szellemét (Ghost of the Day), a túlélők pedig egy sort arról, mit fogadtak rájuk a halottak.
- Az overlay-ben a **Games | Bingo | Bets** fülek között balra/jobbra váltasz. Halottként a képernyő jobb szélén egy kis kártya és a fogadásaid is látszanak.
- **A 0.3.0 nem játszik együtt a 0.2.0-val**: mindenkinek frissítenie kell.
