# Mob settings

Mask Man, raids, Meltdown Elementals, mob gear and glyphids.

Registry: `hbm:mob_config`. Files: `data/hbm/hbm/mob_config/<group>.json`. See [Game settings](https://movblock.mov/ntm-next/26.3/wiki/game-settings.md) for loading, replacement and validation.

## maskman

Mask Man spawns near a player who has crafted or used an Ore Acidizer, has at least `min_rad` radiation and, with `underground`, stands more than 3 blocks below the light-blocking surface. Players are checked once per second outside the Nether and End, except on Peaceful.

| Field | Meaning and default | Range |
| - | - | - |
| `delay` | Seconds a player must meet the conditions before Mask Man spawns; a warning appears 60 seconds earlier; default `1200`. | `[0, i32::MAX]` |
| `enabled` | Enables Mask Man; default `true`. | |
| `min_rad` | Minimum player radiation in RAD; default `50`. | `[0, i32::MAX]` |
| `underground` | Requires the player to be underground; default `true`. | |

Example: `data/hbm/hbm/mob_config/maskman.json`.

```json
{
  "delay": 1200,
  "enabled": true,
  "min_rad": 50,
  "underground": true
}
```

## raids

Every `delay` ticks, each dimension other than the Nether and End has a 1 in `chance` chance to raid a random player in it.

| Field | Meaning and default | Range |
| - | - | - |
| `amount` | FBI Agents per raid; default `15`. | `[0, i32::MAX]` |
| `attack_delay` | Ticks between an FBI Agent's attempts to break an `#hbm:fbi_breakable` block; default `40`. | `[1, i32::MAX]` |
| `attack_distance` | Distance in blocks from the player to the raid's spawn point; default `32`. | `[0, i32::MAX]` |
| `attack_reach` | Reach in blocks of an FBI Agent's block-breaking attempt; default `2`. | `[0, i32::MAX]` |
| `chance` | Raid chance denominator; default `3`. | `[1, i32::MAX]` |
| `delay` | Ticks between raid rolls; default `108000`. | `[1, i32::MAX]` |
| `drones` | FBI Drones per raid; default `5`. | `[0, i32::MAX]` |
| `enabled` | Enables raids; default `false`. | |

Example: `data/hbm/hbm/mob_config/raids.json`.

```json
{
  "amount": 15,
  "attack_delay": 40,
  "attack_distance": 32,
  "attack_reach": 2,
  "chance": 3,
  "delay": 108000,
  "drones": 5,
  "enabled": false
}
```

## elementals

Every `delay` ticks, each dimension other than the Nether and End has a 1 in `chance` chance to pick a random player in it. Meltdown Elementals spawn if that player was within 100 blocks of a ZIRNOX Nuclear Reactor or Research Reactor (LEGACY) meltdown since their last elemental event.

| Field | Meaning and default | Range |
| - | - | - |
| `amount` | Meltdown Elementals per event; the first leads; default `10`. | `[0, i32::MAX]` |
| `chance` | Event chance denominator; default `2`. | `[1, i32::MAX]` |
| `delay` | Ticks between event rolls; default `108000`. | `[1, i32::MAX]` |
| `distance` | Spawn distance in blocks from the player; default `32`. | `[0, i32::MAX]` |
| `enabled` | Enables Meltdown Elemental events and meltdown marking; default `true`. | |

Example: `data/hbm/hbm/mob_config/elementals.json`.

```json
{
  "amount": 10,
  "chance": 2,
  "delay": 108000,
  "distance": 32,
  "enabled": true
}
```

## gear

Naturally spawned zombies and skeletons roll equipment by the soot pollution at their position.

| Field | Meaning and default | Range |
| - | - | - |
| `enabled` | Enables soot-based equipment; default `true`. | |
| `weapon_soot_reduction` | Subtracted from soot before the skeleton gun roll; default `0`. | finite `f64` |
| `weapons` | Skeletons can receive guns; requires `enabled`; default `true`. | |

Example: `data/hbm/hbm/mob_config/gear.json`.

```json
{
  "enabled": true,
  "weapon_soot_reduction": 0,
  "weapons": true
}
```

## glyphids

`enabled` and `hive_spawn` control hive generation. Glyphid Hive Spawners use the spawn keys.

A Glyphid Hive Spawner runs while a living player is within `required_player_range` blocks; its first cycle outside Peaceful runs without a player. A cycle makes up to `spawn_count` spawn attempts within `spawn_range` blocks and stops when the glyphids within `spawn_range` reach `max_nearby_entities`. After a cycle that spawned a glyphid or found the cap, the spawner waits a random `min_spawn_delay` to `max_spawn_delay` ticks, inclusive; otherwise it waits `failed_spawn_delay` ticks. With soot at least `scout_threshold`, a cycle's last attempt spawns a Glyphid Scout with chance `1/(n+1)`, `n` = `scout_swarm_spawn_chance`; radioactive spawners never spawn scouts.

Each variant uses `<variant>_chance_base` `b`, `<variant>_chance_mod` `m` and `<variant>_chance_min_soot`. With `s` the soot pollution at the spawner:

$$
c = \operatorname{trunc}\!\left(b + m - \frac{m}{\max\left((s+1)/3,\ 1\right)}\right)
$$

A variant cannot spawn while `s` is below its `<variant>_chance_min_soot`.

Each attempt picks a variant with weight $\operatorname{clamp}(c, -1, 99) + 1$.

| Variant | `<variant>` | `_chance_base` | `_chance_mod` | `_chance_min_soot` |
| - | - | - | - | - |
| Glyphid | `glyphid` | 50 | -45 | 0 |
| Glyphid Bombardier | `bombardier` | 20 | -15 | 1 |
| Glyphid Brawler | `brawler` | 10 | 30 | 1 |
| Glyphid Digger | `digger` | -15 | 25 | 5 |
| Glyphid Blaster | `blaster` | -5 | 40 | 5 |
| Glyphid Behemoth | `behemoth` | -30 | 45 | 10 |
| Brenda | `brenda` | -50 | 60 | 20 |
| Big Man Johnson | `johnson` | -50 | 60 | 50 |

| Field | Meaning and default | Range |
| - | - | - |
| `<variant>_chance_base` | Base chance `b`; defaults in the variant table. | `i32` |
| `<variant>_chance_min_soot` | Minimum soot; defaults in the variant table. | `[0, i32::MAX]` |
| `<variant>_chance_mod` | Soot modifier `m`; defaults in the variant table. | `i32` |
| `enabled` | Generates glyphid hives; default `true`. | |
| `failed_spawn_delay` | Ticks before the next cycle after a cycle that spawned nothing; default `20`. | `[1, i32::MAX]` |
| `hive_spawn` | Chance 1 in this value per new Overworld chunk to generate a glyphid hive; default `256`. | `[1, i32::MAX]` |
| `max_nearby_entities` | Glyphid cap within `spawn_range`; `0` disables spawning; default `6`. | `[0, i32::MAX]` |
| `max_spawn_delay` | Maximum delay in ticks after a cycle that spawned or found the cap; at least `min_spawn_delay`; default `799`. | `[1, i32::MAX]` |
| `min_spawn_delay` | Minimum delay in ticks after a cycle that spawned or found the cap; default `200`. | `[1, i32::MAX]` |
| `rampant_dig` | Glyphids dig toward their waypoints; Glyphid Diggers always dig; default `false`. | |
| `rampant_extended_targetting` | Glyphids other than scouts search for players within 128 blocks instead of 16; default `false`. | |
| `rampant_glyphid_guidance` | Glyphid Scouts head toward the last bed a player tried to sleep in; default `false`. | |
| `rampant_mode` | Enables rampant mode, below; default `false`. | |
| `rampant_natural_scout_spawn` | Natural mob-spawn attempts at sky-exposed Overworld positions have a 1 in `rampant_scout_spawn_chance` chance to spawn a Glyphid Scout and a Glyphid Digger where soot is at least `rampant_scout_spawn_thresh`; default `false`. | |
| `rampant_scout_spawn_chance` | Natural scout chance denominator; default `1400`. | `[1, i32::MAX]` |
| `rampant_scout_spawn_thresh` | Minimum soot for natural scouts; default `13`. | `[0, f64::MAX]` |
| `rampant_smoke_stack_override` | Smokestack pollution multiplier under `rampant_mode`; the Industrial Smokestack uses half. Without rampant mode they use 0.25 and 0.1. Default `0.4`. | `[0, f64::MAX]` |
| `required_player_range` | Player distance in blocks that activates a spawner; default `16`. | `[1, i32::MAX]` |
| `scout_swarm_spawn_chance` | Scout chance parameter `n`; default `3`. | `[1, i32::MAX-1]` |
| `scout_threshold` | Minimum soot for spawner scouts; default `1`. | `[0, f64::MAX]` |
| `spawn_count` | Spawn attempts per cycle; `0` disables spawning; default `4`. | `[0, i32::MAX]` |
| `spawn_range` | Spawn offset and cap-box radius in blocks; default `4`. | `[0, i32::MAX]` |
| `targeting_threshold` | Soot at a glyphid's position at which glyphids other than scouts search for players within 128 blocks instead of 16; default `1`. | `[0, f64::MAX]` |

`rampant_mode` overrides other settings without changing their stored values:

- `rampant_natural_scout_spawn`, `rampant_extended_targetting`, `rampant_dig` and `rampant_glyphid_guidance` are on.
- `scout_threshold` is 0.1 and `scout_swarm_spawn_chance` is 1.
- A `bombardier_chance_min_soot` of 1 becomes 0.
- A [`pollution_mult`](https://movblock.mov/ntm-next/26.3/wiki/game-settings/radiation_config.md#hazards) of exactly 1 becomes 3, and `soot_fog_threshold` is multiplied by the effective pollution multiplier.
- Smokestacks use `rampant_smoke_stack_override`.

Example: `data/hbm/hbm/mob_config/glyphids.json`.

```json
{
  "behemoth_chance_base": -30,
  "behemoth_chance_min_soot": 10,
  "behemoth_chance_mod": 45,
  "blaster_chance_base": -5,
  "blaster_chance_min_soot": 5,
  "blaster_chance_mod": 40,
  "bombardier_chance_base": 20,
  "bombardier_chance_min_soot": 1,
  "bombardier_chance_mod": -15,
  "brawler_chance_base": 10,
  "brawler_chance_min_soot": 1,
  "brawler_chance_mod": 30,
  "brenda_chance_base": -50,
  "brenda_chance_min_soot": 20,
  "brenda_chance_mod": 60,
  "digger_chance_base": -15,
  "digger_chance_min_soot": 5,
  "digger_chance_mod": 25,
  "enabled": true,
  "failed_spawn_delay": 20,
  "glyphid_chance_base": 50,
  "glyphid_chance_min_soot": 0,
  "glyphid_chance_mod": -45,
  "hive_spawn": 256,
  "johnson_chance_base": -50,
  "johnson_chance_min_soot": 50,
  "johnson_chance_mod": 60,
  "max_nearby_entities": 6,
  "max_spawn_delay": 799,
  "min_spawn_delay": 200,
  "rampant_dig": false,
  "rampant_extended_targetting": false,
  "rampant_glyphid_guidance": false,
  "rampant_mode": false,
  "rampant_natural_scout_spawn": false,
  "rampant_scout_spawn_chance": 1400,
  "rampant_scout_spawn_thresh": 13,
  "rampant_smoke_stack_override": 0.4,
  "required_player_range": 16,
  "scout_swarm_spawn_chance": 3,
  "scout_threshold": 1,
  "spawn_count": 4,
  "spawn_range": 4,
  "targeting_threshold": 1
}
```
