From 7e584df0406d1d5f9074e4ab8a504b221ff66e21 Mon Sep 17 00:00:00 2001 From: Kelly Kinkade Date: Fri, 17 Feb 2023 12:10:23 -0600 Subject: [PATCH] misc tailor updates related to adamantine cloth --- docs/plugins/tailor.rst | 15 ++++++++++++++- plugins/lua/tailor.lua | 3 ++- plugins/tailor.cpp | 3 +++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/docs/plugins/tailor.rst b/docs/plugins/tailor.rst index 0e8980948..7396102f8 100644 --- a/docs/plugins/tailor.rst +++ b/docs/plugins/tailor.rst @@ -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. diff --git a/plugins/lua/tailor.lua b/plugins/lua/tailor.lua index bcfd8bc10..e9a88bfe1 100644 --- a/plugins/lua/tailor.lua +++ b/plugins/lua/tailor.lua @@ -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(...) diff --git a/plugins/tailor.cpp b/plugins/tailor.cpp index f0f2c0b68..a50af1939 100644 --- a/plugins/tailor.cpp +++ b/plugins/tailor.cpp @@ -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(); }