kts.SetZombieActivity – set zombie activity level
kts.SetZombieActivity(probability, zombie_table)
Zombie activity is a process by which tiles are slowly transformed into other tiles and eventually into monsters. For example, corpse tiles may be transformed into varying stages of decay and eventually into zombies.
The zombie_table
argument to kts.SetZombieActivity
sets which tiles are affected. The zombie_table
is a list of entries. Each entry is itself a list of either two Tiles (a "from" tile and a "to" tile), or a "from" Tile and a MonsterType.
On each round of zombie activity, the game searches a small number of randomly selected dungeon squares. If any of the squares contains one of the "from" tiles listed in the zombie_table
, then a random number between 0 and 1 is "rolled"; if this is less than or equal to the probability
value that was passed to kts.SetZombieActivity
, then the tile is transformed either into the corresponding "to" tile, or into a new monster of the corresponding MonsterType, as applicable. Otherwise, nothing happens.
Therefore, it can be seen that setting higher probability
values makes the zombie activity faster. Note that the default Knights Lua files set the probability to be 0.04 times the square of the "Zombie Activity" level selected in the menu (therefore, the probability ranges from 0.04 at a Zombie Activity level of 1, to 1.0 at a Zombie Activity level of 5).
No value is returned.
Errors could result if the zombie_table
is in the wrong format or if the probability
is not a number.
Note that while "FullZombieActivity" is in effect (see kts.FullZombieActivity and kts.NormalZombieActivity), the zombie activity probability
is always automatically set to 1 (the highest possible value), and the probability
value passed to kts.SetZombieActivity
is ignored. (The "FullZombieActivity" mode is usually set by script functions associated with the Necronomicon book, although it could theoretically be set by mods as well.)