kts.PoisonImmunity

Name

kts.PoisonImmunity – give the current actor Poison Immunity

Synopsis

kts.PoisonImmunity(duration, message)

Description

If the current actor (as given by cxt.actor) is a knight, then that knight gains the Poison Immunity magical effect, for the next duration milliseconds. The string message will also flash on screen above the knight a number of times.

If the knight already has Poison Immunity, then the existing Poison Immunity timer is cancelled and replaced with the new one.

If the current actor is not a knight then nothing happens.

Return Value

None.

Notes

Poison Immunity gives the knight immunity to both Poison and Paralyzation.

The duration (first argument to kts.PoisonImmunity) is usually set to some kind of random number, to provide some unpredictability for the players. The duration value is not made visible to the player.

Examples

To give a knight Poison Immunity for a random number of seconds between 1 and 60:

kts.PoisonImmunity(kts.RandomRange(1, 60) * 1000, "Poison Immunity")

The actual game code uses a slightly more complicated method for determining the duration of potion effects; details can be found in magic.lua.

See Also

The cxt table

kts.Invisibility

kts.Invulnerability

kts.Paralyzation

kts.Quickness

kts.Regeneration

kts.Strength

kts.Super