help.lua -------- This script contains functions that are used both in the Tribal Encyclopedia and the Editor help. To get descriptions see: :attr:`wl.Descriptions`. .. code-block:: lua include "scripting/help.lua" .. function:: linkify_encyclopedia_object(descr) Return the localized name of the given unit description as a hyperlink pointing to its encyclopedia entry. :arg descr: The unit description to linkify. :returns: Richtext markup for the hyperlink. .. function:: tree_affinity_list(terrain_description) Returns list of trees that is most likely to grow on the given terrain, sorted in descending order by probability. :arg terrain_description: The terrain type that we want the information for. :type terrain_description: :class:`~wl.map.TerrainDescription` :returns: list of :class:`~wl.map.ImmovableDescription` that have the attribute "tree" and probabilities. .. function:: terrain_affinity_list(immovable_description) Returns list of terrains that the given immovable is most likely to grow on, sorted in descending order by probability. :arg immovable_description: The immovable type that we want the information for. :type immovable_description: :class:`~wl.map.ImmovableDescription` :returns: list of :class:`~wl.map.TerrainDescription` and probabilities. .. function:: terrain_affinity_help(immovable_description) Returns a formatted help string for the terrains that the given immovable is most likely to grow on. :arg immovable_description: The immovable type that we want the information for. :type immovable_description: :class:`~wl.map.ImmovableDescription` :returns: a richtext-formatted list of terrain images, terrain names and probabilities.