# Mechanics

# Mechanics

:::caution[In development]
This page describes the current development build (4.4.3). Values and features can still change before release.
:::

---

## Dungeon Maps

A dungeon map is an item (`KS_Dungeon_Map_Common` … `KS_Dungeon_Map_Legendary`) named after its rarity, for example "Epic Dungeon Map". Its details are shown in the hover tooltip (with DynamicTooltipsLib), in the maps window, with `/ksdungeon mapinfo` and in chat when you use the map. Picking up a map or a stone posts a short chat line, for example "+ Rare Forest Ruins Map (Lvl 12)".

Each map stores:

| Field | Meaning |
|-------|---------|
| **Biome** | Which biome the arena uses |
| **Rarity** | Common, Uncommon, Rare, Epic or Legendary; sets the difficulty and the modifier cap |
| **Level** | Taken from the mob that dropped it |
| **Quality** | 1–100 %; scales every modifier value (from 0.5× to 1.5×) |
| **Size** | Small, Medium, Large or Massive arena |
| **Shape** | Circular, Rectangular or Irregular |
| **Modifiers** | Up to the rarity's cap, about half prefixes and half suffixes |

### Where maps come from

- **Open world:** every regular mob kill has a chance to drop a map (`mapDrops.chance`, default 5 %). Higher rarities lean toward larger arenas, higher quality and more modifiers.
- **Bosses:** a boss killed inside a dungeon always drops boss-tier maps, one per party member. Boss-tier maps are never Common (about 22 % Epic and 11 % Legendary).
- Regular mobs inside a dungeon drop no maps.

### Using a map

Right-click a map, or select it in the maps window (`/ksdungeon maps`) and press **Open Dungeon**. The map is used up and the run starts with exactly the map's values. Players already in a dungeon keep their map.

### Combining maps

In the **Crafting** mode of the maps window, put three maps of the same rarity into the slots and press **Combine**. You get one map of the next rarity with new modifiers and the highest quality of the three. Legendary maps cannot be combined further.

---

## Difficulty

The map's rarity sets the difficulty. Runs started from the dungeon browser use the difficulty you pick there.

| Difficulty | Map rarity | Mob health | Mob damage | Team lives |
|------------|-----------|-----------|------------|-----------|
| **Easy** | Common | 0.7× | 0.7× | default + 2 |
| **Normal** | Uncommon | 1.0× | 1.0× | default |
| **Hard** | Rare | 1.5× | 1.5× | default − 1 |
| **Heroic** | Epic, Legendary | 2.0× | 2.0× | default − 2 |

The default team lives come from `dungeon.defaultTeamLives` (3). A run always has at least one life.

---

## Modifiers

| Modifier | Kind | Range | Effect in this build |
|----------|------|-------|----------------------|
| Monster Damage | Prefix | 10–100 % | Mobs deal more damage to players in the run |
| Monster Life | Prefix | 10–150 % | Mobs have more health |
| Reduced Time | Prefix | 10–40 % | Shorter time limit |
| Monster Speed | Prefix | 5–40 % | No effect yet |
| Monster Attack Speed | Prefix | 10–50 % | No effect yet |
| Reduced Healing | Prefix | 20–60 % | No effect yet |
| Monster Count | Suffix | 10–50 % | More mobs |
| Elite Chance | Suffix | 5–30 % | Some regular mobs spawn as elites |
| Experience | Suffix | 10–50 % | More tokens at the end of the run |
| Stone Drops | Suffix | 5–30 % | Higher stone drop chance inside the run |
| Item Quantity | Suffix | 5–50 % | No effect yet (item loot is not handed out yet) |
| Item Rarity | Suffix | 5–40 % | No effect yet (item loot is not handed out yet) |

The range is the rolled base value; the map's quality then scales it between 0.5× and 1.5×.

---

## Crafting Stones

Stones drop from any mob kill (`stoneDrops.chance`, default 2 %; inside a run the map's Stone Drops suffix raises it). Right-click a stone to apply it to the first dungeon map in your inventory, or choose a map in the maps window and use **Apply Stone**. A stone is only used up when it changed something; for example a Regal Stone on a Legendary map stays in your inventory.

| Stone | Effect |
|-------|--------|
| **Chaos Stone** | Re-rolls all modifiers |
| **Regal Stone** | Upgrades the rarity by one tier |
| **Cartographer Stone** | Changes the biome (always to a different one) |
| **Alchemy Stone** | Turns a Common map into Uncommon with fresh modifiers |
| **Scour Stone** | Removes all modifiers |
| **Mirror Stone** | Duplicates the map (extremely rare) |
| **Annul Stone** | Removes one random modifier |
| **Exalt Stone** | Adds one modifier, up to the rarity cap |

---

## Run Stages

Every run is an open arena that is prepared for the party and removed afterwards.

1. **Surface** — the first mob wave on the surface.
2. **Caves** — when the surface is clear, a new wave spawns in the cave network below; follow the shaft down.
3. **Bosses** — when the caves are clear, the biome's bosses spawn at the center.
4. **Finale** — bosses dead, the run completes.

Reinforcements arrive while a stage drags on. The time limit depends on the arena size (Small 20 min, Medium 40 min, Large 60 min, Massive 90 min) and the Reduced Time modifier.

### Team lives and death

The team shares its lives. A death costs one life; players skip the death screen and respawn automatically. When no lives are left, the run fails. `/ksdungeon leave` leaves a run early.

### Parties

Runs are solo in this build. `/ksdungeon party create` and `/ksdungeon party leave` exist, but inviting other players is not available yet.

---

## Scoring and Tokens

When a run is completed, every member gets a chat summary: time, deaths, score and rank. The score depends on time, deaths, the share of mobs killed and the difficulty.

Each member also receives **dungeon tokens**. The amount depends on difficulty, score, party size, arena size and the Experience suffix. Tokens are stored per player; there is no shop to spend them yet.

After a completed run the biome is marked as on cooldown for the party members (`cooldown.defaultMinutes`, default 30), and the dungeon browser shows "On cooldown" for it. In this build the cooldown is only shown; it does not block a new run.

---

## Achievements

With KyuubiSoft Achievements installed, finished runs send the triggers `dungeon_complete_any`, `dungeon_complete_<biome>`, `dungeon_rarity_<rarity>` and `dungeon_no_death`. Achievements ships "Dungeon Diver" achievements that use them.