Kummitus

The **Ghost** (in-game name **Kummitus**) is a semi-rare flying creature that looks quite similar to the player, usually appearing either in the Mines, Coal Pits, or Snowy Depths.

## Behaviour

Kummitus will always spawns with a wand, which it drops on death. It may also deliberately drop the wand if there are no usable spells left. If not armed with a wand, it will attempt to kick the player, dealing moderate damage. It is hostile to **all** creatures, and this can be utilized to help destroy particularly bothersome enemies with some creative kiting. However, be aware the Kummitus has a tendency to swap targets to the player, if they are in its line of sight.

## Combat Tips

* It takes half damage from most projectiles, even less from melee attacks, and less again from fire. Slice, Ice, and Explosion damage tend to fare the best.
	+ Like most enemies with armor, damage from *slice* spells such as Summon Disc Projectile and Magic Arrow is **not** reduced.
* As with all enemies who can pick up wands, kicking the ghost will force it to drop its wand, effectively disarming it.
* As a ghostly enemy it is immune to stains, which includes Polymorphine. However, spell-based polymorphing effects can still apply.

## Spawning

Kummitus has a unique set of spawning conditions. As a blanket prerequisite, the player **must** have at least 35 deaths in runs where:

* No game-mods have been used, and
* The player is carrying at least one wand that is NOT just an unmodified starting wand - I.e. the 2 starting wands will not count, unless the spells on them are changed at some point

### Bones

Each death in this manner causes a *bones* file to generate in the player's persistent save data. Bones files are essentially just wand entity data, stored in individual XML files. When the player dies holding multiple wands, one of the valid wands will be picked at random to be stored in the bones collection.

### Triggers

Unlike most enemy spawn triggers, which use the same 3-4 pixel-based triggers in the biome terrain wang tiles to spawn random enemies, Kummitus has a separate spawn function that is tied to a very specific trigger which is used by nothing else. When this function is triggered, one of two things will occur:

* If the player does not have at least **35** bones files in their save data, Kummitus will not spawn, and instead 4 Wax candles will be placed around the spawn location. It is likely that there are also other conditions at play here, but it is not known exactly what they are. Some possible additional conditions may be:
	+ Whether the player has died in a previous run in the biome calling the spawn function or at similar depth
	+ A random probability based on the world seed and spawn coordinates
* If the bones spawn condition(s) are met, Kummitus will spawn with a seemingly random wand from the bones files, and a gravestone will be spawned alongside it.

### Spawn Locations

The following table lists which biomes Kummitus can and cannot currently spawn in, as well as the number of spawn locations currently in the wang tiles for the corresponding biome. The precise probability of Kummitus spawning is unknown, but in general the more possible spawn locations for a given biome, and the larger the biome region, the more likely it is that Kummitus will be seen in that biome.

## Trivia

* Kummitus acts as the ghost of the player from a previous failed run, and it carries one of the wands the player was using at that point. Internally, this entity is named `playerghost`.
* While most enemies spawn with full HP, Kummitus spawns with only 250 ♥ of its 1250 ♥ total health. As a result, it drops more gold than a normal enemy with 250 health would drop. A side effect of this is that a Kummitus can spawn with a healing spell on its wand, allowing it to heal itself past its initial health.

## Notes

1. ↑ Bones are stored in the `persistent/bones_new` folder in the player's `save00` folder.
2. ↑ This information was mined out of the wang tile data using this PowerShell script, and may change in future updates.
3. ↑ The Underground Jungle is technically split into two similar biomes, with one generating more roomy areas. Both sub-biomes have 6 spawn locations each, but keep in mind that the total area of the Underground Jungle is roughly half normal Jungle, and half "roomy" Jungle, so the additional spawn locations here are mostly a function of how the biome is implemented as a whole.
4. ↑ 4,0 4,1 The repeating biomes known as **The Work** have **6** Kummitus spawn triggers in their wang tile files, but explicitly override the `spawn_apparition()` function in their biome script with a no-op function. This prevents Kummitus from ever spawning in these areas.