misc tailor updates related to adamantine cloth

develop
Kelly Kinkade 2023-02-17 12:10:23 -06:00
parent f6df3ff335
commit 7e584df040
3 changed files with 19 additions and 2 deletions

@ -30,7 +30,11 @@ By default, ``tailor`` will prefer using materials in this order::
silk cloth yarn leather
but you can use the ``tailor materials`` command to restrict which materials
are used, and in what order.
are used, and in what order. ``tailor`` supports adamantine cloth (using the
keyword ``adamantine``) but does not use it by default, as most players find
adamantine too precious to routinely make into cloth. ``tailor`` does not
support modded "cloth" types which utilize custom reactions to making clothing
out of those cloth types.
Examples
--------
@ -46,3 +50,12 @@ Examples
Restrict the materials used for automatically manufacturing clothing to
silk, cloth, and yarn, preferred in that order. This saves leather for
other uses, like making armor.
Note
----
The reason for the limitation on modded cloth-like materials is
because custom reactions do not support the in-game mechanic
which allows a manager order to specify a different size for clothing items.
This mechanic only works for reactions that use the default make-clothing or
make-armor reactions, and is a limitation of the game itself.

@ -28,7 +28,8 @@ function setMaterials(names)
idxs.silk or -1,
idxs.cloth or -1,
idxs.yarn or -1,
idxs.leather or -1)
idxs.leather or -1,
idxs.adamantine or -1)
end
function parse_commandline(...)

@ -585,6 +585,8 @@ static void set_material_order() {
material_order.push_back(M_YARN);
else if (i == (size_t)get_config_val(config, CONFIG_LEATHER_IDX))
material_order.push_back(M_LEATHER);
else if (i == (size_t)get_config_val(config, CONFIG_ADAMANTINE_IDX))
material_order.push_back(M_ADAMANTINE);
}
if (!material_order.size())
std::copy(all_materials.begin(), all_materials.end(), std::back_inserter(material_order));
@ -710,6 +712,7 @@ static void tailor_setMaterialPreferences(color_ostream &out, int32_t silkIdx,
set_config_val(config, CONFIG_CLOTH_IDX, clothIdx - 1);
set_config_val(config, CONFIG_YARN_IDX, yarnIdx - 1);
set_config_val(config, CONFIG_LEATHER_IDX, leatherIdx - 1);
set_config_val(config, CONFIG_ADAMANTINE_IDX, leatherIdx - 1);
set_material_order();
}